@tiflis-io/tiflis-code-web 0.1.2 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,420 @@
1
+ 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]);
2
+ var FT=Object.defineProperty;var HT=(e,r,n)=>r in e?FT(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n;var _e=(e,r,n)=>HT(e,typeof r!="symbol"?r+"":r,n);function Ab(e,r){for(var n=0;n<r.length;n++){const s=r[n];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in e)){const u=Object.getOwnPropertyDescriptor(s,o);u&&Object.defineProperty(e,o,u.get?u:{enumerable:!0,get:()=>s[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&s(f)}).observe(document,{childList:!0,subtree:!0});function n(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function s(o){if(o.ep)return;o.ep=!0;const u=n(o);fetch(o.href,u)}})();function Dg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tm={exports:{}},Vl={};/**
3
+ * @license React
4
+ * react-jsx-runtime.production.js
5
+ *
6
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */var B0;function VT(){if(B0)return Vl;B0=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function n(s,o,u){var f=null;if(u!==void 0&&(f=""+u),o.key!==void 0&&(f=""+o.key),"key"in o){u={};for(var l in o)l!=="key"&&(u[l]=o[l])}else u=o;return o=u.ref,{$$typeof:e,type:s,key:f,ref:o!==void 0?o:null,props:u}}return Vl.Fragment=r,Vl.jsx=n,Vl.jsxs=n,Vl}var N0;function qT(){return N0||(N0=1,tm.exports=VT()),tm.exports}var b=qT(),rm={exports:{}},He={};/**
11
+ * @license React
12
+ * react.production.js
13
+ *
14
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
15
+ *
16
+ * This source code is licensed under the MIT license found in the
17
+ * LICENSE file in the root directory of this source tree.
18
+ */var I0;function GT(){if(I0)return He;I0=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),f=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),y=Symbol.iterator;function x(j){return j===null||typeof j!="object"?null:(j=y&&j[y]||j["@@iterator"],typeof j=="function"?j:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,v={};function S(j,q,ne){this.props=j,this.context=q,this.refs=v,this.updater=ne||A}S.prototype.isReactComponent={},S.prototype.setState=function(j,q){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,q,"setState")},S.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function g(){}g.prototype=S.prototype;function _(j,q,ne){this.props=j,this.context=q,this.refs=v,this.updater=ne||A}var T=_.prototype=new g;T.constructor=_,w(T,S.prototype),T.isPureReactComponent=!0;var M=Array.isArray;function k(){}var L={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function P(j,q,ne){var Z=ne.ref;return{$$typeof:e,type:j,key:q,ref:Z!==void 0?Z:null,props:ne}}function K(j,q){return P(j.type,q,j.props)}function $(j){return typeof j=="object"&&j!==null&&j.$$typeof===e}function z(j){var q={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(ne){return q[ne]})}var W=/\/+/g;function F(j,q){return typeof j=="object"&&j!==null&&j.key!=null?z(""+j.key):q.toString(36)}function ee(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(k,k):(j.status="pending",j.then(function(q){j.status==="pending"&&(j.status="fulfilled",j.value=q)},function(q){j.status==="pending"&&(j.status="rejected",j.reason=q)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function Y(j,q,ne,Z,be){var fe=typeof j;(fe==="undefined"||fe==="boolean")&&(j=null);var Q=!1;if(j===null)Q=!0;else switch(fe){case"bigint":case"string":case"number":Q=!0;break;case"object":switch(j.$$typeof){case e:case r:Q=!0;break;case m:return Q=j._init,Y(Q(j._payload),q,ne,Z,be)}}if(Q)return be=be(j),Q=Z===""?"."+F(j,0):Z,M(be)?(ne="",Q!=null&&(ne=Q.replace(W,"$&/")+"/"),Y(be,q,ne,"",function(oe){return oe})):be!=null&&($(be)&&(be=K(be,ne+(be.key==null||j&&j.key===be.key?"":(""+be.key).replace(W,"$&/")+"/")+Q)),q.push(be)),1;Q=0;var U=Z===""?".":Z+":";if(M(j))for(var ue=0;ue<j.length;ue++)Z=j[ue],fe=U+F(Z,ue),Q+=Y(Z,q,ne,fe,be);else if(ue=x(j),typeof ue=="function")for(j=ue.call(j),ue=0;!(Z=j.next()).done;)Z=Z.value,fe=U+F(Z,ue++),Q+=Y(Z,q,ne,fe,be);else if(fe==="object"){if(typeof j.then=="function")return Y(ee(j),q,ne,Z,be);throw q=String(j),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return Q}function re(j,q,ne){if(j==null)return j;var Z=[],be=0;return Y(j,Z,"","",function(fe){return q.call(ne,fe,be++)}),Z}function te(j){if(j._status===-1){var q=j._result;q=q(),q.then(function(ne){(j._status===0||j._status===-1)&&(j._status=1,j._result=ne)},function(ne){(j._status===0||j._status===-1)&&(j._status=2,j._result=ne)}),j._status===-1&&(j._status=0,j._result=q)}if(j._status===1)return j._result.default;throw j._result}var O=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)},G={map:re,forEach:function(j,q,ne){re(j,function(){q.apply(this,arguments)},ne)},count:function(j){var q=0;return re(j,function(){q++}),q},toArray:function(j){return re(j,function(q){return q})||[]},only:function(j){if(!$(j))throw Error("React.Children.only expected to receive a single React element child.");return j}};return He.Activity=p,He.Children=G,He.Component=S,He.Fragment=n,He.Profiler=o,He.PureComponent=_,He.StrictMode=s,He.Suspense=c,He.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,He.__COMPILER_RUNTIME={__proto__:null,c:function(j){return L.H.useMemoCache(j)}},He.cache=function(j){return function(){return j.apply(null,arguments)}},He.cacheSignal=function(){return null},He.cloneElement=function(j,q,ne){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var Z=w({},j.props),be=j.key;if(q!=null)for(fe in q.key!==void 0&&(be=""+q.key),q)!D.call(q,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&q.ref===void 0||(Z[fe]=q[fe]);var fe=arguments.length-2;if(fe===1)Z.children=ne;else if(1<fe){for(var Q=Array(fe),U=0;U<fe;U++)Q[U]=arguments[U+2];Z.children=Q}return P(j.type,be,Z)},He.createContext=function(j){return j={$$typeof:f,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:u,_context:j},j},He.createElement=function(j,q,ne){var Z,be={},fe=null;if(q!=null)for(Z in q.key!==void 0&&(fe=""+q.key),q)D.call(q,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(be[Z]=q[Z]);var Q=arguments.length-2;if(Q===1)be.children=ne;else if(1<Q){for(var U=Array(Q),ue=0;ue<Q;ue++)U[ue]=arguments[ue+2];be.children=U}if(j&&j.defaultProps)for(Z in Q=j.defaultProps,Q)be[Z]===void 0&&(be[Z]=Q[Z]);return P(j,fe,be)},He.createRef=function(){return{current:null}},He.forwardRef=function(j){return{$$typeof:l,render:j}},He.isValidElement=$,He.lazy=function(j){return{$$typeof:m,_payload:{_status:-1,_result:j},_init:te}},He.memo=function(j,q){return{$$typeof:h,type:j,compare:q===void 0?null:q}},He.startTransition=function(j){var q=L.T,ne={};L.T=ne;try{var Z=j(),be=L.S;be!==null&&be(ne,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(k,O)}catch(fe){O(fe)}finally{q!==null&&ne.types!==null&&(q.types=ne.types),L.T=q}},He.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},He.use=function(j){return L.H.use(j)},He.useActionState=function(j,q,ne){return L.H.useActionState(j,q,ne)},He.useCallback=function(j,q){return L.H.useCallback(j,q)},He.useContext=function(j){return L.H.useContext(j)},He.useDebugValue=function(){},He.useDeferredValue=function(j,q){return L.H.useDeferredValue(j,q)},He.useEffect=function(j,q){return L.H.useEffect(j,q)},He.useEffectEvent=function(j){return L.H.useEffectEvent(j)},He.useId=function(){return L.H.useId()},He.useImperativeHandle=function(j,q,ne){return L.H.useImperativeHandle(j,q,ne)},He.useInsertionEffect=function(j,q){return L.H.useInsertionEffect(j,q)},He.useLayoutEffect=function(j,q){return L.H.useLayoutEffect(j,q)},He.useMemo=function(j,q){return L.H.useMemo(j,q)},He.useOptimistic=function(j,q){return L.H.useOptimistic(j,q)},He.useReducer=function(j,q,ne){return L.H.useReducer(j,q,ne)},He.useRef=function(j){return L.H.useRef(j)},He.useState=function(j){return L.H.useState(j)},He.useSyncExternalStore=function(j,q,ne){return L.H.useSyncExternalStore(j,q,ne)},He.useTransition=function(){return L.H.useTransition()},He.version="19.2.1",He}var P0;function Mg(){return P0||(P0=1,rm.exports=GT()),rm.exports}var R=Mg();const nn=Dg(R),kg=Ab({__proto__:null,default:nn},[R]);var nm={exports:{}},ql={},im={exports:{}},sm={};/**
19
+ * @license React
20
+ * scheduler.production.js
21
+ *
22
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
23
+ *
24
+ * This source code is licensed under the MIT license found in the
25
+ * LICENSE file in the root directory of this source tree.
26
+ */var j0;function zT(){return j0||(j0=1,(function(e){function r(Y,re){var te=Y.length;Y.push(re);e:for(;0<te;){var O=te-1>>>1,G=Y[O];if(0<o(G,re))Y[O]=re,Y[te]=G,te=O;else break e}}function n(Y){return Y.length===0?null:Y[0]}function s(Y){if(Y.length===0)return null;var re=Y[0],te=Y.pop();if(te!==re){Y[0]=te;e:for(var O=0,G=Y.length,j=G>>>1;O<j;){var q=2*(O+1)-1,ne=Y[q],Z=q+1,be=Y[Z];if(0>o(ne,te))Z<G&&0>o(be,ne)?(Y[O]=be,Y[Z]=te,O=Z):(Y[O]=ne,Y[q]=te,O=q);else if(Z<G&&0>o(be,te))Y[O]=be,Y[Z]=te,O=Z;else break e}}return re}function o(Y,re){var te=Y.sortIndex-re.sortIndex;return te!==0?te:Y.id-re.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var f=Date,l=f.now();e.unstable_now=function(){return f.now()-l}}var c=[],h=[],m=1,p=null,y=3,x=!1,A=!1,w=!1,v=!1,S=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function T(Y){for(var re=n(h);re!==null;){if(re.callback===null)s(h);else if(re.startTime<=Y)s(h),re.sortIndex=re.expirationTime,r(c,re);else break;re=n(h)}}function M(Y){if(w=!1,T(Y),!A)if(n(c)!==null)A=!0,k||(k=!0,z());else{var re=n(h);re!==null&&ee(M,re.startTime-Y)}}var k=!1,L=-1,D=5,P=-1;function K(){return v?!0:!(e.unstable_now()-P<D)}function $(){if(v=!1,k){var Y=e.unstable_now();P=Y;var re=!0;try{e:{A=!1,w&&(w=!1,g(L),L=-1),x=!0;var te=y;try{t:{for(T(Y),p=n(c);p!==null&&!(p.expirationTime>Y&&K());){var O=p.callback;if(typeof O=="function"){p.callback=null,y=p.priorityLevel;var G=O(p.expirationTime<=Y);if(Y=e.unstable_now(),typeof G=="function"){p.callback=G,T(Y),re=!0;break t}p===n(c)&&s(c),T(Y)}else s(c);p=n(c)}if(p!==null)re=!0;else{var j=n(h);j!==null&&ee(M,j.startTime-Y),re=!1}}break e}finally{p=null,y=te,x=!1}re=void 0}}finally{re?z():k=!1}}}var z;if(typeof _=="function")z=function(){_($)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,F=W.port2;W.port1.onmessage=$,z=function(){F.postMessage(null)}}else z=function(){S($,0)};function ee(Y,re){L=S(function(){Y(e.unstable_now())},re)}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(Y){Y.callback=null},e.unstable_forceFrameRate=function(Y){0>Y||125<Y?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<Y?Math.floor(1e3/Y):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(Y){switch(y){case 1:case 2:case 3:var re=3;break;default:re=y}var te=y;y=re;try{return Y()}finally{y=te}},e.unstable_requestPaint=function(){v=!0},e.unstable_runWithPriority=function(Y,re){switch(Y){case 1:case 2:case 3:case 4:case 5:break;default:Y=3}var te=y;y=Y;try{return re()}finally{y=te}},e.unstable_scheduleCallback=function(Y,re,te){var O=e.unstable_now();switch(typeof te=="object"&&te!==null?(te=te.delay,te=typeof te=="number"&&0<te?O+te:O):te=O,Y){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=te+G,Y={id:m++,callback:re,priorityLevel:Y,startTime:te,expirationTime:G,sortIndex:-1},te>O?(Y.sortIndex=te,r(h,Y),n(c)===null&&Y===n(h)&&(w?(g(L),L=-1):w=!0,ee(M,te-O))):(Y.sortIndex=G,r(c,Y),A||x||(A=!0,k||(k=!0,z()))),Y},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(Y){var re=y;return function(){var te=y;y=re;try{return Y.apply(this,arguments)}finally{y=te}}}})(sm)),sm}var U0;function YT(){return U0||(U0=1,im.exports=zT()),im.exports}var om={exports:{}},hr={};/**
27
+ * @license React
28
+ * react-dom.production.js
29
+ *
30
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
31
+ *
32
+ * This source code is licensed under the MIT license found in the
33
+ * LICENSE file in the root directory of this source tree.
34
+ */var F0;function WT(){if(F0)return hr;F0=1;var e=Mg();function r(c){var h="https://react.dev/errors/"+c;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)h+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+c+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var s={d:{f:n,r:function(){throw Error(r(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(c,h,m){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:p==null?null:""+p,children:c,containerInfo:h,implementation:m}}var f=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(c,h){if(c==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return hr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,hr.createPortal=function(c,h){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(r(299));return u(c,h,null,m)},hr.flushSync=function(c){var h=f.T,m=s.p;try{if(f.T=null,s.p=2,c)return c()}finally{f.T=h,s.p=m,s.d.f()}},hr.preconnect=function(c,h){typeof c=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,s.d.C(c,h))},hr.prefetchDNS=function(c){typeof c=="string"&&s.d.D(c)},hr.preinit=function(c,h){if(typeof c=="string"&&h&&typeof h.as=="string"){var m=h.as,p=l(m,h.crossOrigin),y=typeof h.integrity=="string"?h.integrity:void 0,x=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;m==="style"?s.d.S(c,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:p,integrity:y,fetchPriority:x}):m==="script"&&s.d.X(c,{crossOrigin:p,integrity:y,fetchPriority:x,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},hr.preinitModule=function(c,h){if(typeof c=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var m=l(h.as,h.crossOrigin);s.d.M(c,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&s.d.M(c)},hr.preload=function(c,h){if(typeof c=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var m=h.as,p=l(m,h.crossOrigin);s.d.L(c,m,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},hr.preloadModule=function(c,h){if(typeof c=="string")if(h){var m=l(h.as,h.crossOrigin);s.d.m(c,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else s.d.m(c)},hr.requestFormReset=function(c){s.d.r(c)},hr.unstable_batchedUpdates=function(c,h){return c(h)},hr.useFormState=function(c,h,m){return f.H.useFormState(c,h,m)},hr.useFormStatus=function(){return f.H.useHostTransitionStatus()},hr.version="19.2.1",hr}var H0;function Tb(){if(H0)return om.exports;H0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),om.exports=WT(),om.exports}/**
35
+ * @license React
36
+ * react-dom-client.production.js
37
+ *
38
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
39
+ *
40
+ * This source code is licensed under the MIT license found in the
41
+ * LICENSE file in the root directory of this source tree.
42
+ */var V0;function KT(){if(V0)return ql;V0=1;var e=YT(),r=Mg(),n=Tb();function s(t){var i="https://react.dev/errors/"+t;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)i+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function u(t){var i=t,a=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(a=i.return),t=i.return;while(t)}return i.tag===3?a:null}function f(t){if(t.tag===13){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function l(t){if(t.tag===31){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function c(t){if(u(t)!==t)throw Error(s(188))}function h(t){var i=t.alternate;if(!i){if(i=u(t),i===null)throw Error(s(188));return i!==t?null:t}for(var a=t,d=i;;){var C=a.return;if(C===null)break;var E=C.alternate;if(E===null){if(d=C.return,d!==null){a=d;continue}break}if(C.child===E.child){for(E=C.child;E;){if(E===a)return c(C),t;if(E===d)return c(C),i;E=E.sibling}throw Error(s(188))}if(a.return!==d.return)a=C,d=E;else{for(var B=!1,H=C.child;H;){if(H===a){B=!0,a=C,d=E;break}if(H===d){B=!0,d=C,a=E;break}H=H.sibling}if(!B){for(H=E.child;H;){if(H===a){B=!0,a=E,d=C;break}if(H===d){B=!0,d=E,a=C;break}H=H.sibling}if(!B)throw Error(s(189))}}if(a.alternate!==d)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?t:i}function m(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t;for(t=t.child;t!==null;){if(i=m(t),i!==null)return i;t=t.sibling}return null}var p=Object.assign,y=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),g=Symbol.for("react.consumer"),_=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),$=Symbol.iterator;function z(t){return t===null||typeof t!="object"?null:(t=$&&t[$]||t["@@iterator"],typeof t=="function"?t:null)}var W=Symbol.for("react.client.reference");function F(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===W?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case w:return"Fragment";case S:return"Profiler";case v:return"StrictMode";case M:return"Suspense";case k:return"SuspenseList";case P:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case A:return"Portal";case _:return t.displayName||"Context";case g:return(t._context.displayName||"Context")+".Consumer";case T:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case L:return i=t.displayName||null,i!==null?i:F(t.type)||"Memo";case D:i=t._payload,t=t._init;try{return F(t(i))}catch{}}return null}var ee=Array.isArray,Y=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},O=[],G=-1;function j(t){return{current:t}}function q(t){0>G||(t.current=O[G],O[G]=null,G--)}function ne(t,i){G++,O[G]=t.current,t.current=i}var Z=j(null),be=j(null),fe=j(null),Q=j(null);function U(t,i){switch(ne(fe,i),ne(be,t),ne(Z,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?n0(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=n0(i),t=i0(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}q(Z),ne(Z,t)}function ue(){q(Z),q(be),q(fe)}function oe(t){t.memoizedState!==null&&ne(Q,t);var i=Z.current,a=i0(i,t.type);i!==a&&(ne(be,t),ne(Z,a))}function de(t){be.current===t&&(q(Z),q(be)),Q.current===t&&(q(Q),jl._currentValue=te)}var he,De;function Ie(t){if(he===void 0)try{throw Error()}catch(a){var i=a.stack.trim().match(/\n( *(at )?)/);he=i&&i[1]||"",De=-1<a.stack.indexOf(`
43
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
44
+ `+he+t+De}var Fe=!1;function je(t,i){if(!t||Fe)return"";Fe=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(i){var xe=function(){throw Error()};if(Object.defineProperty(xe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(Se){var ve=Se}Reflect.construct(t,[],xe)}else{try{xe.call()}catch(Se){ve=Se}t.call(xe.prototype)}}else{try{throw Error()}catch(Se){ve=Se}(xe=t())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(Se){if(Se&&ve&&typeof Se.stack=="string")return[Se.stack,ve.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var C=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");C&&C.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var E=d.DetermineComponentFrameRoot(),B=E[0],H=E[1];if(B&&H){var ie=B.split(`
45
+ `),me=H.split(`
46
+ `);for(C=d=0;d<ie.length&&!ie[d].includes("DetermineComponentFrameRoot");)d++;for(;C<me.length&&!me[C].includes("DetermineComponentFrameRoot");)C++;if(d===ie.length||C===me.length)for(d=ie.length-1,C=me.length-1;1<=d&&0<=C&&ie[d]!==me[C];)C--;for(;1<=d&&0<=C;d--,C--)if(ie[d]!==me[C]){if(d!==1||C!==1)do if(d--,C--,0>C||ie[d]!==me[C]){var Ce=`
47
+ `+ie[d].replace(" at new "," at ");return t.displayName&&Ce.includes("<anonymous>")&&(Ce=Ce.replace("<anonymous>",t.displayName)),Ce}while(1<=d&&0<=C);break}}}finally{Fe=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?Ie(a):""}function Oe(t,i){switch(t.tag){case 26:case 27:case 5:return Ie(t.type);case 16:return Ie("Lazy");case 13:return t.child!==i&&i!==null?Ie("Suspense Fallback"):Ie("Suspense");case 19:return Ie("SuspenseList");case 0:case 15:return je(t.type,!1);case 11:return je(t.type.render,!1);case 1:return je(t.type,!0);case 31:return Ie("Activity");default:return""}}function Lt(t){try{var i="",a=null;do i+=Oe(t,a),a=t,t=t.return;while(t);return i}catch(d){return`
48
+ Error generating stack: `+d.message+`
49
+ `+d.stack}}var Tt=Object.prototype.hasOwnProperty,Vt=e.unstable_scheduleCallback,Rt=e.unstable_cancelCallback,bn=e.unstable_shouldYield,Xt=e.unstable_requestPaint,Ot=e.unstable_now,lr=e.unstable_getCurrentPriorityLevel,Yr=e.unstable_ImmediatePriority,Cn=e.unstable_UserBlockingPriority,mr=e.unstable_NormalPriority,un=e.unstable_LowPriority,gr=e.unstable_IdlePriority,Br=e.log,at=e.unstable_setDisableYieldValue,vr=null,er=null;function wn(t){if(typeof Br=="function"&&at(t),er&&typeof er.setStrictMode=="function")try{er.setStrictMode(vr,t)}catch{}}var tr=Math.clz32?Math.clz32:Uh,Yn=Math.log,jh=Math.LN2;function Uh(t){return t>>>=0,t===0?32:31-(Yn(t)/jh|0)|0}var qt=256,xn=262144,nt=4194304;function Wn(t){var i=t&42;if(i!==0)return i;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function _r(t,i,a){var d=t.pendingLanes;if(d===0)return 0;var C=0,E=t.suspendedLanes,B=t.pingedLanes;t=t.warmLanes;var H=d&134217727;return H!==0?(d=H&~E,d!==0?C=Wn(d):(B&=H,B!==0?C=Wn(B):a||(a=H&~t,a!==0&&(C=Wn(a))))):(H=d&~E,H!==0?C=Wn(H):B!==0?C=Wn(B):a||(a=d&~t,a!==0&&(C=Wn(a)))),C===0?0:i!==0&&i!==C&&(i&E)===0&&(E=C&-C,a=i&-i,E>=a||E===32&&(a&4194048)!==0)?i:C}function Cs(t,i){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&i)===0}function Fh(t,i){switch(t){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 po(){var t=nt;return nt<<=1,(nt&62914560)===0&&(nt=4194304),t}function ws(t){for(var i=[],a=0;31>a;a++)i.push(t);return i}function Ri(t,i){t.pendingLanes|=i,i!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Hh(t,i,a,d,C,E){var B=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var H=t.entanglements,ie=t.expirationTimes,me=t.hiddenUpdates;for(a=B&~a;0<a;){var Ce=31-tr(a),xe=1<<Ce;H[Ce]=0,ie[Ce]=-1;var ve=me[Ce];if(ve!==null)for(me[Ce]=null,Ce=0;Ce<ve.length;Ce++){var Se=ve[Ce];Se!==null&&(Se.lane&=-536870913)}a&=~xe}d!==0&&Ba(t,d,0),E!==0&&C===0&&t.tag!==0&&(t.suspendedLanes|=E&~(B&~i))}function Ba(t,i,a){t.pendingLanes|=i,t.suspendedLanes&=~i;var d=31-tr(i);t.entangledLanes|=i,t.entanglements[d]=t.entanglements[d]|1073741824|a&261930}function Di(t,i){var a=t.entangledLanes|=i;for(t=t.entanglements;a;){var d=31-tr(a),C=1<<d;C&i|t[d]&i&&(t[d]|=i),a&=~C}}function Ic(t,i){var a=i&-i;return a=(a&42)!==0?1:Mi(a),(a&(t.suspendedLanes|i))!==0?0:a}function Mi(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function xs(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Na(){var t=re.p;return t!==0?t:(t=window.event,t===void 0?32:T0(t.type))}function Ia(t,i){var a=re.p;try{return re.p=t,i()}finally{re.p=a}}var dn=Math.random().toString(36).slice(2),Qt="__reactFiber$"+dn,cr="__reactProps$"+dn,ki="__reactContainer$"+dn,Pa="__reactEvents$"+dn,ja="__reactListeners$"+dn,Ua="__reactHandles$"+dn,Pc="__reactResources$"+dn,Es="__reactMarker$"+dn;function Fa(t){delete t[Qt],delete t[cr],delete t[Pa],delete t[ja],delete t[Ua]}function Kn(t){var i=t[Qt];if(i)return i;for(var a=t.parentNode;a;){if(i=a[ki]||a[Qt]){if(a=i.alternate,i.child!==null||a!==null&&a.child!==null)for(t=d0(t);t!==null;){if(a=t[Qt])return a;t=d0(t)}return i}t=a,a=t.parentNode}return null}function Li(t){if(t=t[Qt]||t[ki]){var i=t.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return t}return null}function As(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t.stateNode;throw Error(s(33))}function Oi(t){var i=t[Pc];return i||(i=t[Pc]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Bt(t){t[Es]=!0}var jc=new Set,Uc={};function Wr(t,i){Qn(t,i),Qn(t+"Capture",i)}function Qn(t,i){for(Uc[t]=i,t=0;t<i.length;t++)jc.add(i[t])}var En=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]*$"),Fc={},Ha={};function Ze(t){return Tt.call(Ha,t)?!0:Tt.call(Fc,t)?!1:En.test(t)?Ha[t]=!0:(Fc[t]=!0,!1)}function mo(t,i,a){if(Ze(i))if(a===null)t.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(i);return;case"boolean":var d=i.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){t.removeAttribute(i);return}}t.setAttribute(i,""+a)}}function go(t,i,a){if(a===null)t.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttribute(i,""+a)}}function Ut(t,i,a,d){if(d===null)t.removeAttribute(a);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(i,a,""+d)}}function wr(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Va(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function vo(t,i,a){var d=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);if(!t.hasOwnProperty(i)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var C=d.get,E=d.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return C.call(this)},set:function(B){a=""+B,E.call(this,B)}}),Object.defineProperty(t,i,{enumerable:d.enumerable}),{getValue:function(){return a},setValue:function(B){a=""+B},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function qa(t){if(!t._valueTracker){var i=Va(t)?"checked":"value";t._valueTracker=vo(t,i,""+t[i])}}function _o(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var a=i.getValue(),d="";return t&&(d=Va(t)?t.checked?"true":"false":t.value),t=d,t!==a?(i.setValue(t),!0):!1}function yo(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Ga=/[\n"\\]/g;function xr(t){return t.replace(Ga,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function So(t,i,a,d,C,E,B,H){t.name="",B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?t.type=B:t.removeAttribute("type"),i!=null?B==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+wr(i)):t.value!==""+wr(i)&&(t.value=""+wr(i)):B!=="submit"&&B!=="reset"||t.removeAttribute("value"),i!=null?bo(t,B,wr(i)):a!=null?bo(t,B,wr(a)):d!=null&&t.removeAttribute("value"),C==null&&E!=null&&(t.defaultChecked=!!E),C!=null&&(t.checked=C&&typeof C!="function"&&typeof C!="symbol"),H!=null&&typeof H!="function"&&typeof H!="symbol"&&typeof H!="boolean"?t.name=""+wr(H):t.removeAttribute("name")}function Hc(t,i,a,d,C,E,B,H){if(E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(t.type=E),i!=null||a!=null){if(!(E!=="submit"&&E!=="reset"||i!=null)){qa(t);return}a=a!=null?""+wr(a):"",i=i!=null?""+wr(i):a,H||i===t.value||(t.value=i),t.defaultValue=i}d=d??C,d=typeof d!="function"&&typeof d!="symbol"&&!!d,t.checked=H?t.checked:!!d,t.defaultChecked=!!d,B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"&&(t.name=B),qa(t)}function bo(t,i,a){i==="number"&&yo(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function Er(t,i,a,d){if(t=t.options,i){i={};for(var C=0;C<a.length;C++)i["$"+a[C]]=!0;for(a=0;a<t.length;a++)C=i.hasOwnProperty("$"+t[a].value),t[a].selected!==C&&(t[a].selected=C),C&&d&&(t[a].defaultSelected=!0)}else{for(a=""+wr(a),i=null,C=0;C<t.length;C++){if(t[C].value===a){t[C].selected=!0,d&&(t[C].defaultSelected=!0);return}i!==null||t[C].disabled||(i=t[C])}i!==null&&(i.selected=!0)}}function Co(t,i,a){if(i!=null&&(i=""+wr(i),i!==t.value&&(t.value=i),a==null)){t.defaultValue!==i&&(t.defaultValue=i);return}t.defaultValue=a!=null?""+wr(a):""}function Nr(t,i,a,d){if(i==null){if(d!=null){if(a!=null)throw Error(s(92));if(ee(d)){if(1<d.length)throw Error(s(93));d=d[0]}a=d}a==null&&(a=""),i=a}a=wr(i),t.defaultValue=a,d=t.textContent,d===a&&d!==""&&d!==null&&(t.value=d),qa(t)}function $n(t,i){if(i){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=i;return}}t.textContent=i}var Vh=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 Vc(t,i,a){var d=i.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?d?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="":d?t.setProperty(i,a):typeof a!="number"||a===0||Vh.has(i)?i==="float"?t.cssFloat=a:t[i]=(""+a).trim():t[i]=a+"px"}function qc(t,i,a){if(i!=null&&typeof i!="object")throw Error(s(62));if(t=t.style,a!=null){for(var d in a)!a.hasOwnProperty(d)||i!=null&&i.hasOwnProperty(d)||(d.indexOf("--")===0?t.setProperty(d,""):d==="float"?t.cssFloat="":t[d]="");for(var C in i)d=i[C],i.hasOwnProperty(C)&&a[C]!==d&&Vc(t,C,d)}else for(var E in i)i.hasOwnProperty(E)&&Vc(t,E,i[E])}function za(t){if(t.indexOf("-")===-1)return!1;switch(t){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 qh=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"]]),Gh=/^[\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 wo(t){return Gh.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function hn(){}var Ya=null;function Wa(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ir=null,Jn=null;function Ka(t){var i=Li(t);if(i&&(t=i.stateNode)){var a=t[cr]||null;e:switch(t=i.stateNode,i.type){case"input":if(So(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),i=a.name,a.type==="radio"&&i!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+xr(""+i)+'"][type="radio"]'),i=0;i<a.length;i++){var d=a[i];if(d!==t&&d.form===t.form){var C=d[cr]||null;if(!C)throw Error(s(90));So(d,C.value,C.defaultValue,C.defaultValue,C.checked,C.defaultChecked,C.type,C.name)}}for(i=0;i<a.length;i++)d=a[i],d.form===t.form&&_o(d)}break e;case"textarea":Co(t,a.value,a.defaultValue);break e;case"select":i=a.value,i!=null&&Er(t,!!a.multiple,i,!1)}}}var xo=!1;function Qa(t,i,a){if(xo)return t(i,a);xo=!0;try{var d=t(i);return d}finally{if(xo=!1,(Ir!==null||Jn!==null)&&(qu(),Ir&&(i=Ir,t=Jn,Jn=Ir=null,Ka(i),t)))for(i=0;i<t.length;i++)Ka(t[i])}}function Ts(t,i){var a=t.stateNode;if(a===null)return null;var d=a[cr]||null;if(d===null)return null;a=d[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(t=t.type,d=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!d;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(s(231,i,typeof a));return a}var fn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Eo=!1;if(fn)try{var Rs={};Object.defineProperty(Rs,"passive",{get:function(){Eo=!0}}),window.addEventListener("test",Rs,Rs),window.removeEventListener("test",Rs,Rs)}catch{Eo=!1}var An=null,$a=null,Ao=null;function Gc(){if(Ao)return Ao;var t,i=$a,a=i.length,d,C="value"in An?An.value:An.textContent,E=C.length;for(t=0;t<a&&i[t]===C[t];t++);var B=a-t;for(d=1;d<=B&&i[a-d]===C[E-d];d++);return Ao=C.slice(t,1<d?1-d:void 0)}function To(t){var i=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&i===13&&(t=13)):t=i,t===10&&(t=13),32<=t||t===13?t:0}function Ro(){return!0}function zc(){return!1}function ur(t){function i(a,d,C,E,B){this._reactName=a,this._targetInst=C,this.type=d,this.nativeEvent=E,this.target=B,this.currentTarget=null;for(var H in t)t.hasOwnProperty(H)&&(a=t[H],this[H]=a?a(E):E[H]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?Ro:zc,this.isPropagationStopped=zc,this}return p(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Ro)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Ro)},persist:function(){},isPersistent:Ro}),i}var Zn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bi=ur(Zn),Ds=p({},Zn,{view:0,detail:0}),zh=ur(Ds),Ja,Za,Ms,ks=p({},Ds,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:el,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Ms&&(Ms&&t.type==="mousemove"?(Ja=t.screenX-Ms.screenX,Za=t.screenY-Ms.screenY):Za=Ja=0,Ms=t),Ja)},movementY:function(t){return"movementY"in t?t.movementY:Za}}),Yc=ur(ks),Yh=p({},ks,{dataTransfer:0}),Wh=ur(Yh),Kh=p({},Ds,{relatedTarget:0}),Xa=ur(Kh),Qh=p({},Zn,{animationName:0,elapsedTime:0,pseudoElement:0}),$h=ur(Qh),Jh=p({},Zn,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Zh=ur(Jh),Xh=p({},Zn,{data:0}),Do=ur(Xh),ef={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ls={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"},tf={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function rf(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=tf[t])?!!i[t]:!1}function el(){return rf}var nf=p({},Ds,{key:function(t){if(t.key){var i=ef[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=To(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Ls[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:el,charCode:function(t){return t.type==="keypress"?To(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?To(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),sf=ur(nf),of=p({},ks,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Wc=ur(of),af=p({},Ds,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:el}),Kc=ur(af),Tn=p({},Zn,{propertyName:0,elapsedTime:0,pseudoElement:0}),tl=ur(Tn),Qc=p({},ks,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Qe=ur(Qc),$c=p({},Zn,{newState:0,oldState:0}),Jc=ur($c),Zc=[9,13,27,32],Mo=fn&&"CompositionEvent"in window,Ni=null;fn&&"documentMode"in document&&(Ni=document.documentMode);var Xc=fn&&"TextEvent"in window&&!Ni,rl=fn&&(!Mo||Ni&&8<Ni&&11>=Ni),nl=" ",Os=!1;function il(t,i){switch(t){case"keyup":return Zc.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function eu(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ii=!1;function lf(t,i){switch(t){case"compositionend":return eu(i);case"keypress":return i.which!==32?null:(Os=!0,nl);case"textInput":return t=i.data,t===nl&&Os?null:t;default:return null}}function cf(t,i){if(Ii)return t==="compositionend"||!Mo&&il(t,i)?(t=Gc(),Ao=$a=An=null,Ii=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return rl&&i.locale!=="ko"?null:i.data;default:return null}}var uf={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 tu(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!uf[t.type]:i==="textarea"}function ru(t,i,a,d){Ir?Jn?Jn.push(d):Jn=[d]:Ir=d,i=$u(i,"onChange"),0<i.length&&(a=new Bi("onChange","change",null,a,d),t.push({event:a,listeners:i}))}var Bs=null,Ns=null;function df(t){Jy(t,0)}function ko(t){var i=As(t);if(_o(i))return t}function nu(t,i){if(t==="change")return i}var iu=!1;if(fn){var sl;if(fn){var ol="oninput"in document;if(!ol){var su=document.createElement("div");su.setAttribute("oninput","return;"),ol=typeof su.oninput=="function"}sl=ol}else sl=!1;iu=sl&&(!document.documentMode||9<document.documentMode)}function ou(){Bs&&(Bs.detachEvent("onpropertychange",au),Ns=Bs=null)}function au(t){if(t.propertyName==="value"&&ko(Ns)){var i=[];ru(i,Ns,t,Wa(t)),Qa(df,i)}}function hf(t,i,a){t==="focusin"?(ou(),Bs=i,Ns=a,Bs.attachEvent("onpropertychange",au)):t==="focusout"&&ou()}function ff(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return ko(Ns)}function pf(t,i){if(t==="click")return ko(i)}function mf(t,i){if(t==="input"||t==="change")return ko(i)}function gf(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var yr=typeof Object.is=="function"?Object.is:gf;function Is(t,i){if(yr(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;var a=Object.keys(t),d=Object.keys(i);if(a.length!==d.length)return!1;for(d=0;d<a.length;d++){var C=a[d];if(!Tt.call(i,C)||!yr(t[C],i[C]))return!1}return!0}function lu(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function cu(t,i){var a=lu(t);t=0;for(var d;a;){if(a.nodeType===3){if(d=t+a.textContent.length,t<=i&&d>=i)return{node:a,offset:i-t};t=d}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=lu(a)}}function uu(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?uu(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function du(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var i=yo(t.document);i instanceof t.HTMLIFrameElement;){try{var a=typeof i.contentWindow.location.href=="string"}catch{a=!1}if(a)t=i.contentWindow;else break;i=yo(t.document)}return i}function al(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i&&(i==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||i==="textarea"||t.contentEditable==="true")}var vf=fn&&"documentMode"in document&&11>=document.documentMode,Pi=null,ll=null,Ps=null,cl=!1;function hu(t,i,a){var d=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;cl||Pi==null||Pi!==yo(d)||(d=Pi,"selectionStart"in d&&al(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Ps&&Is(Ps,d)||(Ps=d,d=$u(ll,"onSelect"),0<d.length&&(i=new Bi("onSelect","select",null,i,a),t.push({event:i,listeners:d}),i.target=Pi)))}function Xn(t,i){var a={};return a[t.toLowerCase()]=i.toLowerCase(),a["Webkit"+t]="webkit"+i,a["Moz"+t]="moz"+i,a}var ji={animationend:Xn("Animation","AnimationEnd"),animationiteration:Xn("Animation","AnimationIteration"),animationstart:Xn("Animation","AnimationStart"),transitionrun:Xn("Transition","TransitionRun"),transitionstart:Xn("Transition","TransitionStart"),transitioncancel:Xn("Transition","TransitionCancel"),transitionend:Xn("Transition","TransitionEnd")},ei={},N={};fn&&(N=document.createElement("div").style,"AnimationEvent"in window||(delete ji.animationend.animation,delete ji.animationiteration.animation,delete ji.animationstart.animation),"TransitionEvent"in window||delete ji.transitionend.transition);function I(t){if(ei[t])return ei[t];if(!ji[t])return t;var i=ji[t],a;for(a in i)if(i.hasOwnProperty(a)&&a in N)return ei[t]=i[a];return t}var V=I("animationend"),X=I("animationiteration"),se=I("animationstart"),le=I("transitionrun"),ge=I("transitionstart"),ye=I("transitioncancel"),Ee=I("transitionend"),Re=new Map,Me="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(" ");Me.push("scrollEnd");function Ne(t,i){Re.set(t,i),Wr(i,[t])}var st=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},$e=[],vt=0,Ct=0;function pt(){for(var t=vt,i=Ct=vt=0;i<t;){var a=$e[i];$e[i++]=null;var d=$e[i];$e[i++]=null;var C=$e[i];$e[i++]=null;var E=$e[i];if($e[i++]=null,d!==null&&C!==null){var B=d.pending;B===null?C.next=C:(C.next=B.next,B.next=C),d.pending=C}E!==0&&Kr(a,C,E)}}function ht(t,i,a,d){$e[vt++]=t,$e[vt++]=i,$e[vt++]=a,$e[vt++]=d,Ct|=d,t.lanes|=d,t=t.alternate,t!==null&&(t.lanes|=d)}function pn(t,i,a,d){return ht(t,i,a,d),ti(t)}function Nt(t,i){return ht(t,null,null,i),ti(t)}function Kr(t,i,a){t.lanes|=a;var d=t.alternate;d!==null&&(d.lanes|=a);for(var C=!1,E=t.return;E!==null;)E.childLanes|=a,d=E.alternate,d!==null&&(d.childLanes|=a),E.tag===22&&(t=E.stateNode,t===null||t._visibility&1||(C=!0)),t=E,E=E.return;return t.tag===3?(E=t.stateNode,C&&i!==null&&(C=31-tr(a),t=E.hiddenUpdates,d=t[C],d===null?t[C]=[i]:d.push(i),i.lane=a|536870912),E):null}function ti(t){if(50<kl)throw kl=0,Ep=null,Error(s(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var Ui={};function fu(t,i,a,d){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function dr(t,i,a,d){return new fu(t,i,a,d)}function Lo(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Ar(t,i){var a=t.alternate;return a===null?(a=dr(t.tag,i,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=i,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,i=t.dependencies,a.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function js(t,i){t.flags&=65011714;var a=t.alternate;return a===null?(t.childLanes=0,t.lanes=i,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,i=a.dependencies,t.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),t}function Us(t,i,a,d,C,E){var B=0;if(d=t,typeof t=="function")Lo(t)&&(B=1);else if(typeof t=="string")B=RT(t,a,Z.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case P:return t=dr(31,a,i,C),t.elementType=P,t.lanes=E,t;case w:return Fs(a.children,C,E,i);case v:B=8,C|=24;break;case S:return t=dr(12,a,i,C|2),t.elementType=S,t.lanes=E,t;case M:return t=dr(13,a,i,C),t.elementType=M,t.lanes=E,t;case k:return t=dr(19,a,i,C),t.elementType=k,t.lanes=E,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case _:B=10;break e;case g:B=9;break e;case T:B=11;break e;case L:B=14;break e;case D:B=16,d=null;break e}B=29,a=Error(s(130,t===null?"null":typeof t,"")),d=null}return i=dr(B,a,i,C),i.elementType=t,i.type=d,i.lanes=E,i}function Fs(t,i,a,d){return t=dr(7,t,d,i),t.lanes=a,t}function _f(t,i,a){return t=dr(6,t,null,i),t.lanes=a,t}function Bv(t){var i=dr(18,null,null,0);return i.stateNode=t,i}function yf(t,i,a){return i=dr(4,t.children!==null?t.children:[],t.key,i),i.lanes=a,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}var Nv=new WeakMap;function Qr(t,i){if(typeof t=="object"&&t!==null){var a=Nv.get(t);return a!==void 0?a:(i={value:t,source:i,stack:Lt(i)},Nv.set(t,i),i)}return{value:t,source:i,stack:Lt(i)}}var Oo=[],Bo=0,pu=null,ul=0,$r=[],Jr=0,Fi=null,Rn=1,Dn="";function ri(t,i){Oo[Bo++]=ul,Oo[Bo++]=pu,pu=t,ul=i}function Iv(t,i,a){$r[Jr++]=Rn,$r[Jr++]=Dn,$r[Jr++]=Fi,Fi=t;var d=Rn;t=Dn;var C=32-tr(d)-1;d&=~(1<<C),a+=1;var E=32-tr(i)+C;if(30<E){var B=C-C%5;E=(d&(1<<B)-1).toString(32),d>>=B,C-=B,Rn=1<<32-tr(i)+C|a<<C|d,Dn=E+t}else Rn=1<<E|a<<C|d,Dn=t}function Sf(t){t.return!==null&&(ri(t,1),Iv(t,1,0))}function bf(t){for(;t===pu;)pu=Oo[--Bo],Oo[Bo]=null,ul=Oo[--Bo],Oo[Bo]=null;for(;t===Fi;)Fi=$r[--Jr],$r[Jr]=null,Dn=$r[--Jr],$r[Jr]=null,Rn=$r[--Jr],$r[Jr]=null}function Pv(t,i){$r[Jr++]=Rn,$r[Jr++]=Dn,$r[Jr++]=Fi,Rn=i.id,Dn=i.overflow,Fi=t}var ir=null,xt=null,it=!1,Hi=null,Zr=!1,Cf=Error(s(519));function Vi(t){var i=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw dl(Qr(i,t)),Cf}function jv(t){var i=t.stateNode,a=t.type,d=t.memoizedProps;switch(i[Qt]=t,i[cr]=d,a){case"dialog":et("cancel",i),et("close",i);break;case"iframe":case"object":case"embed":et("load",i);break;case"video":case"audio":for(a=0;a<Ol.length;a++)et(Ol[a],i);break;case"source":et("error",i);break;case"img":case"image":case"link":et("error",i),et("load",i);break;case"details":et("toggle",i);break;case"input":et("invalid",i),Hc(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":et("invalid",i);break;case"textarea":et("invalid",i),Nr(i,d.value,d.defaultValue,d.children)}a=d.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||i.textContent===""+a||d.suppressHydrationWarning===!0||t0(i.textContent,a)?(d.popover!=null&&(et("beforetoggle",i),et("toggle",i)),d.onScroll!=null&&et("scroll",i),d.onScrollEnd!=null&&et("scrollend",i),d.onClick!=null&&(i.onclick=hn),i=!0):i=!1,i||Vi(t,!0)}function Uv(t){for(ir=t.return;ir;)switch(ir.tag){case 5:case 31:case 13:Zr=!1;return;case 27:case 3:Zr=!0;return;default:ir=ir.return}}function No(t){if(t!==ir)return!1;if(!it)return Uv(t),it=!0,!1;var i=t.tag,a;if((a=i!==3&&i!==27)&&((a=i===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||Fp(t.type,t.memoizedProps)),a=!a),a&&xt&&Vi(t),Uv(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));xt=u0(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));xt=u0(t)}else i===27?(i=xt,rs(t.type)?(t=zp,zp=null,xt=t):xt=i):xt=ir?en(t.stateNode.nextSibling):null;return!0}function Hs(){xt=ir=null,it=!1}function wf(){var t=Hi;return t!==null&&(Mr===null?Mr=t:Mr.push.apply(Mr,t),Hi=null),t}function dl(t){Hi===null?Hi=[t]:Hi.push(t)}var xf=j(null),Vs=null,ni=null;function qi(t,i,a){ne(xf,i._currentValue),i._currentValue=a}function ii(t){t._currentValue=xf.current,q(xf)}function Ef(t,i,a){for(;t!==null;){var d=t.alternate;if((t.childLanes&i)!==i?(t.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),t===a)break;t=t.return}}function Af(t,i,a,d){var C=t.child;for(C!==null&&(C.return=t);C!==null;){var E=C.dependencies;if(E!==null){var B=C.child;E=E.firstContext;e:for(;E!==null;){var H=E;E=C;for(var ie=0;ie<i.length;ie++)if(H.context===i[ie]){E.lanes|=a,H=E.alternate,H!==null&&(H.lanes|=a),Ef(E.return,a,t),d||(B=null);break e}E=H.next}}else if(C.tag===18){if(B=C.return,B===null)throw Error(s(341));B.lanes|=a,E=B.alternate,E!==null&&(E.lanes|=a),Ef(B,a,t),B=null}else B=C.child;if(B!==null)B.return=C;else for(B=C;B!==null;){if(B===t){B=null;break}if(C=B.sibling,C!==null){C.return=B.return,B=C;break}B=B.return}C=B}}function Io(t,i,a,d){t=null;for(var C=i,E=!1;C!==null;){if(!E){if((C.flags&524288)!==0)E=!0;else if((C.flags&262144)!==0)break}if(C.tag===10){var B=C.alternate;if(B===null)throw Error(s(387));if(B=B.memoizedProps,B!==null){var H=C.type;yr(C.pendingProps.value,B.value)||(t!==null?t.push(H):t=[H])}}else if(C===Q.current){if(B=C.alternate,B===null)throw Error(s(387));B.memoizedState.memoizedState!==C.memoizedState.memoizedState&&(t!==null?t.push(jl):t=[jl])}C=C.return}t!==null&&Af(i,t,a,d),i.flags|=262144}function mu(t){for(t=t.firstContext;t!==null;){if(!yr(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function qs(t){Vs=t,ni=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function sr(t){return Fv(Vs,t)}function gu(t,i){return Vs===null&&qs(t),Fv(t,i)}function Fv(t,i){var a=i._currentValue;if(i={context:i,memoizedValue:a,next:null},ni===null){if(t===null)throw Error(s(308));ni=i,t.dependencies={lanes:0,firstContext:i},t.flags|=524288}else ni=ni.next=i;return a}var xA=typeof AbortController<"u"?AbortController:function(){var t=[],i=this.signal={aborted:!1,addEventListener:function(a,d){t.push(d)}};this.abort=function(){i.aborted=!0,t.forEach(function(a){return a()})}},EA=e.unstable_scheduleCallback,AA=e.unstable_NormalPriority,Gt={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Tf(){return{controller:new xA,data:new Map,refCount:0}}function hl(t){t.refCount--,t.refCount===0&&EA(AA,function(){t.controller.abort()})}var fl=null,Rf=0,Po=0,jo=null;function TA(t,i){if(fl===null){var a=fl=[];Rf=0,Po=kp(),jo={status:"pending",value:void 0,then:function(d){a.push(d)}}}return Rf++,i.then(Hv,Hv),i}function Hv(){if(--Rf===0&&fl!==null){jo!==null&&(jo.status="fulfilled");var t=fl;fl=null,Po=0,jo=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function RA(t,i){var a=[],d={status:"pending",value:null,reason:null,then:function(C){a.push(C)}};return t.then(function(){d.status="fulfilled",d.value=i;for(var C=0;C<a.length;C++)(0,a[C])(i)},function(C){for(d.status="rejected",d.reason=C,C=0;C<a.length;C++)(0,a[C])(void 0)}),d}var Vv=Y.S;Y.S=function(t,i){Ey=Ot(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&TA(t,i),Vv!==null&&Vv(t,i)};var Gs=j(null);function Df(){var t=Gs.current;return t!==null?t:bt.pooledCache}function vu(t,i){i===null?ne(Gs,Gs.current):ne(Gs,i.pool)}function qv(){var t=Df();return t===null?null:{parent:Gt._currentValue,pool:t}}var Uo=Error(s(460)),Mf=Error(s(474)),_u=Error(s(542)),yu={then:function(){}};function Gv(t){return t=t.status,t==="fulfilled"||t==="rejected"}function zv(t,i,a){switch(a=t[a],a===void 0?t.push(i):a!==i&&(i.then(hn,hn),i=a),i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,Wv(t),t;default:if(typeof i.status=="string")i.then(hn,hn);else{if(t=bt,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=i,t.status="pending",t.then(function(d){if(i.status==="pending"){var C=i;C.status="fulfilled",C.value=d}},function(d){if(i.status==="pending"){var C=i;C.status="rejected",C.reason=d}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,Wv(t),t}throw Ys=i,Uo}}function zs(t){try{var i=t._init;return i(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Ys=a,Uo):a}}var Ys=null;function Yv(){if(Ys===null)throw Error(s(459));var t=Ys;return Ys=null,t}function Wv(t){if(t===Uo||t===_u)throw Error(s(483))}var Fo=null,pl=0;function Su(t){var i=pl;return pl+=1,Fo===null&&(Fo=[]),zv(Fo,t,i)}function ml(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function bu(t,i){throw i.$$typeof===y?Error(s(525)):(t=Object.prototype.toString.call(i),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t)))}function Kv(t){function i(ce,ae){if(t){var pe=ce.deletions;pe===null?(ce.deletions=[ae],ce.flags|=16):pe.push(ae)}}function a(ce,ae){if(!t)return null;for(;ae!==null;)i(ce,ae),ae=ae.sibling;return null}function d(ce){for(var ae=new Map;ce!==null;)ce.key!==null?ae.set(ce.key,ce):ae.set(ce.index,ce),ce=ce.sibling;return ae}function C(ce,ae){return ce=Ar(ce,ae),ce.index=0,ce.sibling=null,ce}function E(ce,ae,pe){return ce.index=pe,t?(pe=ce.alternate,pe!==null?(pe=pe.index,pe<ae?(ce.flags|=67108866,ae):pe):(ce.flags|=67108866,ae)):(ce.flags|=1048576,ae)}function B(ce){return t&&ce.alternate===null&&(ce.flags|=67108866),ce}function H(ce,ae,pe,we){return ae===null||ae.tag!==6?(ae=_f(pe,ce.mode,we),ae.return=ce,ae):(ae=C(ae,pe),ae.return=ce,ae)}function ie(ce,ae,pe,we){var Pe=pe.type;return Pe===w?Ce(ce,ae,pe.props.children,we,pe.key):ae!==null&&(ae.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===D&&zs(Pe)===ae.type)?(ae=C(ae,pe.props),ml(ae,pe),ae.return=ce,ae):(ae=Us(pe.type,pe.key,pe.props,null,ce.mode,we),ml(ae,pe),ae.return=ce,ae)}function me(ce,ae,pe,we){return ae===null||ae.tag!==4||ae.stateNode.containerInfo!==pe.containerInfo||ae.stateNode.implementation!==pe.implementation?(ae=yf(pe,ce.mode,we),ae.return=ce,ae):(ae=C(ae,pe.children||[]),ae.return=ce,ae)}function Ce(ce,ae,pe,we,Pe){return ae===null||ae.tag!==7?(ae=Fs(pe,ce.mode,we,Pe),ae.return=ce,ae):(ae=C(ae,pe),ae.return=ce,ae)}function xe(ce,ae,pe){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return ae=_f(""+ae,ce.mode,pe),ae.return=ce,ae;if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case x:return pe=Us(ae.type,ae.key,ae.props,null,ce.mode,pe),ml(pe,ae),pe.return=ce,pe;case A:return ae=yf(ae,ce.mode,pe),ae.return=ce,ae;case D:return ae=zs(ae),xe(ce,ae,pe)}if(ee(ae)||z(ae))return ae=Fs(ae,ce.mode,pe,null),ae.return=ce,ae;if(typeof ae.then=="function")return xe(ce,Su(ae),pe);if(ae.$$typeof===_)return xe(ce,gu(ce,ae),pe);bu(ce,ae)}return null}function ve(ce,ae,pe,we){var Pe=ae!==null?ae.key:null;if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return Pe!==null?null:H(ce,ae,""+pe,we);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case x:return pe.key===Pe?ie(ce,ae,pe,we):null;case A:return pe.key===Pe?me(ce,ae,pe,we):null;case D:return pe=zs(pe),ve(ce,ae,pe,we)}if(ee(pe)||z(pe))return Pe!==null?null:Ce(ce,ae,pe,we,null);if(typeof pe.then=="function")return ve(ce,ae,Su(pe),we);if(pe.$$typeof===_)return ve(ce,ae,gu(ce,pe),we);bu(ce,pe)}return null}function Se(ce,ae,pe,we,Pe){if(typeof we=="string"&&we!==""||typeof we=="number"||typeof we=="bigint")return ce=ce.get(pe)||null,H(ae,ce,""+we,Pe);if(typeof we=="object"&&we!==null){switch(we.$$typeof){case x:return ce=ce.get(we.key===null?pe:we.key)||null,ie(ae,ce,we,Pe);case A:return ce=ce.get(we.key===null?pe:we.key)||null,me(ae,ce,we,Pe);case D:return we=zs(we),Se(ce,ae,pe,we,Pe)}if(ee(we)||z(we))return ce=ce.get(pe)||null,Ce(ae,ce,we,Pe,null);if(typeof we.then=="function")return Se(ce,ae,pe,Su(we),Pe);if(we.$$typeof===_)return Se(ce,ae,pe,gu(ae,we),Pe);bu(ae,we)}return null}function ke(ce,ae,pe,we){for(var Pe=null,lt=null,Be=ae,Ye=ae=0,rt=null;Be!==null&&Ye<pe.length;Ye++){Be.index>Ye?(rt=Be,Be=null):rt=Be.sibling;var ct=ve(ce,Be,pe[Ye],we);if(ct===null){Be===null&&(Be=rt);break}t&&Be&&ct.alternate===null&&i(ce,Be),ae=E(ct,ae,Ye),lt===null?Pe=ct:lt.sibling=ct,lt=ct,Be=rt}if(Ye===pe.length)return a(ce,Be),it&&ri(ce,Ye),Pe;if(Be===null){for(;Ye<pe.length;Ye++)Be=xe(ce,pe[Ye],we),Be!==null&&(ae=E(Be,ae,Ye),lt===null?Pe=Be:lt.sibling=Be,lt=Be);return it&&ri(ce,Ye),Pe}for(Be=d(Be);Ye<pe.length;Ye++)rt=Se(Be,ce,Ye,pe[Ye],we),rt!==null&&(t&&rt.alternate!==null&&Be.delete(rt.key===null?Ye:rt.key),ae=E(rt,ae,Ye),lt===null?Pe=rt:lt.sibling=rt,lt=rt);return t&&Be.forEach(function(as){return i(ce,as)}),it&&ri(ce,Ye),Pe}function Ue(ce,ae,pe,we){if(pe==null)throw Error(s(151));for(var Pe=null,lt=null,Be=ae,Ye=ae=0,rt=null,ct=pe.next();Be!==null&&!ct.done;Ye++,ct=pe.next()){Be.index>Ye?(rt=Be,Be=null):rt=Be.sibling;var as=ve(ce,Be,ct.value,we);if(as===null){Be===null&&(Be=rt);break}t&&Be&&as.alternate===null&&i(ce,Be),ae=E(as,ae,Ye),lt===null?Pe=as:lt.sibling=as,lt=as,Be=rt}if(ct.done)return a(ce,Be),it&&ri(ce,Ye),Pe;if(Be===null){for(;!ct.done;Ye++,ct=pe.next())ct=xe(ce,ct.value,we),ct!==null&&(ae=E(ct,ae,Ye),lt===null?Pe=ct:lt.sibling=ct,lt=ct);return it&&ri(ce,Ye),Pe}for(Be=d(Be);!ct.done;Ye++,ct=pe.next())ct=Se(Be,ce,Ye,ct.value,we),ct!==null&&(t&&ct.alternate!==null&&Be.delete(ct.key===null?Ye:ct.key),ae=E(ct,ae,Ye),lt===null?Pe=ct:lt.sibling=ct,lt=ct);return t&&Be.forEach(function(UT){return i(ce,UT)}),it&&ri(ce,Ye),Pe}function St(ce,ae,pe,we){if(typeof pe=="object"&&pe!==null&&pe.type===w&&pe.key===null&&(pe=pe.props.children),typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case x:e:{for(var Pe=pe.key;ae!==null;){if(ae.key===Pe){if(Pe=pe.type,Pe===w){if(ae.tag===7){a(ce,ae.sibling),we=C(ae,pe.props.children),we.return=ce,ce=we;break e}}else if(ae.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===D&&zs(Pe)===ae.type){a(ce,ae.sibling),we=C(ae,pe.props),ml(we,pe),we.return=ce,ce=we;break e}a(ce,ae);break}else i(ce,ae);ae=ae.sibling}pe.type===w?(we=Fs(pe.props.children,ce.mode,we,pe.key),we.return=ce,ce=we):(we=Us(pe.type,pe.key,pe.props,null,ce.mode,we),ml(we,pe),we.return=ce,ce=we)}return B(ce);case A:e:{for(Pe=pe.key;ae!==null;){if(ae.key===Pe)if(ae.tag===4&&ae.stateNode.containerInfo===pe.containerInfo&&ae.stateNode.implementation===pe.implementation){a(ce,ae.sibling),we=C(ae,pe.children||[]),we.return=ce,ce=we;break e}else{a(ce,ae);break}else i(ce,ae);ae=ae.sibling}we=yf(pe,ce.mode,we),we.return=ce,ce=we}return B(ce);case D:return pe=zs(pe),St(ce,ae,pe,we)}if(ee(pe))return ke(ce,ae,pe,we);if(z(pe)){if(Pe=z(pe),typeof Pe!="function")throw Error(s(150));return pe=Pe.call(pe),Ue(ce,ae,pe,we)}if(typeof pe.then=="function")return St(ce,ae,Su(pe),we);if(pe.$$typeof===_)return St(ce,ae,gu(ce,pe),we);bu(ce,pe)}return typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint"?(pe=""+pe,ae!==null&&ae.tag===6?(a(ce,ae.sibling),we=C(ae,pe),we.return=ce,ce=we):(a(ce,ae),we=_f(pe,ce.mode,we),we.return=ce,ce=we),B(ce)):a(ce,ae)}return function(ce,ae,pe,we){try{pl=0;var Pe=St(ce,ae,pe,we);return Fo=null,Pe}catch(Be){if(Be===Uo||Be===_u)throw Be;var lt=dr(29,Be,null,ce.mode);return lt.lanes=we,lt.return=ce,lt}finally{}}}var Ws=Kv(!0),Qv=Kv(!1),Gi=!1;function kf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Lf(t,i){t=t.updateQueue,i.updateQueue===t&&(i.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function zi(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Yi(t,i,a){var d=t.updateQueue;if(d===null)return null;if(d=d.shared,(ft&2)!==0){var C=d.pending;return C===null?i.next=i:(i.next=C.next,C.next=i),d.pending=i,i=ti(t),Kr(t,null,a),i}return ht(t,d,i,a),ti(t)}function gl(t,i,a){if(i=i.updateQueue,i!==null&&(i=i.shared,(a&4194048)!==0)){var d=i.lanes;d&=t.pendingLanes,a|=d,i.lanes=a,Di(t,a)}}function Of(t,i){var a=t.updateQueue,d=t.alternate;if(d!==null&&(d=d.updateQueue,a===d)){var C=null,E=null;if(a=a.firstBaseUpdate,a!==null){do{var B={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};E===null?C=E=B:E=E.next=B,a=a.next}while(a!==null);E===null?C=E=i:E=E.next=i}else C=E=i;a={baseState:d.baseState,firstBaseUpdate:C,lastBaseUpdate:E,shared:d.shared,callbacks:d.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=i:t.next=i,a.lastBaseUpdate=i}var Bf=!1;function vl(){if(Bf){var t=jo;if(t!==null)throw t}}function _l(t,i,a,d){Bf=!1;var C=t.updateQueue;Gi=!1;var E=C.firstBaseUpdate,B=C.lastBaseUpdate,H=C.shared.pending;if(H!==null){C.shared.pending=null;var ie=H,me=ie.next;ie.next=null,B===null?E=me:B.next=me,B=ie;var Ce=t.alternate;Ce!==null&&(Ce=Ce.updateQueue,H=Ce.lastBaseUpdate,H!==B&&(H===null?Ce.firstBaseUpdate=me:H.next=me,Ce.lastBaseUpdate=ie))}if(E!==null){var xe=C.baseState;B=0,Ce=me=ie=null,H=E;do{var ve=H.lane&-536870913,Se=ve!==H.lane;if(Se?(tt&ve)===ve:(d&ve)===ve){ve!==0&&ve===Po&&(Bf=!0),Ce!==null&&(Ce=Ce.next={lane:0,tag:H.tag,payload:H.payload,callback:null,next:null});e:{var ke=t,Ue=H;ve=i;var St=a;switch(Ue.tag){case 1:if(ke=Ue.payload,typeof ke=="function"){xe=ke.call(St,xe,ve);break e}xe=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Ue.payload,ve=typeof ke=="function"?ke.call(St,xe,ve):ke,ve==null)break e;xe=p({},xe,ve);break e;case 2:Gi=!0}}ve=H.callback,ve!==null&&(t.flags|=64,Se&&(t.flags|=8192),Se=C.callbacks,Se===null?C.callbacks=[ve]:Se.push(ve))}else Se={lane:ve,tag:H.tag,payload:H.payload,callback:H.callback,next:null},Ce===null?(me=Ce=Se,ie=xe):Ce=Ce.next=Se,B|=ve;if(H=H.next,H===null){if(H=C.shared.pending,H===null)break;Se=H,H=Se.next,Se.next=null,C.lastBaseUpdate=Se,C.shared.pending=null}}while(!0);Ce===null&&(ie=xe),C.baseState=ie,C.firstBaseUpdate=me,C.lastBaseUpdate=Ce,E===null&&(C.shared.lanes=0),Ji|=B,t.lanes=B,t.memoizedState=xe}}function $v(t,i){if(typeof t!="function")throw Error(s(191,t));t.call(i)}function Jv(t,i){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)$v(a[t],i)}var Ho=j(null),Cu=j(0);function Zv(t,i){t=fi,ne(Cu,t),ne(Ho,i),fi=t|i.baseLanes}function Nf(){ne(Cu,fi),ne(Ho,Ho.current)}function If(){fi=Cu.current,q(Ho),q(Cu)}var Pr=j(null),Xr=null;function Wi(t){var i=t.alternate;ne(Ft,Ft.current&1),ne(Pr,t),Xr===null&&(i===null||Ho.current!==null||i.memoizedState!==null)&&(Xr=t)}function Pf(t){ne(Ft,Ft.current),ne(Pr,t),Xr===null&&(Xr=t)}function Xv(t){t.tag===22?(ne(Ft,Ft.current),ne(Pr,t),Xr===null&&(Xr=t)):Ki()}function Ki(){ne(Ft,Ft.current),ne(Pr,Pr.current)}function jr(t){q(Pr),Xr===t&&(Xr=null),q(Ft)}var Ft=j(0);function wu(t){for(var i=t;i!==null;){if(i.tag===13){var a=i.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||qp(a)||Gp(a)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var si=0,Ge=null,_t=null,zt=null,xu=!1,Vo=!1,Ks=!1,Eu=0,yl=0,qo=null,DA=0;function Pt(){throw Error(s(321))}function jf(t,i){if(i===null)return!1;for(var a=0;a<i.length&&a<t.length;a++)if(!yr(t[a],i[a]))return!1;return!0}function Uf(t,i,a,d,C,E){return si=E,Ge=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Y.H=t===null||t.memoizedState===null?I_:ep,Ks=!1,E=a(d,C),Ks=!1,Vo&&(E=t_(i,a,d,C)),e_(t),E}function e_(t){Y.H=Cl;var i=_t!==null&&_t.next!==null;if(si=0,zt=_t=Ge=null,xu=!1,yl=0,qo=null,i)throw Error(s(300));t===null||Yt||(t=t.dependencies,t!==null&&mu(t)&&(Yt=!0))}function t_(t,i,a,d){Ge=t;var C=0;do{if(Vo&&(qo=null),yl=0,Vo=!1,25<=C)throw Error(s(301));if(C+=1,zt=_t=null,t.updateQueue!=null){var E=t.updateQueue;E.lastEffect=null,E.events=null,E.stores=null,E.memoCache!=null&&(E.memoCache.index=0)}Y.H=P_,E=i(a,d)}while(Vo);return E}function MA(){var t=Y.H,i=t.useState()[0];return i=typeof i.then=="function"?Sl(i):i,t=t.useState()[0],(_t!==null?_t.memoizedState:null)!==t&&(Ge.flags|=1024),i}function Ff(){var t=Eu!==0;return Eu=0,t}function Hf(t,i,a){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~a}function Vf(t){if(xu){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}xu=!1}si=0,zt=_t=Ge=null,Vo=!1,yl=Eu=0,qo=null}function Sr(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zt===null?Ge.memoizedState=zt=t:zt=zt.next=t,zt}function Ht(){if(_t===null){var t=Ge.alternate;t=t!==null?t.memoizedState:null}else t=_t.next;var i=zt===null?Ge.memoizedState:zt.next;if(i!==null)zt=i,_t=t;else{if(t===null)throw Ge.alternate===null?Error(s(467)):Error(s(310));_t=t,t={memoizedState:_t.memoizedState,baseState:_t.baseState,baseQueue:_t.baseQueue,queue:_t.queue,next:null},zt===null?Ge.memoizedState=zt=t:zt=zt.next=t}return zt}function Au(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Sl(t){var i=yl;return yl+=1,qo===null&&(qo=[]),t=zv(qo,t,i),i=Ge,(zt===null?i.memoizedState:zt.next)===null&&(i=i.alternate,Y.H=i===null||i.memoizedState===null?I_:ep),t}function Tu(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Sl(t);if(t.$$typeof===_)return sr(t)}throw Error(s(438,String(t)))}function qf(t){var i=null,a=Ge.updateQueue;if(a!==null&&(i=a.memoCache),i==null){var d=Ge.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(i={data:d.data.map(function(C){return C.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),a===null&&(a=Au(),Ge.updateQueue=a),a.memoCache=i,a=i.data[i.index],a===void 0)for(a=i.data[i.index]=Array(t),d=0;d<t;d++)a[d]=K;return i.index++,a}function oi(t,i){return typeof i=="function"?i(t):i}function Ru(t){var i=Ht();return Gf(i,_t,t)}function Gf(t,i,a){var d=t.queue;if(d===null)throw Error(s(311));d.lastRenderedReducer=a;var C=t.baseQueue,E=d.pending;if(E!==null){if(C!==null){var B=C.next;C.next=E.next,E.next=B}i.baseQueue=C=E,d.pending=null}if(E=t.baseState,C===null)t.memoizedState=E;else{i=C.next;var H=B=null,ie=null,me=i,Ce=!1;do{var xe=me.lane&-536870913;if(xe!==me.lane?(tt&xe)===xe:(si&xe)===xe){var ve=me.revertLane;if(ve===0)ie!==null&&(ie=ie.next={lane:0,revertLane:0,gesture:null,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null}),xe===Po&&(Ce=!0);else if((si&ve)===ve){me=me.next,ve===Po&&(Ce=!0);continue}else xe={lane:0,revertLane:me.revertLane,gesture:null,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null},ie===null?(H=ie=xe,B=E):ie=ie.next=xe,Ge.lanes|=ve,Ji|=ve;xe=me.action,Ks&&a(E,xe),E=me.hasEagerState?me.eagerState:a(E,xe)}else ve={lane:xe,revertLane:me.revertLane,gesture:me.gesture,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null},ie===null?(H=ie=ve,B=E):ie=ie.next=ve,Ge.lanes|=xe,Ji|=xe;me=me.next}while(me!==null&&me!==i);if(ie===null?B=E:ie.next=H,!yr(E,t.memoizedState)&&(Yt=!0,Ce&&(a=jo,a!==null)))throw a;t.memoizedState=E,t.baseState=B,t.baseQueue=ie,d.lastRenderedState=E}return C===null&&(d.lanes=0),[t.memoizedState,d.dispatch]}function zf(t){var i=Ht(),a=i.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=t;var d=a.dispatch,C=a.pending,E=i.memoizedState;if(C!==null){a.pending=null;var B=C=C.next;do E=t(E,B.action),B=B.next;while(B!==C);yr(E,i.memoizedState)||(Yt=!0),i.memoizedState=E,i.baseQueue===null&&(i.baseState=E),a.lastRenderedState=E}return[E,d]}function r_(t,i,a){var d=Ge,C=Ht(),E=it;if(E){if(a===void 0)throw Error(s(407));a=a()}else a=i();var B=!yr((_t||C).memoizedState,a);if(B&&(C.memoizedState=a,Yt=!0),C=C.queue,Kf(s_.bind(null,d,C,t),[t]),C.getSnapshot!==i||B||zt!==null&&zt.memoizedState.tag&1){if(d.flags|=2048,Go(9,{destroy:void 0},i_.bind(null,d,C,a,i),null),bt===null)throw Error(s(349));E||(si&127)!==0||n_(d,i,a)}return a}function n_(t,i,a){t.flags|=16384,t={getSnapshot:i,value:a},i=Ge.updateQueue,i===null?(i=Au(),Ge.updateQueue=i,i.stores=[t]):(a=i.stores,a===null?i.stores=[t]:a.push(t))}function i_(t,i,a,d){i.value=a,i.getSnapshot=d,o_(i)&&a_(t)}function s_(t,i,a){return a(function(){o_(i)&&a_(t)})}function o_(t){var i=t.getSnapshot;t=t.value;try{var a=i();return!yr(t,a)}catch{return!0}}function a_(t){var i=Nt(t,2);i!==null&&kr(i,t,2)}function Yf(t){var i=Sr();if(typeof t=="function"){var a=t;if(t=a(),Ks){wn(!0);try{a()}finally{wn(!1)}}}return i.memoizedState=i.baseState=t,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:oi,lastRenderedState:t},i}function l_(t,i,a,d){return t.baseState=a,Gf(t,_t,typeof d=="function"?d:oi)}function kA(t,i,a,d,C){if(ku(t))throw Error(s(485));if(t=i.action,t!==null){var E={payload:C,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(B){E.listeners.push(B)}};Y.T!==null?a(!0):E.isTransition=!1,d(E),a=i.pending,a===null?(E.next=i.pending=E,c_(i,E)):(E.next=a.next,i.pending=a.next=E)}}function c_(t,i){var a=i.action,d=i.payload,C=t.state;if(i.isTransition){var E=Y.T,B={};Y.T=B;try{var H=a(C,d),ie=Y.S;ie!==null&&ie(B,H),u_(t,i,H)}catch(me){Wf(t,i,me)}finally{E!==null&&B.types!==null&&(E.types=B.types),Y.T=E}}else try{E=a(C,d),u_(t,i,E)}catch(me){Wf(t,i,me)}}function u_(t,i,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(d){d_(t,i,d)},function(d){return Wf(t,i,d)}):d_(t,i,a)}function d_(t,i,a){i.status="fulfilled",i.value=a,h_(i),t.state=a,i=t.pending,i!==null&&(a=i.next,a===i?t.pending=null:(a=a.next,i.next=a,c_(t,a)))}function Wf(t,i,a){var d=t.pending;if(t.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=a,h_(i),i=i.next;while(i!==d)}t.action=null}function h_(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function f_(t,i){return i}function p_(t,i){if(it){var a=bt.formState;if(a!==null){e:{var d=Ge;if(it){if(xt){t:{for(var C=xt,E=Zr;C.nodeType!==8;){if(!E){C=null;break t}if(C=en(C.nextSibling),C===null){C=null;break t}}E=C.data,C=E==="F!"||E==="F"?C:null}if(C){xt=en(C.nextSibling),d=C.data==="F!";break e}}Vi(d)}d=!1}d&&(i=a[0])}}return a=Sr(),a.memoizedState=a.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:f_,lastRenderedState:i},a.queue=d,a=O_.bind(null,Ge,d),d.dispatch=a,d=Yf(!1),E=Xf.bind(null,Ge,!1,d.queue),d=Sr(),C={state:i,dispatch:null,action:t,pending:null},d.queue=C,a=kA.bind(null,Ge,C,E,a),C.dispatch=a,d.memoizedState=t,[i,a,!1]}function m_(t){var i=Ht();return g_(i,_t,t)}function g_(t,i,a){if(i=Gf(t,i,f_)[0],t=Ru(oi)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var d=Sl(i)}catch(B){throw B===Uo?_u:B}else d=i;i=Ht();var C=i.queue,E=C.dispatch;return a!==i.memoizedState&&(Ge.flags|=2048,Go(9,{destroy:void 0},LA.bind(null,C,a),null)),[d,E,t]}function LA(t,i){t.action=i}function v_(t){var i=Ht(),a=_t;if(a!==null)return g_(i,a,t);Ht(),i=i.memoizedState,a=Ht();var d=a.queue.dispatch;return a.memoizedState=t,[i,d,!1]}function Go(t,i,a,d){return t={tag:t,create:a,deps:d,inst:i,next:null},i=Ge.updateQueue,i===null&&(i=Au(),Ge.updateQueue=i),a=i.lastEffect,a===null?i.lastEffect=t.next=t:(d=a.next,a.next=t,t.next=d,i.lastEffect=t),t}function __(){return Ht().memoizedState}function Du(t,i,a,d){var C=Sr();Ge.flags|=t,C.memoizedState=Go(1|i,{destroy:void 0},a,d===void 0?null:d)}function Mu(t,i,a,d){var C=Ht();d=d===void 0?null:d;var E=C.memoizedState.inst;_t!==null&&d!==null&&jf(d,_t.memoizedState.deps)?C.memoizedState=Go(i,E,a,d):(Ge.flags|=t,C.memoizedState=Go(1|i,E,a,d))}function y_(t,i){Du(8390656,8,t,i)}function Kf(t,i){Mu(2048,8,t,i)}function OA(t){Ge.flags|=4;var i=Ge.updateQueue;if(i===null)i=Au(),Ge.updateQueue=i,i.events=[t];else{var a=i.events;a===null?i.events=[t]:a.push(t)}}function S_(t){var i=Ht().memoizedState;return OA({ref:i,nextImpl:t}),function(){if((ft&2)!==0)throw Error(s(440));return i.impl.apply(void 0,arguments)}}function b_(t,i){return Mu(4,2,t,i)}function C_(t,i){return Mu(4,4,t,i)}function w_(t,i){if(typeof i=="function"){t=t();var a=i(t);return function(){typeof a=="function"?a():i(null)}}if(i!=null)return t=t(),i.current=t,function(){i.current=null}}function x_(t,i,a){a=a!=null?a.concat([t]):null,Mu(4,4,w_.bind(null,i,t),a)}function Qf(){}function E_(t,i){var a=Ht();i=i===void 0?null:i;var d=a.memoizedState;return i!==null&&jf(i,d[1])?d[0]:(a.memoizedState=[t,i],t)}function A_(t,i){var a=Ht();i=i===void 0?null:i;var d=a.memoizedState;if(i!==null&&jf(i,d[1]))return d[0];if(d=t(),Ks){wn(!0);try{t()}finally{wn(!1)}}return a.memoizedState=[d,i],d}function $f(t,i,a){return a===void 0||(si&1073741824)!==0&&(tt&261930)===0?t.memoizedState=i:(t.memoizedState=a,t=Ty(),Ge.lanes|=t,Ji|=t,a)}function T_(t,i,a,d){return yr(a,i)?a:Ho.current!==null?(t=$f(t,a,d),yr(t,i)||(Yt=!0),t):(si&42)===0||(si&1073741824)!==0&&(tt&261930)===0?(Yt=!0,t.memoizedState=a):(t=Ty(),Ge.lanes|=t,Ji|=t,i)}function R_(t,i,a,d,C){var E=re.p;re.p=E!==0&&8>E?E:8;var B=Y.T,H={};Y.T=H,Xf(t,!1,i,a);try{var ie=C(),me=Y.S;if(me!==null&&me(H,ie),ie!==null&&typeof ie=="object"&&typeof ie.then=="function"){var Ce=RA(ie,d);bl(t,i,Ce,Hr(t))}else bl(t,i,d,Hr(t))}catch(xe){bl(t,i,{then:function(){},status:"rejected",reason:xe},Hr())}finally{re.p=E,B!==null&&H.types!==null&&(B.types=H.types),Y.T=B}}function BA(){}function Jf(t,i,a,d){if(t.tag!==5)throw Error(s(476));var C=D_(t).queue;R_(t,C,i,te,a===null?BA:function(){return M_(t),a(d)})}function D_(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oi,lastRenderedState:te},next:null};var a={};return i.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oi,lastRenderedState:a},next:null},t.memoizedState=i,t=t.alternate,t!==null&&(t.memoizedState=i),i}function M_(t){var i=D_(t);i.next===null&&(i=t.alternate.memoizedState),bl(t,i.next.queue,{},Hr())}function Zf(){return sr(jl)}function k_(){return Ht().memoizedState}function L_(){return Ht().memoizedState}function NA(t){for(var i=t.return;i!==null;){switch(i.tag){case 24:case 3:var a=Hr();t=zi(a);var d=Yi(i,t,a);d!==null&&(kr(d,i,a),gl(d,i,a)),i={cache:Tf()},t.payload=i;return}i=i.return}}function IA(t,i,a){var d=Hr();a={lane:d,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},ku(t)?B_(i,a):(a=pn(t,i,a,d),a!==null&&(kr(a,t,d),N_(a,i,d)))}function O_(t,i,a){var d=Hr();bl(t,i,a,d)}function bl(t,i,a,d){var C={lane:d,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(ku(t))B_(i,C);else{var E=t.alternate;if(t.lanes===0&&(E===null||E.lanes===0)&&(E=i.lastRenderedReducer,E!==null))try{var B=i.lastRenderedState,H=E(B,a);if(C.hasEagerState=!0,C.eagerState=H,yr(H,B))return ht(t,i,C,0),bt===null&&pt(),!1}catch{}finally{}if(a=pn(t,i,C,d),a!==null)return kr(a,t,d),N_(a,i,d),!0}return!1}function Xf(t,i,a,d){if(d={lane:2,revertLane:kp(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},ku(t)){if(i)throw Error(s(479))}else i=pn(t,a,d,2),i!==null&&kr(i,t,2)}function ku(t){var i=t.alternate;return t===Ge||i!==null&&i===Ge}function B_(t,i){Vo=xu=!0;var a=t.pending;a===null?i.next=i:(i.next=a.next,a.next=i),t.pending=i}function N_(t,i,a){if((a&4194048)!==0){var d=i.lanes;d&=t.pendingLanes,a|=d,i.lanes=a,Di(t,a)}}var Cl={readContext:sr,use:Tu,useCallback:Pt,useContext:Pt,useEffect:Pt,useImperativeHandle:Pt,useLayoutEffect:Pt,useInsertionEffect:Pt,useMemo:Pt,useReducer:Pt,useRef:Pt,useState:Pt,useDebugValue:Pt,useDeferredValue:Pt,useTransition:Pt,useSyncExternalStore:Pt,useId:Pt,useHostTransitionStatus:Pt,useFormState:Pt,useActionState:Pt,useOptimistic:Pt,useMemoCache:Pt,useCacheRefresh:Pt};Cl.useEffectEvent=Pt;var I_={readContext:sr,use:Tu,useCallback:function(t,i){return Sr().memoizedState=[t,i===void 0?null:i],t},useContext:sr,useEffect:y_,useImperativeHandle:function(t,i,a){a=a!=null?a.concat([t]):null,Du(4194308,4,w_.bind(null,i,t),a)},useLayoutEffect:function(t,i){return Du(4194308,4,t,i)},useInsertionEffect:function(t,i){Du(4,2,t,i)},useMemo:function(t,i){var a=Sr();i=i===void 0?null:i;var d=t();if(Ks){wn(!0);try{t()}finally{wn(!1)}}return a.memoizedState=[d,i],d},useReducer:function(t,i,a){var d=Sr();if(a!==void 0){var C=a(i);if(Ks){wn(!0);try{a(i)}finally{wn(!1)}}}else C=i;return d.memoizedState=d.baseState=C,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:C},d.queue=t,t=t.dispatch=IA.bind(null,Ge,t),[d.memoizedState,t]},useRef:function(t){var i=Sr();return t={current:t},i.memoizedState=t},useState:function(t){t=Yf(t);var i=t.queue,a=O_.bind(null,Ge,i);return i.dispatch=a,[t.memoizedState,a]},useDebugValue:Qf,useDeferredValue:function(t,i){var a=Sr();return $f(a,t,i)},useTransition:function(){var t=Yf(!1);return t=R_.bind(null,Ge,t.queue,!0,!1),Sr().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,a){var d=Ge,C=Sr();if(it){if(a===void 0)throw Error(s(407));a=a()}else{if(a=i(),bt===null)throw Error(s(349));(tt&127)!==0||n_(d,i,a)}C.memoizedState=a;var E={value:a,getSnapshot:i};return C.queue=E,y_(s_.bind(null,d,E,t),[t]),d.flags|=2048,Go(9,{destroy:void 0},i_.bind(null,d,E,a,i),null),a},useId:function(){var t=Sr(),i=bt.identifierPrefix;if(it){var a=Dn,d=Rn;a=(d&~(1<<32-tr(d)-1)).toString(32)+a,i="_"+i+"R_"+a,a=Eu++,0<a&&(i+="H"+a.toString(32)),i+="_"}else a=DA++,i="_"+i+"r_"+a.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:Zf,useFormState:p_,useActionState:p_,useOptimistic:function(t){var i=Sr();i.memoizedState=i.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=a,i=Xf.bind(null,Ge,!0,a),a.dispatch=i,[t,i]},useMemoCache:qf,useCacheRefresh:function(){return Sr().memoizedState=NA.bind(null,Ge)},useEffectEvent:function(t){var i=Sr(),a={impl:t};return i.memoizedState=a,function(){if((ft&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},ep={readContext:sr,use:Tu,useCallback:E_,useContext:sr,useEffect:Kf,useImperativeHandle:x_,useInsertionEffect:b_,useLayoutEffect:C_,useMemo:A_,useReducer:Ru,useRef:__,useState:function(){return Ru(oi)},useDebugValue:Qf,useDeferredValue:function(t,i){var a=Ht();return T_(a,_t.memoizedState,t,i)},useTransition:function(){var t=Ru(oi)[0],i=Ht().memoizedState;return[typeof t=="boolean"?t:Sl(t),i]},useSyncExternalStore:r_,useId:k_,useHostTransitionStatus:Zf,useFormState:m_,useActionState:m_,useOptimistic:function(t,i){var a=Ht();return l_(a,_t,t,i)},useMemoCache:qf,useCacheRefresh:L_};ep.useEffectEvent=S_;var P_={readContext:sr,use:Tu,useCallback:E_,useContext:sr,useEffect:Kf,useImperativeHandle:x_,useInsertionEffect:b_,useLayoutEffect:C_,useMemo:A_,useReducer:zf,useRef:__,useState:function(){return zf(oi)},useDebugValue:Qf,useDeferredValue:function(t,i){var a=Ht();return _t===null?$f(a,t,i):T_(a,_t.memoizedState,t,i)},useTransition:function(){var t=zf(oi)[0],i=Ht().memoizedState;return[typeof t=="boolean"?t:Sl(t),i]},useSyncExternalStore:r_,useId:k_,useHostTransitionStatus:Zf,useFormState:v_,useActionState:v_,useOptimistic:function(t,i){var a=Ht();return _t!==null?l_(a,_t,t,i):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:qf,useCacheRefresh:L_};P_.useEffectEvent=S_;function tp(t,i,a,d){i=t.memoizedState,a=a(d,i),a=a==null?i:p({},i,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var rp={enqueueSetState:function(t,i,a){t=t._reactInternals;var d=Hr(),C=zi(d);C.payload=i,a!=null&&(C.callback=a),i=Yi(t,C,d),i!==null&&(kr(i,t,d),gl(i,t,d))},enqueueReplaceState:function(t,i,a){t=t._reactInternals;var d=Hr(),C=zi(d);C.tag=1,C.payload=i,a!=null&&(C.callback=a),i=Yi(t,C,d),i!==null&&(kr(i,t,d),gl(i,t,d))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var a=Hr(),d=zi(a);d.tag=2,i!=null&&(d.callback=i),i=Yi(t,d,a),i!==null&&(kr(i,t,a),gl(i,t,a))}};function j_(t,i,a,d,C,E,B){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(d,E,B):i.prototype&&i.prototype.isPureReactComponent?!Is(a,d)||!Is(C,E):!0}function U_(t,i,a,d){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(a,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(a,d),i.state!==t&&rp.enqueueReplaceState(i,i.state,null)}function Qs(t,i){var a=i;if("ref"in i){a={};for(var d in i)d!=="ref"&&(a[d]=i[d])}if(t=t.defaultProps){a===i&&(a=p({},a));for(var C in t)a[C]===void 0&&(a[C]=t[C])}return a}function F_(t){st(t)}function H_(t){console.error(t)}function V_(t){st(t)}function Lu(t,i){try{var a=t.onUncaughtError;a(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function q_(t,i,a){try{var d=t.onCaughtError;d(a.value,{componentStack:a.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(C){setTimeout(function(){throw C})}}function np(t,i,a){return a=zi(a),a.tag=3,a.payload={element:null},a.callback=function(){Lu(t,i)},a}function G_(t){return t=zi(t),t.tag=3,t}function z_(t,i,a,d){var C=a.type.getDerivedStateFromError;if(typeof C=="function"){var E=d.value;t.payload=function(){return C(E)},t.callback=function(){q_(i,a,d)}}var B=a.stateNode;B!==null&&typeof B.componentDidCatch=="function"&&(t.callback=function(){q_(i,a,d),typeof C!="function"&&(Zi===null?Zi=new Set([this]):Zi.add(this));var H=d.stack;this.componentDidCatch(d.value,{componentStack:H!==null?H:""})})}function PA(t,i,a,d,C){if(a.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=a.alternate,i!==null&&Io(i,a,C,!0),a=Pr.current,a!==null){switch(a.tag){case 31:case 13:return Xr===null?Gu():a.alternate===null&&jt===0&&(jt=3),a.flags&=-257,a.flags|=65536,a.lanes=C,d===yu?a.flags|=16384:(i=a.updateQueue,i===null?a.updateQueue=new Set([d]):i.add(d),Rp(t,d,C)),!1;case 22:return a.flags|=65536,d===yu?a.flags|=16384:(i=a.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([d])},a.updateQueue=i):(a=i.retryQueue,a===null?i.retryQueue=new Set([d]):a.add(d)),Rp(t,d,C)),!1}throw Error(s(435,a.tag))}return Rp(t,d,C),Gu(),!1}if(it)return i=Pr.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=C,d!==Cf&&(t=Error(s(422),{cause:d}),dl(Qr(t,a)))):(d!==Cf&&(i=Error(s(423),{cause:d}),dl(Qr(i,a))),t=t.current.alternate,t.flags|=65536,C&=-C,t.lanes|=C,d=Qr(d,a),C=np(t.stateNode,d,C),Of(t,C),jt!==4&&(jt=2)),!1;var E=Error(s(520),{cause:d});if(E=Qr(E,a),Ml===null?Ml=[E]:Ml.push(E),jt!==4&&(jt=2),i===null)return!0;d=Qr(d,a),a=i;do{switch(a.tag){case 3:return a.flags|=65536,t=C&-C,a.lanes|=t,t=np(a.stateNode,d,t),Of(a,t),!1;case 1:if(i=a.type,E=a.stateNode,(a.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(Zi===null||!Zi.has(E))))return a.flags|=65536,C&=-C,a.lanes|=C,C=G_(C),z_(C,t,a,d),Of(a,C),!1}a=a.return}while(a!==null);return!1}var ip=Error(s(461)),Yt=!1;function or(t,i,a,d){i.child=t===null?Qv(i,null,a,d):Ws(i,t.child,a,d)}function Y_(t,i,a,d,C){a=a.render;var E=i.ref;if("ref"in d){var B={};for(var H in d)H!=="ref"&&(B[H]=d[H])}else B=d;return qs(i),d=Uf(t,i,a,B,E,C),H=Ff(),t!==null&&!Yt?(Hf(t,i,C),ai(t,i,C)):(it&&H&&Sf(i),i.flags|=1,or(t,i,d,C),i.child)}function W_(t,i,a,d,C){if(t===null){var E=a.type;return typeof E=="function"&&!Lo(E)&&E.defaultProps===void 0&&a.compare===null?(i.tag=15,i.type=E,K_(t,i,E,d,C)):(t=Us(a.type,null,d,i,i.mode,C),t.ref=i.ref,t.return=i,i.child=t)}if(E=t.child,!hp(t,C)){var B=E.memoizedProps;if(a=a.compare,a=a!==null?a:Is,a(B,d)&&t.ref===i.ref)return ai(t,i,C)}return i.flags|=1,t=Ar(E,d),t.ref=i.ref,t.return=i,i.child=t}function K_(t,i,a,d,C){if(t!==null){var E=t.memoizedProps;if(Is(E,d)&&t.ref===i.ref)if(Yt=!1,i.pendingProps=d=E,hp(t,C))(t.flags&131072)!==0&&(Yt=!0);else return i.lanes=t.lanes,ai(t,i,C)}return sp(t,i,a,d,C)}function Q_(t,i,a,d){var C=d.children,E=t!==null?t.memoizedState:null;if(t===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((i.flags&128)!==0){if(E=E!==null?E.baseLanes|a:a,t!==null){for(d=i.child=t.child,C=0;d!==null;)C=C|d.lanes|d.childLanes,d=d.sibling;d=C&~E}else d=0,i.child=null;return $_(t,i,E,a,d)}if((a&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&vu(i,E!==null?E.cachePool:null),E!==null?Zv(i,E):Nf(),Xv(i);else return d=i.lanes=536870912,$_(t,i,E!==null?E.baseLanes|a:a,a,d)}else E!==null?(vu(i,E.cachePool),Zv(i,E),Ki(),i.memoizedState=null):(t!==null&&vu(i,null),Nf(),Ki());return or(t,i,C,a),i.child}function wl(t,i){return t!==null&&t.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function $_(t,i,a,d,C){var E=Df();return E=E===null?null:{parent:Gt._currentValue,pool:E},i.memoizedState={baseLanes:a,cachePool:E},t!==null&&vu(i,null),Nf(),Xv(i),t!==null&&Io(t,i,d,!0),i.childLanes=C,null}function Ou(t,i){return i=Nu({mode:i.mode,children:i.children},t.mode),i.ref=t.ref,t.child=i,i.return=t,i}function J_(t,i,a){return Ws(i,t.child,null,a),t=Ou(i,i.pendingProps),t.flags|=2,jr(i),i.memoizedState=null,t}function jA(t,i,a){var d=i.pendingProps,C=(i.flags&128)!==0;if(i.flags&=-129,t===null){if(it){if(d.mode==="hidden")return t=Ou(i,d),i.lanes=536870912,wl(null,t);if(Pf(i),(t=xt)?(t=c0(t,Zr),t=t!==null&&t.data==="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Fi!==null?{id:Rn,overflow:Dn}:null,retryLane:536870912,hydrationErrors:null},a=Bv(t),a.return=i,i.child=a,ir=i,xt=null)):t=null,t===null)throw Vi(i);return i.lanes=536870912,null}return Ou(i,d)}var E=t.memoizedState;if(E!==null){var B=E.dehydrated;if(Pf(i),C)if(i.flags&256)i.flags&=-257,i=J_(t,i,a);else if(i.memoizedState!==null)i.child=t.child,i.flags|=128,i=null;else throw Error(s(558));else if(Yt||Io(t,i,a,!1),C=(a&t.childLanes)!==0,Yt||C){if(d=bt,d!==null&&(B=Ic(d,a),B!==0&&B!==E.retryLane))throw E.retryLane=B,Nt(t,B),kr(d,t,B),ip;Gu(),i=J_(t,i,a)}else t=E.treeContext,xt=en(B.nextSibling),ir=i,it=!0,Hi=null,Zr=!1,t!==null&&Pv(i,t),i=Ou(i,d),i.flags|=4096;return i}return t=Ar(t.child,{mode:d.mode,children:d.children}),t.ref=i.ref,i.child=t,t.return=i,t}function Bu(t,i){var a=i.ref;if(a===null)t!==null&&t.ref!==null&&(i.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(t===null||t.ref!==a)&&(i.flags|=4194816)}}function sp(t,i,a,d,C){return qs(i),a=Uf(t,i,a,d,void 0,C),d=Ff(),t!==null&&!Yt?(Hf(t,i,C),ai(t,i,C)):(it&&d&&Sf(i),i.flags|=1,or(t,i,a,C),i.child)}function Z_(t,i,a,d,C,E){return qs(i),i.updateQueue=null,a=t_(i,d,a,C),e_(t),d=Ff(),t!==null&&!Yt?(Hf(t,i,E),ai(t,i,E)):(it&&d&&Sf(i),i.flags|=1,or(t,i,a,E),i.child)}function X_(t,i,a,d,C){if(qs(i),i.stateNode===null){var E=Ui,B=a.contextType;typeof B=="object"&&B!==null&&(E=sr(B)),E=new a(d,E),i.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,E.updater=rp,i.stateNode=E,E._reactInternals=i,E=i.stateNode,E.props=d,E.state=i.memoizedState,E.refs={},kf(i),B=a.contextType,E.context=typeof B=="object"&&B!==null?sr(B):Ui,E.state=i.memoizedState,B=a.getDerivedStateFromProps,typeof B=="function"&&(tp(i,a,B,d),E.state=i.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(B=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),B!==E.state&&rp.enqueueReplaceState(E,E.state,null),_l(i,d,E,C),vl(),E.state=i.memoizedState),typeof E.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(t===null){E=i.stateNode;var H=i.memoizedProps,ie=Qs(a,H);E.props=ie;var me=E.context,Ce=a.contextType;B=Ui,typeof Ce=="object"&&Ce!==null&&(B=sr(Ce));var xe=a.getDerivedStateFromProps;Ce=typeof xe=="function"||typeof E.getSnapshotBeforeUpdate=="function",H=i.pendingProps!==H,Ce||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(H||me!==B)&&U_(i,E,d,B),Gi=!1;var ve=i.memoizedState;E.state=ve,_l(i,d,E,C),vl(),me=i.memoizedState,H||ve!==me||Gi?(typeof xe=="function"&&(tp(i,a,xe,d),me=i.memoizedState),(ie=Gi||j_(i,a,ie,d,ve,me,B))?(Ce||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(i.flags|=4194308)):(typeof E.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=me),E.props=d,E.state=me,E.context=B,d=ie):(typeof E.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{E=i.stateNode,Lf(t,i),B=i.memoizedProps,Ce=Qs(a,B),E.props=Ce,xe=i.pendingProps,ve=E.context,me=a.contextType,ie=Ui,typeof me=="object"&&me!==null&&(ie=sr(me)),H=a.getDerivedStateFromProps,(me=typeof H=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(B!==xe||ve!==ie)&&U_(i,E,d,ie),Gi=!1,ve=i.memoizedState,E.state=ve,_l(i,d,E,C),vl();var Se=i.memoizedState;B!==xe||ve!==Se||Gi||t!==null&&t.dependencies!==null&&mu(t.dependencies)?(typeof H=="function"&&(tp(i,a,H,d),Se=i.memoizedState),(Ce=Gi||j_(i,a,Ce,d,ve,Se,ie)||t!==null&&t.dependencies!==null&&mu(t.dependencies))?(me||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(d,Se,ie),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(d,Se,ie)),typeof E.componentDidUpdate=="function"&&(i.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof E.componentDidUpdate!="function"||B===t.memoizedProps&&ve===t.memoizedState||(i.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||B===t.memoizedProps&&ve===t.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=Se),E.props=d,E.state=Se,E.context=ie,d=Ce):(typeof E.componentDidUpdate!="function"||B===t.memoizedProps&&ve===t.memoizedState||(i.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||B===t.memoizedProps&&ve===t.memoizedState||(i.flags|=1024),d=!1)}return E=d,Bu(t,i),d=(i.flags&128)!==0,E||d?(E=i.stateNode,a=d&&typeof a.getDerivedStateFromError!="function"?null:E.render(),i.flags|=1,t!==null&&d?(i.child=Ws(i,t.child,null,C),i.child=Ws(i,null,a,C)):or(t,i,a,C),i.memoizedState=E.state,t=i.child):t=ai(t,i,C),t}function ey(t,i,a,d){return Hs(),i.flags|=256,or(t,i,a,d),i.child}var op={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ap(t){return{baseLanes:t,cachePool:qv()}}function lp(t,i,a){return t=t!==null?t.childLanes&~a:0,i&&(t|=Fr),t}function ty(t,i,a){var d=i.pendingProps,C=!1,E=(i.flags&128)!==0,B;if((B=E)||(B=t!==null&&t.memoizedState===null?!1:(Ft.current&2)!==0),B&&(C=!0,i.flags&=-129),B=(i.flags&32)!==0,i.flags&=-33,t===null){if(it){if(C?Wi(i):Ki(),(t=xt)?(t=c0(t,Zr),t=t!==null&&t.data!=="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Fi!==null?{id:Rn,overflow:Dn}:null,retryLane:536870912,hydrationErrors:null},a=Bv(t),a.return=i,i.child=a,ir=i,xt=null)):t=null,t===null)throw Vi(i);return Gp(t)?i.lanes=32:i.lanes=536870912,null}var H=d.children;return d=d.fallback,C?(Ki(),C=i.mode,H=Nu({mode:"hidden",children:H},C),d=Fs(d,C,a,null),H.return=i,d.return=i,H.sibling=d,i.child=H,d=i.child,d.memoizedState=ap(a),d.childLanes=lp(t,B,a),i.memoizedState=op,wl(null,d)):(Wi(i),cp(i,H))}var ie=t.memoizedState;if(ie!==null&&(H=ie.dehydrated,H!==null)){if(E)i.flags&256?(Wi(i),i.flags&=-257,i=up(t,i,a)):i.memoizedState!==null?(Ki(),i.child=t.child,i.flags|=128,i=null):(Ki(),H=d.fallback,C=i.mode,d=Nu({mode:"visible",children:d.children},C),H=Fs(H,C,a,null),H.flags|=2,d.return=i,H.return=i,d.sibling=H,i.child=d,Ws(i,t.child,null,a),d=i.child,d.memoizedState=ap(a),d.childLanes=lp(t,B,a),i.memoizedState=op,i=wl(null,d));else if(Wi(i),Gp(H)){if(B=H.nextSibling&&H.nextSibling.dataset,B)var me=B.dgst;B=me,d=Error(s(419)),d.stack="",d.digest=B,dl({value:d,source:null,stack:null}),i=up(t,i,a)}else if(Yt||Io(t,i,a,!1),B=(a&t.childLanes)!==0,Yt||B){if(B=bt,B!==null&&(d=Ic(B,a),d!==0&&d!==ie.retryLane))throw ie.retryLane=d,Nt(t,d),kr(B,t,d),ip;qp(H)||Gu(),i=up(t,i,a)}else qp(H)?(i.flags|=192,i.child=t.child,i=null):(t=ie.treeContext,xt=en(H.nextSibling),ir=i,it=!0,Hi=null,Zr=!1,t!==null&&Pv(i,t),i=cp(i,d.children),i.flags|=4096);return i}return C?(Ki(),H=d.fallback,C=i.mode,ie=t.child,me=ie.sibling,d=Ar(ie,{mode:"hidden",children:d.children}),d.subtreeFlags=ie.subtreeFlags&65011712,me!==null?H=Ar(me,H):(H=Fs(H,C,a,null),H.flags|=2),H.return=i,d.return=i,d.sibling=H,i.child=d,wl(null,d),d=i.child,H=t.child.memoizedState,H===null?H=ap(a):(C=H.cachePool,C!==null?(ie=Gt._currentValue,C=C.parent!==ie?{parent:ie,pool:ie}:C):C=qv(),H={baseLanes:H.baseLanes|a,cachePool:C}),d.memoizedState=H,d.childLanes=lp(t,B,a),i.memoizedState=op,wl(t.child,d)):(Wi(i),a=t.child,t=a.sibling,a=Ar(a,{mode:"visible",children:d.children}),a.return=i,a.sibling=null,t!==null&&(B=i.deletions,B===null?(i.deletions=[t],i.flags|=16):B.push(t)),i.child=a,i.memoizedState=null,a)}function cp(t,i){return i=Nu({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function Nu(t,i){return t=dr(22,t,null,i),t.lanes=0,t}function up(t,i,a){return Ws(i,t.child,null,a),t=cp(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function ry(t,i,a){t.lanes|=i;var d=t.alternate;d!==null&&(d.lanes|=i),Ef(t.return,i,a)}function dp(t,i,a,d,C,E){var B=t.memoizedState;B===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:a,tailMode:C,treeForkCount:E}:(B.isBackwards=i,B.rendering=null,B.renderingStartTime=0,B.last=d,B.tail=a,B.tailMode=C,B.treeForkCount=E)}function ny(t,i,a){var d=i.pendingProps,C=d.revealOrder,E=d.tail;d=d.children;var B=Ft.current,H=(B&2)!==0;if(H?(B=B&1|2,i.flags|=128):B&=1,ne(Ft,B),or(t,i,d,a),d=it?ul:0,!H&&t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&ry(t,a,i);else if(t.tag===19)ry(t,a,i);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===i)break e;for(;t.sibling===null;){if(t.return===null||t.return===i)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(C){case"forwards":for(a=i.child,C=null;a!==null;)t=a.alternate,t!==null&&wu(t)===null&&(C=a),a=a.sibling;a=C,a===null?(C=i.child,i.child=null):(C=a.sibling,a.sibling=null),dp(i,!1,C,a,E,d);break;case"backwards":case"unstable_legacy-backwards":for(a=null,C=i.child,i.child=null;C!==null;){if(t=C.alternate,t!==null&&wu(t)===null){i.child=C;break}t=C.sibling,C.sibling=a,a=C,C=t}dp(i,!0,a,null,E,d);break;case"together":dp(i,!1,null,null,void 0,d);break;default:i.memoizedState=null}return i.child}function ai(t,i,a){if(t!==null&&(i.dependencies=t.dependencies),Ji|=i.lanes,(a&i.childLanes)===0)if(t!==null){if(Io(t,i,a,!1),(a&i.childLanes)===0)return null}else return null;if(t!==null&&i.child!==t.child)throw Error(s(153));if(i.child!==null){for(t=i.child,a=Ar(t,t.pendingProps),i.child=a,a.return=i;t.sibling!==null;)t=t.sibling,a=a.sibling=Ar(t,t.pendingProps),a.return=i;a.sibling=null}return i.child}function hp(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&mu(t)))}function UA(t,i,a){switch(i.tag){case 3:U(i,i.stateNode.containerInfo),qi(i,Gt,t.memoizedState.cache),Hs();break;case 27:case 5:oe(i);break;case 4:U(i,i.stateNode.containerInfo);break;case 10:qi(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Pf(i),null;break;case 13:var d=i.memoizedState;if(d!==null)return d.dehydrated!==null?(Wi(i),i.flags|=128,null):(a&i.child.childLanes)!==0?ty(t,i,a):(Wi(i),t=ai(t,i,a),t!==null?t.sibling:null);Wi(i);break;case 19:var C=(t.flags&128)!==0;if(d=(a&i.childLanes)!==0,d||(Io(t,i,a,!1),d=(a&i.childLanes)!==0),C){if(d)return ny(t,i,a);i.flags|=128}if(C=i.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),ne(Ft,Ft.current),d)break;return null;case 22:return i.lanes=0,Q_(t,i,a,i.pendingProps);case 24:qi(i,Gt,t.memoizedState.cache)}return ai(t,i,a)}function iy(t,i,a){if(t!==null)if(t.memoizedProps!==i.pendingProps)Yt=!0;else{if(!hp(t,a)&&(i.flags&128)===0)return Yt=!1,UA(t,i,a);Yt=(t.flags&131072)!==0}else Yt=!1,it&&(i.flags&1048576)!==0&&Iv(i,ul,i.index);switch(i.lanes=0,i.tag){case 16:e:{var d=i.pendingProps;if(t=zs(i.elementType),i.type=t,typeof t=="function")Lo(t)?(d=Qs(t,d),i.tag=1,i=X_(null,i,t,d,a)):(i.tag=0,i=sp(null,i,t,d,a));else{if(t!=null){var C=t.$$typeof;if(C===T){i.tag=11,i=Y_(null,i,t,d,a);break e}else if(C===L){i.tag=14,i=W_(null,i,t,d,a);break e}}throw i=F(t)||t,Error(s(306,i,""))}}return i;case 0:return sp(t,i,i.type,i.pendingProps,a);case 1:return d=i.type,C=Qs(d,i.pendingProps),X_(t,i,d,C,a);case 3:e:{if(U(i,i.stateNode.containerInfo),t===null)throw Error(s(387));d=i.pendingProps;var E=i.memoizedState;C=E.element,Lf(t,i),_l(i,d,null,a);var B=i.memoizedState;if(d=B.cache,qi(i,Gt,d),d!==E.cache&&Af(i,[Gt],a,!0),vl(),d=B.element,E.isDehydrated)if(E={element:d,isDehydrated:!1,cache:B.cache},i.updateQueue.baseState=E,i.memoizedState=E,i.flags&256){i=ey(t,i,d,a);break e}else if(d!==C){C=Qr(Error(s(424)),i),dl(C),i=ey(t,i,d,a);break e}else{switch(t=i.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(xt=en(t.firstChild),ir=i,it=!0,Hi=null,Zr=!0,a=Qv(i,null,d,a),i.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Hs(),d===C){i=ai(t,i,a);break e}or(t,i,d,a)}i=i.child}return i;case 26:return Bu(t,i),t===null?(a=m0(i.type,null,i.pendingProps,null))?i.memoizedState=a:it||(a=i.type,t=i.pendingProps,d=Ju(fe.current).createElement(a),d[Qt]=i,d[cr]=t,ar(d,a,t),Bt(d),i.stateNode=d):i.memoizedState=m0(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return oe(i),t===null&&it&&(d=i.stateNode=h0(i.type,i.pendingProps,fe.current),ir=i,Zr=!0,C=xt,rs(i.type)?(zp=C,xt=en(d.firstChild)):xt=C),or(t,i,i.pendingProps.children,a),Bu(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&&it&&((C=d=xt)&&(d=mT(d,i.type,i.pendingProps,Zr),d!==null?(i.stateNode=d,ir=i,xt=en(d.firstChild),Zr=!1,C=!0):C=!1),C||Vi(i)),oe(i),C=i.type,E=i.pendingProps,B=t!==null?t.memoizedProps:null,d=E.children,Fp(C,E)?d=null:B!==null&&Fp(C,B)&&(i.flags|=32),i.memoizedState!==null&&(C=Uf(t,i,MA,null,null,a),jl._currentValue=C),Bu(t,i),or(t,i,d,a),i.child;case 6:return t===null&&it&&((t=a=xt)&&(a=gT(a,i.pendingProps,Zr),a!==null?(i.stateNode=a,ir=i,xt=null,t=!0):t=!1),t||Vi(i)),null;case 13:return ty(t,i,a);case 4:return U(i,i.stateNode.containerInfo),d=i.pendingProps,t===null?i.child=Ws(i,null,d,a):or(t,i,d,a),i.child;case 11:return Y_(t,i,i.type,i.pendingProps,a);case 7:return or(t,i,i.pendingProps,a),i.child;case 8:return or(t,i,i.pendingProps.children,a),i.child;case 12:return or(t,i,i.pendingProps.children,a),i.child;case 10:return d=i.pendingProps,qi(i,i.type,d.value),or(t,i,d.children,a),i.child;case 9:return C=i.type._context,d=i.pendingProps.children,qs(i),C=sr(C),d=d(C),i.flags|=1,or(t,i,d,a),i.child;case 14:return W_(t,i,i.type,i.pendingProps,a);case 15:return K_(t,i,i.type,i.pendingProps,a);case 19:return ny(t,i,a);case 31:return jA(t,i,a);case 22:return Q_(t,i,a,i.pendingProps);case 24:return qs(i),d=sr(Gt),t===null?(C=Df(),C===null&&(C=bt,E=Tf(),C.pooledCache=E,E.refCount++,E!==null&&(C.pooledCacheLanes|=a),C=E),i.memoizedState={parent:d,cache:C},kf(i),qi(i,Gt,C)):((t.lanes&a)!==0&&(Lf(t,i),_l(i,null,null,a),vl()),C=t.memoizedState,E=i.memoizedState,C.parent!==d?(C={parent:d,cache:d},i.memoizedState=C,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=C),qi(i,Gt,d)):(d=E.cache,qi(i,Gt,d),d!==C.cache&&Af(i,[Gt],a,!0))),or(t,i,i.pendingProps.children,a),i.child;case 29:throw i.pendingProps}throw Error(s(156,i.tag))}function li(t){t.flags|=4}function fp(t,i,a,d,C){if((i=(t.mode&32)!==0)&&(i=!1),i){if(t.flags|=16777216,(C&335544128)===C)if(t.stateNode.complete)t.flags|=8192;else if(ky())t.flags|=8192;else throw Ys=yu,Mf}else t.flags&=-16777217}function sy(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!S0(i))if(ky())t.flags|=8192;else throw Ys=yu,Mf}function Iu(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?po():536870912,t.lanes|=i,Ko|=i)}function xl(t,i){if(!it)switch(t.tailMode){case"hidden":i=t.tail;for(var a=null;i!==null;)i.alternate!==null&&(a=i),i=i.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var d=null;a!==null;)a.alternate!==null&&(d=a),a=a.sibling;d===null?i||t.tail===null?t.tail=null:t.tail.sibling=null:d.sibling=null}}function Et(t){var i=t.alternate!==null&&t.alternate.child===t.child,a=0,d=0;if(i)for(var C=t.child;C!==null;)a|=C.lanes|C.childLanes,d|=C.subtreeFlags&65011712,d|=C.flags&65011712,C.return=t,C=C.sibling;else for(C=t.child;C!==null;)a|=C.lanes|C.childLanes,d|=C.subtreeFlags,d|=C.flags,C.return=t,C=C.sibling;return t.subtreeFlags|=d,t.childLanes=a,i}function FA(t,i,a){var d=i.pendingProps;switch(bf(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Et(i),null;case 1:return Et(i),null;case 3:return a=i.stateNode,d=null,t!==null&&(d=t.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),ii(Gt),ue(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(No(i)?li(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,wf())),Et(i),null;case 26:var C=i.type,E=i.memoizedState;return t===null?(li(i),E!==null?(Et(i),sy(i,E)):(Et(i),fp(i,C,null,d,a))):E?E!==t.memoizedState?(li(i),Et(i),sy(i,E)):(Et(i),i.flags&=-16777217):(t=t.memoizedProps,t!==d&&li(i),Et(i),fp(i,C,t,d,a)),null;case 27:if(de(i),a=fe.current,C=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==d&&li(i);else{if(!d){if(i.stateNode===null)throw Error(s(166));return Et(i),null}t=Z.current,No(i)?jv(i):(t=h0(C,d,a),i.stateNode=t,li(i))}return Et(i),null;case 5:if(de(i),C=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==d&&li(i);else{if(!d){if(i.stateNode===null)throw Error(s(166));return Et(i),null}if(E=Z.current,No(i))jv(i);else{var B=Ju(fe.current);switch(E){case 1:E=B.createElementNS("http://www.w3.org/2000/svg",C);break;case 2:E=B.createElementNS("http://www.w3.org/1998/Math/MathML",C);break;default:switch(C){case"svg":E=B.createElementNS("http://www.w3.org/2000/svg",C);break;case"math":E=B.createElementNS("http://www.w3.org/1998/Math/MathML",C);break;case"script":E=B.createElement("div"),E.innerHTML="<script><\/script>",E=E.removeChild(E.firstChild);break;case"select":E=typeof d.is=="string"?B.createElement("select",{is:d.is}):B.createElement("select"),d.multiple?E.multiple=!0:d.size&&(E.size=d.size);break;default:E=typeof d.is=="string"?B.createElement(C,{is:d.is}):B.createElement(C)}}E[Qt]=i,E[cr]=d;e:for(B=i.child;B!==null;){if(B.tag===5||B.tag===6)E.appendChild(B.stateNode);else if(B.tag!==4&&B.tag!==27&&B.child!==null){B.child.return=B,B=B.child;continue}if(B===i)break e;for(;B.sibling===null;){if(B.return===null||B.return===i)break e;B=B.return}B.sibling.return=B.return,B=B.sibling}i.stateNode=E;e:switch(ar(E,C,d),C){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&li(i)}}return Et(i),fp(i,i.type,t===null?null:t.memoizedProps,i.pendingProps,a),null;case 6:if(t&&i.stateNode!=null)t.memoizedProps!==d&&li(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(s(166));if(t=fe.current,No(i)){if(t=i.stateNode,a=i.memoizedProps,d=null,C=ir,C!==null)switch(C.tag){case 27:case 5:d=C.memoizedProps}t[Qt]=i,t=!!(t.nodeValue===a||d!==null&&d.suppressHydrationWarning===!0||t0(t.nodeValue,a)),t||Vi(i,!0)}else t=Ju(t).createTextNode(d),t[Qt]=i,i.stateNode=t}return Et(i),null;case 31:if(a=i.memoizedState,t===null||t.memoizedState!==null){if(d=No(i),a!==null){if(t===null){if(!d)throw Error(s(318));if(t=i.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[Qt]=i}else Hs(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Et(i),t=!1}else a=wf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return i.flags&256?(jr(i),i):(jr(i),null);if((i.flags&128)!==0)throw Error(s(558))}return Et(i),null;case 13:if(d=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(C=No(i),d!==null&&d.dehydrated!==null){if(t===null){if(!C)throw Error(s(318));if(C=i.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(s(317));C[Qt]=i}else Hs(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Et(i),C=!1}else C=wf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=C),C=!0;if(!C)return i.flags&256?(jr(i),i):(jr(i),null)}return jr(i),(i.flags&128)!==0?(i.lanes=a,i):(a=d!==null,t=t!==null&&t.memoizedState!==null,a&&(d=i.child,C=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(C=d.alternate.memoizedState.cachePool.pool),E=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(E=d.memoizedState.cachePool.pool),E!==C&&(d.flags|=2048)),a!==t&&a&&(i.child.flags|=8192),Iu(i,i.updateQueue),Et(i),null);case 4:return ue(),t===null&&Np(i.stateNode.containerInfo),Et(i),null;case 10:return ii(i.type),Et(i),null;case 19:if(q(Ft),d=i.memoizedState,d===null)return Et(i),null;if(C=(i.flags&128)!==0,E=d.rendering,E===null)if(C)xl(d,!1);else{if(jt!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(E=wu(t),E!==null){for(i.flags|=128,xl(d,!1),t=E.updateQueue,i.updateQueue=t,Iu(i,t),i.subtreeFlags=0,t=a,a=i.child;a!==null;)js(a,t),a=a.sibling;return ne(Ft,Ft.current&1|2),it&&ri(i,d.treeForkCount),i.child}t=t.sibling}d.tail!==null&&Ot()>Hu&&(i.flags|=128,C=!0,xl(d,!1),i.lanes=4194304)}else{if(!C)if(t=wu(E),t!==null){if(i.flags|=128,C=!0,t=t.updateQueue,i.updateQueue=t,Iu(i,t),xl(d,!0),d.tail===null&&d.tailMode==="hidden"&&!E.alternate&&!it)return Et(i),null}else 2*Ot()-d.renderingStartTime>Hu&&a!==536870912&&(i.flags|=128,C=!0,xl(d,!1),i.lanes=4194304);d.isBackwards?(E.sibling=i.child,i.child=E):(t=d.last,t!==null?t.sibling=E:i.child=E,d.last=E)}return d.tail!==null?(t=d.tail,d.rendering=t,d.tail=t.sibling,d.renderingStartTime=Ot(),t.sibling=null,a=Ft.current,ne(Ft,C?a&1|2:a&1),it&&ri(i,d.treeForkCount),t):(Et(i),null);case 22:case 23:return jr(i),If(),d=i.memoizedState!==null,t!==null?t.memoizedState!==null!==d&&(i.flags|=8192):d&&(i.flags|=8192),d?(a&536870912)!==0&&(i.flags&128)===0&&(Et(i),i.subtreeFlags&6&&(i.flags|=8192)):Et(i),a=i.updateQueue,a!==null&&Iu(i,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==a&&(i.flags|=2048),t!==null&&q(Gs),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),i.memoizedState.cache!==a&&(i.flags|=2048),ii(Gt),Et(i),null;case 25:return null;case 30:return null}throw Error(s(156,i.tag))}function HA(t,i){switch(bf(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return ii(Gt),ue(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 26:case 27:case 5:return de(i),null;case 31:if(i.memoizedState!==null){if(jr(i),i.alternate===null)throw Error(s(340));Hs()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 13:if(jr(i),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(s(340));Hs()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return q(Ft),null;case 4:return ue(),null;case 10:return ii(i.type),null;case 22:case 23:return jr(i),If(),t!==null&&q(Gs),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 24:return ii(Gt),null;case 25:return null;default:return null}}function oy(t,i){switch(bf(i),i.tag){case 3:ii(Gt),ue();break;case 26:case 27:case 5:de(i);break;case 4:ue();break;case 31:i.memoizedState!==null&&jr(i);break;case 13:jr(i);break;case 19:q(Ft);break;case 10:ii(i.type);break;case 22:case 23:jr(i),If(),t!==null&&q(Gs);break;case 24:ii(Gt)}}function El(t,i){try{var a=i.updateQueue,d=a!==null?a.lastEffect:null;if(d!==null){var C=d.next;a=C;do{if((a.tag&t)===t){d=void 0;var E=a.create,B=a.inst;d=E(),B.destroy=d}a=a.next}while(a!==C)}}catch(H){gt(i,i.return,H)}}function Qi(t,i,a){try{var d=i.updateQueue,C=d!==null?d.lastEffect:null;if(C!==null){var E=C.next;d=E;do{if((d.tag&t)===t){var B=d.inst,H=B.destroy;if(H!==void 0){B.destroy=void 0,C=i;var ie=a,me=H;try{me()}catch(Ce){gt(C,ie,Ce)}}}d=d.next}while(d!==E)}}catch(Ce){gt(i,i.return,Ce)}}function ay(t){var i=t.updateQueue;if(i!==null){var a=t.stateNode;try{Jv(i,a)}catch(d){gt(t,t.return,d)}}}function ly(t,i,a){a.props=Qs(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(d){gt(t,i,d)}}function Al(t,i){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var d=t.stateNode;break;case 30:d=t.stateNode;break;default:d=t.stateNode}typeof a=="function"?t.refCleanup=a(d):a.current=d}}catch(C){gt(t,i,C)}}function Mn(t,i){var a=t.ref,d=t.refCleanup;if(a!==null)if(typeof d=="function")try{d()}catch(C){gt(t,i,C)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(C){gt(t,i,C)}else a.current=null}function cy(t){var i=t.type,a=t.memoizedProps,d=t.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":a.autoFocus&&d.focus();break e;case"img":a.src?d.src=a.src:a.srcSet&&(d.srcset=a.srcSet)}}catch(C){gt(t,t.return,C)}}function pp(t,i,a){try{var d=t.stateNode;cT(d,t.type,a,i),d[cr]=i}catch(C){gt(t,t.return,C)}}function uy(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&rs(t.type)||t.tag===4}function mp(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||uy(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&rs(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function gp(t,i,a){var d=t.tag;if(d===5||d===6)t=t.stateNode,i?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,i):(i=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,i.appendChild(t),a=a._reactRootContainer,a!=null||i.onclick!==null||(i.onclick=hn));else if(d!==4&&(d===27&&rs(t.type)&&(a=t.stateNode,i=null),t=t.child,t!==null))for(gp(t,i,a),t=t.sibling;t!==null;)gp(t,i,a),t=t.sibling}function Pu(t,i,a){var d=t.tag;if(d===5||d===6)t=t.stateNode,i?a.insertBefore(t,i):a.appendChild(t);else if(d!==4&&(d===27&&rs(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(Pu(t,i,a),t=t.sibling;t!==null;)Pu(t,i,a),t=t.sibling}function dy(t){var i=t.stateNode,a=t.memoizedProps;try{for(var d=t.type,C=i.attributes;C.length;)i.removeAttributeNode(C[0]);ar(i,d,a),i[Qt]=t,i[cr]=a}catch(E){gt(t,t.return,E)}}var ci=!1,Wt=!1,vp=!1,hy=typeof WeakSet=="function"?WeakSet:Set,rr=null;function VA(t,i){if(t=t.containerInfo,jp=id,t=du(t),al(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var d=a.getSelection&&a.getSelection();if(d&&d.rangeCount!==0){a=d.anchorNode;var C=d.anchorOffset,E=d.focusNode;d=d.focusOffset;try{a.nodeType,E.nodeType}catch{a=null;break e}var B=0,H=-1,ie=-1,me=0,Ce=0,xe=t,ve=null;t:for(;;){for(var Se;xe!==a||C!==0&&xe.nodeType!==3||(H=B+C),xe!==E||d!==0&&xe.nodeType!==3||(ie=B+d),xe.nodeType===3&&(B+=xe.nodeValue.length),(Se=xe.firstChild)!==null;)ve=xe,xe=Se;for(;;){if(xe===t)break t;if(ve===a&&++me===C&&(H=B),ve===E&&++Ce===d&&(ie=B),(Se=xe.nextSibling)!==null)break;xe=ve,ve=xe.parentNode}xe=Se}a=H===-1||ie===-1?null:{start:H,end:ie}}else a=null}a=a||{start:0,end:0}}else a=null;for(Up={focusedElem:t,selectionRange:a},id=!1,rr=i;rr!==null;)if(i=rr,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,rr=t;else for(;rr!==null;){switch(i=rr,E=i.alternate,t=i.flags,i.tag){case 0:if((t&4)!==0&&(t=i.updateQueue,t=t!==null?t.events:null,t!==null))for(a=0;a<t.length;a++)C=t[a],C.ref.impl=C.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&E!==null){t=void 0,a=i,C=E.memoizedProps,E=E.memoizedState,d=a.stateNode;try{var ke=Qs(a.type,C);t=d.getSnapshotBeforeUpdate(ke,E),d.__reactInternalSnapshotBeforeUpdate=t}catch(Ue){gt(a,a.return,Ue)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,a=t.nodeType,a===9)Vp(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Vp(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(s(163))}if(t=i.sibling,t!==null){t.return=i.return,rr=t;break}rr=i.return}}function fy(t,i,a){var d=a.flags;switch(a.tag){case 0:case 11:case 15:di(t,a),d&4&&El(5,a);break;case 1:if(di(t,a),d&4)if(t=a.stateNode,i===null)try{t.componentDidMount()}catch(B){gt(a,a.return,B)}else{var C=Qs(a.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(C,i,t.__reactInternalSnapshotBeforeUpdate)}catch(B){gt(a,a.return,B)}}d&64&&ay(a),d&512&&Al(a,a.return);break;case 3:if(di(t,a),d&64&&(t=a.updateQueue,t!==null)){if(i=null,a.child!==null)switch(a.child.tag){case 27:case 5:i=a.child.stateNode;break;case 1:i=a.child.stateNode}try{Jv(t,i)}catch(B){gt(a,a.return,B)}}break;case 27:i===null&&d&4&&dy(a);case 26:case 5:di(t,a),i===null&&d&4&&cy(a),d&512&&Al(a,a.return);break;case 12:di(t,a);break;case 31:di(t,a),d&4&&gy(t,a);break;case 13:di(t,a),d&4&&vy(t,a),d&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=JA.bind(null,a),vT(t,a))));break;case 22:if(d=a.memoizedState!==null||ci,!d){i=i!==null&&i.memoizedState!==null||Wt,C=ci;var E=Wt;ci=d,(Wt=i)&&!E?hi(t,a,(a.subtreeFlags&8772)!==0):di(t,a),ci=C,Wt=E}break;case 30:break;default:di(t,a)}}function py(t){var i=t.alternate;i!==null&&(t.alternate=null,py(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&Fa(i)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Dt=null,Tr=!1;function ui(t,i,a){for(a=a.child;a!==null;)my(t,i,a),a=a.sibling}function my(t,i,a){if(er&&typeof er.onCommitFiberUnmount=="function")try{er.onCommitFiberUnmount(vr,a)}catch{}switch(a.tag){case 26:Wt||Mn(a,i),ui(t,i,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Wt||Mn(a,i);var d=Dt,C=Tr;rs(a.type)&&(Dt=a.stateNode,Tr=!1),ui(t,i,a),Nl(a.stateNode),Dt=d,Tr=C;break;case 5:Wt||Mn(a,i);case 6:if(d=Dt,C=Tr,Dt=null,ui(t,i,a),Dt=d,Tr=C,Dt!==null)if(Tr)try{(Dt.nodeType===9?Dt.body:Dt.nodeName==="HTML"?Dt.ownerDocument.body:Dt).removeChild(a.stateNode)}catch(E){gt(a,i,E)}else try{Dt.removeChild(a.stateNode)}catch(E){gt(a,i,E)}break;case 18:Dt!==null&&(Tr?(t=Dt,a0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),ra(t)):a0(Dt,a.stateNode));break;case 4:d=Dt,C=Tr,Dt=a.stateNode.containerInfo,Tr=!0,ui(t,i,a),Dt=d,Tr=C;break;case 0:case 11:case 14:case 15:Qi(2,a,i),Wt||Qi(4,a,i),ui(t,i,a);break;case 1:Wt||(Mn(a,i),d=a.stateNode,typeof d.componentWillUnmount=="function"&&ly(a,i,d)),ui(t,i,a);break;case 21:ui(t,i,a);break;case 22:Wt=(d=Wt)||a.memoizedState!==null,ui(t,i,a),Wt=d;break;default:ui(t,i,a)}}function gy(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ra(t)}catch(a){gt(i,i.return,a)}}}function vy(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ra(t)}catch(a){gt(i,i.return,a)}}function qA(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new hy),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new hy),i;default:throw Error(s(435,t.tag))}}function ju(t,i){var a=qA(t);i.forEach(function(d){if(!a.has(d)){a.add(d);var C=ZA.bind(null,t,d);d.then(C,C)}})}function Rr(t,i){var a=i.deletions;if(a!==null)for(var d=0;d<a.length;d++){var C=a[d],E=t,B=i,H=B;e:for(;H!==null;){switch(H.tag){case 27:if(rs(H.type)){Dt=H.stateNode,Tr=!1;break e}break;case 5:Dt=H.stateNode,Tr=!1;break e;case 3:case 4:Dt=H.stateNode.containerInfo,Tr=!0;break e}H=H.return}if(Dt===null)throw Error(s(160));my(E,B,C),Dt=null,Tr=!1,E=C.alternate,E!==null&&(E.return=null),C.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)_y(i,t),i=i.sibling}var mn=null;function _y(t,i){var a=t.alternate,d=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Rr(i,t),Dr(t),d&4&&(Qi(3,t,t.return),El(3,t),Qi(5,t,t.return));break;case 1:Rr(i,t),Dr(t),d&512&&(Wt||a===null||Mn(a,a.return)),d&64&&ci&&(t=t.updateQueue,t!==null&&(d=t.callbacks,d!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?d:a.concat(d))));break;case 26:var C=mn;if(Rr(i,t),Dr(t),d&512&&(Wt||a===null||Mn(a,a.return)),d&4){var E=a!==null?a.memoizedState:null;if(d=t.memoizedState,a===null)if(d===null)if(t.stateNode===null){e:{d=t.type,a=t.memoizedProps,C=C.ownerDocument||C;t:switch(d){case"title":E=C.getElementsByTagName("title")[0],(!E||E[Es]||E[Qt]||E.namespaceURI==="http://www.w3.org/2000/svg"||E.hasAttribute("itemprop"))&&(E=C.createElement(d),C.head.insertBefore(E,C.querySelector("head > title"))),ar(E,d,a),E[Qt]=t,Bt(E),d=E;break e;case"link":var B=_0("link","href",C).get(d+(a.href||""));if(B){for(var H=0;H<B.length;H++)if(E=B[H],E.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&E.getAttribute("rel")===(a.rel==null?null:a.rel)&&E.getAttribute("title")===(a.title==null?null:a.title)&&E.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){B.splice(H,1);break t}}E=C.createElement(d),ar(E,d,a),C.head.appendChild(E);break;case"meta":if(B=_0("meta","content",C).get(d+(a.content||""))){for(H=0;H<B.length;H++)if(E=B[H],E.getAttribute("content")===(a.content==null?null:""+a.content)&&E.getAttribute("name")===(a.name==null?null:a.name)&&E.getAttribute("property")===(a.property==null?null:a.property)&&E.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&E.getAttribute("charset")===(a.charSet==null?null:a.charSet)){B.splice(H,1);break t}}E=C.createElement(d),ar(E,d,a),C.head.appendChild(E);break;default:throw Error(s(468,d))}E[Qt]=t,Bt(E),d=E}t.stateNode=d}else y0(C,t.type,t.stateNode);else t.stateNode=v0(C,d,t.memoizedProps);else E!==d?(E===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):E.count--,d===null?y0(C,t.type,t.stateNode):v0(C,d,t.memoizedProps)):d===null&&t.stateNode!==null&&pp(t,t.memoizedProps,a.memoizedProps)}break;case 27:Rr(i,t),Dr(t),d&512&&(Wt||a===null||Mn(a,a.return)),a!==null&&d&4&&pp(t,t.memoizedProps,a.memoizedProps);break;case 5:if(Rr(i,t),Dr(t),d&512&&(Wt||a===null||Mn(a,a.return)),t.flags&32){C=t.stateNode;try{$n(C,"")}catch(ke){gt(t,t.return,ke)}}d&4&&t.stateNode!=null&&(C=t.memoizedProps,pp(t,C,a!==null?a.memoizedProps:C)),d&1024&&(vp=!0);break;case 6:if(Rr(i,t),Dr(t),d&4){if(t.stateNode===null)throw Error(s(162));d=t.memoizedProps,a=t.stateNode;try{a.nodeValue=d}catch(ke){gt(t,t.return,ke)}}break;case 3:if(ed=null,C=mn,mn=Zu(i.containerInfo),Rr(i,t),mn=C,Dr(t),d&4&&a!==null&&a.memoizedState.isDehydrated)try{ra(i.containerInfo)}catch(ke){gt(t,t.return,ke)}vp&&(vp=!1,yy(t));break;case 4:d=mn,mn=Zu(t.stateNode.containerInfo),Rr(i,t),Dr(t),mn=d;break;case 12:Rr(i,t),Dr(t);break;case 31:Rr(i,t),Dr(t),d&4&&(d=t.updateQueue,d!==null&&(t.updateQueue=null,ju(t,d)));break;case 13:Rr(i,t),Dr(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Fu=Ot()),d&4&&(d=t.updateQueue,d!==null&&(t.updateQueue=null,ju(t,d)));break;case 22:C=t.memoizedState!==null;var ie=a!==null&&a.memoizedState!==null,me=ci,Ce=Wt;if(ci=me||C,Wt=Ce||ie,Rr(i,t),Wt=Ce,ci=me,Dr(t),d&8192)e:for(i=t.stateNode,i._visibility=C?i._visibility&-2:i._visibility|1,C&&(a===null||ie||ci||Wt||$s(t)),a=null,i=t;;){if(i.tag===5||i.tag===26){if(a===null){ie=a=i;try{if(E=ie.stateNode,C)B=E.style,typeof B.setProperty=="function"?B.setProperty("display","none","important"):B.display="none";else{H=ie.stateNode;var xe=ie.memoizedProps.style,ve=xe!=null&&xe.hasOwnProperty("display")?xe.display:null;H.style.display=ve==null||typeof ve=="boolean"?"":(""+ve).trim()}}catch(ke){gt(ie,ie.return,ke)}}}else if(i.tag===6){if(a===null){ie=i;try{ie.stateNode.nodeValue=C?"":ie.memoizedProps}catch(ke){gt(ie,ie.return,ke)}}}else if(i.tag===18){if(a===null){ie=i;try{var Se=ie.stateNode;C?l0(Se,!0):l0(ie.stateNode,!1)}catch(ke){gt(ie,ie.return,ke)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===t)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;a===i&&(a=null),i=i.return}a===i&&(a=null),i.sibling.return=i.return,i=i.sibling}d&4&&(d=t.updateQueue,d!==null&&(a=d.retryQueue,a!==null&&(d.retryQueue=null,ju(t,a))));break;case 19:Rr(i,t),Dr(t),d&4&&(d=t.updateQueue,d!==null&&(t.updateQueue=null,ju(t,d)));break;case 30:break;case 21:break;default:Rr(i,t),Dr(t)}}function Dr(t){var i=t.flags;if(i&2){try{for(var a,d=t.return;d!==null;){if(uy(d)){a=d;break}d=d.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var C=a.stateNode,E=mp(t);Pu(t,E,C);break;case 5:var B=a.stateNode;a.flags&32&&($n(B,""),a.flags&=-33);var H=mp(t);Pu(t,H,B);break;case 3:case 4:var ie=a.stateNode.containerInfo,me=mp(t);gp(t,me,ie);break;default:throw Error(s(161))}}catch(Ce){gt(t,t.return,Ce)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function yy(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;yy(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),t=t.sibling}}function di(t,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)fy(t,i.alternate,i),i=i.sibling}function $s(t){for(t=t.child;t!==null;){var i=t;switch(i.tag){case 0:case 11:case 14:case 15:Qi(4,i,i.return),$s(i);break;case 1:Mn(i,i.return);var a=i.stateNode;typeof a.componentWillUnmount=="function"&&ly(i,i.return,a),$s(i);break;case 27:Nl(i.stateNode);case 26:case 5:Mn(i,i.return),$s(i);break;case 22:i.memoizedState===null&&$s(i);break;case 30:$s(i);break;default:$s(i)}t=t.sibling}}function hi(t,i,a){for(a=a&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var d=i.alternate,C=t,E=i,B=E.flags;switch(E.tag){case 0:case 11:case 15:hi(C,E,a),El(4,E);break;case 1:if(hi(C,E,a),d=E,C=d.stateNode,typeof C.componentDidMount=="function")try{C.componentDidMount()}catch(me){gt(d,d.return,me)}if(d=E,C=d.updateQueue,C!==null){var H=d.stateNode;try{var ie=C.shared.hiddenCallbacks;if(ie!==null)for(C.shared.hiddenCallbacks=null,C=0;C<ie.length;C++)$v(ie[C],H)}catch(me){gt(d,d.return,me)}}a&&B&64&&ay(E),Al(E,E.return);break;case 27:dy(E);case 26:case 5:hi(C,E,a),a&&d===null&&B&4&&cy(E),Al(E,E.return);break;case 12:hi(C,E,a);break;case 31:hi(C,E,a),a&&B&4&&gy(C,E);break;case 13:hi(C,E,a),a&&B&4&&vy(C,E);break;case 22:E.memoizedState===null&&hi(C,E,a),Al(E,E.return);break;case 30:break;default:hi(C,E,a)}i=i.sibling}}function _p(t,i){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(t=i.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&hl(a))}function yp(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&hl(t))}function gn(t,i,a,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Sy(t,i,a,d),i=i.sibling}function Sy(t,i,a,d){var C=i.flags;switch(i.tag){case 0:case 11:case 15:gn(t,i,a,d),C&2048&&El(9,i);break;case 1:gn(t,i,a,d);break;case 3:gn(t,i,a,d),C&2048&&(t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&hl(t)));break;case 12:if(C&2048){gn(t,i,a,d),t=i.stateNode;try{var E=i.memoizedProps,B=E.id,H=E.onPostCommit;typeof H=="function"&&H(B,i.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(ie){gt(i,i.return,ie)}}else gn(t,i,a,d);break;case 31:gn(t,i,a,d);break;case 13:gn(t,i,a,d);break;case 23:break;case 22:E=i.stateNode,B=i.alternate,i.memoizedState!==null?E._visibility&2?gn(t,i,a,d):Tl(t,i):E._visibility&2?gn(t,i,a,d):(E._visibility|=2,zo(t,i,a,d,(i.subtreeFlags&10256)!==0||!1)),C&2048&&_p(B,i);break;case 24:gn(t,i,a,d),C&2048&&yp(i.alternate,i);break;default:gn(t,i,a,d)}}function zo(t,i,a,d,C){for(C=C&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var E=t,B=i,H=a,ie=d,me=B.flags;switch(B.tag){case 0:case 11:case 15:zo(E,B,H,ie,C),El(8,B);break;case 23:break;case 22:var Ce=B.stateNode;B.memoizedState!==null?Ce._visibility&2?zo(E,B,H,ie,C):Tl(E,B):(Ce._visibility|=2,zo(E,B,H,ie,C)),C&&me&2048&&_p(B.alternate,B);break;case 24:zo(E,B,H,ie,C),C&&me&2048&&yp(B.alternate,B);break;default:zo(E,B,H,ie,C)}i=i.sibling}}function Tl(t,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var a=t,d=i,C=d.flags;switch(d.tag){case 22:Tl(a,d),C&2048&&_p(d.alternate,d);break;case 24:Tl(a,d),C&2048&&yp(d.alternate,d);break;default:Tl(a,d)}i=i.sibling}}var Rl=8192;function Yo(t,i,a){if(t.subtreeFlags&Rl)for(t=t.child;t!==null;)by(t,i,a),t=t.sibling}function by(t,i,a){switch(t.tag){case 26:Yo(t,i,a),t.flags&Rl&&t.memoizedState!==null&&DT(a,mn,t.memoizedState,t.memoizedProps);break;case 5:Yo(t,i,a);break;case 3:case 4:var d=mn;mn=Zu(t.stateNode.containerInfo),Yo(t,i,a),mn=d;break;case 22:t.memoizedState===null&&(d=t.alternate,d!==null&&d.memoizedState!==null?(d=Rl,Rl=16777216,Yo(t,i,a),Rl=d):Yo(t,i,a));break;default:Yo(t,i,a)}}function Cy(t){var i=t.alternate;if(i!==null&&(t=i.child,t!==null)){i.child=null;do i=t.sibling,t.sibling=null,t=i;while(t!==null)}}function Dl(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var a=0;a<i.length;a++){var d=i[a];rr=d,xy(d,t)}Cy(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)wy(t),t=t.sibling}function wy(t){switch(t.tag){case 0:case 11:case 15:Dl(t),t.flags&2048&&Qi(9,t,t.return);break;case 3:Dl(t);break;case 12:Dl(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,Uu(t)):Dl(t);break;default:Dl(t)}}function Uu(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var a=0;a<i.length;a++){var d=i[a];rr=d,xy(d,t)}Cy(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:Qi(8,i,i.return),Uu(i);break;case 22:a=i.stateNode,a._visibility&2&&(a._visibility&=-3,Uu(i));break;default:Uu(i)}t=t.sibling}}function xy(t,i){for(;rr!==null;){var a=rr;switch(a.tag){case 0:case 11:case 15:Qi(8,a,i);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var d=a.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:hl(a.memoizedState.cache)}if(d=a.child,d!==null)d.return=a,rr=d;else e:for(a=t;rr!==null;){d=rr;var C=d.sibling,E=d.return;if(py(d),d===a){rr=null;break e}if(C!==null){C.return=E,rr=C;break e}rr=E}}}var GA={getCacheForType:function(t){var i=sr(Gt),a=i.data.get(t);return a===void 0&&(a=t(),i.data.set(t,a)),a},cacheSignal:function(){return sr(Gt).controller.signal}},zA=typeof WeakMap=="function"?WeakMap:Map,ft=0,bt=null,Xe=null,tt=0,mt=0,Ur=null,$i=!1,Wo=!1,Sp=!1,fi=0,jt=0,Ji=0,Js=0,bp=0,Fr=0,Ko=0,Ml=null,Mr=null,Cp=!1,Fu=0,Ey=0,Hu=1/0,Vu=null,Zi=null,$t=0,Xi=null,Qo=null,pi=0,wp=0,xp=null,Ay=null,kl=0,Ep=null;function Hr(){return(ft&2)!==0&&tt!==0?tt&-tt:Y.T!==null?kp():Na()}function Ty(){if(Fr===0)if((tt&536870912)===0||it){var t=xn;xn<<=1,(xn&3932160)===0&&(xn=262144),Fr=t}else Fr=536870912;return t=Pr.current,t!==null&&(t.flags|=32),Fr}function kr(t,i,a){(t===bt&&(mt===2||mt===9)||t.cancelPendingCommit!==null)&&($o(t,0),es(t,tt,Fr,!1)),Ri(t,a),((ft&2)===0||t!==bt)&&(t===bt&&((ft&2)===0&&(Js|=a),jt===4&&es(t,tt,Fr,!1)),kn(t))}function Ry(t,i,a){if((ft&6)!==0)throw Error(s(327));var d=!a&&(i&127)===0&&(i&t.expiredLanes)===0||Cs(t,i),C=d?KA(t,i):Tp(t,i,!0),E=d;do{if(C===0){Wo&&!d&&es(t,i,0,!1);break}else{if(a=t.current.alternate,E&&!YA(a)){C=Tp(t,i,!1),E=!1;continue}if(C===2){if(E=i,t.errorRecoveryDisabledLanes&E)var B=0;else B=t.pendingLanes&-536870913,B=B!==0?B:B&536870912?536870912:0;if(B!==0){i=B;e:{var H=t;C=Ml;var ie=H.current.memoizedState.isDehydrated;if(ie&&($o(H,B).flags|=256),B=Tp(H,B,!1),B!==2){if(Sp&&!ie){H.errorRecoveryDisabledLanes|=E,Js|=E,C=4;break e}E=Mr,Mr=C,E!==null&&(Mr===null?Mr=E:Mr.push.apply(Mr,E))}C=B}if(E=!1,C!==2)continue}}if(C===1){$o(t,0),es(t,i,0,!0);break}e:{switch(d=t,E=C,E){case 0:case 1:throw Error(s(345));case 4:if((i&4194048)!==i)break;case 6:es(d,i,Fr,!$i);break e;case 2:Mr=null;break;case 3:case 5:break;default:throw Error(s(329))}if((i&62914560)===i&&(C=Fu+300-Ot(),10<C)){if(es(d,i,Fr,!$i),_r(d,0,!0)!==0)break e;pi=i,d.timeoutHandle=s0(Dy.bind(null,d,a,Mr,Vu,Cp,i,Fr,Js,Ko,$i,E,"Throttled",-0,0),C);break e}Dy(d,a,Mr,Vu,Cp,i,Fr,Js,Ko,$i,E,null,-0,0)}}break}while(!0);kn(t)}function Dy(t,i,a,d,C,E,B,H,ie,me,Ce,xe,ve,Se){if(t.timeoutHandle=-1,xe=i.subtreeFlags,xe&8192||(xe&16785408)===16785408){xe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:hn},by(i,E,xe);var ke=(E&62914560)===E?Fu-Ot():(E&4194048)===E?Ey-Ot():0;if(ke=MT(xe,ke),ke!==null){pi=E,t.cancelPendingCommit=ke(Py.bind(null,t,i,E,a,d,C,B,H,ie,Ce,xe,null,ve,Se)),es(t,E,B,!me);return}}Py(t,i,E,a,d,C,B,H,ie)}function YA(t){for(var i=t;;){var a=i.tag;if((a===0||a===11||a===15)&&i.flags&16384&&(a=i.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var d=0;d<a.length;d++){var C=a[d],E=C.getSnapshot;C=C.value;try{if(!yr(E(),C))return!1}catch{return!1}}if(a=i.child,i.subtreeFlags&16384&&a!==null)a.return=i,i=a;else{if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function es(t,i,a,d){i&=~bp,i&=~Js,t.suspendedLanes|=i,t.pingedLanes&=~i,d&&(t.warmLanes|=i),d=t.expirationTimes;for(var C=i;0<C;){var E=31-tr(C),B=1<<E;d[E]=-1,C&=~B}a!==0&&Ba(t,a,i)}function qu(){return(ft&6)===0?(Ll(0),!1):!0}function Ap(){if(Xe!==null){if(mt===0)var t=Xe.return;else t=Xe,ni=Vs=null,Vf(t),Fo=null,pl=0,t=Xe;for(;t!==null;)oy(t.alternate,t),t=t.return;Xe=null}}function $o(t,i){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,hT(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),pi=0,Ap(),bt=t,Xe=a=Ar(t.current,null),tt=i,mt=0,Ur=null,$i=!1,Wo=Cs(t,i),Sp=!1,Ko=Fr=bp=Js=Ji=jt=0,Mr=Ml=null,Cp=!1,(i&8)!==0&&(i|=i&32);var d=t.entangledLanes;if(d!==0)for(t=t.entanglements,d&=i;0<d;){var C=31-tr(d),E=1<<C;i|=t[C],d&=~E}return fi=i,pt(),a}function My(t,i){Ge=null,Y.H=Cl,i===Uo||i===_u?(i=Yv(),mt=3):i===Mf?(i=Yv(),mt=4):mt=i===ip?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Ur=i,Xe===null&&(jt=1,Lu(t,Qr(i,t.current)))}function ky(){var t=Pr.current;return t===null?!0:(tt&4194048)===tt?Xr===null:(tt&62914560)===tt||(tt&536870912)!==0?t===Xr:!1}function Ly(){var t=Y.H;return Y.H=Cl,t===null?Cl:t}function Oy(){var t=Y.A;return Y.A=GA,t}function Gu(){jt=4,$i||(tt&4194048)!==tt&&Pr.current!==null||(Wo=!0),(Ji&134217727)===0&&(Js&134217727)===0||bt===null||es(bt,tt,Fr,!1)}function Tp(t,i,a){var d=ft;ft|=2;var C=Ly(),E=Oy();(bt!==t||tt!==i)&&(Vu=null,$o(t,i)),i=!1;var B=jt;e:do try{if(mt!==0&&Xe!==null){var H=Xe,ie=Ur;switch(mt){case 8:Ap(),B=6;break e;case 3:case 2:case 9:case 6:Pr.current===null&&(i=!0);var me=mt;if(mt=0,Ur=null,Jo(t,H,ie,me),a&&Wo){B=0;break e}break;default:me=mt,mt=0,Ur=null,Jo(t,H,ie,me)}}WA(),B=jt;break}catch(Ce){My(t,Ce)}while(!0);return i&&t.shellSuspendCounter++,ni=Vs=null,ft=d,Y.H=C,Y.A=E,Xe===null&&(bt=null,tt=0,pt()),B}function WA(){for(;Xe!==null;)By(Xe)}function KA(t,i){var a=ft;ft|=2;var d=Ly(),C=Oy();bt!==t||tt!==i?(Vu=null,Hu=Ot()+500,$o(t,i)):Wo=Cs(t,i);e:do try{if(mt!==0&&Xe!==null){i=Xe;var E=Ur;t:switch(mt){case 1:mt=0,Ur=null,Jo(t,i,E,1);break;case 2:case 9:if(Gv(E)){mt=0,Ur=null,Ny(i);break}i=function(){mt!==2&&mt!==9||bt!==t||(mt=7),kn(t)},E.then(i,i);break e;case 3:mt=7;break e;case 4:mt=5;break e;case 7:Gv(E)?(mt=0,Ur=null,Ny(i)):(mt=0,Ur=null,Jo(t,i,E,7));break;case 5:var B=null;switch(Xe.tag){case 26:B=Xe.memoizedState;case 5:case 27:var H=Xe;if(B?S0(B):H.stateNode.complete){mt=0,Ur=null;var ie=H.sibling;if(ie!==null)Xe=ie;else{var me=H.return;me!==null?(Xe=me,zu(me)):Xe=null}break t}}mt=0,Ur=null,Jo(t,i,E,5);break;case 6:mt=0,Ur=null,Jo(t,i,E,6);break;case 8:Ap(),jt=6;break e;default:throw Error(s(462))}}QA();break}catch(Ce){My(t,Ce)}while(!0);return ni=Vs=null,Y.H=d,Y.A=C,ft=a,Xe!==null?0:(bt=null,tt=0,pt(),jt)}function QA(){for(;Xe!==null&&!bn();)By(Xe)}function By(t){var i=iy(t.alternate,t,fi);t.memoizedProps=t.pendingProps,i===null?zu(t):Xe=i}function Ny(t){var i=t,a=i.alternate;switch(i.tag){case 15:case 0:i=Z_(a,i,i.pendingProps,i.type,void 0,tt);break;case 11:i=Z_(a,i,i.pendingProps,i.type.render,i.ref,tt);break;case 5:Vf(i);default:oy(a,i),i=Xe=js(i,fi),i=iy(a,i,fi)}t.memoizedProps=t.pendingProps,i===null?zu(t):Xe=i}function Jo(t,i,a,d){ni=Vs=null,Vf(i),Fo=null,pl=0;var C=i.return;try{if(PA(t,C,i,a,tt)){jt=1,Lu(t,Qr(a,t.current)),Xe=null;return}}catch(E){if(C!==null)throw Xe=C,E;jt=1,Lu(t,Qr(a,t.current)),Xe=null;return}i.flags&32768?(it||d===1?t=!0:Wo||(tt&536870912)!==0?t=!1:($i=t=!0,(d===2||d===9||d===3||d===6)&&(d=Pr.current,d!==null&&d.tag===13&&(d.flags|=16384))),Iy(i,t)):zu(i)}function zu(t){var i=t;do{if((i.flags&32768)!==0){Iy(i,$i);return}t=i.return;var a=FA(i.alternate,i,fi);if(a!==null){Xe=a;return}if(i=i.sibling,i!==null){Xe=i;return}Xe=i=t}while(i!==null);jt===0&&(jt=5)}function Iy(t,i){do{var a=HA(t.alternate,t);if(a!==null){a.flags&=32767,Xe=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!i&&(t=t.sibling,t!==null)){Xe=t;return}Xe=t=a}while(t!==null);jt=6,Xe=null}function Py(t,i,a,d,C,E,B,H,ie){t.cancelPendingCommit=null;do Yu();while($t!==0);if((ft&6)!==0)throw Error(s(327));if(i!==null){if(i===t.current)throw Error(s(177));if(E=i.lanes|i.childLanes,E|=Ct,Hh(t,a,E,B,H,ie),t===bt&&(Xe=bt=null,tt=0),Qo=i,Xi=t,pi=a,wp=E,xp=C,Ay=d,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,XA(mr,function(){return Vy(),null})):(t.callbackNode=null,t.callbackPriority=0),d=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||d){d=Y.T,Y.T=null,C=re.p,re.p=2,B=ft,ft|=4;try{VA(t,i,a)}finally{ft=B,re.p=C,Y.T=d}}$t=1,jy(),Uy(),Fy()}}function jy(){if($t===1){$t=0;var t=Xi,i=Qo,a=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||a){a=Y.T,Y.T=null;var d=re.p;re.p=2;var C=ft;ft|=4;try{_y(i,t);var E=Up,B=du(t.containerInfo),H=E.focusedElem,ie=E.selectionRange;if(B!==H&&H&&H.ownerDocument&&uu(H.ownerDocument.documentElement,H)){if(ie!==null&&al(H)){var me=ie.start,Ce=ie.end;if(Ce===void 0&&(Ce=me),"selectionStart"in H)H.selectionStart=me,H.selectionEnd=Math.min(Ce,H.value.length);else{var xe=H.ownerDocument||document,ve=xe&&xe.defaultView||window;if(ve.getSelection){var Se=ve.getSelection(),ke=H.textContent.length,Ue=Math.min(ie.start,ke),St=ie.end===void 0?Ue:Math.min(ie.end,ke);!Se.extend&&Ue>St&&(B=St,St=Ue,Ue=B);var ce=cu(H,Ue),ae=cu(H,St);if(ce&&ae&&(Se.rangeCount!==1||Se.anchorNode!==ce.node||Se.anchorOffset!==ce.offset||Se.focusNode!==ae.node||Se.focusOffset!==ae.offset)){var pe=xe.createRange();pe.setStart(ce.node,ce.offset),Se.removeAllRanges(),Ue>St?(Se.addRange(pe),Se.extend(ae.node,ae.offset)):(pe.setEnd(ae.node,ae.offset),Se.addRange(pe))}}}}for(xe=[],Se=H;Se=Se.parentNode;)Se.nodeType===1&&xe.push({element:Se,left:Se.scrollLeft,top:Se.scrollTop});for(typeof H.focus=="function"&&H.focus(),H=0;H<xe.length;H++){var we=xe[H];we.element.scrollLeft=we.left,we.element.scrollTop=we.top}}id=!!jp,Up=jp=null}finally{ft=C,re.p=d,Y.T=a}}t.current=i,$t=2}}function Uy(){if($t===2){$t=0;var t=Xi,i=Qo,a=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||a){a=Y.T,Y.T=null;var d=re.p;re.p=2;var C=ft;ft|=4;try{fy(t,i.alternate,i)}finally{ft=C,re.p=d,Y.T=a}}$t=3}}function Fy(){if($t===4||$t===3){$t=0,Xt();var t=Xi,i=Qo,a=pi,d=Ay;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?$t=5:($t=0,Qo=Xi=null,Hy(t,t.pendingLanes));var C=t.pendingLanes;if(C===0&&(Zi=null),xs(a),i=i.stateNode,er&&typeof er.onCommitFiberRoot=="function")try{er.onCommitFiberRoot(vr,i,void 0,(i.current.flags&128)===128)}catch{}if(d!==null){i=Y.T,C=re.p,re.p=2,Y.T=null;try{for(var E=t.onRecoverableError,B=0;B<d.length;B++){var H=d[B];E(H.value,{componentStack:H.stack})}}finally{Y.T=i,re.p=C}}(pi&3)!==0&&Yu(),kn(t),C=t.pendingLanes,(a&261930)!==0&&(C&42)!==0?t===Ep?kl++:(kl=0,Ep=t):kl=0,Ll(0)}}function Hy(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,hl(i)))}function Yu(){return jy(),Uy(),Fy(),Vy()}function Vy(){if($t!==5)return!1;var t=Xi,i=wp;wp=0;var a=xs(pi),d=Y.T,C=re.p;try{re.p=32>a?32:a,Y.T=null,a=xp,xp=null;var E=Xi,B=pi;if($t=0,Qo=Xi=null,pi=0,(ft&6)!==0)throw Error(s(331));var H=ft;if(ft|=4,wy(E.current),Sy(E,E.current,B,a),ft=H,Ll(0,!1),er&&typeof er.onPostCommitFiberRoot=="function")try{er.onPostCommitFiberRoot(vr,E)}catch{}return!0}finally{re.p=C,Y.T=d,Hy(t,i)}}function qy(t,i,a){i=Qr(a,i),i=np(t.stateNode,i,2),t=Yi(t,i,2),t!==null&&(Ri(t,2),kn(t))}function gt(t,i,a){if(t.tag===3)qy(t,t,a);else for(;i!==null;){if(i.tag===3){qy(i,t,a);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Zi===null||!Zi.has(d))){t=Qr(a,t),a=G_(2),d=Yi(i,a,2),d!==null&&(z_(a,d,i,t),Ri(d,2),kn(d));break}}i=i.return}}function Rp(t,i,a){var d=t.pingCache;if(d===null){d=t.pingCache=new zA;var C=new Set;d.set(i,C)}else C=d.get(i),C===void 0&&(C=new Set,d.set(i,C));C.has(a)||(Sp=!0,C.add(a),t=$A.bind(null,t,i,a),i.then(t,t))}function $A(t,i,a){var d=t.pingCache;d!==null&&d.delete(i),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,bt===t&&(tt&a)===a&&(jt===4||jt===3&&(tt&62914560)===tt&&300>Ot()-Fu?(ft&2)===0&&$o(t,0):bp|=a,Ko===tt&&(Ko=0)),kn(t)}function Gy(t,i){i===0&&(i=po()),t=Nt(t,i),t!==null&&(Ri(t,i),kn(t))}function JA(t){var i=t.memoizedState,a=0;i!==null&&(a=i.retryLane),Gy(t,a)}function ZA(t,i){var a=0;switch(t.tag){case 31:case 13:var d=t.stateNode,C=t.memoizedState;C!==null&&(a=C.retryLane);break;case 19:d=t.stateNode;break;case 22:d=t.stateNode._retryCache;break;default:throw Error(s(314))}d!==null&&d.delete(i),Gy(t,a)}function XA(t,i){return Vt(t,i)}var Wu=null,Zo=null,Dp=!1,Ku=!1,Mp=!1,ts=0;function kn(t){t!==Zo&&t.next===null&&(Zo===null?Wu=Zo=t:Zo=Zo.next=t),Ku=!0,Dp||(Dp=!0,tT())}function Ll(t,i){if(!Mp&&Ku){Mp=!0;do for(var a=!1,d=Wu;d!==null;){if(t!==0){var C=d.pendingLanes;if(C===0)var E=0;else{var B=d.suspendedLanes,H=d.pingedLanes;E=(1<<31-tr(42|t)+1)-1,E&=C&~(B&~H),E=E&201326741?E&201326741|1:E?E|2:0}E!==0&&(a=!0,Ky(d,E))}else E=tt,E=_r(d,d===bt?E:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(E&3)===0||Cs(d,E)||(a=!0,Ky(d,E));d=d.next}while(a);Mp=!1}}function eT(){zy()}function zy(){Ku=Dp=!1;var t=0;ts!==0&&dT()&&(t=ts);for(var i=Ot(),a=null,d=Wu;d!==null;){var C=d.next,E=Yy(d,i);E===0?(d.next=null,a===null?Wu=C:a.next=C,C===null&&(Zo=a)):(a=d,(t!==0||(E&3)!==0)&&(Ku=!0)),d=C}$t!==0&&$t!==5||Ll(t),ts!==0&&(ts=0)}function Yy(t,i){for(var a=t.suspendedLanes,d=t.pingedLanes,C=t.expirationTimes,E=t.pendingLanes&-62914561;0<E;){var B=31-tr(E),H=1<<B,ie=C[B];ie===-1?((H&a)===0||(H&d)!==0)&&(C[B]=Fh(H,i)):ie<=i&&(t.expiredLanes|=H),E&=~H}if(i=bt,a=tt,a=_r(t,t===i?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),d=t.callbackNode,a===0||t===i&&(mt===2||mt===9)||t.cancelPendingCommit!==null)return d!==null&&d!==null&&Rt(d),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||Cs(t,a)){if(i=a&-a,i===t.callbackPriority)return i;switch(d!==null&&Rt(d),xs(a)){case 2:case 8:a=Cn;break;case 32:a=mr;break;case 268435456:a=gr;break;default:a=mr}return d=Wy.bind(null,t),a=Vt(a,d),t.callbackPriority=i,t.callbackNode=a,i}return d!==null&&d!==null&&Rt(d),t.callbackPriority=2,t.callbackNode=null,2}function Wy(t,i){if($t!==0&&$t!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(Yu()&&t.callbackNode!==a)return null;var d=tt;return d=_r(t,t===bt?d:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),d===0?null:(Ry(t,d,i),Yy(t,Ot()),t.callbackNode!=null&&t.callbackNode===a?Wy.bind(null,t):null)}function Ky(t,i){if(Yu())return null;Ry(t,i,!0)}function tT(){fT(function(){(ft&6)!==0?Vt(Yr,eT):zy()})}function kp(){if(ts===0){var t=Po;t===0&&(t=qt,qt<<=1,(qt&261888)===0&&(qt=256)),ts=t}return ts}function Qy(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:wo(""+t)}function $y(t,i){var a=i.ownerDocument.createElement("input");return a.name=i.name,a.value=i.value,t.id&&a.setAttribute("form",t.id),i.parentNode.insertBefore(a,i),t=new FormData(t),a.parentNode.removeChild(a),t}function rT(t,i,a,d,C){if(i==="submit"&&a&&a.stateNode===C){var E=Qy((C[cr]||null).action),B=d.submitter;B&&(i=(i=B[cr]||null)?Qy(i.formAction):B.getAttribute("formAction"),i!==null&&(E=i,B=null));var H=new Bi("action","action",null,d,C);t.push({event:H,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(ts!==0){var ie=B?$y(C,B):new FormData(C);Jf(a,{pending:!0,data:ie,method:C.method,action:E},null,ie)}}else typeof E=="function"&&(H.preventDefault(),ie=B?$y(C,B):new FormData(C),Jf(a,{pending:!0,data:ie,method:C.method,action:E},E,ie))},currentTarget:C}]})}}for(var Lp=0;Lp<Me.length;Lp++){var Op=Me[Lp],nT=Op.toLowerCase(),iT=Op[0].toUpperCase()+Op.slice(1);Ne(nT,"on"+iT)}Ne(V,"onAnimationEnd"),Ne(X,"onAnimationIteration"),Ne(se,"onAnimationStart"),Ne("dblclick","onDoubleClick"),Ne("focusin","onFocus"),Ne("focusout","onBlur"),Ne(le,"onTransitionRun"),Ne(ge,"onTransitionStart"),Ne(ye,"onTransitionCancel"),Ne(Ee,"onTransitionEnd"),Qn("onMouseEnter",["mouseout","mouseover"]),Qn("onMouseLeave",["mouseout","mouseover"]),Qn("onPointerEnter",["pointerout","pointerover"]),Qn("onPointerLeave",["pointerout","pointerover"]),Wr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Wr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Wr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Wr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Wr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Wr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ol="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(" "),sT=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ol));function Jy(t,i){i=(i&4)!==0;for(var a=0;a<t.length;a++){var d=t[a],C=d.event;d=d.listeners;e:{var E=void 0;if(i)for(var B=d.length-1;0<=B;B--){var H=d[B],ie=H.instance,me=H.currentTarget;if(H=H.listener,ie!==E&&C.isPropagationStopped())break e;E=H,C.currentTarget=me;try{E(C)}catch(Ce){st(Ce)}C.currentTarget=null,E=ie}else for(B=0;B<d.length;B++){if(H=d[B],ie=H.instance,me=H.currentTarget,H=H.listener,ie!==E&&C.isPropagationStopped())break e;E=H,C.currentTarget=me;try{E(C)}catch(Ce){st(Ce)}C.currentTarget=null,E=ie}}}}function et(t,i){var a=i[Pa];a===void 0&&(a=i[Pa]=new Set);var d=t+"__bubble";a.has(d)||(Zy(i,t,2,!1),a.add(d))}function Bp(t,i,a){var d=0;i&&(d|=4),Zy(a,t,d,i)}var Qu="_reactListening"+Math.random().toString(36).slice(2);function Np(t){if(!t[Qu]){t[Qu]=!0,jc.forEach(function(a){a!=="selectionchange"&&(sT.has(a)||Bp(a,!1,t),Bp(a,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[Qu]||(i[Qu]=!0,Bp("selectionchange",!1,i))}}function Zy(t,i,a,d){switch(T0(i)){case 2:var C=OT;break;case 8:C=BT;break;default:C=$p}a=C.bind(null,i,a,t),C=void 0,!Eo||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(C=!0),d?C!==void 0?t.addEventListener(i,a,{capture:!0,passive:C}):t.addEventListener(i,a,!0):C!==void 0?t.addEventListener(i,a,{passive:C}):t.addEventListener(i,a,!1)}function Ip(t,i,a,d,C){var E=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var B=d.tag;if(B===3||B===4){var H=d.stateNode.containerInfo;if(H===C)break;if(B===4)for(B=d.return;B!==null;){var ie=B.tag;if((ie===3||ie===4)&&B.stateNode.containerInfo===C)return;B=B.return}for(;H!==null;){if(B=Kn(H),B===null)return;if(ie=B.tag,ie===5||ie===6||ie===26||ie===27){d=E=B;continue e}H=H.parentNode}}d=d.return}Qa(function(){var me=E,Ce=Wa(a),xe=[];e:{var ve=Re.get(t);if(ve!==void 0){var Se=Bi,ke=t;switch(t){case"keypress":if(To(a)===0)break e;case"keydown":case"keyup":Se=sf;break;case"focusin":ke="focus",Se=Xa;break;case"focusout":ke="blur",Se=Xa;break;case"beforeblur":case"afterblur":Se=Xa;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Se=Yc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Se=Wh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Se=Kc;break;case V:case X:case se:Se=$h;break;case Ee:Se=tl;break;case"scroll":case"scrollend":Se=zh;break;case"wheel":Se=Qe;break;case"copy":case"cut":case"paste":Se=Zh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Se=Wc;break;case"toggle":case"beforetoggle":Se=Jc}var Ue=(i&4)!==0,St=!Ue&&(t==="scroll"||t==="scrollend"),ce=Ue?ve!==null?ve+"Capture":null:ve;Ue=[];for(var ae=me,pe;ae!==null;){var we=ae;if(pe=we.stateNode,we=we.tag,we!==5&&we!==26&&we!==27||pe===null||ce===null||(we=Ts(ae,ce),we!=null&&Ue.push(Bl(ae,we,pe))),St)break;ae=ae.return}0<Ue.length&&(ve=new Se(ve,ke,null,a,Ce),xe.push({event:ve,listeners:Ue}))}}if((i&7)===0){e:{if(ve=t==="mouseover"||t==="pointerover",Se=t==="mouseout"||t==="pointerout",ve&&a!==Ya&&(ke=a.relatedTarget||a.fromElement)&&(Kn(ke)||ke[ki]))break e;if((Se||ve)&&(ve=Ce.window===Ce?Ce:(ve=Ce.ownerDocument)?ve.defaultView||ve.parentWindow:window,Se?(ke=a.relatedTarget||a.toElement,Se=me,ke=ke?Kn(ke):null,ke!==null&&(St=u(ke),Ue=ke.tag,ke!==St||Ue!==5&&Ue!==27&&Ue!==6)&&(ke=null)):(Se=null,ke=me),Se!==ke)){if(Ue=Yc,we="onMouseLeave",ce="onMouseEnter",ae="mouse",(t==="pointerout"||t==="pointerover")&&(Ue=Wc,we="onPointerLeave",ce="onPointerEnter",ae="pointer"),St=Se==null?ve:As(Se),pe=ke==null?ve:As(ke),ve=new Ue(we,ae+"leave",Se,a,Ce),ve.target=St,ve.relatedTarget=pe,we=null,Kn(Ce)===me&&(Ue=new Ue(ce,ae+"enter",ke,a,Ce),Ue.target=pe,Ue.relatedTarget=St,we=Ue),St=we,Se&&ke)t:{for(Ue=oT,ce=Se,ae=ke,pe=0,we=ce;we;we=Ue(we))pe++;we=0;for(var Pe=ae;Pe;Pe=Ue(Pe))we++;for(;0<pe-we;)ce=Ue(ce),pe--;for(;0<we-pe;)ae=Ue(ae),we--;for(;pe--;){if(ce===ae||ae!==null&&ce===ae.alternate){Ue=ce;break t}ce=Ue(ce),ae=Ue(ae)}Ue=null}else Ue=null;Se!==null&&Xy(xe,ve,Se,Ue,!1),ke!==null&&St!==null&&Xy(xe,St,ke,Ue,!0)}}e:{if(ve=me?As(me):window,Se=ve.nodeName&&ve.nodeName.toLowerCase(),Se==="select"||Se==="input"&&ve.type==="file")var lt=nu;else if(tu(ve))if(iu)lt=mf;else{lt=ff;var Be=hf}else Se=ve.nodeName,!Se||Se.toLowerCase()!=="input"||ve.type!=="checkbox"&&ve.type!=="radio"?me&&za(me.elementType)&&(lt=nu):lt=pf;if(lt&&(lt=lt(t,me))){ru(xe,lt,a,Ce);break e}Be&&Be(t,ve,me),t==="focusout"&&me&&ve.type==="number"&&me.memoizedProps.value!=null&&bo(ve,"number",ve.value)}switch(Be=me?As(me):window,t){case"focusin":(tu(Be)||Be.contentEditable==="true")&&(Pi=Be,ll=me,Ps=null);break;case"focusout":Ps=ll=Pi=null;break;case"mousedown":cl=!0;break;case"contextmenu":case"mouseup":case"dragend":cl=!1,hu(xe,a,Ce);break;case"selectionchange":if(vf)break;case"keydown":case"keyup":hu(xe,a,Ce)}var Ye;if(Mo)e:{switch(t){case"compositionstart":var rt="onCompositionStart";break e;case"compositionend":rt="onCompositionEnd";break e;case"compositionupdate":rt="onCompositionUpdate";break e}rt=void 0}else Ii?il(t,a)&&(rt="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(rt="onCompositionStart");rt&&(rl&&a.locale!=="ko"&&(Ii||rt!=="onCompositionStart"?rt==="onCompositionEnd"&&Ii&&(Ye=Gc()):(An=Ce,$a="value"in An?An.value:An.textContent,Ii=!0)),Be=$u(me,rt),0<Be.length&&(rt=new Do(rt,t,null,a,Ce),xe.push({event:rt,listeners:Be}),Ye?rt.data=Ye:(Ye=eu(a),Ye!==null&&(rt.data=Ye)))),(Ye=Xc?lf(t,a):cf(t,a))&&(rt=$u(me,"onBeforeInput"),0<rt.length&&(Be=new Do("onBeforeInput","beforeinput",null,a,Ce),xe.push({event:Be,listeners:rt}),Be.data=Ye)),rT(xe,t,me,a,Ce)}Jy(xe,i)})}function Bl(t,i,a){return{instance:t,listener:i,currentTarget:a}}function $u(t,i){for(var a=i+"Capture",d=[];t!==null;){var C=t,E=C.stateNode;if(C=C.tag,C!==5&&C!==26&&C!==27||E===null||(C=Ts(t,a),C!=null&&d.unshift(Bl(t,C,E)),C=Ts(t,i),C!=null&&d.push(Bl(t,C,E))),t.tag===3)return d;t=t.return}return[]}function oT(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Xy(t,i,a,d,C){for(var E=i._reactName,B=[];a!==null&&a!==d;){var H=a,ie=H.alternate,me=H.stateNode;if(H=H.tag,ie!==null&&ie===d)break;H!==5&&H!==26&&H!==27||me===null||(ie=me,C?(me=Ts(a,E),me!=null&&B.unshift(Bl(a,me,ie))):C||(me=Ts(a,E),me!=null&&B.push(Bl(a,me,ie)))),a=a.return}B.length!==0&&t.push({event:i,listeners:B})}var aT=/\r\n?/g,lT=/\u0000|\uFFFD/g;function e0(t){return(typeof t=="string"?t:""+t).replace(aT,`
50
+ `).replace(lT,"")}function t0(t,i){return i=e0(i),e0(t)===i}function yt(t,i,a,d,C,E){switch(a){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||$n(t,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&$n(t,""+d);break;case"className":go(t,"class",d);break;case"tabIndex":go(t,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":go(t,a,d);break;case"style":qc(t,d,E);break;case"data":if(i!=="object"){go(t,"data",d);break}case"src":case"href":if(d===""&&(i!=="a"||a!=="href")){t.removeAttribute(a);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){t.removeAttribute(a);break}d=wo(""+d),t.setAttribute(a,d);break;case"action":case"formAction":if(typeof d=="function"){t.setAttribute(a,"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 E=="function"&&(a==="formAction"?(i!=="input"&&yt(t,i,"name",C.name,C,null),yt(t,i,"formEncType",C.formEncType,C,null),yt(t,i,"formMethod",C.formMethod,C,null),yt(t,i,"formTarget",C.formTarget,C,null)):(yt(t,i,"encType",C.encType,C,null),yt(t,i,"method",C.method,C,null),yt(t,i,"target",C.target,C,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){t.removeAttribute(a);break}d=wo(""+d),t.setAttribute(a,d);break;case"onClick":d!=null&&(t.onclick=hn);break;case"onScroll":d!=null&&et("scroll",t);break;case"onScrollEnd":d!=null&&et("scrollend",t);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(s(61));if(a=d.__html,a!=null){if(C.children!=null)throw Error(s(60));t.innerHTML=a}}break;case"multiple":t.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":t.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){t.removeAttribute("xlink:href");break}a=wo(""+d),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?t.setAttribute(a,""+d):t.removeAttribute(a);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":d&&typeof d!="function"&&typeof d!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":d===!0?t.setAttribute(a,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?t.setAttribute(a,d):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?t.setAttribute(a,d):t.removeAttribute(a);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?t.removeAttribute(a):t.setAttribute(a,d);break;case"popover":et("beforetoggle",t),et("toggle",t),mo(t,"popover",d);break;case"xlinkActuate":Ut(t,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":Ut(t,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":Ut(t,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":Ut(t,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":Ut(t,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":Ut(t,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":Ut(t,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":Ut(t,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":Ut(t,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":mo(t,"is",d);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=qh.get(a)||a,mo(t,a,d))}}function Pp(t,i,a,d,C,E){switch(a){case"style":qc(t,d,E);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(s(61));if(a=d.__html,a!=null){if(C.children!=null)throw Error(s(60));t.innerHTML=a}}break;case"children":typeof d=="string"?$n(t,d):(typeof d=="number"||typeof d=="bigint")&&$n(t,""+d);break;case"onScroll":d!=null&&et("scroll",t);break;case"onScrollEnd":d!=null&&et("scrollend",t);break;case"onClick":d!=null&&(t.onclick=hn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Uc.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(C=a.endsWith("Capture"),i=a.slice(2,C?a.length-7:void 0),E=t[cr]||null,E=E!=null?E[a]:null,typeof E=="function"&&t.removeEventListener(i,E,C),typeof d=="function")){typeof E!="function"&&E!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(i,d,C);break e}a in t?t[a]=d:d===!0?t.setAttribute(a,""):mo(t,a,d)}}}function ar(t,i,a){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":et("error",t),et("load",t);var d=!1,C=!1,E;for(E in a)if(a.hasOwnProperty(E)){var B=a[E];if(B!=null)switch(E){case"src":d=!0;break;case"srcSet":C=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:yt(t,i,E,B,a,null)}}C&&yt(t,i,"srcSet",a.srcSet,a,null),d&&yt(t,i,"src",a.src,a,null);return;case"input":et("invalid",t);var H=E=B=C=null,ie=null,me=null;for(d in a)if(a.hasOwnProperty(d)){var Ce=a[d];if(Ce!=null)switch(d){case"name":C=Ce;break;case"type":B=Ce;break;case"checked":ie=Ce;break;case"defaultChecked":me=Ce;break;case"value":E=Ce;break;case"defaultValue":H=Ce;break;case"children":case"dangerouslySetInnerHTML":if(Ce!=null)throw Error(s(137,i));break;default:yt(t,i,d,Ce,a,null)}}Hc(t,E,H,ie,me,B,C,!1);return;case"select":et("invalid",t),d=B=E=null;for(C in a)if(a.hasOwnProperty(C)&&(H=a[C],H!=null))switch(C){case"value":E=H;break;case"defaultValue":B=H;break;case"multiple":d=H;default:yt(t,i,C,H,a,null)}i=E,a=B,t.multiple=!!d,i!=null?Er(t,!!d,i,!1):a!=null&&Er(t,!!d,a,!0);return;case"textarea":et("invalid",t),E=C=d=null;for(B in a)if(a.hasOwnProperty(B)&&(H=a[B],H!=null))switch(B){case"value":d=H;break;case"defaultValue":C=H;break;case"children":E=H;break;case"dangerouslySetInnerHTML":if(H!=null)throw Error(s(91));break;default:yt(t,i,B,H,a,null)}Nr(t,d,C,E);return;case"option":for(ie in a)if(a.hasOwnProperty(ie)&&(d=a[ie],d!=null))switch(ie){case"selected":t.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:yt(t,i,ie,d,a,null)}return;case"dialog":et("beforetoggle",t),et("toggle",t),et("cancel",t),et("close",t);break;case"iframe":case"object":et("load",t);break;case"video":case"audio":for(d=0;d<Ol.length;d++)et(Ol[d],t);break;case"image":et("error",t),et("load",t);break;case"details":et("toggle",t);break;case"embed":case"source":case"link":et("error",t),et("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(me in a)if(a.hasOwnProperty(me)&&(d=a[me],d!=null))switch(me){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:yt(t,i,me,d,a,null)}return;default:if(za(i)){for(Ce in a)a.hasOwnProperty(Ce)&&(d=a[Ce],d!==void 0&&Pp(t,i,Ce,d,a,void 0));return}}for(H in a)a.hasOwnProperty(H)&&(d=a[H],d!=null&&yt(t,i,H,d,a,null))}function cT(t,i,a,d){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var C=null,E=null,B=null,H=null,ie=null,me=null,Ce=null;for(Se in a){var xe=a[Se];if(a.hasOwnProperty(Se)&&xe!=null)switch(Se){case"checked":break;case"value":break;case"defaultValue":ie=xe;default:d.hasOwnProperty(Se)||yt(t,i,Se,null,d,xe)}}for(var ve in d){var Se=d[ve];if(xe=a[ve],d.hasOwnProperty(ve)&&(Se!=null||xe!=null))switch(ve){case"type":E=Se;break;case"name":C=Se;break;case"checked":me=Se;break;case"defaultChecked":Ce=Se;break;case"value":B=Se;break;case"defaultValue":H=Se;break;case"children":case"dangerouslySetInnerHTML":if(Se!=null)throw Error(s(137,i));break;default:Se!==xe&&yt(t,i,ve,Se,d,xe)}}So(t,B,H,ie,me,Ce,E,C);return;case"select":Se=B=H=ve=null;for(E in a)if(ie=a[E],a.hasOwnProperty(E)&&ie!=null)switch(E){case"value":break;case"multiple":Se=ie;default:d.hasOwnProperty(E)||yt(t,i,E,null,d,ie)}for(C in d)if(E=d[C],ie=a[C],d.hasOwnProperty(C)&&(E!=null||ie!=null))switch(C){case"value":ve=E;break;case"defaultValue":H=E;break;case"multiple":B=E;default:E!==ie&&yt(t,i,C,E,d,ie)}i=H,a=B,d=Se,ve!=null?Er(t,!!a,ve,!1):!!d!=!!a&&(i!=null?Er(t,!!a,i,!0):Er(t,!!a,a?[]:"",!1));return;case"textarea":Se=ve=null;for(H in a)if(C=a[H],a.hasOwnProperty(H)&&C!=null&&!d.hasOwnProperty(H))switch(H){case"value":break;case"children":break;default:yt(t,i,H,null,d,C)}for(B in d)if(C=d[B],E=a[B],d.hasOwnProperty(B)&&(C!=null||E!=null))switch(B){case"value":ve=C;break;case"defaultValue":Se=C;break;case"children":break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(s(91));break;default:C!==E&&yt(t,i,B,C,d,E)}Co(t,ve,Se);return;case"option":for(var ke in a)if(ve=a[ke],a.hasOwnProperty(ke)&&ve!=null&&!d.hasOwnProperty(ke))switch(ke){case"selected":t.selected=!1;break;default:yt(t,i,ke,null,d,ve)}for(ie in d)if(ve=d[ie],Se=a[ie],d.hasOwnProperty(ie)&&ve!==Se&&(ve!=null||Se!=null))switch(ie){case"selected":t.selected=ve&&typeof ve!="function"&&typeof ve!="symbol";break;default:yt(t,i,ie,ve,d,Se)}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 Ue in a)ve=a[Ue],a.hasOwnProperty(Ue)&&ve!=null&&!d.hasOwnProperty(Ue)&&yt(t,i,Ue,null,d,ve);for(me in d)if(ve=d[me],Se=a[me],d.hasOwnProperty(me)&&ve!==Se&&(ve!=null||Se!=null))switch(me){case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(s(137,i));break;default:yt(t,i,me,ve,d,Se)}return;default:if(za(i)){for(var St in a)ve=a[St],a.hasOwnProperty(St)&&ve!==void 0&&!d.hasOwnProperty(St)&&Pp(t,i,St,void 0,d,ve);for(Ce in d)ve=d[Ce],Se=a[Ce],!d.hasOwnProperty(Ce)||ve===Se||ve===void 0&&Se===void 0||Pp(t,i,Ce,ve,d,Se);return}}for(var ce in a)ve=a[ce],a.hasOwnProperty(ce)&&ve!=null&&!d.hasOwnProperty(ce)&&yt(t,i,ce,null,d,ve);for(xe in d)ve=d[xe],Se=a[xe],!d.hasOwnProperty(xe)||ve===Se||ve==null&&Se==null||yt(t,i,xe,ve,d,Se)}function r0(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function uT(){if(typeof performance.getEntriesByType=="function"){for(var t=0,i=0,a=performance.getEntriesByType("resource"),d=0;d<a.length;d++){var C=a[d],E=C.transferSize,B=C.initiatorType,H=C.duration;if(E&&H&&r0(B)){for(B=0,H=C.responseEnd,d+=1;d<a.length;d++){var ie=a[d],me=ie.startTime;if(me>H)break;var Ce=ie.transferSize,xe=ie.initiatorType;Ce&&r0(xe)&&(ie=ie.responseEnd,B+=Ce*(ie<H?1:(H-me)/(ie-me)))}if(--d,i+=8*(E+B)/(C.duration/1e3),t++,10<t)break}}if(0<t)return i/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var jp=null,Up=null;function Ju(t){return t.nodeType===9?t:t.ownerDocument}function n0(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function i0(t,i){if(t===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&i==="foreignObject"?0:t}function Fp(t,i){return t==="textarea"||t==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Hp=null;function dT(){var t=window.event;return t&&t.type==="popstate"?t===Hp?!1:(Hp=t,!0):(Hp=null,!1)}var s0=typeof setTimeout=="function"?setTimeout:void 0,hT=typeof clearTimeout=="function"?clearTimeout:void 0,o0=typeof Promise=="function"?Promise:void 0,fT=typeof queueMicrotask=="function"?queueMicrotask:typeof o0<"u"?function(t){return o0.resolve(null).then(t).catch(pT)}:s0;function pT(t){setTimeout(function(){throw t})}function rs(t){return t==="head"}function a0(t,i){var a=i,d=0;do{var C=a.nextSibling;if(t.removeChild(a),C&&C.nodeType===8)if(a=C.data,a==="/$"||a==="/&"){if(d===0){t.removeChild(C),ra(i);return}d--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")d++;else if(a==="html")Nl(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,Nl(a);for(var E=a.firstChild;E;){var B=E.nextSibling,H=E.nodeName;E[Es]||H==="SCRIPT"||H==="STYLE"||H==="LINK"&&E.rel.toLowerCase()==="stylesheet"||a.removeChild(E),E=B}}else a==="body"&&Nl(t.ownerDocument.body);a=C}while(a);ra(i)}function l0(t,i){var a=t;t=0;do{var d=a.nextSibling;if(a.nodeType===1?i?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(i?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),d&&d.nodeType===8)if(a=d.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=d}while(a)}function Vp(t){var i=t.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var a=i;switch(i=i.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Vp(a),Fa(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function mT(t,i,a,d){for(;t.nodeType===1;){var C=a;if(t.nodeName.toLowerCase()!==i.toLowerCase()){if(!d&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(d){if(!t[Es])switch(i){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(E=t.getAttribute("rel"),E==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(E!==C.rel||t.getAttribute("href")!==(C.href==null||C.href===""?null:C.href)||t.getAttribute("crossorigin")!==(C.crossOrigin==null?null:C.crossOrigin)||t.getAttribute("title")!==(C.title==null?null:C.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(E=t.getAttribute("src"),(E!==(C.src==null?null:C.src)||t.getAttribute("type")!==(C.type==null?null:C.type)||t.getAttribute("crossorigin")!==(C.crossOrigin==null?null:C.crossOrigin))&&E&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(i==="input"&&t.type==="hidden"){var E=C.name==null?null:""+C.name;if(C.type==="hidden"&&t.getAttribute("name")===E)return t}else return t;if(t=en(t.nextSibling),t===null)break}return null}function gT(t,i,a){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=en(t.nextSibling),t===null))return null;return t}function c0(t,i){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=en(t.nextSibling),t===null))return null;return t}function qp(t){return t.data==="$?"||t.data==="$~"}function Gp(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function vT(t,i){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=i;else if(t.data!=="$?"||a.readyState!=="loading")i();else{var d=function(){i(),a.removeEventListener("DOMContentLoaded",d)};a.addEventListener("DOMContentLoaded",d),t._reactRetry=d}}function en(t){for(;t!=null;t=t.nextSibling){var i=t.nodeType;if(i===1||i===3)break;if(i===8){if(i=t.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return t}var zp=null;function u0(t){t=t.nextSibling;for(var i=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(i===0)return en(t.nextSibling);i--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||i++}t=t.nextSibling}return null}function d0(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(i===0)return t;i--}else a!=="/$"&&a!=="/&"||i++}t=t.previousSibling}return null}function h0(t,i,a){switch(i=Ju(a),t){case"html":if(t=i.documentElement,!t)throw Error(s(452));return t;case"head":if(t=i.head,!t)throw Error(s(453));return t;case"body":if(t=i.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function Nl(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Fa(t)}var tn=new Map,f0=new Set;function Zu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var mi=re.d;re.d={f:_T,r:yT,D:ST,C:bT,L:CT,m:wT,X:ET,S:xT,M:AT};function _T(){var t=mi.f(),i=qu();return t||i}function yT(t){var i=Li(t);i!==null&&i.tag===5&&i.type==="form"?M_(i):mi.r(t)}var Xo=typeof document>"u"?null:document;function p0(t,i,a){var d=Xo;if(d&&typeof i=="string"&&i){var C=xr(i);C='link[rel="'+t+'"][href="'+C+'"]',typeof a=="string"&&(C+='[crossorigin="'+a+'"]'),f0.has(C)||(f0.add(C),t={rel:t,crossOrigin:a,href:i},d.querySelector(C)===null&&(i=d.createElement("link"),ar(i,"link",t),Bt(i),d.head.appendChild(i)))}}function ST(t){mi.D(t),p0("dns-prefetch",t,null)}function bT(t,i){mi.C(t,i),p0("preconnect",t,i)}function CT(t,i,a){mi.L(t,i,a);var d=Xo;if(d&&t&&i){var C='link[rel="preload"][as="'+xr(i)+'"]';i==="image"&&a&&a.imageSrcSet?(C+='[imagesrcset="'+xr(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(C+='[imagesizes="'+xr(a.imageSizes)+'"]')):C+='[href="'+xr(t)+'"]';var E=C;switch(i){case"style":E=ea(t);break;case"script":E=ta(t)}tn.has(E)||(t=p({rel:"preload",href:i==="image"&&a&&a.imageSrcSet?void 0:t,as:i},a),tn.set(E,t),d.querySelector(C)!==null||i==="style"&&d.querySelector(Il(E))||i==="script"&&d.querySelector(Pl(E))||(i=d.createElement("link"),ar(i,"link",t),Bt(i),d.head.appendChild(i)))}}function wT(t,i){mi.m(t,i);var a=Xo;if(a&&t){var d=i&&typeof i.as=="string"?i.as:"script",C='link[rel="modulepreload"][as="'+xr(d)+'"][href="'+xr(t)+'"]',E=C;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":E=ta(t)}if(!tn.has(E)&&(t=p({rel:"modulepreload",href:t},i),tn.set(E,t),a.querySelector(C)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Pl(E)))return}d=a.createElement("link"),ar(d,"link",t),Bt(d),a.head.appendChild(d)}}}function xT(t,i,a){mi.S(t,i,a);var d=Xo;if(d&&t){var C=Oi(d).hoistableStyles,E=ea(t);i=i||"default";var B=C.get(E);if(!B){var H={loading:0,preload:null};if(B=d.querySelector(Il(E)))H.loading=5;else{t=p({rel:"stylesheet",href:t,"data-precedence":i},a),(a=tn.get(E))&&Yp(t,a);var ie=B=d.createElement("link");Bt(ie),ar(ie,"link",t),ie._p=new Promise(function(me,Ce){ie.onload=me,ie.onerror=Ce}),ie.addEventListener("load",function(){H.loading|=1}),ie.addEventListener("error",function(){H.loading|=2}),H.loading|=4,Xu(B,i,d)}B={type:"stylesheet",instance:B,count:1,state:H},C.set(E,B)}}}function ET(t,i){mi.X(t,i);var a=Xo;if(a&&t){var d=Oi(a).hoistableScripts,C=ta(t),E=d.get(C);E||(E=a.querySelector(Pl(C)),E||(t=p({src:t,async:!0},i),(i=tn.get(C))&&Wp(t,i),E=a.createElement("script"),Bt(E),ar(E,"link",t),a.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},d.set(C,E))}}function AT(t,i){mi.M(t,i);var a=Xo;if(a&&t){var d=Oi(a).hoistableScripts,C=ta(t),E=d.get(C);E||(E=a.querySelector(Pl(C)),E||(t=p({src:t,async:!0,type:"module"},i),(i=tn.get(C))&&Wp(t,i),E=a.createElement("script"),Bt(E),ar(E,"link",t),a.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},d.set(C,E))}}function m0(t,i,a,d){var C=(C=fe.current)?Zu(C):null;if(!C)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(i=ea(a.href),a=Oi(C).hoistableStyles,d=a.get(i),d||(d={type:"style",instance:null,count:0,state:null},a.set(i,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=ea(a.href);var E=Oi(C).hoistableStyles,B=E.get(t);if(B||(C=C.ownerDocument||C,B={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},E.set(t,B),(E=C.querySelector(Il(t)))&&!E._p&&(B.instance=E,B.state.loading=5),tn.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},tn.set(t,a),E||TT(C,t,a,B.state))),i&&d===null)throw Error(s(528,""));return B}if(i&&d!==null)throw Error(s(529,""));return null;case"script":return i=a.async,a=a.src,typeof a=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ta(a),a=Oi(C).hoistableScripts,d=a.get(i),d||(d={type:"script",instance:null,count:0,state:null},a.set(i,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function ea(t){return'href="'+xr(t)+'"'}function Il(t){return'link[rel="stylesheet"]['+t+"]"}function g0(t){return p({},t,{"data-precedence":t.precedence,precedence:null})}function TT(t,i,a,d){t.querySelector('link[rel="preload"][as="style"]['+i+"]")?d.loading=1:(i=t.createElement("link"),d.preload=i,i.addEventListener("load",function(){return d.loading|=1}),i.addEventListener("error",function(){return d.loading|=2}),ar(i,"link",a),Bt(i),t.head.appendChild(i))}function ta(t){return'[src="'+xr(t)+'"]'}function Pl(t){return"script[async]"+t}function v0(t,i,a){if(i.count++,i.instance===null)switch(i.type){case"style":var d=t.querySelector('style[data-href~="'+xr(a.href)+'"]');if(d)return i.instance=d,Bt(d),d;var C=p({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return d=(t.ownerDocument||t).createElement("style"),Bt(d),ar(d,"style",C),Xu(d,a.precedence,t),i.instance=d;case"stylesheet":C=ea(a.href);var E=t.querySelector(Il(C));if(E)return i.state.loading|=4,i.instance=E,Bt(E),E;d=g0(a),(C=tn.get(C))&&Yp(d,C),E=(t.ownerDocument||t).createElement("link"),Bt(E);var B=E;return B._p=new Promise(function(H,ie){B.onload=H,B.onerror=ie}),ar(E,"link",d),i.state.loading|=4,Xu(E,a.precedence,t),i.instance=E;case"script":return E=ta(a.src),(C=t.querySelector(Pl(E)))?(i.instance=C,Bt(C),C):(d=a,(C=tn.get(E))&&(d=p({},a),Wp(d,C)),t=t.ownerDocument||t,C=t.createElement("script"),Bt(C),ar(C,"link",d),t.head.appendChild(C),i.instance=C);case"void":return null;default:throw Error(s(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(d=i.instance,i.state.loading|=4,Xu(d,a.precedence,t));return i.instance}function Xu(t,i,a){for(var d=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),C=d.length?d[d.length-1]:null,E=C,B=0;B<d.length;B++){var H=d[B];if(H.dataset.precedence===i)E=H;else if(E!==C)break}E?E.parentNode.insertBefore(t,E.nextSibling):(i=a.nodeType===9?a.head:a,i.insertBefore(t,i.firstChild))}function Yp(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function Wp(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var ed=null;function _0(t,i,a){if(ed===null){var d=new Map,C=ed=new Map;C.set(a,d)}else C=ed,d=C.get(a),d||(d=new Map,C.set(a,d));if(d.has(t))return d;for(d.set(t,null),a=a.getElementsByTagName(t),C=0;C<a.length;C++){var E=a[C];if(!(E[Es]||E[Qt]||t==="link"&&E.getAttribute("rel")==="stylesheet")&&E.namespaceURI!=="http://www.w3.org/2000/svg"){var B=E.getAttribute(i)||"";B=t+B;var H=d.get(B);H?H.push(E):d.set(B,[E])}}return d}function y0(t,i,a){t=t.ownerDocument||t,t.head.insertBefore(a,i==="title"?t.querySelector("head > title"):null)}function RT(t,i,a){if(a===1||i.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return t=i.disabled,typeof i.precedence=="string"&&t==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function S0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function DT(t,i,a,d){if(a.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var C=ea(d.href),E=i.querySelector(Il(C));if(E){i=E._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(t.count++,t=td.bind(t),i.then(t,t)),a.state.loading|=4,a.instance=E,Bt(E);return}E=i.ownerDocument||i,d=g0(d),(C=tn.get(C))&&Yp(d,C),E=E.createElement("link"),Bt(E);var B=E;B._p=new Promise(function(H,ie){B.onload=H,B.onerror=ie}),ar(E,"link",d),a.instance=E}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,i),(i=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=td.bind(t),i.addEventListener("load",a),i.addEventListener("error",a))}}var Kp=0;function MT(t,i){return t.stylesheets&&t.count===0&&nd(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var d=setTimeout(function(){if(t.stylesheets&&nd(t,t.stylesheets),t.unsuspend){var E=t.unsuspend;t.unsuspend=null,E()}},6e4+i);0<t.imgBytes&&Kp===0&&(Kp=62500*uT());var C=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&nd(t,t.stylesheets),t.unsuspend)){var E=t.unsuspend;t.unsuspend=null,E()}},(t.imgBytes>Kp?50:800)+i);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(d),clearTimeout(C)}}:null}function td(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)nd(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var rd=null;function nd(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,rd=new Map,i.forEach(kT,t),rd=null,td.call(t))}function kT(t,i){if(!(i.state.loading&4)){var a=rd.get(t);if(a)var d=a.get(null);else{a=new Map,rd.set(t,a);for(var C=t.querySelectorAll("link[data-precedence],style[data-precedence]"),E=0;E<C.length;E++){var B=C[E];(B.nodeName==="LINK"||B.getAttribute("media")!=="not all")&&(a.set(B.dataset.precedence,B),d=B)}d&&a.set(null,d)}C=i.instance,B=C.getAttribute("data-precedence"),E=a.get(B)||d,E===d&&a.set(null,C),a.set(B,C),this.count++,d=td.bind(this),C.addEventListener("load",d),C.addEventListener("error",d),E?E.parentNode.insertBefore(C,E.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(C,t.firstChild)),i.state.loading|=4}}var jl={$$typeof:_,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function LT(t,i,a,d,C,E,B,H,ie){this.tag=1,this.containerInfo=t,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=ws(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ws(0),this.hiddenUpdates=ws(null),this.identifierPrefix=d,this.onUncaughtError=C,this.onCaughtError=E,this.onRecoverableError=B,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ie,this.incompleteTransitions=new Map}function b0(t,i,a,d,C,E,B,H,ie,me,Ce,xe){return t=new LT(t,i,a,B,ie,me,Ce,xe,H),i=1,E===!0&&(i|=24),E=dr(3,null,null,i),t.current=E,E.stateNode=t,i=Tf(),i.refCount++,t.pooledCache=i,i.refCount++,E.memoizedState={element:d,isDehydrated:a,cache:i},kf(E),t}function C0(t){return t?(t=Ui,t):Ui}function w0(t,i,a,d,C,E){C=C0(C),d.context===null?d.context=C:d.pendingContext=C,d=zi(i),d.payload={element:a},E=E===void 0?null:E,E!==null&&(d.callback=E),a=Yi(t,d,i),a!==null&&(kr(a,t,i),gl(a,t,i))}function x0(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<i?a:i}}function Qp(t,i){x0(t,i),(t=t.alternate)&&x0(t,i)}function E0(t){if(t.tag===13||t.tag===31){var i=Nt(t,67108864);i!==null&&kr(i,t,67108864),Qp(t,67108864)}}function A0(t){if(t.tag===13||t.tag===31){var i=Hr();i=Mi(i);var a=Nt(t,i);a!==null&&kr(a,t,i),Qp(t,i)}}var id=!0;function OT(t,i,a,d){var C=Y.T;Y.T=null;var E=re.p;try{re.p=2,$p(t,i,a,d)}finally{re.p=E,Y.T=C}}function BT(t,i,a,d){var C=Y.T;Y.T=null;var E=re.p;try{re.p=8,$p(t,i,a,d)}finally{re.p=E,Y.T=C}}function $p(t,i,a,d){if(id){var C=Jp(d);if(C===null)Ip(t,i,d,sd,a),R0(t,d);else if(IT(C,t,i,a,d))d.stopPropagation();else if(R0(t,d),i&4&&-1<NT.indexOf(t)){for(;C!==null;){var E=Li(C);if(E!==null)switch(E.tag){case 3:if(E=E.stateNode,E.current.memoizedState.isDehydrated){var B=Wn(E.pendingLanes);if(B!==0){var H=E;for(H.pendingLanes|=2,H.entangledLanes|=2;B;){var ie=1<<31-tr(B);H.entanglements[1]|=ie,B&=~ie}kn(E),(ft&6)===0&&(Hu=Ot()+500,Ll(0))}}break;case 31:case 13:H=Nt(E,2),H!==null&&kr(H,E,2),qu(),Qp(E,2)}if(E=Jp(d),E===null&&Ip(t,i,d,sd,a),E===C)break;C=E}C!==null&&d.stopPropagation()}else Ip(t,i,d,null,a)}}function Jp(t){return t=Wa(t),Zp(t)}var sd=null;function Zp(t){if(sd=null,t=Kn(t),t!==null){var i=u(t);if(i===null)t=null;else{var a=i.tag;if(a===13){if(t=f(i),t!==null)return t;t=null}else if(a===31){if(t=l(i),t!==null)return t;t=null}else if(a===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null)}}return sd=t,null}function T0(t){switch(t){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(lr()){case Yr:return 2;case Cn:return 8;case mr:case un:return 32;case gr:return 268435456;default:return 32}default:return 32}}var Xp=!1,ns=null,is=null,ss=null,Ul=new Map,Fl=new Map,os=[],NT="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 R0(t,i){switch(t){case"focusin":case"focusout":ns=null;break;case"dragenter":case"dragleave":is=null;break;case"mouseover":case"mouseout":ss=null;break;case"pointerover":case"pointerout":Ul.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fl.delete(i.pointerId)}}function Hl(t,i,a,d,C,E){return t===null||t.nativeEvent!==E?(t={blockedOn:i,domEventName:a,eventSystemFlags:d,nativeEvent:E,targetContainers:[C]},i!==null&&(i=Li(i),i!==null&&E0(i)),t):(t.eventSystemFlags|=d,i=t.targetContainers,C!==null&&i.indexOf(C)===-1&&i.push(C),t)}function IT(t,i,a,d,C){switch(i){case"focusin":return ns=Hl(ns,t,i,a,d,C),!0;case"dragenter":return is=Hl(is,t,i,a,d,C),!0;case"mouseover":return ss=Hl(ss,t,i,a,d,C),!0;case"pointerover":var E=C.pointerId;return Ul.set(E,Hl(Ul.get(E)||null,t,i,a,d,C)),!0;case"gotpointercapture":return E=C.pointerId,Fl.set(E,Hl(Fl.get(E)||null,t,i,a,d,C)),!0}return!1}function D0(t){var i=Kn(t.target);if(i!==null){var a=u(i);if(a!==null){if(i=a.tag,i===13){if(i=f(a),i!==null){t.blockedOn=i,Ia(t.priority,function(){A0(a)});return}}else if(i===31){if(i=l(a),i!==null){t.blockedOn=i,Ia(t.priority,function(){A0(a)});return}}else if(i===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function od(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var a=Jp(t.nativeEvent);if(a===null){a=t.nativeEvent;var d=new a.constructor(a.type,a);Ya=d,a.target.dispatchEvent(d),Ya=null}else return i=Li(a),i!==null&&E0(i),t.blockedOn=a,!1;i.shift()}return!0}function M0(t,i,a){od(t)&&a.delete(i)}function PT(){Xp=!1,ns!==null&&od(ns)&&(ns=null),is!==null&&od(is)&&(is=null),ss!==null&&od(ss)&&(ss=null),Ul.forEach(M0),Fl.forEach(M0)}function ad(t,i){t.blockedOn===i&&(t.blockedOn=null,Xp||(Xp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,PT)))}var ld=null;function k0(t){ld!==t&&(ld=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ld===t&&(ld=null);for(var i=0;i<t.length;i+=3){var a=t[i],d=t[i+1],C=t[i+2];if(typeof d!="function"){if(Zp(d||a)===null)continue;break}var E=Li(a);E!==null&&(t.splice(i,3),i-=3,Jf(E,{pending:!0,data:C,method:a.method,action:d},d,C))}}))}function ra(t){function i(ie){return ad(ie,t)}ns!==null&&ad(ns,t),is!==null&&ad(is,t),ss!==null&&ad(ss,t),Ul.forEach(i),Fl.forEach(i);for(var a=0;a<os.length;a++){var d=os[a];d.blockedOn===t&&(d.blockedOn=null)}for(;0<os.length&&(a=os[0],a.blockedOn===null);)D0(a),a.blockedOn===null&&os.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(d=0;d<a.length;d+=3){var C=a[d],E=a[d+1],B=C[cr]||null;if(typeof E=="function")B||k0(a);else if(B){var H=null;if(E&&E.hasAttribute("formAction")){if(C=E,B=E[cr]||null)H=B.formAction;else if(Zp(C)!==null)continue}else H=B.action;typeof H=="function"?a[d+1]=H:(a.splice(d,3),d-=3),k0(a)}}}function L0(){function t(E){E.canIntercept&&E.info==="react-transition"&&E.intercept({handler:function(){return new Promise(function(B){return C=B})},focusReset:"manual",scroll:"manual"})}function i(){C!==null&&(C(),C=null),d||setTimeout(a,20)}function a(){if(!d&&!navigation.transition){var E=navigation.currentEntry;E&&E.url!=null&&navigation.navigate(E.url,{state:E.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,C=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(a,100),function(){d=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),C!==null&&(C(),C=null)}}}function em(t){this._internalRoot=t}cd.prototype.render=em.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(s(409));var a=i.current,d=Hr();w0(a,d,t,i,null,null)},cd.prototype.unmount=em.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;w0(t.current,2,null,t,null,null),qu(),i[ki]=null}};function cd(t){this._internalRoot=t}cd.prototype.unstable_scheduleHydration=function(t){if(t){var i=Na();t={blockedOn:null,target:t,priority:i};for(var a=0;a<os.length&&i!==0&&i<os[a].priority;a++);os.splice(a,0,t),a===0&&D0(t)}};var O0=r.version;if(O0!=="19.2.1")throw Error(s(527,O0,"19.2.1"));re.findDOMNode=function(t){var i=t._reactInternals;if(i===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=h(i),t=t!==null?m(t):null,t=t===null?null:t.stateNode,t};var jT={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:Y,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ud=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ud.isDisabled&&ud.supportsFiber)try{vr=ud.inject(jT),er=ud}catch{}}return ql.createRoot=function(t,i){if(!o(t))throw Error(s(299));var a=!1,d="",C=F_,E=H_,B=V_;return i!=null&&(i.unstable_strictMode===!0&&(a=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(C=i.onUncaughtError),i.onCaughtError!==void 0&&(E=i.onCaughtError),i.onRecoverableError!==void 0&&(B=i.onRecoverableError)),i=b0(t,1,!1,null,null,a,d,null,C,E,B,L0),t[ki]=i.current,Np(t),new em(i)},ql.hydrateRoot=function(t,i,a){if(!o(t))throw Error(s(299));var d=!1,C="",E=F_,B=H_,H=V_,ie=null;return a!=null&&(a.unstable_strictMode===!0&&(d=!0),a.identifierPrefix!==void 0&&(C=a.identifierPrefix),a.onUncaughtError!==void 0&&(E=a.onUncaughtError),a.onCaughtError!==void 0&&(B=a.onCaughtError),a.onRecoverableError!==void 0&&(H=a.onRecoverableError),a.formState!==void 0&&(ie=a.formState)),i=b0(t,1,!0,i,a??null,d,C,ie,E,B,H,L0),i.context=C0(null),a=i.current,d=Hr(),d=Mi(d),C=zi(d),C.callback=null,Yi(a,C,d),a=d,i.current.lanes=a,Ri(i,a),kn(i),t[ki]=i.current,Np(t),new cd(i)},ql.version="19.2.1",ql}var q0;function QT(){if(q0)return nm.exports;q0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),nm.exports=KT(),nm.exports}var $T=QT();/**
51
+ * react-router v7.11.0
52
+ *
53
+ * Copyright (c) Remix Software Inc.
54
+ *
55
+ * This source code is licensed under the MIT license found in the
56
+ * LICENSE.md file in the root directory of this source tree.
57
+ *
58
+ * @license MIT
59
+ */var G0="popstate";function JT(e={}){function r(s,o){let{pathname:u,search:f,hash:l}=s.location;return qm("",{pathname:u,search:f,hash:l},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(s,o){return typeof o=="string"?o:tc(o)}return XT(r,n,null,e)}function kt(e,r){if(e===!1||e===null||typeof e>"u")throw new Error(r)}function ln(e,r){if(!e){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function ZT(){return Math.random().toString(36).substring(2,10)}function z0(e,r){return{usr:e.state,key:e.key,idx:r}}function qm(e,r,n=null,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof r=="string"?ba(r):r,state:n,key:r&&r.key||s||ZT()}}function tc({pathname:e="/",search:r="",hash:n=""}){return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function ba(e){let r={};if(e){let n=e.indexOf("#");n>=0&&(r.hash=e.substring(n),e=e.substring(0,n));let s=e.indexOf("?");s>=0&&(r.search=e.substring(s),e=e.substring(0,s)),e&&(r.pathname=e)}return r}function XT(e,r,n,s={}){let{window:o=document.defaultView,v5Compat:u=!1}=s,f=o.history,l="POP",c=null,h=m();h==null&&(h=0,f.replaceState({...f.state,idx:h},""));function m(){return(f.state||{idx:null}).idx}function p(){l="POP";let v=m(),S=v==null?null:v-h;h=v,c&&c({action:l,location:w.location,delta:S})}function y(v,S){l="PUSH";let g=qm(w.location,v,S);h=m()+1;let _=z0(g,h),T=w.createHref(g);try{f.pushState(_,"",T)}catch(M){if(M instanceof DOMException&&M.name==="DataCloneError")throw M;o.location.assign(T)}u&&c&&c({action:l,location:w.location,delta:1})}function x(v,S){l="REPLACE";let g=qm(w.location,v,S);h=m();let _=z0(g,h),T=w.createHref(g);f.replaceState(_,"",T),u&&c&&c({action:l,location:w.location,delta:0})}function A(v){return eR(v)}let w={get action(){return l},get location(){return e(o,f)},listen(v){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(G0,p),c=v,()=>{o.removeEventListener(G0,p),c=null}},createHref(v){return r(o,v)},createURL:A,encodeLocation(v){let S=A(v);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:y,replace:x,go(v){return f.go(v)}};return w}function eR(e,r=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),kt(n,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:tc(e);return s=s.replace(/ $/,"%20"),!r&&s.startsWith("//")&&(s=n+s),new URL(s,n)}function Rb(e,r,n="/"){return tR(e,r,n,!1)}function tR(e,r,n,s){let o=typeof r=="string"?ba(r):r,u=wi(o.pathname||"/",n);if(u==null)return null;let f=Db(e);rR(f);let l=null;for(let c=0;l==null&&c<f.length;++c){let h=fR(u);l=dR(f[c],h,s)}return l}function Db(e,r=[],n=[],s="",o=!1){let u=(f,l,c=o,h)=>{let m={relativePath:h===void 0?f.path||"":h,caseSensitive:f.caseSensitive===!0,childrenIndex:l,route:f};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(s)&&c)return;kt(m.relativePath.startsWith(s),`Absolute route path "${m.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(s.length)}let p=bi([s,m.relativePath]),y=n.concat(m);f.children&&f.children.length>0&&(kt(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),Db(f.children,r,y,p,c)),!(f.path==null&&!f.index)&&r.push({path:p,score:cR(p,f.index),routesMeta:y})};return e.forEach((f,l)=>{var c;if(f.path===""||!((c=f.path)!=null&&c.includes("?")))u(f,l);else for(let h of Mb(f.path))u(f,l,!0,h)}),r}function Mb(e){let r=e.split("/");if(r.length===0)return[];let[n,...s]=r,o=n.endsWith("?"),u=n.replace(/\?$/,"");if(s.length===0)return o?[u,""]:[u];let f=Mb(s.join("/")),l=[];return l.push(...f.map(c=>c===""?u:[u,c].join("/"))),o&&l.push(...f),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function rR(e){e.sort((r,n)=>r.score!==n.score?n.score-r.score:uR(r.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}var nR=/^:[\w-]+$/,iR=3,sR=2,oR=1,aR=10,lR=-2,Y0=e=>e==="*";function cR(e,r){let n=e.split("/"),s=n.length;return n.some(Y0)&&(s+=lR),r&&(s+=sR),n.filter(o=>!Y0(o)).reduce((o,u)=>o+(nR.test(u)?iR:u===""?oR:aR),s)}function uR(e,r){return e.length===r.length&&e.slice(0,-1).every((s,o)=>s===r[o])?e[e.length-1]-r[r.length-1]:0}function dR(e,r,n=!1){let{routesMeta:s}=e,o={},u="/",f=[];for(let l=0;l<s.length;++l){let c=s[l],h=l===s.length-1,m=u==="/"?r:r.slice(u.length)||"/",p=qd({path:c.relativePath,caseSensitive:c.caseSensitive,end:h},m),y=c.route;if(!p&&h&&n&&!s[s.length-1].route.index&&(p=qd({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},m)),!p)return null;Object.assign(o,p.params),f.push({params:o,pathname:bi([u,p.pathname]),pathnameBase:vR(bi([u,p.pathnameBase])),route:y}),p.pathnameBase!=="/"&&(u=bi([u,p.pathnameBase]))}return f}function qd(e,r){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=hR(e.path,e.caseSensitive,e.end),o=r.match(n);if(!o)return null;let u=o[0],f=u.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:s.reduce((h,{paramName:m,isOptional:p},y)=>{if(m==="*"){let A=l[y]||"";f=u.slice(0,u.length-A.length).replace(/(.)\/+$/,"$1")}const x=l[y];return p&&!x?h[m]=void 0:h[m]=(x||"").replace(/%2F/g,"/"),h},{}),pathname:u,pathnameBase:f,pattern:e}}function hR(e,r=!1,n=!0){ln(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let s=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,l,c)=>(s.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,r?void 0:"i"),s]}function fR(e){try{return e.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return ln(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`),e}}function wi(e,r){if(r==="/")return e;if(!e.toLowerCase().startsWith(r.toLowerCase()))return null;let n=r.endsWith("/")?r.length-1:r.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}var kb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,pR=e=>kb.test(e);function mR(e,r="/"){let{pathname:n,search:s="",hash:o=""}=typeof e=="string"?ba(e):e,u;if(n)if(pR(n))u=n;else{if(n.includes("//")){let f=n;n=n.replace(/\/\/+/g,"/"),ln(!1,`Pathnames cannot have embedded double slashes - normalizing ${f} -> ${n}`)}n.startsWith("/")?u=W0(n.substring(1),"/"):u=W0(n,r)}else u=r;return{pathname:u,search:_R(s),hash:yR(o)}}function W0(e,r){let n=r.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function am(e,r,n,s){return`Cannot include a '${e}' character in a manually specified \`to.${r}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function gR(e){return e.filter((r,n)=>n===0||r.route.path&&r.route.path.length>0)}function Lg(e){let r=gR(e);return r.map((n,s)=>s===r.length-1?n.pathname:n.pathnameBase)}function Og(e,r,n,s=!1){let o;typeof e=="string"?o=ba(e):(o={...e},kt(!o.pathname||!o.pathname.includes("?"),am("?","pathname","search",o)),kt(!o.pathname||!o.pathname.includes("#"),am("#","pathname","hash",o)),kt(!o.search||!o.search.includes("#"),am("#","search","hash",o)));let u=e===""||o.pathname==="",f=u?"/":o.pathname,l;if(f==null)l=n;else{let p=r.length-1;if(!s&&f.startsWith("..")){let y=f.split("/");for(;y[0]==="..";)y.shift(),p-=1;o.pathname=y.join("/")}l=p>=0?r[p]:"/"}let c=mR(o,l),h=f&&f!=="/"&&f.endsWith("/"),m=(u||f===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(h||m)&&(c.pathname+="/"),c}var bi=e=>e.join("/").replace(/\/\/+/g,"/"),vR=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),_R=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,yR=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,SR=class{constructor(e,r,n,s=!1){this.status=e,this.statusText=r||"",this.internal=s,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function bR(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function CR(e){return e.map(r=>r.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Lb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ob(e,r){let n=e;if(typeof n!="string"||!kb.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let s=n,o=!1;if(Lb)try{let u=new URL(window.location.href),f=n.startsWith("//")?new URL(u.protocol+n):new URL(n),l=wi(f.pathname,r);f.origin===u.origin&&l!=null?n=l+f.search+f.hash:o=!0}catch{ln(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:o,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Bb=["POST","PUT","PATCH","DELETE"];new Set(Bb);var wR=["GET",...Bb];new Set(wR);var Ca=R.createContext(null);Ca.displayName="DataRouter";var hh=R.createContext(null);hh.displayName="DataRouterState";var xR=R.createContext(!1),Nb=R.createContext({isTransitioning:!1});Nb.displayName="ViewTransition";var ER=R.createContext(new Map);ER.displayName="Fetchers";var AR=R.createContext(null);AR.displayName="Await";var zr=R.createContext(null);zr.displayName="Navigation";var _c=R.createContext(null);_c.displayName="Location";var cn=R.createContext({outlet:null,matches:[],isDataRoute:!1});cn.displayName="Route";var Bg=R.createContext(null);Bg.displayName="RouteError";var Ib="REACT_ROUTER_ERROR",TR="REDIRECT",RR="ROUTE_ERROR_RESPONSE";function DR(e){if(e.startsWith(`${Ib}:${TR}:{`))try{let r=JSON.parse(e.slice(28));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.location=="string"&&typeof r.reloadDocument=="boolean"&&typeof r.replace=="boolean")return r}catch{}}function MR(e){if(e.startsWith(`${Ib}:${RR}:{`))try{let r=JSON.parse(e.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new SR(r.status,r.statusText,r.data)}catch{}}function kR(e,{relative:r}={}){kt(wa(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:s}=R.useContext(zr),{hash:o,pathname:u,search:f}=Sc(e,{relative:r}),l=u;return n!=="/"&&(l=u==="/"?n:bi([n,u])),s.createHref({pathname:l,search:f,hash:o})}function wa(){return R.useContext(_c)!=null}function Vn(){return kt(wa(),"useLocation() may be used only in the context of a <Router> component."),R.useContext(_c).location}var Pb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function jb(e){R.useContext(zr).static||R.useLayoutEffect(e)}function yc(){let{isDataRoute:e}=R.useContext(cn);return e?YR():LR()}function LR(){kt(wa(),"useNavigate() may be used only in the context of a <Router> component.");let e=R.useContext(Ca),{basename:r,navigator:n}=R.useContext(zr),{matches:s}=R.useContext(cn),{pathname:o}=Vn(),u=JSON.stringify(Lg(s)),f=R.useRef(!1);return jb(()=>{f.current=!0}),R.useCallback((c,h={})=>{if(ln(f.current,Pb),!f.current)return;if(typeof c=="number"){n.go(c);return}let m=Og(c,JSON.parse(u),o,h.relative==="path");e==null&&r!=="/"&&(m.pathname=m.pathname==="/"?r:bi([r,m.pathname])),(h.replace?n.replace:n.push)(m,h.state,h)},[r,n,u,o,e])}var OR=R.createContext(null);function BR(e){let r=R.useContext(cn).outlet;return R.useMemo(()=>r&&R.createElement(OR.Provider,{value:e},r),[r,e])}function Ub(){let{matches:e}=R.useContext(cn),r=e[e.length-1];return r?r.params:{}}function Sc(e,{relative:r}={}){let{matches:n}=R.useContext(cn),{pathname:s}=Vn(),o=JSON.stringify(Lg(n));return R.useMemo(()=>Og(e,JSON.parse(o),s,r==="path"),[e,o,s,r])}function NR(e,r){return Fb(e,r)}function Fb(e,r,n,s,o){var g;kt(wa(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=R.useContext(zr),{matches:f}=R.useContext(cn),l=f[f.length-1],c=l?l.params:{},h=l?l.pathname:"/",m=l?l.pathnameBase:"/",p=l&&l.route;{let _=p&&p.path||"";Vb(h,!p||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${_}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
60
+
61
+ Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}/*`}">.`)}let y=Vn(),x;if(r){let _=typeof r=="string"?ba(r):r;kt(m==="/"||((g=_.pathname)==null?void 0:g.startsWith(m)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${_.pathname}" was given in the \`location\` prop.`),x=_}else x=y;let A=x.pathname||"/",w=A;if(m!=="/"){let _=m.replace(/^\//,"").split("/");w="/"+A.replace(/^\//,"").split("/").slice(_.length).join("/")}let v=Rb(e,{pathname:w});ln(p||v!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),ln(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${x.pathname}${x.search}${x.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let S=FR(v&&v.map(_=>Object.assign({},_,{params:Object.assign({},c,_.params),pathname:bi([m,u.encodeLocation?u.encodeLocation(_.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?m:bi([m,u.encodeLocation?u.encodeLocation(_.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathnameBase])})),f,n,s,o);return r&&S?R.createElement(_c.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...x},navigationType:"POP"}},S):S}function IR(){let e=zR(),r=bR(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:s},u={padding:"2px 4px",backgroundColor:s},f=null;return console.error("Error handled by React Router default ErrorBoundary:",e),f=R.createElement(R.Fragment,null,R.createElement("p",null,"💿 Hey developer 👋"),R.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",R.createElement("code",{style:u},"ErrorBoundary")," or"," ",R.createElement("code",{style:u},"errorElement")," prop on your route.")),R.createElement(R.Fragment,null,R.createElement("h2",null,"Unexpected Application Error!"),R.createElement("h3",{style:{fontStyle:"italic"}},r),n?R.createElement("pre",{style:o},n):null,f)}var PR=R.createElement(IR,null),Hb=class extends R.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){this.props.onError?this.props.onError(e,r):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=MR(e.digest);n&&(e=n)}let r=e!==void 0?R.createElement(cn.Provider,{value:this.props.routeContext},R.createElement(Bg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?R.createElement(jR,{error:e},r):r}};Hb.contextType=xR;var lm=new WeakMap;function jR({children:e,error:r}){let{basename:n}=R.useContext(zr);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let s=DR(r.digest);if(s){let o=lm.get(r);if(o)throw o;let u=Ob(s.location,n);if(Lb&&!lm.get(r))if(u.isExternal||s.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:s.replace}));throw lm.set(r,f),f}return R.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return e}function UR({routeContext:e,match:r,children:n}){let s=R.useContext(Ca);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),R.createElement(cn.Provider,{value:e},n)}function FR(e,r=[],n=null,s=null,o=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(r.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let u=e,f=n==null?void 0:n.errors;if(f!=null){let m=u.findIndex(p=>p.route.id&&(f==null?void 0:f[p.route.id])!==void 0);kt(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),u=u.slice(0,Math.min(u.length,m+1))}let l=!1,c=-1;if(n)for(let m=0;m<u.length;m++){let p=u[m];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(c=m),p.route.id){let{loaderData:y,errors:x}=n,A=p.route.loader&&!y.hasOwnProperty(p.route.id)&&(!x||x[p.route.id]===void 0);if(p.route.lazy||A){l=!0,c>=0?u=u.slice(0,c+1):u=[u[0]];break}}}let h=n&&s?(m,p)=>{var y,x;s(m,{location:n.location,params:((x=(y=n.matches)==null?void 0:y[0])==null?void 0:x.params)??{},unstable_pattern:CR(n.matches),errorInfo:p})}:void 0;return u.reduceRight((m,p,y)=>{let x,A=!1,w=null,v=null;n&&(x=f&&p.route.id?f[p.route.id]:void 0,w=p.route.errorElement||PR,l&&(c<0&&y===0?(Vb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),A=!0,v=null):c===y&&(A=!0,v=p.route.hydrateFallbackElement||null)));let S=r.concat(u.slice(0,y+1)),g=()=>{let _;return x?_=w:A?_=v:p.route.Component?_=R.createElement(p.route.Component,null):p.route.element?_=p.route.element:_=m,R.createElement(UR,{match:p,routeContext:{outlet:m,matches:S,isDataRoute:n!=null},children:_})};return n&&(p.route.ErrorBoundary||p.route.errorElement||y===0)?R.createElement(Hb,{location:n.location,revalidation:n.revalidation,component:w,error:x,children:g(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:h}):g()},null)}function Ng(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function HR(e){let r=R.useContext(Ca);return kt(r,Ng(e)),r}function VR(e){let r=R.useContext(hh);return kt(r,Ng(e)),r}function qR(e){let r=R.useContext(cn);return kt(r,Ng(e)),r}function Ig(e){let r=qR(e),n=r.matches[r.matches.length-1];return kt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function GR(){return Ig("useRouteId")}function zR(){var s;let e=R.useContext(Bg),r=VR("useRouteError"),n=Ig("useRouteError");return e!==void 0?e:(s=r.errors)==null?void 0:s[n]}function YR(){let{router:e}=HR("useNavigate"),r=Ig("useNavigate"),n=R.useRef(!1);return jb(()=>{n.current=!0}),R.useCallback(async(o,u={})=>{ln(n.current,Pb),n.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:r,...u}))},[e,r])}var K0={};function Vb(e,r,n){!r&&!K0[e]&&(K0[e]=!0,ln(!1,n))}R.memo(WR);function WR({routes:e,future:r,state:n,onError:s}){return Fb(e,void 0,n,s,r)}function Ad({to:e,replace:r,state:n,relative:s}){kt(wa(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=R.useContext(zr);ln(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=R.useContext(cn),{pathname:f}=Vn(),l=yc(),c=Og(e,Lg(u),f,s==="path"),h=JSON.stringify(c);return R.useEffect(()=>{l(JSON.parse(h),{replace:r,state:n,relative:s})},[l,h,s,r,n]),null}function KR(e){return BR(e.context)}function Ln(e){kt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function QR({basename:e="/",children:r=null,location:n,navigationType:s="POP",navigator:o,static:u=!1,unstable_useTransitions:f}){kt(!wa(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),c=R.useMemo(()=>({basename:l,navigator:o,static:u,unstable_useTransitions:f,future:{}}),[l,o,u,f]);typeof n=="string"&&(n=ba(n));let{pathname:h="/",search:m="",hash:p="",state:y=null,key:x="default"}=n,A=R.useMemo(()=>{let w=wi(h,l);return w==null?null:{location:{pathname:w,search:m,hash:p,state:y,key:x},navigationType:s}},[l,h,m,p,y,x,s]);return ln(A!=null,`<Router basename="${l}"> is not able to match the URL "${h}${m}${p}" because it does not start with the basename, so the <Router> won't render anything.`),A==null?null:R.createElement(zr.Provider,{value:c},R.createElement(_c.Provider,{children:r,value:A}))}function $R({children:e,location:r}){return NR(Gm(e),r)}function Gm(e,r=[]){let n=[];return R.Children.forEach(e,(s,o)=>{if(!R.isValidElement(s))return;let u=[...r,o];if(s.type===R.Fragment){n.push.apply(n,Gm(s.props.children,u));return}kt(s.type===Ln,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),kt(!s.props.index||!s.props.children,"An index route cannot have child routes.");let f={id:s.props.id||u.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(f.children=Gm(s.props.children,u)),n.push(f)}),n}var Td="get",Rd="application/x-www-form-urlencoded";function fh(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function JR(e){return fh(e)&&e.tagName.toLowerCase()==="button"}function ZR(e){return fh(e)&&e.tagName.toLowerCase()==="form"}function XR(e){return fh(e)&&e.tagName.toLowerCase()==="input"}function eD(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function tD(e,r){return e.button===0&&(!r||r==="_self")&&!eD(e)}var dd=null;function rD(){if(dd===null)try{new FormData(document.createElement("form"),0),dd=!1}catch{dd=!0}return dd}var nD=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function cm(e){return e!=null&&!nD.has(e)?(ln(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Rd}"`),null):e}function iD(e,r){let n,s,o,u,f;if(ZR(e)){let l=e.getAttribute("action");s=l?wi(l,r):null,n=e.getAttribute("method")||Td,o=cm(e.getAttribute("enctype"))||Rd,u=new FormData(e)}else if(JR(e)||XR(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||l.getAttribute("action");if(s=c?wi(c,r):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||Td,o=cm(e.getAttribute("formenctype"))||cm(l.getAttribute("enctype"))||Rd,u=new FormData(l,e),!rD()){let{name:h,type:m,value:p}=e;if(m==="image"){let y=h?`${h}.`:"";u.append(`${y}x`,"0"),u.append(`${y}y`,"0")}else h&&u.append(h,p)}}else{if(fh(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Td,s=null,o=Rd,f=e}return u&&o==="text/plain"&&(f=u,u=void 0),{action:s,method:n.toLowerCase(),encType:o,formData:u,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Pg(e,r){if(e===!1||e===null||typeof e>"u")throw new Error(r)}function sD(e,r,n){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return s.pathname==="/"?s.pathname=`_root.${n}`:r&&wi(s.pathname,r)==="/"?s.pathname=`${r.replace(/\/$/,"")}/_root.${n}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${n}`,s}async function oD(e,r){if(e.id in r)return r[e.id];try{let n=await import(e.module);return r[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function aD(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function lD(e,r,n){let s=await Promise.all(e.map(async o=>{let u=r.routes[o.route.id];if(u){let f=await oD(u,n);return f.links?f.links():[]}return[]}));return hD(s.flat(1).filter(aD).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function Q0(e,r,n,s,o,u){let f=(c,h)=>n[h]?c.route.id!==n[h].route.id:!0,l=(c,h)=>{var m;return n[h].pathname!==c.pathname||((m=n[h].route.path)==null?void 0:m.endsWith("*"))&&n[h].params["*"]!==c.params["*"]};return u==="assets"?r.filter((c,h)=>f(c,h)||l(c,h)):u==="data"?r.filter((c,h)=>{var p;let m=s.routes[c.route.id];if(!m||!m.hasLoader)return!1;if(f(c,h)||l(c,h))return!0;if(c.route.shouldRevalidate){let y=c.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((p=n[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function cD(e,r,{includeHydrateFallback:n}={}){return uD(e.map(s=>{let o=r.routes[s.route.id];if(!o)return[];let u=[o.module];return o.clientActionModule&&(u=u.concat(o.clientActionModule)),o.clientLoaderModule&&(u=u.concat(o.clientLoaderModule)),n&&o.hydrateFallbackModule&&(u=u.concat(o.hydrateFallbackModule)),o.imports&&(u=u.concat(o.imports)),u}).flat(1))}function uD(e){return[...new Set(e)]}function dD(e){let r={},n=Object.keys(e).sort();for(let s of n)r[s]=e[s];return r}function hD(e,r){let n=new Set;return new Set(r),e.reduce((s,o)=>{let u=JSON.stringify(dD(o));return n.has(u)||(n.add(u),s.push({key:u,link:o})),s},[])}function qb(){let e=R.useContext(Ca);return Pg(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function fD(){let e=R.useContext(hh);return Pg(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var jg=R.createContext(void 0);jg.displayName="FrameworkContext";function Gb(){let e=R.useContext(jg);return Pg(e,"You must render this element inside a <HydratedRouter> element"),e}function pD(e,r){let n=R.useContext(jg),[s,o]=R.useState(!1),[u,f]=R.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:h,onMouseLeave:m,onTouchStart:p}=r,y=R.useRef(null);R.useEffect(()=>{if(e==="render"&&f(!0),e==="viewport"){let w=S=>{S.forEach(g=>{f(g.isIntersecting)})},v=new IntersectionObserver(w,{threshold:.5});return y.current&&v.observe(y.current),()=>{v.disconnect()}}},[e]),R.useEffect(()=>{if(s){let w=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(w)}}},[s]);let x=()=>{o(!0)},A=()=>{o(!1),f(!1)};return n?e!=="intent"?[u,y,{}]:[u,y,{onFocus:Gl(l,x),onBlur:Gl(c,A),onMouseEnter:Gl(h,x),onMouseLeave:Gl(m,A),onTouchStart:Gl(p,x)}]:[!1,y,{}]}function Gl(e,r){return n=>{e&&e(n),n.defaultPrevented||r(n)}}function mD({page:e,...r}){let{router:n}=qb(),s=R.useMemo(()=>Rb(n.routes,e,n.basename),[n.routes,e,n.basename]);return s?R.createElement(vD,{page:e,matches:s,...r}):null}function gD(e){let{manifest:r,routeModules:n}=Gb(),[s,o]=R.useState([]);return R.useEffect(()=>{let u=!1;return lD(e,r,n).then(f=>{u||o(f)}),()=>{u=!0}},[e,r,n]),s}function vD({page:e,matches:r,...n}){let s=Vn(),{manifest:o,routeModules:u}=Gb(),{basename:f}=qb(),{loaderData:l,matches:c}=fD(),h=R.useMemo(()=>Q0(e,r,c,o,s,"data"),[e,r,c,o,s]),m=R.useMemo(()=>Q0(e,r,c,o,s,"assets"),[e,r,c,o,s]),p=R.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let A=new Set,w=!1;if(r.forEach(S=>{var _;let g=o.routes[S.route.id];!g||!g.hasLoader||(!h.some(T=>T.route.id===S.route.id)&&S.route.id in l&&((_=u[S.route.id])!=null&&_.shouldRevalidate)||g.hasClientLoader?w=!0:A.add(S.route.id))}),A.size===0)return[];let v=sD(e,f,"data");return w&&A.size>0&&v.searchParams.set("_routes",r.filter(S=>A.has(S.route.id)).map(S=>S.route.id).join(",")),[v.pathname+v.search]},[f,l,s,o,h,r,e,u]),y=R.useMemo(()=>cD(m,o),[m,o]),x=gD(m);return R.createElement(R.Fragment,null,p.map(A=>R.createElement("link",{key:A,rel:"prefetch",as:"fetch",href:A,...n})),y.map(A=>R.createElement("link",{key:A,rel:"modulepreload",href:A,...n})),x.map(({key:A,link:w})=>R.createElement("link",{key:A,nonce:n.nonce,...w})))}function _D(...e){return r=>{e.forEach(n=>{typeof n=="function"?n(r):n!=null&&(n.current=r)})}}var yD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{yD&&(window.__reactRouterVersion="7.11.0")}catch{}function SD({basename:e,children:r,unstable_useTransitions:n,window:s}){let o=R.useRef();o.current==null&&(o.current=JT({window:s,v5Compat:!0}));let u=o.current,[f,l]=R.useState({action:u.action,location:u.location}),c=R.useCallback(h=>{n===!1?l(h):R.startTransition(()=>l(h))},[n]);return R.useLayoutEffect(()=>u.listen(c),[u,c]),R.createElement(QR,{basename:e,children:r,location:f.location,navigationType:f.action,navigator:u,unstable_useTransitions:n})}var zb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Yb=R.forwardRef(function({onClick:r,discover:n="render",prefetch:s="none",relative:o,reloadDocument:u,replace:f,state:l,target:c,to:h,preventScrollReset:m,viewTransition:p,unstable_defaultShouldRevalidate:y,...x},A){let{basename:w,unstable_useTransitions:v}=R.useContext(zr),S=typeof h=="string"&&zb.test(h),g=Ob(h,w);h=g.to;let _=kR(h,{relative:o}),[T,M,k]=pD(s,x),L=xD(h,{replace:f,state:l,target:c,preventScrollReset:m,relative:o,viewTransition:p,unstable_defaultShouldRevalidate:y,unstable_useTransitions:v});function D(K){r&&r(K),K.defaultPrevented||L(K)}let P=R.createElement("a",{...x,...k,href:g.absoluteURL||_,onClick:g.isExternal||u?r:D,ref:_D(A,M),target:c,"data-discover":!S&&n==="render"?"true":void 0});return T&&!S?R.createElement(R.Fragment,null,P,R.createElement(mD,{page:_})):P});Yb.displayName="Link";var bD=R.forwardRef(function({"aria-current":r="page",caseSensitive:n=!1,className:s="",end:o=!1,style:u,to:f,viewTransition:l,children:c,...h},m){let p=Sc(f,{relative:h.relative}),y=Vn(),x=R.useContext(hh),{navigator:A,basename:w}=R.useContext(zr),v=x!=null&&DD(p)&&l===!0,S=A.encodeLocation?A.encodeLocation(p).pathname:p.pathname,g=y.pathname,_=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;n||(g=g.toLowerCase(),_=_?_.toLowerCase():null,S=S.toLowerCase()),_&&w&&(_=wi(_,w)||_);const T=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let M=g===S||!o&&g.startsWith(S)&&g.charAt(T)==="/",k=_!=null&&(_===S||!o&&_.startsWith(S)&&_.charAt(S.length)==="/"),L={isActive:M,isPending:k,isTransitioning:v},D=M?r:void 0,P;typeof s=="function"?P=s(L):P=[s,M?"active":null,k?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let K=typeof u=="function"?u(L):u;return R.createElement(Yb,{...h,"aria-current":D,className:P,ref:m,style:K,to:f,viewTransition:l},typeof c=="function"?c(L):c)});bD.displayName="NavLink";var CD=R.forwardRef(({discover:e="render",fetcherKey:r,navigate:n,reloadDocument:s,replace:o,state:u,method:f=Td,action:l,onSubmit:c,relative:h,preventScrollReset:m,viewTransition:p,unstable_defaultShouldRevalidate:y,...x},A)=>{let{unstable_useTransitions:w}=R.useContext(zr),v=TD(),S=RD(l,{relative:h}),g=f.toLowerCase()==="get"?"get":"post",_=typeof l=="string"&&zb.test(l),T=M=>{if(c&&c(M),M.defaultPrevented)return;M.preventDefault();let k=M.nativeEvent.submitter,L=(k==null?void 0:k.getAttribute("formmethod"))||f,D=()=>v(k||M.currentTarget,{fetcherKey:r,method:L,navigate:n,replace:o,state:u,relative:h,preventScrollReset:m,viewTransition:p,unstable_defaultShouldRevalidate:y});w&&n!==!1?R.startTransition(()=>D()):D()};return R.createElement("form",{ref:A,method:g,action:S,onSubmit:s?c:T,...x,"data-discover":!_&&e==="render"?"true":void 0})});CD.displayName="Form";function wD(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Wb(e){let r=R.useContext(Ca);return kt(r,wD(e)),r}function xD(e,{target:r,replace:n,state:s,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:l,unstable_useTransitions:c}={}){let h=yc(),m=Vn(),p=Sc(e,{relative:u});return R.useCallback(y=>{if(tD(y,r)){y.preventDefault();let x=n!==void 0?n:tc(m)===tc(p),A=()=>h(e,{replace:x,state:s,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:l});c?R.startTransition(()=>A()):A()}},[m,h,p,n,s,r,e,o,u,f,l,c])}var ED=0,AD=()=>`__${String(++ED)}__`;function TD(){let{router:e}=Wb("useSubmit"),{basename:r}=R.useContext(zr),n=GR(),s=e.fetch,o=e.navigate;return R.useCallback(async(u,f={})=>{let{action:l,method:c,encType:h,formData:m,body:p}=iD(u,r);if(f.navigate===!1){let y=f.fetcherKey||AD();await s(y,n,f.action||l,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:m,body:p,formMethod:f.method||c,formEncType:f.encType||h,flushSync:f.flushSync})}else await o(f.action||l,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:m,body:p,formMethod:f.method||c,formEncType:f.encType||h,replace:f.replace,state:f.state,fromRouteId:n,flushSync:f.flushSync,viewTransition:f.viewTransition})},[s,o,r,n])}function RD(e,{relative:r}={}){let{basename:n}=R.useContext(zr),s=R.useContext(cn);kt(s,"useFormAction must be used inside a RouteContext");let[o]=s.matches.slice(-1),u={...Sc(e||".",{relative:r})},f=Vn();if(e==null){u.search=f.search;let l=new URLSearchParams(u.search),c=l.getAll("index");if(c.some(m=>m==="")){l.delete("index"),c.filter(p=>p).forEach(p=>l.append("index",p));let m=l.toString();u.search=m?`?${m}`:""}}return(!e||e===".")&&o.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(u.pathname=u.pathname==="/"?n:bi([n,u.pathname])),tc(u)}function DD(e,{relative:r}={}){let n=R.useContext(Nb);kt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=Wb("useViewTransitionState"),o=Sc(e,{relative:r});if(!n.isTransitioning)return!1;let u=wi(n.currentLocation.pathname,s)||n.currentLocation.pathname,f=wi(n.nextLocation.pathname,s)||n.nextLocation.pathname;return qd(o.pathname,f)!=null||qd(o.pathname,u)!=null}var bc=Tb();const MD=Dg(bc),$0=e=>{let r;const n=new Set,s=(h,m)=>{const p=typeof h=="function"?h(r):h;if(!Object.is(p,r)){const y=r;r=m??(typeof p!="object"||p===null)?p:Object.assign({},r,p),n.forEach(x=>x(r,y))}},o=()=>r,l={setState:s,getState:o,getInitialState:()=>c,subscribe:h=>(n.add(h),()=>n.delete(h))},c=r=e(s,o,l);return l},kD=(e=>e?$0(e):$0),LD=e=>e;function OD(e,r=LD){const n=nn.useSyncExternalStore(e.subscribe,nn.useCallback(()=>r(e.getState()),[e,r]),nn.useCallback(()=>r(e.getInitialState()),[e,r]));return nn.useDebugValue(n),n}const J0=e=>{const r=kD(e),n=s=>OD(r,s);return Object.assign(n,r),n},Ug=(e=>e?J0(e):J0),Z0={isAuthenticated:!1,credentials:null,connectionState:"disconnected",workstationOnline:!1,workstationInfo:null,tunnelInfo:null,sessions:[],selectedSessionId:null,availableAgents:[],workspaces:[]},Ve=Ug(e=>({...Z0,setAuthenticated:r=>e({isAuthenticated:r}),setCredentials:r=>e({credentials:r}),setConnectionState:r=>e({connectionState:r}),setWorkstationOnline:r=>e({workstationOnline:r}),setWorkstationInfo:r=>e({workstationInfo:r}),setTunnelInfo:r=>e({tunnelInfo:r}),setSessions:r=>e({sessions:r}),addSession:r=>e(n=>n.sessions.some(s=>s.id===r.id)?n:{sessions:[...n.sessions,r]}),removeSession:r=>e(n=>({sessions:n.sessions.filter(s=>s.id!==r),selectedSessionId:n.selectedSessionId===r?null:n.selectedSessionId})),updateSession:(r,n)=>e(s=>({sessions:s.sessions.map(o=>o.id===r?{...o,...n}:o)})),selectSession:r=>e({selectedSessionId:r}),setAvailableAgents:r=>e({availableAgents:r}),setWorkspaces:r=>e({workspaces:r}),reset:()=>e(Z0)}));function X0(e,r){if(typeof e=="function")return e(r);e!=null&&(e.current=r)}function Cc(...e){return r=>{let n=!1;const s=e.map(o=>{const u=X0(o,r);return!n&&typeof u=="function"&&(n=!0),u});if(n)return()=>{for(let o=0;o<s.length;o++){const u=s[o];typeof u=="function"?u():X0(e[o],null)}}}}function ot(...e){return R.useCallback(Cc(...e),e)}var BD=Symbol.for("react.lazy"),Gd=kg[" use ".trim().toString()];function ND(e){return typeof e=="object"&&e!==null&&"then"in e}function Kb(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===BD&&"_payload"in e&&ND(e._payload)}function Qb(e){const r=PD(e),n=R.forwardRef((s,o)=>{let{children:u,...f}=s;Kb(u)&&typeof Gd=="function"&&(u=Gd(u._payload));const l=R.Children.toArray(u),c=l.find(UD);if(c){const h=c.props.children,m=l.map(p=>p===c?R.Children.count(h)>1?R.Children.only(null):R.isValidElement(h)?h.props.children:null:p);return b.jsx(r,{...f,ref:o,children:R.isValidElement(h)?R.cloneElement(h,void 0,m):null})}return b.jsx(r,{...f,ref:o,children:u})});return n.displayName=`${e}.Slot`,n}var ID=Qb("Slot");function PD(e){const r=R.forwardRef((n,s)=>{let{children:o,...u}=n;if(Kb(o)&&typeof Gd=="function"&&(o=Gd(o._payload)),R.isValidElement(o)){const f=HD(o),l=FD(u,o.props);return o.type!==R.Fragment&&(l.ref=s?Cc(s,f):f),R.cloneElement(o,l)}return R.Children.count(o)>1?R.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var jD=Symbol("radix.slottable");function UD(e){return R.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===jD}function FD(e,r){const n={...r};for(const s in r){const o=e[s],u=r[s];/^on[A-Z]/.test(s)?o&&u?n[s]=(...l)=>{const c=u(...l);return o(...l),c}:o&&(n[s]=o):s==="style"?n[s]={...o,...u}:s==="className"&&(n[s]=[o,u].filter(Boolean).join(" "))}return{...e,...n}}function HD(e){var s,o;let r=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=r&&"isReactWarning"in r&&r.isReactWarning;return n?e.ref:(r=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=r&&"isReactWarning"in r&&r.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function $b(e){var r,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(r=0;r<o;r++)e[r]&&(n=$b(e[r]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function Jb(){for(var e,r,n=0,s="",o=arguments.length;n<o;n++)(e=arguments[n])&&(r=$b(e))&&(s&&(s+=" "),s+=r);return s}const eS=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,tS=Jb,Fg=(e,r)=>n=>{var s;if((r==null?void 0:r.variants)==null)return tS(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:u}=r,f=Object.keys(o).map(h=>{const m=n==null?void 0:n[h],p=u==null?void 0:u[h];if(m===null)return null;const y=eS(m)||eS(p);return o[h][y]}),l=n&&Object.entries(n).reduce((h,m)=>{let[p,y]=m;return y===void 0||(h[p]=y),h},{}),c=r==null||(s=r.compoundVariants)===null||s===void 0?void 0:s.reduce((h,m)=>{let{class:p,className:y,...x}=m;return Object.entries(x).every(A=>{let[w,v]=A;return Array.isArray(v)?v.includes({...u,...l}[w]):{...u,...l}[w]===v})?[...h,p,y]:h},[]);return tS(e,f,c,n==null?void 0:n.class,n==null?void 0:n.className)},Hg="-",VD=e=>{const r=GD(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:f=>{const l=f.split(Hg);return l[0]===""&&l.length!==1&&l.shift(),Zb(l,r)||qD(f)},getConflictingClassGroupIds:(f,l)=>{const c=n[f]||[];return l&&s[f]?[...c,...s[f]]:c}}},Zb=(e,r)=>{var f;if(e.length===0)return r.classGroupId;const n=e[0],s=r.nextPart.get(n),o=s?Zb(e.slice(1),s):void 0;if(o)return o;if(r.validators.length===0)return;const u=e.join(Hg);return(f=r.validators.find(({validator:l})=>l(u)))==null?void 0:f.classGroupId},rS=/^\[(.+)\]$/,qD=e=>{if(rS.test(e)){const r=rS.exec(e)[1],n=r==null?void 0:r.substring(0,r.indexOf(":"));if(n)return"arbitrary.."+n}},GD=e=>{const{theme:r,prefix:n}=e,s={nextPart:new Map,validators:[]};return YD(Object.entries(e.classGroups),n).forEach(([u,f])=>{zm(f,s,u,r)}),s},zm=(e,r,n,s)=>{e.forEach(o=>{if(typeof o=="string"){const u=o===""?r:nS(r,o);u.classGroupId=n;return}if(typeof o=="function"){if(zD(o)){zm(o(s),r,n,s);return}r.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([u,f])=>{zm(f,nS(r,u),n,s)})})},nS=(e,r)=>{let n=e;return r.split(Hg).forEach(s=>{n.nextPart.has(s)||n.nextPart.set(s,{nextPart:new Map,validators:[]}),n=n.nextPart.get(s)}),n},zD=e=>e.isThemeGetter,YD=(e,r)=>r?e.map(([n,s])=>{const o=s.map(u=>typeof u=="string"?r+u:typeof u=="object"?Object.fromEntries(Object.entries(u).map(([f,l])=>[r+f,l])):u);return[n,o]}):e,WD=e=>{if(e<1)return{get:()=>{},set:()=>{}};let r=0,n=new Map,s=new Map;const o=(u,f)=>{n.set(u,f),r++,r>e&&(r=0,s=n,n=new Map)};return{get(u){let f=n.get(u);if(f!==void 0)return f;if((f=s.get(u))!==void 0)return o(u,f),f},set(u,f){n.has(u)?n.set(u,f):o(u,f)}}},Xb="!",KD=e=>{const{separator:r,experimentalParseClassName:n}=e,s=r.length===1,o=r[0],u=r.length,f=l=>{const c=[];let h=0,m=0,p;for(let v=0;v<l.length;v++){let S=l[v];if(h===0){if(S===o&&(s||l.slice(v,v+u)===r)){c.push(l.slice(m,v)),m=v+u;continue}if(S==="/"){p=v;continue}}S==="["?h++:S==="]"&&h--}const y=c.length===0?l:l.substring(m),x=y.startsWith(Xb),A=x?y.substring(1):y,w=p&&p>m?p-m:void 0;return{modifiers:c,hasImportantModifier:x,baseClassName:A,maybePostfixModifierPosition:w}};return n?l=>n({className:l,parseClassName:f}):f},QD=e=>{if(e.length<=1)return e;const r=[];let n=[];return e.forEach(s=>{s[0]==="["?(r.push(...n.sort(),s),n=[]):n.push(s)}),r.push(...n.sort()),r},$D=e=>({cache:WD(e.cacheSize),parseClassName:KD(e),...VD(e)}),JD=/\s+/,ZD=(e,r)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:o}=r,u=[],f=e.trim().split(JD);let l="";for(let c=f.length-1;c>=0;c-=1){const h=f[c],{modifiers:m,hasImportantModifier:p,baseClassName:y,maybePostfixModifierPosition:x}=n(h);let A=!!x,w=s(A?y.substring(0,x):y);if(!w){if(!A){l=h+(l.length>0?" "+l:l);continue}if(w=s(y),!w){l=h+(l.length>0?" "+l:l);continue}A=!1}const v=QD(m).join(":"),S=p?v+Xb:v,g=S+w;if(u.includes(g))continue;u.push(g);const _=o(w,A);for(let T=0;T<_.length;++T){const M=_[T];u.push(S+M)}l=h+(l.length>0?" "+l:l)}return l};function XD(){let e=0,r,n,s="";for(;e<arguments.length;)(r=arguments[e++])&&(n=eC(r))&&(s&&(s+=" "),s+=n);return s}const eC=e=>{if(typeof e=="string")return e;let r,n="";for(let s=0;s<e.length;s++)e[s]&&(r=eC(e[s]))&&(n&&(n+=" "),n+=r);return n};function e2(e,...r){let n,s,o,u=f;function f(c){const h=r.reduce((m,p)=>p(m),e());return n=$D(h),s=n.cache.get,o=n.cache.set,u=l,l(c)}function l(c){const h=s(c);if(h)return h;const m=ZD(c,n);return o(c,m),m}return function(){return u(XD.apply(null,arguments))}}const At=e=>{const r=n=>n[e]||[];return r.isThemeGetter=!0,r},tC=/^\[(?:([a-z-]+):)?(.+)\]$/i,t2=/^\d+\/\d+$/,r2=new Set(["px","full","screen"]),n2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,i2=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,s2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,o2=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,a2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,gi=e=>la(e)||r2.has(e)||t2.test(e),ls=e=>xa(e,"length",m2),la=e=>!!e&&!Number.isNaN(Number(e)),um=e=>xa(e,"number",la),zl=e=>!!e&&Number.isInteger(Number(e)),l2=e=>e.endsWith("%")&&la(e.slice(0,-1)),We=e=>tC.test(e),cs=e=>n2.test(e),c2=new Set(["length","size","percentage"]),u2=e=>xa(e,c2,rC),d2=e=>xa(e,"position",rC),h2=new Set(["image","url"]),f2=e=>xa(e,h2,v2),p2=e=>xa(e,"",g2),Yl=()=>!0,xa=(e,r,n)=>{const s=tC.exec(e);return s?s[1]?typeof r=="string"?s[1]===r:r.has(s[1]):n(s[2]):!1},m2=e=>i2.test(e)&&!s2.test(e),rC=()=>!1,g2=e=>o2.test(e),v2=e=>a2.test(e),_2=()=>{const e=At("colors"),r=At("spacing"),n=At("blur"),s=At("brightness"),o=At("borderColor"),u=At("borderRadius"),f=At("borderSpacing"),l=At("borderWidth"),c=At("contrast"),h=At("grayscale"),m=At("hueRotate"),p=At("invert"),y=At("gap"),x=At("gradientColorStops"),A=At("gradientColorStopPositions"),w=At("inset"),v=At("margin"),S=At("opacity"),g=At("padding"),_=At("saturate"),T=At("scale"),M=At("sepia"),k=At("skew"),L=At("space"),D=At("translate"),P=()=>["auto","contain","none"],K=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto",We,r],z=()=>[We,r],W=()=>["",gi,ls],F=()=>["auto",la,We],ee=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Y=()=>["solid","dashed","dotted","double","none"],re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],te=()=>["start","end","center","between","around","evenly","stretch"],O=()=>["","0",We],G=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>[la,We];return{cacheSize:500,separator:":",theme:{colors:[Yl],spacing:[gi,ls],blur:["none","",cs,We],brightness:j(),borderColor:[e],borderRadius:["none","","full",cs,We],borderSpacing:z(),borderWidth:W(),contrast:j(),grayscale:O(),hueRotate:j(),invert:O(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[l2,ls],inset:$(),margin:$(),opacity:j(),padding:z(),saturate:j(),scale:j(),sepia:O(),skew:j(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",We]}],container:["container"],columns:[{columns:[cs]}],"break-after":[{"break-after":G()}],"break-before":[{"break-before":G()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ee(),We]}],overflow:[{overflow:K()}],"overflow-x":[{"overflow-x":K()}],"overflow-y":[{"overflow-y":K()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",zl,We]}],basis:[{basis:$()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",We]}],grow:[{grow:O()}],shrink:[{shrink:O()}],order:[{order:["first","last","none",zl,We]}],"grid-cols":[{"grid-cols":[Yl]}],"col-start-end":[{col:["auto",{span:["full",zl,We]},We]}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":[Yl]}],"row-start-end":[{row:["auto",{span:[zl,We]},We]}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",We]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",We]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",...te()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...te(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...te(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[L]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[L]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",We,r]}],"min-w":[{"min-w":[We,r,"min","max","fit"]}],"max-w":[{"max-w":[We,r,"none","full","min","max","fit","prose",{screen:[cs]},cs]}],h:[{h:[We,r,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[We,r,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[We,r,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[We,r,"auto","min","max","fit"]}],"font-size":[{text:["base",cs,ls]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",um]}],"font-family":[{font:[Yl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",We]}],"line-clamp":[{"line-clamp":["none",la,um]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",gi,We]}],"list-image":[{"list-image":["none",We]}],"list-style-type":[{list:["none","disc","decimal",We]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",gi,ls]}],"underline-offset":[{"underline-offset":["auto",gi,We]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",We]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",We]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ee(),d2]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",u2]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},f2]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[A]}],"gradient-via-pos":[{via:[A]}],"gradient-to-pos":[{to:[A]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[u]}],"rounded-s":[{"rounded-s":[u]}],"rounded-e":[{"rounded-e":[u]}],"rounded-t":[{"rounded-t":[u]}],"rounded-r":[{"rounded-r":[u]}],"rounded-b":[{"rounded-b":[u]}],"rounded-l":[{"rounded-l":[u]}],"rounded-ss":[{"rounded-ss":[u]}],"rounded-se":[{"rounded-se":[u]}],"rounded-ee":[{"rounded-ee":[u]}],"rounded-es":[{"rounded-es":[u]}],"rounded-tl":[{"rounded-tl":[u]}],"rounded-tr":[{"rounded-tr":[u]}],"rounded-br":[{"rounded-br":[u]}],"rounded-bl":[{"rounded-bl":[u]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...Y(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:Y()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...Y()]}],"outline-offset":[{"outline-offset":[gi,We]}],"outline-w":[{outline:[gi,ls]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[gi,ls]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",cs,p2]}],"shadow-color":[{shadow:[Yl]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...re(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":re()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[s]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",cs,We]}],grayscale:[{grayscale:[h]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[p]}],saturate:[{saturate:[_]}],sepia:[{sepia:[M]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[h]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[M]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[f]}],"border-spacing-x":[{"border-spacing-x":[f]}],"border-spacing-y":[{"border-spacing-y":[f]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",We]}],duration:[{duration:j()}],ease:[{ease:["linear","in","out","in-out",We]}],delay:[{delay:j()}],animate:[{animate:["none","spin","ping","pulse","bounce",We]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[zl,We]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",We]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",We]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",We]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[gi,ls,um]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},y2=e2(_2);function Te(...e){return y2(Jb(e))}function dm(e){if(!e||typeof e!="object")return null;const r=e;if(typeof r.tunnel_id!="string"||typeof r.url!="string"||typeof r.key!="string")return null;const n=r.tunnel_id.trim(),s=r.url.trim(),o=r.key.trim();if(!n||!s||!o||!/^[a-zA-Z0-9-_]+$/.test(n))return null;let u=s;try{const f=new URL(s);if(f.protocol==="http:")u="ws:"+s.slice(5);else if(f.protocol==="https:")u="wss:"+s.slice(6);else if(f.protocol!=="ws:"&&f.protocol!=="wss:")return null}catch{return null}return o.length<1?null:{tunnelId:n,url:u,key:o}}function S2(e){if(!e||typeof e!="string")return null;const r=e.trim();if(!r)return null;try{if(r.startsWith("{")){const o=JSON.parse(r);return dm(o)}const n="tiflis://connect?data=",s=r.toLowerCase();if(s.startsWith(n)){const o=s.indexOf("data=");if(o===-1)return null;let u=r.slice(o+5).trim();try{u=decodeURIComponent(u)}catch{}if(!u||!/^[A-Za-z0-9+/=_-]+$/.test(u))return null;const f=u.replace(/-/g,"+").replace(/_/g,"/"),l=JSON.parse(atob(f));return dm(l)}try{const o=new URL(r);if(o.protocol==="tiflis:"){const u=o.searchParams.get("data");if(u&&/^[A-Za-z0-9+/=]+$/.test(u)){const f=JSON.parse(atob(u));return dm(f)}}}catch{}return null}catch{return null}}const Vg=Fg("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),dt=R.forwardRef(({className:e,variant:r,size:n,asChild:s=!1,...o},u)=>{const f=s?ID:"button";return b.jsx(f,{className:Te(Vg({variant:r,size:n,className:e})),ref:u,...o})});dt.displayName="Button";const nC=R.forwardRef(({className:e,type:r,...n},s)=>b.jsx("input",{type:r,className:Te("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:s,...n}));nC.displayName="Input";const fs=R.forwardRef(({className:e,...r},n)=>b.jsx("div",{ref:n,className:Te("rounded-lg border bg-card text-card-foreground shadow-sm",e),...r}));fs.displayName="Card";const ps=R.forwardRef(({className:e,...r},n)=>b.jsx("div",{ref:n,className:Te("flex flex-col space-y-1.5 p-6",e),...r}));ps.displayName="CardHeader";const ms=R.forwardRef(({className:e,...r},n)=>b.jsx("div",{ref:n,className:Te("text-2xl font-semibold leading-none tracking-tight",e),...r}));ms.displayName="CardTitle";const Xs=R.forwardRef(({className:e,...r},n)=>b.jsx("div",{ref:n,className:Te("text-sm text-muted-foreground",e),...r}));Xs.displayName="CardDescription";const gs=R.forwardRef(({className:e,...r},n)=>b.jsx("div",{ref:n,className:Te("p-6 pt-0",e),...r}));gs.displayName="CardContent";const b2=R.forwardRef(({className:e,...r},n)=>b.jsx("div",{ref:n,className:Te("flex items-center p-6 pt-0",e),...r}));b2.displayName="CardFooter";var iC=e=>{throw TypeError(e)},sC=(e,r,n)=>r.has(e)||iC("Cannot "+n),C2=(e,r,n)=>(sC(e,r,"read from private field"),n?n.call(e):r.get(e)),w2=(e,r,n)=>r.has(e)?iC("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(e):r.set(e,n),x2=(e,r,n,s)=>(sC(e,r,"write to private field"),r.set(e,n),n);const ph=[["Aztec","M"],["Codabar","L"],["Code39","L"],["Code93","L"],["Code128","L"],["DataBar","L"],["DataBarExpanded","L"],["DataMatrix","M"],["EAN-8","L"],["EAN-13","L"],["ITF","L"],["MaxiCode","M"],["PDF417","M"],["QRCode","M"],["UPC-A","L"],["UPC-E","L"],["MicroQRCode","M"],["rMQRCode","M"],["DXFilmEdge","L"],["DataBarLimited","L"]],mh=ph.map(([e])=>e),E2=mh.filter((e,r)=>ph[r][1]==="L"),A2=mh.filter((e,r)=>ph[r][1]==="M");function Ym(e){switch(e){case"Linear-Codes":return E2.reduce((r,n)=>r|Ym(n),0);case"Matrix-Codes":return A2.reduce((r,n)=>r|Ym(n),0);case"Any":return(1<<ph.length)-1;case"None":return 0;default:return 1<<mh.indexOf(e)}}function T2(e){if(e===0)return"None";const r=31-Math.clz32(e);return mh[r]}function R2(e){return e.reduce((r,n)=>r|Ym(n),0)}const D2=["LocalAverage","GlobalHistogram","FixedThreshold","BoolCast"];function M2(e){return D2.indexOf(e)}const iS=["Unknown","ASCII","ISO8859_1","ISO8859_2","ISO8859_3","ISO8859_4","ISO8859_5","ISO8859_6","ISO8859_7","ISO8859_8","ISO8859_9","ISO8859_10","ISO8859_11","ISO8859_13","ISO8859_14","ISO8859_15","ISO8859_16","Cp437","Cp1250","Cp1251","Cp1252","Cp1256","Shift_JIS","Big5","GB2312","GB18030","EUC_JP","EUC_KR","UTF16BE","UTF16BE","UTF8","UTF16LE","UTF32BE","UTF32LE","BINARY"];function k2(e){return e==="UnicodeBig"?iS.indexOf("UTF16BE"):iS.indexOf(e)}const L2=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function O2(e){return L2[e]}const B2=["Ignore","Read","Require"];function N2(e){return B2.indexOf(e)}const I2=["Plain","ECI","HRI","Hex","Escaped"];function P2(e){return I2.indexOf(e)}const zd={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,tryDenoise:!1,binarizer:"LocalAverage",isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,tryCode39ExtendedMode:!0,returnErrors:!1,eanAddOnSymbol:"Ignore",textMode:"HRI",characterSet:"Unknown"};function sS(e){return{...e,formats:R2(e.formats),binarizer:M2(e.binarizer),eanAddOnSymbol:N2(e.eanAddOnSymbol),textMode:P2(e.textMode),characterSet:k2(e.characterSet)}}function j2(e){return{...e,format:T2(e.format),contentType:O2(e.contentType),eccLevel:e.ecLevel}}const U2={locateFile:(e,r)=>{const n=e.match(/_(.+?)\.wasm$/);return n?`https://fastly.jsdelivr.net/npm/zxing-wasm@2.2.4/dist/${n[1]}/${e}`:r+e}},hm=new WeakMap;function F2(e,r){return Object.is(e,r)||Object.keys(e).length===Object.keys(r).length&&Object.keys(e).every(n=>Object.hasOwn(r,n)&&e[n]===r[n])}function oC(e,{overrides:r,equalityFn:n=F2,fireImmediately:s=!1}={}){var o;const[u,f]=(o=hm.get(e))!=null?o:[U2],l=r??u;let c;if(s){if(f&&(c=n(u,l)))return f;const h=e({...l});return hm.set(e,[l,h]),h}(c??n(u,l))||hm.set(e,[l])}async function H2(e,r,n=zd){const s={...zd,...n},o=await oC(e,{fireImmediately:!0});let u,f;if("width"in r&&"height"in r&&"data"in r){const{data:c,data:{byteLength:h},width:m,height:p}=r;f=o._malloc(h),o.HEAPU8.set(c,f),u=o.readBarcodesFromPixmap(f,m,p,sS(s))}else{let c,h;if("buffer"in r)[c,h]=[r.byteLength,r];else if("byteLength"in r)[c,h]=[r.byteLength,new Uint8Array(r)];else if("size"in r)[c,h]=[r.size,new Uint8Array(await r.arrayBuffer())];else throw new TypeError("Invalid input type");f=o._malloc(c),o.HEAPU8.set(h,f),u=o.readBarcodesFromImage(f,c,sS(s))}o._free(f);const l=[];for(let c=0;c<u.size();++c)l.push(j2(u.get(c)));return l}({...zd,formats:[...zd.formats]});async function aC(e={}){var r,n,s,o=e,u=!!globalThis.window,f=typeof Bun<"u",l=!!globalThis.WorkerGlobalScope;!((n=globalThis.process)===null||n===void 0||(n=n.versions)===null||n===void 0)&&n.node&&((s=globalThis.process)===null||s===void 0?void 0:s.type)!="renderer";var c="./this.program",h,m="";function p(N){return o.locateFile?o.locateFile(N,m):m+N}var y,x;if(u||l||f){try{m=new URL(".",h).href}catch{}l&&(x=N=>{var I=new XMLHttpRequest;return I.open("GET",N,!1),I.responseType="arraybuffer",I.send(null),new Uint8Array(I.response)}),y=async N=>{var I=await fetch(N,{credentials:"same-origin"});if(I.ok)return I.arrayBuffer();throw new Error(I.status+" : "+I.url)}}var A=console.log.bind(console),w=console.error.bind(console),v,S=!1,g,_,T,M,k,L,D,P,K,$,z=!1;function W(){var N=Os.buffer;T=new Int8Array(N),k=new Int16Array(N),o.HEAPU8=M=new Uint8Array(N),L=new Uint16Array(N),D=new Int32Array(N),P=new Uint32Array(N),K=new Float32Array(N),$=new Float64Array(N)}function F(){if(o.preRun)for(typeof o.preRun=="function"&&(o.preRun=[o.preRun]);o.preRun.length;)oe(o.preRun.shift());fe(ue)}function ee(){z=!0,ei.xa()}function Y(){if(o.postRun)for(typeof o.postRun=="function"&&(o.postRun=[o.postRun]);o.postRun.length;)U(o.postRun.shift());fe(Q)}function re(N){var I,V;(I=o.onAbort)===null||I===void 0||I.call(o,N),N="Aborted("+N+")",w(N),S=!0,N+=". Build with -sASSERTIONS for more info.";var X=new WebAssembly.RuntimeError(N);throw(V=_)===null||V===void 0||V(X),X}var te;function O(){return p("zxing_reader.wasm")}function G(N){if(N==te&&v)return new Uint8Array(v);if(x)return x(N);throw"both async and sync fetching of the wasm failed"}async function j(N){if(!v)try{var I=await y(N);return new Uint8Array(I)}catch{}return G(N)}async function q(N,I){try{var V=await j(N),X=await WebAssembly.instantiate(V,I);return X}catch(se){w(`failed to asynchronously prepare wasm: ${se}`),re(se)}}async function ne(N,I,V){if(!N&&WebAssembly.instantiateStreaming)try{var X=fetch(I,{credentials:"same-origin"}),se=await WebAssembly.instantiateStreaming(X,V);return se}catch(le){w(`wasm streaming compile failed: ${le}`),w("falling back to ArrayBuffer instantiation")}return q(I,V)}function Z(){var N={a:Ii};return N}async function be(){function N(le,ge){return ei=le.exports,eu(ei),W(),ei}function I(le){return N(le.instance)}var V=Z();if(o.instantiateWasm)return new Promise((le,ge)=>{o.instantiateWasm(V,(ye,Ee)=>{le(N(ye))})});te!=null||(te=O());var X=await ne(v,te,V),se=I(X);return se}var fe=N=>{for(;N.length>0;)N.shift()(o)},Q=[],U=N=>Q.push(N),ue=[],oe=N=>ue.push(N),de=N=>Jc(N),he=()=>Zc(),De=[],Ie=0,Fe=N=>{var I=new Lt(N);return I.get_caught()||(I.set_caught(!0),Ie--),I.set_rethrown(!1),De.push(I),Ni(N),Qc(N)},je=0,Oe=()=>{Qe(0,0);var N=De.pop();Mo(N.excPtr),je=0};class Lt{constructor(I){this.excPtr=I,this.ptr=I-24}set_type(I){P[this.ptr+4>>2]=I}get_type(){return P[this.ptr+4>>2]}set_destructor(I){P[this.ptr+8>>2]=I}get_destructor(){return P[this.ptr+8>>2]}set_caught(I){I=I?1:0,T[this.ptr+12]=I}get_caught(){return T[this.ptr+12]!=0}set_rethrown(I){I=I?1:0,T[this.ptr+13]=I}get_rethrown(){return T[this.ptr+13]!=0}init(I,V){this.set_adjusted_ptr(0),this.set_type(I),this.set_destructor(V)}set_adjusted_ptr(I){P[this.ptr+16>>2]=I}get_adjusted_ptr(){return P[this.ptr+16>>2]}}var Tt=N=>$c(N),Vt=N=>{var I=je;if(!I)return Tt(0),0;var V=new Lt(I);V.set_adjusted_ptr(I);var X=V.get_type();if(!X)return Tt(0),I;for(var se of N){if(se===0||se===X)break;var le=V.ptr+16;if(Xc(se,X,le))return Tt(se),I}return Tt(X),I},Rt=()=>Vt([]),bn=N=>Vt([N]),Xt=(N,I)=>Vt([N,I]),Ot=()=>{var N=De.pop();N||re("no exception to throw");var I=N.excPtr;throw N.get_rethrown()||(De.push(N),N.set_rethrown(!0),N.set_caught(!1),Ie++),je=I,je},lr=(N,I,V)=>{var X=new Lt(N);throw X.init(I,V),je=N,Ie++,je},Yr=()=>Ie,Cn=N=>{throw je||(je=N),je},mr=()=>re(""),un={},gr=N=>{for(;N.length;){var I=N.pop(),V=N.pop();V(I)}};function Br(N){return this.fromWireType(P[N>>2])}var at={},vr={},er={},wn=class extends Error{constructor(N){super(N),this.name="InternalError"}},tr=N=>{throw new wn(N)},Yn=(N,I,V)=>{N.forEach(ye=>er[ye]=I);function X(ye){var Ee=V(ye);Ee.length!==N.length&&tr("Mismatched type converter count");for(var Re=0;Re<N.length;++Re)_r(N[Re],Ee[Re])}var se=new Array(I.length),le=[],ge=0;{const ye=I;for(let Ee=0;Ee<ye.length;++Ee){const Re=ye[Ee];vr.hasOwnProperty(Re)?se[Ee]=vr[Re]:(le.push(Re),at.hasOwnProperty(Re)||(at[Re]=[]),at[Re].push(()=>{se[Ee]=vr[Re],++ge,ge===le.length&&X(se)}))}}le.length===0&&X(se)},jh=N=>{var I=un[N];delete un[N];var V=I.rawConstructor,X=I.rawDestructor,se=I.fields,le=se.map(ge=>ge.getterReturnType).concat(se.map(ge=>ge.setterArgumentType));Yn([N],le,ge=>{var ye={};{const Ee=se;for(let Re=0;Re<Ee.length;++Re){const Me=Ee[Re],Ne=ge[Re],st=Me.getter,$e=Me.getterContext,vt=ge[Re+se.length],Ct=Me.setter,pt=Me.setterContext;ye[Me.fieldName]={read:ht=>Ne.fromWireType(st($e,ht)),write:(ht,pn)=>{var Nt=[];Ct(pt,ht,vt.toWireType(Nt,pn)),gr(Nt)},optional:Ne.optional}}}return[{name:I.name,fromWireType:Ee=>{var Re={};for(var Me in ye)Re[Me]=ye[Me].read(Ee);return X(Ee),Re},toWireType:(Ee,Re)=>{for(var Me in ye)if(!(Me in Re)&&!ye[Me].optional)throw new TypeError(`Missing field: "${Me}"`);var Ne=V();for(Me in ye)ye[Me].write(Ne,Re[Me]);return Ee!==null&&Ee.push(X,Ne),Ne},readValueFromPointer:Br,destructorFunction:X}]})},Uh=(N,I,V,X,se)=>{},qt=N=>{for(var I="";;){var V=M[N++];if(!V)return I;I+=String.fromCharCode(V)}},xn=class extends Error{constructor(N){super(N),this.name="BindingError"}},nt=N=>{throw new xn(N)};function Wn(N,I){let V=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var X=I.name;if(N||nt(`type "${X}" must have a positive integer typeid pointer`),vr.hasOwnProperty(N)){if(V.ignoreDuplicateRegistrations)return;nt(`Cannot register type '${X}' twice`)}if(vr[N]=I,delete er[N],at.hasOwnProperty(N)){var se=at[N];delete at[N],se.forEach(le=>le())}}function _r(N,I){let V=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Wn(N,I,V)}var Cs=(N,I,V,X)=>{I=qt(I),_r(N,{name:I,fromWireType:function(se){return!!se},toWireType:function(se,le){return le?V:X},readValueFromPointer:function(se){return this.fromWireType(M[se])},destructorFunction:null})},Fh=N=>({count:N.count,deleteScheduled:N.deleteScheduled,preservePointerOnDelete:N.preservePointerOnDelete,ptr:N.ptr,ptrType:N.ptrType,smartPtr:N.smartPtr,smartPtrType:N.smartPtrType}),po=N=>{function I(V){return V.$$.ptrType.registeredClass.name}nt(I(N)+" instance already deleted")},ws=!1,Ri=N=>{},Hh=N=>{N.smartPtr?N.smartPtrType.rawDestructor(N.smartPtr):N.ptrType.registeredClass.rawDestructor(N.ptr)},Ba=N=>{N.count.value-=1;var I=N.count.value===0;I&&Hh(N)},Di=N=>globalThis.FinalizationRegistry?(ws=new FinalizationRegistry(I=>{Ba(I.$$)}),Di=I=>{var V=I.$$,X=!!V.smartPtr;if(X){var se={$$:V};ws.register(I,se,I)}return I},Ri=I=>ws.unregister(I),Di(N)):(Di=I=>I,N),Ic=()=>{let N=Mi.prototype;Object.assign(N,{isAliasOf(V){if(!(this instanceof Mi)||!(V instanceof Mi))return!1;var X=this.$$.ptrType.registeredClass,se=this.$$.ptr;V.$$=V.$$;for(var le=V.$$.ptrType.registeredClass,ge=V.$$.ptr;X.baseClass;)se=X.upcast(se),X=X.baseClass;for(;le.baseClass;)ge=le.upcast(ge),le=le.baseClass;return X===le&&se===ge},clone(){if(this.$$.ptr||po(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var V=Di(Object.create(Object.getPrototypeOf(this),{$$:{value:Fh(this.$$)}}));return V.$$.count.value+=1,V.$$.deleteScheduled=!1,V},delete(){this.$$.ptr||po(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&nt("Object already scheduled for deletion"),Ri(this),Ba(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||po(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&nt("Object already scheduled for deletion"),this.$$.deleteScheduled=!0,this}});const I=Symbol.dispose;I&&(N[I]=N.delete)};function Mi(){}var xs=(N,I)=>Object.defineProperty(I,"name",{value:N}),Na={},Ia=(N,I,V)=>{if(N[I].overloadTable===void 0){var X=N[I];N[I]=function(){for(var se=arguments.length,le=new Array(se),ge=0;ge<se;ge++)le[ge]=arguments[ge];return N[I].overloadTable.hasOwnProperty(le.length)||nt(`Function '${V}' called with an invalid number of arguments (${le.length}) - expects one of (${N[I].overloadTable})!`),N[I].overloadTable[le.length].apply(this,le)},N[I].overloadTable=[],N[I].overloadTable[X.argCount]=X}},dn=(N,I,V)=>{o.hasOwnProperty(N)?((V===void 0||o[N].overloadTable!==void 0&&o[N].overloadTable[V]!==void 0)&&nt(`Cannot register public name '${N}' twice`),Ia(o,N,N),o[N].overloadTable.hasOwnProperty(V)&&nt(`Cannot register multiple overloads of a function with the same number of arguments (${V})!`),o[N].overloadTable[V]=I):(o[N]=I,o[N].argCount=V)},Qt=48,cr=57,ki=N=>{N=N.replace(/[^a-zA-Z0-9_]/g,"$");var I=N.charCodeAt(0);return I>=Qt&&I<=cr?`_${N}`:N};function Pa(N,I,V,X,se,le,ge,ye){this.name=N,this.constructor=I,this.instancePrototype=V,this.rawDestructor=X,this.baseClass=se,this.getActualType=le,this.upcast=ge,this.downcast=ye,this.pureVirtualFunctions=[]}var ja=(N,I,V)=>{for(;I!==V;)I.upcast||nt(`Expected null or instance of ${V.name}, got an instance of ${I.name}`),N=I.upcast(N),I=I.baseClass;return N},Ua=N=>{if(N===null)return"null";var I=typeof N;return I==="object"||I==="array"||I==="function"?N.toString():""+N};function Pc(N,I){if(I===null)return this.isReference&&nt(`null is not a valid ${this.name}`),0;I.$$||nt(`Cannot pass "${Ua(I)}" as a ${this.name}`),I.$$.ptr||nt(`Cannot pass deleted object as a pointer of type ${this.name}`);var V=I.$$.ptrType.registeredClass,X=ja(I.$$.ptr,V,this.registeredClass);return X}function Es(N,I){var V;if(I===null)return this.isReference&&nt(`null is not a valid ${this.name}`),this.isSmartPointer?(V=this.rawConstructor(),N!==null&&N.push(this.rawDestructor,V),V):0;(!I||!I.$$)&&nt(`Cannot pass "${Ua(I)}" as a ${this.name}`),I.$$.ptr||nt(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&I.$$.ptrType.isConst&&nt(`Cannot convert argument of type ${I.$$.smartPtrType?I.$$.smartPtrType.name:I.$$.ptrType.name} to parameter type ${this.name}`);var X=I.$$.ptrType.registeredClass;if(V=ja(I.$$.ptr,X,this.registeredClass),this.isSmartPointer)switch(I.$$.smartPtr===void 0&&nt("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:I.$$.smartPtrType===this?V=I.$$.smartPtr:nt(`Cannot convert argument of type ${I.$$.smartPtrType?I.$$.smartPtrType.name:I.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:V=I.$$.smartPtr;break;case 2:if(I.$$.smartPtrType===this)V=I.$$.smartPtr;else{var se=I.clone();V=this.rawShare(V,Nr.toHandle(()=>se.delete())),N!==null&&N.push(this.rawDestructor,V)}break;default:nt("Unsupporting sharing policy")}return V}function Fa(N,I){if(I===null)return this.isReference&&nt(`null is not a valid ${this.name}`),0;I.$$||nt(`Cannot pass "${Ua(I)}" as a ${this.name}`),I.$$.ptr||nt(`Cannot pass deleted object as a pointer of type ${this.name}`),I.$$.ptrType.isConst&&nt(`Cannot convert argument of type ${I.$$.ptrType.name} to parameter type ${this.name}`);var V=I.$$.ptrType.registeredClass,X=ja(I.$$.ptr,V,this.registeredClass);return X}var Kn=(N,I,V)=>{if(I===V)return N;if(V.baseClass===void 0)return null;var X=Kn(N,I,V.baseClass);return X===null?null:V.downcast(X)},Li={},As=(N,I)=>{for(I===void 0&&nt("ptr should not be undefined");N.baseClass;)I=N.upcast(I),N=N.baseClass;return I},Oi=(N,I)=>(I=As(N,I),Li[I]),Bt=(N,I)=>{(!I.ptrType||!I.ptr)&&tr("makeClassHandle requires ptr and ptrType");var V=!!I.smartPtrType,X=!!I.smartPtr;return V!==X&&tr("Both smartPtrType and smartPtr must be specified"),I.count={value:1},Di(Object.create(N,{$$:{value:I,writable:!0}}))};function jc(N){var I=this.getPointee(N);if(!I)return this.destructor(N),null;var V=Oi(this.registeredClass,I);if(V!==void 0){if(V.$$.count.value===0)return V.$$.ptr=I,V.$$.smartPtr=N,V.clone();var X=V.clone();return this.destructor(N),X}function se(){return this.isSmartPointer?Bt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:I,smartPtrType:this,smartPtr:N}):Bt(this.registeredClass.instancePrototype,{ptrType:this,ptr:N})}var le=this.registeredClass.getActualType(I),ge=Na[le];if(!ge)return se.call(this);var ye;this.isConst?ye=ge.constPointerType:ye=ge.pointerType;var Ee=Kn(I,this.registeredClass,ye.registeredClass);return Ee===null?se.call(this):this.isSmartPointer?Bt(ye.registeredClass.instancePrototype,{ptrType:ye,ptr:Ee,smartPtrType:this,smartPtr:N}):Bt(ye.registeredClass.instancePrototype,{ptrType:ye,ptr:Ee})}var Uc=()=>{Object.assign(Wr.prototype,{getPointee(N){return this.rawGetPointee&&(N=this.rawGetPointee(N)),N},destructor(N){var I;(I=this.rawDestructor)===null||I===void 0||I.call(this,N)},readValueFromPointer:Br,fromWireType:jc})};function Wr(N,I,V,X,se,le,ge,ye,Ee,Re,Me){this.name=N,this.registeredClass=I,this.isReference=V,this.isConst=X,this.isSmartPointer=se,this.pointeeType=le,this.sharingPolicy=ge,this.rawGetPointee=ye,this.rawConstructor=Ee,this.rawShare=Re,this.rawDestructor=Me,!se&&I.baseClass===void 0?X?(this.toWireType=Pc,this.destructorFunction=null):(this.toWireType=Fa,this.destructorFunction=null):this.toWireType=Es}var Qn=(N,I,V)=>{o.hasOwnProperty(N)||tr("Replacing nonexistent public symbol"),o[N].overloadTable!==void 0&&V!==void 0?o[N].overloadTable[V]=I:(o[N]=I,o[N].argCount=V)},En={},Fc=(N,I,V)=>{N=N.replace(/p/g,"i");var X=En[N];return X(I,...V)},Ha=[],Ze=N=>{var I=Ha[N];return I||(Ha[N]=I=il.get(N)),I},mo=function(N,I){let V=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(N.includes("j"))return Fc(N,I,V);var X=Ze(I),se=X(...V);return se},go=function(N,I){let V=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return function(){for(var X=arguments.length,se=new Array(X),le=0;le<X;le++)se[le]=arguments[le];return mo(N,I,se,V)}},Ut=function(N,I){N=qt(N);function V(){if(N.includes("j"))return go(N,I);var se=Ze(I);return se}var X=V();return typeof X!="function"&&nt(`unknown function pointer with signature ${N}: ${I}`),X};class wr extends Error{}var Va=N=>{var I=Kc(N),V=qt(I);return Tn(I),V},vo=(N,I)=>{var V=[],X={};function se(le){if(!X[le]&&!vr[le]){if(er[le]){er[le].forEach(se);return}V.push(le),X[le]=!0}}throw I.forEach(se),new wr(`${N}: `+V.map(Va).join([", "]))},qa=(N,I,V,X,se,le,ge,ye,Ee,Re,Me,Ne,st)=>{Me=qt(Me),le=Ut(se,le),ye&&(ye=Ut(ge,ye)),Re&&(Re=Ut(Ee,Re)),st=Ut(Ne,st);var $e=ki(Me);dn($e,function(){vo(`Cannot construct ${Me} due to unbound types`,[X])}),Yn([N,I,V],X?[X]:[],vt=>{vt=vt[0];var Ct,pt;X?(Ct=vt.registeredClass,pt=Ct.instancePrototype):pt=Mi.prototype;var ht=xs(Me,function(){if(Object.getPrototypeOf(this)!==pn)throw new xn(`Use 'new' to construct ${Me}`);if(Nt.constructor_body===void 0)throw new xn(`${Me} has no accessible constructor`);for(var Lo=arguments.length,Ar=new Array(Lo),js=0;js<Lo;js++)Ar[js]=arguments[js];var Us=Nt.constructor_body[Ar.length];if(Us===void 0)throw new xn(`Tried to invoke ctor of ${Me} with invalid number of parameters (${Ar.length}) - expected (${Object.keys(Nt.constructor_body).toString()}) parameters instead!`);return Us.apply(this,Ar)}),pn=Object.create(pt,{constructor:{value:ht}});ht.prototype=pn;var Nt=new Pa(Me,ht,pn,st,Ct,le,ye,Re);if(Nt.baseClass){var Kr,ti;(ti=(Kr=Nt.baseClass).__derivedClasses)!==null&&ti!==void 0||(Kr.__derivedClasses=[]),Nt.baseClass.__derivedClasses.push(Nt)}var Ui=new Wr(Me,Nt,!0,!1,!1),fu=new Wr(Me+"*",Nt,!1,!1,!1),dr=new Wr(Me+" const*",Nt,!1,!0,!1);return Na[N]={pointerType:fu,constPointerType:dr},Qn($e,ht),[Ui,fu,dr]})},_o=(N,I)=>{for(var V=[],X=0;X<N;X++)V.push(P[I+X*4>>2]);return V};function yo(N){for(var I=1;I<N.length;++I)if(N[I]!==null&&N[I].destructorFunction===void 0)return!0;return!1}function Ga(N,I,V,X,se,le){var ge=I.length;ge<2&&nt("argTypes array size mismatch! Must at least get return value and 'this' types!");var ye=I[1]!==null&&V!==null,Ee=yo(I),Re=!I[0].isVoid,Me=ge-2,Ne=new Array(Me),st=[],$e=[],vt=function(){$e.length=0;var Ct;st.length=ye?2:1,st[0]=se,ye&&(Ct=I[1].toWireType($e,this),st[1]=Ct);for(var pt=0;pt<Me;++pt)Ne[pt]=I[pt+2].toWireType($e,pt<0||arguments.length<=pt?void 0:arguments[pt]),st.push(Ne[pt]);var ht=X(...st);function pn(Nt){if(Ee)gr($e);else for(var Kr=ye?1:2;Kr<I.length;Kr++){var ti=Kr===1?Ct:Ne[Kr-2];I[Kr].destructorFunction!==null&&I[Kr].destructorFunction(ti)}if(Re)return I[0].fromWireType(Nt)}return pn(ht)};return xs(N,vt)}var xr=(N,I,V,X,se,le)=>{var ge=_o(I,V);se=Ut(X,se),Yn([],[N],ye=>{ye=ye[0];var Ee=`constructor ${ye.name}`;if(ye.registeredClass.constructor_body===void 0&&(ye.registeredClass.constructor_body=[]),ye.registeredClass.constructor_body[I-1]!==void 0)throw new xn(`Cannot register multiple constructors with identical number of parameters (${I-1}) for class '${ye.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return ye.registeredClass.constructor_body[I-1]=()=>{vo(`Cannot construct ${ye.name} due to unbound types`,ge)},Yn([],ge,Re=>(Re.splice(1,0,null),ye.registeredClass.constructor_body[I-1]=Ga(Ee,Re,null,se,le),[])),[]})},So=N=>{N=N.trim();const I=N.indexOf("(");return I===-1?N:N.slice(0,I)},Hc=(N,I,V,X,se,le,ge,ye,Ee,Re)=>{var Me=_o(V,X);I=qt(I),I=So(I),le=Ut(se,le),Yn([],[N],Ne=>{Ne=Ne[0];var st=`${Ne.name}.${I}`;I.startsWith("@@")&&(I=Symbol[I.substring(2)]),ye&&Ne.registeredClass.pureVirtualFunctions.push(I);function $e(){vo(`Cannot call ${st} due to unbound types`,Me)}var vt=Ne.registeredClass.instancePrototype,Ct=vt[I];return Ct===void 0||Ct.overloadTable===void 0&&Ct.className!==Ne.name&&Ct.argCount===V-2?($e.argCount=V-2,$e.className=Ne.name,vt[I]=$e):(Ia(vt,I,st),vt[I].overloadTable[V-2]=$e),Yn([],Me,pt=>{var ht=Ga(st,pt,Ne,le,ge);return vt[I].overloadTable===void 0?(ht.argCount=V-2,vt[I]=ht):vt[I].overloadTable[V-2]=ht,[]}),[]})},bo=[],Er=[0,1,,1,null,1,!0,1,!1,1],Co=N=>{N>9&&--Er[N+1]===0&&(Er[N]=void 0,bo.push(N))},Nr={toValue:N=>(N||nt(`Cannot use deleted val. handle = ${N}`),Er[N]),toHandle:N=>{switch(N){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const I=bo.pop()||Er.length;return Er[I]=N,Er[I+1]=1,I}}}},$n={name:"emscripten::val",fromWireType:N=>{var I=Nr.toValue(N);return Co(N),I},toWireType:(N,I)=>Nr.toHandle(I),readValueFromPointer:Br,destructorFunction:null},Vh=N=>_r(N,$n),Vc=(N,I)=>{switch(I){case 4:return function(V){return this.fromWireType(K[V>>2])};case 8:return function(V){return this.fromWireType($[V>>3])};default:throw new TypeError(`invalid float width (${I}): ${N}`)}},qc=(N,I,V)=>{I=qt(I),_r(N,{name:I,fromWireType:X=>X,toWireType:(X,se)=>se,readValueFromPointer:Vc(I,V),destructorFunction:null})},za=(N,I,V,X,se,le,ge,ye)=>{var Ee=_o(I,V);N=qt(N),N=So(N),se=Ut(X,se),dn(N,function(){vo(`Cannot call ${N} due to unbound types`,Ee)},I-1),Yn([],Ee,Re=>{var Me=[Re[0],null].concat(Re.slice(1));return Qn(N,Ga(N,Me,null,se,le),I-1),[]})},qh=(N,I,V)=>{switch(I){case 1:return V?X=>T[X]:X=>M[X];case 2:return V?X=>k[X>>1]:X=>L[X>>1];case 4:return V?X=>D[X>>2]:X=>P[X>>2];default:throw new TypeError(`invalid integer width (${I}): ${N}`)}},Gh=(N,I,V,X,se)=>{I=qt(I);const le=X===0;let ge=Ee=>Ee;if(le){var ye=32-8*V;ge=Ee=>Ee<<ye>>>ye,se=ge(se)}_r(N,{name:I,fromWireType:ge,toWireType:(Ee,Re)=>Re,readValueFromPointer:qh(I,V,X!==0),destructorFunction:null})},wo=(N,I,V)=>{var X=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],se=X[I];function le(ge){var ye=P[ge>>2],Ee=P[ge+4>>2];return new se(T.buffer,Ee,ye)}V=qt(V),_r(N,{name:V,fromWireType:le,readValueFromPointer:le},{ignoreDuplicateRegistrations:!0})},hn=Object.assign({optional:!0},$n),Ya=(N,I)=>{_r(N,hn)},Wa=(N,I,V,X)=>{if(!(X>0))return 0;for(var se=V,le=V+X-1,ge=0;ge<N.length;++ge){var ye=N.codePointAt(ge);if(ye<=127){if(V>=le)break;I[V++]=ye}else if(ye<=2047){if(V+1>=le)break;I[V++]=192|ye>>6,I[V++]=128|ye&63}else if(ye<=65535){if(V+2>=le)break;I[V++]=224|ye>>12,I[V++]=128|ye>>6&63,I[V++]=128|ye&63}else{if(V+3>=le)break;I[V++]=240|ye>>18,I[V++]=128|ye>>12&63,I[V++]=128|ye>>6&63,I[V++]=128|ye&63,ge++}}return I[V]=0,V-se},Ir=(N,I,V)=>Wa(N,M,I,V),Jn=N=>{for(var I=0,V=0;V<N.length;++V){var X=N.charCodeAt(V);X<=127?I++:X<=2047?I+=2:X>=55296&&X<=57343?(I+=4,++V):I+=3}return I},Ka=globalThis.TextDecoder&&new TextDecoder,xo=(N,I,V,X)=>{var se=I+V;if(X)return se;for(;N[I]&&!(I>=se);)++I;return I},Qa=function(N){let I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,V=arguments.length>2?arguments[2]:void 0,X=arguments.length>3?arguments[3]:void 0;var se=xo(N,I,V,X);if(se-I>16&&N.buffer&&Ka)return Ka.decode(N.subarray(I,se));for(var le="";I<se;){var ge=N[I++];if(!(ge&128)){le+=String.fromCharCode(ge);continue}var ye=N[I++]&63;if((ge&224)==192){le+=String.fromCharCode((ge&31)<<6|ye);continue}var Ee=N[I++]&63;if((ge&240)==224?ge=(ge&15)<<12|ye<<6|Ee:ge=(ge&7)<<18|ye<<12|Ee<<6|N[I++]&63,ge<65536)le+=String.fromCharCode(ge);else{var Re=ge-65536;le+=String.fromCharCode(55296|Re>>10,56320|Re&1023)}}return le},Ts=(N,I,V)=>N?Qa(M,N,I,V):"",fn=(N,I)=>{I=qt(I),_r(N,{name:I,fromWireType(V){var X=P[V>>2],se=V+4,le;return le=Ts(se,X,!0),Tn(V),le},toWireType(V,X){X instanceof ArrayBuffer&&(X=new Uint8Array(X));var se,le=typeof X=="string";le||ArrayBuffer.isView(X)&&X.BYTES_PER_ELEMENT==1||nt("Cannot pass non-string to std::string"),le?se=Jn(X):se=X.length;var ge=tl(4+se+1),ye=ge+4;return P[ge>>2]=se,le?Ir(X,ye,se+1):M.set(X,ye),V!==null&&V.push(Tn,ge),ge},readValueFromPointer:Br,destructorFunction(V){Tn(V)}})},Eo=globalThis.TextDecoder?new TextDecoder("utf-16le"):void 0,Rs=(N,I,V)=>{var X=N>>1,se=xo(L,X,I/2,V);if(se-X>16&&Eo)return Eo.decode(L.subarray(X,se));for(var le="",ge=X;ge<se;++ge){var ye=L[ge];le+=String.fromCharCode(ye)}return le},An=(N,I,V)=>{if(V!=null||(V=2147483647),V<2)return 0;V-=2;for(var X=I,se=V<N.length*2?V/2:N.length,le=0;le<se;++le){var ge=N.charCodeAt(le);k[I>>1]=ge,I+=2}return k[I>>1]=0,I-X},$a=N=>N.length*2,Ao=(N,I,V)=>{for(var X="",se=N>>2,le=0;!(le>=I/4);le++){var ge=P[se+le];if(!ge&&!V)break;X+=String.fromCodePoint(ge)}return X},Gc=(N,I,V)=>{if(V!=null||(V=2147483647),V<4)return 0;for(var X=I,se=X+V-4,le=0;le<N.length;++le){var ge=N.codePointAt(le);if(ge>65535&&le++,D[I>>2]=ge,I+=4,I+4>se)break}return D[I>>2]=0,I-X},To=N=>{for(var I=0,V=0;V<N.length;++V){var X=N.codePointAt(V);X>65535&&V++,I+=4}return I},Ro=(N,I,V)=>{V=qt(V);var X,se,le;I===2?(X=Rs,se=An,le=$a):(X=Ao,se=Gc,le=To),_r(N,{name:V,fromWireType:ge=>{var ye=P[ge>>2],Ee=X(ge+4,ye*I,!0);return Tn(ge),Ee},toWireType:(ge,ye)=>{typeof ye!="string"&&nt(`Cannot pass non-string to C++ string type ${V}`);var Ee=le(ye),Re=tl(4+Ee+I);return P[Re>>2]=Ee/I,se(ye,Re+4,Ee+I),ge!==null&&ge.push(Tn,Re),Re},readValueFromPointer:Br,destructorFunction(ge){Tn(ge)}})},zc=(N,I,V,X,se,le)=>{un[N]={name:qt(I),rawConstructor:Ut(V,X),rawDestructor:Ut(se,le),fields:[]}},ur=(N,I,V,X,se,le,ge,ye,Ee,Re)=>{un[N].fields.push({fieldName:qt(I),getterReturnType:V,getter:Ut(X,se),getterContext:le,setterArgumentType:ge,setter:Ut(ye,Ee),setterContext:Re})},Zn=(N,I)=>{I=qt(I),_r(N,{isVoid:!0,name:I,fromWireType:()=>{},toWireType:(V,X)=>{}})},Bi=[],Ds=N=>{var I=Bi.length;return Bi.push(N),I},zh=(N,I)=>{var V=vr[N];return V===void 0&&nt(`${I} has unknown type ${Va(N)}`),V},Ja=(N,I)=>{for(var V=new Array(N),X=0;X<N;++X)V[X]=zh(P[I+X*4>>2],`parameter ${X}`);return V},Za=(N,I,V)=>{var X=[],se=N(X,V);return X.length&&(P[I>>2]=Nr.toHandle(X)),se},Ms={},ks=N=>{var I=Ms[N];return I===void 0?qt(N):I},Yc=(N,I,V)=>{var X=8,[se,...le]=Ja(N,I),ge=se.toWireType.bind(se),ye=le.map(Ne=>Ne.readValueFromPointer.bind(Ne));N--;var Ee=new Array(N),Re=(Ne,st,$e,vt)=>{for(var Ct=0,pt=0;pt<N;++pt)Ee[pt]=ye[pt](vt+Ct),Ct+=X;var ht;switch(V){case 0:ht=Nr.toValue(Ne).apply(null,Ee);break;case 2:ht=Reflect.construct(Nr.toValue(Ne),Ee);break;case 3:ht=Ee[0];break;case 1:ht=Nr.toValue(Ne)[ks(st)](...Ee);break}return Za(ge,$e,ht)},Me=`methodCaller<(${le.map(Ne=>Ne.name)}) => ${se.name}>`;return Ds(xs(Me,Re))},Yh=N=>N?(N=ks(N),Nr.toHandle(globalThis[N])):Nr.toHandle(globalThis),Wh=N=>{N>9&&(Er[N+1]+=1)},Kh=(N,I,V,X,se)=>Bi[N](I,V,X,se),Xa=N=>{var I=Nr.toValue(N);gr(I),Co(N)},Qh=(N,I,V,X)=>{var se=new Date().getFullYear(),le=new Date(se,0,1),ge=new Date(se,6,1),ye=le.getTimezoneOffset(),Ee=ge.getTimezoneOffset(),Re=Math.max(ye,Ee);P[N>>2]=Re*60,D[I>>2]=+(ye!=Ee);var Me=$e=>{var vt=$e>=0?"-":"+",Ct=Math.abs($e),pt=String(Math.floor(Ct/60)).padStart(2,"0"),ht=String(Ct%60).padStart(2,"0");return`UTC${vt}${pt}${ht}`},Ne=Me(ye),st=Me(Ee);Ee<ye?(Ir(Ne,V,17),Ir(st,X,17)):(Ir(Ne,X,17),Ir(st,V,17))},$h=()=>2147483648,Jh=(N,I)=>Math.ceil(N/I)*I,Zh=N=>{var I=Os.buffer.byteLength,V=(N-I+65535)/65536|0;try{return Os.grow(V),W(),1}catch{}},Xh=N=>{var I=M.length;N>>>=0;var V=$h();if(N>V)return!1;for(var X=1;X<=4;X*=2){var se=I*(1+.2/X);se=Math.min(se,N+100663296);var le=Math.min(V,Jh(Math.max(N,se),65536)),ge=Zh(le);if(ge)return!0}return!1},Do={},ef=()=>c||"./this.program",Ls=()=>{if(!Ls.strings){var N=(typeof navigator=="object"&&navigator.language||"C").replace("-","_")+".UTF-8",I={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:N,_:ef()};for(var V in Do)Do[V]===void 0?delete I[V]:I[V]=Do[V];var X=[];for(var V in I)X.push(`${V}=${I[V]}`);Ls.strings=X}return Ls.strings},tf=(N,I)=>{var V=0,X=0;for(var se of Ls()){var le=I+V;P[N+X>>2]=le,V+=Ir(se,le,1/0)+1,X+=4}return 0},rf=(N,I)=>{var V=Ls();P[N>>2]=V.length;var X=0;for(var se of V)X+=Jn(se)+1;return P[I>>2]=X,0},el=N=>52;function nf(N,I,V,X,se){return 70}var sf=[null,[],[]],of=(N,I)=>{var V=sf[N];I===0||I===10?((N===1?A:w)(Qa(V)),V.length=0):V.push(I)},Wc=(N,I,V,X)=>{for(var se=0,le=0;le<V;le++){var ge=P[I>>2],ye=P[I+4>>2];I+=8;for(var Ee=0;Ee<ye;Ee++)of(N,M[ge+Ee]);se+=ye}return P[X>>2]=se,0},af=N=>N;if(Ic(),Uc(),o.noExitRuntime&&o.noExitRuntime,o.print&&(A=o.print),o.printErr&&(w=o.printErr),o.wasmBinary&&(v=o.wasmBinary),o.arguments&&o.arguments,o.thisProgram&&(c=o.thisProgram),o.preInit)for(typeof o.preInit=="function"&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.shift()();var Kc,Tn,tl,Qc,Qe,$c,Jc,Zc,Mo,Ni,Xc,rl,nl,Os,il;function eu(N){Kc=N.ya,Tn=o._free=N.za,tl=o._malloc=N.Ba,Qc=N.Ca,Qe=N.Da,$c=N.Ea,Jc=N.Fa,Zc=N.Ga,Mo=N.Ha,Ni=N.Ia,Xc=N.Ja,En.viijii=N.Ka,rl=En.iiijj=N.La,En.jiji=N.Ma,nl=En.jiiii=N.Na,En.iiiiij=N.Oa,En.iiiiijj=N.Pa,En.iiiiiijj=N.Qa,Os=N.wa,il=N.Aa}var Ii={s:Fe,w:Oe,a:Rt,j:bn,m:Xt,Q:Ot,p:lr,U:Yr,d:Cn,ca:mr,ta:jh,ba:Uh,oa:Cs,ra:qa,qa:xr,H:Hc,ma:Vh,X:qc,Y:za,x:Gh,t:wo,sa:Ya,na:fn,R:Ro,I:zc,ua:ur,pa:Zn,N:Yc,va:Co,D:Yh,S:Wh,M:Kh,ia:Xa,da:Qh,ga:Xh,ea:tf,fa:rf,ha:el,$:nf,V:Wc,K:Is,C:uu,Z:Ns,T:Ps,r:pf,b:ru,E:yr,ka:al,c:df,ja:vf,h:Bs,i:iu,q:ou,P:gf,v:hf,F:ff,L:mf,z:du,J:cl,aa:hu,_:Xn,f:ko,l:lf,e:tu,g:uf,O:ll,k:cf,la:lu,o:au,B:sl,u:cu,W:su,A:Pi,n:nu,G:ol,y:af};function lf(N,I){var V=he();try{Ze(N)(I)}catch(X){if(de(V),X!==X+0)throw X;Qe(1,0)}}function cf(N,I,V,X,se){var le=he();try{Ze(N)(I,V,X,se)}catch(ge){if(de(le),ge!==ge+0)throw ge;Qe(1,0)}}function uf(N,I,V,X){var se=he();try{Ze(N)(I,V,X)}catch(le){if(de(se),le!==le+0)throw le;Qe(1,0)}}function tu(N,I,V){var X=he();try{Ze(N)(I,V)}catch(se){if(de(X),se!==se+0)throw se;Qe(1,0)}}function ru(N,I){var V=he();try{return Ze(N)(I)}catch(X){if(de(V),X!==X+0)throw X;Qe(1,0)}}function Bs(N,I,V,X){var se=he();try{return Ze(N)(I,V,X)}catch(le){if(de(se),le!==le+0)throw le;Qe(1,0)}}function Ns(N,I,V,X,se,le){var ge=he();try{return Ze(N)(I,V,X,se,le)}catch(ye){if(de(ge),ye!==ye+0)throw ye;Qe(1,0)}}function df(N,I,V){var X=he();try{return Ze(N)(I,V)}catch(se){if(de(X),se!==se+0)throw se;Qe(1,0)}}function ko(N){var I=he();try{Ze(N)()}catch(V){if(de(I),V!==V+0)throw V;Qe(1,0)}}function nu(N,I,V,X,se,le,ge,ye,Ee,Re,Me){var Ne=he();try{Ze(N)(I,V,X,se,le,ge,ye,Ee,Re,Me)}catch(st){if(de(Ne),st!==st+0)throw st;Qe(1,0)}}function iu(N,I,V,X,se){var le=he();try{return Ze(N)(I,V,X,se)}catch(ge){if(de(le),ge!==ge+0)throw ge;Qe(1,0)}}function sl(N,I,V,X,se,le,ge){var ye=he();try{Ze(N)(I,V,X,se,le,ge)}catch(Ee){if(de(ye),Ee!==Ee+0)throw Ee;Qe(1,0)}}function ol(N,I,V,X,se,le,ge,ye,Ee,Re,Me,Ne,st,$e,vt,Ct){var pt=he();try{Ze(N)(I,V,X,se,le,ge,ye,Ee,Re,Me,Ne,st,$e,vt,Ct)}catch(ht){if(de(pt),ht!==ht+0)throw ht;Qe(1,0)}}function su(N,I,V,X,se,le,ge,ye,Ee){var Re=he();try{Ze(N)(I,V,X,se,le,ge,ye,Ee)}catch(Me){if(de(Re),Me!==Me+0)throw Me;Qe(1,0)}}function ou(N,I,V,X,se,le){var ge=he();try{return Ze(N)(I,V,X,se,le)}catch(ye){if(de(ge),ye!==ye+0)throw ye;Qe(1,0)}}function au(N,I,V,X,se,le){var ge=he();try{Ze(N)(I,V,X,se,le)}catch(ye){if(de(ge),ye!==ye+0)throw ye;Qe(1,0)}}function hf(N,I,V,X,se,le,ge){var ye=he();try{return Ze(N)(I,V,X,se,le,ge)}catch(Ee){if(de(ye),Ee!==Ee+0)throw Ee;Qe(1,0)}}function ff(N,I,V,X,se,le,ge,ye){var Ee=he();try{return Ze(N)(I,V,X,se,le,ge,ye)}catch(Re){if(de(Ee),Re!==Re+0)throw Re;Qe(1,0)}}function pf(N){var I=he();try{return Ze(N)()}catch(V){if(de(I),V!==V+0)throw V;Qe(1,0)}}function mf(N,I,V,X,se,le,ge,ye,Ee){var Re=he();try{return Ze(N)(I,V,X,se,le,ge,ye,Ee)}catch(Me){if(de(Re),Me!==Me+0)throw Me;Qe(1,0)}}function gf(N,I,V,X,se,le,ge){var ye=he();try{return Ze(N)(I,V,X,se,le,ge)}catch(Ee){if(de(ye),Ee!==Ee+0)throw Ee;Qe(1,0)}}function yr(N,I,V,X){var se=he();try{return Ze(N)(I,V,X)}catch(le){if(de(se),le!==le+0)throw le;Qe(1,0)}}function Is(N,I,V,X){var se=he();try{return Ze(N)(I,V,X)}catch(le){if(de(se),le!==le+0)throw le;Qe(1,0)}}function lu(N,I,V,X,se,le,ge,ye){var Ee=he();try{Ze(N)(I,V,X,se,le,ge,ye)}catch(Re){if(de(Ee),Re!==Re+0)throw Re;Qe(1,0)}}function cu(N,I,V,X,se,le,ge,ye){var Ee=he();try{Ze(N)(I,V,X,se,le,ge,ye)}catch(Re){if(de(Ee),Re!==Re+0)throw Re;Qe(1,0)}}function uu(N,I,V,X,se,le){var ge=he();try{return Ze(N)(I,V,X,se,le)}catch(ye){if(de(ge),ye!==ye+0)throw ye;Qe(1,0)}}function du(N,I,V,X,se,le,ge,ye,Ee,Re){var Me=he();try{return Ze(N)(I,V,X,se,le,ge,ye,Ee,Re)}catch(Ne){if(de(Me),Ne!==Ne+0)throw Ne;Qe(1,0)}}function al(N,I,V){var X=he();try{return Ze(N)(I,V)}catch(se){if(de(X),se!==se+0)throw se;Qe(1,0)}}function vf(N,I,V,X,se){var le=he();try{return Ze(N)(I,V,X,se)}catch(ge){if(de(le),ge!==ge+0)throw ge;Qe(1,0)}}function Pi(N,I,V,X,se,le,ge,ye,Ee,Re){var Me=he();try{Ze(N)(I,V,X,se,le,ge,ye,Ee,Re)}catch(Ne){if(de(Me),Ne!==Ne+0)throw Ne;Qe(1,0)}}function ll(N,I,V,X,se,le,ge){var ye=he();try{Ze(N)(I,V,X,se,le,ge)}catch(Ee){if(de(ye),Ee!==Ee+0)throw Ee;Qe(1,0)}}function Ps(N,I,V,X){var se=he();try{return Ze(N)(I,V,X)}catch(le){if(de(se),le!==le+0)throw le;Qe(1,0)}}function cl(N,I,V,X,se,le,ge,ye,Ee,Re,Me,Ne){var st=he();try{return Ze(N)(I,V,X,se,le,ge,ye,Ee,Re,Me,Ne)}catch($e){if(de(st),$e!==$e+0)throw $e;Qe(1,0)}}function hu(N,I,V,X,se,le,ge){var ye=he();try{return rl(N,I,V,X,se,le,ge)}catch(Ee){if(de(ye),Ee!==Ee+0)throw Ee;Qe(1,0)}}function Xn(N,I,V,X,se){var le=he();try{return nl(N,I,V,X,se)}catch(ge){if(de(le),ge!==ge+0)throw ge;Qe(1,0)}}function ji(){F();function N(){var I,V;o.calledRun=!0,!S&&(ee(),(I=g)===null||I===void 0||I(o),(V=o.onRuntimeInitialized)===null||V===void 0||V.call(o),Y())}o.setStatus?(o.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>o.setStatus(""),1),N()},1)):N()}var ei;return ei=await be(),ji(),z?r=o:r=new Promise((N,I)=>{g=N,_=I}),r}function V2(e){return oC(aC,e)}async function q2(e,r){return H2(aC,e,r)}const lC=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["databar_limited","DataBarLimited"],["data_matrix","DataMatrix"],["dx_film_edge","DXFilmEdge"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["maxi_code","MaxiCode"],["micro_qr_code","MicroQRCode"],["pdf417","PDF417"],["qr_code","QRCode"],["rm_qr_code","rMQRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"],["linear_codes","Linear-Codes"],["matrix_codes","Matrix-Codes"],["any","Any"]],G2=[...lC,["unknown"]].map(e=>e[0]),Wm=new Map(lC);function z2(e){for(const[r,n]of Wm)if(e===n)return r;return"unknown"}function Y2(e){if(cC(e))return{width:e.naturalWidth,height:e.naturalHeight};if(uC(e))return{width:e.width.baseVal.value,height:e.height.baseVal.value};if(dC(e))return{width:e.videoWidth,height:e.videoHeight};if(fC(e))return{width:e.width,height:e.height};if(mC(e))return{width:e.displayWidth,height:e.displayHeight};if(hC(e))return{width:e.width,height:e.height};if(pC(e))return{width:e.width,height:e.height};throw new TypeError("The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'.")}function cC(e){var r,n;try{return e instanceof((n=(r=e==null?void 0:e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:n.HTMLImageElement)}catch{return!1}}function uC(e){var r,n;try{return e instanceof((n=(r=e==null?void 0:e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:n.SVGImageElement)}catch{return!1}}function dC(e){var r,n;try{return e instanceof((n=(r=e==null?void 0:e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:n.HTMLVideoElement)}catch{return!1}}function hC(e){var r,n;try{return e instanceof((n=(r=e==null?void 0:e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:n.HTMLCanvasElement)}catch{return!1}}function fC(e){try{return e instanceof ImageBitmap||Object.prototype.toString.call(e)==="[object ImageBitmap]"}catch{return!1}}function pC(e){try{return e instanceof OffscreenCanvas||Object.prototype.toString.call(e)==="[object OffscreenCanvas]"}catch{return!1}}function mC(e){try{return e instanceof VideoFrame||Object.prototype.toString.call(e)==="[object VideoFrame]"}catch{return!1}}function W2(e){try{return e instanceof Blob||Object.prototype.toString.call(e)==="[object Blob]"}catch{return!1}}function K2(e){try{return e instanceof ImageData||Object.prototype.toString.call(e)==="[object ImageData]"}catch{return!1}}function Q2(e,r){try{const n=new OffscreenCanvas(e,r);if(n.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return n;throw void 0}catch{const n=document.createElement("canvas");return n.width=e,n.height=r,n}}async function gC(e){if(cC(e)&&!await X2(e))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(uC(e)&&!await eM(e))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(mC(e)&&tM(e))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(dC(e)&&(e.readyState===0||e.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(fC(e)&&nM(e))throw new DOMException("The image source is detached.","InvalidStateError");const{width:r,height:n}=Y2(e);if(r===0||n===0)return null;const s=Q2(r,n).getContext("2d");s.drawImage(e,0,0);try{return s.getImageData(0,0,r,n)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function $2(e){let r;try{r=await createImageBitmap(e)}catch{try{if(globalThis.Image){r=new Image;let n="";try{n=URL.createObjectURL(e),r.src=n,await r.decode()}finally{URL.revokeObjectURL(n)}}else return e}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}}return await gC(r)}function J2(e){const{width:r,height:n}=e;if(r===0||n===0)return null;const s=e.getContext("2d");try{return s.getImageData(0,0,r,n)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Z2(e){if(W2(e))return await $2(e);if(K2(e)){if(rM(e))throw new DOMException("The image data has been detached.","InvalidStateError");return e}return hC(e)||pC(e)?J2(e):await gC(e)}async function X2(e){try{return await e.decode(),!0}catch{return!1}}async function eM(e){var r;try{return await((r=e.decode)==null?void 0:r.call(e)),!0}catch{return!1}}function tM(e){return e.format===null}function rM(e){return e.data.buffer.byteLength===0}function nM(e){return e.width===0&&e.height===0}function oS(e,r){return iM(e)?new DOMException(`${r}: ${e.message}`,e.name):sM(e)?new e.constructor(`${r}: ${e.message}`):new Error(`${r}: ${e}`)}function iM(e){return e instanceof DOMException||Object.prototype.toString.call(e)==="[object DOMException]"}function sM(e){return e instanceof Error||Object.prototype.toString.call(e)==="[object Error]"}var Dd;class Km{constructor(r={}){w2(this,Dd);var n;try{const s=(n=r==null?void 0:r.formats)==null?void 0:n.filter(o=>o!=="unknown");if((s==null?void 0:s.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const o of s??[])if(!Wm.has(o))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${o}' is not a valid enum value of type BarcodeFormat.`);x2(this,Dd,s??[]),V2({fireImmediately:!0}).catch(()=>{})}catch(s){throw oS(s,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return G2.filter(r=>r!=="unknown")}async detect(r){try{const n=await Z2(r);if(n===null)return[];let s;const o={tryCode39ExtendedMode:!1,textMode:"Plain",formats:C2(this,Dd).map(u=>Wm.get(u))};try{s=await q2(n,o)}catch(u){throw console.error(u),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return s.map(u=>{const{topLeft:{x:f,y:l},topRight:{x:c,y:h},bottomLeft:{x:m,y:p},bottomRight:{x:y,y:x}}=u.position,A=Math.min(f,c,m,y),w=Math.min(l,h,p,x),v=Math.max(f,c,m,y),S=Math.max(l,h,p,x);return{boundingBox:new DOMRectReadOnly(A,w,v-A,S-w),rawValue:u.text,format:z2(u.format),cornerPoints:[{x:f,y:l},{x:c,y:h},{x:y,y:x},{x:m,y:p}]}})}catch(n){throw oS(n,"Failed to execute 'detect' on 'BarcodeDetector'")}}}Dd=new WeakMap;globalThis.BarcodeDetector!=null||(globalThis.BarcodeDetector=Km);let vC=!0,_C=!0;function Ql(e,r,n){const s=e.match(r);return s&&s.length>=n&&parseFloat(s[n],10)}function lo(e,r,n){if(!e.RTCPeerConnection)return;const s=e.RTCPeerConnection.prototype,o=s.addEventListener;s.addEventListener=function(f,l){if(f!==r)return o.apply(this,arguments);const c=h=>{const m=n(h);m&&(l.handleEvent?l.handleEvent(m):l(m))};return this._eventMap=this._eventMap||{},this._eventMap[r]||(this._eventMap[r]=new Map),this._eventMap[r].set(l,c),o.apply(this,[f,c])};const u=s.removeEventListener;s.removeEventListener=function(f,l){if(f!==r||!this._eventMap||!this._eventMap[r])return u.apply(this,arguments);if(!this._eventMap[r].has(l))return u.apply(this,arguments);const c=this._eventMap[r].get(l);return this._eventMap[r].delete(l),this._eventMap[r].size===0&&delete this._eventMap[r],Object.keys(this._eventMap).length===0&&delete this._eventMap,u.apply(this,[f,c])},Object.defineProperty(s,"on"+r,{get(){return this["_on"+r]},set(f){this["_on"+r]&&(this.removeEventListener(r,this["_on"+r]),delete this["_on"+r]),f&&this.addEventListener(r,this["_on"+r]=f)},enumerable:!0,configurable:!0})}function oM(e){return typeof e!="boolean"?new Error("Argument type: "+typeof e+". Please use a boolean."):(vC=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function aM(e){return typeof e!="boolean"?new Error("Argument type: "+typeof e+". Please use a boolean."):(_C=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function yC(){if(typeof window=="object"){if(vC)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function qg(e,r){_C&&console.warn(e+" is deprecated, please use "+r+" instead.")}function lM(e){const r={browser:null,version:null};if(typeof e>"u"||!e.navigator||!e.navigator.userAgent)return r.browser="Not a browser.",r;const{navigator:n}=e;if(n.userAgentData&&n.userAgentData.brands){const s=n.userAgentData.brands.find(o=>o.brand==="Chromium");if(s)return{browser:"chrome",version:parseInt(s.version,10)}}if(n.mozGetUserMedia)r.browser="firefox",r.version=parseInt(Ql(n.userAgent,/Firefox\/(\d+)\./,1));else if(n.webkitGetUserMedia||e.isSecureContext===!1&&e.webkitRTCPeerConnection)r.browser="chrome",r.version=parseInt(Ql(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2));else if(e.RTCPeerConnection&&n.userAgent.match(/AppleWebKit\/(\d+)\./))r.browser="safari",r.version=parseInt(Ql(n.userAgent,/AppleWebKit\/(\d+)\./,1)),r.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype,r._safariVersion=Ql(n.userAgent,/Version\/(\d+(\.?\d+))/,1);else return r.browser="Not a supported browser.",r;return r}function aS(e){return Object.prototype.toString.call(e)==="[object Object]"}function SC(e){return aS(e)?Object.keys(e).reduce(function(r,n){const s=aS(e[n]),o=s?SC(e[n]):e[n],u=s&&!Object.keys(o).length;return o===void 0||u?r:Object.assign(r,{[n]:o})},{}):e}function Qm(e,r,n){!r||n.has(r.id)||(n.set(r.id,r),Object.keys(r).forEach(s=>{s.endsWith("Id")?Qm(e,e.get(r[s]),n):s.endsWith("Ids")&&r[s].forEach(o=>{Qm(e,e.get(o),n)})}))}function lS(e,r,n){const s=n?"outbound-rtp":"inbound-rtp",o=new Map;if(r===null)return o;const u=[];return e.forEach(f=>{f.type==="track"&&f.trackIdentifier===r.id&&u.push(f)}),u.forEach(f=>{e.forEach(l=>{l.type===s&&l.trackId===f.id&&Qm(e,l,o)})}),o}const cS=yC;function bC(e,r){const n=e&&e.navigator;if(!n.mediaDevices)return;const s=function(l){if(typeof l!="object"||l.mandatory||l.optional)return l;const c={};return Object.keys(l).forEach(h=>{if(h==="require"||h==="advanced"||h==="mediaSource")return;const m=typeof l[h]=="object"?l[h]:{ideal:l[h]};m.exact!==void 0&&typeof m.exact=="number"&&(m.min=m.max=m.exact);const p=function(y,x){return y?y+x.charAt(0).toUpperCase()+x.slice(1):x==="deviceId"?"sourceId":x};if(m.ideal!==void 0){c.optional=c.optional||[];let y={};typeof m.ideal=="number"?(y[p("min",h)]=m.ideal,c.optional.push(y),y={},y[p("max",h)]=m.ideal,c.optional.push(y)):(y[p("",h)]=m.ideal,c.optional.push(y))}m.exact!==void 0&&typeof m.exact!="number"?(c.mandatory=c.mandatory||{},c.mandatory[p("",h)]=m.exact):["min","max"].forEach(y=>{m[y]!==void 0&&(c.mandatory=c.mandatory||{},c.mandatory[p(y,h)]=m[y])})}),l.advanced&&(c.optional=(c.optional||[]).concat(l.advanced)),c},o=function(l,c){if(r.version>=61)return c(l);if(l=JSON.parse(JSON.stringify(l)),l&&typeof l.audio=="object"){const h=function(m,p,y){p in m&&!(y in m)&&(m[y]=m[p],delete m[p])};l=JSON.parse(JSON.stringify(l)),h(l.audio,"autoGainControl","googAutoGainControl"),h(l.audio,"noiseSuppression","googNoiseSuppression"),l.audio=s(l.audio)}if(l&&typeof l.video=="object"){let h=l.video.facingMode;h=h&&(typeof h=="object"?h:{ideal:h});const m=r.version<66;if(h&&(h.exact==="user"||h.exact==="environment"||h.ideal==="user"||h.ideal==="environment")&&!(n.mediaDevices.getSupportedConstraints&&n.mediaDevices.getSupportedConstraints().facingMode&&!m)){delete l.video.facingMode;let p;if(h.exact==="environment"||h.ideal==="environment"?p=["back","rear"]:(h.exact==="user"||h.ideal==="user")&&(p=["front"]),p)return n.mediaDevices.enumerateDevices().then(y=>{y=y.filter(A=>A.kind==="videoinput");let x=y.find(A=>p.some(w=>A.label.toLowerCase().includes(w)));return!x&&y.length&&p.includes("back")&&(x=y[y.length-1]),x&&(l.video.deviceId=h.exact?{exact:x.deviceId}:{ideal:x.deviceId}),l.video=s(l.video),cS("chrome: "+JSON.stringify(l)),c(l)})}l.video=s(l.video)}return cS("chrome: "+JSON.stringify(l)),c(l)},u=function(l){return r.version>=64?l:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[l.name]||l.name,message:l.message,constraint:l.constraint||l.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},f=function(l,c,h){o(l,m=>{n.webkitGetUserMedia(m,c,p=>{h&&h(u(p))})})};if(n.getUserMedia=f.bind(n),n.mediaDevices.getUserMedia){const l=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(c){return o(c,h=>l(h).then(m=>{if(h.audio&&!m.getAudioTracks().length||h.video&&!m.getVideoTracks().length)throw m.getTracks().forEach(p=>{p.stop()}),new DOMException("","NotFoundError");return m},m=>Promise.reject(u(m))))}}}function CC(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function wC(e){if(typeof e=="object"&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(n){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=n)},enumerable:!0,configurable:!0});const r=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=s=>{s.stream.addEventListener("addtrack",o=>{let u;e.RTCPeerConnection.prototype.getReceivers?u=this.getReceivers().find(l=>l.track&&l.track.id===o.track.id):u={track:o.track};const f=new Event("track");f.track=o.track,f.receiver=u,f.transceiver={receiver:u},f.streams=[s.stream],this.dispatchEvent(f)}),s.stream.getTracks().forEach(o=>{let u;e.RTCPeerConnection.prototype.getReceivers?u=this.getReceivers().find(l=>l.track&&l.track.id===o.id):u={track:o};const f=new Event("track");f.track=o,f.receiver=u,f.transceiver={receiver:u},f.streams=[s.stream],this.dispatchEvent(f)})},this.addEventListener("addstream",this._ontrackpoly)),r.apply(this,arguments)}}else lo(e,"track",r=>(r.transceiver||Object.defineProperty(r,"transceiver",{value:{receiver:r.receiver}}),r))}function xC(e){if(typeof e=="object"&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const r=function(o,u){return{track:u,get dtmf(){return this._dtmf===void 0&&(u.kind==="audio"?this._dtmf=o.createDTMFSender(u):this._dtmf=null),this._dtmf},_pc:o}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const o=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(l,c){let h=o.apply(this,arguments);return h||(h=r(this,l),this._senders.push(h)),h};const u=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(l){u.apply(this,arguments);const c=this._senders.indexOf(l);c!==-1&&this._senders.splice(c,1)}}const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(u){this._senders=this._senders||[],n.apply(this,[u]),u.getTracks().forEach(f=>{this._senders.push(r(this,f))})};const s=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(u){this._senders=this._senders||[],s.apply(this,[u]),u.getTracks().forEach(f=>{const l=this._senders.find(c=>c.track===f);l&&this._senders.splice(this._senders.indexOf(l),1)})}}else if(typeof e=="object"&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){const r=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const s=r.apply(this,[]);return s.forEach(o=>o._pc=this),s},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function EC(e){if(!(typeof e=="object"&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const n=e.RTCPeerConnection.prototype.getSenders;n&&(e.RTCPeerConnection.prototype.getSenders=function(){const u=n.apply(this,[]);return u.forEach(f=>f._pc=this),u});const s=e.RTCPeerConnection.prototype.addTrack;s&&(e.RTCPeerConnection.prototype.addTrack=function(){const u=s.apply(this,arguments);return u._pc=this,u}),e.RTCRtpSender.prototype.getStats=function(){const u=this;return this._pc.getStats().then(f=>lS(f,u.track,!0))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const n=e.RTCPeerConnection.prototype.getReceivers;n&&(e.RTCPeerConnection.prototype.getReceivers=function(){const o=n.apply(this,[]);return o.forEach(u=>u._pc=this),o}),lo(e,"track",s=>(s.receiver._pc=s.srcElement,s)),e.RTCRtpReceiver.prototype.getStats=function(){const o=this;return this._pc.getStats().then(u=>lS(u,o.track,!1))}}if(!("getStats"in e.RTCRtpSender.prototype&&"getStats"in e.RTCRtpReceiver.prototype))return;const r=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const s=arguments[0];let o,u,f;return this.getSenders().forEach(l=>{l.track===s&&(o?f=!0:o=l)}),this.getReceivers().forEach(l=>(l.track===s&&(u?f=!0:u=l),l.track===s)),f||o&&u?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):o?o.getStats():u?u.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return r.apply(this,arguments)}}function AC(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(f=>this._shimmedLocalStreams[f][0])};const r=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(f,l){if(!l)return r.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const c=r.apply(this,arguments);return this._shimmedLocalStreams[l.id]?this._shimmedLocalStreams[l.id].indexOf(c)===-1&&this._shimmedLocalStreams[l.id].push(c):this._shimmedLocalStreams[l.id]=[l,c],c};const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(f){this._shimmedLocalStreams=this._shimmedLocalStreams||{},f.getTracks().forEach(h=>{if(this.getSenders().find(p=>p.track===h))throw new DOMException("Track already exists.","InvalidAccessError")});const l=this.getSenders();n.apply(this,arguments);const c=this.getSenders().filter(h=>l.indexOf(h)===-1);this._shimmedLocalStreams[f.id]=[f].concat(c)};const s=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(f){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[f.id],s.apply(this,arguments)};const o=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(f){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},f&&Object.keys(this._shimmedLocalStreams).forEach(l=>{const c=this._shimmedLocalStreams[l].indexOf(f);c!==-1&&this._shimmedLocalStreams[l].splice(c,1),this._shimmedLocalStreams[l].length===1&&delete this._shimmedLocalStreams[l]}),o.apply(this,arguments)}}function TC(e,r){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&r.version>=65)return AC(e);const n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const m=n.apply(this);return this._reverseStreams=this._reverseStreams||{},m.map(p=>this._reverseStreams[p.id])};const s=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(m){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},m.getTracks().forEach(p=>{if(this.getSenders().find(x=>x.track===p))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[m.id]){const p=new e.MediaStream(m.getTracks());this._streams[m.id]=p,this._reverseStreams[p.id]=m,m=p}s.apply(this,[m])};const o=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(m){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},o.apply(this,[this._streams[m.id]||m]),delete this._reverseStreams[this._streams[m.id]?this._streams[m.id].id:m.id],delete this._streams[m.id]},e.RTCPeerConnection.prototype.addTrack=function(m,p){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const y=[].slice.call(arguments,1);if(y.length!==1||!y[0].getTracks().find(w=>w===m))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(w=>w.track===m))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const A=this._streams[p.id];if(A)A.addTrack(m),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const w=new e.MediaStream([m]);this._streams[p.id]=w,this._reverseStreams[w.id]=p,this.addStream(w)}return this.getSenders().find(w=>w.track===m)};function u(h,m){let p=m.sdp;return Object.keys(h._reverseStreams||[]).forEach(y=>{const x=h._reverseStreams[y],A=h._streams[x.id];p=p.replace(new RegExp(A.id,"g"),x.id)}),new RTCSessionDescription({type:m.type,sdp:p})}function f(h,m){let p=m.sdp;return Object.keys(h._reverseStreams||[]).forEach(y=>{const x=h._reverseStreams[y],A=h._streams[x.id];p=p.replace(new RegExp(x.id,"g"),A.id)}),new RTCSessionDescription({type:m.type,sdp:p})}["createOffer","createAnswer"].forEach(function(h){const m=e.RTCPeerConnection.prototype[h],p={[h](){const y=arguments;return arguments.length&&typeof arguments[0]=="function"?m.apply(this,[A=>{const w=u(this,A);y[0].apply(null,[w])},A=>{y[1]&&y[1].apply(null,A)},arguments[2]]):m.apply(this,arguments).then(A=>u(this,A))}};e.RTCPeerConnection.prototype[h]=p[h]});const l=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?l.apply(this,arguments):(arguments[0]=f(this,arguments[0]),l.apply(this,arguments))};const c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const h=c.get.apply(this);return h.type===""?h:u(this,h)}}),e.RTCPeerConnection.prototype.removeTrack=function(m){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!m._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(m._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let y;Object.keys(this._streams).forEach(x=>{this._streams[x].getTracks().find(w=>m.track===w)&&(y=this._streams[x])}),y&&(y.getTracks().length===1?this.removeStream(this._reverseStreams[y.id]):y.removeTrack(m.track),this.dispatchEvent(new Event("negotiationneeded")))}}function $m(e,r){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&r.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(n){const s=e.RTCPeerConnection.prototype[n],o={[n](){return arguments[0]=new(n==="addIceCandidate"?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),s.apply(this,arguments)}};e.RTCPeerConnection.prototype[n]=o[n]})}function RC(e,r){lo(e,"negotiationneeded",n=>{const s=n.target;if(!((r.version<72||s.getConfiguration&&s.getConfiguration().sdpSemantics==="plan-b")&&s.signalingState!=="stable"))return n})}const uS=Object.freeze(Object.defineProperty({__proto__:null,fixNegotiationNeeded:RC,shimAddTrackRemoveTrack:TC,shimAddTrackRemoveTrackWithNative:AC,shimGetSendersWithDtmf:xC,shimGetUserMedia:bC,shimMediaStream:CC,shimOnTrack:wC,shimPeerConnection:$m,shimSenderReceiverGetStats:EC},Symbol.toStringTag,{value:"Module"}));function DC(e,r){const n=e&&e.navigator,s=e&&e.MediaStreamTrack;if(n.getUserMedia=function(o,u,f){qg("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(o).then(u,f)},!(r.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const o=function(f,l,c){l in f&&!(c in f)&&(f[c]=f[l],delete f[l])},u=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(f){return typeof f=="object"&&typeof f.audio=="object"&&(f=JSON.parse(JSON.stringify(f)),o(f.audio,"autoGainControl","mozAutoGainControl"),o(f.audio,"noiseSuppression","mozNoiseSuppression")),u(f)},s&&s.prototype.getSettings){const f=s.prototype.getSettings;s.prototype.getSettings=function(){const l=f.apply(this,arguments);return o(l,"mozAutoGainControl","autoGainControl"),o(l,"mozNoiseSuppression","noiseSuppression"),l}}if(s&&s.prototype.applyConstraints){const f=s.prototype.applyConstraints;s.prototype.applyConstraints=function(l){return this.kind==="audio"&&typeof l=="object"&&(l=JSON.parse(JSON.stringify(l)),o(l,"autoGainControl","mozAutoGainControl"),o(l,"noiseSuppression","mozNoiseSuppression")),f.apply(this,[l])}}}}function cM(e,r){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(s){if(!(s&&s.video)){const o=new DOMException("getDisplayMedia without video constraints is undefined");return o.name="NotFoundError",o.code=8,Promise.reject(o)}return s.video===!0?s.video={mediaSource:r}:s.video.mediaSource=r,e.navigator.mediaDevices.getUserMedia(s)})}function MC(e){typeof e=="object"&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Jm(e,r){if(typeof e!="object"||!(e.RTCPeerConnection||e.mozRTCPeerConnection))return;!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),r.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(o){const u=e.RTCPeerConnection.prototype[o],f={[o](){return arguments[0]=new(o==="addIceCandidate"?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),u.apply(this,arguments)}};e.RTCPeerConnection.prototype[o]=f[o]});const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},s=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[u,f,l]=arguments;return s.apply(this,[u||null]).then(c=>{if(r.version<53&&!f)try{c.forEach(h=>{h.type=n[h.type]||h.type})}catch(h){if(h.name!=="TypeError")throw h;c.forEach((m,p)=>{c.set(p,Object.assign({},m,{type:n[m.type]||m.type}))})}return c}).then(f,l)}}function kC(e){if(!(typeof e=="object"&&e.RTCPeerConnection&&e.RTCRtpSender)||e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const r=e.RTCPeerConnection.prototype.getSenders;r&&(e.RTCPeerConnection.prototype.getSenders=function(){const o=r.apply(this,[]);return o.forEach(u=>u._pc=this),o});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const o=n.apply(this,arguments);return o._pc=this,o}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function LC(e){if(!(typeof e=="object"&&e.RTCPeerConnection&&e.RTCRtpSender)||e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const r=e.RTCPeerConnection.prototype.getReceivers;r&&(e.RTCPeerConnection.prototype.getReceivers=function(){const s=r.apply(this,[]);return s.forEach(o=>o._pc=this),s}),lo(e,"track",n=>(n.receiver._pc=n.srcElement,n)),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function OC(e){!e.RTCPeerConnection||"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(n){qg("removeStream","removeTrack"),this.getSenders().forEach(s=>{s.track&&n.getTracks().includes(s.track)&&this.removeTrack(s)})})}function BC(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function NC(e){if(!(typeof e=="object"&&e.RTCPeerConnection))return;const r=e.RTCPeerConnection.prototype.addTransceiver;r&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let s=arguments[1]&&arguments[1].sendEncodings;s===void 0&&(s=[]),s=[...s];const o=s.length>0;o&&s.forEach(f=>{if("rid"in f&&!/^[a-z0-9]{0,16}$/i.test(f.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in f&&!(parseFloat(f.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in f&&!(parseFloat(f.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const u=r.apply(this,arguments);if(o){const{sender:f}=u,l=f.getParameters();(!("encodings"in l)||l.encodings.length===1&&Object.keys(l.encodings[0]).length===0)&&(l.encodings=s,f.sendEncodings=s,this.setParametersPromises.push(f.setParameters(l).then(()=>{delete f.sendEncodings}).catch(()=>{delete f.sendEncodings})))}return u})}function IC(e){if(!(typeof e=="object"&&e.RTCRtpSender))return;const r=e.RTCRtpSender.prototype.getParameters;r&&(e.RTCRtpSender.prototype.getParameters=function(){const s=r.apply(this,arguments);return"encodings"in s||(s.encodings=[].concat(this.sendEncodings||[{}])),s})}function PC(e){if(!(typeof e=="object"&&e.RTCPeerConnection))return;const r=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>r.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):r.apply(this,arguments)}}function jC(e){if(!(typeof e=="object"&&e.RTCPeerConnection))return;const r=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>r.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):r.apply(this,arguments)}}const dS=Object.freeze(Object.defineProperty({__proto__:null,shimAddTransceiver:NC,shimCreateAnswer:jC,shimCreateOffer:PC,shimGetDisplayMedia:cM,shimGetParameters:IC,shimGetUserMedia:DC,shimOnTrack:MC,shimPeerConnection:Jm,shimRTCDataChannel:BC,shimReceiverGetStats:LC,shimRemoveStream:OC,shimSenderGetStats:kC},Symbol.toStringTag,{value:"Module"}));function UC(e){if(!(typeof e!="object"||!e.RTCPeerConnection)){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){const r=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(s){this._localStreams||(this._localStreams=[]),this._localStreams.includes(s)||this._localStreams.push(s),s.getAudioTracks().forEach(o=>r.call(this,o,s)),s.getVideoTracks().forEach(o=>r.call(this,o,s))},e.RTCPeerConnection.prototype.addTrack=function(s,...o){return o&&o.forEach(u=>{this._localStreams?this._localStreams.includes(u)||this._localStreams.push(u):this._localStreams=[u]}),r.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(n){this._localStreams||(this._localStreams=[]);const s=this._localStreams.indexOf(n);if(s===-1)return;this._localStreams.splice(s,1);const o=n.getTracks();this.getSenders().forEach(u=>{o.includes(u.track)&&this.removeTrack(u)})})}}function FC(e){if(!(typeof e!="object"||!e.RTCPeerConnection)&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(n){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=n),this.addEventListener("track",this._onaddstreampoly=s=>{s.streams.forEach(o=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(o))return;this._remoteStreams.push(o);const u=new Event("addstream");u.stream=o,this.dispatchEvent(u)})})}});const r=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const s=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(o){o.streams.forEach(u=>{if(s._remoteStreams||(s._remoteStreams=[]),s._remoteStreams.indexOf(u)>=0)return;s._remoteStreams.push(u);const f=new Event("addstream");f.stream=u,s.dispatchEvent(f)})}),r.apply(s,arguments)}}}function HC(e){if(typeof e!="object"||!e.RTCPeerConnection)return;const r=e.RTCPeerConnection.prototype,n=r.createOffer,s=r.createAnswer,o=r.setLocalDescription,u=r.setRemoteDescription,f=r.addIceCandidate;r.createOffer=function(h,m){const p=arguments.length>=2?arguments[2]:arguments[0],y=n.apply(this,[p]);return m?(y.then(h,m),Promise.resolve()):y},r.createAnswer=function(h,m){const p=arguments.length>=2?arguments[2]:arguments[0],y=s.apply(this,[p]);return m?(y.then(h,m),Promise.resolve()):y};let l=function(c,h,m){const p=o.apply(this,[c]);return m?(p.then(h,m),Promise.resolve()):p};r.setLocalDescription=l,l=function(c,h,m){const p=u.apply(this,[c]);return m?(p.then(h,m),Promise.resolve()):p},r.setRemoteDescription=l,l=function(c,h,m){const p=f.apply(this,[c]);return m?(p.then(h,m),Promise.resolve()):p},r.addIceCandidate=l}function VC(e){const r=e&&e.navigator;if(r.mediaDevices&&r.mediaDevices.getUserMedia){const n=r.mediaDevices,s=n.getUserMedia.bind(n);r.mediaDevices.getUserMedia=o=>s(qC(o))}!r.getUserMedia&&r.mediaDevices&&r.mediaDevices.getUserMedia&&(r.getUserMedia=(function(s,o,u){r.mediaDevices.getUserMedia(s).then(o,u)}).bind(r))}function qC(e){return e&&e.video!==void 0?Object.assign({},e,{video:SC(e.video)}):e}function GC(e){if(!e.RTCPeerConnection)return;const r=e.RTCPeerConnection;e.RTCPeerConnection=function(s,o){if(s&&s.iceServers){const u=[];for(let f=0;f<s.iceServers.length;f++){let l=s.iceServers[f];l.urls===void 0&&l.url?(qg("RTCIceServer.url","RTCIceServer.urls"),l=JSON.parse(JSON.stringify(l)),l.urls=l.url,delete l.url,u.push(l)):u.push(s.iceServers[f])}s.iceServers=u}return new r(s,o)},e.RTCPeerConnection.prototype=r.prototype,"generateCertificate"in r&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get(){return r.generateCertificate}})}function zC(e){typeof e=="object"&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function YC(e){const r=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(s){if(s){typeof s.offerToReceiveAudio<"u"&&(s.offerToReceiveAudio=!!s.offerToReceiveAudio);const o=this.getTransceivers().find(f=>f.receiver.track.kind==="audio");s.offerToReceiveAudio===!1&&o?o.direction==="sendrecv"?o.setDirection?o.setDirection("sendonly"):o.direction="sendonly":o.direction==="recvonly"&&(o.setDirection?o.setDirection("inactive"):o.direction="inactive"):s.offerToReceiveAudio===!0&&!o&&this.addTransceiver("audio",{direction:"recvonly"}),typeof s.offerToReceiveVideo<"u"&&(s.offerToReceiveVideo=!!s.offerToReceiveVideo);const u=this.getTransceivers().find(f=>f.receiver.track.kind==="video");s.offerToReceiveVideo===!1&&u?u.direction==="sendrecv"?u.setDirection?u.setDirection("sendonly"):u.direction="sendonly":u.direction==="recvonly"&&(u.setDirection?u.setDirection("inactive"):u.direction="inactive"):s.offerToReceiveVideo===!0&&!u&&this.addTransceiver("video",{direction:"recvonly"})}return r.apply(this,arguments)}}function WC(e){typeof e!="object"||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}const hS=Object.freeze(Object.defineProperty({__proto__:null,shimAudioContext:WC,shimCallbacksAPI:HC,shimConstraints:qC,shimCreateOfferLegacy:YC,shimGetUserMedia:VC,shimLocalStreamsAPI:UC,shimRTCIceServerUrls:GC,shimRemoteStreamsAPI:FC,shimTrackEventTransceiver:zC},Symbol.toStringTag,{value:"Module"}));var fm={exports:{}},fS;function uM(){return fS||(fS=1,(function(e){const r={};r.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},r.localCName=r.generateIdentifier(),r.splitLines=function(n){return n.trim().split(`
62
+ `).map(s=>s.trim())},r.splitSections=function(n){return n.split(`
63
+ m=`).map((o,u)=>(u>0?"m="+o:o).trim()+`\r
64
+ `)},r.getDescription=function(n){const s=r.splitSections(n);return s&&s[0]},r.getMediaSections=function(n){const s=r.splitSections(n);return s.shift(),s},r.matchPrefix=function(n,s){return r.splitLines(n).filter(o=>o.indexOf(s)===0)},r.parseCandidate=function(n){let s;n.indexOf("a=candidate:")===0?s=n.substring(12).split(" "):s=n.substring(10).split(" ");const o={foundation:s[0],component:{1:"rtp",2:"rtcp"}[s[1]]||s[1],protocol:s[2].toLowerCase(),priority:parseInt(s[3],10),ip:s[4],address:s[4],port:parseInt(s[5],10),type:s[7]};for(let u=8;u<s.length;u+=2)switch(s[u]){case"raddr":o.relatedAddress=s[u+1];break;case"rport":o.relatedPort=parseInt(s[u+1],10);break;case"tcptype":o.tcpType=s[u+1];break;case"ufrag":o.ufrag=s[u+1],o.usernameFragment=s[u+1];break;default:o[s[u]]===void 0&&(o[s[u]]=s[u+1]);break}return o},r.writeCandidate=function(n){const s=[];s.push(n.foundation);const o=n.component;o==="rtp"?s.push(1):o==="rtcp"?s.push(2):s.push(o),s.push(n.protocol.toUpperCase()),s.push(n.priority),s.push(n.address||n.ip),s.push(n.port);const u=n.type;return s.push("typ"),s.push(u),u!=="host"&&n.relatedAddress&&n.relatedPort&&(s.push("raddr"),s.push(n.relatedAddress),s.push("rport"),s.push(n.relatedPort)),n.tcpType&&n.protocol.toLowerCase()==="tcp"&&(s.push("tcptype"),s.push(n.tcpType)),(n.usernameFragment||n.ufrag)&&(s.push("ufrag"),s.push(n.usernameFragment||n.ufrag)),"candidate:"+s.join(" ")},r.parseIceOptions=function(n){return n.substring(14).split(" ")},r.parseRtpMap=function(n){let s=n.substring(9).split(" ");const o={payloadType:parseInt(s.shift(),10)};return s=s[0].split("/"),o.name=s[0],o.clockRate=parseInt(s[1],10),o.channels=s.length===3?parseInt(s[2],10):1,o.numChannels=o.channels,o},r.writeRtpMap=function(n){let s=n.payloadType;n.preferredPayloadType!==void 0&&(s=n.preferredPayloadType);const o=n.channels||n.numChannels||1;return"a=rtpmap:"+s+" "+n.name+"/"+n.clockRate+(o!==1?"/"+o:"")+`\r
65
+ `},r.parseExtmap=function(n){const s=n.substring(9).split(" ");return{id:parseInt(s[0],10),direction:s[0].indexOf("/")>0?s[0].split("/")[1]:"sendrecv",uri:s[1],attributes:s.slice(2).join(" ")}},r.writeExtmap=function(n){return"a=extmap:"+(n.id||n.preferredId)+(n.direction&&n.direction!=="sendrecv"?"/"+n.direction:"")+" "+n.uri+(n.attributes?" "+n.attributes:"")+`\r
66
+ `},r.parseFmtp=function(n){const s={};let o;const u=n.substring(n.indexOf(" ")+1).split(";");for(let f=0;f<u.length;f++)o=u[f].trim().split("="),s[o[0].trim()]=o[1];return s},r.writeFmtp=function(n){let s="",o=n.payloadType;if(n.preferredPayloadType!==void 0&&(o=n.preferredPayloadType),n.parameters&&Object.keys(n.parameters).length){const u=[];Object.keys(n.parameters).forEach(f=>{n.parameters[f]!==void 0?u.push(f+"="+n.parameters[f]):u.push(f)}),s+="a=fmtp:"+o+" "+u.join(";")+`\r
67
+ `}return s},r.parseRtcpFb=function(n){const s=n.substring(n.indexOf(" ")+1).split(" ");return{type:s.shift(),parameter:s.join(" ")}},r.writeRtcpFb=function(n){let s="",o=n.payloadType;return n.preferredPayloadType!==void 0&&(o=n.preferredPayloadType),n.rtcpFeedback&&n.rtcpFeedback.length&&n.rtcpFeedback.forEach(u=>{s+="a=rtcp-fb:"+o+" "+u.type+(u.parameter&&u.parameter.length?" "+u.parameter:"")+`\r
68
+ `}),s},r.parseSsrcMedia=function(n){const s=n.indexOf(" "),o={ssrc:parseInt(n.substring(7,s),10)},u=n.indexOf(":",s);return u>-1?(o.attribute=n.substring(s+1,u),o.value=n.substring(u+1)):o.attribute=n.substring(s+1),o},r.parseSsrcGroup=function(n){const s=n.substring(13).split(" ");return{semantics:s.shift(),ssrcs:s.map(o=>parseInt(o,10))}},r.getMid=function(n){const s=r.matchPrefix(n,"a=mid:")[0];if(s)return s.substring(6)},r.parseFingerprint=function(n){const s=n.substring(14).split(" ");return{algorithm:s[0].toLowerCase(),value:s[1].toUpperCase()}},r.getDtlsParameters=function(n,s){return{role:"auto",fingerprints:r.matchPrefix(n+s,"a=fingerprint:").map(r.parseFingerprint)}},r.writeDtlsParameters=function(n,s){let o="a=setup:"+s+`\r
69
+ `;return n.fingerprints.forEach(u=>{o+="a=fingerprint:"+u.algorithm+" "+u.value+`\r
70
+ `}),o},r.parseCryptoLine=function(n){const s=n.substring(9).split(" ");return{tag:parseInt(s[0],10),cryptoSuite:s[1],keyParams:s[2],sessionParams:s.slice(3)}},r.writeCryptoLine=function(n){return"a=crypto:"+n.tag+" "+n.cryptoSuite+" "+(typeof n.keyParams=="object"?r.writeCryptoKeyParams(n.keyParams):n.keyParams)+(n.sessionParams?" "+n.sessionParams.join(" "):"")+`\r
71
+ `},r.parseCryptoKeyParams=function(n){if(n.indexOf("inline:")!==0)return null;const s=n.substring(7).split("|");return{keyMethod:"inline",keySalt:s[0],lifeTime:s[1],mkiValue:s[2]?s[2].split(":")[0]:void 0,mkiLength:s[2]?s[2].split(":")[1]:void 0}},r.writeCryptoKeyParams=function(n){return n.keyMethod+":"+n.keySalt+(n.lifeTime?"|"+n.lifeTime:"")+(n.mkiValue&&n.mkiLength?"|"+n.mkiValue+":"+n.mkiLength:"")},r.getCryptoParameters=function(n,s){return r.matchPrefix(n+s,"a=crypto:").map(r.parseCryptoLine)},r.getIceParameters=function(n,s){const o=r.matchPrefix(n+s,"a=ice-ufrag:")[0],u=r.matchPrefix(n+s,"a=ice-pwd:")[0];return o&&u?{usernameFragment:o.substring(12),password:u.substring(10)}:null},r.writeIceParameters=function(n){let s="a=ice-ufrag:"+n.usernameFragment+`\r
72
+ a=ice-pwd:`+n.password+`\r
73
+ `;return n.iceLite&&(s+=`a=ice-lite\r
74
+ `),s},r.parseRtpParameters=function(n){const s={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},u=r.splitLines(n)[0].split(" ");s.profile=u[2];for(let l=3;l<u.length;l++){const c=u[l],h=r.matchPrefix(n,"a=rtpmap:"+c+" ")[0];if(h){const m=r.parseRtpMap(h),p=r.matchPrefix(n,"a=fmtp:"+c+" ");switch(m.parameters=p.length?r.parseFmtp(p[0]):{},m.rtcpFeedback=r.matchPrefix(n,"a=rtcp-fb:"+c+" ").map(r.parseRtcpFb),s.codecs.push(m),m.name.toUpperCase()){case"RED":case"ULPFEC":s.fecMechanisms.push(m.name.toUpperCase());break}}}r.matchPrefix(n,"a=extmap:").forEach(l=>{s.headerExtensions.push(r.parseExtmap(l))});const f=r.matchPrefix(n,"a=rtcp-fb:* ").map(r.parseRtcpFb);return s.codecs.forEach(l=>{f.forEach(c=>{l.rtcpFeedback.find(m=>m.type===c.type&&m.parameter===c.parameter)||l.rtcpFeedback.push(c)})}),s},r.writeRtpDescription=function(n,s){let o="";o+="m="+n+" ",o+=s.codecs.length>0?"9":"0",o+=" "+(s.profile||"UDP/TLS/RTP/SAVPF")+" ",o+=s.codecs.map(f=>f.preferredPayloadType!==void 0?f.preferredPayloadType:f.payloadType).join(" ")+`\r
75
+ `,o+=`c=IN IP4 0.0.0.0\r
76
+ `,o+=`a=rtcp:9 IN IP4 0.0.0.0\r
77
+ `,s.codecs.forEach(f=>{o+=r.writeRtpMap(f),o+=r.writeFmtp(f),o+=r.writeRtcpFb(f)});let u=0;return s.codecs.forEach(f=>{f.maxptime>u&&(u=f.maxptime)}),u>0&&(o+="a=maxptime:"+u+`\r
78
+ `),s.headerExtensions&&s.headerExtensions.forEach(f=>{o+=r.writeExtmap(f)}),o},r.parseRtpEncodingParameters=function(n){const s=[],o=r.parseRtpParameters(n),u=o.fecMechanisms.indexOf("RED")!==-1,f=o.fecMechanisms.indexOf("ULPFEC")!==-1,l=r.matchPrefix(n,"a=ssrc:").map(y=>r.parseSsrcMedia(y)).filter(y=>y.attribute==="cname"),c=l.length>0&&l[0].ssrc;let h;const m=r.matchPrefix(n,"a=ssrc-group:FID").map(y=>y.substring(17).split(" ").map(A=>parseInt(A,10)));m.length>0&&m[0].length>1&&m[0][0]===c&&(h=m[0][1]),o.codecs.forEach(y=>{if(y.name.toUpperCase()==="RTX"&&y.parameters.apt){let x={ssrc:c,codecPayloadType:parseInt(y.parameters.apt,10)};c&&h&&(x.rtx={ssrc:h}),s.push(x),u&&(x=JSON.parse(JSON.stringify(x)),x.fec={ssrc:c,mechanism:f?"red+ulpfec":"red"},s.push(x))}}),s.length===0&&c&&s.push({ssrc:c});let p=r.matchPrefix(n,"b=");return p.length&&(p[0].indexOf("b=TIAS:")===0?p=parseInt(p[0].substring(7),10):p[0].indexOf("b=AS:")===0?p=parseInt(p[0].substring(5),10)*1e3*.95-2e3*8:p=void 0,s.forEach(y=>{y.maxBitrate=p})),s},r.parseRtcpParameters=function(n){const s={},o=r.matchPrefix(n,"a=ssrc:").map(l=>r.parseSsrcMedia(l)).filter(l=>l.attribute==="cname")[0];o&&(s.cname=o.value,s.ssrc=o.ssrc);const u=r.matchPrefix(n,"a=rtcp-rsize");s.reducedSize=u.length>0,s.compound=u.length===0;const f=r.matchPrefix(n,"a=rtcp-mux");return s.mux=f.length>0,s},r.writeRtcpParameters=function(n){let s="";return n.reducedSize&&(s+=`a=rtcp-rsize\r
79
+ `),n.mux&&(s+=`a=rtcp-mux\r
80
+ `),n.ssrc!==void 0&&n.cname&&(s+="a=ssrc:"+n.ssrc+" cname:"+n.cname+`\r
81
+ `),s},r.parseMsid=function(n){let s;const o=r.matchPrefix(n,"a=msid:");if(o.length===1)return s=o[0].substring(7).split(" "),{stream:s[0],track:s[1]};const u=r.matchPrefix(n,"a=ssrc:").map(f=>r.parseSsrcMedia(f)).filter(f=>f.attribute==="msid");if(u.length>0)return s=u[0].value.split(" "),{stream:s[0],track:s[1]}},r.parseSctpDescription=function(n){const s=r.parseMLine(n),o=r.matchPrefix(n,"a=max-message-size:");let u;o.length>0&&(u=parseInt(o[0].substring(19),10)),isNaN(u)&&(u=65536);const f=r.matchPrefix(n,"a=sctp-port:");if(f.length>0)return{port:parseInt(f[0].substring(12),10),protocol:s.fmt,maxMessageSize:u};const l=r.matchPrefix(n,"a=sctpmap:");if(l.length>0){const c=l[0].substring(10).split(" ");return{port:parseInt(c[0],10),protocol:c[1],maxMessageSize:u}}},r.writeSctpDescription=function(n,s){let o=[];return n.protocol!=="DTLS/SCTP"?o=["m="+n.kind+" 9 "+n.protocol+" "+s.protocol+`\r
82
+ `,`c=IN IP4 0.0.0.0\r
83
+ `,"a=sctp-port:"+s.port+`\r
84
+ `]:o=["m="+n.kind+" 9 "+n.protocol+" "+s.port+`\r
85
+ `,`c=IN IP4 0.0.0.0\r
86
+ `,"a=sctpmap:"+s.port+" "+s.protocol+` 65535\r
87
+ `],s.maxMessageSize!==void 0&&o.push("a=max-message-size:"+s.maxMessageSize+`\r
88
+ `),o.join("")},r.generateSessionId=function(){return Math.random().toString().substr(2,22)},r.writeSessionBoilerplate=function(n,s,o){let u;const f=s!==void 0?s:2;return n?u=n:u=r.generateSessionId(),`v=0\r
89
+ o=`+(o||"thisisadapterortc")+" "+u+" "+f+` IN IP4 127.0.0.1\r
90
+ s=-\r
91
+ t=0 0\r
92
+ `},r.getDirection=function(n,s){const o=r.splitLines(n);for(let u=0;u<o.length;u++)switch(o[u]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return o[u].substring(2)}return s?r.getDirection(s):"sendrecv"},r.getKind=function(n){return r.splitLines(n)[0].split(" ")[0].substring(2)},r.isRejected=function(n){return n.split(" ",2)[1]==="0"},r.parseMLine=function(n){const o=r.splitLines(n)[0].substring(2).split(" ");return{kind:o[0],port:parseInt(o[1],10),protocol:o[2],fmt:o.slice(3).join(" ")}},r.parseOLine=function(n){const o=r.matchPrefix(n,"o=")[0].substring(2).split(" ");return{username:o[0],sessionId:o[1],sessionVersion:parseInt(o[2],10),netType:o[3],addressType:o[4],address:o[5]}},r.isValidSDP=function(n){if(typeof n!="string"||n.length===0)return!1;const s=r.splitLines(n);for(let o=0;o<s.length;o++)if(s[o].length<2||s[o].charAt(1)!=="=")return!1;return!0},e.exports=r})(fm)),fm.exports}var KC=uM();const ca=Dg(KC),dM=Ab({__proto__:null,default:ca},[KC]);function Md(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)return;const r=e.RTCIceCandidate;e.RTCIceCandidate=function(s){if(typeof s=="object"&&s.candidate&&s.candidate.indexOf("a=")===0&&(s=JSON.parse(JSON.stringify(s)),s.candidate=s.candidate.substring(2)),s.candidate&&s.candidate.length){const o=new r(s),u=ca.parseCandidate(s.candidate);for(const f in u)f in o||Object.defineProperty(o,f,{value:u[f]});return o.toJSON=function(){return{candidate:o.candidate,sdpMid:o.sdpMid,sdpMLineIndex:o.sdpMLineIndex,usernameFragment:o.usernameFragment}},o}return new r(s)},e.RTCIceCandidate.prototype=r.prototype,lo(e,"icecandidate",n=>(n.candidate&&Object.defineProperty(n,"candidate",{value:new e.RTCIceCandidate(n.candidate),writable:"false"}),n))}function Zm(e){!e.RTCIceCandidate||e.RTCIceCandidate&&"relayProtocol"in e.RTCIceCandidate.prototype||lo(e,"icecandidate",r=>{if(r.candidate){const n=ca.parseCandidate(r.candidate.candidate);n.type==="relay"&&(r.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[n.priority>>24])}return r})}function kd(e,r){if(!e.RTCPeerConnection)return;"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp}});const n=function(l){if(!l||!l.sdp)return!1;const c=ca.splitSections(l.sdp);return c.shift(),c.some(h=>{const m=ca.parseMLine(h);return m&&m.kind==="application"&&m.protocol.indexOf("SCTP")!==-1})},s=function(l){const c=l.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(c===null||c.length<2)return-1;const h=parseInt(c[1],10);return h!==h?-1:h},o=function(l){let c=65536;return r.browser==="firefox"&&(r.version<57?l===-1?c=16384:c=2147483637:r.version<60?c=r.version===57?65535:65536:c=2147483637),c},u=function(l,c){let h=65536;r.browser==="firefox"&&r.version===57&&(h=65535);const m=ca.matchPrefix(l.sdp,"a=max-message-size:");return m.length>0?h=parseInt(m[0].substring(19),10):r.browser==="firefox"&&c!==-1&&(h=2147483637),h},f=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,r.browser==="chrome"&&r.version>=76){const{sdpSemantics:c}=this.getConfiguration();c==="plan-b"&&Object.defineProperty(this,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){const c=s(arguments[0]),h=o(c),m=u(arguments[0],c);let p;h===0&&m===0?p=Number.POSITIVE_INFINITY:h===0||m===0?p=Math.max(h,m):p=Math.min(h,m);const y={};Object.defineProperty(y,"maxMessageSize",{get(){return p}}),this._sctp=y}return f.apply(this,arguments)}}function Ld(e){if(!(e.RTCPeerConnection&&"createDataChannel"in e.RTCPeerConnection.prototype))return;function r(s,o){const u=s.send;s.send=function(){const l=arguments[0],c=l.length||l.size||l.byteLength;if(s.readyState==="open"&&o.sctp&&c>o.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+o.sctp.maxMessageSize+" bytes)");return u.apply(s,arguments)}}const n=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const o=n.apply(this,arguments);return r(o,this),o},lo(e,"datachannel",s=>(r(s.channel,s.target),s))}function Xm(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const r=e.RTCPeerConnection.prototype;Object.defineProperty(r,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(r,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(n){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),n&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=n)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(n=>{const s=r[n];r[n]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=o=>{const u=o.target;if(u._lastConnectionState!==u.connectionState){u._lastConnectionState=u.connectionState;const f=new Event("connectionstatechange",o);u.dispatchEvent(f)}return o},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),s.apply(this,arguments)}})}function eg(e,r){if(!e.RTCPeerConnection||r.browser==="chrome"&&r.version>=71||r.browser==="safari"&&r._safariVersion>=13.1)return;const n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(o){if(o&&o.sdp&&o.sdp.indexOf(`
93
+ a=extmap-allow-mixed`)!==-1){const u=o.sdp.split(`
94
+ `).filter(f=>f.trim()!=="a=extmap-allow-mixed").join(`
95
+ `);e.RTCSessionDescription&&o instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:o.type,sdp:u}):o.sdp=u}return n.apply(this,arguments)}}function Od(e,r){if(!(e.RTCPeerConnection&&e.RTCPeerConnection.prototype))return;const n=e.RTCPeerConnection.prototype.addIceCandidate;!n||n.length===0||(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(r.browser==="chrome"&&r.version<78||r.browser==="firefox"&&r.version<68||r.browser==="safari")&&arguments[0]&&arguments[0].candidate===""?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function Bd(e,r){if(!(e.RTCPeerConnection&&e.RTCPeerConnection.prototype))return;const n=e.RTCPeerConnection.prototype.setLocalDescription;!n||n.length===0||(e.RTCPeerConnection.prototype.setLocalDescription=function(){let o=arguments[0]||{};if(typeof o!="object"||o.type&&o.sdp)return n.apply(this,arguments);if(o={type:o.type,sdp:o.sdp},!o.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":o.type="offer";break;default:o.type="answer";break}return o.sdp||o.type!=="offer"&&o.type!=="answer"?n.apply(this,[o]):(o.type==="offer"?this.createOffer:this.createAnswer).apply(this).then(f=>n.apply(this,[f]))})}const hM=Object.freeze(Object.defineProperty({__proto__:null,removeExtmapAllowMixed:eg,shimAddIceCandidateNullOrEmpty:Od,shimConnectionState:Xm,shimMaxMessageSize:kd,shimParameterlessSetLocalDescription:Bd,shimRTCIceCandidate:Md,shimRTCIceCandidateRelayProtocol:Zm,shimSendThrowTypeError:Ld},Symbol.toStringTag,{value:"Module"}));function fM({window:e}={},r={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const n=yC,s=lM(e),o={browserDetails:s,commonShim:hM,extractVersion:Ql,disableLog:oM,disableWarnings:aM,sdp:dM};switch(s.browser){case"chrome":if(!uS||!$m||!r.shimChrome)return n("Chrome shim is not included in this adapter release."),o;if(s.version===null)return n("Chrome shim can not determine version, not shimming."),o;n("adapter.js shimming chrome."),o.browserShim=uS,Od(e,s),Bd(e),bC(e,s),CC(e),$m(e,s),wC(e),TC(e,s),xC(e),EC(e),RC(e,s),Md(e),Zm(e),Xm(e),kd(e,s),Ld(e),eg(e,s);break;case"firefox":if(!dS||!Jm||!r.shimFirefox)return n("Firefox shim is not included in this adapter release."),o;n("adapter.js shimming firefox."),o.browserShim=dS,Od(e,s),Bd(e),DC(e,s),Jm(e,s),MC(e),OC(e),kC(e),LC(e),BC(e),NC(e),IC(e),PC(e),jC(e),Md(e),Xm(e),kd(e,s),Ld(e);break;case"safari":if(!hS||!r.shimSafari)return n("Safari shim is not included in this adapter release."),o;n("adapter.js shimming safari."),o.browserShim=hS,Od(e,s),Bd(e),GC(e),YC(e),HC(e),UC(e),FC(e),zC(e),VC(e),WC(e),Md(e),Zm(e),kd(e,s),Ld(e),eg(e,s);break;default:n("Unsupported browser!");break}return o}fM({window:typeof window>"u"?void 0:window});const pM={finder:!0,torch:!0,tracker:void 0,onOff:!1,zoom:!1},mM={facingMode:"environment",width:{min:640,ideal:720,max:1920},height:{min:640,ideal:720,max:1080}},gM={width:"100%",height:"100%",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",aspectRatio:"1/1"},vM={width:"100%",height:"100%",objectFit:"cover",overflow:"hidden"};var $l=e=>e instanceof Date,QC=e=>e==null;const $C=e=>typeof e=="object";var pS=e=>!QC(e)&&!Array.isArray(e)&&$C(e)&&!$l(e),mS=e=>QC(e)||!$C(e);function JC(e,r){if(mS(e)||mS(r))return e===r;if($l(e)&&$l(r))return e.getTime()===r.getTime();const n=e,s=r,o=Object.keys(n),u=Object.keys(s);if(o.length!==u.length)return!1;for(const f of o){const l=n[f];if(!u.includes(f))return!1;if(f!=="ref"){const c=s[f];if($l(l)&&$l(c)||pS(l)&&pS(c)||Array.isArray(l)&&Array.isArray(c)?!JC(l,c):l!==c)return!1}}return!0}function _M(e){const{onClick:r,disabled:n,className:s}=e,o={cursor:n?"default":"pointer",stroke:n?"grey":"yellow",strokeLineJoin:"round",strokeLineCap:"round",strokeWidth:1.5,...e.style};return b.jsxs("svg",{onClick:n?void 0:r,className:s,style:o,width:"28px",height:"28px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[b.jsx("title",{children:"Camera Off"}),b.jsx("path",{d:"M3 3L6.00007 6.00007M21 21L19.8455 19.8221M9.74194 4.06811C9.83646 4.04279 9.93334 4.02428 10.0319 4.01299C10.1453 4 10.2683 4 10.5141 4H13.5327C13.7786 4 13.9015 4 14.015 4.01299C14.6068 4.08078 15.1375 4.40882 15.4628 4.90782C15.5252 5.00345 15.5802 5.11345 15.6901 5.33333C15.7451 5.44329 15.7726 5.49827 15.8037 5.54609C15.9664 5.79559 16.2318 5.95961 16.5277 5.9935C16.5844 6 16.6459 6 16.7688 6H17.8234C18.9435 6 19.5036 6 19.9314 6.21799C20.3077 6.40973 20.6137 6.71569 20.8055 7.09202C21.0234 7.51984 21.0234 8.0799 21.0234 9.2V15.3496M19.8455 19.8221C19.4278 20 18.8702 20 17.8234 20H6.22344C5.10333 20 4.54328 20 4.11546 19.782C3.73913 19.5903 3.43317 19.2843 3.24142 18.908C3.02344 18.4802 3.02344 17.9201 3.02344 16.8V9.2C3.02344 8.0799 3.02344 7.51984 3.24142 7.09202C3.43317 6.71569 3.73913 6.40973 4.11546 6.21799C4.51385 6.015 5.0269 6.00103 6.00007 6.00007M19.8455 19.8221L14.5619 14.5619M14.5619 14.5619C14.0349 15.4243 13.0847 16 12 16C10.3431 16 9 14.6569 9 13C9 11.9153 9.57566 10.9651 10.4381 10.4381M14.5619 14.5619L10.4381 10.4381M10.4381 10.4381L6.00007 6.00007"})]})}function yM(e){const{onClick:r,disabled:n,className:s}=e,o={cursor:n?"default":"pointer",stroke:n?"grey":"yellow",strokeLineJoin:"round",strokeLineCap:"round",strokeWidth:1.5,...e.style};return b.jsxs("svg",{onClick:n?void 0:r,className:s,style:o,width:"28px",height:"28px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[b.jsx("title",{children:"Camera On"}),b.jsx("path",{d:"M12 16C13.6569 16 15 14.6569 15 13C15 11.3431 13.6569 10 12 10C10.3431 10 9 11.3431 9 13C9 14.6569 10.3431 16 12 16Z"}),b.jsx("path",{d:"M3 16.8V9.2C3 8.0799 3 7.51984 3.21799 7.09202C3.40973 6.71569 3.71569 6.40973 4.09202 6.21799C4.51984 6 5.0799 6 6.2 6H7.25464C7.37758 6 7.43905 6 7.49576 5.9935C7.79166 5.95961 8.05705 5.79559 8.21969 5.54609C8.25086 5.49827 8.27836 5.44328 8.33333 5.33333C8.44329 5.11342 8.49827 5.00346 8.56062 4.90782C8.8859 4.40882 9.41668 4.08078 10.0085 4.01299C10.1219 4 10.2448 4 10.4907 4H13.5093C13.7552 4 13.8781 4 13.9915 4.01299C14.5833 4.08078 15.1141 4.40882 15.4394 4.90782C15.5017 5.00345 15.5567 5.11345 15.6667 5.33333C15.7216 5.44329 15.7491 5.49827 15.7803 5.54609C15.943 5.79559 16.2083 5.95961 16.5042 5.9935C16.561 6 16.6224 6 16.7454 6H17.8C18.9201 6 19.4802 6 19.908 6.21799C20.2843 6.40973 20.5903 6.71569 20.782 7.09202C21 7.51984 21 8.0799 21 9.2V16.8C21 17.9201 21 18.4802 20.782 18.908C20.5903 19.2843 20.2843 19.5903 19.908 19.782C19.4802 20 18.9201 20 17.8 20H6.2C5.0799 20 4.51984 20 4.09202 19.782C3.71569 19.5903 3.40973 19.2843 3.21799 18.908C3 18.4802 3 17.9201 3 16.8Z"})]})}function SM(e){const{scanning:r,startScanning:n,stopScanning:s}=e,[o,u]=R.useState(!1);function f(){u(!0),r?s():n(),setTimeout(()=>u(!1),1e3)}return b.jsx("div",{style:{bottom:85,right:8,position:"absolute",zIndex:2,cursor:o?"default":"pointer"},children:b.jsx(r?_M:yM,{disabled:o,onClick:f})})}function bM(e){const{onClick:r,className:n,style:s}=e;return b.jsxs("svg",{onClick:r,width:"30px",height:"30px",viewBox:"0 0 24 24",className:n,style:s,xmlns:"http://www.w3.org/2000/svg",children:[b.jsx("title",{children:"Torch Off"}),b.jsx("path",{strokeWidth:.2,stroke:"yellow",fill:"yellow",d:"M14.516 15.158l.714.714-4.595 6.14-.75-.364L12.337 13H6.978L8.22 8.861l.803.803L8.322 12h3.036l1.793 1.792-1.475 5.16zm5.984 4.05L4.793 3.5l.707-.707 3.492 3.492L10.278 2h7.972l-5.025 7h7.149l-3.71 4.957 4.543 4.543zM12.707 10l3.243 3.243L18.376 10zM9.795 7.088l2.079 2.079L16.3 3h-5.278z"})]})}function CM(e){const{onClick:r,className:n,style:s}=e;return b.jsxs("svg",{onClick:r,width:"30px",height:"30px",viewBox:"0 0 24 24",className:n,style:s,xmlns:"http://www.w3.org/2000/svg",children:[b.jsx("title",{children:"Torch On"}),b.jsx("path",{strokeWidth:.2,stroke:"yellow",fill:"yellow",d:"M13.225 9l5.025-7h-7.972l-3.3 11h5.359l-2.452 8.648.75.364L20.374 9zm.438 3H8.322l2.7-9H16.3l-5.025 7h7.101l-6.7 8.953z"})]})}function wM(e){const{status:r,scanning:n,torchToggle:s}=e;function o(u){s(u)}return n&&s?b.jsx("div",{style:{bottom:35,right:8,position:"absolute",zIndex:2,cursor:"pointer"},children:r?b.jsx(bM,{onClick:()=>o(!1)}):b.jsx(CM,{onClick:()=>o(!0)})}):null}function xM(e){const{onClick:r,className:n,disabled:s=!1}=e,o={cursor:s?"default":"pointer",stroke:s?"grey":"yellow",fill:s?"grey":"yellow",...e.style};return b.jsxs("svg",{onClick:s?void 0:r,width:"30px",height:"30px",viewBox:"0 0 24 24",className:n,style:o,xmlns:"http://www.w3.org/2000/svg",children:[b.jsx("title",{children:"Zoom In"}),b.jsx("path",{strokeWidth:.3,d:"M16.279,17.039c-1.396,1.209 -3.216,1.941 -5.206,1.941c-4.393,0 -7.96,-3.567 -7.96,-7.96c-0,-4.393 3.567,-7.96 7.96,-7.96c4.393,0 7.96,3.567 7.96,7.96c-0,2.044 -0.772,3.909 -2.04,5.319l0.165,0.165c1.194,1.194 2.388,2.388 3.583,3.582c0.455,0.456 -0.252,1.163 -0.707,0.708l-3.755,-3.755Zm1.754,-6.019c-0,-3.841 -3.119,-6.96 -6.96,-6.96c-3.842,0 -6.96,3.119 -6.96,6.96c-0,3.841 3.118,6.96 6.96,6.96c3.841,0 6.96,-3.119 6.96,-6.96Zm-7.46,0.5l-1.5,0c-0.645,0 -0.643,-1 -0,-1l1.5,0l-0,-1.5c-0,-0.645 1,-0.643 1,0l-0,1.5l1.5,0c0.645,0 0.643,1 -0,1l-1.5,0l-0,1.5c-0,0.645 -1,0.643 -1,0l-0,-1.5Z"})]})}function EM(e){const{onClick:r,className:n,disabled:s=!1}=e,o={cursor:s?"default":"pointer",stroke:s?"grey":"yellow",fill:s?"grey":"yellow",...e.style};return b.jsxs("svg",{onClick:s?void 0:r,width:"30px",height:"30px",viewBox:"0 0 24 24",className:n,style:o,xmlns:"http://www.w3.org/2000/svg",children:[b.jsx("title",{children:"Zoom Out"}),b.jsx("path",{strokeWidth:.3,d:"M16.279,17.039c-1.396,1.209 -3.216,1.941 -5.206,1.941c-4.393,0 -7.96,-3.567 -7.96,-7.96c-0,-4.393 3.567,-7.96 7.96,-7.96c4.393,0 7.96,3.567 7.96,7.96c-0,2.044 -0.772,3.909 -2.04,5.319l0.165,0.165c1.194,1.194 2.388,2.388 3.583,3.582c0.455,0.456 -0.252,1.163 -0.707,0.708l-3.755,-3.755Zm1.754,-6.019c-0,-3.841 -3.119,-6.96 -6.96,-6.96c-3.842,0 -6.96,3.119 -6.96,6.96c-0,3.841 3.118,6.96 6.96,6.96c3.841,0 6.96,-3.119 6.96,-6.96Zm-4.96,-0.5c0.645,0 0.643,1 -0,1l-4,0c-0.645,0 -0.643,-1 -0,-1l4,0Z"})]})}function AM(e){const{scanning:r,capabilities:n,onZoom:s,value:o}=e;if(!r||!s)return null;const u=(n.max-n.min)/3;return b.jsxs(R.Fragment,{children:[b.jsx("div",{style:{bottom:130,right:8,position:"absolute",zIndex:2,cursor:"pointer"},children:b.jsx(EM,{disabled:o<=n.min,onClick:function(){s(Math.max(o-u,n.min))}})}),b.jsx("div",{style:{bottom:180,right:8,position:"absolute",zIndex:2,cursor:"pointer"},children:b.jsx(xM,{disabled:o>=n.max,onClick:function(){s(Math.min(o+u,n.max))}})})]})}const us={fullContainer:{width:"100%",height:"100%",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},innerContainer:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",position:"relative"},overlay:{position:"absolute",top:0,right:0,bottom:0,left:0,pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"},borderBox:{position:"relative",width:"70%",aspectRatio:"1 / 1",border:"2px dashed rgba(239, 68, 68, 0.4)",borderRadius:"0.5rem"},cornerTopLeft:{position:"absolute",width:"15%",height:"15%",border:"4px solid #ef4444",top:0,left:0,borderBottomColor:"transparent",borderRightColor:"transparent",borderTopLeftRadius:"0.5rem"},cornerTopRight:{position:"absolute",width:"15%",height:"15%",border:"4px solid #ef4444",top:0,right:0,borderBottomColor:"transparent",borderLeftColor:"transparent",borderTopRightRadius:"0.5rem"},cornerBottomLeft:{position:"absolute",width:"15%",height:"15%",border:"4px solid #ef4444",bottom:0,left:0,borderTopColor:"transparent",borderRightColor:"transparent",borderBottomLeftRadius:"0.5rem"},cornerBottomRight:{position:"absolute",width:"15%",height:"15%",border:"4px solid #ef4444",bottom:0,right:0,borderTopColor:"transparent",borderLeftColor:"transparent",borderBottomRightRadius:"0.5rem"}};function TM(e){const{scanning:r,capabilities:n,onOff:s,torch:o,zoom:u,startScanning:f,stopScanning:l}=e;return b.jsx("div",{style:us.fullContainer,children:b.jsxs("div",{style:us.innerContainer,children:[b.jsx("div",{style:us.overlay,children:b.jsxs("div",{style:us.borderBox,children:[b.jsx("div",{style:us.cornerTopLeft}),b.jsx("div",{style:us.cornerTopRight}),b.jsx("div",{style:us.cornerBottomLeft}),b.jsx("div",{style:us.cornerBottomRight})]})}),s&&b.jsx(SM,{scanning:r,startScanning:f,stopScanning:l}),o&&n.torch&&b.jsx(wM,{scanning:r,status:o.status,torchToggle:o.toggle}),u&&n.zoom&&b.jsx(AM,{scanning:r,capabilities:n.zoom,value:u.value,onZoom:u.onChange})]})})}function hd(e){if(e===null)throw new Error("Canvas should always be defined when component is mounted.");const r=e.getContext("2d");if(r===null)throw new Error("Canvas 2D context should be non-null");r.clearRect(0,0,e.width,e.height)}function RM(e){const{onScan:r,constraints:n,formats:s=["any"],paused:o=!1,components:u,children:f,styles:l,classNames:c,allowMultiple:h,scanDelay:m,onError:p,sound:y}=e,x=R.useRef(null),A=R.useRef(null),w=R.useRef(null),v=R.useMemo(()=>({...mM,...n}),[n]),S=R.useMemo(()=>({...pM,...u}),[u]),[g,_]=R.useState(!1),[T,M]=R.useState(!0),[k,L]=R.useState(v),D=(function(){const te=R.useRef(Promise.resolve({type:"stop",data:{}})),O=R.useRef(null),G=R.useRef(null),[j,q]=R.useState({}),[ne,Z]=R.useState({}),be=R.useCallback(async(oe,de)=>{var Ie,Fe;if(!window.isSecureContext)throw new Error("camera access is only permitted in secure context. Use HTTPS or localhost rather than HTTP.");if(((Ie=navigator==null?void 0:navigator.mediaDevices)==null?void 0:Ie.getUserMedia)===void 0)throw new Error("this browser has no Stream API support");const he=await navigator.mediaDevices.getUserMedia({audio:!1,video:de});oe.srcObject!==void 0?oe.srcObject=he:oe.mozSrcObject!==void 0?oe.mozSrcObject=he:window.URL.createObjectURL?oe.src=window.URL.createObjectURL(he):window.webkitURL?oe.src=window.webkitURL.createObjectURL(he):oe.src=he.id,await Promise.race([oe.play(),new Promise(je=>setTimeout(je,3e3)).then(()=>{throw new Error("Loading camera stream timed out after 3 seconds.")})]),await new Promise(je=>setTimeout(je,500));const[De]=he.getVideoTracks();return Z(De.getSettings()),q(((Fe=De==null?void 0:De.getCapabilities)==null?void 0:Fe.call(De))??{}),O.current=he,G.current=De,{type:"start",data:{videoEl:oe,stream:he,constraints:de}}},[]),fe=R.useCallback(async(oe,de)=>{oe.src="",oe.srcObject=null,oe.load();for(const he of de.getTracks())de.removeTrack(he),he.stop();return O.current=null,G.current=null,Z({}),{type:"stop",data:{}}},[]),Q=R.useCallback(async(oe,{constraints:de,restart:he=!1})=>{let De=null;te.current=te.current.then(Fe=>{if(Fe.type==="start"){const{data:{videoEl:je,stream:Oe,constraints:Lt}}=Fe;return he||oe!==je||de!==Lt?fe(je,Oe).then(()=>be(oe,de)):Fe}return be(oe,de)}).catch(Fe=>(De=Fe,{type:"stop",data:{}}));const Ie=await te.current;if(De)throw De;if(Ie.type==="stop")throw new Error("Something went wrong with the camera task queue (start task).")},[be,fe]),U=R.useCallback(async()=>{if(te.current=te.current.then(oe=>{if(oe.type==="stop")return oe;const{data:{videoEl:de,stream:he}}=oe;return fe(de,he)}),(await te.current).type==="start")throw new Error("Something went wrong with the camera task queue (stop task).")},[fe]),ue=R.useCallback(async oe=>{var he;const de=G.current;if(!de)throw new Error("No active video track found.");{(he=oe.advanced)!=null&&he[0].zoom&&de.getCapabilities().torch&&await de.applyConstraints({advanced:[{torch:!1}]}),await de.applyConstraints(oe);const De=de.getCapabilities(),Ie=de.getSettings();q(De),Z(Ie)}},[]);return R.useEffect(()=>()=>{(async()=>await U())()},[U]),{capabilities:j,settings:ne,startCamera:Q,stopCamera:U,updateConstraints:ue}})(),P=R.useRef(D),K=R.useRef(p),$=R.useRef(S.tracker);R.useEffect(()=>{P.current=D},[D]),R.useEffect(()=>{K.current=p},[p]),R.useEffect(()=>{$.current=S.tracker},[S.tracker]);const z=R.useCallback(te=>{(function(O,G,j,q){const ne=j;if(ne==null)throw new Error("onFound handler should only be called when component is mounted. Thus tracking canvas is always defined.");const Z=G;if(Z==null)throw new Error("onFound handler should only be called when component is mounted. Thus video element is always defined.");if(O.length===0||q===void 0)hd(ne);else{const be=Z.offsetWidth,fe=Z.offsetHeight,Q=Z.videoWidth,U=Z.videoHeight,ue=Math.max(be/Q,fe/U),oe=Q*ue,de=U*ue,he=oe/Q,De=de/U,Ie=(be-oe)/2,Fe=(fe-de)/2,je=({x:Vt,y:Rt})=>({x:Math.floor(Vt*he),y:Math.floor(Rt*De)}),Oe=({x:Vt,y:Rt})=>({x:Math.floor(Vt+Ie),y:Math.floor(Rt+Fe)}),Lt=O.map(Vt=>{const{boundingBox:Rt,cornerPoints:bn}=Vt,{x:Xt,y:Ot}=Oe(je({x:Rt.x,y:Rt.y})),{x:lr,y:Yr}=je({x:Rt.width,y:Rt.height});return{...Vt,cornerPoints:bn.map(Cn=>Oe(je(Cn))),boundingBox:DOMRectReadOnly.fromRect({x:Xt,y:Ot,width:lr,height:Yr})}});ne.width=Z.offsetWidth,ne.height=Z.offsetHeight;const Tt=ne.getContext("2d");if(Tt===null)throw new Error("onFound handler should only be called when component is mounted. Thus tracking canvas 2D context is always defined.");q(Lt,Tt)}})(te,x.current,w.current,$.current)},[]),{startScanning:W,stopScanning:F}=(function(te){const{videoElementRef:O,onScan:G,onFound:j,retryDelay:q=100,scanDelay:ne=0,formats:Z=[],allowMultiple:be=!1,sound:fe=!0}=te,Q=R.useRef(new Km({formats:Z})),U=R.useRef(null),ue=R.useRef(null);R.useEffect(()=>{Q.current=new Km({formats:Z})},[Z]),R.useEffect(()=>{typeof window<"u"&&fe&&(U.current=new Audio(typeof fe=="string"?fe:"data:audio/mp3;base64,//PkZAAhghE0AKToAJra/n0FQygAAAGIkYJgmCYXBMAAGCTJz3zhCEM//z//1hz//8MMMMN08ssV6e5DDWIQreAgCvFKy8bXgIKMkUDDBgzJwIBtkRMQAocxIFdxghQGKDoEziAzQxOBOdH92i/iGi+zDCAEIX46a73HrSybZw1x3JZjXp7dSNy/P68rjcbt7p7fakMP5LVMyzCaj1pjvejYYAIDgDGzECjEAk1Jl3559HIon8hzlfPVTCvGJZzfcKSxXfyMWM88//9VKSxXdtnb9vomOuuRyiWVYbf+X8zp6fKGHIdycuWMMMMMMKSnp+6wsYc/9f/7z7rPPWHN556p6fP8MMMP///PPP/7+GHK9PT6p7f/unldP2np7YeHjweiYA4GLNAgAiI7u57n5//oc5/yfk6znOcPhwOBwggHCMpA4HA4KEyHOc5znO+hPIc5//+fqJh8XQPh90JU5xQinOf//87/zvP+ggAYuhCKHxdA+Hxd0EA4KKHA4ciB3kOXfXB/gmf8p/B96lAMKAgAADU+BujARHgwdisgHMfAUHAiceBg4ASBgZBiBIBH4ZaHOJsLhf8R+HYEciIgYSwj/+Bi7EqBh+AcBn5P6Bh4TuBmrAMBiZH7gaLEWgew//PkZFMlyek60MpYAShzqqZhm6gCUWeEUWAewEWYGN4X4GDEPwGE8S4GDoOIGAYKgIQOkz//gGARAUB+CwGxTwMAACAEgyAwdAlAxKhzAxXiZ///AxcEwAwJjDAziCAAwQgdAwRgdAsJQDAmAcGzYDwAhZIAKAcIQB4GT9TQMJ9/4Gi1Fv/AcAYUqKBAwGgNAwVBAAwGhwAwdBlAxFg1AwlgzAwNBuAkJQDBgEEDEqGECgChFgBgL//CIswYYH//+HKCpk4K0C9AaKKCAOBeMcR4X9C44BwABCgGAsGYCgTwHAcAwXAiAwSAQV///CJP9lwMBQAwAAAWGo5lVLCcaeneVhJAVGai3//ioaUEf//gaTAYGCj8BnEwfrIqDcsIQb/vmhU/8fAs0G8YGGwKST8Igj4GCATipksVzY8p//90FWJwh45AkX//4fCF9wMEgkL3uQc+gbGJ8t4MBAMBP/hEXf9FRuWBcAfIFjYzQdoLCBwh7IWVlxaX/w8oMCP/+EQT5poGB1Ir90DhiV6af/jFYBpT2BgoQyyt2M0ToBdEaZyzt8nTo3xdNDCTSd//o6F06CjooxRr4jVF/0bOKD6OMUNDRxiMUVFR0FFQPhGXRjDpr4MAEA4wIQUhYOIw//PkZE4nrg08sOx4ACQ0CopD2aAAlwTTBxQeMcwd8w8gZTAgABXwGABOkzpI0wAQAExnWfP4x8ZjKunWdZ1o1Qe6lFGKCNULORQCELAAPnRUf/GIx/0FHGfo3SdZ0qP2cukXKLlRtBKFgAQwCkwJgFRYBEEATmDsLSY2QiQYCEnEra+UZo6F1aKMRr6GhoaP/+j//ov+i+hjLqBgMkYoqChoo1GqCjoY06TpRqjjLOYzRRmMuizmgdKhdF8kjTAAAPMCwGswzglgwAJfzqxmioKH/////////////+ijLOAwFmN0f/////////Q///8ZjP/9DGYyFwIDBeB3MA4AlBWidKM5spykAUAQOCakK+udGqN8VDYjTRuN//0bVX//6Kio4xQFv//nf//kKOoAEIB6SY6hcxenp85///4/DEPf/84Xvl4vF4dwtxfEJgCYQHMSgKCROp4+fn////L4tQf0unz89OecLxeL0ul09y6enzp4dIhKAQFA5hKfLu1nU7/Wr71rRKJUBQSUVt////l08GUPVWgAAYAeNKsxbQNAAhQx3/oKGMM6dZ1Yy6sajMbfKio7lNcv0sScZ47lNcw32ekVFMP9fp/f+mklI6at6u/dBMQuW6y+C5BcgwAA//PkZEomGg1HYGe0riWsCqbEwiY0BJFJMxrCcxGgQ2VK8xxCF1wsABgQBBgQBAYAFCkYCgALkK4fJ00E5ctJN1Uxy5au3XoGcM4dSN0EYZwzhW0WCh1PZwzhnFFQxtnbO2d0Kt6CdXbruggkTEX5Rs4TEQUVsdVXaCcuWXIBQUGmwmgoAGcJiM4dSioHQdBnEY+hjcbov//jcb/43G43G/jCRibfxugdBnDqULO2duvQumztncbo4xGKKNxugooxGIxQULoOgFgUMTA/jbrxiMDmETL+eLhcPThzOeeOZfL5fIcBYuXD/OHv8t//LJFxjxQYHHKDGFkZMtlmKM0RgQfbVtxFIHbQBDRuzRguEI1c9XZ/rWmrZfVU3Oc/9utNNygRQkCoHlAYstNN6DJ1IINpoINppv+WG/+g2mmnUmmmpBAoJIJhnwB5xkymn606Df/t000xhU03UXC5Ol8uFyXy+Xy/l8v5w4cLk4XAvwAYUvl/QL5fTdlKZkEEEEGumaKaX00zIOemf6CH///ywI3LKpiQ2Ef4xYWMSDyI0XwzikpL0ajVHZ3j9DGIjeuXcNfjn96/S/TUz/X/vX////5K/r+v7Jn+LlAoGZOIQIwMKBQM/yppKYURmhGZkR2b//PkZE0mHg1HEG8wyiD7mlwAyDU8nJHi5htakZmZGNiRcpkJhBmUmZYQcM1VDEEBggNDV/ASEZRYKFZIhkXKLlKmk7IVTKmZNJ5KhiqVUqpX+k7+qlVKyV/ZIqZDFDWTJlFyi5TJpKhiXKBQyZzIS5JhBoayV/AQWVpGWkcYTV5O/rIVSv8/0nkr+v6/vyR/X9f1/ZN8kf5/n99/n+f5/lTKmf9/mRP8yFUqpWSv4yJUqpX9kj/MmZNJ5K/z/P9J5P/v6yFUz/CEoywgUMqZkz/FssECIsVq0aPRrRRatFFFykQZJ2Ukl///5KjmksOaA7ALROJLDnEsLbq3GTMVrwb/0dGzmM0DlfBlHQOmrdR0MYi92TX6b/cmDHLclyUVYO/4O8sFTKFTKFf8yhUyhUyhXzKlDKlCsr/+ZUoVlSsr/+ZQqZUoZUoceMfcoZUoZUoVlfOPGcmDHKcpynKg9yXJcr3JclyXJclyYO+DXJclyfgxFZVb3KcqD/g2MxzsY72L9LubPR0dCyf5K5NNd+Tv9GXRdV0XJclyfcl/n+k8kf6SX/iVynvXf///4Mg/1OkxguYzmM5jMcLHMxwwGhgNCwXMLAcwMXTLi1MD7w7tmTdBvMmE0xQFzCwHMDAd//PkZGMpigkmAGOUvCfTgcgAuC+ITswMFzC4oMLhYMByn0xvU+p9Tr0xUxf/0xv///1PBYDhgNTFTFTGTGTGTGTGTGTGTGC4GTFMDAcLAdMVMVMULAcMBpgYDhcDGFwsYXFBikLGFwMGA4MBxgcDKfTEMUoAx2BisD+mKp5Tv1OkxkxkxkxkxkxkxkxlO0xVPJi/6nv////U7CwHTFTFTGTGTGTGU+p71PpjJipihYDpipi/6n1Ov//C4GC4GTGTGTGTFU8WBSZdLhWB//yKlotyLZFiLf8tyyRUipFSKkVGRBZQMiWC3yx//wxUGKsSvDFQGHUAL3QMsHDFIYpCYy2Bmagy6BjLgy6Bh3od58DCLAizBgRb+EQiyEQiwGBFuDAi3/////20QqSBJf/qcumv/////wMZdGXAYMu1gYy6MuBEZdBgy4BjLgy6BjLgy6BjLgy6BjLQy6DBlz2cJDLgRGXAMZdGXAYMuhMZcCIy6sJGaoGMuppwNRl3WBjLgy63wiEWAwIt/+EQi0IhFsDCLAi0GBFkGBFgMJCqaqYAgAYIhBBvwf7kwcqRq7V3IctacvlN6NxqgooxRRuNRiijEZjMGRuMvz9FGozQ+1X2qe1T1S//+VhaWAtKwtML//PkZEIkbgcaAHc1xCJrjeAAtfuUAtLAWf///mWePH95ZFgsyssvM88+jzO6K+z7OM48sH+WDiweZx5YOK+zxWLGJWsa6xadAv02fTZLSpsFpvLSga0tMgWgUgWmwgUmyWl8tMgWWmLSoFJsoFlpSwsmyBg4HhEdgwHAYPBwGDgeBg8HwMHg4DB4PBgOAwcOwMHLwDn5lAwcDgiDgYDwMHA/4MB3//+EQeDAdwiDwYLPhEWQYLODBYERZBgt8Ii34GLBaB5pfAZ0FvEAQ/UfwxULlx+IXx+8f5CELH8fxKhAIDFoHBEDRc3////gwHgaRXgMHYMB2EU/gwZ/gYbw3gY3QbgYNgbgYiAbgwN3/+EQbBEG4MBuDAbAwG4RBtAwbg2////+B9B6F//////////hEdD//////////8DRahEQGCInMNg3LBElgNjDciCwG/lgNiwGxWG///mG4bf/+WA3Kw3KyIMNw2Kw3MNg3MNg3MNiIMiQ2OK0xMiA3KyJLAEZgRARmBEDEYFwBBgEgEeomowol5YAJKwCDAIAJ8sAE+gGBgCJYAQUZ/13LubMu5dyiYOAhKwEFGf9AOoz/g4CFAIol/lgAjysAgsAElYBP////lgJksBM//lgRUxF//PkZGApggsIAHt2wiNLoggAqCz8RFSwIqYioipkjEjHCCSN/+WJg5iYOYmPK5krmTmZk5mZ8sTJYmf8yJiNiIisi/ywRmRkZkZGZGRmRERkREZERGRERkREZERGxEf///hETIMEyBiZEyBiZEzwiJgDEwU4DV2gQGFOBgmP8GAiAwRAiBgIgYCIGAi/4MBHAwRgjAwRgjwMEQIgMcgY8DBGCMDBGCMDEyJn///+BiYQIBlObj4eYLIwsjAOBGFkYBoEQ84eULIw88LIA88PKHnw8sPKFkeHlANAiAaFUDAiMYPIHmDzBZBhZB///8GBOA1sH/Awni7AwnhPCITwYE/CKzBgt8Ig8GA4Ig6EQdww4Yb+F1sIgtwYCwGAsAwWAsBgLAYCwDBYCwDBaHUDF+VEDKgC2BgtBaDAWgYLQW////gYLAWQMFgLAMFoLcGAt////4RMABmBSj4NgwMOGHBsHhdcLrwbB4XXC6+F14YcLrww4Ng8MOGHBsHww4Ng8AUC4AoMQMC4fgw3wutV4QIsAgFYIBWCCVgHeVgHeWABCwAIVgH+YBwB5aRAstKgV6Ba1oMg9avtUVN/qdLWciD/cqD3Jg6DFPuTB/////lYAn//mC8C+YLwL5gvgvGC//PkZFEpLgMKYXt2xB5LogAArbdc+C8VgvlYL/mC8C+YLwL5YBfMNgNkwXixDWoHPMc4VUxVA2TBeDZPYXzXl815fK14sLxYXvK1//NeXzXl815fMtdDLSw3UsMtLCstMtLDLSwsFhWWlgt//8sFhW6f/////+WF7zXl8sL5ry+Vrxry+WF/wMLwX4MC+EQv/AwvBfAxsjYAyqpKA0lpLAwvBfBgXv///4RA2DANAYGgNgYGgNgYGwN+EQvf/BgXwYF//8DC+F4Dd6NgGBf4AgFwbB0MMF1wuuDYMBsGwusDYOBsHA2Dvg2DQuuDYOhdcMMF14YYDGYDEGwfhhgbB0MN///4RBaEQWgZByoYRWYMFvwiDsGwaF1gbB34GDwdC64XW/w1aKxDVgatir4YcLrQbBwNg7////////////+ESfgZPyff/////////4MFmBvvMAERZ8CC5adNj02E2S0qbCBSBZaYtN///oFlpU2QMXIFAYuQK9AtAo7IxLTpsIFJs/5aZRxQawaxGfIg9CsrI+PUqkWdOHp7ODsOl6cOHZ4dsulfLI9/8BAAgMBACsBLACVgBjoAWAE5OTM6WDAR0zodMdHCsJLASWAjzCQgsBJhASWAjysI8wkJMICU//PkZFkeqgcaYDd1th6DogAAqCuIxQwtDA5MdMULgyY6YqnXqdep5TpMdMVRNRL/UT9AN6jCiSjKAZRNRhAMomgFQDfCIJwYCQiCAiCMGAkGAgDBJUA3eVAMEgj////8SrDFIYqh5g8kPMHkDzB5OFkYeYPJ+HlDzB5+AYVQDibCyIPLLEZIsjIliWS0WywWyyWuWCyWJaLZbLJYDHgLAItFvy3///4eYPKBlQTh5QYEODBb//hhoNg7/C62DYPFUKwKsVgNWBq8VkVcVkVUVYrH//hGff/8Iz8GT7//////wiX4ML3gwvgwvf4ML3gZeqoHVGyBl4vgZfL2F1oNg4Lrg2DcLrg2DQw0Lrhh8Lr4YcMNBsGhdcGBcMOGGAFGAGMQsF1guuGG4XXV/4uQXOLmF1kL/8lCXkuSk4O8/FzHzuP0hIucf/CIFAMCgFPgYFAKAwCgGBQCgGHYO4GBVM4GgQI4RCMEQKQOtQjUI1CNcI14MqDKwDIAGQDzh5wsjDyw8uHmDzYeUPN+DEYRRhFEIowYgDQgIhWDApgwKAwKQYFAYFQMKkYDOxHAzsRgMKBUGBX/h5v+Hm4ecPNh5A8wBwjhZHhZAHlDzBZAFkAeQPKHnCyILIAsih5QsgDz//PkZLQgIgsMAFp1xCGLogAAA2rkB5w8oeYLIQ8kPMHkCyGHnAMKoGmAgFkUPMHmDYAtfHPHNkr/JYl8c8lCWHPHMkqSo5onMAkBDnfJX//8IgDBgBhEdAaxSQMHUGAEIgAV4risCcipBOMVRVBO////hEvAxsAwvf////8MPDDww4XWC64XXDDww4YcMPC6wYb/wYGgiGwMplMDYhTCIaCIaBga/////8GA+EQdgYPB4MB4GDwdhEH8Ig8Ig8GA6EQcEQf8DBxlBjoAweDuFwgCQXiL//iLiKCKCL4XCiKRFwEgoRT4iqpMQU1FMy4xMDCqqqqqqqr////xuDd8fv/DVwrArEIg6EQdhEHAYPBwMB+ERYBi0WAwWAZ0FoGLYOB+JfgZ0FoGdBaDBYbn+WHm9xW7/Nzzc83PLDzc8reWlA7S0oHamx//6BflpU2C0qbBaf/8yk/ysn+VkMhTKQrKVk8yE8rIVkKyYsAn/5WC+YICmCApWCGTkxtKMcVWlgFMEBTBAX////0C0C0C/////////LTFpvTZLTlpv/0Ci0xaYtOgWmymyWkAxcWmTZTYTY8tMmygUWmLTIFpsFpv9NnywLmLCx2RgWmQKTZ98UjnzZ1/++D4M6/////3//PkZOgjIg8IAFcbxCaTogAAoCuIzfJ8vfJ8Wcs5fBnD5//++L5f////////6nCKv//+o0o0FUYwqDNGCwgUMKC0VVGkVv//4Yf8LrxVCriqDVoasDVuKsNWw1bisBqwVkVkVX//gy/4YYMMGGhhgwwNg4LrhdcLrAYWGAA0zBsH4Ng3C6/////4MAoGBQIDAKBgUCAwCgYEAsDAoEAwKBAYBYMAoGBQIBgUCYGBQIBgUCwiBAYBYMAoRAgRAoGBBMBooCAYFAkIgTEUxFv/EWxFxFhFoi0LhQuFiLCL/EWqTEFNRTMuMTAwqqqq//////8TWJriV/hERAwRgYiEYGIhGBmIRgYiEYMEQMEcDMSiA1GYwMR+UDMTkA7KIgMRGIGGM0SIrRGjRlhEV4jxov8rR/5YRFhEdQSViCsR5iRJWIKxPlgQYgSViSsR5WJMQJLC78IiKERF4REeERGEREERHwMRGOBmIRhERhERAwRAYiEQGIhGBmIRAajkgG5TEEREDBHwYIwYI4REXCIV/4MCmDArgwKAYUO/gYVCkGBUGBTgYUCsGBUIhUDCoUCIVBgVBgVBgUhEKQMKhUDCoUBgVAwoFAYFcGBQDI6oA5+qQiFAMjBUGBXCyEPIFkOH//PkZPMj6gr6AFdVwifkBdwAoC2Ilh5/8PPh5Qsih5IeUA0TAZrE8PP////wMRiIIqID8piAxEIwMxCMDEQjCIj//BiIDRo8Iogii/4MKwYVhEoESkDEiIGJEgYlfBgmDBIMEAYgSBiBIREAwSERH/8I7wPfuCO4I7v/8GBvAw3Bv/////gwN34RBuBg2BuBg2BuBg2BuEQbhEG+EQbAwG4MBtwiDaDAbhEGwMBuDAbAwG4GDYG8DBsDcDBuNwDRWDcIg2AwbA34RBv///CINvCINgMRIN/////wiG4DDeG+TEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq/zB4OLAP8rBxWDisHlYOKxb5WLTFgsMWiw18LDOnjPxZoxadDOgsLAtLAbKymVhsrDZWG/LAb8w2GywGysNlgNFgNGFwuBQuWnTZLToFFpisLJsFp0Cy0voFAQLFZkMCAQwIBCsC/5WBCwBCwBCwBCsCeVgUwIBCwBDEwEMCAQrAhgUClgCFgTlgCGJgJ5gQTGJwKWAKYFApgQTGBQL5kY0HMjQYnAhWJvKwIWAIVgQrApYAhWBPBgECIEBgE/8IgXhECQiBAMCkcDEwEwMCAQGAQIhoIhsGBsIhvgwN//PkZN4irgr2AAOVqiUThegAnCtMgwNwiG/8IhuDA1hENhENgYbKYHb2IBhoNhENAwN////8IhsDKZS////8IhuBhspgc0KQRDWEQ3///CNf4GAIMDAwgAwAAwhAwAwYAIgwiHBgAMAYGAAGHv///CIBqBqESDEIgRYGoGHBiDEIgGoGgMAYgxgwgxCIETwYFYMCoMCuDApBgU8DCoU//gY3G//wYFOBhUKBEKQYFfBgV8IhSEQoBkYK8IhT/wMKhXBgUCIU4RCoRCvgYVCsDCp3A1SqAYFAiFP////gY3G1TEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVgwCAwCBEC///////8IgUIgWEQIBgUCAwTQMCAQDAoEhECAYFIwGaRMBotWAasdwH/KqBmhFgaKI4GRgKVpjCBTCBPMJHNMFMIFKwnlgJ5hUxhUwGWlpAMuMuWLTFpvQKQLQKLTIFJsoFIFFZb/8woQwoT///MIF8rC+WAphAphAppgpYClgsmwBC6bHoFFpUCi0wGXFguWCwFLgUsgX6BZaVNj0Ci03//+EQKEQKEQLCIFAxMBcDAgFAwIBQYBODAKBgUCAYEAuDAKBgUCAYFAgRAngwCgwCwiBIRAmE//PkZN4iogj2AFdVxiUrhewAhOkwQIBgQ0gbOI4GRhOBiYCgYEAv////CIFAyMBQYBf///CIF8IgUDAgFBgEAwIRwMCCcDEwFAwIBf///CIEQGMDGEXCKBpCIDCEQDCAsYInDFQMMAuYSoTQMVfBlf//+DKfBgAiGDAQMIMIgCIQYADAEGAgwP////8ItgNu2/8DAAAiABgHhECBgQGEQARA8GAeEQIMABECEQIMAwYBBgCDAARA4GAAgYACDAARAwiAgwDhED4RABEBCIGBgDoH2dgZwCBgAP//BhX/+DCiTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqF1ww////////hdeGGDDBhwjeF102E2fTYAowMLjE0zTDfyyMYjEDJTwMLSwFi0/gQLoFIFpsegWmyBQsWlQL9ApNgtIWn8tMgX6BaBX+WmQL9Nn02f9NktIgUgWmwWl9Avy06bCBSbJaUtImyWkQKLTIFgYWoFFpAKFwMLzZgwAwvLTIFlpU2fQLQK///4Yf4YaF1sLrg2DAuuDYNDDQw4NgwLrhh4XXC64Ng3C60MNwbB4XWC64YcMODYPCJYDlMQBlwRLg2DOF1v/////PkZM0eKgz0AE+UuCnLFfAAk3Fsg2DAYX/ww//4YaGGDDhdbDDACFwMuXA2DADlygusDYOBsGhhv//wNU/CKQusF1oXX+F1wuuGGC6wXWDDBdbC6wXXhHv//4AHIFgC0BZAA4Ba4FkADwFsC3AtQAOcC0BYAtgAcAA9+BYAsgW4FvgWOABwC1oq+it4RT0VVG0VFGkVywo1/RWU4U59TlFb1GvRX////QK9Nj/9AtNn02fTY9NhNlAr/QK//TYTZLSJsIFemx///oF/5aZNj02U2C0yBaBfoFAS6bKBfoFVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQiA8GAO/4RAf//////wYA4GAO+EQHAwB4GDoB4GA4HQRB0BhlDIBpEAcBgPDIBgPAeDAHIFAYuLTpspsJsFpi0haRApAtAstIYKClgF/ysF/ysE/ysF//LAJ6plTlYC1ZUypmqtWVK1VqyplSFgBaqqcwAAVIqcrEBAAKmMBERCQhwD5iICIQEyABMAABBVGXF4gIA4DLAAWAEQgLVSsBaq1ZUv+YKClgELAJ////5YBP//LAL5WC+Vgn+WAX/LT+gW//PkZMIhLgrsAFt1yiD7FiB6A9qwmwViybCbCbCBSBabCBSBabPpsegWmwWn9ApApApNgCGBmEwWlLSpsf////hEHgYOB3////4GDkiBxMHhEdgYOB4GDwcBg4HW23gooFYHd/+BnAz8O8Vv//FaBm4rBWh38es2zbAtD1m2PVBqBrBqBrAF7AF3/5el84MkuHTgyy+dL0dRnEajMIyOn8RsZ5HGG/kbIpHIkYUiD0y2WctlZaWSwrKx6FZbxnL54ul04eLhw9Ol84dl86cOHT3Ipb5Z8qKpVx6/j0EkLctVTEFNRTMuMTAwgWQLQAHgLf/////4Fn+EQESEcIgInCIRW9TkrCzH0YIjjWtI+YeCD0woLCBQwsKRWUaRVCBZFZRtRtFRTlTlThRtAr0C0C//02E2fTZQK/0Ck2f9TlFRTlTlFT/9TlFVFRFb/9ThThynIQbWkAREue5S11rKdlkDEVABh61ExYPU+tOD4MQgcn4iwigivxFRFoXDcRQLhoiwioXCeAkFBcNiL8RURQBIKEVEWiLBcKIqIpEXC4QReIoIpCIKAQMxFAFAsIuIr/4YYLr//ww4XWBgwC64XX/hhgw3hhwuv8MNhhguvhdcAUYgaYTAAoWDDg2DQbBg//PkZPYe6gzuADd1uDKsBhBAe89cYYdGjtDT2hDmlD2leaOv9oX0OX/0NNLplNf8ewakNWGrTfTRpphNJtfaeh7T1/tStdtTpqN532lpX/1/kmQ5eaf2hoaV9paGleJAvd0rer2pWu1ar2vk56vVrV5Hj1Nop+/lfv5Zpkem5kX/2vtata2rq783nbvtbW6VjW6a2rq13+rO6VysV58K7tbp0ru6Vrtqa1a67tr6sau1ulYrnfa2v927Vrt21NSuN5X927/D4diAQANh4gEIfxB+IQG/D/4gDw/iGIRD+HRATEFNRTMuMTAwqqqqqqqqqqqqqqqqqiIEK/ititFX///8VcVuK38VsVhXBOQTpq/qm8QCAcBmIxgdfFZCHECpxFBFAuFEUC4cLhsRTEVEUDVoDQD+KrFYirFX+KwKoVgVUVUVeKwGrhWRWBViqFYDV4rMViKyGroauBg/A0YThVgNAEVQqw1fisis4quKxxWYrAatxWIqoqg1dFYxVxWIrAavAaAArIrAqoqhWYrIqvxWMVYrARCADhcKoVYavDVgqhV4qorIrHFWKuKxFViscVUVYasAaAfFY/4YcMNhdfwuuGGC64YfDDA2DwusANygbBwAxhAECwNg8MOF1hD4//PkZOkc4g7yBjd1sDNkDhgqYwtcYoUyiQ0NCkxQ0NCQkSIbGKIyRGEo5mUaNEhGKEHMmaGhI0UokORvMmZmZSZSiMZQkRnKKZkzRoSNCQpQ0NEZoaNFJkhh3KOUJEhIcoSJCQkIzlDlEjMDMyMpQ0JCQzNCRGaNCRISEZoZihoaIwlEHKNGiMzFEjRmSIwlHMyZmcyiGyMxRyhIkIxRSZokSEYGBkiRojAPESNGjQxvKHMmMoSKTJCQkIwlFKLDYWGhoZhYWAAUGBsAwsMDYUAcK4XDPhQVwwLAH/DfgHC6TEFNRaqqBgjwYI//wYI/8GCL///+DBFhERgwRcIiPAzGYgMRKIDcskBgjAxEIwYI4GiRwNEjhFH4MRwYjA0aOEUf8Io/BiLgxGEUYRRQij/BiKDEYMR+DBGBiMRQiIgYIwiIwYIgiIgMRGIDUSjhEReEREBiIRAwR/wYI/8IiP4MEcGCIIiOERH8GCIIiMIiIIiODBHBgjBgjwiIoREcIiOEREDBFCKiAxHJcIiMGCMGCLwYI8IiPhERgwRAwRAYjEUIiIGCP/AxGIgiIsGCL//4REYMEXhERBERhExhExAzyAZiEWDBGERGeKsVsVRVFcVwTnFcVxVgnYqipFUV//PkZPkcfgzeAFaVxDgUBgAgatvIYrgnYqgnQJyK4riqK4rwTsVor4rQAjABAgnQritFSKoqQTsE5C1haxfF7F4XQtULSFqC1i4LwWkXIWkXRdF+LwqAnME4iqCdwToVuK+HAERWAkAlgJB0OB3Doc8OYc8VCsVgIB3DuHAERUAkAkHMOBwOAIisO4dwEAEAEg6AkAl4CeHA4AkKhXioBIOiv8OB3F+LgWkXxeF8XouxcF0XBeF8XBdF8XhdAdouC8AEsXYWsXOKsVBU/FaKmK/FTxXFbFUVPiv/8VfxXitVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVAXX/8MN/wwwYf//DDBh4Yf/+DYODDfCIFAwKBQiaANFgUDAgFAwIBcADwFuBY/At8C1wLfgAdAtwLGBawLcC3AsgWeBYwLX4XW8LrBhgiFgMlhYLrhh4XWhdb8MOGGhdcMP4YaF1gw8LrwuvhhoYYLrYXWDDBdcGwfC60MN/ww8GwZ4XXC64GZQsF1wbBnDD4XXg2DcLrBdaDYPhhgusF1uGGC64YfhhoNg0LrQwwYcMNC62F1/g2DYXW4XXC6+GH8DTIW4YeB/wR/wjwR+DP/y06bJaRAtAtAtAs//PkZNwY2grqBFW1xDhTRegABLBstL6BRaVAstN5aYtN/psIFf5aQtIgWgUWk8tImyWkQL9Avy0qbKbKbJaf02f/0CkCy05adAsC3K7+mx5aVAv0C/TZ8tOmymwB2pspsFpPLSlpy0qbCBSBXlpk2E2E2C0paUtP6Bfpslp0CkCy0ibJaZAosWQLLTJsemwgUmz6BZaYtOgUWmLTpsJsoFJslpPLT+mwmz//6Bfpsf6BSBSbCBXoFeWk9NhNhAr0Cy0/+WnTZ8tJ/oFf6bP+myWn//8tMmz/lpf//////8sPTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVBgJwiCYMBP//gwE//////wiCAMEgkIggIqIDKpUCIIgwE8IzA4j+EYhGAZMIyDJA5gGRhGcIyDIhEQiIGAgwIRDwiAGAAwYMHBghGAZMGRCMhGYRgGRA5gIyDIwZPBk/wZIRmEY/gyOBxIMgIzCMgcTgwRBgjwYJBgngwTwYJhEQBiBGERMIrwOouAxAgGCQYIhERhEQDBGDBAREgwTCIgGCQYJgwSDBHwiI4MEAwSBiRHCIkGCYGJEQiI/Bgn4REYREeBiBIH6XhERhETwogoy04mpZibFmJuWYmx8n//PkZN4ZrgrkAFZUyDcjofgAA9qc0HafZ8HwNrjaG3xtjaDtJwTo+D55Ow7fxNRNSyLPlqJsAr/lmA/FmWYm5acTQVgTkVQTnBOQTgVxVBOBVFWK4J3FUE7gBABOwToVQTsVhUFcVRXBOhUBORWiuKkVYrCqK+KoqgnQrAnEV+K8E7FQE5xWBOQToVQTsVRW8V4qRUFYVgTsVhXioKgrCqKwqAnYqCtBOhUioK+CcisK8VRUFSKnirFQVBVFcE6FcVoJwKoqCrFXFUE7gnAqiuCcQTsE7xU8VP8VYrgnYrCuTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqn3/l/J/8vHL5f/BhwCETgGpIDOATgEIOFoDcHzgEIDgC+pG7eve1S/6tat7rXupDXSStWoIpGS4TSMQNIySMwpIyAaRkkZ8GJGdBtbwYkZ63tCKRkoIpGWDEjLCKRmEkjOvsEUjJOsIpGa6bOrgxIzsEkjIGJGYUkZVKCKRmqoDkgEjMJJGSYMSMAikZJ3qhp0dq9ru3X1I36FujPbXuxwKbr//waABfg0AC6DUDUDXBqBoAmQawJiGrhqDUGoN//PkZL8USgKcAAblrroTgfQAbhtQAag1QawaYNIAuQa12Lv9si7F2NnXa2Vsi7i/DZl2tlL9l+vL8tlUTUTUTUYQDIBlGUAyifqJKJqJ+p5Mf/U7TETEU7CxkxVO1PKdqeU8u4vq2ddnrsbM2Zs/tl9s67V2NlbIu5sgaA1Q14ExAmAaA0BrDVDXhpgTPDQGuBMA0gTKGgCYgTHDQGrDUGgNcNQaw1hoAmcNIaRIAtALVEgC1gteI8FpBaBIAtcRwkAWgFpBaILVBaIkAWgRwjhIiPEeDXwa/4NUGr+DRwaKBgX/8IhP//wiF8GBMGBP/wYEhEKEQmEQuDAoGFTAwLgwLhG/4MvCM8GSDJCNwZQOXg2DwbB8MPDDhhuGGBsHhh8Lrf4MCQYFCIUGJgiE8GBQMIFhELDDhdaGHhdYGwaGGDDhhuDYMBsHg2D8MMGHBsH8GwYDYMhEKEQgMCeDAsIhAiFBgQIhAYFhEKDAkGBMIhYGEC4GFCBELgYUKDAuEQsGBQMKEwiEBgUGBcIhQYFwYFAwgWDAoRC8GBAYE4RCgwKEQvhEJgYUIBhQkIhAiECIUGBIMC4RCgwJCIUGBAiFgaYLwiEA5cGXCNhGBGwZAw4Ng0MPBkqNqcoqorlh//PkZP8cygrkAFI0wjo7lfAAjhq4SnPor//psoFemygWmwWm/0C0Ci05adApNn/TZQLU5RU9FRFVFdTn1OFG1Gywv/UbUa9Ff0VoFgCwBbAtQLUCzAtgAchHAN8ImAbgBvwDd4RwjQDeAN8I0ImEQEQAbwRgiQjBHhHAN0A3vgG6Ab/CIhEgG5AN6EQESAbmEYI4RABvYRoRABuYRgDehEQiAiIRABvcA3QiQDfwjwDfCICPCJCJCJ4RwiYRwjBEwDehEYRgDfCNCOEQEQEcI+BagAd4FrAscCxAswLfwLAFgC1wLNVMQU1FMy4xMDBVVVVVVVVVBlBkwO3wZAZMIz//////+DJwO0IwI0DsA7cGUI34Rn4RgMuEZgywZQjAZP/hGAcmDKEYDIB28GQGQGXhGgcgRoMgRoHYBywZAZYMmBygyQYFCIUDChQYE4MCgaYJ/gwKEQsGBAiEBgXAwgQLrhdcGwcGHBsGA2Dgw4YYGwZC6/hdYMMF14YcLrYYcMPDDhdYGweF1oYb4MCwYEwYEgwJBgTCIQGBIRC/BgQDCBcIhAMKFhEKDAsGBQYFAwgTgwKDAoMCQiEgwIBhAnCIUGBQiFwiEBicIhAiFhEIgIoBooGieDPA+4GeDPCP//PkZOobXgrkAEY0jjazieQgBKKIBGgyBGhGhGgyAdoMmEaDIB2gyhGwZYMsI0GSDIEaDKB2QOWEaDKB2hGgygcoHYBygdkDtgygcngyAyhG4MgMgRgRmDJCNBkA7QjAZIRoRoMuByhGgyAyAyhGwZYHKByAcgMgRoHIEbCNCNA7fCNA7AZAO0GSEYEaDLA7cDthGgyAyAyQjAOwGUIyDKEYEaEYEYEaEbA5AZQZAZAZIMgRkGXBlBkCMgyAyQZYMngcmEb8GUGQIyDIBywZAZOEZhGBGwO2EbwjcI3hGYMqTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqquDqz8GMDQIvBj///+DGDEGAMAifBj8IuEThFCIEQGPCLwiQYBFCKESDCETBhhGAZGEZ4MjgcSEY4GoRQigxCIEQGPCKBiBrgxwiBEwMIRAY4MQNMIkImDEGIRYMIRYRAYhFBjwYwNQYgwBgBh4GAMQiwYgxA0gahFBgBjgYBFhFhFCKEWBgEWEUGEIgMQYQMYRAMQigxhFBh4GkIgRIRYRAY4RIMQYgYhFA18IoMQYQihFhEgwhFCIDEGIRQieBiEUIoRQYhEwYDAFwGrBog0waAaQawacGsGiDQp9MZMVT3piJjJjK//PkZOYZBgjoaUJQ0DprofQgbhq0dep71PqeU69TpMdMVT6n1OlPKdJjpiKdFZkxlPKdJiJj+mKp/0xFPBoAmYaw0BpwJhDSBMQ1BqAmIEzDSGgNXDRDRhp+GsNMNAEyAmYagJkBMA1BpDXAmECZhoDXhqAmYawJjgTICZBrDSGsNAExDVDQGqGgNHDWBMIaQ0BrAmcCYgTHAmIEzDWGgNYaOBMw0BqDSBMYaA04aA1hqwJhw0ATKGqBM8NYEz4aQJkGoNMNIag1+GsCY+BMQJlDVw0cCYfDXw1ho4aQ0gTCTEFNRTMuMTAwqqoD37wjuhHf/////hGf////hHf/gycEZwRn4MnYMncIzsGTwOdOA507A507hGeEZ8GTuDJ4Rn4HPn4Mn4RnhGcDJwM3YM3gzdBm6DNwR3QjvA927Bm//Bm7Bm/Bm8GbgZvBm4GboR3gzeEd+DN8GbvBm6EZ+Bzp4Mn4HOnBGfA588IzsDnTgZPCM8Iz+EZ/CM4DnTgOdPBk8Iz4RJwGTidBi7AycTgiT4RJ8GE6ESdhEngZPJwGTieDCcESfwYToMJ3AycTwiTsDJ5OhEnwibwYb+ETdwibwibvCJuwYb/4RN/Btf/jYGyNv8bHLUtSzE0/LQBW//PkZPQcHgjQAFKVrjfDmgAge1eMLITcshNy1LX8si0LUTQtCyLQTUteWQmvLItSz4mgmnTJops0umEymDSPsnR9HwfB8k7Pvn0fAvwtcLXF/F+L4vQtQWuFoC0BaReF7AeBfwtcXBdF4XheFwXAtAui9C1haRdi6LwvirgnUE6FcVBVisKgrCvioK+KoqiqAhh3AQFXhwVYrFYCWHMOioVAI4dFWHPDgCAdDgdDmHcBIBEO+HRWAiKsBMO4dFQCAdATw6HBWHBWAgHBUHMOf/gICsOCoV4qw7+KxWHA6KhVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVC11Fz1+NP+/Xkqpr9OfuhQ6lZNWf+XsZc/si+KNoOj/Ntai9j7IISgZAklTqQhjToNTeQoreRdaSDODWvYAVFaWWkQmVuZPP8bRUzq896vc+XS6mm5gnnW7JLnV4z9N5XnW4k86x+uyHyxnWkmdborzraff2SvOtvljOtjd/5XRW8MivOsry/K3gUzrFPS1eFTOttTsul1+lLGdbV3c53h51mdbK7xPOr1SpnWlM63kedZnV4XPK86onnW7myrnWTmRTOqascoabXd/L+yuzS95dv1efjhl92ntYyTuIb6wuWRZFmWRa//PkZOcb/gqMACDf1LTLofggA9qc/gKRZiblqWYm3E24moSQnR9BJj6JwfBaFqWZZFoWvLUshNPxNuWn6bTZHgozRTSaNAY5oGjFQVgTkE6FUVorioK8VBXBO8VRUioAhxVioK4qAnIrYrCqKsVRVBORXBORVFcVcVwTgVBUBORUisK4rCoKwrxXFYE4FYVATjFcVhX4rcVBVFQV4rxVFSKwqCpFcV+K8VhXFYV4qivFUE4FaCdivBORUBOfBOgToE6FUVYqisKgqCtxWFbFQVxXisKgqRU4qioKuKwqCvxVBkH/4Mgf4Rg4RgfgxZBizhFYEVuDFvhFbBi3CKyEVsGLf/4MgAxaDFoGsWYMWgaxYBrFngxaDFnCKwIrAYswNas+DFgRWYGtWYMWBFZgxbgaxbgxZCKwGLIRWgxZCK2EVmDFmDFgMW4GtW8IrAYtBi3Bi0GLAYsCK0IrQit4MWeEVgRW+DFsI9cDW9AYtgxZhFaBrVgMWgxaDFvCKwIrIGtWhFaBrFuEVvBi3hFZA1i0IrYMWYMWAxaEVkGLAisCKzBizCK0DWrIRg+EYIRgQjABkHwODABkDhGDwODBgyAEYIRoRvww4YcKILYKILfhRg5htjY4OQbQ2hNAH8su//PkZP8cRgjWAFAUYjwDofQAi9pcJry1E1LUsuWvE2E0LQTcB+E2LMTctQFEEcWnFYVwTkAI4rRWFYE6BOhWwToBBAQgnIrisETANwIiAb/COEQEbgG+EcA38A3wjhGCMEeEaEeKoJwK4J2KoARBVBOIJ1FWKoJ0CcCuCdRWFcV4rioK4rAnYJ2K0V8VYr8E4xWFUVBVFQE6FXBORWFSKorxVFcVwToE5wTvBOoqwToVIJziuKwJxAQgnUVBUgnAqQCaCdxWirFaKwrRWFcE7FfFeK4rgnIrAnYrCoKoqgnAqCrip4qgnCr/////8Iu8BjvP4Ry5/8Izggc4Zw4RnD/hGcP8GThBk4eDJwgycIMnDwjOD4MnBA3eu9hF3kGO8gx3vBjvAN3jvMGO8CLvAY72DHeAbvXe+DHehF3kGO8gbvHeBF3oG713gG713vgx3oMd5BjvAi7wGO9A3eu8BjvMDd470Iu9wN3jvQY7wGO9wN3jvIRd4Bu9d6Bu9d6DHeAbvHewi7yEXecGO9BjvQN3rvIG7zykGO9A3eO9CLvYMd6EXegx3gG7x3kDd470Dd472DHewY7yDHeAKomwmhZFkAof8tCy4m5aCbcTUswFYsy0/LQTX9NBqBgJgYaY//PkZPcaTdCuAFgWlkI0DfQAe9r8Jxz6CShr8++JsArgjxNBNC0LQsyyLMsgRxallyyLIsi0LUTUtS0AVwFPia8si0LMTXiacsxNizLMTYTcsi1LMsy0E2LUsuJqJvxNyy/E1LMteWgm4mpZlkJuWRZFmWnLQTfgncVATkVcVQTsVIqQToVxWFeK4rwTmATCsCcAnQJyKoriqKwrxWiqKoqwToVRWBORWBOBVFSKgq4qAnAqAnArRVgnIJ3FYVQAgCriqK4qYqivBOsVoJwKgJ3FYVBWFfBOIqCoCcivipxUFSCd4qRV4rCvFaCc/BOhW8VxWFUVhX4r1eX/+DHgaYMOEX/CJgwwYQY8GODH/wYf4RAiQiAxCKBj4GAMYRQiwYcGEGMIoMfhECIBgEXAwCJhEA1BjhF+BhCIDEGARYGoRAYgxCLwYeESEUGMDEIoGAMAiAwBiBrCJ8GMGGEWEUGIRYMAYAxCKBiBgBqDDA1wiBEBiDAIsGIMANANMIoMAYhEBh4GMGMGARfAxBj8GAMANYRAYBFAwCIBhgYhEwNQMYGIRAMAiwNYRQi4RQYwYgahEBiBqBgESEUIqa6Z6bTBpGkmUwmkwaZpJlNCkifmkaaaBymgm0wmRPxSDTTa//PkZOYYTgboZUAQIkCEFgAAe898YTZpJtMJhNilphNdMJhMGgmemDSNJNmkaX6aNJN9MJhMc0E2mzSNJMpg0umU2mDS5oJlNJtNJnpg0DSTBoml0wmzTE8TRpGgm00mkzzRNNMJg0jQTSb/NFNdNGl02KTzRTfTPTSbTKZNLphNJpNmgmUymkwaaaTKZ/TSYTBoJr/ifptMpr9MJlNptMpg0kymumEwmf+mEwmOmkymTT5ppv80eaHTCYTHTSaNBNJtN80/0yaBoJo0k2aPTPNA0OaSaTJoplMJv9MgBAB4MBUGwbwVwUBkFAYDAU4NBoMBqhAELk//h/y1/vz6/6zMnEglwqnIsVSHBzAMMIqXiLgxS8ucoLCKl7VwipeupwYpeAxS8Z22hSl4U+qE1L2goKUva1GUJqXqwkpeAxS81IQpS8smBqXql6E1LyEVLxdEJqXoSUvAmpeJhFS8rpH3CKl6EVLxPWFKXgDUvVL1LCal4kuDFL2EVLxFlPClLyEVL2FKXhdwYpeswGpeqXkGKXqLAxS8wYpeqWk8KUvATUvQYpehJS9Bil6yoUpegipeZT2x1vN5NR2X3KrRuXjFmaS0AUCyE1BHflmWZacTYsvy05ZgAIs+WQCqJoWZ//PkZOwZ+gaYBgbm6EQMAfQAe9r8ZCbiaFkWv5ZibialoArlryyDtCSnyfR8hrE7PpNmiaIxDTGKafTJalqJoJoWQm4mnLUtSzE1LUsxNyy4mpZlqJpy14mgD8WpagKvLIEcJuWnLItBNhNhNxNgH8tSyLMTflmA/iaCaFqJqWf4mxZFmCdCvFWKwqivgnQJzFfwToAIwqgnOKgqCoK4J2KwqisKwJwKwqCqKgJwK4rYqirgnIJ2K8VhVwTmKorYrioK4JwKwrRWFQE5FUE6BOwTgV4qYqiuCdAnYqAnMVBVFUVATkVBVirioKoqCviuK8VwTjxWFfivFUVxXBOcVuKvFaKoqiuCdeEW3Bjb/gxvhFvCLYGN8GNwi3CLf8DbtuEW//CM7+DG+EW+DG8DbNgi3CLfA2zYItwY3gbZuDG8GT/Bk+DJ+DJ/hGdCM+EZwMnQZP8GT8GToRngc6dBk4IzwZOBk8GTvhGdBk+DG8Dbt8DbtgY2CLbBjYGNwi2A2zYDbN4RbhFtA2zcDbNwNu3CLaEW4RbeEW2DG8DbNwY3BjYDbNgY3A2zYItwi3CLbgbdvA27YGN/CLaDG4RbgxsDG4Rb8ItsI7oR3cGb00m0wmTT6aTZoJgUpMc0kwaa//PkZNcYqeLUAAAUHjw8DgQAe88cYTXTXNBpXiQdfLVpLJoaCSJs0TQNAbRpJpDWleaGlDmlfQ9fQ7tBZoa0IeOw3Ccq44TcHgrufDVzQNA0Om0wmDTNE0EymkymumU2mU0aSY6ZE8NFMmiaaYNDptMGn+aJpdNptNps0OmU0J50wNtMGmmEz/zQTJpppNplMJlM9M8FAYCoKAAApgqDIMACwAQbBsAMGQAQaCkGg0GgyCkGeCgNABwAAUgrwA+CoAQNAeHCAOAeAyIQHBwgDg4QYDAGgMEEOEAeA0Q4DxAHh0PEMGYMBsFQYDPgoDMGQV4NBqryAZfhGfwjMDl4Rv/wjcGT/4R/CPBH//hH4H3gzv4M7A+/gzoR4GdBnAf+DPBnwj4M7BnwivA1QIpCKcIpgaqDFgaqBogMWBqgGqgxQinA0XBi8IqEUCKBFcD7/CPwj0I+DPA/8GfBnQZ8I+EeCPwZ4R6EfhGcI0GSDIDJCNCMBkgdsIwGQDkBk4HIEZgy4RoHZwZQjcDtCMgcoRgRoRgHKDJBl4RgHIDKDIEYEaEZgyYMoRsIwGQGQIwGUGUI3A5AZMI2EaDLBlwjQZQjAjAZQoqIqqN+pypx/qNIqoqqNKNKcqchwGrCAPqN//PkZOsaCgjiBUZRnkhEBfAgw9tw+iu1RUqp2qNUNalOVG1GkV/U58sLU48sLLCiwFU4hAYA+qQQgasVhVIYQNWKwmAKpvasNoHIDm4OQHIDlGwNgbH4D+JuWQm4mhZFoJsWgm4I4TcbA2xtA5ODnGyNoHJ+NgHKDl/LMBXLUtS04mvLQteAqCaCbFoWQmha8bQ2Acg2ht8bI2RsjaGyNrjYGwNvjbByja/GxFYE4ipBOIrwTiK4J2KuK8BAK4rAnAJwKkE4FYE7FUVgEIqgIRVBO4qRXFQVBVBOMVwCcE5itBOoqAnQqCpBOIrxVBOoJ0KwJxgnQrCuKsVBXioCcCqCdAnYJyKsVYqipBOgjwiAj/8InhH4RMIkIioAC4RiJCMRP////CNk//Blkv4M6F8I9C/8GWT/8I2SwjZOEbJQZZIGWShGyYMsnwj0P///CPQ/hGyQRsn8I2SCNkgOyVkoMsnhGyQMslCNkoMsl4MsnhGyXCNk4MsmEbJ/wZZP8I2SA7JWTgyyQMiKDIieEYiAcRIihGIkIxFwZEUIxEA4iREgcRYihGIoHESIkDiJEUIxFwjEQIxEwZEWDIihGIoRiKEYiHcYJRIr9kzDmO5cIaApXE/NA0TTTKZGym/0//PkZMQWjdCsAwAWCsQ8Cfwoe89cyaXTKZACgKxsmybQFQCyPQPUbRtA9x6QAoegHKmRtClpk0RSkwaCYE/GyaaZ6ZFJTaaTCbTabTBomgmk2mxS0x0waSaTI2gcgOcT0T5MiedM9M9NCfCeGgNhMJlNJoT1MdNJhMjaNPptNGkmhtpnmgmv+KQmRSE0aaY6ZTKZTRoJg0U0aBopg0emU1/xPzTTaa5o80DRTZoJs0TRNEUhMikJs0P0x0wmkwmUymkwaKb5pppNJg0OaInhpGgmeaSbTBp9N/ptNJo0DTNAbOCkGAwGABgA4NgwAAAMAPBgAQKAyDAZgoCkFINAABWAEDAUBTAABgMBTgqACDcGAAQYDAUqLUlVt///+Bj4MIRcGH/hE//hEwY/wi8GPBj8GH8IgRcIv4RYMQi+DAIsIsIn8GHCLCJCJ/BhBgBpgwwifhFhEhF/gwCIDAGIMIMAMQYBFhFBgDH4GAMQiQNAYAwwYBECIAMIAMAAiHBgAMIAiAIg4MABgABhADAhEAGAARCBhCEQhEIMABh6EQAwIMABgCEQwMAQYD4MDCIcGACIQiHwYGDAhEOEQ4MAENB8hJD7PsnXJ0fZ98+D6LItQR3PgnZHmgPYYRopk0xj//PkZMkU/gLsKkITrkL0CfzIetvgJtNdNGkmkwCPLITf8s+WpaFmApAjgFUsyz49jSTCaGMmkyaRZlkJsWpaiagKBZlmWomh8c+CdcnROj4Pk+Akh9E6DsJ0fJ8c+OTs+idk4J2Tg+j7Pr8nB9nwfAa59k7598+D74Sk+eEkFQdDmKsOhwBEVYCeAiAmAiHcBEV4CYCIWmCHF6FqC0haRcF4XYvxfF2LwvC+FqC0xcC0C/FwLSFoF0XBfi7C0xei8LwvcLQLoWoXheC0BaIWoXBdiNiMY6cZ8RkZxnjqOojAz4zx0HUdBGozjoMw6iMjpxdi+L4uC5F/xd/haIui/bZ/+DGBp4RYMQYgw8Ivgw/CJ4RfBh/hECKBgEUGODH8InhFwY4GoMcIgRIMcInCIBrBhCIESESBp+DEGARfhEA1gxBjBj4RAYQYgxgYwiYRcIgMAiAwBjCJgYAawYYRQMQMAYhFgagYhEA0AxA1A1CJBhBgEXwMQNAihFhFAxwYAwgaYMPCJA1hEBiBrwYQiwYwiBFwYhFgxgawihFCLA0gYAwCKESBoBpCJ4MIRcGOEVB9ALR8BJj7/PonB9HyEoJwfZ9E4Dt5OeTnlqJtxNAH7nwfHPonJ8E759E6PoJI//PkZOAWKgjoZUAQYka0Ffgge9VcfZOCdE7J0To+Cc8JWTo+D7J0EqPoO0+T5PsJSfJ9n0TkJUfJOeTknPPo+z6J2Ts+ycE759/k7Pg+z5J2TonBOeTkJUTg+T5DtJ0Tvk5Pjk5DXPg+idH2HYfR9E6PgnR9k5JyfZ9cnR9cNYJSfROidE6Ps+Cdn0fB8E6DtPs+CdHwfH5OAlR8nyfB98+SdE4J0ff5OidH2TknfPkJMfYSg+Cd8+D6PsnP/JwTk++fYSQO0+D5J0fZ8HwTjn2AWDgdAL8ApALQCkO8GACwMgyAVBiAVhzwY4BeDIMgFMOh0ArDgc4BeAV4cgFsOhz/wP225HGw7wCsO4M8AqHP/+DEGQ7/8OgzgFoM4Bf4MhwO4BT4cDmHcGfDnw78GcVhUFTFXFeKoqYJ3isKuKkVgTsVoqCsKwrCoKsVQTqKorYWoXhfxeF/xdi58XOL4WmLnFYVQToE4FXiuK0VwTnFQVRVFcVhU4JzFfDgdhzBnDuHfALgyDAMQZBgGQCgBUAoDAMh3BkAsDMGcGAYgxBn+HAC0ArwCwMAS5adAry0yBSBfoFBVaKqKwVUVrRXUa9FUOEqVUjV3ySPLkvkzlNlNn02E2S06pvVKWACECpW//PkZN8VDgj+zymq5krb1ewAxJvkqe1XysDVFSqlVIo2o0ispyFVoqKNIrKcqNKcKcFhSjaKiKyKhYWiv6nCnCKijajSnPorKNKcKcqcIrqNoqKNqcKNoqKNKNqNKcIqKN//orf6BSbKbKBSBXlp0CvQKTYTZ/0C/LTxFxFoigioigCLC4cRYRWItEXC4cRcI0IoFwwXCiKwjQXC8LhRFcRcRQRSFwoikRcLhxFRFguHiKRF8E7FYVhVBOgCYVRUACKKgqgE0E6ACJFYVoJ0CcgnQrAnMVwTgE6ioKoRwDdhHhG4RARgDcCMEaEYIiAbwRIRuESEcIwRwiYRwjQjBEgWoFuBa4FngWkIQQigwhEwigx/CL/4RfCKEQGP/wYiEUwYHwYGDAwYAGA4RCEQBEGB0rCNcGU4RrBlcIsGGDCESBiEWDCBhCIEWBiDAGHCKEUGEGEGMIgMAiwigxCIDADQGIRfCIEQDXgYYRfBgBoESEXwY/CJCKEQIsGIRODEGIRQYgw8IgRYMMGAGGDEDGDAIoMcDQIkGMGGBrgwCKDAIsIkDUDWDGDDA1hE4RQMQYgwBhhFBhBh4MAMYRMIoRAiAxBjhF4mhZFpxNBNy0LQTUTXhKglR9FqWpaAP5Zi//PkZNYXkgTkGEJwlkXcDfQAe9r8bCa/k5JwTriacsizBHE6CSH1w7efHLPgjuJqWnLITYTX8tRNAH/ialqJuJuWZaFkCO4m5aE7J2TonB8E559nyEnJyfB8FmJrxNxNhNS1E3LT8sxNC0E0LTlqJuWQm3E15ZiaFqWRZiaCagP5aCblkKoqCsCdioKoqwToE6FcVwAhRWBOIrCpFbgnEVRVFUVIJ2K4rAnIqioKgrcV4riuK0E4FcVQTsVxUBOoJ3FUE7itFYE7FYVRXFUVwTkVoqAnYJxBO4rReF4XYWsLWLoui4LwuC9AdsLQL0LQA9C8Lgvi6LguBahfFwXAtIvQQ4vCqKwrxX/8E5xXit4JwKzBnwj+DF+F1guvBiQYkDRIR8I/gz8Gd4R/wYsGLBi8I8DPBneDPBnwZ/8I8DP8I8B/0Gd+DPA+8I/+Ef+DOgzvwj4R/hHoM+Ee4M4D74M+Ef/A/7gfcDPBn4R7BnfCPgz4M7Bngf8DPwjwR6B/3CPwj0Gfgz+EfBnhH8GfwioRQGIBqgRUDVAYoGiBFcIoBqoMWEUA1UDRYRUIqEUA1WBooGiAaqBogRUGJwigM8I/gz+DOCPwj/Bnwj3BnBHgZ4M4I+DOhHhNCz5aiaCb//PkZM0YugrgAAASBEUEBfQAe9rclmWompZ8shNyzLMsy1LMBUAfhNxNicBJCcE5J0JpyyLMTcBVLXloCO5aCagKACiAqflqWYmvE3E3BHlmArFnxNRNC1LUBS5aFoWhZFmWR8k5CTnxz4PonZ8E5Pg+j4LUshNQH4TYtSzLMshNBNhNSyAViyE0FQE4FYVoJ0CcRUgnYqisKoJxFWAhiuKgrCtFUE7FQE5iqKgqRVFWKorwTsVxVFYE7FTFTBOxVgnAqRXBOPisK4BOK0VoriuK0E5BOxUivFcE5FYE5FQVBXFQE6FQVBVFYVxWioCcCoLovi4LoWiL0LSL+LouBaIvBahdi6LoWgEMFoC1hacXxdC14uipiqKn8VPFbiqKsVb//Bm/+EXgx4RdhFb///hE1/8GLP//CKwIrQjoGa/wPewZqEdYM1wZqDNAetgzWEd8GagzYM2DN4M1wjoI7Bm+DNhHcD3rA9awZuEdwZvCOwjsGaA964M1A978I7hHQR0DNge98I6hHYR1wZrBmwPWgPWwZsI7wjqB63COvgzQR3BmwZsGaget8D3rCOgZoGa4R1gzYM0EdwZsI6CO+DN4R1wZsD3oGaBmwjqEdAzXCO/4R0DNAzYR0WgI8TQT//PkZL4XFgTcAE6Tekf8EfQAe9t8YTXiagKwCsJuWXLMTUtC1LMTT8TYTUJP+fAdomomoD8JuWoCgWoI7iaFkJqJqfZ8hrk4CSE5Pk+Cdk5PgnBOT7JwTg+uWZaiaCbcsgFAsy0LPlmJsWYmom5ZFmWpaibiaAjy15ZFkWQm5Zll+JsJqJvy1E0CThJz65OQlJ8H2TknZOT759k6J3z4PgTQTcsy0LITflmWfLUsiyLITYTcTT8syzLQsi0LMEcWZa8tSyE1LTibibFqWYI/8shNCyE1LQsy1LUTUBTLLloWXLUsiyLUtBN+JqJvy1E05Z8TcsxNeWn/LTnxydHwfZ9n1ydk4PsnHJyfR9E4JwTgnB8k4588nB9cnR8c+D7PjxV4q4r8VsVgTgE4/itFShX/xV4rirxVFWKoq4qfxX8E6xVxUBOYrCtwTvwTj/xV8E5/irBOsVuKwqRXFTFQVorCrFf/xWioKwrCtioCcxUFUVAToE4FUVxWFQVhUBO4rgnUVIJyKkVgToE4ipFUVoq4qisKsE64qCoCdxUFUVxXFUE78VxWFQV4qiuKgqiuK4CCK2KoqirBOATsE4FWK4qxVFUVhVFYE4gnIriuCcQTiK4rCoCdCtirBORUiqK2//PkZLAWsgzuADQNNkZj/fjIe9r8K/FXFUVwSE5aiaAKgmhaFpxNQkp8n3z5PsJOGsffLQsyyE1LItS1E1Af+CPLMTUTfibFmJoWQmxanzydHwTsnASknBaCalqWom5ZcsxNyc8nASsnHDt59BrhJgkpOicBKg7D7JyfZ8E5Pk+Cd8EeWXE0LQsiyLQtSyLIsi0LUTYsy0E3LITQshNiyLUsiy4I78shNy0LMVcE6ipgnArRVgncE4wTsVIrCqCcCtBOYrwTgE7iuKwqCoKwrcE7BOQTqKgqiqFpBEC1gPYD3F0X4WoLTF0Xxei6FqC0BaAtQWgXxdwtWFqC0haBW/FQVRUBOBUFcE6ioCcAnEVRX4rYrxWFUVBViuLsXgtAuC6FoBDBaYvi7F8XxexdF8XhcFyI//gx//CJBhgxhEwY/+EXwYgx8ImDH8GPhE8GPhEwigwhFwNQNQNfhE+DGDAGHCIBrhEhEBh4RQMAY/gYBFBhhEAxCIDCEUDEDHBiEUIoRQY+DCBp4McGEIgGgMcGIGMGIGIGgRQYgxCKBiBjBgDGESDADWBgEUDEIuDADWBpBiEUDEDDgYgwBgDEDQDUGIGgRAYQYAxCKBhCKEThEBgBiEUGIRQMQiQiwNAY//PkZKwWNgjoZUAQREakFfQAe9t8YMfwi4GBaFoJsWpaFlyyBHctCzE25ZiaFoAocsy1E24Sk+idk6LMTYTYTQsyyLUtCyLQTUswFYJMGuTg+CdHwErPotAFAsuJtxNCz4m4mvBHiafloWZZ8YppBqzTNI0jTNBMpg0jTTZZFqWfE3Af/xNf+WomhZ8suWZZCb8tC1LQtS14m/LQtBNhNOfR8hKCc8nHJ2EqCUE5CSHxydk6Pg+D7Ps+Sdk6LUTQTcTcTctSz4mwmha8TXlmJvyy5ZiaFl+WpZFoWZa8TQshNCz4mhalmJsWfLQsuWRactBNRNC1E1LLlly0E2PgJWfR8h2H2fJOSdnx+fXPs+T5PgNbnzz6Po+T7JwTk+z4PonROglJ84qCvxXxUirFX4q4qeCd1f8InCI/4R/CP//4RMI/CMEYI4RAR8I8IjCJ4REI/gG8ESEfCOERCP4R/+EaERCPCNCNCI4BvQjYRMHINobIOfjZBzDZG3xtja42gcw2PwcvG2Nng5+NgbY2wcn42htDYGwNrjYGwNsbX42vxscbI2gc3Bzg5Qcg2uNvjaGwNgbI2+Dl4OUbI2Qc42RsjbBy//g5eAboR4RwjQDeCP+EcI8IwBuwjwjBEBEA//PkZKoZMgrqADXt9EV8FfQAe9scG+EThEBGCMESESEbhEQjwjwjwjBHCIwiQDcCNCI/hHE0/LQBSLITf/lqWoSvk7LT8BWLMtRNAk58E7Po+CyLQTcsyyLUsi0Afi1LUTUTUtBNS05aFkWpZHzwkoSgnB9HwfQSsTYsizLQtRNRNgFf/8NcJWEmAWCdn0To+T4CUHyGtxNiyLT/lmJqJqJqWgmpZFqJsWgmwmwmwmv5ZiaibiactBNv/yyLTiaFkWZagKgCmJqWQmgmom3E0LTibAKfE0LLiuKgrYqipBO4JzFUE5BORXBOhVioKwqRWBOYJyKkE6BOIrYqCqCcxVxVFUV8E4FSCdcVgAgCuKkLTBDC6CHi+LwuRfha4uC+FpF8XQtAWgB2wtAWoXBchaBfwtQWnFSCdxVxXFUVhUFYV4rgnOK3wTiKir//1eDCsf//7/+wOYd///ei/f6lmiqGXpyOlCSRm+yP3UtDhFIzqBhwCFHAGFHABYGcAnAAMOAAYcAAw4BYKOAIROANgicAQYcABE4AAzgE4B+1wmcAwYcAK+sDOADgFLCJwAlWBnABwABnABwDWraETgEDOADgDBiRkgoJpGaP+64RSMoRSMGBiRkkwMSMlq7AxIy4//PkZJUYEgieBFw3fkL8FgAied8AROAAicA8DOATgAGHAAROAFwM4BOAGBhwADDgAGHANQUcAgicAYROAfgw4AIkbPNNNpo0TSNBNJgUs0l7lomEwmRSOaRp80zQFK4nvTInnTEGgwGwAwYmOmkyaInppJpMJg0k1+KUaaaTCb42U0mBsGiaSaNNNpo0OaKZNE0jTTSY5oGmaZpJrphM9MGkmDQTCZBzpg0OKR+mBtdMJobfTSbTfG2KSaBpGgaZomiaBomn02mOmkwmjSNPpjmmaKZNA0zSNFNCeClJkT40DTTCY5oJk0kyaJpdMppMdMdN80TR6ZTXTfNJNmimumem+aKZTKaTaaTRops0kwaZppk0+aSa6ZTKYTfTfTPTHTKa5omgmEyaJo9NmkaRp/pnmmaf6aNNMplMplMdMpv8TxMJlNplNJn9MdM1OM6hWa/EjiRiRiO/xIcSP+GgCZQ1+GvDRDV//4aP///4I8EwTwTBLwS/4AHgnBHBHgiwR4JgAgS4IwAYPA8ADg+AAAAFwfB4L4WADC2AGAGFwsFwuD2FgAcAPC+F/B8L4X/B7B4L4WwuD+AGDwXACAAC2D2AEFgfCwAAAAXB8LhcLeDwXCwPYPA+ACACD+AH4XwA//PkZJMVIgb2ejVLxkBMEgTIe898vwv4X/ACB/C4WwtgBg/gA4PA9gBeFhLRTXTRomkmP0yJ6J+mPy0NA0OvibNDQmfzTNNMjaFKNATxMiemiaRoGkmE2mkwmTRTHNBMGiaCZTSZTZomh0PaV9fX2hoX14kzSmOaCY5pJr80U0aPTfNFMps0jSNJMmiaSaTKb6aTKYNLphMpg0eaJoGkJ8aBoppMppMJg00xzTTabNFNJpNJpNpnpg0DT6bTRoppoJMWrSh/690NQ5paV5D2le/LND2hoQxDF/rzR1/r/aWhfaWleQxfXmheaevNDS0tLQ0ryGoch/X15D+vLy+0oc0ry/19DUOXuvIc0oav9oXkNX1/r3X18QCGHQGQHB8PiAPAaHgPDsBgcH+Hqv//+DJ0GNuEW4MbQY2wZO4Rn///4R34R3Qjv//8Gbv//8GbgZuwZvCO4GbsD37+Ed3A586DJ4Rn8DnToRn8GTsGT8GToRn4HOngyf4HOnBGeDJ0IzgjOCM8DnTwjOgydwOdP4RnYMncDbtwY2A27cItgNs3CLeDGwMbwY3CLaEWwRbQi3A27eDG0GN4G2bBFvA2zcItgY3A27YGN4G2bAxtA58/gc6eDJwHOnAyfCM7A588//PkZLMYngTSAFAUhEYcDfggw9V8DnzwOdOBk8IzuEZ4MnAyfgychsy7F3oE13Nl9sy7myrsL6qqOU5anCqkHqNDI3KVUTEU8GNU7U6gxyHKchyVV/Xa2Zspfds3rubK2VsjZmztk9djZi/TZV2NnXYu0vsm0yaBoDZNEbA2k0aKZNjmwbH/Nvm2bRtGyBVArD1G0bQPUevg9h6/+PRzZNkCrzZNgesegesermyPQPXzbHpNvm0PQPUPSbJs82TaHqAtj082h6DaNn8eo2DbHrHpNjj1m1zYHqNo2jYNnmwbPNgek2ja5sj0D1m0bJs80xtJlMdMCeps0U0meaaa6b5p/mmmU3zRTfNFN/pgHPzQNPmkaaaTXTKbTRoJk0zS6b/NBNdNJlNGj02aH6Z4IgAEEYJ4I+CMEQJcEUEXBOpHDX/w1Q0Q1Q1cNWGvw0Q0/hp/AmIaA0cCYhow0w1/w0hoDRhpw1w1BrgTLDXw1BrhrDQGgNQEzAmOGuGiGgNfgTHDQGoCZw1w0BrDWBMIEzDVDTDUGgNfAFwGjBrg1A1YNcGsAXAaQaABcBqg1g1QagaINYaoEyw1Bow1YaA1hoDSBMw1gTICYQJkGrDQGoNGGmGsNcNQawJkGuBM4aIa//PkZKAYngTsATQNQkKMFgDifh7AYagJkGsCZ+GkNWGiGsNAaYaOGgCYgTENQaw0Yaw1Q1Q0/hqw1BkAfmkaCb6ZTCY6bNBNLwmqGA5fzSTCb/lgwXOmMmMmTQ5pmkmUwmkymfzRTaZFJ6aNM002NrppMpg0kwKQmE2m0yKUaKaE95o9MJj9N9NJk0UymOaSaE/TabNNNmmmk2mU2aHTKZTCaNDjaTJoGimkyNvpk0TRTHTf6bTRopg001+mU0aXNBMjYNA0k2mjR5pfps0U100mUz0ym02mDRTHTaaTRpplMc0kz0ySA000mDSTKbNI002mzQTHTaYTf//NA0zQTBodNJk0UyKSaaZNJMprmkaP5oGmKUmEymUyaCbTHNBMJlN80DRNBMmkm/00mUwaZpprplNpvmiaJo80+aSa//TaY/6ZaH//wY4ReEX4RIMfwiAxBh/BhCJ/+ESDDwYcIn+EQIoMAiQYAw8IsGIGGETBj4MP4MQiAxhEAwAxAxBjBiEUIgMIMcDCDAGIMcGMDEGGBgEUDTwNfAx4MAiwiQYgwBgEUIgMIRAiQYhFwYAwBhA1CKDEIoGoGgMQi4MeDADGEQIkIgGMDCDAIoMAiQiAYwYYMQNQigwCJBiDEGAR//PkZJwV+gzoZUAQRkZsCfQAe9tcQYgx8GEGIMQiwMAY4MANAMcIoMSyE1E1/LMTUtCz5OD5PkJJz5Pk+uA/FqWRaib8TUTUTQtC05alqWYm4momgI8TYsxNCzE3LUtQFEsgFM+z6J0fB8nz+TsNcnB9BK+Tk+g7CdhJT6LTiaFqWYI7lqWoCvy05ZlnxNy0/LUshNBNvwR4moCj+Wv5ZlkJqWpalkCOE1E1LQsiyLITUBULLlqWZZlmJsWhZcsi1/4CiWpalkJqJuWvLXlkJsJpyy4mwm5ZlmJuWXLUTQteWgmgmwCsJoWfE3LMsiyLP8TTlkJuAolqJryzE1LTibCbloJuWhZFoWYmxZ8TcXIvxeC0i+FrF0B2i4L8LSL4uBaIDyCHF8XRfF6FqgiwtIuYWoXIrYqAncVvxVip8VIqCvUxPqtFbFf/4q/8V/8V/iririr8VATjxXipxWgnYq+KwqfFTFQVoq+KsVBW8VhUisKuK0VRXivFYE4FTBOhVFcVRV4riuCdCuCdCtwTiCcCqCcgnYqxWFcVIJwKsVxWisK8VxVgnArYqRWFeK0V4qgnQrgnYrfBOoqAnAq4J0CciqKviuK3BOoJyKsE4FUVoqisK2KwrAnArgBAFSK4//PkZJ0VagjyJgGtbkOkFfwAbh4AqRViuK4J0KgrCrFUVxVjOEeDQgjlcT4T40xtjaNI0uaI2QciGNJIl4kJZtCGIaSckIm6GL3TQ2zRTY2UwmjSNE0fxS02aY2BsJs0/+mzSE8TQpHTKZTaaG0aQpApZp/mmm+aHTfTCZGwNgUk0E0aRp/ilJlNJgT5MmkJ9zQNA0TQTH6ZG2mk0mk0mk3zQTKY/G3zQTHTabTBpGgmU0aKaTJpJpNJtMphNjYTfNE0emkymE2mEyaCbNBNfmkaJpdNJnpg0k0mDTTCbTaZTBp80k2aCbTfNE00yaCb6bTZoplMmmaKZTKaTJpmiaHTXNJNdMDbTab6Y6Z6ZNNMJhMJhN9NJrmim02m0ymU300aPTSa6Y//5pJpNdN/9NppxWxU4Jx/xWxU/xU4qcV/ipiuKwqxWFbioK/8VIqivFTwTkVgTkVor4JxFXxX8VcVxUFQE4FaCcwTvBOIqwToVuKwqCtFUVYqxXxWFeK0E7FQVYrwTnwTsV4rCqCcfFaCcRVFQE5gnAr4JyK4r4Jz4J0Koqip4rCvisKoJ3xWBOME7iuKgriuKgrAnAqgnArxXiqCcgnYJzFQVQTmAEIVYrwToAIYrwTiKkVQTkE5//PkZK4XGgzsADQNAkIcCfwAe898FXFTFYVxXxUFQVkzzS5oilg5TTTY2kyaJpJtNGgJ8aKaTQ2k2aCaNI0eaSYNJM/tKHEiQxfJG09MmgaSYTRppg0TRNNMJlMptMCfppNprmiaA2jQNLmmaRppk0jRFLNP9NJhMGmaQpZpJhNCkGkmE0J+mxSk0m0x02mjRTKbTCZ42EwaQpJpptNprmgaRpmim00J4mzSNM0kymkyKWmE0muaKYGwNjmgafTPNE0U0mUwJ7+mem01+J8mhSk2mjRTSb6aTCbNBM9MpjpjppMpk0E2mE2mE2mjSTfTaZ6YNFMcT1MpnprptNmim0wmE100aSaTRo9MGjzTTHTaaTfTSaNLpoFMAAFYNBQGwAvwAYM4NgqqkjaAN3d3d3etERNK5CZ/3Ctf8AaiAc/u7vaIn/+8XPv//+GDKv8W1/+AC8K4Yw+94xe940jgceOBwOcRaxGwH4EuNIjBfxazB8HhkwVjIAII/vDkjG/wAcJPeF5e98hNgSYLWMFvhZ73pX06aoehpmh01hMJtM9K3TKY9E10x+memvlIpZM9MUTCbShbUrtM+n5ophNZuXK+0wmemumMCemkmvc0Uwm/lJJlLe5oJZI0SyW6R0mE//PkZLcXlgrzECFvrEmMEfgAfh7k2aORpbTYUo9SBNsekGYNVKgqg6hrUXK4Q42DOwPWbILEzBSumEgkWJPU8S72G5wUuGDwguEKa1Q0UykS3Bn7FJNgg5qoEgpsGabBtGabZt7NrKCNgLYes1idmabBtm2bZsBRm0PQbF9mwPSPUBbMwzB6QojYM42ePTzbMwzR6TaNs1eBVNv81yDUJ2QYhJtD0m0PVe+x6T2M8HsbFwsh6B6D7HpugT2uZhO6HqZhmE7ISZhhkFNcghtmybBnnsD1Ho49ZtG2bZs5PVBc2EEepCaEHNjj1EJHq5smabZtmwbNEEPR+bJse9z2PY2T1SN0rdNJq6yXI06COvNJj9MGmkkGmUj7pI0TToNGlEsNEnCW10ymi5FtNFKpvps0kz0uW3aaTF00mTSzdNJu0KFYz1KjaGAhyoQCFGM//zFARgIUZ/oZpdCttay6M5drW1joSj6Ekk1b7J7R7aoQNlPrWBKLTTzOsGT5yYxLrtHTy2iUxEkES0HIBVD066VjGj31odPkkSjJtbWs6OIjKmlXHR9K5MTv5pdZolE10kk2lly74TFx5KTXeTGLrS6ExiucvJSSDUdXZm3NLn1rtYBCUEoRj77WOhCPc+g5//PkZJ8XPgzoAABMTrz8BfQyY9ONGxJULutaa1TE5LHxWEo+XecmMa3p0kqBCR6qOFaFUGpNJIIjqVi0ylBqJIkiSJIkmJj605EkSRJPetWAyVacmodBUVhGfrAZPF0AUrgRLNiqDU4VHo8h6HRObJJNdqlRBMFT0qdNE0WZhmay2tCuOY6oieWieianCnVSbzjd7SGhrLi6eUSeLcZTWqdML5PM50uOGJms9VqtYU6hrgrm4V0frUzTvYsiegR2FOkqUxSKdVCpmRCSkIAUZ4VPhqEKgFDU2VhUiIhUaIg0RAkTBYEjYBUbBMuCJgLAkCUBUinABgBE3/9EQqFRM0s0qzktk9ZFqqFC6RULE11JVDkd8Y1vVFOx9oUIpZ8Vnq5klkxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq"))},[fe]);const oe=R.useCallback(de=>async he=>{if(O.current!==null&&O.current.readyState>1){const{lastScan:De,contentBefore:Ie,lastScanHadContent:Fe}=de;if(he-De<q)ue.current=window.requestAnimationFrame(oe(de));else{const je=await Q.current.detect(O.current),Oe=je.some(Rt=>!Ie.includes(Rt.rawValue)),Lt=je.length>0;let Tt=de.lastOnScan;(Oe||be&&Lt&&he-Tt>=ne)&&(fe&&U.current&&U.current.paused&&U.current.play().catch(Rt=>console.error("Error playing the sound",Rt)),Tt=he,G(je)),Lt&&j(je),!Lt&&Fe&&j(je);const Vt={lastScan:he,lastOnScan:Tt,lastScanHadContent:Lt,contentBefore:Oe?je.map(Rt=>Rt.rawValue):Ie};ue.current=window.requestAnimationFrame(oe(Vt))}}},[O.current,G,j,q,be,ne,fe]);return{startScanning:R.useCallback(()=>{const de=performance.now(),he={lastScan:de,lastOnScan:de,contentBefore:[],lastScanHadContent:!1};ue.current=window.requestAnimationFrame(oe(he))},[oe]),stopScanning:R.useCallback(()=>{ue.current!==null&&(window.cancelAnimationFrame(ue.current),ue.current=null)},[])}})({videoElementRef:x,onScan:r,onFound:z,formats:s,retryDelay:S.tracker===void 0?500:10,scanDelay:m,allowMultiple:h,sound:y});R.useEffect(()=>(_(!0),()=>{_(!1)}),[]),R.useEffect(()=>{g&&(F(),W())},[g,W,F]),R.useEffect(()=>{if(!JC(v,k)){const te=v;n!=null&&n.deviceId&&delete te.facingMode,L(te)}},[n,v,k]);const ee=R.useMemo(()=>({constraints:k,shouldStream:g&&!o}),[k,g,o]),Y=R.useCallback(async()=>{var j;const te=x.current;if(te==null)throw new Error("Video should be defined when component is mounted.");const O=A.current;if(O==null)throw new Error("Canvas should be defined when component is mounted.");const G=O.getContext("2d");if(G==null)throw new Error("Canvas should be defined when component is mounted.");if(ee.shouldStream){await P.current.stopCamera(),M(!1);try{await P.current.startCamera(te,ee),te?M(!0):await P.current.stopCamera()}catch(q){(j=K.current)==null||j.call(K,q),console.error("error",q)}}else O.width=te.videoWidth,O.height=te.videoHeight,G.drawImage(te,0,0,te.videoWidth,te.videoHeight),await P.current.stopCamera(),M(!1)},[ee]);R.useEffect(()=>{(async()=>await Y())()},[Y]);const re=R.useMemo(()=>ee.shouldStream&&T,[ee.shouldStream,T]);return R.useEffect(()=>{if(re){if(A.current===void 0)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus pause frame canvas is defined");if(hd(A.current),w.current===void 0)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus tracking canvas is defined");if(hd(w.current),x.current==null)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus video element is defined");W()}},[re,W]),b.jsxs("div",{style:{...gM,...l==null?void 0:l.container},className:c==null?void 0:c.container,children:[b.jsx("video",{ref:x,style:{...vM,...l==null?void 0:l.video,visibility:o?"hidden":"visible"},className:c==null?void 0:c.video,autoPlay:!0,muted:!0,playsInline:!0}),b.jsx("canvas",{ref:A,style:{display:o?"block":"none",position:"absolute",width:"100%",height:"100%"}}),b.jsx("canvas",{ref:w,style:{position:"absolute",width:"100%",height:"100%"}}),b.jsxs("div",{style:{position:"absolute",width:"100%",height:"100%"},children:[S.finder&&b.jsx(TM,{scanning:T,capabilities:D.capabilities,onOff:S.onOff,zoom:S.zoom&&D.settings.zoom?{value:D.settings.zoom,onChange:async te=>{const O={...k,advanced:[{zoom:te}]};await D.updateConstraints(O)}}:void 0,torch:S.torch?{status:D.settings.torch??!1,toggle:async te=>{const O={...k,advanced:[{torch:te}]};await D.updateConstraints(O)}}:void 0,startScanning:async()=>await Y(),stopScanning:async()=>{await D.stopCamera(),hd(w.current),M(!1)}}),f]})]})}/**
96
+ * @license lucide-react v0.469.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const DM=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ZC=(...e)=>e.filter((r,n,s)=>!!r&&r.trim()!==""&&s.indexOf(r)===n).join(" ").trim();/**
101
+ * @license lucide-react v0.469.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */var MM={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
106
+ * @license lucide-react v0.469.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const kM=R.forwardRef(({color:e="currentColor",size:r=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:o="",children:u,iconNode:f,...l},c)=>R.createElement("svg",{ref:c,...MM,width:r,height:r,stroke:e,strokeWidth:s?Number(n)*24/Number(r):n,className:ZC("lucide",o),...l},[...f.map(([h,m])=>R.createElement(h,m)),...Array.isArray(u)?u:[u]]));/**
111
+ * @license lucide-react v0.469.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const qe=(e,r)=>{const n=R.forwardRef(({className:s,...o},u)=>R.createElement(kM,{ref:u,iconNode:r,className:ZC(`lucide-${DM(e)}`,s),...o}));return n.displayName=`${e}`,n};/**
116
+ * @license lucide-react v0.469.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const LM=qe("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
121
+ * @license lucide-react v0.469.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const OM=qe("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
126
+ * @license lucide-react v0.469.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const BM=qe("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
131
+ * @license lucide-react v0.469.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const NM=qe("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
136
+ * @license lucide-react v0.469.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const IM=qe("CameraOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16",key:"qmtpty"}],["path",{d:"M9.5 4h5L17 7h3a2 2 0 0 1 2 2v7.5",key:"1ufyfc"}],["path",{d:"M14.121 15.121A3 3 0 1 1 9.88 10.88",key:"11zox6"}]]);/**
141
+ * @license lucide-react v0.469.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const PM=qe("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/**
146
+ * @license lucide-react v0.469.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const XC=qe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
151
+ * @license lucide-react v0.469.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const gh=qe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
156
+ * @license lucide-react v0.469.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const jM=qe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
161
+ * @license lucide-react v0.469.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const UM=qe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
166
+ * @license lucide-react v0.469.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const Gg=qe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
171
+ * @license lucide-react v0.469.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const vh=qe("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
176
+ * @license lucide-react v0.469.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const e1=qe("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
181
+ * @license lucide-react v0.469.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const FM=qe("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
186
+ * @license lucide-react v0.469.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const HM=qe("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
191
+ * @license lucide-react v0.469.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const gS=qe("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
196
+ * @license lucide-react v0.469.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const fd=qe("Eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]]);/**
201
+ * @license lucide-react v0.469.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const t1=qe("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
206
+ * @license lucide-react v0.469.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const VM=qe("Laptop",[["path",{d:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",key:"tarvll"}]]);/**
211
+ * @license lucide-react v0.469.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const qM=qe("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
216
+ * @license lucide-react v0.469.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const wc=qe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
221
+ * @license lucide-react v0.469.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const GM=qe("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
226
+ * @license lucide-react v0.469.0 - ISC
227
+ *
228
+ * This source code is licensed under the ISC license.
229
+ * See the LICENSE file in the root directory of this source tree.
230
+ */const r1=qe("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
231
+ * @license lucide-react v0.469.0 - ISC
232
+ *
233
+ * This source code is licensed under the ISC license.
234
+ * See the LICENSE file in the root directory of this source tree.
235
+ */const zM=qe("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
236
+ * @license lucide-react v0.469.0 - ISC
237
+ *
238
+ * This source code is licensed under the ISC license.
239
+ * See the LICENSE file in the root directory of this source tree.
240
+ */const YM=qe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
241
+ * @license lucide-react v0.469.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ */const WM=qe("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
246
+ * @license lucide-react v0.469.0 - ISC
247
+ *
248
+ * This source code is licensed under the ISC license.
249
+ * See the LICENSE file in the root directory of this source tree.
250
+ */const KM=qe("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
251
+ * @license lucide-react v0.469.0 - ISC
252
+ *
253
+ * This source code is licensed under the ISC license.
254
+ * See the LICENSE file in the root directory of this source tree.
255
+ */const n1=qe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
256
+ * @license lucide-react v0.469.0 - ISC
257
+ *
258
+ * This source code is licensed under the ISC license.
259
+ * See the LICENSE file in the root directory of this source tree.
260
+ */const QM=qe("QrCode",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);/**
261
+ * @license lucide-react v0.469.0 - ISC
262
+ *
263
+ * This source code is licensed under the ISC license.
264
+ * See the LICENSE file in the root directory of this source tree.
265
+ */const zg=qe("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
266
+ * @license lucide-react v0.469.0 - ISC
267
+ *
268
+ * This source code is licensed under the ISC license.
269
+ * See the LICENSE file in the root directory of this source tree.
270
+ */const $M=qe("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
271
+ * @license lucide-react v0.469.0 - ISC
272
+ *
273
+ * This source code is licensed under the ISC license.
274
+ * See the LICENSE file in the root directory of this source tree.
275
+ */const JM=qe("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
276
+ * @license lucide-react v0.469.0 - ISC
277
+ *
278
+ * This source code is licensed under the ISC license.
279
+ * See the LICENSE file in the root directory of this source tree.
280
+ */const tg=qe("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
281
+ * @license lucide-react v0.469.0 - ISC
282
+ *
283
+ * This source code is licensed under the ISC license.
284
+ * See the LICENSE file in the root directory of this source tree.
285
+ */const i1=qe("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
286
+ * @license lucide-react v0.469.0 - ISC
287
+ *
288
+ * This source code is licensed under the ISC license.
289
+ * See the LICENSE file in the root directory of this source tree.
290
+ */const vS=qe("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
291
+ * @license lucide-react v0.469.0 - ISC
292
+ *
293
+ * This source code is licensed under the ISC license.
294
+ * See the LICENSE file in the root directory of this source tree.
295
+ */const ZM=qe("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
296
+ * @license lucide-react v0.469.0 - ISC
297
+ *
298
+ * This source code is licensed under the ISC license.
299
+ * See the LICENSE file in the root directory of this source tree.
300
+ */const rc=qe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
301
+ * @license lucide-react v0.469.0 - ISC
302
+ *
303
+ * This source code is licensed under the ISC license.
304
+ * See the LICENSE file in the root directory of this source tree.
305
+ */const Yg=qe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
306
+ * @license lucide-react v0.469.0 - ISC
307
+ *
308
+ * This source code is licensed under the ISC license.
309
+ * See the LICENSE file in the root directory of this source tree.
310
+ */const XM=qe("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
311
+ * @license lucide-react v0.469.0 - ISC
312
+ *
313
+ * This source code is licensed under the ISC license.
314
+ * See the LICENSE file in the root directory of this source tree.
315
+ */const ek=qe("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
316
+ * @license lucide-react v0.469.0 - ISC
317
+ *
318
+ * This source code is licensed under the ISC license.
319
+ * See the LICENSE file in the root directory of this source tree.
320
+ */const s1=qe("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
321
+ * @license lucide-react v0.469.0 - ISC
322
+ *
323
+ * This source code is licensed under the ISC license.
324
+ * See the LICENSE file in the root directory of this source tree.
325
+ */const o1=qe("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/**
326
+ * @license lucide-react v0.469.0 - ISC
327
+ *
328
+ * This source code is licensed under the ISC license.
329
+ * See the LICENSE file in the root directory of this source tree.
330
+ */const Wg=qe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Wl(e){return(...r)=>{}}const ze={log:Wl(),info:Wl(),warn:Wl(),error:Wl(),debug:Wl()},on={audio:(...e)=>ze.log("🔊",...e),voice:(...e)=>ze.log("🎤",...e),ws:(...e)=>ze.log("🔌",...e),message:(...e)=>ze.log("💬",...e),session:(...e)=>ze.log("📋",...e),auth:(...e)=>ze.log("🔐",...e)};function tk({onScan:e,onBack:r}){const[n,s]=R.useState(null),[o,u]=R.useState(null),f=R.useCallback(c=>{if(c.length>0){const h=c[0];h!=null&&h.rawValue&&e(h.rawValue)}},[e]),l=R.useCallback(c=>{ze.error("QR Scanner error:",c),c instanceof Error?c.name==="NotAllowedError"?(u(!1),s("Camera access denied. Please allow camera access in your browser settings.")):c.name==="NotFoundError"?s("No camera found on this device."):s(c.message):s("Failed to access camera")},[]);return b.jsxs("div",{className:"space-y-4",children:[b.jsxs("div",{className:"aspect-square bg-muted rounded-lg overflow-hidden relative",children:[o===!1?b.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center p-4 text-center",children:[b.jsx(IM,{className:"w-12 h-12 text-muted-foreground mb-4"}),b.jsx("p",{className:"text-sm text-muted-foreground",children:n})]}):n?b.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center p-4 text-center",children:[b.jsx(PM,{className:"w-12 h-12 text-muted-foreground mb-4"}),b.jsx("p",{className:"text-sm text-destructive",children:n})]}):b.jsx(RM,{onScan:f,onError:l,constraints:{facingMode:"environment"},styles:{container:{width:"100%",height:"100%"},video:{width:"100%",height:"100%",objectFit:"cover"}},components:{finder:!0}}),!n&&o!==!1&&b.jsxs("div",{className:"absolute inset-0 pointer-events-none",children:[b.jsx("div",{className:"absolute inset-8 border-2 border-primary rounded-lg opacity-50"}),b.jsxs("div",{className:"absolute inset-8 animate-pulse",children:[b.jsx("div",{className:"absolute top-0 left-0 w-8 h-8 border-t-4 border-l-4 border-primary rounded-tl-lg"}),b.jsx("div",{className:"absolute top-0 right-0 w-8 h-8 border-t-4 border-r-4 border-primary rounded-tr-lg"}),b.jsx("div",{className:"absolute bottom-0 left-0 w-8 h-8 border-b-4 border-l-4 border-primary rounded-bl-lg"}),b.jsx("div",{className:"absolute bottom-0 right-0 w-8 h-8 border-b-4 border-r-4 border-primary rounded-br-lg"})]})]})]}),b.jsx("p",{className:"text-sm text-center text-muted-foreground",children:"Point your camera at the QR code shown in your workstation terminal"}),b.jsxs(dt,{variant:"outline",className:"w-full",onClick:r,children:[b.jsx(OM,{className:"w-4 h-4"}),"Back to Magic Link"]})]})}const _S={supervisorMessages:[],agentMessages:{},supervisorIsLoading:!1,agentIsLoading:{},historyPaginationState:{},supervisorStreamingMessageId:null,agentStreamingMessageIds:{},pendingMessageAcks:new Set},ut=Ug(e=>({..._S,addSupervisorMessage:r=>e(n=>n.supervisorMessages.some(s=>s.id===r.id)?(console.debug("[ChatStore] Skipping duplicate supervisor message:",r.id),n):{supervisorMessages:[...n.supervisorMessages,r]}),updateSupervisorMessage:(r,n)=>e(s=>({supervisorMessages:s.supervisorMessages.map(o=>o.id===r?{...o,...n}:o)})),updateSupervisorStreamingBlocks:(r,n)=>e(s=>({supervisorMessages:s.supervisorMessages.map(o=>o.id===r?{...o,contentBlocks:n}:o)})),setSupervisorIsLoading:r=>e({supervisorIsLoading:r}),setSupervisorStreamingMessageId:r=>e({supervisorStreamingMessageId:r}),clearSupervisorMessages:()=>e({supervisorMessages:[]}),addAgentMessage:(r,n)=>e(s=>{const o=s.agentMessages[r]??[];return o.some(u=>u.id===n.id)?(console.debug("[ChatStore] Skipping duplicate agent message:",n.id,"session:",r),s):{agentMessages:{...s.agentMessages,[r]:[...o,n]}}}),updateAgentMessage:(r,n,s)=>e(o=>({agentMessages:{...o.agentMessages,[r]:(o.agentMessages[r]??[]).map(u=>u.id===n?{...u,...s}:u)}})),updateAgentStreamingBlocks:(r,n,s)=>e(o=>({agentMessages:{...o.agentMessages,[r]:(o.agentMessages[r]??[]).map(u=>u.id===n?{...u,contentBlocks:s}:u)}})),setAgentIsLoading:(r,n)=>e(s=>({agentIsLoading:{...s.agentIsLoading,[r]:n}})),setAgentStreamingMessageId:(r,n)=>e(s=>({agentStreamingMessageIds:{...s.agentStreamingMessageIds,[r]:n??""}})),clearAgentMessages:r=>e(n=>({agentMessages:{...n.agentMessages,[r]:[]}})),setMessageSendStatus:(r,n)=>e(s=>{if(s.supervisorMessages.find(f=>f.id===r))return{supervisorMessages:s.supervisorMessages.map(f=>f.id===r?{...f,sendStatus:n}:f)};const u={...s.agentMessages};for(const f in u){const l=u[f];if(l&&l.findIndex(h=>h.id===r)!==-1)return u[f]=l.map(h=>h.id===r?{...h,sendStatus:n}:h),{agentMessages:u}}return{}}),addPendingAck:r=>e(n=>({pendingMessageAcks:new Set([...n.pendingMessageAcks,r])})),removePendingAck:r=>e(n=>{const s=new Set(n.pendingMessageAcks);return s.delete(r),{pendingMessageAcks:s}}),setHistoryPaginationState:(r,n)=>e(s=>({historyPaginationState:{...s.historyPaginationState,[r]:n}})),prependSupervisorMessages:r=>e(n=>{const s=new Set(n.supervisorMessages.map(u=>u.id)),o=r.filter(u=>!s.has(u.id));return o.length<r.length&&console.debug("[ChatStore] Filtered",r.length-o.length,"duplicate supervisor messages during prepend"),{supervisorMessages:[...o,...n.supervisorMessages]}}),prependAgentMessages:(r,n)=>e(s=>{const o=s.agentMessages[r]??[],u=new Set(o.map(l=>l.id)),f=n.filter(l=>!u.has(l.id));return f.length<n.length&&console.debug("[ChatStore] Filtered",n.length-f.length,"duplicate agent messages during prepend for session:",r),{agentMessages:{...s.agentMessages,[r]:[...f,...o]}}}),reset:()=>e(_S)})),rk=5e3,nk=1e4,ik=1e4,sk=5e3,ok=500,ak=5e3,dh=class dh{constructor(){_e(this,"ws",null);_e(this,"credentials",null);_e(this,"callbacks",null);_e(this,"pingInterval",null);_e(this,"heartbeatInterval",null);_e(this,"pongTimeout",null);_e(this,"heartbeatTimeout",null);_e(this,"reconnectTimeout",null);_e(this,"reconnectAttempts",0);_e(this,"isConnecting",!1);_e(this,"isAuthenticated",!1);_e(this,"intentionalDisconnect",!1);_e(this,"pendingRequests",new Map)}init(r){this.callbacks=r}async connect(r){var n,s,o;if(!(this.isConnecting||((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN)){this.credentials=r,this.intentionalDisconnect=!1,this.isConnecting=!0,(s=this.callbacks)==null||s.onConnectionStateChange("connecting");try{await this.establishConnection()}catch(u){throw this.isConnecting=!1,(o=this.callbacks)==null||o.onConnectionStateChange("error"),u}}}disconnect(){var r;this.intentionalDisconnect=!0,this.cleanup(),(r=this.callbacks)==null||r.onConnectionStateChange("disconnected")}async sendRequest(r){return new Promise((n,s)=>{if(!this.ws||this.ws.readyState!==WebSocket.OPEN){s(new Error("WebSocket not connected"));return}this.pendingRequests.size>=dh.MAX_PENDING_REQUESTS&&this.cleanupStaleRequests();const o=setTimeout(()=>{this.pendingRequests.delete(r.id),s(new Error("Request timeout"))},3e4);this.pendingRequests.set(r.id,{resolve:u=>{clearTimeout(o),n(u)},reject:u=>{clearTimeout(o),s(u)},timestamp:Date.now()}),this.send(r)})}send(r){var n;((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify(r))}isConnected(){var r;return((r=this.ws)==null?void 0:r.readyState)===WebSocket.OPEN&&this.isAuthenticated}reconnect(){this.credentials&&!this.isConnecting&&(this.intentionalDisconnect=!1,this.reconnectAttempts=0,this.cleanup(),this.connect(this.credentials).catch(r=>{ze.error("Manual reconnection failed:",r)}))}getReconnectAttempts(){return this.reconnectAttempts}async establishConnection(){return new Promise((r,n)=>{if(!this.credentials){n(new Error("No credentials"));return}try{this.ws=new WebSocket(this.credentials.tunnelUrl)}catch(o){n(o);return}const s=setTimeout(()=>{var o;(o=this.ws)==null||o.close(),n(new Error("Connection timeout"))},3e4);this.ws.onopen=()=>{var o;clearTimeout(s),(o=this.callbacks)==null||o.onConnectionStateChange("connected"),this.sendConnectMessage()},this.ws.onclose=o=>{clearTimeout(s),this.handleClose(o),this.isAuthenticated||n(new Error("Connection closed before authentication"))},this.ws.onerror=o=>{var u;clearTimeout(s),ze.error("WebSocket error:",o),(u=this.callbacks)==null||u.onConnectionStateChange("error")},this.ws.onmessage=o=>{try{const u=JSON.parse(o.data);this.handleMessage(u,r,n)}catch(u){ze.error("Failed to parse message:",u)}}})}sendConnectMessage(){var n;if(!this.credentials)return;const r={type:"connect",payload:{tunnel_id:this.credentials.tunnelId,auth_key:this.credentials.authKey,device_id:this.credentials.deviceId,reconnect:this.reconnectAttempts>0}};this.send(r),(n=this.callbacks)==null||n.onConnectionStateChange("authenticating")}sendAuthMessage(){if(!this.credentials)return;const r={type:"auth",payload:{auth_key:this.credentials.authKey,device_id:this.credentials.deviceId}};this.send(r)}handleMessage(r,n,s){var o,u,f,l,c,h;if(r.id&&this.pendingRequests.has(r.id)){const m=this.pendingRequests.get(r.id);if(this.pendingRequests.delete(r.id),r.type==="error"){const p=r.payload;m==null||m.reject(new Error(`${p.code}: ${p.message}`))}else m==null||m.resolve(r);return}switch(r.type){case"connected":this.sendAuthMessage();break;case"auth.success":this.isConnecting=!1,this.isAuthenticated=!0,this.reconnectAttempts=0,(o=this.callbacks)==null||o.onConnectionStateChange("authenticated"),this.startHeartbeat(),this.requestSync(),(u=this.callbacks)==null||u.onMessage(r),n==null||n();break;case"auth.error":{this.isConnecting=!1,(f=this.callbacks)==null||f.onConnectionStateChange("error");const m=r.payload;s==null||s(new Error(`Auth failed: ${m.message}`));break}case"pong":this.handlePong();break;case"heartbeat.ack":this.handleHeartbeatAck();break;case"connection.workstation_online":(l=this.callbacks)==null||l.onWorkstationOnline();break;case"connection.workstation_offline":(c=this.callbacks)==null||c.onWorkstationOffline();break;default:(h=this.callbacks)==null||h.onMessage(r)}}startHeartbeat(){this.stopHeartbeat(),this.pingInterval=setInterval(()=>{this.sendPing()},rk),this.heartbeatInterval=setInterval(()=>{this.sendHeartbeat()},ik),this.sendHeartbeat()}stopHeartbeat(){this.pingInterval&&(clearInterval(this.pingInterval),this.pingInterval=null),this.heartbeatInterval&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=null),this.pongTimeout&&(clearTimeout(this.pongTimeout),this.pongTimeout=null),this.heartbeatTimeout&&(clearTimeout(this.heartbeatTimeout),this.heartbeatTimeout=null)}sendPing(){this.send({type:"ping",timestamp:Date.now()}),this.pongTimeout=setTimeout(()=>{var r;ze.warn("Pong timeout - connection may be stale"),(r=this.callbacks)==null||r.onConnectionStateChange("degraded")},nk)}handlePong(){this.pongTimeout&&(clearTimeout(this.pongTimeout),this.pongTimeout=null)}sendHeartbeat(){const r={type:"heartbeat",id:crypto.randomUUID(),timestamp:Date.now()};this.send(r),this.heartbeatTimeout=setTimeout(()=>{var n;ze.warn("Heartbeat timeout - connection may be stale"),(n=this.callbacks)==null||n.onConnectionStateChange("degraded")},sk)}handleHeartbeatAck(){var r;this.heartbeatTimeout&&(clearTimeout(this.heartbeatTimeout),this.heartbeatTimeout=null),(r=this.callbacks)==null||r.onConnectionStateChange("verified")}requestSync(){const r={type:"sync",id:crypto.randomUUID(),lightweight:this.reconnectAttempts>0};this.send(r)}handleClose(r){var n,s;if(this.cleanup(),this.intentionalDisconnect){(n=this.callbacks)==null||n.onConnectionStateChange("disconnected");return}on.ws("WebSocket closed:",r.code,r.reason),(s=this.callbacks)==null||s.onConnectionStateChange("disconnected"),this.scheduleReconnect()}scheduleReconnect(){if(this.intentionalDisconnect||!this.credentials)return;const r=Math.min(ok*Math.pow(2,this.reconnectAttempts),ak);this.reconnectAttempts++,on.ws(`Reconnecting in ${r}ms (attempt ${this.reconnectAttempts})`),this.reconnectTimeout=setTimeout(()=>{this.credentials&&!this.intentionalDisconnect&&this.connect(this.credentials).catch(n=>{ze.error("Reconnection failed:",n)})},r)}cleanupStaleRequests(){const r=Date.now(),n=6e4;for(const[s,o]of this.pendingRequests)r-o.timestamp>n&&(o.reject(new Error("Request expired")),this.pendingRequests.delete(s))}cleanup(){this.stopHeartbeat(),this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.ws&&(this.ws.onopen=null,this.ws.onclose=null,this.ws.onerror=null,this.ws.onmessage=null,(this.ws.readyState===WebSocket.OPEN||this.ws.readyState===WebSocket.CONNECTING)&&this.ws.close(1e3,"Client disconnect"),this.ws=null),this.isConnecting=!1,this.isAuthenticated=!1;for(const[r,n]of this.pendingRequests)n.reject(new Error("Connection closed")),this.pendingRequests.delete(r)}};_e(dh,"MAX_PENDING_REQUESTS",100);let rg=dh;const Mt=new rg;function lk(e,r){let n;try{n=e()}catch{return}return{getItem:o=>{var u;const f=c=>c===null?null:JSON.parse(c,void 0),l=(u=n.getItem(o))!=null?u:null;return l instanceof Promise?l.then(f):f(l)},setItem:(o,u)=>n.setItem(o,JSON.stringify(u,void 0)),removeItem:o=>n.removeItem(o)}}const ng=e=>r=>{try{const n=e(r);return n instanceof Promise?n:{then(s){return ng(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return ng(s)(n)}}}},ck=(e,r)=>(n,s,o)=>{let u={storage:lk(()=>localStorage),partialize:w=>w,version:0,merge:(w,v)=>({...v,...w}),...r},f=!1;const l=new Set,c=new Set;let h=u.storage;if(!h)return e((...w)=>{console.warn(`[zustand persist middleware] Unable to update item '${u.name}', the given storage is currently unavailable.`),n(...w)},s,o);const m=()=>{const w=u.partialize({...s()});return h.setItem(u.name,{state:w,version:u.version})},p=o.setState;o.setState=(w,v)=>(p(w,v),m());const y=e((...w)=>(n(...w),m()),s,o);o.getInitialState=()=>y;let x;const A=()=>{var w,v;if(!h)return;f=!1,l.forEach(g=>{var _;return g((_=s())!=null?_:y)});const S=((v=u.onRehydrateStorage)==null?void 0:v.call(u,(w=s())!=null?w:y))||void 0;return ng(h.getItem.bind(h))(u.name).then(g=>{if(g)if(typeof g.version=="number"&&g.version!==u.version){if(u.migrate){const _=u.migrate(g.state,g.version);return _ instanceof Promise?_.then(T=>[!0,T]):[!0,_]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,g.state];return[!1,void 0]}).then(g=>{var _;const[T,M]=g;if(x=u.merge(M,(_=s())!=null?_:y),n(x,!0),T)return m()}).then(()=>{S==null||S(x,void 0),x=s(),f=!0,c.forEach(g=>g(x))}).catch(g=>{S==null||S(void 0,g)})};return o.persist={setOptions:w=>{u={...u,...w},w.storage&&(h=w.storage)},clearStorage:()=>{h==null||h.removeItem(u.name)},getOptions:()=>u,rehydrate:()=>A(),hasHydrated:()=>f,onHydrate:w=>(l.add(w),()=>{l.delete(w)}),onFinishHydration:w=>(c.add(w),()=>{c.delete(w)})},u.skipHydration||A(),x||y},uk=ck,a1=200,l1=480,dk=320,hk=64,yS={ttsEnabled:!0,sttLanguage:"en",sidebarCollapsed:!1,sidebarWidth:dk},Pn=Ug()(uk(e=>({...yS,setTtsEnabled:r=>e({ttsEnabled:r}),setSttLanguage:r=>e({sttLanguage:r}),setSidebarCollapsed:r=>e({sidebarCollapsed:r}),setSidebarWidth:r=>e({sidebarWidth:Math.max(a1,Math.min(l1,r))}),toggleSidebar:()=>e(r=>({sidebarCollapsed:!r.sidebarCollapsed})),reset:()=>e(yS)}),{name:"tiflis-settings"})),fk="audio/wav";class pk{constructor(){_e(this,"audioCache",new Map);_e(this,"currentMessageId",null);_e(this,"isCurrentlyLoading",!1);_e(this,"CACHE_DURATION_MS",900*1e3);_e(this,"MAX_CACHE_SIZE",50);_e(this,"sharedAudio");_e(this,"audioContext",null);_e(this,"isUnlocked",!1);_e(this,"pendingAutoPlay",null);_e(this,"listeners",new Set);_e(this,"animationFrameId",null);this.sharedAudio=new Audio,this.sharedAudio.preload="auto",this.setupSharedAudioListeners(),this.setupAudioUnlock()}setupSharedAudioListeners(){this.sharedAudio.addEventListener("play",()=>{this.startProgressTracking(),this.notifyListeners()}),this.sharedAudio.addEventListener("pause",()=>{this.stopProgressTracking(),this.notifyListeners()}),this.sharedAudio.addEventListener("ended",()=>{this.stopProgressTracking(),this.sharedAudio.currentTime=0,this.notifyListeners()}),this.sharedAudio.addEventListener("loadedmetadata",()=>{this.isCurrentlyLoading=!1,this.notifyListeners()}),this.sharedAudio.addEventListener("canplay",()=>{this.isCurrentlyLoading=!1,this.notifyListeners()}),this.sharedAudio.addEventListener("error",()=>{this.isCurrentlyLoading=!1,this.notifyListeners("Failed to load audio")})}subscribe(r){return this.listeners.add(r),r(this.getState()),()=>{this.listeners.delete(r)}}getState(){return{messageId:this.currentMessageId,isPlaying:!this.sharedAudio.paused,isLoading:this.isCurrentlyLoading,currentTime:this.sharedAudio.currentTime,duration:isNaN(this.sharedAudio.duration)?0:this.sharedAudio.duration,error:null}}notifyListeners(r){const n={...this.getState(),error:r??null};this.listeners.forEach(s=>s(n))}startProgressTracking(){if(this.animationFrameId!==null)return;const r=()=>{this.notifyListeners(),this.sharedAudio.paused?this.animationFrameId=null:this.animationFrameId=requestAnimationFrame(r)};this.animationFrameId=requestAnimationFrame(r)}stopProgressTracking(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}getAudioContext(){return this.audioContext||(this.audioContext=new(window.AudioContext||window.webkitAudioContext)),this.audioContext}setupAudioUnlock(){const r=async()=>{if(!this.isUnlocked)try{const n=this.getAudioContext();n.state==="suspended"&&await n.resume(),this.sharedAudio.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA",this.sharedAudio.volume=.01;try{await this.sharedAudio.play(),this.sharedAudio.pause(),this.sharedAudio.currentTime=0,this.sharedAudio.volume=1}catch{}if(this.isUnlocked=!0,ze.log("Audio unlocked via user interaction"),this.pendingAutoPlay){const{base64Audio:s,messageId:o}=this.pendingAutoPlay;this.pendingAutoPlay=null,setTimeout(()=>{this.playAudio(s,o,!0)},50)}document.removeEventListener("touchstart",r),document.removeEventListener("touchend",r),document.removeEventListener("click",r),document.removeEventListener("keydown",r)}catch(n){ze.warn("Audio unlock failed, will retry:",n)}};document.addEventListener("touchstart",r,{once:!1,passive:!0}),document.addEventListener("touchend",r,{once:!1,passive:!0}),document.addEventListener("click",r,{once:!1,passive:!0}),document.addEventListener("keydown",r,{once:!1,passive:!0})}isAudioUnlocked(){return this.isUnlocked}async unlockIfNeeded(){if(!this.isUnlocked)try{const r=this.getAudioContext();if(r.state==="suspended"&&await r.resume(),this.sharedAudio.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA",this.sharedAudio.volume=.01,await this.sharedAudio.play(),this.sharedAudio.pause(),this.sharedAudio.currentTime=0,this.sharedAudio.volume=1,this.isUnlocked=!0,ze.log("Audio manually unlocked"),this.pendingAutoPlay){const{base64Audio:n,messageId:s}=this.pendingAutoPlay;this.pendingAutoPlay=null,this.playAudio(n,s,!0)}}catch(r){ze.warn("Manual audio unlock failed:",r),this.isUnlocked=!0}}isMobileDevice(){return/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)}playAudio(r,n,s){if(ze.log(`playAudio: messageId=${n}, autoPlay=${s}, isUnlocked=${this.isUnlocked}, isMobile=${this.isMobileDevice()}`),this.cacheAudio(r,n),s&&!this.isUnlocked&&this.isMobileDevice()){ze.log("Mobile: Audio not unlocked yet, queuing for auto-play"),this.pendingAutoPlay={base64Audio:r,messageId:n};return}this.stop(),this.currentMessageId=n,this.isCurrentlyLoading=!0,this.notifyListeners(),this.sharedAudio.src=`data:${fk};base64,${r}`,s?this.sharedAudio.play().then(()=>{this.isUnlocked=!0}).catch(o=>{o.name==="NotAllowedError"?(ze.log("Auto-play blocked by browser policy, user can play manually"),this.isMobileDevice()&&(this.pendingAutoPlay={base64Audio:r,messageId:n})):ze.warn("Play failed:",o.name,o.message),this.isCurrentlyLoading=!1,this.notifyListeners()}):this.sharedAudio.load()}cacheAudio(r,n){if(this.audioCache.has(n))return;this.audioCache.size>=this.MAX_CACHE_SIZE&&this.evictLRU();const s=Date.now();this.audioCache.set(n,{base64:r,expiresAt:s+this.CACHE_DURATION_MS,accessedAt:s}),this.cleanupCache()}playByMessageId(r){const n=this.audioCache.get(r);return n&&Date.now()<n.expiresAt?(n.accessedAt=Date.now(),this.playAudio(n.base64,r,!0),!0):!1}togglePlay(){this.sharedAudio.paused?this.sharedAudio.play().catch(r=>{ze.warn("Toggle play failed:",r)}):this.sharedAudio.pause()}seek(r){this.sharedAudio.duration&&(this.sharedAudio.currentTime=r*this.sharedAudio.duration,this.notifyListeners())}seekToTime(r){this.sharedAudio.currentTime=r,this.notifyListeners()}resetToStart(){this.sharedAudio.currentTime=0,this.notifyListeners()}getAudioBase64(r){const n=this.audioCache.get(r);return n&&Date.now()<n.expiresAt?n.base64:null}getAudio(r){return this.currentMessageId===r?this.sharedAudio:this.hasAudio(r)?this.sharedAudio:null}hasAudio(r){const n=this.audioCache.get(r);return n!==void 0&&Date.now()<n.expiresAt}registerAudio(r,n){n&&(this.currentMessageId=n),this.notifyListeners()}unregisterAudio(r){}stop(){this.stopProgressTracking(),this.sharedAudio.pause(),this.sharedAudio.currentTime=0,this.currentMessageId=null,this.isCurrentlyLoading=!1,this.notifyListeners()}stopAll(){this.stop()}isPlaying(){return!this.sharedAudio.paused}getCurrentMessageId(){return this.currentMessageId}cleanupCache(){const r=Date.now();for(const[n,s]of this.audioCache.entries())r>=s.expiresAt&&this.audioCache.delete(n)}evictLRU(){let r=null,n=1/0;for(const[s,o]of this.audioCache.entries())o.accessedAt<n&&(n=o.accessedAt,r=s);r&&this.audioCache.delete(r)}}const It=new pk;function _i(e){const r=e.filter(n=>n.block_type==="voice_output"||n.block_type==="voice_input");return r.length>0&&on.audio("parseContentBlocks - voice blocks from server:",r),e.map(n=>({id:n.id,blockType:n.block_type,content:n.content,metadata:n.metadata?{language:n.metadata.language,toolName:n.metadata.tool_name,toolUseId:n.metadata.tool_use_id,toolInput:n.metadata.tool_input,toolOutput:n.metadata.tool_output,toolStatus:n.metadata.tool_status,audioUrl:n.metadata.audio_url,audioBase64:n.metadata.audio_base64,messageId:n.metadata.message_id,duration:n.metadata.duration,hasAudio:n.metadata.has_audio,errorCode:n.metadata.error_code}:void 0}))}const ma={supervisorInProgress:!1,agentSessionsInProgress:new Set,pendingUpdates:new Map,isHistoryLoadingForSession(e){return e==="supervisor"?this.supervisorInProgress:this.agentSessionsInProgress.has(e)},markHistoryLoadStart(e){e==="supervisor"?this.supervisorInProgress=!0:this.agentSessionsInProgress.add(e)},markHistoryLoadEnd(e){e==="supervisor"?this.supervisorInProgress=!1:this.agentSessionsInProgress.delete(e),this.processPendingUpdates(e)},queueUpdate(e,r){const n=this.pendingUpdates.get(e)??[];n.push(r),this.pendingUpdates.set(e,n)},processPendingUpdates(e){const r=this.pendingUpdates.get(e)??[];this.pendingUpdates.delete(e);for(const n of r)try{n()}catch(s){ze.error({error:s,sessionKey:e},"Error processing pending update")}}},c1={lastSupervisorSequence:0,lastAgentSequences:new Map,checkSupervisorSequence(e){e!==void 0&&(e>this.lastSupervisorSequence+1&&ze.warn({expected:this.lastSupervisorSequence+1,received:e},"Detected supervisor message gap - messages may have been lost"),this.lastSupervisorSequence=e)},checkAgentSequence(e,r){if(r!==void 0){const n=this.lastAgentSequences.get(e)??0;r>n+1&&ze.warn({sessionId:e,expected:n+1,received:r},"Detected agent message gap - messages may have been lost"),this.lastAgentSequences.set(e,r)}}};function mk(e){const r=e;switch(r.type){case"auth.success":gk(r);break;case"sync.state":vk(r);break;case"history.response":_k(r);break;case"session.created":yk(r);break;case"session.terminated":bk(r);break;case"session.subscribed":Sk(r);break;case"supervisor.output":u1(r);break;case"supervisor.user_message":Ck(r);break;case"supervisor.context_cleared":wk();break;case"session.output":d1(r);break;case"session.replay.data":xk(r);break;case"session.user_message":Ek(r);break;case"message.ack":Ak(r);break;case"supervisor.voice_output":Tk(r);break;case"session.voice_output":Rk(r);break;case"supervisor.transcription":Dk(r);break;case"session.transcription":Mk(r);break;case"response":break;case"error":ze.error("Server error:",r.payload);break;default:ze.log("Unhandled message type:",r.type)}}function gk(e){Ve.getState().setWorkstationInfo({name:e.payload.workstation_name??"Unknown",version:e.payload.workstation_version??"",protocolVersion:e.payload.protocol_version??"",workspacesRoot:e.payload.workspaces_root??""})}function vk(e){const r=Ve.getState(),n=ut.getState(),s=e.payload.sessions.map(o=>({id:o.session_id,type:o.session_type,status:o.status,agentName:o.agent_name,workspace:o.workspace,project:o.project,worktree:o.worktree,workingDir:o.working_dir,createdAt:o.created_at?new Date(o.created_at):new Date}));if(r.setSessions(s),e.payload.availableAgents){const o=e.payload.availableAgents.map(u=>({name:u.name,baseType:u.base_type,displayName:u.name.charAt(0).toUpperCase()+u.name.slice(1),description:u.description,isAlias:u.is_alias}));r.setAvailableAgents(o)}if(e.payload.workspaces){const o=e.payload.workspaces.map(u=>({name:u.name,projects:u.projects.map(f=>({name:f.name,isGitRepo:f.is_git_repo,defaultBranch:f.default_branch}))}));r.setWorkspaces(o)}n.setHistoryPaginationState("supervisor",{oldestSequence:void 0,hasMore:!0,isLoading:!0}),ze.log("Sending supervisor history.request"),Mt.send({type:"history.request",id:crypto.randomUUID(),payload:{session_id:null,limit:50}})}function _k(e){const r=ut.getState(),{session_id:n,history:s,has_more:o,oldest_sequence:u,is_executing:f,current_streaming_blocks:l,streaming_message_id:c}=e.payload;ze.log("history.response received:",{session_id:n,historyCount:(s==null?void 0:s.length)??0,has_more:o,oldest_sequence:u,streaming_message_id:c});const h=n??"supervisor";ma.markHistoryLoadStart(h);try{if(r.setHistoryPaginationState(h,{oldestSequence:u,hasMore:o,isLoading:!1}),s.length===0)return;const p=[...s].sort((y,x)=>y.sequence-x.sequence).map(y=>({id:y.message_id??crypto.randomUUID(),sessionId:h,role:y.role,contentBlocks:y.content_blocks?_i(y.content_blocks):[{id:crypto.randomUUID(),blockType:"text",content:y.content}],isStreaming:!1,createdAt:new Date(y.createdAt)}));if(n===null){if(r.prependSupervisorMessages(p),f&&r.setSupervisorIsLoading(!0),l&&l.length>0){const y=c??crypto.randomUUID();if(r.supervisorStreamingMessageId===y)r.updateSupervisorStreamingBlocks(y,_i(l));else if(!r.supervisorMessages.some(A=>A.id===y)){const A={id:y,sessionId:"supervisor",role:"assistant",contentBlocks:_i(l),isStreaming:!0,createdAt:new Date};r.addSupervisorMessage(A),r.setSupervisorStreamingMessageId(y),r.setSupervisorIsLoading(!0)}}}else if(r.prependAgentMessages(n,p),f&&r.setAgentIsLoading(n,!0),l&&l.length>0){const y=c??crypto.randomUUID();if(r.agentStreamingMessageIds[n]===y)r.updateAgentStreamingBlocks(n,y,_i(l));else if(!(r.agentMessages[n]??[]).some(w=>w.id===y)){const w={id:y,sessionId:n,role:"assistant",contentBlocks:_i(l),isStreaming:!0,createdAt:new Date};r.addAgentMessage(n,w),r.setAgentStreamingMessageId(n,y),r.setAgentIsLoading(n,!0)}}}finally{ma.markHistoryLoadEnd(h)}}function yk(e){const r=Ve.getState(),n={id:e.session_id,type:e.payload.session_type,status:"active",agentName:e.payload.agent_name,workspace:e.payload.workspace,project:e.payload.project,worktree:e.payload.worktree,workingDir:e.payload.working_dir,createdAt:e.payload.created_at?new Date(e.payload.created_at):new Date,terminalConfig:e.payload.terminal_config?{cols:80,rows:24,bufferSize:e.payload.terminal_config.buffer_size}:void 0};r.addSession(n)}function Sk(e){const r=ut.getState(),n=e.session_id,o=Ve.getState().sessions.find(u=>u.id===n);if((o==null?void 0:o.type)!=="terminal"&&(e.is_executing&&r.setAgentIsLoading(n,!0),r.setHistoryPaginationState(n,{oldestSequence:void 0,hasMore:!0,isLoading:!0}),ze.log("Sending agent history.request",{sessionId:n}),Mt.send({type:"history.request",id:crypto.randomUUID(),payload:{session_id:n,limit:50}}),e.current_streaming_blocks&&e.current_streaming_blocks.length>0)){const u=e.streaming_message_id??crypto.randomUUID();if(r.agentStreamingMessageIds[n]===u)r.updateAgentStreamingBlocks(n,u,_i(e.current_streaming_blocks));else if(!(r.agentMessages[n]??[]).some(c=>c.id===u)){const c={id:u,sessionId:n,role:"assistant",contentBlocks:_i(e.current_streaming_blocks),isStreaming:!0,createdAt:new Date};r.addAgentMessage(n,c),r.setAgentStreamingMessageId(n,u),r.setAgentIsLoading(n,!0)}}}function bk(e){Ve.getState().removeSession(e.session_id)}function u1(e){if(c1.checkSupervisorSequence(e.sequence),ma.isHistoryLoadingForSession("supervisor")){ma.queueUpdate("supervisor",()=>u1(e));return}const r=ut.getState(),n=r.supervisorStreamingMessageId,s=e.streaming_message_id,o=_i(e.payload.content_blocks),u=o.length>0&&o.some(f=>f.content||f.blockType==="tool"||f.blockType==="voice_output");if(s&&n&&n!==s&&r.supervisorMessages.some(f=>f.id===s)){u&&r.updateSupervisorStreamingBlocks(s,o),e.payload.is_complete&&(r.updateSupervisorMessage(s,{isStreaming:!1}),r.setSupervisorStreamingMessageId(null),r.setSupervisorIsLoading(!1));return}if(n)u&&r.updateSupervisorStreamingBlocks(n,o),e.payload.is_complete&&(r.updateSupervisorMessage(n,{isStreaming:!1}),r.setSupervisorStreamingMessageId(null),r.setSupervisorIsLoading(!1));else{if(!u&&e.payload.is_complete)return;const f=s??crypto.randomUUID();if(r.supervisorMessages.some(c=>c.id===f)){u&&r.updateSupervisorStreamingBlocks(f,o),e.payload.is_complete?(r.updateSupervisorMessage(f,{isStreaming:!1}),r.setSupervisorStreamingMessageId(null),r.setSupervisorIsLoading(!1)):(r.setSupervisorStreamingMessageId(f),r.setSupervisorIsLoading(!0));return}const l={id:f,sessionId:"supervisor",role:"assistant",contentBlocks:o,isStreaming:!e.payload.is_complete,createdAt:new Date(e.payload.timestamp)};r.addSupervisorMessage(l),e.payload.is_complete||(r.setSupervisorStreamingMessageId(l.id),r.setSupervisorIsLoading(!0))}}function Ck(e){const r=ut.getState(),s=Ve.getState().credentials;if(s&&e.payload.from_device_id===s.deviceId)return;const o={id:crypto.randomUUID(),sessionId:"supervisor",role:"user",contentBlocks:[{id:crypto.randomUUID(),blockType:"text",content:e.payload.content}],isStreaming:!1,createdAt:new Date(e.payload.timestamp),fromDeviceId:e.payload.from_device_id};r.addSupervisorMessage(o)}function wk(){ut.getState().clearSupervisorMessages()}function xk(e){const r=e.session_id,{messages:n}=e.payload;if(ze.debug("Terminal replay received",{sessionId:r,messageCount:n.length,hasMore:e.payload.has_more,firstSequence:e.payload.first_sequence,lastSequence:e.payload.last_sequence}),n.length===0)return;const o=[...n].sort((u,f)=>u.sequence-f.sequence).map(u=>u.content).join("");window.dispatchEvent(new CustomEvent("terminal-output",{detail:{sessionId:r,data:o}}))}function d1(e){const r=e.session_id;if(c1.checkAgentSequence(r,e.sequence),ma.isHistoryLoadingForSession(r)){ma.queueUpdate(r,()=>d1(e));return}const n=ut.getState();if(e.payload.content_type==="terminal"){window.dispatchEvent(new CustomEvent("terminal-output",{detail:{sessionId:r,data:e.payload.content}}));return}const s=n.agentStreamingMessageIds[r],o=e.streaming_message_id,u=e.payload.content_blocks?_i(e.payload.content_blocks):[{id:crypto.randomUUID(),blockType:"text",content:e.payload.content}],f=u.length>0&&u.some(l=>l.content||l.blockType==="tool"||l.blockType==="voice_output");if(o&&s&&s!==o&&(n.agentMessages[r]??[]).some(c=>c.id===o)){f&&n.updateAgentStreamingBlocks(r,o,u),e.payload.is_complete&&(n.updateAgentMessage(r,o,{isStreaming:!1}),n.setAgentStreamingMessageId(r,null),n.setAgentIsLoading(r,!1));return}if(s)f&&n.updateAgentStreamingBlocks(r,s,u),e.payload.is_complete&&(n.updateAgentMessage(r,s,{isStreaming:!1}),n.setAgentStreamingMessageId(r,null),n.setAgentIsLoading(r,!1));else{if(!f&&e.payload.is_complete)return;const l=o??crypto.randomUUID();if((n.agentMessages[r]??[]).some(m=>m.id===l)){f&&n.updateAgentStreamingBlocks(r,l,u),e.payload.is_complete?(n.updateAgentMessage(r,l,{isStreaming:!1}),n.setAgentStreamingMessageId(r,null),n.setAgentIsLoading(r,!1)):(n.setAgentStreamingMessageId(r,l),n.setAgentIsLoading(r,!0));return}const h={id:l,sessionId:r,role:"assistant",contentBlocks:u,isStreaming:!e.payload.is_complete,createdAt:new Date(e.payload.timestamp)};n.addAgentMessage(r,h),e.payload.is_complete||(n.setAgentStreamingMessageId(r,h.id),n.setAgentIsLoading(r,!0))}}function Ek(e){const r=ut.getState(),s=Ve.getState().credentials;if(s&&e.payload.from_device_id===s.deviceId)return;const o={id:crypto.randomUUID(),sessionId:e.session_id,role:"user",contentBlocks:[{id:crypto.randomUUID(),blockType:"text",content:e.payload.content}],isStreaming:!1,createdAt:new Date,fromDeviceId:e.payload.from_device_id};r.addAgentMessage(e.session_id,o)}function Ak(e){const r=ut.getState();r.pendingMessageAcks.has(e.payload.message_id)&&(r.removePendingAck(e.payload.message_id),r.setMessageSendStatus(e.payload.message_id,"sent"))}function Tk(e){on.audio("Received supervisor.voice_output:",e);const r=Ve.getState(),n=Pn.getState(),s=ut.getState(),o=r.credentials,{message_id:u,audio_base64:f,from_device_id:l,duration:c}=e.payload,h=n.ttsEnabled,m=l!==void 0&&l===(o==null?void 0:o.deviceId),p=h&&m;on.audio(`TTS: from=${l??"nil"} me=${o==null?void 0:o.deviceId} match=${m} ttsEnabled=${h} autoPlay=${p}`),It.playAudio(f,u,p);const y=s.supervisorMessages;let x=-1;for(let A=y.length-1;A>=0;A--){const w=y[A];if(w&&w.role==="assistant"){x=A;break}}if(x!==-1){const A=y[x];if(A){const w={id:crypto.randomUUID(),blockType:"voice_output",content:"",metadata:{messageId:u,audioBase64:f,duration:c,hasAudio:!0}};s.updateSupervisorMessage(A.id,{contentBlocks:[...A.contentBlocks,w]})}}}function Rk(e){on.audio("Received session.voice_output:",e);const r=Ve.getState(),n=Pn.getState(),s=ut.getState(),o=r.credentials,u=e.session_id,{message_id:f,audio_base64:l,from_device_id:c,duration:h}=e.payload,m=n.ttsEnabled,p=c!==void 0&&c===(o==null?void 0:o.deviceId),y=m&&p;on.audio(`TTS(agent): from=${c??"nil"} me=${o==null?void 0:o.deviceId} match=${p} autoPlay=${y}`),It.playAudio(l,f,y);const x=s.agentMessages[u]??[];let A=-1;for(let w=x.length-1;w>=0;w--){const v=x[w];if(v&&v.role==="assistant"){A=w;break}}if(A!==-1){const w=x[A];if(w){const v={id:crypto.randomUUID(),blockType:"voice_output",content:"",metadata:{messageId:f,audioBase64:l,duration:h,hasAudio:!0}};s.updateAgentMessage(u,w.id,{contentBlocks:[...w.contentBlocks,v]})}}}function Dk(e){const r=ut.getState(),s=Ve.getState().credentials,{message_id:o,transcription:u,from_device_id:f}=e.payload,l=r.supervisorMessages;let c=!1;for(const h of l)if(h.id===o||h.contentBlocks.some(m=>{var p;return((p=m.metadata)==null?void 0:p.messageId)===o})){const m=h.contentBlocks.map(p=>p.blockType==="voice_input"?{...p,content:u}:p);r.updateSupervisorMessage(h.id,{contentBlocks:m}),c=!0;break}if(!c&&f&&f!==(s==null?void 0:s.deviceId)&&u){const h={id:o,sessionId:"supervisor",role:"user",contentBlocks:[{id:crypto.randomUUID(),blockType:"voice_input",content:u,metadata:{messageId:o}}],isStreaming:!1,createdAt:new Date,fromDeviceId:f};r.addSupervisorMessage(h)}}function Mk(e){const r=ut.getState(),s=Ve.getState().credentials,o=e.session_id,{message_id:u,transcription:f,from_device_id:l}=e.payload,c=r.agentMessages[o]??[];let h=!1;for(const m of c)if(m.id===u||m.contentBlocks.some(p=>{var y;return((y=p.metadata)==null?void 0:y.messageId)===u})){const p=m.contentBlocks.map(y=>y.blockType==="voice_input"?{...y,content:f}:y);r.updateAgentMessage(o,m.id,{contentBlocks:p}),h=!0;break}if(!h&&l&&l!==(s==null?void 0:s.deviceId)&&f){const m={id:u,sessionId:o,role:"user",contentBlocks:[{id:crypto.randomUUID(),blockType:"voice_input",content:f,metadata:{messageId:u}}],isStreaming:!1,createdAt:new Date,fromDeviceId:l};r.addAgentMessage(o,m)}}const pd="tiflis_credentials",pm="tiflis_device_id",SS="tiflis_encryption_key",mm="tiflis_security",ds="keys";class kk{constructor(){_e(this,"encryptionKey",null)}getDeviceId(){let r=localStorage.getItem(pm);return r||(r=crypto.randomUUID(),localStorage.setItem(pm,r)),r}async storeCredentials(r){const n=await this.getOrCreateEncryptionKey(),{encrypted:s,iv:o}=await this.encrypt(n,r.authKey),u={tunnelId:r.tunnelId,tunnelUrl:r.tunnelUrl,encryptedAuthKey:s,iv:o};localStorage.setItem(pd,JSON.stringify(u))}async getCredentials(){const r=localStorage.getItem(pd);if(!r)return null;try{const n=JSON.parse(r),s=await this.getOrCreateEncryptionKey(),o=await this.decrypt(s,n.encryptedAuthKey,n.iv);return{tunnelId:n.tunnelId,tunnelUrl:n.tunnelUrl,authKey:o,deviceId:this.getDeviceId()}}catch(n){return ze.error("Failed to decrypt credentials:",n),null}}hasCredentials(){return localStorage.getItem(pd)!==null}async forgetAll(){localStorage.removeItem(pd),localStorage.removeItem(pm);try{await this.deleteEncryptionKey()}catch(r){ze.error("Failed to delete encryption key:",r)}this.encryptionKey=null}async getOrCreateEncryptionKey(){if(this.encryptionKey)return this.encryptionKey;const r=await this.loadKeyFromDB();if(r)return this.encryptionKey=r,r;const n=await crypto.subtle.generateKey({name:"AES-GCM",length:256},!1,["encrypt","decrypt"]);return await this.saveKeyToDB(n),this.encryptionKey=n,n}async encrypt(r,n){const s=new TextEncoder,o=crypto.getRandomValues(new Uint8Array(12)),u=await crypto.subtle.encrypt({name:"AES-GCM",iv:o},r,s.encode(n));return{encrypted:this.bufferToBase64(new Uint8Array(u)),iv:this.bufferToBase64(o)}}async decrypt(r,n,s){const o=new TextDecoder,u=this.base64ToBuffer(s),f=this.base64ToBuffer(n),l=await crypto.subtle.decrypt({name:"AES-GCM",iv:u.buffer},r,f.buffer);return o.decode(l)}loadKeyFromDB(){return new Promise((r,n)=>{const s=indexedDB.open(mm,1);s.onerror=()=>n(s.error),s.onupgradeneeded=()=>{const o=s.result;o.objectStoreNames.contains(ds)||o.createObjectStore(ds)},s.onsuccess=()=>{const o=s.result;try{const l=o.transaction(ds,"readonly").objectStore(ds).get(SS);l.onerror=()=>{o.close(),n(l.error)},l.onsuccess=()=>{o.close(),r(l.result??null)}}catch(u){o.close(),n(u)}}})}saveKeyToDB(r){return new Promise((n,s)=>{const o=indexedDB.open(mm,1);o.onerror=()=>s(o.error),o.onupgradeneeded=()=>{const u=o.result;u.objectStoreNames.contains(ds)||u.createObjectStore(ds)},o.onsuccess=()=>{const u=o.result;try{const f=u.transaction(ds,"readwrite");f.objectStore(ds).put(r,SS),f.oncomplete=()=>{u.close(),n()},f.onerror=()=>{u.close(),s(f.error)}}catch(f){u.close(),s(f)}}})}deleteEncryptionKey(){return new Promise((r,n)=>{const s=indexedDB.deleteDatabase(mm);s.onblocked=()=>{ze.warn("IndexedDB delete blocked by open connections, resolving anyway"),r()},s.onerror=()=>n(s.error),s.onsuccess=()=>r()})}bufferToBase64(r){let n="";for(let s=0;s<r.byteLength;s++)n+=String.fromCharCode(r[s]);return btoa(n)}base64ToBuffer(r){const n=atob(r),s=new Uint8Array(n.length);for(let o=0;o<n.length;o++)s[o]=n.charCodeAt(o);return s}}const md=new kk;function co(){const e=R.useRef(!1),r=R.useRef(new Map),n=Ve(F=>F.setConnectionState),s=Ve(F=>F.setWorkstationOnline),o=Ve(F=>F.setAuthenticated),u=Ve(F=>F.setCredentials),f=Ve(F=>F.credentials),l=Ve(F=>F.connectionState),c=ut(F=>F.addSupervisorMessage),h=ut(F=>F.setSupervisorIsLoading),m=ut(F=>F.addPendingAck),p=ut(F=>F.setMessageSendStatus);R.useEffect(()=>{if(e.current)return;e.current=!0,Mt.init({onConnectionStateChange:ee=>{n(ee),ee==="authenticated"||ee==="verified"?s(!0):(ee==="disconnected"||ee==="error")&&s(!1)},onMessage:mk,onWorkstationOnline:()=>s(!0),onWorkstationOffline:()=>s(!1)}),(async()=>{const ee=await md.getCredentials();if(ee){u(ee),o(!0);try{await Mt.connect(ee)}catch(Y){ze.error("Auto-connect failed:",Y)}}})();const F=r.current;return()=>{F.forEach(ee=>{clearTimeout(ee)}),F.clear()}},[n,s,o,u]);const y=R.useCallback(async F=>{const ee=md.getDeviceId(),Y={...F,deviceId:ee};await md.storeCredentials(F),u(Y);try{await Mt.connect(Y),o(!0)}catch(re){throw o(!1),re}},[u,o]),x=R.useCallback(()=>{Mt.disconnect(),o(!1)},[o]),A=R.useCallback(async()=>{Mt.disconnect(),await md.forgetAll(),Ve.getState().reset(),ut.getState().reset()},[]),w=R.useCallback(async F=>{const ee=crypto.randomUUID();c({id:ee,sessionId:"supervisor",role:"user",contentBlocks:[{id:crypto.randomUUID(),blockType:"text",content:F}],isStreaming:!1,createdAt:new Date,sendStatus:"pending",fromDeviceId:f==null?void 0:f.deviceId}),m(ee),h(!0);const Y={type:"supervisor.command",id:ee,payload:{command:F}};Mt.send(Y);const re=setTimeout(()=>{r.current.delete(ee);const te=ut.getState();te.pendingMessageAcks.has(ee)&&(te.removePendingAck(ee),p(ee,"failed"))},5e3);r.current.set(ee,re)},[f,l]),v=R.useCallback(async(F,ee)=>{const Y=crypto.randomUUID(),re=ut.getState();re.addAgentMessage(F,{id:Y,sessionId:F,role:"user",contentBlocks:[{id:crypto.randomUUID(),blockType:"text",content:ee}],isStreaming:!1,createdAt:new Date,sendStatus:"pending",fromDeviceId:f==null?void 0:f.deviceId}),re.addPendingAck(Y),re.setAgentIsLoading(F,!0);const te={type:"session.execute",id:Y,session_id:F,payload:{content:ee}};Mt.send(te);const O=setTimeout(()=>{r.current.delete(Y);const G=ut.getState();G.pendingMessageAcks.has(Y)&&(G.removePendingAck(Y),G.setMessageSendStatus(Y,"failed"))},5e3);r.current.set(Y,O)},[f]),S=R.useCallback(async(F,ee,Y,re,te)=>{const O={type:"supervisor.create_session",id:crypto.randomUUID(),payload:{session_type:F,agent_name:te,workspace:ee,project:Y,worktree:re}};return Mt.sendRequest(O)},[]),g=R.useCallback(F=>{const ee={type:"session.subscribe",session_id:F};Mt.send(ee)},[]),_=R.useCallback((F,ee)=>{const Y={type:"session.input",session_id:F,payload:{data:ee}};Mt.send(Y)},[]),T=R.useCallback((F,ee,Y)=>{const re={type:"session.resize",session_id:F,payload:{cols:ee,rows:Y}};Mt.send(re)},[]),M=R.useCallback((F,ee=0,Y=500)=>{const re={type:"session.replay",session_id:F,payload:{since_sequence:ee,limit:Y}};Mt.send(re),ze.debug("Requested terminal replay",{sessionId:F,sinceSequence:ee,limit:Y})},[]),k=R.useCallback(()=>{Mt.send({type:"supervisor.cancel",id:crypto.randomUUID()}),h(!1)},[h]),L=R.useCallback(F=>{Mt.send({type:"session.cancel",id:crypto.randomUUID(),session_id:F}),ut.getState().setAgentIsLoading(F,!1)},[]),D=R.useCallback(async(F,ee)=>{if(!f){ze.error("Cannot send supervisor voice command: Not authenticated");return}if(l!=="verified"&&l!=="authenticated"){ze.error("Cannot send supervisor voice command: Not connected",{connectionState:l});return}const Y=crypto.randomUUID();on.voice(`Sending supervisor voice command: format=${ee}, audioSize=${F.length}, messageId=${Y}`),c({id:Y,sessionId:"supervisor",role:"user",contentBlocks:[{id:crypto.randomUUID(),blockType:"voice_input",content:"",metadata:{audioBase64:F,messageId:Y}}],isStreaming:!1,createdAt:new Date,sendStatus:"pending",fromDeviceId:f==null?void 0:f.deviceId});const re=crypto.randomUUID();c({id:re,sessionId:"supervisor",role:"assistant",contentBlocks:[],isStreaming:!0,createdAt:new Date}),ut.getState().setSupervisorStreamingMessageId(re),m(Y),h(!0);const O={type:"supervisor.command",id:Y,payload:{audio:F,audio_format:ee,message_id:Y}};on.voice("WebSocket sending supervisor voice:",O),Mt.send(O);const G=setTimeout(()=>{r.current.delete(Y);const j=ut.getState();j.pendingMessageAcks.has(Y)&&(ze.warn(`Voice message ACK timeout: ${Y}`),j.removePendingAck(Y),p(Y,"failed"))},1e4);r.current.set(Y,G)},[f,l,c,m,h,p]),P=R.useCallback(async(F,ee,Y)=>{if(!f){ze.error("Cannot send agent voice command: Not authenticated");return}if(l!=="verified"&&l!=="authenticated"){ze.error("Cannot send agent voice command: Not connected",{connectionState:l});return}const re=crypto.randomUUID(),te=ut.getState();on.voice(`Sending agent voice command: sessionId=${F}, format=${Y}, audioSize=${ee.length}, messageId=${re}`),te.addAgentMessage(F,{id:re,sessionId:F,role:"user",contentBlocks:[{id:crypto.randomUUID(),blockType:"voice_input",content:"",metadata:{audioBase64:ee,messageId:re}}],isStreaming:!1,createdAt:new Date,sendStatus:"pending",fromDeviceId:f==null?void 0:f.deviceId});const O=crypto.randomUUID();te.addAgentMessage(F,{id:O,sessionId:F,role:"assistant",contentBlocks:[],isStreaming:!0,createdAt:new Date}),te.setAgentStreamingMessageId(F,O),te.addPendingAck(re),te.setAgentIsLoading(F,!0);const G={type:"session.execute",id:re,session_id:F,payload:{audio:ee,audio_format:Y,message_id:re}};Mt.send(G);const j=setTimeout(()=>{r.current.delete(re);const q=ut.getState();q.pendingMessageAcks.has(re)&&(q.removePendingAck(re),q.setMessageSendStatus(re,"failed"))},1e4);r.current.set(re,j)},[f,l]),K=R.useCallback(()=>{Mt.send({type:"supervisor.clear_context",id:crypto.randomUUID()}),ut.getState().clearSupervisorMessages()},[]),$=R.useCallback(()=>{const F={type:"sync",id:crypto.randomUUID()};Mt.send(F)},[]),z=R.useCallback((F,ee,Y=20)=>{const re={type:"history.request",id:crypto.randomUUID(),payload:{session_id:F,before_sequence:ee,limit:Y}};Mt.send(re)},[]),W=R.useCallback(F=>{Mt.send({type:"supervisor.terminate_session",id:crypto.randomUUID(),payload:{session_id:F}})},[]);return{connect:y,disconnect:x,disconnectAndForget:A,sendSupervisorCommand:w,sendAgentCommand:v,sendSupervisorVoiceCommand:D,sendAgentVoiceCommand:P,createSession:S,subscribeToSession:g,sendTerminalInput:_,resizeTerminal:T,requestTerminalReplay:M,cancelSupervisor:k,cancelAgent:L,clearSupervisorContext:K,terminateSession:W,requestSync:$,requestHistory:z,isConnected:Mt.isConnected}}const h1="(prefers-color-scheme: dark)",Lk="ui-theme",f1=R.createContext(void 0);function gm(){return typeof window>"u"||window.matchMedia(h1).matches?"dark":"light"}function Ok({children:e,defaultTheme:r="system",storageKey:n=Lk}){const[s,o]=R.useState(()=>localStorage.getItem(n)||r),[u,f]=R.useState(()=>s==="system"?gm():s);R.useEffect(()=>{const c=window.document.documentElement;c.classList.remove("light","dark");const h=s==="system"?gm():s;c.classList.add(h),f(h)},[s]),R.useEffect(()=>{const c=window.matchMedia(h1),h=()=>{if(s==="system"){const m=window.document.documentElement,p=gm();m.classList.remove("light","dark"),m.classList.add(p),f(p)}};return c.addEventListener("change",h),()=>c.removeEventListener("change",h)},[s]);const l=c=>{localStorage.setItem(n,c),o(c)};return b.jsx(f1.Provider,{value:{theme:s,setTheme:l,resolvedTheme:u},children:e})}function Kg(){const e=R.useContext(f1);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}function p1(e){return b.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64",...e,children:[b.jsx("defs",{children:b.jsxs("linearGradient",{id:"tiflis-accent",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[b.jsx("stop",{offset:"0%",stopColor:"#2E5AA6"}),b.jsx("stop",{offset:"100%",stopColor:"#6F4ABF"})]})}),b.jsx("rect",{width:"64",height:"64",rx:"12",fill:"#111"}),b.jsx("path",{d:"M 14 20 L 10 26 L 10 42 L 14 48",fill:"none",stroke:"#2E5AA6",strokeWidth:"2.6",strokeLinecap:"round"}),b.jsx("path",{d:"M 50 20 L 54 26 L 54 42 L 50 48",fill:"none",stroke:"#6F4ABF",strokeWidth:"2.6",strokeLinecap:"round"}),b.jsx("text",{x:"14",y:"46",fontFamily:"monospace",fontSize:"23",fill:"url(#tiflis-accent)",children:"›"}),b.jsx("text",{x:"32",y:"47",textAnchor:"middle",fontFamily:"system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif",fontSize:"47",fontWeight:"500",fill:"#fff",children:"t"})]})}function ga(e){return b.jsx(p1,{...e})}function Ea({className:e,...r}){return b.jsx("img",{src:"/icons/claude-logo.png",alt:"Claude Code",className:e,...r})}function Aa({className:e,...r}){const{resolvedTheme:n}=Kg(),s=n==="dark"?"/icons/opencode-logo-dark.png":"/icons/opencode-logo-light.png";return b.jsx("img",{src:s,alt:"OpenCode",className:e,...r})}function Ta({className:e,...r}){return b.jsx("img",{src:"/icons/cursor-logo.png",alt:"Cursor",className:e,...r})}function va(e){return b.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[b.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),b.jsx("path",{d:"M7 9l3 3-3 3"}),b.jsx("path",{d:"M13 15h4"})]})}function xi(e){return b.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[b.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),b.jsx("circle",{cx:"12",cy:"10",r:"3"}),b.jsx("path",{d:"M7 20v-1a5 5 0 0 1 10 0v1"})]})}function Bk(){const[e,r]=R.useState(""),[n,s]=R.useState(!1),[o,u]=R.useState(null),[f,l]=R.useState(!1),{connect:c}=co(),h=R.useCallback(async y=>{u(null);const x=y??e.trim(),A=S2(x);if(!A){u("Invalid magic link format");return}s(!0);try{await c({tunnelId:A.tunnelId,tunnelUrl:A.url,authKey:A.key})}catch(w){u(w instanceof Error?w.message:"Connection failed"),s(!1)}},[c,e]),m=R.useCallback(y=>{l(!1),r(y),h(y)},[h]),p=y=>{y.key==="Enter"&&!y.shiftKey&&(y.preventDefault(),h())};return b.jsx("div",{className:"min-h-screen flex items-center justify-center p-4 bg-background",children:b.jsxs(fs,{className:"w-full max-w-md",children:[b.jsxs(ps,{className:"text-center",children:[b.jsx("div",{className:"mx-auto mb-4 w-16 h-16 rounded-lg overflow-hidden",children:b.jsx(p1,{className:"w-16 h-16"})}),b.jsx(ms,{className:"text-2xl",children:"Tiflis Code"}),b.jsx(Xs,{children:"Connect to your workstation to control AI agents remotely"})]}),b.jsx(gs,{className:"space-y-4",children:f?b.jsx(tk,{onScan:m,onBack:()=>l(!1)}):b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"space-y-2",children:[b.jsx(nC,{placeholder:"Paste magic link here...",value:e,onChange:y=>r(y.target.value),onKeyDown:p,disabled:n}),o&&b.jsx("p",{className:"text-sm text-destructive",children:o})]}),b.jsx(dt,{className:"w-full",onClick:()=>h(),disabled:!e.trim()||n,children:n?b.jsxs(b.Fragment,{children:[b.jsx(wc,{className:"animate-spin"}),"Connecting..."]}):b.jsxs(b.Fragment,{children:[b.jsx(qM,{}),"Connect"]})}),b.jsxs("div",{className:"relative",children:[b.jsx("div",{className:"absolute inset-0 flex items-center",children:b.jsx("span",{className:"w-full border-t"})}),b.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:b.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"Or"})})]}),b.jsxs(dt,{variant:"outline",className:"w-full",onClick:()=>l(!0),disabled:n,children:[b.jsx(QM,{}),"Scan QR Code"]})]})})]})})}function Le(e,r,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return r==null?void 0:r(o)}}function Nk(e,r){const n=R.createContext(r),s=u=>{const{children:f,...l}=u,c=R.useMemo(()=>l,Object.values(l));return b.jsx(n.Provider,{value:c,children:f})};s.displayName=e+"Provider";function o(u){const f=R.useContext(n);if(f)return f;if(r!==void 0)return r;throw new Error(`\`${u}\` must be used within \`${e}\``)}return[s,o]}function qn(e,r=[]){let n=[];function s(u,f){const l=R.createContext(f),c=n.length;n=[...n,f];const h=p=>{var S;const{scope:y,children:x,...A}=p,w=((S=y==null?void 0:y[e])==null?void 0:S[c])||l,v=R.useMemo(()=>A,Object.values(A));return b.jsx(w.Provider,{value:v,children:x})};h.displayName=u+"Provider";function m(p,y){var w;const x=((w=y==null?void 0:y[e])==null?void 0:w[c])||l,A=R.useContext(x);if(A)return A;if(f!==void 0)return f;throw new Error(`\`${p}\` must be used within \`${u}\``)}return[h,m]}const o=()=>{const u=n.map(f=>R.createContext(f));return function(l){const c=(l==null?void 0:l[e])||u;return R.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[s,Ik(o,...r)]}function Ik(...e){const r=e[0];if(e.length===1)return r;const n=()=>{const s=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(u){const f=s.reduce((l,{useScope:c,scopeName:h})=>{const p=c(u)[`__scope${h}`];return{...l,...p}},{});return R.useMemo(()=>({[`__scope${r.scopeName}`]:f}),[f])}};return n.scopeName=r.scopeName,n}var pr=globalThis!=null&&globalThis.document?R.useLayoutEffect:()=>{},Pk=kg[" useId ".trim().toString()]||(()=>{}),jk=0;function jn(e){const[r,n]=R.useState(Pk());return pr(()=>{n(s=>s??String(jk++))},[e]),r?`radix-${r}`:""}var Uk=kg[" useInsertionEffect ".trim().toString()]||pr;function ro({prop:e,defaultProp:r,onChange:n=()=>{},caller:s}){const[o,u,f]=Fk({defaultProp:r,onChange:n}),l=e!==void 0,c=l?e:o;{const m=R.useRef(e!==void 0);R.useEffect(()=>{const p=m.current;p!==l&&console.warn(`${s} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=l},[l,s])}const h=R.useCallback(m=>{var p;if(l){const y=Hk(m)?m(e):m;y!==e&&((p=f.current)==null||p.call(f,y))}else u(m)},[l,e,u,f]);return[c,h]}function Fk({defaultProp:e,onChange:r}){const[n,s]=R.useState(e),o=R.useRef(n),u=R.useRef(r);return Uk(()=>{u.current=r},[r]),R.useEffect(()=>{var f;o.current!==n&&((f=u.current)==null||f.call(u,n),o.current=n)},[n,o]),[n,s,u]}function Hk(e){return typeof e=="function"}function no(e){const r=Vk(e),n=R.forwardRef((s,o)=>{const{children:u,...f}=s,l=R.Children.toArray(u),c=l.find(Gk);if(c){const h=c.props.children,m=l.map(p=>p===c?R.Children.count(h)>1?R.Children.only(null):R.isValidElement(h)?h.props.children:null:p);return b.jsx(r,{...f,ref:o,children:R.isValidElement(h)?R.cloneElement(h,void 0,m):null})}return b.jsx(r,{...f,ref:o,children:u})});return n.displayName=`${e}.Slot`,n}function Vk(e){const r=R.forwardRef((n,s)=>{const{children:o,...u}=n;if(R.isValidElement(o)){const f=Yk(o),l=zk(u,o.props);return o.type!==R.Fragment&&(l.ref=s?Cc(s,f):f),R.cloneElement(o,l)}return R.Children.count(o)>1?R.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var m1=Symbol("radix.slottable");function qk(e){const r=({children:n})=>b.jsx(b.Fragment,{children:n});return r.displayName=`${e}.Slottable`,r.__radixId=m1,r}function Gk(e){return R.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===m1}function zk(e,r){const n={...r};for(const s in r){const o=e[s],u=r[s];/^on[A-Z]/.test(s)?o&&u?n[s]=(...l)=>{const c=u(...l);return o(...l),c}:o&&(n[s]=o):s==="style"?n[s]={...o,...u}:s==="className"&&(n[s]=[o,u].filter(Boolean).join(" "))}return{...e,...n}}function Yk(e){var s,o;let r=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=r&&"isReactWarning"in r&&r.isReactWarning;return n?e.ref:(r=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=r&&"isReactWarning"in r&&r.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Wk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Je=Wk.reduce((e,r)=>{const n=no(`Primitive.${r}`),s=R.forwardRef((o,u)=>{const{asChild:f,...l}=o,c=f?n:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(c,{...l,ref:u})});return s.displayName=`Primitive.${r}`,{...e,[r]:s}},{});function g1(e,r){e&&bc.flushSync(()=>e.dispatchEvent(r))}function Fn(e){const r=R.useRef(e);return R.useEffect(()=>{r.current=e}),R.useMemo(()=>(...n)=>{var s;return(s=r.current)==null?void 0:s.call(r,...n)},[])}function Kk(e,r=globalThis==null?void 0:globalThis.document){const n=Fn(e);R.useEffect(()=>{const s=o=>{o.key==="Escape"&&n(o)};return r.addEventListener("keydown",s,{capture:!0}),()=>r.removeEventListener("keydown",s,{capture:!0})},[n,r])}var Qk="DismissableLayer",ig="dismissableLayer.update",$k="dismissableLayer.pointerDownOutside",Jk="dismissableLayer.focusOutside",bS,v1=R.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),xc=R.forwardRef((e,r)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:u,onInteractOutside:f,onDismiss:l,...c}=e,h=R.useContext(v1),[m,p]=R.useState(null),y=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=R.useState({}),A=ot(r,L=>p(L)),w=Array.from(h.layers),[v]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),S=w.indexOf(v),g=m?w.indexOf(m):-1,_=h.layersWithOutsidePointerEventsDisabled.size>0,T=g>=S,M=eL(L=>{const D=L.target,P=[...h.branches].some(K=>K.contains(D));!T||P||(o==null||o(L),f==null||f(L),L.defaultPrevented||l==null||l())},y),k=tL(L=>{const D=L.target;[...h.branches].some(K=>K.contains(D))||(u==null||u(L),f==null||f(L),L.defaultPrevented||l==null||l())},y);return Kk(L=>{g===h.layers.size-1&&(s==null||s(L),!L.defaultPrevented&&l&&(L.preventDefault(),l()))},y),R.useEffect(()=>{if(m)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(bS=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(m)),h.layers.add(m),CS(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=bS)}},[m,y,n,h]),R.useEffect(()=>()=>{m&&(h.layers.delete(m),h.layersWithOutsidePointerEventsDisabled.delete(m),CS())},[m,h]),R.useEffect(()=>{const L=()=>x({});return document.addEventListener(ig,L),()=>document.removeEventListener(ig,L)},[]),b.jsx(Je.div,{...c,ref:A,style:{pointerEvents:_?T?"auto":"none":void 0,...e.style},onFocusCapture:Le(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Le(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Le(e.onPointerDownCapture,M.onPointerDownCapture)})});xc.displayName=Qk;var Zk="DismissableLayerBranch",Xk=R.forwardRef((e,r)=>{const n=R.useContext(v1),s=R.useRef(null),o=ot(r,s);return R.useEffect(()=>{const u=s.current;if(u)return n.branches.add(u),()=>{n.branches.delete(u)}},[n.branches]),b.jsx(Je.div,{...e,ref:o})});Xk.displayName=Zk;function eL(e,r=globalThis==null?void 0:globalThis.document){const n=Fn(e),s=R.useRef(!1),o=R.useRef(()=>{});return R.useEffect(()=>{const u=l=>{if(l.target&&!s.current){let c=function(){_1($k,n,h,{discrete:!0})};const h={originalEvent:l};l.pointerType==="touch"?(r.removeEventListener("click",o.current),o.current=c,r.addEventListener("click",o.current,{once:!0})):c()}else r.removeEventListener("click",o.current);s.current=!1},f=window.setTimeout(()=>{r.addEventListener("pointerdown",u)},0);return()=>{window.clearTimeout(f),r.removeEventListener("pointerdown",u),r.removeEventListener("click",o.current)}},[r,n]),{onPointerDownCapture:()=>s.current=!0}}function tL(e,r=globalThis==null?void 0:globalThis.document){const n=Fn(e),s=R.useRef(!1);return R.useEffect(()=>{const o=u=>{u.target&&!s.current&&_1(Jk,n,{originalEvent:u},{discrete:!1})};return r.addEventListener("focusin",o),()=>r.removeEventListener("focusin",o)},[r,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function CS(){const e=new CustomEvent(ig);document.dispatchEvent(e)}function _1(e,r,n,{discrete:s}){const o=n.originalEvent.target,u=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});r&&o.addEventListener(e,r,{once:!0}),s?g1(o,u):o.dispatchEvent(u)}var vm="focusScope.autoFocusOnMount",_m="focusScope.autoFocusOnUnmount",wS={bubbles:!1,cancelable:!0},rL="FocusScope",Ec=R.forwardRef((e,r)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:o,onUnmountAutoFocus:u,...f}=e,[l,c]=R.useState(null),h=Fn(o),m=Fn(u),p=R.useRef(null),y=ot(r,w=>c(w)),x=R.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;R.useEffect(()=>{if(s){let w=function(_){if(x.paused||!l)return;const T=_.target;l.contains(T)?p.current=T:hs(p.current,{select:!0})},v=function(_){if(x.paused||!l)return;const T=_.relatedTarget;T!==null&&(l.contains(T)||hs(p.current,{select:!0}))},S=function(_){if(document.activeElement===document.body)for(const M of _)M.removedNodes.length>0&&hs(l)};document.addEventListener("focusin",w),document.addEventListener("focusout",v);const g=new MutationObserver(S);return l&&g.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",v),g.disconnect()}}},[s,l,x.paused]),R.useEffect(()=>{if(l){ES.add(x);const w=document.activeElement;if(!l.contains(w)){const S=new CustomEvent(vm,wS);l.addEventListener(vm,h),l.dispatchEvent(S),S.defaultPrevented||(nL(lL(y1(l)),{select:!0}),document.activeElement===w&&hs(l))}return()=>{l.removeEventListener(vm,h),setTimeout(()=>{const S=new CustomEvent(_m,wS);l.addEventListener(_m,m),l.dispatchEvent(S),S.defaultPrevented||hs(w??document.body,{select:!0}),l.removeEventListener(_m,m),ES.remove(x)},0)}}},[l,h,m,x]);const A=R.useCallback(w=>{if(!n&&!s||x.paused)return;const v=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,S=document.activeElement;if(v&&S){const g=w.currentTarget,[_,T]=iL(g);_&&T?!w.shiftKey&&S===T?(w.preventDefault(),n&&hs(_,{select:!0})):w.shiftKey&&S===_&&(w.preventDefault(),n&&hs(T,{select:!0})):S===g&&w.preventDefault()}},[n,s,x.paused]);return b.jsx(Je.div,{tabIndex:-1,...f,ref:y,onKeyDown:A})});Ec.displayName=rL;function nL(e,{select:r=!1}={}){const n=document.activeElement;for(const s of e)if(hs(s,{select:r}),document.activeElement!==n)return}function iL(e){const r=y1(e),n=xS(r,e),s=xS(r.reverse(),e);return[n,s]}function y1(e){const r=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const o=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||o?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)r.push(n.currentNode);return r}function xS(e,r){for(const n of e)if(!sL(n,{upTo:r}))return n}function sL(e,{upTo:r}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(r!==void 0&&e===r)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function oL(e){return e instanceof HTMLInputElement&&"select"in e}function hs(e,{select:r=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&oL(e)&&r&&e.select()}}var ES=aL();function aL(){let e=[];return{add(r){const n=e[0];r!==n&&(n==null||n.pause()),e=AS(e,r),e.unshift(r)},remove(r){var n;e=AS(e,r),(n=e[0])==null||n.resume()}}}function AS(e,r){const n=[...e],s=n.indexOf(r);return s!==-1&&n.splice(s,1),n}function lL(e){return e.filter(r=>r.tagName!=="A")}var cL="Portal",Ac=R.forwardRef((e,r)=>{var l;const{container:n,...s}=e,[o,u]=R.useState(!1);pr(()=>u(!0),[]);const f=n||o&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return f?MD.createPortal(b.jsx(Je.div,{...s,ref:r}),f):null});Ac.displayName=cL;function uL(e,r){return R.useReducer((n,s)=>r[n][s]??n,e)}var Gn=e=>{const{present:r,children:n}=e,s=dL(r),o=typeof n=="function"?n({present:s.isPresent}):R.Children.only(n),u=ot(s.ref,hL(o));return typeof n=="function"||s.isPresent?R.cloneElement(o,{ref:u}):null};Gn.displayName="Presence";function dL(e){const[r,n]=R.useState(),s=R.useRef(null),o=R.useRef(e),u=R.useRef("none"),f=e?"mounted":"unmounted",[l,c]=uL(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return R.useEffect(()=>{const h=gd(s.current);u.current=l==="mounted"?h:"none"},[l]),pr(()=>{const h=s.current,m=o.current;if(m!==e){const y=u.current,x=gd(h);e?c("MOUNT"):x==="none"||(h==null?void 0:h.display)==="none"?c("UNMOUNT"):c(m&&y!==x?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),pr(()=>{if(r){let h;const m=r.ownerDocument.defaultView??window,p=x=>{const w=gd(s.current).includes(CSS.escape(x.animationName));if(x.target===r&&w&&(c("ANIMATION_END"),!o.current)){const v=r.style.animationFillMode;r.style.animationFillMode="forwards",h=m.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=v)})}},y=x=>{x.target===r&&(u.current=gd(s.current))};return r.addEventListener("animationstart",y),r.addEventListener("animationcancel",p),r.addEventListener("animationend",p),()=>{m.clearTimeout(h),r.removeEventListener("animationstart",y),r.removeEventListener("animationcancel",p),r.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[r,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:R.useCallback(h=>{s.current=h?getComputedStyle(h):null,n(h)},[])}}function gd(e){return(e==null?void 0:e.animationName)||"none"}function hL(e){var s,o;let r=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=r&&"isReactWarning"in r&&r.isReactWarning;return n?e.ref:(r=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=r&&"isReactWarning"in r&&r.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ym=0;function _h(){R.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??TS()),document.body.insertAdjacentElement("beforeend",e[1]??TS()),ym++,()=>{ym===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),ym--}},[])}function TS(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Nn=function(){return Nn=Object.assign||function(r){for(var n,s=1,o=arguments.length;s<o;s++){n=arguments[s];for(var u in n)Object.prototype.hasOwnProperty.call(n,u)&&(r[u]=n[u])}return r},Nn.apply(this,arguments)};function S1(e,r){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&r.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,s=Object.getOwnPropertySymbols(e);o<s.length;o++)r.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(e,s[o])&&(n[s[o]]=e[s[o]]);return n}function fL(e,r,n){if(n||arguments.length===2)for(var s=0,o=r.length,u;s<o;s++)(u||!(s in r))&&(u||(u=Array.prototype.slice.call(r,0,s)),u[s]=r[s]);return e.concat(u||Array.prototype.slice.call(r))}var Nd="right-scroll-bar-position",Id="width-before-scroll-bar",pL="with-scroll-bars-hidden",mL="--removed-body-scroll-bar-size";function Sm(e,r){return typeof e=="function"?e(r):e&&(e.current=r),e}function gL(e,r){var n=R.useState(function(){return{value:e,callback:r,facade:{get current(){return n.value},set current(s){var o=n.value;o!==s&&(n.value=s,n.callback(s,o))}}}})[0];return n.callback=r,n.facade}var vL=typeof window<"u"?R.useLayoutEffect:R.useEffect,RS=new WeakMap;function _L(e,r){var n=gL(null,function(s){return e.forEach(function(o){return Sm(o,s)})});return vL(function(){var s=RS.get(n);if(s){var o=new Set(s),u=new Set(e),f=n.current;o.forEach(function(l){u.has(l)||Sm(l,null)}),u.forEach(function(l){o.has(l)||Sm(l,f)})}RS.set(n,e)},[e]),n}function yL(e){return e}function SL(e,r){r===void 0&&(r=yL);var n=[],s=!1,o={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(u){var f=r(u,s);return n.push(f),function(){n=n.filter(function(l){return l!==f})}},assignSyncMedium:function(u){for(s=!0;n.length;){var f=n;n=[],f.forEach(u)}n={push:function(l){return u(l)},filter:function(){return n}}},assignMedium:function(u){s=!0;var f=[];if(n.length){var l=n;n=[],l.forEach(u),f=n}var c=function(){var m=f;f=[],m.forEach(u)},h=function(){return Promise.resolve().then(c)};h(),n={push:function(m){f.push(m),h()},filter:function(m){return f=f.filter(m),n}}}};return o}function bL(e){e===void 0&&(e={});var r=SL(null);return r.options=Nn({async:!0,ssr:!1},e),r}var b1=function(e){var r=e.sideCar,n=S1(e,["sideCar"]);if(!r)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=r.read();if(!s)throw new Error("Sidecar medium not found");return R.createElement(s,Nn({},n))};b1.isSideCarExport=!0;function CL(e,r){return e.useMedium(r),b1}var C1=bL(),bm=function(){},yh=R.forwardRef(function(e,r){var n=R.useRef(null),s=R.useState({onScrollCapture:bm,onWheelCapture:bm,onTouchMoveCapture:bm}),o=s[0],u=s[1],f=e.forwardProps,l=e.children,c=e.className,h=e.removeScrollBar,m=e.enabled,p=e.shards,y=e.sideCar,x=e.noRelative,A=e.noIsolation,w=e.inert,v=e.allowPinchZoom,S=e.as,g=S===void 0?"div":S,_=e.gapMode,T=S1(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=y,k=_L([n,r]),L=Nn(Nn({},T),o);return R.createElement(R.Fragment,null,m&&R.createElement(M,{sideCar:C1,removeScrollBar:h,shards:p,noRelative:x,noIsolation:A,inert:w,setCallbacks:u,allowPinchZoom:!!v,lockRef:n,gapMode:_}),f?R.cloneElement(R.Children.only(l),Nn(Nn({},L),{ref:k})):R.createElement(g,Nn({},L,{className:c,ref:k}),l))});yh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};yh.classNames={fullWidth:Id,zeroRight:Nd};var wL=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function xL(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var r=wL();return r&&e.setAttribute("nonce",r),e}function EL(e,r){e.styleSheet?e.styleSheet.cssText=r:e.appendChild(document.createTextNode(r))}function AL(e){var r=document.head||document.getElementsByTagName("head")[0];r.appendChild(e)}var TL=function(){var e=0,r=null;return{add:function(n){e==0&&(r=xL())&&(EL(r,n),AL(r)),e++},remove:function(){e--,!e&&r&&(r.parentNode&&r.parentNode.removeChild(r),r=null)}}},RL=function(){var e=TL();return function(r,n){R.useEffect(function(){return e.add(r),function(){e.remove()}},[r&&n])}},w1=function(){var e=RL(),r=function(n){var s=n.styles,o=n.dynamic;return e(s,o),null};return r},DL={left:0,top:0,right:0,gap:0},Cm=function(e){return parseInt(e||"",10)||0},ML=function(e){var r=window.getComputedStyle(document.body),n=r[e==="padding"?"paddingLeft":"marginLeft"],s=r[e==="padding"?"paddingTop":"marginTop"],o=r[e==="padding"?"paddingRight":"marginRight"];return[Cm(n),Cm(s),Cm(o)]},kL=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return DL;var r=ML(e),n=document.documentElement.clientWidth,s=window.innerWidth;return{left:r[0],top:r[1],right:r[2],gap:Math.max(0,s-n+r[2]-r[0])}},LL=w1(),ua="data-scroll-locked",OL=function(e,r,n,s){var o=e.left,u=e.top,f=e.right,l=e.gap;return n===void 0&&(n="margin"),`
331
+ .`.concat(pL,` {
332
+ overflow: hidden `).concat(s,`;
333
+ padding-right: `).concat(l,"px ").concat(s,`;
334
+ }
335
+ body[`).concat(ua,`] {
336
+ overflow: hidden `).concat(s,`;
337
+ overscroll-behavior: contain;
338
+ `).concat([r&&"position: relative ".concat(s,";"),n==="margin"&&`
339
+ padding-left: `.concat(o,`px;
340
+ padding-top: `).concat(u,`px;
341
+ padding-right: `).concat(f,`px;
342
+ margin-left:0;
343
+ margin-top:0;
344
+ margin-right: `).concat(l,"px ").concat(s,`;
345
+ `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(s,";")].filter(Boolean).join(""),`
346
+ }
347
+
348
+ .`).concat(Nd,` {
349
+ right: `).concat(l,"px ").concat(s,`;
350
+ }
351
+
352
+ .`).concat(Id,` {
353
+ margin-right: `).concat(l,"px ").concat(s,`;
354
+ }
355
+
356
+ .`).concat(Nd," .").concat(Nd,` {
357
+ right: 0 `).concat(s,`;
358
+ }
359
+
360
+ .`).concat(Id," .").concat(Id,` {
361
+ margin-right: 0 `).concat(s,`;
362
+ }
363
+
364
+ body[`).concat(ua,`] {
365
+ `).concat(mL,": ").concat(l,`px;
366
+ }
367
+ `)},DS=function(){var e=parseInt(document.body.getAttribute(ua)||"0",10);return isFinite(e)?e:0},BL=function(){R.useEffect(function(){return document.body.setAttribute(ua,(DS()+1).toString()),function(){var e=DS()-1;e<=0?document.body.removeAttribute(ua):document.body.setAttribute(ua,e.toString())}},[])},NL=function(e){var r=e.noRelative,n=e.noImportant,s=e.gapMode,o=s===void 0?"margin":s;BL();var u=R.useMemo(function(){return kL(o)},[o]);return R.createElement(LL,{styles:OL(u,!r,o,n?"":"!important")})},sg=!1;if(typeof window<"u")try{var vd=Object.defineProperty({},"passive",{get:function(){return sg=!0,!0}});window.addEventListener("test",vd,vd),window.removeEventListener("test",vd,vd)}catch{sg=!1}var na=sg?{passive:!1}:!1,IL=function(e){return e.tagName==="TEXTAREA"},x1=function(e,r){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[r]!=="hidden"&&!(n.overflowY===n.overflowX&&!IL(e)&&n[r]==="visible")},PL=function(e){return x1(e,"overflowY")},jL=function(e){return x1(e,"overflowX")},MS=function(e,r){var n=r.ownerDocument,s=r;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var o=E1(e,s);if(o){var u=A1(e,s),f=u[1],l=u[2];if(f>l)return!0}s=s.parentNode}while(s&&s!==n.body);return!1},UL=function(e){var r=e.scrollTop,n=e.scrollHeight,s=e.clientHeight;return[r,n,s]},FL=function(e){var r=e.scrollLeft,n=e.scrollWidth,s=e.clientWidth;return[r,n,s]},E1=function(e,r){return e==="v"?PL(r):jL(r)},A1=function(e,r){return e==="v"?UL(r):FL(r)},HL=function(e,r){return e==="h"&&r==="rtl"?-1:1},VL=function(e,r,n,s,o){var u=HL(e,window.getComputedStyle(r).direction),f=u*s,l=n.target,c=r.contains(l),h=!1,m=f>0,p=0,y=0;do{if(!l)break;var x=A1(e,l),A=x[0],w=x[1],v=x[2],S=w-v-u*A;(A||S)&&E1(e,l)&&(p+=S,y+=A);var g=l.parentNode;l=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&l!==document.body||c&&(r.contains(l)||r===l));return(m&&Math.abs(p)<1||!m&&Math.abs(y)<1)&&(h=!0),h},_d=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},kS=function(e){return[e.deltaX,e.deltaY]},LS=function(e){return e&&"current"in e?e.current:e},qL=function(e,r){return e[0]===r[0]&&e[1]===r[1]},GL=function(e){return`
368
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
369
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
370
+ `)},zL=0,ia=[];function YL(e){var r=R.useRef([]),n=R.useRef([0,0]),s=R.useRef(),o=R.useState(zL++)[0],u=R.useState(w1)[0],f=R.useRef(e);R.useEffect(function(){f.current=e},[e]),R.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var w=fL([e.lockRef.current],(e.shards||[]).map(LS),!0).filter(Boolean);return w.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=R.useCallback(function(w,v){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!f.current.allowPinchZoom;var S=_d(w),g=n.current,_="deltaX"in w?w.deltaX:g[0]-S[0],T="deltaY"in w?w.deltaY:g[1]-S[1],M,k=w.target,L=Math.abs(_)>Math.abs(T)?"h":"v";if("touches"in w&&L==="h"&&k.type==="range")return!1;var D=window.getSelection(),P=D&&D.anchorNode,K=P?P===k||P.contains(k):!1;if(K)return!1;var $=MS(L,k);if(!$)return!0;if($?M=L:(M=L==="v"?"h":"v",$=MS(L,k)),!$)return!1;if(!s.current&&"changedTouches"in w&&(_||T)&&(s.current=M),!M)return!0;var z=s.current||M;return VL(z,v,w,z==="h"?_:T)},[]),c=R.useCallback(function(w){var v=w;if(!(!ia.length||ia[ia.length-1]!==u)){var S="deltaY"in v?kS(v):_d(v),g=r.current.filter(function(M){return M.name===v.type&&(M.target===v.target||v.target===M.shadowParent)&&qL(M.delta,S)})[0];if(g&&g.should){v.cancelable&&v.preventDefault();return}if(!g){var _=(f.current.shards||[]).map(LS).filter(Boolean).filter(function(M){return M.contains(v.target)}),T=_.length>0?l(v,_[0]):!f.current.noIsolation;T&&v.cancelable&&v.preventDefault()}}},[]),h=R.useCallback(function(w,v,S,g){var _={name:w,delta:v,target:S,should:g,shadowParent:WL(S)};r.current.push(_),setTimeout(function(){r.current=r.current.filter(function(T){return T!==_})},1)},[]),m=R.useCallback(function(w){n.current=_d(w),s.current=void 0},[]),p=R.useCallback(function(w){h(w.type,kS(w),w.target,l(w,e.lockRef.current))},[]),y=R.useCallback(function(w){h(w.type,_d(w),w.target,l(w,e.lockRef.current))},[]);R.useEffect(function(){return ia.push(u),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:y}),document.addEventListener("wheel",c,na),document.addEventListener("touchmove",c,na),document.addEventListener("touchstart",m,na),function(){ia=ia.filter(function(w){return w!==u}),document.removeEventListener("wheel",c,na),document.removeEventListener("touchmove",c,na),document.removeEventListener("touchstart",m,na)}},[]);var x=e.removeScrollBar,A=e.inert;return R.createElement(R.Fragment,null,A?R.createElement(u,{styles:GL(o)}):null,x?R.createElement(NL,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function WL(e){for(var r=null;e!==null;)e instanceof ShadowRoot&&(r=e.host,e=e.host),e=e.parentNode;return r}const KL=CL(C1,YL);var Tc=R.forwardRef(function(e,r){return R.createElement(yh,Nn({},e,{ref:r,sideCar:KL}))});Tc.classNames=yh.classNames;var QL=function(e){if(typeof document>"u")return null;var r=Array.isArray(e)?e[0]:e;return r.ownerDocument.body},sa=new WeakMap,yd=new WeakMap,Sd={},wm=0,T1=function(e){return e&&(e.host||T1(e.parentNode))},$L=function(e,r){return r.map(function(n){if(e.contains(n))return n;var s=T1(n);return s&&e.contains(s)?s:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},JL=function(e,r,n,s){var o=$L(r,Array.isArray(e)?e:[e]);Sd[n]||(Sd[n]=new WeakMap);var u=Sd[n],f=[],l=new Set,c=new Set(o),h=function(p){!p||l.has(p)||(l.add(p),h(p.parentNode))};o.forEach(h);var m=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(y){if(l.has(y))m(y);else try{var x=y.getAttribute(s),A=x!==null&&x!=="false",w=(sa.get(y)||0)+1,v=(u.get(y)||0)+1;sa.set(y,w),u.set(y,v),f.push(y),w===1&&A&&yd.set(y,!0),v===1&&y.setAttribute(n,"true"),A||y.setAttribute(s,"true")}catch(S){console.error("aria-hidden: cannot operate on ",y,S)}})};return m(r),l.clear(),wm++,function(){f.forEach(function(p){var y=sa.get(p)-1,x=u.get(p)-1;sa.set(p,y),u.set(p,x),y||(yd.has(p)||p.removeAttribute(s),yd.delete(p)),x||p.removeAttribute(n)}),wm--,wm||(sa=new WeakMap,sa=new WeakMap,yd=new WeakMap,Sd={})}},Sh=function(e,r,n){n===void 0&&(n="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),o=QL(e);return o?(s.push.apply(s,Array.from(o.querySelectorAll("[aria-live], script"))),JL(s,o,n,"aria-hidden")):function(){return null}},bh="Dialog",[R1,D1]=qn(bh),[ZL,Sn]=R1(bh),M1=e=>{const{__scopeDialog:r,children:n,open:s,defaultOpen:o,onOpenChange:u,modal:f=!0}=e,l=R.useRef(null),c=R.useRef(null),[h,m]=ro({prop:s,defaultProp:o??!1,onChange:u,caller:bh});return b.jsx(ZL,{scope:r,triggerRef:l,contentRef:c,contentId:jn(),titleId:jn(),descriptionId:jn(),open:h,onOpenChange:m,onOpenToggle:R.useCallback(()=>m(p=>!p),[m]),modal:f,children:n})};M1.displayName=bh;var k1="DialogTrigger",L1=R.forwardRef((e,r)=>{const{__scopeDialog:n,...s}=e,o=Sn(k1,n),u=ot(r,o.triggerRef);return b.jsx(Je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Jg(o.open),...s,ref:u,onClick:Le(e.onClick,o.onOpenToggle)})});L1.displayName=k1;var Qg="DialogPortal",[XL,O1]=R1(Qg,{forceMount:void 0}),B1=e=>{const{__scopeDialog:r,forceMount:n,children:s,container:o}=e,u=Sn(Qg,r);return b.jsx(XL,{scope:r,forceMount:n,children:R.Children.map(s,f=>b.jsx(Gn,{present:n||u.open,children:b.jsx(Ac,{asChild:!0,container:o,children:f})}))})};B1.displayName=Qg;var Yd="DialogOverlay",N1=R.forwardRef((e,r)=>{const n=O1(Yd,e.__scopeDialog),{forceMount:s=n.forceMount,...o}=e,u=Sn(Yd,e.__scopeDialog);return u.modal?b.jsx(Gn,{present:s||u.open,children:b.jsx(tO,{...o,ref:r})}):null});N1.displayName=Yd;var eO=no("DialogOverlay.RemoveScroll"),tO=R.forwardRef((e,r)=>{const{__scopeDialog:n,...s}=e,o=Sn(Yd,n);return b.jsx(Tc,{as:eO,allowPinchZoom:!0,shards:[o.contentRef],children:b.jsx(Je.div,{"data-state":Jg(o.open),...s,ref:r,style:{pointerEvents:"auto",...s.style}})})}),io="DialogContent",I1=R.forwardRef((e,r)=>{const n=O1(io,e.__scopeDialog),{forceMount:s=n.forceMount,...o}=e,u=Sn(io,e.__scopeDialog);return b.jsx(Gn,{present:s||u.open,children:u.modal?b.jsx(rO,{...o,ref:r}):b.jsx(nO,{...o,ref:r})})});I1.displayName=io;var rO=R.forwardRef((e,r)=>{const n=Sn(io,e.__scopeDialog),s=R.useRef(null),o=ot(r,n.contentRef,s);return R.useEffect(()=>{const u=s.current;if(u)return Sh(u)},[]),b.jsx(P1,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Le(e.onCloseAutoFocus,u=>{var f;u.preventDefault(),(f=n.triggerRef.current)==null||f.focus()}),onPointerDownOutside:Le(e.onPointerDownOutside,u=>{const f=u.detail.originalEvent,l=f.button===0&&f.ctrlKey===!0;(f.button===2||l)&&u.preventDefault()}),onFocusOutside:Le(e.onFocusOutside,u=>u.preventDefault())})}),nO=R.forwardRef((e,r)=>{const n=Sn(io,e.__scopeDialog),s=R.useRef(!1),o=R.useRef(!1);return b.jsx(P1,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{var f,l;(f=e.onCloseAutoFocus)==null||f.call(e,u),u.defaultPrevented||(s.current||(l=n.triggerRef.current)==null||l.focus(),u.preventDefault()),s.current=!1,o.current=!1},onInteractOutside:u=>{var c,h;(c=e.onInteractOutside)==null||c.call(e,u),u.defaultPrevented||(s.current=!0,u.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const f=u.target;((h=n.triggerRef.current)==null?void 0:h.contains(f))&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&o.current&&u.preventDefault()}})}),P1=R.forwardRef((e,r)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:u,...f}=e,l=Sn(io,n),c=R.useRef(null),h=ot(r,c);return _h(),b.jsxs(b.Fragment,{children:[b.jsx(Ec,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:u,children:b.jsx(xc,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Jg(l.open),...f,ref:h,onDismiss:()=>l.onOpenChange(!1)})}),b.jsxs(b.Fragment,{children:[b.jsx(sO,{titleId:l.titleId}),b.jsx(aO,{contentRef:c,descriptionId:l.descriptionId})]})]})}),$g="DialogTitle",j1=R.forwardRef((e,r)=>{const{__scopeDialog:n,...s}=e,o=Sn($g,n);return b.jsx(Je.h2,{id:o.titleId,...s,ref:r})});j1.displayName=$g;var U1="DialogDescription",F1=R.forwardRef((e,r)=>{const{__scopeDialog:n,...s}=e,o=Sn(U1,n);return b.jsx(Je.p,{id:o.descriptionId,...s,ref:r})});F1.displayName=U1;var H1="DialogClose",V1=R.forwardRef((e,r)=>{const{__scopeDialog:n,...s}=e,o=Sn(H1,n);return b.jsx(Je.button,{type:"button",...s,ref:r,onClick:Le(e.onClick,()=>o.onOpenChange(!1))})});V1.displayName=H1;function Jg(e){return e?"open":"closed"}var q1="DialogTitleWarning",[iO,G1]=Nk(q1,{contentName:io,titleName:$g,docsSlug:"dialog"}),sO=({titleId:e})=>{const r=G1(q1),n=`\`${r.contentName}\` requires a \`${r.titleName}\` for the component to be accessible for screen reader users.
371
+
372
+ If you want to hide the \`${r.titleName}\`, you can wrap it with our VisuallyHidden component.
373
+
374
+ For more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;return R.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},oO="DialogDescriptionWarning",aO=({contentRef:e,descriptionId:r})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${G1(oO).contentName}}.`;return R.useEffect(()=>{var u;const o=(u=e.current)==null?void 0:u.getAttribute("aria-describedby");r&&o&&(document.getElementById(r)||console.warn(s))},[s,e,r]),null},z1=M1,Y1=L1,W1=B1,Zg=N1,Xg=I1,ev=j1,tv=F1,rv=V1;const lO=z1,cO=Y1,uO=W1,K1=R.forwardRef(({className:e,...r},n)=>b.jsx(Zg,{ref:n,className:Te("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r}));K1.displayName=Zg.displayName;const Q1=R.forwardRef(({className:e,children:r,...n},s)=>b.jsxs(uO,{children:[b.jsx(K1,{}),b.jsxs(Xg,{ref:s,className:Te("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[r,b.jsxs(rv,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[b.jsx(Wg,{className:"h-4 w-4"}),b.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Q1.displayName=Xg.displayName;const $1=({className:e,...r})=>b.jsx("div",{className:Te("flex flex-col space-y-1.5 text-center sm:text-left",e),...r});$1.displayName="DialogHeader";const J1=({className:e,...r})=>b.jsx("div",{className:Te("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});J1.displayName="DialogFooter";const Z1=R.forwardRef(({className:e,...r},n)=>b.jsx(ev,{ref:n,className:Te("text-lg font-semibold leading-none tracking-tight",e),...r}));Z1.displayName=ev.displayName;const X1=R.forwardRef(({className:e,...r},n)=>b.jsx(tv,{ref:n,className:Te("text-sm text-muted-foreground",e),...r}));X1.displayName=tv.displayName;function OS(e,[r,n]){return Math.min(n,Math.max(r,e))}function nv(e){const r=e+"CollectionProvider",[n,s]=qn(r),[o,u]=n(r,{collectionRef:{current:null},itemMap:new Map}),f=w=>{const{scope:v,children:S}=w,g=nn.useRef(null),_=nn.useRef(new Map).current;return b.jsx(o,{scope:v,itemMap:_,collectionRef:g,children:S})};f.displayName=r;const l=e+"CollectionSlot",c=no(l),h=nn.forwardRef((w,v)=>{const{scope:S,children:g}=w,_=u(l,S),T=ot(v,_.collectionRef);return b.jsx(c,{ref:T,children:g})});h.displayName=l;const m=e+"CollectionItemSlot",p="data-radix-collection-item",y=no(m),x=nn.forwardRef((w,v)=>{const{scope:S,children:g,..._}=w,T=nn.useRef(null),M=ot(v,T),k=u(m,S);return nn.useEffect(()=>(k.itemMap.set(T,{ref:T,..._}),()=>void k.itemMap.delete(T))),b.jsx(y,{[p]:"",ref:M,children:g})});x.displayName=m;function A(w){const v=u(e+"CollectionConsumer",w);return nn.useCallback(()=>{const g=v.collectionRef.current;if(!g)return[];const _=Array.from(g.querySelectorAll(`[${p}]`));return Array.from(v.itemMap.values()).sort((k,L)=>_.indexOf(k.ref.current)-_.indexOf(L.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:f,Slot:h,ItemSlot:x},A,s]}var dO=R.createContext(void 0);function iv(e){const r=R.useContext(dO);return e||r||"ltr"}const hO=["top","right","bottom","left"],vs=Math.min,qr=Math.max,Wd=Math.round,bd=Math.floor,Un=e=>({x:e,y:e}),fO={left:"right",right:"left",bottom:"top",top:"bottom"},pO={start:"end",end:"start"};function og(e,r,n){return qr(e,vs(r,n))}function Ei(e,r){return typeof e=="function"?e(r):e}function Ai(e){return e.split("-")[0]}function Ra(e){return e.split("-")[1]}function sv(e){return e==="x"?"y":"x"}function ov(e){return e==="y"?"height":"width"}const mO=new Set(["top","bottom"]);function In(e){return mO.has(Ai(e))?"y":"x"}function av(e){return sv(In(e))}function gO(e,r,n){n===void 0&&(n=!1);const s=Ra(e),o=av(e),u=ov(o);let f=o==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return r.reference[u]>r.floating[u]&&(f=Kd(f)),[f,Kd(f)]}function vO(e){const r=Kd(e);return[ag(e),r,ag(r)]}function ag(e){return e.replace(/start|end/g,r=>pO[r])}const BS=["left","right"],NS=["right","left"],_O=["top","bottom"],yO=["bottom","top"];function SO(e,r,n){switch(e){case"top":case"bottom":return n?r?NS:BS:r?BS:NS;case"left":case"right":return r?_O:yO;default:return[]}}function bO(e,r,n,s){const o=Ra(e);let u=SO(Ai(e),n==="start",s);return o&&(u=u.map(f=>f+"-"+o),r&&(u=u.concat(u.map(ag)))),u}function Kd(e){return e.replace(/left|right|bottom|top/g,r=>fO[r])}function CO(e){return{top:0,right:0,bottom:0,left:0,...e}}function ew(e){return typeof e!="number"?CO(e):{top:e,right:e,bottom:e,left:e}}function Qd(e){const{x:r,y:n,width:s,height:o}=e;return{width:s,height:o,top:n,left:r,right:r+s,bottom:n+o,x:r,y:n}}function IS(e,r,n){let{reference:s,floating:o}=e;const u=In(r),f=av(r),l=ov(f),c=Ai(r),h=u==="y",m=s.x+s.width/2-o.width/2,p=s.y+s.height/2-o.height/2,y=s[l]/2-o[l]/2;let x;switch(c){case"top":x={x:m,y:s.y-o.height};break;case"bottom":x={x:m,y:s.y+s.height};break;case"right":x={x:s.x+s.width,y:p};break;case"left":x={x:s.x-o.width,y:p};break;default:x={x:s.x,y:s.y}}switch(Ra(r)){case"start":x[f]-=y*(n&&h?-1:1);break;case"end":x[f]+=y*(n&&h?-1:1);break}return x}const wO=async(e,r,n)=>{const{placement:s="bottom",strategy:o="absolute",middleware:u=[],platform:f}=n,l=u.filter(Boolean),c=await(f.isRTL==null?void 0:f.isRTL(r));let h=await f.getElementRects({reference:e,floating:r,strategy:o}),{x:m,y:p}=IS(h,s,c),y=s,x={},A=0;for(let w=0;w<l.length;w++){const{name:v,fn:S}=l[w],{x:g,y:_,data:T,reset:M}=await S({x:m,y:p,initialPlacement:s,placement:y,strategy:o,middlewareData:x,rects:h,platform:f,elements:{reference:e,floating:r}});m=g??m,p=_??p,x={...x,[v]:{...x[v],...T}},M&&A<=50&&(A++,typeof M=="object"&&(M.placement&&(y=M.placement),M.rects&&(h=M.rects===!0?await f.getElementRects({reference:e,floating:r,strategy:o}):M.rects),{x:m,y:p}=IS(h,y,c)),w=-1)}return{x:m,y:p,placement:y,strategy:o,middlewareData:x}};async function nc(e,r){var n;r===void 0&&(r={});const{x:s,y:o,platform:u,rects:f,elements:l,strategy:c}=e,{boundary:h="clippingAncestors",rootBoundary:m="viewport",elementContext:p="floating",altBoundary:y=!1,padding:x=0}=Ei(r,e),A=ew(x),v=l[y?p==="floating"?"reference":"floating":p],S=Qd(await u.getClippingRect({element:(n=await(u.isElement==null?void 0:u.isElement(v)))==null||n?v:v.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(l.floating)),boundary:h,rootBoundary:m,strategy:c})),g=p==="floating"?{x:s,y:o,width:f.floating.width,height:f.floating.height}:f.reference,_=await(u.getOffsetParent==null?void 0:u.getOffsetParent(l.floating)),T=await(u.isElement==null?void 0:u.isElement(_))?await(u.getScale==null?void 0:u.getScale(_))||{x:1,y:1}:{x:1,y:1},M=Qd(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:_,strategy:c}):g);return{top:(S.top-M.top+A.top)/T.y,bottom:(M.bottom-S.bottom+A.bottom)/T.y,left:(S.left-M.left+A.left)/T.x,right:(M.right-S.right+A.right)/T.x}}const xO=e=>({name:"arrow",options:e,async fn(r){const{x:n,y:s,placement:o,rects:u,platform:f,elements:l,middlewareData:c}=r,{element:h,padding:m=0}=Ei(e,r)||{};if(h==null)return{};const p=ew(m),y={x:n,y:s},x=av(o),A=ov(x),w=await f.getDimensions(h),v=x==="y",S=v?"top":"left",g=v?"bottom":"right",_=v?"clientHeight":"clientWidth",T=u.reference[A]+u.reference[x]-y[x]-u.floating[A],M=y[x]-u.reference[x],k=await(f.getOffsetParent==null?void 0:f.getOffsetParent(h));let L=k?k[_]:0;(!L||!await(f.isElement==null?void 0:f.isElement(k)))&&(L=l.floating[_]||u.floating[A]);const D=T/2-M/2,P=L/2-w[A]/2-1,K=vs(p[S],P),$=vs(p[g],P),z=K,W=L-w[A]-$,F=L/2-w[A]/2+D,ee=og(z,F,W),Y=!c.arrow&&Ra(o)!=null&&F!==ee&&u.reference[A]/2-(F<z?K:$)-w[A]/2<0,re=Y?F<z?F-z:F-W:0;return{[x]:y[x]+re,data:{[x]:ee,centerOffset:F-ee-re,...Y&&{alignmentOffset:re}},reset:Y}}}),EO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(r){var n,s;const{placement:o,middlewareData:u,rects:f,initialPlacement:l,platform:c,elements:h}=r,{mainAxis:m=!0,crossAxis:p=!0,fallbackPlacements:y,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:A="none",flipAlignment:w=!0,...v}=Ei(e,r);if((n=u.arrow)!=null&&n.alignmentOffset)return{};const S=Ai(o),g=In(l),_=Ai(l)===l,T=await(c.isRTL==null?void 0:c.isRTL(h.floating)),M=y||(_||!w?[Kd(l)]:vO(l)),k=A!=="none";!y&&k&&M.push(...bO(l,w,A,T));const L=[l,...M],D=await nc(r,v),P=[];let K=((s=u.flip)==null?void 0:s.overflows)||[];if(m&&P.push(D[S]),p){const F=gO(o,f,T);P.push(D[F[0]],D[F[1]])}if(K=[...K,{placement:o,overflows:P}],!P.every(F=>F<=0)){var $,z;const F=((($=u.flip)==null?void 0:$.index)||0)+1,ee=L[F];if(ee&&(!(p==="alignment"?g!==In(ee):!1)||K.every(te=>In(te.placement)===g?te.overflows[0]>0:!0)))return{data:{index:F,overflows:K},reset:{placement:ee}};let Y=(z=K.filter(re=>re.overflows[0]<=0).sort((re,te)=>re.overflows[1]-te.overflows[1])[0])==null?void 0:z.placement;if(!Y)switch(x){case"bestFit":{var W;const re=(W=K.filter(te=>{if(k){const O=In(te.placement);return O===g||O==="y"}return!0}).map(te=>[te.placement,te.overflows.filter(O=>O>0).reduce((O,G)=>O+G,0)]).sort((te,O)=>te[1]-O[1])[0])==null?void 0:W[0];re&&(Y=re);break}case"initialPlacement":Y=l;break}if(o!==Y)return{reset:{placement:Y}}}return{}}}};function PS(e,r){return{top:e.top-r.height,right:e.right-r.width,bottom:e.bottom-r.height,left:e.left-r.width}}function jS(e){return hO.some(r=>e[r]>=0)}const AO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(r){const{rects:n}=r,{strategy:s="referenceHidden",...o}=Ei(e,r);switch(s){case"referenceHidden":{const u=await nc(r,{...o,elementContext:"reference"}),f=PS(u,n.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:jS(f)}}}case"escaped":{const u=await nc(r,{...o,altBoundary:!0}),f=PS(u,n.floating);return{data:{escapedOffsets:f,escaped:jS(f)}}}default:return{}}}}},tw=new Set(["left","top"]);async function TO(e,r){const{placement:n,platform:s,elements:o}=e,u=await(s.isRTL==null?void 0:s.isRTL(o.floating)),f=Ai(n),l=Ra(n),c=In(n)==="y",h=tw.has(f)?-1:1,m=u&&c?-1:1,p=Ei(r,e);let{mainAxis:y,crossAxis:x,alignmentAxis:A}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof A=="number"&&(x=l==="end"?A*-1:A),c?{x:x*m,y:y*h}:{x:y*h,y:x*m}}const RO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(r){var n,s;const{x:o,y:u,placement:f,middlewareData:l}=r,c=await TO(r,e);return f===((n=l.offset)==null?void 0:n.placement)&&(s=l.arrow)!=null&&s.alignmentOffset?{}:{x:o+c.x,y:u+c.y,data:{...c,placement:f}}}}},DO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(r){const{x:n,y:s,placement:o}=r,{mainAxis:u=!0,crossAxis:f=!1,limiter:l={fn:v=>{let{x:S,y:g}=v;return{x:S,y:g}}},...c}=Ei(e,r),h={x:n,y:s},m=await nc(r,c),p=In(Ai(o)),y=sv(p);let x=h[y],A=h[p];if(u){const v=y==="y"?"top":"left",S=y==="y"?"bottom":"right",g=x+m[v],_=x-m[S];x=og(g,x,_)}if(f){const v=p==="y"?"top":"left",S=p==="y"?"bottom":"right",g=A+m[v],_=A-m[S];A=og(g,A,_)}const w=l.fn({...r,[y]:x,[p]:A});return{...w,data:{x:w.x-n,y:w.y-s,enabled:{[y]:u,[p]:f}}}}}},MO=function(e){return e===void 0&&(e={}),{options:e,fn(r){const{x:n,y:s,placement:o,rects:u,middlewareData:f}=r,{offset:l=0,mainAxis:c=!0,crossAxis:h=!0}=Ei(e,r),m={x:n,y:s},p=In(o),y=sv(p);let x=m[y],A=m[p];const w=Ei(l,r),v=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(c){const _=y==="y"?"height":"width",T=u.reference[y]-u.floating[_]+v.mainAxis,M=u.reference[y]+u.reference[_]-v.mainAxis;x<T?x=T:x>M&&(x=M)}if(h){var S,g;const _=y==="y"?"width":"height",T=tw.has(Ai(o)),M=u.reference[p]-u.floating[_]+(T&&((S=f.offset)==null?void 0:S[p])||0)+(T?0:v.crossAxis),k=u.reference[p]+u.reference[_]+(T?0:((g=f.offset)==null?void 0:g[p])||0)-(T?v.crossAxis:0);A<M?A=M:A>k&&(A=k)}return{[y]:x,[p]:A}}}},kO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(r){var n,s;const{placement:o,rects:u,platform:f,elements:l}=r,{apply:c=()=>{},...h}=Ei(e,r),m=await nc(r,h),p=Ai(o),y=Ra(o),x=In(o)==="y",{width:A,height:w}=u.floating;let v,S;p==="top"||p==="bottom"?(v=p,S=y===(await(f.isRTL==null?void 0:f.isRTL(l.floating))?"start":"end")?"left":"right"):(S=p,v=y==="end"?"top":"bottom");const g=w-m.top-m.bottom,_=A-m.left-m.right,T=vs(w-m[v],g),M=vs(A-m[S],_),k=!r.middlewareData.shift;let L=T,D=M;if((n=r.middlewareData.shift)!=null&&n.enabled.x&&(D=_),(s=r.middlewareData.shift)!=null&&s.enabled.y&&(L=g),k&&!y){const K=qr(m.left,0),$=qr(m.right,0),z=qr(m.top,0),W=qr(m.bottom,0);x?D=A-2*(K!==0||$!==0?K+$:qr(m.left,m.right)):L=w-2*(z!==0||W!==0?z+W:qr(m.top,m.bottom))}await c({...r,availableWidth:D,availableHeight:L});const P=await f.getDimensions(l.floating);return A!==P.width||w!==P.height?{reset:{rects:!0}}:{}}}};function Ch(){return typeof window<"u"}function Da(e){return rw(e)?(e.nodeName||"").toLowerCase():"#document"}function Gr(e){var r;return(e==null||(r=e.ownerDocument)==null?void 0:r.defaultView)||window}function zn(e){var r;return(r=(rw(e)?e.ownerDocument:e.document)||window.document)==null?void 0:r.documentElement}function rw(e){return Ch()?e instanceof Node||e instanceof Gr(e).Node:!1}function _n(e){return Ch()?e instanceof Element||e instanceof Gr(e).Element:!1}function Hn(e){return Ch()?e instanceof HTMLElement||e instanceof Gr(e).HTMLElement:!1}function US(e){return!Ch()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Gr(e).ShadowRoot}const LO=new Set(["inline","contents"]);function Rc(e){const{overflow:r,overflowX:n,overflowY:s,display:o}=yn(e);return/auto|scroll|overlay|hidden|clip/.test(r+s+n)&&!LO.has(o)}const OO=new Set(["table","td","th"]);function BO(e){return OO.has(Da(e))}const NO=[":popover-open",":modal"];function wh(e){return NO.some(r=>{try{return e.matches(r)}catch{return!1}})}const IO=["transform","translate","scale","rotate","perspective"],PO=["transform","translate","scale","rotate","perspective","filter"],jO=["paint","layout","strict","content"];function lv(e){const r=cv(),n=_n(e)?yn(e):e;return IO.some(s=>n[s]?n[s]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!r&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!r&&(n.filter?n.filter!=="none":!1)||PO.some(s=>(n.willChange||"").includes(s))||jO.some(s=>(n.contain||"").includes(s))}function UO(e){let r=_s(e);for(;Hn(r)&&!_a(r);){if(lv(r))return r;if(wh(r))return null;r=_s(r)}return null}function cv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const FO=new Set(["html","body","#document"]);function _a(e){return FO.has(Da(e))}function yn(e){return Gr(e).getComputedStyle(e)}function xh(e){return _n(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _s(e){if(Da(e)==="html")return e;const r=e.assignedSlot||e.parentNode||US(e)&&e.host||zn(e);return US(r)?r.host:r}function nw(e){const r=_s(e);return _a(r)?e.ownerDocument?e.ownerDocument.body:e.body:Hn(r)&&Rc(r)?r:nw(r)}function ic(e,r,n){var s;r===void 0&&(r=[]),n===void 0&&(n=!0);const o=nw(e),u=o===((s=e.ownerDocument)==null?void 0:s.body),f=Gr(o);if(u){const l=lg(f);return r.concat(f,f.visualViewport||[],Rc(o)?o:[],l&&n?ic(l):[])}return r.concat(o,ic(o,[],n))}function lg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function iw(e){const r=yn(e);let n=parseFloat(r.width)||0,s=parseFloat(r.height)||0;const o=Hn(e),u=o?e.offsetWidth:n,f=o?e.offsetHeight:s,l=Wd(n)!==u||Wd(s)!==f;return l&&(n=u,s=f),{width:n,height:s,$:l}}function uv(e){return _n(e)?e:e.contextElement}function da(e){const r=uv(e);if(!Hn(r))return Un(1);const n=r.getBoundingClientRect(),{width:s,height:o,$:u}=iw(r);let f=(u?Wd(n.width):n.width)/s,l=(u?Wd(n.height):n.height)/o;return(!f||!Number.isFinite(f))&&(f=1),(!l||!Number.isFinite(l))&&(l=1),{x:f,y:l}}const HO=Un(0);function sw(e){const r=Gr(e);return!cv()||!r.visualViewport?HO:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function VO(e,r,n){return r===void 0&&(r=!1),!n||r&&n!==Gr(e)?!1:r}function so(e,r,n,s){r===void 0&&(r=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),u=uv(e);let f=Un(1);r&&(s?_n(s)&&(f=da(s)):f=da(e));const l=VO(u,n,s)?sw(u):Un(0);let c=(o.left+l.x)/f.x,h=(o.top+l.y)/f.y,m=o.width/f.x,p=o.height/f.y;if(u){const y=Gr(u),x=s&&_n(s)?Gr(s):s;let A=y,w=lg(A);for(;w&&s&&x!==A;){const v=da(w),S=w.getBoundingClientRect(),g=yn(w),_=S.left+(w.clientLeft+parseFloat(g.paddingLeft))*v.x,T=S.top+(w.clientTop+parseFloat(g.paddingTop))*v.y;c*=v.x,h*=v.y,m*=v.x,p*=v.y,c+=_,h+=T,A=Gr(w),w=lg(A)}}return Qd({width:m,height:p,x:c,y:h})}function Eh(e,r){const n=xh(e).scrollLeft;return r?r.left+n:so(zn(e)).left+n}function ow(e,r){const n=e.getBoundingClientRect(),s=n.left+r.scrollLeft-Eh(e,n),o=n.top+r.scrollTop;return{x:s,y:o}}function qO(e){let{elements:r,rect:n,offsetParent:s,strategy:o}=e;const u=o==="fixed",f=zn(s),l=r?wh(r.floating):!1;if(s===f||l&&u)return n;let c={scrollLeft:0,scrollTop:0},h=Un(1);const m=Un(0),p=Hn(s);if((p||!p&&!u)&&((Da(s)!=="body"||Rc(f))&&(c=xh(s)),Hn(s))){const x=so(s);h=da(s),m.x=x.x+s.clientLeft,m.y=x.y+s.clientTop}const y=f&&!p&&!u?ow(f,c):Un(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-c.scrollLeft*h.x+m.x+y.x,y:n.y*h.y-c.scrollTop*h.y+m.y+y.y}}function GO(e){return Array.from(e.getClientRects())}function zO(e){const r=zn(e),n=xh(e),s=e.ownerDocument.body,o=qr(r.scrollWidth,r.clientWidth,s.scrollWidth,s.clientWidth),u=qr(r.scrollHeight,r.clientHeight,s.scrollHeight,s.clientHeight);let f=-n.scrollLeft+Eh(e);const l=-n.scrollTop;return yn(s).direction==="rtl"&&(f+=qr(r.clientWidth,s.clientWidth)-o),{width:o,height:u,x:f,y:l}}const FS=25;function YO(e,r){const n=Gr(e),s=zn(e),o=n.visualViewport;let u=s.clientWidth,f=s.clientHeight,l=0,c=0;if(o){u=o.width,f=o.height;const m=cv();(!m||m&&r==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const h=Eh(s);if(h<=0){const m=s.ownerDocument,p=m.body,y=getComputedStyle(p),x=m.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,A=Math.abs(s.clientWidth-p.clientWidth-x);A<=FS&&(u-=A)}else h<=FS&&(u+=h);return{width:u,height:f,x:l,y:c}}const WO=new Set(["absolute","fixed"]);function KO(e,r){const n=so(e,!0,r==="fixed"),s=n.top+e.clientTop,o=n.left+e.clientLeft,u=Hn(e)?da(e):Un(1),f=e.clientWidth*u.x,l=e.clientHeight*u.y,c=o*u.x,h=s*u.y;return{width:f,height:l,x:c,y:h}}function HS(e,r,n){let s;if(r==="viewport")s=YO(e,n);else if(r==="document")s=zO(zn(e));else if(_n(r))s=KO(r,n);else{const o=sw(e);s={x:r.x-o.x,y:r.y-o.y,width:r.width,height:r.height}}return Qd(s)}function aw(e,r){const n=_s(e);return n===r||!_n(n)||_a(n)?!1:yn(n).position==="fixed"||aw(n,r)}function QO(e,r){const n=r.get(e);if(n)return n;let s=ic(e,[],!1).filter(l=>_n(l)&&Da(l)!=="body"),o=null;const u=yn(e).position==="fixed";let f=u?_s(e):e;for(;_n(f)&&!_a(f);){const l=yn(f),c=lv(f);!c&&l.position==="fixed"&&(o=null),(u?!c&&!o:!c&&l.position==="static"&&!!o&&WO.has(o.position)||Rc(f)&&!c&&aw(e,f))?s=s.filter(m=>m!==f):o=l,f=_s(f)}return r.set(e,s),s}function $O(e){let{element:r,boundary:n,rootBoundary:s,strategy:o}=e;const f=[...n==="clippingAncestors"?wh(r)?[]:QO(r,this._c):[].concat(n),s],l=f[0],c=f.reduce((h,m)=>{const p=HS(r,m,o);return h.top=qr(p.top,h.top),h.right=vs(p.right,h.right),h.bottom=vs(p.bottom,h.bottom),h.left=qr(p.left,h.left),h},HS(r,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function JO(e){const{width:r,height:n}=iw(e);return{width:r,height:n}}function ZO(e,r,n){const s=Hn(r),o=zn(r),u=n==="fixed",f=so(e,!0,u,r);let l={scrollLeft:0,scrollTop:0};const c=Un(0);function h(){c.x=Eh(o)}if(s||!s&&!u)if((Da(r)!=="body"||Rc(o))&&(l=xh(r)),s){const x=so(r,!0,u,r);c.x=x.x+r.clientLeft,c.y=x.y+r.clientTop}else o&&h();u&&!s&&o&&h();const m=o&&!s&&!u?ow(o,l):Un(0),p=f.left+l.scrollLeft-c.x-m.x,y=f.top+l.scrollTop-c.y-m.y;return{x:p,y,width:f.width,height:f.height}}function xm(e){return yn(e).position==="static"}function VS(e,r){if(!Hn(e)||yn(e).position==="fixed")return null;if(r)return r(e);let n=e.offsetParent;return zn(e)===n&&(n=n.ownerDocument.body),n}function lw(e,r){const n=Gr(e);if(wh(e))return n;if(!Hn(e)){let o=_s(e);for(;o&&!_a(o);){if(_n(o)&&!xm(o))return o;o=_s(o)}return n}let s=VS(e,r);for(;s&&BO(s)&&xm(s);)s=VS(s,r);return s&&_a(s)&&xm(s)&&!lv(s)?n:s||UO(e)||n}const XO=async function(e){const r=this.getOffsetParent||lw,n=this.getDimensions,s=await n(e.floating);return{reference:ZO(e.reference,await r(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function eB(e){return yn(e).direction==="rtl"}const tB={convertOffsetParentRelativeRectToViewportRelativeRect:qO,getDocumentElement:zn,getClippingRect:$O,getOffsetParent:lw,getElementRects:XO,getClientRects:GO,getDimensions:JO,getScale:da,isElement:_n,isRTL:eB};function cw(e,r){return e.x===r.x&&e.y===r.y&&e.width===r.width&&e.height===r.height}function rB(e,r){let n=null,s;const o=zn(e);function u(){var l;clearTimeout(s),(l=n)==null||l.disconnect(),n=null}function f(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),u();const h=e.getBoundingClientRect(),{left:m,top:p,width:y,height:x}=h;if(l||r(),!y||!x)return;const A=bd(p),w=bd(o.clientWidth-(m+y)),v=bd(o.clientHeight-(p+x)),S=bd(m),_={rootMargin:-A+"px "+-w+"px "+-v+"px "+-S+"px",threshold:qr(0,vs(1,c))||1};let T=!0;function M(k){const L=k[0].intersectionRatio;if(L!==c){if(!T)return f();L?f(!1,L):s=setTimeout(()=>{f(!1,1e-7)},1e3)}L===1&&!cw(h,e.getBoundingClientRect())&&f(),T=!1}try{n=new IntersectionObserver(M,{..._,root:o.ownerDocument})}catch{n=new IntersectionObserver(M,_)}n.observe(e)}return f(!0),u}function nB(e,r,n,s){s===void 0&&(s={});const{ancestorScroll:o=!0,ancestorResize:u=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,h=uv(e),m=o||u?[...h?ic(h):[],...ic(r)]:[];m.forEach(S=>{o&&S.addEventListener("scroll",n,{passive:!0}),u&&S.addEventListener("resize",n)});const p=h&&l?rB(h,n):null;let y=-1,x=null;f&&(x=new ResizeObserver(S=>{let[g]=S;g&&g.target===h&&x&&(x.unobserve(r),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var _;(_=x)==null||_.observe(r)})),n()}),h&&!c&&x.observe(h),x.observe(r));let A,w=c?so(e):null;c&&v();function v(){const S=so(e);w&&!cw(w,S)&&n(),w=S,A=requestAnimationFrame(v)}return n(),()=>{var S;m.forEach(g=>{o&&g.removeEventListener("scroll",n),u&&g.removeEventListener("resize",n)}),p==null||p(),(S=x)==null||S.disconnect(),x=null,c&&cancelAnimationFrame(A)}}const iB=RO,sB=DO,oB=EO,aB=kO,lB=AO,qS=xO,cB=MO,uB=(e,r,n)=>{const s=new Map,o={platform:tB,...n},u={...o.platform,_c:s};return wO(e,r,{...o,platform:u})};var dB=typeof document<"u",hB=function(){},Pd=dB?R.useLayoutEffect:hB;function $d(e,r){if(e===r)return!0;if(typeof e!=typeof r)return!1;if(typeof e=="function"&&e.toString()===r.toString())return!0;let n,s,o;if(e&&r&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==r.length)return!1;for(s=n;s--!==0;)if(!$d(e[s],r[s]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(r,o[s]))return!1;for(s=n;s--!==0;){const u=o[s];if(!(u==="_owner"&&e.$$typeof)&&!$d(e[u],r[u]))return!1}return!0}return e!==e&&r!==r}function uw(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function GS(e,r){const n=uw(e);return Math.round(r*n)/n}function Em(e){const r=R.useRef(e);return Pd(()=>{r.current=e}),r}function fB(e){e===void 0&&(e={});const{placement:r="bottom",strategy:n="absolute",middleware:s=[],platform:o,elements:{reference:u,floating:f}={},transform:l=!0,whileElementsMounted:c,open:h}=e,[m,p]=R.useState({x:0,y:0,strategy:n,placement:r,middlewareData:{},isPositioned:!1}),[y,x]=R.useState(s);$d(y,s)||x(s);const[A,w]=R.useState(null),[v,S]=R.useState(null),g=R.useCallback(te=>{te!==k.current&&(k.current=te,w(te))},[]),_=R.useCallback(te=>{te!==L.current&&(L.current=te,S(te))},[]),T=u||A,M=f||v,k=R.useRef(null),L=R.useRef(null),D=R.useRef(m),P=c!=null,K=Em(c),$=Em(o),z=Em(h),W=R.useCallback(()=>{if(!k.current||!L.current)return;const te={placement:r,strategy:n,middleware:y};$.current&&(te.platform=$.current),uB(k.current,L.current,te).then(O=>{const G={...O,isPositioned:z.current!==!1};F.current&&!$d(D.current,G)&&(D.current=G,bc.flushSync(()=>{p(G)}))})},[y,r,n,$,z]);Pd(()=>{h===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,p(te=>({...te,isPositioned:!1})))},[h]);const F=R.useRef(!1);Pd(()=>(F.current=!0,()=>{F.current=!1}),[]),Pd(()=>{if(T&&(k.current=T),M&&(L.current=M),T&&M){if(K.current)return K.current(T,M,W);W()}},[T,M,W,K,P]);const ee=R.useMemo(()=>({reference:k,floating:L,setReference:g,setFloating:_}),[g,_]),Y=R.useMemo(()=>({reference:T,floating:M}),[T,M]),re=R.useMemo(()=>{const te={position:n,left:0,top:0};if(!Y.floating)return te;const O=GS(Y.floating,m.x),G=GS(Y.floating,m.y);return l?{...te,transform:"translate("+O+"px, "+G+"px)",...uw(Y.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:G}},[n,l,Y.floating,m.x,m.y]);return R.useMemo(()=>({...m,update:W,refs:ee,elements:Y,floatingStyles:re}),[m,W,ee,Y,re])}const pB=e=>{function r(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:s,padding:o}=typeof e=="function"?e(n):e;return s&&r(s)?s.current!=null?qS({element:s.current,padding:o}).fn(n):{}:s?qS({element:s,padding:o}).fn(n):{}}}},mB=(e,r)=>({...iB(e),options:[e,r]}),gB=(e,r)=>({...sB(e),options:[e,r]}),vB=(e,r)=>({...cB(e),options:[e,r]}),_B=(e,r)=>({...oB(e),options:[e,r]}),yB=(e,r)=>({...aB(e),options:[e,r]}),SB=(e,r)=>({...lB(e),options:[e,r]}),bB=(e,r)=>({...pB(e),options:[e,r]});var CB="Arrow",dw=R.forwardRef((e,r)=>{const{children:n,width:s=10,height:o=5,...u}=e;return b.jsx(Je.svg,{...u,ref:r,width:s,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:b.jsx("polygon",{points:"0,0 30,0 15,10"})})});dw.displayName=CB;var wB=dw;function hw(e){const[r,n]=R.useState(void 0);return pr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const u=o[0];let f,l;if("borderBoxSize"in u){const c=u.borderBoxSize,h=Array.isArray(c)?c[0]:c;f=h.inlineSize,l=h.blockSize}else f=e.offsetWidth,l=e.offsetHeight;n({width:f,height:l})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else n(void 0)},[e]),r}var dv="Popper",[fw,Ma]=qn(dv),[xB,pw]=fw(dv),mw=e=>{const{__scopePopper:r,children:n}=e,[s,o]=R.useState(null);return b.jsx(xB,{scope:r,anchor:s,onAnchorChange:o,children:n})};mw.displayName=dv;var gw="PopperAnchor",vw=R.forwardRef((e,r)=>{const{__scopePopper:n,virtualRef:s,...o}=e,u=pw(gw,n),f=R.useRef(null),l=ot(r,f),c=R.useRef(null);return R.useEffect(()=>{const h=c.current;c.current=(s==null?void 0:s.current)||f.current,h!==c.current&&u.onAnchorChange(c.current)}),s?null:b.jsx(Je.div,{...o,ref:l})});vw.displayName=gw;var hv="PopperContent",[EB,AB]=fw(hv),_w=R.forwardRef((e,r)=>{var Q,U,ue,oe,de,he;const{__scopePopper:n,side:s="bottom",sideOffset:o=0,align:u="center",alignOffset:f=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:h=[],collisionPadding:m=0,sticky:p="partial",hideWhenDetached:y=!1,updatePositionStrategy:x="optimized",onPlaced:A,...w}=e,v=pw(hv,n),[S,g]=R.useState(null),_=ot(r,De=>g(De)),[T,M]=R.useState(null),k=hw(T),L=(k==null?void 0:k.width)??0,D=(k==null?void 0:k.height)??0,P=s+(u!=="center"?"-"+u:""),K=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},$=Array.isArray(h)?h:[h],z=$.length>0,W={padding:K,boundary:$.filter(RB),altBoundary:z},{refs:F,floatingStyles:ee,placement:Y,isPositioned:re,middlewareData:te}=fB({strategy:"fixed",placement:P,whileElementsMounted:(...De)=>nB(...De,{animationFrame:x==="always"}),elements:{reference:v.anchor},middleware:[mB({mainAxis:o+D,alignmentAxis:f}),c&&gB({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?vB():void 0,...W}),c&&_B({...W}),yB({...W,apply:({elements:De,rects:Ie,availableWidth:Fe,availableHeight:je})=>{const{width:Oe,height:Lt}=Ie.reference,Tt=De.floating.style;Tt.setProperty("--radix-popper-available-width",`${Fe}px`),Tt.setProperty("--radix-popper-available-height",`${je}px`),Tt.setProperty("--radix-popper-anchor-width",`${Oe}px`),Tt.setProperty("--radix-popper-anchor-height",`${Lt}px`)}}),T&&bB({element:T,padding:l}),DB({arrowWidth:L,arrowHeight:D}),y&&SB({strategy:"referenceHidden",...W})]}),[O,G]=bw(Y),j=Fn(A);pr(()=>{re&&(j==null||j())},[re,j]);const q=(Q=te.arrow)==null?void 0:Q.x,ne=(U=te.arrow)==null?void 0:U.y,Z=((ue=te.arrow)==null?void 0:ue.centerOffset)!==0,[be,fe]=R.useState();return pr(()=>{S&&fe(window.getComputedStyle(S).zIndex)},[S]),b.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...ee,transform:re?ee.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[(oe=te.transformOrigin)==null?void 0:oe.x,(de=te.transformOrigin)==null?void 0:de.y].join(" "),...((he=te.hide)==null?void 0:he.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:b.jsx(EB,{scope:n,placedSide:O,onArrowChange:M,arrowX:q,arrowY:ne,shouldHideArrow:Z,children:b.jsx(Je.div,{"data-side":O,"data-align":G,...w,ref:_,style:{...w.style,animation:re?void 0:"none"}})})})});_w.displayName=hv;var yw="PopperArrow",TB={top:"bottom",right:"left",bottom:"top",left:"right"},Sw=R.forwardRef(function(r,n){const{__scopePopper:s,...o}=r,u=AB(yw,s),f=TB[u.placedSide];return b.jsx("span",{ref:u.onArrowChange,style:{position:"absolute",left:u.arrowX,top:u.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[u.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[u.placedSide],visibility:u.shouldHideArrow?"hidden":void 0},children:b.jsx(wB,{...o,ref:n,style:{...o.style,display:"block"}})})});Sw.displayName=yw;function RB(e){return e!==null}var DB=e=>({name:"transformOrigin",options:e,fn(r){var v,S,g;const{placement:n,rects:s,middlewareData:o}=r,f=((v=o.arrow)==null?void 0:v.centerOffset)!==0,l=f?0:e.arrowWidth,c=f?0:e.arrowHeight,[h,m]=bw(n),p={start:"0%",center:"50%",end:"100%"}[m],y=(((S=o.arrow)==null?void 0:S.x)??0)+l/2,x=(((g=o.arrow)==null?void 0:g.y)??0)+c/2;let A="",w="";return h==="bottom"?(A=f?p:`${y}px`,w=`${-c}px`):h==="top"?(A=f?p:`${y}px`,w=`${s.floating.height+c}px`):h==="right"?(A=`${-c}px`,w=f?p:`${x}px`):h==="left"&&(A=`${s.floating.width+c}px`,w=f?p:`${x}px`),{data:{x:A,y:w}}}});function bw(e){const[r,n="center"]=e.split("-");return[r,n]}var fv=mw,Ah=vw,pv=_w,mv=Sw;function Cw(e){const r=R.useRef({value:e,previous:e});return R.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}var ww=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),MB="VisuallyHidden",kB=R.forwardRef((e,r)=>b.jsx(Je.span,{...e,ref:r,style:{...ww,...e.style}}));kB.displayName=MB;var LB=[" ","Enter","ArrowUp","ArrowDown"],OB=[" ","Enter"],oo="Select",[Th,Rh,BB]=nv(oo),[ka]=qn(oo,[BB,Ma]),Dh=Ma(),[NB,ys]=ka(oo),[IB,PB]=ka(oo),xw=e=>{const{__scopeSelect:r,children:n,open:s,defaultOpen:o,onOpenChange:u,value:f,defaultValue:l,onValueChange:c,dir:h,name:m,autoComplete:p,disabled:y,required:x,form:A}=e,w=Dh(r),[v,S]=R.useState(null),[g,_]=R.useState(null),[T,M]=R.useState(!1),k=iv(h),[L,D]=ro({prop:s,defaultProp:o??!1,onChange:u,caller:oo}),[P,K]=ro({prop:f,defaultProp:l,onChange:c,caller:oo}),$=R.useRef(null),z=v?A||!!v.closest("form"):!0,[W,F]=R.useState(new Set),ee=Array.from(W).map(Y=>Y.props.value).join(";");return b.jsx(fv,{...w,children:b.jsxs(NB,{required:x,scope:r,trigger:v,onTriggerChange:S,valueNode:g,onValueNodeChange:_,valueNodeHasChildren:T,onValueNodeHasChildrenChange:M,contentId:jn(),value:P,onValueChange:K,open:L,onOpenChange:D,dir:k,triggerPointerDownPosRef:$,disabled:y,children:[b.jsx(Th.Provider,{scope:r,children:b.jsx(IB,{scope:e.__scopeSelect,onNativeOptionAdd:R.useCallback(Y=>{F(re=>new Set(re).add(Y))},[]),onNativeOptionRemove:R.useCallback(Y=>{F(re=>{const te=new Set(re);return te.delete(Y),te})},[]),children:n})}),z?b.jsxs(Kw,{"aria-hidden":!0,required:x,tabIndex:-1,name:m,autoComplete:p,value:P,onChange:Y=>K(Y.target.value),disabled:y,form:A,children:[P===void 0?b.jsx("option",{value:""}):null,Array.from(W)]},ee):null]})})};xw.displayName=oo;var Ew="SelectTrigger",Aw=R.forwardRef((e,r)=>{const{__scopeSelect:n,disabled:s=!1,...o}=e,u=Dh(n),f=ys(Ew,n),l=f.disabled||s,c=ot(r,f.onTriggerChange),h=Rh(n),m=R.useRef("touch"),[p,y,x]=$w(w=>{const v=h().filter(_=>!_.disabled),S=v.find(_=>_.value===f.value),g=Jw(v,w,S);g!==void 0&&f.onValueChange(g.value)}),A=w=>{l||(f.onOpenChange(!0),x()),w&&(f.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return b.jsx(Ah,{asChild:!0,...u,children:b.jsx(Je.button,{type:"button",role:"combobox","aria-controls":f.contentId,"aria-expanded":f.open,"aria-required":f.required,"aria-autocomplete":"none",dir:f.dir,"data-state":f.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":Qw(f.value)?"":void 0,...o,ref:c,onClick:Le(o.onClick,w=>{w.currentTarget.focus(),m.current!=="mouse"&&A(w)}),onPointerDown:Le(o.onPointerDown,w=>{m.current=w.pointerType;const v=w.target;v.hasPointerCapture(w.pointerId)&&v.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(A(w),w.preventDefault())}),onKeyDown:Le(o.onKeyDown,w=>{const v=p.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&y(w.key),!(v&&w.key===" ")&&LB.includes(w.key)&&(A(),w.preventDefault())})})})});Aw.displayName=Ew;var Tw="SelectValue",Rw=R.forwardRef((e,r)=>{const{__scopeSelect:n,className:s,style:o,children:u,placeholder:f="",...l}=e,c=ys(Tw,n),{onValueNodeHasChildrenChange:h}=c,m=u!==void 0,p=ot(r,c.onValueNodeChange);return pr(()=>{h(m)},[h,m]),b.jsx(Je.span,{...l,ref:p,style:{pointerEvents:"none"},children:Qw(c.value)?b.jsx(b.Fragment,{children:f}):u})});Rw.displayName=Tw;var jB="SelectIcon",Dw=R.forwardRef((e,r)=>{const{__scopeSelect:n,children:s,...o}=e;return b.jsx(Je.span,{"aria-hidden":!0,...o,ref:r,children:s||"▼"})});Dw.displayName=jB;var UB="SelectPortal",Mw=e=>b.jsx(Ac,{asChild:!0,...e});Mw.displayName=UB;var ao="SelectContent",kw=R.forwardRef((e,r)=>{const n=ys(ao,e.__scopeSelect),[s,o]=R.useState();if(pr(()=>{o(new DocumentFragment)},[]),!n.open){const u=s;return u?bc.createPortal(b.jsx(Lw,{scope:e.__scopeSelect,children:b.jsx(Th.Slot,{scope:e.__scopeSelect,children:b.jsx("div",{children:e.children})})}),u):null}return b.jsx(Ow,{...e,ref:r})});kw.displayName=ao;var vn=10,[Lw,Ss]=ka(ao),FB="SelectContentImpl",HB=no("SelectContent.RemoveScroll"),Ow=R.forwardRef((e,r)=>{const{__scopeSelect:n,position:s="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:u,onPointerDownOutside:f,side:l,sideOffset:c,align:h,alignOffset:m,arrowPadding:p,collisionBoundary:y,collisionPadding:x,sticky:A,hideWhenDetached:w,avoidCollisions:v,...S}=e,g=ys(ao,n),[_,T]=R.useState(null),[M,k]=R.useState(null),L=ot(r,Q=>T(Q)),[D,P]=R.useState(null),[K,$]=R.useState(null),z=Rh(n),[W,F]=R.useState(!1),ee=R.useRef(!1);R.useEffect(()=>{if(_)return Sh(_)},[_]),_h();const Y=R.useCallback(Q=>{const[U,...ue]=z().map(he=>he.ref.current),[oe]=ue.slice(-1),de=document.activeElement;for(const he of Q)if(he===de||(he==null||he.scrollIntoView({block:"nearest"}),he===U&&M&&(M.scrollTop=0),he===oe&&M&&(M.scrollTop=M.scrollHeight),he==null||he.focus(),document.activeElement!==de))return},[z,M]),re=R.useCallback(()=>Y([D,_]),[Y,D,_]);R.useEffect(()=>{W&&re()},[W,re]);const{onOpenChange:te,triggerPointerDownPosRef:O}=g;R.useEffect(()=>{if(_){let Q={x:0,y:0};const U=oe=>{var de,he;Q={x:Math.abs(Math.round(oe.pageX)-(((de=O.current)==null?void 0:de.x)??0)),y:Math.abs(Math.round(oe.pageY)-(((he=O.current)==null?void 0:he.y)??0))}},ue=oe=>{Q.x<=10&&Q.y<=10?oe.preventDefault():_.contains(oe.target)||te(!1),document.removeEventListener("pointermove",U),O.current=null};return O.current!==null&&(document.addEventListener("pointermove",U),document.addEventListener("pointerup",ue,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",ue,{capture:!0})}}},[_,te,O]),R.useEffect(()=>{const Q=()=>te(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[te]);const[G,j]=$w(Q=>{const U=z().filter(de=>!de.disabled),ue=U.find(de=>de.ref.current===document.activeElement),oe=Jw(U,Q,ue);oe&&setTimeout(()=>oe.ref.current.focus())}),q=R.useCallback((Q,U,ue)=>{const oe=!ee.current&&!ue;(g.value!==void 0&&g.value===U||oe)&&(P(Q),oe&&(ee.current=!0))},[g.value]),ne=R.useCallback(()=>_==null?void 0:_.focus(),[_]),Z=R.useCallback((Q,U,ue)=>{const oe=!ee.current&&!ue;(g.value!==void 0&&g.value===U||oe)&&$(Q)},[g.value]),be=s==="popper"?cg:Bw,fe=be===cg?{side:l,sideOffset:c,align:h,alignOffset:m,arrowPadding:p,collisionBoundary:y,collisionPadding:x,sticky:A,hideWhenDetached:w,avoidCollisions:v}:{};return b.jsx(Lw,{scope:n,content:_,viewport:M,onViewportChange:k,itemRefCallback:q,selectedItem:D,onItemLeave:ne,itemTextRefCallback:Z,focusSelectedItem:re,selectedItemText:K,position:s,isPositioned:W,searchRef:G,children:b.jsx(Tc,{as:HB,allowPinchZoom:!0,children:b.jsx(Ec,{asChild:!0,trapped:g.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:Le(o,Q=>{var U;(U=g.trigger)==null||U.focus({preventScroll:!0}),Q.preventDefault()}),children:b.jsx(xc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>g.onOpenChange(!1),children:b.jsx(be,{role:"listbox",id:g.contentId,"data-state":g.open?"open":"closed",dir:g.dir,onContextMenu:Q=>Q.preventDefault(),...S,...fe,onPlaced:()=>F(!0),ref:L,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:Le(S.onKeyDown,Q=>{const U=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!U&&Q.key.length===1&&j(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let oe=z().filter(de=>!de.disabled).map(de=>de.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(oe=oe.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const de=Q.target,he=oe.indexOf(de);oe=oe.slice(he+1)}setTimeout(()=>Y(oe)),Q.preventDefault()}})})})})})})});Ow.displayName=FB;var VB="SelectItemAlignedPosition",Bw=R.forwardRef((e,r)=>{const{__scopeSelect:n,onPlaced:s,...o}=e,u=ys(ao,n),f=Ss(ao,n),[l,c]=R.useState(null),[h,m]=R.useState(null),p=ot(r,L=>m(L)),y=Rh(n),x=R.useRef(!1),A=R.useRef(!0),{viewport:w,selectedItem:v,selectedItemText:S,focusSelectedItem:g}=f,_=R.useCallback(()=>{if(u.trigger&&u.valueNode&&l&&h&&w&&v&&S){const L=u.trigger.getBoundingClientRect(),D=h.getBoundingClientRect(),P=u.valueNode.getBoundingClientRect(),K=S.getBoundingClientRect();if(u.dir!=="rtl"){const de=K.left-D.left,he=P.left-de,De=L.left-he,Ie=L.width+De,Fe=Math.max(Ie,D.width),je=window.innerWidth-vn,Oe=OS(he,[vn,Math.max(vn,je-Fe)]);l.style.minWidth=Ie+"px",l.style.left=Oe+"px"}else{const de=D.right-K.right,he=window.innerWidth-P.right-de,De=window.innerWidth-L.right-he,Ie=L.width+De,Fe=Math.max(Ie,D.width),je=window.innerWidth-vn,Oe=OS(he,[vn,Math.max(vn,je-Fe)]);l.style.minWidth=Ie+"px",l.style.right=Oe+"px"}const $=y(),z=window.innerHeight-vn*2,W=w.scrollHeight,F=window.getComputedStyle(h),ee=parseInt(F.borderTopWidth,10),Y=parseInt(F.paddingTop,10),re=parseInt(F.borderBottomWidth,10),te=parseInt(F.paddingBottom,10),O=ee+Y+W+te+re,G=Math.min(v.offsetHeight*5,O),j=window.getComputedStyle(w),q=parseInt(j.paddingTop,10),ne=parseInt(j.paddingBottom,10),Z=L.top+L.height/2-vn,be=z-Z,fe=v.offsetHeight/2,Q=v.offsetTop+fe,U=ee+Y+Q,ue=O-U;if(U<=Z){const de=$.length>0&&v===$[$.length-1].ref.current;l.style.bottom="0px";const he=h.clientHeight-w.offsetTop-w.offsetHeight,De=Math.max(be,fe+(de?ne:0)+he+re),Ie=U+De;l.style.height=Ie+"px"}else{const de=$.length>0&&v===$[0].ref.current;l.style.top="0px";const De=Math.max(Z,ee+w.offsetTop+(de?q:0)+fe)+ue;l.style.height=De+"px",w.scrollTop=U-Z+w.offsetTop}l.style.margin=`${vn}px 0`,l.style.minHeight=G+"px",l.style.maxHeight=z+"px",s==null||s(),requestAnimationFrame(()=>x.current=!0)}},[y,u.trigger,u.valueNode,l,h,w,v,S,u.dir,s]);pr(()=>_(),[_]);const[T,M]=R.useState();pr(()=>{h&&M(window.getComputedStyle(h).zIndex)},[h]);const k=R.useCallback(L=>{L&&A.current===!0&&(_(),g==null||g(),A.current=!1)},[_,g]);return b.jsx(GB,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:x,onScrollButtonChange:k,children:b.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:T},children:b.jsx(Je.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Bw.displayName=VB;var qB="SelectPopperPosition",cg=R.forwardRef((e,r)=>{const{__scopeSelect:n,align:s="start",collisionPadding:o=vn,...u}=e,f=Dh(n);return b.jsx(pv,{...f,...u,ref:r,align:s,collisionPadding:o,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});cg.displayName=qB;var[GB,gv]=ka(ao,{}),ug="SelectViewport",Nw=R.forwardRef((e,r)=>{const{__scopeSelect:n,nonce:s,...o}=e,u=Ss(ug,n),f=gv(ug,n),l=ot(r,u.onViewportChange),c=R.useRef(0);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),b.jsx(Th.Slot,{scope:n,children:b.jsx(Je.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Le(o.onScroll,h=>{const m=h.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:y}=f;if(y!=null&&y.current&&p){const x=Math.abs(c.current-m.scrollTop);if(x>0){const A=window.innerHeight-vn*2,w=parseFloat(p.style.minHeight),v=parseFloat(p.style.height),S=Math.max(w,v);if(S<A){const g=S+x,_=Math.min(A,g),T=g-_;p.style.height=_+"px",p.style.bottom==="0px"&&(m.scrollTop=T>0?T:0,p.style.justifyContent="flex-end")}}}c.current=m.scrollTop})})})]})});Nw.displayName=ug;var Iw="SelectGroup",[zB,YB]=ka(Iw),WB=R.forwardRef((e,r)=>{const{__scopeSelect:n,...s}=e,o=jn();return b.jsx(zB,{scope:n,id:o,children:b.jsx(Je.div,{role:"group","aria-labelledby":o,...s,ref:r})})});WB.displayName=Iw;var Pw="SelectLabel",jw=R.forwardRef((e,r)=>{const{__scopeSelect:n,...s}=e,o=YB(Pw,n);return b.jsx(Je.div,{id:o.id,...s,ref:r})});jw.displayName=Pw;var Jd="SelectItem",[KB,Uw]=ka(Jd),Fw=R.forwardRef((e,r)=>{const{__scopeSelect:n,value:s,disabled:o=!1,textValue:u,...f}=e,l=ys(Jd,n),c=Ss(Jd,n),h=l.value===s,[m,p]=R.useState(u??""),[y,x]=R.useState(!1),A=ot(r,g=>{var _;return(_=c.itemRefCallback)==null?void 0:_.call(c,g,s,o)}),w=jn(),v=R.useRef("touch"),S=()=>{o||(l.onValueChange(s),l.onOpenChange(!1))};if(s==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return b.jsx(KB,{scope:n,value:s,disabled:o,textId:w,isSelected:h,onItemTextChange:R.useCallback(g=>{p(_=>_||((g==null?void 0:g.textContent)??"").trim())},[]),children:b.jsx(Th.ItemSlot,{scope:n,value:s,disabled:o,textValue:m,children:b.jsx(Je.div,{role:"option","aria-labelledby":w,"data-highlighted":y?"":void 0,"aria-selected":h&&y,"data-state":h?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...f,ref:A,onFocus:Le(f.onFocus,()=>x(!0)),onBlur:Le(f.onBlur,()=>x(!1)),onClick:Le(f.onClick,()=>{v.current!=="mouse"&&S()}),onPointerUp:Le(f.onPointerUp,()=>{v.current==="mouse"&&S()}),onPointerDown:Le(f.onPointerDown,g=>{v.current=g.pointerType}),onPointerMove:Le(f.onPointerMove,g=>{var _;v.current=g.pointerType,o?(_=c.onItemLeave)==null||_.call(c):v.current==="mouse"&&g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Le(f.onPointerLeave,g=>{var _;g.currentTarget===document.activeElement&&((_=c.onItemLeave)==null||_.call(c))}),onKeyDown:Le(f.onKeyDown,g=>{var T;((T=c.searchRef)==null?void 0:T.current)!==""&&g.key===" "||(OB.includes(g.key)&&S(),g.key===" "&&g.preventDefault())})})})})});Fw.displayName=Jd;var Jl="SelectItemText",Hw=R.forwardRef((e,r)=>{const{__scopeSelect:n,className:s,style:o,...u}=e,f=ys(Jl,n),l=Ss(Jl,n),c=Uw(Jl,n),h=PB(Jl,n),[m,p]=R.useState(null),y=ot(r,S=>p(S),c.onItemTextChange,S=>{var g;return(g=l.itemTextRefCallback)==null?void 0:g.call(l,S,c.value,c.disabled)}),x=m==null?void 0:m.textContent,A=R.useMemo(()=>b.jsx("option",{value:c.value,disabled:c.disabled,children:x},c.value),[c.disabled,c.value,x]),{onNativeOptionAdd:w,onNativeOptionRemove:v}=h;return pr(()=>(w(A),()=>v(A)),[w,v,A]),b.jsxs(b.Fragment,{children:[b.jsx(Je.span,{id:c.textId,...u,ref:y}),c.isSelected&&f.valueNode&&!f.valueNodeHasChildren?bc.createPortal(u.children,f.valueNode):null]})});Hw.displayName=Jl;var Vw="SelectItemIndicator",qw=R.forwardRef((e,r)=>{const{__scopeSelect:n,...s}=e;return Uw(Vw,n).isSelected?b.jsx(Je.span,{"aria-hidden":!0,...s,ref:r}):null});qw.displayName=Vw;var dg="SelectScrollUpButton",Gw=R.forwardRef((e,r)=>{const n=Ss(dg,e.__scopeSelect),s=gv(dg,e.__scopeSelect),[o,u]=R.useState(!1),f=ot(r,s.onScrollButtonChange);return pr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const h=c.scrollTop>0;u(h)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?b.jsx(Yw,{...e,ref:f,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});Gw.displayName=dg;var hg="SelectScrollDownButton",zw=R.forwardRef((e,r)=>{const n=Ss(hg,e.__scopeSelect),s=gv(hg,e.__scopeSelect),[o,u]=R.useState(!1),f=ot(r,s.onScrollButtonChange);return pr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const h=c.scrollHeight-c.clientHeight,m=Math.ceil(c.scrollTop)<h;u(m)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?b.jsx(Yw,{...e,ref:f,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});zw.displayName=hg;var Yw=R.forwardRef((e,r)=>{const{__scopeSelect:n,onAutoScroll:s,...o}=e,u=Ss("SelectScrollButton",n),f=R.useRef(null),l=Rh(n),c=R.useCallback(()=>{f.current!==null&&(window.clearInterval(f.current),f.current=null)},[]);return R.useEffect(()=>()=>c(),[c]),pr(()=>{var m;const h=l().find(p=>p.ref.current===document.activeElement);(m=h==null?void 0:h.ref.current)==null||m.scrollIntoView({block:"nearest"})},[l]),b.jsx(Je.div,{"aria-hidden":!0,...o,ref:r,style:{flexShrink:0,...o.style},onPointerDown:Le(o.onPointerDown,()=>{f.current===null&&(f.current=window.setInterval(s,50))}),onPointerMove:Le(o.onPointerMove,()=>{var h;(h=u.onItemLeave)==null||h.call(u),f.current===null&&(f.current=window.setInterval(s,50))}),onPointerLeave:Le(o.onPointerLeave,()=>{c()})})}),QB="SelectSeparator",Ww=R.forwardRef((e,r)=>{const{__scopeSelect:n,...s}=e;return b.jsx(Je.div,{"aria-hidden":!0,...s,ref:r})});Ww.displayName=QB;var fg="SelectArrow",$B=R.forwardRef((e,r)=>{const{__scopeSelect:n,...s}=e,o=Dh(n),u=ys(fg,n),f=Ss(fg,n);return u.open&&f.position==="popper"?b.jsx(mv,{...o,...s,ref:r}):null});$B.displayName=fg;var JB="SelectBubbleInput",Kw=R.forwardRef(({__scopeSelect:e,value:r,...n},s)=>{const o=R.useRef(null),u=ot(s,o),f=Cw(r);return R.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(c,"value").set;if(f!==r&&m){const p=new Event("change",{bubbles:!0});m.call(l,r),l.dispatchEvent(p)}},[f,r]),b.jsx(Je.select,{...n,style:{...ww,...n.style},ref:u,defaultValue:r})});Kw.displayName=JB;function Qw(e){return e===""||e===void 0}function $w(e){const r=Fn(e),n=R.useRef(""),s=R.useRef(0),o=R.useCallback(f=>{const l=n.current+f;r(l),(function c(h){n.current=h,window.clearTimeout(s.current),h!==""&&(s.current=window.setTimeout(()=>c(""),1e3))})(l)},[r]),u=R.useCallback(()=>{n.current="",window.clearTimeout(s.current)},[]);return R.useEffect(()=>()=>window.clearTimeout(s.current),[]),[n,o,u]}function Jw(e,r,n){const o=r.length>1&&Array.from(r).every(h=>h===r[0])?r[0]:r,u=n?e.indexOf(n):-1;let f=ZB(e,Math.max(u,0));o.length===1&&(f=f.filter(h=>h!==n));const c=f.find(h=>h.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function ZB(e,r){return e.map((n,s)=>e[(r+s)%e.length])}var XB=xw,Zw=Aw,eN=Rw,tN=Dw,rN=Mw,Xw=kw,nN=Nw,ex=jw,tx=Fw,iN=Hw,sN=qw,rx=Gw,nx=zw,ix=Ww;const Am=XB,Tm=eN,jd=R.forwardRef(({className:e,children:r,...n},s)=>b.jsxs(Zw,{ref:s,className:Te("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[r,b.jsx(tN,{asChild:!0,children:b.jsx(gh,{className:"h-4 w-4 opacity-50"})})]}));jd.displayName=Zw.displayName;const sx=R.forwardRef(({className:e,...r},n)=>b.jsx(rx,{ref:n,className:Te("flex cursor-default items-center justify-center py-1",e),...r,children:b.jsx(Gg,{className:"h-4 w-4"})}));sx.displayName=rx.displayName;const ox=R.forwardRef(({className:e,...r},n)=>b.jsx(nx,{ref:n,className:Te("flex cursor-default items-center justify-center py-1",e),...r,children:b.jsx(gh,{className:"h-4 w-4"})}));ox.displayName=nx.displayName;const Ud=R.forwardRef(({className:e,children:r,position:n="popper",...s},o)=>b.jsx(rN,{children:b.jsxs(Xw,{ref:o,className:Te("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...s,children:[b.jsx(sx,{}),b.jsx(nN,{className:Te("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),b.jsx(ox,{})]})}));Ud.displayName=Xw.displayName;const oN=R.forwardRef(({className:e,...r},n)=>b.jsx(ex,{ref:n,className:Te("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...r}));oN.displayName=ex.displayName;const oa=R.forwardRef(({className:e,children:r,...n},s)=>b.jsxs(tx,{ref:s,className:Te("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[b.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(sN,{children:b.jsx(XC,{className:"h-4 w-4"})})}),b.jsx(iN,{children:r})]}));oa.displayName=tx.displayName;const aN=R.forwardRef(({className:e,...r},n)=>b.jsx(ix,{ref:n,className:Te("-mx-1 my-1 h-px bg-muted",e),...r}));aN.displayName=ix.displayName;var lN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],cN=lN.reduce((e,r)=>{const n=Qb(`Primitive.${r}`),s=R.forwardRef((o,u)=>{const{asChild:f,...l}=o,c=f?n:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(c,{...l,ref:u})});return s.displayName=`Primitive.${r}`,{...e,[r]:s}},{}),uN="Label",ax=R.forwardRef((e,r)=>b.jsx(cN.label,{...e,ref:r,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));ax.displayName=uN;var lx=ax;const dN=Fg("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),aa=R.forwardRef(({className:e,...r},n)=>b.jsx(lx,{ref:n,className:Te(dN(),e),...r}));aa.displayName=lx.displayName;const hN=[{name:"claude",baseType:"claude",displayName:"Claude",isAlias:!1},{name:"cursor",baseType:"cursor",displayName:"Cursor",isAlias:!1},{name:"opencode",baseType:"opencode",displayName:"OpenCode",isAlias:!1}];function cx({children:e}){var K,$;const[r,n]=R.useState(!1),[s,o]=R.useState(!1),[u,f]=R.useState(null),[l,c]=R.useState("claude"),[h,m]=R.useState(""),[p,y]=R.useState(""),[x,A]=R.useState(!1),{createSession:w,subscribeToSession:v,requestSync:S}=co(),g=Ve(z=>z.selectSession),_=Ve(z=>z.availableAgents),T=Ve(z=>z.workspaces),M=yc(),k=R.useMemo(()=>_.length>0?_:hN,[_]),L=R.useMemo(()=>{const z=T.find(W=>W.name===h);return(z==null?void 0:z.projects)??[]},[T,h]);R.useEffect(()=>{r&&S()},[r,S]),R.useEffect(()=>{y("")},[h]),R.useEffect(()=>{var z;k.length>0&&!k.find(W=>W.name===l)&&c(((z=k[0])==null?void 0:z.name)??"claude")},[k,l]);const D=R.useCallback(async()=>{var z;if(!x&&(!h||!p)){f("Workspace and project are required for agent sessions");return}f(null),o(!0);try{const W=k.find(O=>O.name===l),F=x?"terminal":(W==null?void 0:W.baseType)??"claude",te=(await w(F,x?h||"home":h,x?p||"default":p,void 0,x?void 0:l)).payload.session_id;v(te),g(te),M(x?`/terminal/${te}`:`/chat/${te}`),n(!1),m(""),y(""),c(((z=k[0])==null?void 0:z.name)??"claude"),A(!1)}catch(W){f(W instanceof Error?W.message:"Failed to create session")}finally{o(!1)}},[w,v,g,M,l,h,p,x,k]),P=z=>{switch(z){case"claude":return b.jsx(Ea,{className:"w-4 h-4"});case"cursor":return b.jsx(Ta,{className:"w-4 h-4"});case"opencode":return b.jsx(Aa,{className:"w-4 h-4"});case"terminal":return b.jsx(va,{className:"w-4 h-4"});default:return b.jsx(xi,{className:"w-4 h-4"})}};return b.jsxs(lO,{open:r,onOpenChange:n,children:[b.jsx(cO,{asChild:!0,children:e}),b.jsxs(Q1,{className:"sm:max-w-[425px]",children:[b.jsxs($1,{children:[b.jsx(Z1,{children:"Create New Session"}),b.jsx(X1,{children:"Start a new agent or terminal session"})]}),b.jsxs("div",{className:"grid gap-4 py-4",children:[b.jsxs("div",{className:"grid gap-2",children:[b.jsx(aa,{children:"Session Type"}),b.jsxs("div",{className:"flex gap-2",children:[b.jsxs(dt,{type:"button",variant:x?"outline":"default",className:"flex-1",onClick:()=>A(!1),children:[b.jsx(xi,{className:"w-4 h-4 mr-2"}),"Agent"]}),b.jsxs(dt,{type:"button",variant:x?"default":"outline",className:"flex-1",onClick:()=>A(!0),children:[b.jsx(va,{className:"w-4 h-4 mr-2"}),"Terminal"]})]})]}),!x&&b.jsxs("div",{className:"grid gap-2",children:[b.jsx(aa,{htmlFor:"agent",children:"Agent"}),b.jsxs(Am,{value:l,onValueChange:c,children:[b.jsx(jd,{id:"agent",children:b.jsx(Tm,{placeholder:"Select agent"})}),b.jsx(Ud,{children:k.map(z=>b.jsx(oa,{value:z.name,children:b.jsxs("div",{className:"flex items-center gap-2",children:[P(z.baseType),b.jsx("span",{children:z.displayName}),z.isAlias&&b.jsx("span",{className:"text-xs text-muted-foreground",children:"(alias)"})]})},z.name))})]}),((K=_.find(z=>z.name===l))==null?void 0:K.description)&&b.jsx("p",{className:"text-xs text-muted-foreground",children:($=_.find(z=>z.name===l))==null?void 0:$.description})]}),!x&&b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"grid gap-2",children:[b.jsx(aa,{htmlFor:"workspace",children:"Workspace"}),b.jsxs(Am,{value:h,onValueChange:m,children:[b.jsx(jd,{id:"workspace",children:b.jsx(Tm,{placeholder:"Select workspace"})}),b.jsx(Ud,{children:T.length>0?T.map(z=>b.jsx(oa,{value:z.name,children:z.name},z.name)):b.jsx(oa,{value:"_empty",disabled:!0,children:"No workspaces available"})})]})]}),b.jsxs("div",{className:"grid gap-2",children:[b.jsx(aa,{htmlFor:"project",children:"Project"}),b.jsxs(Am,{value:p,onValueChange:y,disabled:!h,children:[b.jsx(jd,{id:"project",children:b.jsx(Tm,{placeholder:h?"Select project":"Select workspace first"})}),b.jsx(Ud,{children:L.length>0?L.map(z=>b.jsx(oa,{value:z.name,children:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx("span",{children:z.name}),z.isGitRepo&&b.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",z.defaultBranch??"git",")"]})]})},z.name)):b.jsx(oa,{value:"_empty",disabled:!0,children:h?"No projects in workspace":"Select workspace first"})})]})]})]}),u&&b.jsx("p",{className:"text-sm text-destructive",children:u})]}),b.jsxs(J1,{children:[b.jsx(dt,{variant:"outline",onClick:()=>n(!1),disabled:s,children:"Cancel"}),b.jsx(dt,{onClick:D,disabled:s||!x&&(!h||!p),children:s?b.jsxs(b.Fragment,{children:[b.jsx(wc,{className:"w-4 h-4 animate-spin"}),"Creating..."]}):"Create Session"})]})]})]})}var ux="AlertDialog",[fN]=qn(ux,[D1]),Ti=D1(),dx=e=>{const{__scopeAlertDialog:r,...n}=e,s=Ti(r);return b.jsx(z1,{...s,...n,modal:!0})};dx.displayName=ux;var pN="AlertDialogTrigger",hx=R.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...s}=e,o=Ti(n);return b.jsx(Y1,{...o,...s,ref:r})});hx.displayName=pN;var mN="AlertDialogPortal",fx=e=>{const{__scopeAlertDialog:r,...n}=e,s=Ti(r);return b.jsx(W1,{...s,...n})};fx.displayName=mN;var gN="AlertDialogOverlay",px=R.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...s}=e,o=Ti(n);return b.jsx(Zg,{...o,...s,ref:r})});px.displayName=gN;var ha="AlertDialogContent",[vN,_N]=fN(ha),yN=qk("AlertDialogContent"),mx=R.forwardRef((e,r)=>{const{__scopeAlertDialog:n,children:s,...o}=e,u=Ti(n),f=R.useRef(null),l=ot(r,f),c=R.useRef(null);return b.jsx(iO,{contentName:ha,titleName:gx,docsSlug:"alert-dialog",children:b.jsx(vN,{scope:n,cancelRef:c,children:b.jsxs(Xg,{role:"alertdialog",...u,...o,ref:l,onOpenAutoFocus:Le(o.onOpenAutoFocus,h=>{var m;h.preventDefault(),(m=c.current)==null||m.focus({preventScroll:!0})}),onPointerDownOutside:h=>h.preventDefault(),onInteractOutside:h=>h.preventDefault(),children:[b.jsx(yN,{children:s}),b.jsx(bN,{contentRef:f})]})})})});mx.displayName=ha;var gx="AlertDialogTitle",vx=R.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...s}=e,o=Ti(n);return b.jsx(ev,{...o,...s,ref:r})});vx.displayName=gx;var _x="AlertDialogDescription",yx=R.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...s}=e,o=Ti(n);return b.jsx(tv,{...o,...s,ref:r})});yx.displayName=_x;var SN="AlertDialogAction",Sx=R.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...s}=e,o=Ti(n);return b.jsx(rv,{...o,...s,ref:r})});Sx.displayName=SN;var bx="AlertDialogCancel",Cx=R.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...s}=e,{cancelRef:o}=_N(bx,n),u=Ti(n),f=ot(r,o);return b.jsx(rv,{...u,...s,ref:f})});Cx.displayName=bx;var bN=({contentRef:e})=>{const r=`\`${ha}\` requires a description for the component to be accessible for screen reader users.
375
+
376
+ You can add a description to the \`${ha}\` by passing a \`${_x}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
377
+
378
+ Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${ha}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
379
+
380
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return R.useEffect(()=>{var s;document.getElementById((s=e.current)==null?void 0:s.getAttribute("aria-describedby"))||console.warn(r)},[r,e]),null},CN=dx,wN=hx,xN=fx,wx=px,xx=mx,Ex=Sx,Ax=Cx,Tx=vx,Rx=yx;const Zd=CN,EN=wN,AN=xN,Dx=R.forwardRef(({className:e,...r},n)=>b.jsx(wx,{className:Te("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r,ref:n}));Dx.displayName=wx.displayName;const sc=R.forwardRef(({className:e,...r},n)=>b.jsxs(AN,{children:[b.jsx(Dx,{}),b.jsx(xx,{ref:n,className:Te("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r})]}));sc.displayName=xx.displayName;const oc=({className:e,...r})=>b.jsx("div",{className:Te("flex flex-col space-y-2 text-center sm:text-left",e),...r});oc.displayName="AlertDialogHeader";const ac=({className:e,...r})=>b.jsx("div",{className:Te("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});ac.displayName="AlertDialogFooter";const lc=R.forwardRef(({className:e,...r},n)=>b.jsx(Tx,{ref:n,className:Te("text-lg font-semibold",e),...r}));lc.displayName=Tx.displayName;const cc=R.forwardRef(({className:e,...r},n)=>b.jsx(Rx,{ref:n,className:Te("text-sm text-muted-foreground",e),...r}));cc.displayName=Rx.displayName;const uc=R.forwardRef(({className:e,...r},n)=>b.jsx(Ex,{ref:n,className:Te(Vg(),e),...r}));uc.displayName=Ex.displayName;const dc=R.forwardRef(({className:e,...r},n)=>b.jsx(Ax,{ref:n,className:Te(Vg({variant:"outline"}),"mt-2 sm:mt-0",e),...r}));dc.displayName=Ax.displayName;const TN=Fg("pointer-events-auto relative flex w-full items-center justify-between gap-4 overflow-hidden rounded-lg border p-4 shadow-lg transition-all data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full",{variants:{variant:{default:"border bg-background text-foreground",success:"border-green-500/50 bg-green-50 text-green-900 dark:bg-green-950 dark:text-green-100",error:"border-destructive/50 bg-destructive/10 text-destructive dark:bg-destructive/20",warning:"border-yellow-500/50 bg-yellow-50 text-yellow-900 dark:bg-yellow-950 dark:text-yellow-100",info:"border-blue-500/50 bg-blue-50 text-blue-900 dark:bg-blue-950 dark:text-blue-100"}},defaultVariants:{variant:"default"}}),RN={default:null,success:e1,error:vh,warning:Yg,info:t1};function DN({id:e,title:r,description:n,variant:s="default",action:o,onDismiss:u}){const f=RN[s];return b.jsxs("div",{className:Te(TN({variant:s})),role:"alert","aria-live":"polite","data-state":"open",children:[b.jsxs("div",{className:"flex items-start gap-3",children:[f&&b.jsx(f,{className:"mt-0.5 h-5 w-5 flex-shrink-0","aria-hidden":"true"}),b.jsxs("div",{className:"flex-1 space-y-1",children:[r&&b.jsx("p",{className:"text-sm font-semibold",children:r}),n&&b.jsx("p",{className:"text-sm opacity-90",children:n})]})]}),b.jsxs("div",{className:"flex items-center gap-2",children:[o&&b.jsx("button",{onClick:o.onClick,className:"text-sm font-medium underline-offset-4 hover:underline",children:o.label}),b.jsx("button",{onClick:()=>u(e),className:"rounded-md p-1 opacity-70 hover:opacity-100","aria-label":"Dismiss notification",children:b.jsx(Wg,{className:"h-4 w-4"})})]})]})}function MN({toasts:e,onDismiss:r}){return e.length===0?null:b.jsx("div",{className:"fixed bottom-0 right-0 z-50 flex max-h-screen w-full flex-col-reverse gap-2 p-4 sm:bottom-auto sm:right-4 sm:top-4 sm:max-w-[420px] sm:flex-col",role:"region","aria-label":"Notifications",children:e.map(n=>b.jsx(DN,{...n,onDismiss:r},n.id))})}class kN{constructor(){_e(this,"toasts",[]);_e(this,"listeners",new Set)}subscribe(r){return this.listeners.add(r),r(this.toasts),()=>this.listeners.delete(r)}notify(){this.listeners.forEach(r=>r([...this.toasts]))}show(r){const n=crypto.randomUUID(),s={...r,id:n};this.toasts=[...this.toasts,s],this.notify();const o=r.duration??5e3;return o>0&&setTimeout(()=>this.dismiss(n),o),n}dismiss(r){this.toasts=this.toasts.filter(n=>n.id!==r),this.notify()}dismissAll(){this.toasts=[],this.notify()}success(r,n){return this.show({title:r,description:n,variant:"success"})}error(r,n){return this.show({title:r,description:n,variant:"error",duration:8e3})}warning(r,n){return this.show({title:r,description:n,variant:"warning"})}info(r,n){return this.show({title:r,description:n,variant:"info"})}}const vi=new kN;function LN(){const[e,r]=R.useState([]);return R.useEffect(()=>vi.subscribe(r),[]),e}const Lr={show:e=>vi.show(e),success:(e,r)=>vi.success(e,r),error:(e,r)=>vi.error(e,r),warning:(e,r)=>vi.warning(e,r),info:(e,r)=>vi.info(e,r),dismiss:e=>vi.dismiss(e),dismissAll:()=>vi.dismissAll()};function zS({status:e}){const r={active:{className:"bg-green-500",label:"Active"},busy:{className:"bg-blue-500 animate-pulse",label:"Processing"},idle:{className:"bg-yellow-500",label:"Idle"}},n=r[e]||r.idle;return b.jsx("span",{className:Te("w-2 h-2 rounded-full shrink-0",n.className),title:n.label,"aria-label":`Status: ${n.label}`})}function ON(){const e=yc(),r=Vn(),n=Ve(F=>F.sessions),s=Ve(F=>F.selectedSessionId),o=Ve(F=>F.selectSession),u=Ve(F=>F.removeSession),f=Ve(F=>F.workstationInfo),l=Pn(F=>F.sidebarCollapsed),c=Pn(F=>F.toggleSidebar),{terminateSession:h}=co(),[m,p]=R.useState(null),y=(f==null?void 0:f.workspacesRoot)??"",x=R.useCallback((F,ee)=>{ee.stopPropagation(),p(F)},[]),A=R.useCallback(()=>{m&&(h(m.id),u(m.id),s===m.id&&e("/chat"),Lr.success("Session Terminated",`${$(m.type)} session has been closed.`),p(null))},[m,h,u,s,e]),w=!s&&r.pathname==="/chat",v=r.pathname==="/settings",S=F=>s===F&&r.pathname===`/chat/${F}`,g=()=>"/chat",_=F=>`/chat/${F}`,T=F=>typeof F=="number"?F:typeof F=="string"?new Date(F).getTime():F instanceof Date?F.getTime():0,M=n.filter(F=>F.type!=="terminal").sort((F,ee)=>T(F.createdAt)-T(ee.createdAt)),k=n.filter(F=>F.type==="terminal").sort((F,ee)=>T(F.createdAt)-T(ee.createdAt)),L=()=>{o(null),e(g())},D=F=>{o(F.id),F.type==="terminal"?e(`/terminal/${F.id}`):e(_(F.id))},P=()=>{e("/settings")},K=F=>{switch(F.type){case"terminal":return b.jsx(va,{className:"w-4 h-4"});case"claude":return b.jsx(Ea,{className:"w-4 h-4"});case"cursor":return b.jsx(Ta,{className:"w-4 h-4"});case"opencode":return b.jsx(Aa,{className:"w-4 h-4"});default:return b.jsx(xi,{className:"w-4 h-4"})}},$=F=>{switch(F){case"claude":return"Claude Code";case"cursor":return"Cursor";case"opencode":return"OpenCode";case"terminal":return"Terminal";case"supervisor":return"Supervisor";default:return F.charAt(0).toUpperCase()+F.slice(1)}},z=F=>{const ee=$(F.type);return F.agentName&&F.agentName!==F.type?`${ee} (${F.agentName})`:ee},W=F=>{const ee=F.workspace&&F.workspace!=="home",Y=F.project&&F.project!=="default";if(ee&&Y)return F.worktree?`${F.workspace}/${F.project}--${F.worktree}`:`${F.workspace}/${F.project}`;if(!F.workingDir)return!ee&&!Y?"~":null;if(!y)return F.workingDir;if(F.workingDir.startsWith(y)){let re=F.workingDir.slice(y.length);return re.startsWith("/")&&(re=re.slice(1)),re||"~"}return F.workingDir};return b.jsxs("aside",{className:"flex flex-col h-full","aria-label":"Session navigation",children:[b.jsx("div",{className:"p-4 border-b space-y-2",children:b.jsxs("div",{className:"flex items-center justify-between",children:[!l&&b.jsx("h1",{className:"font-semibold text-lg",children:"Tiflis Code"}),b.jsx(dt,{variant:"ghost",size:"icon",onClick:c,className:Te(l&&"mx-auto"),"aria-label":l?"Expand sidebar":"Collapse sidebar","aria-expanded":!l,children:l?b.jsx(UM,{className:"w-4 h-4","aria-hidden":"true"}):b.jsx(jM,{className:"w-4 h-4","aria-hidden":"true"})})]})}),b.jsxs("nav",{className:"flex-1 overflow-auto p-2 space-y-1","aria-label":"Sessions",children:[b.jsxs(dt,{variant:w?"secondary":"ghost",className:Te("w-full justify-start",l&&"justify-center px-2"),onClick:L,"aria-current":w?"page":void 0,"aria-label":l?"Supervisor":void 0,children:[b.jsx(ga,{className:"w-4 h-4","aria-hidden":"true"}),!l&&b.jsx("span",{className:"ml-2",children:"Supervisor"})]}),M.length>0&&b.jsxs("section",{className:"pt-4","aria-label":"Agent sessions",children:[!l&&b.jsx("h2",{className:"px-2 py-1 text-xs font-medium text-muted-foreground uppercase",children:"Agent Sessions"}),b.jsx("ul",{role:"list",className:"space-y-1",children:M.map(F=>{const ee=W(F),Y=z(F);return b.jsxs("li",{className:"group relative",children:[b.jsxs(dt,{variant:S(F.id)?"secondary":"ghost",className:Te("w-full justify-start h-auto py-2 pr-8",l&&"justify-center px-2 pr-2"),onClick:()=>D(F),"aria-current":S(F.id)?"page":void 0,"aria-label":l?`${Y}${ee?` - ${ee}`:""}`:void 0,children:[b.jsxs("div",{className:"relative shrink-0",children:[b.jsx("span",{"aria-hidden":"true",children:K(F)}),b.jsx("span",{className:"absolute -bottom-0.5 -right-0.5",children:b.jsx(zS,{status:F.status})})]}),!l&&b.jsxs("div",{className:"ml-2 flex flex-col items-start min-w-0 flex-1",children:[b.jsx("span",{className:"truncate text-sm font-medium",children:Y}),ee&&b.jsx("span",{className:"truncate text-xs text-muted-foreground",children:ee})]})]}),!l&&b.jsx("button",{type:"button",onClick:re=>x(F,re),className:Te("absolute right-1 top-1/2 -translate-y-1/2","p-1.5 rounded-md","opacity-0 group-hover:opacity-100 focus:opacity-100","text-muted-foreground hover:text-destructive hover:bg-destructive/10","transition-opacity"),"aria-label":`Delete ${Y} session`,children:b.jsx(rc,{className:"w-3.5 h-3.5"})})]},F.id)})})]}),k.length>0&&b.jsxs("section",{className:"pt-4","aria-label":"Terminal sessions",children:[!l&&b.jsx("h2",{className:"px-2 py-1 text-xs font-medium text-muted-foreground uppercase",children:"Terminals"}),b.jsx("ul",{role:"list",className:"space-y-1",children:k.map(F=>{const ee=W(F);return b.jsxs("li",{className:"group relative",children:[b.jsxs(dt,{variant:S(F.id)?"secondary":"ghost",className:Te("w-full justify-start h-auto py-2 pr-8",l&&"justify-center px-2 pr-2"),onClick:()=>D(F),"aria-current":S(F.id)?"page":void 0,"aria-label":l?`Terminal${ee?` - ${ee}`:""}`:void 0,children:[b.jsxs("div",{className:"relative shrink-0",children:[b.jsx("span",{"aria-hidden":"true",children:K(F)}),b.jsx("span",{className:"absolute -bottom-0.5 -right-0.5",children:b.jsx(zS,{status:F.status})})]}),!l&&b.jsxs("div",{className:"ml-2 flex flex-col items-start min-w-0 flex-1",children:[b.jsx("span",{className:"truncate text-sm font-medium",children:"Terminal"}),ee&&b.jsx("span",{className:"truncate text-xs text-muted-foreground",children:ee})]})]}),!l&&b.jsx("button",{type:"button",onClick:Y=>x(F,Y),className:Te("absolute right-1 top-1/2 -translate-y-1/2","p-1.5 rounded-md","opacity-0 group-hover:opacity-100 focus:opacity-100","text-muted-foreground hover:text-destructive hover:bg-destructive/10","transition-opacity"),"aria-label":"Delete terminal session",children:b.jsx(rc,{className:"w-3.5 h-3.5"})})]},F.id)})})]}),b.jsx("div",{className:"pt-4",children:b.jsx(cx,{children:b.jsxs(dt,{variant:"outline",className:Te("w-full justify-start",l&&"justify-center px-2"),"aria-label":l?"Create new session":void 0,children:[b.jsx(n1,{className:"w-4 h-4","aria-hidden":"true"}),!l&&b.jsx("span",{className:"ml-2",children:"New Session"})]})})})]}),b.jsx("div",{className:"p-2 border-t",children:b.jsxs(dt,{variant:v?"secondary":"ghost",className:Te("w-full justify-start",l&&"justify-center px-2"),onClick:P,"aria-current":v?"page":void 0,"aria-label":l?"Settings":void 0,children:[b.jsx(tg,{className:"w-4 h-4","aria-hidden":"true"}),!l&&b.jsx("span",{className:"ml-2",children:"Settings"})]})}),b.jsx(Zd,{open:!!m,onOpenChange:F=>!F&&p(null),children:b.jsxs(sc,{children:[b.jsxs(oc,{children:[b.jsx(lc,{children:"Terminate Session?"}),b.jsxs(cc,{children:["This will end the ",m?$(m.type):""," session",(m==null?void 0:m.project)&&` for ${m.project}`,". You will need to create a new session to continue."]})]}),b.jsxs(ac,{children:[b.jsx(dc,{children:"Cancel"}),b.jsx(uc,{onClick:A,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Terminate"})]})]})})]})}var Mh="Popover",[Mx]=qn(Mh,[Ma]),Dc=Ma(),[BN,bs]=Mx(Mh),kx=e=>{const{__scopePopover:r,children:n,open:s,defaultOpen:o,onOpenChange:u,modal:f=!1}=e,l=Dc(r),c=R.useRef(null),[h,m]=R.useState(!1),[p,y]=ro({prop:s,defaultProp:o??!1,onChange:u,caller:Mh});return b.jsx(fv,{...l,children:b.jsx(BN,{scope:r,contentId:jn(),triggerRef:c,open:p,onOpenChange:y,onOpenToggle:R.useCallback(()=>y(x=>!x),[y]),hasCustomAnchor:h,onCustomAnchorAdd:R.useCallback(()=>m(!0),[]),onCustomAnchorRemove:R.useCallback(()=>m(!1),[]),modal:f,children:n})})};kx.displayName=Mh;var Lx="PopoverAnchor",NN=R.forwardRef((e,r)=>{const{__scopePopover:n,...s}=e,o=bs(Lx,n),u=Dc(n),{onCustomAnchorAdd:f,onCustomAnchorRemove:l}=o;return R.useEffect(()=>(f(),()=>l()),[f,l]),b.jsx(Ah,{...u,...s,ref:r})});NN.displayName=Lx;var Ox="PopoverTrigger",Bx=R.forwardRef((e,r)=>{const{__scopePopover:n,...s}=e,o=bs(Ox,n),u=Dc(n),f=ot(r,o.triggerRef),l=b.jsx(Je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ux(o.open),...s,ref:f,onClick:Le(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:b.jsx(Ah,{asChild:!0,...u,children:l})});Bx.displayName=Ox;var vv="PopoverPortal",[IN,PN]=Mx(vv,{forceMount:void 0}),Nx=e=>{const{__scopePopover:r,forceMount:n,children:s,container:o}=e,u=bs(vv,r);return b.jsx(IN,{scope:r,forceMount:n,children:b.jsx(Gn,{present:n||u.open,children:b.jsx(Ac,{asChild:!0,container:o,children:s})})})};Nx.displayName=vv;var ya="PopoverContent",Ix=R.forwardRef((e,r)=>{const n=PN(ya,e.__scopePopover),{forceMount:s=n.forceMount,...o}=e,u=bs(ya,e.__scopePopover);return b.jsx(Gn,{present:s||u.open,children:u.modal?b.jsx(UN,{...o,ref:r}):b.jsx(FN,{...o,ref:r})})});Ix.displayName=ya;var jN=no("PopoverContent.RemoveScroll"),UN=R.forwardRef((e,r)=>{const n=bs(ya,e.__scopePopover),s=R.useRef(null),o=ot(r,s),u=R.useRef(!1);return R.useEffect(()=>{const f=s.current;if(f)return Sh(f)},[]),b.jsx(Tc,{as:jN,allowPinchZoom:!0,children:b.jsx(Px,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Le(e.onCloseAutoFocus,f=>{var l;f.preventDefault(),u.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Le(e.onPointerDownOutside,f=>{const l=f.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,h=l.button===2||c;u.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:Le(e.onFocusOutside,f=>f.preventDefault(),{checkForDefaultPrevented:!1})})})}),FN=R.forwardRef((e,r)=>{const n=bs(ya,e.__scopePopover),s=R.useRef(!1),o=R.useRef(!1);return b.jsx(Px,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{var f,l;(f=e.onCloseAutoFocus)==null||f.call(e,u),u.defaultPrevented||(s.current||(l=n.triggerRef.current)==null||l.focus(),u.preventDefault()),s.current=!1,o.current=!1},onInteractOutside:u=>{var c,h;(c=e.onInteractOutside)==null||c.call(e,u),u.defaultPrevented||(s.current=!0,u.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const f=u.target;((h=n.triggerRef.current)==null?void 0:h.contains(f))&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&o.current&&u.preventDefault()}})}),Px=R.forwardRef((e,r)=>{const{__scopePopover:n,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:u,disableOutsidePointerEvents:f,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:h,onInteractOutside:m,...p}=e,y=bs(ya,n),x=Dc(n);return _h(),b.jsx(Ec,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:u,children:b.jsx(xc,{asChild:!0,disableOutsidePointerEvents:f,onInteractOutside:m,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:h,onDismiss:()=>y.onOpenChange(!1),children:b.jsx(pv,{"data-state":Ux(y.open),role:"dialog",id:y.contentId,...x,...p,ref:r,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),jx="PopoverClose",HN=R.forwardRef((e,r)=>{const{__scopePopover:n,...s}=e,o=bs(jx,n);return b.jsx(Je.button,{type:"button",...s,ref:r,onClick:Le(e.onClick,()=>o.onOpenChange(!1))})});HN.displayName=jx;var VN="PopoverArrow",qN=R.forwardRef((e,r)=>{const{__scopePopover:n,...s}=e,o=Dc(n);return b.jsx(mv,{...o,...s,ref:r})});qN.displayName=VN;function Ux(e){return e?"open":"closed"}var GN=kx,zN=Bx,YN=Nx,Fx=Ix;const YS=GN,WS=zN,pg=R.forwardRef(({className:e,align:r="center",sideOffset:n=4,...s},o)=>b.jsx(YN,{children:b.jsx(Fx,{ref:o,align:r,sideOffset:n,className:Te("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s})}));pg.displayName=Fx.displayName;var Rm="rovingFocusGroup.onEntryFocus",WN={bubbles:!1,cancelable:!0},Mc="RovingFocusGroup",[mg,Hx,KN]=nv(Mc),[QN,Vx]=qn(Mc,[KN]),[$N,JN]=QN(Mc),qx=R.forwardRef((e,r)=>b.jsx(mg.Provider,{scope:e.__scopeRovingFocusGroup,children:b.jsx(mg.Slot,{scope:e.__scopeRovingFocusGroup,children:b.jsx(ZN,{...e,ref:r})})}));qx.displayName=Mc;var ZN=R.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:n,orientation:s,loop:o=!1,dir:u,currentTabStopId:f,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:h,preventScrollOnEntryFocus:m=!1,...p}=e,y=R.useRef(null),x=ot(r,y),A=iv(u),[w,v]=ro({prop:f,defaultProp:l??null,onChange:c,caller:Mc}),[S,g]=R.useState(!1),_=Fn(h),T=Hx(n),M=R.useRef(!1),[k,L]=R.useState(0);return R.useEffect(()=>{const D=y.current;if(D)return D.addEventListener(Rm,_),()=>D.removeEventListener(Rm,_)},[_]),b.jsx($N,{scope:n,orientation:s,dir:A,loop:o,currentTabStopId:w,onItemFocus:R.useCallback(D=>v(D),[v]),onItemShiftTab:R.useCallback(()=>g(!0),[]),onFocusableItemAdd:R.useCallback(()=>L(D=>D+1),[]),onFocusableItemRemove:R.useCallback(()=>L(D=>D-1),[]),children:b.jsx(Je.div,{tabIndex:S||k===0?-1:0,"data-orientation":s,...p,ref:x,style:{outline:"none",...e.style},onMouseDown:Le(e.onMouseDown,()=>{M.current=!0}),onFocus:Le(e.onFocus,D=>{const P=!M.current;if(D.target===D.currentTarget&&P&&!S){const K=new CustomEvent(Rm,WN);if(D.currentTarget.dispatchEvent(K),!K.defaultPrevented){const $=T().filter(Y=>Y.focusable),z=$.find(Y=>Y.active),W=$.find(Y=>Y.id===w),ee=[z,W,...$].filter(Boolean).map(Y=>Y.ref.current);Yx(ee,m)}}M.current=!1}),onBlur:Le(e.onBlur,()=>g(!1))})})}),Gx="RovingFocusGroupItem",zx=R.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:o=!1,tabStopId:u,children:f,...l}=e,c=jn(),h=u||c,m=JN(Gx,n),p=m.currentTabStopId===h,y=Hx(n),{onFocusableItemAdd:x,onFocusableItemRemove:A,currentTabStopId:w}=m;return R.useEffect(()=>{if(s)return x(),()=>A()},[s,x,A]),b.jsx(mg.ItemSlot,{scope:n,id:h,focusable:s,active:o,children:b.jsx(Je.span,{tabIndex:p?0:-1,"data-orientation":m.orientation,...l,ref:r,onMouseDown:Le(e.onMouseDown,v=>{s?m.onItemFocus(h):v.preventDefault()}),onFocus:Le(e.onFocus,()=>m.onItemFocus(h)),onKeyDown:Le(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){m.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const S=t4(v,m.orientation,m.dir);if(S!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let _=y().filter(T=>T.focusable).map(T=>T.ref.current);if(S==="last")_.reverse();else if(S==="prev"||S==="next"){S==="prev"&&_.reverse();const T=_.indexOf(v.currentTarget);_=m.loop?r4(_,T+1):_.slice(T+1)}setTimeout(()=>Yx(_))}}),children:typeof f=="function"?f({isCurrentTabStop:p,hasTabStop:w!=null}):f})})});zx.displayName=Gx;var XN={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function e4(e,r){return r!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function t4(e,r,n){const s=e4(e.key,n);if(!(r==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(r==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return XN[s]}function Yx(e,r=!1){const n=document.activeElement;for(const s of e)if(s===n||(s.focus({preventScroll:r}),document.activeElement!==n))return}function r4(e,r){return e.map((n,s)=>e[(r+s)%e.length])}var n4=qx,i4=zx,gg=["Enter"," "],s4=["ArrowDown","PageUp","Home"],Wx=["ArrowUp","PageDown","End"],o4=[...s4,...Wx],a4={ltr:[...gg,"ArrowRight"],rtl:[...gg,"ArrowLeft"]},l4={ltr:["ArrowLeft"],rtl:["ArrowRight"]},kc="Menu",[hc,c4,u4]=nv(kc),[uo,Kx]=qn(kc,[u4,Ma,Vx]),kh=Ma(),Qx=Vx(),[d4,ho]=uo(kc),[h4,Lc]=uo(kc),$x=e=>{const{__scopeMenu:r,open:n=!1,children:s,dir:o,onOpenChange:u,modal:f=!0}=e,l=kh(r),[c,h]=R.useState(null),m=R.useRef(!1),p=Fn(u),y=iv(o);return R.useEffect(()=>{const x=()=>{m.current=!0,document.addEventListener("pointerdown",A,{capture:!0,once:!0}),document.addEventListener("pointermove",A,{capture:!0,once:!0})},A=()=>m.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",A,{capture:!0}),document.removeEventListener("pointermove",A,{capture:!0})}},[]),b.jsx(fv,{...l,children:b.jsx(d4,{scope:r,open:n,onOpenChange:p,content:c,onContentChange:h,children:b.jsx(h4,{scope:r,onClose:R.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:m,dir:y,modal:f,children:s})})})};$x.displayName=kc;var f4="MenuAnchor",_v=R.forwardRef((e,r)=>{const{__scopeMenu:n,...s}=e,o=kh(n);return b.jsx(Ah,{...o,...s,ref:r})});_v.displayName=f4;var yv="MenuPortal",[p4,Jx]=uo(yv,{forceMount:void 0}),Zx=e=>{const{__scopeMenu:r,forceMount:n,children:s,container:o}=e,u=ho(yv,r);return b.jsx(p4,{scope:r,forceMount:n,children:b.jsx(Gn,{present:n||u.open,children:b.jsx(Ac,{asChild:!0,container:o,children:s})})})};Zx.displayName=yv;var an="MenuContent",[m4,Sv]=uo(an),Xx=R.forwardRef((e,r)=>{const n=Jx(an,e.__scopeMenu),{forceMount:s=n.forceMount,...o}=e,u=ho(an,e.__scopeMenu),f=Lc(an,e.__scopeMenu);return b.jsx(hc.Provider,{scope:e.__scopeMenu,children:b.jsx(Gn,{present:s||u.open,children:b.jsx(hc.Slot,{scope:e.__scopeMenu,children:f.modal?b.jsx(g4,{...o,ref:r}):b.jsx(v4,{...o,ref:r})})})})}),g4=R.forwardRef((e,r)=>{const n=ho(an,e.__scopeMenu),s=R.useRef(null),o=ot(r,s);return R.useEffect(()=>{const u=s.current;if(u)return Sh(u)},[]),b.jsx(bv,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Le(e.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),v4=R.forwardRef((e,r)=>{const n=ho(an,e.__scopeMenu);return b.jsx(bv,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),_4=no("MenuContent.ScrollLock"),bv=R.forwardRef((e,r)=>{const{__scopeMenu:n,loop:s=!1,trapFocus:o,onOpenAutoFocus:u,onCloseAutoFocus:f,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:h,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:y,onDismiss:x,disableOutsideScroll:A,...w}=e,v=ho(an,n),S=Lc(an,n),g=kh(n),_=Qx(n),T=c4(n),[M,k]=R.useState(null),L=R.useRef(null),D=ot(r,L,v.onContentChange),P=R.useRef(0),K=R.useRef(""),$=R.useRef(0),z=R.useRef(null),W=R.useRef("right"),F=R.useRef(0),ee=A?Tc:R.Fragment,Y=A?{as:_4,allowPinchZoom:!0}:void 0,re=O=>{var Q,U;const G=K.current+O,j=T().filter(ue=>!ue.disabled),q=document.activeElement,ne=(Q=j.find(ue=>ue.ref.current===q))==null?void 0:Q.textValue,Z=j.map(ue=>ue.textValue),be=M4(Z,G,ne),fe=(U=j.find(ue=>ue.textValue===be))==null?void 0:U.ref.current;(function ue(oe){K.current=oe,window.clearTimeout(P.current),oe!==""&&(P.current=window.setTimeout(()=>ue(""),1e3))})(G),fe&&setTimeout(()=>fe.focus())};R.useEffect(()=>()=>window.clearTimeout(P.current),[]),_h();const te=R.useCallback(O=>{var j,q;return W.current===((j=z.current)==null?void 0:j.side)&&L4(O,(q=z.current)==null?void 0:q.area)},[]);return b.jsx(m4,{scope:n,searchRef:K,onItemEnter:R.useCallback(O=>{te(O)&&O.preventDefault()},[te]),onItemLeave:R.useCallback(O=>{var G;te(O)||((G=L.current)==null||G.focus(),k(null))},[te]),onTriggerLeave:R.useCallback(O=>{te(O)&&O.preventDefault()},[te]),pointerGraceTimerRef:$,onPointerGraceIntentChange:R.useCallback(O=>{z.current=O},[]),children:b.jsx(ee,{...Y,children:b.jsx(Ec,{asChild:!0,trapped:o,onMountAutoFocus:Le(u,O=>{var G;O.preventDefault(),(G=L.current)==null||G.focus({preventScroll:!0})}),onUnmountAutoFocus:f,children:b.jsx(xc,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:h,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:y,onDismiss:x,children:b.jsx(n4,{asChild:!0,..._,dir:S.dir,orientation:"vertical",loop:s,currentTabStopId:M,onCurrentTabStopIdChange:k,onEntryFocus:Le(c,O=>{S.isUsingKeyboardRef.current||O.preventDefault()}),preventScrollOnEntryFocus:!0,children:b.jsx(pv,{role:"menu","aria-orientation":"vertical","data-state":mE(v.open),"data-radix-menu-content":"",dir:S.dir,...g,...w,ref:D,style:{outline:"none",...w.style},onKeyDown:Le(w.onKeyDown,O=>{const j=O.target.closest("[data-radix-menu-content]")===O.currentTarget,q=O.ctrlKey||O.altKey||O.metaKey,ne=O.key.length===1;j&&(O.key==="Tab"&&O.preventDefault(),!q&&ne&&re(O.key));const Z=L.current;if(O.target!==Z||!o4.includes(O.key))return;O.preventDefault();const fe=T().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);Wx.includes(O.key)&&fe.reverse(),R4(fe)}),onBlur:Le(e.onBlur,O=>{O.currentTarget.contains(O.target)||(window.clearTimeout(P.current),K.current="")}),onPointerMove:Le(e.onPointerMove,fc(O=>{const G=O.target,j=F.current!==O.clientX;if(O.currentTarget.contains(G)&&j){const q=O.clientX>F.current?"right":"left";W.current=q,F.current=O.clientX}}))})})})})})})});Xx.displayName=an;var y4="MenuGroup",Cv=R.forwardRef((e,r)=>{const{__scopeMenu:n,...s}=e;return b.jsx(Je.div,{role:"group",...s,ref:r})});Cv.displayName=y4;var S4="MenuLabel",eE=R.forwardRef((e,r)=>{const{__scopeMenu:n,...s}=e;return b.jsx(Je.div,{...s,ref:r})});eE.displayName=S4;var Xd="MenuItem",KS="menu.itemSelect",Lh=R.forwardRef((e,r)=>{const{disabled:n=!1,onSelect:s,...o}=e,u=R.useRef(null),f=Lc(Xd,e.__scopeMenu),l=Sv(Xd,e.__scopeMenu),c=ot(r,u),h=R.useRef(!1),m=()=>{const p=u.current;if(!n&&p){const y=new CustomEvent(KS,{bubbles:!0,cancelable:!0});p.addEventListener(KS,x=>s==null?void 0:s(x),{once:!0}),g1(p,y),y.defaultPrevented?h.current=!1:f.onClose()}};return b.jsx(tE,{...o,ref:c,disabled:n,onClick:Le(e.onClick,m),onPointerDown:p=>{var y;(y=e.onPointerDown)==null||y.call(e,p),h.current=!0},onPointerUp:Le(e.onPointerUp,p=>{var y;h.current||(y=p.currentTarget)==null||y.click()}),onKeyDown:Le(e.onKeyDown,p=>{const y=l.searchRef.current!=="";n||y&&p.key===" "||gg.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Lh.displayName=Xd;var tE=R.forwardRef((e,r)=>{const{__scopeMenu:n,disabled:s=!1,textValue:o,...u}=e,f=Sv(Xd,n),l=Qx(n),c=R.useRef(null),h=ot(r,c),[m,p]=R.useState(!1),[y,x]=R.useState("");return R.useEffect(()=>{const A=c.current;A&&x((A.textContent??"").trim())},[u.children]),b.jsx(hc.ItemSlot,{scope:n,disabled:s,textValue:o??y,children:b.jsx(i4,{asChild:!0,...l,focusable:!s,children:b.jsx(Je.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":s||void 0,"data-disabled":s?"":void 0,...u,ref:h,onPointerMove:Le(e.onPointerMove,fc(A=>{s?f.onItemLeave(A):(f.onItemEnter(A),A.defaultPrevented||A.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Le(e.onPointerLeave,fc(A=>f.onItemLeave(A))),onFocus:Le(e.onFocus,()=>p(!0)),onBlur:Le(e.onBlur,()=>p(!1))})})})}),b4="MenuCheckboxItem",rE=R.forwardRef((e,r)=>{const{checked:n=!1,onCheckedChange:s,...o}=e;return b.jsx(aE,{scope:e.__scopeMenu,checked:n,children:b.jsx(Lh,{role:"menuitemcheckbox","aria-checked":eh(n)?"mixed":n,...o,ref:r,"data-state":xv(n),onSelect:Le(o.onSelect,()=>s==null?void 0:s(eh(n)?!0:!n),{checkForDefaultPrevented:!1})})})});rE.displayName=b4;var nE="MenuRadioGroup",[C4,w4]=uo(nE,{value:void 0,onValueChange:()=>{}}),iE=R.forwardRef((e,r)=>{const{value:n,onValueChange:s,...o}=e,u=Fn(s);return b.jsx(C4,{scope:e.__scopeMenu,value:n,onValueChange:u,children:b.jsx(Cv,{...o,ref:r})})});iE.displayName=nE;var sE="MenuRadioItem",oE=R.forwardRef((e,r)=>{const{value:n,...s}=e,o=w4(sE,e.__scopeMenu),u=n===o.value;return b.jsx(aE,{scope:e.__scopeMenu,checked:u,children:b.jsx(Lh,{role:"menuitemradio","aria-checked":u,...s,ref:r,"data-state":xv(u),onSelect:Le(s.onSelect,()=>{var f;return(f=o.onValueChange)==null?void 0:f.call(o,n)},{checkForDefaultPrevented:!1})})})});oE.displayName=sE;var wv="MenuItemIndicator",[aE,x4]=uo(wv,{checked:!1}),lE=R.forwardRef((e,r)=>{const{__scopeMenu:n,forceMount:s,...o}=e,u=x4(wv,n);return b.jsx(Gn,{present:s||eh(u.checked)||u.checked===!0,children:b.jsx(Je.span,{...o,ref:r,"data-state":xv(u.checked)})})});lE.displayName=wv;var E4="MenuSeparator",cE=R.forwardRef((e,r)=>{const{__scopeMenu:n,...s}=e;return b.jsx(Je.div,{role:"separator","aria-orientation":"horizontal",...s,ref:r})});cE.displayName=E4;var A4="MenuArrow",uE=R.forwardRef((e,r)=>{const{__scopeMenu:n,...s}=e,o=kh(n);return b.jsx(mv,{...o,...s,ref:r})});uE.displayName=A4;var T4="MenuSub",[Rj,dE]=uo(T4),Zl="MenuSubTrigger",hE=R.forwardRef((e,r)=>{const n=ho(Zl,e.__scopeMenu),s=Lc(Zl,e.__scopeMenu),o=dE(Zl,e.__scopeMenu),u=Sv(Zl,e.__scopeMenu),f=R.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=u,h={__scopeMenu:e.__scopeMenu},m=R.useCallback(()=>{f.current&&window.clearTimeout(f.current),f.current=null},[]);return R.useEffect(()=>m,[m]),R.useEffect(()=>{const p=l.current;return()=>{window.clearTimeout(p),c(null)}},[l,c]),b.jsx(_v,{asChild:!0,...h,children:b.jsx(tE,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":mE(n.open),...e,ref:Cc(r,o.onTriggerChange),onClick:p=>{var y;(y=e.onClick)==null||y.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Le(e.onPointerMove,fc(p=>{u.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!f.current&&(u.onPointerGraceIntentChange(null),f.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:Le(e.onPointerLeave,fc(p=>{var x,A;m();const y=(x=n.content)==null?void 0:x.getBoundingClientRect();if(y){const w=(A=n.content)==null?void 0:A.dataset.side,v=w==="right",S=v?-5:5,g=y[v?"left":"right"],_=y[v?"right":"left"];u.onPointerGraceIntentChange({area:[{x:p.clientX+S,y:p.clientY},{x:g,y:y.top},{x:_,y:y.top},{x:_,y:y.bottom},{x:g,y:y.bottom}],side:w}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>u.onPointerGraceIntentChange(null),300)}else{if(u.onTriggerLeave(p),p.defaultPrevented)return;u.onPointerGraceIntentChange(null)}})),onKeyDown:Le(e.onKeyDown,p=>{var x;const y=u.searchRef.current!=="";e.disabled||y&&p.key===" "||a4[s.dir].includes(p.key)&&(n.onOpenChange(!0),(x=n.content)==null||x.focus(),p.preventDefault())})})})});hE.displayName=Zl;var fE="MenuSubContent",pE=R.forwardRef((e,r)=>{const n=Jx(an,e.__scopeMenu),{forceMount:s=n.forceMount,...o}=e,u=ho(an,e.__scopeMenu),f=Lc(an,e.__scopeMenu),l=dE(fE,e.__scopeMenu),c=R.useRef(null),h=ot(r,c);return b.jsx(hc.Provider,{scope:e.__scopeMenu,children:b.jsx(Gn,{present:s||u.open,children:b.jsx(hc.Slot,{scope:e.__scopeMenu,children:b.jsx(bv,{id:l.contentId,"aria-labelledby":l.triggerId,...o,ref:h,align:"start",side:f.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var p;f.isUsingKeyboardRef.current&&((p=c.current)==null||p.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:Le(e.onFocusOutside,m=>{m.target!==l.trigger&&u.onOpenChange(!1)}),onEscapeKeyDown:Le(e.onEscapeKeyDown,m=>{f.onClose(),m.preventDefault()}),onKeyDown:Le(e.onKeyDown,m=>{var x;const p=m.currentTarget.contains(m.target),y=l4[f.dir].includes(m.key);p&&y&&(u.onOpenChange(!1),(x=l.trigger)==null||x.focus(),m.preventDefault())})})})})})});pE.displayName=fE;function mE(e){return e?"open":"closed"}function eh(e){return e==="indeterminate"}function xv(e){return eh(e)?"indeterminate":e?"checked":"unchecked"}function R4(e){const r=document.activeElement;for(const n of e)if(n===r||(n.focus(),document.activeElement!==r))return}function D4(e,r){return e.map((n,s)=>e[(r+s)%e.length])}function M4(e,r,n){const o=r.length>1&&Array.from(r).every(h=>h===r[0])?r[0]:r,u=n?e.indexOf(n):-1;let f=D4(e,Math.max(u,0));o.length===1&&(f=f.filter(h=>h!==n));const c=f.find(h=>h.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function k4(e,r){const{x:n,y:s}=e;let o=!1;for(let u=0,f=r.length-1;u<r.length;f=u++){const l=r[u],c=r[f],h=l.x,m=l.y,p=c.x,y=c.y;m>s!=y>s&&n<(p-h)*(s-m)/(y-m)+h&&(o=!o)}return o}function L4(e,r){if(!r)return!1;const n={x:e.clientX,y:e.clientY};return k4(n,r)}function fc(e){return r=>r.pointerType==="mouse"?e(r):void 0}var O4=$x,B4=_v,N4=Zx,I4=Xx,P4=Cv,j4=eE,U4=Lh,F4=rE,H4=iE,V4=oE,q4=lE,G4=cE,z4=uE,Y4=hE,W4=pE,Oh="DropdownMenu",[K4]=qn(Oh,[Kx]),Cr=Kx(),[Q4,gE]=K4(Oh),vE=e=>{const{__scopeDropdownMenu:r,children:n,dir:s,open:o,defaultOpen:u,onOpenChange:f,modal:l=!0}=e,c=Cr(r),h=R.useRef(null),[m,p]=ro({prop:o,defaultProp:u??!1,onChange:f,caller:Oh});return b.jsx(Q4,{scope:r,triggerId:jn(),triggerRef:h,contentId:jn(),open:m,onOpenChange:p,onOpenToggle:R.useCallback(()=>p(y=>!y),[p]),modal:l,children:b.jsx(O4,{...c,open:m,onOpenChange:p,dir:s,modal:l,children:n})})};vE.displayName=Oh;var _E="DropdownMenuTrigger",yE=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,disabled:s=!1,...o}=e,u=gE(_E,n),f=Cr(n);return b.jsx(B4,{asChild:!0,...f,children:b.jsx(Je.button,{type:"button",id:u.triggerId,"aria-haspopup":"menu","aria-expanded":u.open,"aria-controls":u.open?u.contentId:void 0,"data-state":u.open?"open":"closed","data-disabled":s?"":void 0,disabled:s,...o,ref:Cc(r,u.triggerRef),onPointerDown:Le(e.onPointerDown,l=>{!s&&l.button===0&&l.ctrlKey===!1&&(u.onOpenToggle(),u.open||l.preventDefault())}),onKeyDown:Le(e.onKeyDown,l=>{s||(["Enter"," "].includes(l.key)&&u.onOpenToggle(),l.key==="ArrowDown"&&u.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});yE.displayName=_E;var $4="DropdownMenuPortal",SE=e=>{const{__scopeDropdownMenu:r,...n}=e,s=Cr(r);return b.jsx(N4,{...s,...n})};SE.displayName=$4;var bE="DropdownMenuContent",CE=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,o=gE(bE,n),u=Cr(n),f=R.useRef(!1);return b.jsx(I4,{id:o.contentId,"aria-labelledby":o.triggerId,...u,...s,ref:r,onCloseAutoFocus:Le(e.onCloseAutoFocus,l=>{var c;f.current||(c=o.triggerRef.current)==null||c.focus(),f.current=!1,l.preventDefault()}),onInteractOutside:Le(e.onInteractOutside,l=>{const c=l.detail.originalEvent,h=c.button===0&&c.ctrlKey===!0,m=c.button===2||h;(!o.modal||m)&&(f.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});CE.displayName=bE;var J4="DropdownMenuGroup",Z4=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,o=Cr(n);return b.jsx(P4,{...o,...s,ref:r})});Z4.displayName=J4;var X4="DropdownMenuLabel",eI=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,o=Cr(n);return b.jsx(j4,{...o,...s,ref:r})});eI.displayName=X4;var tI="DropdownMenuItem",wE=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,o=Cr(n);return b.jsx(U4,{...o,...s,ref:r})});wE.displayName=tI;var rI="DropdownMenuCheckboxItem",nI=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,o=Cr(n);return b.jsx(F4,{...o,...s,ref:r})});nI.displayName=rI;var iI="DropdownMenuRadioGroup",sI=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,o=Cr(n);return b.jsx(H4,{...o,...s,ref:r})});sI.displayName=iI;var oI="DropdownMenuRadioItem",aI=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,o=Cr(n);return b.jsx(V4,{...o,...s,ref:r})});aI.displayName=oI;var lI="DropdownMenuItemIndicator",cI=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,o=Cr(n);return b.jsx(q4,{...o,...s,ref:r})});cI.displayName=lI;var uI="DropdownMenuSeparator",xE=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,o=Cr(n);return b.jsx(G4,{...o,...s,ref:r})});xE.displayName=uI;var dI="DropdownMenuArrow",hI=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,o=Cr(n);return b.jsx(z4,{...o,...s,ref:r})});hI.displayName=dI;var fI="DropdownMenuSubTrigger",pI=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,o=Cr(n);return b.jsx(Y4,{...o,...s,ref:r})});pI.displayName=fI;var mI="DropdownMenuSubContent",gI=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,o=Cr(n);return b.jsx(W4,{...o,...s,ref:r,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});gI.displayName=mI;var vI=vE,_I=yE,yI=SE,EE=CE,AE=wE,TE=xE;const QS=vI,$S=_I,vg=R.forwardRef(({className:e,sideOffset:r=4,...n},s)=>b.jsx(yI,{children:b.jsx(EE,{ref:s,sideOffset:r,className:Te("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));vg.displayName=EE.displayName;const Zs=R.forwardRef(({className:e,inset:r,...n},s)=>b.jsx(AE,{ref:s,className:Te("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none","transition-colors focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","[&>svg]:size-4 [&>svg]:shrink-0",r&&"pl-8",e),...n}));Zs.displayName=AE.displayName;const SI=R.forwardRef(({className:e,...r},n)=>b.jsx(TE,{ref:n,className:Te("-mx-1 my-1 h-px bg-muted",e),...r}));SI.displayName=TE.displayName;function JS({status:e}){const r={active:{className:"bg-green-500",label:"Active"},busy:{className:"bg-blue-500 animate-pulse",label:"Processing"},idle:{className:"bg-yellow-500",label:"Idle"}},n=r[e]||r.idle;return b.jsx("span",{className:Te("w-2 h-2 rounded-full shrink-0",n.className),title:n.label,"aria-label":`Status: ${n.label}`})}function bI(){const[e,r]=R.useState(!1),[n,s]=R.useState(!1),[o,u]=R.useState(!1),f=yc(),l=Vn(),c=Ve(Z=>Z.sessions),h=Ve(Z=>Z.selectedSessionId),m=Ve(Z=>Z.selectSession),p=Ve(Z=>Z.removeSession),y=Ve(Z=>Z.workstationInfo),x=Ve(Z=>Z.connectionState),A=Ve(Z=>Z.workstationOnline),{clearSupervisorContext:w,terminateSession:v}=co(),S=(y==null?void 0:y.workspacesRoot)??"",g=!h&&l.pathname==="/chat",_=l.pathname==="/settings",T=c.filter(Z=>Z.type!=="terminal"),M=c.filter(Z=>Z.type==="terminal"),k=(Z,be)=>{m(be!==void 0?be:null),f(Z),r(!1)},L=()=>"/chat",D=Z=>`/chat/${Z}`,P=Z=>{switch(Z.type){case"terminal":return b.jsx(va,{className:"w-4 h-4"});case"claude":return b.jsx(Ea,{className:"w-4 h-4"});case"cursor":return b.jsx(Ta,{className:"w-4 h-4"});case"opencode":return b.jsx(Aa,{className:"w-4 h-4"});default:return b.jsx(xi,{className:"w-4 h-4"})}},K=Z=>{switch(Z){case"claude":return"Claude Code";case"cursor":return"Cursor";case"opencode":return"OpenCode";case"terminal":return"Terminal";case"supervisor":return"Supervisor";default:return Z.charAt(0).toUpperCase()+Z.slice(1)}},$=Z=>{const be=K(Z.type);return Z.agentName&&Z.agentName!==Z.type?`${be} (${Z.agentName})`:be},z=Z=>{const be=Z.workspace&&Z.workspace!=="home",fe=Z.project&&Z.project!=="default";if(be&&fe)return Z.worktree?`${Z.workspace}/${Z.project}--${Z.worktree}`:`${Z.workspace}/${Z.project}`;if(!Z.workingDir)return!be&&!fe?"~":null;if(!S)return Z.workingDir;if(Z.workingDir.startsWith(S)){let Q=Z.workingDir.slice(S.length);return Q.startsWith("/")&&(Q=Q.slice(1)),Q||"~"}return Z.workingDir},W=()=>h?c.find(Z=>Z.id===h):null,F=()=>{if(_)return"Settings";const Z=W();return Z?Z.type==="terminal"?"Terminal":$(Z):"Supervisor"},ee=()=>{if(_)return null;const Z=W();return Z?z(Z):null},Y=()=>{w(),Lr.success("Context Cleared","Supervisor conversation has been reset."),s(!1)},re=()=>{h&&(v(h),p(h),f("/chat"),Lr.success("Session Terminated","The session has been closed."),u(!1))},te=()=>{h&&(window.dispatchEvent(new CustomEvent("terminal-clear",{detail:{sessionId:h}})),Lr.success("Terminal Cleared","Terminal output has been cleared."))},O=W(),G=(O==null?void 0:O.type)==="terminal",j=()=>{if(_)return b.jsx(tg,{className:"w-4 h-4"});const Z=W();return Z?P(Z):b.jsx(ga,{className:"w-4 h-4"})},ne=x==="verified"&&A?{icon:null,color:"bg-green-500",label:"Connected",isCircle:!0}:x==="verified"&&!A?{icon:Yg,color:"text-orange-500",label:"Workstation offline"}:x==="error"||x==="disconnected"?{icon:s1,color:"text-destructive",label:"Disconnected"}:x==="connecting"||x==="authenticating"||x==="authenticated"?{icon:wc,color:"text-yellow-500",label:"Connecting...",spin:!0}:{icon:o1,color:"text-muted-foreground",label:x};return b.jsxs(b.Fragment,{children:[b.jsxs("header",{className:"md:hidden flex items-center gap-3 p-4 border-b bg-card",children:[b.jsx(dt,{variant:"ghost",size:"icon",onClick:()=>r(!0),children:b.jsx(GM,{className:"w-5 h-5"})}),b.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[j(),b.jsxs("div",{className:"min-w-0 flex-1",children:[b.jsx("h1",{className:"font-semibold truncate text-sm",children:F()}),ee()&&b.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ee()})]})]}),b.jsxs(YS,{children:[b.jsx(WS,{asChild:!0,children:b.jsx(dt,{variant:"ghost",size:"icon",className:"relative shrink-0",children:ne.isCircle?b.jsx("span",{className:Te("w-2.5 h-2.5 rounded-full",ne.color)}):ne.icon?b.jsx(ne.icon,{className:Te("w-4 h-4",ne.color,ne.spin&&"animate-spin")}):null})}),b.jsxs(pg,{align:"end",className:"w-56",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[ne.isCircle?b.jsx("span",{className:Te("w-2.5 h-2.5 rounded-full",ne.color)}):ne.icon?b.jsx(ne.icon,{className:Te("w-4 h-4",ne.color,ne.spin&&"animate-spin")}):null,b.jsx("span",{className:"text-sm font-medium",children:ne.label})]}),y&&b.jsxs("div",{className:"mt-2 pt-2 border-t text-xs text-muted-foreground space-y-1",children:[b.jsxs("p",{children:["Workstation: ",y.name]}),b.jsxs("p",{children:["Version: ",y.version]})]})]})]}),(g||h)&&!_&&b.jsxs(QS,{children:[b.jsx($S,{asChild:!0,children:b.jsx(dt,{variant:"ghost",size:"icon",className:"shrink-0",children:b.jsx(gS,{className:"w-5 h-5"})})}),b.jsxs(vg,{align:"end",children:[g&&b.jsxs(Zs,{onClick:()=>s(!0),className:"text-destructive focus:text-destructive",children:[b.jsx(fd,{className:"w-4 h-4"}),"Clear Context"]}),G&&b.jsxs(Zs,{onClick:te,children:[b.jsx(fd,{className:"w-4 h-4"}),"Clear Terminal"]}),h&&b.jsxs(Zs,{onClick:()=>u(!0),className:"text-destructive focus:text-destructive",children:[b.jsx(rc,{className:"w-4 h-4"}),"Terminate Session"]})]})]})]}),b.jsxs("header",{className:"hidden md:flex items-center gap-3 p-4 pl-6 border-b bg-card",children:[b.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[j(),b.jsxs("div",{className:"min-w-0 flex-1",children:[b.jsx("h1",{className:"font-semibold truncate text-sm",children:F()}),ee()&&b.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ee()})]})]}),b.jsxs(YS,{children:[b.jsx(WS,{asChild:!0,children:b.jsx(dt,{variant:"ghost",size:"icon",className:"relative shrink-0",children:ne.isCircle?b.jsx("span",{className:Te("w-2.5 h-2.5 rounded-full",ne.color)}):ne.icon?b.jsx(ne.icon,{className:Te("w-4 h-4",ne.color,ne.spin&&"animate-spin")}):null})}),b.jsxs(pg,{align:"end",className:"w-56",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[ne.isCircle?b.jsx("span",{className:Te("w-2.5 h-2.5 rounded-full",ne.color)}):ne.icon?b.jsx(ne.icon,{className:Te("w-4 h-4",ne.color,ne.spin&&"animate-spin")}):null,b.jsx("span",{className:"text-sm font-medium",children:ne.label})]}),y&&b.jsxs("div",{className:"mt-2 pt-2 border-t text-xs text-muted-foreground space-y-1",children:[b.jsxs("p",{children:["Workstation: ",y.name]}),b.jsxs("p",{children:["Version: ",y.version]})]})]})]}),(g||h)&&!_&&b.jsxs(QS,{children:[b.jsx($S,{asChild:!0,children:b.jsx(dt,{variant:"ghost",size:"icon",className:"shrink-0",children:b.jsx(gS,{className:"w-5 h-5"})})}),b.jsxs(vg,{align:"end",children:[g&&b.jsxs(Zs,{onClick:()=>s(!0),className:"text-destructive focus:text-destructive",children:[b.jsx(fd,{className:"w-4 h-4"}),"Clear Context"]}),G&&b.jsxs(Zs,{onClick:te,children:[b.jsx(fd,{className:"w-4 h-4"}),"Clear Terminal"]}),h&&b.jsxs(Zs,{onClick:()=>u(!0),className:"text-destructive focus:text-destructive",children:[b.jsx(rc,{className:"w-4 h-4"}),"Terminate Session"]})]})]})]}),b.jsx(Zd,{open:n,onOpenChange:s,children:b.jsxs(sc,{children:[b.jsxs(oc,{children:[b.jsx(lc,{children:"Clear Conversation?"}),b.jsx(cc,{children:"This will clear the entire conversation history with the Supervisor. This action cannot be undone."})]}),b.jsxs(ac,{children:[b.jsx(dc,{children:"Cancel"}),b.jsx(uc,{onClick:Y,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Clear Context"})]})]})}),b.jsx(Zd,{open:o,onOpenChange:u,children:b.jsxs(sc,{children:[b.jsxs(oc,{children:[b.jsx(lc,{children:"Terminate Session?"}),b.jsx(cc,{children:"This will end the current session and close the connection to the agent. You will need to create a new session to continue."})]}),b.jsxs(ac,{children:[b.jsx(dc,{children:"Cancel"}),b.jsx(uc,{onClick:re,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Terminate"})]})]})}),e&&b.jsx("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>r(!1)}),b.jsx("div",{className:Te("md:hidden fixed inset-y-0 left-0 w-full bg-card z-50 transform transition-transform duration-300",e?"translate-x-0":"-translate-x-full"),children:b.jsxs("div",{className:"flex flex-col h-full",children:[b.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[b.jsx("h1",{className:"font-semibold text-lg",children:"Tiflis Code"}),b.jsx(dt,{variant:"ghost",size:"icon",onClick:()=>r(!1),children:b.jsx(Wg,{className:"w-5 h-5"})})]}),b.jsxs("nav",{className:"flex-1 overflow-auto p-2 space-y-1","aria-label":"Sessions",children:[b.jsxs(dt,{variant:g?"secondary":"ghost",className:"w-full justify-start",onClick:()=>k(L()),"aria-current":g?"page":void 0,children:[b.jsx(ga,{className:"w-4 h-4","aria-hidden":"true"}),b.jsx("span",{className:"ml-2",children:"Supervisor"})]}),T.length>0&&b.jsxs("section",{className:"pt-4","aria-label":"Agent sessions",children:[b.jsx("h2",{className:"px-2 py-1 text-xs font-medium text-muted-foreground uppercase",children:"Agent Sessions"}),b.jsx("ul",{role:"list",className:"space-y-1",children:T.map(Z=>{const be=z(Z),fe=$(Z);return b.jsx("li",{children:b.jsxs(dt,{variant:h===Z.id?"secondary":"ghost",className:"w-full justify-start h-auto py-2",onClick:()=>k(D(Z.id),Z.id),"aria-current":h===Z.id?"page":void 0,children:[b.jsxs("div",{className:"relative shrink-0",children:[b.jsx("span",{"aria-hidden":"true",children:P(Z)}),b.jsx("span",{className:"absolute -bottom-0.5 -right-0.5",children:b.jsx(JS,{status:Z.status})})]}),b.jsxs("div",{className:"ml-2 flex flex-col items-start min-w-0 flex-1",children:[b.jsx("span",{className:"truncate text-sm font-medium flex items-center",children:fe}),be&&b.jsx("span",{className:"truncate text-xs text-muted-foreground",children:be})]})]})},Z.id)})})]}),M.length>0&&b.jsxs("section",{className:"pt-4","aria-label":"Terminal sessions",children:[b.jsx("h2",{className:"px-2 py-1 text-xs font-medium text-muted-foreground uppercase",children:"Terminals"}),b.jsx("ul",{role:"list",className:"space-y-1",children:M.map(Z=>{const be=z(Z);return b.jsx("li",{children:b.jsxs(dt,{variant:h===Z.id?"secondary":"ghost",className:"w-full justify-start h-auto py-2",onClick:()=>k(`/terminal/${Z.id}`,Z.id),"aria-current":h===Z.id?"page":void 0,children:[b.jsxs("div",{className:"relative shrink-0",children:[b.jsx("span",{"aria-hidden":"true",children:P(Z)}),b.jsx("span",{className:"absolute -bottom-0.5 -right-0.5",children:b.jsx(JS,{status:Z.status})})]}),b.jsxs("div",{className:"ml-2 flex flex-col items-start min-w-0 flex-1",children:[b.jsx("span",{className:"truncate text-sm font-medium",children:"Terminal"}),be&&b.jsx("span",{className:"truncate text-xs text-muted-foreground",children:be})]})]})},Z.id)})})]}),b.jsx("div",{className:"pt-4",children:b.jsx(cx,{children:b.jsxs(dt,{variant:"outline",className:"w-full justify-start",children:[b.jsx(n1,{className:"w-4 h-4","aria-hidden":"true"}),b.jsx("span",{className:"ml-2",children:"New Session"})]})})})]}),b.jsx("div",{className:"p-2 border-t",children:b.jsxs(dt,{variant:_?"secondary":"ghost",className:"w-full justify-start",onClick:()=>k("/settings"),children:[b.jsx(tg,{className:"w-4 h-4"}),b.jsx("span",{className:"ml-2",children:"Settings"})]})})]})})]})}function CI(){const e=Pn(h=>h.sidebarCollapsed),r=Pn(h=>h.sidebarWidth),n=Pn(h=>h.setSidebarWidth),[s,o]=R.useState(!1),u=R.useRef(!1),f=R.useRef(null),l=R.useCallback(h=>{if(e)return;h.preventDefault(),o(!0),u.current=!0;const m=y=>{if(!u.current)return;const x=y.clientX;x>=a1&&x<=l1&&n(x)},p=()=>{o(!1),u.current=!1,document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",p),document.body.style.cursor="",document.body.style.userSelect=""};document.addEventListener("mousemove",m),document.addEventListener("mouseup",p),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[e,n]),c=e?hk:r;return b.jsxs("div",{className:"flex h-[var(--app-height)] overflow-hidden bg-background",children:[b.jsxs("aside",{ref:f,style:{width:c},className:Te("hidden md:flex flex-col border-r bg-card relative",!e&&"transition-none",e&&"transition-all duration-300"),children:[b.jsx(ON,{}),!e&&b.jsx("div",{className:Te("absolute top-0 right-0 w-1 h-full cursor-col-resize hover:bg-primary/20 transition-colors",s&&"bg-primary/30"),onMouseDown:l})]}),b.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[b.jsx(bI,{}),b.jsx("main",{className:"flex-1 overflow-hidden",children:b.jsx(KR,{})})]})]})}function RE({audioUrl:e,audioBase64:r,messageId:n,className:s,onPlayStart:o,onPlayEnd:u}){const[f,l]=R.useState(!1),[c,h]=R.useState(!1),[m,p]=R.useState(0),[y,x]=R.useState(0),[A,w]=R.useState(!1),[v,S]=R.useState(null),[g,_]=R.useState(!1),[T,M]=R.useState(null),[k,L]=R.useState(!1),D=R.useRef(null),P=R.useRef(!1),K=R.useRef(!1),$=R.useRef(!1),z=!!(r||e),W=n?It.hasAudio(n):!1,F=!!n&&!z&&!W&&!A,ee=T!==null?T:y,Y=m>0?ee/m*100:0;R.useEffect(()=>It.subscribe(Q=>{Q.messageId===n?(l(Q.isPlaying),h(Q.isLoading),x(Q.currentTime),Q.duration>0&&(p(Q.duration),w(!0)),Q.error&&S(Q.error),Q.isPlaying&&!$.current?o==null||o():!Q.isPlaying&&$.current&&Q.currentTime===0&&(u==null||u()),$.current=Q.isPlaying):$.current&&Q.messageId!==n&&(l(!1),$.current=!1)}),[n,o,u]),R.useEffect(()=>{if(!K.current)if(n&&It.hasAudio(n)){const fe=It.getAudio(n);if(fe){if(fe.duration&&!isNaN(fe.duration))p(fe.duration);else{const Q=()=>{isNaN(fe.duration)||p(fe.duration),fe.removeEventListener("loadedmetadata",Q)};fe.addEventListener("loadedmetadata",Q)}w(!0),K.current=!0}}else r&&n&&(It.playAudio(r,n,!1),w(!0),K.current=!0)},[r,n]);const re=R.useCallback(async()=>{if(!n||k)return;L(!0),h(!0),S(null),on.audio(`Requesting audio for messageId: ${n}`);const fe=async(Q=1)=>{try{const U={type:"audio.request",id:crypto.randomUUID(),payload:{message_id:n}},ue=await Mt.sendRequest(U);if(ue.payload.error){if(ue.payload.error==="Audio not found"&&Q<3)return await new Promise(de=>setTimeout(de,1e3)),fe(Q+1);ue.payload.error==="Audio not found"?S("Audio unavailable - TTS may be disabled"):S(ue.payload.error),h(!1),L(!1);return}const oe=ue.payload.audio||ue.payload.audio_base64;if(oe)It.playAudio(oe,n,!0),w(!0),K.current=!0;else{if(Q<3)return await new Promise(de=>setTimeout(de,1e3)),fe(Q+1);S("Audio not available")}}catch(U){const ue=U instanceof Error?U.message:"Failed to load audio";if(Q<3)return await new Promise(oe=>setTimeout(oe,1e3)),fe(Q+1);S(ue)}};await fe(),h(!1),L(!1)},[n,k]),te=R.useCallback(()=>{if(!A&&F){re();return}if(n&&It.getCurrentMessageId()!==n){It.hasAudio(n)?It.playByMessageId(n):r&&It.playAudio(r,n,!0);return}It.togglePlay()},[A,F,re,n,r]),O=R.useCallback(()=>{n&&It.getCurrentMessageId()===n&&(It.resetToStart(),"vibrate"in navigator&&navigator.vibrate(10))},[n]),G=R.useCallback(fe=>{if(isNaN(fe)||!isFinite(fe))return"0:00";const Q=Math.floor(fe/60),U=Math.floor(fe%60);return`${Q}:${U.toString().padStart(2,"0")}`},[]),j=R.useCallback(fe=>{var oe,de;if(!D.current||!m)return null;const Q=D.current.getBoundingClientRect(),U="touches"in fe?((oe=fe.touches[0])==null?void 0:oe.clientX)??((de=fe.changedTouches[0])==null?void 0:de.clientX)??0:fe.clientX;return Math.max(0,Math.min(1,(U-Q.left)/Q.width))*m},[m]),q=R.useCallback(fe=>{if(!m||c)return;fe.preventDefault(),fe.stopPropagation(),P.current=f,f&&n&&It.getCurrentMessageId()===n&&It.togglePlay(),_(!0);const Q=j(fe);Q!==null&&(M(Q),"vibrate"in navigator&&navigator.vibrate(5))},[m,c,f,n,j]);R.useEffect(()=>{if(!g)return;const fe=U=>{U.preventDefault();const ue=j(U);ue!==null&&M(ue)},Q=U=>{const ue=j(U);ue!==null&&n&&(It.seekToTime(ue),x(ue),P.current&&It.togglePlay()),M(null),_(!1),"vibrate"in navigator&&navigator.vibrate(10)};return document.addEventListener("mousemove",fe,{passive:!1}),document.addEventListener("mouseup",Q),document.addEventListener("touchmove",fe,{passive:!1}),document.addEventListener("touchend",Q),()=>{document.removeEventListener("mousemove",fe),document.removeEventListener("mouseup",Q),document.removeEventListener("touchmove",fe),document.removeEventListener("touchend",Q)}},[g,j,n]);const ne=R.useCallback(fe=>{if(fe.key===" "||fe.key==="Spacebar"){fe.preventDefault(),te();return}if(fe.key==="r"||fe.key==="R"){fe.preventDefault(),O();return}if(!m||c)return;const Q=m*.05;let U=y;switch(fe.key){case"ArrowLeft":U=Math.max(0,y-Q);break;case"ArrowRight":U=Math.min(m,y+Q);break;case"Home":U=0;break;case"End":U=m;break;default:return}fe.preventDefault(),n&&(It.seekToTime(U),x(U))},[y,m,c,te,O,n]);if(!z&&!W&&!F&&!v&&!A)return null;if(v)return b.jsxs("div",{className:Te("flex items-center gap-3 py-2 text-destructive",s),role:"alert",children:[b.jsx("div",{className:"flex items-center justify-center w-10 h-10 rounded-full shrink-0 bg-destructive/10",children:b.jsx(vh,{className:"w-5 h-5","aria-hidden":"true"})}),b.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[b.jsx("span",{className:"text-sm",children:v}),F&&b.jsxs("button",{type:"button",onClick:()=>{S(null),re()},className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors","aria-label":"Retry loading audio",children:[b.jsx(zg,{className:"w-3 h-3","aria-hidden":"true"}),"Retry"]})]})]});const Z=c||k,be=f&&n&&It.getCurrentMessageId()===n;return b.jsxs("div",{className:Te("flex items-center gap-3 p-3 rounded-2xl bg-muted select-none",s),role:"group","aria-label":"Audio player",tabIndex:0,onKeyDown:ne,children:[b.jsx("button",{type:"button",onClick:te,disabled:Z,className:Te("flex items-center justify-center w-10 h-10 rounded-full shrink-0 transition-all active:scale-95",Z&&"opacity-70 cursor-wait","bg-primary text-primary-foreground"),"aria-label":Z?"Loading audio":be?"Pause audio":"Play audio","aria-busy":Z,children:Z?b.jsx(wc,{className:"w-5 h-5 animate-spin","aria-hidden":"true"}):be?b.jsx(WM,{className:"w-5 h-5",fill:"currentColor","aria-hidden":"true"}):b.jsx(KM,{className:"w-5 h-5 ml-0.5",fill:"currentColor","aria-hidden":"true"})}),b.jsxs("div",{className:"flex-1 flex flex-col gap-1.5 min-w-0",children:[b.jsxs("div",{ref:D,className:Te("relative h-1.5 rounded-full bg-secondary-foreground/20 touch-none overflow-hidden",A&&!Z&&"cursor-pointer",g&&"cursor-grabbing"),role:"slider",tabIndex:-1,"aria-valuenow":Math.round(Y),"aria-valuemin":0,"aria-valuemax":100,"aria-label":`Audio progress: ${G(ee)} of ${G(m)}`,onMouseDown:q,onTouchStart:q,children:[b.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full bg-primary",style:{width:`${Y}%`}}),g&&T!==null&&b.jsx("div",{className:"absolute -top-8 transform -translate-x-1/2 px-2 py-1 bg-popover border rounded shadow-lg text-xs font-medium tabular-nums pointer-events-none z-10",style:{left:`${Y}%`},children:G(T)})]}),b.jsxs("div",{className:"flex items-center justify-between text-[11px] text-muted-foreground",children:[b.jsx("span",{className:"tabular-nums",children:Z?"...":G(ee)}),b.jsx("span",{className:"tabular-nums",children:G(m)})]})]}),A&&y>0&&b.jsx("button",{type:"button",onClick:O,className:"p-2 text-muted-foreground hover:text-foreground transition-colors rounded-full hover:bg-muted-foreground/10 active:scale-95","aria-label":"Reset to start",children:b.jsx($M,{className:"w-4 h-4","aria-hidden":"true"})})]})}const wI="modulepreload",xI=function(e){return"/"+e},ZS={},J=function(r,n,s){let o=Promise.resolve();if(n&&n.length>0){let f=function(h){return Promise.all(h.map(m=>Promise.resolve(m).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));o=f(n.map(h=>{if(h=xI(h),h in ZS)return;ZS[h]=!0;const m=h.endsWith(".css"),p=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${p}`))return;const y=document.createElement("link");if(y.rel=m?"stylesheet":wI,m||(y.as="script"),y.crossOrigin="",y.href=h,c&&y.setAttribute("nonce",c),document.head.appendChild(y),m)return new Promise((x,A)=>{y.addEventListener("load",x),y.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${h}`)))})}))}function u(f){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=f,window.dispatchEvent(l),!l.defaultPrevented)throw f}return o.then(f=>{for(const l of f||[])l.status==="rejected"&&u(l.reason);return r().catch(u)})},DE=[{id:"abap",name:"ABAP",import:()=>J(()=>import("./abap-DsBKuouk.js"),[])},{id:"actionscript-3",name:"ActionScript",import:()=>J(()=>import("./actionscript-3-D_z4Izcz.js"),[])},{id:"ada",name:"Ada",import:()=>J(()=>import("./ada-727ZlQH0.js"),[])},{id:"angular-html",name:"Angular HTML",import:()=>J(()=>import("./angular-html-LfdN0zeE.js").then(e=>e.f),__vite__mapDeps([0,1,2,3]))},{id:"angular-ts",name:"Angular TypeScript",import:()=>J(()=>import("./angular-ts-CKsD7JZE.js"),__vite__mapDeps([4,0,1,2,3,5]))},{id:"apache",name:"Apache Conf",import:()=>J(()=>import("./apache-Dn00JSTd.js"),[])},{id:"apex",name:"Apex",import:()=>J(()=>import("./apex-COJ4H7py.js"),[])},{id:"apl",name:"APL",import:()=>J(()=>import("./apl-BBq3IX1j.js"),__vite__mapDeps([6,1,2,3,7,8,9]))},{id:"applescript",name:"AppleScript",import:()=>J(()=>import("./applescript-Bu5BbsvL.js"),[])},{id:"ara",name:"Ara",import:()=>J(()=>import("./ara-7O62HKoU.js"),[])},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:()=>J(()=>import("./asciidoc-BPT9niGB.js"),[])},{id:"asm",name:"Assembly",import:()=>J(()=>import("./asm-Dhn9LcZ4.js"),[])},{id:"astro",name:"Astro",import:()=>J(()=>import("./astro-CqkE3fuf.js"),__vite__mapDeps([10,9,2,11,3,12]))},{id:"awk",name:"AWK",import:()=>J(()=>import("./awk-eg146-Ew.js"),[])},{id:"ballerina",name:"Ballerina",import:()=>J(()=>import("./ballerina-Du268qiB.js"),[])},{id:"bat",name:"Batch File",aliases:["batch"],import:()=>J(()=>import("./bat-fje9CFhw.js"),[])},{id:"beancount",name:"Beancount",import:()=>J(()=>import("./beancount-BwXTMy5W.js"),[])},{id:"berry",name:"Berry",aliases:["be"],import:()=>J(()=>import("./berry-3xVqZejG.js"),[])},{id:"bibtex",name:"BibTeX",import:()=>J(()=>import("./bibtex-xW4inM5L.js"),[])},{id:"bicep",name:"Bicep",import:()=>J(()=>import("./bicep-DHo0CJ0O.js"),[])},{id:"blade",name:"Blade",import:()=>J(()=>import("./blade-a8OxSdnT.js"),__vite__mapDeps([13,1,2,3,7,8,14,9]))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:()=>J(()=>import("./bsl-Dgyn0ogV.js"),__vite__mapDeps([15,16]))},{id:"c",name:"C",import:()=>J(()=>import("./c-C3t2pwGQ.js"),[])},{id:"cadence",name:"Cadence",aliases:["cdc"],import:()=>J(()=>import("./cadence-DNquZEk8.js"),[])},{id:"cairo",name:"Cairo",import:()=>J(()=>import("./cairo--RitsXJZ.js"),__vite__mapDeps([17,18]))},{id:"clarity",name:"Clarity",import:()=>J(()=>import("./clarity-BHOwM8T6.js"),[])},{id:"clojure",name:"Clojure",aliases:["clj"],import:()=>J(()=>import("./clojure-DxSadP1t.js"),[])},{id:"cmake",name:"CMake",import:()=>J(()=>import("./cmake-DbXoA79R.js"),[])},{id:"cobol",name:"COBOL",import:()=>J(()=>import("./cobol-PTqiYgYu.js"),__vite__mapDeps([19,1,2,3,8]))},{id:"codeowners",name:"CODEOWNERS",import:()=>J(()=>import("./codeowners-Bp6g37R7.js"),[])},{id:"codeql",name:"CodeQL",aliases:["ql"],import:()=>J(()=>import("./codeql-sacFqUAJ.js"),[])},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:()=>J(()=>import("./coffee-dyiR41kL.js"),__vite__mapDeps([20,2]))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:()=>J(()=>import("./common-lisp-C7gG9l05.js"),[])},{id:"coq",name:"Coq",import:()=>J(()=>import("./coq-Dsg_Bt_b.js"),[])},{id:"cpp",name:"C++",aliases:["c++"],import:()=>J(()=>import("./cpp-BksuvNSY.js"),__vite__mapDeps([21,22,23,24,14]))},{id:"crystal",name:"Crystal",import:()=>J(()=>import("./crystal-DtDmRg-F.js"),__vite__mapDeps([25,1,2,3,14,24,26]))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:()=>J(()=>import("./csharp-D9R-vmeu.js"),[])},{id:"css",name:"CSS",import:()=>J(()=>import("./css-BPhBrDlE.js"),[])},{id:"csv",name:"CSV",import:()=>J(()=>import("./csv-B0qRVHPH.js"),[])},{id:"cue",name:"CUE",import:()=>J(()=>import("./cue-DtFQj3wx.js"),[])},{id:"cypher",name:"Cypher",aliases:["cql"],import:()=>J(()=>import("./cypher-m2LEI-9-.js"),[])},{id:"d",name:"D",import:()=>J(()=>import("./d-BoXegm-a.js"),[])},{id:"dart",name:"Dart",import:()=>J(()=>import("./dart-B9wLZaAG.js"),[])},{id:"dax",name:"DAX",import:()=>J(()=>import("./dax-ClGRhx96.js"),[])},{id:"desktop",name:"Desktop",import:()=>J(()=>import("./desktop-DEIpsLCJ.js"),[])},{id:"diff",name:"Diff",import:()=>J(()=>import("./diff-BgYniUM_.js"),[])},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:()=>J(()=>import("./docker-COcR7UxN.js"),[])},{id:"dotenv",name:"dotEnv",import:()=>J(()=>import("./dotenv-BjQB5zDj.js"),[])},{id:"dream-maker",name:"Dream Maker",import:()=>J(()=>import("./dream-maker-C-nORZOA.js"),[])},{id:"edge",name:"Edge",import:()=>J(()=>import("./edge-D5gP-w-T.js"),__vite__mapDeps([27,11,1,2,3,28]))},{id:"elixir",name:"Elixir",import:()=>J(()=>import("./elixir-CLiX3zqd.js"),__vite__mapDeps([29,1,2,3]))},{id:"elm",name:"Elm",import:()=>J(()=>import("./elm-CmHSxxaM.js"),__vite__mapDeps([30,23,24]))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:()=>J(()=>import("./emacs-lisp-BX77sIaO.js"),[])},{id:"erb",name:"ERB",import:()=>J(()=>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:()=>J(()=>import("./erlang-B-DoSBHF.js"),[])},{id:"fennel",name:"Fennel",import:()=>J(()=>import("./fennel-bCA53EVm.js"),[])},{id:"fish",name:"Fish",import:()=>J(()=>import("./fish-w-ucz2PV.js"),[])},{id:"fluent",name:"Fluent",aliases:["ftl"],import:()=>J(()=>import("./fluent-Dayu4EKP.js"),[])},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:()=>J(()=>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:()=>J(()=>import("./fortran-free-form-DKXYxT9g.js"),[])},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:()=>J(()=>import("./fsharp-XplgxFYe.js"),__vite__mapDeps([41,42]))},{id:"gdresource",name:"GDResource",import:()=>J(()=>import("./gdresource-BHYsBjWJ.js"),__vite__mapDeps([43,44,45]))},{id:"gdscript",name:"GDScript",import:()=>J(()=>import("./gdscript-DfxzS6Rs.js"),[])},{id:"gdshader",name:"GDShader",import:()=>J(()=>import("./gdshader-SKMF96pI.js"),[])},{id:"genie",name:"Genie",import:()=>J(()=>import("./genie-ajMbGru0.js"),[])},{id:"gherkin",name:"Gherkin",import:()=>J(()=>import("./gherkin--30QC5Em.js"),[])},{id:"git-commit",name:"Git Commit Message",import:()=>J(()=>import("./git-commit-i4q6IMui.js"),__vite__mapDeps([46,47]))},{id:"git-rebase",name:"Git Rebase Message",import:()=>J(()=>import("./git-rebase-B-v9cOL2.js"),__vite__mapDeps([48,26]))},{id:"gleam",name:"Gleam",import:()=>J(()=>import("./gleam-B430Bg39.js"),[])},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:()=>J(()=>import("./glimmer-js-D-cwc0-E.js"),__vite__mapDeps([49,2,11,3,1]))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:()=>J(()=>import("./glimmer-ts-pgjy16dm.js"),__vite__mapDeps([50,11,3,2,1]))},{id:"glsl",name:"GLSL",import:()=>J(()=>import("./glsl-DBO2IWDn.js"),__vite__mapDeps([23,24]))},{id:"gnuplot",name:"Gnuplot",import:()=>J(()=>import("./gnuplot-CM8KxXT1.js"),[])},{id:"go",name:"Go",import:()=>J(()=>import("./go-B1SYOhNW.js"),[])},{id:"graphql",name:"GraphQL",aliases:["gql"],import:()=>J(()=>import("./graphql-cDcHW_If.js"),__vite__mapDeps([34,2,11,35,36]))},{id:"groovy",name:"Groovy",import:()=>J(()=>import("./groovy-DkBy-JyN.js"),[])},{id:"hack",name:"Hack",import:()=>J(()=>import("./hack-D1yCygmZ.js"),__vite__mapDeps([51,1,2,3,14]))},{id:"haml",name:"Ruby Haml",import:()=>J(()=>import("./haml-B2EZWmdv.js"),__vite__mapDeps([33,2,3]))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:()=>J(()=>import("./handlebars-BQGss363.js"),__vite__mapDeps([52,1,2,3,38]))},{id:"haskell",name:"Haskell",aliases:["hs"],import:()=>J(()=>import("./haskell-BILxekzW.js"),[])},{id:"haxe",name:"Haxe",import:()=>J(()=>import("./haxe-C5wWYbrZ.js"),[])},{id:"hcl",name:"HashiCorp HCL",import:()=>J(()=>import("./hcl-HzYwdGDm.js"),[])},{id:"hjson",name:"Hjson",import:()=>J(()=>import("./hjson-T-Tgc4AT.js"),[])},{id:"hlsl",name:"HLSL",import:()=>J(()=>import("./hlsl-ifBTmRxC.js"),[])},{id:"html",name:"HTML",import:()=>J(()=>import("./html-C2L_23MC.js"),__vite__mapDeps([1,2,3]))},{id:"html-derivative",name:"HTML (Derivative)",import:()=>J(()=>import("./html-derivative-CSfWNPLT.js"),__vite__mapDeps([28,1,2,3]))},{id:"http",name:"HTTP",import:()=>J(()=>import("./http-FRrOvY1W.js"),__vite__mapDeps([53,26,9,7,8,34,2,11,35,36]))},{id:"hxml",name:"HXML",import:()=>J(()=>import("./hxml-TIA70rKU.js"),__vite__mapDeps([54,55]))},{id:"hy",name:"Hy",import:()=>J(()=>import("./hy-BMj5Y0dO.js"),[])},{id:"imba",name:"Imba",import:()=>J(()=>import("./imba-bv_oIlVt.js"),__vite__mapDeps([56,11]))},{id:"ini",name:"INI",aliases:["properties"],import:()=>J(()=>import("./ini-BjABl1g7.js"),[])},{id:"java",name:"Java",import:()=>J(()=>import("./java-xI-RfyKK.js"),[])},{id:"javascript",name:"JavaScript",aliases:["js"],import:()=>J(()=>import("./javascript-ySlJ1b_l.js"),[])},{id:"jinja",name:"Jinja",import:()=>J(()=>import("./jinja-DGy0s7-h.js"),__vite__mapDeps([57,1,2,3]))},{id:"jison",name:"Jison",import:()=>J(()=>import("./jison-BqZprYcd.js"),__vite__mapDeps([58,2]))},{id:"json",name:"JSON",import:()=>J(()=>import("./json-BQoSv7ci.js"),[])},{id:"json5",name:"JSON5",import:()=>J(()=>import("./json5-w8dY5SsB.js"),[])},{id:"jsonc",name:"JSON with Comments",import:()=>J(()=>import("./jsonc-TU54ms6u.js"),[])},{id:"jsonl",name:"JSON Lines",import:()=>J(()=>import("./jsonl-DREVFZK8.js"),[])},{id:"jsonnet",name:"Jsonnet",import:()=>J(()=>import("./jsonnet-BfivnA6A.js"),[])},{id:"jssm",name:"JSSM",aliases:["fsl"],import:()=>J(()=>import("./jssm-P4WzXJd0.js"),[])},{id:"jsx",name:"JSX",import:()=>J(()=>import("./jsx-BAng5TT0.js"),[])},{id:"julia",name:"Julia",aliases:["jl"],import:()=>J(()=>import("./julia-BBuGR-5E.js"),__vite__mapDeps([59,21,22,23,24,14,18,2,60]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:()=>J(()=>import("./kotlin-B5lbUyaz.js"),[])},{id:"kusto",name:"Kusto",aliases:["kql"],import:()=>J(()=>import("./kusto-mebxcVVE.js"),[])},{id:"latex",name:"LaTeX",import:()=>J(()=>import("./latex-C-cWTeAZ.js"),__vite__mapDeps([61,62,60]))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:()=>J(()=>import("./lean-XBlWyCtg.js"),[])},{id:"less",name:"Less",import:()=>J(()=>import("./less-BfCpw3nA.js"),[])},{id:"liquid",name:"Liquid",import:()=>J(()=>import("./liquid-D3W5UaiH.js"),__vite__mapDeps([63,1,2,3,9]))},{id:"log",name:"Log file",import:()=>J(()=>import("./log-Cc5clBb7.js"),[])},{id:"logo",name:"Logo",import:()=>J(()=>import("./logo-IuBKFhSY.js"),[])},{id:"lua",name:"Lua",import:()=>J(()=>import("./lua-CvWAzNxB.js"),__vite__mapDeps([37,24]))},{id:"luau",name:"Luau",import:()=>J(()=>import("./luau-Du5NY7AG.js"),[])},{id:"make",name:"Makefile",aliases:["makefile"],import:()=>J(()=>import("./make-Bvotw-X0.js"),[])},{id:"markdown",name:"Markdown",aliases:["md"],import:()=>J(()=>import("./markdown-UIAJJxZW.js"),[])},{id:"marko",name:"Marko",import:()=>J(()=>import("./marko-z0MBrx5-.js"),__vite__mapDeps([64,3,65,5,2]))},{id:"matlab",name:"MATLAB",import:()=>J(()=>import("./matlab-D9-PGadD.js"),[])},{id:"mdc",name:"MDC",import:()=>J(()=>import("./mdc-DB_EDNY_.js"),__vite__mapDeps([66,42,38,28,1,2,3]))},{id:"mdx",name:"MDX",import:()=>J(()=>import("./mdx-sdHcTMYB.js"),[])},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:()=>J(()=>import("./mermaid-Ci6OQyBP.js"),[])},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:()=>J(()=>import("./mipsasm-BC5c_5Pe.js"),[])},{id:"mojo",name:"Mojo",import:()=>J(()=>import("./mojo-Tz6hzZYG.js"),[])},{id:"move",name:"Move",import:()=>J(()=>import("./move-DB_GagMm.js"),[])},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:()=>J(()=>import("./narrat-DLbgOhZU.js"),[])},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:()=>J(()=>import("./nextflow-B0XVJmRM.js"),[])},{id:"nginx",name:"Nginx",import:()=>J(()=>import("./nginx-D_VnBJ67.js"),__vite__mapDeps([67,37,24]))},{id:"nim",name:"Nim",import:()=>J(()=>import("./nim-ZlGxZxc3.js"),__vite__mapDeps([68,24,1,2,3,7,8,23,42]))},{id:"nix",name:"Nix",import:()=>J(()=>import("./nix-shcSOmrb.js"),[])},{id:"nushell",name:"nushell",aliases:["nu"],import:()=>J(()=>import("./nushell-D4Tzg5kh.js"),[])},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:()=>J(()=>import("./objective-c-Deuh7S70.js"),[])},{id:"objective-cpp",name:"Objective-C++",import:()=>J(()=>import("./objective-cpp-BUEGK8hf.js"),[])},{id:"ocaml",name:"OCaml",import:()=>J(()=>import("./ocaml-BNioltXt.js"),[])},{id:"pascal",name:"Pascal",import:()=>J(()=>import("./pascal-JqZropPD.js"),[])},{id:"perl",name:"Perl",import:()=>J(()=>import("./perl-CHQXSrWU.js"),__vite__mapDeps([69,1,2,3,7,8,14]))},{id:"php",name:"PHP",import:()=>J(()=>import("./php-B5ebYQev.js"),__vite__mapDeps([70,1,2,3,7,8,14,9]))},{id:"plsql",name:"PL/SQL",import:()=>J(()=>import("./plsql-LKU2TuZ1.js"),[])},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:()=>J(()=>import("./po-BFLt1xDp.js"),[])},{id:"polar",name:"Polar",import:()=>J(()=>import("./polar-DKykz6zU.js"),[])},{id:"postcss",name:"PostCSS",import:()=>J(()=>import("./postcss-B3ZDOciz.js"),[])},{id:"powerquery",name:"PowerQuery",import:()=>J(()=>import("./powerquery-CSHBycmS.js"),[])},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:()=>J(()=>import("./powershell-BIEUsx6d.js"),[])},{id:"prisma",name:"Prisma",import:()=>J(()=>import("./prisma-B48N-Iqd.js"),[])},{id:"prolog",name:"Prolog",import:()=>J(()=>import("./prolog-BY-TUvya.js"),[])},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:()=>J(()=>import("./proto-zocC4JxJ.js"),[])},{id:"pug",name:"Pug",aliases:["jade"],import:()=>J(()=>import("./pug-CM9l7STV.js"),__vite__mapDeps([71,2,3,1]))},{id:"puppet",name:"Puppet",import:()=>J(()=>import("./puppet-Cza_XSSt.js"),[])},{id:"purescript",name:"PureScript",import:()=>J(()=>import("./purescript-Bg-kzb6g.js"),[])},{id:"python",name:"Python",aliases:["py"],import:()=>J(()=>import("./python-DhUJRlN_.js"),[])},{id:"qml",name:"QML",import:()=>J(()=>import("./qml-D8XfuvdV.js"),__vite__mapDeps([72,2]))},{id:"qmldir",name:"QML Directory",import:()=>J(()=>import("./qmldir-C8lEn-DE.js"),[])},{id:"qss",name:"Qt Style Sheets",import:()=>J(()=>import("./qss-DhMKtDLN.js"),[])},{id:"r",name:"R",import:()=>J(()=>import("./r-CwjWoCRV.js"),[])},{id:"racket",name:"Racket",import:()=>J(()=>import("./racket-CzouJOBO.js"),[])},{id:"raku",name:"Raku",aliases:["perl6"],import:()=>J(()=>import("./raku-B1bQXN8T.js"),[])},{id:"razor",name:"ASP.NET Razor",import:()=>J(()=>import("./razor-CNLDkMZG.js"),__vite__mapDeps([73,1,2,3,74]))},{id:"reg",name:"Windows Registry Script",import:()=>J(()=>import("./reg-5LuOXUq_.js"),[])},{id:"regexp",name:"RegExp",aliases:["regex"],import:()=>J(()=>import("./regexp-DWJ3fJO_.js"),[])},{id:"rel",name:"Rel",import:()=>J(()=>import("./rel-DJlmqQ1C.js"),[])},{id:"riscv",name:"RISC-V",import:()=>J(()=>import("./riscv-QhoSD0DR.js"),[])},{id:"rst",name:"reStructuredText",import:()=>J(()=>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:()=>J(()=>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:()=>J(()=>import("./rust-Be6lgOlo.js"),[])},{id:"sas",name:"SAS",import:()=>J(()=>import("./sas-BmTFh92c.js"),__vite__mapDeps([77,14]))},{id:"sass",name:"Sass",import:()=>J(()=>import("./sass-BJ4Li9vH.js"),[])},{id:"scala",name:"Scala",import:()=>J(()=>import("./scala-DQVVAn-B.js"),[])},{id:"scheme",name:"Scheme",import:()=>J(()=>import("./scheme-BJGe-b2p.js"),[])},{id:"scss",name:"SCSS",import:()=>J(()=>import("./scss-C31hgJw-.js"),__vite__mapDeps([5,3]))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:()=>J(()=>import("./sdbl-BLhTXw86.js"),[])},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:()=>J(()=>import("./shaderlab-B7qAK45m.js"),__vite__mapDeps([78,79]))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:()=>J(()=>import("./shellscript-atvbtKCR.js"),[])},{id:"shellsession",name:"Shell Session",aliases:["console"],import:()=>J(()=>import("./shellsession-C_rIy8kc.js"),__vite__mapDeps([80,26]))},{id:"smalltalk",name:"Smalltalk",import:()=>J(()=>import("./smalltalk-DkLiglaE.js"),[])},{id:"solidity",name:"Solidity",import:()=>J(()=>import("./solidity-C1w2a3ep.js"),[])},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:()=>J(()=>import("./soy-C-lX7w71.js"),__vite__mapDeps([81,1,2,3]))},{id:"sparql",name:"SPARQL",import:()=>J(()=>import("./sparql-bYkjHRlG.js"),__vite__mapDeps([82,83]))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:()=>J(()=>import("./splunk-Cf8iN4DR.js"),[])},{id:"sql",name:"SQL",import:()=>J(()=>import("./sql-COK4E0Yg.js"),[])},{id:"ssh-config",name:"SSH Config",import:()=>J(()=>import("./ssh-config-BknIz3MU.js"),[])},{id:"stata",name:"Stata",import:()=>J(()=>import("./stata-DorPZHa4.js"),__vite__mapDeps([84,14]))},{id:"stylus",name:"Stylus",aliases:["styl"],import:()=>J(()=>import("./stylus-BeQkCIfX.js"),[])},{id:"svelte",name:"Svelte",import:()=>J(()=>import("./svelte-MSaWC3Je.js"),__vite__mapDeps([85,2,11,3,12]))},{id:"swift",name:"Swift",import:()=>J(()=>import("./swift-BSxZ-RaX.js"),[])},{id:"system-verilog",name:"SystemVerilog",import:()=>J(()=>import("./system-verilog-C7L56vO4.js"),[])},{id:"systemd",name:"Systemd Units",import:()=>J(()=>import("./systemd-CUnW07Te.js"),[])},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:()=>J(()=>import("./talonscript-C1XDQQGZ.js"),[])},{id:"tasl",name:"Tasl",import:()=>J(()=>import("./tasl-CQjiPCtT.js"),[])},{id:"tcl",name:"Tcl",import:()=>J(()=>import("./tcl-DQ1-QYvQ.js"),[])},{id:"templ",name:"Templ",import:()=>J(()=>import("./templ-dwX3ZSMB.js"),__vite__mapDeps([86,87,2,3]))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:()=>J(()=>import("./terraform-BbSNqyBO.js"),[])},{id:"tex",name:"TeX",import:()=>J(()=>import("./tex-rYs2v40G.js"),__vite__mapDeps([62,60]))},{id:"toml",name:"TOML",import:()=>J(()=>import("./toml-CB2ApiWb.js"),[])},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:()=>J(()=>import("./ts-tags-CipyTH0X.js"),__vite__mapDeps([88,11,3,2,23,24,1,14,7,8]))},{id:"tsv",name:"TSV",import:()=>J(()=>import("./tsv-B_m7g4N7.js"),[])},{id:"tsx",name:"TSX",import:()=>J(()=>import("./tsx-B6W0miNI.js"),[])},{id:"turtle",name:"Turtle",import:()=>J(()=>import("./turtle-BMR_PYu6.js"),[])},{id:"twig",name:"Twig",import:()=>J(()=>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:()=>J(()=>import("./typescript-Dj6nwHGl.js"),[])},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:()=>J(()=>import("./typespec-BpWG_bgh.js"),[])},{id:"typst",name:"Typst",aliases:["typ"],import:()=>J(()=>import("./typst-BVUVsWT6.js"),[])},{id:"v",name:"V",import:()=>J(()=>import("./v-CAQ2eGtk.js"),[])},{id:"vala",name:"Vala",import:()=>J(()=>import("./vala-BFOHcciG.js"),[])},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:()=>J(()=>import("./vb-CdO5JTpU.js"),[])},{id:"verilog",name:"Verilog",import:()=>J(()=>import("./verilog-CJaU5se_.js"),[])},{id:"vhdl",name:"VHDL",import:()=>J(()=>import("./vhdl-DYoNaHQp.js"),[])},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:()=>J(()=>import("./viml-m4uW47V2.js"),[])},{id:"vue",name:"Vue",import:()=>J(()=>import("./vue-BuYVFjOK.js"),__vite__mapDeps([90,1,2,3,11,9,28]))},{id:"vue-html",name:"Vue HTML",import:()=>J(()=>import("./vue-html-xdeiXROB.js"),__vite__mapDeps([91,90,1,2,3,11,9,28]))},{id:"vyper",name:"Vyper",aliases:["vy"],import:()=>J(()=>import("./vyper-nyqBNV6O.js"),[])},{id:"wasm",name:"WebAssembly",import:()=>J(()=>import("./wasm-C6j12Q_x.js"),[])},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:()=>J(()=>import("./wenyan-7A4Fjokl.js"),[])},{id:"wgsl",name:"WGSL",import:()=>J(()=>import("./wgsl-CB0Krxn9.js"),[])},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:()=>J(()=>import("./wikitext-DCE3LsBG.js"),[])},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:()=>J(()=>import("./wolfram-C3FkfJm5.js"),[])},{id:"xml",name:"XML",import:()=>J(()=>import("./xml-e3z08dGr.js"),__vite__mapDeps([7,8]))},{id:"xsl",name:"XSL",import:()=>J(()=>import("./xsl-Dd0NUgwM.js"),__vite__mapDeps([92,7,8]))},{id:"yaml",name:"YAML",aliases:["yml"],import:()=>J(()=>import("./yaml-CVw76BM1.js"),[])},{id:"zenscript",name:"ZenScript",import:()=>J(()=>import("./zenscript-HnGAYVZD.js"),[])},{id:"zig",name:"Zig",import:()=>J(()=>import("./zig-BVz_zdnA.js"),[])}],EI=Object.fromEntries(DE.map(e=>[e.id,e.import])),AI=Object.fromEntries(DE.flatMap(e=>{var r;return((r=e.aliases)==null?void 0:r.map(n=>[n,e.import]))||[]})),TI={...EI,...AI},RI=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:()=>J(()=>import("./andromeeda-C3khCPGq.js"),[])},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:()=>J(()=>import("./aurora-x-D-2ljcwZ.js"),[])},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:()=>J(()=>import("./ayu-dark-Cv9koXgw.js"),[])},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:()=>J(()=>import("./catppuccin-frappe-CD_QflpE.js"),[])},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:()=>J(()=>import("./catppuccin-latte-DRW-0cLl.js"),[])},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:()=>J(()=>import("./catppuccin-macchiato-C-_shW-Y.js"),[])},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:()=>J(()=>import("./catppuccin-mocha-LGGdnPYs.js"),[])},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:()=>J(()=>import("./dark-plus-C3mMm8J8.js"),[])},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:()=>J(()=>import("./dracula-BzJJZx-M.js"),[])},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:()=>J(()=>import("./dracula-soft-BXkSAIEj.js"),[])},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:()=>J(()=>import("./everforest-dark-BgDCqdQA.js"),[])},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:()=>J(()=>import("./everforest-light-C8M2exoo.js"),[])},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:()=>J(()=>import("./github-dark-DHJKELXO.js"),[])},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:()=>J(()=>import("./github-dark-default-Cuk6v7N8.js"),[])},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:()=>J(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[])},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:()=>J(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[])},{id:"github-light",displayName:"GitHub Light",type:"light",import:()=>J(()=>import("./github-light-DAi9KRSo.js"),[])},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:()=>J(()=>import("./github-light-default-D7oLnXFd.js"),[])},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:()=>J(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[])},{id:"houston",displayName:"Houston",type:"dark",import:()=>J(()=>import("./houston-DnULxvSX.js"),[])},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:()=>J(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[])},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:()=>J(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[])},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:()=>J(()=>import("./kanagawa-wave-DWedfzmr.js"),[])},{id:"laserwave",displayName:"LaserWave",type:"dark",import:()=>J(()=>import("./laserwave-DUszq2jm.js"),[])},{id:"light-plus",displayName:"Light Plus",type:"light",import:()=>J(()=>import("./light-plus-B7mTdjB0.js"),[])},{id:"material-theme",displayName:"Material Theme",type:"dark",import:()=>J(()=>import("./material-theme-D5KoaKCx.js"),[])},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:()=>J(()=>import("./material-theme-darker-BfHTSMKl.js"),[])},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:()=>J(()=>import("./material-theme-lighter-B0m2ddpp.js"),[])},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:()=>J(()=>import("./material-theme-ocean-CyktbL80.js"),[])},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:()=>J(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[])},{id:"min-dark",displayName:"Min Dark",type:"dark",import:()=>J(()=>import("./min-dark-CafNBF8u.js"),[])},{id:"min-light",displayName:"Min Light",type:"light",import:()=>J(()=>import("./min-light-CTRr51gU.js"),[])},{id:"monokai",displayName:"Monokai",type:"dark",import:()=>J(()=>import("./monokai-D4h5O-jR.js"),[])},{id:"night-owl",displayName:"Night Owl",type:"dark",import:()=>J(()=>import("./night-owl-C39BiMTA.js"),[])},{id:"nord",displayName:"Nord",type:"dark",import:()=>J(()=>import("./nord-Ddv68eIx.js"),[])},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:()=>J(()=>import("./one-dark-pro-GBQ2dnAY.js"),[])},{id:"one-light",displayName:"One Light",type:"light",import:()=>J(()=>import("./one-light-PoHY5YXO.js"),[])},{id:"plastic",displayName:"Plastic",type:"dark",import:()=>J(()=>import("./plastic-3e1v2bzS.js"),[])},{id:"poimandres",displayName:"Poimandres",type:"dark",import:()=>J(()=>import("./poimandres-CS3Unz2-.js"),[])},{id:"red",displayName:"Red",type:"dark",import:()=>J(()=>import("./red-bN70gL4F.js"),[])},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:()=>J(()=>import("./rose-pine-CmCqftbK.js"),[])},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:()=>J(()=>import("./rose-pine-dawn-Ds-gbosJ.js"),[])},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:()=>J(()=>import("./rose-pine-moon-CjDtw9vr.js"),[])},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:()=>J(()=>import("./slack-dark-BthQWCQV.js"),[])},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:()=>J(()=>import("./slack-ochin-DqwNpetd.js"),[])},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:()=>J(()=>import("./snazzy-light-Bw305WKR.js"),[])},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:()=>J(()=>import("./solarized-dark-DXbdFlpD.js"),[])},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:()=>J(()=>import("./solarized-light-L9t79GZl.js"),[])},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:()=>J(()=>import("./synthwave-84-CbfX1IO0.js"),[])},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:()=>J(()=>import("./tokyo-night-DBQeEorK.js"),[])},{id:"vesper",displayName:"Vesper",type:"dark",import:()=>J(()=>import("./vesper-BEBZ7ncR.js"),[])},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:()=>J(()=>import("./vitesse-black-Bkuqu6BP.js"),[])},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:()=>J(()=>import("./vitesse-dark-D0r3Knsf.js"),[])},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:()=>J(()=>import("./vitesse-light-CVO1_9PV.js"),[])}],DI=Object.fromEntries(RI.map(e=>[e.id,e.import]));let Ci=class extends Error{constructor(r){super(r),this.name="ShikiError"}},Ev=class extends Error{constructor(r){super(r),this.name="ShikiError"}};function MI(){return 2147483648}function kI(){return typeof performance<"u"?performance.now():Date.now()}const LI=(e,r)=>e+(r-e%r)%r;async function OI(e){let r,n;const s={};function o(x){n=x,s.HEAPU8=new Uint8Array(x),s.HEAPU32=new Uint32Array(x)}function u(x,A,w){s.HEAPU8.copyWithin(x,A,A+w)}function f(x){try{return r.grow(x-n.byteLength+65535>>>16),o(r.buffer),1}catch{}}function l(x){const A=s.HEAPU8.length;x=x>>>0;const w=MI();if(x>w)return!1;for(let v=1;v<=4;v*=2){let S=A*(1+.2/v);S=Math.min(S,x+100663296);const g=Math.min(w,LI(Math.max(x,S),65536));if(f(g))return!0}return!1}const c=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function h(x,A,w=1024){const v=A+w;let S=A;for(;x[S]&&!(S>=v);)++S;if(S-A>16&&x.buffer&&c)return c.decode(x.subarray(A,S));let g="";for(;A<S;){let _=x[A++];if(!(_&128)){g+=String.fromCharCode(_);continue}const T=x[A++]&63;if((_&224)===192){g+=String.fromCharCode((_&31)<<6|T);continue}const M=x[A++]&63;if((_&240)===224?_=(_&15)<<12|T<<6|M:_=(_&7)<<18|T<<12|M<<6|x[A++]&63,_<65536)g+=String.fromCharCode(_);else{const k=_-65536;g+=String.fromCharCode(55296|k>>10,56320|k&1023)}}return g}function m(x,A){return x?h(s.HEAPU8,x,A):""}const p={emscripten_get_now:kI,emscripten_memcpy_big:u,emscripten_resize_heap:l,fd_write:()=>0};async function y(){const A=await e({env:p,wasi_snapshot_preview1:p});r=A.memory,o(r.buffer),Object.assign(s,A),s.UTF8ToString=m}return await y(),s}var BI=Object.defineProperty,NI=(e,r,n)=>r in e?BI(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,Jt=(e,r,n)=>(NI(e,typeof r!="symbol"?r+"":r,n),n);let nr=null;function II(e){throw new Ev(e.UTF8ToString(e.getLastOnigError()))}class Bh{constructor(r){Jt(this,"utf16Length"),Jt(this,"utf8Length"),Jt(this,"utf16Value"),Jt(this,"utf8Value"),Jt(this,"utf16OffsetToUtf8"),Jt(this,"utf8OffsetToUtf16");const n=r.length,s=Bh._utf8ByteLength(r),o=s!==n,u=o?new Uint32Array(n+1):null;o&&(u[n]=s);const f=o?new Uint32Array(s+1):null;o&&(f[s]=n);const l=new Uint8Array(s);let c=0;for(let h=0;h<n;h++){const m=r.charCodeAt(h);let p=m,y=!1;if(m>=55296&&m<=56319&&h+1<n){const x=r.charCodeAt(h+1);x>=56320&&x<=57343&&(p=(m-55296<<10)+65536|x-56320,y=!0)}o&&(u[h]=c,y&&(u[h+1]=c),p<=127?f[c+0]=h:p<=2047?(f[c+0]=h,f[c+1]=h):p<=65535?(f[c+0]=h,f[c+1]=h,f[c+2]=h):(f[c+0]=h,f[c+1]=h,f[c+2]=h,f[c+3]=h)),p<=127?l[c++]=p:p<=2047?(l[c++]=192|(p&1984)>>>6,l[c++]=128|(p&63)>>>0):p<=65535?(l[c++]=224|(p&61440)>>>12,l[c++]=128|(p&4032)>>>6,l[c++]=128|(p&63)>>>0):(l[c++]=240|(p&1835008)>>>18,l[c++]=128|(p&258048)>>>12,l[c++]=128|(p&4032)>>>6,l[c++]=128|(p&63)>>>0),y&&h++}this.utf16Length=n,this.utf8Length=s,this.utf16Value=r,this.utf8Value=l,this.utf16OffsetToUtf8=u,this.utf8OffsetToUtf16=f}static _utf8ByteLength(r){let n=0;for(let s=0,o=r.length;s<o;s++){const u=r.charCodeAt(s);let f=u,l=!1;if(u>=55296&&u<=56319&&s+1<o){const c=r.charCodeAt(s+1);c>=56320&&c<=57343&&(f=(u-55296<<10)+65536|c-56320,l=!0)}f<=127?n+=1:f<=2047?n+=2:f<=65535?n+=3:n+=4,l&&s++}return n}createString(r){const n=r.omalloc(this.utf8Length);return r.HEAPU8.set(this.utf8Value,n),n}}const On=class{constructor(e){if(Jt(this,"id",++On.LAST_ID),Jt(this,"_onigBinding"),Jt(this,"content"),Jt(this,"utf16Length"),Jt(this,"utf8Length"),Jt(this,"utf16OffsetToUtf8"),Jt(this,"utf8OffsetToUtf16"),Jt(this,"ptr"),!nr)throw new Ev("Must invoke loadWasm first.");this._onigBinding=nr,this.content=e;const r=new Bh(e);this.utf16Length=r.utf16Length,this.utf8Length=r.utf8Length,this.utf16OffsetToUtf8=r.utf16OffsetToUtf8,this.utf8OffsetToUtf16=r.utf8OffsetToUtf16,this.utf8Length<1e4&&!On._sharedPtrInUse?(On._sharedPtr||(On._sharedPtr=nr.omalloc(1e4)),On._sharedPtrInUse=!0,nr.HEAPU8.set(r.utf8Value,On._sharedPtr),this.ptr=On._sharedPtr):this.ptr=r.createString(nr)}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===On._sharedPtr?On._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};let Oc=On;Jt(Oc,"LAST_ID",0);Jt(Oc,"_sharedPtr",0);Jt(Oc,"_sharedPtrInUse",!1);class PI{constructor(r){if(Jt(this,"_onigBinding"),Jt(this,"_ptr"),!nr)throw new Ev("Must invoke loadWasm first.");const n=[],s=[];for(let l=0,c=r.length;l<c;l++){const h=new Bh(r[l]);n[l]=h.createString(nr),s[l]=h.utf8Length}const o=nr.omalloc(4*r.length);nr.HEAPU32.set(n,o/4);const u=nr.omalloc(4*r.length);nr.HEAPU32.set(s,u/4);const f=nr.createOnigScanner(o,u,r.length);for(let l=0,c=r.length;l<c;l++)nr.ofree(n[l]);nr.ofree(u),nr.ofree(o),f===0&&II(nr),this._onigBinding=nr,this._ptr=f}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(r,n,s){let o=0;if(typeof s=="number"&&(o=s),typeof r=="string"){r=new Oc(r);const u=this._findNextMatchSync(r,n,!1,o);return r.dispose(),u}return this._findNextMatchSync(r,n,!1,o)}_findNextMatchSync(r,n,s,o){const u=this._onigBinding,f=u.findNextOnigScannerMatch(this._ptr,r.id,r.ptr,r.utf8Length,r.convertUtf16OffsetToUtf8(n),o);if(f===0)return null;const l=u.HEAPU32;let c=f/4;const h=l[c++],m=l[c++],p=[];for(let y=0;y<m;y++){const x=r.convertUtf8OffsetToUtf16(l[c++]),A=r.convertUtf8OffsetToUtf16(l[c++]);p[y]={start:x,end:A,length:A-x}}return{index:h,captureIndices:p}}}function jI(e){return typeof e.instantiator=="function"}function UI(e){return typeof e.default=="function"}function FI(e){return typeof e.data<"u"}function HI(e){return typeof Response<"u"&&e instanceof Response}function VI(e){var r;return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&((r=Buffer.isBuffer)==null?void 0:r.call(Buffer,e))||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let Cd;function qI(e){if(Cd)return Cd;async function r(){nr=await OI(async n=>{let s=e;return s=await s,typeof s=="function"&&(s=await s(n)),typeof s=="function"&&(s=await s(n)),jI(s)?s=await s.instantiator(n):UI(s)?s=await s.default(n):(FI(s)&&(s=s.data),HI(s)?typeof WebAssembly.instantiateStreaming=="function"?s=await GI(s)(n):s=await zI(s)(n):VI(s)?s=await Dm(s)(n):s instanceof WebAssembly.Module?s=await Dm(s)(n):"default"in s&&s.default instanceof WebAssembly.Module&&(s=await Dm(s.default)(n))),"instance"in s&&(s=s.instance),"exports"in s&&(s=s.exports),s})}return Cd=r(),Cd}function Dm(e){return r=>WebAssembly.instantiate(e,r)}function GI(e){return r=>WebAssembly.instantiateStreaming(e,r)}function zI(e){return async r=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,r)}}let YI;function WI(){return YI}async function ME(e){return e&&await qI(e),{createScanner(r){return new PI(r.map(n=>typeof n=="string"?n:n.source))},createString(r){return new Oc(r)}}}function KI(e){return Av(e)}function Av(e){return Array.isArray(e)?QI(e):e instanceof RegExp?e:typeof e=="object"?$I(e):e}function QI(e){let r=[];for(let n=0,s=e.length;n<s;n++)r[n]=Av(e[n]);return r}function $I(e){let r={};for(let n in e)r[n]=Av(e[n]);return r}function kE(e,...r){return r.forEach(n=>{for(let s in n)e[s]=n[s]}),e}function LE(e){const r=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return r===0?e:~r===e.length-1?LE(e.substring(0,e.length-1)):e.substr(~r+1)}var Mm=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,wd=class{static hasCaptures(e){return e===null?!1:(Mm.lastIndex=0,Mm.test(e))}static replaceCaptures(e,r,n){return e.replace(Mm,(s,o,u,f)=>{let l=n[parseInt(o||u,10)];if(l){let c=r.substring(l.start,l.end);for(;c[0]===".";)c=c.substring(1);switch(f){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return s})}};function OE(e,r){return e<r?-1:e>r?1:0}function BE(e,r){if(e===null&&r===null)return 0;if(!e)return-1;if(!r)return 1;let n=e.length,s=r.length;if(n===s){for(let o=0;o<n;o++){let u=OE(e[o],r[o]);if(u!==0)return u}return 0}return n-s}function XS(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 NE(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var IE=class{constructor(e){_e(this,"cache",new Map);this.fn=e}get(e){if(this.cache.has(e))return this.cache.get(e);const r=this.fn(e);return this.cache.set(e,r),r}},th=class{constructor(e,r,n){_e(this,"_cachedMatchRoot",new IE(e=>this._root.match(e)));this._colorMap=e,this._defaults=r,this._root=n}static createFromRawTheme(e,r){return this.createFromParsedTheme(XI(e),r)}static createFromParsedTheme(e,r){return t5(e,r)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const r=e.scopeName,s=this._cachedMatchRoot.get(r).find(o=>JI(e.parent,o.parentScopes));return s?new PE(s.fontStyle,s.foreground,s.background):null}},km=class Fd{constructor(r,n){this.parent=r,this.scopeName=n}static push(r,n){for(const s of n)r=new Fd(r,s);return r}static from(...r){let n=null;for(let s=0;s<r.length;s++)n=new Fd(n,r[s]);return n}push(r){return new Fd(this,r)}getSegments(){let r=this;const n=[];for(;r;)n.push(r.scopeName),r=r.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(r){return this===r?!0:this.parent===null?!1:this.parent.extends(r)}getExtensionIfDefined(r){const n=[];let s=this;for(;s&&s!==r;)n.push(s.scopeName),s=s.parent;return s===r?n.reverse():void 0}};function JI(e,r){if(r.length===0)return!0;for(let n=0;n<r.length;n++){let s=r[n],o=!1;if(s===">"){if(n===r.length-1)return!1;s=r[++n],o=!0}for(;e&&!ZI(e.scopeName,s);){if(o)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function ZI(e,r){return r===e||e.startsWith(r)&&e[r.length]==="."}var PE=class{constructor(e,r,n){this.fontStyle=e,this.foregroundId=r,this.backgroundId=n}};function XI(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let r=e.settings,n=[],s=0;for(let o=0,u=r.length;o<u;o++){let f=r[o];if(!f.settings)continue;let l;if(typeof f.scope=="string"){let p=f.scope;p=p.replace(/^[,]+/,""),p=p.replace(/[,]+$/,""),l=p.split(",")}else Array.isArray(f.scope)?l=f.scope:l=[""];let c=-1;if(typeof f.settings.fontStyle=="string"){c=0;let p=f.settings.fontStyle.split(" ");for(let y=0,x=p.length;y<x;y++)switch(p[y]){case"italic":c=c|1;break;case"bold":c=c|2;break;case"underline":c=c|4;break;case"strikethrough":c=c|8;break}}let h=null;typeof f.settings.foreground=="string"&&XS(f.settings.foreground)&&(h=f.settings.foreground);let m=null;typeof f.settings.background=="string"&&XS(f.settings.background)&&(m=f.settings.background);for(let p=0,y=l.length;p<y;p++){let A=l[p].trim().split(" "),w=A[A.length-1],v=null;A.length>1&&(v=A.slice(0,A.length-1),v.reverse()),n[s++]=new e5(w,v,o,c,h,m)}}return n}var e5=class{constructor(e,r,n,s,o,u){this.scope=e,this.parentScopes=r,this.index=n,this.fontStyle=s,this.foreground=o,this.background=u}},Si=(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))(Si||{});function t5(e,r){e.sort((c,h)=>{let m=OE(c.scope,h.scope);return m!==0||(m=BE(c.parentScopes,h.parentScopes),m!==0)?m:c.index-h.index});let n=0,s="#000000",o="#ffffff";for(;e.length>=1&&e[0].scope==="";){let c=e.shift();c.fontStyle!==-1&&(n=c.fontStyle),c.foreground!==null&&(s=c.foreground),c.background!==null&&(o=c.background)}let u=new r5(r),f=new PE(n,u.getId(s),u.getId(o)),l=new i5(new _g(0,null,-1,0,0),[]);for(let c=0,h=e.length;c<h;c++){let m=e[c];l.insert(0,m.scope,m.parentScopes,m.fontStyle,u.getId(m.foreground),u.getId(m.background))}return new th(u,f,l)}var r5=class{constructor(e){_e(this,"_isFrozen");_e(this,"_lastColorId");_e(this,"_id2color");_e(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let r=0,n=e.length;r<n;r++)this._color2id[e[r]]=r,this._id2color[r]=e[r]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let r=this._color2id[e];if(r)return r;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return r=++this._lastColorId,this._color2id[e]=r,this._id2color[r]=e,r}getColorMap(){return this._id2color.slice(0)}},n5=Object.freeze([]),_g=class jE{constructor(r,n,s,o,u){_e(this,"scopeDepth");_e(this,"parentScopes");_e(this,"fontStyle");_e(this,"foreground");_e(this,"background");this.scopeDepth=r,this.parentScopes=n||n5,this.fontStyle=s,this.foreground=o,this.background=u}clone(){return new jE(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(r){let n=[];for(let s=0,o=r.length;s<o;s++)n[s]=r[s].clone();return n}acceptOverwrite(r,n,s,o){this.scopeDepth>r?console.log("how did this happen?"):this.scopeDepth=r,n!==-1&&(this.fontStyle=n),s!==0&&(this.foreground=s),o!==0&&(this.background=o)}},i5=class yg{constructor(r,n=[],s={}){_e(this,"_rulesWithParentScopes");this._mainRule=r,this._children=s,this._rulesWithParentScopes=n}static _cmpBySpecificity(r,n){if(r.scopeDepth!==n.scopeDepth)return n.scopeDepth-r.scopeDepth;let s=0,o=0;for(;r.parentScopes[s]===">"&&s++,n.parentScopes[o]===">"&&o++,!(s>=r.parentScopes.length||o>=n.parentScopes.length);){const u=n.parentScopes[o].length-r.parentScopes[s].length;if(u!==0)return u;s++,o++}return n.parentScopes.length-r.parentScopes.length}match(r){if(r!==""){let s=r.indexOf("."),o,u;if(s===-1?(o=r,u=""):(o=r.substring(0,s),u=r.substring(s+1)),this._children.hasOwnProperty(o))return this._children[o].match(u)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(yg._cmpBySpecificity),n}insert(r,n,s,o,u,f){if(n===""){this._doInsertHere(r,s,o,u,f);return}let l=n.indexOf("."),c,h;l===-1?(c=n,h=""):(c=n.substring(0,l),h=n.substring(l+1));let m;this._children.hasOwnProperty(c)?m=this._children[c]:(m=new yg(this._mainRule.clone(),_g.cloneArr(this._rulesWithParentScopes)),this._children[c]=m),m.insert(r+1,h,s,o,u,f)}_doInsertHere(r,n,s,o,u){if(n===null){this._mainRule.acceptOverwrite(r,s,o,u);return}for(let f=0,l=this._rulesWithParentScopes.length;f<l;f++){let c=this._rulesWithParentScopes[f];if(BE(c.parentScopes,n)===0){c.acceptOverwrite(r,s,o,u);return}}s===-1&&(s=this._mainRule.fontStyle),o===0&&(o=this._mainRule.foreground),u===0&&(u=this._mainRule.background),this._rulesWithParentScopes.push(new _g(r,n,s,o,u))}},Sa=class rn{static toBinaryStr(r){return r.toString(2).padStart(32,"0")}static print(r){const n=rn.getLanguageId(r),s=rn.getTokenType(r),o=rn.getFontStyle(r),u=rn.getForeground(r),f=rn.getBackground(r);console.log({languageId:n,tokenType:s,fontStyle:o,foreground:u,background:f})}static getLanguageId(r){return(r&255)>>>0}static getTokenType(r){return(r&768)>>>8}static containsBalancedBrackets(r){return(r&1024)!==0}static getFontStyle(r){return(r&30720)>>>11}static getForeground(r){return(r&16744448)>>>15}static getBackground(r){return(r&4278190080)>>>24}static set(r,n,s,o,u,f,l){let c=rn.getLanguageId(r),h=rn.getTokenType(r),m=rn.containsBalancedBrackets(r)?1:0,p=rn.getFontStyle(r),y=rn.getForeground(r),x=rn.getBackground(r);return n!==0&&(c=n),s!==8&&(h=s),o!==null&&(m=o?1:0),u!==-1&&(p=u),f!==0&&(y=f),l!==0&&(x=l),(c<<0|h<<8|m<<10|p<<11|y<<15|x<<24)>>>0}};function rh(e,r){const n=[],s=s5(e);let o=s.next();for(;o!==null;){let c=0;if(o.length===2&&o.charAt(1)===":"){switch(o.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${o} in scope selector`)}o=s.next()}let h=f();if(n.push({matcher:h,priority:c}),o!==",")break;o=s.next()}return n;function u(){if(o==="-"){o=s.next();const c=u();return h=>!!c&&!c(h)}if(o==="("){o=s.next();const c=l();return o===")"&&(o=s.next()),c}if(eb(o)){const c=[];do c.push(o),o=s.next();while(eb(o));return h=>r(c,h)}return null}function f(){const c=[];let h=u();for(;h;)c.push(h),h=u();return m=>c.every(p=>p(m))}function l(){const c=[];let h=f();for(;h&&(c.push(h),o==="|"||o===",");){do o=s.next();while(o==="|"||o===",");h=f()}return m=>c.some(p=>p(m))}}function eb(e){return!!e&&!!e.match(/[\w\.:]+/)}function s5(e){let r=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=r.exec(e);return{next:()=>{if(!n)return null;const s=n[0];return n=r.exec(e),s}}}function UE(e){typeof e.dispose=="function"&&e.dispose()}var pc=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},o5=class{constructor(e,r){this.scopeName=e,this.ruleName=r}toKey(){return`${this.scopeName}#${this.ruleName}`}},a5=class{constructor(){_e(this,"_references",[]);_e(this,"_seenReferenceKeys",new Set);_e(this,"visitedRule",new Set)}get references(){return this._references}add(e){const r=e.toKey();this._seenReferenceKeys.has(r)||(this._seenReferenceKeys.add(r),this._references.push(e))}},l5=class{constructor(e,r){_e(this,"seenFullScopeRequests",new Set);_e(this,"seenPartialScopeRequests",new Set);_e(this,"Q");this.repo=e,this.initialScopeName=r,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new pc(this.initialScopeName)]}processQueue(){const e=this.Q;this.Q=[];const r=new a5;for(const n of e)c5(n,this.initialScopeName,this.repo,r);for(const n of r.references)if(n instanceof pc){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 c5(e,r,n,s){const o=n.lookup(e.scopeName);if(!o){if(e.scopeName===r)throw new Error(`No grammar provided for <${r}>`);return}const u=n.lookup(r);e instanceof pc?Hd({baseGrammar:u,selfGrammar:o},s):Sg(e.ruleName,{baseGrammar:u,selfGrammar:o,repository:o.repository},s);const f=n.injections(e.scopeName);if(f)for(const l of f)s.add(new pc(l))}function Sg(e,r,n){if(r.repository&&r.repository[e]){const s=r.repository[e];nh([s],r,n)}}function Hd(e,r){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&nh(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},r),e.selfGrammar.injections&&nh(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},r)}function nh(e,r,n){for(const s of e){if(n.visitedRule.has(s))continue;n.visitedRule.add(s);const o=s.repository?kE({},r.repository,s.repository):r.repository;Array.isArray(s.patterns)&&nh(s.patterns,{...r,repository:o},n);const u=s.include;if(!u)continue;const f=FE(u);switch(f.kind){case 0:Hd({...r,selfGrammar:r.baseGrammar},n);break;case 1:Hd(r,n);break;case 2:Sg(f.ruleName,{...r,repository:o},n);break;case 3:case 4:const l=f.scopeName===r.selfGrammar.scopeName?r.selfGrammar:f.scopeName===r.baseGrammar.scopeName?r.baseGrammar:void 0;if(l){const c={baseGrammar:r.baseGrammar,selfGrammar:l,repository:o};f.kind===4?Sg(f.ruleName,c,n):Hd(c,n)}else f.kind===4?n.add(new o5(f.scopeName,f.ruleName)):n.add(new pc(f.scopeName));break}}}var u5=class{constructor(){_e(this,"kind",0)}},d5=class{constructor(){_e(this,"kind",1)}},h5=class{constructor(e){_e(this,"kind",2);this.ruleName=e}},f5=class{constructor(e){_e(this,"kind",3);this.scopeName=e}},p5=class{constructor(e,r){_e(this,"kind",4);this.scopeName=e,this.ruleName=r}};function FE(e){if(e==="$base")return new u5;if(e==="$self")return new d5;const r=e.indexOf("#");if(r===-1)return new f5(e);if(r===0)return new h5(e.substring(1));{const n=e.substring(0,r),s=e.substring(r+1);return new p5(n,s)}}var m5=/\\(\d+)/,tb=/\\(\d+)/g,g5=-1,HE=-2;var Bc=class{constructor(e,r,n,s){_e(this,"$location");_e(this,"id");_e(this,"_nameIsCapturing");_e(this,"_name");_e(this,"_contentNameIsCapturing");_e(this,"_contentName");this.$location=e,this.id=r,this._name=n||null,this._nameIsCapturing=wd.hasCaptures(this._name),this._contentName=s||null,this._contentNameIsCapturing=wd.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${LE(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,r){return!this._nameIsCapturing||this._name===null||e===null||r===null?this._name:wd.replaceCaptures(this._name,e,r)}getContentName(e,r){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:wd.replaceCaptures(this._contentName,e,r)}},v5=class extends Bc{constructor(r,n,s,o,u){super(r,n,s,o);_e(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=u}dispose(){}collectPatterns(r,n){throw new Error("Not supported!")}compile(r,n){throw new Error("Not supported!")}compileAG(r,n,s,o){throw new Error("Not supported!")}},_5=class extends Bc{constructor(r,n,s,o,u){super(r,n,s,null);_e(this,"_match");_e(this,"captures");_e(this,"_cachedCompiledPatterns");this._match=new mc(o,this.id),this.captures=u,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(r,n){n.push(this._match)}compile(r,n){return this._getCachedCompiledPatterns(r).compile(r)}compileAG(r,n,s,o){return this._getCachedCompiledPatterns(r).compileAG(r,s,o)}_getCachedCompiledPatterns(r){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new gc,this.collectPatterns(r,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},rb=class extends Bc{constructor(r,n,s,o,u){super(r,n,s,o);_e(this,"hasMissingPatterns");_e(this,"patterns");_e(this,"_cachedCompiledPatterns");this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(r,n){for(const s of this.patterns)r.getRule(s).collectPatterns(r,n)}compile(r,n){return this._getCachedCompiledPatterns(r).compile(r)}compileAG(r,n,s,o){return this._getCachedCompiledPatterns(r).compileAG(r,s,o)}_getCachedCompiledPatterns(r){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new gc,this.collectPatterns(r,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},bg=class extends Bc{constructor(r,n,s,o,u,f,l,c,h,m){super(r,n,s,o);_e(this,"_begin");_e(this,"beginCaptures");_e(this,"_end");_e(this,"endHasBackReferences");_e(this,"endCaptures");_e(this,"applyEndPatternLast");_e(this,"hasMissingPatterns");_e(this,"patterns");_e(this,"_cachedCompiledPatterns");this._begin=new mc(u,this.id),this.beginCaptures=f,this._end=new mc(l||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=c,this.applyEndPatternLast=h||!1,this.patterns=m.patterns,this.hasMissingPatterns=m.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(r,n){return this._end.resolveBackReferences(r,n)}collectPatterns(r,n){n.push(this._begin)}compile(r,n){return this._getCachedCompiledPatterns(r,n).compile(r)}compileAG(r,n,s,o){return this._getCachedCompiledPatterns(r,n).compileAG(r,s,o)}_getCachedCompiledPatterns(r,n){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new gc;for(const s of this.patterns)r.getRule(s).collectPatterns(r,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}},ih=class extends Bc{constructor(r,n,s,o,u,f,l,c,h){super(r,n,s,o);_e(this,"_begin");_e(this,"beginCaptures");_e(this,"whileCaptures");_e(this,"_while");_e(this,"whileHasBackReferences");_e(this,"hasMissingPatterns");_e(this,"patterns");_e(this,"_cachedCompiledPatterns");_e(this,"_cachedCompiledWhilePatterns");this._begin=new mc(u,this.id),this.beginCaptures=f,this.whileCaptures=c,this._while=new mc(l,HE),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=h.patterns,this.hasMissingPatterns=h.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(r,n){return this._while.resolveBackReferences(r,n)}collectPatterns(r,n){n.push(this._begin)}compile(r,n){return this._getCachedCompiledPatterns(r).compile(r)}compileAG(r,n,s,o){return this._getCachedCompiledPatterns(r).compileAG(r,s,o)}_getCachedCompiledPatterns(r){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new gc;for(const n of this.patterns)r.getRule(n).collectPatterns(r,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(r,n){return this._getCachedCompiledWhilePatterns(r,n).compile(r)}compileWhileAG(r,n,s,o){return this._getCachedCompiledWhilePatterns(r,n).compileAG(r,s,o)}_getCachedCompiledWhilePatterns(r,n){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new gc,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||"￿"),this._cachedCompiledWhilePatterns}},VE=class fr{static createCaptureRule(r,n,s,o,u){return r.registerRule(f=>new v5(n,f,s,o,u))}static getCompiledRuleId(r,n,s){return r.id||n.registerRule(o=>{if(r.id=o,r.match)return new _5(r.$vscodeTextmateLocation,r.id,r.name,r.match,fr._compileCaptures(r.captures,n,s));if(typeof r.begin>"u"){r.repository&&(s=kE({},s,r.repository));let u=r.patterns;return typeof u>"u"&&r.include&&(u=[{include:r.include}]),new rb(r.$vscodeTextmateLocation,r.id,r.name,r.contentName,fr._compilePatterns(u,n,s))}return r.while?new ih(r.$vscodeTextmateLocation,r.id,r.name,r.contentName,r.begin,fr._compileCaptures(r.beginCaptures||r.captures,n,s),r.while,fr._compileCaptures(r.whileCaptures||r.captures,n,s),fr._compilePatterns(r.patterns,n,s)):new bg(r.$vscodeTextmateLocation,r.id,r.name,r.contentName,r.begin,fr._compileCaptures(r.beginCaptures||r.captures,n,s),r.end,fr._compileCaptures(r.endCaptures||r.captures,n,s),r.applyEndPatternLast,fr._compilePatterns(r.patterns,n,s))}),r.id}static _compileCaptures(r,n,s){let o=[];if(r){let u=0;for(const f in r){if(f==="$vscodeTextmateLocation")continue;const l=parseInt(f,10);l>u&&(u=l)}for(let f=0;f<=u;f++)o[f]=null;for(const f in r){if(f==="$vscodeTextmateLocation")continue;const l=parseInt(f,10);let c=0;r[f].patterns&&(c=fr.getCompiledRuleId(r[f],n,s)),o[l]=fr.createCaptureRule(n,r[f].$vscodeTextmateLocation,r[f].name,r[f].contentName,c)}}return o}static _compilePatterns(r,n,s){let o=[];if(r)for(let u=0,f=r.length;u<f;u++){const l=r[u];let c=-1;if(l.include){const h=FE(l.include);switch(h.kind){case 0:case 1:c=fr.getCompiledRuleId(s[l.include],n,s);break;case 2:let m=s[h.ruleName];m&&(c=fr.getCompiledRuleId(m,n,s));break;case 3:case 4:const p=h.scopeName,y=h.kind===4?h.ruleName:null,x=n.getExternalGrammar(p,s);if(x)if(y){let A=x.repository[y];A&&(c=fr.getCompiledRuleId(A,n,x.repository))}else c=fr.getCompiledRuleId(x.repository.$self,n,x.repository);break}}else c=fr.getCompiledRuleId(l,n,s);if(c!==-1){const h=n.getRule(c);let m=!1;if((h instanceof rb||h instanceof bg||h instanceof ih)&&h.hasMissingPatterns&&h.patterns.length===0&&(m=!0),m)continue;o.push(c)}}return{patterns:o,hasMissingPatterns:(r?r.length:0)!==o.length}}},mc=class qE{constructor(r,n){_e(this,"source");_e(this,"ruleId");_e(this,"hasAnchor");_e(this,"hasBackReferences");_e(this,"_anchorCache");if(r&&typeof r=="string"){const s=r.length;let o=0,u=[],f=!1;for(let l=0;l<s;l++)if(r.charAt(l)==="\\"&&l+1<s){const h=r.charAt(l+1);h==="z"?(u.push(r.substring(o,l)),u.push("$(?!\\n)(?<!\\n)"),o=l+2):(h==="A"||h==="G")&&(f=!0),l++}this.hasAnchor=f,o===0?this.source=r:(u.push(r.substring(o,s)),this.source=u.join(""))}else this.hasAnchor=!1,this.source=r;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=m5.test(this.source):this.hasBackReferences=!1}clone(){return new qE(this.source,this.ruleId)}setSource(r){this.source!==r&&(this.source=r,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(r,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let s=n.map(o=>r.substring(o.start,o.end));return tb.lastIndex=0,this.source.replace(tb,(o,u)=>NE(s[parseInt(u,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=[],n=[],s=[],o=[],u,f,l,c;for(u=0,f=this.source.length;u<f;u++)l=this.source.charAt(u),r[u]=l,n[u]=l,s[u]=l,o[u]=l,l==="\\"&&u+1<f&&(c=this.source.charAt(u+1),c==="A"?(r[u+1]="￿",n[u+1]="￿",s[u+1]="A",o[u+1]="A"):c==="G"?(r[u+1]="￿",n[u+1]="G",s[u+1]="￿",o[u+1]="G"):(r[u+1]=c,n[u+1]=c,s[u+1]=c,o[u+1]=c),u++);return{A0_G0:r.join(""),A0_G1:n.join(""),A1_G0:s.join(""),A1_G1:o.join("")}}resolveAnchors(r,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:r?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},gc=class{constructor(){_e(this,"_items");_e(this,"_hasAnchors");_e(this,"_cached");_e(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,r){this._items[e].source!==r&&(this._disposeCaches(),this._items[e].setSource(r))}compile(e){if(!this._cached){let r=this._items.map(n=>n.source);this._cached=new nb(e,r,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,r,n){return this._hasAnchors?r?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,r,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,r,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,r,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,r,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,r,n){let s=this._items.map(o=>o.resolveAnchors(r,n));return new nb(e,s,this._items.map(o=>o.ruleId))}},nb=class{constructor(e,r,n){_e(this,"scanner");this.regExps=r,this.rules=n,this.scanner=e.createOnigScanner(r)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let r=0,n=this.rules.length;r<n;r++)e.push(" - "+this.rules[r]+": "+this.regExps[r]);return e.join(`
381
+ `)}findNextMatchSync(e,r,n){const s=this.scanner.findNextMatchSync(e,r,n);return s?{ruleId:this.rules[s.index],captureIndices:s.captureIndices}:null}},Lm=class{constructor(e,r){this.languageId=e,this.tokenType=r}},yi,y5=(yi=class{constructor(r,n){_e(this,"_defaultAttributes");_e(this,"_embeddedLanguagesMatcher");_e(this,"_getBasicScopeAttributes",new IE(r=>{const n=this._scopeToLanguage(r),s=this._toStandardTokenType(r);return new Lm(n,s)}));this._defaultAttributes=new Lm(r,8),this._embeddedLanguagesMatcher=new S5(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(r){return r===null?yi._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(r)}_scopeToLanguage(r){return this._embeddedLanguagesMatcher.match(r)||0}_toStandardTokenType(r){const n=r.match(yi.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!")}},_e(yi,"_NULL_SCOPE_METADATA",new Lm(0,0)),_e(yi,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),yi),S5=class{constructor(e){_e(this,"values");_e(this,"scopesRegExp");if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const r=e.map(([n,s])=>NE(n));r.sort(),r.reverse(),this.scopesRegExp=new RegExp(`^((${r.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const r=e.match(this.scopesRegExp);if(r)return this.values.get(r[1])}},ib=class{constructor(e,r){this.stack=e,this.stoppedEarly=r}};function GE(e,r,n,s,o,u,f,l){const c=r.content.length;let h=!1,m=-1;if(f){const x=b5(e,r,n,s,o,u);o=x.stack,s=x.linePos,n=x.isFirstLine,m=x.anchorPosition}const p=Date.now();for(;!h;){if(l!==0&&Date.now()-p>l)return new ib(o,!0);y()}return new ib(o,!1);function y(){const x=C5(e,r,n,s,o,m);if(!x){u.produce(o,c),h=!0;return}const A=x.captureIndices,w=x.matchedRuleId,v=A&&A.length>0?A[0].end>s:!1;if(w===g5){const S=o.getRule(e);u.produce(o,A[0].start),o=o.withContentNameScopesList(o.nameScopesList),Xl(e,r,n,o,u,S.endCaptures,A),u.produce(o,A[0].end);const g=o;if(o=o.parent,m=g.getAnchorPos(),!v&&g.getEnterPos()===s){o=g,u.produce(o,c),h=!0;return}}else{const S=e.getRule(w);u.produce(o,A[0].start);const g=o,_=S.getName(r.content,A),T=o.contentNameScopesList.pushAttributed(_,e);if(o=o.push(w,s,m,A[0].end===c,null,T,T),S instanceof bg){const M=S;Xl(e,r,n,o,u,M.beginCaptures,A),u.produce(o,A[0].end),m=A[0].end;const k=M.getContentName(r.content,A),L=T.pushAttributed(k,e);if(o=o.withContentNameScopesList(L),M.endHasBackReferences&&(o=o.withEndRule(M.getEndWithResolvedBackReferences(r.content,A))),!v&&g.hasSameRuleAs(o)){o=o.pop(),u.produce(o,c),h=!0;return}}else if(S instanceof ih){const M=S;Xl(e,r,n,o,u,M.beginCaptures,A),u.produce(o,A[0].end),m=A[0].end;const k=M.getContentName(r.content,A),L=T.pushAttributed(k,e);if(o=o.withContentNameScopesList(L),M.whileHasBackReferences&&(o=o.withEndRule(M.getWhileWithResolvedBackReferences(r.content,A))),!v&&g.hasSameRuleAs(o)){o=o.pop(),u.produce(o,c),h=!0;return}}else if(Xl(e,r,n,o,u,S.captures,A),u.produce(o,A[0].end),o=o.pop(),!v){o=o.safePop(),u.produce(o,c),h=!0;return}}A[0].end>s&&(s=A[0].end,n=!1)}}function b5(e,r,n,s,o,u){let f=o.beginRuleCapturedEOL?0:-1;const l=[];for(let c=o;c;c=c.pop()){const h=c.getRule(e);h instanceof ih&&l.push({rule:h,stack:c})}for(let c=l.pop();c;c=l.pop()){const{ruleScanner:h,findOptions:m}=E5(c.rule,e,c.stack.endRule,n,s===f),p=h.findNextMatchSync(r,s,m);if(p){if(p.ruleId!==HE){o=c.stack.pop();break}p.captureIndices&&p.captureIndices.length&&(u.produce(c.stack,p.captureIndices[0].start),Xl(e,r,n,c.stack,u,c.rule.whileCaptures,p.captureIndices),u.produce(c.stack,p.captureIndices[0].end),f=p.captureIndices[0].end,p.captureIndices[0].end>s&&(s=p.captureIndices[0].end,n=!1))}else{o=c.stack.pop();break}}return{stack:o,linePos:s,anchorPosition:f,isFirstLine:n}}function C5(e,r,n,s,o,u){const f=w5(e,r,n,s,o,u),l=e.getInjections();if(l.length===0)return f;const c=x5(l,e,r,n,s,o,u);if(!c)return f;if(!f)return c;const h=f.captureIndices[0].start,m=c.captureIndices[0].start;return m<h||c.priorityMatch&&m===h?c:f}function w5(e,r,n,s,o,u){const f=o.getRule(e),{ruleScanner:l,findOptions:c}=zE(f,e,o.endRule,n,s===u),h=l.findNextMatchSync(r,s,c);return h?{captureIndices:h.captureIndices,matchedRuleId:h.ruleId}:null}function x5(e,r,n,s,o,u,f){let l=Number.MAX_VALUE,c=null,h,m=0;const p=u.contentNameScopesList.getScopeNames();for(let y=0,x=e.length;y<x;y++){const A=e[y];if(!A.matcher(p))continue;const w=r.getRule(A.ruleId),{ruleScanner:v,findOptions:S}=zE(w,r,null,s,o===f),g=v.findNextMatchSync(n,o,S);if(!g)continue;const _=g.captureIndices[0].start;if(!(_>=l)&&(l=_,c=g.captureIndices,h=g.ruleId,m=A.priority,l===o))break}return c?{priorityMatch:m===-1,captureIndices:c,matchedRuleId:h}:null}function zE(e,r,n,s,o){return{ruleScanner:e.compileAG(r,n,s,o),findOptions:0}}function E5(e,r,n,s,o){return{ruleScanner:e.compileWhileAG(r,n,s,o),findOptions:0}}function Xl(e,r,n,s,o,u,f){if(u.length===0)return;const l=r.content,c=Math.min(u.length,f.length),h=[],m=f[0].end;for(let p=0;p<c;p++){const y=u[p];if(y===null)continue;const x=f[p];if(x.length===0)continue;if(x.start>m)break;for(;h.length>0&&h[h.length-1].endPos<=x.start;)o.produceFromScopes(h[h.length-1].scopes,h[h.length-1].endPos),h.pop();if(h.length>0?o.produceFromScopes(h[h.length-1].scopes,x.start):o.produce(s,x.start),y.retokenizeCapturedWithRuleId){const w=y.getName(l,f),v=s.contentNameScopesList.pushAttributed(w,e),S=y.getContentName(l,f),g=v.pushAttributed(S,e),_=s.push(y.retokenizeCapturedWithRuleId,x.start,-1,!1,null,v,g),T=e.createOnigString(l.substring(0,x.end));GE(e,T,n&&x.start===0,x.start,_,o,!1,0),UE(T);continue}const A=y.getName(l,f);if(A!==null){const v=(h.length>0?h[h.length-1].scopes:s.contentNameScopesList).pushAttributed(A,e);h.push(new A5(v,x.end))}}for(;h.length>0;)o.produceFromScopes(h[h.length-1].scopes,h[h.length-1].endPos),h.pop()}var A5=class{constructor(e,r){_e(this,"scopes");_e(this,"endPos");this.scopes=e,this.endPos=r}};function T5(e,r,n,s,o,u,f,l){return new D5(e,r,n,s,o,u,f,l)}function sb(e,r,n,s,o){const u=rh(r,sh),f=VE.getCompiledRuleId(n,s,o.repository);for(const l of u)e.push({debugSelector:r,matcher:l.matcher,ruleId:f,grammar:o,priority:l.priority})}function sh(e,r){if(r.length<e.length)return!1;let n=0;return e.every(s=>{for(let o=n;o<r.length;o++)if(R5(r[o],s))return n=o+1,!0;return!1})}function R5(e,r){if(!e)return!1;if(e===r)return!0;const n=r.length;return e.length>n&&e.substr(0,n)===r&&e[n]==="."}var D5=class{constructor(e,r,n,s,o,u,f,l){_e(this,"_rootId");_e(this,"_lastRuleId");_e(this,"_ruleId2desc");_e(this,"_includedGrammars");_e(this,"_grammarRepository");_e(this,"_grammar");_e(this,"_injections");_e(this,"_basicScopeAttributesProvider");_e(this,"_tokenTypeMatchers");if(this._rootScopeName=e,this.balancedBracketSelectors=u,this._onigLib=l,this._basicScopeAttributesProvider=new y5(n,s),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=f,this._grammar=ob(r,null),this._injections=null,this._tokenTypeMatchers=[],o)for(const c of Object.keys(o)){const h=rh(c,sh);for(const m of h)this._tokenTypeMatchers.push({matcher:m.matcher,type:o[c]})}}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:o=>o===this._rootScopeName?this._grammar:this.getExternalGrammar(o),injections:o=>this._grammarRepository.injections(o)},r=[],n=this._rootScopeName,s=e.lookup(n);if(s){const o=s.injections;if(o)for(let f in o)sb(r,f,o[f],this,s);const u=this._grammarRepository.injections(n);u&&u.forEach(f=>{const l=this.getExternalGrammar(f);if(l){const c=l.injectionSelector;c&&sb(r,c,l,this,l)}})}return r.sort((o,u)=>o.priority-u.priority),r}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const r=++this._lastRuleId,n=e(r);return this._ruleId2desc[r]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,r){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=ob(n,r&&r.$base),this._includedGrammars[e]}}tokenizeLine(e,r,n=0){const s=this._tokenize(e,r,!1,n);return{tokens:s.lineTokens.getResult(s.ruleStack,s.lineLength),ruleStack:s.ruleStack,stoppedEarly:s.stoppedEarly}}tokenizeLine2(e,r,n=0){const s=this._tokenize(e,r,!0,n);return{tokens:s.lineTokens.getBinaryResult(s.ruleStack,s.lineLength),ruleStack:s.ruleStack,stoppedEarly:s.stoppedEarly}}_tokenize(e,r,n,s){this._rootId===-1&&(this._rootId=VE.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!r||r===Cg.NULL){o=!0;const h=this._basicScopeAttributesProvider.getDefaultAttributes(),m=this.themeProvider.getDefaults(),p=Sa.set(0,h.languageId,h.tokenType,null,m.fontStyle,m.foregroundId,m.backgroundId),y=this.getRule(this._rootId).getName(null,null);let x;y?x=ec.createRootAndLookUpScopeName(y,p,this):x=ec.createRoot("unknown",p),r=new Cg(null,this._rootId,-1,-1,!1,null,x,x)}else o=!1,r.reset();e=e+`
382
+ `;const u=this.createOnigString(e),f=u.content.length,l=new k5(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=GE(this,u,o,0,r,l,!0,s);return UE(u),{lineLength:f,lineTokens:l,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function ob(e,r){return e=KI(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=r||e.repository.$self,e}var ec=class Bn{constructor(r,n,s){this.parent=r,this.scopePath=n,this.tokenAttributes=s}static fromExtension(r,n){let s=r,o=(r==null?void 0:r.scopePath)??null;for(const u of n)o=km.push(o,u.scopeNames),s=new Bn(s,o,u.encodedTokenAttributes);return s}static createRoot(r,n){return new Bn(null,new km(null,r),n)}static createRootAndLookUpScopeName(r,n,s){const o=s.getMetadataForScope(r),u=new km(null,r),f=s.themeProvider.themeMatch(u),l=Bn.mergeAttributes(n,o,f);return new Bn(null,u,l)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(r){return Bn.equals(this,r)}static equals(r,n){do{if(r===n||!r&&!n)return!0;if(!r||!n||r.scopeName!==n.scopeName||r.tokenAttributes!==n.tokenAttributes)return!1;r=r.parent,n=n.parent}while(!0)}static mergeAttributes(r,n,s){let o=-1,u=0,f=0;return s!==null&&(o=s.fontStyle,u=s.foregroundId,f=s.backgroundId),Sa.set(r,n.languageId,n.tokenType,null,o,u,f)}pushAttributed(r,n){if(r===null)return this;if(r.indexOf(" ")===-1)return Bn._pushAttributed(this,r,n);const s=r.split(/ /g);let o=this;for(const u of s)o=Bn._pushAttributed(o,u,n);return o}static _pushAttributed(r,n,s){const o=s.getMetadataForScope(n),u=r.scopePath.push(n),f=s.themeProvider.themeMatch(u),l=Bn.mergeAttributes(r.tokenAttributes,o,f);return new Bn(r,u,l)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(r){var o;const n=[];let s=this;for(;s&&s!==r;)n.push({encodedTokenAttributes:s.tokenAttributes,scopeNames:s.scopePath.getExtensionIfDefined(((o=s.parent)==null?void 0:o.scopePath)??null)}),s=s.parent;return s===r?n.reverse():void 0}},sn,Cg=(sn=class{constructor(r,n,s,o,u,f,l,c){_e(this,"_stackElementBrand");_e(this,"_enterPos");_e(this,"_anchorPos");_e(this,"depth");this.parent=r,this.ruleId=n,this.beginRuleCapturedEOL=u,this.endRule=f,this.nameScopesList=l,this.contentNameScopesList=c,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=s,this._anchorPos=o}equals(r){return r===null?!1:sn._equals(this,r)}static _equals(r,n){return r===n?!0:this._structuralEquals(r,n)?ec.equals(r.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(r,n){do{if(r===n||!r&&!n)return!0;if(!r||!n||r.depth!==n.depth||r.ruleId!==n.ruleId||r.endRule!==n.endRule)return!1;r=r.parent,n=n.parent}while(!0)}clone(){return this}static _reset(r){for(;r;)r._enterPos=-1,r._anchorPos=-1,r=r.parent}reset(){sn._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(r,n,s,o,u,f,l){return new sn(this,r,n,s,o,u,f,l)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(r){return r.getRule(this.ruleId)}toString(){const r=[];return this._writeString(r,0),"["+r.join(",")+"]"}_writeString(r,n){var s,o;return this.parent&&(n=this.parent._writeString(r,n)),r[n++]=`(${this.ruleId}, ${(s=this.nameScopesList)==null?void 0:s.toString()}, ${(o=this.contentNameScopesList)==null?void 0:o.toString()})`,n}withContentNameScopesList(r){return this.contentNameScopesList===r?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,r)}withEndRule(r){return this.endRule===r?this:new sn(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,r,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(r){let n=this;for(;n&&n._enterPos===r._enterPos;){if(n.ruleId===r.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){var r,n,s;return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:((n=this.nameScopesList)==null?void 0:n.getExtensionIfDefined(((r=this.parent)==null?void 0:r.nameScopesList)??null))??[],contentNameScopesList:((s=this.contentNameScopesList)==null?void 0:s.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(r,n){const s=ec.fromExtension((r==null?void 0:r.nameScopesList)??null,n.nameScopesList);return new sn(r,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,s,ec.fromExtension(s,n.contentNameScopesList))}},_e(sn,"NULL",new sn(null,0,0,0,!1,null,null,null)),sn),M5=class{constructor(e,r){_e(this,"balancedBracketScopes");_e(this,"unbalancedBracketScopes");_e(this,"allowAny",!1);this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):rh(n,sh).map(s=>s.matcher)),this.unbalancedBracketScopes=r.flatMap(n=>rh(n,sh).map(s=>s.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const r of this.unbalancedBracketScopes)if(r(e))return!1;for(const r of this.balancedBracketScopes)if(r(e))return!0;return this.allowAny}},k5=class{constructor(e,r,n,s){_e(this,"_emitBinaryTokens");_e(this,"_lineText");_e(this,"_tokens");_e(this,"_binaryTokens");_e(this,"_lastTokenEndIndex");_e(this,"_tokenTypeOverrides");this.balancedBracketSelectors=s,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(e,r){this.produceFromScopes(e.contentNameScopesList,r)}produceFromScopes(e,r){var s;if(this._lastTokenEndIndex>=r)return;if(this._emitBinaryTokens){let o=(e==null?void 0:e.tokenAttributes)??0,u=!1;if((s=this.balancedBracketSelectors)!=null&&s.matchesAlways&&(u=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const f=(e==null?void 0:e.getScopeNames())??[];for(const l of this._tokenTypeOverrides)l.matcher(f)&&(o=Sa.set(o,0,l.type,null,-1,0,0));this.balancedBracketSelectors&&(u=this.balancedBracketSelectors.match(f))}if(u&&(o=Sa.set(o,0,8,u,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===o){this._lastTokenEndIndex=r;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(o),this._lastTokenEndIndex=r;return}const n=(e==null?void 0:e.getScopeNames())??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:r,scopes:n}),this._lastTokenEndIndex=r}getResult(e,r){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===r-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,r),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,r){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===r-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,r),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let s=0,o=this._binaryTokens.length;s<o;s++)n[s]=this._binaryTokens[s];return n}},L5=class{constructor(e,r){_e(this,"_grammars",new Map);_e(this,"_rawGrammars",new Map);_e(this,"_injectionGrammars",new Map);_e(this,"_theme");this._onigLib=r,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,r){this._rawGrammars.set(e.scopeName,e),r&&this._injectionGrammars.set(e.scopeName,r)}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,r,n,s,o){if(!this._grammars.has(e)){let u=this._rawGrammars.get(e);if(!u)return null;this._grammars.set(e,T5(e,u,r,n,s,o,this,this._onigLib))}return this._grammars.get(e)}},O5=class{constructor(r){_e(this,"_options");_e(this,"_syncRegistry");_e(this,"_ensureGrammarCache");this._options=r,this._syncRegistry=new L5(th.createFromRawTheme(r.theme,r.colorMap),r.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(r,n){this._syncRegistry.setTheme(th.createFromRawTheme(r,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(r,n,s){return this.loadGrammarWithConfiguration(r,n,{embeddedLanguages:s})}loadGrammarWithConfiguration(r,n,s){return this._loadGrammar(r,n,s.embeddedLanguages,s.tokenTypes,new M5(s.balancedBracketSelectors||[],s.unbalancedBracketSelectors||[]))}loadGrammar(r){return this._loadGrammar(r,0,null,null,null)}_loadGrammar(r,n,s,o,u){const f=new l5(this._syncRegistry,r);for(;f.Q.length>0;)f.Q.map(l=>this._loadSingleGrammar(l.scopeName)),f.processQueue();return this._grammarForScopeName(r,n,s,o,u)}_loadSingleGrammar(r){this._ensureGrammarCache.has(r)||(this._doLoadSingleGrammar(r),this._ensureGrammarCache.set(r,!0))}_doLoadSingleGrammar(r){const n=this._options.loadGrammar(r);if(n){const s=typeof this._options.getInjections=="function"?this._options.getInjections(r):void 0;this._syncRegistry.addGrammar(n,s)}}addGrammar(r,n=[],s=0,o=null){return this._syncRegistry.addGrammar(r,n),this._grammarForScopeName(r.scopeName,s,o)}_grammarForScopeName(r,n=0,s=null,o=null,u=null){return this._syncRegistry.grammarForScopeName(r,n,s,o,u)}},wg=Cg.NULL;const B5=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Nc{constructor(r,n,s){this.normal=n,this.property=r,s&&(this.space=s)}}Nc.prototype.normal={};Nc.prototype.property={};Nc.prototype.space=void 0;function YE(e,r){const n={},s={};for(const o of e)Object.assign(n,o.property),Object.assign(s,o.normal);return new Nc(n,s,r)}function xg(e){return e.toLowerCase()}class Or{constructor(r,n){this.attribute=n,this.property=r}}Or.prototype.attribute="";Or.prototype.booleanish=!1;Or.prototype.boolean=!1;Or.prototype.commaOrSpaceSeparated=!1;Or.prototype.commaSeparated=!1;Or.prototype.defined=!1;Or.prototype.mustUseProperty=!1;Or.prototype.number=!1;Or.prototype.overloadedBoolean=!1;Or.prototype.property="";Or.prototype.spaceSeparated=!1;Or.prototype.space=void 0;let N5=0;const Ke=fo(),Kt=fo(),Eg=fo(),Ae=fo(),wt=fo(),fa=fo(),Vr=fo();function fo(){return 2**++N5}const Ag=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ke,booleanish:Kt,commaOrSpaceSeparated:Vr,commaSeparated:fa,number:Ae,overloadedBoolean:Eg,spaceSeparated:wt},Symbol.toStringTag,{value:"Module"})),Om=Object.keys(Ag);class Tv extends Or{constructor(r,n,s,o){let u=-1;if(super(r,n),ab(this,"space",o),typeof s=="number")for(;++u<Om.length;){const f=Om[u];ab(this,Om[u],(s&Ag[f])===Ag[f])}}}Tv.prototype.defined=!0;function ab(e,r,n){n&&(e[r]=n)}function La(e){const r={},n={};for(const[s,o]of Object.entries(e.properties)){const u=new Tv(s,e.transform(e.attributes||{},s),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(u.mustUseProperty=!0),r[s]=u,n[xg(s)]=s,n[xg(u.attribute)]=s}return new Nc(r,n,e.space)}const WE=La({properties:{ariaActiveDescendant:null,ariaAtomic:Kt,ariaAutoComplete:null,ariaBusy:Kt,ariaChecked:Kt,ariaColCount:Ae,ariaColIndex:Ae,ariaColSpan:Ae,ariaControls:wt,ariaCurrent:null,ariaDescribedBy:wt,ariaDetails:null,ariaDisabled:Kt,ariaDropEffect:wt,ariaErrorMessage:null,ariaExpanded:Kt,ariaFlowTo:wt,ariaGrabbed:Kt,ariaHasPopup:null,ariaHidden:Kt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:wt,ariaLevel:Ae,ariaLive:null,ariaModal:Kt,ariaMultiLine:Kt,ariaMultiSelectable:Kt,ariaOrientation:null,ariaOwns:wt,ariaPlaceholder:null,ariaPosInSet:Ae,ariaPressed:Kt,ariaReadOnly:Kt,ariaRelevant:null,ariaRequired:Kt,ariaRoleDescription:wt,ariaRowCount:Ae,ariaRowIndex:Ae,ariaRowSpan:Ae,ariaSelected:Kt,ariaSetSize:Ae,ariaSort:null,ariaValueMax:Ae,ariaValueMin:Ae,ariaValueNow:Ae,ariaValueText:null,role:null},transform(e,r){return r==="role"?r:"aria-"+r.slice(4).toLowerCase()}});function KE(e,r){return r in e?e[r]:r}function QE(e,r){return KE(e,r.toLowerCase())}const I5=La({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:fa,acceptCharset:wt,accessKey:wt,action:null,allow:null,allowFullScreen:Ke,allowPaymentRequest:Ke,allowUserMedia:Ke,alt:null,as:null,async:Ke,autoCapitalize:null,autoComplete:wt,autoFocus:Ke,autoPlay:Ke,blocking:wt,capture:null,charSet:null,checked:Ke,cite:null,className:wt,cols:Ae,colSpan:null,content:null,contentEditable:Kt,controls:Ke,controlsList:wt,coords:Ae|fa,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ke,defer:Ke,dir:null,dirName:null,disabled:Ke,download:Eg,draggable:Kt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ke,formTarget:null,headers:wt,height:Ae,hidden:Eg,high:Ae,href:null,hrefLang:null,htmlFor:wt,httpEquiv:wt,id:null,imageSizes:null,imageSrcSet:null,inert:Ke,inputMode:null,integrity:null,is:null,isMap:Ke,itemId:null,itemProp:wt,itemRef:wt,itemScope:Ke,itemType:wt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ke,low:Ae,manifest:null,max:null,maxLength:Ae,media:null,method:null,min:null,minLength:Ae,multiple:Ke,muted:Ke,name:null,nonce:null,noModule:Ke,noValidate:Ke,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:Ke,optimum:Ae,pattern:null,ping:wt,placeholder:null,playsInline:Ke,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ke,referrerPolicy:null,rel:wt,required:Ke,reversed:Ke,rows:Ae,rowSpan:Ae,sandbox:wt,scope:null,scoped:Ke,seamless:Ke,selected:Ke,shadowRootClonable:Ke,shadowRootDelegatesFocus:Ke,shadowRootMode:null,shape:null,size:Ae,sizes:null,slot:null,span:Ae,spellCheck:Kt,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:Ke,useMap:null,value:Kt,width:Ae,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:wt,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:Ke,declare:Ke,event:null,face:null,frame:null,frameBorder:null,hSpace:Ae,leftMargin:Ae,link:null,longDesc:null,lowSrc:null,marginHeight:Ae,marginWidth:Ae,noResize:Ke,noHref:Ke,noShade:Ke,noWrap:Ke,object:null,profile:null,prompt:null,rev:null,rightMargin:Ae,rules:null,scheme:null,scrolling:Kt,standby:null,summary:null,text:null,topMargin:Ae,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ae,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ke,disableRemotePlayback:Ke,prefix:null,property:null,results:Ae,security:null,unselectable:null},space:"html",transform:QE}),P5=La({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Vr,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:wt,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:Ke,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:fa,g2:fa,glyphName:fa,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:Vr,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,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:wt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ae,pointsAtY:Ae,pointsAtZ:Ae,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Vr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Vr,rev:Vr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Vr,requiredFeatures:Vr,requiredFonts:Vr,requiredFormats:Vr,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:Vr,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:Vr,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:Vr,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:KE}),$E=La({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,r){return"xlink:"+r.slice(5).toLowerCase()}}),JE=La({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:QE}),ZE=La({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,r){return"xml:"+r.slice(3).toLowerCase()}}),j5=/[A-Z]/g,lb=/-[a-z]/g,U5=/^data[-\w.:]+$/i;function F5(e,r){const n=xg(r);let s=r,o=Or;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&U5.test(r)){if(r.charAt(4)==="-"){const u=r.slice(5).replace(lb,V5);s="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=r.slice(4);if(!lb.test(u)){let f=u.replace(j5,H5);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}o=Tv}return new o(s,r)}function H5(e){return"-"+e.toLowerCase()}function V5(e){return e.charAt(1).toUpperCase()}const q5=YE([WE,I5,$E,JE,ZE],"html"),XE=YE([WE,P5,$E,JE,ZE],"svg"),cb={}.hasOwnProperty;function G5(e,r){const n=r||{};function s(o,...u){let f=s.invalid;const l=s.handlers;if(o&&cb.call(o,e)){const c=String(o[e]);f=cb.call(l,c)?l[c]:s.unknown}if(f)return f.call(this,o,...u)}return s.handlers=n.handlers||{},s.invalid=n.invalid,s.unknown=n.unknown,s}const z5=/["&'<>`]/g,Y5=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,W5=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,K5=/[|\\{}()[\]^$+*?.]/g,ub=new WeakMap;function Q5(e,r){if(e=e.replace(r.subset?$5(r.subset):z5,s),r.subset||r.escapeOnly)return e;return e.replace(Y5,n).replace(W5,s);function n(o,u,f){return r.format((o.charCodeAt(0)-55296)*1024+o.charCodeAt(1)-56320+65536,f.charCodeAt(u+2),r)}function s(o,u,f){return r.format(o.charCodeAt(0),f.charCodeAt(u+1),r)}}function $5(e){let r=ub.get(e);return r||(r=J5(e),ub.set(e,r)),r}function J5(e){const r=[];let n=-1;for(;++n<e.length;)r.push(e[n].replace(K5,"\\$&"));return new RegExp("(?:"+r.join("|")+")","g")}const Z5=/[\dA-Fa-f]/;function X5(e,r,n){const s="&#x"+e.toString(16).toUpperCase();return n&&r&&!Z5.test(String.fromCharCode(r))?s:s+";"}const eP=/\d/;function tP(e,r,n){const s="&#"+String(e);return n&&r&&!eP.test(String.fromCharCode(r))?s:s+";"}const rP=["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"],Bm={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:"€"},nP=["cent","copy","divide","gt","lt","not","para","times"],eA={}.hasOwnProperty,Tg={};let xd;for(xd in Bm)eA.call(Bm,xd)&&(Tg[Bm[xd]]=xd);const iP=/[^\dA-Za-z]/;function sP(e,r,n,s){const o=String.fromCharCode(e);if(eA.call(Tg,o)){const u=Tg[o],f="&"+u;return n&&rP.includes(u)&&!nP.includes(u)&&(!s||r&&r!==61&&iP.test(String.fromCharCode(r)))?f:f+";"}return""}function oP(e,r,n){let s=X5(e,r,n.omitOptionalSemicolons),o;if((n.useNamedReferences||n.useShortestReferences)&&(o=sP(e,r,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!o)&&n.useShortestReferences){const u=tP(e,r,n.omitOptionalSemicolons);u.length<s.length&&(s=u)}return o&&(!n.useShortestReferences||o.length<s.length)?o:s}function pa(e,r){return Q5(e,Object.assign({format:oP},r))}const aP=/^>|^->|<!--|-->|--!>|<!-$/g,lP=[">"],cP=["<",">"];function uP(e,r,n,s){return s.settings.bogusComments?"<?"+pa(e.value,Object.assign({},s.settings.characterReferences,{subset:lP}))+">":"<!--"+e.value.replace(aP,o)+"-->";function o(u){return pa(u,Object.assign({},s.settings.characterReferences,{subset:cP}))}}function dP(e,r,n,s){return"<!"+(s.settings.upperDoctype?"DOCTYPE":"doctype")+(s.settings.tightDoctype?"":" ")+"html>"}function db(e,r){const n=String(e);if(typeof r!="string")throw new TypeError("Expected character");let s=0,o=n.indexOf(r);for(;o!==-1;)s++,o=n.indexOf(r,o+r.length);return s}function hP(e,r){const n=r||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function fP(e){return e.join(" ").trim()}const pP=/[ \t\n\f\r]/g;function Rv(e){return typeof e=="object"?e.type==="text"?hb(e.value):!1:hb(e)}function hb(e){return e.replace(pP,"")===""}const Zt=rA(1),tA=rA(-1),mP=[];function rA(e){return r;function r(n,s,o){const u=n?n.children:mP;let f=(s||0)+e,l=u[f];if(!o)for(;l&&Rv(l);)f+=e,l=u[f];return l}}const gP={}.hasOwnProperty;function nA(e){return r;function r(n,s,o){return gP.call(e,n.tagName)&&e[n.tagName](n,s,o)}}const Dv=nA({body:_P,caption:Nm,colgroup:Nm,dd:CP,dt:bP,head:Nm,html:vP,li:SP,optgroup:wP,option:xP,p:yP,rp:fb,rt:fb,tbody:AP,td:pb,tfoot:TP,th:pb,thead:EP,tr:RP});function Nm(e,r,n){const s=Zt(n,r,!0);return!s||s.type!=="comment"&&!(s.type==="text"&&Rv(s.value.charAt(0)))}function vP(e,r,n){const s=Zt(n,r);return!s||s.type!=="comment"}function _P(e,r,n){const s=Zt(n,r);return!s||s.type!=="comment"}function yP(e,r,n){const s=Zt(n,r);return s?s.type==="element"&&(s.tagName==="address"||s.tagName==="article"||s.tagName==="aside"||s.tagName==="blockquote"||s.tagName==="details"||s.tagName==="div"||s.tagName==="dl"||s.tagName==="fieldset"||s.tagName==="figcaption"||s.tagName==="figure"||s.tagName==="footer"||s.tagName==="form"||s.tagName==="h1"||s.tagName==="h2"||s.tagName==="h3"||s.tagName==="h4"||s.tagName==="h5"||s.tagName==="h6"||s.tagName==="header"||s.tagName==="hgroup"||s.tagName==="hr"||s.tagName==="main"||s.tagName==="menu"||s.tagName==="nav"||s.tagName==="ol"||s.tagName==="p"||s.tagName==="pre"||s.tagName==="section"||s.tagName==="table"||s.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 SP(e,r,n){const s=Zt(n,r);return!s||s.type==="element"&&s.tagName==="li"}function bP(e,r,n){const s=Zt(n,r);return!!(s&&s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd"))}function CP(e,r,n){const s=Zt(n,r);return!s||s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd")}function fb(e,r,n){const s=Zt(n,r);return!s||s.type==="element"&&(s.tagName==="rp"||s.tagName==="rt")}function wP(e,r,n){const s=Zt(n,r);return!s||s.type==="element"&&s.tagName==="optgroup"}function xP(e,r,n){const s=Zt(n,r);return!s||s.type==="element"&&(s.tagName==="option"||s.tagName==="optgroup")}function EP(e,r,n){const s=Zt(n,r);return!!(s&&s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot"))}function AP(e,r,n){const s=Zt(n,r);return!s||s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot")}function TP(e,r,n){return!Zt(n,r)}function RP(e,r,n){const s=Zt(n,r);return!s||s.type==="element"&&s.tagName==="tr"}function pb(e,r,n){const s=Zt(n,r);return!s||s.type==="element"&&(s.tagName==="td"||s.tagName==="th")}const DP=nA({body:LP,colgroup:OP,head:kP,html:MP,tbody:BP});function MP(e){const r=Zt(e,-1);return!r||r.type!=="comment"}function kP(e){const r=new Set;for(const s of e.children)if(s.type==="element"&&(s.tagName==="base"||s.tagName==="title")){if(r.has(s.tagName))return!1;r.add(s.tagName)}const n=e.children[0];return!n||n.type==="element"}function LP(e){const r=Zt(e,-1,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&Rv(r.value.charAt(0)))&&!(r.type==="element"&&(r.tagName==="meta"||r.tagName==="link"||r.tagName==="script"||r.tagName==="style"||r.tagName==="template"))}function OP(e,r,n){const s=tA(n,r),o=Zt(e,-1,!0);return n&&s&&s.type==="element"&&s.tagName==="colgroup"&&Dv(s,n.children.indexOf(s),n)?!1:!!(o&&o.type==="element"&&o.tagName==="col")}function BP(e,r,n){const s=tA(n,r),o=Zt(e,-1);return n&&s&&s.type==="element"&&(s.tagName==="thead"||s.tagName==="tbody")&&Dv(s,n.children.indexOf(s),n)?!1:!!(o&&o.type==="element"&&o.tagName==="tr")}const Ed={name:[[`
383
+ \f\r &/=>`.split(""),`
384
+ \f\r "&'/=>\``.split("")],[`\0
385
+ \f\r "&'/<=>`.split(""),`\0
386
+ \f\r "&'/<=>\``.split("")]],unquoted:[[`
387
+ \f\r &>`.split(""),`\0
388
+ \f\r "&'<=>\``.split("")],[`\0
389
+ \f\r "&'<=>\``.split(""),`\0
390
+ \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function NP(e,r,n,s){const o=s.schema,u=o.space==="svg"?!1:s.settings.omitOptionalTags;let f=o.space==="svg"?s.settings.closeEmptyElements:s.settings.voids.includes(e.tagName.toLowerCase());const l=[];let c;o.space==="html"&&e.tagName==="svg"&&(s.schema=XE);const h=IP(s,e.properties),m=s.all(o.space==="html"&&e.tagName==="template"?e.content:e);return s.schema=o,m&&(f=!1),(h||!u||!DP(e,r,n))&&(l.push("<",e.tagName,h?" "+h:""),f&&(o.space==="svg"||s.settings.closeSelfClosing)&&(c=h.charAt(h.length-1),(!s.settings.tightSelfClosing||c==="/"||c&&c!=='"'&&c!=="'")&&l.push(" "),l.push("/")),l.push(">")),l.push(m),!f&&(!u||!Dv(e,r,n))&&l.push("</"+e.tagName+">"),l.join("")}function IP(e,r){const n=[];let s=-1,o;if(r){for(o in r)if(r[o]!==null&&r[o]!==void 0){const u=PP(e,o,r[o]);u&&n.push(u)}}for(;++s<n.length;){const u=e.settings.tightAttributes?n[s].charAt(n[s].length-1):void 0;s!==n.length-1&&u!=='"'&&u!=="'"&&(n[s]+=" ")}return n.join("")}function PP(e,r,n){const s=F5(e.schema,r),o=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,u=e.settings.allowDangerousCharacters?0:1;let f=e.quote,l;if(s.overloadedBoolean&&(n===s.attribute||n==="")?n=!0:(s.boolean||s.overloadedBoolean)&&(typeof n!="string"||n===s.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const c=pa(s.attribute,Object.assign({},e.settings.characterReferences,{subset:Ed.name[o][u]}));return n===!0||(n=Array.isArray(n)?(s.commaSeparated?hP:fP)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(l=pa(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Ed.unquoted[o][u]}))),l!==n&&(e.settings.quoteSmart&&db(n,f)>db(n,e.alternative)&&(f=e.alternative),l=f+pa(n,Object.assign({},e.settings.characterReferences,{subset:(f==="'"?Ed.single:Ed.double)[o][u],attribute:!0}))+f),c+(l&&"="+l))}const jP=["<","&"];function iA(e,r,n,s){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:pa(e.value,Object.assign({},s.settings.characterReferences,{subset:jP}))}function UP(e,r,n,s){return s.settings.allowDangerousHtml?e.value:iA(e,r,n,s)}function FP(e,r,n,s){return s.all(e)}const HP=G5("type",{invalid:VP,unknown:qP,handlers:{comment:uP,doctype:dP,element:NP,raw:UP,root:FP,text:iA}});function VP(e){throw new Error("Expected node, not `"+e+"`")}function qP(e){const r=e;throw new Error("Cannot compile unknown node `"+r.type+"`")}const GP={},zP={},YP=[];function WP(e,r){const n=GP,s=n.quote||'"',o=s==='"'?"'":'"';if(s!=='"'&&s!=="'")throw new Error("Invalid quote `"+s+"`, expected `'` or `\"`");return{one:KP,all:QP,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||B5,characterReferences:n.characterReferences||zP,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?XE:q5,quote:s,alternative:o}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function KP(e,r,n){return HP(e,r,n,this)}function QP(e){const r=[],n=e&&e.children||YP;let s=-1;for(;++s<n.length;)r[s]=this.one(n[s],s,e);return r.join("")}function $P(e){return Array.isArray(e)?e:[e]}function Nh(e,r=!1){var u;const n=e.split(/(\r?\n)/g);let s=0;const o=[];for(let f=0;f<n.length;f+=2){const l=r?n[f]+(n[f+1]||""):n[f];o.push([l,s]),s+=n[f].length,s+=((u=n[f+1])==null?void 0:u.length)||0}return o}function Mv(e){return!e||["plaintext","txt","text","plain"].includes(e)}function sA(e){return e==="ansi"||Mv(e)}function kv(e){return e==="none"}function oA(e){return kv(e)}function aA(e,r){var s;if(!r)return e;e.properties||(e.properties={}),(s=e.properties).class||(s.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(r)?r:r.split(/\s+/g);for(const o of n)o&&!e.properties.class.includes(o)&&e.properties.class.push(o);return e}function JP(e,r){let n=0;const s=[];for(const o of r)o>n&&s.push({...e,content:e.content.slice(n,o),offset:e.offset+n}),n=o;return n<e.content.length&&s.push({...e,content:e.content.slice(n),offset:e.offset+n}),s}function ZP(e,r){const n=Array.from(r instanceof Set?r:new Set(r)).sort((s,o)=>s-o);return n.length?e.map(s=>s.flatMap(o=>{const u=n.filter(f=>o.offset<f&&f<o.offset+o.content.length).map(f=>f-o.offset).sort((f,l)=>f-l);return u.length?JP(o,u):o})):e}async function lA(e){return Promise.resolve(typeof e=="function"?e():e).then(r=>r.default||r)}function oh(e,r){const n=typeof e=="string"?{}:{...e.colorReplacements},s=typeof e=="string"?e:e.name;for(const[o,u]of Object.entries((r==null?void 0:r.colorReplacements)||{}))typeof u=="string"?n[o]=u:o===s&&Object.assign(n,u);return n}function eo(e,r){return e&&((r==null?void 0:r[e==null?void 0:e.toLowerCase()])||e)}function cA(e){const r={};return e.color&&(r.color=e.color),e.bgColor&&(r["background-color"]=e.bgColor),e.fontStyle&&(e.fontStyle&Si.Italic&&(r["font-style"]="italic"),e.fontStyle&Si.Bold&&(r["font-weight"]="bold"),e.fontStyle&Si.Underline&&(r["text-decoration"]="underline")),r}function XP(e){return typeof e=="string"?e:Object.entries(e).map(([r,n])=>`${r}:${n}`).join(";")}function e3(e){const r=Nh(e,!0).map(([o])=>o);function n(o){if(o===e.length)return{line:r.length-1,character:r[r.length-1].length};let u=o,f=0;for(const l of r){if(u<l.length)break;u-=l.length,f++}return{line:f,character:u}}function s(o,u){let f=0;for(let l=0;l<o;l++)f+=r[l].length;return f+=u,f}return{lines:r,indexToPos:n,posToIndex:s}}class br extends Error{constructor(r){super(r),this.name="ShikiError"}}const uA=new WeakMap;function Ih(e,r){uA.set(e,r)}function vc(e){return uA.get(e)}class Oa{constructor(...r){_e(this,"_stacks",{});_e(this,"lang");if(r.length===2){const[n,s]=r;this.lang=s,this._stacks=n}else{const[n,s,o]=r;this.lang=s,this._stacks={[o]:n}}}get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(r,n){return new Oa(Object.fromEntries($P(n).map(s=>[s,wg])),r)}getInternalStack(r=this.theme){return this._stacks[r]}get scopes(){return mb(this._stacks[this.theme])}getScopes(r=this.theme){return mb(this._stacks[r])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.scopes}}}function mb(e){const r=[],n=new Set;function s(o){var f;if(n.has(o))return;n.add(o);const u=(f=o==null?void 0:o.nameScopesList)==null?void 0:f.scopeName;u&&r.push(u),o.parent&&s(o.parent)}return s(e),r}function t3(e,r){if(!(e instanceof Oa))throw new br("Invalid grammar state");return e.getInternalStack(r)}function r3(){const e=new WeakMap;function r(n){if(!e.has(n.meta)){let s=function(f){if(typeof f=="number"){if(f<0||f>n.source.length)throw new br(`Invalid decoration offset: ${f}. Code length: ${n.source.length}`);return{...o.indexToPos(f),offset:f}}else{const l=o.lines[f.line];if(l===void 0)throw new br(`Invalid decoration position ${JSON.stringify(f)}. Lines length: ${o.lines.length}`);if(f.character<0||f.character>l.length)throw new br(`Invalid decoration position ${JSON.stringify(f)}. Line ${f.line} length: ${l.length}`);return{...f,offset:o.posToIndex(f.line,f.character)}}};const o=e3(n.source),u=(n.options.decorations||[]).map(f=>({...f,start:s(f.start),end:s(f.end)}));n3(u),e.set(n.meta,{decorations:u,converter:o,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){var f;if(!((f=this.options.decorations)!=null&&f.length))return;const o=r(this).decorations.flatMap(l=>[l.start.offset,l.end.offset]);return ZP(n,o)},code(n){var m;if(!((m=this.options.decorations)!=null&&m.length))return;const s=r(this),o=Array.from(n.children).filter(p=>p.type==="element"&&p.tagName==="span");if(o.length!==s.converter.lines.length)throw new br(`Number of lines in code element (${o.length}) does not match the number of lines in the source (${s.converter.lines.length}). Failed to apply decorations.`);function u(p,y,x,A){const w=o[p];let v="",S=-1,g=-1;if(y===0&&(S=0),x===0&&(g=0),x===Number.POSITIVE_INFINITY&&(g=w.children.length),S===-1||g===-1)for(let T=0;T<w.children.length;T++)v+=dA(w.children[T]),S===-1&&v.length===y&&(S=T+1),g===-1&&v.length===x&&(g=T+1);if(S===-1)throw new br(`Failed to find start index for decoration ${JSON.stringify(A.start)}`);if(g===-1)throw new br(`Failed to find end index for decoration ${JSON.stringify(A.end)}`);const _=w.children.slice(S,g);if(!A.alwaysWrap&&_.length===w.children.length)l(w,A,"line");else if(!A.alwaysWrap&&_.length===1&&_[0].type==="element")l(_[0],A,"token");else{const T={type:"element",tagName:"span",properties:{},children:_};l(T,A,"wrapper"),w.children.splice(S,_.length,T)}}function f(p,y){o[p]=l(o[p],y,"line")}function l(p,y,x){var v;const A=y.properties||{},w=y.transform||(S=>S);return p.tagName=y.tagName||"span",p.properties={...p.properties,...A,class:p.properties.class},(v=y.properties)!=null&&v.class&&aA(p,y.properties.class),p=w(p,x)||p,p}const c=[],h=s.decorations.sort((p,y)=>y.start.offset-p.start.offset);for(const p of h){const{start:y,end:x}=p;if(y.line===x.line)u(y.line,y.character,x.character,p);else if(y.line<x.line){u(y.line,y.character,Number.POSITIVE_INFINITY,p);for(let A=y.line+1;A<x.line;A++)c.unshift(()=>f(A,p));u(x.line,0,x.character,p)}}c.forEach(p=>p())}}}function n3(e){for(let r=0;r<e.length;r++){const n=e[r];if(n.start.offset>n.end.offset)throw new br(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let s=r+1;s<e.length;s++){const o=e[s],u=n.start.offset<o.start.offset&&o.start.offset<n.end.offset,f=n.start.offset<o.end.offset&&o.end.offset<n.end.offset,l=o.start.offset<n.start.offset&&n.start.offset<o.end.offset,c=o.start.offset<n.end.offset&&n.end.offset<o.end.offset;if(u||f||l||c){if(f&&f||l&&c)continue;throw new br(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(o.start)} intersect.`)}}}}function dA(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(dA).join(""):""}const i3=[r3()];function ah(e){return[...e.transformers||[],...i3]}var to=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Im={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",9:"strikethrough"};function s3(e,r){const n=e.indexOf("\x1B[",r);if(n!==-1){const s=e.indexOf("m",n);return{sequence:e.substring(n+2,s).split(";"),startPosition:n,position:s+1}}return{position:e.length}}function gb(e,r){let n=1;const s=e[r+n++];let o;if(s==="2"){const u=[e[r+n++],e[r+n++],e[r+n]].map(f=>Number.parseInt(f));u.length===3&&!u.some(f=>Number.isNaN(f))&&(o={type:"rgb",rgb:u})}else if(s==="5"){const u=Number.parseInt(e[r+n]);Number.isNaN(u)||(o={type:"table",index:Number(u)})}return[n,o]}function o3(e){const r=[];for(let n=0;n<e.length;n++){const s=e[n],o=Number.parseInt(s);if(!Number.isNaN(o))if(o===0)r.push({type:"resetAll"});else if(o<=9)Im[o]&&r.push({type:"setDecoration",value:Im[o]});else if(o<=29){const u=Im[o-20];u&&r.push({type:"resetDecoration",value:u})}else if(o<=37)r.push({type:"setForegroundColor",value:{type:"named",name:to[o-30]}});else if(o===38){const[u,f]=gb(e,n);f&&r.push({type:"setForegroundColor",value:f}),n+=u}else if(o===39)r.push({type:"resetForegroundColor"});else if(o<=47)r.push({type:"setBackgroundColor",value:{type:"named",name:to[o-40]}});else if(o===48){const[u,f]=gb(e,n);f&&r.push({type:"setBackgroundColor",value:f}),n+=u}else o===49?r.push({type:"resetBackgroundColor"}):o>=90&&o<=97?r.push({type:"setForegroundColor",value:{type:"named",name:to[o-90+8]}}):o>=100&&o<=107&&r.push({type:"setBackgroundColor",value:{type:"named",name:to[o-100+8]}})}return r}function a3(){let e=null,r=null,n=new Set;return{parse(s){const o=[];let u=0;do{const f=s3(s,u),l=f.sequence?s.substring(u,f.startPosition):s.substring(u);if(l.length>0&&o.push({value:l,foreground:e,background:r,decorations:new Set(n)}),f.sequence){const c=o3(f.sequence);for(const h of c)h.type==="resetAll"?(e=null,r=null,n.clear()):h.type==="resetForegroundColor"?e=null:h.type==="resetBackgroundColor"?r=null:h.type==="resetDecoration"&&n.delete(h.value);for(const h of c)h.type==="setForegroundColor"?e=h.value:h.type==="setBackgroundColor"?r=h.value:h.type==="setDecoration"&&n.add(h.value)}u=f.position}while(u<s.length);return o}}}var l3={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 c3(e=l3){function r(l){return e[l]}function n(l){return`#${l.map(c=>Math.max(0,Math.min(c,255)).toString(16).padStart(2,"0")).join("")}`}let s;function o(){if(s)return s;s=[];for(let h=0;h<to.length;h++)s.push(r(to[h]));let l=[0,95,135,175,215,255];for(let h=0;h<6;h++)for(let m=0;m<6;m++)for(let p=0;p<6;p++)s.push(n([l[h],l[m],l[p]]));let c=8;for(let h=0;h<24;h++,c+=10)s.push(n([c,c,c]));return s}function u(l){return o()[l]}function f(l){switch(l.type){case"named":return r(l.name);case"rgb":return n(l.rgb);case"table":return u(l.index)}}return{value:f}}function u3(e,r,n){const s=oh(e,n),o=Nh(r),u=c3(Object.fromEntries(to.map(l=>{var c;return[l,(c=e.colors)==null?void 0:c[`terminal.ansi${l[0].toUpperCase()}${l.substring(1)}`]]}))),f=a3();return o.map(l=>f.parse(l[0]).map(c=>{let h,m;c.decorations.has("reverse")?(h=c.background?u.value(c.background):e.bg,m=c.foreground?u.value(c.foreground):e.fg):(h=c.foreground?u.value(c.foreground):e.fg,m=c.background?u.value(c.background):void 0),h=eo(h,s),m=eo(m,s),c.decorations.has("dim")&&(h=d3(h));let p=Si.None;return c.decorations.has("bold")&&(p|=Si.Bold),c.decorations.has("italic")&&(p|=Si.Italic),c.decorations.has("underline")&&(p|=Si.Underline),{content:c.value,offset:l[1],color:h,bgColor:m,fontStyle:p}}))}function d3(e){const r=e.match(/#([0-9a-f]{3})([0-9a-f]{3})?([0-9a-f]{2})?/);if(r)if(r[3]){const s=Math.round(Number.parseInt(r[3],16)/2).toString(16).padStart(2,"0");return`#${r[1]}${r[2]}${s}`}else return r[2]?`#${r[1]}${r[2]}80`:`#${Array.from(r[1]).map(s=>`${s}${s}`).join("")}80`;const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function Lv(e,r,n={}){const{lang:s="text",theme:o=e.getLoadedThemes()[0]}=n;if(Mv(s)||kv(o))return Nh(r).map(c=>[{content:c[0],offset:c[1]}]);const{theme:u,colorMap:f}=e.setTheme(o);if(s==="ansi")return u3(u,r,n);const l=e.getLanguage(s);if(n.grammarState){if(n.grammarState.lang!==l.name)throw new Ci(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${l.name}"`);if(!n.grammarState.themes.includes(u.name))throw new Ci(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${u.name}"`)}return f3(r,l,u,f,n)}function h3(...e){if(e.length===2)return vc(e[1]);const[r,n,s={}]=e,{lang:o="text",theme:u=r.getLoadedThemes()[0]}=s;if(Mv(o)||kv(u))throw new Ci("Plain language does not have grammar state");if(o==="ansi")throw new Ci("ANSI language does not have grammar state");const{theme:f,colorMap:l}=r.setTheme(u),c=r.getLanguage(o);return new Oa(lh(n,c,f,l,s).stateStack,c.name,f.name)}function f3(e,r,n,s,o){const u=lh(e,r,n,s,o),f=new Oa(lh(e,r,n,s,o).stateStack,r.name,n.name);return Ih(u.tokens,f),u.tokens}function lh(e,r,n,s,o){const u=oh(n,o),{tokenizeMaxLineLength:f=0,tokenizeTimeLimit:l=500}=o,c=Nh(e);let h=o.grammarState?t3(o.grammarState,n.name)??wg:o.grammarContextCode!=null?lh(o.grammarContextCode,r,n,s,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:wg,m=[];const p=[];for(let y=0,x=c.length;y<x;y++){const[A,w]=c[y];if(A===""){m=[],p.push([]);continue}if(f>0&&A.length>=f){m=[],p.push([{content:A,offset:w,color:"",fontStyle:0}]);continue}let v,S,g;o.includeExplanation&&(v=r.tokenizeLine(A,h),S=v.tokens,g=0);const _=r.tokenizeLine2(A,h,l),T=_.tokens.length/2;for(let M=0;M<T;M++){const k=_.tokens[2*M],L=M+1<T?_.tokens[2*M+2]:A.length;if(k===L)continue;const D=_.tokens[2*M+1],P=eo(s[Sa.getForeground(D)],u),K=Sa.getFontStyle(D),$={content:A.substring(k,L),offset:w+k,color:P,fontStyle:K};if(o.includeExplanation){const z=[];if(o.includeExplanation!=="scopeName")for(const F of n.settings){let ee;switch(typeof F.scope){case"string":ee=F.scope.split(/,/).map(Y=>Y.trim());break;case"object":ee=F.scope;break;default:continue}z.push({settings:F,selectors:ee.map(Y=>Y.split(/ /))})}$.explanation=[];let W=0;for(;k+W<L;){const F=S[g],ee=A.substring(F.startIndex,F.endIndex);W+=ee.length,$.explanation.push({content:ee,scopes:o.includeExplanation==="scopeName"?p3(F.scopes):m3(z,F.scopes)}),g+=1}}m.push($)}p.push(m),m=[],h=_.ruleStack}return{tokens:p,stateStack:h}}function p3(e){return e.map(r=>({scopeName:r}))}function m3(e,r){const n=[];for(let s=0,o=r.length;s<o;s++){const u=r[s];n[s]={scopeName:u,themeMatches:v3(e,u,r.slice(0,s))}}return n}function vb(e,r){return e===r||r.substring(0,e.length)===e&&r[e.length]==="."}function g3(e,r,n){if(!vb(e[e.length-1],r))return!1;let s=e.length-2,o=n.length-1;for(;s>=0&&o>=0;)vb(e[s],n[o])&&(s-=1),o-=1;return s===-1}function v3(e,r,n){const s=[];for(const{selectors:o,settings:u}of e)for(const f of o)if(g3(f,r,n)){s.push(u);break}return s}function hA(e,r,n){const s=Object.entries(n.themes).filter(c=>c[1]).map(c=>({color:c[0],theme:c[1]})),o=s.map(c=>{const h=Lv(e,r,{...n,theme:c.theme}),m=vc(h),p=typeof c.theme=="string"?c.theme:c.theme.name;return{tokens:h,state:m,theme:p}}),u=_3(...o.map(c=>c.tokens)),f=u[0].map((c,h)=>c.map((m,p)=>{const y={content:m.content,variants:{},offset:m.offset};return"includeExplanation"in n&&n.includeExplanation&&(y.explanation=m.explanation),u.forEach((x,A)=>{const{content:w,explanation:v,offset:S,...g}=x[h][p];y.variants[s[A].color]=g}),y})),l=o[0].state?new Oa(Object.fromEntries(o.map(c=>{var h;return[c.theme,(h=c.state)==null?void 0:h.getInternalStack(c.theme)]})),o[0].state.lang):void 0;return l&&Ih(f,l),f}function _3(...e){const r=e.map(()=>[]),n=e.length;for(let s=0;s<e[0].length;s++){const o=e.map(c=>c[s]),u=r.map(()=>[]);r.forEach((c,h)=>c.push(u[h]));const f=o.map(()=>0),l=o.map(c=>c[0]);for(;l.every(c=>c);){const c=Math.min(...l.map(h=>h.content.length));for(let h=0;h<n;h++){const m=l[h];m.content.length===c?(u[h].push(m),f[h]+=1,l[h]=o[h][f[h]]):(u[h].push({...m,content:m.content.slice(0,c)}),l[h]={...m,content:m.content.slice(c),offset:m.offset+c})}}}return r}function ch(e,r,n){let s,o,u,f,l,c;if("themes"in n){const{defaultColor:h="light",cssVariablePrefix:m="--shiki-"}=n,p=Object.entries(n.themes).filter(v=>v[1]).map(v=>({color:v[0],theme:v[1]})).sort((v,S)=>v.color===h?-1:S.color===h?1:0);if(p.length===0)throw new Ci("`themes` option must not be empty");const y=hA(e,r,n);if(c=vc(y),h&&!p.find(v=>v.color===h))throw new Ci(`\`themes\` option must contain the defaultColor key \`${h}\``);const x=p.map(v=>e.getTheme(v.theme)),A=p.map(v=>v.color);u=y.map(v=>v.map(S=>y3(S,A,m,h))),c&&Ih(u,c);const w=p.map(v=>oh(v.theme,n));o=p.map((v,S)=>(S===0&&h?"":`${m+v.color}:`)+(eo(x[S].fg,w[S])||"inherit")).join(";"),s=p.map((v,S)=>(S===0&&h?"":`${m+v.color}-bg:`)+(eo(x[S].bg,w[S])||"inherit")).join(";"),f=`shiki-themes ${x.map(v=>v.name).join(" ")}`,l=h?void 0:[o,s].join(";")}else if("theme"in n){const h=oh(n.theme,n);u=Lv(e,r,n);const m=e.getTheme(n.theme);s=eo(m.bg,h),o=eo(m.fg,h),f=m.name,c=vc(u)}else throw new Ci("Invalid options, either `theme` or `themes` must be provided");return{tokens:u,fg:o,bg:s,themeName:f,rootStyle:l,grammarState:c}}function y3(e,r,n,s){const o={content:e.content,explanation:e.explanation,offset:e.offset},u=r.map(c=>cA(e.variants[c])),f=new Set(u.flatMap(c=>Object.keys(c))),l={};return u.forEach((c,h)=>{for(const m of f){const p=c[m]||"inherit";if(h===0&&s)l[m]=p;else{const y=m==="color"?"":m==="background-color"?"-bg":`-${m}`,x=n+r[h]+(m==="color"?"":y);l[x]=p}}}),o.htmlStyle=l,o}function uh(e,r,n,s={meta:{},options:n,codeToHast:(o,u)=>uh(e,o,u),codeToTokens:(o,u)=>ch(e,o,u)}){var x,A;let o=r;for(const w of ah(n))o=((x=w.preprocess)==null?void 0:x.call(s,o,n))||o;let{tokens:u,fg:f,bg:l,themeName:c,rootStyle:h,grammarState:m}=ch(e,o,n);const{mergeWhitespaces:p=!0}=n;p===!0?u=b3(u):p==="never"&&(u=C3(u));const y={...s,get source(){return o}};for(const w of ah(n))u=((A=w.tokens)==null?void 0:A.call(y,u))||u;return S3(u,{...n,fg:f,bg:l,themeName:c,rootStyle:h},y,m)}function S3(e,r,n,s=vc(e)){var A,w,v;const o=ah(r),u=[],f={type:"root",children:[]},{structure:l="classic",tabindex:c="0"}=r;let h={type:"element",tagName:"pre",properties:{class:`shiki ${r.themeName||""}`,style:r.rootStyle||`background-color:${r.bg};color:${r.fg}`,...c!==!1&&c!=null?{tabindex:c.toString()}:{},...Object.fromEntries(Array.from(Object.entries(r.meta||{})).filter(([S])=>!S.startsWith("_")))},children:[]},m={type:"element",tagName:"code",properties:{},children:u};const p=[],y={...n,structure:l,addClassToHast:aA,get source(){return n.source},get tokens(){return e},get options(){return r},get root(){return f},get pre(){return h},get code(){return m},get lines(){return p}};if(e.forEach((S,g)=>{var M,k;g&&(l==="inline"?f.children.push({type:"element",tagName:"br",properties:{},children:[]}):l==="classic"&&u.push({type:"text",value:`
391
+ `}));let _={type:"element",tagName:"span",properties:{class:"line"},children:[]},T=0;for(const L of S){let D={type:"element",tagName:"span",properties:{...L.htmlAttrs},children:[{type:"text",value:L.content}]};L.htmlStyle;const P=XP(L.htmlStyle||cA(L));P&&(D.properties.style=P);for(const K of o)D=((M=K==null?void 0:K.span)==null?void 0:M.call(y,D,g+1,T,_,L))||D;l==="inline"?f.children.push(D):l==="classic"&&_.children.push(D),T+=L.content.length}if(l==="classic"){for(const L of o)_=((k=L==null?void 0:L.line)==null?void 0:k.call(y,_,g+1))||_;p.push(_),u.push(_)}}),l==="classic"){for(const S of o)m=((A=S==null?void 0:S.code)==null?void 0:A.call(y,m))||m;h.children.push(m);for(const S of o)h=((w=S==null?void 0:S.pre)==null?void 0:w.call(y,h))||h;f.children.push(h)}let x=f;for(const S of o)x=((v=S==null?void 0:S.root)==null?void 0:v.call(y,x))||x;return s&&Ih(x,s),x}function b3(e){return e.map(r=>{const n=[];let s="",o=0;return r.forEach((u,f)=>{const c=!(u.fontStyle&&u.fontStyle&Si.Underline);c&&u.content.match(/^\s+$/)&&r[f+1]?(o||(o=u.offset),s+=u.content):s?(c?n.push({...u,offset:o,content:s+u.content}):n.push({content:s,offset:o},u),o=0,s=""):n.push(u)}),n})}function C3(e){return e.map(r=>r.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const s=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!s)return n;const[,o,u,f]=s;if(!o&&!f)return n;const l=[{...n,offset:n.offset+o.length,content:u}];return o&&l.unshift({content:o,offset:n.offset}),f&&l.push({content:f,offset:n.offset+o.length+u.length}),l}))}function w3(e,r,n){var u;const s={meta:{},options:n,codeToHast:(f,l)=>uh(e,f,l),codeToTokens:(f,l)=>ch(e,f,l)};let o=WP(uh(e,r,n,s));for(const f of ah(n))o=((u=f.postprocess)==null?void 0:u.call(s,o,n))||o;return o}const _b={light:"#333333",dark:"#bbbbbb"},yb={light:"#fffffe",dark:"#1e1e1e"},Sb="__shiki_resolved";function Ov(e){var l,c,h,m,p;if(e!=null&&e[Sb])return e;const r={...e};r.tokenColors&&!r.settings&&(r.settings=r.tokenColors,delete r.tokenColors),r.type||(r.type="dark"),r.colorReplacements={...r.colorReplacements},r.settings||(r.settings=[]);let{bg:n,fg:s}=r;if(!n||!s){const y=r.settings?r.settings.find(x=>!x.name&&!x.scope):void 0;(l=y==null?void 0:y.settings)!=null&&l.foreground&&(s=y.settings.foreground),(c=y==null?void 0:y.settings)!=null&&c.background&&(n=y.settings.background),!s&&((h=r==null?void 0:r.colors)!=null&&h["editor.foreground"])&&(s=r.colors["editor.foreground"]),!n&&((m=r==null?void 0:r.colors)!=null&&m["editor.background"])&&(n=r.colors["editor.background"]),s||(s=r.type==="light"?_b.light:_b.dark),n||(n=r.type==="light"?yb.light:yb.dark),r.fg=s,r.bg=n}r.settings[0]&&r.settings[0].settings&&!r.settings[0].scope||r.settings.unshift({settings:{foreground:r.fg,background:r.bg}});let o=0;const u=new Map;function f(y){var A;if(u.has(y))return u.get(y);o+=1;const x=`#${o.toString(16).padStart(8,"0").toLowerCase()}`;return(A=r.colorReplacements)!=null&&A[`#${x}`]?f(y):(u.set(y,x),x)}r.settings=r.settings.map(y=>{var v,S;const x=((v=y.settings)==null?void 0:v.foreground)&&!y.settings.foreground.startsWith("#"),A=((S=y.settings)==null?void 0:S.background)&&!y.settings.background.startsWith("#");if(!x&&!A)return y;const w={...y,settings:{...y.settings}};if(x){const g=f(y.settings.foreground);r.colorReplacements[g]=y.settings.foreground,w.settings.foreground=g}if(A){const g=f(y.settings.background);r.colorReplacements[g]=y.settings.background,w.settings.background=g}return w});for(const y of Object.keys(r.colors||{}))if((y==="editor.foreground"||y==="editor.background"||y.startsWith("terminal.ansi"))&&!((p=r.colors[y])!=null&&p.startsWith("#"))){const x=f(r.colors[y]);r.colorReplacements[x]=r.colors[y],r.colors[y]=x}return Object.defineProperty(r,Sb,{enumerable:!1,writable:!1,value:!0}),r}async function fA(e){return Array.from(new Set((await Promise.all(e.filter(r=>!sA(r)).map(async r=>await lA(r).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function pA(e){return(await Promise.all(e.map(async n=>oA(n)?null:Ov(await lA(n))))).filter(n=>!!n)}class x3 extends O5{constructor(n,s,o,u={}){super(n);_e(this,"_resolvedThemes",new Map);_e(this,"_resolvedGrammars",new Map);_e(this,"_langMap",new Map);_e(this,"_langGraph",new Map);_e(this,"_textmateThemeCache",new WeakMap);_e(this,"_loadedThemesCache",null);_e(this,"_loadedLanguagesCache",null);this._resolver=n,this._themes=s,this._langs=o,this._alias=u,this._themes.map(f=>this.loadTheme(f)),this.loadLanguages(this._langs)}getTheme(n){return typeof n=="string"?this._resolvedThemes.get(n):this.loadTheme(n)}loadTheme(n){const s=Ov(n);return s.name&&(this._resolvedThemes.set(s.name,s),this._loadedThemesCache=null),s}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(n){let s=this._textmateThemeCache.get(n);s||(s=th.createFromRawTheme(n),this._textmateThemeCache.set(n,s)),this._syncRegistry.setTheme(s)}getGrammar(n){if(this._alias[n]){const s=new Set([n]);for(;this._alias[n];){if(n=this._alias[n],s.has(n))throw new br(`Circular alias \`${Array.from(s).join(" -> ")} -> ${n}\``);s.add(n)}}return this._resolvedGrammars.get(n)}loadLanguage(n){var f,l,c,h;if(this.getGrammar(n.name))return;const s=new Set([...this._langMap.values()].filter(m=>{var p;return(p=m.embeddedLangsLazy)==null?void 0:p.includes(n.name)}));this._resolver.addLanguage(n);const o={balancedBracketSelectors:n.balancedBracketSelectors||["*"],unbalancedBracketSelectors:n.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(n.scopeName,n);const u=this.loadGrammarWithConfiguration(n.scopeName,1,o);if(u.name=n.name,this._resolvedGrammars.set(n.name,u),n.aliases&&n.aliases.forEach(m=>{this._alias[m]=n.name}),this._loadedLanguagesCache=null,s.size)for(const m of s)this._resolvedGrammars.delete(m.name),this._loadedLanguagesCache=null,(l=(f=this._syncRegistry)==null?void 0:f._injectionGrammars)==null||l.delete(m.scopeName),(h=(c=this._syncRegistry)==null?void 0:c._grammars)==null||h.delete(m.scopeName),this.loadLanguage(this._langMap.get(m.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(n){for(const u of n)this.resolveEmbeddedLanguages(u);const s=Array.from(this._langGraph.entries()),o=s.filter(([u,f])=>!f);if(o.length){const u=s.filter(([f,l])=>{var c;return l&&((c=l.embeddedLangs)==null?void 0:c.some(h=>o.map(([m])=>m).includes(h)))}).filter(f=>!o.includes(f));throw new br(`Missing languages ${o.map(([f])=>`\`${f}\``).join(", ")}, required by ${u.map(([f])=>`\`${f}\``).join(", ")}`)}for(const[u,f]of s)this._resolver.addLanguage(f);for(const[u,f]of s)this.loadLanguage(f)}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 s of n.embeddedLangs)this._langGraph.set(s,this._langMap.get(s))}}class E3{constructor(r,n){_e(this,"_langs",new Map);_e(this,"_scopeToLang",new Map);_e(this,"_injections",new Map);_e(this,"_onigLib");this._onigLib={createOnigScanner:s=>r.createScanner(s),createOnigString:s=>r.createString(s)},n.forEach(s=>this.addLanguage(s))}get onigLib(){return this._onigLib}getLangRegistration(r){return this._langs.get(r)}loadGrammar(r){return this._scopeToLang.get(r)}addLanguage(r){this._langs.set(r.name,r),r.aliases&&r.aliases.forEach(n=>{this._langs.set(n,r)}),this._scopeToLang.set(r.scopeName,r),r.injectTo&&r.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(r.scopeName)})}getInjections(r){const n=r.split(".");let s=[];for(let o=1;o<=n.length;o++){const u=n.slice(0,o).join(".");s=[...s,...this._injections.get(u)||[]]}return s}}let Kl=0;function A3(e){Kl+=1,e.warnings!==!1&&Kl>=10&&Kl%10===0&&console.warn(`[Shiki] ${Kl} 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 r=!1;if(!e.engine)throw new br("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),s=(e.themes||[]).flat(1).map(Ov),o=new E3(e.engine,n),u=new x3(o,s,n,e.langAlias);let f;function l(g){v();const _=u.getGrammar(typeof g=="string"?g:g.name);if(!_)throw new br(`Language \`${g}\` not found, you may need to load it first`);return _}function c(g){if(g==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};v();const _=u.getTheme(g);if(!_)throw new br(`Theme \`${g}\` not found, you may need to load it first`);return _}function h(g){v();const _=c(g);f!==g&&(u.setTheme(_),f=g);const T=u.getColorMap();return{theme:_,colorMap:T}}function m(){return v(),u.getLoadedThemes()}function p(){return v(),u.getLoadedLanguages()}function y(...g){v(),u.loadLanguages(g.flat(1))}async function x(...g){return y(await fA(g))}function A(...g){v();for(const _ of g.flat(1))u.loadTheme(_)}async function w(...g){return v(),A(await pA(g))}function v(){if(r)throw new br("Shiki instance has been disposed")}function S(){r||(r=!0,u.dispose(),Kl-=1)}return{setTheme:h,getTheme:c,getLanguage:l,getLoadedThemes:m,getLoadedLanguages:p,loadLanguage:x,loadLanguageSync:y,loadTheme:w,loadThemeSync:A,dispose:S,[Symbol.dispose]:S}}async function T3(e={}){e.loadWasm;const[r,n,s]=await Promise.all([pA(e.themes||[]),fA(e.langs||[]),e.engine||ME(e.loadWasm||WI())]);return A3({...e,themes:r,langs:n,engine:s})}async function R3(e={}){const r=await T3(e);return{getLastGrammarState:(...n)=>h3(r,...n),codeToTokensBase:(n,s)=>Lv(r,n,s),codeToTokensWithThemes:(n,s)=>hA(r,n,s),codeToTokens:(n,s)=>ch(r,n,s),codeToHast:(n,s)=>uh(r,n,s),codeToHtml:(n,s)=>w3(r,n,s),...r,getInternalContext:()=>r}}function D3(e,r,n){let s,o,u;{const l=e;s=l.langs,o=l.themes,u=l.engine}async function f(l){function c(x){if(typeof x=="string"){if(sA(x))return[];const A=s[x];if(!A)throw new Ci(`Language \`${x}\` is not included in this bundle. You may want to load it from external source.`);return A}return x}function h(x){if(oA(x))return"none";if(typeof x=="string"){const A=o[x];if(!A)throw new Ci(`Theme \`${x}\` is not included in this bundle. You may want to load it from external source.`);return A}return x}const m=(l.themes??[]).map(x=>h(x)),p=(l.langs??[]).map(x=>c(x)),y=await R3({engine:l.engine??u(),...l,themes:m,langs:p});return{...y,loadLanguage(...x){return y.loadLanguage(...x.map(c))},loadTheme(...x){return y.loadTheme(...x.map(h))}}}return f}function M3(e){let r;async function n(s={}){if(r){const o=await r;return await Promise.all([o.loadTheme(...s.themes||[]),o.loadLanguage(...s.langs||[])]),o}else return r=e({...s,themes:s.themes||[],langs:s.langs||[]}),r}return n}function k3(e){const r=M3(e);return{getSingletonHighlighter(n){return r(n)},async codeToHtml(n,s){return(await r({langs:[s.lang],themes:"theme"in s?[s.theme]:Object.values(s.themes)})).codeToHtml(n,s)},async codeToHast(n,s){return(await r({langs:[s.lang],themes:"theme"in s?[s.theme]:Object.values(s.themes)})).codeToHast(n,s)},async codeToTokens(n,s){return(await r({langs:[s.lang],themes:"theme"in s?[s.theme]:Object.values(s.themes)})).codeToTokens(n,s)},async codeToTokensBase(n,s){return(await r({langs:[s.lang],themes:[s.theme]})).codeToTokensBase(n,s)},async codeToTokensWithThemes(n,s){return(await r({langs:[s.lang],themes:Object.values(s.themes).filter(Boolean)})).codeToTokensWithThemes(n,s)},async getLastGrammarState(n,s){return(await r({langs:[s.lang],themes:[s.theme]})).getLastGrammarState(n,s)}}}const L3=D3({langs:TI,themes:DI,engine:()=>ME(J(()=>import("./wasm-CG6Dc4jp.js"),[]))}),{codeToHtml:O3}=k3(L3),B3=new Set(["javascript","js","typescript","ts","tsx","jsx","python","py","java","kotlin","swift","go","rust","c","cpp","c++","csharp","c#","cs","html","css","scss","sass","less","json","yaml","yml","toml","xml","bash","sh","shell","zsh","powershell","ps1","sql","graphql","markdown","md","dockerfile","ruby","php","perl","lua","r","matlab","scala","groovy","haskell","elixir","vue","svelte","astro"]);function N3(e){if(!e)return"text";const r=e.toLowerCase().trim(),s={js:"javascript",ts:"typescript",py:"python",rb:"ruby","c++":"cpp","c#":"csharp",cs:"csharp",sh:"bash",shell:"bash",zsh:"bash",yml:"yaml",md:"markdown",ps1:"powershell"}[r]||r;return B3.has(s)?s:"text"}const I3=R.memo(function({code:r,language:n}){const[s,o]=R.useState(""),[u,f]=R.useState(!1),[l,c]=R.useState(!0),h=N3(n),m=n||"code";R.useEffect(()=>{let y=!1;c(!0);async function x(){try{if(h==="text")o(`<pre class="shiki"><code>${Pm(r)}</code></pre>`);else{const A=await O3(r,{lang:h,themes:{light:"github-light",dark:"github-dark"}});y||o(A)}}catch{y||o(`<pre class="shiki"><code>${Pm(r)}</code></pre>`)}finally{y||c(!1)}}return x(),()=>{y=!0}},[r,h]);const p=R.useCallback(()=>{navigator.clipboard.writeText(r),f(!0),setTimeout(()=>f(!1),2e3)},[r]);return b.jsxs("div",{className:"my-2 rounded-lg overflow-hidden border bg-zinc-50 dark:bg-zinc-900",children:[b.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 bg-zinc-100 dark:bg-zinc-800 border-b text-xs text-zinc-500 dark:text-zinc-400",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(FM,{className:"w-3 h-3","aria-hidden":"true"}),b.jsx("span",{children:m})]}),b.jsx("button",{type:"button",className:Te("flex items-center gap-1 transition-colors",u?"text-green-500":"hover:text-zinc-700 dark:hover:text-zinc-200"),onClick:p,"aria-label":u?"Copied to clipboard":"Copy code",children:u?b.jsxs(b.Fragment,{children:[b.jsx(XC,{className:"w-3 h-3","aria-hidden":"true"}),b.jsx("span",{children:"Copied"})]}):b.jsxs(b.Fragment,{children:[b.jsx(HM,{className:"w-3 h-3","aria-hidden":"true"}),b.jsx("span",{children:"Copy"})]})})]}),b.jsx("div",{className:Te("overflow-x-auto text-sm [&_.shiki]:!bg-transparent [&_.shiki]:p-3 [&_.shiki]:m-0","[&_pre]:!bg-transparent [&_code]:!bg-transparent",l&&"animate-pulse"),dangerouslySetInnerHTML:{__html:s||`<pre class="p-3"><code>${Pm(r)}</code></pre>`}})]})});function Pm(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function P3({block:e,isUserMessage:r=!1}){var n,s,o,u,f,l,c,h,m,p,y,x,A;switch(e.blockType){case"text":return b.jsx(bb,{content:e.content,isUserMessage:r});case"code":return b.jsx(I3,{code:e.content,language:(n=e.metadata)==null?void 0:n.language});case"tool":return b.jsx(j3,{toolName:(s=e.metadata)==null?void 0:s.toolName,toolInput:(o=e.metadata)==null?void 0:o.toolInput,toolOutput:(u=e.metadata)==null?void 0:u.toolOutput,toolStatus:(f=e.metadata)==null?void 0:f.toolStatus});case"thinking":return b.jsx(U3,{content:e.content});case"error":return b.jsx(F3,{content:e.content,errorCode:(l=e.metadata)==null?void 0:l.errorCode});case"status":return b.jsx(H3,{content:e.content});case"voice_input":return b.jsx(V3,{content:e.content,audioUrl:(c=e.metadata)==null?void 0:c.audioUrl,audioBase64:(h=e.metadata)==null?void 0:h.audioBase64,duration:(m=e.metadata)==null?void 0:m.duration,isUserMessage:r});case"voice_output":return b.jsx(q3,{content:e.content,audioUrl:(p=e.metadata)==null?void 0:p.audioUrl,audioBase64:(y=e.metadata)==null?void 0:y.audioBase64,messageId:(x=e.metadata)==null?void 0:x.messageId,hasAudio:(A=e.metadata)==null?void 0:A.hasAudio});default:return b.jsx(bb,{content:e.content,isUserMessage:r})}}function bb({content:e,isUserMessage:r}){const n=(u,f)=>{const l=[];let c=u,h=0;for(;c.length>0;){const m=c.match(/^`([^`]+)`/);if(m){l.push(b.jsx("code",{className:Te("px-1 py-0.5 rounded text-sm font-mono",r?"bg-primary-foreground/20":"bg-muted"),children:m[1]},`${f}-${h++}`)),c=c.slice(m[0].length);continue}const p=c.match(/^(\*\*|__)(.+?)\1/);if(p!=null&&p[2]){l.push(b.jsx("strong",{className:"font-semibold",children:n(p[2],`${f}-b${h}`)},`${f}-${h++}`)),c=c.slice(p[0].length);continue}const y=c.match(/^(\*|_)(?!\1)(.+?)\1(?!\1)/);if(y!=null&&y[2]){l.push(b.jsx("em",{className:"italic",children:n(y[2],`${f}-i${h}`)},`${f}-${h++}`)),c=c.slice(y[0].length);continue}const x=c.match(/^\[([^\]]+)\]\(([^)]+)\)/);if(x){l.push(b.jsx("a",{href:x[2],target:"_blank",rel:"noopener noreferrer",className:Te("underline underline-offset-2 hover:opacity-80",r?"text-primary-foreground":"text-primary"),children:x[1]},`${f}-${h++}`)),c=c.slice(x[0].length);continue}const A=c.slice(1).search(/[`*_[]/);if(A===-1){l.push(b.jsx("span",{children:c},`${f}-${h++}`));break}else{const w=c.slice(0,A+1);l.push(b.jsx("span",{children:w},`${f}-${h++}`)),c=c.slice(A+1)}}return l},o=(e||"").replace(/^\n+/,"").replace(/\n+$/,"").split(`
392
+ `);return b.jsx("div",{className:"whitespace-pre-wrap break-words",children:o.map((u,f)=>b.jsx("p",{className:Te("m-0",u===""?"h-4":void 0),children:n(u,`line-${f}`)},f))})}function j3({toolName:e,toolInput:r,toolOutput:n,toolStatus:s}){const[o,u]=R.useState(!1),f=e?e.replace(/_/g," ").replace(/\b\w/g,l=>l.toUpperCase()):"Tool";return b.jsxs("div",{className:"my-2 rounded-lg overflow-hidden border bg-orange-500/10",children:[b.jsxs("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-2 text-sm hover:bg-orange-500/5 transition-colors",onClick:()=>u(!o),children:[s==="running"&&b.jsx(wc,{className:"w-4 h-4 animate-spin text-blue-500 flex-shrink-0"}),s==="completed"&&b.jsx(e1,{className:"w-4 h-4 text-green-500 flex-shrink-0"}),s==="failed"&&b.jsx(vh,{className:"w-4 h-4 text-red-500 flex-shrink-0"}),!s&&b.jsx(ZM,{className:"w-4 h-4 flex-shrink-0"}),b.jsx("span",{className:"font-medium flex-1 text-left",children:f}),o?b.jsx(Gg,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}):b.jsx(gh,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"})]}),o&&b.jsxs("div",{className:"px-3 pb-3 space-y-3",children:[r&&b.jsxs("div",{children:[b.jsx("span",{className:"text-xs text-muted-foreground",children:"Input:"}),b.jsx("div",{className:"mt-1 p-2 rounded bg-muted/50 max-h-48 overflow-auto",children:b.jsx("pre",{className:"whitespace-pre-wrap text-xs font-mono",children:r})})]}),n&&b.jsxs("div",{children:[b.jsx("span",{className:"text-xs text-muted-foreground",children:"Output:"}),b.jsx("div",{className:"mt-1 p-2 rounded bg-background/50 max-h-48 overflow-auto",children:b.jsx("pre",{className:"whitespace-pre-wrap text-xs font-mono",children:n})})]})]})]})}function U3({content:e}){const[r,n]=R.useState(!1);return b.jsxs("div",{className:"my-2 rounded-lg overflow-hidden border border-dashed bg-purple-500/5",children:[b.jsxs("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-muted-foreground hover:bg-purple-500/5 transition-colors",onClick:()=>n(!r),children:[b.jsx(NM,{className:"w-4 h-4 text-purple-500 flex-shrink-0"}),b.jsx("span",{className:"flex-1 text-left italic",children:"Thinking..."}),r?b.jsx(Gg,{className:"w-4 h-4 flex-shrink-0"}):b.jsx(gh,{className:"w-4 h-4 flex-shrink-0"})]}),r&&b.jsx("div",{className:"px-3 pb-3 text-sm text-muted-foreground italic border-t border-dashed",children:b.jsx("pre",{className:"whitespace-pre-wrap text-xs pt-2",children:e})})]})}function F3({content:e,errorCode:r}){return b.jsxs("div",{className:"my-2 rounded-lg overflow-hidden border border-destructive/50 bg-destructive/10",children:[b.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 text-sm text-destructive",children:[b.jsx(vh,{className:"w-3 h-3"}),b.jsxs("span",{className:"font-medium",children:["Error",r?`: ${r}`:""]})]}),b.jsx("div",{className:"px-3 py-2 text-sm text-destructive",children:b.jsx("p",{className:"whitespace-pre-wrap",children:e})})]})}function H3({content:e}){return b.jsx("div",{className:"my-2 text-center text-sm text-muted-foreground",children:b.jsx("span",{className:"px-3 py-1 rounded-full bg-muted",children:e})})}function V3({content:e,audioUrl:r,audioBase64:n,duration:s,isUserMessage:o}){const u=!o&&!!(r||n),f=o&&!e&&s&&s>0;return b.jsxs("div",{className:"space-y-2",children:[b.jsxs("div",{className:Te("flex items-center gap-2 text-sm",o?"text-primary-foreground/70":"text-muted-foreground"),children:[b.jsx(r1,{className:"w-3 h-3"}),b.jsx("span",{children:"Voice message"}),s&&b.jsxs("span",{className:"tabular-nums",children:[Math.floor(s/60),":",(s%60).toString().padStart(2,"0")]}),f&&b.jsx("span",{className:"text-xs opacity-70",children:"Transcribing..."})]}),u&&b.jsx(RE,{audioUrl:r,audioBase64:n,className:"bg-background/50"}),e&&b.jsx("p",{className:"whitespace-pre-wrap break-words text-sm italic",children:e})]})}function q3({audioUrl:e,audioBase64:r,messageId:n,hasAudio:s}){const o=!!(e||r||n),u=o||s;return on.audio("VoiceOutputBlock render:",{audioUrl:!!e,audioBase64:!!r,messageId:n,hasAudio:s,audioAvailable:o,shouldShowAudioPlayer:u}),u?b.jsx(RE,{audioUrl:e,audioBase64:r,messageId:n,className:"bg-background/50 !p-2 mt-2"}):null}function G3({agentType:e}){const r="w-[18px] h-[18px]",n=()=>{switch(e){case"supervisor":return b.jsx(ga,{className:r});case"claude":return b.jsx(Ea,{className:r});case"cursor":return b.jsx(Ta,{className:r});case"opencode":return b.jsx(Aa,{className:r});case"terminal":return b.jsx(va,{className:Te(r,"text-foreground")});default:return b.jsx(xi,{className:Te(r,"text-foreground")})}};return b.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-lg bg-muted flex items-center justify-center overflow-hidden",children:n()})}function z3({contentBlocks:e,isUser:r,showAvatar:n,isContinuation:s,sendStatus:o,isCurrentDevice:u,fromDeviceId:f,onRetry:l,agentType:c}){return e.length>0&&e.some(m=>m.content||m.blockType==="tool"||m.blockType==="voice_output"||m.blockType==="voice_input")?b.jsxs("div",{className:Te("flex gap-3",s?"mb-1":"mb-4",r&&"flex-row-reverse"),children:[n?r?b.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-primary text-primary-foreground flex items-center justify-center",children:b.jsx(XM,{className:"w-4 h-4"})}):b.jsx(G3,{agentType:c}):b.jsx("div",{className:"flex-shrink-0 w-8"}),b.jsxs("div",{className:Te("flex-1 max-w-[85%] md:max-w-[75%]",r&&"flex flex-col items-end"),children:[b.jsx("div",{className:Te("rounded-2xl px-4 py-3",r?"bg-primary text-primary-foreground rounded-br-sm":"bg-muted rounded-bl-sm",s&&!r&&"rounded-tl-sm"),children:e.map(m=>b.jsx(P3,{block:m,isUserMessage:r},m.id))}),o==="pending"&&b.jsx("span",{className:"text-xs text-muted-foreground mt-1",role:"status",children:"Sending..."}),o==="failed"&&b.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[b.jsx("span",{className:"text-xs text-destructive",role:"alert",children:"Failed to send"}),l&&b.jsxs(dt,{variant:"ghost",size:"sm",onClick:l,className:"h-6 px-2 text-xs","aria-label":"Retry sending message",children:[b.jsx(zg,{className:"w-3 h-3 mr-1","aria-hidden":"true"}),"Retry"]})]}),!u&&f&&b.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"From another device"})]})]}):null}function Y3({className:e}){return b.jsx("div",{className:Te("flex items-center gap-1",e),role:"status","aria-label":"Agent is typing",children:[0,1,2].map(r=>b.jsx("div",{className:"w-2 h-2 bg-muted-foreground/60 rounded-full animate-[typing-dot_1s_ease-in-out_infinite]",style:{animationDelay:`${r*.15}s`}},r))})}function W3({agentType:e}){const r="w-[18px] h-[18px]",n=()=>{switch(e){case"supervisor":return b.jsx(ga,{className:r});case"claude":return b.jsx(Ea,{className:r});case"cursor":return b.jsx(Ta,{className:r});case"opencode":return b.jsx(Aa,{className:r});case"terminal":return b.jsx(va,{className:Te(r,"text-foreground")});default:return b.jsx(xi,{className:Te(r,"text-foreground")})}};return b.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-lg bg-muted flex items-center justify-center overflow-hidden",children:n()})}function K3({agentType:e,className:r}){return b.jsxs("div",{className:Te("flex gap-3 mb-4",r),role:"status","aria-label":"Agent is thinking",children:[b.jsx(W3,{agentType:e}),b.jsx("div",{className:"flex-1 max-w-[85%] md:max-w-[75%]",children:b.jsx("div",{className:"rounded-2xl px-4 py-3 bg-muted rounded-bl-sm inline-block",children:b.jsx(Y3,{})})})]})}function Q3({onRecordingComplete:e,disabled:r=!1,className:n}){const[s,o]=R.useState(!1),[u,f]=R.useState(!1),l=R.useRef(null),c=R.useRef([]),h=R.useRef(null),m=R.useRef(null),p=R.useRef(!1),y=R.useRef(0),x=R.useCallback(async()=>{if(!(s||u)){It.stop();try{const _=await navigator.mediaDevices.getUserMedia({audio:!0});h.current=_;let T="audio/webm;codecs=opus";MediaRecorder.isTypeSupported(T)||(T="audio/webm",MediaRecorder.isTypeSupported(T)||(T="audio/mp4",MediaRecorder.isTypeSupported(T)||(T="")));const M=new MediaRecorder(_,T?{mimeType:T}:void 0);l.current=M,c.current=[],M.ondataavailable=k=>{k.data.size>0&&c.current.push(k.data)},M.onstop=()=>{const k=M.mimeType,L=new Blob(c.current,{type:k}),D=k.includes("webm")?"webm":k.includes("mp4")?"m4a":"wav";_.getTracks().forEach(P=>P.stop()),h.current=null,L.size>0&&(f(!0),e(L,D),setTimeout(()=>f(!1),500))},M.start(100),o(!0),"vibrate"in navigator&&navigator.vibrate(10)}catch(_){ze.error("Failed to start recording:",_),Lr.error("Microphone access denied","Please allow microphone access to record voice messages.")}}},[s,u,e]),A=R.useCallback(()=>{l.current&&l.current.state==="recording"&&l.current.stop(),o(!1),"vibrate"in navigator&&navigator.vibrate(10)},[]),w=R.useCallback(_=>{var T,M;r||u||((M=(T=_.target).setPointerCapture)==null||M.call(T,_.pointerId),It.unlockIfNeeded().catch(()=>{}),y.current=Date.now(),p.current=!1,!s&&(m.current=setTimeout(()=>{p.current=!0,x()},150)))},[r,u,s,x]),v=R.useCallback(_=>{var M,k;if(r)return;(k=(M=_.target).releasePointerCapture)==null||k.call(M,_.pointerId);const T=Date.now()-y.current;m.current&&(clearTimeout(m.current),m.current=null),p.current?(A(),p.current=!1):T<150&&(s?A():x())},[r,s,x,A]),S=R.useCallback(()=>{m.current&&(clearTimeout(m.current),m.current=null),p.current&&s&&(A(),p.current=!1)},[s,A]);R.useEffect(()=>()=>{m.current&&clearTimeout(m.current),h.current&&h.current.getTracks().forEach(_=>_.stop())},[]);const g=36;return b.jsxs("div",{className:Te("relative flex items-center justify-center gap-2 shrink-0",n),children:[s&&b.jsxs(b.Fragment,{children:[b.jsx("span",{className:"absolute w-14 h-14 rounded-full bg-red-500/40",style:{animation:"pulse-ring 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite"}}),b.jsx("span",{className:"absolute w-14 h-14 rounded-full bg-red-500/40",style:{animation:"pulse-ring 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite",animationDelay:"0.5s"}}),b.jsx("span",{className:"absolute w-14 h-14 rounded-full bg-red-500/40",style:{animation:"pulse-ring 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite",animationDelay:"1s"}})]}),b.jsx("button",{type:"button",onPointerDown:w,onPointerUp:v,onPointerLeave:S,onPointerCancel:S,disabled:r||u,className:Te("relative z-10 flex items-center justify-center rounded-full","transition-all duration-150","select-none","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s?"w-14 h-14 bg-red-500 text-white scale-100":"w-9 h-9 text-primary hover:bg-muted active:scale-95",r&&"opacity-50 cursor-not-allowed"),"aria-label":s?"Stop recording":"Record voice message",children:s?b.jsx(i1,{className:"w-5 h-5",fill:"currentColor"}):b.jsx(r1,{className:"w-5 h-5",style:{width:g*.55,height:g*.55}})})]})}function $3({onSend:e,onSendAudio:r,onCancel:n,isLoading:s=!1,placeholder:o="Message...",disabled:u=!1,showVoice:f=!0}){const[l,c]=R.useState(""),h=R.useRef(null),m=R.useCallback(()=>{const w=l.trim();!w||s||u||(e(w),c(""),h.current&&(h.current.style.height="auto"))},[l,s,u,e]),p=R.useCallback(w=>{w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),m())},[m]),y=R.useCallback(()=>{const w=h.current;if(w){w.style.height="auto";const g=24*6;w.style.height=`${Math.min(w.scrollHeight,g)}px`}},[]),x=R.useCallback((w,v)=>{r==null||r(w,v)},[r]),A=l.trim()&&!s&&!u;return b.jsx("footer",{className:"border-t bg-background/80 backdrop-blur-xl supports-[backdrop-filter]:bg-background/60 px-3 py-3",children:b.jsx("div",{className:"max-w-3xl mx-auto",children:b.jsxs("form",{onSubmit:w=>{w.preventDefault(),m()},className:"flex items-end gap-3",role:"form","aria-label":"Message input",children:[b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("label",{htmlFor:"chat-input",className:"sr-only",children:"Message input"}),b.jsx("textarea",{id:"chat-input",ref:h,value:l,onChange:w=>c(w.target.value),onKeyDown:p,onInput:y,placeholder:o,disabled:u,rows:1,"aria-label":"Type your message",className:Te("w-full resize-none rounded-[20px] bg-muted px-4 py-3","text-base leading-6","border-0 focus:outline-none focus:ring-2 focus:ring-primary/50","placeholder:text-muted-foreground/60","min-h-[48px]",u&&"opacity-50 cursor-not-allowed")})]}),f&&r&&b.jsx(Q3,{onRecordingComplete:x,disabled:u||s}),s&&n?b.jsx("button",{type:"button",onClick:n,className:Te("flex items-center justify-center shrink-0","w-9 h-9 rounded-full","bg-destructive text-destructive-foreground","transition-transform active:scale-95"),"aria-label":"Stop generation",children:b.jsx(i1,{className:"w-4 h-4",fill:"currentColor","aria-hidden":"true"})}):b.jsx("button",{type:"submit",disabled:!A,className:Te("flex items-center justify-center shrink-0","w-9 h-9 rounded-full","transition-all active:scale-95",A?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground/50 cursor-not-allowed"),"aria-label":"Send message",children:b.jsx(BM,{className:"w-5 h-5",strokeWidth:2.5,"aria-hidden":"true"})})]})})})}function jm({className:e}){return b.jsx("div",{className:Te("animate-pulse rounded-md bg-muted",e),"aria-hidden":"true"})}function J3({isUser:e=!1}){return b.jsxs("div",{className:Te("flex gap-3 mb-4",e&&"flex-row-reverse"),children:[b.jsx(jm,{className:"w-8 h-8 rounded-full shrink-0"}),b.jsx("div",{className:Te("flex-1 max-w-[75%]",e&&"flex flex-col items-end"),children:b.jsxs("div",{className:Te("rounded-2xl px-4 py-3 space-y-2",e?"bg-primary/20":"bg-muted"),children:[b.jsx(jm,{className:"h-4 w-48"}),b.jsx(jm,{className:"h-4 w-32"})]})})]})}function Z3({count:e=3}){return b.jsxs("div",{className:"space-y-4",role:"status","aria-label":"Loading messages",children:[Array.from({length:e}).map((r,n)=>b.jsx(J3,{isUser:n%2===0},n)),b.jsx("span",{className:"sr-only",children:"Loading chat messages..."})]})}const X3={maxHeightUnitsPerSegment:14,minHeightUnitsToSplit:17},Rg=45;function Um(e){var r,n;switch(e.blockType){case"text":{const s=e.content.split(`
393
+ `).length,o=Math.max(1,Math.ceil(e.content.length/Rg));return Math.max(s,o)}case"code":return e.content.split(`
394
+ `).length+2;case"tool":return 3;case"thinking":return 2;case"status":return 1;case"error":return Math.max(1,Math.ceil(e.content.length/Rg))+1;case"cancel":return 2;case"voice_input":return 3;case"voice_output":return 2;case"action_buttons":return Math.max(1,((n=(r=e.metadata)==null?void 0:r.buttons)==null?void 0:n.length)??1)*2;default:return 1}}function ej(e,r){const n=e.slice(0,r),s=Math.floor(r/2),o=n.lastIndexOf(`
395
+
396
+ `);if(o>s)return o+2;const u=[". ","! ","? ",`.
397
+ `,`!
398
+ `,`?
399
+ `];for(const h of u){const m=n.lastIndexOf(h);if(m>s)return m+h.length}const f=n.lastIndexOf(`
400
+ `);if(f>s)return f+1;const l=Math.floor(r/3),c=n.lastIndexOf(" ");return c>l?c+1:r}function tj(e,r){const n=[];let s=e;for(;s.length>r;){const o=ej(s,r),u=s.slice(0,o).trim();u&&n.push(u),s=s.slice(o).trim()}return s&&n.push(s),n.length===0?[e]:n}function Fm(e){return{id:`${e.id}-seg-0`,messageId:e.id,contentBlocks:e.contentBlocks,segmentIndex:0,totalSegments:1,isFirstSegment:!0,isLastSegment:!0,isStreaming:e.isStreaming,showAvatar:e.role==="assistant",createdAt:e.createdAt,role:e.role,sendStatus:e.sendStatus,fromDeviceId:e.fromDeviceId}}function rj(e,r=X3){if(e.role==="user")return[Fm(e)];if(e.contentBlocks.reduce((l,c)=>l+Um(c),0)<r.minHeightUnitsToSplit)return[Fm(e)];const s=[];let o=[],u=0;for(const l of e.contentBlocks){const c=Um(l);if(u+c>r.maxHeightUnitsPerSegment&&u>0){if(l.blockType==="text"&&c>r.maxHeightUnitsPerSegment/2){o.length>0&&(s.push(o),o=[],u=0);const h=r.maxHeightUnitsPerSegment*Rg,m=tj(l.content,h);for(let p=0;p<m.length;p++){const y=m[p];if(!y)continue;const x={id:`${l.id}-part-${p}`,blockType:"text",content:y,metadata:l.metadata};p<m.length-1?s.push([x]):(o.push(x),u=Um(x))}continue}o.length>0&&(s.push(o),o=[],u=0)}o.push(l),u+=c}if(o.length>0&&s.push(o),s.length===0)return[Fm(e)];const f=s.length;return s.map((l,c)=>({id:`${e.id}-seg-${c}`,messageId:e.id,contentBlocks:l,segmentIndex:c,totalSegments:f,isFirstSegment:c===0,isLastSegment:c===f-1,isStreaming:e.isStreaming&&c===f-1,showAvatar:c===0,createdAt:e.createdAt,role:e.role,sendStatus:e.sendStatus,fromDeviceId:e.fromDeviceId}))}function nj(e){return e.flatMap(r=>rj(r))}function Cb({messages:e,isLoading:r,isSubscribing:n=!1,onSend:s,onSendAudio:o,onCancel:u,currentDeviceId:f,disabled:l=!1,emptyMessage:c="No messages yet. Start the conversation!",showVoice:h=!0,emptyIcon:m,agentType:p,hasMore:y=!1,isLoadingMore:x=!1,onLoadMore:A}){const w=R.useRef(null),v=R.useRef(null),[S,g]=R.useState(!1),[_,T]=R.useState(!0),M=R.useMemo(()=>nj(e),[e]),k=r&&e.length>0,L=R.useCallback(()=>{if(!w.current)return;const{scrollTop:P,scrollHeight:K,clientHeight:$}=w.current,W=K-P-$<100;T(W),g(!W&&e.length>0)},[e.length]);R.useEffect(()=>{w.current&&_&&(w.current.scrollTop=w.current.scrollHeight)},[M,_]),R.useEffect(()=>{const P=w.current;if(!P)return;let K=!1;const $=()=>{K||(requestAnimationFrame(()=>{L(),K=!1}),K=!0)};return P.addEventListener("scroll",$,{passive:!0}),()=>P.removeEventListener("scroll",$)},[L]),R.useEffect(()=>{if(!y||!A||x||n)return;const P=v.current;if(!P)return;const K=new IntersectionObserver($=>{const z=$[0];z!=null&&z.isIntersecting&&y&&!x&&A()},{root:w.current,rootMargin:"100px 0px 0px 0px",threshold:0});return K.observe(P),()=>K.disconnect()},[y,A,x,n]);const D=R.useCallback(()=>{w.current&&w.current.scrollTo({top:w.current.scrollHeight,behavior:"smooth"})},[]);return b.jsxs("div",{className:"flex flex-col h-full",role:"main",children:[b.jsxs("div",{className:"relative flex-1",children:[b.jsx("div",{ref:w,className:"absolute inset-0 overflow-y-auto p-4",role:"log","aria-label":"Chat messages","aria-live":"polite",children:b.jsxs("div",{className:"max-w-3xl mx-auto",children:[!n&&e.length>0&&b.jsx("div",{ref:v,className:"h-1","aria-hidden":"true"}),x&&b.jsx("div",{className:"flex justify-center py-4",children:b.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground text-sm",children:[b.jsx("div",{className:"w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),b.jsx("span",{children:"Loading older messages..."})]})}),n?b.jsx(Z3,{count:3}):e.length===0?b.jsxs("div",{className:"flex flex-col items-center justify-center h-full min-h-[200px] text-center",role:"status","aria-label":c,children:[b.jsx("div",{className:"w-16 h-16 rounded-full bg-muted flex items-center justify-center mb-4","aria-hidden":"true",children:m||b.jsx(xi,{className:"w-8 h-8 text-muted-foreground"})}),b.jsx("p",{className:"text-muted-foreground",children:c})]}):b.jsxs(b.Fragment,{children:[M.map(P=>b.jsx(z3,{contentBlocks:P.contentBlocks,isUser:P.role==="user",isStreaming:P.isStreaming,showAvatar:P.showAvatar,isContinuation:!P.isFirstSegment,sendStatus:P.isLastSegment?P.sendStatus:void 0,isCurrentDevice:!P.fromDeviceId||P.fromDeviceId===f,fromDeviceId:P.isLastSegment?P.fromDeviceId:void 0,agentType:p},P.id)),k&&b.jsx(K3,{agentType:p})]})]})}),b.jsx("button",{type:"button",onClick:D,className:Te("absolute bottom-4 right-4 z-10","w-10 h-10 rounded-full shadow-lg","bg-background border border-border","flex items-center justify-center","transition-all duration-200 ease-out","hover:bg-muted hover:shadow-xl","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",S?"opacity-100 translate-y-0 pointer-events-auto":"opacity-0 translate-y-4 pointer-events-none"),"aria-label":"Scroll to bottom","aria-hidden":!S,children:b.jsx(LM,{className:"w-5 h-5 text-muted-foreground"})})]}),b.jsx($3,{onSend:s,onSendAudio:o,onCancel:u,isLoading:r,disabled:l,placeholder:l?"Not connected...":"Type a message...",showVoice:h})]})}function wb(){const{sessionId:e}=Ub(),r=!e,n=R.useRef(new Set),s=Ve(O=>O.credentials),o=Ve(O=>O.connectionState),u=Ve(O=>O.sessions),f=ut(O=>O.supervisorMessages),l=ut(O=>O.supervisorIsLoading),c=ut(O=>O.historyPaginationState),h=ut(O=>O.agentMessages),m=ut(O=>O.agentIsLoading),{sendSupervisorCommand:p,cancelSupervisor:y,sendAgentCommand:x,cancelAgent:A,subscribeToSession:w,sendSupervisorVoiceCommand:v,sendAgentVoiceCommand:S,requestHistory:g}=co(),_=o==="verified"||o==="authenticated";R.useEffect(()=>{if(!e||r||!_||n.current.has(e))return;const O=u.find(G=>G.id===e);(O==null?void 0:O.type)!=="terminal"&&(n.current.add(e),w(e))},[e,r,_,u,w]);const T=e?u.find(O=>O.id===e):null,M=R.useCallback(O=>{p(O)},[p]),k=R.useCallback(O=>{e&&x(e,O)},[e,x]),L=R.useCallback(()=>{y()},[y]),D=R.useCallback(()=>{e&&A(e)},[e,A]),P=R.useCallback(async(O,G)=>{if(console.log("🎤 handleSupervisorAudio called:",{audioBlobSize:O.size,format:G,isConnected:_}),!_){console.error("❌ Not connected to WebSocket"),Lr.error("Connection Error","Not connected to Tiflis. Please check your connection.");return}const j=new FileReader;j.onloadend=()=>{const q=j.result,ne=q.split(",")[1];if(console.log("🎤 Converting to base64:",{originalSize:q.length,base64Size:ne==null?void 0:ne.length}),ne)try{v(ne,G),console.log("✅ Voice command sent successfully")}catch(Z){console.error("❌ Failed to send voice command:",Z),Lr.error("Voice Message Error","Failed to send voice message. Please try again.")}else console.error("❌ Failed to convert audio to base64"),Lr.error("Voice Message Error","Failed to process audio. Please try recording again.")},j.onerror=q=>{console.error("❌ FileReader error:",q),Lr.error("Voice Message Error","Failed to read audio file. Please try again.")},j.readAsDataURL(O)},[v,_]),K=R.useCallback(async(O,G)=>{if(console.log("🎤 handleAgentAudio called:",{sessionId:e,audioBlobSize:O.size,format:G,isConnected:_}),!e){console.error("❌ No session ID provided"),Lr.error("Voice Message Error","No session active. Please select a session first.");return}if(!_){console.error("❌ Not connected to WebSocket"),Lr.error("Connection Error","Not connected to Tiflis. Please check your connection.");return}const j=new FileReader;j.onloadend=()=>{const q=j.result,ne=q.split(",")[1];if(console.log("🎤 Converting to base64:",{originalSize:q.length,base64Size:ne==null?void 0:ne.length}),ne)try{S(e,ne,G),console.log("✅ Voice command sent successfully")}catch(Z){console.error("❌ Failed to send voice command:",Z),Lr.error("Voice Message Error","Failed to send voice message. Please try again.")}else console.error("❌ Failed to convert audio to base64"),Lr.error("Voice Message Error","Failed to process audio. Please try recording again.")},j.onerror=q=>{console.error("❌ FileReader error:",q),Lr.error("Voice Message Error","Failed to read audio file. Please try again.")},j.readAsDataURL(O)},[e,S,_]),$=R.useCallback(()=>{const O=c.supervisor;O!=null&&O.hasMore&&!(O!=null&&O.isLoading)&&(O!=null&&O.oldestSequence)&&g(null,O.oldestSequence)},[c,g]),z=R.useCallback(()=>{if(!e)return;const O=c[e];O!=null&&O.hasMore&&!(O!=null&&O.isLoading)&&(O!=null&&O.oldestSequence)&&g(e,O.oldestSequence)},[e,c,g]),W=O=>{if(!O)return b.jsx(xi,{className:"w-8 h-8 text-muted-foreground"});switch(O.type){case"claude":return b.jsx(Ea,{className:"w-8 h-8 text-muted-foreground"});case"cursor":return b.jsx(Ta,{className:"w-8 h-8 text-muted-foreground"});case"opencode":return b.jsx(Aa,{className:"w-8 h-8 text-muted-foreground"});default:return b.jsx(xi,{className:"w-8 h-8 text-muted-foreground"})}};if(r){const O=c.supervisor,G=(O==null?void 0:O.isLoading)??!1,j=(O==null?void 0:O.hasMore)??!1;return b.jsx(Cb,{messages:f,isLoading:l,isSubscribing:G&&f.length===0,onSend:M,onSendAudio:P,onCancel:L,currentDeviceId:s==null?void 0:s.deviceId,disabled:!_,emptyMessage:"Hello! I'm your AI assistant. Ask me to create sessions, manage your workspace, or help with tasks.",emptyIcon:b.jsx(ga,{className:"w-8 h-8 text-muted-foreground"}),agentType:"supervisor",hasMore:j,isLoadingMore:G&&f.length>0,onLoadMore:$})}const F=h[e]??[],ee=m[e]??!1,Y=c[e],re=(Y==null?void 0:Y.isLoading)??!1,te=(Y==null?void 0:Y.hasMore)??!1;return b.jsx(Cb,{messages:F,isLoading:ee,isSubscribing:re&&F.length===0,onSend:k,onSendAudio:K,onCancel:D,currentDeviceId:s==null?void 0:s.deviceId,disabled:!_,emptyMessage:`Start a conversation with ${(T==null?void 0:T.agentName)??"the agent"}...`,emptyIcon:W(T??null),agentType:T==null?void 0:T.type,hasMore:te,isLoadingMore:re&&F.length>0,onLoadMore:z})}var Hm={exports:{}},xb;function ij(){return xb||(xb=1,(function(e,r){(function(n,s){e.exports=s()})(globalThis,(()=>(()=>{var n={4567:function(f,l,c){var h=this&&this.__decorate||function(g,_,T,M){var k,L=arguments.length,D=L<3?_:M===null?M=Object.getOwnPropertyDescriptor(_,T):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(g,_,T,M);else for(var P=g.length-1;P>=0;P--)(k=g[P])&&(D=(L<3?k(D):L>3?k(_,T,D):k(_,T))||D);return L>3&&D&&Object.defineProperty(_,T,D),D},m=this&&this.__param||function(g,_){return function(T,M){_(T,M,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const p=c(9042),y=c(9924),x=c(844),A=c(4725),w=c(2585),v=c(3656);let S=l.AccessibilityManager=class extends x.Disposable{constructor(g,_,T,M){super(),this._terminal=g,this._coreBrowserService=T,this._renderService=M,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let k=0;k<this._terminal.rows;k++)this._rowElements[k]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[k]);if(this._topBoundaryFocusListener=k=>this._handleBoundaryFocus(k,0),this._bottomBoundaryFocusListener=k=>this._handleBoundaryFocus(k,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new y.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((k=>this._handleResize(k.rows)))),this.register(this._terminal.onRender((k=>this._refreshRows(k.start,k.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((k=>this._handleChar(k)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
401
+ `)))),this.register(this._terminal.onA11yTab((k=>this._handleTab(k)))),this.register(this._terminal.onKey((k=>this._handleKey(k.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,v.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,x.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(g){for(let _=0;_<g;_++)this._handleChar(" ")}_handleChar(g){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==g&&(this._charsToAnnounce+=g):this._charsToAnnounce+=g,g===`
402
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=p.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(g){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(g)||this._charsToConsume.push(g)}_refreshRows(g,_){this._liveRegionDebouncer.refresh(g,_,this._terminal.rows)}_renderRows(g,_){const T=this._terminal.buffer,M=T.lines.length.toString();for(let k=g;k<=_;k++){const L=T.lines.get(T.ydisp+k),D=[],P=(L==null?void 0:L.translateToString(!0,void 0,void 0,D))||"",K=(T.ydisp+k+1).toString(),$=this._rowElements[k];$&&(P.length===0?($.innerText=" ",this._rowColumns.set($,[0,1])):($.textContent=P,this._rowColumns.set($,D)),$.setAttribute("aria-posinset",K),$.setAttribute("aria-setsize",M))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(g,_){const T=g.target,M=this._rowElements[_===0?1:this._rowElements.length-2];if(T.getAttribute("aria-posinset")===(_===0?"1":`${this._terminal.buffer.lines.length}`)||g.relatedTarget!==M)return;let k,L;if(_===0?(k=T,L=this._rowElements.pop(),this._rowContainer.removeChild(L)):(k=this._rowElements.shift(),L=T,this._rowContainer.removeChild(k)),k.removeEventListener("focus",this._topBoundaryFocusListener),L.removeEventListener("focus",this._bottomBoundaryFocusListener),_===0){const D=this._createAccessibilityTreeNode();this._rowElements.unshift(D),this._rowContainer.insertAdjacentElement("afterbegin",D)}else{const D=this._createAccessibilityTreeNode();this._rowElements.push(D),this._rowContainer.appendChild(D)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(_===0?-1:1),this._rowElements[_===0?1:this._rowElements.length-2].focus(),g.preventDefault(),g.stopImmediatePropagation()}_handleSelectionChange(){var P;if(this._rowElements.length===0)return;const g=document.getSelection();if(!g)return;if(g.isCollapsed)return void(this._rowContainer.contains(g.anchorNode)&&this._terminal.clearSelection());if(!g.anchorNode||!g.focusNode)return void console.error("anchorNode and/or focusNode are null");let _={node:g.anchorNode,offset:g.anchorOffset},T={node:g.focusNode,offset:g.focusOffset};if((_.node.compareDocumentPosition(T.node)&Node.DOCUMENT_POSITION_PRECEDING||_.node===T.node&&_.offset>T.offset)&&([_,T]=[T,_]),_.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(_={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(_.node))return;const M=this._rowElements.slice(-1)[0];if(T.node.compareDocumentPosition(M)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(T={node:M,offset:((P=M.textContent)==null?void 0:P.length)??0}),!this._rowContainer.contains(T.node))return;const k=({node:K,offset:$})=>{const z=K instanceof Text?K.parentNode:K;let W=parseInt(z==null?void 0:z.getAttribute("aria-posinset"),10)-1;if(isNaN(W))return console.warn("row is invalid. Race condition?"),null;const F=this._rowColumns.get(z);if(!F)return console.warn("columns is null. Race condition?"),null;let ee=$<F.length?F[$]:F.slice(-1)[0]+1;return ee>=this._terminal.cols&&(++W,ee=0),{row:W,column:ee}},L=k(_),D=k(T);if(L&&D){if(L.row>D.row||L.row===D.row&&L.column>=D.column)throw new Error("invalid range");this._terminal.select(L.column,L.row,(D.row-L.row)*this._terminal.cols-L.column+D.column)}}_handleResize(g){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let _=this._rowContainer.children.length;_<this._terminal.rows;_++)this._rowElements[_]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[_]);for(;this._rowElements.length>g;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const g=this._coreBrowserService.mainDocument.createElement("div");return g.setAttribute("role","listitem"),g.tabIndex=-1,this._refreshRowDimensions(g),g}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let g=0;g<this._terminal.rows;g++)this._refreshRowDimensions(this._rowElements[g])}}_refreshRowDimensions(g){g.style.height=`${this._renderService.dimensions.css.cell.height}px`}};l.AccessibilityManager=S=h([m(1,w.IInstantiationService),m(2,A.ICoreBrowserService),m(3,A.IRenderService)],S)},3614:(f,l)=>{function c(y){return y.replace(/\r?\n/g,"\r")}function h(y,x){return x?"\x1B[200~"+y+"\x1B[201~":y}function m(y,x,A,w){y=h(y=c(y),A.decPrivateModes.bracketedPasteMode&&w.rawOptions.ignoreBracketedPasteMode!==!0),A.triggerDataEvent(y,!0),x.value=""}function p(y,x,A){const w=A.getBoundingClientRect(),v=y.clientX-w.left-10,S=y.clientY-w.top-10;x.style.width="20px",x.style.height="20px",x.style.left=`${v}px`,x.style.top=`${S}px`,x.style.zIndex="1000",x.focus()}Object.defineProperty(l,"__esModule",{value:!0}),l.rightClickHandler=l.moveTextAreaUnderMouseCursor=l.paste=l.handlePasteEvent=l.copyHandler=l.bracketTextForPaste=l.prepareTextForTerminal=void 0,l.prepareTextForTerminal=c,l.bracketTextForPaste=h,l.copyHandler=function(y,x){y.clipboardData&&y.clipboardData.setData("text/plain",x.selectionText),y.preventDefault()},l.handlePasteEvent=function(y,x,A,w){y.stopPropagation(),y.clipboardData&&m(y.clipboardData.getData("text/plain"),x,A,w)},l.paste=m,l.moveTextAreaUnderMouseCursor=p,l.rightClickHandler=function(y,x,A,w,v){p(y,x,A),v&&w.rightClickSelect(y),x.value=w.selectionText,x.select()}},7239:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const h=c(1505);l.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(m,p,y){this._css.set(m,p,y)}getCss(m,p){return this._css.get(m,p)}setColor(m,p,y){this._color.set(m,p,y)}getColor(m,p){return this._color.get(m,p)}clear(){this._color.clear(),this._css.clear()}}},3656:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(c,h,m,p){c.addEventListener(h,m,p);let y=!1;return{dispose:()=>{y||(y=!0,c.removeEventListener(h,m,p))}}}},3551:function(f,l,c){var h=this&&this.__decorate||function(S,g,_,T){var M,k=arguments.length,L=k<3?g:T===null?T=Object.getOwnPropertyDescriptor(g,_):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(S,g,_,T);else for(var D=S.length-1;D>=0;D--)(M=S[D])&&(L=(k<3?M(L):k>3?M(g,_,L):M(g,_))||L);return k>3&&L&&Object.defineProperty(g,_,L),L},m=this&&this.__param||function(S,g){return function(_,T){g(_,T,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier=void 0;const p=c(3656),y=c(8460),x=c(844),A=c(2585),w=c(4725);let v=l.Linkifier=class extends x.Disposable{get currentLink(){return this._currentLink}constructor(S,g,_,T,M){super(),this._element=S,this._mouseService=g,this._renderService=_,this._bufferService=T,this._linkProviderService=M,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new y.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new y.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,x.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,x.toDisposable)((()=>{var k;this._lastMouseEvent=void 0,(k=this._activeProviderReplies)==null||k.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,p.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,p.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,p.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,p.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(S){this._lastMouseEvent=S;const g=this._positionFromMouseEvent(S,this._element,this._mouseService);if(!g)return;this._isMouseOut=!1;const _=S.composedPath();for(let T=0;T<_.length;T++){const M=_[T];if(M.classList.contains("xterm"))break;if(M.classList.contains("xterm-hover"))return}this._lastBufferCell&&g.x===this._lastBufferCell.x&&g.y===this._lastBufferCell.y||(this._handleHover(g),this._lastBufferCell=g)}_handleHover(S){if(this._activeLine!==S.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(S,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,S)||(this._clearCurrentLink(),this._askForLink(S,!0))}_askForLink(S,g){var T,M;this._activeProviderReplies&&g||((T=this._activeProviderReplies)==null||T.forEach((k=>{k==null||k.forEach((L=>{L.link.dispose&&L.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=S.y);let _=!1;for(const[k,L]of this._linkProviderService.linkProviders.entries())g?(M=this._activeProviderReplies)!=null&&M.get(k)&&(_=this._checkLinkProviderResult(k,S,_)):L.provideLinks(S.y,(D=>{var K,$;if(this._isMouseOut)return;const P=D==null?void 0:D.map((z=>({link:z})));(K=this._activeProviderReplies)==null||K.set(k,P),_=this._checkLinkProviderResult(k,S,_),(($=this._activeProviderReplies)==null?void 0:$.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(S.y,this._activeProviderReplies)}))}_removeIntersectingLinks(S,g){const _=new Set;for(let T=0;T<g.size;T++){const M=g.get(T);if(M)for(let k=0;k<M.length;k++){const L=M[k],D=L.link.range.start.y<S?0:L.link.range.start.x,P=L.link.range.end.y>S?this._bufferService.cols:L.link.range.end.x;for(let K=D;K<=P;K++){if(_.has(K)){M.splice(k--,1);break}_.add(K)}}}}_checkLinkProviderResult(S,g,_){var k;if(!this._activeProviderReplies)return _;const T=this._activeProviderReplies.get(S);let M=!1;for(let L=0;L<S;L++)this._activeProviderReplies.has(L)&&!this._activeProviderReplies.get(L)||(M=!0);if(!M&&T){const L=T.find((D=>this._linkAtPosition(D.link,g)));L&&(_=!0,this._handleNewLink(L))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!_)for(let L=0;L<this._activeProviderReplies.size;L++){const D=(k=this._activeProviderReplies.get(L))==null?void 0:k.find((P=>this._linkAtPosition(P.link,g)));if(D){_=!0,this._handleNewLink(D);break}}return _}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(S){if(!this._currentLink)return;const g=this._positionFromMouseEvent(S,this._element,this._mouseService);g&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,g)&&this._currentLink.link.activate(S,this._currentLink.link.text)}_clearCurrentLink(S,g){this._currentLink&&this._lastMouseEvent&&(!S||!g||this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=g)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,x.disposeArray)(this._linkCacheDisposables))}_handleNewLink(S){if(!this._lastMouseEvent)return;const g=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);g&&this._linkAtPosition(S.link,g)&&(this._currentLink=S,this._currentLink.state={decorations:{underline:S.link.decorations===void 0||S.link.decorations.underline,pointerCursor:S.link.decorations===void 0||S.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,S.link,this._lastMouseEvent),S.link.decorations={},Object.defineProperties(S.link.decorations,{pointerCursor:{get:()=>{var _,T;return(T=(_=this._currentLink)==null?void 0:_.state)==null?void 0:T.decorations.pointerCursor},set:_=>{var T;(T=this._currentLink)!=null&&T.state&&this._currentLink.state.decorations.pointerCursor!==_&&(this._currentLink.state.decorations.pointerCursor=_,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",_))}},underline:{get:()=>{var _,T;return(T=(_=this._currentLink)==null?void 0:_.state)==null?void 0:T.decorations.underline},set:_=>{var T,M,k;(T=this._currentLink)!=null&&T.state&&((k=(M=this._currentLink)==null?void 0:M.state)==null?void 0:k.decorations.underline)!==_&&(this._currentLink.state.decorations.underline=_,this._currentLink.state.isHovered&&this._fireUnderlineEvent(S.link,_))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((_=>{if(!this._currentLink)return;const T=_.start===0?0:_.start+1+this._bufferService.buffer.ydisp,M=this._bufferService.buffer.ydisp+1+_.end;if(this._currentLink.link.range.start.y>=T&&this._currentLink.link.range.end.y<=M&&(this._clearCurrentLink(T,M),this._lastMouseEvent)){const k=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);k&&this._askForLink(k,!1)}}))))}_linkHover(S,g,_){var T;(T=this._currentLink)!=null&&T.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(g,!0),this._currentLink.state.decorations.pointerCursor&&S.classList.add("xterm-cursor-pointer")),g.hover&&g.hover(_,g.text)}_fireUnderlineEvent(S,g){const _=S.range,T=this._bufferService.buffer.ydisp,M=this._createLinkUnderlineEvent(_.start.x-1,_.start.y-T-1,_.end.x,_.end.y-T-1,void 0);(g?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(M)}_linkLeave(S,g,_){var T;(T=this._currentLink)!=null&&T.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(g,!1),this._currentLink.state.decorations.pointerCursor&&S.classList.remove("xterm-cursor-pointer")),g.leave&&g.leave(_,g.text)}_linkAtPosition(S,g){const _=S.range.start.y*this._bufferService.cols+S.range.start.x,T=S.range.end.y*this._bufferService.cols+S.range.end.x,M=g.y*this._bufferService.cols+g.x;return _<=M&&M<=T}_positionFromMouseEvent(S,g,_){const T=_.getCoords(S,g,this._bufferService.cols,this._bufferService.rows);if(T)return{x:T[0],y:T[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(S,g,_,T,M){return{x1:S,y1:g,x2:_,y2:T,cols:this._bufferService.cols,fg:M}}};l.Linkifier=v=h([m(1,w.IMouseService),m(2,w.IRenderService),m(3,A.IBufferService),m(4,w.ILinkProviderService)],v)},9042:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tooMuchOutput=l.promptLabel=void 0,l.promptLabel="Terminal input",l.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(f,l,c){var h=this&&this.__decorate||function(w,v,S,g){var _,T=arguments.length,M=T<3?v:g===null?g=Object.getOwnPropertyDescriptor(v,S):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(w,v,S,g);else for(var k=w.length-1;k>=0;k--)(_=w[k])&&(M=(T<3?_(M):T>3?_(v,S,M):_(v,S))||M);return T>3&&M&&Object.defineProperty(v,S,M),M},m=this&&this.__param||function(w,v){return function(S,g){v(S,g,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const p=c(511),y=c(2585);let x=l.OscLinkProvider=class{constructor(w,v,S){this._bufferService=w,this._optionsService=v,this._oscLinkService=S}provideLinks(w,v){var P;const S=this._bufferService.buffer.lines.get(w-1);if(!S)return void v(void 0);const g=[],_=this._optionsService.rawOptions.linkHandler,T=new p.CellData,M=S.getTrimmedLength();let k=-1,L=-1,D=!1;for(let K=0;K<M;K++)if(L!==-1||S.hasContent(K)){if(S.loadCell(K,T),T.hasExtendedAttrs()&&T.extended.urlId){if(L===-1){L=K,k=T.extended.urlId;continue}D=T.extended.urlId!==k}else L!==-1&&(D=!0);if(D||L!==-1&&K===M-1){const $=(P=this._oscLinkService.getLinkData(k))==null?void 0:P.uri;if($){const z={start:{x:L+1,y:w},end:{x:K+(D||K!==M-1?0:1),y:w}};let W=!1;if(!(_!=null&&_.allowNonHttpProtocols))try{const F=new URL($);["http:","https:"].includes(F.protocol)||(W=!0)}catch{W=!0}W||g.push({text:$,range:z,activate:(F,ee)=>_?_.activate(F,ee,z):A(0,ee),hover:(F,ee)=>{var Y;return(Y=_==null?void 0:_.hover)==null?void 0:Y.call(_,F,ee,z)},leave:(F,ee)=>{var Y;return(Y=_==null?void 0:_.leave)==null?void 0:Y.call(_,F,ee,z)}})}D=!1,T.hasExtendedAttrs()&&T.extended.urlId?(L=K,k=T.extended.urlId):(L=-1,k=-1)}}v(g)}};function A(w,v){if(confirm(`Do you want to navigate to ${v}?
403
+
404
+ WARNING: This link could potentially be dangerous`)){const S=window.open();if(S){try{S.opener=null}catch{}S.location.href=v}else console.warn("Opening link blocked as opener could not be cleared")}}l.OscLinkProvider=x=h([m(0,y.IBufferService),m(1,y.IOptionsService),m(2,y.IOscLinkService)],x)},6193:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.RenderDebouncer=class{constructor(c,h){this._renderCallback=c,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,h,m){this._rowCount=m,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const h=c(3614),m=c(3656),p=c(3551),y=c(9042),x=c(3730),A=c(1680),w=c(3107),v=c(5744),S=c(2950),g=c(1296),_=c(428),T=c(4269),M=c(5114),k=c(8934),L=c(3230),D=c(9312),P=c(4725),K=c(6731),$=c(8055),z=c(8969),W=c(8460),F=c(844),ee=c(6114),Y=c(8437),re=c(2584),te=c(7399),O=c(5941),G=c(9074),j=c(2585),q=c(5435),ne=c(4567),Z=c(779);class be extends z.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(Q={}){super(Q),this.browser=ee,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new F.MutableDisposable),this._onCursorMove=this.register(new W.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new W.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new W.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new W.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new W.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new W.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new W.EventEmitter),this._onBlur=this.register(new W.EventEmitter),this._onA11yCharEmitter=this.register(new W.EventEmitter),this._onA11yTabEmitter=this.register(new W.EventEmitter),this._onWillOpen=this.register(new W.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(G.DecorationService),this._instantiationService.setService(j.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Z.LinkProviderService),this._instantiationService.setService(P.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(x.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((U,ue)=>this.refresh(U,ue)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((U=>this._reportWindowsOptions(U)))),this.register(this._inputHandler.onColor((U=>this._handleColorEvent(U)))),this.register((0,W.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,W.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,W.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,W.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((U=>this._afterResize(U.cols,U.rows)))),this.register((0,F.toDisposable)((()=>{var U,ue;this._customKeyEventHandler=void 0,(ue=(U=this.element)==null?void 0:U.parentNode)==null||ue.removeChild(this.element)})))}_handleColorEvent(Q){if(this._themeService)for(const U of Q){let ue,oe="";switch(U.index){case 256:ue="foreground",oe="10";break;case 257:ue="background",oe="11";break;case 258:ue="cursor",oe="12";break;default:ue="ansi",oe="4;"+U.index}switch(U.type){case 0:const de=$.color.toColorRGB(ue==="ansi"?this._themeService.colors.ansi[U.index]:this._themeService.colors[ue]);this.coreService.triggerDataEvent(`${re.C0.ESC}]${oe};${(0,O.toRgbString)(de)}${re.C1_ESCAPED.ST}`);break;case 1:if(ue==="ansi")this._themeService.modifyColors((he=>he.ansi[U.index]=$.channels.toColor(...U.color)));else{const he=ue;this._themeService.modifyColors((De=>De[he]=$.channels.toColor(...U.color)))}break;case 2:this._themeService.restoreColor(U.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Q){Q?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(ne.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Q){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(re.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var Q;return(Q=this.textarea)==null?void 0:Q.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(re.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const Q=this.buffer.ybase+this.buffer.y,U=this.buffer.lines.get(Q);if(!U)return;const ue=Math.min(this.buffer.x,this.cols-1),oe=this._renderService.dimensions.css.cell.height,de=U.getWidth(ue),he=this._renderService.dimensions.css.cell.width*de,De=this.buffer.y*this._renderService.dimensions.css.cell.height,Ie=ue*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ie+"px",this.textarea.style.top=De+"px",this.textarea.style.width=he+"px",this.textarea.style.height=oe+"px",this.textarea.style.lineHeight=oe+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,m.addDisposableDomListener)(this.element,"copy",(U=>{this.hasSelection()&&(0,h.copyHandler)(U,this._selectionService)})));const Q=U=>(0,h.handlePasteEvent)(U,this.textarea,this.coreService,this.optionsService);this.register((0,m.addDisposableDomListener)(this.textarea,"paste",Q)),this.register((0,m.addDisposableDomListener)(this.element,"paste",Q)),ee.isFirefox?this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(U=>{U.button===2&&(0,h.rightClickHandler)(U,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,m.addDisposableDomListener)(this.element,"contextmenu",(U=>{(0,h.rightClickHandler)(U,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),ee.isLinux&&this.register((0,m.addDisposableDomListener)(this.element,"auxclick",(U=>{U.button===1&&(0,h.moveTextAreaUnderMouseCursor)(U,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,m.addDisposableDomListener)(this.textarea,"keyup",(Q=>this._keyUp(Q)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keydown",(Q=>this._keyDown(Q)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keypress",(Q=>this._keyPress(Q)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionupdate",(Q=>this._compositionHelper.compositionupdate(Q)))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,m.addDisposableDomListener)(this.textarea,"input",(Q=>this._inputEvent(Q)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Q){var ue;if(!Q)throw new Error("Terminal requires a parent element.");if(Q.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ue=this.element)==null?void 0:ue.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=Q.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),Q.appendChild(this.element);const U=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),U.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,m.addDisposableDomListener)(this.screenElement,"mousemove",(oe=>this.updateCursorStyle(oe)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),U.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",y.promptLabel),ee.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(M.CoreBrowserService,this.textarea,Q.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(P.ICoreBrowserService,this._coreBrowserService),this.register((0,m.addDisposableDomListener)(this.textarea,"focus",(oe=>this._handleTextAreaFocus(oe)))),this.register((0,m.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(_.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(P.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(K.ThemeService),this._instantiationService.setService(P.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(T.CharacterJoinerService),this._instantiationService.setService(P.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(L.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(P.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((oe=>this._onRender.fire(oe)))),this.onResize((oe=>this._renderService.resize(oe.cols,oe.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(S.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(k.MouseService),this._instantiationService.setService(P.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(p.Linkifier,this.screenElement)),this.element.appendChild(U);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(A.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(D.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(P.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((oe=>this._renderService.handleSelectionChanged(oe.start,oe.end,oe.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((oe=>{this.textarea.value=oe,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((oe=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(w.BufferDecorationRenderer,this.screenElement)),this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(oe=>this._selectionService.handleMouseDown(oe)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(ne.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(g.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Q=this,U=this.element;function ue(he){const De=Q._mouseService.getMouseReportCoords(he,Q.screenElement);if(!De)return!1;let Ie,Fe;switch(he.overrideType||he.type){case"mousemove":Fe=32,he.buttons===void 0?(Ie=3,he.button!==void 0&&(Ie=he.button<3?he.button:3)):Ie=1&he.buttons?0:4&he.buttons?1:2&he.buttons?2:3;break;case"mouseup":Fe=0,Ie=he.button<3?he.button:3;break;case"mousedown":Fe=1,Ie=he.button<3?he.button:3;break;case"wheel":if(Q._customWheelEventHandler&&Q._customWheelEventHandler(he)===!1||Q.viewport.getLinesScrolled(he)===0)return!1;Fe=he.deltaY<0?0:1,Ie=4;break;default:return!1}return!(Fe===void 0||Ie===void 0||Ie>4)&&Q.coreMouseService.triggerMouseEvent({col:De.col,row:De.row,x:De.x,y:De.y,button:Ie,action:Fe,ctrl:he.ctrlKey,alt:he.altKey,shift:he.shiftKey})}const oe={mouseup:null,wheel:null,mousedrag:null,mousemove:null},de={mouseup:he=>(ue(he),he.buttons||(this._document.removeEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.removeEventListener("mousemove",oe.mousedrag)),this.cancel(he)),wheel:he=>(ue(he),this.cancel(he,!0)),mousedrag:he=>{he.buttons&&ue(he)},mousemove:he=>{he.buttons||ue(he)}};this.register(this.coreMouseService.onProtocolChange((he=>{he?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(he)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&he?oe.mousemove||(U.addEventListener("mousemove",de.mousemove),oe.mousemove=de.mousemove):(U.removeEventListener("mousemove",oe.mousemove),oe.mousemove=null),16&he?oe.wheel||(U.addEventListener("wheel",de.wheel,{passive:!1}),oe.wheel=de.wheel):(U.removeEventListener("wheel",oe.wheel),oe.wheel=null),2&he?oe.mouseup||(oe.mouseup=de.mouseup):(this._document.removeEventListener("mouseup",oe.mouseup),oe.mouseup=null),4&he?oe.mousedrag||(oe.mousedrag=de.mousedrag):(this._document.removeEventListener("mousemove",oe.mousedrag),oe.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,m.addDisposableDomListener)(U,"mousedown",(he=>{if(he.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(he))return ue(he),oe.mouseup&&this._document.addEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.addEventListener("mousemove",oe.mousedrag),this.cancel(he)}))),this.register((0,m.addDisposableDomListener)(U,"wheel",(he=>{if(!oe.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(he)===!1)return!1;if(!this.buffer.hasScrollback){const De=this.viewport.getLinesScrolled(he);if(De===0)return;const Ie=re.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(he.deltaY<0?"A":"B");let Fe="";for(let je=0;je<Math.abs(De);je++)Fe+=Ie;return this.coreService.triggerDataEvent(Fe,!0),this.cancel(he,!0)}return this.viewport.handleWheel(he)?this.cancel(he):void 0}}),{passive:!1})),this.register((0,m.addDisposableDomListener)(U,"touchstart",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(he),this.cancel(he)}),{passive:!0})),this.register((0,m.addDisposableDomListener)(U,"touchmove",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(he)?void 0:this.cancel(he)}),{passive:!1}))}refresh(Q,U){var ue;(ue=this._renderService)==null||ue.refreshRows(Q,U)}updateCursorStyle(Q){var U;(U=this._selectionService)!=null&&U.shouldColumnSelect(Q)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(Q,U,ue=0){var oe;ue===1?(super.scrollLines(Q,U,ue),this.refresh(0,this.rows-1)):(oe=this.viewport)==null||oe.scrollLines(Q)}paste(Q){(0,h.paste)(Q,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Q){this._customKeyEventHandler=Q}attachCustomWheelEventHandler(Q){this._customWheelEventHandler=Q}registerLinkProvider(Q){return this._linkProviderService.registerLinkProvider(Q)}registerCharacterJoiner(Q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const U=this._characterJoinerService.register(Q);return this.refresh(0,this.rows-1),U}deregisterCharacterJoiner(Q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Q)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Q){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Q)}registerDecoration(Q){return this._decorationService.registerDecoration(Q)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Q,U,ue){this._selectionService.setSelection(Q,U,ue)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var Q;(Q=this._selectionService)==null||Q.clearSelection()}selectAll(){var Q;(Q=this._selectionService)==null||Q.selectAll()}selectLines(Q,U){var ue;(ue=this._selectionService)==null||ue.selectLines(Q,U)}_keyDown(Q){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;const U=this.browser.isMac&&this.options.macOptionIsMeta&&Q.altKey;if(!U&&!this._compositionHelper.keydown(Q))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;U||Q.key!=="Dead"&&Q.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ue=(0,te.evaluateKeyboardEvent)(Q,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Q),ue.type===3||ue.type===2){const oe=this.rows-1;return this.scrollLines(ue.type===2?-oe:oe),this.cancel(Q,!0)}return ue.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Q)||(ue.cancel&&this.cancel(Q,!0),!ue.key||!!(Q.key&&!Q.ctrlKey&&!Q.altKey&&!Q.metaKey&&Q.key.length===1&&Q.key.charCodeAt(0)>=65&&Q.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ue.key!==re.C0.ETX&&ue.key!==re.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ue.key,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent(ue.key,!0),!this.optionsService.rawOptions.screenReaderMode||Q.altKey||Q.ctrlKey?this.cancel(Q,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Q,U){const ue=Q.isMac&&!this.options.macOptionIsMeta&&U.altKey&&!U.ctrlKey&&!U.metaKey||Q.isWindows&&U.altKey&&U.ctrlKey&&!U.metaKey||Q.isWindows&&U.getModifierState("AltGraph");return U.type==="keypress"?ue:ue&&(!U.keyCode||U.keyCode>47)}_keyUp(Q){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1||((function(U){return U.keyCode===16||U.keyCode===17||U.keyCode===18})(Q)||this.focus(),this.updateCursorStyle(Q),this._keyPressHandled=!1)}_keyPress(Q){let U;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;if(this.cancel(Q),Q.charCode)U=Q.charCode;else if(Q.which===null||Q.which===void 0)U=Q.keyCode;else{if(Q.which===0||Q.charCode===0)return!1;U=Q.which}return!(!U||(Q.altKey||Q.ctrlKey||Q.metaKey)&&!this._isThirdLevelShift(this.browser,Q)||(U=String.fromCharCode(U),this._onKey.fire({key:U,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent(U,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Q){if(Q.data&&Q.inputType==="insertText"&&(!Q.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const U=Q.data;return this.coreService.triggerDataEvent(U,!0),this.cancel(Q),!0}return!1}resize(Q,U){Q!==this.cols||U!==this.rows?super.resize(Q,U):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Q,U){var ue,oe;(ue=this._charSizeService)==null||ue.measure(),(oe=this.viewport)==null||oe.syncScrollArea(!0)}clear(){var Q;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let U=1;U<this.rows;U++)this.buffer.lines.push(this.buffer.getBlankLine(Y.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(Q=this.viewport)==null||Q.reset(),this.refresh(0,this.rows-1)}}reset(){var U,ue;this.options.rows=this.rows,this.options.cols=this.cols;const Q=this._customKeyEventHandler;this._setup(),super.reset(),(U=this._selectionService)==null||U.reset(),this._decorationService.reset(),(ue=this.viewport)==null||ue.reset(),this._customKeyEventHandler=Q,this.refresh(0,this.rows-1)}clearTextureAtlas(){var Q;(Q=this._renderService)==null||Q.clearTextureAtlas()}_reportFocus(){var Q;(Q=this.element)!=null&&Q.classList.contains("focus")?this.coreService.triggerDataEvent(re.C0.ESC+"[I"):this.coreService.triggerDataEvent(re.C0.ESC+"[O")}_reportWindowsOptions(Q){if(this._renderService)switch(Q){case q.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const U=this._renderService.dimensions.css.canvas.width.toFixed(0),ue=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${re.C0.ESC}[4;${ue};${U}t`);break;case q.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const oe=this._renderService.dimensions.css.cell.width.toFixed(0),de=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${re.C0.ESC}[6;${de};${oe}t`)}}cancel(Q,U){if(this.options.cancelEvents||U)return Q.preventDefault(),Q.stopPropagation(),!1}}l.Terminal=be},9924:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.TimeBasedDebouncer=class{constructor(c,h=1e3){this._renderCallback=c,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,h,m){this._rowCount=m,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const p=Date.now();if(p-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=p,this._innerRefresh();else if(!this._additionalRefreshRequested){const y=p-this._lastRefreshMs,x=this._debounceThresholdMS-y;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),x)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h)}}},1680:function(f,l,c){var h=this&&this.__decorate||function(S,g,_,T){var M,k=arguments.length,L=k<3?g:T===null?T=Object.getOwnPropertyDescriptor(g,_):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(S,g,_,T);else for(var D=S.length-1;D>=0;D--)(M=S[D])&&(L=(k<3?M(L):k>3?M(g,_,L):M(g,_))||L);return k>3&&L&&Object.defineProperty(g,_,L),L},m=this&&this.__param||function(S,g){return function(_,T){g(_,T,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const p=c(3656),y=c(4725),x=c(8460),A=c(844),w=c(2585);let v=l.Viewport=class extends A.Disposable{constructor(S,g,_,T,M,k,L,D){super(),this._viewportElement=S,this._scrollArea=g,this._bufferService=_,this._optionsService=T,this._charSizeService=M,this._renderService=k,this._coreBrowserService=L,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((P=>this._activeBuffer=P.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((P=>this._renderDimensions=P))),this._handleThemeChange(D.colors),this.register(D.onChangeColors((P=>this._handleThemeChange(P)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(S){this._viewportElement.style.backgroundColor=S.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(S){if(S)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const g=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==g&&(this._lastRecordedBufferHeight=g,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const S=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==S&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=S),this._refreshAnimationFrame=null}syncScrollArea(S=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(S);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(S)}_handleScroll(S){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const g=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:g,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const S=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(S*(this._smoothScrollState.target-this._smoothScrollState.origin)),S<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(S,g){const _=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(g<0&&this._viewportElement.scrollTop!==0||g>0&&_<this._lastRecordedBufferHeight)||(S.cancelable&&S.preventDefault(),!1)}handleWheel(S){const g=this._getPixelsScrolled(S);return g!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+g:this._smoothScrollState.target+=g,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=g,this._bubbleScroll(S,g))}scrollLines(S){if(S!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const g=S*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+g,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:S,suppressScrollEvent:!1})}_getPixelsScrolled(S){if(S.deltaY===0||S.shiftKey)return 0;let g=this._applyScrollModifier(S.deltaY,S);return S.deltaMode===WheelEvent.DOM_DELTA_LINE?g*=this._currentRowHeight:S.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(g*=this._currentRowHeight*this._bufferService.rows),g}getBufferElements(S,g){var D;let _,T="";const M=[],k=g??this._bufferService.buffer.lines.length,L=this._bufferService.buffer.lines;for(let P=S;P<k;P++){const K=L.get(P);if(!K)continue;const $=(D=L.get(P+1))==null?void 0:D.isWrapped;if(T+=K.translateToString(!$),!$||P===L.length-1){const z=document.createElement("div");z.textContent=T,M.push(z),T.length>0&&(_=z),T=""}}return{bufferElements:M,cursorElement:_}}getLinesScrolled(S){if(S.deltaY===0||S.shiftKey)return 0;let g=this._applyScrollModifier(S.deltaY,S);return S.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(g/=this._currentRowHeight+0,this._wheelPartialScroll+=g,g=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):S.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(g*=this._bufferService.rows),g}_applyScrollModifier(S,g){const _=this._optionsService.rawOptions.fastScrollModifier;return _==="alt"&&g.altKey||_==="ctrl"&&g.ctrlKey||_==="shift"&&g.shiftKey?S*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:S*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(S){this._lastTouchY=S.touches[0].pageY}handleTouchMove(S){const g=this._lastTouchY-S.touches[0].pageY;return this._lastTouchY=S.touches[0].pageY,g!==0&&(this._viewportElement.scrollTop+=g,this._bubbleScroll(S,g))}};l.Viewport=v=h([m(2,w.IBufferService),m(3,w.IOptionsService),m(4,y.ICharSizeService),m(5,y.IRenderService),m(6,y.ICoreBrowserService),m(7,y.IThemeService)],v)},3107:function(f,l,c){var h=this&&this.__decorate||function(w,v,S,g){var _,T=arguments.length,M=T<3?v:g===null?g=Object.getOwnPropertyDescriptor(v,S):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(w,v,S,g);else for(var k=w.length-1;k>=0;k--)(_=w[k])&&(M=(T<3?_(M):T>3?_(v,S,M):_(v,S))||M);return T>3&&M&&Object.defineProperty(v,S,M),M},m=this&&this.__param||function(w,v){return function(S,g){v(S,g,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const p=c(4725),y=c(844),x=c(2585);let A=l.BufferDecorationRenderer=class extends y.Disposable{constructor(w,v,S,g,_){super(),this._screenElement=w,this._bufferService=v,this._coreBrowserService=S,this._decorationService=g,this._renderService=_,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((T=>this._removeDecoration(T)))),this.register((0,y.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const w of this._decorationService.decorations)this._renderDecoration(w);this._dimensionsChanged=!1}_renderDecoration(w){this._refreshStyle(w),this._dimensionsChanged&&this._refreshXPosition(w)}_createElement(w){var g;const v=this._coreBrowserService.mainDocument.createElement("div");v.classList.add("xterm-decoration"),v.classList.toggle("xterm-decoration-top-layer",((g=w==null?void 0:w.options)==null?void 0:g.layer)==="top"),v.style.width=`${Math.round((w.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,v.style.height=(w.options.height||1)*this._renderService.dimensions.css.cell.height+"px",v.style.top=(w.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",v.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const S=w.options.x??0;return S&&S>this._bufferService.cols&&(v.style.display="none"),this._refreshXPosition(w,v),v}_refreshStyle(w){const v=w.marker.line-this._bufferService.buffers.active.ydisp;if(v<0||v>=this._bufferService.rows)w.element&&(w.element.style.display="none",w.onRenderEmitter.fire(w.element));else{let S=this._decorationElements.get(w);S||(S=this._createElement(w),w.element=S,this._decorationElements.set(w,S),this._container.appendChild(S),w.onDispose((()=>{this._decorationElements.delete(w),S.remove()}))),S.style.top=v*this._renderService.dimensions.css.cell.height+"px",S.style.display=this._altBufferIsActive?"none":"block",w.onRenderEmitter.fire(S)}}_refreshXPosition(w,v=w.element){if(!v)return;const S=w.options.x??0;(w.options.anchor||"left")==="right"?v.style.right=S?S*this._renderService.dimensions.css.cell.width+"px":"":v.style.left=S?S*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(w){var v;(v=this._decorationElements.get(w))==null||v.remove(),this._decorationElements.delete(w),w.dispose()}};l.BufferDecorationRenderer=A=h([m(1,x.IBufferService),m(2,p.ICoreBrowserService),m(3,x.IDecorationService),m(4,p.IRenderService)],A)},5871:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorZoneStore=void 0,l.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const h of this._zones)if(h.color===c.options.overviewRulerOptions.color&&h.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,c.marker.line))return;if(this._lineAdjacentToZone(h,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(h,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,h){return h>=c.startBufferLine&&h<=c.endBufferLine}_lineAdjacentToZone(c,h,m){return h>=c.startBufferLine-this._linePadding[m||"full"]&&h<=c.endBufferLine+this._linePadding[m||"full"]}_addLineToZone(c,h){c.startBufferLine=Math.min(c.startBufferLine,h),c.endBufferLine=Math.max(c.endBufferLine,h)}}},5744:function(f,l,c){var h=this&&this.__decorate||function(_,T,M,k){var L,D=arguments.length,P=D<3?T:k===null?k=Object.getOwnPropertyDescriptor(T,M):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(_,T,M,k);else for(var K=_.length-1;K>=0;K--)(L=_[K])&&(P=(D<3?L(P):D>3?L(T,M,P):L(T,M))||P);return D>3&&P&&Object.defineProperty(T,M,P),P},m=this&&this.__param||function(_,T){return function(M,k){T(M,k,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const p=c(5871),y=c(4725),x=c(844),A=c(2585),w={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0},S={full:0,left:0,center:0,right:0};let g=l.OverviewRulerRenderer=class extends x.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(_,T,M,k,L,D,P){var $;super(),this._viewportElement=_,this._screenElement=T,this._bufferService=M,this._decorationService=k,this._renderService=L,this._optionsService=D,this._coreBrowserService=P,this._colorZoneStore=new p.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),($=this._viewportElement.parentElement)==null||$.insertBefore(this._canvas,this._viewportElement);const K=this._canvas.getContext("2d");if(!K)throw new Error("Ctx cannot be null");this._ctx=K,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,x.toDisposable)((()=>{var z;(z=this._canvas)==null||z.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const _=Math.floor(this._canvas.width/3),T=Math.ceil(this._canvas.width/3);v.full=this._canvas.width,v.left=_,v.center=T,v.right=_,this._refreshDrawHeightConstants(),S.full=0,S.left=0,S.center=v.left,S.right=v.left+v.center}_refreshDrawHeightConstants(){w.full=Math.round(2*this._coreBrowserService.dpr);const _=this._canvas.height/this._bufferService.buffer.lines.length,T=Math.round(Math.max(Math.min(_,12),6)*this._coreBrowserService.dpr);w.left=T,w.center=T,w.right=T}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const T of this._decorationService.decorations)this._colorZoneStore.addDecoration(T);this._ctx.lineWidth=1;const _=this._colorZoneStore.zones;for(const T of _)T.position!=="full"&&this._renderColorZone(T);for(const T of _)T.position==="full"&&this._renderColorZone(T);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(_){this._ctx.fillStyle=_.color,this._ctx.fillRect(S[_.position||"full"],Math.round((this._canvas.height-1)*(_.startBufferLine/this._bufferService.buffers.active.lines.length)-w[_.position||"full"]/2),v[_.position||"full"],Math.round((this._canvas.height-1)*((_.endBufferLine-_.startBufferLine)/this._bufferService.buffers.active.lines.length)+w[_.position||"full"]))}_queueRefresh(_,T){this._shouldUpdateDimensions=_||this._shouldUpdateDimensions,this._shouldUpdateAnchor=T||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};l.OverviewRulerRenderer=g=h([m(2,A.IBufferService),m(3,A.IDecorationService),m(4,y.IRenderService),m(5,A.IOptionsService),m(6,y.ICoreBrowserService)],g)},2950:function(f,l,c){var h=this&&this.__decorate||function(w,v,S,g){var _,T=arguments.length,M=T<3?v:g===null?g=Object.getOwnPropertyDescriptor(v,S):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(w,v,S,g);else for(var k=w.length-1;k>=0;k--)(_=w[k])&&(M=(T<3?_(M):T>3?_(v,S,M):_(v,S))||M);return T>3&&M&&Object.defineProperty(v,S,M),M},m=this&&this.__param||function(w,v){return function(S,g){v(S,g,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const p=c(4725),y=c(2585),x=c(2584);let A=l.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(w,v,S,g,_,T){this._textarea=w,this._compositionView=v,this._bufferService=S,this._optionsService=g,this._coreService=_,this._renderService=T,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(w){this._compositionView.textContent=w.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(w){if(this._isComposing||this._isSendingComposition){if(w.keyCode===229||w.keyCode===16||w.keyCode===17||w.keyCode===18)return!1;this._finalizeComposition(!1)}return w.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(w){if(this._compositionView.classList.remove("active"),this._isComposing=!1,w){const v={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let S;this._isSendingComposition=!1,v.start+=this._dataAlreadySent.length,S=this._isComposing?this._textarea.value.substring(v.start,v.end):this._textarea.value.substring(v.start),S.length>0&&this._coreService.triggerDataEvent(S,!0)}}),0)}else{this._isSendingComposition=!1;const v=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(v,!0)}}_handleAnyTextareaChanges(){const w=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const v=this._textarea.value,S=v.replace(w,"");this._dataAlreadySent=S,v.length>w.length?this._coreService.triggerDataEvent(S,!0):v.length<w.length?this._coreService.triggerDataEvent(`${x.C0.DEL}`,!0):v.length===w.length&&v!==w&&this._coreService.triggerDataEvent(v,!0)}}),0)}updateCompositionElements(w){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const v=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),S=this._renderService.dimensions.css.cell.height,g=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,_=v*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=_+"px",this._compositionView.style.top=g+"px",this._compositionView.style.height=S+"px",this._compositionView.style.lineHeight=S+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const T=this._compositionView.getBoundingClientRect();this._textarea.style.left=_+"px",this._textarea.style.top=g+"px",this._textarea.style.width=Math.max(T.width,1)+"px",this._textarea.style.height=Math.max(T.height,1)+"px",this._textarea.style.lineHeight=T.height+"px"}w||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};l.CompositionHelper=A=h([m(2,y.IBufferService),m(3,y.IOptionsService),m(4,y.ICoreService),m(5,p.IRenderService)],A)},9806:(f,l)=>{function c(h,m,p){const y=p.getBoundingClientRect(),x=h.getComputedStyle(p),A=parseInt(x.getPropertyValue("padding-left")),w=parseInt(x.getPropertyValue("padding-top"));return[m.clientX-y.left-A,m.clientY-y.top-w]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=c,l.getCoords=function(h,m,p,y,x,A,w,v,S){if(!A)return;const g=c(h,m,p);return g?(g[0]=Math.ceil((g[0]+(S?w/2:0))/w),g[1]=Math.ceil(g[1]/v),g[0]=Math.min(Math.max(g[0],1),y+(S?1:0)),g[1]=Math.min(Math.max(g[1],1),x),g):void 0}},9504:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const h=c(2584);function m(v,S,g,_){const T=v-p(v,g),M=S-p(S,g),k=Math.abs(T-M)-(function(L,D,P){let K=0;const $=L-p(L,P),z=D-p(D,P);for(let W=0;W<Math.abs($-z);W++){const F=y(L,D)==="A"?-1:1,ee=P.buffer.lines.get($+F*W);ee!=null&&ee.isWrapped&&K++}return K})(v,S,g);return w(k,A(y(v,S),_))}function p(v,S){let g=0,_=S.buffer.lines.get(v),T=_==null?void 0:_.isWrapped;for(;T&&v>=0&&v<S.rows;)g++,_=S.buffer.lines.get(--v),T=_==null?void 0:_.isWrapped;return g}function y(v,S){return v>S?"A":"B"}function x(v,S,g,_,T,M){let k=v,L=S,D="";for(;k!==g||L!==_;)k+=T?1:-1,T&&k>M.cols-1?(D+=M.buffer.translateBufferLineToString(L,!1,v,k),k=0,v=0,L++):!T&&k<0&&(D+=M.buffer.translateBufferLineToString(L,!1,0,v+1),k=M.cols-1,v=k,L--);return D+M.buffer.translateBufferLineToString(L,!1,v,k)}function A(v,S){const g=S?"O":"[";return h.C0.ESC+g+v}function w(v,S){v=Math.floor(v);let g="";for(let _=0;_<v;_++)g+=S;return g}l.moveToCellSequence=function(v,S,g,_){const T=g.buffer.x,M=g.buffer.y;if(!g.buffer.hasScrollback)return(function(D,P,K,$,z,W){return m(P,$,z,W).length===0?"":w(x(D,P,D,P-p(P,z),!1,z).length,A("D",W))})(T,M,0,S,g,_)+m(M,S,g,_)+(function(D,P,K,$,z,W){let F;F=m(P,$,z,W).length>0?$-p($,z):P;const ee=$,Y=(function(re,te,O,G,j,q){let ne;return ne=m(O,G,j,q).length>0?G-p(G,j):te,re<O&&ne<=G||re>=O&&ne<G?"C":"D"})(D,P,K,$,z,W);return w(x(D,F,K,ee,Y==="C",z).length,A(Y,W))})(T,M,v,S,g,_);let k;if(M===S)return k=T>v?"D":"C",w(Math.abs(T-v),A(k,_));k=M>S?"D":"C";const L=Math.abs(M-S);return w((function(D,P){return P.cols-D})(M>S?v:T,g)+(L-1)*g.cols+1+((M>S?T:v)-1),A(k,_))}},1296:function(f,l,c){var h=this&&this.__decorate||function(W,F,ee,Y){var re,te=arguments.length,O=te<3?F:Y===null?Y=Object.getOwnPropertyDescriptor(F,ee):Y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(W,F,ee,Y);else for(var G=W.length-1;G>=0;G--)(re=W[G])&&(O=(te<3?re(O):te>3?re(F,ee,O):re(F,ee))||O);return te>3&&O&&Object.defineProperty(F,ee,O),O},m=this&&this.__param||function(W,F){return function(ee,Y){F(ee,Y,W)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const p=c(3787),y=c(2550),x=c(2223),A=c(6171),w=c(6052),v=c(4725),S=c(8055),g=c(8460),_=c(844),T=c(2585),M="xterm-dom-renderer-owner-",k="xterm-rows",L="xterm-fg-",D="xterm-bg-",P="xterm-focus",K="xterm-selection";let $=1,z=l.DomRenderer=class extends _.Disposable{constructor(W,F,ee,Y,re,te,O,G,j,q,ne,Z,be){super(),this._terminal=W,this._document=F,this._element=ee,this._screenElement=Y,this._viewportElement=re,this._helperContainer=te,this._linkifier2=O,this._charSizeService=j,this._optionsService=q,this._bufferService=ne,this._coreBrowserService=Z,this._themeService=be,this._terminalClass=$++,this._rowElements=[],this._selectionRenderModel=(0,w.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new g.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(k),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(K),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,A.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((fe=>this._injectCss(fe)))),this._injectCss(this._themeService.colors),this._rowFactory=G.createInstance(p.DomRendererRowFactory,document),this._element.classList.add(M+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((fe=>this._handleLinkHover(fe)))),this.register(this._linkifier2.onHideLinkUnderline((fe=>this._handleLinkLeave(fe)))),this.register((0,_.toDisposable)((()=>{this._element.classList.remove(M+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new y.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const W=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*W,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*W),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/W),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/W),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const ee of this._rowElements)ee.style.width=`${this.dimensions.css.canvas.width}px`,ee.style.height=`${this.dimensions.css.cell.height}px`,ee.style.lineHeight=`${this.dimensions.css.cell.height}px`,ee.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const F=`${this._terminalSelector} .${k} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=F,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(W){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let F=`${this._terminalSelector} .${k} { color: ${W.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;F+=`${this._terminalSelector} .${k} .xterm-dim { color: ${S.color.multiplyOpacity(W.foreground,.5).css};}`,F+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const ee=`blink_underline_${this._terminalClass}`,Y=`blink_bar_${this._terminalClass}`,re=`blink_block_${this._terminalClass}`;F+=`@keyframes ${ee} { 50% { border-bottom-style: hidden; }}`,F+=`@keyframes ${Y} { 50% { box-shadow: none; }}`,F+=`@keyframes ${re} { 0% { background-color: ${W.cursor.css}; color: ${W.cursorAccent.css}; } 50% { background-color: inherit; color: ${W.cursor.css}; }}`,F+=`${this._terminalSelector} .${k}.${P} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${ee} 1s step-end infinite;}${this._terminalSelector} .${k}.${P} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${k}.${P} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${re} 1s step-end infinite;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-block { background-color: ${W.cursor.css}; color: ${W.cursorAccent.css};}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${W.cursor.css} !important; color: ${W.cursorAccent.css} !important;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${W.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${W.cursor.css} inset;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${W.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,F+=`${this._terminalSelector} .${K} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${K} div { position: absolute; background-color: ${W.selectionBackgroundOpaque.css};}${this._terminalSelector} .${K} div { position: absolute; background-color: ${W.selectionInactiveBackgroundOpaque.css};}`;for(const[te,O]of W.ansi.entries())F+=`${this._terminalSelector} .${L}${te} { color: ${O.css}; }${this._terminalSelector} .${L}${te}.xterm-dim { color: ${S.color.multiplyOpacity(O,.5).css}; }${this._terminalSelector} .${D}${te} { background-color: ${O.css}; }`;F+=`${this._terminalSelector} .${L}${x.INVERTED_DEFAULT_COLOR} { color: ${S.color.opaque(W.background).css}; }${this._terminalSelector} .${L}${x.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${S.color.multiplyOpacity(S.color.opaque(W.background),.5).css}; }${this._terminalSelector} .${D}${x.INVERTED_DEFAULT_COLOR} { background-color: ${W.foreground.css}; }`,this._themeStyleElement.textContent=F}_setDefaultSpacing(){const W=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${W}px`,this._rowFactory.defaultSpacing=W}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(W,F){for(let ee=this._rowElements.length;ee<=F;ee++){const Y=this._document.createElement("div");this._rowContainer.appendChild(Y),this._rowElements.push(Y)}for(;this._rowElements.length>F;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(W,F){this._refreshRowElements(W,F),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(P),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(P),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(W,F,ee){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(W,F,ee),this.renderRows(0,this._bufferService.rows-1),!W||!F)return;this._selectionRenderModel.update(this._terminal,W,F,ee);const Y=this._selectionRenderModel.viewportStartRow,re=this._selectionRenderModel.viewportEndRow,te=this._selectionRenderModel.viewportCappedStartRow,O=this._selectionRenderModel.viewportCappedEndRow;if(te>=this._bufferService.rows||O<0)return;const G=this._document.createDocumentFragment();if(ee){const j=W[0]>F[0];G.appendChild(this._createSelectionElement(te,j?F[0]:W[0],j?W[0]:F[0],O-te+1))}else{const j=Y===te?W[0]:0,q=te===re?F[0]:this._bufferService.cols;G.appendChild(this._createSelectionElement(te,j,q));const ne=O-te-1;if(G.appendChild(this._createSelectionElement(te+1,0,this._bufferService.cols,ne)),te!==O){const Z=re===O?F[0]:this._bufferService.cols;G.appendChild(this._createSelectionElement(O,0,Z))}}this._selectionContainer.appendChild(G)}_createSelectionElement(W,F,ee,Y=1){const re=this._document.createElement("div"),te=F*this.dimensions.css.cell.width;let O=this.dimensions.css.cell.width*(ee-F);return te+O>this.dimensions.css.canvas.width&&(O=this.dimensions.css.canvas.width-te),re.style.height=Y*this.dimensions.css.cell.height+"px",re.style.top=W*this.dimensions.css.cell.height+"px",re.style.left=`${te}px`,re.style.width=`${O}px`,re}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const W of this._rowElements)W.replaceChildren()}renderRows(W,F){const ee=this._bufferService.buffer,Y=ee.ybase+ee.y,re=Math.min(ee.x,this._bufferService.cols-1),te=this._optionsService.rawOptions.cursorBlink,O=this._optionsService.rawOptions.cursorStyle,G=this._optionsService.rawOptions.cursorInactiveStyle;for(let j=W;j<=F;j++){const q=j+ee.ydisp,ne=this._rowElements[j],Z=ee.lines.get(q);if(!ne||!Z)break;ne.replaceChildren(...this._rowFactory.createRow(Z,q,q===Y,O,G,re,te,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${M}${this._terminalClass}`}_handleLinkHover(W){this._setCellUnderline(W.x1,W.x2,W.y1,W.y2,W.cols,!0)}_handleLinkLeave(W){this._setCellUnderline(W.x1,W.x2,W.y1,W.y2,W.cols,!1)}_setCellUnderline(W,F,ee,Y,re,te){ee<0&&(W=0),Y<0&&(F=0);const O=this._bufferService.rows-1;ee=Math.max(Math.min(ee,O),0),Y=Math.max(Math.min(Y,O),0),re=Math.min(re,this._bufferService.cols);const G=this._bufferService.buffer,j=G.ybase+G.y,q=Math.min(G.x,re-1),ne=this._optionsService.rawOptions.cursorBlink,Z=this._optionsService.rawOptions.cursorStyle,be=this._optionsService.rawOptions.cursorInactiveStyle;for(let fe=ee;fe<=Y;++fe){const Q=fe+G.ydisp,U=this._rowElements[fe],ue=G.lines.get(Q);if(!U||!ue)break;U.replaceChildren(...this._rowFactory.createRow(ue,Q,Q===j,Z,be,q,ne,this.dimensions.css.cell.width,this._widthCache,te?fe===ee?W:0:-1,te?(fe===Y?F:re)-1:-1))}}};l.DomRenderer=z=h([m(7,T.IInstantiationService),m(8,v.ICharSizeService),m(9,T.IOptionsService),m(10,T.IBufferService),m(11,v.ICoreBrowserService),m(12,v.IThemeService)],z)},3787:function(f,l,c){var h=this&&this.__decorate||function(k,L,D,P){var K,$=arguments.length,z=$<3?L:P===null?P=Object.getOwnPropertyDescriptor(L,D):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(k,L,D,P);else for(var W=k.length-1;W>=0;W--)(K=k[W])&&(z=($<3?K(z):$>3?K(L,D,z):K(L,D))||z);return $>3&&z&&Object.defineProperty(L,D,z),z},m=this&&this.__param||function(k,L){return function(D,P){L(D,P,k)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const p=c(2223),y=c(643),x=c(511),A=c(2585),w=c(8055),v=c(4725),S=c(4269),g=c(6171),_=c(3734);let T=l.DomRendererRowFactory=class{constructor(k,L,D,P,K,$,z){this._document=k,this._characterJoinerService=L,this._optionsService=D,this._coreBrowserService=P,this._coreService=K,this._decorationService=$,this._themeService=z,this._workCell=new x.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(k,L,D){this._selectionStart=k,this._selectionEnd=L,this._columnSelectMode=D}createRow(k,L,D,P,K,$,z,W,F,ee,Y){const re=[],te=this._characterJoinerService.getJoinedCharacters(L),O=this._themeService.colors;let G,j=k.getNoBgTrimmedLength();D&&j<$+1&&(j=$+1);let q=0,ne="",Z=0,be=0,fe=0,Q=!1,U=0,ue=!1,oe=0;const de=[],he=ee!==-1&&Y!==-1;for(let De=0;De<j;De++){k.loadCell(De,this._workCell);let Ie=this._workCell.getWidth();if(Ie===0)continue;let Fe=!1,je=De,Oe=this._workCell;if(te.length>0&&De===te[0][0]){Fe=!0;const at=te.shift();Oe=new S.JoinedCellData(this._workCell,k.translateToString(!0,at[0],at[1]),at[1]-at[0]),je=at[1]-1,Ie=Oe.getWidth()}const Lt=this._isCellInSelection(De,L),Tt=D&&De===$,Vt=he&&De>=ee&&De<=Y;let Rt=!1;this._decorationService.forEachDecorationAtCell(De,L,void 0,(at=>{Rt=!0}));let bn=Oe.getChars()||y.WHITESPACE_CELL_CHAR;if(bn===" "&&(Oe.isUnderline()||Oe.isOverline())&&(bn=" "),oe=Ie*W-F.get(bn,Oe.isBold(),Oe.isItalic()),G){if(q&&(Lt&&ue||!Lt&&!ue&&Oe.bg===Z)&&(Lt&&ue&&O.selectionForeground||Oe.fg===be)&&Oe.extended.ext===fe&&Vt===Q&&oe===U&&!Tt&&!Fe&&!Rt){Oe.isInvisible()?ne+=y.WHITESPACE_CELL_CHAR:ne+=bn,q++;continue}q&&(G.textContent=ne),G=this._document.createElement("span"),q=0,ne=""}else G=this._document.createElement("span");if(Z=Oe.bg,be=Oe.fg,fe=Oe.extended.ext,Q=Vt,U=oe,ue=Lt,Fe&&$>=De&&$<=je&&($=De),!this._coreService.isCursorHidden&&Tt&&this._coreService.isCursorInitialized){if(de.push("xterm-cursor"),this._coreBrowserService.isFocused)z&&de.push("xterm-cursor-blink"),de.push(P==="bar"?"xterm-cursor-bar":P==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(K)switch(K){case"outline":de.push("xterm-cursor-outline");break;case"block":de.push("xterm-cursor-block");break;case"bar":de.push("xterm-cursor-bar");break;case"underline":de.push("xterm-cursor-underline")}}if(Oe.isBold()&&de.push("xterm-bold"),Oe.isItalic()&&de.push("xterm-italic"),Oe.isDim()&&de.push("xterm-dim"),ne=Oe.isInvisible()?y.WHITESPACE_CELL_CHAR:Oe.getChars()||y.WHITESPACE_CELL_CHAR,Oe.isUnderline()&&(de.push(`xterm-underline-${Oe.extended.underlineStyle}`),ne===" "&&(ne=" "),!Oe.isUnderlineColorDefault()))if(Oe.isUnderlineColorRGB())G.style.textDecorationColor=`rgb(${_.AttributeData.toColorRGB(Oe.getUnderlineColor()).join(",")})`;else{let at=Oe.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Oe.isBold()&&at<8&&(at+=8),G.style.textDecorationColor=O.ansi[at].css}Oe.isOverline()&&(de.push("xterm-overline"),ne===" "&&(ne=" ")),Oe.isStrikethrough()&&de.push("xterm-strikethrough"),Vt&&(G.style.textDecoration="underline");let Xt=Oe.getFgColor(),Ot=Oe.getFgColorMode(),lr=Oe.getBgColor(),Yr=Oe.getBgColorMode();const Cn=!!Oe.isInverse();if(Cn){const at=Xt;Xt=lr,lr=at;const vr=Ot;Ot=Yr,Yr=vr}let mr,un,gr,Br=!1;switch(this._decorationService.forEachDecorationAtCell(De,L,void 0,(at=>{at.options.layer!=="top"&&Br||(at.backgroundColorRGB&&(Yr=50331648,lr=at.backgroundColorRGB.rgba>>8&16777215,mr=at.backgroundColorRGB),at.foregroundColorRGB&&(Ot=50331648,Xt=at.foregroundColorRGB.rgba>>8&16777215,un=at.foregroundColorRGB),Br=at.options.layer==="top")})),!Br&&Lt&&(mr=this._coreBrowserService.isFocused?O.selectionBackgroundOpaque:O.selectionInactiveBackgroundOpaque,lr=mr.rgba>>8&16777215,Yr=50331648,Br=!0,O.selectionForeground&&(Ot=50331648,Xt=O.selectionForeground.rgba>>8&16777215,un=O.selectionForeground)),Br&&de.push("xterm-decoration-top"),Yr){case 16777216:case 33554432:gr=O.ansi[lr],de.push(`xterm-bg-${lr}`);break;case 50331648:gr=w.channels.toColor(lr>>16,lr>>8&255,255&lr),this._addStyle(G,`background-color:#${M((lr>>>0).toString(16),"0",6)}`);break;default:Cn?(gr=O.foreground,de.push(`xterm-bg-${p.INVERTED_DEFAULT_COLOR}`)):gr=O.background}switch(mr||Oe.isDim()&&(mr=w.color.multiplyOpacity(gr,.5)),Ot){case 16777216:case 33554432:Oe.isBold()&&Xt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Xt+=8),this._applyMinimumContrast(G,gr,O.ansi[Xt],Oe,mr,void 0)||de.push(`xterm-fg-${Xt}`);break;case 50331648:const at=w.channels.toColor(Xt>>16&255,Xt>>8&255,255&Xt);this._applyMinimumContrast(G,gr,at,Oe,mr,un)||this._addStyle(G,`color:#${M(Xt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(G,gr,O.foreground,Oe,mr,un)||Cn&&de.push(`xterm-fg-${p.INVERTED_DEFAULT_COLOR}`)}de.length&&(G.className=de.join(" "),de.length=0),Tt||Fe||Rt?G.textContent=ne:q++,oe!==this.defaultSpacing&&(G.style.letterSpacing=`${oe}px`),re.push(G),De=je}return G&&q&&(G.textContent=ne),re}_applyMinimumContrast(k,L,D,P,K,$){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,g.treatGlyphAsBackgroundColor)(P.getCode()))return!1;const z=this._getContrastCache(P);let W;if(K||$||(W=z.getColor(L.rgba,D.rgba)),W===void 0){const F=this._optionsService.rawOptions.minimumContrastRatio/(P.isDim()?2:1);W=w.color.ensureContrastRatio(K||L,$||D,F),z.setColor((K||L).rgba,($||D).rgba,W??null)}return!!W&&(this._addStyle(k,`color:${W.css}`),!0)}_getContrastCache(k){return k.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(k,L){k.setAttribute("style",`${k.getAttribute("style")||""}${L};`)}_isCellInSelection(k,L){const D=this._selectionStart,P=this._selectionEnd;return!(!D||!P)&&(this._columnSelectMode?D[0]<=P[0]?k>=D[0]&&L>=D[1]&&k<P[0]&&L<=P[1]:k<D[0]&&L>=D[1]&&k>=P[0]&&L<=P[1]:L>D[1]&&L<P[1]||D[1]===P[1]&&L===D[1]&&k>=D[0]&&k<P[0]||D[1]<P[1]&&L===P[1]&&k<P[0]||D[1]<P[1]&&L===D[1]&&k>=D[0])}};function M(k,L,D){for(;k.length<D;)k=L+k;return k}l.DomRendererRowFactory=T=h([m(1,v.ICharacterJoinerService),m(2,A.IOptionsService),m(3,v.ICoreBrowserService),m(4,A.ICoreService),m(5,A.IDecorationService),m(6,v.IThemeService)],T)},2550:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.WidthCache=class{constructor(c,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const m=c.createElement("span");m.classList.add("xterm-char-measure-element");const p=c.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontWeight="bold";const y=c.createElement("span");y.classList.add("xterm-char-measure-element"),y.style.fontStyle="italic";const x=c.createElement("span");x.classList.add("xterm-char-measure-element"),x.style.fontWeight="bold",x.style.fontStyle="italic",this._measureElements=[m,p,y,x],this._container.appendChild(m),this._container.appendChild(p),this._container.appendChild(y),this._container.appendChild(x),h.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,h,m,p){c===this._font&&h===this._fontSize&&m===this._weight&&p===this._weightBold||(this._font=c,this._fontSize=h,this._weight=m,this._weightBold=p,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${m}`,this._measureElements[1].style.fontWeight=`${p}`,this._measureElements[2].style.fontWeight=`${m}`,this._measureElements[3].style.fontWeight=`${p}`,this.clear())}get(c,h,m){let p=0;if(!h&&!m&&c.length===1&&(p=c.charCodeAt(0))<256){if(this._flat[p]!==-9999)return this._flat[p];const A=this._measure(c,0);return A>0&&(this._flat[p]=A),A}let y=c;h&&(y+="B"),m&&(y+="I");let x=this._holey.get(y);if(x===void 0){let A=0;h&&(A|=1),m&&(A|=2),x=this._measure(c,A),x>0&&this._holey.set(y,x)}return x}_measure(c,h){const m=this._measureElements[h];return m.textContent=c.repeat(32),m.offsetWidth/32}}},2223:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const h=c(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(f,l)=>{function c(m){return 57508<=m&&m<=57558}function h(m){return m>=128512&&m<=128591||m>=127744&&m<=128511||m>=128640&&m<=128767||m>=9728&&m<=9983||m>=9984&&m<=10175||m>=65024&&m<=65039||m>=129280&&m<=129535||m>=127462&&m<=127487}Object.defineProperty(l,"__esModule",{value:!0}),l.computeNextVariantOffset=l.createRenderDimensions=l.treatGlyphAsBackgroundColor=l.allowRescaling=l.isEmoji=l.isRestrictedPowerlineGlyph=l.isPowerlineGlyph=l.throwIfFalsy=void 0,l.throwIfFalsy=function(m){if(!m)throw new Error("value must not be falsy");return m},l.isPowerlineGlyph=c,l.isRestrictedPowerlineGlyph=function(m){return 57520<=m&&m<=57527},l.isEmoji=h,l.allowRescaling=function(m,p,y,x){return p===1&&y>Math.ceil(1.5*x)&&m!==void 0&&m>255&&!h(m)&&!c(m)&&!(function(A){return 57344<=A&&A<=63743})(m)},l.treatGlyphAsBackgroundColor=function(m){return c(m)||(function(p){return 9472<=p&&p<=9631})(m)},l.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},l.computeNextVariantOffset=function(m,p,y=0){return(m-(2*Math.round(p)-y))%(2*Math.round(p))}},6052:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(m,p,y,x=!1){if(this.selectionStart=p,this.selectionEnd=y,!p||!y||p[0]===y[0]&&p[1]===y[1])return void this.clear();const A=m.buffers.active.ydisp,w=p[1]-A,v=y[1]-A,S=Math.max(w,0),g=Math.min(v,m.rows-1);S>=m.rows||g<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=x,this.viewportStartRow=w,this.viewportEndRow=v,this.viewportCappedStartRow=S,this.viewportCappedEndRow=g,this.startCol=p[0],this.endCol=y[0])}isCellSelected(m,p,y){return!!this.hasSelection&&(y-=m.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?p>=this.startCol&&y>=this.viewportCappedStartRow&&p<this.endCol&&y<=this.viewportCappedEndRow:p<this.startCol&&y>=this.viewportCappedStartRow&&p>=this.endCol&&y<=this.viewportCappedEndRow:y>this.viewportStartRow&&y<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&y===this.viewportStartRow&&p>=this.startCol&&p<this.endCol||this.viewportStartRow<this.viewportEndRow&&y===this.viewportEndRow&&p<this.endCol||this.viewportStartRow<this.viewportEndRow&&y===this.viewportStartRow&&p>=this.startCol)}}l.createSelectionRenderModel=function(){return new c}},456:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,h=this.selectionEnd;return!(!c||!h)&&(c[1]>h[1]||c[1]===h[1]&&c[0]>h[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(f,l,c){var h=this&&this.__decorate||function(g,_,T,M){var k,L=arguments.length,D=L<3?_:M===null?M=Object.getOwnPropertyDescriptor(_,T):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(g,_,T,M);else for(var P=g.length-1;P>=0;P--)(k=g[P])&&(D=(L<3?k(D):L>3?k(_,T,D):k(_,T))||D);return L>3&&D&&Object.defineProperty(_,T,D),D},m=this&&this.__param||function(g,_){return function(T,M){_(T,M,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const p=c(2585),y=c(8460),x=c(844);let A=l.CharSizeService=class extends x.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(g,_,T){super(),this._optionsService=T,this.width=0,this.height=0,this._onCharSizeChange=this.register(new y.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new S(this._optionsService))}catch{this._measureStrategy=this.register(new v(g,_,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const g=this._measureStrategy.measure();g.width===this.width&&g.height===this.height||(this.width=g.width,this.height=g.height,this._onCharSizeChange.fire())}};l.CharSizeService=A=h([m(2,p.IOptionsService)],A);class w extends x.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(_,T){_!==void 0&&_>0&&T!==void 0&&T>0&&(this._result.width=_,this._result.height=T)}}class v extends w{constructor(_,T,M){super(),this._document=_,this._parentElement=T,this._optionsService=M,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class S extends w{constructor(_){super(),this._optionsService=_,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const T=this._ctx.measureText("W");if(!("width"in T&&"fontBoundingBoxAscent"in T&&"fontBoundingBoxDescent"in T))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const _=this._ctx.measureText("W");return this._validateAndSet(_.width,_.fontBoundingBoxAscent+_.fontBoundingBoxDescent),this._result}}},4269:function(f,l,c){var h=this&&this.__decorate||function(S,g,_,T){var M,k=arguments.length,L=k<3?g:T===null?T=Object.getOwnPropertyDescriptor(g,_):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(S,g,_,T);else for(var D=S.length-1;D>=0;D--)(M=S[D])&&(L=(k<3?M(L):k>3?M(g,_,L):M(g,_))||L);return k>3&&L&&Object.defineProperty(g,_,L),L},m=this&&this.__param||function(S,g){return function(_,T){g(_,T,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const p=c(3734),y=c(643),x=c(511),A=c(2585);class w extends p.AttributeData{constructor(g,_,T){super(),this.content=0,this.combinedData="",this.fg=g.fg,this.bg=g.bg,this.combinedData=_,this._width=T}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(g){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.JoinedCellData=w;let v=l.CharacterJoinerService=class mA{constructor(g){this._bufferService=g,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new x.CellData}register(g){const _={id:this._nextCharacterJoinerId++,handler:g};return this._characterJoiners.push(_),_.id}deregister(g){for(let _=0;_<this._characterJoiners.length;_++)if(this._characterJoiners[_].id===g)return this._characterJoiners.splice(_,1),!0;return!1}getJoinedCharacters(g){if(this._characterJoiners.length===0)return[];const _=this._bufferService.buffer.lines.get(g);if(!_||_.length===0)return[];const T=[],M=_.translateToString(!0);let k=0,L=0,D=0,P=_.getFg(0),K=_.getBg(0);for(let $=0;$<_.getTrimmedLength();$++)if(_.loadCell($,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==P||this._workCell.bg!==K){if($-k>1){const z=this._getJoinedRanges(M,D,L,_,k);for(let W=0;W<z.length;W++)T.push(z[W])}k=$,D=L,P=this._workCell.fg,K=this._workCell.bg}L+=this._workCell.getChars().length||y.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-k>1){const $=this._getJoinedRanges(M,D,L,_,k);for(let z=0;z<$.length;z++)T.push($[z])}return T}_getJoinedRanges(g,_,T,M,k){const L=g.substring(_,T);let D=[];try{D=this._characterJoiners[0].handler(L)}catch(P){console.error(P)}for(let P=1;P<this._characterJoiners.length;P++)try{const K=this._characterJoiners[P].handler(L);for(let $=0;$<K.length;$++)mA._mergeRanges(D,K[$])}catch(K){console.error(K)}return this._stringRangesToCellRanges(D,M,k),D}_stringRangesToCellRanges(g,_,T){let M=0,k=!1,L=0,D=g[M];if(D){for(let P=T;P<this._bufferService.cols;P++){const K=_.getWidth(P),$=_.getString(P).length||y.WHITESPACE_CELL_CHAR.length;if(K!==0){if(!k&&D[0]<=L&&(D[0]=P,k=!0),D[1]<=L){if(D[1]=P,D=g[++M],!D)break;D[0]<=L?(D[0]=P,k=!0):k=!1}L+=$}}D&&(D[1]=this._bufferService.cols)}}static _mergeRanges(g,_){let T=!1;for(let M=0;M<g.length;M++){const k=g[M];if(T){if(_[1]<=k[0])return g[M-1][1]=_[1],g;if(_[1]<=k[1])return g[M-1][1]=Math.max(_[1],k[1]),g.splice(M,1),g;g.splice(M,1),M--}else{if(_[1]<=k[0])return g.splice(M,0,_),g;if(_[1]<=k[1])return k[0]=Math.min(_[0],k[0]),g;_[0]<k[1]&&(k[0]=Math.min(_[0],k[0]),T=!0)}}return T?g[g.length-1][1]=_[1]:g.push(_),g}};l.CharacterJoinerService=v=h([m(0,A.IBufferService)],v)},5114:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0;const h=c(844),m=c(8460),p=c(3656);class y extends h.Disposable{constructor(w,v,S){super(),this._textarea=w,this._window=v,this.mainDocument=S,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new x(this._window),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new m.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((g=>this._screenDprMonitor.setWindow(g)))),this.register((0,m.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(w){this._window!==w&&(this._window=w,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}l.CoreBrowserService=y;class x extends h.Disposable{constructor(w){super(),this._parentWindow=w,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,h.toDisposable)((()=>this.clearListener())))}setWindow(w){this._parentWindow=w,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,p.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var w;this._outerListener&&((w=this._resolutionMediaMatchList)==null||w.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LinkProviderService=void 0;const h=c(844);class m extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(y){return this.linkProviders.push(y),{dispose:()=>{const x=this.linkProviders.indexOf(y);x!==-1&&this.linkProviders.splice(x,1)}}}}l.LinkProviderService=m},8934:function(f,l,c){var h=this&&this.__decorate||function(A,w,v,S){var g,_=arguments.length,T=_<3?w:S===null?S=Object.getOwnPropertyDescriptor(w,v):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(A,w,v,S);else for(var M=A.length-1;M>=0;M--)(g=A[M])&&(T=(_<3?g(T):_>3?g(w,v,T):g(w,v))||T);return _>3&&T&&Object.defineProperty(w,v,T),T},m=this&&this.__param||function(A,w){return function(v,S){w(v,S,A)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const p=c(4725),y=c(9806);let x=l.MouseService=class{constructor(A,w){this._renderService=A,this._charSizeService=w}getCoords(A,w,v,S,g){return(0,y.getCoords)(window,A,w,v,S,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,g)}getMouseReportCoords(A,w){const v=(0,y.getCoordsRelativeToElement)(window,A,w);if(this._charSizeService.hasValidSize)return v[0]=Math.min(Math.max(v[0],0),this._renderService.dimensions.css.canvas.width-1),v[1]=Math.min(Math.max(v[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(v[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(v[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(v[0]),y:Math.floor(v[1])}}};l.MouseService=x=h([m(0,p.IRenderService),m(1,p.ICharSizeService)],x)},3230:function(f,l,c){var h=this&&this.__decorate||function(g,_,T,M){var k,L=arguments.length,D=L<3?_:M===null?M=Object.getOwnPropertyDescriptor(_,T):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(g,_,T,M);else for(var P=g.length-1;P>=0;P--)(k=g[P])&&(D=(L<3?k(D):L>3?k(_,T,D):k(_,T))||D);return L>3&&D&&Object.defineProperty(_,T,D),D},m=this&&this.__param||function(g,_){return function(T,M){_(T,M,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const p=c(6193),y=c(4725),x=c(8460),A=c(844),w=c(7226),v=c(2585);let S=l.RenderService=class extends A.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(g,_,T,M,k,L,D,P){super(),this._rowCount=g,this._charSizeService=M,this._renderer=this.register(new A.MutableDisposable),this._pausedResizeTask=new w.DebouncedIdleTask,this._observerDisposable=this.register(new A.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new x.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new x.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new x.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new x.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new p.RenderDebouncer(((K,$)=>this._renderRows(K,$)),D),this.register(this._renderDebouncer),this.register(D.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(L.onResize((()=>this._fullRefresh()))),this.register(L.buffers.onBufferActivate((()=>{var K;return(K=this._renderer.value)==null?void 0:K.clear()}))),this.register(T.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(k.onDecorationRegistered((()=>this._fullRefresh()))),this.register(k.onDecorationRemoved((()=>this._fullRefresh()))),this.register(T.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(L.cols,L.rows),this._fullRefresh()}))),this.register(T.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(L.buffer.y,L.buffer.y,!0)))),this.register(P.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(D.window,_),this.register(D.onWindowChange((K=>this._registerIntersectionObserver(K,_))))}_registerIntersectionObserver(g,_){if("IntersectionObserver"in g){const T=new g.IntersectionObserver((M=>this._handleIntersectionChange(M[M.length-1])),{threshold:0});T.observe(_),this._observerDisposable.value=(0,A.toDisposable)((()=>T.disconnect()))}}_handleIntersectionChange(g){this._isPaused=g.isIntersecting===void 0?g.intersectionRatio===0:!g.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(g,_,T=!1){this._isPaused?this._needsFullRefresh=!0:(T||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(g,_,this._rowCount))}_renderRows(g,_){this._renderer.value&&(g=Math.min(g,this._rowCount-1),_=Math.min(_,this._rowCount-1),this._renderer.value.renderRows(g,_),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:g,end:_}),this._onRender.fire({start:g,end:_}),this._isNextRenderRedrawOnly=!0)}resize(g,_){this._rowCount=_,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(g){this._renderer.value=g,this._renderer.value&&(this._renderer.value.onRequestRedraw((_=>this.refreshRows(_.start,_.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(g){return this._renderDebouncer.addRefreshCallback(g)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var g,_;this._renderer.value&&((_=(g=this._renderer.value).clearTextureAtlas)==null||_.call(g),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(g,_){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var T;return(T=this._renderer.value)==null?void 0:T.handleResize(g,_)})):this._renderer.value.handleResize(g,_),this._fullRefresh())}handleCharSizeChanged(){var g;(g=this._renderer.value)==null||g.handleCharSizeChanged()}handleBlur(){var g;(g=this._renderer.value)==null||g.handleBlur()}handleFocus(){var g;(g=this._renderer.value)==null||g.handleFocus()}handleSelectionChanged(g,_,T){var M;this._selectionState.start=g,this._selectionState.end=_,this._selectionState.columnSelectMode=T,(M=this._renderer.value)==null||M.handleSelectionChanged(g,_,T)}handleCursorMove(){var g;(g=this._renderer.value)==null||g.handleCursorMove()}clear(){var g;(g=this._renderer.value)==null||g.clear()}};l.RenderService=S=h([m(2,v.IOptionsService),m(3,y.ICharSizeService),m(4,v.IDecorationService),m(5,v.IBufferService),m(6,y.ICoreBrowserService),m(7,y.IThemeService)],S)},9312:function(f,l,c){var h=this&&this.__decorate||function(D,P,K,$){var z,W=arguments.length,F=W<3?P:$===null?$=Object.getOwnPropertyDescriptor(P,K):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(D,P,K,$);else for(var ee=D.length-1;ee>=0;ee--)(z=D[ee])&&(F=(W<3?z(F):W>3?z(P,K,F):z(P,K))||F);return W>3&&F&&Object.defineProperty(P,K,F),F},m=this&&this.__param||function(D,P){return function(K,$){P(K,$,D)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const p=c(9806),y=c(9504),x=c(456),A=c(4725),w=c(8460),v=c(844),S=c(6114),g=c(4841),_=c(511),T=c(2585),M=" ",k=new RegExp(M,"g");let L=l.SelectionService=class extends v.Disposable{constructor(D,P,K,$,z,W,F,ee,Y){super(),this._element=D,this._screenElement=P,this._linkifier=K,this._bufferService=$,this._coreService=z,this._mouseService=W,this._optionsService=F,this._renderService=ee,this._coreBrowserService=Y,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new _.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new w.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new w.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new w.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=re=>this._handleMouseMove(re),this._mouseUpListener=re=>this._handleMouseUp(re),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((re=>this._handleTrim(re))),this.register(this._bufferService.buffers.onBufferActivate((re=>this._handleBufferActivate(re)))),this.enable(),this._model=new x.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,v.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const D=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!(!D||!P||D[0]===P[0]&&D[1]===P[1])}get selectionText(){const D=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;if(!D||!P)return"";const K=this._bufferService.buffer,$=[];if(this._activeSelectionMode===3){if(D[0]===P[0])return"";const z=D[0]<P[0]?D[0]:P[0],W=D[0]<P[0]?P[0]:D[0];for(let F=D[1];F<=P[1];F++){const ee=K.translateBufferLineToString(F,!0,z,W);$.push(ee)}}else{const z=D[1]===P[1]?P[0]:void 0;$.push(K.translateBufferLineToString(D[1],!0,D[0],z));for(let W=D[1]+1;W<=P[1]-1;W++){const F=K.lines.get(W),ee=K.translateBufferLineToString(W,!0);F!=null&&F.isWrapped?$[$.length-1]+=ee:$.push(ee)}if(D[1]!==P[1]){const W=K.lines.get(P[1]),F=K.translateBufferLineToString(P[1],!0,0,P[0]);W&&W.isWrapped?$[$.length-1]+=F:$.push(F)}}return $.map((z=>z.replace(k," "))).join(S.isWindows?`\r
405
+ `:`
406
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(D){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),S.isLinux&&D&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(D){const P=this._getMouseBufferCoords(D),K=this._model.finalSelectionStart,$=this._model.finalSelectionEnd;return!!(K&&$&&P)&&this._areCoordsInSelection(P,K,$)}isCellInSelection(D,P){const K=this._model.finalSelectionStart,$=this._model.finalSelectionEnd;return!(!K||!$)&&this._areCoordsInSelection([D,P],K,$)}_areCoordsInSelection(D,P,K){return D[1]>P[1]&&D[1]<K[1]||P[1]===K[1]&&D[1]===P[1]&&D[0]>=P[0]&&D[0]<K[0]||P[1]<K[1]&&D[1]===K[1]&&D[0]<K[0]||P[1]<K[1]&&D[1]===P[1]&&D[0]>=P[0]}_selectWordAtCursor(D,P){var z,W;const K=(W=(z=this._linkifier.currentLink)==null?void 0:z.link)==null?void 0:W.range;if(K)return this._model.selectionStart=[K.start.x-1,K.start.y-1],this._model.selectionStartLength=(0,g.getRangeLength)(K,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const $=this._getMouseBufferCoords(D);return!!$&&(this._selectWordAt($,P),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(D,P){this._model.clearSelection(),D=Math.max(D,0),P=Math.min(P,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,D],this._model.selectionEnd=[this._bufferService.cols,P],this.refresh(),this._onSelectionChange.fire()}_handleTrim(D){this._model.handleTrim(D)&&this.refresh()}_getMouseBufferCoords(D){const P=this._mouseService.getCoords(D,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(P)return P[0]--,P[1]--,P[1]+=this._bufferService.buffer.ydisp,P}_getMouseEventScrollAmount(D){let P=(0,p.getCoordsRelativeToElement)(this._coreBrowserService.window,D,this._screenElement)[1];const K=this._renderService.dimensions.css.canvas.height;return P>=0&&P<=K?0:(P>K&&(P-=K),P=Math.min(Math.max(P,-50),50),P/=50,P/Math.abs(P)+Math.round(14*P))}shouldForceSelection(D){return S.isMac?D.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:D.shiftKey}handleMouseDown(D){if(this._mouseDownTimeStamp=D.timeStamp,(D.button!==2||!this.hasSelection)&&D.button===0){if(!this._enabled){if(!this.shouldForceSelection(D))return;D.stopPropagation()}D.preventDefault(),this._dragScrollAmount=0,this._enabled&&D.shiftKey?this._handleIncrementalClick(D):D.detail===1?this._handleSingleClick(D):D.detail===2?this._handleDoubleClick(D):D.detail===3&&this._handleTripleClick(D),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(D){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(D))}_handleSingleClick(D){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(D)?3:0,this._model.selectionStart=this._getMouseBufferCoords(D),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const P=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);P&&P.length!==this._model.selectionStart[0]&&P.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(D){this._selectWordAtCursor(D,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(D){const P=this._getMouseBufferCoords(D);P&&(this._activeSelectionMode=2,this._selectLineAt(P[1]))}shouldColumnSelect(D){return D.altKey&&!(S.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(D){if(D.stopImmediatePropagation(),!this._model.selectionStart)return;const P=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(D),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(D),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const K=this._bufferService.buffer;if(this._model.selectionEnd[1]<K.lines.length){const $=K.lines.get(this._model.selectionEnd[1]);$&&$.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}P&&P[0]===this._model.selectionEnd[0]&&P[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const D=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(D.ydisp+this._bufferService.rows,D.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=D.ydisp),this.refresh()}}_handleMouseUp(D){const P=D.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&P<500&&D.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const K=this._mouseService.getCoords(D,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(K&&K[0]!==void 0&&K[1]!==void 0){const $=(0,y.moveToCellSequence)(K[0]-1,K[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent($,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const D=this._model.finalSelectionStart,P=this._model.finalSelectionEnd,K=!(!D||!P||D[0]===P[0]&&D[1]===P[1]);K?D&&P&&(this._oldSelectionStart&&this._oldSelectionEnd&&D[0]===this._oldSelectionStart[0]&&D[1]===this._oldSelectionStart[1]&&P[0]===this._oldSelectionEnd[0]&&P[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(D,P,K)):this._oldHasSelection&&this._fireOnSelectionChange(D,P,K)}_fireOnSelectionChange(D,P,K){this._oldSelectionStart=D,this._oldSelectionEnd=P,this._oldHasSelection=K,this._onSelectionChange.fire()}_handleBufferActivate(D){this.clearSelection(),this._trimListener.dispose(),this._trimListener=D.activeBuffer.lines.onTrim((P=>this._handleTrim(P)))}_convertViewportColToCharacterIndex(D,P){let K=P;for(let $=0;P>=$;$++){const z=D.loadCell($,this._workCell).getChars().length;this._workCell.getWidth()===0?K--:z>1&&P!==$&&(K+=z-1)}return K}setSelection(D,P,K){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[D,P],this._model.selectionStartLength=K,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(D){this._isClickInSelection(D)||(this._selectWordAtCursor(D,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(D,P,K=!0,$=!0){if(D[0]>=this._bufferService.cols)return;const z=this._bufferService.buffer,W=z.lines.get(D[1]);if(!W)return;const F=z.translateBufferLineToString(D[1],!1);let ee=this._convertViewportColToCharacterIndex(W,D[0]),Y=ee;const re=D[0]-ee;let te=0,O=0,G=0,j=0;if(F.charAt(ee)===" "){for(;ee>0&&F.charAt(ee-1)===" ";)ee--;for(;Y<F.length&&F.charAt(Y+1)===" ";)Y++}else{let Z=D[0],be=D[0];W.getWidth(Z)===0&&(te++,Z--),W.getWidth(be)===2&&(O++,be++);const fe=W.getString(be).length;for(fe>1&&(j+=fe-1,Y+=fe-1);Z>0&&ee>0&&!this._isCharWordSeparator(W.loadCell(Z-1,this._workCell));){W.loadCell(Z-1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===0?(te++,Z--):Q>1&&(G+=Q-1,ee-=Q-1),ee--,Z--}for(;be<W.length&&Y+1<F.length&&!this._isCharWordSeparator(W.loadCell(be+1,this._workCell));){W.loadCell(be+1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===2?(O++,be++):Q>1&&(j+=Q-1,Y+=Q-1),Y++,be++}}Y++;let q=ee+re-te+G,ne=Math.min(this._bufferService.cols,Y-ee+te+O-G-j);if(P||F.slice(ee,Y).trim()!==""){if(K&&q===0&&W.getCodePoint(0)!==32){const Z=z.lines.get(D[1]-1);if(Z&&W.isWrapped&&Z.getCodePoint(this._bufferService.cols-1)!==32){const be=this._getWordAt([this._bufferService.cols-1,D[1]-1],!1,!0,!1);if(be){const fe=this._bufferService.cols-be.start;q-=fe,ne+=fe}}}if($&&q+ne===this._bufferService.cols&&W.getCodePoint(this._bufferService.cols-1)!==32){const Z=z.lines.get(D[1]+1);if(Z!=null&&Z.isWrapped&&Z.getCodePoint(0)!==32){const be=this._getWordAt([0,D[1]+1],!1,!1,!0);be&&(ne+=be.length)}}return{start:q,length:ne}}}_selectWordAt(D,P){const K=this._getWordAt(D,P);if(K){for(;K.start<0;)K.start+=this._bufferService.cols,D[1]--;this._model.selectionStart=[K.start,D[1]],this._model.selectionStartLength=K.length}}_selectToWordAt(D){const P=this._getWordAt(D,!0);if(P){let K=D[1];for(;P.start<0;)P.start+=this._bufferService.cols,K--;if(!this._model.areSelectionValuesReversed())for(;P.start+P.length>this._bufferService.cols;)P.length-=this._bufferService.cols,K++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?P.start:P.start+P.length,K]}}_isCharWordSeparator(D){return D.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(D.getChars())>=0}_selectLineAt(D){const P=this._bufferService.buffer.getWrappedRangeForLine(D),K={start:{x:0,y:P.first},end:{x:this._bufferService.cols-1,y:P.last}};this._model.selectionStart=[0,P.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,g.getRangeLength)(K,this._bufferService.cols)}};l.SelectionService=L=h([m(3,T.IBufferService),m(4,T.ICoreService),m(5,A.IMouseService),m(6,T.IOptionsService),m(7,A.IRenderService),m(8,A.ICoreBrowserService)],L)},4725:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ILinkProviderService=l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const h=c(8343);l.ICharSizeService=(0,h.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),l.IMouseService=(0,h.createDecorator)("MouseService"),l.IRenderService=(0,h.createDecorator)("RenderService"),l.ISelectionService=(0,h.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,h.createDecorator)("ThemeService"),l.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(f,l,c){var h=this&&this.__decorate||function(L,D,P,K){var $,z=arguments.length,W=z<3?D:K===null?K=Object.getOwnPropertyDescriptor(D,P):K;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(L,D,P,K);else for(var F=L.length-1;F>=0;F--)($=L[F])&&(W=(z<3?$(W):z>3?$(D,P,W):$(D,P))||W);return z>3&&W&&Object.defineProperty(D,P,W),W},m=this&&this.__param||function(L,D){return function(P,K){D(P,K,L)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const p=c(7239),y=c(8055),x=c(8460),A=c(844),w=c(2585),v=y.css.toColor("#ffffff"),S=y.css.toColor("#000000"),g=y.css.toColor("#ffffff"),_=y.css.toColor("#000000"),T={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const L=[y.css.toColor("#2e3436"),y.css.toColor("#cc0000"),y.css.toColor("#4e9a06"),y.css.toColor("#c4a000"),y.css.toColor("#3465a4"),y.css.toColor("#75507b"),y.css.toColor("#06989a"),y.css.toColor("#d3d7cf"),y.css.toColor("#555753"),y.css.toColor("#ef2929"),y.css.toColor("#8ae234"),y.css.toColor("#fce94f"),y.css.toColor("#729fcf"),y.css.toColor("#ad7fa8"),y.css.toColor("#34e2e2"),y.css.toColor("#eeeeec")],D=[0,95,135,175,215,255];for(let P=0;P<216;P++){const K=D[P/36%6|0],$=D[P/6%6|0],z=D[P%6];L.push({css:y.channels.toCss(K,$,z),rgba:y.channels.toRgba(K,$,z)})}for(let P=0;P<24;P++){const K=8+10*P;L.push({css:y.channels.toCss(K,K,K),rgba:y.channels.toRgba(K,K,K)})}return L})());let M=l.ThemeService=class extends A.Disposable{get colors(){return this._colors}constructor(L){super(),this._optionsService=L,this._contrastCache=new p.ColorContrastCache,this._halfContrastCache=new p.ColorContrastCache,this._onChangeColors=this.register(new x.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:v,background:S,cursor:g,cursorAccent:_,selectionForeground:void 0,selectionBackgroundTransparent:T,selectionBackgroundOpaque:y.color.blend(S,T),selectionInactiveBackgroundTransparent:T,selectionInactiveBackgroundOpaque:y.color.blend(S,T),ansi:l.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(L={}){const D=this._colors;if(D.foreground=k(L.foreground,v),D.background=k(L.background,S),D.cursor=k(L.cursor,g),D.cursorAccent=k(L.cursorAccent,_),D.selectionBackgroundTransparent=k(L.selectionBackground,T),D.selectionBackgroundOpaque=y.color.blend(D.background,D.selectionBackgroundTransparent),D.selectionInactiveBackgroundTransparent=k(L.selectionInactiveBackground,D.selectionBackgroundTransparent),D.selectionInactiveBackgroundOpaque=y.color.blend(D.background,D.selectionInactiveBackgroundTransparent),D.selectionForeground=L.selectionForeground?k(L.selectionForeground,y.NULL_COLOR):void 0,D.selectionForeground===y.NULL_COLOR&&(D.selectionForeground=void 0),y.color.isOpaque(D.selectionBackgroundTransparent)&&(D.selectionBackgroundTransparent=y.color.opacity(D.selectionBackgroundTransparent,.3)),y.color.isOpaque(D.selectionInactiveBackgroundTransparent)&&(D.selectionInactiveBackgroundTransparent=y.color.opacity(D.selectionInactiveBackgroundTransparent,.3)),D.ansi=l.DEFAULT_ANSI_COLORS.slice(),D.ansi[0]=k(L.black,l.DEFAULT_ANSI_COLORS[0]),D.ansi[1]=k(L.red,l.DEFAULT_ANSI_COLORS[1]),D.ansi[2]=k(L.green,l.DEFAULT_ANSI_COLORS[2]),D.ansi[3]=k(L.yellow,l.DEFAULT_ANSI_COLORS[3]),D.ansi[4]=k(L.blue,l.DEFAULT_ANSI_COLORS[4]),D.ansi[5]=k(L.magenta,l.DEFAULT_ANSI_COLORS[5]),D.ansi[6]=k(L.cyan,l.DEFAULT_ANSI_COLORS[6]),D.ansi[7]=k(L.white,l.DEFAULT_ANSI_COLORS[7]),D.ansi[8]=k(L.brightBlack,l.DEFAULT_ANSI_COLORS[8]),D.ansi[9]=k(L.brightRed,l.DEFAULT_ANSI_COLORS[9]),D.ansi[10]=k(L.brightGreen,l.DEFAULT_ANSI_COLORS[10]),D.ansi[11]=k(L.brightYellow,l.DEFAULT_ANSI_COLORS[11]),D.ansi[12]=k(L.brightBlue,l.DEFAULT_ANSI_COLORS[12]),D.ansi[13]=k(L.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),D.ansi[14]=k(L.brightCyan,l.DEFAULT_ANSI_COLORS[14]),D.ansi[15]=k(L.brightWhite,l.DEFAULT_ANSI_COLORS[15]),L.extendedAnsi){const P=Math.min(D.ansi.length-16,L.extendedAnsi.length);for(let K=0;K<P;K++)D.ansi[K+16]=k(L.extendedAnsi[K],l.DEFAULT_ANSI_COLORS[K+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(L){this._restoreColor(L),this._onChangeColors.fire(this.colors)}_restoreColor(L){if(L!==void 0)switch(L){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[L]=this._restoreColors.ansi[L]}else for(let D=0;D<this._restoreColors.ansi.length;++D)this._colors.ansi[D]=this._restoreColors.ansi[D]}modifyColors(L){L(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function k(L,D){if(L!==void 0)try{return y.css.toColor(L)}catch{}return D}l.ThemeService=M=h([m(0,w.IOptionsService)],M)},6349:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const h=c(8460),m=c(844);class p extends m.Disposable{constructor(x){super(),this._maxLength=x,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(x){if(this._maxLength===x)return;const A=new Array(x);for(let w=0;w<Math.min(x,this.length);w++)A[w]=this._array[this._getCyclicIndex(w)];this._array=A,this._maxLength=x,this._startIndex=0}get length(){return this._length}set length(x){if(x>this._length)for(let A=this._length;A<x;A++)this._array[A]=void 0;this._length=x}get(x){return this._array[this._getCyclicIndex(x)]}set(x,A){this._array[this._getCyclicIndex(x)]=A}push(x){this._array[this._getCyclicIndex(this._length)]=x,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(x,A,...w){if(A){for(let v=x;v<this._length-A;v++)this._array[this._getCyclicIndex(v)]=this._array[this._getCyclicIndex(v+A)];this._length-=A,this.onDeleteEmitter.fire({index:x,amount:A})}for(let v=this._length-1;v>=x;v--)this._array[this._getCyclicIndex(v+w.length)]=this._array[this._getCyclicIndex(v)];for(let v=0;v<w.length;v++)this._array[this._getCyclicIndex(x+v)]=w[v];if(w.length&&this.onInsertEmitter.fire({index:x,amount:w.length}),this._length+w.length>this._maxLength){const v=this._length+w.length-this._maxLength;this._startIndex+=v,this._length=this._maxLength,this.onTrimEmitter.fire(v)}else this._length+=w.length}trimStart(x){x>this._length&&(x=this._length),this._startIndex+=x,this._length-=x,this.onTrimEmitter.fire(x)}shiftElements(x,A,w){if(!(A<=0)){if(x<0||x>=this._length)throw new Error("start argument out of range");if(x+w<0)throw new Error("Cannot shift elements in list beyond index 0");if(w>0){for(let S=A-1;S>=0;S--)this.set(x+S+w,this.get(x+S));const v=x+A+w-this._length;if(v>0)for(this._length+=v;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let v=0;v<A;v++)this.set(x+v+w,this.get(x+v))}}_getCyclicIndex(x){return(this._startIndex+x)%this._maxLength}}l.CircularList=p},1439:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function c(h,m=5){if(typeof h!="object")return h;const p=Array.isArray(h)?[]:{};for(const y in h)p[y]=m<=1?h[y]:h[y]&&c(h[y],m-1);return p}},8055:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;let c=0,h=0,m=0,p=0;var y,x,A,w,v;function S(_){const T=_.toString(16);return T.length<2?"0"+T:T}function g(_,T){return _<T?(T+.05)/(_+.05):(_+.05)/(T+.05)}l.NULL_COLOR={css:"#00000000",rgba:0},(function(_){_.toCss=function(T,M,k,L){return L!==void 0?`#${S(T)}${S(M)}${S(k)}${S(L)}`:`#${S(T)}${S(M)}${S(k)}`},_.toRgba=function(T,M,k,L=255){return(T<<24|M<<16|k<<8|L)>>>0},_.toColor=function(T,M,k,L){return{css:_.toCss(T,M,k,L),rgba:_.toRgba(T,M,k,L)}}})(y||(l.channels=y={})),(function(_){function T(M,k){return p=Math.round(255*k),[c,h,m]=v.toChannels(M.rgba),{css:y.toCss(c,h,m,p),rgba:y.toRgba(c,h,m,p)}}_.blend=function(M,k){if(p=(255&k.rgba)/255,p===1)return{css:k.css,rgba:k.rgba};const L=k.rgba>>24&255,D=k.rgba>>16&255,P=k.rgba>>8&255,K=M.rgba>>24&255,$=M.rgba>>16&255,z=M.rgba>>8&255;return c=K+Math.round((L-K)*p),h=$+Math.round((D-$)*p),m=z+Math.round((P-z)*p),{css:y.toCss(c,h,m),rgba:y.toRgba(c,h,m)}},_.isOpaque=function(M){return(255&M.rgba)==255},_.ensureContrastRatio=function(M,k,L){const D=v.ensureContrastRatio(M.rgba,k.rgba,L);if(D)return y.toColor(D>>24&255,D>>16&255,D>>8&255)},_.opaque=function(M){const k=(255|M.rgba)>>>0;return[c,h,m]=v.toChannels(k),{css:y.toCss(c,h,m),rgba:k}},_.opacity=T,_.multiplyOpacity=function(M,k){return p=255&M.rgba,T(M,p*k/255)},_.toColorRGB=function(M){return[M.rgba>>24&255,M.rgba>>16&255,M.rgba>>8&255]}})(x||(l.color=x={})),(function(_){let T,M;try{const k=document.createElement("canvas");k.width=1,k.height=1;const L=k.getContext("2d",{willReadFrequently:!0});L&&(T=L,T.globalCompositeOperation="copy",M=T.createLinearGradient(0,0,1,1))}catch{}_.toColor=function(k){if(k.match(/#[\da-f]{3,8}/i))switch(k.length){case 4:return c=parseInt(k.slice(1,2).repeat(2),16),h=parseInt(k.slice(2,3).repeat(2),16),m=parseInt(k.slice(3,4).repeat(2),16),y.toColor(c,h,m);case 5:return c=parseInt(k.slice(1,2).repeat(2),16),h=parseInt(k.slice(2,3).repeat(2),16),m=parseInt(k.slice(3,4).repeat(2),16),p=parseInt(k.slice(4,5).repeat(2),16),y.toColor(c,h,m,p);case 7:return{css:k,rgba:(parseInt(k.slice(1),16)<<8|255)>>>0};case 9:return{css:k,rgba:parseInt(k.slice(1),16)>>>0}}const L=k.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(L)return c=parseInt(L[1]),h=parseInt(L[2]),m=parseInt(L[3]),p=Math.round(255*(L[5]===void 0?1:parseFloat(L[5]))),y.toColor(c,h,m,p);if(!T||!M)throw new Error("css.toColor: Unsupported css format");if(T.fillStyle=M,T.fillStyle=k,typeof T.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(T.fillRect(0,0,1,1),[c,h,m,p]=T.getImageData(0,0,1,1).data,p!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:y.toRgba(c,h,m,p),css:k}}})(A||(l.css=A={})),(function(_){function T(M,k,L){const D=M/255,P=k/255,K=L/255;return .2126*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))+.7152*(P<=.03928?P/12.92:Math.pow((P+.055)/1.055,2.4))+.0722*(K<=.03928?K/12.92:Math.pow((K+.055)/1.055,2.4))}_.relativeLuminance=function(M){return T(M>>16&255,M>>8&255,255&M)},_.relativeLuminance2=T})(w||(l.rgb=w={})),(function(_){function T(k,L,D){const P=k>>24&255,K=k>>16&255,$=k>>8&255;let z=L>>24&255,W=L>>16&255,F=L>>8&255,ee=g(w.relativeLuminance2(z,W,F),w.relativeLuminance2(P,K,$));for(;ee<D&&(z>0||W>0||F>0);)z-=Math.max(0,Math.ceil(.1*z)),W-=Math.max(0,Math.ceil(.1*W)),F-=Math.max(0,Math.ceil(.1*F)),ee=g(w.relativeLuminance2(z,W,F),w.relativeLuminance2(P,K,$));return(z<<24|W<<16|F<<8|255)>>>0}function M(k,L,D){const P=k>>24&255,K=k>>16&255,$=k>>8&255;let z=L>>24&255,W=L>>16&255,F=L>>8&255,ee=g(w.relativeLuminance2(z,W,F),w.relativeLuminance2(P,K,$));for(;ee<D&&(z<255||W<255||F<255);)z=Math.min(255,z+Math.ceil(.1*(255-z))),W=Math.min(255,W+Math.ceil(.1*(255-W))),F=Math.min(255,F+Math.ceil(.1*(255-F))),ee=g(w.relativeLuminance2(z,W,F),w.relativeLuminance2(P,K,$));return(z<<24|W<<16|F<<8|255)>>>0}_.blend=function(k,L){if(p=(255&L)/255,p===1)return L;const D=L>>24&255,P=L>>16&255,K=L>>8&255,$=k>>24&255,z=k>>16&255,W=k>>8&255;return c=$+Math.round((D-$)*p),h=z+Math.round((P-z)*p),m=W+Math.round((K-W)*p),y.toRgba(c,h,m)},_.ensureContrastRatio=function(k,L,D){const P=w.relativeLuminance(k>>8),K=w.relativeLuminance(L>>8);if(g(P,K)<D){if(K<P){const W=T(k,L,D),F=g(P,w.relativeLuminance(W>>8));if(F<D){const ee=M(k,L,D);return F>g(P,w.relativeLuminance(ee>>8))?W:ee}return W}const $=M(k,L,D),z=g(P,w.relativeLuminance($>>8));if(z<D){const W=T(k,L,D);return z>g(P,w.relativeLuminance(W>>8))?$:W}return $}},_.reduceLuminance=T,_.increaseLuminance=M,_.toChannels=function(k){return[k>>24&255,k>>16&255,k>>8&255,255&k]}})(v||(l.rgba=v={})),l.toPaddedHex=S,l.contrastRatio=g},8969:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const h=c(844),m=c(2585),p=c(4348),y=c(7866),x=c(744),A=c(7302),w=c(6975),v=c(8460),S=c(1753),g=c(1480),_=c(7994),T=c(9282),M=c(5435),k=c(5981),L=c(2660);let D=!1;class P extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new v.EventEmitter),this._onScroll.event(($=>{var z;(z=this._onScrollApi)==null||z.fire($.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options($){for(const z in $)this.optionsService.options[z]=$[z]}constructor($){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new v.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new v.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new v.EventEmitter),this._instantiationService=new p.InstantiationService,this.optionsService=this.register(new A.OptionsService($)),this._instantiationService.setService(m.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(x.BufferService)),this._instantiationService.setService(m.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(y.LogService)),this._instantiationService.setService(m.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(w.CoreService)),this._instantiationService.setService(m.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(S.CoreMouseService)),this._instantiationService.setService(m.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(g.UnicodeService)),this._instantiationService.setService(m.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(_.CharsetService),this._instantiationService.setService(m.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(L.OscLinkService),this._instantiationService.setService(m.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new M.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,v.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,v.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,v.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,v.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((z=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((z=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new k.WriteBuffer(((z,W)=>this._inputHandler.parse(z,W)))),this.register((0,v.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write($,z){this._writeBuffer.write($,z)}writeSync($,z){this._logService.logLevel<=m.LogLevelEnum.WARN&&!D&&(this._logService.warn("writeSync is unreliable and will be removed soon."),D=!0),this._writeBuffer.writeSync($,z)}input($,z=!0){this.coreService.triggerDataEvent($,z)}resize($,z){isNaN($)||isNaN(z)||($=Math.max($,x.MINIMUM_COLS),z=Math.max(z,x.MINIMUM_ROWS),this._bufferService.resize($,z))}scroll($,z=!1){this._bufferService.scroll($,z)}scrollLines($,z,W){this._bufferService.scrollLines($,z,W)}scrollPages($){this.scrollLines($*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine($){const z=$-this._bufferService.buffer.ydisp;z!==0&&this.scrollLines(z)}registerEscHandler($,z){return this._inputHandler.registerEscHandler($,z)}registerDcsHandler($,z){return this._inputHandler.registerDcsHandler($,z)}registerCsiHandler($,z){return this._inputHandler.registerCsiHandler($,z)}registerOscHandler($,z){return this._inputHandler.registerOscHandler($,z)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let $=!1;const z=this.optionsService.rawOptions.windowsPty;z&&z.buildNumber!==void 0&&z.buildNumber!==void 0?$=z.backend==="conpty"&&z.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&($=!0),$?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const $=[];$.push(this.onLineFeed(T.updateWindowsModeWrappedState.bind(null,this._bufferService))),$.push(this.registerCsiHandler({final:"H"},(()=>((0,T.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const z of $)z.dispose()}))}}}l.CoreTerminal=P},8460:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.runAndSubscribe=l.forwardEvent=l.EventEmitter=void 0,l.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===c)return void this._listeners.splice(h,1)}}})),this._event}fire(c,h){const m=[];for(let p=0;p<this._listeners.length;p++)m.push(this._listeners[p]);for(let p=0;p<m.length;p++)m[p].call(void 0,c,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},l.forwardEvent=function(c,h){return c((m=>h.fire(m)))},l.runAndSubscribe=function(c,h){return h(void 0),c((m=>h(m)))}},5435:function(f,l,c){var h=this&&this.__decorate||function(te,O,G,j){var q,ne=arguments.length,Z=ne<3?O:j===null?j=Object.getOwnPropertyDescriptor(O,G):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(te,O,G,j);else for(var be=te.length-1;be>=0;be--)(q=te[be])&&(Z=(ne<3?q(Z):ne>3?q(O,G,Z):q(O,G))||Z);return ne>3&&Z&&Object.defineProperty(O,G,Z),Z},m=this&&this.__param||function(te,O){return function(G,j){O(G,j,te)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const p=c(2584),y=c(7116),x=c(2015),A=c(844),w=c(482),v=c(8437),S=c(8460),g=c(643),_=c(511),T=c(3734),M=c(2585),k=c(1480),L=c(6242),D=c(6351),P=c(5941),K={"(":0,")":1,"*":2,"+":3,"-":1,".":2},$=131072;function z(te,O){if(te>24)return O.setWinLines||!1;switch(te){case 1:return!!O.restoreWin;case 2:return!!O.minimizeWin;case 3:return!!O.setWinPosition;case 4:return!!O.setWinSizePixels;case 5:return!!O.raiseWin;case 6:return!!O.lowerWin;case 7:return!!O.refreshWin;case 8:return!!O.setWinSizeChars;case 9:return!!O.maximizeWin;case 10:return!!O.fullscreenWin;case 11:return!!O.getWinState;case 13:return!!O.getWinPosition;case 14:return!!O.getWinSizePixels;case 15:return!!O.getScreenSizePixels;case 16:return!!O.getCellSizePixels;case 18:return!!O.getWinSizeChars;case 19:return!!O.getScreenSizeChars;case 20:return!!O.getIconTitle;case 21:return!!O.getWinTitle;case 22:return!!O.pushTitle;case 23:return!!O.popTitle;case 24:return!!O.setWinLines}return!1}var W;(function(te){te[te.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",te[te.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(W||(l.WindowsOptionsReportType=W={}));let F=0;class ee extends A.Disposable{getAttrData(){return this._curAttrData}constructor(O,G,j,q,ne,Z,be,fe,Q=new x.EscapeSequenceParser){super(),this._bufferService=O,this._charsetService=G,this._coreService=j,this._logService=q,this._optionsService=ne,this._oscLinkService=Z,this._coreMouseService=be,this._unicodeService=fe,this._parser=Q,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new w.StringToUtf32,this._utf8Decoder=new w.Utf8ToUtf32,this._workCell=new _.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new S.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new S.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new S.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new S.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new S.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new S.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new S.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new S.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new S.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new S.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new S.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new S.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new S.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new Y(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((U=>this._activeBuffer=U.activeBuffer))),this._parser.setCsiHandlerFallback(((U,ue)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(U),params:ue.toArray()})})),this._parser.setEscHandlerFallback((U=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(U)})})),this._parser.setExecuteHandlerFallback((U=>{this._logService.debug("Unknown EXECUTE code: ",{code:U})})),this._parser.setOscHandlerFallback(((U,ue,oe)=>{this._logService.debug("Unknown OSC code: ",{identifier:U,action:ue,data:oe})})),this._parser.setDcsHandlerFallback(((U,ue,oe)=>{ue==="HOOK"&&(oe=oe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(U),action:ue,payload:oe})})),this._parser.setPrintHandler(((U,ue,oe)=>this.print(U,ue,oe))),this._parser.registerCsiHandler({final:"@"},(U=>this.insertChars(U))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(U=>this.scrollLeft(U))),this._parser.registerCsiHandler({final:"A"},(U=>this.cursorUp(U))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(U=>this.scrollRight(U))),this._parser.registerCsiHandler({final:"B"},(U=>this.cursorDown(U))),this._parser.registerCsiHandler({final:"C"},(U=>this.cursorForward(U))),this._parser.registerCsiHandler({final:"D"},(U=>this.cursorBackward(U))),this._parser.registerCsiHandler({final:"E"},(U=>this.cursorNextLine(U))),this._parser.registerCsiHandler({final:"F"},(U=>this.cursorPrecedingLine(U))),this._parser.registerCsiHandler({final:"G"},(U=>this.cursorCharAbsolute(U))),this._parser.registerCsiHandler({final:"H"},(U=>this.cursorPosition(U))),this._parser.registerCsiHandler({final:"I"},(U=>this.cursorForwardTab(U))),this._parser.registerCsiHandler({final:"J"},(U=>this.eraseInDisplay(U,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(U=>this.eraseInDisplay(U,!0))),this._parser.registerCsiHandler({final:"K"},(U=>this.eraseInLine(U,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(U=>this.eraseInLine(U,!0))),this._parser.registerCsiHandler({final:"L"},(U=>this.insertLines(U))),this._parser.registerCsiHandler({final:"M"},(U=>this.deleteLines(U))),this._parser.registerCsiHandler({final:"P"},(U=>this.deleteChars(U))),this._parser.registerCsiHandler({final:"S"},(U=>this.scrollUp(U))),this._parser.registerCsiHandler({final:"T"},(U=>this.scrollDown(U))),this._parser.registerCsiHandler({final:"X"},(U=>this.eraseChars(U))),this._parser.registerCsiHandler({final:"Z"},(U=>this.cursorBackwardTab(U))),this._parser.registerCsiHandler({final:"`"},(U=>this.charPosAbsolute(U))),this._parser.registerCsiHandler({final:"a"},(U=>this.hPositionRelative(U))),this._parser.registerCsiHandler({final:"b"},(U=>this.repeatPrecedingCharacter(U))),this._parser.registerCsiHandler({final:"c"},(U=>this.sendDeviceAttributesPrimary(U))),this._parser.registerCsiHandler({prefix:">",final:"c"},(U=>this.sendDeviceAttributesSecondary(U))),this._parser.registerCsiHandler({final:"d"},(U=>this.linePosAbsolute(U))),this._parser.registerCsiHandler({final:"e"},(U=>this.vPositionRelative(U))),this._parser.registerCsiHandler({final:"f"},(U=>this.hVPosition(U))),this._parser.registerCsiHandler({final:"g"},(U=>this.tabClear(U))),this._parser.registerCsiHandler({final:"h"},(U=>this.setMode(U))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(U=>this.setModePrivate(U))),this._parser.registerCsiHandler({final:"l"},(U=>this.resetMode(U))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(U=>this.resetModePrivate(U))),this._parser.registerCsiHandler({final:"m"},(U=>this.charAttributes(U))),this._parser.registerCsiHandler({final:"n"},(U=>this.deviceStatus(U))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(U=>this.deviceStatusPrivate(U))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(U=>this.softReset(U))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(U=>this.setCursorStyle(U))),this._parser.registerCsiHandler({final:"r"},(U=>this.setScrollRegion(U))),this._parser.registerCsiHandler({final:"s"},(U=>this.saveCursor(U))),this._parser.registerCsiHandler({final:"t"},(U=>this.windowOptions(U))),this._parser.registerCsiHandler({final:"u"},(U=>this.restoreCursor(U))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(U=>this.insertColumns(U))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(U=>this.deleteColumns(U))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(U=>this.selectProtected(U))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(U=>this.requestMode(U,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(U=>this.requestMode(U,!1))),this._parser.setExecuteHandler(p.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(p.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(p.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(p.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(p.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(p.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(p.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(p.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(p.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(p.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(p.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(p.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new L.OscHandler((U=>(this.setTitle(U),this.setIconName(U),!0)))),this._parser.registerOscHandler(1,new L.OscHandler((U=>this.setIconName(U)))),this._parser.registerOscHandler(2,new L.OscHandler((U=>this.setTitle(U)))),this._parser.registerOscHandler(4,new L.OscHandler((U=>this.setOrReportIndexedColor(U)))),this._parser.registerOscHandler(8,new L.OscHandler((U=>this.setHyperlink(U)))),this._parser.registerOscHandler(10,new L.OscHandler((U=>this.setOrReportFgColor(U)))),this._parser.registerOscHandler(11,new L.OscHandler((U=>this.setOrReportBgColor(U)))),this._parser.registerOscHandler(12,new L.OscHandler((U=>this.setOrReportCursorColor(U)))),this._parser.registerOscHandler(104,new L.OscHandler((U=>this.restoreIndexedColor(U)))),this._parser.registerOscHandler(110,new L.OscHandler((U=>this.restoreFgColor(U)))),this._parser.registerOscHandler(111,new L.OscHandler((U=>this.restoreBgColor(U)))),this._parser.registerOscHandler(112,new L.OscHandler((U=>this.restoreCursorColor(U)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const U in y.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:U},(()=>this.selectCharset("("+U))),this._parser.registerEscHandler({intermediates:")",final:U},(()=>this.selectCharset(")"+U))),this._parser.registerEscHandler({intermediates:"*",final:U},(()=>this.selectCharset("*"+U))),this._parser.registerEscHandler({intermediates:"+",final:U},(()=>this.selectCharset("+"+U))),this._parser.registerEscHandler({intermediates:"-",final:U},(()=>this.selectCharset("-"+U))),this._parser.registerEscHandler({intermediates:".",final:U},(()=>this.selectCharset("."+U))),this._parser.registerEscHandler({intermediates:"/",final:U},(()=>this.selectCharset("/"+U)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((U=>(this._logService.error("Parsing error: ",U),U))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new D.DcsHandler(((U,ue)=>this.requestStatusString(U,ue))))}_preserveStack(O,G,j,q){this._parseStack.paused=!0,this._parseStack.cursorStartX=O,this._parseStack.cursorStartY=G,this._parseStack.decodedLength=j,this._parseStack.position=q}_logSlowResolvingAsync(O){this._logService.logLevel<=M.LogLevelEnum.WARN&&Promise.race([O,new Promise(((G,j)=>setTimeout((()=>j("#SLOW_TIMEOUT")),5e3)))]).catch((G=>{if(G!=="#SLOW_TIMEOUT")throw G;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(O,G){let j,q=this._activeBuffer.x,ne=this._activeBuffer.y,Z=0;const be=this._parseStack.paused;if(be){if(j=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,G))return this._logSlowResolvingAsync(j),j;q=this._parseStack.cursorStartX,ne=this._parseStack.cursorStartY,this._parseStack.paused=!1,O.length>$&&(Z=this._parseStack.position+$)}if(this._logService.logLevel<=M.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof O=="string"?` "${O}"`:` "${Array.prototype.map.call(O,(U=>String.fromCharCode(U))).join("")}"`),typeof O=="string"?O.split("").map((U=>U.charCodeAt(0))):O),this._parseBuffer.length<O.length&&this._parseBuffer.length<$&&(this._parseBuffer=new Uint32Array(Math.min(O.length,$))),be||this._dirtyRowTracker.clearRange(),O.length>$)for(let U=Z;U<O.length;U+=$){const ue=U+$<O.length?U+$:O.length,oe=typeof O=="string"?this._stringDecoder.decode(O.substring(U,ue),this._parseBuffer):this._utf8Decoder.decode(O.subarray(U,ue),this._parseBuffer);if(j=this._parser.parse(this._parseBuffer,oe))return this._preserveStack(q,ne,oe,U),this._logSlowResolvingAsync(j),j}else if(!be){const U=typeof O=="string"?this._stringDecoder.decode(O,this._parseBuffer):this._utf8Decoder.decode(O,this._parseBuffer);if(j=this._parser.parse(this._parseBuffer,U))return this._preserveStack(q,ne,U,0),this._logSlowResolvingAsync(j),j}this._activeBuffer.x===q&&this._activeBuffer.y===ne||this._onCursorMove.fire();const fe=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Q=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Q<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Q,this._bufferService.rows-1),Math.min(fe,this._bufferService.rows-1))}print(O,G,j){let q,ne;const Z=this._charsetService.charset,be=this._optionsService.rawOptions.screenReaderMode,fe=this._bufferService.cols,Q=this._coreService.decPrivateModes.wraparound,U=this._coreService.modes.insertMode,ue=this._curAttrData;let oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&j-G>0&&oe.getWidth(this._activeBuffer.x-1)===2&&oe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ue);let de=this._parser.precedingJoinState;for(let he=G;he<j;++he){if(q=O[he],q<127&&Z){const je=Z[String.fromCharCode(q)];je&&(q=je.charCodeAt(0))}const De=this._unicodeService.charProperties(q,de);ne=k.UnicodeService.extractWidth(De);const Ie=k.UnicodeService.extractShouldJoin(De),Fe=Ie?k.UnicodeService.extractWidth(de):0;if(de=De,be&&this._onA11yChar.fire((0,w.stringFromCodePoint)(q)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+ne-Fe>fe){if(Q){const je=oe;let Oe=this._activeBuffer.x-Fe;for(this._activeBuffer.x=Fe,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Fe>0&&oe instanceof v.BufferLine&&oe.copyCellsFrom(je,Oe,0,Fe,!1);Oe<fe;)je.setCellFromCodepoint(Oe++,0,1,ue)}else if(this._activeBuffer.x=fe-1,ne===2)continue}if(Ie&&this._activeBuffer.x){const je=oe.getWidth(this._activeBuffer.x-1)?1:2;oe.addCodepointToCell(this._activeBuffer.x-je,q,ne);for(let Oe=ne-Fe;--Oe>=0;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ue)}else if(U&&(oe.insertCells(this._activeBuffer.x,ne-Fe,this._activeBuffer.getNullCell(ue)),oe.getWidth(fe-1)===2&&oe.setCellFromCodepoint(fe-1,g.NULL_CELL_CODE,g.NULL_CELL_WIDTH,ue)),oe.setCellFromCodepoint(this._activeBuffer.x++,q,ne,ue),ne>0)for(;--ne;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ue)}this._parser.precedingJoinState=de,this._activeBuffer.x<fe&&j-G>0&&oe.getWidth(this._activeBuffer.x)===0&&!oe.hasContent(this._activeBuffer.x)&&oe.setCellFromCodepoint(this._activeBuffer.x,0,1,ue),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(O,G){return O.final!=="t"||O.prefix||O.intermediates?this._parser.registerCsiHandler(O,G):this._parser.registerCsiHandler(O,(j=>!z(j.params[0],this._optionsService.rawOptions.windowOptions)||G(j)))}registerDcsHandler(O,G){return this._parser.registerDcsHandler(O,new D.DcsHandler(G))}registerEscHandler(O,G){return this._parser.registerEscHandler(O,G)}registerOscHandler(O,G){return this._parser.registerOscHandler(O,new L.OscHandler(G))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var O;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&O.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);G.hasWidth(this._activeBuffer.x)&&!G.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const O=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-O),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(O=this._bufferService.cols-1){this._activeBuffer.x=Math.min(O,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(O,G){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=O,this._activeBuffer.y=this._activeBuffer.scrollTop+G):(this._activeBuffer.x=O,this._activeBuffer.y=G),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(O,G){this._restrictCursor(),this._setCursor(this._activeBuffer.x+O,this._activeBuffer.y+G)}cursorUp(O){const G=this._activeBuffer.y-this._activeBuffer.scrollTop;return G>=0?this._moveCursor(0,-Math.min(G,O.params[0]||1)):this._moveCursor(0,-(O.params[0]||1)),!0}cursorDown(O){const G=this._activeBuffer.scrollBottom-this._activeBuffer.y;return G>=0?this._moveCursor(0,Math.min(G,O.params[0]||1)):this._moveCursor(0,O.params[0]||1),!0}cursorForward(O){return this._moveCursor(O.params[0]||1,0),!0}cursorBackward(O){return this._moveCursor(-(O.params[0]||1),0),!0}cursorNextLine(O){return this.cursorDown(O),this._activeBuffer.x=0,!0}cursorPrecedingLine(O){return this.cursorUp(O),this._activeBuffer.x=0,!0}cursorCharAbsolute(O){return this._setCursor((O.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(O){return this._setCursor(O.length>=2?(O.params[1]||1)-1:0,(O.params[0]||1)-1),!0}charPosAbsolute(O){return this._setCursor((O.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(O){return this._moveCursor(O.params[0]||1,0),!0}linePosAbsolute(O){return this._setCursor(this._activeBuffer.x,(O.params[0]||1)-1),!0}vPositionRelative(O){return this._moveCursor(0,O.params[0]||1),!0}hVPosition(O){return this.cursorPosition(O),!0}tabClear(O){const G=O.params[0];return G===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:G===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(O){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let G=O.params[0]||1;for(;G--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(O){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let G=O.params[0]||1;for(;G--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(O){const G=O.params[0];return G===1&&(this._curAttrData.bg|=536870912),G!==2&&G!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(O,G,j,q=!1,ne=!1){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);Z.replaceCells(G,j,this._activeBuffer.getNullCell(this._eraseAttrData()),ne),q&&(Z.isWrapped=!1)}_resetBufferLine(O,G=!1){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);j&&(j.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),G),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+O),j.isWrapped=!1)}eraseInDisplay(O,G=!1){let j;switch(this._restrictCursor(this._bufferService.cols),O.params[0]){case 0:for(j=this._activeBuffer.y,this._dirtyRowTracker.markDirty(j),this._eraseInBufferLine(j++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,G);j<this._bufferService.rows;j++)this._resetBufferLine(j,G);this._dirtyRowTracker.markDirty(j);break;case 1:for(j=this._activeBuffer.y,this._dirtyRowTracker.markDirty(j),this._eraseInBufferLine(j,0,this._activeBuffer.x+1,!0,G),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(j+1).isWrapped=!1);j--;)this._resetBufferLine(j,G);this._dirtyRowTracker.markDirty(0);break;case 2:for(j=this._bufferService.rows,this._dirtyRowTracker.markDirty(j-1);j--;)this._resetBufferLine(j,G);this._dirtyRowTracker.markDirty(0);break;case 3:const q=this._activeBuffer.lines.length-this._bufferService.rows;q>0&&(this._activeBuffer.lines.trimStart(q),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-q,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-q,0),this._onScroll.fire(0))}return!0}eraseInLine(O,G=!1){switch(this._restrictCursor(this._bufferService.cols),O.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,G);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,G);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,G)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(O){this._restrictCursor();let G=O.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=this._activeBuffer.ybase+this._activeBuffer.y,q=this._bufferService.rows-1-this._activeBuffer.scrollBottom,ne=this._bufferService.rows-1+this._activeBuffer.ybase-q+1;for(;G--;)this._activeBuffer.lines.splice(ne-1,1),this._activeBuffer.lines.splice(j,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(O){this._restrictCursor();let G=O.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=this._activeBuffer.ybase+this._activeBuffer.y;let q;for(q=this._bufferService.rows-1-this._activeBuffer.scrollBottom,q=this._bufferService.rows-1+this._activeBuffer.ybase-q;G--;)this._activeBuffer.lines.splice(j,1),this._activeBuffer.lines.splice(q,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(O){this._restrictCursor();const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return G&&(G.insertCells(this._activeBuffer.x,O.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(O){this._restrictCursor();const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return G&&(G.deleteCells(this._activeBuffer.x,O.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(O){let G=O.params[0]||1;for(;G--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(O){let G=O.params[0]||1;for(;G--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(v.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(O){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const G=O.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);q.deleteCells(0,G,this._activeBuffer.getNullCell(this._eraseAttrData())),q.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(O){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const G=O.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);q.insertCells(0,G,this._activeBuffer.getNullCell(this._eraseAttrData())),q.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(O){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const G=O.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);q.insertCells(this._activeBuffer.x,G,this._activeBuffer.getNullCell(this._eraseAttrData())),q.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(O){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const G=O.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);q.deleteCells(this._activeBuffer.x,G,this._activeBuffer.getNullCell(this._eraseAttrData())),q.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(O){this._restrictCursor();const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return G&&(G.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(O.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(O){const G=this._parser.precedingJoinState;if(!G)return!0;const j=O.params[0]||1,q=k.UnicodeService.extractWidth(G),ne=this._activeBuffer.x-q,Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(ne),be=new Uint32Array(Z.length*j);let fe=0;for(let U=0;U<Z.length;){const ue=Z.codePointAt(U)||0;be[fe++]=ue,U+=ue>65535?2:1}let Q=fe;for(let U=1;U<j;++U)be.copyWithin(Q,0,fe),Q+=fe;return this.print(be,0,Q),!0}sendDeviceAttributesPrimary(O){return O.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(p.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(p.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(O){return O.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(p.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(p.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(O.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(p.C0.ESC+"[>83;40003;0c")),!0}_is(O){return(this._optionsService.rawOptions.termName+"").indexOf(O)===0}setMode(O){for(let G=0;G<O.length;G++)switch(O.params[G]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(O){for(let G=0;G<O.length;G++)switch(O.params[G]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,y.DEFAULT_CHARSET),this._charsetService.setgCharset(1,y.DEFAULT_CHARSET),this._charsetService.setgCharset(2,y.DEFAULT_CHARSET),this._charsetService.setgCharset(3,y.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(O){for(let G=0;G<O.length;G++)switch(O.params[G]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(O){for(let G=0;G<O.length;G++)switch(O.params[G]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),O.params[G]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(O,G){const j=this._coreService.decPrivateModes,{activeProtocol:q,activeEncoding:ne}=this._coreMouseService,Z=this._coreService,{buffers:be,cols:fe}=this._bufferService,{active:Q,alt:U}=be,ue=this._optionsService.rawOptions,oe=Ie=>Ie?1:2,de=O.params[0];return he=de,De=G?de===2?4:de===4?oe(Z.modes.insertMode):de===12?3:de===20?oe(ue.convertEol):0:de===1?oe(j.applicationCursorKeys):de===3?ue.windowOptions.setWinLines?fe===80?2:fe===132?1:0:0:de===6?oe(j.origin):de===7?oe(j.wraparound):de===8?3:de===9?oe(q==="X10"):de===12?oe(ue.cursorBlink):de===25?oe(!Z.isCursorHidden):de===45?oe(j.reverseWraparound):de===66?oe(j.applicationKeypad):de===67?4:de===1e3?oe(q==="VT200"):de===1002?oe(q==="DRAG"):de===1003?oe(q==="ANY"):de===1004?oe(j.sendFocus):de===1005?4:de===1006?oe(ne==="SGR"):de===1015?4:de===1016?oe(ne==="SGR_PIXELS"):de===1048?1:de===47||de===1047||de===1049?oe(Q===U):de===2004?oe(j.bracketedPasteMode):0,Z.triggerDataEvent(`${p.C0.ESC}[${G?"":"?"}${he};${De}$y`),!0;var he,De}_updateAttrColor(O,G,j,q,ne){return G===2?(O|=50331648,O&=-16777216,O|=T.AttributeData.fromColorRGB([j,q,ne])):G===5&&(O&=-50331904,O|=33554432|255&j),O}_extractColor(O,G,j){const q=[0,0,-1,0,0,0];let ne=0,Z=0;do{if(q[Z+ne]=O.params[G+Z],O.hasSubParams(G+Z)){const be=O.getSubParams(G+Z);let fe=0;do q[1]===5&&(ne=1),q[Z+fe+1+ne]=be[fe];while(++fe<be.length&&fe+Z+1+ne<q.length);break}if(q[1]===5&&Z+ne>=2||q[1]===2&&Z+ne>=5)break;q[1]&&(ne=1)}while(++Z+G<O.length&&Z+ne<q.length);for(let be=2;be<q.length;++be)q[be]===-1&&(q[be]=0);switch(q[0]){case 38:j.fg=this._updateAttrColor(j.fg,q[1],q[3],q[4],q[5]);break;case 48:j.bg=this._updateAttrColor(j.bg,q[1],q[3],q[4],q[5]);break;case 58:j.extended=j.extended.clone(),j.extended.underlineColor=this._updateAttrColor(j.extended.underlineColor,q[1],q[3],q[4],q[5])}return Z}_processUnderline(O,G){G.extended=G.extended.clone(),(!~O||O>5)&&(O=1),G.extended.underlineStyle=O,G.fg|=268435456,O===0&&(G.fg&=-268435457),G.updateExtended()}_processSGR0(O){O.fg=v.DEFAULT_ATTR_DATA.fg,O.bg=v.DEFAULT_ATTR_DATA.bg,O.extended=O.extended.clone(),O.extended.underlineStyle=0,O.extended.underlineColor&=-67108864,O.updateExtended()}charAttributes(O){if(O.length===1&&O.params[0]===0)return this._processSGR0(this._curAttrData),!0;const G=O.length;let j;const q=this._curAttrData;for(let ne=0;ne<G;ne++)j=O.params[ne],j>=30&&j<=37?(q.fg&=-50331904,q.fg|=16777216|j-30):j>=40&&j<=47?(q.bg&=-50331904,q.bg|=16777216|j-40):j>=90&&j<=97?(q.fg&=-50331904,q.fg|=16777224|j-90):j>=100&&j<=107?(q.bg&=-50331904,q.bg|=16777224|j-100):j===0?this._processSGR0(q):j===1?q.fg|=134217728:j===3?q.bg|=67108864:j===4?(q.fg|=268435456,this._processUnderline(O.hasSubParams(ne)?O.getSubParams(ne)[0]:1,q)):j===5?q.fg|=536870912:j===7?q.fg|=67108864:j===8?q.fg|=1073741824:j===9?q.fg|=2147483648:j===2?q.bg|=134217728:j===21?this._processUnderline(2,q):j===22?(q.fg&=-134217729,q.bg&=-134217729):j===23?q.bg&=-67108865:j===24?(q.fg&=-268435457,this._processUnderline(0,q)):j===25?q.fg&=-536870913:j===27?q.fg&=-67108865:j===28?q.fg&=-1073741825:j===29?q.fg&=2147483647:j===39?(q.fg&=-67108864,q.fg|=16777215&v.DEFAULT_ATTR_DATA.fg):j===49?(q.bg&=-67108864,q.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):j===38||j===48||j===58?ne+=this._extractColor(O,ne,q):j===53?q.bg|=1073741824:j===55?q.bg&=-1073741825:j===59?(q.extended=q.extended.clone(),q.extended.underlineColor=-1,q.updateExtended()):j===100?(q.fg&=-67108864,q.fg|=16777215&v.DEFAULT_ATTR_DATA.fg,q.bg&=-67108864,q.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",j);return!0}deviceStatus(O){switch(O.params[0]){case 5:this._coreService.triggerDataEvent(`${p.C0.ESC}[0n`);break;case 6:const G=this._activeBuffer.y+1,j=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[${G};${j}R`)}return!0}deviceStatusPrivate(O){if(O.params[0]===6){const G=this._activeBuffer.y+1,j=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[?${G};${j}R`)}return!0}softReset(O){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(O){const G=O.params[0]||1;switch(G){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const j=G%2==1;return this._optionsService.options.cursorBlink=j,!0}setScrollRegion(O){const G=O.params[0]||1;let j;return(O.length<2||(j=O.params[1])>this._bufferService.rows||j===0)&&(j=this._bufferService.rows),j>G&&(this._activeBuffer.scrollTop=G-1,this._activeBuffer.scrollBottom=j-1,this._setCursor(0,0)),!0}windowOptions(O){if(!z(O.params[0],this._optionsService.rawOptions.windowOptions))return!0;const G=O.length>1?O.params[1]:0;switch(O.params[0]){case 14:G!==2&&this._onRequestWindowsOptionsReport.fire(W.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(W.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${p.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:G!==0&&G!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),G!==0&&G!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:G!==0&&G!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),G!==0&&G!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(O){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(O){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(O){return this._windowTitle=O,this._onTitleChange.fire(O),!0}setIconName(O){return this._iconName=O,!0}setOrReportIndexedColor(O){const G=[],j=O.split(";");for(;j.length>1;){const q=j.shift(),ne=j.shift();if(/^\d+$/.exec(q)){const Z=parseInt(q);if(re(Z))if(ne==="?")G.push({type:0,index:Z});else{const be=(0,P.parseColor)(ne);be&&G.push({type:1,index:Z,color:be})}}}return G.length&&this._onColor.fire(G),!0}setHyperlink(O){const G=O.split(";");return!(G.length<2)&&(G[1]?this._createHyperlink(G[0],G[1]):!G[0]&&this._finishHyperlink())}_createHyperlink(O,G){this._getCurrentLinkId()&&this._finishHyperlink();const j=O.split(":");let q;const ne=j.findIndex((Z=>Z.startsWith("id=")));return ne!==-1&&(q=j[ne].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:q,uri:G}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(O,G){const j=O.split(";");for(let q=0;q<j.length&&!(G>=this._specialColors.length);++q,++G)if(j[q]==="?")this._onColor.fire([{type:0,index:this._specialColors[G]}]);else{const ne=(0,P.parseColor)(j[q]);ne&&this._onColor.fire([{type:1,index:this._specialColors[G],color:ne}])}return!0}setOrReportFgColor(O){return this._setOrReportSpecialColor(O,0)}setOrReportBgColor(O){return this._setOrReportSpecialColor(O,1)}setOrReportCursorColor(O){return this._setOrReportSpecialColor(O,2)}restoreIndexedColor(O){if(!O)return this._onColor.fire([{type:2}]),!0;const G=[],j=O.split(";");for(let q=0;q<j.length;++q)if(/^\d+$/.exec(j[q])){const ne=parseInt(j[q]);re(ne)&&G.push({type:2,index:ne})}return G.length&&this._onColor.fire(G),!0}restoreFgColor(O){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(O){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(O){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,y.DEFAULT_CHARSET),!0}selectCharset(O){return O.length!==2?(this.selectDefaultCharset(),!0):(O[0]==="/"||this._charsetService.setgCharset(K[O[0]],y.CHARSETS[O[1]]||y.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const O=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,O,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(O){return this._charsetService.setgLevel(O),!0}screenAlignmentPattern(){const O=new _.CellData;O.content=4194373,O.fg=this._curAttrData.fg,O.bg=this._curAttrData.bg,this._setCursor(0,0);for(let G=0;G<this._bufferService.rows;++G){const j=this._activeBuffer.ybase+this._activeBuffer.y+G,q=this._activeBuffer.lines.get(j);q&&(q.fill(O),q.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(O,G){const j=this._bufferService.buffer,q=this._optionsService.rawOptions;return(ne=>(this._coreService.triggerDataEvent(`${p.C0.ESC}${ne}${p.C0.ESC}\\`),!0))(O==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:O==='"p'?'P1$r61;1"p':O==="r"?`P1$r${j.scrollTop+1};${j.scrollBottom+1}r`:O==="m"?"P1$r0m":O===" q"?`P1$r${{block:2,underline:4,bar:6}[q.cursorStyle]-(q.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(O,G){this._dirtyRowTracker.markRangeDirty(O,G)}}l.InputHandler=ee;let Y=class{constructor(te){this._bufferService=te,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(te){te<this.start?this.start=te:te>this.end&&(this.end=te)}markRangeDirty(te,O){te>O&&(F=te,te=O,O=F),te<this.start&&(this.start=te),O>this.end&&(this.end=O)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function re(te){return 0<=te&&te<256}Y=h([m(0,M.IBufferService)],Y)},844:(f,l)=>{function c(h){for(const m of h)m.dispose();h.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const m=this._disposables.indexOf(h);m!==-1&&this._disposables.splice(m,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var m;this._isDisposed||h===this._value||((m=this._value)==null||m.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)==null||h.dispose(),this._value=void 0}},l.toDisposable=function(h){return{dispose:h}},l.disposeArray=c,l.getDisposeArrayDisposable=function(h){return{dispose:()=>c(h)}}},1505:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(m,p,y){this._data[m]||(this._data[m]={}),this._data[m][p]=y}get(m,p){return this._data[m]?this._data[m][p]:void 0}clear(){this._data={}}}l.TwoKeyMap=c,l.FourKeyMap=class{constructor(){this._data=new c}set(h,m,p,y,x){this._data.get(h,m)||this._data.set(h,m,new c),this._data.get(h,m).set(p,y,x)}get(h,m,p,y){var x;return(x=this._data.get(h,m))==null?void 0:x.get(p,y)}clear(){this._data.clear()}}},6114:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof process<"u"&&"title"in process;const c=l.isNode?"node":navigator.userAgent,h=l.isNode?"node":navigator.platform;l.isFirefox=c.includes("Firefox"),l.isLegacyEdge=c.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(c),l.getSafariVersion=function(){if(!l.isSafari)return 0;const m=c.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),l.isIpad=h==="iPad",l.isIphone=h==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),l.isLinux=h.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(c)},6106:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let c=0;l.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(c=this._search(this._getKey(h)),this._array.splice(c,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const m=this._getKey(h);if(m===void 0||(c=this._search(m),c===-1)||this._getKey(this._array[c])!==m)return!1;do if(this._array[c]===h)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===m);return!1}*getKeyIterator(h){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===h)}forEachByKey(h,m){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do m(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===h)}values(){return[...this._array].values()}_search(h){let m=0,p=this._array.length-1;for(;p>=m;){let y=m+p>>1;const x=this._getKey(this._array[y]);if(x>h)p=y-1;else{if(!(x<h)){for(;y>0&&this._getKey(this._array[y-1])===h;)y--;return y}m=y+1}}return m}}},7226:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const h=c(6114);class m{constructor(){this._tasks=[],this._i=0}enqueue(x){this._tasks.push(x),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(x){this._idleCallback=void 0;let A=0,w=0,v=x.timeRemaining(),S=0;for(;this._i<this._tasks.length;){if(A=Date.now(),this._tasks[this._i]()||this._i++,A=Math.max(1,Date.now()-A),w=Math.max(A,w),S=x.timeRemaining(),1.5*w>S)return v-A<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-A))}ms`),void this._start();v=S}this.clear()}}class p extends m{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const A=Date.now()+x;return{timeRemaining:()=>Math.max(0,A-Date.now())}}}l.PriorityTaskQueue=p,l.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(y){return requestIdleCallback(y)}_cancelCallback(y){cancelIdleCallback(y)}}:p,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(y){this._queue.clear(),this._queue.enqueue(y)}flush(){this._queue.flush()}}},9282:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const h=c(643);l.updateWindowsModeWrappedState=function(m){const p=m.buffer.lines.get(m.buffer.ybase+m.buffer.y-1),y=p==null?void 0:p.get(m.cols-1),x=m.buffer.lines.get(m.buffer.ybase+m.buffer.y);x&&y&&(x.isWrapped=y[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&y[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(p){return[p>>>16&255,p>>>8&255,255&p]}static fromColorRGB(p){return(255&p[0])<<16|(255&p[1])<<8|255&p[2]}clone(){const p=new c;return p.fg=this.fg,p.bg=this.bg,p.extended=this.extended.clone(),p}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}l.AttributeData=c;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(p){this._ext=p}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(p){this._ext&=-469762049,this._ext|=p<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(p){this._ext&=-67108864,this._ext|=67108863&p}get urlId(){return this._urlId}set urlId(p){this._urlId=p}get underlineVariantOffset(){const p=(3758096384&this._ext)>>29;return p<0?4294967288^p:p}set underlineVariantOffset(p){this._ext&=536870911,this._ext|=p<<29&3758096384}constructor(p=0,y=0){this._ext=0,this._urlId=0,this._ext=p,this._urlId=y}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=h},9092:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const h=c(6349),m=c(7226),p=c(3734),y=c(8437),x=c(4634),A=c(511),w=c(643),v=c(4863),S=c(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(g,_,T){this._hasScrollback=g,this._optionsService=_,this._bufferService=T,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=y.DEFAULT_ATTR_DATA.clone(),this.savedCharset=S.DEFAULT_CHARSET,this.markers=[],this._nullCell=A.CellData.fromCharData([0,w.NULL_CELL_CHAR,w.NULL_CELL_WIDTH,w.NULL_CELL_CODE]),this._whitespaceCell=A.CellData.fromCharData([0,w.WHITESPACE_CELL_CHAR,w.WHITESPACE_CELL_WIDTH,w.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new m.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(g){return g?(this._nullCell.fg=g.fg,this._nullCell.bg=g.bg,this._nullCell.extended=g.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new p.ExtendedAttrs),this._nullCell}getWhitespaceCell(g){return g?(this._whitespaceCell.fg=g.fg,this._whitespaceCell.bg=g.bg,this._whitespaceCell.extended=g.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new p.ExtendedAttrs),this._whitespaceCell}getBlankLine(g,_){return new y.BufferLine(this._bufferService.cols,this.getNullCell(g),_)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const g=this.ybase+this.y-this.ydisp;return g>=0&&g<this._rows}_getCorrectBufferLength(g){if(!this._hasScrollback)return g;const _=g+this._optionsService.rawOptions.scrollback;return _>l.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:_}fillViewportRows(g){if(this.lines.length===0){g===void 0&&(g=y.DEFAULT_ATTR_DATA);let _=this._rows;for(;_--;)this.lines.push(this.getBlankLine(g))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(g,_){const T=this.getNullCell(y.DEFAULT_ATTR_DATA);let M=0;const k=this._getCorrectBufferLength(_);if(k>this.lines.maxLength&&(this.lines.maxLength=k),this.lines.length>0){if(this._cols<g)for(let D=0;D<this.lines.length;D++)M+=+this.lines.get(D).resize(g,T);let L=0;if(this._rows<_)for(let D=this._rows;D<_;D++)this.lines.length<_+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new y.BufferLine(g,T)):this.ybase>0&&this.lines.length<=this.ybase+this.y+L+1?(this.ybase--,L++,this.ydisp>0&&this.ydisp--):this.lines.push(new y.BufferLine(g,T)));else for(let D=this._rows;D>_;D--)this.lines.length>_+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(k<this.lines.maxLength){const D=this.lines.length-k;D>0&&(this.lines.trimStart(D),this.ybase=Math.max(this.ybase-D,0),this.ydisp=Math.max(this.ydisp-D,0),this.savedY=Math.max(this.savedY-D,0)),this.lines.maxLength=k}this.x=Math.min(this.x,g-1),this.y=Math.min(this.y,_-1),L&&(this.y+=L),this.savedX=Math.min(this.savedX,g-1),this.scrollTop=0}if(this.scrollBottom=_-1,this._isReflowEnabled&&(this._reflow(g,_),this._cols>g))for(let L=0;L<this.lines.length;L++)M+=+this.lines.get(L).resize(g,T);this._cols=g,this._rows=_,this._memoryCleanupQueue.clear(),M>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let g=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,g=!1);let _=0;for(;this._memoryCleanupPosition<this.lines.length;)if(_+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),_>100)return!0;return g}get _isReflowEnabled(){const g=this._optionsService.rawOptions.windowsPty;return g&&g.buildNumber?this._hasScrollback&&g.backend==="conpty"&&g.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(g,_){this._cols!==g&&(g>this._cols?this._reflowLarger(g,_):this._reflowSmaller(g,_))}_reflowLarger(g,_){const T=(0,x.reflowLargerGetLinesToRemove)(this.lines,this._cols,g,this.ybase+this.y,this.getNullCell(y.DEFAULT_ATTR_DATA));if(T.length>0){const M=(0,x.reflowLargerCreateNewLayout)(this.lines,T);(0,x.reflowLargerApplyNewLayout)(this.lines,M.layout),this._reflowLargerAdjustViewport(g,_,M.countRemoved)}}_reflowLargerAdjustViewport(g,_,T){const M=this.getNullCell(y.DEFAULT_ATTR_DATA);let k=T;for(;k-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<_&&this.lines.push(new y.BufferLine(g,M))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-T,0)}_reflowSmaller(g,_){const T=this.getNullCell(y.DEFAULT_ATTR_DATA),M=[];let k=0;for(let L=this.lines.length-1;L>=0;L--){let D=this.lines.get(L);if(!D||!D.isWrapped&&D.getTrimmedLength()<=g)continue;const P=[D];for(;D.isWrapped&&L>0;)D=this.lines.get(--L),P.unshift(D);const K=this.ybase+this.y;if(K>=L&&K<L+P.length)continue;const $=P[P.length-1].getTrimmedLength(),z=(0,x.reflowSmallerGetNewLineLengths)(P,this._cols,g),W=z.length-P.length;let F;F=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+W):Math.max(0,this.lines.length-this.lines.maxLength+W);const ee=[];for(let j=0;j<W;j++){const q=this.getBlankLine(y.DEFAULT_ATTR_DATA,!0);ee.push(q)}ee.length>0&&(M.push({start:L+P.length+k,newLines:ee}),k+=ee.length),P.push(...ee);let Y=z.length-1,re=z[Y];re===0&&(Y--,re=z[Y]);let te=P.length-W-1,O=$;for(;te>=0;){const j=Math.min(O,re);if(P[Y]===void 0)break;if(P[Y].copyCellsFrom(P[te],O-j,re-j,j,!0),re-=j,re===0&&(Y--,re=z[Y]),O-=j,O===0){te--;const q=Math.max(te,0);O=(0,x.getWrappedLineTrimmedLength)(P,q,this._cols)}}for(let j=0;j<P.length;j++)z[j]<g&&P[j].setCell(z[j],T);let G=W-F;for(;G-- >0;)this.ybase===0?this.y<_-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+k)-_&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+W,this.ybase+_-1)}if(M.length>0){const L=[],D=[];for(let Y=0;Y<this.lines.length;Y++)D.push(this.lines.get(Y));const P=this.lines.length;let K=P-1,$=0,z=M[$];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+k);let W=0;for(let Y=Math.min(this.lines.maxLength-1,P+k-1);Y>=0;Y--)if(z&&z.start>K+W){for(let re=z.newLines.length-1;re>=0;re--)this.lines.set(Y--,z.newLines[re]);Y++,L.push({index:K+1,amount:z.newLines.length}),W+=z.newLines.length,z=M[++$]}else this.lines.set(Y,D[K--]);let F=0;for(let Y=L.length-1;Y>=0;Y--)L[Y].index+=F,this.lines.onInsertEmitter.fire(L[Y]),F+=L[Y].amount;const ee=Math.max(0,P+k-this.lines.maxLength);ee>0&&this.lines.onTrimEmitter.fire(ee)}}translateBufferLineToString(g,_,T=0,M){const k=this.lines.get(g);return k?k.translateToString(_,T,M):""}getWrappedRangeForLine(g){let _=g,T=g;for(;_>0&&this.lines.get(_).isWrapped;)_--;for(;T+1<this.lines.length&&this.lines.get(T+1).isWrapped;)T++;return{first:_,last:T}}setupTabStops(g){for(g!=null?this.tabs[g]||(g=this.prevStop(g)):(this.tabs={},g=0);g<this._cols;g+=this._optionsService.rawOptions.tabStopWidth)this.tabs[g]=!0}prevStop(g){for(g==null&&(g=this.x);!this.tabs[--g]&&g>0;);return g>=this._cols?this._cols-1:g<0?0:g}nextStop(g){for(g==null&&(g=this.x);!this.tabs[++g]&&g<this._cols;);return g>=this._cols?this._cols-1:g<0?0:g}clearMarkers(g){this._isClearing=!0;for(let _=0;_<this.markers.length;_++)this.markers[_].line===g&&(this.markers[_].dispose(),this.markers.splice(_--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let g=0;g<this.markers.length;g++)this.markers[g].dispose(),this.markers.splice(g--,1);this._isClearing=!1}addMarker(g){const _=new v.Marker(g);return this.markers.push(_),_.register(this.lines.onTrim((T=>{_.line-=T,_.line<0&&_.dispose()}))),_.register(this.lines.onInsert((T=>{_.line>=T.index&&(_.line+=T.amount)}))),_.register(this.lines.onDelete((T=>{_.line>=T.index&&_.line<T.index+T.amount&&_.dispose(),_.line>T.index&&(_.line-=T.amount)}))),_.register(_.onDispose((()=>this._removeMarker(_)))),_}_removeMarker(g){this._isClearing||this.markers.splice(this.markers.indexOf(g),1)}}},8437:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const h=c(3734),m=c(511),p=c(643),y=c(482);l.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let x=0;class A{constructor(v,S,g=!1){this.isWrapped=g,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*v);const _=S||m.CellData.fromCharData([0,p.NULL_CELL_CHAR,p.NULL_CELL_WIDTH,p.NULL_CELL_CODE]);for(let T=0;T<v;++T)this.setCell(T,_);this.length=v}get(v){const S=this._data[3*v+0],g=2097151&S;return[this._data[3*v+1],2097152&S?this._combined[v]:g?(0,y.stringFromCodePoint)(g):"",S>>22,2097152&S?this._combined[v].charCodeAt(this._combined[v].length-1):g]}set(v,S){this._data[3*v+1]=S[p.CHAR_DATA_ATTR_INDEX],S[p.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[v]=S[1],this._data[3*v+0]=2097152|v|S[p.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*v+0]=S[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[p.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(v){return this._data[3*v+0]>>22}hasWidth(v){return 12582912&this._data[3*v+0]}getFg(v){return this._data[3*v+1]}getBg(v){return this._data[3*v+2]}hasContent(v){return 4194303&this._data[3*v+0]}getCodePoint(v){const S=this._data[3*v+0];return 2097152&S?this._combined[v].charCodeAt(this._combined[v].length-1):2097151&S}isCombined(v){return 2097152&this._data[3*v+0]}getString(v){const S=this._data[3*v+0];return 2097152&S?this._combined[v]:2097151&S?(0,y.stringFromCodePoint)(2097151&S):""}isProtected(v){return 536870912&this._data[3*v+2]}loadCell(v,S){return x=3*v,S.content=this._data[x+0],S.fg=this._data[x+1],S.bg=this._data[x+2],2097152&S.content&&(S.combinedData=this._combined[v]),268435456&S.bg&&(S.extended=this._extendedAttrs[v]),S}setCell(v,S){2097152&S.content&&(this._combined[v]=S.combinedData),268435456&S.bg&&(this._extendedAttrs[v]=S.extended),this._data[3*v+0]=S.content,this._data[3*v+1]=S.fg,this._data[3*v+2]=S.bg}setCellFromCodepoint(v,S,g,_){268435456&_.bg&&(this._extendedAttrs[v]=_.extended),this._data[3*v+0]=S|g<<22,this._data[3*v+1]=_.fg,this._data[3*v+2]=_.bg}addCodepointToCell(v,S,g){let _=this._data[3*v+0];2097152&_?this._combined[v]+=(0,y.stringFromCodePoint)(S):2097151&_?(this._combined[v]=(0,y.stringFromCodePoint)(2097151&_)+(0,y.stringFromCodePoint)(S),_&=-2097152,_|=2097152):_=S|4194304,g&&(_&=-12582913,_|=g<<22),this._data[3*v+0]=_}insertCells(v,S,g){if((v%=this.length)&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,g),S<this.length-v){const _=new m.CellData;for(let T=this.length-v-S-1;T>=0;--T)this.setCell(v+S+T,this.loadCell(v+T,_));for(let T=0;T<S;++T)this.setCell(v+T,g)}else for(let _=v;_<this.length;++_)this.setCell(_,g);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,g)}deleteCells(v,S,g){if(v%=this.length,S<this.length-v){const _=new m.CellData;for(let T=0;T<this.length-v-S;++T)this.setCell(v+T,this.loadCell(v+S+T,_));for(let T=this.length-S;T<this.length;++T)this.setCell(T,g)}else for(let _=v;_<this.length;++_)this.setCell(_,g);v&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,g),this.getWidth(v)!==0||this.hasContent(v)||this.setCellFromCodepoint(v,0,1,g)}replaceCells(v,S,g,_=!1){if(_)for(v&&this.getWidth(v-1)===2&&!this.isProtected(v-1)&&this.setCellFromCodepoint(v-1,0,1,g),S<this.length&&this.getWidth(S-1)===2&&!this.isProtected(S)&&this.setCellFromCodepoint(S,0,1,g);v<S&&v<this.length;)this.isProtected(v)||this.setCell(v,g),v++;else for(v&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,g),S<this.length&&this.getWidth(S-1)===2&&this.setCellFromCodepoint(S,0,1,g);v<S&&v<this.length;)this.setCell(v++,g)}resize(v,S){if(v===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const g=3*v;if(v>this.length){if(this._data.buffer.byteLength>=4*g)this._data=new Uint32Array(this._data.buffer,0,g);else{const _=new Uint32Array(g);_.set(this._data),this._data=_}for(let _=this.length;_<v;++_)this.setCell(_,S)}else{this._data=this._data.subarray(0,g);const _=Object.keys(this._combined);for(let M=0;M<_.length;M++){const k=parseInt(_[M],10);k>=v&&delete this._combined[k]}const T=Object.keys(this._extendedAttrs);for(let M=0;M<T.length;M++){const k=parseInt(T[M],10);k>=v&&delete this._extendedAttrs[k]}}return this.length=v,4*g*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const v=new Uint32Array(this._data.length);return v.set(this._data),this._data=v,1}return 0}fill(v,S=!1){if(S)for(let g=0;g<this.length;++g)this.isProtected(g)||this.setCell(g,v);else{this._combined={},this._extendedAttrs={};for(let g=0;g<this.length;++g)this.setCell(g,v)}}copyFrom(v){this.length!==v.length?this._data=new Uint32Array(v._data):this._data.set(v._data),this.length=v.length,this._combined={};for(const S in v._combined)this._combined[S]=v._combined[S];this._extendedAttrs={};for(const S in v._extendedAttrs)this._extendedAttrs[S]=v._extendedAttrs[S];this.isWrapped=v.isWrapped}clone(){const v=new A(0);v._data=new Uint32Array(this._data),v.length=this.length;for(const S in this._combined)v._combined[S]=this._combined[S];for(const S in this._extendedAttrs)v._extendedAttrs[S]=this._extendedAttrs[S];return v.isWrapped=this.isWrapped,v}getTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0])return v+(this._data[3*v+0]>>22);return 0}getNoBgTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0]||50331648&this._data[3*v+2])return v+(this._data[3*v+0]>>22);return 0}copyCellsFrom(v,S,g,_,T){const M=v._data;if(T)for(let L=_-1;L>=0;L--){for(let D=0;D<3;D++)this._data[3*(g+L)+D]=M[3*(S+L)+D];268435456&M[3*(S+L)+2]&&(this._extendedAttrs[g+L]=v._extendedAttrs[S+L])}else for(let L=0;L<_;L++){for(let D=0;D<3;D++)this._data[3*(g+L)+D]=M[3*(S+L)+D];268435456&M[3*(S+L)+2]&&(this._extendedAttrs[g+L]=v._extendedAttrs[S+L])}const k=Object.keys(v._combined);for(let L=0;L<k.length;L++){const D=parseInt(k[L],10);D>=S&&(this._combined[D-S+g]=v._combined[D])}}translateToString(v,S,g,_){S=S??0,g=g??this.length,v&&(g=Math.min(g,this.getTrimmedLength())),_&&(_.length=0);let T="";for(;S<g;){const M=this._data[3*S+0],k=2097151&M,L=2097152&M?this._combined[S]:k?(0,y.stringFromCodePoint)(k):p.WHITESPACE_CELL_CHAR;if(T+=L,_)for(let D=0;D<L.length;++D)_.push(S);S+=M>>22||1}return _&&_.push(S),T}}l.BufferLine=A},4841:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.getRangeLength=function(c,h){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return h*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(f,l)=>{function c(h,m,p){if(m===h.length-1)return h[m].getTrimmedLength();const y=!h[m].hasContent(p-1)&&h[m].getWidth(p-1)===1,x=h[m+1].getWidth(0)===2;return y&&x?p-1:p}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(h,m,p,y,x){const A=[];for(let w=0;w<h.length-1;w++){let v=w,S=h.get(++v);if(!S.isWrapped)continue;const g=[h.get(w)];for(;v<h.length&&S.isWrapped;)g.push(S),S=h.get(++v);if(y>=w&&y<v){w+=g.length-1;continue}let _=0,T=c(g,_,m),M=1,k=0;for(;M<g.length;){const D=c(g,M,m),P=D-k,K=p-T,$=Math.min(P,K);g[_].copyCellsFrom(g[M],k,T,$,!1),T+=$,T===p&&(_++,T=0),k+=$,k===D&&(M++,k=0),T===0&&_!==0&&g[_-1].getWidth(p-1)===2&&(g[_].copyCellsFrom(g[_-1],p-1,T++,1,!1),g[_-1].setCell(p-1,x))}g[_].replaceCells(T,p,x);let L=0;for(let D=g.length-1;D>0&&(D>_||g[D].getTrimmedLength()===0);D--)L++;L>0&&(A.push(w+g.length-L),A.push(L)),w+=g.length-1}return A},l.reflowLargerCreateNewLayout=function(h,m){const p=[];let y=0,x=m[y],A=0;for(let w=0;w<h.length;w++)if(x===w){const v=m[++y];h.onDeleteEmitter.fire({index:w-A,amount:v}),w+=v-1,A+=v,x=m[++y]}else p.push(w);return{layout:p,countRemoved:A}},l.reflowLargerApplyNewLayout=function(h,m){const p=[];for(let y=0;y<m.length;y++)p.push(h.get(m[y]));for(let y=0;y<p.length;y++)h.set(y,p[y]);h.length=m.length},l.reflowSmallerGetNewLineLengths=function(h,m,p){const y=[],x=h.map(((S,g)=>c(h,g,m))).reduce(((S,g)=>S+g));let A=0,w=0,v=0;for(;v<x;){if(x-v<p){y.push(x-v);break}A+=p;const S=c(h,w,m);A>S&&(A-=S,w++);const g=h[w].getWidth(A-1)===2;g&&A--;const _=g?p-1:p;y.push(_),v+=_}return y},l.getWrappedLineTrimmedLength=c},5295:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const h=c(8460),m=c(844),p=c(9092);class y extends m.Disposable{constructor(A,w){super(),this._optionsService=A,this._bufferService=w,this._onBufferActivate=this.register(new h.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new p.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new p.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(A){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(A),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(A,w){this._normal.resize(A,w),this._alt.resize(A,w),this.setupTabStops(A)}setupTabStops(A){this._normal.setupTabStops(A),this._alt.setupTabStops(A)}}l.BufferSet=y},511:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const h=c(482),m=c(643),p=c(3734);class y extends p.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new p.ExtendedAttrs,this.combinedData=""}static fromCharData(A){const w=new y;return w.setFromCharData(A),w}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(A){this.fg=A[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let w=!1;if(A[m.CHAR_DATA_CHAR_INDEX].length>2)w=!0;else if(A[m.CHAR_DATA_CHAR_INDEX].length===2){const v=A[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const S=A[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=S&&S<=57343?this.content=1024*(v-55296)+S-56320+65536|A[m.CHAR_DATA_WIDTH_INDEX]<<22:w=!0}else w=!0}else this.content=A[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|A[m.CHAR_DATA_WIDTH_INDEX]<<22;w&&(this.combinedData=A[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|A[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=y},643:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const h=c(8460),m=c(844);class p{get id(){return this._id}constructor(x){this.line=x,this.isDisposed=!1,this._disposables=[],this._id=p._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,m.disposeArray)(this._disposables),this._disposables.length=0)}register(x){return this._disposables.push(x),x}}l.Marker=p,p._nextId=1},7116:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(f,l)=>{var c,h,m;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.C0=void 0,(function(p){p.NUL="\0",p.SOH="",p.STX="",p.ETX="",p.EOT="",p.ENQ="",p.ACK="",p.BEL="\x07",p.BS="\b",p.HT=" ",p.LF=`
407
+ `,p.VT="\v",p.FF="\f",p.CR="\r",p.SO="",p.SI="",p.DLE="",p.DC1="",p.DC2="",p.DC3="",p.DC4="",p.NAK="",p.SYN="",p.ETB="",p.CAN="",p.EM="",p.SUB="",p.ESC="\x1B",p.FS="",p.GS="",p.RS="",p.US="",p.SP=" ",p.DEL=""})(c||(l.C0=c={})),(function(p){p.PAD="€",p.HOP="",p.BPH="‚",p.NBH="ƒ",p.IND="„",p.NEL="…",p.SSA="†",p.ESA="‡",p.HTS="ˆ",p.HTJ="‰",p.VTS="Š",p.PLD="‹",p.PLU="Œ",p.RI="",p.SS2="Ž",p.SS3="",p.DCS="",p.PU1="‘",p.PU2="’",p.STS="“",p.CCH="”",p.MW="•",p.SPA="–",p.EPA="—",p.SOS="˜",p.SGCI="™",p.SCI="š",p.CSI="›",p.ST="œ",p.OSC="",p.PM="ž",p.APC="Ÿ"})(h||(l.C1=h={})),(function(p){p.ST=`${c.ESC}\\`})(m||(l.C1_ESCAPED=m={}))},7399:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.evaluateKeyboardEvent=void 0;const h=c(2584),m={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};l.evaluateKeyboardEvent=function(p,y,x,A){const w={type:0,cancel:!1,key:void 0},v=(p.shiftKey?1:0)|(p.altKey?2:0)|(p.ctrlKey?4:0)|(p.metaKey?8:0);switch(p.keyCode){case 0:p.key==="UIKeyInputUpArrow"?w.key=y?h.C0.ESC+"OA":h.C0.ESC+"[A":p.key==="UIKeyInputLeftArrow"?w.key=y?h.C0.ESC+"OD":h.C0.ESC+"[D":p.key==="UIKeyInputRightArrow"?w.key=y?h.C0.ESC+"OC":h.C0.ESC+"[C":p.key==="UIKeyInputDownArrow"&&(w.key=y?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:w.key=p.ctrlKey?"\b":h.C0.DEL,p.altKey&&(w.key=h.C0.ESC+w.key);break;case 9:if(p.shiftKey){w.key=h.C0.ESC+"[Z";break}w.key=h.C0.HT,w.cancel=!0;break;case 13:w.key=p.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,w.cancel=!0;break;case 27:w.key=h.C0.ESC,p.altKey&&(w.key=h.C0.ESC+h.C0.ESC),w.cancel=!0;break;case 37:if(p.metaKey)break;v?(w.key=h.C0.ESC+"[1;"+(v+1)+"D",w.key===h.C0.ESC+"[1;3D"&&(w.key=h.C0.ESC+(x?"b":"[1;5D"))):w.key=y?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(p.metaKey)break;v?(w.key=h.C0.ESC+"[1;"+(v+1)+"C",w.key===h.C0.ESC+"[1;3C"&&(w.key=h.C0.ESC+(x?"f":"[1;5C"))):w.key=y?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(p.metaKey)break;v?(w.key=h.C0.ESC+"[1;"+(v+1)+"A",x||w.key!==h.C0.ESC+"[1;3A"||(w.key=h.C0.ESC+"[1;5A")):w.key=y?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(p.metaKey)break;v?(w.key=h.C0.ESC+"[1;"+(v+1)+"B",x||w.key!==h.C0.ESC+"[1;3B"||(w.key=h.C0.ESC+"[1;5B")):w.key=y?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:p.shiftKey||p.ctrlKey||(w.key=h.C0.ESC+"[2~");break;case 46:w.key=v?h.C0.ESC+"[3;"+(v+1)+"~":h.C0.ESC+"[3~";break;case 36:w.key=v?h.C0.ESC+"[1;"+(v+1)+"H":y?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:w.key=v?h.C0.ESC+"[1;"+(v+1)+"F":y?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:p.shiftKey?w.type=2:p.ctrlKey?w.key=h.C0.ESC+"[5;"+(v+1)+"~":w.key=h.C0.ESC+"[5~";break;case 34:p.shiftKey?w.type=3:p.ctrlKey?w.key=h.C0.ESC+"[6;"+(v+1)+"~":w.key=h.C0.ESC+"[6~";break;case 112:w.key=v?h.C0.ESC+"[1;"+(v+1)+"P":h.C0.ESC+"OP";break;case 113:w.key=v?h.C0.ESC+"[1;"+(v+1)+"Q":h.C0.ESC+"OQ";break;case 114:w.key=v?h.C0.ESC+"[1;"+(v+1)+"R":h.C0.ESC+"OR";break;case 115:w.key=v?h.C0.ESC+"[1;"+(v+1)+"S":h.C0.ESC+"OS";break;case 116:w.key=v?h.C0.ESC+"[15;"+(v+1)+"~":h.C0.ESC+"[15~";break;case 117:w.key=v?h.C0.ESC+"[17;"+(v+1)+"~":h.C0.ESC+"[17~";break;case 118:w.key=v?h.C0.ESC+"[18;"+(v+1)+"~":h.C0.ESC+"[18~";break;case 119:w.key=v?h.C0.ESC+"[19;"+(v+1)+"~":h.C0.ESC+"[19~";break;case 120:w.key=v?h.C0.ESC+"[20;"+(v+1)+"~":h.C0.ESC+"[20~";break;case 121:w.key=v?h.C0.ESC+"[21;"+(v+1)+"~":h.C0.ESC+"[21~";break;case 122:w.key=v?h.C0.ESC+"[23;"+(v+1)+"~":h.C0.ESC+"[23~";break;case 123:w.key=v?h.C0.ESC+"[24;"+(v+1)+"~":h.C0.ESC+"[24~";break;default:if(!p.ctrlKey||p.shiftKey||p.altKey||p.metaKey)if(x&&!A||!p.altKey||p.metaKey)!x||p.altKey||p.ctrlKey||p.shiftKey||!p.metaKey?p.key&&!p.ctrlKey&&!p.altKey&&!p.metaKey&&p.keyCode>=48&&p.key.length===1?w.key=p.key:p.key&&p.ctrlKey&&(p.key==="_"&&(w.key=h.C0.US),p.key==="@"&&(w.key=h.C0.NUL)):p.keyCode===65&&(w.type=1);else{const S=m[p.keyCode],g=S==null?void 0:S[p.shiftKey?1:0];if(g)w.key=h.C0.ESC+g;else if(p.keyCode>=65&&p.keyCode<=90){const _=p.ctrlKey?p.keyCode-64:p.keyCode+32;let T=String.fromCharCode(_);p.shiftKey&&(T=T.toUpperCase()),w.key=h.C0.ESC+T}else if(p.keyCode===32)w.key=h.C0.ESC+(p.ctrlKey?h.C0.NUL:" ");else if(p.key==="Dead"&&p.code.startsWith("Key")){let _=p.code.slice(3,4);p.shiftKey||(_=_.toLowerCase()),w.key=h.C0.ESC+_,w.cancel=!0}}else p.keyCode>=65&&p.keyCode<=90?w.key=String.fromCharCode(p.keyCode-64):p.keyCode===32?w.key=h.C0.NUL:p.keyCode>=51&&p.keyCode<=55?w.key=String.fromCharCode(p.keyCode-51+27):p.keyCode===56?w.key=h.C0.DEL:p.keyCode===219?w.key=h.C0.ESC:p.keyCode===220?w.key=h.C0.FS:p.keyCode===221&&(w.key=h.C0.GS)}return w}},482:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Utf8ToUtf32=l.StringToUtf32=l.utf32ToString=l.stringFromCodePoint=void 0,l.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},l.utf32ToString=function(c,h=0,m=c.length){let p="";for(let y=h;y<m;++y){let x=c[y];x>65535?(x-=65536,p+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):p+=String.fromCharCode(x)}return p},l.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,h){const m=c.length;if(!m)return 0;let p=0,y=0;if(this._interim){const x=c.charCodeAt(y++);56320<=x&&x<=57343?h[p++]=1024*(this._interim-55296)+x-56320+65536:(h[p++]=this._interim,h[p++]=x),this._interim=0}for(let x=y;x<m;++x){const A=c.charCodeAt(x);if(55296<=A&&A<=56319){if(++x>=m)return this._interim=A,p;const w=c.charCodeAt(x);56320<=w&&w<=57343?h[p++]=1024*(A-55296)+w-56320+65536:(h[p++]=A,h[p++]=w)}else A!==65279&&(h[p++]=A)}return p}},l.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,h){const m=c.length;if(!m)return 0;let p,y,x,A,w=0,v=0,S=0;if(this.interim[0]){let T=!1,M=this.interim[0];M&=(224&M)==192?31:(240&M)==224?15:7;let k,L=0;for(;(k=63&this.interim[++L])&&L<4;)M<<=6,M|=k;const D=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,P=D-L;for(;S<P;){if(S>=m)return 0;if(k=c[S++],(192&k)!=128){S--,T=!0;break}this.interim[L++]=k,M<<=6,M|=63&k}T||(D===2?M<128?S--:h[w++]=M:D===3?M<2048||M>=55296&&M<=57343||M===65279||(h[w++]=M):M<65536||M>1114111||(h[w++]=M)),this.interim.fill(0)}const g=m-4;let _=S;for(;_<m;){for(;!(!(_<g)||128&(p=c[_])||128&(y=c[_+1])||128&(x=c[_+2])||128&(A=c[_+3]));)h[w++]=p,h[w++]=y,h[w++]=x,h[w++]=A,_+=4;if(p=c[_++],p<128)h[w++]=p;else if((224&p)==192){if(_>=m)return this.interim[0]=p,w;if(y=c[_++],(192&y)!=128){_--;continue}if(v=(31&p)<<6|63&y,v<128){_--;continue}h[w++]=v}else if((240&p)==224){if(_>=m)return this.interim[0]=p,w;if(y=c[_++],(192&y)!=128){_--;continue}if(_>=m)return this.interim[0]=p,this.interim[1]=y,w;if(x=c[_++],(192&x)!=128){_--;continue}if(v=(15&p)<<12|(63&y)<<6|63&x,v<2048||v>=55296&&v<=57343||v===65279)continue;h[w++]=v}else if((248&p)==240){if(_>=m)return this.interim[0]=p,w;if(y=c[_++],(192&y)!=128){_--;continue}if(_>=m)return this.interim[0]=p,this.interim[1]=y,w;if(x=c[_++],(192&x)!=128){_--;continue}if(_>=m)return this.interim[0]=p,this.interim[1]=y,this.interim[2]=x,w;if(A=c[_++],(192&A)!=128){_--;continue}if(v=(7&p)<<18|(63&y)<<12|(63&x)<<6|63&A,v<65536||v>1114111)continue;h[w++]=v}}return w}}},225:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV6=void 0;const h=c(1480),m=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],p=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let y;l.UnicodeV6=class{constructor(){if(this.version="6",!y){y=new Uint8Array(65536),y.fill(1),y[0]=0,y.fill(0,1,32),y.fill(0,127,160),y.fill(2,4352,4448),y[9001]=2,y[9002]=2,y.fill(2,11904,42192),y[12351]=1,y.fill(2,44032,55204),y.fill(2,63744,64256),y.fill(2,65040,65050),y.fill(2,65072,65136),y.fill(2,65280,65377),y.fill(2,65504,65511);for(let x=0;x<m.length;++x)y.fill(0,m[x][0],m[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?y[x]:(function(A,w){let v,S=0,g=w.length-1;if(A<w[0][0]||A>w[g][1])return!1;for(;g>=S;)if(v=S+g>>1,A>w[v][1])S=v+1;else{if(!(A<w[v][0]))return!0;g=v-1}return!1})(x,p)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,A){let w=this.wcwidth(x),v=w===0&&A!==0;if(v){const S=h.UnicodeService.extractWidth(A);S===0?v=!1:S>w&&(w=S)}return h.UnicodeService.createPropertyValue(0,w,v)}}},5981:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WriteBuffer=void 0;const h=c(8460),m=c(844);class p extends m.Disposable{constructor(x){super(),this._action=x,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(x,A){if(A!==void 0&&this._syncCalls>A)return void(this._syncCalls=0);if(this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let w;for(this._isSyncWriting=!0;w=this._writeBuffer.shift();){this._action(w);const v=this._callbacks.shift();v&&v()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(x,A){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(A),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(A)}_innerWrite(x=0,A=!0){const w=x||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const v=this._writeBuffer[this._bufferOffset],S=this._action(v,A);if(S){const _=T=>Date.now()-w>=12?setTimeout((()=>this._innerWrite(0,T))):this._innerWrite(w,T);return void S.catch((T=>(queueMicrotask((()=>{throw T})),Promise.resolve(!1)))).then(_)}const g=this._callbacks[this._bufferOffset];if(g&&g(),this._bufferOffset++,this._pendingData-=v.length,Date.now()-w>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}l.WriteBuffer=p},5941:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.toRgbString=l.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,h=/^[\da-f]+$/;function m(p,y){const x=p.toString(16),A=x.length<2?"0"+x:x;switch(y){case 4:return x[0];case 8:return A;case 12:return(A+A).slice(0,3);default:return A+A}}l.parseColor=function(p){if(!p)return;let y=p.toLowerCase();if(y.indexOf("rgb:")===0){y=y.slice(4);const x=c.exec(y);if(x){const A=x[1]?15:x[4]?255:x[7]?4095:65535;return[Math.round(parseInt(x[1]||x[4]||x[7]||x[10],16)/A*255),Math.round(parseInt(x[2]||x[5]||x[8]||x[11],16)/A*255),Math.round(parseInt(x[3]||x[6]||x[9]||x[12],16)/A*255)]}}else if(y.indexOf("#")===0&&(y=y.slice(1),h.exec(y)&&[3,6,9,12].includes(y.length))){const x=y.length/3,A=[0,0,0];for(let w=0;w<3;++w){const v=parseInt(y.slice(x*w,x*w+x),16);A[w]=x===1?v<<4:x===2?v:x===3?v>>4:v>>8}return A}},l.toRgbString=function(p,y=16){const[x,A,w]=p;return`rgb:${m(x,y)}/${m(A,y)}/${m(w,y)}`}},5770:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DcsHandler=l.DcsParser=void 0;const h=c(482),m=c(8742),p=c(5770),y=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=y,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=y}registerHandler(A,w){this._handlers[A]===void 0&&(this._handlers[A]=[]);const v=this._handlers[A];return v.push(w),{dispose:()=>{const S=v.indexOf(w);S!==-1&&v.splice(S,1)}}}clearHandler(A){this._handlers[A]&&delete this._handlers[A]}setHandlerFallback(A){this._handlerFb=A}reset(){if(this._active.length)for(let A=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;A>=0;--A)this._active[A].unhook(!1);this._stack.paused=!1,this._active=y,this._ident=0}hook(A,w){if(this.reset(),this._ident=A,this._active=this._handlers[A]||y,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].hook(w);else this._handlerFb(this._ident,"HOOK",w)}put(A,w,v){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(A,w,v);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(A,w,v))}unhook(A,w=!0){if(this._active.length){let v=!1,S=this._active.length-1,g=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,v=w,g=this._stack.fallThrough,this._stack.paused=!1),!g&&v===!1){for(;S>=0&&(v=this._active[S].unhook(A),v!==!0);S--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,v;S--}for(;S>=0;S--)if(v=this._active[S].unhook(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,v}else this._handlerFb(this._ident,"UNHOOK",A);this._active=y,this._ident=0}};const x=new m.Params;x.addParam(0),l.DcsHandler=class{constructor(A){this._handler=A,this._data="",this._params=x,this._hitLimit=!1}hook(A){this._params=A.length>1||A.params[0]?A.clone():x,this._data="",this._hitLimit=!1}put(A,w,v){this._hitLimit||(this._data+=(0,h.utf32ToString)(A,w,v),this._data.length>p.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(A){let w=!1;if(this._hitLimit)w=!1;else if(A&&(w=this._handler(this._data,this._params),w instanceof Promise))return w.then((v=>(this._params=x,this._data="",this._hitLimit=!1,v)));return this._params=x,this._data="",this._hitLimit=!1,w}}},2015:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.EscapeSequenceParser=l.VT500_TRANSITION_TABLE=l.TransitionTable=void 0;const h=c(844),m=c(8742),p=c(6242),y=c(6351);class x{constructor(S){this.table=new Uint8Array(S)}setDefault(S,g){this.table.fill(S<<4|g)}add(S,g,_,T){this.table[g<<8|S]=_<<4|T}addMany(S,g,_,T){for(let M=0;M<S.length;M++)this.table[g<<8|S[M]]=_<<4|T}}l.TransitionTable=x;const A=160;l.VT500_TRANSITION_TABLE=(function(){const v=new x(4095),S=Array.apply(null,Array(256)).map(((L,D)=>D)),g=(L,D)=>S.slice(L,D),_=g(32,127),T=g(0,24);T.push(25),T.push.apply(T,g(28,32));const M=g(0,14);let k;for(k in v.setDefault(1,0),v.addMany(_,0,2,0),M)v.addMany([24,26,153,154],k,3,0),v.addMany(g(128,144),k,3,0),v.addMany(g(144,152),k,3,0),v.add(156,k,0,0),v.add(27,k,11,1),v.add(157,k,4,8),v.addMany([152,158,159],k,0,7),v.add(155,k,11,3),v.add(144,k,11,9);return v.addMany(T,0,3,0),v.addMany(T,1,3,1),v.add(127,1,0,1),v.addMany(T,8,0,8),v.addMany(T,3,3,3),v.add(127,3,0,3),v.addMany(T,4,3,4),v.add(127,4,0,4),v.addMany(T,6,3,6),v.addMany(T,5,3,5),v.add(127,5,0,5),v.addMany(T,2,3,2),v.add(127,2,0,2),v.add(93,1,4,8),v.addMany(_,8,5,8),v.add(127,8,5,8),v.addMany([156,27,24,26,7],8,6,0),v.addMany(g(28,32),8,0,8),v.addMany([88,94,95],1,0,7),v.addMany(_,7,0,7),v.addMany(T,7,0,7),v.add(156,7,0,0),v.add(127,7,0,7),v.add(91,1,11,3),v.addMany(g(64,127),3,7,0),v.addMany(g(48,60),3,8,4),v.addMany([60,61,62,63],3,9,4),v.addMany(g(48,60),4,8,4),v.addMany(g(64,127),4,7,0),v.addMany([60,61,62,63],4,0,6),v.addMany(g(32,64),6,0,6),v.add(127,6,0,6),v.addMany(g(64,127),6,0,0),v.addMany(g(32,48),3,9,5),v.addMany(g(32,48),5,9,5),v.addMany(g(48,64),5,0,6),v.addMany(g(64,127),5,7,0),v.addMany(g(32,48),4,9,5),v.addMany(g(32,48),1,9,2),v.addMany(g(32,48),2,9,2),v.addMany(g(48,127),2,10,0),v.addMany(g(48,80),1,10,0),v.addMany(g(81,88),1,10,0),v.addMany([89,90,92],1,10,0),v.addMany(g(96,127),1,10,0),v.add(80,1,11,9),v.addMany(T,9,0,9),v.add(127,9,0,9),v.addMany(g(28,32),9,0,9),v.addMany(g(32,48),9,9,12),v.addMany(g(48,60),9,8,10),v.addMany([60,61,62,63],9,9,10),v.addMany(T,11,0,11),v.addMany(g(32,128),11,0,11),v.addMany(g(28,32),11,0,11),v.addMany(T,10,0,10),v.add(127,10,0,10),v.addMany(g(28,32),10,0,10),v.addMany(g(48,60),10,8,10),v.addMany([60,61,62,63],10,0,11),v.addMany(g(32,48),10,9,12),v.addMany(T,12,0,12),v.add(127,12,0,12),v.addMany(g(28,32),12,0,12),v.addMany(g(32,48),12,9,12),v.addMany(g(48,64),12,0,11),v.addMany(g(64,127),12,12,13),v.addMany(g(64,127),10,12,13),v.addMany(g(64,127),9,12,13),v.addMany(T,13,13,13),v.addMany(_,13,13,13),v.add(127,13,0,13),v.addMany([27,156,24,26],13,14,0),v.add(A,0,2,0),v.add(A,8,5,8),v.add(A,6,0,6),v.add(A,11,0,11),v.add(A,13,13,13),v})();class w extends h.Disposable{constructor(S=l.VT500_TRANSITION_TABLE){super(),this._transitions=S,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new m.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(g,_,T)=>{},this._executeHandlerFb=g=>{},this._csiHandlerFb=(g,_)=>{},this._escHandlerFb=g=>{},this._errorHandlerFb=g=>g,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new p.OscParser),this._dcsParser=this.register(new y.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(S,g=[64,126]){let _=0;if(S.prefix){if(S.prefix.length>1)throw new Error("only one byte as prefix supported");if(_=S.prefix.charCodeAt(0),_&&60>_||_>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(S.intermediates){if(S.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let M=0;M<S.intermediates.length;++M){const k=S.intermediates.charCodeAt(M);if(32>k||k>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");_<<=8,_|=k}}if(S.final.length!==1)throw new Error("final must be a single byte");const T=S.final.charCodeAt(0);if(g[0]>T||T>g[1])throw new Error(`final must be in range ${g[0]} .. ${g[1]}`);return _<<=8,_|=T,_}identToString(S){const g=[];for(;S;)g.push(String.fromCharCode(255&S)),S>>=8;return g.reverse().join("")}setPrintHandler(S){this._printHandler=S}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(S,g){const _=this._identifier(S,[48,126]);this._escHandlers[_]===void 0&&(this._escHandlers[_]=[]);const T=this._escHandlers[_];return T.push(g),{dispose:()=>{const M=T.indexOf(g);M!==-1&&T.splice(M,1)}}}clearEscHandler(S){this._escHandlers[this._identifier(S,[48,126])]&&delete this._escHandlers[this._identifier(S,[48,126])]}setEscHandlerFallback(S){this._escHandlerFb=S}setExecuteHandler(S,g){this._executeHandlers[S.charCodeAt(0)]=g}clearExecuteHandler(S){this._executeHandlers[S.charCodeAt(0)]&&delete this._executeHandlers[S.charCodeAt(0)]}setExecuteHandlerFallback(S){this._executeHandlerFb=S}registerCsiHandler(S,g){const _=this._identifier(S);this._csiHandlers[_]===void 0&&(this._csiHandlers[_]=[]);const T=this._csiHandlers[_];return T.push(g),{dispose:()=>{const M=T.indexOf(g);M!==-1&&T.splice(M,1)}}}clearCsiHandler(S){this._csiHandlers[this._identifier(S)]&&delete this._csiHandlers[this._identifier(S)]}setCsiHandlerFallback(S){this._csiHandlerFb=S}registerDcsHandler(S,g){return this._dcsParser.registerHandler(this._identifier(S),g)}clearDcsHandler(S){this._dcsParser.clearHandler(this._identifier(S))}setDcsHandlerFallback(S){this._dcsParser.setHandlerFallback(S)}registerOscHandler(S,g){return this._oscParser.registerHandler(S,g)}clearOscHandler(S){this._oscParser.clearHandler(S)}setOscHandlerFallback(S){this._oscParser.setHandlerFallback(S)}setErrorHandler(S){this._errorHandler=S}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(S,g,_,T,M){this._parseStack.state=S,this._parseStack.handlers=g,this._parseStack.handlerPos=_,this._parseStack.transition=T,this._parseStack.chunkPos=M}parse(S,g,_){let T,M=0,k=0,L=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,L=this._parseStack.chunkPos+1;else{if(_===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const D=this._parseStack.handlers;let P=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(_===!1&&P>-1){for(;P>=0&&(T=D[P](this._params),T!==!0);P--)if(T instanceof Promise)return this._parseStack.handlerPos=P,T}this._parseStack.handlers=[];break;case 4:if(_===!1&&P>-1){for(;P>=0&&(T=D[P](),T!==!0);P--)if(T instanceof Promise)return this._parseStack.handlerPos=P,T}this._parseStack.handlers=[];break;case 6:if(M=S[this._parseStack.chunkPos],T=this._dcsParser.unhook(M!==24&&M!==26,_),T)return T;M===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(M=S[this._parseStack.chunkPos],T=this._oscParser.end(M!==24&&M!==26,_),T)return T;M===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,L=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let D=L;D<g;++D){switch(M=S[D],k=this._transitions.table[this.currentState<<8|(M<160?M:A)],k>>4){case 2:for(let W=D+1;;++W){if(W>=g||(M=S[W])<32||M>126&&M<A){this._printHandler(S,D,W),D=W-1;break}if(++W>=g||(M=S[W])<32||M>126&&M<A){this._printHandler(S,D,W),D=W-1;break}if(++W>=g||(M=S[W])<32||M>126&&M<A){this._printHandler(S,D,W),D=W-1;break}if(++W>=g||(M=S[W])<32||M>126&&M<A){this._printHandler(S,D,W),D=W-1;break}}break;case 3:this._executeHandlers[M]?this._executeHandlers[M]():this._executeHandlerFb(M),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:D,code:M,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const P=this._csiHandlers[this._collect<<8|M];let K=P?P.length-1:-1;for(;K>=0&&(T=P[K](this._params),T!==!0);K--)if(T instanceof Promise)return this._preserveStack(3,P,K,k,D),T;K<0&&this._csiHandlerFb(this._collect<<8|M,this._params),this.precedingJoinState=0;break;case 8:do switch(M){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(M-48)}while(++D<g&&(M=S[D])>47&&M<60);D--;break;case 9:this._collect<<=8,this._collect|=M;break;case 10:const $=this._escHandlers[this._collect<<8|M];let z=$?$.length-1:-1;for(;z>=0&&(T=$[z](),T!==!0);z--)if(T instanceof Promise)return this._preserveStack(4,$,z,k,D),T;z<0&&this._escHandlerFb(this._collect<<8|M),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|M,this._params);break;case 13:for(let W=D+1;;++W)if(W>=g||(M=S[W])===24||M===26||M===27||M>127&&M<A){this._dcsParser.put(S,D,W),D=W-1;break}break;case 14:if(T=this._dcsParser.unhook(M!==24&&M!==26),T)return this._preserveStack(6,[],0,k,D),T;M===27&&(k|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let W=D+1;;W++)if(W>=g||(M=S[W])<32||M>127&&M<A){this._oscParser.put(S,D,W),D=W-1;break}break;case 6:if(T=this._oscParser.end(M!==24&&M!==26),T)return this._preserveStack(5,[],0,k,D),T;M===27&&(k|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&k}}}l.EscapeSequenceParser=w},6242:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OscHandler=l.OscParser=void 0;const h=c(5770),m=c(482),p=[];l.OscParser=class{constructor(){this._state=0,this._active=p,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(y,x){this._handlers[y]===void 0&&(this._handlers[y]=[]);const A=this._handlers[y];return A.push(x),{dispose:()=>{const w=A.indexOf(x);w!==-1&&A.splice(w,1)}}}clearHandler(y){this._handlers[y]&&delete this._handlers[y]}setHandlerFallback(y){this._handlerFb=y}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}reset(){if(this._state===2)for(let y=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;y>=0;--y)this._active[y].end(!1);this._stack.paused=!1,this._active=p,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||p,this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].start();else this._handlerFb(this._id,"START")}_put(y,x,A){if(this._active.length)for(let w=this._active.length-1;w>=0;w--)this._active[w].put(y,x,A);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(y,x,A))}start(){this.reset(),this._state=1}put(y,x,A){if(this._state!==3){if(this._state===1)for(;x<A;){const w=y[x++];if(w===59){this._state=2,this._start();break}if(w<48||57<w)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+w-48}this._state===2&&A-x>0&&this._put(y,x,A)}}end(y,x=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let A=!1,w=this._active.length-1,v=!1;if(this._stack.paused&&(w=this._stack.loopPosition-1,A=x,v=this._stack.fallThrough,this._stack.paused=!1),!v&&A===!1){for(;w>=0&&(A=this._active[w].end(y),A!==!0);w--)if(A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!1,A;w--}for(;w>=0;w--)if(A=this._active[w].end(!1),A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!0,A}else this._handlerFb(this._id,"END",y);this._active=p,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(y){this._handler=y,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(y,x,A){this._hitLimit||(this._data+=(0,m.utf32ToString)(y,x,A),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(y){let x=!1;if(this._hitLimit)x=!1;else if(y&&(x=this._handler(this._data),x instanceof Promise))return x.then((A=>(this._data="",this._hitLimit=!1,A)));return this._data="",this._hitLimit=!1,x}}},8742:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Params=void 0;const c=2147483647;class h{static fromArray(p){const y=new h;if(!p.length)return y;for(let x=Array.isArray(p[0])?1:0;x<p.length;++x){const A=p[x];if(Array.isArray(A))for(let w=0;w<A.length;++w)y.addSubParam(A[w]);else y.addParam(A)}return y}constructor(p=32,y=32){if(this.maxLength=p,this.maxSubParamsLength=y,y>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(p),this.length=0,this._subParams=new Int32Array(y),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(p),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const p=new h(this.maxLength,this.maxSubParamsLength);return p.params.set(this.params),p.length=this.length,p._subParams.set(this._subParams),p._subParamsLength=this._subParamsLength,p._subParamsIdx.set(this._subParamsIdx),p._rejectDigits=this._rejectDigits,p._rejectSubDigits=this._rejectSubDigits,p._digitIsSub=this._digitIsSub,p}toArray(){const p=[];for(let y=0;y<this.length;++y){p.push(this.params[y]);const x=this._subParamsIdx[y]>>8,A=255&this._subParamsIdx[y];A-x>0&&p.push(Array.prototype.slice.call(this._subParams,x,A))}return p}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(p){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(p<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=p>c?c:p}}addSubParam(p){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(p<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=p>c?c:p,this._subParamsIdx[this.length-1]++}}hasSubParams(p){return(255&this._subParamsIdx[p])-(this._subParamsIdx[p]>>8)>0}getSubParams(p){const y=this._subParamsIdx[p]>>8,x=255&this._subParamsIdx[p];return x-y>0?this._subParams.subarray(y,x):null}getSubParamsAll(){const p={};for(let y=0;y<this.length;++y){const x=this._subParamsIdx[y]>>8,A=255&this._subParamsIdx[y];A-x>0&&(p[y]=this._subParams.slice(x,A))}return p}addDigit(p){let y;if(this._rejectDigits||!(y=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const x=this._digitIsSub?this._subParams:this.params,A=x[y-1];x[y-1]=~A?Math.min(10*A+p,c):p}}l.Params=h},5741:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.AddonManager=void 0,l.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,h){const m={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(m),h.dispose=()=>this._wrappedAddonDispose(m),h.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let h=-1;for(let m=0;m<this._addons.length;m++)if(this._addons[m]===c){h=m;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(h,1)}}},8771:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferApiView=void 0;const h=c(3785),m=c(511);l.BufferApiView=class{constructor(p,y){this._buffer=p,this.type=y}init(p){return this._buffer=p,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(p){const y=this._buffer.lines.get(p);if(y)return new h.BufferLineApiView(y)}getNullCell(){return new m.CellData}}},3785:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLineApiView=void 0;const h=c(511);l.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,p){if(!(m<0||m>=this._line.length))return p?(this._line.loadCell(m,p),p):this._line.loadCell(m,new h.CellData)}translateToString(m,p,y){return this._line.translateToString(m,p,y)}}},8285:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferNamespaceApi=void 0;const h=c(8771),m=c(8460),p=c(844);class y extends p.Disposable{constructor(A){super(),this._core=A,this._onBufferChange=this.register(new m.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}l.BufferNamespaceApi=y},7975:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ParserApi=void 0,l.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,h){return this._core.registerCsiHandler(c,(m=>h(m.toArray())))}addCsiHandler(c,h){return this.registerCsiHandler(c,h)}registerDcsHandler(c,h){return this._core.registerDcsHandler(c,((m,p)=>h(m,p.toArray())))}addDcsHandler(c,h){return this.registerDcsHandler(c,h)}registerEscHandler(c,h){return this._core.registerEscHandler(c,h)}addEscHandler(c,h){return this.registerEscHandler(c,h)}registerOscHandler(c,h){return this._core.registerOscHandler(c,h)}addOscHandler(c,h){return this.registerOscHandler(c,h)}}},7090:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeApi=void 0,l.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(f,l,c){var h=this&&this.__decorate||function(v,S,g,_){var T,M=arguments.length,k=M<3?S:_===null?_=Object.getOwnPropertyDescriptor(S,g):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(v,S,g,_);else for(var L=v.length-1;L>=0;L--)(T=v[L])&&(k=(M<3?T(k):M>3?T(S,g,k):T(S,g))||k);return M>3&&k&&Object.defineProperty(S,g,k),k},m=this&&this.__param||function(v,S){return function(g,_){S(g,_,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const p=c(8460),y=c(844),x=c(5295),A=c(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let w=l.BufferService=class extends y.Disposable{get buffer(){return this.buffers.active}constructor(v){super(),this.isUserScrolling=!1,this._onResize=this.register(new p.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(v.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(v.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new x.BufferSet(v,this))}resize(v,S){this.cols=v,this.rows=S,this.buffers.resize(v,S),this._onResize.fire({cols:v,rows:S})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(v,S=!1){const g=this.buffer;let _;_=this._cachedBlankLine,_&&_.length===this.cols&&_.getFg(0)===v.fg&&_.getBg(0)===v.bg||(_=g.getBlankLine(v,S),this._cachedBlankLine=_),_.isWrapped=S;const T=g.ybase+g.scrollTop,M=g.ybase+g.scrollBottom;if(g.scrollTop===0){const k=g.lines.isFull;M===g.lines.length-1?k?g.lines.recycle().copyFrom(_):g.lines.push(_.clone()):g.lines.splice(M+1,0,_.clone()),k?this.isUserScrolling&&(g.ydisp=Math.max(g.ydisp-1,0)):(g.ybase++,this.isUserScrolling||g.ydisp++)}else{const k=M-T+1;g.lines.shiftElements(T+1,k-1,-1),g.lines.set(M,_.clone())}this.isUserScrolling||(g.ydisp=g.ybase),this._onScroll.fire(g.ydisp)}scrollLines(v,S,g){const _=this.buffer;if(v<0){if(_.ydisp===0)return;this.isUserScrolling=!0}else v+_.ydisp>=_.ybase&&(this.isUserScrolling=!1);const T=_.ydisp;_.ydisp=Math.max(Math.min(_.ydisp+v,_.ybase),0),T!==_.ydisp&&(S||this._onScroll.fire(_.ydisp))}};l.BufferService=w=h([m(0,A.IOptionsService)],w)},7994:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CharsetService=void 0,l.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,h){this._charsets[c]=h,this.glevel===c&&(this.charset=h)}}},1753:function(f,l,c){var h=this&&this.__decorate||function(_,T,M,k){var L,D=arguments.length,P=D<3?T:k===null?k=Object.getOwnPropertyDescriptor(T,M):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(_,T,M,k);else for(var K=_.length-1;K>=0;K--)(L=_[K])&&(P=(D<3?L(P):D>3?L(T,M,P):L(T,M))||P);return D>3&&P&&Object.defineProperty(T,M,P),P},m=this&&this.__param||function(_,T){return function(M,k){T(M,k,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const p=c(2585),y=c(8460),x=c(844),A={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:_=>_.button!==4&&_.action===1&&(_.ctrl=!1,_.alt=!1,_.shift=!1,!0)},VT200:{events:19,restrict:_=>_.action!==32},DRAG:{events:23,restrict:_=>_.action!==32||_.button!==3},ANY:{events:31,restrict:_=>!0}};function w(_,T){let M=(_.ctrl?16:0)|(_.shift?4:0)|(_.alt?8:0);return _.button===4?(M|=64,M|=_.action):(M|=3&_.button,4&_.button&&(M|=64),8&_.button&&(M|=128),_.action===32?M|=32:_.action!==0||T||(M|=3)),M}const v=String.fromCharCode,S={DEFAULT:_=>{const T=[w(_,!1)+32,_.col+32,_.row+32];return T[0]>255||T[1]>255||T[2]>255?"":`\x1B[M${v(T[0])}${v(T[1])}${v(T[2])}`},SGR:_=>{const T=_.action===0&&_.button!==4?"m":"M";return`\x1B[<${w(_,!0)};${_.col};${_.row}${T}`},SGR_PIXELS:_=>{const T=_.action===0&&_.button!==4?"m":"M";return`\x1B[<${w(_,!0)};${_.x};${_.y}${T}`}};let g=l.CoreMouseService=class extends x.Disposable{constructor(_,T){super(),this._bufferService=_,this._coreService=T,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new y.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const M of Object.keys(A))this.addProtocol(M,A[M]);for(const M of Object.keys(S))this.addEncoding(M,S[M]);this.reset()}addProtocol(_,T){this._protocols[_]=T}addEncoding(_,T){this._encodings[_]=T}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(_){if(!this._protocols[_])throw new Error(`unknown protocol "${_}"`);this._activeProtocol=_,this._onProtocolChange.fire(this._protocols[_].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(_){if(!this._encodings[_])throw new Error(`unknown encoding "${_}"`);this._activeEncoding=_}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(_){if(_.col<0||_.col>=this._bufferService.cols||_.row<0||_.row>=this._bufferService.rows||_.button===4&&_.action===32||_.button===3&&_.action!==32||_.button!==4&&(_.action===2||_.action===3)||(_.col++,_.row++,_.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,_,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(_))return!1;const T=this._encodings[this._activeEncoding](_);return T&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(T):this._coreService.triggerDataEvent(T,!0)),this._lastEvent=_,!0}explainEvents(_){return{down:!!(1&_),up:!!(2&_),drag:!!(4&_),move:!!(8&_),wheel:!!(16&_)}}_equalEvents(_,T,M){if(M){if(_.x!==T.x||_.y!==T.y)return!1}else if(_.col!==T.col||_.row!==T.row)return!1;return _.button===T.button&&_.action===T.action&&_.ctrl===T.ctrl&&_.alt===T.alt&&_.shift===T.shift}};l.CoreMouseService=g=h([m(0,p.IBufferService),m(1,p.ICoreService)],g)},6975:function(f,l,c){var h=this&&this.__decorate||function(g,_,T,M){var k,L=arguments.length,D=L<3?_:M===null?M=Object.getOwnPropertyDescriptor(_,T):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(g,_,T,M);else for(var P=g.length-1;P>=0;P--)(k=g[P])&&(D=(L<3?k(D):L>3?k(_,T,D):k(_,T))||D);return L>3&&D&&Object.defineProperty(_,T,D),D},m=this&&this.__param||function(g,_){return function(T,M){_(T,M,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const p=c(1439),y=c(8460),x=c(844),A=c(2585),w=Object.freeze({insertMode:!1}),v=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let S=l.CoreService=class extends x.Disposable{constructor(g,_,T){super(),this._bufferService=g,this._logService=_,this._optionsService=T,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new y.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new y.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new y.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new y.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,p.clone)(w),this.decPrivateModes=(0,p.clone)(v)}reset(){this.modes=(0,p.clone)(w),this.decPrivateModes=(0,p.clone)(v)}triggerDataEvent(g,_=!1){if(this._optionsService.rawOptions.disableStdin)return;const T=this._bufferService.buffer;_&&this._optionsService.rawOptions.scrollOnUserInput&&T.ybase!==T.ydisp&&this._onRequestScrollToBottom.fire(),_&&this._onUserInput.fire(),this._logService.debug(`sending data "${g}"`,(()=>g.split("").map((M=>M.charCodeAt(0))))),this._onData.fire(g)}triggerBinaryEvent(g){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${g}"`,(()=>g.split("").map((_=>_.charCodeAt(0))))),this._onBinary.fire(g))}};l.CoreService=S=h([m(0,A.IBufferService),m(1,A.ILogService),m(2,A.IOptionsService)],S)},9074:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const h=c(8055),m=c(8460),p=c(844),y=c(6106);let x=0,A=0;class w extends p.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new y.SortedList((g=>g==null?void 0:g.marker.line)),this._onDecorationRegistered=this.register(new m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,p.toDisposable)((()=>this.reset())))}registerDecoration(g){if(g.marker.isDisposed)return;const _=new v(g);if(_){const T=_.marker.onDispose((()=>_.dispose()));_.onDispose((()=>{_&&(this._decorations.delete(_)&&this._onDecorationRemoved.fire(_),T.dispose())})),this._decorations.insert(_),this._onDecorationRegistered.fire(_)}return _}reset(){for(const g of this._decorations.values())g.dispose();this._decorations.clear()}*getDecorationsAtCell(g,_,T){let M=0,k=0;for(const L of this._decorations.getKeyIterator(_))M=L.options.x??0,k=M+(L.options.width??1),g>=M&&g<k&&(!T||(L.options.layer??"bottom")===T)&&(yield L)}forEachDecorationAtCell(g,_,T,M){this._decorations.forEachByKey(_,(k=>{x=k.options.x??0,A=x+(k.options.width??1),g>=x&&g<A&&(!T||(k.options.layer??"bottom")===T)&&M(k)}))}}l.DecorationService=w;class v extends p.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(g){super(),this.options=g,this.onRenderEmitter=this.register(new m.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new m.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=g.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.InstantiationService=l.ServiceCollection=void 0;const h=c(2585),m=c(8343);class p{constructor(...x){this._entries=new Map;for(const[A,w]of x)this.set(A,w)}set(x,A){const w=this._entries.get(x);return this._entries.set(x,A),w}forEach(x){for(const[A,w]of this._entries.entries())x(A,w)}has(x){return this._entries.has(x)}get(x){return this._entries.get(x)}}l.ServiceCollection=p,l.InstantiationService=class{constructor(){this._services=new p,this._services.set(h.IInstantiationService,this)}setService(y,x){this._services.set(y,x)}getService(y){return this._services.get(y)}createInstance(y,...x){const A=(0,m.getServiceDependencies)(y).sort(((S,g)=>S.index-g.index)),w=[];for(const S of A){const g=this._services.get(S.id);if(!g)throw new Error(`[createInstance] ${y.name} depends on UNKNOWN service ${S.id}.`);w.push(g)}const v=A.length>0?A[0].index:x.length;if(x.length!==v)throw new Error(`[createInstance] First service dependency of ${y.name} at position ${v+1} conflicts with ${x.length} static arguments`);return new y(...x,...w)}}},7866:function(f,l,c){var h=this&&this.__decorate||function(v,S,g,_){var T,M=arguments.length,k=M<3?S:_===null?_=Object.getOwnPropertyDescriptor(S,g):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(v,S,g,_);else for(var L=v.length-1;L>=0;L--)(T=v[L])&&(k=(M<3?T(k):M>3?T(S,g,k):T(S,g))||k);return M>3&&k&&Object.defineProperty(S,g,k),k},m=this&&this.__param||function(v,S){return function(g,_){S(g,_,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.LogService=void 0;const p=c(844),y=c(2585),x={trace:y.LogLevelEnum.TRACE,debug:y.LogLevelEnum.DEBUG,info:y.LogLevelEnum.INFO,warn:y.LogLevelEnum.WARN,error:y.LogLevelEnum.ERROR,off:y.LogLevelEnum.OFF};let A,w=l.LogService=class extends p.Disposable{get logLevel(){return this._logLevel}constructor(v){super(),this._optionsService=v,this._logLevel=y.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),A=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let S=0;S<v.length;S++)typeof v[S]=="function"&&(v[S]=v[S]())}_log(v,S,g){this._evalLazyOptionalParams(g),v.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+S,...g)}trace(v,...S){var g;this._logLevel<=y.LogLevelEnum.TRACE&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.trace.bind(this._optionsService.options.logger))??console.log,v,S)}debug(v,...S){var g;this._logLevel<=y.LogLevelEnum.DEBUG&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.debug.bind(this._optionsService.options.logger))??console.log,v,S)}info(v,...S){var g;this._logLevel<=y.LogLevelEnum.INFO&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.info.bind(this._optionsService.options.logger))??console.info,v,S)}warn(v,...S){var g;this._logLevel<=y.LogLevelEnum.WARN&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.warn.bind(this._optionsService.options.logger))??console.warn,v,S)}error(v,...S){var g;this._logLevel<=y.LogLevelEnum.ERROR&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.error.bind(this._optionsService.options.logger))??console.error,v,S)}};l.LogService=w=h([m(0,y.IOptionsService)],w),l.setTraceLogger=function(v){A=v},l.traceCall=function(v,S,g){if(typeof g.value!="function")throw new Error("not supported");const _=g.value;g.value=function(...T){if(A.logLevel!==y.LogLevelEnum.TRACE)return _.apply(this,T);A.trace(`GlyphRenderer#${_.name}(${T.map((k=>JSON.stringify(k))).join(", ")})`);const M=_.apply(this,T);return A.trace(`GlyphRenderer#${_.name} return`,M),M}}},7302:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OptionsService=l.DEFAULT_OPTIONS=void 0;const h=c(8460),m=c(844),p=c(6114);l.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:p.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const y=["normal","bold","100","200","300","400","500","600","700","800","900"];class x extends m.Disposable{constructor(w){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const v={...l.DEFAULT_OPTIONS};for(const S in w)if(S in v)try{const g=w[S];v[S]=this._sanitizeAndValidateOption(S,g)}catch(g){console.error(g)}this.rawOptions=v,this.options={...v},this._setupOptions(),this.register((0,m.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(w,v){return this.onOptionChange((S=>{S===w&&v(this.rawOptions[w])}))}onMultipleOptionChange(w,v){return this.onOptionChange((S=>{w.indexOf(S)!==-1&&v()}))}_setupOptions(){const w=S=>{if(!(S in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);return this.rawOptions[S]},v=(S,g)=>{if(!(S in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);g=this._sanitizeAndValidateOption(S,g),this.rawOptions[S]!==g&&(this.rawOptions[S]=g,this._onOptionChange.fire(S))};for(const S in this.rawOptions){const g={get:w.bind(this,S),set:v.bind(this,S)};Object.defineProperty(this.options,S,g)}}_sanitizeAndValidateOption(w,v){switch(w){case"cursorStyle":if(v||(v=l.DEFAULT_OPTIONS[w]),!(function(S){return S==="block"||S==="underline"||S==="bar"})(v))throw new Error(`"${v}" is not a valid value for ${w}`);break;case"wordSeparator":v||(v=l.DEFAULT_OPTIONS[w]);break;case"fontWeight":case"fontWeightBold":if(typeof v=="number"&&1<=v&&v<=1e3)break;v=y.includes(v)?v:l.DEFAULT_OPTIONS[w];break;case"cursorWidth":v=Math.floor(v);case"lineHeight":case"tabStopWidth":if(v<1)throw new Error(`${w} cannot be less than 1, value: ${v}`);break;case"minimumContrastRatio":v=Math.max(1,Math.min(21,Math.round(10*v)/10));break;case"scrollback":if((v=Math.min(v,4294967295))<0)throw new Error(`${w} cannot be less than 0, value: ${v}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(v<=0)throw new Error(`${w} cannot be less than or equal to 0, value: ${v}`);break;case"rows":case"cols":if(!v&&v!==0)throw new Error(`${w} must be numeric, value: ${v}`);break;case"windowsPty":v=v??{}}return v}}l.OptionsService=x},2660:function(f,l,c){var h=this&&this.__decorate||function(x,A,w,v){var S,g=arguments.length,_=g<3?A:v===null?v=Object.getOwnPropertyDescriptor(A,w):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(x,A,w,v);else for(var T=x.length-1;T>=0;T--)(S=x[T])&&(_=(g<3?S(_):g>3?S(A,w,_):S(A,w))||_);return g>3&&_&&Object.defineProperty(A,w,_),_},m=this&&this.__param||function(x,A){return function(w,v){A(w,v,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const p=c(2585);let y=l.OscLinkService=class{constructor(x){this._bufferService=x,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(x){const A=this._bufferService.buffer;if(x.id===void 0){const T=A.addMarker(A.ybase+A.y),M={data:x,id:this._nextId++,lines:[T]};return T.onDispose((()=>this._removeMarkerFromLink(M,T))),this._dataByLinkId.set(M.id,M),M.id}const w=x,v=this._getEntryIdKey(w),S=this._entriesWithId.get(v);if(S)return this.addLineToLink(S.id,A.ybase+A.y),S.id;const g=A.addMarker(A.ybase+A.y),_={id:this._nextId++,key:this._getEntryIdKey(w),data:w,lines:[g]};return g.onDispose((()=>this._removeMarkerFromLink(_,g))),this._entriesWithId.set(_.key,_),this._dataByLinkId.set(_.id,_),_.id}addLineToLink(x,A){const w=this._dataByLinkId.get(x);if(w&&w.lines.every((v=>v.line!==A))){const v=this._bufferService.buffer.addMarker(A);w.lines.push(v),v.onDispose((()=>this._removeMarkerFromLink(w,v)))}}getLinkData(x){var A;return(A=this._dataByLinkId.get(x))==null?void 0:A.data}_getEntryIdKey(x){return`${x.id};;${x.uri}`}_removeMarkerFromLink(x,A){const w=x.lines.indexOf(A);w!==-1&&(x.lines.splice(w,1),x.lines.length===0&&(x.data.id!==void 0&&this._entriesWithId.delete(x.key),this._dataByLinkId.delete(x.id)))}};l.OscLinkService=y=h([m(0,p.IBufferService)],y)},8343:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createDecorator=l.getServiceDependencies=l.serviceRegistry=void 0;const c="di$target",h="di$dependencies";l.serviceRegistry=new Map,l.getServiceDependencies=function(m){return m[h]||[]},l.createDecorator=function(m){if(l.serviceRegistry.has(m))return l.serviceRegistry.get(m);const p=function(y,x,A){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(w,v,S){v[c]===v?v[h].push({id:w,index:S}):(v[h]=[{id:w,index:S}],v[c]=v)})(p,y,A)};return p.toString=()=>m,l.serviceRegistry.set(m,p),p}},2585:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IDecorationService=l.IUnicodeService=l.IOscLinkService=l.IOptionsService=l.ILogService=l.LogLevelEnum=l.IInstantiationService=l.ICharsetService=l.ICoreService=l.ICoreMouseService=l.IBufferService=void 0;const h=c(8343);var m;l.IBufferService=(0,h.createDecorator)("BufferService"),l.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),l.ICoreService=(0,h.createDecorator)("CoreService"),l.ICharsetService=(0,h.createDecorator)("CharsetService"),l.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(p){p[p.TRACE=0]="TRACE",p[p.DEBUG=1]="DEBUG",p[p.INFO=2]="INFO",p[p.WARN=3]="WARN",p[p.ERROR=4]="ERROR",p[p.OFF=5]="OFF"})(m||(l.LogLevelEnum=m={})),l.ILogService=(0,h.createDecorator)("LogService"),l.IOptionsService=(0,h.createDecorator)("OptionsService"),l.IOscLinkService=(0,h.createDecorator)("OscLinkService"),l.IUnicodeService=(0,h.createDecorator)("UnicodeService"),l.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeService=void 0;const h=c(8460),m=c(225);class p{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,A,w=!1){return(16777215&x)<<3|(3&A)<<1|(w?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const x=new m.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let A=0,w=0;const v=x.length;for(let S=0;S<v;++S){let g=x.charCodeAt(S);if(55296<=g&&g<=56319){if(++S>=v)return A+this.wcwidth(g);const M=x.charCodeAt(S);56320<=M&&M<=57343?g=1024*(g-55296)+M-56320+65536:A+=this.wcwidth(M)}const _=this.charProperties(g,w);let T=p.extractWidth(_);p.extractShouldJoin(_)&&(T-=p.extractWidth(w)),A+=T,w=_}return A}charProperties(x,A){return this._activeProvider.charProperties(x,A)}}l.UnicodeService=p}},s={};function o(f){var l=s[f];if(l!==void 0)return l.exports;var c=s[f]={exports:{}};return n[f].call(c.exports,c,c.exports,o),c.exports}var u={};return(()=>{var f=u;Object.defineProperty(f,"__esModule",{value:!0}),f.Terminal=void 0;const l=o(9042),c=o(3236),h=o(844),m=o(5741),p=o(8285),y=o(7975),x=o(7090),A=["cols","rows"];class w extends h.Disposable{constructor(S){super(),this._core=this.register(new c.Terminal(S)),this._addonManager=this.register(new m.AddonManager),this._publicOptions={...this._core.options};const g=T=>this._core.options[T],_=(T,M)=>{this._checkReadonlyOptions(T),this._core.options[T]=M};for(const T in this._core.options){const M={get:g.bind(this,T),set:_.bind(this,T)};Object.defineProperty(this._publicOptions,T,M)}}_checkReadonlyOptions(S){if(A.includes(S))throw new Error(`Option "${S}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new y.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new x.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new p.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const S=this._core.coreService.decPrivateModes;let g="none";switch(this._core.coreMouseService.activeProtocol){case"X10":g="x10";break;case"VT200":g="vt200";break;case"DRAG":g="drag";break;case"ANY":g="any"}return{applicationCursorKeysMode:S.applicationCursorKeys,applicationKeypadMode:S.applicationKeypad,bracketedPasteMode:S.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:g,originMode:S.origin,reverseWraparoundMode:S.reverseWraparound,sendFocusMode:S.sendFocus,wraparoundMode:S.wraparound}}get options(){return this._publicOptions}set options(S){for(const g in S)this._publicOptions[g]=S[g]}blur(){this._core.blur()}focus(){this._core.focus()}input(S,g=!0){this._core.input(S,g)}resize(S,g){this._verifyIntegers(S,g),this._core.resize(S,g)}open(S){this._core.open(S)}attachCustomKeyEventHandler(S){this._core.attachCustomKeyEventHandler(S)}attachCustomWheelEventHandler(S){this._core.attachCustomWheelEventHandler(S)}registerLinkProvider(S){return this._core.registerLinkProvider(S)}registerCharacterJoiner(S){return this._checkProposedApi(),this._core.registerCharacterJoiner(S)}deregisterCharacterJoiner(S){this._checkProposedApi(),this._core.deregisterCharacterJoiner(S)}registerMarker(S=0){return this._verifyIntegers(S),this._core.registerMarker(S)}registerDecoration(S){return this._checkProposedApi(),this._verifyPositiveIntegers(S.x??0,S.width??0,S.height??0),this._core.registerDecoration(S)}hasSelection(){return this._core.hasSelection()}select(S,g,_){this._verifyIntegers(S,g,_),this._core.select(S,g,_)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(S,g){this._verifyIntegers(S,g),this._core.selectLines(S,g)}dispose(){super.dispose()}scrollLines(S){this._verifyIntegers(S),this._core.scrollLines(S)}scrollPages(S){this._verifyIntegers(S),this._core.scrollPages(S)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(S){this._verifyIntegers(S),this._core.scrollToLine(S)}clear(){this._core.clear()}write(S,g){this._core.write(S,g)}writeln(S,g){this._core.write(S),this._core.write(`\r
408
+ `,g)}paste(S){this._core.paste(S)}refresh(S,g){this._verifyIntegers(S,g),this._core.refresh(S,g)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(S){this._addonManager.loadAddon(this,S)}static get strings(){return l}_verifyIntegers(...S){for(const g of S)if(g===1/0||isNaN(g)||g%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...S){for(const g of S)if(g&&(g===1/0||isNaN(g)||g%1!=0||g<0))throw new Error("This API only accepts positive integers")}}f.Terminal=w})(),u})()))})(Hm)),Hm.exports}var sj=ij(),Vm={exports:{}},Eb;function oj(){return Eb||(Eb=1,(function(e,r){(function(n,s){e.exports=s()})(self,(()=>(()=>{var n={};return(()=>{var s=n;Object.defineProperty(s,"__esModule",{value:!0}),s.FitAddon=void 0,s.FitAddon=class{activate(o){this._terminal=o}dispose(){}fit(){const o=this.proposeDimensions();if(!o||!this._terminal||isNaN(o.cols)||isNaN(o.rows))return;const u=this._terminal._core;this._terminal.rows===o.rows&&this._terminal.cols===o.cols||(u._renderService.clear(),this._terminal.resize(o.cols,o.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const o=this._terminal._core,u=o._renderService.dimensions;if(u.css.cell.width===0||u.css.cell.height===0)return;const f=this._terminal.options.scrollback===0?0:o.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(l.getPropertyValue("height")),h=Math.max(0,parseInt(l.getPropertyValue("width"))),m=window.getComputedStyle(this._terminal.element),p=c-(parseInt(m.getPropertyValue("padding-top"))+parseInt(m.getPropertyValue("padding-bottom"))),y=h-(parseInt(m.getPropertyValue("padding-right"))+parseInt(m.getPropertyValue("padding-left")))-f;return{cols:Math.max(2,Math.floor(y/u.css.cell.width)),rows:Math.max(1,Math.floor(p/u.css.cell.height))}}}})(),n})()))})(Vm)),Vm.exports}var aj=oj();/**
409
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
410
+ * @license MIT
411
+ *
412
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
413
+ * @license MIT
414
+ *
415
+ * Originally forked from (with the author's permission):
416
+ * Fabrice Bellard's javascript vt100 for jslinux:
417
+ * http://bellard.org/jslinux/
418
+ * Copyright (c) 2011 Fabrice Bellard
419
+ */var lj=class{constructor(e,r,n,s={}){this._terminal=e,this._regex=r,this._handler=n,this._options=s}provideLinks(e,r){let n=uj.computeLink(e,this._regex,this._terminal,this._handler);r(this._addCallbacks(n))}_addCallbacks(e){return e.map(r=>(r.leave=this._options.leave,r.hover=(n,s)=>{if(this._options.hover){let{range:o}=r;this._options.hover(n,s,o)}},r))}};function cj(e){try{let r=new URL(e),n=r.password&&r.username?`${r.protocol}//${r.username}:${r.password}@${r.host}`:r.username?`${r.protocol}//${r.username}@${r.host}`:`${r.protocol}//${r.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var uj=class Vd{static computeLink(r,n,s,o){let u=new RegExp(n.source,(n.flags||"")+"g"),[f,l]=Vd._getWindowedLineStrings(r-1,s),c=f.join(""),h,m=[];for(;h=u.exec(c);){let p=h[0];if(!cj(p))continue;let[y,x]=Vd._mapStrIdx(s,l,0,h.index),[A,w]=Vd._mapStrIdx(s,y,x,p.length);if(y===-1||x===-1||A===-1||w===-1)continue;let v={start:{x:x+1,y:y+1},end:{x:w,y:A+1}};m.push({range:v,text:p,activate:o})}return m}static _getWindowedLineStrings(r,n){let s,o=r,u=r,f=0,l="",c=[];if(s=n.buffer.active.getLine(r)){let h=s.translateToString(!0);if(s.isWrapped&&h[0]!==" "){for(f=0;(s=n.buffer.active.getLine(--o))&&f<2048&&(l=s.translateToString(!0),f+=l.length,c.push(l),!(!s.isWrapped||l.indexOf(" ")!==-1)););c.reverse()}for(c.push(h),f=0;(s=n.buffer.active.getLine(++u))&&s.isWrapped&&f<2048&&(l=s.translateToString(!0),f+=l.length,c.push(l),l.indexOf(" ")===-1););}return[c,o]}static _mapStrIdx(r,n,s,o){let u=r.buffer.active,f=u.getNullCell(),l=s;for(;o;){let c=u.getLine(n);if(!c)return[-1,-1];for(let h=l;h<c.length;++h){c.getCell(h,f);let m=f.getChars();if(f.getWidth()&&(o-=m.length||1,h===c.length-1&&m==="")){let p=u.getLine(n+1);p&&p.isWrapped&&(p.getCell(0,f),f.getWidth()===2&&(o+=1))}if(o<0)return[n,h]}n++,l=0}return[n,l]}},dj=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function hj(e,r){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=r}else console.warn("Opening link blocked as opener could not be cleared")}var fj=class{constructor(e=hj,r={}){this._handler=e,this._options=r}activate(e){this._terminal=e;let r=this._options,n=r.urlRegex||dj;this._linkProvider=this._terminal.registerLinkProvider(new lj(this._terminal,n,this._handler,r))}dispose(){var e;(e=this._linkProvider)==null||e.dispose()}};const pj={background:"#1a1a1a",foreground:"#d4d4d4",cursor:"#d4d4d4",cursorAccent:"#1a1a1a",selectionBackground:"#3a3a3a",black:"#1a1a1a",red:"#f44747",green:"#6a9955",yellow:"#dcdcaa",blue:"#569cd6",magenta:"#c586c0",cyan:"#4ec9b0",white:"#d4d4d4",brightBlack:"#808080",brightRed:"#f44747",brightGreen:"#6a9955",brightYellow:"#dcdcaa",brightBlue:"#569cd6",brightMagenta:"#c586c0",brightCyan:"#4ec9b0",brightWhite:"#ffffff"},mj={background:"#ffffff",foreground:"#383a42",cursor:"#383a42",cursorAccent:"#ffffff",selectionBackground:"#d7d7d7",black:"#383a42",red:"#e45649",green:"#50a14f",yellow:"#c18401",blue:"#4078f2",magenta:"#a626a4",cyan:"#0184bc",white:"#fafafa",brightBlack:"#4f525e",brightRed:"#e06c75",brightGreen:"#98c379",brightYellow:"#e5c07b",brightBlue:"#61afef",brightMagenta:"#c678dd",brightCyan:"#56b6c2",brightWhite:"#ffffff"};function gj({sessionId:e}){const r=R.useRef(null),n=R.useRef(null),s=R.useRef(null),[o,u]=R.useState(!1),f=R.useRef(null),l=R.useRef(null),c=R.useRef(null),h=R.useRef(!1),m=R.useRef(0),p=R.useRef(""),y=R.useRef(null),{sendTerminalInput:x,resizeTerminal:A,subscribeToSession:w,requestTerminalReplay:v}=co(),{resolvedTheme:S}=Kg(),g=R.useMemo(()=>S==="dark"?pj:mj,[S]);R.useEffect(()=>{if(!r.current||n.current)return;const k=new sj.Terminal({cursorBlink:!0,cursorStyle:"block",cursorInactiveStyle:"outline",fontSize:14,fontFamily:'Menlo, Monaco, "Courier New", monospace',theme:g,scrollback:1e4,scrollOnUserInput:!0,smoothScrollDuration:0,fastScrollModifier:"alt",fastScrollSensitivity:5,convertEol:!0,macOptionIsMeta:!0,macOptionClickForcesSelection:!0,rightClickSelectsWord:!0,altClickMovesCursor:!0}),L=new aj.FitAddon,D=new fj;k.loadAddon(L),k.loadAddon(D),k.open(r.current),L.fit(),n.current=k,s.current=L,u(!0),k.onData(K=>{const $=Ve.getState().connectionState;($==="verified"||$==="authenticated")&&x(e,K)}),w(e);const P=setTimeout(()=>{v(e,0,500)},100);return()=>{clearTimeout(P),k.dispose(),n.current=null,s.current=null}},[e,x,w,v]);const _=R.useCallback(k=>{p.current+=k,y.current===null&&(y.current=requestAnimationFrame(()=>{n.current&&p.current&&n.current.write(p.current),p.current="",y.current=null}))},[]),T=R.useCallback(()=>{if(!s.current||!n.current||!r.current)return;const k=Date.now();if(k-m.current<500)return;const L=r.current.getBoundingClientRect(),D=Math.floor(L.width),P=Math.floor(L.height),K=c.current;if(!(K&&K.width===D&&K.height===P)){c.current={width:D,height:P},h.current=!0;try{s.current.fit();const{cols:$,rows:z}=n.current,W=l.current;(!W||W.cols!==$||W.rows!==z)&&(l.current={cols:$,rows:z},m.current=k,A(e,$,z))}finally{setTimeout(()=>{h.current=!1},50)}}},[e,A]);R.useEffect(()=>{if(!r.current||!o)return;const k=r.current,L=()=>{f.current!==null&&clearTimeout(f.current),f.current=setTimeout(()=>{f.current=null;const $=Ve.getState().connectionState;($==="verified"||$==="authenticated")&&T()},150)},D=new ResizeObserver($=>{if(h.current)return;const z=$[0];if(!z)return;let W,F;if(z.borderBoxSize&&z.borderBoxSize[0]?(W=Math.floor(z.borderBoxSize[0].inlineSize),F=Math.floor(z.borderBoxSize[0].blockSize)):(W=Math.floor(z.contentRect.width),F=Math.floor(z.contentRect.height)),W===0||F===0)return;const ee=c.current;ee&&ee.width===W&&ee.height===F||L()});D.observe(k,{box:"border-box"});const P=()=>L();window.addEventListener("resize",P);const K=setTimeout(L,50);return()=>{D.disconnect(),window.removeEventListener("resize",P),clearTimeout(K),f.current!==null&&clearTimeout(f.current)}},[o,T]),R.useEffect(()=>{n.current&&(n.current.options.theme=g)},[g]),R.useEffect(()=>{if(!n.current)return;const k=L=>{L.detail.sessionId===e&&_(L.detail.data)};return window.addEventListener("terminal-output",k),()=>{window.removeEventListener("terminal-output",k),y.current!==null&&(cancelAnimationFrame(y.current),y.current=null),n.current&&p.current&&(n.current.write(p.current),p.current="")}},[e,_]),R.useEffect(()=>{const k=L=>{L.detail.sessionId===e&&n.current&&n.current.clear()};return window.addEventListener("terminal-clear",k),()=>{window.removeEventListener("terminal-clear",k)}},[e]);const M=S==="dark"?"bg-[#1a1a1a]":"bg-white";return b.jsx("div",{className:`flex flex-col h-full ${M}`,children:b.jsx("div",{ref:r,className:"flex-1 p-2"})})}function vj(){const{sessionId:e}=Ub();return e?b.jsx(gj,{sessionId:e}):b.jsx(Ad,{to:"/chat",replace:!0})}var Ph="Switch",[_j]=qn(Ph),[yj,Sj]=_j(Ph),gA=R.forwardRef((e,r)=>{const{__scopeSwitch:n,name:s,checked:o,defaultChecked:u,required:f,disabled:l,value:c="on",onCheckedChange:h,form:m,...p}=e,[y,x]=R.useState(null),A=ot(r,_=>x(_)),w=R.useRef(!1),v=y?m||!!y.closest("form"):!0,[S,g]=ro({prop:o,defaultProp:u??!1,onChange:h,caller:Ph});return b.jsxs(yj,{scope:n,checked:S,disabled:l,children:[b.jsx(Je.button,{type:"button",role:"switch","aria-checked":S,"aria-required":f,"data-state":SA(S),"data-disabled":l?"":void 0,disabled:l,value:c,...p,ref:A,onClick:Le(e.onClick,_=>{g(T=>!T),v&&(w.current=_.isPropagationStopped(),w.current||_.stopPropagation())})}),v&&b.jsx(yA,{control:y,bubbles:!w.current,name:s,value:c,checked:S,required:f,disabled:l,form:m,style:{transform:"translateX(-100%)"}})]})});gA.displayName=Ph;var vA="SwitchThumb",_A=R.forwardRef((e,r)=>{const{__scopeSwitch:n,...s}=e,o=Sj(vA,n);return b.jsx(Je.span,{"data-state":SA(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:r})});_A.displayName=vA;var bj="SwitchBubbleInput",yA=R.forwardRef(({__scopeSwitch:e,control:r,checked:n,bubbles:s=!0,...o},u)=>{const f=R.useRef(null),l=ot(f,u),c=Cw(n),h=hw(r);return R.useEffect(()=>{const m=f.current;if(!m)return;const p=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(p,"checked").set;if(c!==n&&x){const A=new Event("click",{bubbles:s});x.call(m,n),m.dispatchEvent(A)}},[c,n,s]),b.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:l,style:{...o.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});yA.displayName=bj;function SA(e){return e?"checked":"unchecked"}var bA=gA,Cj=_A;const CA=R.forwardRef(({className:e,...r},n)=>b.jsx(bA,{className:Te("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...r,ref:n,children:b.jsx(Cj,{className:Te("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform","data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));CA.displayName=bA.displayName;function wj(){const e=Ve(v=>v.credentials),r=Ve(v=>v.workstationInfo),n=Ve(v=>v.tunnelInfo),s=Ve(v=>v.connectionState),{disconnectAndForget:o}=co(),u=Pn(v=>v.reset),f=Pn(v=>v.ttsEnabled),l=Pn(v=>v.setTtsEnabled),{theme:c,setTheme:h}=Kg(),[m,p]=R.useState(!1),y=async()=>{await o(),u(),p(!1)},x=s==="verified"||s==="authenticated",A=()=>{switch(s){case"verified":return"bg-green-500";case"authenticated":return"bg-yellow-500";case"connecting":return"bg-blue-500 animate-pulse";case"error":return"bg-red-500";default:return"bg-gray-500"}},w=()=>{switch(s){case"verified":return"Connected to Workstation";case"authenticated":return"Connected to Tunnel";case"connecting":return"Connecting...";case"error":return"Connection Error";default:return"Disconnected"}};return b.jsx("div",{className:"h-full overflow-y-auto p-4",children:b.jsxs("div",{className:"max-w-2xl mx-auto space-y-6 pb-8",children:[b.jsx("h1",{className:"text-2xl font-bold",children:"Settings"}),b.jsxs(fs,{children:[b.jsxs(ps,{children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(vS,{className:"w-5 h-5 text-muted-foreground"}),b.jsx(ms,{children:"Appearance"})]}),b.jsx(Xs,{children:"Customize the look and feel of the application"})]}),b.jsx(gs,{children:b.jsxs("div",{className:"space-y-2",children:[b.jsx("p",{className:"text-sm text-muted-foreground",children:"Theme"}),b.jsxs("div",{className:"flex gap-2",children:[b.jsxs(dt,{variant:"outline",className:Te("flex-1 gap-2",c==="light"&&"border-primary bg-primary/10"),onClick:()=>h("light"),children:[b.jsx(vS,{className:"w-4 h-4"}),"Light"]}),b.jsxs(dt,{variant:"outline",className:Te("flex-1 gap-2",c==="dark"&&"border-primary bg-primary/10"),onClick:()=>h("dark"),children:[b.jsx(YM,{className:"w-4 h-4"}),"Dark"]}),b.jsxs(dt,{variant:"outline",className:Te("flex-1 gap-2",c==="system"&&"border-primary bg-primary/10"),onClick:()=>h("system"),children:[b.jsx(VM,{className:"w-4 h-4"}),"System"]})]})]})})]}),b.jsxs(fs,{children:[b.jsxs(ps,{children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(ek,{className:"w-5 h-5 text-muted-foreground"}),b.jsx(ms,{children:"Voice"})]}),b.jsx(Xs,{children:"Configure text-to-speech and voice input settings"})]}),b.jsx(gs,{children:b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs("div",{className:"space-y-0.5",children:[b.jsx(aa,{htmlFor:"tts-toggle",className:"text-sm font-medium",children:"Auto-play TTS responses"}),b.jsx("p",{className:"text-sm text-muted-foreground",children:"Automatically play audio when receiving voice responses"})]}),b.jsx(CA,{id:"tts-toggle",checked:f,onCheckedChange:l})]})})]}),b.jsxs(fs,{children:[b.jsxs(ps,{children:[b.jsxs("div",{className:"flex items-center gap-2",children:[x?b.jsx(o1,{className:"w-5 h-5 text-green-500"}):b.jsx(s1,{className:"w-5 h-5 text-muted-foreground"}),b.jsx(ms,{children:"Connection"})]}),b.jsx(Xs,{children:"Current connection status and information"})]}),b.jsxs(gs,{className:"space-y-4",children:[b.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/50",children:[b.jsx("div",{className:`w-3 h-3 rounded-full ${A()}`}),b.jsx("span",{className:"font-medium",children:w()})]}),e&&b.jsxs("div",{className:"space-y-3 text-sm",children:[b.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[b.jsx(t1,{className:"w-4 h-4"}),b.jsx("span",{children:"Connection Details"})]}),b.jsxs("div",{className:"grid gap-2 pl-6",children:[b.jsxs("div",{className:"flex justify-between",children:[b.jsx("span",{className:"text-muted-foreground",children:"Tunnel ID:"}),b.jsx("span",{className:"font-mono text-xs",children:e.tunnelId})]}),b.jsxs("div",{className:"flex justify-between",children:[b.jsx("span",{className:"text-muted-foreground",children:"Tunnel URL:"}),b.jsx("span",{className:"font-mono text-xs truncate max-w-[200px]",children:e.tunnelUrl})]}),b.jsxs("div",{className:"flex justify-between",children:[b.jsx("span",{className:"text-muted-foreground",children:"Device ID:"}),b.jsx("span",{className:"font-mono text-xs",children:e.deviceId})]})]})]}),r&&b.jsxs("div",{className:"space-y-3 text-sm border-t pt-4",children:[b.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[b.jsx(zM,{className:"w-4 h-4"}),b.jsx("span",{children:"Workstation"})]}),b.jsxs("div",{className:"grid gap-2 pl-6",children:[b.jsxs("div",{className:"flex justify-between",children:[b.jsx("span",{className:"text-muted-foreground",children:"Name:"}),b.jsx("span",{children:r.name})]}),b.jsxs("div",{className:"flex justify-between",children:[b.jsx("span",{className:"text-muted-foreground",children:"Version:"}),b.jsx("span",{className:"font-mono text-xs",children:r.version})]}),r.workspacesRoot&&b.jsxs("div",{className:"flex justify-between",children:[b.jsx("span",{className:"text-muted-foreground",children:"Workspaces:"}),b.jsx("span",{className:"font-mono text-xs truncate max-w-[200px]",children:r.workspacesRoot})]})]})]}),n&&b.jsxs("div",{className:"space-y-3 text-sm border-t pt-4",children:[b.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[b.jsx(JM,{className:"w-4 h-4"}),b.jsx("span",{children:"Tunnel Server"})]}),b.jsxs("div",{className:"grid gap-2 pl-6",children:[b.jsxs("div",{className:"flex justify-between",children:[b.jsx("span",{className:"text-muted-foreground",children:"Version:"}),b.jsx("span",{className:"font-mono text-xs",children:n.version})]}),n.protocolVersion&&b.jsxs("div",{className:"flex justify-between",children:[b.jsx("span",{className:"text-muted-foreground",children:"Protocol:"}),b.jsxs("span",{className:"font-mono text-xs",children:["v",n.protocolVersion]})]})]})]})]})]}),b.jsxs(fs,{children:[b.jsxs(ps,{children:[b.jsx(ms,{children:"About"}),b.jsx(Xs,{children:"Tiflis Code Web Client"})]}),b.jsxs(gs,{className:"space-y-2 text-sm",children:[b.jsxs("div",{className:"flex justify-between",children:[b.jsx("span",{className:"text-muted-foreground",children:"Version:"}),b.jsx("span",{className:"font-mono",children:"0.1.0"})]}),b.jsxs("div",{className:"flex justify-between",children:[b.jsx("span",{className:"text-muted-foreground",children:"Author:"}),b.jsx("span",{children:"Roman Barinov"})]}),b.jsxs("div",{className:"flex justify-between",children:[b.jsx("span",{className:"text-muted-foreground",children:"Repository:"}),b.jsx("a",{href:"https://github.com/tiflis-io/tiflis-code",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"tiflis-io/tiflis-code"})]}),b.jsxs("div",{className:"flex justify-between",children:[b.jsx("span",{className:"text-muted-foreground",children:"License:"}),b.jsx("span",{children:"FSL-1.1-NC"})]})]})]}),b.jsxs(fs,{children:[b.jsx(ps,{children:b.jsx(ms,{children:"Legal"})}),b.jsxs(gs,{className:"space-y-2 text-sm",children:[b.jsxs("div",{className:"flex justify-between items-center",children:[b.jsx("span",{className:"text-muted-foreground",children:"Privacy Policy"}),b.jsx("a",{href:"https://github.com/tiflis-io/tiflis-code/blob/main/PRIVACY.md",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"View"})]}),b.jsxs("div",{className:"flex justify-between items-center",children:[b.jsx("span",{className:"text-muted-foreground",children:"Terms of Service"}),b.jsx("a",{href:"https://github.com/tiflis-io/tiflis-code/blob/main/TERMS.md",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"View"})]})]})]}),b.jsxs(fs,{className:"border-destructive/50",children:[b.jsxs(ps,{children:[b.jsx(ms,{className:"text-destructive",children:"Danger Zone"}),b.jsx(Xs,{children:"Disconnect and clear all stored data"})]}),b.jsx(gs,{children:b.jsxs(Zd,{open:m,onOpenChange:p,children:[b.jsx(EN,{asChild:!0,children:b.jsxs(dt,{variant:"destructive",className:"w-full",children:[b.jsx(rc,{className:"w-4 h-4"}),"Disconnect & Forget All Data"]})}),b.jsxs(sc,{children:[b.jsxs(oc,{children:[b.jsx(lc,{children:"Are you sure?"}),b.jsxs(cc,{children:["This will permanently delete all stored connection data including:",b.jsxs("ul",{className:"list-disc list-inside mt-2 space-y-1",children:[b.jsx("li",{children:"Authentication keys"}),b.jsx("li",{children:"Tunnel connection settings"}),b.jsx("li",{children:"Device ID"}),b.jsx("li",{children:"All stored preferences"})]}),b.jsx("p",{className:"mt-2 font-medium",children:"You will need to scan a QR code or paste a magic link again to reconnect."})]})]}),b.jsxs(ac,{children:[b.jsx(dc,{children:"Cancel"}),b.jsx(uc,{onClick:y,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete All Data"})]})]})]})})]})]})})}function xj(){const e=Ve(r=>r.isAuthenticated);return b.jsx(SD,{children:b.jsx($R,{children:e?b.jsxs(b.Fragment,{children:[b.jsxs(Ln,{element:b.jsx(CI,{}),children:[b.jsx(Ln,{path:"/",element:b.jsx(Ad,{to:"/chat",replace:!0})}),b.jsx(Ln,{path:"/chat",element:b.jsx(wb,{})}),b.jsx(Ln,{path:"/chat/:sessionId",element:b.jsx(wb,{})}),b.jsx(Ln,{path:"/terminal/:sessionId",element:b.jsx(vj,{})}),b.jsx(Ln,{path:"/settings",element:b.jsx(wj,{})})]}),b.jsx(Ln,{path:"*",element:b.jsx(Ad,{to:"/chat",replace:!0})})]}):b.jsxs(b.Fragment,{children:[b.jsx(Ln,{path:"/",element:b.jsx(Bk,{})}),b.jsx(Ln,{path:"*",element:b.jsx(Ad,{to:"/",replace:!0})})]})})})}class Ej extends R.Component{constructor(n){super(n);_e(this,"handleReset",()=>{this.setState({hasError:!1,error:null,errorInfo:null})});_e(this,"handleReload",()=>{window.location.reload()});this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,s){this.setState({errorInfo:s})}render(){return this.state.hasError?this.props.fallback?this.props.fallback:b.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",role:"alert","aria-live":"assertive",children:b.jsxs("div",{className:"w-full max-w-md space-y-6 text-center",children:[b.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-full bg-destructive/10",children:b.jsx(Yg,{className:"h-8 w-8 text-destructive","aria-hidden":"true"})}),b.jsxs("div",{className:"space-y-2",children:[b.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:"Something went wrong"}),b.jsx("p",{className:"text-muted-foreground",children:"An unexpected error occurred. Please try again or reload the page."})]}),!1,b.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:justify-center",children:[b.jsxs(dt,{variant:"outline",onClick:this.handleReset,className:"gap-2",children:[b.jsx(zg,{className:"h-4 w-4","aria-hidden":"true"}),"Try again"]}),b.jsx(dt,{onClick:this.handleReload,children:"Reload page"})]})]})}):this.props.children}}function Aj(){const e=LN();return b.jsx(MN,{toasts:e,onDismiss:r=>vi.dismiss(r)})}const wA=document.getElementById("root");if(!wA)throw new Error("Root element not found");$T.createRoot(wA).render(b.jsx(R.StrictMode,{children:b.jsx(Ej,{children:b.jsxs(Ok,{defaultTheme:"system",children:[b.jsx(xj,{}),b.jsx(Aj,{})]})})}));
420
+ //# sourceMappingURL=index-DgZ42qlO.js.map