@dotobokuri/fleet-console 1.10.1 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/cli-bin.mjs +198 -0
  2. package/dist/cli.mjs +198 -0
  3. package/dist/client/assets/{_baseUniq-e_j340KJ.js → _baseUniq-ztWyEFQN.js} +1 -1
  4. package/dist/client/assets/{arc-CioNx0k6.js → arc-EhU8s6Ua.js} +1 -1
  5. package/dist/client/assets/{architectureDiagram-Q4EWVU46-B_8HDSCb.js → architectureDiagram-Q4EWVU46-D-A0BxBN.js} +1 -1
  6. package/dist/client/assets/{blockDiagram-DXYQGD6D-CpHdrypQ.js → blockDiagram-DXYQGD6D-2I4IGpqO.js} +1 -1
  7. package/dist/client/assets/{c4Diagram-AHTNJAMY-CkitEGpF.js → c4Diagram-AHTNJAMY-CbqNPptt.js} +1 -1
  8. package/dist/client/assets/channel-Dd54JtFQ.js +1 -0
  9. package/dist/client/assets/{chunk-4BX2VUAB-DxyXXSCc.js → chunk-4BX2VUAB-BazJQgjj.js} +1 -1
  10. package/dist/client/assets/{chunk-4TB4RGXK-C2-nU4zS.js → chunk-4TB4RGXK-B5U6jXNZ.js} +1 -1
  11. package/dist/client/assets/{chunk-55IACEB6-Ch5DNHFU.js → chunk-55IACEB6-0n2BOb9g.js} +1 -1
  12. package/dist/client/assets/{chunk-EDXVE4YY-CHE6KKZa.js → chunk-EDXVE4YY-CCIYCj-v.js} +1 -1
  13. package/dist/client/assets/{chunk-FMBD7UC4-PFqCeOs6.js → chunk-FMBD7UC4-De3-snUm.js} +1 -1
  14. package/dist/client/assets/{chunk-OYMX7WX6-DHE5_rgO.js → chunk-OYMX7WX6-diQ1neOD.js} +1 -1
  15. package/dist/client/assets/{chunk-QZHKN3VN-BNsfe2Ai.js → chunk-QZHKN3VN-jDt-UT0T.js} +1 -1
  16. package/dist/client/assets/{chunk-YZCP3GAM-Du6aAWOS.js → chunk-YZCP3GAM-DcO9HsKI.js} +1 -1
  17. package/dist/client/assets/classDiagram-6PBFFD2Q-DXlHCr38.js +1 -0
  18. package/dist/client/assets/classDiagram-v2-HSJHXN6E-DXlHCr38.js +1 -0
  19. package/dist/client/assets/clone-aAfeyUSr.js +1 -0
  20. package/dist/client/assets/{cose-bilkent-S5V4N54A-BMbRb2Ij.js → cose-bilkent-S5V4N54A--wgqx5mz.js} +1 -1
  21. package/dist/client/assets/{dagre-KV5264BT-BIYIuU4t.js → dagre-KV5264BT-BJ0_Y4Vz.js} +1 -1
  22. package/dist/client/assets/{diagram-5BDNPKRD-DE58KlL0.js → diagram-5BDNPKRD-CfBHVHZE.js} +1 -1
  23. package/dist/client/assets/{diagram-G4DWMVQ6-BBHYXkDj.js → diagram-G4DWMVQ6-DDcFZCuW.js} +1 -1
  24. package/dist/client/assets/{diagram-MMDJMWI5-BGA4ZKw3.js → diagram-MMDJMWI5-D1h5iLfb.js} +1 -1
  25. package/dist/client/assets/{diagram-TYMM5635-DusN1Hix.js → diagram-TYMM5635-BDq0icy6.js} +1 -1
  26. package/dist/client/assets/{erDiagram-SMLLAGMA-84E-AJKo.js → erDiagram-SMLLAGMA-hM5asp2K.js} +1 -1
  27. package/dist/client/assets/{flowDiagram-DWJPFMVM-Dpap9NqV.js → flowDiagram-DWJPFMVM-Duycvo32.js} +1 -1
  28. package/dist/client/assets/{ganttDiagram-T4ZO3ILL-CukRJAaM.js → ganttDiagram-T4ZO3ILL-f43QwkVB.js} +1 -1
  29. package/dist/client/assets/{gitGraphDiagram-UUTBAWPF-DuAwiTii.js → gitGraphDiagram-UUTBAWPF-B-fSCy1k.js} +1 -1
  30. package/dist/client/assets/{graph-B7irxl7Q.js → graph-Cl_pkMd7.js} +1 -1
  31. package/dist/client/assets/index-BvDAt7ke.js +777 -0
  32. package/dist/client/assets/index-CWhJm0eS.css +1 -0
  33. package/dist/client/assets/{infoDiagram-42DDH7IO-Gdh2w_Ry.js → infoDiagram-42DDH7IO-CI1F8uHU.js} +1 -1
  34. package/dist/client/assets/{ishikawaDiagram-UXIWVN3A-DvbqJman.js → ishikawaDiagram-UXIWVN3A-CPTPh9Lu.js} +1 -1
  35. package/dist/client/assets/{journeyDiagram-VCZTEJTY-DIQYAsjN.js → journeyDiagram-VCZTEJTY-D_FHFgB1.js} +1 -1
  36. package/dist/client/assets/{kanban-definition-6JOO6SKY-8BBtOuAV.js → kanban-definition-6JOO6SKY-C_Bn4fd8.js} +1 -1
  37. package/dist/client/assets/{layout-DDUpLunD.js → layout-Bc8t_qfg.js} +1 -1
  38. package/dist/client/assets/{linear-BzLoJVdP.js → linear-GI_b927m.js} +1 -1
  39. package/dist/client/assets/{mermaid.core-Ddi7z3V3.js → mermaid.core-Dpt8s_19.js} +4 -4
  40. package/dist/client/assets/{min-CEKwugI-.js → min-C0TmzA9X.js} +1 -1
  41. package/dist/client/assets/{mindmap-definition-QFDTVHPH-y-V-6GIi.js → mindmap-definition-QFDTVHPH-DeVjdvs_.js} +1 -1
  42. package/dist/client/assets/{pieDiagram-DEJITSTG-DjqTUefi.js → pieDiagram-DEJITSTG-D6vRcSmr.js} +1 -1
  43. package/dist/client/assets/{quadrantDiagram-34T5L4WZ-BZbwyDuC.js → quadrantDiagram-34T5L4WZ-CHx1fSsQ.js} +1 -1
  44. package/dist/client/assets/{requirementDiagram-MS252O5E-M2epVejI.js → requirementDiagram-MS252O5E-BYXRdqXr.js} +1 -1
  45. package/dist/client/assets/{sankeyDiagram-XADWPNL6-DQHzVL6h.js → sankeyDiagram-XADWPNL6-DQ6TVGQn.js} +1 -1
  46. package/dist/client/assets/{sequenceDiagram-FGHM5R23-Dldq08WJ.js → sequenceDiagram-FGHM5R23-DLKBakQH.js} +1 -1
  47. package/dist/client/assets/{stateDiagram-FHFEXIEX-B32muPdI.js → stateDiagram-FHFEXIEX-CKEUdeZY.js} +1 -1
  48. package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-DtBjrVLm.js +1 -0
  49. package/dist/client/assets/{timeline-definition-GMOUNBTQ-nSYYEX6t.js → timeline-definition-GMOUNBTQ-DJ34nw1g.js} +1 -1
  50. package/dist/client/assets/{vennDiagram-DHZGUBPP-DPIMKKCQ.js → vennDiagram-DHZGUBPP-DaF9-6LK.js} +1 -1
  51. package/dist/client/assets/{wardley-RL74JXVD-DArerB6Y.js → wardley-RL74JXVD-B3nUfV4p.js} +1 -1
  52. package/dist/client/assets/{wardleyDiagram-NUSXRM2D-DRvimWEN.js → wardleyDiagram-NUSXRM2D-DeYWbpzl.js} +1 -1
  53. package/dist/client/assets/{xychartDiagram-5P7HB3ND-D0VCX3ps.js → xychartDiagram-5P7HB3ND-DkpV5JZH.js} +1 -1
  54. package/dist/client/index.html +2 -2
  55. package/package.json +1 -1
  56. package/dist/client/assets/channel-CEwT4AXW.js +0 -1
  57. package/dist/client/assets/classDiagram-6PBFFD2Q-BcAsKAPs.js +0 -1
  58. package/dist/client/assets/classDiagram-v2-HSJHXN6E-BcAsKAPs.js +0 -1
  59. package/dist/client/assets/clone-BbRCSYXZ.js +0 -1
  60. package/dist/client/assets/index-CTyjGQHF.css +0 -1
  61. package/dist/client/assets/index-Uidvbtqb.js +0 -777
  62. package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-Ct3tm_Bq.js +0 -1
@@ -0,0 +1,777 @@
1
+ (function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const f of o)if(f.type==="childList")for(const _ of f.addedNodes)_.tagName==="LINK"&&_.rel==="modulepreload"&&a(_)}).observe(document,{childList:!0,subtree:!0});function r(o){const f={};return o.integrity&&(f.integrity=o.integrity),o.referrerPolicy&&(f.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?f.credentials="include":o.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function a(o){if(o.ep)return;o.ep=!0;const f=r(o);fetch(o.href,f)}})();function ME(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function IB(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var n=e.default;if(typeof n=="function"){var r=function a(){var o=!1;try{o=this instanceof a}catch{}return o?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};r.prototype=n.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,o.get?o:{enumerable:!0,get:function(){return e[a]}})}),r}var Af={exports:{}},fl={};var nb;function DE(){if(nb)return fl;nb=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(a,o,f){var _=null;if(f!==void 0&&(_=""+f),o.key!==void 0&&(_=""+o.key),"key"in o){f={};for(var c in o)c!=="key"&&(f[c]=o[c])}else f=o;return o=f.ref,{$$typeof:e,type:a,key:_,ref:o!==void 0?o:null,props:f}}return fl.Fragment=n,fl.jsx=r,fl.jsxs=r,fl}var ib;function OE(){return ib||(ib=1,Af.exports=DE()),Af.exports}var y=OE(),kf={exports:{}},Fe={};var rb;function NE(){if(rb)return Fe;rb=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),_=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),C=Symbol.iterator;function E(N){return N===null||typeof N!="object"?null:(N=C&&N[C]||N["@@iterator"],typeof N=="function"?N:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,p={};function v(N,P,Z){this.props=N,this.context=P,this.refs=p,this.updater=Z||A}v.prototype.isReactComponent={},v.prototype.setState=function(N,P){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,P,"setState")},v.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function h(){}h.prototype=v.prototype;function b(N,P,Z){this.props=N,this.context=P,this.refs=p,this.updater=Z||A}var T=b.prototype=new h;T.constructor=b,x(T,v.prototype),T.isPureReactComponent=!0;var R=Array.isArray;function L(){}var M={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function B(N,P,Z){var ae=Z.ref;return{$$typeof:e,type:N,key:P,ref:ae!==void 0?ae:null,props:Z}}function F(N,P){return B(N.type,P,N.props)}function U(N){return typeof N=="object"&&N!==null&&N.$$typeof===e}function W(N){var P={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(Z){return P[Z]})}var j=/\/+/g;function G(N,P){return typeof N=="object"&&N!==null&&N.key!=null?W(""+N.key):P.toString(36)}function ee(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(L,L):(N.status="pending",N.then(function(P){N.status==="pending"&&(N.status="fulfilled",N.value=P)},function(P){N.status==="pending"&&(N.status="rejected",N.reason=P)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function q(N,P,Z,ae,ce){var _e=typeof N;(_e==="undefined"||_e==="boolean")&&(N=null);var Q=!1;if(N===null)Q=!0;else switch(_e){case"bigint":case"string":case"number":Q=!0;break;case"object":switch(N.$$typeof){case e:case n:Q=!0;break;case S:return Q=N._init,q(Q(N._payload),P,Z,ae,ce)}}if(Q)return ce=ce(N),Q=ae===""?"."+G(N,0):ae,R(ce)?(Z="",Q!=null&&(Z=Q.replace(j,"$&/")+"/"),q(ce,P,Z,"",function(ge){return ge})):ce!=null&&(U(ce)&&(ce=F(ce,Z+(ce.key==null||N&&N.key===ce.key?"":(""+ce.key).replace(j,"$&/")+"/")+Q)),P.push(ce)),1;Q=0;var $=ae===""?".":ae+":";if(R(N))for(var oe=0;oe<N.length;oe++)ae=N[oe],_e=$+G(ae,oe),Q+=q(ae,P,Z,_e,ce);else if(oe=E(N),typeof oe=="function")for(N=oe.call(N),oe=0;!(ae=N.next()).done;)ae=ae.value,_e=$+G(ae,oe++),Q+=q(ae,P,Z,_e,ce);else if(_e==="object"){if(typeof N.then=="function")return q(ee(N),P,Z,ae,ce);throw P=String(N),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return Q}function V(N,P,Z){if(N==null)return N;var ae=[],ce=0;return q(N,ae,"","",function(_e){return P.call(Z,_e,ce++)}),ae}function Y(N){if(N._status===-1){var P=N._result;P=P(),P.then(function(Z){(N._status===0||N._status===-1)&&(N._status=1,N._result=Z)},function(Z){(N._status===0||N._status===-1)&&(N._status=2,N._result=Z)}),N._status===-1&&(N._status=0,N._result=P)}if(N._status===1)return N._result.default;throw N._result}var D=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},I={map:V,forEach:function(N,P,Z){V(N,function(){P.apply(this,arguments)},Z)},count:function(N){var P=0;return V(N,function(){P++}),P},toArray:function(N){return V(N,function(P){return P})||[]},only:function(N){if(!U(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return Fe.Activity=g,Fe.Children=I,Fe.Component=v,Fe.Fragment=r,Fe.Profiler=o,Fe.PureComponent=b,Fe.StrictMode=a,Fe.Suspense=u,Fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Fe.__COMPILER_RUNTIME={__proto__:null,c:function(N){return M.H.useMemoCache(N)}},Fe.cache=function(N){return function(){return N.apply(null,arguments)}},Fe.cacheSignal=function(){return null},Fe.cloneElement=function(N,P,Z){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var ae=x({},N.props),ce=N.key;if(P!=null)for(_e in P.key!==void 0&&(ce=""+P.key),P)!k.call(P,_e)||_e==="key"||_e==="__self"||_e==="__source"||_e==="ref"&&P.ref===void 0||(ae[_e]=P[_e]);var _e=arguments.length-2;if(_e===1)ae.children=Z;else if(1<_e){for(var Q=Array(_e),$=0;$<_e;$++)Q[$]=arguments[$+2];ae.children=Q}return B(N.type,ce,ae)},Fe.createContext=function(N){return N={$$typeof:_,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:f,_context:N},N},Fe.createElement=function(N,P,Z){var ae,ce={},_e=null;if(P!=null)for(ae in P.key!==void 0&&(_e=""+P.key),P)k.call(P,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(ce[ae]=P[ae]);var Q=arguments.length-2;if(Q===1)ce.children=Z;else if(1<Q){for(var $=Array(Q),oe=0;oe<Q;oe++)$[oe]=arguments[oe+2];ce.children=$}if(N&&N.defaultProps)for(ae in Q=N.defaultProps,Q)ce[ae]===void 0&&(ce[ae]=Q[ae]);return B(N,_e,ce)},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(N){return{$$typeof:c,render:N}},Fe.isValidElement=U,Fe.lazy=function(N){return{$$typeof:S,_payload:{_status:-1,_result:N},_init:Y}},Fe.memo=function(N,P){return{$$typeof:d,type:N,compare:P===void 0?null:P}},Fe.startTransition=function(N){var P=M.T,Z={};M.T=Z;try{var ae=N(),ce=M.S;ce!==null&&ce(Z,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(L,D)}catch(_e){D(_e)}finally{P!==null&&Z.types!==null&&(P.types=Z.types),M.T=P}},Fe.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Fe.use=function(N){return M.H.use(N)},Fe.useActionState=function(N,P,Z){return M.H.useActionState(N,P,Z)},Fe.useCallback=function(N,P){return M.H.useCallback(N,P)},Fe.useContext=function(N){return M.H.useContext(N)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(N,P){return M.H.useDeferredValue(N,P)},Fe.useEffect=function(N,P){return M.H.useEffect(N,P)},Fe.useEffectEvent=function(N){return M.H.useEffectEvent(N)},Fe.useId=function(){return M.H.useId()},Fe.useImperativeHandle=function(N,P,Z){return M.H.useImperativeHandle(N,P,Z)},Fe.useInsertionEffect=function(N,P){return M.H.useInsertionEffect(N,P)},Fe.useLayoutEffect=function(N,P){return M.H.useLayoutEffect(N,P)},Fe.useMemo=function(N,P){return M.H.useMemo(N,P)},Fe.useOptimistic=function(N,P){return M.H.useOptimistic(N,P)},Fe.useReducer=function(N,P,Z){return M.H.useReducer(N,P,Z)},Fe.useRef=function(N){return M.H.useRef(N)},Fe.useState=function(N){return M.H.useState(N)},Fe.useSyncExternalStore=function(N,P,Z){return M.H.useSyncExternalStore(N,P,Z)},Fe.useTransition=function(){return M.H.useTransition()},Fe.version="19.2.7",Fe}var sb;function Og(){return sb||(sb=1,kf.exports=NE()),kf.exports}var H=Og(),Rf={exports:{}},pl={},Lf={exports:{}},Mf={};var ab;function BE(){return ab||(ab=1,(function(e){function n(q,V){var Y=q.length;q.push(V);e:for(;0<Y;){var D=Y-1>>>1,I=q[D];if(0<o(I,V))q[D]=V,q[Y]=I,Y=D;else break e}}function r(q){return q.length===0?null:q[0]}function a(q){if(q.length===0)return null;var V=q[0],Y=q.pop();if(Y!==V){q[0]=Y;e:for(var D=0,I=q.length,N=I>>>1;D<N;){var P=2*(D+1)-1,Z=q[P],ae=P+1,ce=q[ae];if(0>o(Z,Y))ae<I&&0>o(ce,Z)?(q[D]=ce,q[ae]=Y,D=ae):(q[D]=Z,q[P]=Y,D=P);else if(ae<I&&0>o(ce,Y))q[D]=ce,q[ae]=Y,D=ae;else break e}}return V}function o(q,V){var Y=q.sortIndex-V.sortIndex;return Y!==0?Y:q.id-V.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;e.unstable_now=function(){return f.now()}}else{var _=Date,c=_.now();e.unstable_now=function(){return _.now()-c}}var u=[],d=[],S=1,g=null,C=3,E=!1,A=!1,x=!1,p=!1,v=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function T(q){for(var V=r(d);V!==null;){if(V.callback===null)a(d);else if(V.startTime<=q)a(d),V.sortIndex=V.expirationTime,n(u,V);else break;V=r(d)}}function R(q){if(x=!1,T(q),!A)if(r(u)!==null)A=!0,L||(L=!0,W());else{var V=r(d);V!==null&&ee(R,V.startTime-q)}}var L=!1,M=-1,k=5,B=-1;function F(){return p?!0:!(e.unstable_now()-B<k)}function U(){if(p=!1,L){var q=e.unstable_now();B=q;var V=!0;try{e:{A=!1,x&&(x=!1,h(M),M=-1),E=!0;var Y=C;try{t:{for(T(q),g=r(u);g!==null&&!(g.expirationTime>q&&F());){var D=g.callback;if(typeof D=="function"){g.callback=null,C=g.priorityLevel;var I=D(g.expirationTime<=q);if(q=e.unstable_now(),typeof I=="function"){g.callback=I,T(q),V=!0;break t}g===r(u)&&a(u),T(q)}else a(u);g=r(u)}if(g!==null)V=!0;else{var N=r(d);N!==null&&ee(R,N.startTime-q),V=!1}}break e}finally{g=null,C=Y,E=!1}V=void 0}}finally{V?W():L=!1}}}var W;if(typeof b=="function")W=function(){b(U)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,G=j.port2;j.port1.onmessage=U,W=function(){G.postMessage(null)}}else W=function(){v(U,0)};function ee(q,V){M=v(function(){q(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(q){q.callback=null},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return C},e.unstable_next=function(q){switch(C){case 1:case 2:case 3:var V=3;break;default:V=C}var Y=C;C=V;try{return q()}finally{C=Y}},e.unstable_requestPaint=function(){p=!0},e.unstable_runWithPriority=function(q,V){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var Y=C;C=q;try{return V()}finally{C=Y}},e.unstable_scheduleCallback=function(q,V,Y){var D=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?D+Y:D):Y=D,q){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=Y+I,q={id:S++,callback:V,priorityLevel:q,startTime:Y,expirationTime:I,sortIndex:-1},Y>D?(q.sortIndex=Y,n(d,q),r(u)===null&&q===r(d)&&(x?(h(M),M=-1):x=!0,ee(R,Y-D))):(q.sortIndex=I,n(u,q),A||E||(A=!0,L||(L=!0,W()))),q},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(q){var V=C;return function(){var Y=C;C=V;try{return q.apply(this,arguments)}finally{C=Y}}}})(Mf)),Mf}var ob;function IE(){return ob||(ob=1,Lf.exports=BE()),Lf.exports}var Df={exports:{}},Nn={};var lb;function jE(){if(lb)return Nn;lb=1;var e=Og();function n(u){var d="https://react.dev/errors/"+u;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var S=2;S<arguments.length;S++)d+="&args[]="+encodeURIComponent(arguments[S])}return"Minified React error #"+u+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var a={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function f(u,d,S){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:u,containerInfo:d,implementation:S}}var _=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(u,d){if(u==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Nn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Nn.createPortal=function(u,d){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(n(299));return f(u,d,null,S)},Nn.flushSync=function(u){var d=_.T,S=a.p;try{if(_.T=null,a.p=2,u)return u()}finally{_.T=d,a.p=S,a.d.f()}},Nn.preconnect=function(u,d){typeof u=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,a.d.C(u,d))},Nn.prefetchDNS=function(u){typeof u=="string"&&a.d.D(u)},Nn.preinit=function(u,d){if(typeof u=="string"&&d&&typeof d.as=="string"){var S=d.as,g=c(S,d.crossOrigin),C=typeof d.integrity=="string"?d.integrity:void 0,E=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;S==="style"?a.d.S(u,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:g,integrity:C,fetchPriority:E}):S==="script"&&a.d.X(u,{crossOrigin:g,integrity:C,fetchPriority:E,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Nn.preinitModule=function(u,d){if(typeof u=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var S=c(d.as,d.crossOrigin);a.d.M(u,{crossOrigin:S,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&a.d.M(u)},Nn.preload=function(u,d){if(typeof u=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var S=d.as,g=c(S,d.crossOrigin);a.d.L(u,S,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Nn.preloadModule=function(u,d){if(typeof u=="string")if(d){var S=c(d.as,d.crossOrigin);a.d.m(u,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:S,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else a.d.m(u)},Nn.requestFormReset=function(u){a.d.r(u)},Nn.unstable_batchedUpdates=function(u,d){return u(d)},Nn.useFormState=function(u,d,S){return _.H.useFormState(u,d,S)},Nn.useFormStatus=function(){return _.H.useHostTransitionStatus()},Nn.version="19.2.7",Nn}var cb;function Ky(){if(cb)return Df.exports;cb=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(n){console.error(n)}}return e(),Df.exports=jE(),Df.exports}var ub;function zE(){if(ub)return pl;ub=1;var e=IE(),n=Og(),r=Ky();function a(t){var i="https://react.dev/errors/"+t;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)i+="&args[]="+encodeURIComponent(arguments[s])}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 f(t){var i=t,s=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(s=i.return),t=i.return;while(t)}return i.tag===3?s:null}function _(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 c(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 u(t){if(f(t)!==t)throw Error(a(188))}function d(t){var i=t.alternate;if(!i){if(i=f(t),i===null)throw Error(a(188));return i!==t?null:t}for(var s=t,l=i;;){var m=s.return;if(m===null)break;var w=m.alternate;if(w===null){if(l=m.return,l!==null){s=l;continue}break}if(m.child===w.child){for(w=m.child;w;){if(w===s)return u(m),t;if(w===l)return u(m),i;w=w.sibling}throw Error(a(188))}if(s.return!==l.return)s=m,l=w;else{for(var O=!1,z=m.child;z;){if(z===s){O=!0,s=m,l=w;break}if(z===l){O=!0,l=m,s=w;break}z=z.sibling}if(!O){for(z=w.child;z;){if(z===s){O=!0,s=w,l=m;break}if(z===l){O=!0,l=w,s=m;break}z=z.sibling}if(!O)throw Error(a(189))}}if(s.alternate!==l)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?t:i}function S(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t;for(t=t.child;t!==null;){if(i=S(t),i!==null)return i;t=t.sibling}return null}var g=Object.assign,C=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),b=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function W(t){return t===null||typeof t!="object"?null:(t=U&&t[U]||t["@@iterator"],typeof t=="function"?t:null)}var j=Symbol.for("react.client.reference");function G(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===j?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case x:return"Fragment";case v:return"Profiler";case p:return"StrictMode";case R:return"Suspense";case L:return"SuspenseList";case B:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case A:return"Portal";case b:return t.displayName||"Context";case h: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 M:return i=t.displayName||null,i!==null?i:G(t.type)||"Memo";case k:i=t._payload,t=t._init;try{return G(t(i))}catch{}}return null}var ee=Array.isArray,q=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},D=[],I=-1;function N(t){return{current:t}}function P(t){0>I||(t.current=D[I],D[I]=null,I--)}function Z(t,i){I++,D[I]=t.current,t.current=i}var ae=N(null),ce=N(null),_e=N(null),Q=N(null);function $(t,i){switch(Z(_e,i),Z(ce,t),Z(ae,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?E0(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=E0(i),t=T0(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}P(ae),Z(ae,t)}function oe(){P(ae),P(ce),P(_e)}function ge(t){t.memoizedState!==null&&Z(Q,t);var i=ae.current,s=T0(i,t.type);i!==s&&(Z(ce,t),Z(ae,s))}function Se(t){ce.current===t&&(P(ae),P(ce)),Q.current===t&&(P(Q),cl._currentValue=Y)}var ye,Pe;function qe(t){if(ye===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);ye=i&&i[1]||"",Pe=-1<s.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+ye+t+Pe}var Xe=!1;function xt(t,i){if(!t||Xe)return"";Xe=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(i){var fe=function(){throw Error()};if(Object.defineProperty(fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(fe,[])}catch(le){var se=le}Reflect.construct(t,[],fe)}else{try{fe.call()}catch(le){se=le}t.call(fe.prototype)}}else{try{throw Error()}catch(le){se=le}(fe=t())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(le){if(le&&se&&typeof le.stack=="string")return[le.stack,se.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=l.DetermineComponentFrameRoot(),O=w[0],z=w[1];if(O&&z){var X=O.split(`
4
+ `),re=z.split(`
5
+ `);for(m=l=0;l<X.length&&!X[l].includes("DetermineComponentFrameRoot");)l++;for(;m<re.length&&!re[m].includes("DetermineComponentFrameRoot");)m++;if(l===X.length||m===re.length)for(l=X.length-1,m=re.length-1;1<=l&&0<=m&&X[l]!==re[m];)m--;for(;1<=l&&0<=m;l--,m--)if(X[l]!==re[m]){if(l!==1||m!==1)do if(l--,m--,0>m||X[l]!==re[m]){var ue=`
6
+ `+X[l].replace(" at new "," at ");return t.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",t.displayName)),ue}while(1<=l&&0<=m);break}}}finally{Xe=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?qe(s):""}function Ne(t,i){switch(t.tag){case 26:case 27:case 5:return qe(t.type);case 16:return qe("Lazy");case 13:return t.child!==i&&i!==null?qe("Suspense Fallback"):qe("Suspense");case 19:return qe("SuspenseList");case 0:case 15:return xt(t.type,!1);case 11:return xt(t.type.render,!1);case 1:return xt(t.type,!0);case 31:return qe("Activity");default:return""}}function en(t){try{var i="",s=null;do i+=Ne(t,s),s=t,t=t.return;while(t);return i}catch(l){return`
7
+ Error generating stack: `+l.message+`
8
+ `+l.stack}}var yn=Object.prototype.hasOwnProperty,Sn=e.unstable_scheduleCallback,mi=e.unstable_cancelCallback,Ni=e.unstable_shouldYield,tn=e.unstable_requestPaint,ht=e.unstable_now,Vt=e.unstable_getCurrentPriorityLevel,zt=e.unstable_ImmediatePriority,$t=e.unstable_UserBlockingPriority,nn=e.unstable_NormalPriority,Bi=e.unstable_LowPriority,Dn=e.unstable_IdlePriority,ri=e.log,ft=e.unstable_setDisableYieldValue,Un=null,Yt=null;function Xt(t){if(typeof ri=="function"&&ft(t),Yt&&typeof Yt.setStrictMode=="function")try{Yt.setStrictMode(Un,t)}catch{}}var Pt=Math.clz32?Math.clz32:ca,ks=Math.log,cr=Math.LN2;function ca(t){return t>>>=0,t===0?32:31-(ks(t)/cr|0)|0}var Ii=256,Vi=262144,ur=4194304;function rn(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 J(t,i,s){var l=t.pendingLanes;if(l===0)return 0;var m=0,w=t.suspendedLanes,O=t.pingedLanes;t=t.warmLanes;var z=l&134217727;return z!==0?(l=z&~w,l!==0?m=rn(l):(O&=z,O!==0?m=rn(O):s||(s=z&~t,s!==0&&(m=rn(s))))):(z=l&~w,z!==0?m=rn(z):O!==0?m=rn(O):s||(s=l&~t,s!==0&&(m=rn(s)))),m===0?0:i!==0&&i!==m&&(i&w)===0&&(w=m&-m,s=i&-i,w>=s||w===32&&(s&4194048)!==0)?i:m}function he(t,i){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&i)===0}function be(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 Ie(){var t=ur;return ur<<=1,(ur&62914560)===0&&(ur=4194304),t}function wt(t){for(var i=[],s=0;31>s;s++)i.push(t);return i}function pt(t,i){t.pendingLanes|=i,i!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Te(t,i,s,l,m,w){var O=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var z=t.entanglements,X=t.expirationTimes,re=t.hiddenUpdates;for(s=O&~s;0<s;){var ue=31-Pt(s),fe=1<<ue;z[ue]=0,X[ue]=-1;var se=re[ue];if(se!==null)for(re[ue]=null,ue=0;ue<se.length;ue++){var le=se[ue];le!==null&&(le.lane&=-536870913)}s&=~fe}l!==0&&Ce(t,l,0),w!==0&&m===0&&t.tag!==0&&(t.suspendedLanes|=w&~(O&~i))}function Ce(t,i,s){t.pendingLanes|=i,t.suspendedLanes&=~i;var l=31-Pt(i);t.entangledLanes|=i,t.entanglements[l]=t.entanglements[l]|1073741824|s&261930}function je(t,i){var s=t.entangledLanes|=i;for(t=t.entanglements;s;){var l=31-Pt(s),m=1<<l;m&i|t[l]&i&&(t[l]|=i),s&=~m}}function It(t,i){var s=i&-i;return s=(s&42)!==0?1:et(s),(s&(t.suspendedLanes|i))!==0?0:s}function et(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 wn(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function hr(){var t=V.p;return t!==0?t:(t=window.event,t===void 0?32:Y0(t.type))}function dr(t,i){var s=V.p;try{return V.p=t,i()}finally{V.p=s}}var Fn=Math.random().toString(36).slice(2),At="__reactFiber$"+Fn,Et="__reactProps$"+Fn,ji="__reactContainer$"+Fn,Fr="__reactEvents$"+Fn,ua="__reactListeners$"+Fn,fr="__reactHandles$"+Fn,Rs="__reactResources$"+Fn,Yi="__reactMarker$"+Fn;function De(t){delete t[At],delete t[Et],delete t[Fr],delete t[ua],delete t[fr]}function K(t){var i=t[At];if(i)return i;for(var s=t.parentNode;s;){if(i=s[ji]||s[At]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(t=O0(t);t!==null;){if(s=t[At])return s;t=O0(t)}return i}t=s,s=t.parentNode}return null}function pe(t){if(t=t[At]||t[ji]){var i=t.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return t}return null}function xe(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t.stateNode;throw Error(a(33))}function st(t){var i=t[Rs];return i||(i=t[Rs]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Ze(t){t[Yi]=!0}var kt=new Set,Ht={};function Ut(t,i){me(t,i),me(t+"Capture",i)}function me(t,i){for(Ht[t]=i,t=0;t<i.length;t++)kt.add(i[t])}var Me=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]*$"),Oe={},ot={};function Ot(t){return yn.call(ot,t)?!0:yn.call(Oe,t)?!1:Me.test(t)?ot[t]=!0:(Oe[t]=!0,!1)}function On(t,i,s){if(Ot(i))if(s===null)t.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(i);return;case"boolean":var l=i.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){t.removeAttribute(i);return}}t.setAttribute(i,""+s)}}function si(t,i,s){if(s===null)t.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttribute(i,""+s)}}function qn(t,i,s,l){if(l===null)t.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(i,s,""+l)}}function Tt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ai(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Ql(t,i,s){var l=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);if(!t.hasOwnProperty(i)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var m=l.get,w=l.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return m.call(this)},set:function(O){s=""+O,w.call(this,O)}}),Object.defineProperty(t,i,{enumerable:l.enumerable}),{getValue:function(){return s},setValue:function(O){s=""+O},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function ha(t){if(!t._valueTracker){var i=ai(t)?"checked":"value";t._valueTracker=Ql(t,i,""+t[i])}}function wo(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var s=i.getValue(),l="";return t&&(l=ai(t)?t.checked?"true":"false":t.value),t=l,t!==s?(i.setValue(t),!0):!1}function da(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 Eh=/[\n"\\]/g;function Wn(t){return t.replace(Eh,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Co(t,i,s,l,m,w,O,z){t.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?t.type=O:t.removeAttribute("type"),i!=null?O==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+Tt(i)):t.value!==""+Tt(i)&&(t.value=""+Tt(i)):O!=="submit"&&O!=="reset"||t.removeAttribute("value"),i!=null?fa(t,O,Tt(i)):s!=null?fa(t,O,Tt(s)):l!=null&&t.removeAttribute("value"),m==null&&w!=null&&(t.defaultChecked=!!w),m!=null&&(t.checked=m&&typeof m!="function"&&typeof m!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?t.name=""+Tt(z):t.removeAttribute("name")}function Ls(t,i,s,l,m,w,O,z){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(t.type=w),i!=null||s!=null){if(!(w!=="submit"&&w!=="reset"||i!=null)){ha(t);return}s=s!=null?""+Tt(s):"",i=i!=null?""+Tt(i):s,z||i===t.value||(t.value=i),t.defaultValue=i}l=l??m,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=z?t.checked:!!l,t.defaultChecked=!!l,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(t.name=O),ha(t)}function fa(t,i,s){i==="number"&&da(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function Cn(t,i,s,l){if(t=t.options,i){i={};for(var m=0;m<s.length;m++)i["$"+s[m]]=!0;for(s=0;s<t.length;s++)m=i.hasOwnProperty("$"+t[s].value),t[s].selected!==m&&(t[s].selected=m),m&&l&&(t[s].defaultSelected=!0)}else{for(s=""+Tt(s),i=null,m=0;m<t.length;m++){if(t[m].value===s){t[m].selected=!0,l&&(t[m].defaultSelected=!0);return}i!==null||t[m].disabled||(i=t[m])}i!==null&&(i.selected=!0)}}function ec(t,i,s){if(i!=null&&(i=""+Tt(i),i!==t.value&&(t.value=i),s==null)){t.defaultValue!==i&&(t.defaultValue=i);return}t.defaultValue=s!=null?""+Tt(s):""}function pa(t,i,s,l){if(i==null){if(l!=null){if(s!=null)throw Error(a(92));if(ee(l)){if(1<l.length)throw Error(a(93));l=l[0]}s=l}s==null&&(s=""),i=s}s=Tt(i),t.defaultValue=s,l=t.textContent,l===s&&l!==""&&l!==null&&(t.value=l),ha(t)}function He(t,i){if(i){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=i;return}}t.textContent=i}var tc=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 sn(t,i,s){var l=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?l?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="":l?t.setProperty(i,s):typeof s!="number"||s===0||tc.has(i)?i==="float"?t.cssFloat=s:t[i]=(""+s).trim():t[i]=s+"px"}function gt(t,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(t=t.style,s!=null){for(var l in s)!s.hasOwnProperty(l)||i!=null&&i.hasOwnProperty(l)||(l.indexOf("--")===0?t.setProperty(l,""):l==="float"?t.cssFloat="":t[l]="");for(var m in i)l=i[m],i.hasOwnProperty(m)&&s[m]!==l&&sn(t,m,l)}else for(var w in i)i.hasOwnProperty(w)&&sn(t,w,i[w])}function qr(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 pr=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"]]),xo=/^[\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 Wr(t){return xo.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function we(){}var Re=null;function We(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var tt=null,jt=null;function _i(t){var i=pe(t);if(i&&(t=i.stateNode)){var s=t[Et]||null;e:switch(t=i.stateNode,i.type){case"input":if(Co(t,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),i=s.name,s.type==="radio"&&i!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Wn(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var l=s[i];if(l!==t&&l.form===t.form){var m=l[Et]||null;if(!m)throw Error(a(90));Co(l,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(i=0;i<s.length;i++)l=s[i],l.form===t.form&&wo(l)}break e;case"textarea":ec(t,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&Cn(t,!!s.multiple,i,!1)}}}var Eo=!1;function nc(t,i,s){if(Eo)return t(i,s);Eo=!0;try{var l=t(i);return l}finally{if(Eo=!1,(tt!==null||jt!==null)&&(Fc(),tt&&(i=tt,t=jt,jt=tt=null,_i(i),t)))for(i=0;i<t.length;i++)_i(t[i])}}function To(t,i){var s=t.stateNode;if(s===null)return null;var l=s[Et]||null;if(l===null)return null;s=l[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":(l=!l.disabled)||(t=t.type,l=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!l;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var gr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Th=!1;if(gr)try{var Ao={};Object.defineProperty(Ao,"passive",{get:function(){Th=!0}}),window.addEventListener("test",Ao,Ao),window.removeEventListener("test",Ao,Ao)}catch{Th=!1}var Gr=null,Ah=null,ic=null;function Tm(){if(ic)return ic;var t,i=Ah,s=i.length,l,m="value"in Gr?Gr.value:Gr.textContent,w=m.length;for(t=0;t<s&&i[t]===m[t];t++);var O=s-t;for(l=1;l<=O&&i[s-l]===m[w-l];l++);return ic=m.slice(t,1<l?1-l:void 0)}function rc(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 sc(){return!0}function Am(){return!1}function Gn(t){function i(s,l,m,w,O){this._reactName=s,this._targetInst=m,this.type=l,this.nativeEvent=w,this.target=O,this.currentTarget=null;for(var z in t)t.hasOwnProperty(z)&&(s=t[z],this[z]=s?s(w):w[z]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?sc:Am,this.isPropagationStopped=Am,this}return g(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=sc)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=sc)},persist:function(){},isPersistent:sc}),i}var Ms={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ac=Gn(Ms),ko=g({},Ms,{view:0,detail:0}),Rx=Gn(ko),kh,Rh,Ro,oc=g({},ko,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mh,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!==Ro&&(Ro&&t.type==="mousemove"?(kh=t.screenX-Ro.screenX,Rh=t.screenY-Ro.screenY):Rh=kh=0,Ro=t),kh)},movementY:function(t){return"movementY"in t?t.movementY:Rh}}),km=Gn(oc),Lx=g({},oc,{dataTransfer:0}),Mx=Gn(Lx),Dx=g({},ko,{relatedTarget:0}),Lh=Gn(Dx),Ox=g({},Ms,{animationName:0,elapsedTime:0,pseudoElement:0}),Nx=Gn(Ox),Bx=g({},Ms,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Ix=Gn(Bx),jx=g({},Ms,{data:0}),Rm=Gn(jx),zx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$x={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"},Px={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hx(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=Px[t])?!!i[t]:!1}function Mh(){return Hx}var Ux=g({},ko,{key:function(t){if(t.key){var i=zx[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=rc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?$x[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mh,charCode:function(t){return t.type==="keypress"?rc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?rc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Fx=Gn(Ux),qx=g({},oc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Lm=Gn(qx),Wx=g({},ko,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mh}),Gx=Gn(Wx),Kx=g({},Ms,{propertyName:0,elapsedTime:0,pseudoElement:0}),Vx=Gn(Kx),Yx=g({},oc,{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}),Xx=Gn(Yx),Zx=g({},Ms,{newState:0,oldState:0}),Jx=Gn(Zx),Qx=[9,13,27,32],Dh=gr&&"CompositionEvent"in window,Lo=null;gr&&"documentMode"in document&&(Lo=document.documentMode);var e2=gr&&"TextEvent"in window&&!Lo,Mm=gr&&(!Dh||Lo&&8<Lo&&11>=Lo),Dm=" ",Om=!1;function Nm(t,i){switch(t){case"keyup":return Qx.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ga=!1;function t2(t,i){switch(t){case"compositionend":return Bm(i);case"keypress":return i.which!==32?null:(Om=!0,Dm);case"textInput":return t=i.data,t===Dm&&Om?null:t;default:return null}}function n2(t,i){if(ga)return t==="compositionend"||!Dh&&Nm(t,i)?(t=Tm(),ic=Ah=Gr=null,ga=!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 Mm&&i.locale!=="ko"?null:i.data;default:return null}}var i2={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 Im(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!i2[t.type]:i==="textarea"}function jm(t,i,s,l){tt?jt?jt.push(l):jt=[l]:tt=l,i=Xc(i,"onChange"),0<i.length&&(s=new ac("onChange","change",null,s,l),t.push({event:s,listeners:i}))}var Mo=null,Do=null;function r2(t){b0(t,0)}function lc(t){var i=xe(t);if(wo(i))return t}function zm(t,i){if(t==="change")return i}var $m=!1;if(gr){var Oh;if(gr){var Nh="oninput"in document;if(!Nh){var Pm=document.createElement("div");Pm.setAttribute("oninput","return;"),Nh=typeof Pm.oninput=="function"}Oh=Nh}else Oh=!1;$m=Oh&&(!document.documentMode||9<document.documentMode)}function Hm(){Mo&&(Mo.detachEvent("onpropertychange",Um),Do=Mo=null)}function Um(t){if(t.propertyName==="value"&&lc(Do)){var i=[];jm(i,Do,t,We(t)),nc(r2,i)}}function s2(t,i,s){t==="focusin"?(Hm(),Mo=i,Do=s,Mo.attachEvent("onpropertychange",Um)):t==="focusout"&&Hm()}function a2(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return lc(Do)}function o2(t,i){if(t==="click")return lc(i)}function l2(t,i){if(t==="input"||t==="change")return lc(i)}function c2(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var oi=typeof Object.is=="function"?Object.is:c2;function Oo(t,i){if(oi(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;var s=Object.keys(t),l=Object.keys(i);if(s.length!==l.length)return!1;for(l=0;l<s.length;l++){var m=s[l];if(!yn.call(i,m)||!oi(t[m],i[m]))return!1}return!0}function Fm(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function qm(t,i){var s=Fm(t);t=0;for(var l;s;){if(s.nodeType===3){if(l=t+s.textContent.length,t<=i&&l>=i)return{node:s,offset:i-t};t=l}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Fm(s)}}function Wm(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?Wm(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function Gm(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var i=da(t.document);i instanceof t.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)t=i.contentWindow;else break;i=da(t.document)}return i}function Bh(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 u2=gr&&"documentMode"in document&&11>=document.documentMode,ma=null,Ih=null,No=null,jh=!1;function Km(t,i,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;jh||ma==null||ma!==da(l)||(l=ma,"selectionStart"in l&&Bh(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),No&&Oo(No,l)||(No=l,l=Xc(Ih,"onSelect"),0<l.length&&(i=new ac("onSelect","select",null,i,s),t.push({event:i,listeners:l}),i.target=ma)))}function Ds(t,i){var s={};return s[t.toLowerCase()]=i.toLowerCase(),s["Webkit"+t]="webkit"+i,s["Moz"+t]="moz"+i,s}var _a={animationend:Ds("Animation","AnimationEnd"),animationiteration:Ds("Animation","AnimationIteration"),animationstart:Ds("Animation","AnimationStart"),transitionrun:Ds("Transition","TransitionRun"),transitionstart:Ds("Transition","TransitionStart"),transitioncancel:Ds("Transition","TransitionCancel"),transitionend:Ds("Transition","TransitionEnd")},zh={},Vm={};gr&&(Vm=document.createElement("div").style,"AnimationEvent"in window||(delete _a.animationend.animation,delete _a.animationiteration.animation,delete _a.animationstart.animation),"TransitionEvent"in window||delete _a.transitionend.transition);function Os(t){if(zh[t])return zh[t];if(!_a[t])return t;var i=_a[t],s;for(s in i)if(i.hasOwnProperty(s)&&s in Vm)return zh[t]=i[s];return t}var Ym=Os("animationend"),Xm=Os("animationiteration"),Zm=Os("animationstart"),h2=Os("transitionrun"),d2=Os("transitionstart"),f2=Os("transitioncancel"),Jm=Os("transitionend"),Qm=new Map,$h="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(" ");$h.push("scrollEnd");function zi(t,i){Qm.set(t,i),Ut(i,[t])}var cc=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)},vi=[],va=0,Ph=0;function uc(){for(var t=va,i=Ph=va=0;i<t;){var s=vi[i];vi[i++]=null;var l=vi[i];vi[i++]=null;var m=vi[i];vi[i++]=null;var w=vi[i];if(vi[i++]=null,l!==null&&m!==null){var O=l.pending;O===null?m.next=m:(m.next=O.next,O.next=m),l.pending=m}w!==0&&e_(s,m,w)}}function hc(t,i,s,l){vi[va++]=t,vi[va++]=i,vi[va++]=s,vi[va++]=l,Ph|=l,t.lanes|=l,t=t.alternate,t!==null&&(t.lanes|=l)}function Hh(t,i,s,l){return hc(t,i,s,l),dc(t)}function Ns(t,i){return hc(t,null,null,i),dc(t)}function e_(t,i,s){t.lanes|=s;var l=t.alternate;l!==null&&(l.lanes|=s);for(var m=!1,w=t.return;w!==null;)w.childLanes|=s,l=w.alternate,l!==null&&(l.childLanes|=s),w.tag===22&&(t=w.stateNode,t===null||t._visibility&1||(m=!0)),t=w,w=w.return;return t.tag===3?(w=t.stateNode,m&&i!==null&&(m=31-Pt(s),t=w.hiddenUpdates,l=t[m],l===null?t[m]=[i]:l.push(i),i.lane=s|536870912),w):null}function dc(t){if(50<nl)throw nl=0,Xd=null,Error(a(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var ba={};function p2(t,i,s,l){this.tag=t,this.key=s,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=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function li(t,i,s,l){return new p2(t,i,s,l)}function Uh(t){return t=t.prototype,!(!t||!t.isReactComponent)}function mr(t,i){var s=t.alternate;return s===null?(s=li(t.tag,i,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=i,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&65011712,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,i=t.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s.refCleanup=t.refCleanup,s}function t_(t,i){t.flags&=65011714;var s=t.alternate;return s===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=s.childLanes,t.lanes=s.lanes,t.child=s.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=s.memoizedProps,t.memoizedState=s.memoizedState,t.updateQueue=s.updateQueue,t.type=s.type,i=s.dependencies,t.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),t}function fc(t,i,s,l,m,w){var O=0;if(l=t,typeof t=="function")Uh(t)&&(O=1);else if(typeof t=="string")O=bE(t,s,ae.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case B:return t=li(31,s,i,m),t.elementType=B,t.lanes=w,t;case x:return Bs(s.children,m,w,i);case p:O=8,m|=24;break;case v:return t=li(12,s,i,m|2),t.elementType=v,t.lanes=w,t;case R:return t=li(13,s,i,m),t.elementType=R,t.lanes=w,t;case L:return t=li(19,s,i,m),t.elementType=L,t.lanes=w,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case b:O=10;break e;case h:O=9;break e;case T:O=11;break e;case M:O=14;break e;case k:O=16,l=null;break e}O=29,s=Error(a(130,t===null?"null":typeof t,"")),l=null}return i=li(O,s,i,m),i.elementType=t,i.type=l,i.lanes=w,i}function Bs(t,i,s,l){return t=li(7,t,l,i),t.lanes=s,t}function Fh(t,i,s){return t=li(6,t,null,i),t.lanes=s,t}function n_(t){var i=li(18,null,null,0);return i.stateNode=t,i}function qh(t,i,s){return i=li(4,t.children!==null?t.children:[],t.key,i),i.lanes=s,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}var i_=new WeakMap;function bi(t,i){if(typeof t=="object"&&t!==null){var s=i_.get(t);return s!==void 0?s:(i={value:t,source:i,stack:en(i)},i_.set(t,i),i)}return{value:t,source:i,stack:en(i)}}var ya=[],Sa=0,pc=null,Bo=0,yi=[],Si=0,Kr=null,Xi=1,Zi="";function _r(t,i){ya[Sa++]=Bo,ya[Sa++]=pc,pc=t,Bo=i}function r_(t,i,s){yi[Si++]=Xi,yi[Si++]=Zi,yi[Si++]=Kr,Kr=t;var l=Xi;t=Zi;var m=32-Pt(l)-1;l&=~(1<<m),s+=1;var w=32-Pt(i)+m;if(30<w){var O=m-m%5;w=(l&(1<<O)-1).toString(32),l>>=O,m-=O,Xi=1<<32-Pt(i)+m|s<<m|l,Zi=w+t}else Xi=1<<w|s<<m|l,Zi=t}function Wh(t){t.return!==null&&(_r(t,1),r_(t,1,0))}function Gh(t){for(;t===pc;)pc=ya[--Sa],ya[Sa]=null,Bo=ya[--Sa],ya[Sa]=null;for(;t===Kr;)Kr=yi[--Si],yi[Si]=null,Zi=yi[--Si],yi[Si]=null,Xi=yi[--Si],yi[Si]=null}function s_(t,i){yi[Si++]=Xi,yi[Si++]=Zi,yi[Si++]=Kr,Xi=i.id,Zi=i.overflow,Kr=t}var xn=null,Rt=null,at=!1,Vr=null,wi=!1,Kh=Error(a(519));function Yr(t){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Io(bi(i,t)),Kh}function a_(t){var i=t.stateNode,s=t.type,l=t.memoizedProps;switch(i[At]=t,i[Et]=l,s){case"dialog":Qe("cancel",i),Qe("close",i);break;case"iframe":case"object":case"embed":Qe("load",i);break;case"video":case"audio":for(s=0;s<rl.length;s++)Qe(rl[s],i);break;case"source":Qe("error",i);break;case"img":case"image":case"link":Qe("error",i),Qe("load",i);break;case"details":Qe("toggle",i);break;case"input":Qe("invalid",i),Ls(i,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Qe("invalid",i);break;case"textarea":Qe("invalid",i),pa(i,l.value,l.defaultValue,l.children)}s=l.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||l.suppressHydrationWarning===!0||C0(i.textContent,s)?(l.popover!=null&&(Qe("beforetoggle",i),Qe("toggle",i)),l.onScroll!=null&&Qe("scroll",i),l.onScrollEnd!=null&&Qe("scrollend",i),l.onClick!=null&&(i.onclick=we),i=!0):i=!1,i||Yr(t,!0)}function o_(t){for(xn=t.return;xn;)switch(xn.tag){case 5:case 31:case 13:wi=!1;return;case 27:case 3:wi=!0;return;default:xn=xn.return}}function wa(t){if(t!==xn)return!1;if(!at)return o_(t),at=!0,!1;var i=t.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||df(t.type,t.memoizedProps)),s=!s),s&&Rt&&Yr(t),o_(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));Rt=D0(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));Rt=D0(t)}else i===27?(i=Rt,cs(t.type)?(t=_f,_f=null,Rt=t):Rt=i):Rt=xn?xi(t.stateNode.nextSibling):null;return!0}function Is(){Rt=xn=null,at=!1}function Vh(){var t=Vr;return t!==null&&(Xn===null?Xn=t:Xn.push.apply(Xn,t),Vr=null),t}function Io(t){Vr===null?Vr=[t]:Vr.push(t)}var Yh=N(null),js=null,vr=null;function Xr(t,i,s){Z(Yh,i._currentValue),i._currentValue=s}function br(t){t._currentValue=Yh.current,P(Yh)}function Xh(t,i,s){for(;t!==null;){var l=t.alternate;if((t.childLanes&i)!==i?(t.childLanes|=i,l!==null&&(l.childLanes|=i)):l!==null&&(l.childLanes&i)!==i&&(l.childLanes|=i),t===s)break;t=t.return}}function Zh(t,i,s,l){var m=t.child;for(m!==null&&(m.return=t);m!==null;){var w=m.dependencies;if(w!==null){var O=m.child;w=w.firstContext;e:for(;w!==null;){var z=w;w=m;for(var X=0;X<i.length;X++)if(z.context===i[X]){w.lanes|=s,z=w.alternate,z!==null&&(z.lanes|=s),Xh(w.return,s,t),l||(O=null);break e}w=z.next}}else if(m.tag===18){if(O=m.return,O===null)throw Error(a(341));O.lanes|=s,w=O.alternate,w!==null&&(w.lanes|=s),Xh(O,s,t),O=null}else O=m.child;if(O!==null)O.return=m;else for(O=m;O!==null;){if(O===t){O=null;break}if(m=O.sibling,m!==null){m.return=O.return,O=m;break}O=O.return}m=O}}function Ca(t,i,s,l){t=null;for(var m=i,w=!1;m!==null;){if(!w){if((m.flags&524288)!==0)w=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var O=m.alternate;if(O===null)throw Error(a(387));if(O=O.memoizedProps,O!==null){var z=m.type;oi(m.pendingProps.value,O.value)||(t!==null?t.push(z):t=[z])}}else if(m===Q.current){if(O=m.alternate,O===null)throw Error(a(387));O.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(t!==null?t.push(cl):t=[cl])}m=m.return}t!==null&&Zh(i,t,s,l),i.flags|=262144}function gc(t){for(t=t.firstContext;t!==null;){if(!oi(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function zs(t){js=t,vr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function En(t){return l_(js,t)}function mc(t,i){return js===null&&zs(t),l_(t,i)}function l_(t,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},vr===null){if(t===null)throw Error(a(308));vr=i,t.dependencies={lanes:0,firstContext:i},t.flags|=524288}else vr=vr.next=i;return s}var g2=typeof AbortController<"u"?AbortController:function(){var t=[],i=this.signal={aborted:!1,addEventListener:function(s,l){t.push(l)}};this.abort=function(){i.aborted=!0,t.forEach(function(s){return s()})}},m2=e.unstable_scheduleCallback,_2=e.unstable_NormalPriority,an={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Jh(){return{controller:new g2,data:new Map,refCount:0}}function jo(t){t.refCount--,t.refCount===0&&m2(_2,function(){t.controller.abort()})}var zo=null,Qh=0,xa=0,Ea=null;function v2(t,i){if(zo===null){var s=zo=[];Qh=0,xa=nf(),Ea={status:"pending",value:void 0,then:function(l){s.push(l)}}}return Qh++,i.then(c_,c_),i}function c_(){if(--Qh===0&&zo!==null){Ea!==null&&(Ea.status="fulfilled");var t=zo;zo=null,xa=0,Ea=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function b2(t,i){var s=[],l={status:"pending",value:null,reason:null,then:function(m){s.push(m)}};return t.then(function(){l.status="fulfilled",l.value=i;for(var m=0;m<s.length;m++)(0,s[m])(i)},function(m){for(l.status="rejected",l.reason=m,m=0;m<s.length;m++)(0,s[m])(void 0)}),l}var u_=q.S;q.S=function(t,i){Kv=ht(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&v2(t,i),u_!==null&&u_(t,i)};var $s=N(null);function ed(){var t=$s.current;return t!==null?t:Ct.pooledCache}function _c(t,i){i===null?Z($s,$s.current):Z($s,i.pool)}function h_(){var t=ed();return t===null?null:{parent:an._currentValue,pool:t}}var Ta=Error(a(460)),td=Error(a(474)),vc=Error(a(542)),bc={then:function(){}};function d_(t){return t=t.status,t==="fulfilled"||t==="rejected"}function f_(t,i,s){switch(s=t[s],s===void 0?t.push(i):s!==i&&(i.then(we,we),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,g_(t),t;default:if(typeof i.status=="string")i.then(we,we);else{if(t=Ct,t!==null&&100<t.shellSuspendCounter)throw Error(a(482));t=i,t.status="pending",t.then(function(l){if(i.status==="pending"){var m=i;m.status="fulfilled",m.value=l}},function(l){if(i.status==="pending"){var m=i;m.status="rejected",m.reason=l}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,g_(t),t}throw Hs=i,Ta}}function Ps(t){try{var i=t._init;return i(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Hs=s,Ta):s}}var Hs=null;function p_(){if(Hs===null)throw Error(a(459));var t=Hs;return Hs=null,t}function g_(t){if(t===Ta||t===vc)throw Error(a(483))}var Aa=null,$o=0;function yc(t){var i=$o;return $o+=1,Aa===null&&(Aa=[]),f_(Aa,t,i)}function Po(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function Sc(t,i){throw i.$$typeof===C?Error(a(525)):(t=Object.prototype.toString.call(i),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t)))}function m_(t){function i(ne,te){if(t){var ie=ne.deletions;ie===null?(ne.deletions=[te],ne.flags|=16):ie.push(te)}}function s(ne,te){if(!t)return null;for(;te!==null;)i(ne,te),te=te.sibling;return null}function l(ne){for(var te=new Map;ne!==null;)ne.key!==null?te.set(ne.key,ne):te.set(ne.index,ne),ne=ne.sibling;return te}function m(ne,te){return ne=mr(ne,te),ne.index=0,ne.sibling=null,ne}function w(ne,te,ie){return ne.index=ie,t?(ie=ne.alternate,ie!==null?(ie=ie.index,ie<te?(ne.flags|=67108866,te):ie):(ne.flags|=67108866,te)):(ne.flags|=1048576,te)}function O(ne){return t&&ne.alternate===null&&(ne.flags|=67108866),ne}function z(ne,te,ie,de){return te===null||te.tag!==6?(te=Fh(ie,ne.mode,de),te.return=ne,te):(te=m(te,ie),te.return=ne,te)}function X(ne,te,ie,de){var Be=ie.type;return Be===x?ue(ne,te,ie.props.children,de,ie.key):te!==null&&(te.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===k&&Ps(Be)===te.type)?(te=m(te,ie.props),Po(te,ie),te.return=ne,te):(te=fc(ie.type,ie.key,ie.props,null,ne.mode,de),Po(te,ie),te.return=ne,te)}function re(ne,te,ie,de){return te===null||te.tag!==4||te.stateNode.containerInfo!==ie.containerInfo||te.stateNode.implementation!==ie.implementation?(te=qh(ie,ne.mode,de),te.return=ne,te):(te=m(te,ie.children||[]),te.return=ne,te)}function ue(ne,te,ie,de,Be){return te===null||te.tag!==7?(te=Bs(ie,ne.mode,de,Be),te.return=ne,te):(te=m(te,ie),te.return=ne,te)}function fe(ne,te,ie){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Fh(""+te,ne.mode,ie),te.return=ne,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case E:return ie=fc(te.type,te.key,te.props,null,ne.mode,ie),Po(ie,te),ie.return=ne,ie;case A:return te=qh(te,ne.mode,ie),te.return=ne,te;case k:return te=Ps(te),fe(ne,te,ie)}if(ee(te)||W(te))return te=Bs(te,ne.mode,ie,null),te.return=ne,te;if(typeof te.then=="function")return fe(ne,yc(te),ie);if(te.$$typeof===b)return fe(ne,mc(ne,te),ie);Sc(ne,te)}return null}function se(ne,te,ie,de){var Be=te!==null?te.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return Be!==null?null:z(ne,te,""+ie,de);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case E:return ie.key===Be?X(ne,te,ie,de):null;case A:return ie.key===Be?re(ne,te,ie,de):null;case k:return ie=Ps(ie),se(ne,te,ie,de)}if(ee(ie)||W(ie))return Be!==null?null:ue(ne,te,ie,de,null);if(typeof ie.then=="function")return se(ne,te,yc(ie),de);if(ie.$$typeof===b)return se(ne,te,mc(ne,ie),de);Sc(ne,ie)}return null}function le(ne,te,ie,de,Be){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return ne=ne.get(ie)||null,z(te,ne,""+de,Be);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case E:return ne=ne.get(de.key===null?ie:de.key)||null,X(te,ne,de,Be);case A:return ne=ne.get(de.key===null?ie:de.key)||null,re(te,ne,de,Be);case k:return de=Ps(de),le(ne,te,ie,de,Be)}if(ee(de)||W(de))return ne=ne.get(ie)||null,ue(te,ne,de,Be,null);if(typeof de.then=="function")return le(ne,te,ie,yc(de),Be);if(de.$$typeof===b)return le(ne,te,ie,mc(te,de),Be);Sc(te,de)}return null}function Ae(ne,te,ie,de){for(var Be=null,lt=null,Le=te,Ke=te=0,it=null;Le!==null&&Ke<ie.length;Ke++){Le.index>Ke?(it=Le,Le=null):it=Le.sibling;var ct=se(ne,Le,ie[Ke],de);if(ct===null){Le===null&&(Le=it);break}t&&Le&&ct.alternate===null&&i(ne,Le),te=w(ct,te,Ke),lt===null?Be=ct:lt.sibling=ct,lt=ct,Le=it}if(Ke===ie.length)return s(ne,Le),at&&_r(ne,Ke),Be;if(Le===null){for(;Ke<ie.length;Ke++)Le=fe(ne,ie[Ke],de),Le!==null&&(te=w(Le,te,Ke),lt===null?Be=Le:lt.sibling=Le,lt=Le);return at&&_r(ne,Ke),Be}for(Le=l(Le);Ke<ie.length;Ke++)it=le(Le,ne,Ke,ie[Ke],de),it!==null&&(t&&it.alternate!==null&&Le.delete(it.key===null?Ke:it.key),te=w(it,te,Ke),lt===null?Be=it:lt.sibling=it,lt=it);return t&&Le.forEach(function(ps){return i(ne,ps)}),at&&_r(ne,Ke),Be}function ze(ne,te,ie,de){if(ie==null)throw Error(a(151));for(var Be=null,lt=null,Le=te,Ke=te=0,it=null,ct=ie.next();Le!==null&&!ct.done;Ke++,ct=ie.next()){Le.index>Ke?(it=Le,Le=null):it=Le.sibling;var ps=se(ne,Le,ct.value,de);if(ps===null){Le===null&&(Le=it);break}t&&Le&&ps.alternate===null&&i(ne,Le),te=w(ps,te,Ke),lt===null?Be=ps:lt.sibling=ps,lt=ps,Le=it}if(ct.done)return s(ne,Le),at&&_r(ne,Ke),Be;if(Le===null){for(;!ct.done;Ke++,ct=ie.next())ct=fe(ne,ct.value,de),ct!==null&&(te=w(ct,te,Ke),lt===null?Be=ct:lt.sibling=ct,lt=ct);return at&&_r(ne,Ke),Be}for(Le=l(Le);!ct.done;Ke++,ct=ie.next())ct=le(Le,ne,Ke,ct.value,de),ct!==null&&(t&&ct.alternate!==null&&Le.delete(ct.key===null?Ke:ct.key),te=w(ct,te,Ke),lt===null?Be=ct:lt.sibling=ct,lt=ct);return t&&Le.forEach(function(LE){return i(ne,LE)}),at&&_r(ne,Ke),Be}function yt(ne,te,ie,de){if(typeof ie=="object"&&ie!==null&&ie.type===x&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case E:e:{for(var Be=ie.key;te!==null;){if(te.key===Be){if(Be=ie.type,Be===x){if(te.tag===7){s(ne,te.sibling),de=m(te,ie.props.children),de.return=ne,ne=de;break e}}else if(te.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===k&&Ps(Be)===te.type){s(ne,te.sibling),de=m(te,ie.props),Po(de,ie),de.return=ne,ne=de;break e}s(ne,te);break}else i(ne,te);te=te.sibling}ie.type===x?(de=Bs(ie.props.children,ne.mode,de,ie.key),de.return=ne,ne=de):(de=fc(ie.type,ie.key,ie.props,null,ne.mode,de),Po(de,ie),de.return=ne,ne=de)}return O(ne);case A:e:{for(Be=ie.key;te!==null;){if(te.key===Be)if(te.tag===4&&te.stateNode.containerInfo===ie.containerInfo&&te.stateNode.implementation===ie.implementation){s(ne,te.sibling),de=m(te,ie.children||[]),de.return=ne,ne=de;break e}else{s(ne,te);break}else i(ne,te);te=te.sibling}de=qh(ie,ne.mode,de),de.return=ne,ne=de}return O(ne);case k:return ie=Ps(ie),yt(ne,te,ie,de)}if(ee(ie))return Ae(ne,te,ie,de);if(W(ie)){if(Be=W(ie),typeof Be!="function")throw Error(a(150));return ie=Be.call(ie),ze(ne,te,ie,de)}if(typeof ie.then=="function")return yt(ne,te,yc(ie),de);if(ie.$$typeof===b)return yt(ne,te,mc(ne,ie),de);Sc(ne,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,te!==null&&te.tag===6?(s(ne,te.sibling),de=m(te,ie),de.return=ne,ne=de):(s(ne,te),de=Fh(ie,ne.mode,de),de.return=ne,ne=de),O(ne)):s(ne,te)}return function(ne,te,ie,de){try{$o=0;var Be=yt(ne,te,ie,de);return Aa=null,Be}catch(Le){if(Le===Ta||Le===vc)throw Le;var lt=li(29,Le,null,ne.mode);return lt.lanes=de,lt.return=ne,lt}}}var Us=m_(!0),__=m_(!1),Zr=!1;function nd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function id(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 Jr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Qr(t,i,s){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(dt&2)!==0){var m=l.pending;return m===null?i.next=i:(i.next=m.next,m.next=i),l.pending=i,i=dc(t),e_(t,null,s),i}return hc(t,l,i,s),dc(t)}function Ho(t,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var l=i.lanes;l&=t.pendingLanes,s|=l,i.lanes=s,je(t,s)}}function rd(t,i){var s=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,s===l)){var m=null,w=null;if(s=s.firstBaseUpdate,s!==null){do{var O={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};w===null?m=w=O:w=w.next=O,s=s.next}while(s!==null);w===null?m=w=i:w=w.next=i}else m=w=i;s={baseState:l.baseState,firstBaseUpdate:m,lastBaseUpdate:w,shared:l.shared,callbacks:l.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=i:t.next=i,s.lastBaseUpdate=i}var sd=!1;function Uo(){if(sd){var t=Ea;if(t!==null)throw t}}function Fo(t,i,s,l){sd=!1;var m=t.updateQueue;Zr=!1;var w=m.firstBaseUpdate,O=m.lastBaseUpdate,z=m.shared.pending;if(z!==null){m.shared.pending=null;var X=z,re=X.next;X.next=null,O===null?w=re:O.next=re,O=X;var ue=t.alternate;ue!==null&&(ue=ue.updateQueue,z=ue.lastBaseUpdate,z!==O&&(z===null?ue.firstBaseUpdate=re:z.next=re,ue.lastBaseUpdate=X))}if(w!==null){var fe=m.baseState;O=0,ue=re=X=null,z=w;do{var se=z.lane&-536870913,le=se!==z.lane;if(le?(nt&se)===se:(l&se)===se){se!==0&&se===xa&&(sd=!0),ue!==null&&(ue=ue.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var Ae=t,ze=z;se=i;var yt=s;switch(ze.tag){case 1:if(Ae=ze.payload,typeof Ae=="function"){fe=Ae.call(yt,fe,se);break e}fe=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=ze.payload,se=typeof Ae=="function"?Ae.call(yt,fe,se):Ae,se==null)break e;fe=g({},fe,se);break e;case 2:Zr=!0}}se=z.callback,se!==null&&(t.flags|=64,le&&(t.flags|=8192),le=m.callbacks,le===null?m.callbacks=[se]:le.push(se))}else le={lane:se,tag:z.tag,payload:z.payload,callback:z.callback,next:null},ue===null?(re=ue=le,X=fe):ue=ue.next=le,O|=se;if(z=z.next,z===null){if(z=m.shared.pending,z===null)break;le=z,z=le.next,le.next=null,m.lastBaseUpdate=le,m.shared.pending=null}}while(!0);ue===null&&(X=fe),m.baseState=X,m.firstBaseUpdate=re,m.lastBaseUpdate=ue,w===null&&(m.shared.lanes=0),rs|=O,t.lanes=O,t.memoizedState=fe}}function v_(t,i){if(typeof t!="function")throw Error(a(191,t));t.call(i)}function b_(t,i){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)v_(s[t],i)}var ka=N(null),wc=N(0);function y_(t,i){t=kr,Z(wc,t),Z(ka,i),kr=t|i.baseLanes}function ad(){Z(wc,kr),Z(ka,ka.current)}function od(){kr=wc.current,P(ka),P(wc)}var ci=N(null),Ci=null;function es(t){var i=t.alternate;Z(Zt,Zt.current&1),Z(ci,t),Ci===null&&(i===null||ka.current!==null||i.memoizedState!==null)&&(Ci=t)}function ld(t){Z(Zt,Zt.current),Z(ci,t),Ci===null&&(Ci=t)}function S_(t){t.tag===22?(Z(Zt,Zt.current),Z(ci,t),Ci===null&&(Ci=t)):ts()}function ts(){Z(Zt,Zt.current),Z(ci,ci.current)}function ui(t){P(ci),Ci===t&&(Ci=null),P(Zt)}var Zt=N(0);function Cc(t){for(var i=t;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||gf(s)||mf(s)))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 yr=0,Ge=null,vt=null,on=null,xc=!1,Ra=!1,Fs=!1,Ec=0,qo=0,La=null,y2=0;function Ft(){throw Error(a(321))}function cd(t,i){if(i===null)return!1;for(var s=0;s<i.length&&s<t.length;s++)if(!oi(t[s],i[s]))return!1;return!0}function ud(t,i,s,l,m,w){return yr=w,Ge=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,q.H=t===null||t.memoizedState===null?rv:Ed,Fs=!1,w=s(l,m),Fs=!1,Ra&&(w=C_(i,s,l,m)),w_(t),w}function w_(t){q.H=Ko;var i=vt!==null&&vt.next!==null;if(yr=0,on=vt=Ge=null,xc=!1,qo=0,La=null,i)throw Error(a(300));t===null||ln||(t=t.dependencies,t!==null&&gc(t)&&(ln=!0))}function C_(t,i,s,l){Ge=t;var m=0;do{if(Ra&&(La=null),qo=0,Ra=!1,25<=m)throw Error(a(301));if(m+=1,on=vt=null,t.updateQueue!=null){var w=t.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}q.H=sv,w=i(s,l)}while(Ra);return w}function S2(){var t=q.H,i=t.useState()[0];return i=typeof i.then=="function"?Wo(i):i,t=t.useState()[0],(vt!==null?vt.memoizedState:null)!==t&&(Ge.flags|=1024),i}function hd(){var t=Ec!==0;return Ec=0,t}function dd(t,i,s){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~s}function fd(t){if(xc){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}xc=!1}yr=0,on=vt=Ge=null,Ra=!1,qo=Ec=0,La=null}function In(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return on===null?Ge.memoizedState=on=t:on=on.next=t,on}function Jt(){if(vt===null){var t=Ge.alternate;t=t!==null?t.memoizedState:null}else t=vt.next;var i=on===null?Ge.memoizedState:on.next;if(i!==null)on=i,vt=t;else{if(t===null)throw Ge.alternate===null?Error(a(467)):Error(a(310));vt=t,t={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},on===null?Ge.memoizedState=on=t:on=on.next=t}return on}function Tc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Wo(t){var i=qo;return qo+=1,La===null&&(La=[]),t=f_(La,t,i),i=Ge,(on===null?i.memoizedState:on.next)===null&&(i=i.alternate,q.H=i===null||i.memoizedState===null?rv:Ed),t}function Ac(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Wo(t);if(t.$$typeof===b)return En(t)}throw Error(a(438,String(t)))}function pd(t){var i=null,s=Ge.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var l=Ge.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(i={data:l.data.map(function(m){return m.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=Tc(),Ge.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(t),l=0;l<t;l++)s[l]=F;return i.index++,s}function Sr(t,i){return typeof i=="function"?i(t):i}function kc(t){var i=Jt();return gd(i,vt,t)}function gd(t,i,s){var l=t.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=s;var m=t.baseQueue,w=l.pending;if(w!==null){if(m!==null){var O=m.next;m.next=w.next,w.next=O}i.baseQueue=m=w,l.pending=null}if(w=t.baseState,m===null)t.memoizedState=w;else{i=m.next;var z=O=null,X=null,re=i,ue=!1;do{var fe=re.lane&-536870913;if(fe!==re.lane?(nt&fe)===fe:(yr&fe)===fe){var se=re.revertLane;if(se===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),fe===xa&&(ue=!0);else if((yr&se)===se){re=re.next,se===xa&&(ue=!0);continue}else fe={lane:0,revertLane:re.revertLane,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},X===null?(z=X=fe,O=w):X=X.next=fe,Ge.lanes|=se,rs|=se;fe=re.action,Fs&&s(w,fe),w=re.hasEagerState?re.eagerState:s(w,fe)}else se={lane:fe,revertLane:re.revertLane,gesture:re.gesture,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},X===null?(z=X=se,O=w):X=X.next=se,Ge.lanes|=fe,rs|=fe;re=re.next}while(re!==null&&re!==i);if(X===null?O=w:X.next=z,!oi(w,t.memoizedState)&&(ln=!0,ue&&(s=Ea,s!==null)))throw s;t.memoizedState=w,t.baseState=O,t.baseQueue=X,l.lastRenderedState=w}return m===null&&(l.lanes=0),[t.memoizedState,l.dispatch]}function md(t){var i=Jt(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=t;var l=s.dispatch,m=s.pending,w=i.memoizedState;if(m!==null){s.pending=null;var O=m=m.next;do w=t(w,O.action),O=O.next;while(O!==m);oi(w,i.memoizedState)||(ln=!0),i.memoizedState=w,i.baseQueue===null&&(i.baseState=w),s.lastRenderedState=w}return[w,l]}function x_(t,i,s){var l=Ge,m=Jt(),w=at;if(w){if(s===void 0)throw Error(a(407));s=s()}else s=i();var O=!oi((vt||m).memoizedState,s);if(O&&(m.memoizedState=s,ln=!0),m=m.queue,bd(A_.bind(null,l,m,t),[t]),m.getSnapshot!==i||O||on!==null&&on.memoizedState.tag&1){if(l.flags|=2048,Ma(9,{destroy:void 0},T_.bind(null,l,m,s,i),null),Ct===null)throw Error(a(349));w||(yr&127)!==0||E_(l,i,s)}return s}function E_(t,i,s){t.flags|=16384,t={getSnapshot:i,value:s},i=Ge.updateQueue,i===null?(i=Tc(),Ge.updateQueue=i,i.stores=[t]):(s=i.stores,s===null?i.stores=[t]:s.push(t))}function T_(t,i,s,l){i.value=s,i.getSnapshot=l,k_(i)&&R_(t)}function A_(t,i,s){return s(function(){k_(i)&&R_(t)})}function k_(t){var i=t.getSnapshot;t=t.value;try{var s=i();return!oi(t,s)}catch{return!0}}function R_(t){var i=Ns(t,2);i!==null&&Zn(i,t,2)}function _d(t){var i=In();if(typeof t=="function"){var s=t;if(t=s(),Fs){Xt(!0);try{s()}finally{Xt(!1)}}}return i.memoizedState=i.baseState=t,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sr,lastRenderedState:t},i}function L_(t,i,s,l){return t.baseState=s,gd(t,vt,typeof l=="function"?l:Sr)}function w2(t,i,s,l,m){if(Mc(t))throw Error(a(485));if(t=i.action,t!==null){var w={payload:m,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){w.listeners.push(O)}};q.T!==null?s(!0):w.isTransition=!1,l(w),s=i.pending,s===null?(w.next=i.pending=w,M_(i,w)):(w.next=s.next,i.pending=s.next=w)}}function M_(t,i){var s=i.action,l=i.payload,m=t.state;if(i.isTransition){var w=q.T,O={};q.T=O;try{var z=s(m,l),X=q.S;X!==null&&X(O,z),D_(t,i,z)}catch(re){vd(t,i,re)}finally{w!==null&&O.types!==null&&(w.types=O.types),q.T=w}}else try{w=s(m,l),D_(t,i,w)}catch(re){vd(t,i,re)}}function D_(t,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(l){O_(t,i,l)},function(l){return vd(t,i,l)}):O_(t,i,s)}function O_(t,i,s){i.status="fulfilled",i.value=s,N_(i),t.state=s,i=t.pending,i!==null&&(s=i.next,s===i?t.pending=null:(s=s.next,i.next=s,M_(t,s)))}function vd(t,i,s){var l=t.pending;if(t.pending=null,l!==null){l=l.next;do i.status="rejected",i.reason=s,N_(i),i=i.next;while(i!==l)}t.action=null}function N_(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function B_(t,i){return i}function I_(t,i){if(at){var s=Ct.formState;if(s!==null){e:{var l=Ge;if(at){if(Rt){t:{for(var m=Rt,w=wi;m.nodeType!==8;){if(!w){m=null;break t}if(m=xi(m.nextSibling),m===null){m=null;break t}}w=m.data,m=w==="F!"||w==="F"?m:null}if(m){Rt=xi(m.nextSibling),l=m.data==="F!";break e}}Yr(l)}l=!1}l&&(i=s[0])}}return s=In(),s.memoizedState=s.baseState=i,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:B_,lastRenderedState:i},s.queue=l,s=tv.bind(null,Ge,l),l.dispatch=s,l=_d(!1),w=xd.bind(null,Ge,!1,l.queue),l=In(),m={state:i,dispatch:null,action:t,pending:null},l.queue=m,s=w2.bind(null,Ge,m,w,s),m.dispatch=s,l.memoizedState=t,[i,s,!1]}function j_(t){var i=Jt();return z_(i,vt,t)}function z_(t,i,s){if(i=gd(t,i,B_)[0],t=kc(Sr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var l=Wo(i)}catch(O){throw O===Ta?vc:O}else l=i;i=Jt();var m=i.queue,w=m.dispatch;return s!==i.memoizedState&&(Ge.flags|=2048,Ma(9,{destroy:void 0},C2.bind(null,m,s),null)),[l,w,t]}function C2(t,i){t.action=i}function $_(t){var i=Jt(),s=vt;if(s!==null)return z_(i,s,t);Jt(),i=i.memoizedState,s=Jt();var l=s.queue.dispatch;return s.memoizedState=t,[i,l,!1]}function Ma(t,i,s,l){return t={tag:t,create:s,deps:l,inst:i,next:null},i=Ge.updateQueue,i===null&&(i=Tc(),Ge.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=t.next=t:(l=s.next,s.next=t,t.next=l,i.lastEffect=t),t}function P_(){return Jt().memoizedState}function Rc(t,i,s,l){var m=In();Ge.flags|=t,m.memoizedState=Ma(1|i,{destroy:void 0},s,l===void 0?null:l)}function Lc(t,i,s,l){var m=Jt();l=l===void 0?null:l;var w=m.memoizedState.inst;vt!==null&&l!==null&&cd(l,vt.memoizedState.deps)?m.memoizedState=Ma(i,w,s,l):(Ge.flags|=t,m.memoizedState=Ma(1|i,w,s,l))}function H_(t,i){Rc(8390656,8,t,i)}function bd(t,i){Lc(2048,8,t,i)}function x2(t){Ge.flags|=4;var i=Ge.updateQueue;if(i===null)i=Tc(),Ge.updateQueue=i,i.events=[t];else{var s=i.events;s===null?i.events=[t]:s.push(t)}}function U_(t){var i=Jt().memoizedState;return x2({ref:i,nextImpl:t}),function(){if((dt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function F_(t,i){return Lc(4,2,t,i)}function q_(t,i){return Lc(4,4,t,i)}function W_(t,i){if(typeof i=="function"){t=t();var s=i(t);return function(){typeof s=="function"?s():i(null)}}if(i!=null)return t=t(),i.current=t,function(){i.current=null}}function G_(t,i,s){s=s!=null?s.concat([t]):null,Lc(4,4,W_.bind(null,i,t),s)}function yd(){}function K_(t,i){var s=Jt();i=i===void 0?null:i;var l=s.memoizedState;return i!==null&&cd(i,l[1])?l[0]:(s.memoizedState=[t,i],t)}function V_(t,i){var s=Jt();i=i===void 0?null:i;var l=s.memoizedState;if(i!==null&&cd(i,l[1]))return l[0];if(l=t(),Fs){Xt(!0);try{t()}finally{Xt(!1)}}return s.memoizedState=[l,i],l}function Sd(t,i,s){return s===void 0||(yr&1073741824)!==0&&(nt&261930)===0?t.memoizedState=i:(t.memoizedState=s,t=Yv(),Ge.lanes|=t,rs|=t,s)}function Y_(t,i,s,l){return oi(s,i)?s:ka.current!==null?(t=Sd(t,s,l),oi(t,i)||(ln=!0),t):(yr&42)===0||(yr&1073741824)!==0&&(nt&261930)===0?(ln=!0,t.memoizedState=s):(t=Yv(),Ge.lanes|=t,rs|=t,i)}function X_(t,i,s,l,m){var w=V.p;V.p=w!==0&&8>w?w:8;var O=q.T,z={};q.T=z,xd(t,!1,i,s);try{var X=m(),re=q.S;if(re!==null&&re(z,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var ue=b2(X,l);Go(t,i,ue,fi(t))}else Go(t,i,l,fi(t))}catch(fe){Go(t,i,{then:function(){},status:"rejected",reason:fe},fi())}finally{V.p=w,O!==null&&z.types!==null&&(O.types=z.types),q.T=O}}function E2(){}function wd(t,i,s,l){if(t.tag!==5)throw Error(a(476));var m=Z_(t).queue;X_(t,m,i,Y,s===null?E2:function(){return J_(t),s(l)})}function Z_(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sr,lastRenderedState:Y},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sr,lastRenderedState:s},next:null},t.memoizedState=i,t=t.alternate,t!==null&&(t.memoizedState=i),i}function J_(t){var i=Z_(t);i.next===null&&(i=t.alternate.memoizedState),Go(t,i.next.queue,{},fi())}function Cd(){return En(cl)}function Q_(){return Jt().memoizedState}function ev(){return Jt().memoizedState}function T2(t){for(var i=t.return;i!==null;){switch(i.tag){case 24:case 3:var s=fi();t=Jr(s);var l=Qr(i,t,s);l!==null&&(Zn(l,i,s),Ho(l,i,s)),i={cache:Jh()},t.payload=i;return}i=i.return}}function A2(t,i,s){var l=fi();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Mc(t)?nv(i,s):(s=Hh(t,i,s,l),s!==null&&(Zn(s,t,l),iv(s,i,l)))}function tv(t,i,s){var l=fi();Go(t,i,s,l)}function Go(t,i,s,l){var m={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Mc(t))nv(i,m);else{var w=t.alternate;if(t.lanes===0&&(w===null||w.lanes===0)&&(w=i.lastRenderedReducer,w!==null))try{var O=i.lastRenderedState,z=w(O,s);if(m.hasEagerState=!0,m.eagerState=z,oi(z,O))return hc(t,i,m,0),Ct===null&&uc(),!1}catch{}if(s=Hh(t,i,m,l),s!==null)return Zn(s,t,l),iv(s,i,l),!0}return!1}function xd(t,i,s,l){if(l={lane:2,revertLane:nf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Mc(t)){if(i)throw Error(a(479))}else i=Hh(t,s,l,2),i!==null&&Zn(i,t,2)}function Mc(t){var i=t.alternate;return t===Ge||i!==null&&i===Ge}function nv(t,i){Ra=xc=!0;var s=t.pending;s===null?i.next=i:(i.next=s.next,s.next=i),t.pending=i}function iv(t,i,s){if((s&4194048)!==0){var l=i.lanes;l&=t.pendingLanes,s|=l,i.lanes=s,je(t,s)}}var Ko={readContext:En,use:Ac,useCallback:Ft,useContext:Ft,useEffect:Ft,useImperativeHandle:Ft,useLayoutEffect:Ft,useInsertionEffect:Ft,useMemo:Ft,useReducer:Ft,useRef:Ft,useState:Ft,useDebugValue:Ft,useDeferredValue:Ft,useTransition:Ft,useSyncExternalStore:Ft,useId:Ft,useHostTransitionStatus:Ft,useFormState:Ft,useActionState:Ft,useOptimistic:Ft,useMemoCache:Ft,useCacheRefresh:Ft};Ko.useEffectEvent=Ft;var rv={readContext:En,use:Ac,useCallback:function(t,i){return In().memoizedState=[t,i===void 0?null:i],t},useContext:En,useEffect:H_,useImperativeHandle:function(t,i,s){s=s!=null?s.concat([t]):null,Rc(4194308,4,W_.bind(null,i,t),s)},useLayoutEffect:function(t,i){return Rc(4194308,4,t,i)},useInsertionEffect:function(t,i){Rc(4,2,t,i)},useMemo:function(t,i){var s=In();i=i===void 0?null:i;var l=t();if(Fs){Xt(!0);try{t()}finally{Xt(!1)}}return s.memoizedState=[l,i],l},useReducer:function(t,i,s){var l=In();if(s!==void 0){var m=s(i);if(Fs){Xt(!0);try{s(i)}finally{Xt(!1)}}}else m=i;return l.memoizedState=l.baseState=m,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:m},l.queue=t,t=t.dispatch=A2.bind(null,Ge,t),[l.memoizedState,t]},useRef:function(t){var i=In();return t={current:t},i.memoizedState=t},useState:function(t){t=_d(t);var i=t.queue,s=tv.bind(null,Ge,i);return i.dispatch=s,[t.memoizedState,s]},useDebugValue:yd,useDeferredValue:function(t,i){var s=In();return Sd(s,t,i)},useTransition:function(){var t=_d(!1);return t=X_.bind(null,Ge,t.queue,!0,!1),In().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,s){var l=Ge,m=In();if(at){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),Ct===null)throw Error(a(349));(nt&127)!==0||E_(l,i,s)}m.memoizedState=s;var w={value:s,getSnapshot:i};return m.queue=w,H_(A_.bind(null,l,w,t),[t]),l.flags|=2048,Ma(9,{destroy:void 0},T_.bind(null,l,w,s,i),null),s},useId:function(){var t=In(),i=Ct.identifierPrefix;if(at){var s=Zi,l=Xi;s=(l&~(1<<32-Pt(l)-1)).toString(32)+s,i="_"+i+"R_"+s,s=Ec++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=y2++,i="_"+i+"r_"+s.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:Cd,useFormState:I_,useActionState:I_,useOptimistic:function(t){var i=In();i.memoizedState=i.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=xd.bind(null,Ge,!0,s),s.dispatch=i,[t,i]},useMemoCache:pd,useCacheRefresh:function(){return In().memoizedState=T2.bind(null,Ge)},useEffectEvent:function(t){var i=In(),s={impl:t};return i.memoizedState=s,function(){if((dt&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},Ed={readContext:En,use:Ac,useCallback:K_,useContext:En,useEffect:bd,useImperativeHandle:G_,useInsertionEffect:F_,useLayoutEffect:q_,useMemo:V_,useReducer:kc,useRef:P_,useState:function(){return kc(Sr)},useDebugValue:yd,useDeferredValue:function(t,i){var s=Jt();return Y_(s,vt.memoizedState,t,i)},useTransition:function(){var t=kc(Sr)[0],i=Jt().memoizedState;return[typeof t=="boolean"?t:Wo(t),i]},useSyncExternalStore:x_,useId:Q_,useHostTransitionStatus:Cd,useFormState:j_,useActionState:j_,useOptimistic:function(t,i){var s=Jt();return L_(s,vt,t,i)},useMemoCache:pd,useCacheRefresh:ev};Ed.useEffectEvent=U_;var sv={readContext:En,use:Ac,useCallback:K_,useContext:En,useEffect:bd,useImperativeHandle:G_,useInsertionEffect:F_,useLayoutEffect:q_,useMemo:V_,useReducer:md,useRef:P_,useState:function(){return md(Sr)},useDebugValue:yd,useDeferredValue:function(t,i){var s=Jt();return vt===null?Sd(s,t,i):Y_(s,vt.memoizedState,t,i)},useTransition:function(){var t=md(Sr)[0],i=Jt().memoizedState;return[typeof t=="boolean"?t:Wo(t),i]},useSyncExternalStore:x_,useId:Q_,useHostTransitionStatus:Cd,useFormState:$_,useActionState:$_,useOptimistic:function(t,i){var s=Jt();return vt!==null?L_(s,vt,t,i):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:pd,useCacheRefresh:ev};sv.useEffectEvent=U_;function Td(t,i,s,l){i=t.memoizedState,s=s(l,i),s=s==null?i:g({},i,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var Ad={enqueueSetState:function(t,i,s){t=t._reactInternals;var l=fi(),m=Jr(l);m.payload=i,s!=null&&(m.callback=s),i=Qr(t,m,l),i!==null&&(Zn(i,t,l),Ho(i,t,l))},enqueueReplaceState:function(t,i,s){t=t._reactInternals;var l=fi(),m=Jr(l);m.tag=1,m.payload=i,s!=null&&(m.callback=s),i=Qr(t,m,l),i!==null&&(Zn(i,t,l),Ho(i,t,l))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var s=fi(),l=Jr(s);l.tag=2,i!=null&&(l.callback=i),i=Qr(t,l,s),i!==null&&(Zn(i,t,s),Ho(i,t,s))}};function av(t,i,s,l,m,w,O){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(l,w,O):i.prototype&&i.prototype.isPureReactComponent?!Oo(s,l)||!Oo(m,w):!0}function ov(t,i,s,l){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,l),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,l),i.state!==t&&Ad.enqueueReplaceState(i,i.state,null)}function qs(t,i){var s=i;if("ref"in i){s={};for(var l in i)l!=="ref"&&(s[l]=i[l])}if(t=t.defaultProps){s===i&&(s=g({},s));for(var m in t)s[m]===void 0&&(s[m]=t[m])}return s}function lv(t){cc(t)}function cv(t){console.error(t)}function uv(t){cc(t)}function Dc(t,i){try{var s=t.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(l){setTimeout(function(){throw l})}}function hv(t,i,s){try{var l=t.onCaughtError;l(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function kd(t,i,s){return s=Jr(s),s.tag=3,s.payload={element:null},s.callback=function(){Dc(t,i)},s}function dv(t){return t=Jr(t),t.tag=3,t}function fv(t,i,s,l){var m=s.type.getDerivedStateFromError;if(typeof m=="function"){var w=l.value;t.payload=function(){return m(w)},t.callback=function(){hv(i,s,l)}}var O=s.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(t.callback=function(){hv(i,s,l),typeof m!="function"&&(ss===null?ss=new Set([this]):ss.add(this));var z=l.stack;this.componentDidCatch(l.value,{componentStack:z!==null?z:""})})}function k2(t,i,s,l,m){if(s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(i=s.alternate,i!==null&&Ca(i,s,m,!0),s=ci.current,s!==null){switch(s.tag){case 31:case 13:return Ci===null?qc():s.alternate===null&&qt===0&&(qt=3),s.flags&=-257,s.flags|=65536,s.lanes=m,l===bc?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([l]):i.add(l),Qd(t,l,m)),!1;case 22:return s.flags|=65536,l===bc?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([l])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([l]):s.add(l)),Qd(t,l,m)),!1}throw Error(a(435,s.tag))}return Qd(t,l,m),qc(),!1}if(at)return i=ci.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=m,l!==Kh&&(t=Error(a(422),{cause:l}),Io(bi(t,s)))):(l!==Kh&&(i=Error(a(423),{cause:l}),Io(bi(i,s))),t=t.current.alternate,t.flags|=65536,m&=-m,t.lanes|=m,l=bi(l,s),m=kd(t.stateNode,l,m),rd(t,m),qt!==4&&(qt=2)),!1;var w=Error(a(520),{cause:l});if(w=bi(w,s),tl===null?tl=[w]:tl.push(w),qt!==4&&(qt=2),i===null)return!0;l=bi(l,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,t=m&-m,s.lanes|=t,t=kd(s.stateNode,l,t),rd(s,t),!1;case 1:if(i=s.type,w=s.stateNode,(s.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(ss===null||!ss.has(w))))return s.flags|=65536,m&=-m,s.lanes|=m,m=dv(m),fv(m,t,s,l),rd(s,m),!1}s=s.return}while(s!==null);return!1}var Rd=Error(a(461)),ln=!1;function Tn(t,i,s,l){i.child=t===null?__(i,null,s,l):Us(i,t.child,s,l)}function pv(t,i,s,l,m){s=s.render;var w=i.ref;if("ref"in l){var O={};for(var z in l)z!=="ref"&&(O[z]=l[z])}else O=l;return zs(i),l=ud(t,i,s,O,w,m),z=hd(),t!==null&&!ln?(dd(t,i,m),wr(t,i,m)):(at&&z&&Wh(i),i.flags|=1,Tn(t,i,l,m),i.child)}function gv(t,i,s,l,m){if(t===null){var w=s.type;return typeof w=="function"&&!Uh(w)&&w.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=w,mv(t,i,w,l,m)):(t=fc(s.type,null,l,i,i.mode,m),t.ref=i.ref,t.return=i,i.child=t)}if(w=t.child,!jd(t,m)){var O=w.memoizedProps;if(s=s.compare,s=s!==null?s:Oo,s(O,l)&&t.ref===i.ref)return wr(t,i,m)}return i.flags|=1,t=mr(w,l),t.ref=i.ref,t.return=i,i.child=t}function mv(t,i,s,l,m){if(t!==null){var w=t.memoizedProps;if(Oo(w,l)&&t.ref===i.ref)if(ln=!1,i.pendingProps=l=w,jd(t,m))(t.flags&131072)!==0&&(ln=!0);else return i.lanes=t.lanes,wr(t,i,m)}return Ld(t,i,s,l,m)}function _v(t,i,s,l){var m=l.children,w=t!==null?t.memoizedState:null;if(t===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((i.flags&128)!==0){if(w=w!==null?w.baseLanes|s:s,t!==null){for(l=i.child=t.child,m=0;l!==null;)m=m|l.lanes|l.childLanes,l=l.sibling;l=m&~w}else l=0,i.child=null;return vv(t,i,w,s,l)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&_c(i,w!==null?w.cachePool:null),w!==null?y_(i,w):ad(),S_(i);else return l=i.lanes=536870912,vv(t,i,w!==null?w.baseLanes|s:s,s,l)}else w!==null?(_c(i,w.cachePool),y_(i,w),ts(),i.memoizedState=null):(t!==null&&_c(i,null),ad(),ts());return Tn(t,i,m,s),i.child}function Vo(t,i){return t!==null&&t.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function vv(t,i,s,l,m){var w=ed();return w=w===null?null:{parent:an._currentValue,pool:w},i.memoizedState={baseLanes:s,cachePool:w},t!==null&&_c(i,null),ad(),S_(i),t!==null&&Ca(t,i,l,!0),i.childLanes=m,null}function Oc(t,i){return i=Bc({mode:i.mode,children:i.children},t.mode),i.ref=t.ref,t.child=i,i.return=t,i}function bv(t,i,s){return Us(i,t.child,null,s),t=Oc(i,i.pendingProps),t.flags|=2,ui(i),i.memoizedState=null,t}function R2(t,i,s){var l=i.pendingProps,m=(i.flags&128)!==0;if(i.flags&=-129,t===null){if(at){if(l.mode==="hidden")return t=Oc(i,l),i.lanes=536870912,Vo(null,t);if(ld(i),(t=Rt)?(t=M0(t,wi),t=t!==null&&t.data==="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Kr!==null?{id:Xi,overflow:Zi}:null,retryLane:536870912,hydrationErrors:null},s=n_(t),s.return=i,i.child=s,xn=i,Rt=null)):t=null,t===null)throw Yr(i);return i.lanes=536870912,null}return Oc(i,l)}var w=t.memoizedState;if(w!==null){var O=w.dehydrated;if(ld(i),m)if(i.flags&256)i.flags&=-257,i=bv(t,i,s);else if(i.memoizedState!==null)i.child=t.child,i.flags|=128,i=null;else throw Error(a(558));else if(ln||Ca(t,i,s,!1),m=(s&t.childLanes)!==0,ln||m){if(l=Ct,l!==null&&(O=It(l,s),O!==0&&O!==w.retryLane))throw w.retryLane=O,Ns(t,O),Zn(l,t,O),Rd;qc(),i=bv(t,i,s)}else t=w.treeContext,Rt=xi(O.nextSibling),xn=i,at=!0,Vr=null,wi=!1,t!==null&&s_(i,t),i=Oc(i,l),i.flags|=4096;return i}return t=mr(t.child,{mode:l.mode,children:l.children}),t.ref=i.ref,i.child=t,t.return=i,t}function Nc(t,i){var s=i.ref;if(s===null)t!==null&&t.ref!==null&&(i.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(t===null||t.ref!==s)&&(i.flags|=4194816)}}function Ld(t,i,s,l,m){return zs(i),s=ud(t,i,s,l,void 0,m),l=hd(),t!==null&&!ln?(dd(t,i,m),wr(t,i,m)):(at&&l&&Wh(i),i.flags|=1,Tn(t,i,s,m),i.child)}function yv(t,i,s,l,m,w){return zs(i),i.updateQueue=null,s=C_(i,l,s,m),w_(t),l=hd(),t!==null&&!ln?(dd(t,i,w),wr(t,i,w)):(at&&l&&Wh(i),i.flags|=1,Tn(t,i,s,w),i.child)}function Sv(t,i,s,l,m){if(zs(i),i.stateNode===null){var w=ba,O=s.contextType;typeof O=="object"&&O!==null&&(w=En(O)),w=new s(l,w),i.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=Ad,i.stateNode=w,w._reactInternals=i,w=i.stateNode,w.props=l,w.state=i.memoizedState,w.refs={},nd(i),O=s.contextType,w.context=typeof O=="object"&&O!==null?En(O):ba,w.state=i.memoizedState,O=s.getDerivedStateFromProps,typeof O=="function"&&(Td(i,s,O,l),w.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(O=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),O!==w.state&&Ad.enqueueReplaceState(w,w.state,null),Fo(i,l,w,m),Uo(),w.state=i.memoizedState),typeof w.componentDidMount=="function"&&(i.flags|=4194308),l=!0}else if(t===null){w=i.stateNode;var z=i.memoizedProps,X=qs(s,z);w.props=X;var re=w.context,ue=s.contextType;O=ba,typeof ue=="object"&&ue!==null&&(O=En(ue));var fe=s.getDerivedStateFromProps;ue=typeof fe=="function"||typeof w.getSnapshotBeforeUpdate=="function",z=i.pendingProps!==z,ue||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(z||re!==O)&&ov(i,w,l,O),Zr=!1;var se=i.memoizedState;w.state=se,Fo(i,l,w,m),Uo(),re=i.memoizedState,z||se!==re||Zr?(typeof fe=="function"&&(Td(i,s,fe,l),re=i.memoizedState),(X=Zr||av(i,s,X,l,se,re,O))?(ue||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(i.flags|=4194308)):(typeof w.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=l,i.memoizedState=re),w.props=l,w.state=re,w.context=O,l=X):(typeof w.componentDidMount=="function"&&(i.flags|=4194308),l=!1)}else{w=i.stateNode,id(t,i),O=i.memoizedProps,ue=qs(s,O),w.props=ue,fe=i.pendingProps,se=w.context,re=s.contextType,X=ba,typeof re=="object"&&re!==null&&(X=En(re)),z=s.getDerivedStateFromProps,(re=typeof z=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(O!==fe||se!==X)&&ov(i,w,l,X),Zr=!1,se=i.memoizedState,w.state=se,Fo(i,l,w,m),Uo();var le=i.memoizedState;O!==fe||se!==le||Zr||t!==null&&t.dependencies!==null&&gc(t.dependencies)?(typeof z=="function"&&(Td(i,s,z,l),le=i.memoizedState),(ue=Zr||av(i,s,ue,l,se,le,X)||t!==null&&t.dependencies!==null&&gc(t.dependencies))?(re||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(l,le,X),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(l,le,X)),typeof w.componentDidUpdate=="function"&&(i.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof w.componentDidUpdate!="function"||O===t.memoizedProps&&se===t.memoizedState||(i.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||O===t.memoizedProps&&se===t.memoizedState||(i.flags|=1024),i.memoizedProps=l,i.memoizedState=le),w.props=l,w.state=le,w.context=X,l=ue):(typeof w.componentDidUpdate!="function"||O===t.memoizedProps&&se===t.memoizedState||(i.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||O===t.memoizedProps&&se===t.memoizedState||(i.flags|=1024),l=!1)}return w=l,Nc(t,i),l=(i.flags&128)!==0,w||l?(w=i.stateNode,s=l&&typeof s.getDerivedStateFromError!="function"?null:w.render(),i.flags|=1,t!==null&&l?(i.child=Us(i,t.child,null,m),i.child=Us(i,null,s,m)):Tn(t,i,s,m),i.memoizedState=w.state,t=i.child):t=wr(t,i,m),t}function wv(t,i,s,l){return Is(),i.flags|=256,Tn(t,i,s,l),i.child}var Md={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Dd(t){return{baseLanes:t,cachePool:h_()}}function Od(t,i,s){return t=t!==null?t.childLanes&~s:0,i&&(t|=di),t}function Cv(t,i,s){var l=i.pendingProps,m=!1,w=(i.flags&128)!==0,O;if((O=w)||(O=t!==null&&t.memoizedState===null?!1:(Zt.current&2)!==0),O&&(m=!0,i.flags&=-129),O=(i.flags&32)!==0,i.flags&=-33,t===null){if(at){if(m?es(i):ts(),(t=Rt)?(t=M0(t,wi),t=t!==null&&t.data!=="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Kr!==null?{id:Xi,overflow:Zi}:null,retryLane:536870912,hydrationErrors:null},s=n_(t),s.return=i,i.child=s,xn=i,Rt=null)):t=null,t===null)throw Yr(i);return mf(t)?i.lanes=32:i.lanes=536870912,null}var z=l.children;return l=l.fallback,m?(ts(),m=i.mode,z=Bc({mode:"hidden",children:z},m),l=Bs(l,m,s,null),z.return=i,l.return=i,z.sibling=l,i.child=z,l=i.child,l.memoizedState=Dd(s),l.childLanes=Od(t,O,s),i.memoizedState=Md,Vo(null,l)):(es(i),Nd(i,z))}var X=t.memoizedState;if(X!==null&&(z=X.dehydrated,z!==null)){if(w)i.flags&256?(es(i),i.flags&=-257,i=Bd(t,i,s)):i.memoizedState!==null?(ts(),i.child=t.child,i.flags|=128,i=null):(ts(),z=l.fallback,m=i.mode,l=Bc({mode:"visible",children:l.children},m),z=Bs(z,m,s,null),z.flags|=2,l.return=i,z.return=i,l.sibling=z,i.child=l,Us(i,t.child,null,s),l=i.child,l.memoizedState=Dd(s),l.childLanes=Od(t,O,s),i.memoizedState=Md,i=Vo(null,l));else if(es(i),mf(z)){if(O=z.nextSibling&&z.nextSibling.dataset,O)var re=O.dgst;O=re,l=Error(a(419)),l.stack="",l.digest=O,Io({value:l,source:null,stack:null}),i=Bd(t,i,s)}else if(ln||Ca(t,i,s,!1),O=(s&t.childLanes)!==0,ln||O){if(O=Ct,O!==null&&(l=It(O,s),l!==0&&l!==X.retryLane))throw X.retryLane=l,Ns(t,l),Zn(O,t,l),Rd;gf(z)||qc(),i=Bd(t,i,s)}else gf(z)?(i.flags|=192,i.child=t.child,i=null):(t=X.treeContext,Rt=xi(z.nextSibling),xn=i,at=!0,Vr=null,wi=!1,t!==null&&s_(i,t),i=Nd(i,l.children),i.flags|=4096);return i}return m?(ts(),z=l.fallback,m=i.mode,X=t.child,re=X.sibling,l=mr(X,{mode:"hidden",children:l.children}),l.subtreeFlags=X.subtreeFlags&65011712,re!==null?z=mr(re,z):(z=Bs(z,m,s,null),z.flags|=2),z.return=i,l.return=i,l.sibling=z,i.child=l,Vo(null,l),l=i.child,z=t.child.memoizedState,z===null?z=Dd(s):(m=z.cachePool,m!==null?(X=an._currentValue,m=m.parent!==X?{parent:X,pool:X}:m):m=h_(),z={baseLanes:z.baseLanes|s,cachePool:m}),l.memoizedState=z,l.childLanes=Od(t,O,s),i.memoizedState=Md,Vo(t.child,l)):(es(i),s=t.child,t=s.sibling,s=mr(s,{mode:"visible",children:l.children}),s.return=i,s.sibling=null,t!==null&&(O=i.deletions,O===null?(i.deletions=[t],i.flags|=16):O.push(t)),i.child=s,i.memoizedState=null,s)}function Nd(t,i){return i=Bc({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function Bc(t,i){return t=li(22,t,null,i),t.lanes=0,t}function Bd(t,i,s){return Us(i,t.child,null,s),t=Nd(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function xv(t,i,s){t.lanes|=i;var l=t.alternate;l!==null&&(l.lanes|=i),Xh(t.return,i,s)}function Id(t,i,s,l,m,w){var O=t.memoizedState;O===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:l,tail:s,tailMode:m,treeForkCount:w}:(O.isBackwards=i,O.rendering=null,O.renderingStartTime=0,O.last=l,O.tail=s,O.tailMode=m,O.treeForkCount=w)}function Ev(t,i,s){var l=i.pendingProps,m=l.revealOrder,w=l.tail;l=l.children;var O=Zt.current,z=(O&2)!==0;if(z?(O=O&1|2,i.flags|=128):O&=1,Z(Zt,O),Tn(t,i,l,s),l=at?Bo:0,!z&&t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&xv(t,s,i);else if(t.tag===19)xv(t,s,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(m){case"forwards":for(s=i.child,m=null;s!==null;)t=s.alternate,t!==null&&Cc(t)===null&&(m=s),s=s.sibling;s=m,s===null?(m=i.child,i.child=null):(m=s.sibling,s.sibling=null),Id(i,!1,m,s,w,l);break;case"backwards":case"unstable_legacy-backwards":for(s=null,m=i.child,i.child=null;m!==null;){if(t=m.alternate,t!==null&&Cc(t)===null){i.child=m;break}t=m.sibling,m.sibling=s,s=m,m=t}Id(i,!0,s,null,w,l);break;case"together":Id(i,!1,null,null,void 0,l);break;default:i.memoizedState=null}return i.child}function wr(t,i,s){if(t!==null&&(i.dependencies=t.dependencies),rs|=i.lanes,(s&i.childLanes)===0)if(t!==null){if(Ca(t,i,s,!1),(s&i.childLanes)===0)return null}else return null;if(t!==null&&i.child!==t.child)throw Error(a(153));if(i.child!==null){for(t=i.child,s=mr(t,t.pendingProps),i.child=s,s.return=i;t.sibling!==null;)t=t.sibling,s=s.sibling=mr(t,t.pendingProps),s.return=i;s.sibling=null}return i.child}function jd(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&gc(t)))}function L2(t,i,s){switch(i.tag){case 3:$(i,i.stateNode.containerInfo),Xr(i,an,t.memoizedState.cache),Is();break;case 27:case 5:ge(i);break;case 4:$(i,i.stateNode.containerInfo);break;case 10:Xr(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,ld(i),null;break;case 13:var l=i.memoizedState;if(l!==null)return l.dehydrated!==null?(es(i),i.flags|=128,null):(s&i.child.childLanes)!==0?Cv(t,i,s):(es(i),t=wr(t,i,s),t!==null?t.sibling:null);es(i);break;case 19:var m=(t.flags&128)!==0;if(l=(s&i.childLanes)!==0,l||(Ca(t,i,s,!1),l=(s&i.childLanes)!==0),m){if(l)return Ev(t,i,s);i.flags|=128}if(m=i.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),Z(Zt,Zt.current),l)break;return null;case 22:return i.lanes=0,_v(t,i,s,i.pendingProps);case 24:Xr(i,an,t.memoizedState.cache)}return wr(t,i,s)}function Tv(t,i,s){if(t!==null)if(t.memoizedProps!==i.pendingProps)ln=!0;else{if(!jd(t,s)&&(i.flags&128)===0)return ln=!1,L2(t,i,s);ln=(t.flags&131072)!==0}else ln=!1,at&&(i.flags&1048576)!==0&&r_(i,Bo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var l=i.pendingProps;if(t=Ps(i.elementType),i.type=t,typeof t=="function")Uh(t)?(l=qs(t,l),i.tag=1,i=Sv(null,i,t,l,s)):(i.tag=0,i=Ld(null,i,t,l,s));else{if(t!=null){var m=t.$$typeof;if(m===T){i.tag=11,i=pv(null,i,t,l,s);break e}else if(m===M){i.tag=14,i=gv(null,i,t,l,s);break e}}throw i=G(t)||t,Error(a(306,i,""))}}return i;case 0:return Ld(t,i,i.type,i.pendingProps,s);case 1:return l=i.type,m=qs(l,i.pendingProps),Sv(t,i,l,m,s);case 3:e:{if($(i,i.stateNode.containerInfo),t===null)throw Error(a(387));l=i.pendingProps;var w=i.memoizedState;m=w.element,id(t,i),Fo(i,l,null,s);var O=i.memoizedState;if(l=O.cache,Xr(i,an,l),l!==w.cache&&Zh(i,[an],s,!0),Uo(),l=O.element,w.isDehydrated)if(w={element:l,isDehydrated:!1,cache:O.cache},i.updateQueue.baseState=w,i.memoizedState=w,i.flags&256){i=wv(t,i,l,s);break e}else if(l!==m){m=bi(Error(a(424)),i),Io(m),i=wv(t,i,l,s);break e}else for(t=i.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Rt=xi(t.firstChild),xn=i,at=!0,Vr=null,wi=!0,s=__(i,null,l,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Is(),l===m){i=wr(t,i,s);break e}Tn(t,i,l,s)}i=i.child}return i;case 26:return Nc(t,i),t===null?(s=j0(i.type,null,i.pendingProps,null))?i.memoizedState=s:at||(s=i.type,t=i.pendingProps,l=Zc(_e.current).createElement(s),l[At]=i,l[Et]=t,An(l,s,t),Ze(l),i.stateNode=l):i.memoizedState=j0(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return ge(i),t===null&&at&&(l=i.stateNode=N0(i.type,i.pendingProps,_e.current),xn=i,wi=!0,m=Rt,cs(i.type)?(_f=m,Rt=xi(l.firstChild)):Rt=m),Tn(t,i,i.pendingProps.children,s),Nc(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&&at&&((m=l=Rt)&&(l=aE(l,i.type,i.pendingProps,wi),l!==null?(i.stateNode=l,xn=i,Rt=xi(l.firstChild),wi=!1,m=!0):m=!1),m||Yr(i)),ge(i),m=i.type,w=i.pendingProps,O=t!==null?t.memoizedProps:null,l=w.children,df(m,w)?l=null:O!==null&&df(m,O)&&(i.flags|=32),i.memoizedState!==null&&(m=ud(t,i,S2,null,null,s),cl._currentValue=m),Nc(t,i),Tn(t,i,l,s),i.child;case 6:return t===null&&at&&((t=s=Rt)&&(s=oE(s,i.pendingProps,wi),s!==null?(i.stateNode=s,xn=i,Rt=null,t=!0):t=!1),t||Yr(i)),null;case 13:return Cv(t,i,s);case 4:return $(i,i.stateNode.containerInfo),l=i.pendingProps,t===null?i.child=Us(i,null,l,s):Tn(t,i,l,s),i.child;case 11:return pv(t,i,i.type,i.pendingProps,s);case 7:return Tn(t,i,i.pendingProps,s),i.child;case 8:return Tn(t,i,i.pendingProps.children,s),i.child;case 12:return Tn(t,i,i.pendingProps.children,s),i.child;case 10:return l=i.pendingProps,Xr(i,i.type,l.value),Tn(t,i,l.children,s),i.child;case 9:return m=i.type._context,l=i.pendingProps.children,zs(i),m=En(m),l=l(m),i.flags|=1,Tn(t,i,l,s),i.child;case 14:return gv(t,i,i.type,i.pendingProps,s);case 15:return mv(t,i,i.type,i.pendingProps,s);case 19:return Ev(t,i,s);case 31:return R2(t,i,s);case 22:return _v(t,i,s,i.pendingProps);case 24:return zs(i),l=En(an),t===null?(m=ed(),m===null&&(m=Ct,w=Jh(),m.pooledCache=w,w.refCount++,w!==null&&(m.pooledCacheLanes|=s),m=w),i.memoizedState={parent:l,cache:m},nd(i),Xr(i,an,m)):((t.lanes&s)!==0&&(id(t,i),Fo(i,null,null,s),Uo()),m=t.memoizedState,w=i.memoizedState,m.parent!==l?(m={parent:l,cache:l},i.memoizedState=m,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=m),Xr(i,an,l)):(l=w.cache,Xr(i,an,l),l!==m.cache&&Zh(i,[an],s,!0))),Tn(t,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Cr(t){t.flags|=4}function zd(t,i,s,l,m){if((i=(t.mode&32)!==0)&&(i=!1),i){if(t.flags|=16777216,(m&335544128)===m)if(t.stateNode.complete)t.flags|=8192;else if(Qv())t.flags|=8192;else throw Hs=bc,td}else t.flags&=-16777217}function Av(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!U0(i))if(Qv())t.flags|=8192;else throw Hs=bc,td}function Ic(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?Ie():536870912,t.lanes|=i,Ba|=i)}function Yo(t,i){if(!at)switch(t.tailMode){case"hidden":i=t.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?i||t.tail===null?t.tail=null:t.tail.sibling=null:l.sibling=null}}function Lt(t){var i=t.alternate!==null&&t.alternate.child===t.child,s=0,l=0;if(i)for(var m=t.child;m!==null;)s|=m.lanes|m.childLanes,l|=m.subtreeFlags&65011712,l|=m.flags&65011712,m.return=t,m=m.sibling;else for(m=t.child;m!==null;)s|=m.lanes|m.childLanes,l|=m.subtreeFlags,l|=m.flags,m.return=t,m=m.sibling;return t.subtreeFlags|=l,t.childLanes=s,i}function M2(t,i,s){var l=i.pendingProps;switch(Gh(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Lt(i),null;case 1:return Lt(i),null;case 3:return s=i.stateNode,l=null,t!==null&&(l=t.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),br(an),oe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(wa(i)?Cr(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Vh())),Lt(i),null;case 26:var m=i.type,w=i.memoizedState;return t===null?(Cr(i),w!==null?(Lt(i),Av(i,w)):(Lt(i),zd(i,m,null,l,s))):w?w!==t.memoizedState?(Cr(i),Lt(i),Av(i,w)):(Lt(i),i.flags&=-16777217):(t=t.memoizedProps,t!==l&&Cr(i),Lt(i),zd(i,m,t,l,s)),null;case 27:if(Se(i),s=_e.current,m=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==l&&Cr(i);else{if(!l){if(i.stateNode===null)throw Error(a(166));return Lt(i),null}t=ae.current,wa(i)?a_(i):(t=N0(m,l,s),i.stateNode=t,Cr(i))}return Lt(i),null;case 5:if(Se(i),m=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==l&&Cr(i);else{if(!l){if(i.stateNode===null)throw Error(a(166));return Lt(i),null}if(w=ae.current,wa(i))a_(i);else{var O=Zc(_e.current);switch(w){case 1:w=O.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:w=O.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":w=O.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":w=O.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":w=O.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof l.is=="string"?O.createElement("select",{is:l.is}):O.createElement("select"),l.multiple?w.multiple=!0:l.size&&(w.size=l.size);break;default:w=typeof l.is=="string"?O.createElement(m,{is:l.is}):O.createElement(m)}}w[At]=i,w[Et]=l;e:for(O=i.child;O!==null;){if(O.tag===5||O.tag===6)w.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===i)break e;for(;O.sibling===null;){if(O.return===null||O.return===i)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}i.stateNode=w;e:switch(An(w,m,l),m){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Cr(i)}}return Lt(i),zd(i,i.type,t===null?null:t.memoizedProps,i.pendingProps,s),null;case 6:if(t&&i.stateNode!=null)t.memoizedProps!==l&&Cr(i);else{if(typeof l!="string"&&i.stateNode===null)throw Error(a(166));if(t=_e.current,wa(i)){if(t=i.stateNode,s=i.memoizedProps,l=null,m=xn,m!==null)switch(m.tag){case 27:case 5:l=m.memoizedProps}t[At]=i,t=!!(t.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||C0(t.nodeValue,s)),t||Yr(i,!0)}else t=Zc(t).createTextNode(l),t[At]=i,i.stateNode=t}return Lt(i),null;case 31:if(s=i.memoizedState,t===null||t.memoizedState!==null){if(l=wa(i),s!==null){if(t===null){if(!l)throw Error(a(318));if(t=i.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(557));t[At]=i}else Is(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Lt(i),t=!1}else s=Vh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return i.flags&256?(ui(i),i):(ui(i),null);if((i.flags&128)!==0)throw Error(a(558))}return Lt(i),null;case 13:if(l=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(m=wa(i),l!==null&&l.dehydrated!==null){if(t===null){if(!m)throw Error(a(318));if(m=i.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(a(317));m[At]=i}else Is(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Lt(i),m=!1}else m=Vh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=m),m=!0;if(!m)return i.flags&256?(ui(i),i):(ui(i),null)}return ui(i),(i.flags&128)!==0?(i.lanes=s,i):(s=l!==null,t=t!==null&&t.memoizedState!==null,s&&(l=i.child,m=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(m=l.alternate.memoizedState.cachePool.pool),w=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(w=l.memoizedState.cachePool.pool),w!==m&&(l.flags|=2048)),s!==t&&s&&(i.child.flags|=8192),Ic(i,i.updateQueue),Lt(i),null);case 4:return oe(),t===null&&of(i.stateNode.containerInfo),Lt(i),null;case 10:return br(i.type),Lt(i),null;case 19:if(P(Zt),l=i.memoizedState,l===null)return Lt(i),null;if(m=(i.flags&128)!==0,w=l.rendering,w===null)if(m)Yo(l,!1);else{if(qt!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(w=Cc(t),w!==null){for(i.flags|=128,Yo(l,!1),t=w.updateQueue,i.updateQueue=t,Ic(i,t),i.subtreeFlags=0,t=s,s=i.child;s!==null;)t_(s,t),s=s.sibling;return Z(Zt,Zt.current&1|2),at&&_r(i,l.treeForkCount),i.child}t=t.sibling}l.tail!==null&&ht()>Hc&&(i.flags|=128,m=!0,Yo(l,!1),i.lanes=4194304)}else{if(!m)if(t=Cc(w),t!==null){if(i.flags|=128,m=!0,t=t.updateQueue,i.updateQueue=t,Ic(i,t),Yo(l,!0),l.tail===null&&l.tailMode==="hidden"&&!w.alternate&&!at)return Lt(i),null}else 2*ht()-l.renderingStartTime>Hc&&s!==536870912&&(i.flags|=128,m=!0,Yo(l,!1),i.lanes=4194304);l.isBackwards?(w.sibling=i.child,i.child=w):(t=l.last,t!==null?t.sibling=w:i.child=w,l.last=w)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=ht(),t.sibling=null,s=Zt.current,Z(Zt,m?s&1|2:s&1),at&&_r(i,l.treeForkCount),t):(Lt(i),null);case 22:case 23:return ui(i),od(),l=i.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(i.flags|=8192):l&&(i.flags|=8192),l?(s&536870912)!==0&&(i.flags&128)===0&&(Lt(i),i.subtreeFlags&6&&(i.flags|=8192)):Lt(i),s=i.updateQueue,s!==null&&Ic(i,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),l=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(l=i.memoizedState.cachePool.pool),l!==s&&(i.flags|=2048),t!==null&&P($s),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),br(an),Lt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function D2(t,i){switch(Gh(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return br(an),oe(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 26:case 27:case 5:return Se(i),null;case 31:if(i.memoizedState!==null){if(ui(i),i.alternate===null)throw Error(a(340));Is()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 13:if(ui(i),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Is()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return P(Zt),null;case 4:return oe(),null;case 10:return br(i.type),null;case 22:case 23:return ui(i),od(),t!==null&&P($s),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 24:return br(an),null;case 25:return null;default:return null}}function kv(t,i){switch(Gh(i),i.tag){case 3:br(an),oe();break;case 26:case 27:case 5:Se(i);break;case 4:oe();break;case 31:i.memoizedState!==null&&ui(i);break;case 13:ui(i);break;case 19:P(Zt);break;case 10:br(i.type);break;case 22:case 23:ui(i),od(),t!==null&&P($s);break;case 24:br(an)}}function Xo(t,i){try{var s=i.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var m=l.next;s=m;do{if((s.tag&t)===t){l=void 0;var w=s.create,O=s.inst;l=w(),O.destroy=l}s=s.next}while(s!==m)}}catch(z){_t(i,i.return,z)}}function ns(t,i,s){try{var l=i.updateQueue,m=l!==null?l.lastEffect:null;if(m!==null){var w=m.next;l=w;do{if((l.tag&t)===t){var O=l.inst,z=O.destroy;if(z!==void 0){O.destroy=void 0,m=i;var X=s,re=z;try{re()}catch(ue){_t(m,X,ue)}}}l=l.next}while(l!==w)}}catch(ue){_t(i,i.return,ue)}}function Rv(t){var i=t.updateQueue;if(i!==null){var s=t.stateNode;try{b_(i,s)}catch(l){_t(t,t.return,l)}}}function Lv(t,i,s){s.props=qs(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(l){_t(t,i,l)}}function Zo(t,i){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof s=="function"?t.refCleanup=s(l):s.current=l}}catch(m){_t(t,i,m)}}function Ji(t,i){var s=t.ref,l=t.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(m){_t(t,i,m)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(m){_t(t,i,m)}else s.current=null}function Mv(t){var i=t.type,s=t.memoizedProps,l=t.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&l.focus();break e;case"img":s.src?l.src=s.src:s.srcSet&&(l.srcset=s.srcSet)}}catch(m){_t(t,t.return,m)}}function $d(t,i,s){try{var l=t.stateNode;eE(l,t.type,s,i),l[Et]=i}catch(m){_t(t,t.return,m)}}function Dv(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&cs(t.type)||t.tag===4}function Pd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Dv(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&&cs(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 Hd(t,i,s){var l=t.tag;if(l===5||l===6)t=t.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(t),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=we));else if(l!==4&&(l===27&&cs(t.type)&&(s=t.stateNode,i=null),t=t.child,t!==null))for(Hd(t,i,s),t=t.sibling;t!==null;)Hd(t,i,s),t=t.sibling}function jc(t,i,s){var l=t.tag;if(l===5||l===6)t=t.stateNode,i?s.insertBefore(t,i):s.appendChild(t);else if(l!==4&&(l===27&&cs(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(jc(t,i,s),t=t.sibling;t!==null;)jc(t,i,s),t=t.sibling}function Ov(t){var i=t.stateNode,s=t.memoizedProps;try{for(var l=t.type,m=i.attributes;m.length;)i.removeAttributeNode(m[0]);An(i,l,s),i[At]=t,i[Et]=s}catch(w){_t(t,t.return,w)}}var xr=!1,cn=!1,Ud=!1,Nv=typeof WeakSet=="function"?WeakSet:Set,gn=null;function O2(t,i){if(t=t.containerInfo,uf=ru,t=Gm(t),Bh(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var l=s.getSelection&&s.getSelection();if(l&&l.rangeCount!==0){s=l.anchorNode;var m=l.anchorOffset,w=l.focusNode;l=l.focusOffset;try{s.nodeType,w.nodeType}catch{s=null;break e}var O=0,z=-1,X=-1,re=0,ue=0,fe=t,se=null;t:for(;;){for(var le;fe!==s||m!==0&&fe.nodeType!==3||(z=O+m),fe!==w||l!==0&&fe.nodeType!==3||(X=O+l),fe.nodeType===3&&(O+=fe.nodeValue.length),(le=fe.firstChild)!==null;)se=fe,fe=le;for(;;){if(fe===t)break t;if(se===s&&++re===m&&(z=O),se===w&&++ue===l&&(X=O),(le=fe.nextSibling)!==null)break;fe=se,se=fe.parentNode}fe=le}s=z===-1||X===-1?null:{start:z,end:X}}else s=null}s=s||{start:0,end:0}}else s=null;for(hf={focusedElem:t,selectionRange:s},ru=!1,gn=i;gn!==null;)if(i=gn,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,gn=t;else for(;gn!==null;){switch(i=gn,w=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(s=0;s<t.length;s++)m=t[s],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&w!==null){t=void 0,s=i,m=w.memoizedProps,w=w.memoizedState,l=s.stateNode;try{var Ae=qs(s.type,m);t=l.getSnapshotBeforeUpdate(Ae,w),l.__reactInternalSnapshotBeforeUpdate=t}catch(ze){_t(s,s.return,ze)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,s=t.nodeType,s===9)pf(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":pf(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(a(163))}if(t=i.sibling,t!==null){t.return=i.return,gn=t;break}gn=i.return}}function Bv(t,i,s){var l=s.flags;switch(s.tag){case 0:case 11:case 15:Tr(t,s),l&4&&Xo(5,s);break;case 1:if(Tr(t,s),l&4)if(t=s.stateNode,i===null)try{t.componentDidMount()}catch(O){_t(s,s.return,O)}else{var m=qs(s.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(m,i,t.__reactInternalSnapshotBeforeUpdate)}catch(O){_t(s,s.return,O)}}l&64&&Rv(s),l&512&&Zo(s,s.return);break;case 3:if(Tr(t,s),l&64&&(t=s.updateQueue,t!==null)){if(i=null,s.child!==null)switch(s.child.tag){case 27:case 5:i=s.child.stateNode;break;case 1:i=s.child.stateNode}try{b_(t,i)}catch(O){_t(s,s.return,O)}}break;case 27:i===null&&l&4&&Ov(s);case 26:case 5:Tr(t,s),i===null&&l&4&&Mv(s),l&512&&Zo(s,s.return);break;case 12:Tr(t,s);break;case 31:Tr(t,s),l&4&&zv(t,s);break;case 13:Tr(t,s),l&4&&$v(t,s),l&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=U2.bind(null,s),lE(t,s))));break;case 22:if(l=s.memoizedState!==null||xr,!l){i=i!==null&&i.memoizedState!==null||cn,m=xr;var w=cn;xr=l,(cn=i)&&!w?Ar(t,s,(s.subtreeFlags&8772)!==0):Tr(t,s),xr=m,cn=w}break;case 30:break;default:Tr(t,s)}}function Iv(t){var i=t.alternate;i!==null&&(t.alternate=null,Iv(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&De(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 Nt=null,Kn=!1;function Er(t,i,s){for(s=s.child;s!==null;)jv(t,i,s),s=s.sibling}function jv(t,i,s){if(Yt&&typeof Yt.onCommitFiberUnmount=="function")try{Yt.onCommitFiberUnmount(Un,s)}catch{}switch(s.tag){case 26:cn||Ji(s,i),Er(t,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:cn||Ji(s,i);var l=Nt,m=Kn;cs(s.type)&&(Nt=s.stateNode,Kn=!1),Er(t,i,s),al(s.stateNode),Nt=l,Kn=m;break;case 5:cn||Ji(s,i);case 6:if(l=Nt,m=Kn,Nt=null,Er(t,i,s),Nt=l,Kn=m,Nt!==null)if(Kn)try{(Nt.nodeType===9?Nt.body:Nt.nodeName==="HTML"?Nt.ownerDocument.body:Nt).removeChild(s.stateNode)}catch(w){_t(s,i,w)}else try{Nt.removeChild(s.stateNode)}catch(w){_t(s,i,w)}break;case 18:Nt!==null&&(Kn?(t=Nt,R0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),Fa(t)):R0(Nt,s.stateNode));break;case 4:l=Nt,m=Kn,Nt=s.stateNode.containerInfo,Kn=!0,Er(t,i,s),Nt=l,Kn=m;break;case 0:case 11:case 14:case 15:ns(2,s,i),cn||ns(4,s,i),Er(t,i,s);break;case 1:cn||(Ji(s,i),l=s.stateNode,typeof l.componentWillUnmount=="function"&&Lv(s,i,l)),Er(t,i,s);break;case 21:Er(t,i,s);break;case 22:cn=(l=cn)||s.memoizedState!==null,Er(t,i,s),cn=l;break;default:Er(t,i,s)}}function zv(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Fa(t)}catch(s){_t(i,i.return,s)}}}function $v(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Fa(t)}catch(s){_t(i,i.return,s)}}function N2(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new Nv),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new Nv),i;default:throw Error(a(435,t.tag))}}function zc(t,i){var s=N2(t);i.forEach(function(l){if(!s.has(l)){s.add(l);var m=F2.bind(null,t,l);l.then(m,m)}})}function Vn(t,i){var s=i.deletions;if(s!==null)for(var l=0;l<s.length;l++){var m=s[l],w=t,O=i,z=O;e:for(;z!==null;){switch(z.tag){case 27:if(cs(z.type)){Nt=z.stateNode,Kn=!1;break e}break;case 5:Nt=z.stateNode,Kn=!1;break e;case 3:case 4:Nt=z.stateNode.containerInfo,Kn=!0;break e}z=z.return}if(Nt===null)throw Error(a(160));jv(w,O,m),Nt=null,Kn=!1,w=m.alternate,w!==null&&(w.return=null),m.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Pv(i,t),i=i.sibling}var $i=null;function Pv(t,i){var s=t.alternate,l=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Vn(i,t),Yn(t),l&4&&(ns(3,t,t.return),Xo(3,t),ns(5,t,t.return));break;case 1:Vn(i,t),Yn(t),l&512&&(cn||s===null||Ji(s,s.return)),l&64&&xr&&(t=t.updateQueue,t!==null&&(l=t.callbacks,l!==null&&(s=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=s===null?l:s.concat(l))));break;case 26:var m=$i;if(Vn(i,t),Yn(t),l&512&&(cn||s===null||Ji(s,s.return)),l&4){var w=s!==null?s.memoizedState:null;if(l=t.memoizedState,s===null)if(l===null)if(t.stateNode===null){e:{l=t.type,s=t.memoizedProps,m=m.ownerDocument||m;t:switch(l){case"title":w=m.getElementsByTagName("title")[0],(!w||w[Yi]||w[At]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=m.createElement(l),m.head.insertBefore(w,m.querySelector("head > title"))),An(w,l,s),w[At]=t,Ze(w),l=w;break e;case"link":var O=P0("link","href",m).get(l+(s.href||""));if(O){for(var z=0;z<O.length;z++)if(w=O[z],w.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&w.getAttribute("rel")===(s.rel==null?null:s.rel)&&w.getAttribute("title")===(s.title==null?null:s.title)&&w.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){O.splice(z,1);break t}}w=m.createElement(l),An(w,l,s),m.head.appendChild(w);break;case"meta":if(O=P0("meta","content",m).get(l+(s.content||""))){for(z=0;z<O.length;z++)if(w=O[z],w.getAttribute("content")===(s.content==null?null:""+s.content)&&w.getAttribute("name")===(s.name==null?null:s.name)&&w.getAttribute("property")===(s.property==null?null:s.property)&&w.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&w.getAttribute("charset")===(s.charSet==null?null:s.charSet)){O.splice(z,1);break t}}w=m.createElement(l),An(w,l,s),m.head.appendChild(w);break;default:throw Error(a(468,l))}w[At]=t,Ze(w),l=w}t.stateNode=l}else H0(m,t.type,t.stateNode);else t.stateNode=$0(m,l,t.memoizedProps);else w!==l?(w===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):w.count--,l===null?H0(m,t.type,t.stateNode):$0(m,l,t.memoizedProps)):l===null&&t.stateNode!==null&&$d(t,t.memoizedProps,s.memoizedProps)}break;case 27:Vn(i,t),Yn(t),l&512&&(cn||s===null||Ji(s,s.return)),s!==null&&l&4&&$d(t,t.memoizedProps,s.memoizedProps);break;case 5:if(Vn(i,t),Yn(t),l&512&&(cn||s===null||Ji(s,s.return)),t.flags&32){m=t.stateNode;try{He(m,"")}catch(Ae){_t(t,t.return,Ae)}}l&4&&t.stateNode!=null&&(m=t.memoizedProps,$d(t,m,s!==null?s.memoizedProps:m)),l&1024&&(Ud=!0);break;case 6:if(Vn(i,t),Yn(t),l&4){if(t.stateNode===null)throw Error(a(162));l=t.memoizedProps,s=t.stateNode;try{s.nodeValue=l}catch(Ae){_t(t,t.return,Ae)}}break;case 3:if(eu=null,m=$i,$i=Jc(i.containerInfo),Vn(i,t),$i=m,Yn(t),l&4&&s!==null&&s.memoizedState.isDehydrated)try{Fa(i.containerInfo)}catch(Ae){_t(t,t.return,Ae)}Ud&&(Ud=!1,Hv(t));break;case 4:l=$i,$i=Jc(t.stateNode.containerInfo),Vn(i,t),Yn(t),$i=l;break;case 12:Vn(i,t),Yn(t);break;case 31:Vn(i,t),Yn(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,zc(t,l)));break;case 13:Vn(i,t),Yn(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Pc=ht()),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,zc(t,l)));break;case 22:m=t.memoizedState!==null;var X=s!==null&&s.memoizedState!==null,re=xr,ue=cn;if(xr=re||m,cn=ue||X,Vn(i,t),cn=ue,xr=re,Yn(t),l&8192)e:for(i=t.stateNode,i._visibility=m?i._visibility&-2:i._visibility|1,m&&(s===null||X||xr||cn||Ws(t)),s=null,i=t;;){if(i.tag===5||i.tag===26){if(s===null){X=s=i;try{if(w=X.stateNode,m)O=w.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{z=X.stateNode;var fe=X.memoizedProps.style,se=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;z.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(Ae){_t(X,X.return,Ae)}}}else if(i.tag===6){if(s===null){X=i;try{X.stateNode.nodeValue=m?"":X.memoizedProps}catch(Ae){_t(X,X.return,Ae)}}}else if(i.tag===18){if(s===null){X=i;try{var le=X.stateNode;m?L0(le,!0):L0(X.stateNode,!1)}catch(Ae){_t(X,X.return,Ae)}}}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;s===i&&(s=null),i=i.return}s===i&&(s=null),i.sibling.return=i.return,i=i.sibling}l&4&&(l=t.updateQueue,l!==null&&(s=l.retryQueue,s!==null&&(l.retryQueue=null,zc(t,s))));break;case 19:Vn(i,t),Yn(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,zc(t,l)));break;case 30:break;case 21:break;default:Vn(i,t),Yn(t)}}function Yn(t){var i=t.flags;if(i&2){try{for(var s,l=t.return;l!==null;){if(Dv(l)){s=l;break}l=l.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var m=s.stateNode,w=Pd(t);jc(t,w,m);break;case 5:var O=s.stateNode;s.flags&32&&(He(O,""),s.flags&=-33);var z=Pd(t);jc(t,z,O);break;case 3:case 4:var X=s.stateNode.containerInfo,re=Pd(t);Hd(t,re,X);break;default:throw Error(a(161))}}catch(ue){_t(t,t.return,ue)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function Hv(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;Hv(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),t=t.sibling}}function Tr(t,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Bv(t,i.alternate,i),i=i.sibling}function Ws(t){for(t=t.child;t!==null;){var i=t;switch(i.tag){case 0:case 11:case 14:case 15:ns(4,i,i.return),Ws(i);break;case 1:Ji(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&Lv(i,i.return,s),Ws(i);break;case 27:al(i.stateNode);case 26:case 5:Ji(i,i.return),Ws(i);break;case 22:i.memoizedState===null&&Ws(i);break;case 30:Ws(i);break;default:Ws(i)}t=t.sibling}}function Ar(t,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var l=i.alternate,m=t,w=i,O=w.flags;switch(w.tag){case 0:case 11:case 15:Ar(m,w,s),Xo(4,w);break;case 1:if(Ar(m,w,s),l=w,m=l.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(re){_t(l,l.return,re)}if(l=w,m=l.updateQueue,m!==null){var z=l.stateNode;try{var X=m.shared.hiddenCallbacks;if(X!==null)for(m.shared.hiddenCallbacks=null,m=0;m<X.length;m++)v_(X[m],z)}catch(re){_t(l,l.return,re)}}s&&O&64&&Rv(w),Zo(w,w.return);break;case 27:Ov(w);case 26:case 5:Ar(m,w,s),s&&l===null&&O&4&&Mv(w),Zo(w,w.return);break;case 12:Ar(m,w,s);break;case 31:Ar(m,w,s),s&&O&4&&zv(m,w);break;case 13:Ar(m,w,s),s&&O&4&&$v(m,w);break;case 22:w.memoizedState===null&&Ar(m,w,s),Zo(w,w.return);break;case 30:break;default:Ar(m,w,s)}i=i.sibling}}function Fd(t,i){var s=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),t=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(t=i.memoizedState.cachePool.pool),t!==s&&(t!=null&&t.refCount++,s!=null&&jo(s))}function qd(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&jo(t))}function Pi(t,i,s,l){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Uv(t,i,s,l),i=i.sibling}function Uv(t,i,s,l){var m=i.flags;switch(i.tag){case 0:case 11:case 15:Pi(t,i,s,l),m&2048&&Xo(9,i);break;case 1:Pi(t,i,s,l);break;case 3:Pi(t,i,s,l),m&2048&&(t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&jo(t)));break;case 12:if(m&2048){Pi(t,i,s,l),t=i.stateNode;try{var w=i.memoizedProps,O=w.id,z=w.onPostCommit;typeof z=="function"&&z(O,i.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(X){_t(i,i.return,X)}}else Pi(t,i,s,l);break;case 31:Pi(t,i,s,l);break;case 13:Pi(t,i,s,l);break;case 23:break;case 22:w=i.stateNode,O=i.alternate,i.memoizedState!==null?w._visibility&2?Pi(t,i,s,l):Jo(t,i):w._visibility&2?Pi(t,i,s,l):(w._visibility|=2,Da(t,i,s,l,(i.subtreeFlags&10256)!==0||!1)),m&2048&&Fd(O,i);break;case 24:Pi(t,i,s,l),m&2048&&qd(i.alternate,i);break;default:Pi(t,i,s,l)}}function Da(t,i,s,l,m){for(m=m&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var w=t,O=i,z=s,X=l,re=O.flags;switch(O.tag){case 0:case 11:case 15:Da(w,O,z,X,m),Xo(8,O);break;case 23:break;case 22:var ue=O.stateNode;O.memoizedState!==null?ue._visibility&2?Da(w,O,z,X,m):Jo(w,O):(ue._visibility|=2,Da(w,O,z,X,m)),m&&re&2048&&Fd(O.alternate,O);break;case 24:Da(w,O,z,X,m),m&&re&2048&&qd(O.alternate,O);break;default:Da(w,O,z,X,m)}i=i.sibling}}function Jo(t,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=t,l=i,m=l.flags;switch(l.tag){case 22:Jo(s,l),m&2048&&Fd(l.alternate,l);break;case 24:Jo(s,l),m&2048&&qd(l.alternate,l);break;default:Jo(s,l)}i=i.sibling}}var Qo=8192;function Oa(t,i,s){if(t.subtreeFlags&Qo)for(t=t.child;t!==null;)Fv(t,i,s),t=t.sibling}function Fv(t,i,s){switch(t.tag){case 26:Oa(t,i,s),t.flags&Qo&&t.memoizedState!==null&&yE(s,$i,t.memoizedState,t.memoizedProps);break;case 5:Oa(t,i,s);break;case 3:case 4:var l=$i;$i=Jc(t.stateNode.containerInfo),Oa(t,i,s),$i=l;break;case 22:t.memoizedState===null&&(l=t.alternate,l!==null&&l.memoizedState!==null?(l=Qo,Qo=16777216,Oa(t,i,s),Qo=l):Oa(t,i,s));break;default:Oa(t,i,s)}}function qv(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 el(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var l=i[s];gn=l,Gv(l,t)}qv(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Wv(t),t=t.sibling}function Wv(t){switch(t.tag){case 0:case 11:case 15:el(t),t.flags&2048&&ns(9,t,t.return);break;case 3:el(t);break;case 12:el(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,$c(t)):el(t);break;default:el(t)}}function $c(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var l=i[s];gn=l,Gv(l,t)}qv(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:ns(8,i,i.return),$c(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,$c(i));break;default:$c(i)}t=t.sibling}}function Gv(t,i){for(;gn!==null;){var s=gn;switch(s.tag){case 0:case 11:case 15:ns(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var l=s.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:jo(s.memoizedState.cache)}if(l=s.child,l!==null)l.return=s,gn=l;else e:for(s=t;gn!==null;){l=gn;var m=l.sibling,w=l.return;if(Iv(l),l===s){gn=null;break e}if(m!==null){m.return=w,gn=m;break e}gn=w}}}var B2={getCacheForType:function(t){var i=En(an),s=i.data.get(t);return s===void 0&&(s=t(),i.data.set(t,s)),s},cacheSignal:function(){return En(an).controller.signal}},I2=typeof WeakMap=="function"?WeakMap:Map,dt=0,Ct=null,Je=null,nt=0,mt=0,hi=null,is=!1,Na=!1,Wd=!1,kr=0,qt=0,rs=0,Gs=0,Gd=0,di=0,Ba=0,tl=null,Xn=null,Kd=!1,Pc=0,Kv=0,Hc=1/0,Uc=null,ss=null,pn=0,as=null,Ia=null,Rr=0,Vd=0,Yd=null,Vv=null,nl=0,Xd=null;function fi(){return(dt&2)!==0&&nt!==0?nt&-nt:q.T!==null?nf():hr()}function Yv(){if(di===0)if((nt&536870912)===0||at){var t=Vi;Vi<<=1,(Vi&3932160)===0&&(Vi=262144),di=t}else di=536870912;return t=ci.current,t!==null&&(t.flags|=32),di}function Zn(t,i,s){(t===Ct&&(mt===2||mt===9)||t.cancelPendingCommit!==null)&&(ja(t,0),os(t,nt,di,!1)),pt(t,s),((dt&2)===0||t!==Ct)&&(t===Ct&&((dt&2)===0&&(Gs|=s),qt===4&&os(t,nt,di,!1)),Qi(t))}function Xv(t,i,s){if((dt&6)!==0)throw Error(a(327));var l=!s&&(i&127)===0&&(i&t.expiredLanes)===0||he(t,i),m=l?$2(t,i):Jd(t,i,!0),w=l;do{if(m===0){Na&&!l&&os(t,i,0,!1);break}else{if(s=t.current.alternate,w&&!j2(s)){m=Jd(t,i,!1),w=!1;continue}if(m===2){if(w=i,t.errorRecoveryDisabledLanes&w)var O=0;else O=t.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){i=O;e:{var z=t;m=tl;var X=z.current.memoizedState.isDehydrated;if(X&&(ja(z,O).flags|=256),O=Jd(z,O,!1),O!==2){if(Wd&&!X){z.errorRecoveryDisabledLanes|=w,Gs|=w,m=4;break e}w=Xn,Xn=m,w!==null&&(Xn===null?Xn=w:Xn.push.apply(Xn,w))}m=O}if(w=!1,m!==2)continue}}if(m===1){ja(t,0),os(t,i,0,!0);break}e:{switch(l=t,w=m,w){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:os(l,i,di,!is);break e;case 2:Xn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(m=Pc+300-ht(),10<m)){if(os(l,i,di,!is),J(l,0,!0)!==0)break e;Rr=i,l.timeoutHandle=A0(Zv.bind(null,l,s,Xn,Uc,Kd,i,di,Gs,Ba,is,w,"Throttled",-0,0),m);break e}Zv(l,s,Xn,Uc,Kd,i,di,Gs,Ba,is,w,null,-0,0)}}break}while(!0);Qi(t)}function Zv(t,i,s,l,m,w,O,z,X,re,ue,fe,se,le){if(t.timeoutHandle=-1,fe=i.subtreeFlags,fe&8192||(fe&16785408)===16785408){fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:we},Fv(i,w,fe);var Ae=(w&62914560)===w?Pc-ht():(w&4194048)===w?Kv-ht():0;if(Ae=SE(fe,Ae),Ae!==null){Rr=w,t.cancelPendingCommit=Ae(s0.bind(null,t,i,w,s,l,m,O,z,X,ue,fe,null,se,le)),os(t,w,O,!re);return}}s0(t,i,w,s,l,m,O,z,X)}function j2(t){for(var i=t;;){var s=i.tag;if((s===0||s===11||s===15)&&i.flags&16384&&(s=i.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var l=0;l<s.length;l++){var m=s[l],w=m.getSnapshot;m=m.value;try{if(!oi(w(),m))return!1}catch{return!1}}if(s=i.child,i.subtreeFlags&16384&&s!==null)s.return=i,i=s;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 os(t,i,s,l){i&=~Gd,i&=~Gs,t.suspendedLanes|=i,t.pingedLanes&=~i,l&&(t.warmLanes|=i),l=t.expirationTimes;for(var m=i;0<m;){var w=31-Pt(m),O=1<<w;l[w]=-1,m&=~O}s!==0&&Ce(t,s,i)}function Fc(){return(dt&6)===0?(il(0),!1):!0}function Zd(){if(Je!==null){if(mt===0)var t=Je.return;else t=Je,vr=js=null,fd(t),Aa=null,$o=0,t=Je;for(;t!==null;)kv(t.alternate,t),t=t.return;Je=null}}function ja(t,i){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,iE(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),Rr=0,Zd(),Ct=t,Je=s=mr(t.current,null),nt=i,mt=0,hi=null,is=!1,Na=he(t,i),Wd=!1,Ba=di=Gd=Gs=rs=qt=0,Xn=tl=null,Kd=!1,(i&8)!==0&&(i|=i&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=i;0<l;){var m=31-Pt(l),w=1<<m;i|=t[m],l&=~w}return kr=i,uc(),s}function Jv(t,i){Ge=null,q.H=Ko,i===Ta||i===vc?(i=p_(),mt=3):i===td?(i=p_(),mt=4):mt=i===Rd?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,hi=i,Je===null&&(qt=1,Dc(t,bi(i,t.current)))}function Qv(){var t=ci.current;return t===null?!0:(nt&4194048)===nt?Ci===null:(nt&62914560)===nt||(nt&536870912)!==0?t===Ci:!1}function e0(){var t=q.H;return q.H=Ko,t===null?Ko:t}function t0(){var t=q.A;return q.A=B2,t}function qc(){qt=4,is||(nt&4194048)!==nt&&ci.current!==null||(Na=!0),(rs&134217727)===0&&(Gs&134217727)===0||Ct===null||os(Ct,nt,di,!1)}function Jd(t,i,s){var l=dt;dt|=2;var m=e0(),w=t0();(Ct!==t||nt!==i)&&(Uc=null,ja(t,i)),i=!1;var O=qt;e:do try{if(mt!==0&&Je!==null){var z=Je,X=hi;switch(mt){case 8:Zd(),O=6;break e;case 3:case 2:case 9:case 6:ci.current===null&&(i=!0);var re=mt;if(mt=0,hi=null,za(t,z,X,re),s&&Na){O=0;break e}break;default:re=mt,mt=0,hi=null,za(t,z,X,re)}}z2(),O=qt;break}catch(ue){Jv(t,ue)}while(!0);return i&&t.shellSuspendCounter++,vr=js=null,dt=l,q.H=m,q.A=w,Je===null&&(Ct=null,nt=0,uc()),O}function z2(){for(;Je!==null;)n0(Je)}function $2(t,i){var s=dt;dt|=2;var l=e0(),m=t0();Ct!==t||nt!==i?(Uc=null,Hc=ht()+500,ja(t,i)):Na=he(t,i);e:do try{if(mt!==0&&Je!==null){i=Je;var w=hi;t:switch(mt){case 1:mt=0,hi=null,za(t,i,w,1);break;case 2:case 9:if(d_(w)){mt=0,hi=null,i0(i);break}i=function(){mt!==2&&mt!==9||Ct!==t||(mt=7),Qi(t)},w.then(i,i);break e;case 3:mt=7;break e;case 4:mt=5;break e;case 7:d_(w)?(mt=0,hi=null,i0(i)):(mt=0,hi=null,za(t,i,w,7));break;case 5:var O=null;switch(Je.tag){case 26:O=Je.memoizedState;case 5:case 27:var z=Je;if(O?U0(O):z.stateNode.complete){mt=0,hi=null;var X=z.sibling;if(X!==null)Je=X;else{var re=z.return;re!==null?(Je=re,Wc(re)):Je=null}break t}}mt=0,hi=null,za(t,i,w,5);break;case 6:mt=0,hi=null,za(t,i,w,6);break;case 8:Zd(),qt=6;break e;default:throw Error(a(462))}}P2();break}catch(ue){Jv(t,ue)}while(!0);return vr=js=null,q.H=l,q.A=m,dt=s,Je!==null?0:(Ct=null,nt=0,uc(),qt)}function P2(){for(;Je!==null&&!Ni();)n0(Je)}function n0(t){var i=Tv(t.alternate,t,kr);t.memoizedProps=t.pendingProps,i===null?Wc(t):Je=i}function i0(t){var i=t,s=i.alternate;switch(i.tag){case 15:case 0:i=yv(s,i,i.pendingProps,i.type,void 0,nt);break;case 11:i=yv(s,i,i.pendingProps,i.type.render,i.ref,nt);break;case 5:fd(i);default:kv(s,i),i=Je=t_(i,kr),i=Tv(s,i,kr)}t.memoizedProps=t.pendingProps,i===null?Wc(t):Je=i}function za(t,i,s,l){vr=js=null,fd(i),Aa=null,$o=0;var m=i.return;try{if(k2(t,m,i,s,nt)){qt=1,Dc(t,bi(s,t.current)),Je=null;return}}catch(w){if(m!==null)throw Je=m,w;qt=1,Dc(t,bi(s,t.current)),Je=null;return}i.flags&32768?(at||l===1?t=!0:Na||(nt&536870912)!==0?t=!1:(is=t=!0,(l===2||l===9||l===3||l===6)&&(l=ci.current,l!==null&&l.tag===13&&(l.flags|=16384))),r0(i,t)):Wc(i)}function Wc(t){var i=t;do{if((i.flags&32768)!==0){r0(i,is);return}t=i.return;var s=M2(i.alternate,i,kr);if(s!==null){Je=s;return}if(i=i.sibling,i!==null){Je=i;return}Je=i=t}while(i!==null);qt===0&&(qt=5)}function r0(t,i){do{var s=D2(t.alternate,t);if(s!==null){s.flags&=32767,Je=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(t=t.sibling,t!==null)){Je=t;return}Je=t=s}while(t!==null);qt=6,Je=null}function s0(t,i,s,l,m,w,O,z,X){t.cancelPendingCommit=null;do Gc();while(pn!==0);if((dt&6)!==0)throw Error(a(327));if(i!==null){if(i===t.current)throw Error(a(177));if(w=i.lanes|i.childLanes,w|=Ph,Te(t,s,w,O,z,X),t===Ct&&(Je=Ct=null,nt=0),Ia=i,as=t,Rr=s,Vd=w,Yd=m,Vv=l,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,q2(nn,function(){return u0(),null})):(t.callbackNode=null,t.callbackPriority=0),l=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||l){l=q.T,q.T=null,m=V.p,V.p=2,O=dt,dt|=4;try{O2(t,i,s)}finally{dt=O,V.p=m,q.T=l}}pn=1,a0(),o0(),l0()}}function a0(){if(pn===1){pn=0;var t=as,i=Ia,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=q.T,q.T=null;var l=V.p;V.p=2;var m=dt;dt|=4;try{Pv(i,t);var w=hf,O=Gm(t.containerInfo),z=w.focusedElem,X=w.selectionRange;if(O!==z&&z&&z.ownerDocument&&Wm(z.ownerDocument.documentElement,z)){if(X!==null&&Bh(z)){var re=X.start,ue=X.end;if(ue===void 0&&(ue=re),"selectionStart"in z)z.selectionStart=re,z.selectionEnd=Math.min(ue,z.value.length);else{var fe=z.ownerDocument||document,se=fe&&fe.defaultView||window;if(se.getSelection){var le=se.getSelection(),Ae=z.textContent.length,ze=Math.min(X.start,Ae),yt=X.end===void 0?ze:Math.min(X.end,Ae);!le.extend&&ze>yt&&(O=yt,yt=ze,ze=O);var ne=qm(z,ze),te=qm(z,yt);if(ne&&te&&(le.rangeCount!==1||le.anchorNode!==ne.node||le.anchorOffset!==ne.offset||le.focusNode!==te.node||le.focusOffset!==te.offset)){var ie=fe.createRange();ie.setStart(ne.node,ne.offset),le.removeAllRanges(),ze>yt?(le.addRange(ie),le.extend(te.node,te.offset)):(ie.setEnd(te.node,te.offset),le.addRange(ie))}}}}for(fe=[],le=z;le=le.parentNode;)le.nodeType===1&&fe.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;z<fe.length;z++){var de=fe[z];de.element.scrollLeft=de.left,de.element.scrollTop=de.top}}ru=!!uf,hf=uf=null}finally{dt=m,V.p=l,q.T=s}}t.current=i,pn=2}}function o0(){if(pn===2){pn=0;var t=as,i=Ia,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=q.T,q.T=null;var l=V.p;V.p=2;var m=dt;dt|=4;try{Bv(t,i.alternate,i)}finally{dt=m,V.p=l,q.T=s}}pn=3}}function l0(){if(pn===4||pn===3){pn=0,tn();var t=as,i=Ia,s=Rr,l=Vv;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?pn=5:(pn=0,Ia=as=null,c0(t,t.pendingLanes));var m=t.pendingLanes;if(m===0&&(ss=null),wn(s),i=i.stateNode,Yt&&typeof Yt.onCommitFiberRoot=="function")try{Yt.onCommitFiberRoot(Un,i,void 0,(i.current.flags&128)===128)}catch{}if(l!==null){i=q.T,m=V.p,V.p=2,q.T=null;try{for(var w=t.onRecoverableError,O=0;O<l.length;O++){var z=l[O];w(z.value,{componentStack:z.stack})}}finally{q.T=i,V.p=m}}(Rr&3)!==0&&Gc(),Qi(t),m=t.pendingLanes,(s&261930)!==0&&(m&42)!==0?t===Xd?nl++:(nl=0,Xd=t):nl=0,il(0)}}function c0(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,jo(i)))}function Gc(){return a0(),o0(),l0(),u0()}function u0(){if(pn!==5)return!1;var t=as,i=Vd;Vd=0;var s=wn(Rr),l=q.T,m=V.p;try{V.p=32>s?32:s,q.T=null,s=Yd,Yd=null;var w=as,O=Rr;if(pn=0,Ia=as=null,Rr=0,(dt&6)!==0)throw Error(a(331));var z=dt;if(dt|=4,Wv(w.current),Uv(w,w.current,O,s),dt=z,il(0,!1),Yt&&typeof Yt.onPostCommitFiberRoot=="function")try{Yt.onPostCommitFiberRoot(Un,w)}catch{}return!0}finally{V.p=m,q.T=l,c0(t,i)}}function h0(t,i,s){i=bi(s,i),i=kd(t.stateNode,i,2),t=Qr(t,i,2),t!==null&&(pt(t,2),Qi(t))}function _t(t,i,s){if(t.tag===3)h0(t,t,s);else for(;i!==null;){if(i.tag===3){h0(i,t,s);break}else if(i.tag===1){var l=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ss===null||!ss.has(l))){t=bi(s,t),s=dv(2),l=Qr(i,s,2),l!==null&&(fv(s,l,i,t),pt(l,2),Qi(l));break}}i=i.return}}function Qd(t,i,s){var l=t.pingCache;if(l===null){l=t.pingCache=new I2;var m=new Set;l.set(i,m)}else m=l.get(i),m===void 0&&(m=new Set,l.set(i,m));m.has(s)||(Wd=!0,m.add(s),t=H2.bind(null,t,i,s),i.then(t,t))}function H2(t,i,s){var l=t.pingCache;l!==null&&l.delete(i),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,Ct===t&&(nt&s)===s&&(qt===4||qt===3&&(nt&62914560)===nt&&300>ht()-Pc?(dt&2)===0&&ja(t,0):Gd|=s,Ba===nt&&(Ba=0)),Qi(t)}function d0(t,i){i===0&&(i=Ie()),t=Ns(t,i),t!==null&&(pt(t,i),Qi(t))}function U2(t){var i=t.memoizedState,s=0;i!==null&&(s=i.retryLane),d0(t,s)}function F2(t,i){var s=0;switch(t.tag){case 31:case 13:var l=t.stateNode,m=t.memoizedState;m!==null&&(s=m.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(a(314))}l!==null&&l.delete(i),d0(t,s)}function q2(t,i){return Sn(t,i)}var Kc=null,$a=null,ef=!1,Vc=!1,tf=!1,ls=0;function Qi(t){t!==$a&&t.next===null&&($a===null?Kc=$a=t:$a=$a.next=t),Vc=!0,ef||(ef=!0,G2())}function il(t,i){if(!tf&&Vc){tf=!0;do for(var s=!1,l=Kc;l!==null;){if(t!==0){var m=l.pendingLanes;if(m===0)var w=0;else{var O=l.suspendedLanes,z=l.pingedLanes;w=(1<<31-Pt(42|t)+1)-1,w&=m&~(O&~z),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(s=!0,m0(l,w))}else w=nt,w=J(l,l===Ct?w:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(w&3)===0||he(l,w)||(s=!0,m0(l,w));l=l.next}while(s);tf=!1}}function W2(){f0()}function f0(){Vc=ef=!1;var t=0;ls!==0&&nE()&&(t=ls);for(var i=ht(),s=null,l=Kc;l!==null;){var m=l.next,w=p0(l,i);w===0?(l.next=null,s===null?Kc=m:s.next=m,m===null&&($a=s)):(s=l,(t!==0||(w&3)!==0)&&(Vc=!0)),l=m}pn!==0&&pn!==5||il(t),ls!==0&&(ls=0)}function p0(t,i){for(var s=t.suspendedLanes,l=t.pingedLanes,m=t.expirationTimes,w=t.pendingLanes&-62914561;0<w;){var O=31-Pt(w),z=1<<O,X=m[O];X===-1?((z&s)===0||(z&l)!==0)&&(m[O]=be(z,i)):X<=i&&(t.expiredLanes|=z),w&=~z}if(i=Ct,s=nt,s=J(t,t===i?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l=t.callbackNode,s===0||t===i&&(mt===2||mt===9)||t.cancelPendingCommit!==null)return l!==null&&l!==null&&mi(l),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||he(t,s)){if(i=s&-s,i===t.callbackPriority)return i;switch(l!==null&&mi(l),wn(s)){case 2:case 8:s=$t;break;case 32:s=nn;break;case 268435456:s=Dn;break;default:s=nn}return l=g0.bind(null,t),s=Sn(s,l),t.callbackPriority=i,t.callbackNode=s,i}return l!==null&&l!==null&&mi(l),t.callbackPriority=2,t.callbackNode=null,2}function g0(t,i){if(pn!==0&&pn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(Gc()&&t.callbackNode!==s)return null;var l=nt;return l=J(t,t===Ct?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l===0?null:(Xv(t,l,i),p0(t,ht()),t.callbackNode!=null&&t.callbackNode===s?g0.bind(null,t):null)}function m0(t,i){if(Gc())return null;Xv(t,i,!0)}function G2(){rE(function(){(dt&6)!==0?Sn(zt,W2):f0()})}function nf(){if(ls===0){var t=xa;t===0&&(t=Ii,Ii<<=1,(Ii&261888)===0&&(Ii=256)),ls=t}return ls}function _0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Wr(""+t)}function v0(t,i){var s=i.ownerDocument.createElement("input");return s.name=i.name,s.value=i.value,t.id&&s.setAttribute("form",t.id),i.parentNode.insertBefore(s,i),t=new FormData(t),s.parentNode.removeChild(s),t}function K2(t,i,s,l,m){if(i==="submit"&&s&&s.stateNode===m){var w=_0((m[Et]||null).action),O=l.submitter;O&&(i=(i=O[Et]||null)?_0(i.formAction):O.getAttribute("formAction"),i!==null&&(w=i,O=null));var z=new ac("action","action",null,l,m);t.push({event:z,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(ls!==0){var X=O?v0(m,O):new FormData(m);wd(s,{pending:!0,data:X,method:m.method,action:w},null,X)}}else typeof w=="function"&&(z.preventDefault(),X=O?v0(m,O):new FormData(m),wd(s,{pending:!0,data:X,method:m.method,action:w},w,X))},currentTarget:m}]})}}for(var rf=0;rf<$h.length;rf++){var sf=$h[rf],V2=sf.toLowerCase(),Y2=sf[0].toUpperCase()+sf.slice(1);zi(V2,"on"+Y2)}zi(Ym,"onAnimationEnd"),zi(Xm,"onAnimationIteration"),zi(Zm,"onAnimationStart"),zi("dblclick","onDoubleClick"),zi("focusin","onFocus"),zi("focusout","onBlur"),zi(h2,"onTransitionRun"),zi(d2,"onTransitionStart"),zi(f2,"onTransitionCancel"),zi(Jm,"onTransitionEnd"),me("onMouseEnter",["mouseout","mouseover"]),me("onMouseLeave",["mouseout","mouseover"]),me("onPointerEnter",["pointerout","pointerover"]),me("onPointerLeave",["pointerout","pointerover"]),Ut("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ut("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ut("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ut("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ut("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ut("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var rl="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(" "),X2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(rl));function b0(t,i){i=(i&4)!==0;for(var s=0;s<t.length;s++){var l=t[s],m=l.event;l=l.listeners;e:{var w=void 0;if(i)for(var O=l.length-1;0<=O;O--){var z=l[O],X=z.instance,re=z.currentTarget;if(z=z.listener,X!==w&&m.isPropagationStopped())break e;w=z,m.currentTarget=re;try{w(m)}catch(ue){cc(ue)}m.currentTarget=null,w=X}else for(O=0;O<l.length;O++){if(z=l[O],X=z.instance,re=z.currentTarget,z=z.listener,X!==w&&m.isPropagationStopped())break e;w=z,m.currentTarget=re;try{w(m)}catch(ue){cc(ue)}m.currentTarget=null,w=X}}}}function Qe(t,i){var s=i[Fr];s===void 0&&(s=i[Fr]=new Set);var l=t+"__bubble";s.has(l)||(y0(i,t,2,!1),s.add(l))}function af(t,i,s){var l=0;i&&(l|=4),y0(s,t,l,i)}var Yc="_reactListening"+Math.random().toString(36).slice(2);function of(t){if(!t[Yc]){t[Yc]=!0,kt.forEach(function(s){s!=="selectionchange"&&(X2.has(s)||af(s,!1,t),af(s,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[Yc]||(i[Yc]=!0,af("selectionchange",!1,i))}}function y0(t,i,s,l){switch(Y0(i)){case 2:var m=xE;break;case 8:m=EE;break;default:m=wf}s=m.bind(null,i,s,t),m=void 0,!Th||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(m=!0),l?m!==void 0?t.addEventListener(i,s,{capture:!0,passive:m}):t.addEventListener(i,s,!0):m!==void 0?t.addEventListener(i,s,{passive:m}):t.addEventListener(i,s,!1)}function lf(t,i,s,l,m){var w=l;if((i&1)===0&&(i&2)===0&&l!==null)e:for(;;){if(l===null)return;var O=l.tag;if(O===3||O===4){var z=l.stateNode.containerInfo;if(z===m)break;if(O===4)for(O=l.return;O!==null;){var X=O.tag;if((X===3||X===4)&&O.stateNode.containerInfo===m)return;O=O.return}for(;z!==null;){if(O=K(z),O===null)return;if(X=O.tag,X===5||X===6||X===26||X===27){l=w=O;continue e}z=z.parentNode}}l=l.return}nc(function(){var re=w,ue=We(s),fe=[];e:{var se=Qm.get(t);if(se!==void 0){var le=ac,Ae=t;switch(t){case"keypress":if(rc(s)===0)break e;case"keydown":case"keyup":le=Fx;break;case"focusin":Ae="focus",le=Lh;break;case"focusout":Ae="blur",le=Lh;break;case"beforeblur":case"afterblur":le=Lh;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":le=km;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=Mx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=Gx;break;case Ym:case Xm:case Zm:le=Nx;break;case Jm:le=Vx;break;case"scroll":case"scrollend":le=Rx;break;case"wheel":le=Xx;break;case"copy":case"cut":case"paste":le=Ix;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=Lm;break;case"toggle":case"beforetoggle":le=Jx}var ze=(i&4)!==0,yt=!ze&&(t==="scroll"||t==="scrollend"),ne=ze?se!==null?se+"Capture":null:se;ze=[];for(var te=re,ie;te!==null;){var de=te;if(ie=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||ie===null||ne===null||(de=To(te,ne),de!=null&&ze.push(sl(te,de,ie))),yt)break;te=te.return}0<ze.length&&(se=new le(se,Ae,null,s,ue),fe.push({event:se,listeners:ze}))}}if((i&7)===0){e:{if(se=t==="mouseover"||t==="pointerover",le=t==="mouseout"||t==="pointerout",se&&s!==Re&&(Ae=s.relatedTarget||s.fromElement)&&(K(Ae)||Ae[ji]))break e;if((le||se)&&(se=ue.window===ue?ue:(se=ue.ownerDocument)?se.defaultView||se.parentWindow:window,le?(Ae=s.relatedTarget||s.toElement,le=re,Ae=Ae?K(Ae):null,Ae!==null&&(yt=f(Ae),ze=Ae.tag,Ae!==yt||ze!==5&&ze!==27&&ze!==6)&&(Ae=null)):(le=null,Ae=re),le!==Ae)){if(ze=km,de="onMouseLeave",ne="onMouseEnter",te="mouse",(t==="pointerout"||t==="pointerover")&&(ze=Lm,de="onPointerLeave",ne="onPointerEnter",te="pointer"),yt=le==null?se:xe(le),ie=Ae==null?se:xe(Ae),se=new ze(de,te+"leave",le,s,ue),se.target=yt,se.relatedTarget=ie,de=null,K(ue)===re&&(ze=new ze(ne,te+"enter",Ae,s,ue),ze.target=ie,ze.relatedTarget=yt,de=ze),yt=de,le&&Ae)t:{for(ze=Z2,ne=le,te=Ae,ie=0,de=ne;de;de=ze(de))ie++;de=0;for(var Be=te;Be;Be=ze(Be))de++;for(;0<ie-de;)ne=ze(ne),ie--;for(;0<de-ie;)te=ze(te),de--;for(;ie--;){if(ne===te||te!==null&&ne===te.alternate){ze=ne;break t}ne=ze(ne),te=ze(te)}ze=null}else ze=null;le!==null&&S0(fe,se,le,ze,!1),Ae!==null&&yt!==null&&S0(fe,yt,Ae,ze,!0)}}e:{if(se=re?xe(re):window,le=se.nodeName&&se.nodeName.toLowerCase(),le==="select"||le==="input"&&se.type==="file")var lt=zm;else if(Im(se))if($m)lt=l2;else{lt=a2;var Le=s2}else le=se.nodeName,!le||le.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?re&&qr(re.elementType)&&(lt=zm):lt=o2;if(lt&&(lt=lt(t,re))){jm(fe,lt,s,ue);break e}Le&&Le(t,se,re),t==="focusout"&&re&&se.type==="number"&&re.memoizedProps.value!=null&&fa(se,"number",se.value)}switch(Le=re?xe(re):window,t){case"focusin":(Im(Le)||Le.contentEditable==="true")&&(ma=Le,Ih=re,No=null);break;case"focusout":No=Ih=ma=null;break;case"mousedown":jh=!0;break;case"contextmenu":case"mouseup":case"dragend":jh=!1,Km(fe,s,ue);break;case"selectionchange":if(u2)break;case"keydown":case"keyup":Km(fe,s,ue)}var Ke;if(Dh)e:{switch(t){case"compositionstart":var it="onCompositionStart";break e;case"compositionend":it="onCompositionEnd";break e;case"compositionupdate":it="onCompositionUpdate";break e}it=void 0}else ga?Nm(t,s)&&(it="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(it="onCompositionStart");it&&(Mm&&s.locale!=="ko"&&(ga||it!=="onCompositionStart"?it==="onCompositionEnd"&&ga&&(Ke=Tm()):(Gr=ue,Ah="value"in Gr?Gr.value:Gr.textContent,ga=!0)),Le=Xc(re,it),0<Le.length&&(it=new Rm(it,t,null,s,ue),fe.push({event:it,listeners:Le}),Ke?it.data=Ke:(Ke=Bm(s),Ke!==null&&(it.data=Ke)))),(Ke=e2?t2(t,s):n2(t,s))&&(it=Xc(re,"onBeforeInput"),0<it.length&&(Le=new Rm("onBeforeInput","beforeinput",null,s,ue),fe.push({event:Le,listeners:it}),Le.data=Ke)),K2(fe,t,re,s,ue)}b0(fe,i)})}function sl(t,i,s){return{instance:t,listener:i,currentTarget:s}}function Xc(t,i){for(var s=i+"Capture",l=[];t!==null;){var m=t,w=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||w===null||(m=To(t,s),m!=null&&l.unshift(sl(t,m,w)),m=To(t,i),m!=null&&l.push(sl(t,m,w))),t.tag===3)return l;t=t.return}return[]}function Z2(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function S0(t,i,s,l,m){for(var w=i._reactName,O=[];s!==null&&s!==l;){var z=s,X=z.alternate,re=z.stateNode;if(z=z.tag,X!==null&&X===l)break;z!==5&&z!==26&&z!==27||re===null||(X=re,m?(re=To(s,w),re!=null&&O.unshift(sl(s,re,X))):m||(re=To(s,w),re!=null&&O.push(sl(s,re,X)))),s=s.return}O.length!==0&&t.push({event:i,listeners:O})}var J2=/\r\n?/g,Q2=/\u0000|\uFFFD/g;function w0(t){return(typeof t=="string"?t:""+t).replace(J2,`
9
+ `).replace(Q2,"")}function C0(t,i){return i=w0(i),w0(t)===i}function bt(t,i,s,l,m,w){switch(s){case"children":typeof l=="string"?i==="body"||i==="textarea"&&l===""||He(t,l):(typeof l=="number"||typeof l=="bigint")&&i!=="body"&&He(t,""+l);break;case"className":si(t,"class",l);break;case"tabIndex":si(t,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":si(t,s,l);break;case"style":gt(t,l,w);break;case"data":if(i!=="object"){si(t,"data",l);break}case"src":case"href":if(l===""&&(i!=="a"||s!=="href")){t.removeAttribute(s);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(s);break}l=Wr(""+l),t.setAttribute(s,l);break;case"action":case"formAction":if(typeof l=="function"){t.setAttribute(s,"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 w=="function"&&(s==="formAction"?(i!=="input"&&bt(t,i,"name",m.name,m,null),bt(t,i,"formEncType",m.formEncType,m,null),bt(t,i,"formMethod",m.formMethod,m,null),bt(t,i,"formTarget",m.formTarget,m,null)):(bt(t,i,"encType",m.encType,m,null),bt(t,i,"method",m.method,m,null),bt(t,i,"target",m.target,m,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(s);break}l=Wr(""+l),t.setAttribute(s,l);break;case"onClick":l!=null&&(t.onclick=we);break;case"onScroll":l!=null&&Qe("scroll",t);break;case"onScrollEnd":l!=null&&Qe("scrollend",t);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(a(61));if(s=l.__html,s!=null){if(m.children!=null)throw Error(a(60));t.innerHTML=s}}break;case"multiple":t.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":t.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){t.removeAttribute("xlink:href");break}s=Wr(""+l),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(s,""+l):t.removeAttribute(s);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":l&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":l===!0?t.setAttribute(s,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(s,l):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?t.setAttribute(s,l):t.removeAttribute(s);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?t.removeAttribute(s):t.setAttribute(s,l);break;case"popover":Qe("beforetoggle",t),Qe("toggle",t),On(t,"popover",l);break;case"xlinkActuate":qn(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":qn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":qn(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":qn(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":qn(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":qn(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":qn(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":qn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":qn(t,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":On(t,"is",l);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=pr.get(s)||s,On(t,s,l))}}function cf(t,i,s,l,m,w){switch(s){case"style":gt(t,l,w);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(a(61));if(s=l.__html,s!=null){if(m.children!=null)throw Error(a(60));t.innerHTML=s}}break;case"children":typeof l=="string"?He(t,l):(typeof l=="number"||typeof l=="bigint")&&He(t,""+l);break;case"onScroll":l!=null&&Qe("scroll",t);break;case"onScrollEnd":l!=null&&Qe("scrollend",t);break;case"onClick":l!=null&&(t.onclick=we);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ht.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(m=s.endsWith("Capture"),i=s.slice(2,m?s.length-7:void 0),w=t[Et]||null,w=w!=null?w[s]:null,typeof w=="function"&&t.removeEventListener(i,w,m),typeof l=="function")){typeof w!="function"&&w!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(i,l,m);break e}s in t?t[s]=l:l===!0?t.setAttribute(s,""):On(t,s,l)}}}function An(t,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Qe("error",t),Qe("load",t);var l=!1,m=!1,w;for(w in s)if(s.hasOwnProperty(w)){var O=s[w];if(O!=null)switch(w){case"src":l=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:bt(t,i,w,O,s,null)}}m&&bt(t,i,"srcSet",s.srcSet,s,null),l&&bt(t,i,"src",s.src,s,null);return;case"input":Qe("invalid",t);var z=w=O=m=null,X=null,re=null;for(l in s)if(s.hasOwnProperty(l)){var ue=s[l];if(ue!=null)switch(l){case"name":m=ue;break;case"type":O=ue;break;case"checked":X=ue;break;case"defaultChecked":re=ue;break;case"value":w=ue;break;case"defaultValue":z=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(a(137,i));break;default:bt(t,i,l,ue,s,null)}}Ls(t,w,z,X,re,O,m,!1);return;case"select":Qe("invalid",t),l=O=w=null;for(m in s)if(s.hasOwnProperty(m)&&(z=s[m],z!=null))switch(m){case"value":w=z;break;case"defaultValue":O=z;break;case"multiple":l=z;default:bt(t,i,m,z,s,null)}i=w,s=O,t.multiple=!!l,i!=null?Cn(t,!!l,i,!1):s!=null&&Cn(t,!!l,s,!0);return;case"textarea":Qe("invalid",t),w=m=l=null;for(O in s)if(s.hasOwnProperty(O)&&(z=s[O],z!=null))switch(O){case"value":l=z;break;case"defaultValue":m=z;break;case"children":w=z;break;case"dangerouslySetInnerHTML":if(z!=null)throw Error(a(91));break;default:bt(t,i,O,z,s,null)}pa(t,l,m,w);return;case"option":for(X in s)s.hasOwnProperty(X)&&(l=s[X],l!=null)&&(X==="selected"?t.selected=l&&typeof l!="function"&&typeof l!="symbol":bt(t,i,X,l,s,null));return;case"dialog":Qe("beforetoggle",t),Qe("toggle",t),Qe("cancel",t),Qe("close",t);break;case"iframe":case"object":Qe("load",t);break;case"video":case"audio":for(l=0;l<rl.length;l++)Qe(rl[l],t);break;case"image":Qe("error",t),Qe("load",t);break;case"details":Qe("toggle",t);break;case"embed":case"source":case"link":Qe("error",t),Qe("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(re in s)if(s.hasOwnProperty(re)&&(l=s[re],l!=null))switch(re){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:bt(t,i,re,l,s,null)}return;default:if(qr(i)){for(ue in s)s.hasOwnProperty(ue)&&(l=s[ue],l!==void 0&&cf(t,i,ue,l,s,void 0));return}}for(z in s)s.hasOwnProperty(z)&&(l=s[z],l!=null&&bt(t,i,z,l,s,null))}function eE(t,i,s,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,w=null,O=null,z=null,X=null,re=null,ue=null;for(le in s){var fe=s[le];if(s.hasOwnProperty(le)&&fe!=null)switch(le){case"checked":break;case"value":break;case"defaultValue":X=fe;default:l.hasOwnProperty(le)||bt(t,i,le,null,l,fe)}}for(var se in l){var le=l[se];if(fe=s[se],l.hasOwnProperty(se)&&(le!=null||fe!=null))switch(se){case"type":w=le;break;case"name":m=le;break;case"checked":re=le;break;case"defaultChecked":ue=le;break;case"value":O=le;break;case"defaultValue":z=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(a(137,i));break;default:le!==fe&&bt(t,i,se,le,l,fe)}}Co(t,O,z,X,re,ue,w,m);return;case"select":le=O=z=se=null;for(w in s)if(X=s[w],s.hasOwnProperty(w)&&X!=null)switch(w){case"value":break;case"multiple":le=X;default:l.hasOwnProperty(w)||bt(t,i,w,null,l,X)}for(m in l)if(w=l[m],X=s[m],l.hasOwnProperty(m)&&(w!=null||X!=null))switch(m){case"value":se=w;break;case"defaultValue":z=w;break;case"multiple":O=w;default:w!==X&&bt(t,i,m,w,l,X)}i=z,s=O,l=le,se!=null?Cn(t,!!s,se,!1):!!l!=!!s&&(i!=null?Cn(t,!!s,i,!0):Cn(t,!!s,s?[]:"",!1));return;case"textarea":le=se=null;for(z in s)if(m=s[z],s.hasOwnProperty(z)&&m!=null&&!l.hasOwnProperty(z))switch(z){case"value":break;case"children":break;default:bt(t,i,z,null,l,m)}for(O in l)if(m=l[O],w=s[O],l.hasOwnProperty(O)&&(m!=null||w!=null))switch(O){case"value":se=m;break;case"defaultValue":le=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(a(91));break;default:m!==w&&bt(t,i,O,m,l,w)}ec(t,se,le);return;case"option":for(var Ae in s)se=s[Ae],s.hasOwnProperty(Ae)&&se!=null&&!l.hasOwnProperty(Ae)&&(Ae==="selected"?t.selected=!1:bt(t,i,Ae,null,l,se));for(X in l)se=l[X],le=s[X],l.hasOwnProperty(X)&&se!==le&&(se!=null||le!=null)&&(X==="selected"?t.selected=se&&typeof se!="function"&&typeof se!="symbol":bt(t,i,X,se,l,le));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 ze in s)se=s[ze],s.hasOwnProperty(ze)&&se!=null&&!l.hasOwnProperty(ze)&&bt(t,i,ze,null,l,se);for(re in l)if(se=l[re],le=s[re],l.hasOwnProperty(re)&&se!==le&&(se!=null||le!=null))switch(re){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(a(137,i));break;default:bt(t,i,re,se,l,le)}return;default:if(qr(i)){for(var yt in s)se=s[yt],s.hasOwnProperty(yt)&&se!==void 0&&!l.hasOwnProperty(yt)&&cf(t,i,yt,void 0,l,se);for(ue in l)se=l[ue],le=s[ue],!l.hasOwnProperty(ue)||se===le||se===void 0&&le===void 0||cf(t,i,ue,se,l,le);return}}for(var ne in s)se=s[ne],s.hasOwnProperty(ne)&&se!=null&&!l.hasOwnProperty(ne)&&bt(t,i,ne,null,l,se);for(fe in l)se=l[fe],le=s[fe],!l.hasOwnProperty(fe)||se===le||se==null&&le==null||bt(t,i,fe,se,l,le)}function x0(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function tE(){if(typeof performance.getEntriesByType=="function"){for(var t=0,i=0,s=performance.getEntriesByType("resource"),l=0;l<s.length;l++){var m=s[l],w=m.transferSize,O=m.initiatorType,z=m.duration;if(w&&z&&x0(O)){for(O=0,z=m.responseEnd,l+=1;l<s.length;l++){var X=s[l],re=X.startTime;if(re>z)break;var ue=X.transferSize,fe=X.initiatorType;ue&&x0(fe)&&(X=X.responseEnd,O+=ue*(X<z?1:(z-re)/(X-re)))}if(--l,i+=8*(w+O)/(m.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 uf=null,hf=null;function Zc(t){return t.nodeType===9?t:t.ownerDocument}function E0(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 T0(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 df(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 ff=null;function nE(){var t=window.event;return t&&t.type==="popstate"?t===ff?!1:(ff=t,!0):(ff=null,!1)}var A0=typeof setTimeout=="function"?setTimeout:void 0,iE=typeof clearTimeout=="function"?clearTimeout:void 0,k0=typeof Promise=="function"?Promise:void 0,rE=typeof queueMicrotask=="function"?queueMicrotask:typeof k0<"u"?function(t){return k0.resolve(null).then(t).catch(sE)}:A0;function sE(t){setTimeout(function(){throw t})}function cs(t){return t==="head"}function R0(t,i){var s=i,l=0;do{var m=s.nextSibling;if(t.removeChild(s),m&&m.nodeType===8)if(s=m.data,s==="/$"||s==="/&"){if(l===0){t.removeChild(m),Fa(i);return}l--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")l++;else if(s==="html")al(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,al(s);for(var w=s.firstChild;w;){var O=w.nextSibling,z=w.nodeName;w[Yi]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&w.rel.toLowerCase()==="stylesheet"||s.removeChild(w),w=O}}else s==="body"&&al(t.ownerDocument.body);s=m}while(s);Fa(i)}function L0(t,i){var s=t;t=0;do{var l=s.nextSibling;if(s.nodeType===1?i?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(i?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),l&&l.nodeType===8)if(s=l.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=l}while(s)}function pf(t){var i=t.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var s=i;switch(i=i.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":pf(s),De(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function aE(t,i,s,l){for(;t.nodeType===1;){var m=s;if(t.nodeName.toLowerCase()!==i.toLowerCase()){if(!l&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(l){if(!t[Yi])switch(i){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(w=t.getAttribute("rel"),w==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(w!==m.rel||t.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||t.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||t.getAttribute("title")!==(m.title==null?null:m.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(w=t.getAttribute("src"),(w!==(m.src==null?null:m.src)||t.getAttribute("type")!==(m.type==null?null:m.type)||t.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&w&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(i==="input"&&t.type==="hidden"){var w=m.name==null?null:""+m.name;if(m.type==="hidden"&&t.getAttribute("name")===w)return t}else return t;if(t=xi(t.nextSibling),t===null)break}return null}function oE(t,i,s){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=xi(t.nextSibling),t===null))return null;return t}function M0(t,i){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=xi(t.nextSibling),t===null))return null;return t}function gf(t){return t.data==="$?"||t.data==="$~"}function mf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function lE(t,i){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=i;else if(t.data!=="$?"||s.readyState!=="loading")i();else{var l=function(){i(),s.removeEventListener("DOMContentLoaded",l)};s.addEventListener("DOMContentLoaded",l),t._reactRetry=l}}function xi(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 _f=null;function D0(t){t=t.nextSibling;for(var i=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(i===0)return xi(t.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}t=t.nextSibling}return null}function O0(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(i===0)return t;i--}else s!=="/$"&&s!=="/&"||i++}t=t.previousSibling}return null}function N0(t,i,s){switch(i=Zc(s),t){case"html":if(t=i.documentElement,!t)throw Error(a(452));return t;case"head":if(t=i.head,!t)throw Error(a(453));return t;case"body":if(t=i.body,!t)throw Error(a(454));return t;default:throw Error(a(451))}}function al(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);De(t)}var Ei=new Map,B0=new Set;function Jc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Lr=V.d;V.d={f:cE,r:uE,D:hE,C:dE,L:fE,m:pE,X:mE,S:gE,M:_E};function cE(){var t=Lr.f(),i=Fc();return t||i}function uE(t){var i=pe(t);i!==null&&i.tag===5&&i.type==="form"?J_(i):Lr.r(t)}var Pa=typeof document>"u"?null:document;function I0(t,i,s){var l=Pa;if(l&&typeof i=="string"&&i){var m=Wn(i);m='link[rel="'+t+'"][href="'+m+'"]',typeof s=="string"&&(m+='[crossorigin="'+s+'"]'),B0.has(m)||(B0.add(m),t={rel:t,crossOrigin:s,href:i},l.querySelector(m)===null&&(i=l.createElement("link"),An(i,"link",t),Ze(i),l.head.appendChild(i)))}}function hE(t){Lr.D(t),I0("dns-prefetch",t,null)}function dE(t,i){Lr.C(t,i),I0("preconnect",t,i)}function fE(t,i,s){Lr.L(t,i,s);var l=Pa;if(l&&t&&i){var m='link[rel="preload"][as="'+Wn(i)+'"]';i==="image"&&s&&s.imageSrcSet?(m+='[imagesrcset="'+Wn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(m+='[imagesizes="'+Wn(s.imageSizes)+'"]')):m+='[href="'+Wn(t)+'"]';var w=m;switch(i){case"style":w=Ha(t);break;case"script":w=Ua(t)}Ei.has(w)||(t=g({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:t,as:i},s),Ei.set(w,t),l.querySelector(m)!==null||i==="style"&&l.querySelector(ol(w))||i==="script"&&l.querySelector(ll(w))||(i=l.createElement("link"),An(i,"link",t),Ze(i),l.head.appendChild(i)))}}function pE(t,i){Lr.m(t,i);var s=Pa;if(s&&t){var l=i&&typeof i.as=="string"?i.as:"script",m='link[rel="modulepreload"][as="'+Wn(l)+'"][href="'+Wn(t)+'"]',w=m;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=Ua(t)}if(!Ei.has(w)&&(t=g({rel:"modulepreload",href:t},i),Ei.set(w,t),s.querySelector(m)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(ll(w)))return}l=s.createElement("link"),An(l,"link",t),Ze(l),s.head.appendChild(l)}}}function gE(t,i,s){Lr.S(t,i,s);var l=Pa;if(l&&t){var m=st(l).hoistableStyles,w=Ha(t);i=i||"default";var O=m.get(w);if(!O){var z={loading:0,preload:null};if(O=l.querySelector(ol(w)))z.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":i},s),(s=Ei.get(w))&&vf(t,s);var X=O=l.createElement("link");Ze(X),An(X,"link",t),X._p=new Promise(function(re,ue){X.onload=re,X.onerror=ue}),X.addEventListener("load",function(){z.loading|=1}),X.addEventListener("error",function(){z.loading|=2}),z.loading|=4,Qc(O,i,l)}O={type:"stylesheet",instance:O,count:1,state:z},m.set(w,O)}}}function mE(t,i){Lr.X(t,i);var s=Pa;if(s&&t){var l=st(s).hoistableScripts,m=Ua(t),w=l.get(m);w||(w=s.querySelector(ll(m)),w||(t=g({src:t,async:!0},i),(i=Ei.get(m))&&bf(t,i),w=s.createElement("script"),Ze(w),An(w,"link",t),s.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},l.set(m,w))}}function _E(t,i){Lr.M(t,i);var s=Pa;if(s&&t){var l=st(s).hoistableScripts,m=Ua(t),w=l.get(m);w||(w=s.querySelector(ll(m)),w||(t=g({src:t,async:!0,type:"module"},i),(i=Ei.get(m))&&bf(t,i),w=s.createElement("script"),Ze(w),An(w,"link",t),s.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},l.set(m,w))}}function j0(t,i,s,l){var m=(m=_e.current)?Jc(m):null;if(!m)throw Error(a(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=Ha(s.href),s=st(m).hoistableStyles,l=s.get(i),l||(l={type:"style",instance:null,count:0,state:null},s.set(i,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=Ha(s.href);var w=st(m).hoistableStyles,O=w.get(t);if(O||(m=m.ownerDocument||m,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(t,O),(w=m.querySelector(ol(t)))&&!w._p&&(O.instance=w,O.state.loading=5),Ei.has(t)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Ei.set(t,s),w||vE(m,t,s,O.state))),i&&l===null)throw Error(a(528,""));return O}if(i&&l!==null)throw Error(a(529,""));return null;case"script":return i=s.async,s=s.src,typeof s=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Ua(s),s=st(m).hoistableScripts,l=s.get(i),l||(l={type:"script",instance:null,count:0,state:null},s.set(i,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,t))}}function Ha(t){return'href="'+Wn(t)+'"'}function ol(t){return'link[rel="stylesheet"]['+t+"]"}function z0(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function vE(t,i,s,l){t.querySelector('link[rel="preload"][as="style"]['+i+"]")?l.loading=1:(i=t.createElement("link"),l.preload=i,i.addEventListener("load",function(){return l.loading|=1}),i.addEventListener("error",function(){return l.loading|=2}),An(i,"link",s),Ze(i),t.head.appendChild(i))}function Ua(t){return'[src="'+Wn(t)+'"]'}function ll(t){return"script[async]"+t}function $0(t,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var l=t.querySelector('style[data-href~="'+Wn(s.href)+'"]');if(l)return i.instance=l,Ze(l),l;var m=g({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),Ze(l),An(l,"style",m),Qc(l,s.precedence,t),i.instance=l;case"stylesheet":m=Ha(s.href);var w=t.querySelector(ol(m));if(w)return i.state.loading|=4,i.instance=w,Ze(w),w;l=z0(s),(m=Ei.get(m))&&vf(l,m),w=(t.ownerDocument||t).createElement("link"),Ze(w);var O=w;return O._p=new Promise(function(z,X){O.onload=z,O.onerror=X}),An(w,"link",l),i.state.loading|=4,Qc(w,s.precedence,t),i.instance=w;case"script":return w=Ua(s.src),(m=t.querySelector(ll(w)))?(i.instance=m,Ze(m),m):(l=s,(m=Ei.get(w))&&(l=g({},s),bf(l,m)),t=t.ownerDocument||t,m=t.createElement("script"),Ze(m),An(m,"link",l),t.head.appendChild(m),i.instance=m);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(l=i.instance,i.state.loading|=4,Qc(l,s.precedence,t));return i.instance}function Qc(t,i,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=l.length?l[l.length-1]:null,w=m,O=0;O<l.length;O++){var z=l[O];if(z.dataset.precedence===i)w=z;else if(w!==m)break}w?w.parentNode.insertBefore(t,w.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(t,i.firstChild))}function vf(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function bf(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var eu=null;function P0(t,i,s){if(eu===null){var l=new Map,m=eu=new Map;m.set(s,l)}else m=eu,l=m.get(s),l||(l=new Map,m.set(s,l));if(l.has(t))return l;for(l.set(t,null),s=s.getElementsByTagName(t),m=0;m<s.length;m++){var w=s[m];if(!(w[Yi]||w[At]||t==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var O=w.getAttribute(i)||"";O=t+O;var z=l.get(O);z?z.push(w):l.set(O,[w])}}return l}function H0(t,i,s){t=t.ownerDocument||t,t.head.insertBefore(s,i==="title"?t.querySelector("head > title"):null)}function bE(t,i,s){if(s===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;return i.rel==="stylesheet"?(t=i.disabled,typeof i.precedence=="string"&&t==null):!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 U0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function yE(t,i,s,l){if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var m=Ha(l.href),w=i.querySelector(ol(m));if(w){i=w._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(t.count++,t=tu.bind(t),i.then(t,t)),s.state.loading|=4,s.instance=w,Ze(w);return}w=i.ownerDocument||i,l=z0(l),(m=Ei.get(m))&&vf(l,m),w=w.createElement("link"),Ze(w);var O=w;O._p=new Promise(function(z,X){O.onload=z,O.onerror=X}),An(w,"link",l),s.instance=w}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=tu.bind(t),i.addEventListener("load",s),i.addEventListener("error",s))}}var yf=0;function SE(t,i){return t.stylesheets&&t.count===0&&iu(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var l=setTimeout(function(){if(t.stylesheets&&iu(t,t.stylesheets),t.unsuspend){var w=t.unsuspend;t.unsuspend=null,w()}},6e4+i);0<t.imgBytes&&yf===0&&(yf=62500*tE());var m=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&iu(t,t.stylesheets),t.unsuspend)){var w=t.unsuspend;t.unsuspend=null,w()}},(t.imgBytes>yf?50:800)+i);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(m)}}:null}function tu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)iu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var nu=null;function iu(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,nu=new Map,i.forEach(wE,t),nu=null,tu.call(t))}function wE(t,i){if(!(i.state.loading&4)){var s=nu.get(t);if(s)var l=s.get(null);else{s=new Map,nu.set(t,s);for(var m=t.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<m.length;w++){var O=m[w];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(s.set(O.dataset.precedence,O),l=O)}l&&s.set(null,l)}m=i.instance,O=m.getAttribute("data-precedence"),w=s.get(O)||l,w===l&&s.set(null,m),s.set(O,m),this.count++,l=tu.bind(this),m.addEventListener("load",l),m.addEventListener("error",l),w?w.parentNode.insertBefore(m,w.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(m,t.firstChild)),i.state.loading|=4}}var cl={$$typeof:b,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function CE(t,i,s,l,m,w,O,z,X){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=wt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wt(0),this.hiddenUpdates=wt(null),this.identifierPrefix=l,this.onUncaughtError=m,this.onCaughtError=w,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function F0(t,i,s,l,m,w,O,z,X,re,ue,fe){return t=new CE(t,i,s,O,X,re,ue,fe,z),i=1,w===!0&&(i|=24),w=li(3,null,null,i),t.current=w,w.stateNode=t,i=Jh(),i.refCount++,t.pooledCache=i,i.refCount++,w.memoizedState={element:l,isDehydrated:s,cache:i},nd(w),t}function q0(t){return t?(t=ba,t):ba}function W0(t,i,s,l,m,w){m=q0(m),l.context===null?l.context=m:l.pendingContext=m,l=Jr(i),l.payload={element:s},w=w===void 0?null:w,w!==null&&(l.callback=w),s=Qr(t,l,i),s!==null&&(Zn(s,t,i),Ho(s,t,i))}function G0(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<i?s:i}}function Sf(t,i){G0(t,i),(t=t.alternate)&&G0(t,i)}function K0(t){if(t.tag===13||t.tag===31){var i=Ns(t,67108864);i!==null&&Zn(i,t,67108864),Sf(t,67108864)}}function V0(t){if(t.tag===13||t.tag===31){var i=fi();i=et(i);var s=Ns(t,i);s!==null&&Zn(s,t,i),Sf(t,i)}}var ru=!0;function xE(t,i,s,l){var m=q.T;q.T=null;var w=V.p;try{V.p=2,wf(t,i,s,l)}finally{V.p=w,q.T=m}}function EE(t,i,s,l){var m=q.T;q.T=null;var w=V.p;try{V.p=8,wf(t,i,s,l)}finally{V.p=w,q.T=m}}function wf(t,i,s,l){if(ru){var m=Cf(l);if(m===null)lf(t,i,l,su,s),X0(t,l);else if(AE(m,t,i,s,l))l.stopPropagation();else if(X0(t,l),i&4&&-1<TE.indexOf(t)){for(;m!==null;){var w=pe(m);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var O=rn(w.pendingLanes);if(O!==0){var z=w;for(z.pendingLanes|=2,z.entangledLanes|=2;O;){var X=1<<31-Pt(O);z.entanglements[1]|=X,O&=~X}Qi(w),(dt&6)===0&&(Hc=ht()+500,il(0))}}break;case 31:case 13:z=Ns(w,2),z!==null&&Zn(z,w,2),Fc(),Sf(w,2)}if(w=Cf(l),w===null&&lf(t,i,l,su,s),w===m)break;m=w}m!==null&&l.stopPropagation()}else lf(t,i,l,null,s)}}function Cf(t){return t=We(t),xf(t)}var su=null;function xf(t){if(su=null,t=K(t),t!==null){var i=f(t);if(i===null)t=null;else{var s=i.tag;if(s===13){if(t=_(i),t!==null)return t;t=null}else if(s===31){if(t=c(i),t!==null)return t;t=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null)}}return su=t,null}function Y0(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(Vt()){case zt:return 2;case $t:return 8;case nn:case Bi:return 32;case Dn:return 268435456;default:return 32}default:return 32}}var Ef=!1,us=null,hs=null,ds=null,ul=new Map,hl=new Map,fs=[],TE="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 X0(t,i){switch(t){case"focusin":case"focusout":us=null;break;case"dragenter":case"dragleave":hs=null;break;case"mouseover":case"mouseout":ds=null;break;case"pointerover":case"pointerout":ul.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":hl.delete(i.pointerId)}}function dl(t,i,s,l,m,w){return t===null||t.nativeEvent!==w?(t={blockedOn:i,domEventName:s,eventSystemFlags:l,nativeEvent:w,targetContainers:[m]},i!==null&&(i=pe(i),i!==null&&K0(i)),t):(t.eventSystemFlags|=l,i=t.targetContainers,m!==null&&i.indexOf(m)===-1&&i.push(m),t)}function AE(t,i,s,l,m){switch(i){case"focusin":return us=dl(us,t,i,s,l,m),!0;case"dragenter":return hs=dl(hs,t,i,s,l,m),!0;case"mouseover":return ds=dl(ds,t,i,s,l,m),!0;case"pointerover":var w=m.pointerId;return ul.set(w,dl(ul.get(w)||null,t,i,s,l,m)),!0;case"gotpointercapture":return w=m.pointerId,hl.set(w,dl(hl.get(w)||null,t,i,s,l,m)),!0}return!1}function Z0(t){var i=K(t.target);if(i!==null){var s=f(i);if(s!==null){if(i=s.tag,i===13){if(i=_(s),i!==null){t.blockedOn=i,dr(t.priority,function(){V0(s)});return}}else if(i===31){if(i=c(s),i!==null){t.blockedOn=i,dr(t.priority,function(){V0(s)});return}}else if(i===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function au(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var s=Cf(t.nativeEvent);if(s===null){s=t.nativeEvent;var l=new s.constructor(s.type,s);Re=l,s.target.dispatchEvent(l),Re=null}else return i=pe(s),i!==null&&K0(i),t.blockedOn=s,!1;i.shift()}return!0}function J0(t,i,s){au(t)&&s.delete(i)}function kE(){Ef=!1,us!==null&&au(us)&&(us=null),hs!==null&&au(hs)&&(hs=null),ds!==null&&au(ds)&&(ds=null),ul.forEach(J0),hl.forEach(J0)}function ou(t,i){t.blockedOn===i&&(t.blockedOn=null,Ef||(Ef=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,kE)))}var lu=null;function Q0(t){lu!==t&&(lu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){lu===t&&(lu=null);for(var i=0;i<t.length;i+=3){var s=t[i],l=t[i+1],m=t[i+2];if(typeof l!="function"){if(xf(l||s)===null)continue;break}var w=pe(s);w!==null&&(t.splice(i,3),i-=3,wd(w,{pending:!0,data:m,method:s.method,action:l},l,m))}}))}function Fa(t){function i(X){return ou(X,t)}us!==null&&ou(us,t),hs!==null&&ou(hs,t),ds!==null&&ou(ds,t),ul.forEach(i),hl.forEach(i);for(var s=0;s<fs.length;s++){var l=fs[s];l.blockedOn===t&&(l.blockedOn=null)}for(;0<fs.length&&(s=fs[0],s.blockedOn===null);)Z0(s),s.blockedOn===null&&fs.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(l=0;l<s.length;l+=3){var m=s[l],w=s[l+1],O=m[Et]||null;if(typeof w=="function")O||Q0(s);else if(O){var z=null;if(w&&w.hasAttribute("formAction")){if(m=w,O=w[Et]||null)z=O.formAction;else if(xf(m)!==null)continue}else z=O.action;typeof z=="function"?s[l+1]=z:(s.splice(l,3),l-=3),Q0(s)}}}function eb(){function t(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(O){return m=O})},focusReset:"manual",scroll:"manual"})}function i(){m!==null&&(m(),m=null),l||setTimeout(s,20)}function s(){if(!l&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,m=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){l=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),m!==null&&(m(),m=null)}}}function Tf(t){this._internalRoot=t}cu.prototype.render=Tf.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,l=fi();W0(s,l,t,i,null,null)},cu.prototype.unmount=Tf.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),Fc(),i[ji]=null}};function cu(t){this._internalRoot=t}cu.prototype.unstable_scheduleHydration=function(t){if(t){var i=hr();t={blockedOn:null,target:t,priority:i};for(var s=0;s<fs.length&&i!==0&&i<fs[s].priority;s++);fs.splice(s,0,t),s===0&&Z0(t)}};var tb=n.version;if(tb!=="19.2.7")throw Error(a(527,tb,"19.2.7"));V.findDOMNode=function(t){var i=t._reactInternals;if(i===void 0)throw typeof t.render=="function"?Error(a(188)):(t=Object.keys(t).join(","),Error(a(268,t)));return t=d(i),t=t!==null?S(t):null,t=t===null?null:t.stateNode,t};var RE={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var uu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!uu.isDisabled&&uu.supportsFiber)try{Un=uu.inject(RE),Yt=uu}catch{}}return pl.createRoot=function(t,i){if(!o(t))throw Error(a(299));var s=!1,l="",m=lv,w=cv,O=uv;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(l=i.identifierPrefix),i.onUncaughtError!==void 0&&(m=i.onUncaughtError),i.onCaughtError!==void 0&&(w=i.onCaughtError),i.onRecoverableError!==void 0&&(O=i.onRecoverableError)),i=F0(t,1,!1,null,null,s,l,null,m,w,O,eb),t[ji]=i.current,of(t),new Tf(i)},pl.hydrateRoot=function(t,i,s){if(!o(t))throw Error(a(299));var l=!1,m="",w=lv,O=cv,z=uv,X=null;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(m=s.identifierPrefix),s.onUncaughtError!==void 0&&(w=s.onUncaughtError),s.onCaughtError!==void 0&&(O=s.onCaughtError),s.onRecoverableError!==void 0&&(z=s.onRecoverableError),s.formState!==void 0&&(X=s.formState)),i=F0(t,1,!0,i,s??null,l,m,X,w,O,z,eb),i.context=q0(null),s=i.current,l=fi(),l=et(l),m=Jr(l),m.callback=null,Qr(s,m,l),s=l,i.current.lanes=s,pt(i,s),Qi(i),t[ji]=i.current,of(t),new cu(i)},pl.version="19.2.7",pl}var hb;function $E(){if(hb)return Rf.exports;hb=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(n){console.error(n)}}return e(),Rf.exports=zE(),Rf.exports}var PE=$E();var db="popstate";function fb(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function HE(e={}){function n(a,o){let f=o.state?.masked,{pathname:_,search:c,hash:u}=f||a.location;return Tp("",{pathname:_,search:c,hash:u},o.state&&o.state.usr||null,o.state&&o.state.key||"default",f?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,o){return typeof o=="string"?o:$l(o)}return FE(n,r,null,e)}function Bt(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Wi(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function UE(){return Math.random().toString(36).substring(2,10)}function pb(e,n){return{usr:e.state,key:e.key,idx:n,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Tp(e,n,r=null,a,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?po(n):n,state:r,key:n&&n.key||a||UE(),mask:o}}function $l({pathname:e="/",search:n="",hash:r=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function po(e){let n={};if(e){let r=e.indexOf("#");r>=0&&(n.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(n.search=e.substring(a),e=e.substring(0,a)),e&&(n.pathname=e)}return n}function FE(e,n,r,a={}){let{window:o=document.defaultView,v5Compat:f=!1}=a,_=o.history,c="POP",u=null,d=S();d==null&&(d=0,_.replaceState({..._.state,idx:d},""));function S(){return(_.state||{idx:null}).idx}function g(){c="POP";let p=S(),v=p==null?null:p-d;d=p,u&&u({action:c,location:x.location,delta:v})}function C(p,v){c="PUSH";let h=fb(p)?p:Tp(x.location,p,v);d=S()+1;let b=pb(h,d),T=x.createHref(h.mask||h);try{_.pushState(b,"",T)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;o.location.assign(T)}f&&u&&u({action:c,location:x.location,delta:1})}function E(p,v){c="REPLACE";let h=fb(p)?p:Tp(x.location,p,v);d=S();let b=pb(h,d),T=x.createHref(h.mask||h);_.replaceState(b,"",T),f&&u&&u({action:c,location:x.location,delta:0})}function A(p){return qE(o,p)}let x={get action(){return c},get location(){return e(o,_)},listen(p){if(u)throw new Error("A history only accepts one active listener");return o.addEventListener(db,g),u=p,()=>{o.removeEventListener(db,g),u=null}},createHref(p){return n(o,p)},createURL:A,encodeLocation(p){let v=A(p);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:C,replace:E,go(p){return _.go(p)}};return x}function qE(e,n,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),Bt(a,"No window.location.(origin|href) available to create URL");let o=typeof n=="string"?n:$l(n);return o=o.replace(/ $/,"%20"),!r&&o.startsWith("//")&&(o=a+o),new URL(o,a)}function Vy(e,n,r="/"){return WE(e,n,r,!1)}function WE(e,n,r,a,o){let f=typeof n=="string"?po(n):n,_=Pr(f.pathname||"/",r);if(_==null)return null;let c=GE(e),u=null,d=r5(_);for(let S=0;u==null&&S<c.length;++S)u=n5(c[S],d,a);return u}function GE(e){let n=Yy(e);return KE(n),n}function Yy(e,n=[],r=[],a="",o=!1){let f=(_,c,u=o,d)=>{let S={relativePath:d===void 0?_.path||"":d,caseSensitive:_.caseSensitive===!0,childrenIndex:c,route:_};if(S.relativePath.startsWith("/")){if(!S.relativePath.startsWith(a)&&u)return;Bt(S.relativePath.startsWith(a),`Absolute route path "${S.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),S.relativePath=S.relativePath.slice(a.length)}let g=qi([a,S.relativePath]),C=r.concat(S);_.children&&_.children.length>0&&(Bt(_.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),Yy(_.children,n,C,g,u)),!(_.path==null&&!_.index)&&n.push({path:g,score:e5(g,_.index),routesMeta:C})};return e.forEach((_,c)=>{if(_.path===""||!_.path?.includes("?"))f(_,c);else for(let u of Xy(_.path))f(_,c,!0,u)}),n}function Xy(e){let n=e.split("/");if(n.length===0)return[];let[r,...a]=n,o=r.endsWith("?"),f=r.replace(/\?$/,"");if(a.length===0)return o?[f,""]:[f];let _=Xy(a.join("/")),c=[];return c.push(..._.map(u=>u===""?f:[f,u].join("/"))),o&&c.push(..._),c.map(u=>e.startsWith("/")&&u===""?"/":u)}function KE(e){e.sort((n,r)=>n.score!==r.score?r.score-n.score:t5(n.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var VE=/^:[\w-]+$/,YE=3,XE=2,ZE=1,JE=10,QE=-2,gb=e=>e==="*";function e5(e,n){let r=e.split("/"),a=r.length;return r.some(gb)&&(a+=QE),n&&(a+=XE),r.filter(o=>!gb(o)).reduce((o,f)=>o+(VE.test(f)?YE:f===""?ZE:JE),a)}function t5(e,n){return e.length===n.length&&e.slice(0,-1).every((a,o)=>a===n[o])?e[e.length-1]-n[n.length-1]:0}function n5(e,n,r=!1){let{routesMeta:a}=e,o={},f="/",_=[];for(let c=0;c<a.length;++c){let u=a[c],d=c===a.length-1,S=f==="/"?n:n.slice(f.length)||"/",g=qu({path:u.relativePath,caseSensitive:u.caseSensitive,end:d},S),C=u.route;if(!g&&d&&r&&!a[a.length-1].route.index&&(g=qu({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},S)),!g)return null;Object.assign(o,g.params),_.push({params:o,pathname:qi([f,g.pathname]),pathnameBase:l5(qi([f,g.pathnameBase])),route:C}),g.pathnameBase!=="/"&&(f=qi([f,g.pathnameBase]))}return _}function qu(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=i5(e.path,e.caseSensitive,e.end),o=n.match(r);if(!o)return null;let f=o[0],_=f.replace(/(.)\/+$/,"$1"),c=o.slice(1);return{params:a.reduce((d,{paramName:S,isOptional:g},C)=>{if(S==="*"){let A=c[C]||"";_=f.slice(0,f.length-A.length).replace(/(.)\/+$/,"$1")}const E=c[C];return g&&!E?d[S]=void 0:d[S]=(E||"").replace(/%2F/g,"/"),d},{}),pathname:f,pathnameBase:_,pattern:e}}function i5(e,n=!1,r=!0){Wi(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 a=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(_,c,u,d,S)=>{if(a.push({paramName:c,isOptional:u!=null}),u){let g=S.charAt(d+_.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,n?void 0:"i"),a]}function r5(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Wi(!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 (${n}).`),e}}function Pr(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let r=n.endsWith("/")?n.length-1:n.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}var s5=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function a5(e,n="/"){let{pathname:r,search:a="",hash:o=""}=typeof e=="string"?po(e):e,f;return r?(r=Zy(r),r.startsWith("/")?f=mb(r.substring(1),"/"):f=mb(r,n)):f=n,{pathname:f,search:c5(a),hash:u5(o)}}function mb(e,n){let r=Wu(n).split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function Of(e,n,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function o5(e){return e.filter((n,r)=>r===0||n.route.path&&n.route.path.length>0)}function Ng(e){let n=o5(e);return n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase)}function ch(e,n,r,a=!1){let o;typeof e=="string"?o=po(e):(o={...e},Bt(!o.pathname||!o.pathname.includes("?"),Of("?","pathname","search",o)),Bt(!o.pathname||!o.pathname.includes("#"),Of("#","pathname","hash",o)),Bt(!o.search||!o.search.includes("#"),Of("#","search","hash",o)));let f=e===""||o.pathname==="",_=f?"/":o.pathname,c;if(_==null)c=r;else{let g=n.length-1;if(!a&&_.startsWith("..")){let C=_.split("/");for(;C[0]==="..";)C.shift(),g-=1;o.pathname=C.join("/")}c=g>=0?n[g]:"/"}let u=a5(o,c),d=_&&_!=="/"&&_.endsWith("/"),S=(f||_===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(d||S)&&(u.pathname+="/"),u}var Zy=e=>e.replace(/\/\/+/g,"/"),qi=e=>Zy(e.join("/")),Wu=e=>e.replace(/\/+$/,""),l5=e=>Wu(e).replace(/^\/*/,"/"),c5=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,u5=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,h5=class{constructor(e,n,r,a=!1){this.status=e,this.statusText=n||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function d5(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function f5(e){let n=e.map(r=>r.route.path).filter(Boolean);return qi(n)||"/"}var Jy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Qy(e,n){let r=e;if(typeof r!="string"||!s5.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,o=!1;if(Jy)try{let f=new URL(window.location.href),_=r.startsWith("//")?new URL(f.protocol+r):new URL(r),c=Pr(_.pathname,n);_.origin===f.origin&&c!=null?r=c+_.search+_.hash:o=!0}catch{Wi(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:o,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var eS=["POST","PUT","PATCH","DELETE"];new Set(eS);var p5=["GET",...eS];new Set(p5);var go=H.createContext(null);go.displayName="DataRouter";var uh=H.createContext(null);uh.displayName="DataRouterState";var tS=H.createContext(!1);function g5(){return H.useContext(tS)}var nS=H.createContext({isTransitioning:!1});nS.displayName="ViewTransition";var m5=H.createContext(new Map);m5.displayName="Fetchers";var _5=H.createContext(null);_5.displayName="Await";var gi=H.createContext(null);gi.displayName="Navigation";var Kl=H.createContext(null);Kl.displayName="Location";var ar=H.createContext({outlet:null,matches:[],isDataRoute:!1});ar.displayName="Route";var Bg=H.createContext(null);Bg.displayName="RouteError";var iS="REACT_ROUTER_ERROR",v5="REDIRECT",b5="ROUTE_ERROR_RESPONSE";function y5(e){if(e.startsWith(`${iS}:${v5}:{`))try{let n=JSON.parse(e.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function S5(e){if(e.startsWith(`${iS}:${b5}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new h5(n.status,n.statusText,n.data)}catch{}}function w5(e,{relative:n}={}){Bt(mo(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=H.useContext(gi),{hash:o,pathname:f,search:_}=Vl(e,{relative:n}),c=f;return r!=="/"&&(c=f==="/"?r:qi([r,f])),a.createHref({pathname:c,search:_,hash:o})}function mo(){return H.useContext(Kl)!=null}function Oi(){return Bt(mo(),"useLocation() may be used only in the context of a <Router> component."),H.useContext(Kl).location}var rS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function sS(e){H.useContext(gi).static||H.useLayoutEffect(e)}function _o(){let{isDataRoute:e}=H.useContext(ar);return e?B5():C5()}function C5(){Bt(mo(),"useNavigate() may be used only in the context of a <Router> component.");let e=H.useContext(go),{basename:n,navigator:r}=H.useContext(gi),{matches:a}=H.useContext(ar),{pathname:o}=Oi(),f=JSON.stringify(Ng(a)),_=H.useRef(!1);return sS(()=>{_.current=!0}),H.useCallback((u,d={})=>{if(Wi(_.current,rS),!_.current)return;if(typeof u=="number"){r.go(u);return}let S=ch(u,JSON.parse(f),o,d.relative==="path");e==null&&n!=="/"&&(S.pathname=S.pathname==="/"?n:qi([n,S.pathname])),(d.replace?r.replace:r.push)(S,d.state,d)},[n,r,f,o,e])}H.createContext(null);function Vl(e,{relative:n}={}){let{matches:r}=H.useContext(ar),{pathname:a}=Oi(),o=JSON.stringify(Ng(r));return H.useMemo(()=>ch(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function x5(e,n){return aS(e,n)}function aS(e,n,r){Bt(mo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=H.useContext(gi),{matches:o}=H.useContext(ar),f=o[o.length-1],_=f?f.params:{},c=f?f.pathname:"/",u=f?f.pathnameBase:"/",d=f&&f.route;{let p=d&&d.path||"";lS(c,!d||p.endsWith("*")||p.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${p}">) 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.
10
+
11
+ Please change the parent <Route path="${p}"> to <Route path="${p==="/"?"*":`${p}/*`}">.`)}let S=Oi(),g;if(n){let p=typeof n=="string"?po(n):n;Bt(u==="/"||p.pathname?.startsWith(u),`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 "${u}" but pathname "${p.pathname}" was given in the \`location\` prop.`),g=p}else g=S;let C=g.pathname||"/",E=C;if(u!=="/"){let p=u.replace(/^\//,"").split("/");E="/"+C.replace(/^\//,"").split("/").slice(p.length).join("/")}let A=r&&r.state.matches.length?r.state.matches.map(p=>Object.assign(p,{route:r.manifest[p.route.id]||p.route})):Vy(e,{pathname:E});Wi(d||A!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Wi(A==null||A[A.length-1].route.element!==void 0||A[A.length-1].route.Component!==void 0||A[A.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let x=R5(A&&A.map(p=>Object.assign({},p,{params:Object.assign({},_,p.params),pathname:qi([u,a.encodeLocation?a.encodeLocation(p.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?u:qi([u,a.encodeLocation?a.encodeLocation(p.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:p.pathnameBase])})),o,r);return n&&x?H.createElement(Kl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...g},navigationType:"POP"}},x):x}function E5(){let e=N5(),n=d5(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:a},f={padding:"2px 4px",backgroundColor:a},_=null;return console.error("Error handled by React Router default ErrorBoundary:",e),_=H.createElement(H.Fragment,null,H.createElement("p",null,"💿 Hey developer 👋"),H.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",H.createElement("code",{style:f},"ErrorBoundary")," or"," ",H.createElement("code",{style:f},"errorElement")," prop on your route.")),H.createElement(H.Fragment,null,H.createElement("h2",null,"Unexpected Application Error!"),H.createElement("h3",{style:{fontStyle:"italic"}},n),r?H.createElement("pre",{style:o},r):null,_)}var T5=H.createElement(E5,null),oS=class extends H.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,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.onError?this.props.onError(e,n):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 r=S5(e.digest);r&&(e=r)}let n=e!==void 0?H.createElement(ar.Provider,{value:this.props.routeContext},H.createElement(Bg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?H.createElement(A5,{error:e},n):n}};oS.contextType=tS;var Nf=new WeakMap;function A5({children:e,error:n}){let{basename:r}=H.useContext(gi);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let a=y5(n.digest);if(a){let o=Nf.get(n);if(o)throw o;let f=Qy(a.location,r);if(Jy&&!Nf.get(n))if(f.isExternal||a.reloadDocument)window.location.href=f.absoluteURL||f.to;else{const _=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:a.replace}));throw Nf.set(n,_),_}return H.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return e}function k5({routeContext:e,match:n,children:r}){let a=H.useContext(go);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),H.createElement(ar.Provider,{value:e},r)}function R5(e,n=[],r){let a=r?.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(n.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let o=e,f=a?.errors;if(f!=null){let S=o.findIndex(g=>g.route.id&&f?.[g.route.id]!==void 0);Bt(S>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),o=o.slice(0,Math.min(o.length,S+1))}let _=!1,c=-1;if(r&&a){_=a.renderFallback;for(let S=0;S<o.length;S++){let g=o[S];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(c=S),g.route.id){let{loaderData:C,errors:E}=a,A=g.route.loader&&!C.hasOwnProperty(g.route.id)&&(!E||E[g.route.id]===void 0);if(g.route.lazy||A){r.isStatic&&(_=!0),c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}}let u=r?.onError,d=a&&u?(S,g)=>{u(S,{location:a.location,params:a.matches?.[0]?.params??{},pattern:f5(a.matches),errorInfo:g})}:void 0;return o.reduceRight((S,g,C)=>{let E,A=!1,x=null,p=null;a&&(E=f&&g.route.id?f[g.route.id]:void 0,x=g.route.errorElement||T5,_&&(c<0&&C===0?(lS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),A=!0,p=null):c===C&&(A=!0,p=g.route.hydrateFallbackElement||null)));let v=n.concat(o.slice(0,C+1)),h=()=>{let b;return E?b=x:A?b=p:g.route.Component?b=H.createElement(g.route.Component,null):g.route.element?b=g.route.element:b=S,H.createElement(k5,{match:g,routeContext:{outlet:S,matches:v,isDataRoute:a!=null},children:b})};return a&&(g.route.ErrorBoundary||g.route.errorElement||C===0)?H.createElement(oS,{location:a.location,revalidation:a.revalidation,component:x,error:E,children:h(),routeContext:{outlet:null,matches:v,isDataRoute:!0},onError:d}):h()},null)}function Ig(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function L5(e){let n=H.useContext(go);return Bt(n,Ig(e)),n}function M5(e){let n=H.useContext(uh);return Bt(n,Ig(e)),n}function D5(e){let n=H.useContext(ar);return Bt(n,Ig(e)),n}function jg(e){let n=D5(e),r=n.matches[n.matches.length-1];return Bt(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function O5(){return jg("useRouteId")}function N5(){let e=H.useContext(Bg),n=M5("useRouteError"),r=jg("useRouteError");return e!==void 0?e:n.errors?.[r]}function B5(){let{router:e}=L5("useNavigate"),n=jg("useNavigate"),r=H.useRef(!1);return sS(()=>{r.current=!0}),H.useCallback(async(o,f={})=>{Wi(r.current,rS),r.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:n,...f}))},[e,n])}var _b={};function lS(e,n,r){!n&&!_b[e]&&(_b[e]=!0,Wi(!1,r))}H.memo(I5);function I5({routes:e,manifest:n,future:r,state:a,isStatic:o,onError:f}){return aS(e,void 0,{manifest:n,state:a,isStatic:o,onError:f})}function vb({to:e,replace:n,state:r,relative:a}){Bt(mo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=H.useContext(gi);Wi(!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:f}=H.useContext(ar),{pathname:_}=Oi(),c=_o(),u=ch(e,Ng(f),_,a==="path"),d=JSON.stringify(u);return H.useEffect(()=>{c(JSON.parse(d),{replace:n,state:r,relative:a})},[c,d,a,n,r]),null}function Xs(e){Bt(!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 j5({basename:e="/",children:n=null,location:r,navigationType:a="POP",navigator:o,static:f=!1,useTransitions:_}){Bt(!mo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),u=H.useMemo(()=>({basename:c,navigator:o,static:f,useTransitions:_,future:{}}),[c,o,f,_]);typeof r=="string"&&(r=po(r));let{pathname:d="/",search:S="",hash:g="",state:C=null,key:E="default",mask:A}=r,x=H.useMemo(()=>{let p=Pr(d,c);return p==null?null:{location:{pathname:p,search:S,hash:g,state:C,key:E,mask:A},navigationType:a}},[c,d,S,g,C,E,a,A]);return Wi(x!=null,`<Router basename="${c}"> is not able to match the URL "${d}${S}${g}" because it does not start with the basename, so the <Router> won't render anything.`),x==null?null:H.createElement(gi.Provider,{value:u},H.createElement(Kl.Provider,{children:n,value:x}))}function z5({children:e,location:n}){return x5(Ap(e),n)}function Ap(e,n=[]){let r=[];return H.Children.forEach(e,(a,o)=>{if(!H.isValidElement(a))return;let f=[...n,o];if(a.type===H.Fragment){r.push.apply(r,Ap(a.props.children,f));return}Bt(a.type===Xs,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Bt(!a.props.index||!a.props.children,"An index route cannot have child routes.");let _={id:a.props.id||f.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(_.children=Ap(a.props.children,f)),r.push(_)}),r}var Ru="get",Lu="application/x-www-form-urlencoded";function hh(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function $5(e){return hh(e)&&e.tagName.toLowerCase()==="button"}function P5(e){return hh(e)&&e.tagName.toLowerCase()==="form"}function H5(e){return hh(e)&&e.tagName.toLowerCase()==="input"}function U5(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function F5(e,n){return e.button===0&&(!n||n==="_self")&&!U5(e)}var hu=null;function q5(){if(hu===null)try{new FormData(document.createElement("form"),0),hu=!1}catch{hu=!0}return hu}var W5=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Bf(e){return e!=null&&!W5.has(e)?(Wi(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Lu}"`),null):e}function G5(e,n){let r,a,o,f,_;if(P5(e)){let c=e.getAttribute("action");a=c?Pr(c,n):null,r=e.getAttribute("method")||Ru,o=Bf(e.getAttribute("enctype"))||Lu,f=new FormData(e)}else if($5(e)||H5(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||c.getAttribute("action");if(a=u?Pr(u,n):null,r=e.getAttribute("formmethod")||c.getAttribute("method")||Ru,o=Bf(e.getAttribute("formenctype"))||Bf(c.getAttribute("enctype"))||Lu,f=new FormData(c,e),!q5()){let{name:d,type:S,value:g}=e;if(S==="image"){let C=d?`${d}.`:"";f.append(`${C}x`,"0"),f.append(`${C}y`,"0")}else d&&f.append(d,g)}}else{if(hh(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Ru,a=null,o=Lu,_=e}return f&&o==="text/plain"&&(_=f,f=void 0),{action:a,method:r.toLowerCase(),encType:o,formData:f,body:_}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function zg(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function cS(e,n,r,a){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${a}`:o.pathname=`${o.pathname}.${a}`:o.pathname==="/"?o.pathname=`_root.${a}`:n&&Pr(o.pathname,n)==="/"?o.pathname=`${Wu(n)}/_root.${a}`:o.pathname=`${Wu(o.pathname)}.${a}`,o}async function K5(e,n){if(e.id in n)return n[e.id];try{let r=await import(e.module);return n[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function V5(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 Y5(e,n,r){let a=await Promise.all(e.map(async o=>{let f=n.routes[o.route.id];if(f){let _=await K5(f,r);return _.links?_.links():[]}return[]}));return Q5(a.flat(1).filter(V5).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function bb(e,n,r,a,o,f){let _=(u,d)=>r[d]?u.route.id!==r[d].route.id:!0,c=(u,d)=>r[d].pathname!==u.pathname||r[d].route.path?.endsWith("*")&&r[d].params["*"]!==u.params["*"];return f==="assets"?n.filter((u,d)=>_(u,d)||c(u,d)):f==="data"?n.filter((u,d)=>{let S=a.routes[u.route.id];if(!S||!S.hasLoader)return!1;if(_(u,d)||c(u,d))return!0;if(u.route.shouldRevalidate){let g=u.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function X5(e,n,{includeHydrateFallback:r}={}){return Z5(e.map(a=>{let o=n.routes[a.route.id];if(!o)return[];let f=[o.module];return o.clientActionModule&&(f=f.concat(o.clientActionModule)),o.clientLoaderModule&&(f=f.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(f=f.concat(o.hydrateFallbackModule)),o.imports&&(f=f.concat(o.imports)),f}).flat(1))}function Z5(e){return[...new Set(e)]}function J5(e){let n={},r=Object.keys(e).sort();for(let a of r)n[a]=e[a];return n}function Q5(e,n){let r=new Set;return new Set(n),e.reduce((a,o)=>{let f=JSON.stringify(J5(o));return r.has(f)||(r.add(f),a.push({key:f,link:o})),a},[])}function $g(){let e=H.useContext(go);return zg(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function eT(){let e=H.useContext(uh);return zg(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Pg=H.createContext(void 0);Pg.displayName="FrameworkContext";function Hg(){let e=H.useContext(Pg);return zg(e,"You must render this element inside a <HydratedRouter> element"),e}function tT(e,n){let r=H.useContext(Pg),[a,o]=H.useState(!1),[f,_]=H.useState(!1),{onFocus:c,onBlur:u,onMouseEnter:d,onMouseLeave:S,onTouchStart:g}=n,C=H.useRef(null);H.useEffect(()=>{if(e==="render"&&_(!0),e==="viewport"){let x=v=>{v.forEach(h=>{_(h.isIntersecting)})},p=new IntersectionObserver(x,{threshold:.5});return C.current&&p.observe(C.current),()=>{p.disconnect()}}},[e]),H.useEffect(()=>{if(a){let x=setTimeout(()=>{_(!0)},100);return()=>{clearTimeout(x)}}},[a]);let E=()=>{o(!0)},A=()=>{o(!1),_(!1)};return r?e!=="intent"?[f,C,{}]:[f,C,{onFocus:gl(c,E),onBlur:gl(u,A),onMouseEnter:gl(d,E),onMouseLeave:gl(S,A),onTouchStart:gl(g,E)}]:[!1,C,{}]}function gl(e,n){return r=>{e&&e(r),r.defaultPrevented||n(r)}}function nT({page:e,...n}){let r=g5(),{router:a}=$g(),o=H.useMemo(()=>Vy(a.routes,e,a.basename),[a.routes,e,a.basename]);return o?r?H.createElement(rT,{page:e,matches:o,...n}):H.createElement(sT,{page:e,matches:o,...n}):null}function iT(e){let{manifest:n,routeModules:r}=Hg(),[a,o]=H.useState([]);return H.useEffect(()=>{let f=!1;return Y5(e,n,r).then(_=>{f||o(_)}),()=>{f=!0}},[e,n,r]),a}function rT({page:e,matches:n,...r}){let a=Oi(),{future:o}=Hg(),{basename:f}=$g(),_=H.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let c=cS(e,f,o.v8_trailingSlashAwareDataRequests,"rsc"),u=!1,d=[];for(let S of n)typeof S.route.shouldRevalidate=="function"?u=!0:d.push(S.route.id);return u&&d.length>0&&c.searchParams.set("_routes",d.join(",")),[c.pathname+c.search]},[f,o.v8_trailingSlashAwareDataRequests,e,a,n]);return H.createElement(H.Fragment,null,_.map(c=>H.createElement("link",{key:c,rel:"prefetch",as:"fetch",href:c,...r})))}function sT({page:e,matches:n,...r}){let a=Oi(),{future:o,manifest:f,routeModules:_}=Hg(),{basename:c}=$g(),{loaderData:u,matches:d}=eT(),S=H.useMemo(()=>bb(e,n,d,f,a,"data"),[e,n,d,f,a]),g=H.useMemo(()=>bb(e,n,d,f,a,"assets"),[e,n,d,f,a]),C=H.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let x=new Set,p=!1;if(n.forEach(h=>{let b=f.routes[h.route.id];!b||!b.hasLoader||(!S.some(T=>T.route.id===h.route.id)&&h.route.id in u&&_[h.route.id]?.shouldRevalidate||b.hasClientLoader?p=!0:x.add(h.route.id))}),x.size===0)return[];let v=cS(e,c,o.v8_trailingSlashAwareDataRequests,"data");return p&&x.size>0&&v.searchParams.set("_routes",n.filter(h=>x.has(h.route.id)).map(h=>h.route.id).join(",")),[v.pathname+v.search]},[c,o.v8_trailingSlashAwareDataRequests,u,a,f,S,n,e,_]),E=H.useMemo(()=>X5(g,f),[g,f]),A=iT(g);return H.createElement(H.Fragment,null,C.map(x=>H.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...r})),E.map(x=>H.createElement("link",{key:x,rel:"modulepreload",href:x,...r})),A.map(({key:x,link:p})=>H.createElement("link",{key:x,nonce:r.nonce,...p,crossOrigin:p.crossOrigin??r.crossOrigin})))}function aT(...e){return n=>{e.forEach(r=>{typeof r=="function"?r(n):r!=null&&(r.current=n)})}}var oT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{oT&&(window.__reactRouterVersion="7.17.0")}catch{}function lT({basename:e,children:n,useTransitions:r,window:a}){let o=H.useRef();o.current==null&&(o.current=HE({window:a,v5Compat:!0}));let f=o.current,[_,c]=H.useState({action:f.action,location:f.location}),u=H.useCallback(d=>{r===!1?c(d):H.startTransition(()=>c(d))},[r]);return H.useLayoutEffect(()=>f.listen(u),[f,u]),H.createElement(j5,{basename:e,children:n,location:_.location,navigationType:_.action,navigator:f,useTransitions:r})}var uS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pl=H.forwardRef(function({onClick:n,discover:r="render",prefetch:a="none",relative:o,reloadDocument:f,replace:_,mask:c,state:u,target:d,to:S,preventScrollReset:g,viewTransition:C,defaultShouldRevalidate:E,...A},x){let{basename:p,navigator:v,useTransitions:h}=H.useContext(gi),b=typeof S=="string"&&uS.test(S),T=Qy(S,p);S=T.to;let R=w5(S,{relative:o}),L=Oi(),M=null;if(c){let ee=ch(c,[],L.mask?L.mask.pathname:"/",!0);p!=="/"&&(ee.pathname=ee.pathname==="/"?p:qi([p,ee.pathname])),M=v.createHref(ee)}let[k,B,F]=tT(a,A),U=dT(S,{replace:_,mask:c,state:u,target:d,preventScrollReset:g,relative:o,viewTransition:C,defaultShouldRevalidate:E,useTransitions:h});function W(ee){n&&n(ee),ee.defaultPrevented||U(ee)}let j=!(T.isExternal||f),G=H.createElement("a",{...A,...F,href:(j?M:void 0)||T.absoluteURL||R,onClick:j?W:n,ref:aT(x,B),target:d,"data-discover":!b&&r==="render"?"true":void 0});return k&&!b?H.createElement(H.Fragment,null,G,H.createElement(nT,{page:R})):G});Pl.displayName="Link";var cT=H.forwardRef(function({"aria-current":n="page",caseSensitive:r=!1,className:a="",end:o=!1,style:f,to:_,viewTransition:c,children:u,...d},S){let g=Vl(_,{relative:d.relative}),C=Oi(),E=H.useContext(uh),{navigator:A,basename:x}=H.useContext(gi),p=E!=null&&_T(g)&&c===!0,v=A.encodeLocation?A.encodeLocation(g).pathname:g.pathname,h=C.pathname,b=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;r||(h=h.toLowerCase(),b=b?b.toLowerCase():null,v=v.toLowerCase()),b&&x&&(b=Pr(b,x)||b);const T=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let R=h===v||!o&&h.startsWith(v)&&h.charAt(T)==="/",L=b!=null&&(b===v||!o&&b.startsWith(v)&&b.charAt(v.length)==="/"),M={isActive:R,isPending:L,isTransitioning:p},k=R?n:void 0,B;typeof a=="function"?B=a(M):B=[a,R?"active":null,L?"pending":null,p?"transitioning":null].filter(Boolean).join(" ");let F=typeof f=="function"?f(M):f;return H.createElement(Pl,{...d,"aria-current":k,className:B,ref:S,style:F,to:_,viewTransition:c},typeof u=="function"?u(M):u)});cT.displayName="NavLink";var uT=H.forwardRef(({discover:e="render",fetcherKey:n,navigate:r,reloadDocument:a,replace:o,state:f,method:_=Ru,action:c,onSubmit:u,relative:d,preventScrollReset:S,viewTransition:g,defaultShouldRevalidate:C,...E},A)=>{let{useTransitions:x}=H.useContext(gi),p=gT(),v=mT(c,{relative:d}),h=_.toLowerCase()==="get"?"get":"post",b=typeof c=="string"&&uS.test(c),T=R=>{if(u&&u(R),R.defaultPrevented)return;R.preventDefault();let L=R.nativeEvent.submitter,M=L?.getAttribute("formmethod")||_,k=()=>p(L||R.currentTarget,{fetcherKey:n,method:M,navigate:r,replace:o,state:f,relative:d,preventScrollReset:S,viewTransition:g,defaultShouldRevalidate:C});x&&r!==!1?H.startTransition(()=>k()):k()};return H.createElement("form",{ref:A,method:h,action:v,onSubmit:a?u:T,...E,"data-discover":!b&&e==="render"?"true":void 0})});uT.displayName="Form";function hT(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function hS(e){let n=H.useContext(go);return Bt(n,hT(e)),n}function dT(e,{target:n,replace:r,mask:a,state:o,preventScrollReset:f,relative:_,viewTransition:c,defaultShouldRevalidate:u,useTransitions:d}={}){let S=_o(),g=Oi(),C=Vl(e,{relative:_});return H.useCallback(E=>{if(F5(E,n)){E.preventDefault();let A=r!==void 0?r:$l(g)===$l(C),x=()=>S(e,{replace:A,mask:a,state:o,preventScrollReset:f,relative:_,viewTransition:c,defaultShouldRevalidate:u});d?H.startTransition(()=>x()):x()}},[g,S,C,r,a,o,n,e,f,_,c,u,d])}var fT=0,pT=()=>`__${String(++fT)}__`;function gT(){let{router:e}=hS("useSubmit"),{basename:n}=H.useContext(gi),r=O5(),a=e.fetch,o=e.navigate;return H.useCallback(async(f,_={})=>{let{action:c,method:u,encType:d,formData:S,body:g}=G5(f,n);if(_.navigate===!1){let C=_.fetcherKey||pT();await a(C,r,_.action||c,{defaultShouldRevalidate:_.defaultShouldRevalidate,preventScrollReset:_.preventScrollReset,formData:S,body:g,formMethod:_.method||u,formEncType:_.encType||d,flushSync:_.flushSync})}else await o(_.action||c,{defaultShouldRevalidate:_.defaultShouldRevalidate,preventScrollReset:_.preventScrollReset,formData:S,body:g,formMethod:_.method||u,formEncType:_.encType||d,replace:_.replace,state:_.state,fromRouteId:r,flushSync:_.flushSync,viewTransition:_.viewTransition})},[a,o,n,r])}function mT(e,{relative:n}={}){let{basename:r}=H.useContext(gi),a=H.useContext(ar);Bt(a,"useFormAction must be used inside a RouteContext");let[o]=a.matches.slice(-1),f={...Vl(e||".",{relative:n})},_=Oi();if(e==null){f.search=_.search;let c=new URLSearchParams(f.search),u=c.getAll("index");if(u.some(S=>S==="")){c.delete("index"),u.filter(g=>g).forEach(g=>c.append("index",g));let S=c.toString();f.search=S?`?${S}`:""}}return(!e||e===".")&&o.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(f.pathname=f.pathname==="/"?r:qi([r,f.pathname])),$l(f)}function _T(e,{relative:n}={}){let r=H.useContext(nS);Bt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=hS("useViewTransitionState"),o=Vl(e,{relative:n});if(!r.isTransitioning)return!1;let f=Pr(r.currentLocation.pathname,a)||r.currentLocation.pathname,_=Pr(r.nextLocation.pathname,a)||r.nextLocation.pathname;return qu(o.pathname,_)!=null||qu(o.pathname,f)!=null}var vT=Ky();const bT="fleet-console.canvas.",dS="fleet-console.canvas.backgroundAnimation",fS="fleet-console.canvas.maximized",yT=400,kp=640,Rp=400,yb=40,Sb=96,ST=.25,wT=1,If=.2,wb=.5,CT=.001,Ja={x:0,y:0,zoom:1},io={viewport:Ja,panels:{},panelCreatedAt:{},minimized:[]},Lp=new Set,Mp=new Set,Dp=new Set;let Hl=null,Cs=null,rt=io,Mu=WT(),Ol=KT(),ws=Ja,ea=null,Gu=0,co=0;function pS(e){return Lp.add(e),()=>{Lp.delete(e)}}function Op(){return rt}function xT(){return H.useSyncExternalStore(pS,Op,Op)}function ET(){return H.useSyncExternalStore(IT,Cb,Cb)}function gS(){return H.useSyncExternalStore(zT,xb,xb)}function TT(){return H.useSyncExternalStore(pS,Eb,Eb)}function ir(e){rt={viewport:e.viewport??rt.viewport,panels:e.panels??rt.panels,panelCreatedAt:e.panelCreatedAt??rt.panelCreatedAt,minimized:e.minimized??rt.minimized},HT(),yS()}function Du(e){Ug();const n=Fg(e);ws=n,ir({viewport:n})}function mS(e){const n=Fg(e);if(typeof window>"u"||typeof window.requestAnimationFrame!="function"||PT()){Du(n);return}ws=n,ea===null&&(ea=window.requestAnimationFrame(SS))}function Nl(e,n){const r=Es();ir({panels:{...rt.panels,[e]:{...qg(n,r),zIndex:r}},panelCreatedAt:CS(e)})}function AT(e){rt.minimized.includes(e)||ir({minimized:[...rt.minimized,e]})}function kT(e){if(!rt.minimized.includes(e))return;const n=rt.minimized.filter(o=>o!==e),r=rt.panels[e];if(!r){ir({minimized:n});return}const a=Es();ir({minimized:n,panels:{...rt.panels,[e]:{...r,zIndex:a}}})}function Es(){return co+=1,co}function RT(e){co=Math.max(co,e)}function _S(){return Gu+=1,Gu}function vS(e){Gu=Math.max(Gu,e)}function LT(e){const n=rt.panels[e];if(n)return n;const r=Object.keys(rt.panels).length,a={x:r*yb,y:r*yb,width:kp,height:Rp,zIndex:Es()};return ir({panels:{...rt.panels,[e]:a},panelCreatedAt:CS(e)}),a}function MT(e){const n=new Set(e),r={};let a=!1;for(const[u,d]of Object.entries(rt.panels))n.has(u)?r[u]=d:a=!0;const o=rt.minimized.filter(u=>n.has(u)),f=o.length!==rt.minimized.length,_=Object.fromEntries(Object.entries(rt.panelCreatedAt).filter(([u])=>n.has(u))),c=Object.keys(_).length!==Object.keys(rt.panelCreatedAt).length;(a||f||c)&&ir({panels:r,panelCreatedAt:_,minimized:o})}function DT(e){UT(),Ug(),Hl=e,rt=e?qT(e):io,vS(eA(rt.panelCreatedAt)),ws=rt.viewport,co=Math.max(co,ES(rt.panels)),yS()}function bS(e,n){const r=rt.panels[e];if(!r)return;const a=Math.max(ST,Math.min(wT,Math.min((n.width-Sb)/r.width,(n.height-Sb)/r.height))),o={x:n.width/2-(r.x+r.width/2)*a,y:n.height/2-(r.y+r.height/2)*a,zoom:a};Ug(),ws=o;const f=Es(),_=rt.minimized.includes(e);ir({viewport:o,panels:{...rt.panels,[e]:{...qg(r,f),zIndex:f}},..._?{minimized:rt.minimized.filter(c=>c!==e)}:{}})}function OT(){Mu=!Mu,GT(Mu),jT()}function NT(){BT(!Ol)}function BT(e){Ol!==e&&(Ol=e,VT(Ol),$T())}function IT(e){return Mp.add(e),()=>{Mp.delete(e)}}function Cb(){return Mu}function yS(){for(const e of Lp)e()}function jT(){for(const e of Mp)e()}function zT(e){return Dp.add(e),()=>{Dp.delete(e)}}function xb(){return Ol}function Eb(){return rt.minimized}function $T(){for(const e of Dp)e()}function SS(){const e=rt.viewport,n=ws.x-e.x,r=ws.y-e.y,a=ws.zoom-e.zoom;if(Math.abs(n)<wb&&Math.abs(r)<wb&&Math.abs(a)<CT){ea=null,ir({viewport:ws});return}ir({viewport:{x:e.x+n*If,y:e.y+r*If,zoom:e.zoom+a*If}}),ea=typeof window<"u"?window.requestAnimationFrame(SS):null}function Ug(){ea===null||typeof window>"u"||(window.cancelAnimationFrame(ea),ea=null)}function PT(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function HT(){!Hl||typeof window>"u"||(FT(),Cs=window.setTimeout(()=>{Cs=null,wS(Hl,rt)},yT))}function UT(){!Cs||!Hl||typeof window>"u"||(window.clearTimeout(Cs),Cs=null,wS(Hl,rt))}function FT(){!Cs||typeof window>"u"||(window.clearTimeout(Cs),Cs=null)}function qT(e){if(typeof window>"u")return io;try{const n=window.localStorage.getItem(xS(e));if(!n)return io;const r=JSON.parse(n);return YT(r)}catch{return io}}function wS(e,n){if(!(!e||typeof window>"u"))try{window.localStorage.setItem(xS(e),JSON.stringify(n))}catch{}}function CS(e){return rt.panelCreatedAt[e]!==void 0?rt.panelCreatedAt:{...rt.panelCreatedAt,[e]:_S()}}function WT(){if(typeof window>"u")return!0;try{const e=window.localStorage.getItem(dS);return e===null?!0:e==="true"}catch{return!0}}function GT(e){if(!(typeof window>"u"))try{window.localStorage.setItem(dS,String(e))}catch{}}function KT(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(fS)==="true"}catch{return!1}}function VT(e){if(!(typeof window>"u"))try{window.localStorage.setItem(fS,String(e))}catch{}}function xS(e){return`${bT}${e}`}function YT(e){if(!uo(e))return io;const n=JT(e.panels);return{viewport:Fg(e.viewport),panels:n,panelCreatedAt:XT(e.panelCreatedAt,n),minimized:ZT(e.minimized,n)}}function XT(e,n){const r={},a=uo(e)?e:{};let o=0;for(const f of Object.keys(n))o+=1,r[f]=Ku(a[f],o);return r}function ZT(e,n){if(!Array.isArray(e))return[];const r=new Set,a=[];for(const o of e)typeof o!="string"||r.has(o)||!(o in n)||(r.add(o),a.push(o));return a}function Fg(e){if(!uo(e))return Ja;const n=Bl(e.x,Ja.x),r=Bl(e.y,Ja.y),a=Ku(e.zoom,Ja.zoom);return{x:n,y:r,zoom:a}}function JT(e){if(!uo(e))return{};const n={};for(const[r,a]of Object.entries(e))uo(a)&&(n[r]=qg(a,QT(n)));return n}function qg(e,n){return uo(e)?{x:Bl(e.x,0),y:Bl(e.y,0),width:Ku(e.width,kp),height:Ku(e.height,Rp),zIndex:Bl(e.zIndex,n)}:{x:0,y:0,width:kp,height:Rp,zIndex:n}}function QT(e){return ES(e)+1}function ES(e){return Math.max(0,...Object.values(e).map(n=>n.zIndex))}function eA(e){return Math.max(0,...Object.values(e))}function Bl(e,n){return typeof e=="number"&&Number.isFinite(e)?e:n}function Ku(e,n){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:n}function uo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const TS="fleet-console.codex.view-mode",AS="fleet-console.codex.side-width",jf="route",kl=460,tA=120,Np=new Set;let Bp=aA(),Ip=oA(),kS=!1;function nA(){return H.useSyncExternalStore(Wg,Tb,Tb)}function iA(e){if(kS=!0,Bp===e){jp();return}Bp=e,MS(TS,e),jp()}function rA(){return H.useSyncExternalStore(Wg,kb,kb)}function RS(){return H.useSyncExternalStore(Wg,Ab,Ab)}function sA(e){const n=LS(e);Ip!==n&&(Ip=n,MS(AS,String(n)),jp())}function Wg(e){return Np.add(e),()=>{Np.delete(e)}}function Tb(){return Bp}function Ab(){return Ip}function kb(){return kS}function jp(){for(const e of Np)e()}function LS(e){return Number.isFinite(e)?Math.max(tA,Math.round(e)):kl}function aA(){if(typeof window>"u")return jf;try{const e=window.localStorage.getItem(TS);return e==="route"||e==="side"?e:jf}catch{return jf}}function oA(){if(typeof window>"u")return kl;try{const e=window.localStorage.getItem(AS);if(e===null)return kl;const n=Number.parseInt(e,10);return Number.isNaN(n)?kl:LS(n)}catch{return kl}}function MS(e,n){if(!(typeof window>"u"))try{window.localStorage.setItem(e,n)}catch{}}const lA=["canonicalCwd","cwd","providerSession","ticket","token","transcriptPath"];class Ue extends Error{status;constructor(n,r){super(r),this.name="ApiError",this.status=n}}async function DS(e){const n=await fetch("/observer/tenants",{signal:e});await Mn(n);const r=await n.json();if(!Array.isArray(r.tenants))throw new Ue(n.status,"Invalid tenants response");return r.tenants.map(a=>wA(a,n.status))}async function cA(e){const n=await fetch("/observer/jobs",{signal:e});return await Mn(n),(await n.json()).tenants}async function uA(e){const n=await fetch("/observer/events",{signal:e});if(await Mn(n),!n.body)throw new Ue(n.status,"Observer stream unavailable");return n.body.getReader()}async function OS(e){const n=await fetch("/observer/theaters",{signal:e});await Mn(n);const r=await n.json();if(!Array.isArray(r.theaters))throw new Ue(n.status,"Invalid Theater response");const a=Array.isArray(r.agentClis)?r.agentClis.map(o=>SA(o,n.status)):[];return{theaters:r.theaters.map(o=>$S(o,n.status)),agentClis:a}}async function hA(e,n){const r=e?`?theaterId=${encodeURIComponent(e)}`:"",a=await fetch(`/observer/status${r}`,{signal:n});return await Mn(a),CA(await a.json(),a.status)}async function NS(e={}){const n=e.force?"?force=true":"",r=await fetch(`/observer/release-notes${n}`,{signal:e.signal});return await Mn(r),EA(await r.json(),r.status)}async function dA(e){const n=await fetch("/update/apply",{method:"POST",signal:e});return await Mn(n),xA(await n.json(),n.status)}async function BS(e,n){const r=await fetch("/observer/theaters",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folderGrantId:e}),signal:n});await Mn(r);const a=await r.json();return $S(a,r.status)}async function Rb(e,n,r){const a=await fetch(`/observer/theaters/${encodeURIComponent(e)}/sessions`,{method:"POST",...n?{headers:{"Content-Type":"application/json"},body:JSON.stringify({cliId:n})}:{},signal:r});return await Mn(a),dh(await a.json(),a.status)}async function fA(e,n){const r=await fetch("/terminal/folders/list",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:n});return await Mn(r),bA(await r.json(),r.status)}async function IS(e,n){const r=await fetch("/terminal/folders/grants",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:n});await Mn(r);const a=await r.json();if(typeof a.folderGrantId!="string")throw new Ue(r.status,"Invalid folder grant response");return a.folderGrantId}async function Vu(e,n){const r=await fetch(`/terminal/sessions/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});await Mn(r)}async function jS(e,n){const r=await fetch(`/terminal/sessions/${encodeURIComponent(e)}/resume`,{method:"POST",signal:n});return await Mn(r),dh(await r.json(),r.status)}async function pA(e,n){const r=await fetch(`/observer/theaters/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});await Mn(r)}async function gA(e,n){const r=await fetch(`/terminal/sessions/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({label:n})});return await Mn(r),dh(await r.json(),r.status)}async function mA(e){const n=await fetch("/terminal/sessions",{signal:e});await Mn(n);const r=await n.json();if(!Array.isArray(r.sessions))throw new Ue(n.status,"Invalid terminal sessions response");return r.sessions.map(a=>dh(a,n.status))}async function _A(e,n){const r=vA(n),a=await fetch("/terminal/ticket",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:e,...r.kind?{kind:r.kind}:{},...r.theaterId?{theaterId:r.theaterId}:{}}),signal:r.signal});await Mn(a);const o=await a.json();if(typeof o.ticket!="string"||typeof o.ttlMs!="number")throw new Ue(a.status,"Invalid terminal ticket response");return{ticket:o.ticket,ttlMs:o.ttlMs}}function vA(e){return e?e instanceof AbortSignal?{signal:e}:e:{}}function dh(e,n){const r=e;if(!r||typeof r.sessionId!="string"||typeof r.cwdLabel!="string"||typeof r.sequence!="number"||typeof r.status!="string"||typeof r.createdAt!="number"||zS(r))throw new Ue(n,"Invalid terminal session response");return{sessionId:r.sessionId,terminalSessionId:typeof r.terminalSessionId=="string"?r.terminalSessionId:r.sessionId,cwdLabel:r.cwdLabel,sequence:r.sequence,label:typeof r.label=="string"?r.label:void 0,cliId:typeof r.cliId=="string"?r.cliId:void 0,cliLabel:typeof r.cliLabel=="string"?r.cliLabel:void 0,status:r.status,turnState:r.turnState==="running"||r.turnState==="ended"?r.turnState:"none",createdAt:r.createdAt,theaterId:typeof r.theaterId=="string"?r.theaterId:void 0,tenantId:typeof r.tenantId=="string"?r.tenantId:void 0,registrationId:typeof r.registrationId=="string"?r.registrationId:void 0,resumeAvailable:r.resumeAvailable===!0}}function bA(e,n){const r=e;if(!r||typeof r.path!="string"||r.parentPath!==null&&typeof r.parentPath!="string"||!Array.isArray(r.roots)||!r.roots.every(a=>typeof a=="string")||!Array.isArray(r.entries))throw new Ue(n,"Invalid folder list response");return{path:r.path,parentPath:r.parentPath,roots:r.roots,entries:r.entries.map(a=>yA(a,n)),...r.truncated===!0?{truncated:!0}:{}}}function yA(e,n){const r=e;if(!r||typeof r.name!="string"||typeof r.path!="string"||r.kind!=="dir"||typeof r.accessible!="boolean")throw new Ue(n,"Invalid folder list response");return{name:r.name,path:r.path,kind:"dir",accessible:r.accessible}}function SA(e,n){const r=e;if(!r||typeof r.id!="string"||typeof r.label!="string"||typeof r.available!="boolean"||typeof r.signedIn!="boolean")throw new Ue(n,"Invalid Agent CLI metadata response");return{id:r.id,label:r.label,available:r.available,signedIn:r.signedIn}}function wA(e,n){const r=e;if(!r||typeof r.tenantId!="string"||typeof r.tenantLabel!="string"||typeof r.createdAt!="number"||typeof r.sessions!="number"||zS(r))throw new Ue(n,"Invalid tenants response");return{tenantId:r.tenantId,tenantLabel:r.tenantLabel,createdAt:r.createdAt,sessions:r.sessions,status:r.status,cliRunId:typeof r.cliRunId=="string"?r.cliRunId:void 0,registrationId:typeof r.registrationId=="string"?r.registrationId:void 0,theaterId:typeof r.theaterId=="string"?r.theaterId:void 0,terminalSessionId:typeof r.terminalSessionId=="string"?r.terminalSessionId:void 0}}function zS(e){return lA.some(n=>n in e)}function CA(e,n){const r=e;if(!r||typeof r.workspaces!="number"||typeof r.jobs!="number"||typeof r.version!="string"||r.channel!=="stable"&&r.channel!=="local"&&r.channel!=="unknown"||typeof r.updateAvailable!="boolean"||r.latestVersion!==void 0&&typeof r.latestVersion!="string"||typeof r.port!="number"||r.wikiServerStatus!=="available"&&r.wikiServerStatus!=="unavailable"&&r.wikiServerStatus!=="unknown"||"token"in r||"path"in r||"cwd"in r||"knowledgeRoot"in r)throw new Ue(n,"Invalid observer status response");return{workspaces:r.workspaces,jobs:r.jobs,version:r.version,channel:r.channel,updateAvailable:r.updateAvailable,...r.latestVersion!==void 0?{latestVersion:r.latestVersion}:{},port:r.port,wikiServerStatus:r.wikiServerStatus}}function xA(e,n){const r=e;if(!r||r.status!=="accepted"||"packageName"in r||"packageVersion"in r||"path"in r||"token"in r)throw new Ue(n,"Invalid update apply response");return{status:"accepted"}}function EA(e,n){const r=e;if(!r||!Array.isArray(r.notes)||r.sourceRef!=="main"||typeof r.fetchedAt!="number"||typeof r.stale!="boolean"||"url"in r||"token"in r||"path"in r)throw new Ue(n,"Invalid release notes response");return{notes:r.notes.map(a=>TA(a,n)),sourceRef:"main",fetchedAt:r.fetchedAt,stale:r.stale}}function TA(e,n){const r=e;if(!r||typeof r.version!="string"||r.date!==null&&typeof r.date!="string"||!Array.isArray(r.sections))throw new Ue(n,"Invalid release notes response");return{version:r.version,date:r.date,sections:r.sections.map(a=>AA(a,n))}}function AA(e,n){const r=e;if(!r||r.heading!=="Added"&&r.heading!=="Changed"&&r.heading!=="Fixed"&&r.heading!=="Removed"&&r.heading!=="Breaking Changes"||!Array.isArray(r.items))throw new Ue(n,"Invalid release notes response");return{heading:r.heading,items:r.items.map(a=>kA(a,n))}}function kA(e,n){const r=e;if(!r||!Array.isArray(r.packageTags)||!r.packageTags.every(a=>typeof a=="string")||typeof r.text!="string")throw new Ue(n,"Invalid release notes response");return{packageTags:r.packageTags,text:r.text}}function $S(e,n){const r=e;if(!r||typeof r.id!="string"||typeof r.label!="string"||"path"in r||typeof r.createdAt!="string"||typeof r.lastOpenedAt!="string"||typeof r.hasWiki!="boolean"||typeof r.activeAdmiralCount!="number")throw new Ue(n,"Invalid Theater response");return{id:r.id,label:r.label,createdAt:r.createdAt,lastOpenedAt:r.lastOpenedAt,hasWiki:r.hasWiki,activeAdmiralCount:r.activeAdmiralCount}}async function Mn(e){if(e.ok)return;let n=e.statusText;try{n=(await e.json()).error??n}catch{}throw new Ue(e.status,n||`HTTP ${e.status}`)}const Lb=120,RA="active",zp=new Set(["done","error","aborted"]);function LA(e,n){let r=HS(e,n.jobId,n.updatedAt);for(const a of n.events)r=PS(r,a);return zp.has(n.status)&&!zp.has(r.status)&&(r={...r,status:n.status}),r}function PS(e,n){if(n.id<=e.lastEventId)return e;const r=n.event,a={...e,updatedAt:n.at,lastEventId:n.id,recentEvents:IA(e.recentEvents,n)};switch(n.type){case"job:registered":return NA(a,r);case"job:finalized":return{...a,status:un(r.status)??"done",finishedAt:_s(r.finishedAt)??n.at,summary:un(r.summary),error:un(r.error)};case"track:begin":return qa(a,r,o=>({...o,startedAt:_s(r.startedAt)??n.at,requestPreview:un(r.requestPreview)}));case"track:status":return qa(a,r,o=>({...o,status:un(r.status)??o.status}));case"track:text":return qa(a,r,o=>({...o,status:"stream",text:o.text+(un(r.text)??""),sentTextLength:o.sentTextLength+(_s(r.textLength)??un(r.text)?.length??0)}));case"track:thought":return qa(a,r,o=>({...o,thought:o.thought+(un(r.text)??""),sentThoughtLength:o.sentThoughtLength+(_s(r.textLength)??un(r.text)?.length??0)}));case"track:tool":return qa(a,r,o=>({...o,status:"stream",tools:BA(o.tools,r)}));case"track:finalized":return qa(a,r,o=>{const f=Db(o.text,o.sentTextLength,un(r.fallbackText),_s(r.fallbackTextLength)),_=Db(o.thought,o.sentThoughtLength,un(r.fallbackThought),_s(r.fallbackThoughtLength));return{...o,status:un(r.status)??"done",finishedAt:_s(r.finishedAt)??n.at,error:un(r.error),text:f.text,sentTextLength:f.sentLength,thought:_.text,sentThoughtLength:_.sentLength}});default:return a}}function HS(e,n,r){return{jobId:n,tenantId:e,status:RA,updatedAt:r,trackOrder:[],tracks:{},lastEventId:0,recentEvents:[]}}function Gg(e){return zp.has(e)}function MA(e){return e.operationsViewActive?new Set:new Set}function DA(e,n){const r=[],a=[];for(const o of e)n.has(o.sessionId)?a.push(o):r.push(o);return{hidden:r,visible:a}}function Mb(e){const n=new Map;for(const r of[...e].sort((a,o)=>o.lastRaisedSeq-a.lastRaisedSeq)){const a=r.theaterId??"__unknown__",o=n.get(a)??{theaterId:r.theaterId,theaterLabel:r.theaterLabel,notifications:[],totalCount:0};o.notifications.push(r),o.totalCount+=r.count,n.set(a,o)}return[...n.values()].sort((r,a)=>{const o=r.notifications[0]?.lastRaisedSeq??0;return(a.notifications[0]?.lastRaisedSeq??0)-o})}function OA(e,n){return n.globalMute||n.dnd?[]:e.filter(r=>!r.theaterId||n.mutedTheaterIds[r.theaterId]!==!0)}function NA(e,n){const r=Array.isArray(n.tracks)?n.tracks:[];let a=e.trackOrder,o=e.tracks;for(const f of r){if(!f.trackId)continue;const _=o[f.trackId],c={..._??US(f.trackId),displayName:f.displayName??_?.displayName??f.trackId,displayCli:f.displayCli??_?.displayCli,model:f.model??_?.model,effort:f.effort??_?.effort,subtitle:f.subtitle??_?.subtitle,kind:f.kind??_?.kind,startedAt:f.startedAt??_?.startedAt};_||(a=[...a,f.trackId]),o={...o,[f.trackId]:c}}return{...e,label:un(n.label)??e.label,ownerCarrierId:un(n.ownerCarrierId)??e.ownerCarrierId,kind:un(n.kind)??e.kind,startedAt:_s(n.startedAt)??e.startedAt,trackOrder:a,tracks:o}}function qa(e,n,r){const a=un(n.trackId);if(!a)return e;const o=e.tracks[a],f=r(o??US(a));return{...e,trackOrder:o?e.trackOrder:[...e.trackOrder,a],tracks:{...e.tracks,[a]:f}}}function US(e){return{trackId:e,displayName:e,status:"queued",text:"",thought:"",sentTextLength:0,sentThoughtLength:0,tools:[]}}function Db(e,n,r,a){const o=a??r?.length??0;return r!==void 0&&o>e.length?{text:r,sentLength:Math.max(o,n)}:{text:e,sentLength:Math.max(n,o)}}function BA(e,n){const r=un(n.title)??"tool",a=un(n.status)??"",o=un(n.toolCallId),f=o??`${r}#${e.length}`;if(o){const _=e.findIndex(c=>c.key===o);if(_>=0){const c=[...e];return c[_]={key:o,title:r,status:a},c}}return[...e,{key:f,title:r,status:a}]}function IA(e,n){const r=[...e,n];return r.length>Lb?r.slice(-Lb):r}function un(e){return typeof e=="string"?e:void 0}function _s(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function FS(e){return new Date(e).toLocaleTimeString([],{hour12:!1})}function fh(e){return e.label?.trim()||`#${e.sequence} Operation`}function jA(e,n){const r=Math.max(0,Math.round((n-e)/1e3)),a=Math.floor(r/60),o=r%60;return a===0?`${o}s`:a<60?`${a}m ${String(o).padStart(2,"0")}s`:`${Math.floor(a/60)}h ${String(a%60).padStart(2,"0")}m`}function $p(e){return e.length<=14?e:`${e.slice(0,6)}…${e.slice(-6)}`}function zA(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function Pp(e){switch(e){case"active":return"running";case"done":return"done";case"error":return"error";case"aborted":return"aborted";default:return e}}function $A(e){switch(e){case"queued":return"queued";case"conn":return"connecting";case"stream":return"streaming";case"done":return"done";case"err":return"error";case"aborted":return"aborted";default:return e}}function qS(e,n){return e.status==="dormant"?"tenant-beacon is-dormant":n>0?"tenant-beacon is-live":e.turnState==="running"?"tenant-beacon is-turn-running":e.turnState==="ended"?"tenant-beacon is-turn-ended":"tenant-beacon"}function ph(e){switch(e){case"stream":case"active":case"conn":return"live";case"done":return"ok";case"err":case"error":return"bad";default:return"idle"}}function PA(e){if(e.status!=="active")return null;const n=e.trackOrder.map(o=>e.tracks[o]).filter(o=>!!o),r=n.filter(o=>o.status==="stream"||o.status==="conn"),a=r.length>0?r:n;for(let o=a.length-1;o>=0;o--){const f=a[o],_=f?HA(f):null;if(_)return _}return null}function HA(e){return Ob(e.text)??Ob(e.thought)??e.tools[e.tools.length-1]?.title??null}function Ob(e){if(!e)return null;const n=e.split(`
12
+ `);for(let r=n.length-1;r>=0;r--){const a=n[r]?.trim();if(a)return a}return null}const UA="__unassigned__";function FA(e){const n=new Map(e.theaters.map(a=>[a.id,a])),r=[];for(const a of e.sessionOrder){const o=e.sessions[a];o&&o.theaterId&&r.push(GA(o,n.get(o.theaterId)))}return r}function qA(e,n){const r=WS(n);return r.length===0?e:e.filter(a=>{const o=KA(a);return r.every(f=>o.includes(f))})}function WA(e){const n=[],r=new Map;for(const a of e){const o=a.theaterId??UA,f=r.get(o);if(f!==void 0){const _=n[f];_&&(n[f]={..._,entries:[..._.entries,a]});continue}r.set(o,n.length),n.push({theaterId:a.theaterId,theaterLabel:a.theaterLabel,entries:[a]})}return n}function WS(e){return e.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean)}function GA(e,n){return{sessionId:e.sessionId,theaterId:e.theaterId??null,theaterLabel:n?.label??e.theaterId??"",operationName:fh(e),cliLabel:e.cliLabel,status:e.status}}function KA(e){return[e.operationName,e.theaterLabel,e.cliLabel??""].join(" ").toLocaleLowerCase()}const VA="fleet-console.canvas.shell.",YA=400,Nb=560,Bb=360,Hp=new Set;let dn={},Mi=[],Hr=null,ia=null,xs=null;function XA(){return H.useSyncExternalStore(Kg,jb,jb)}function GS(){return H.useSyncExternalStore(Kg,Up,Up)}function KS(){return dn}function Up(){return Hr}function Ib(){return Mi}function ZA(){return H.useSyncExternalStore(Kg,Ib,Ib)}function ho(e){Hr!==e&&(Hr=e,Ts())}function JA(e,n){const r=uk();return dn={...dn,[r]:{theaterId:e,geometry:n,createdAt:ck()}},Yl(),Ts(),r}function Ou(e,n){const r=dn[e];r&&(dn={...dn,[e]:{...r,geometry:n}},Yl(),Ts())}function QA(e){!(e in dn)||Mi.includes(e)||(Mi=[...Mi,e],Hr===e&&(Hr=null),Yl(),Ts())}function VS(e){if(!Mi.includes(e))return;Mi=Mi.filter(r=>r!==e);const n=dn[e];n&&(dn={...dn,[e]:{...n,geometry:{...n.geometry,zIndex:Es()}}}),Yl(),Ts()}function Fp(e){if(!(e in dn))return;const n={...dn};delete n[e],dn=n,Mi=Mi.filter(r=>r!==e),Hr===e&&(Hr=null),Yl(),Ts()}function ek(e){nk(),ia=e;const n=e?ik(e):{panels:{},minimized:[]};dn=n.panels,Mi=n.minimized,vS(lk(dn)),Hr=null,RT(ok(dn)),Ts()}function tk(e){if(typeof window<"u")try{window.sessionStorage.removeItem(Vg(e))}catch{}ia===e&&(YS(),ia=null,dn={},Mi=[],Hr=null,Ts())}function Kg(e){return Hp.add(e),()=>{Hp.delete(e)}}function jb(){return dn}function Ts(){for(const e of Hp)e()}function Yl(){!ia||typeof window>"u"||(YS(),xs=window.setTimeout(()=>{xs=null,XS(ia,dn)},YA))}function nk(){!xs||!ia||typeof window>"u"||(window.clearTimeout(xs),xs=null,XS(ia,dn))}function YS(){!xs||typeof window>"u"||(window.clearTimeout(xs),xs=null)}function ik(e){if(typeof window>"u")return{panels:{},minimized:[]};try{const n=window.sessionStorage.getItem(Vg(e));return n?rk(JSON.parse(n),e):{panels:{},minimized:[]}}catch{return{panels:{},minimized:[]}}}function XS(e,n){if(!(!e||typeof window>"u"))try{window.sessionStorage.setItem(Vg(e),JSON.stringify({panels:n,minimized:Mi}))}catch{}}function Vg(e){return`${VA}${e}`}function rk(e,n){if(!Nu(e)||!Nu(e.panels))return{panels:{},minimized:[]};const r={};let a=0;for(const[o,f]of Object.entries(e.panels))!o.startsWith("shell:")||!Nu(f)||f.theaterId===n&&(a+=1,r[o]={theaterId:n,geometry:ak(f.geometry),createdAt:qp(f.createdAt,a)});return{panels:r,minimized:sk(e.minimized,r)}}function sk(e,n){if(!Array.isArray(e))return[];const r=new Set,a=[];for(const o of e)typeof o!="string"||r.has(o)||!(o in n)||(r.add(o),a.push(o));return a}function ak(e){return Nu(e)?{x:zf(e.x,0),y:zf(e.y,0),width:qp(e.width,Nb),height:qp(e.height,Bb),zIndex:zf(e.zIndex,0)}:{x:0,y:0,width:Nb,height:Bb,zIndex:0}}function ok(e){return Math.max(0,...Object.values(e).map(n=>n.geometry.zIndex))}function lk(e){return Math.max(0,...Object.values(e).map(n=>n.createdAt))}function ck(){return _S()}function zf(e,n){return typeof e=="number"&&Number.isFinite(e)?e:n}function qp(e,n){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:n}function Nu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function uk(){return`shell:${typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}`}const Wp=200,Gp="fleet-console.activeTheaterId",ZS="fleet-console.activeTheme",JS="fleet-console.terminalRenderer",QS="fleet-console.commissioningSeen",ew="fleet-console.whatsNewSeenVersion",tw="fleet-console.notificationPreferences",nw=1,$f="maritime",Pf="webgl",du={globalMute:!1,dnd:!1,mutedTheaterIds:{}},Kp=new Set;let Vp=null,ve={connection:"connecting",connectionError:null,activeTheme:Cw(),terminalRenderer:mk(),version:"",updateAvailable:!1,latestVersion:null,tenants:[],theaters:[],agentClis:[],activeTheaterId:null,addingTheater:!1,theaterError:null,sessions:{},sessionOrder:[],activeTerminalSessionId:null,operationsViewActive:!1,creatingTerminalSession:!1,terminalSessionError:null,tenantJobs:{},tenantOrder:[],timelineOpen:!1,operationSearchOpen:!1,shortcutsOpen:!1,whatsNewOpen:!1,releaseNotes:[],releaseNotesLoading:!1,releaseNotesError:null,releaseNotesSourceRef:null,releaseNotesFetchedAt:null,releaseNotesStale:!1,automaticWhatsNewVersion:null,selectedReleaseNoteKey:null,onboardingOpen:!1,bootstrapped:!1,terminalSessionsHydrated:!1,pendingOperationFocus:null,selectedJobId:null,operationNotifications:{},notificationPreferences:Uk()},zb=0;function $b(){return ve}function hk(e){return Kp.add(e),()=>{Kp.delete(e)}}function $e(e){ve={...ve,...e},xw()}function dk(e){ve.operationsViewActive!==e&&$e({operationsViewActive:e})}function fk(){aw(Cw())}function pk(e){Wk(e),aw(e),$e({activeTheme:e})}function gk(e){Gk(e),$e({terminalRenderer:e})}function mk(){if(typeof window>"u")return Pf;try{const e=window.localStorage.getItem(JS);return e==="webgl"||e==="dom"?e:Pf}catch{return Pf}}function _k(e){$e({version:e.version,updateAvailable:e.updateAvailable,latestVersion:e.latestVersion??null,...gw({...ve,version:e.version})})}function iw(){$e({releaseNotesLoading:!0,releaseNotesError:null})}function rw(e){const n={...ve,releaseNotes:e.notes,releaseNotesLoading:!1,releaseNotesError:null,releaseNotesSourceRef:e.sourceRef,releaseNotesFetchedAt:e.fetchedAt,releaseNotesStale:e.stale,selectedReleaseNoteKey:ve.selectedReleaseNoteKey&&_w(e.notes,ve.selectedReleaseNoteKey)?ve.selectedReleaseNoteKey:mw(e.notes)};$e({releaseNotes:n.releaseNotes,releaseNotesLoading:n.releaseNotesLoading,releaseNotesError:n.releaseNotesError,releaseNotesSourceRef:n.releaseNotesSourceRef,releaseNotesFetchedAt:n.releaseNotesFetchedAt,releaseNotesStale:n.releaseNotesStale,...gw(n)})}function sw(e){$e({releaseNotesLoading:!1,releaseNotesError:e})}function aw(e){if(!(typeof document>"u")){if(e==="maritime"){document.documentElement.removeAttribute("data-theme");return}document.documentElement.setAttribute("data-theme",e)}}function vk(e){const n={};for(const o of e)n[o.sessionId]=mh(o);const r=[...e].sort((o,f)=>f.createdAt-o.createdAt).map(o=>o.sessionId),a=Sw(n,ve.tenants);$e({sessions:a,sessionOrder:r,activeTerminalSessionId:As(ve.activeTheaterId,a,r,ve.activeTerminalSessionId),terminalSessionsHydrated:!0})}function ow(e){const n=ww(e.theaters,ve.activeTheaterId);$e({theaters:e.theaters,agentClis:e.agentClis,activeTheaterId:n,activeTerminalSessionId:As(n,ve.sessions,ve.sessionOrder,ve.activeTerminalSessionId),selectedJobId:null})}function bk(e){vh(e),$e({activeTheaterId:e,activeTerminalSessionId:As(e,ve.sessions,ve.sessionOrder,null),selectedJobId:null})}function lw(){$e({addingTheater:!0,theaterError:null})}function cw(e){const n=[e,...ve.theaters.filter(r=>r.id!==e.id)];vh(e.id),$e({theaters:n,activeTheaterId:e.id,addingTheater:!1,theaterError:null,activeTerminalSessionId:As(e.id,ve.sessions,ve.sessionOrder,null),selectedJobId:null})}function yk(){$e({addingTheater:!1,theaterError:null})}function Yp(e){$e({addingTheater:!1,theaterError:e})}function ei(e){$e({activeTerminalSessionId:e,selectedJobId:null,operationNotifications:e?_h(ve.operationNotifications,e):ve.operationNotifications})}function uw(e){const n=ve.sessions[e];n&&(vh(n.theaterId??null),$e({activeTheaterId:n.theaterId??null,activeTerminalSessionId:e,selectedJobId:null,pendingOperationFocus:e,operationNotifications:_h(ve.operationNotifications,e)}))}function Pb(){ve.pendingOperationFocus!==null&&$e({pendingOperationFocus:null})}function Hf(){$e({operationSearchOpen:!1})}function Sk(){$e({operationSearchOpen:!ve.operationSearchOpen})}function Hb(){$e({creatingTerminalSession:!0,terminalSessionError:null})}function Ub(e){const n=mh(e);$e({sessions:{...ve.sessions,[n.sessionId]:n},sessionOrder:[n.sessionId,...ve.sessionOrder.filter(r=>r!==n.sessionId)],activeTerminalSessionId:!ve.activeTheaterId||Zu(n,ve.activeTheaterId)?n.sessionId:ve.activeTerminalSessionId,creatingTerminalSession:!1,terminalSessionError:null,selectedJobId:null})}function gh(e){const n=ve.sessions[e.sessionId],r=mh({...n??{},...e}),a=!!n,o={...ve.sessions,[r.sessionId]:r},f=a?ve.sessionOrder:[r.sessionId,...ve.sessionOrder.filter(c=>c!==r.sessionId)],_=n?zk(ve.operationNotifications,n,r):ve.operationNotifications;$e({sessions:o,sessionOrder:f,activeTerminalSessionId:As(ve.activeTheaterId,o,f,ve.activeTerminalSessionId),operationNotifications:_})}function wk(e,n){const r=ve.sessions[e.sessionId]??mh(e);n==="idle_prompt"&&yw(r)||$e({operationNotifications:bw(ve.operationNotifications,vw("input-waiting",r))})}function Ck(e){const n={...ve.notificationPreferences,globalMute:e};Jg(n),$e({notificationPreferences:n})}function xk(e){const n={...ve.notificationPreferences,dnd:e};Jg(n),$e({notificationPreferences:n})}function Ek(e){const n={...ve.notificationPreferences.mutedTheaterIds};n[e]?delete n[e]:n[e]=!0;const r={...ve.notificationPreferences,mutedTheaterIds:n};Jg(r),$e({notificationPreferences:r})}function Fb(e){$e({creatingTerminalSession:!1,terminalSessionError:e})}function Tk(){$e({timelineOpen:!ve.timelineOpen})}function Ak(){ve.shortcutsOpen||$e({shortcutsOpen:!0})}function Uf(){ve.shortcutsOpen&&$e({shortcutsOpen:!1})}function kk(){ve.releaseNotes.length===0||ve.whatsNewOpen||$e({whatsNewOpen:!0,selectedReleaseNoteKey:ve.selectedReleaseNoteKey??mw(ve.releaseNotes)})}function fu(){ve.whatsNewOpen&&(ve.automaticWhatsNewVersion&&Vk(ve.automaticWhatsNewVersion),$e({whatsNewOpen:!1,automaticWhatsNewVersion:null}))}function qb(e){_w(ve.releaseNotes,e)&&$e({selectedReleaseNoteKey:e})}function ml(){Kk(!0),ve.onboardingOpen&&$e({onboardingOpen:!1})}function Wb(){if(ve.bootstrapped)return;const e=ve.theaters.length===0&&!Fk();$e({bootstrapped:!0,onboardingOpen:e?!0:ve.onboardingOpen})}function Yu(e){$e({terminalSessionError:e})}function hw(e){$e({terminalSessionError:e})}function Rk(e){$e({terminalSessionError:e})}function Gb(e){tk(e);const n=ve.theaters.filter(_=>_.id!==e),r={},a=[];for(const _ of ve.sessionOrder){const c=ve.sessions[_];!c||c.theaterId===e||(r[_]=c,a.push(_))}const o=ww(n,ve.activeTheaterId===e?null:ve.activeTheaterId),f=$k(ve.operationNotifications,e);vh(o),$e({theaters:n,sessions:r,sessionOrder:a,activeTheaterId:o,activeTerminalSessionId:As(o,r,a,ve.activeTerminalSessionId),selectedJobId:null,operationNotifications:f})}function Yg(e){if(!ve.sessions[e])return;const n={...ve.sessions};delete n[e];const r=ve.sessionOrder.filter(o=>o!==e),a=ve.activeTerminalSessionId===e;$e({sessions:n,sessionOrder:r,activeTerminalSessionId:a?As(ve.activeTheaterId,n,r,null):ve.activeTerminalSessionId,selectedJobId:a?null:ve.selectedJobId,operationNotifications:_h(ve.operationNotifications,e)})}function dw(e){$e({selectedJobId:ve.selectedJobId===e?null:e})}function Ff(){$e({selectedJobId:null})}function fw(e){const n=new Set(e.map(o=>o.tenantId)),r=Sw(ve.sessions,e),a=[...e.map(o=>o.tenantId),...ve.tenantOrder.filter(o=>!n.has(o)&&ve.tenantJobs[o])];$e({tenants:e,sessions:r,tenantOrder:a,activeTerminalSessionId:As(ve.activeTheaterId,r,ve.sessionOrder,ve.activeTerminalSessionId)})}function Lk(e){const n={},r=[];for(const o of e){const f={};for(const c of o.jobs)f[c.jobId]=LA(o.tenantId,c);const _=Object.values(f).sort((c,u)=>(c.startedAt??c.updatedAt)-(u.startedAt??u.updatedAt)).map(c=>c.jobId);n[o.tenantId]={tenantId:o.tenantId,tenantLabel:o.tenantLabel,jobOrder:_,jobs:f,truncation:o.truncation},r.push(o.tenantId)}const a=[...ve.tenantOrder.filter(o=>n[o]),...r.filter(o=>!ve.tenantOrder.includes(o))];$e({tenantJobs:n,tenantOrder:a.length>0?a:r})}function Mk(e,n){const r=ve.tenantJobs[e.tenantId],a=!r&&!ve.tenants.some(c=>c.tenantId===e.tenantId),o=r??{tenantId:e.tenantId,tenantLabel:n,jobOrder:[],jobs:{},truncation:{droppedCount:0}};let f=n&&o.tenantLabel!==n?{...o,tenantLabel:n}:o;if(e.jobId){const c=f.jobs[e.jobId],u=PS(c??HS(e.tenantId,e.jobId,e.at),e),d=c?f.jobOrder:[...f.jobOrder,e.jobId];f={...f,jobs:Yk({...f.jobs,[e.jobId]:u},d),jobOrder:d.slice(-Wp)}}const _={...ve.tenantJobs,[e.tenantId]:f};return ve={...ve,connection:"live",connectionError:null,tenantJobs:_,tenantOrder:ve.tenantOrder.includes(e.tenantId)?ve.tenantOrder:[...ve.tenantOrder,e.tenantId]},xw(),{unknownTenant:a}}function Dk(e,n,r){const a=ve.tenantJobs[e]??{tenantId:e,tenantLabel:n,jobOrder:[],jobs:{},truncation:{droppedCount:0}};$e({tenantJobs:{...ve.tenantJobs,[e]:{...a,truncation:r}},tenantOrder:ve.tenantOrder.includes(e)?ve.tenantOrder:[...ve.tenantOrder,e]})}function Ok(e){if(!e.selectedJobId||e.activeTheaterId&&e.activeTerminalSessionId&&!Xu(e).includes(e.activeTerminalSessionId))return null;const n=Nk(e);return n?e.tenantJobs[n]?.jobs[e.selectedJobId]??null:null}function Nk(e){return e.activeTerminalSessionId?Xg(e.sessions[e.activeTerminalSessionId]):null}function Bk(e){return Xu(e).map(n=>e.sessions[n]).filter(n=>!!n)}function Xu(e){return e.activeTheaterId?e.sessionOrder.filter(n=>Zu(e.sessions[n],e.activeTheaterId)):[]}function Ik(e){return FA(e)}function pw(e,n){const r=Xg(n);if(!r)return[];const a=e.tenantJobs[r];if(!a)return[];const o=[];for(const f of a.jobOrder){const _=a.jobs[f];_&&o.push({job:_,tenant:a})}return o}function Xg(e){return e?.tenantId??e?.sessionId??null}function mh(e){return{...e,terminalSessionId:e.terminalSessionId??e.sessionId,status:e.status==="starting"&&e.tenantId?"registered":e.status,turnState:e.turnState??"none",resumeAvailable:e.resumeAvailable===!0}}function gw(e){const n=e.releaseNotes.findIndex(a=>a.version!=="Unreleased"),r=n>=0?e.releaseNotes[n]:void 0;return!r||!e.version||r.version!==e.version||qk()===r.version?{whatsNewOpen:e.whatsNewOpen,automaticWhatsNewVersion:e.automaticWhatsNewVersion,selectedReleaseNoteKey:e.selectedReleaseNoteKey}:{whatsNewOpen:!0,automaticWhatsNewVersion:r.version,selectedReleaseNoteKey:Zg(r.version,n)}}function mw(e){return e[0]?Zg(e[0].version,0):null}function _w(e,n){return e.some((r,a)=>Zg(r.version,a)===n)}function Zg(e,n){return`${e}:${n}`}function jk(e){return e?ve.theaters.find(n=>n.id===e)?.label??e:"—"}function vw(e,n){return zb+=1,{kind:e,sessionId:n.sessionId,theaterId:n.theaterId??null,theaterLabel:jk(n.theaterId),operationLabel:fh(n),count:1,lastRaisedSeq:zb}}function zk(e,n,r){return n.turnState!=="running"&&r.turnState==="running"?_h(e,r.sessionId):n.turnState!=="ended"&&r.turnState==="ended"&&!yw(r)?bw(e,vw("ended",r)):e}function bw(e,n){const r=e[n.sessionId];return{...e,[n.sessionId]:{...n,count:r?.kind==="input-waiting"&&n.kind==="input-waiting"?r.count+1:1}}}function _h(e,n){if(!e[n])return e;const r={...e};return delete r[n],r}function $k(e,n){let r=!1;const a={};for(const[o,f]of Object.entries(e)){if(f.theaterId===n){r=!0;continue}a[o]=f}return r?a:e}function yw(e){const n=Xg(e);return n?Pk(ve.tenantJobs[n]):!1}function Pk(e){return e?e.jobOrder.some(n=>{const r=e.jobs[n];return r?!r.finishedAt&&!Gg(r.status):!1}):!1}function Sw(e,n){const r={...e};for(const a of n){if(!a.terminalSessionId)continue;const o=r[a.terminalSessionId];o&&(r[a.terminalSessionId]={...o,status:a.status==="closed"?"closed":a.status==="dormant"?"dormant":"registered",tenantId:a.tenantId,registrationId:a.registrationId,theaterId:a.theaterId??o.theaterId})}return r}function ww(e,n){const r=new Set(e.map(o=>o.id)),a=Hk();return a&&r.has(a)?a:n&&r.has(n)?n:e[0]?.id??null}function As(e,n,r,a){return e?a&&Zu(n[a],e)&&pu(n[a])?a:r.find(o=>Zu(n[o],e)&&pu(n[o]))??null:a&&n[a]&&pu(n[a])?a:r.find(o=>pu(n[o]))??null}function Zu(e,n){return!e||!n?!1:e.theaterId===n}function pu(e){return!!(e&&e.status!=="dormant")}function Hk(){if(typeof window>"u")return null;try{return window.localStorage.getItem(Gp)}catch{return null}}function vh(e){if(!(typeof window>"u"))try{e?window.localStorage.setItem(Gp,e):window.localStorage.removeItem(Gp)}catch{}}function Cw(){if(typeof window>"u")return $f;try{const e=window.localStorage.getItem(ZS);return e==="maritime"||e==="carbon"?e:$f}catch{return $f}}function Uk(){if(typeof window>"u")return du;try{const e=window.localStorage.getItem(tw);if(!e)return du;const n=JSON.parse(e);return Xk(n)?{globalMute:n.preferences.globalMute,dnd:n.preferences.dnd,mutedTheaterIds:n.preferences.mutedTheaterIds}:du}catch{return du}}function Fk(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(QS)==="1"}catch{return!1}}function qk(){if(Vp!==null)return Vp;if(typeof window>"u")return null;try{return window.localStorage.getItem(ew)}catch{return null}}function Wk(e){if(!(typeof window>"u"))try{window.localStorage.setItem(ZS,e)}catch{}}function Gk(e){if(!(typeof window>"u"))try{window.localStorage.setItem(JS,e)}catch{}}function Jg(e){if(!(typeof window>"u"))try{window.localStorage.setItem(tw,JSON.stringify({version:nw,preferences:e}))}catch{}}function Kk(e){if(!(typeof window>"u"))try{window.localStorage.setItem(QS,e?"1":"0")}catch{}}function Vk(e){if(Vp=e,!(typeof window>"u"))try{window.localStorage.setItem(ew,e)}catch{}}function Yk(e,n){if(n.length<=Wp)return e;const r=new Set(n.slice(-Wp)),a={};for(const o of Object.keys(e))r.has(o)&&(a[o]=e[o]);return a}function Xk(e){if(!e||typeof e!="object")return!1;const n=e;if(n.version!==nw||!n.preferences||typeof n.preferences.globalMute!="boolean"||typeof n.preferences.dnd!="boolean")return!1;const r=n.preferences.mutedTheaterIds;return!!r&&typeof r=="object"&&!Array.isArray(r)}function xw(){for(const e of Kp)e()}const gu="directory-browser-sectors";function Ew({open:e,onCancel:n,onConfirm:r}){const[a,o]=H.useState(null),[f,_]=H.useState(null),[c,u]=H.useState(null),[d,S]=H.useState(""),[g,C]=H.useState(0),E=H.useRef(null),A=H.useRef(null),x=async(B,F)=>{_(B),u(null),S(""),C(0);try{const U=await fA(B,F);o(U)}catch(U){if(U instanceof DOMException&&U.name==="AbortError")return;u(U instanceof Ue?U.message:String(U))}finally{_(null)}};H.useEffect(()=>{if(!e)return;const B=new AbortController;return x(null,B.signal),()=>B.abort()},[e]),H.useEffect(()=>{e&&E.current?.focus()},[e,a?.path]);const p=a?.entries??[],v=H.useMemo(()=>{const B=d.trim().toLowerCase();return B===""?p:p.filter(F=>F.name.toLowerCase().includes(B))},[p,d]),h=H.useMemo(()=>a?Zk(a):[],[a]),b=v.length===0?-1:Math.min(g,v.length-1);if(H.useEffect(()=>{if(b<0)return;A.current?.querySelector(`[data-index="${b}"]`)?.scrollIntoView({block:"nearest"})},[b,a?.path]),!e)return null;const T=B=>{B.accessible&&f===null&&x(B.path)},R=()=>{a?.parentPath!=null&&f===null&&x(a.parentPath)},L=a?.path??null,M=b>=0?`${gu}-${b}`:void 0,k=B=>{switch(B.key){case"Escape":d!==""?S(""):n();return;case"ArrowDown":B.preventDefault(),C(F=>Math.min(F+1,Math.max(v.length-1,0)));return;case"ArrowUp":B.preventDefault(),C(F=>Math.max(F-1,0));return;case"Enter":{B.preventDefault();const F=v[b];F&&T(F);return}case"Backspace":d===""&&(B.preventDefault(),R());return;default:return}};return vT.createPortal(y.jsxs("div",{className:"directory-browser-overlay",role:"presentation",children:[y.jsx("button",{type:"button",className:"directory-browser-scrim","aria-label":"Close",onClick:n}),y.jsxs("section",{className:"directory-browser-card",role:"dialog","aria-modal":"true","aria-label":"Establish Theater of Operations",onKeyDown:k,children:[y.jsxs("header",{className:"directory-browser-header",children:[y.jsx("span",{className:"directory-browser-sigil","aria-hidden":"true",children:y.jsx(Qk,{})}),y.jsxs("div",{className:"directory-browser-heading",children:[y.jsx("span",{className:"directory-browser-kicker",children:"Theater of Operations"}),y.jsx("h2",{children:"Establish Theater"})]}),y.jsx("button",{type:"button",className:"directory-browser-close",onClick:n,"aria-label":"Close",children:"×"})]}),y.jsx("nav",{className:"directory-browser-course","aria-label":"Path",children:h.map((B,F)=>{const U=F===h.length-1;return y.jsxs("span",{className:"directory-browser-course-seg",children:[F>0?y.jsx("span",{className:"directory-browser-course-sep","aria-hidden":"true",children:"›"}):null,y.jsx("button",{type:"button",className:`directory-browser-crumb ${U?"is-current":""}`,"aria-current":U?"location":void 0,disabled:U||f!==null,title:B.path,onClick:()=>{x(B.path)},children:B.label})]},B.path)})}),y.jsxs("div",{className:"directory-browser-toolbar",children:[y.jsxs("div",{className:"directory-browser-filter",children:[y.jsx("span",{className:"directory-browser-filter-glyph","aria-hidden":"true",children:y.jsx(tR,{})}),y.jsx("input",{ref:E,type:"text",className:"directory-browser-filter-input",placeholder:"Filter sectors…","aria-label":"Filter folders","aria-controls":gu,value:d,spellCheck:!1,autoComplete:"off",onChange:B=>{S(B.target.value),C(0)}})]}),y.jsxs("button",{type:"button",className:"directory-browser-up",disabled:a?.parentPath==null||f!==null,title:"Up one sector (Backspace)",onClick:R,children:[y.jsx(nR,{}),y.jsx("span",{children:"Up"})]})]}),c?y.jsx("p",{className:"directory-browser-error",role:"alert",children:c}):null,y.jsx("div",{className:"directory-browser-list",id:gu,role:"listbox","aria-label":"Folders","aria-busy":f!==null,"aria-activedescendant":M,ref:A,children:f!==null?y.jsxs("p",{className:"directory-browser-state is-live",children:[y.jsx("span",{className:"directory-browser-scan-dot","aria-hidden":"true"}),"Scouting…"]}):v.length===0?y.jsx("p",{className:"directory-browser-state",children:d!==""?"No sectors match the filter.":"No sectors to advance into."}):v.map((B,F)=>y.jsxs("div",{id:`${gu}-${F}`,"data-index":F,role:"option","aria-selected":F===b,"aria-disabled":!B.accessible,className:`directory-browser-sector ${F===b?"is-active":""} ${B.accessible?"":"is-locked"}`,title:B.path,onClick:()=>{C(F),T(B)},children:[y.jsx("span",{className:"directory-browser-sector-glyph","aria-hidden":"true",children:y.jsx(eR,{})}),y.jsx("span",{className:"directory-browser-sector-name",children:B.name}),B.accessible?y.jsx("span",{className:"directory-browser-sector-advance","aria-hidden":"true",children:"›"}):y.jsxs("span",{className:"directory-browser-sector-lock",children:[y.jsx(iR,{})," Locked"]})]},B.path))}),a?.truncated?y.jsx("p",{className:"directory-browser-note",children:"Charting first 500 sectors only."}):null,y.jsxs("footer",{className:"directory-browser-actions",children:[y.jsxs("div",{className:"directory-browser-target",children:[y.jsx("span",{className:"directory-browser-target-label",children:"Theater Root"}),y.jsx("span",{className:"directory-browser-target-path",title:L??"",children:L??"Scouting…"})]}),y.jsxs("div",{className:"directory-browser-buttons",children:[y.jsx("button",{type:"button",className:"directory-browser-button",onClick:n,children:"Cancel"}),y.jsx("button",{type:"button",className:"directory-browser-button is-primary",disabled:L===null||f!==null,onClick:()=>L&&r(L),children:"Establish Theater"})]})]})]})]}),document.body)}function Zk(e){if(Jk(e)==="/"){const _=[{label:"/",path:"/"}];let c="";for(const u of e.path.split("/").filter(Boolean))c+=`/${u}`,_.push({label:u,path:c});return _}const r=/^([A-Za-z]:)\\?/.exec(e.path),a=r?`${r[1]}\\`:e.roots[0]??"C:\\",o=[{label:a,path:a}];let f=a.replace(/\\$/,"");for(const _ of e.path.slice(a.length).split("\\").filter(Boolean))f+=`\\${_}`,o.push({label:_,path:f});return o}function Jk(e){return e.roots.some(n=>/^[A-Za-z]:\\$/.test(n))||/^[A-Za-z]:\\/.test(e.path)?"\\":"/"}function Qk(){return y.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[y.jsx("circle",{cx:"10",cy:"10",r:"6.6",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),y.jsx("circle",{cx:"10",cy:"10",r:"2.1",fill:"currentColor"}),y.jsx("path",{d:"M10 1.6v3.2M10 15.2v3.2M1.6 10h3.2M15.2 10h3.2",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function eR(){return y.jsx("svg",{viewBox:"0 0 18 18","aria-hidden":"true",children:y.jsx("path",{d:"M2.4 5.2c0-.7.6-1.3 1.3-1.3h2.7l1.4 1.5h6.5c.7 0 1.3.6 1.3 1.3v6.4c0 .7-.6 1.3-1.3 1.3H3.7c-.7 0-1.3-.6-1.3-1.3z",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinejoin:"round"})})}function tR(){return y.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[y.jsx("circle",{cx:"7",cy:"7",r:"4.2",fill:"none",stroke:"currentColor",strokeWidth:"1.3"}),y.jsx("path",{d:"M10.2 10.2 13.5 13.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})}function nR(){return y.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:y.jsx("path",{d:"M8 12.5V4M4.5 7.5 8 4l3.5 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"})})}function iR(){return y.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[y.jsx("rect",{x:"3.6",y:"7",width:"8.8",height:"6.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),y.jsx("path",{d:"M5.6 7V5.4a2.4 2.4 0 0 1 4.8 0V7",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}const rR=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function sR({state:e}){const[n,r]=H.useState(!1),a=H.useRef(null),o=H.useRef(null),f=H.useRef(null),_=e.theaters.length>0;if(H.useEffect(()=>{if(e.onboardingOpen)return a.current=document.activeElement,o.current?.focus(),()=>{const S=a.current;a.current=null,S?.focus?.()}},[e.onboardingOpen]),H.useEffect(()=>{if(!e.onboardingOpen)return;const S=g=>{n||(g.key==="Escape"?(g.preventDefault(),ml()):g.key==="Tab"&&aR(g,f.current),g.stopImmediatePropagation())};return window.addEventListener("keydown",S,!0),()=>window.removeEventListener("keydown",S,!0)},[n,e.onboardingOpen]),!e.onboardingOpen)return null;const c=()=>{r(!0)},u=()=>{r(!1)},d=async S=>{r(!1),lw();try{const g=await IS(S),C=await BS(g);cw(C)}catch(g){Yp(g instanceof Error?g.message:String(g))}};return y.jsxs("div",{className:"commissioning-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"commissioning-title",children:[y.jsx("button",{type:"button",className:"commissioning-scrim",onClick:ml,"aria-label":"Close Commissioning guide"}),y.jsxs("section",{className:"commissioning-card",ref:f,children:[y.jsxs("header",{className:"commissioning-header",children:[y.jsx("span",{className:"commissioning-eyebrow",children:"COMMISSIONING · FLEET CONSOLE"}),y.jsx("h2",{id:"commissioning-title",children:"Bring your fleet online"}),y.jsx("p",{children:"Three steps to go from an empty bridge to live carrier operations."})]}),y.jsxs("ol",{className:"commissioning-steps",children:[y.jsxs("li",{className:`commissioning-step commissioning-step--primary ${_?"is-complete":"is-current"}`,children:[y.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:_?"✓":"01"}),y.jsxs("div",{className:"commissioning-step-body",children:[y.jsx("h3",{children:"Register a Theater"}),y.jsx("p",{children:"A Theater is a project directory the fleet operates in. Choose the folder you want to work from."}),_?y.jsx(Pl,{ref:S=>{o.current=S},className:"commissioning-primary-action",to:"/operations",onClick:ml,children:"Go to Operations →"}):y.jsx("button",{ref:S=>{o.current=S},type:"button",className:"commissioning-primary-action is-live",disabled:e.addingTheater,onClick:c,children:e.addingTheater?"Adding Theater…":"Choose a folder…"}),e.theaterError?y.jsx("p",{className:"commissioning-error",role:"alert",children:e.theaterError}):null]})]}),y.jsxs("li",{className:"commissioning-step",children:[y.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:"02"}),y.jsxs("div",{className:"commissioning-step-body",children:[y.jsx("h3",{children:"Open an Operation"}),y.jsx("p",{children:"An Operation is a live terminal session running an Agent CLI. Start one from the Operations tab to begin a working session."}),y.jsx(Pl,{className:"commissioning-secondary-link",to:"/operations",onClick:ml,children:"Go to Operations"})]})]}),y.jsxs("li",{className:"commissioning-step",children:[y.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:"03"}),y.jsxs("div",{className:"commissioning-step-body",children:[y.jsx("h3",{children:"Observe carriers"}),y.jsx("p",{children:"Carriers are specialist agents your Admiral dispatches. Their sorties stream here in real time as they run."})]})]})]}),y.jsxs("footer",{className:"commissioning-footer",children:[y.jsx("p",{children:"Theaters with a Fleet Wiki knowledge root also unlock Codex — your decision log and reference library."}),y.jsx("button",{type:"button",className:"commissioning-skip",onClick:ml,children:"Skip for now"})]})]}),y.jsx(Ew,{open:n,onCancel:u,onConfirm:d})]})}function aR(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(rR)),a=r[0],o=r[r.length-1];!a||!o||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),a.focus()))}function Xl(){return H.useSyncExternalStore(hk,$b,$b)}const oR={ended:"Stood down","input-waiting":"Awaiting orders"},Tw="fleet-console.notificationsDockOpen",qf=!1;function lR(){const e=Xl(),n=_o(),[r,a]=H.useState(cR),[o,f]=H.useState(!1),_=H.useRef(null),c=H.useRef(null),u=H.useMemo(()=>Object.values(e.operationNotifications),[e.operationNotifications]),d=MA(e),S=DA(u,d).hidden,g=OA(S,e.notificationPreferences),C=Mb(g),E=Mb(S),A=C.reduce((B,F)=>B+F.totalCount,0),x=Kb(C,"input-waiting"),p=Kb(C,"ended");hR(e.notificationPreferences);const v=C.length===0,h=v?"muted":x>0?"awaiting":"ended",b=H.useMemo(()=>g.reduce((B,F)=>Math.max(B,F.lastRaisedSeq),0),[g]),T=H.useRef(b),[R,L]=H.useState(0),M=H.useCallback(B=>{a(B),uR(B)},[]);H.useEffect(()=>{b>T.current&&!r&&L(B=>B+1),T.current=b},[b,r]),H.useEffect(()=>{if(!r)return;const B=F=>{const U=F.target;if(!(U instanceof Node)){M(!1);return}c.current?.contains(U)||_.current?.contains(U)||M(!1)};return document.addEventListener("pointerdown",B),()=>{document.removeEventListener("pointerdown",B)}},[r,M]);const k=B=>{uw(B.sessionId),n("/operations"),M(!1)};return r?y.jsx("div",{className:"notification-dock-layer",children:y.jsxs("aside",{ref:c,className:`notification-dock ${h==="awaiting"?"has-awaiting":""}`,"aria-live":"polite","aria-label":"Operation notifications",children:[y.jsxs("header",{className:"notification-dock-head",children:[y.jsx("span",{className:"notification-dock-eyebrow",children:"Notifications"}),v?null:y.jsxs("span",{className:"notification-dock-tallies","aria-hidden":"true",children:[x>0?y.jsx("span",{className:"notification-tally is-input-waiting",children:x}):null,p>0?y.jsx("span",{className:"notification-tally is-ended",children:p}):null]}),y.jsx("button",{type:"button",className:"notification-dock-icon",onClick:()=>f(!o),"aria-expanded":o,"aria-label":"Notification settings",title:"Notification settings",children:y.jsx(pR,{})}),y.jsx("button",{type:"button",className:"notification-dock-icon",onClick:()=>M(!1),"aria-label":"Close notifications",title:"Close",children:y.jsx(gR,{})})]}),o?y.jsx(dR,{groups:E}):null,v?y.jsx("p",{className:"notification-dock-empty",children:"No active alerts"}):y.jsx("div",{className:"notification-dock-deck",children:C.map(B=>y.jsxs("section",{className:"notification-cluster-group",children:[y.jsxs("header",{className:"notification-cluster-group-head",children:[y.jsx("span",{className:"notification-cluster-theater",children:B.theaterLabel}),y.jsx("span",{className:"notification-cluster-group-count",children:B.totalCount})]}),y.jsx("ul",{className:"notification-cluster-roster",children:B.notifications.map(F=>y.jsxs("li",{className:`notification-row is-${F.kind}`,children:[y.jsx("span",{className:"notification-row-beacon","aria-hidden":"true"}),y.jsxs("span",{className:"notification-row-body",children:[y.jsx("span",{className:"notification-row-op",children:F.operationLabel}),y.jsx("span",{className:"notification-row-state",children:oR[F.kind]})]}),F.count>1?y.jsx("span",{className:"notification-row-count",children:F.count}):null,y.jsx("button",{type:"button",className:"notification-row-move",onClick:()=>k(F),"aria-label":`Open ${B.theaterLabel} ${F.operationLabel}`,children:"Open"})]},F.sessionId))})]},B.theaterId??"__unknown__"))})]})}):y.jsxs("button",{ref:_,type:"button",className:`notification-handle is-${h} ${h==="awaiting"?"has-awaiting":""}`,onClick:()=>M(!0),"aria-label":`Open notifications (${A})`,children:[y.jsx("span",{className:"notification-handle-count",children:v?0:A}),y.jsx("span",{className:"notification-handle-label",children:"Alerts"}),y.jsx(mR,{className:"notification-handle-chevron"}),R>0?y.jsx("span",{className:"notification-handle-pulse","aria-hidden":"true"},R):null]})}function cR(){if(typeof window>"u")return qf;try{const e=window.localStorage.getItem(Tw);return e===null?qf:e==="true"}catch{return qf}}function uR(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Tw,String(e))}catch{}}function hR(e){return e.globalMute||e.dnd||Object.keys(e.mutedTheaterIds).length>0}function Kb(e,n){let r=0;for(const a of e)for(const o of a.notifications)o.kind===n&&(r+=o.count);return r}function dR({groups:e}){const n=Xl(),r=fR(e,n.notificationPreferences.mutedTheaterIds,n.theaters);return y.jsxs("div",{className:"notification-cluster-settings",role:"dialog","aria-label":"Notification settings",children:[y.jsx("p",{className:"notification-cluster-settings-eyebrow",children:"Display"}),y.jsxs("label",{className:"notification-cluster-setting",children:[y.jsx("input",{type:"checkbox",checked:n.notificationPreferences.globalMute,onChange:a=>Ck(a.currentTarget.checked)}),y.jsx("span",{children:"Mute all"})]}),y.jsxs("label",{className:"notification-cluster-setting",children:[y.jsx("input",{type:"checkbox",checked:n.notificationPreferences.dnd,onChange:a=>xk(a.currentTarget.checked)}),y.jsx("span",{children:"Do not disturb"})]}),r.length>0?y.jsx("p",{className:"notification-cluster-settings-eyebrow",children:"By Theater"}):null,r.map(a=>y.jsxs("label",{className:"notification-cluster-setting",children:[y.jsx("input",{type:"checkbox",checked:a.theaterId?n.notificationPreferences.mutedTheaterIds[a.theaterId]===!0:!1,onChange:()=>{a.theaterId&&Ek(a.theaterId)}}),y.jsx("span",{children:a.theaterLabel})]},a.theaterId))]})}function fR(e,n,r){const a=new Map;for(const o of e)o.theaterId&&a.set(o.theaterId,o);for(const o of Object.keys(n))a.has(o)||a.set(o,{theaterId:o,theaterLabel:r.find(f=>f.id===o)?.label??o,notifications:[],totalCount:0});return[...a.values()]}function pR(){return y.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[y.jsx("path",{d:"M8 5.4a2.6 2.6 0 1 1 0 5.2 2.6 2.6 0 0 1 0-5.2Z",fill:"none",stroke:"currentColor",strokeWidth:"1.25"}),y.jsx("path",{d:"M8 2.2v1.6M8 12.2v1.6M3.9 3.9 5 5M11 11l1.1 1.1M2.2 8h1.6M12.2 8h1.6M3.9 12.1 5 11M11 5l1.1-1.1",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})]})}function gR(){return y.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:y.jsx("path",{d:"M4 4l8 8M12 4l-8 8",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function mR({className:e}){return y.jsx("svg",{className:e,viewBox:"0 0 16 16","aria-hidden":"true",children:y.jsx("path",{d:"M10 4l-4 4 4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}const Aw=[{title:"Console",entries:[{combos:[["Mod","K"]],description:"Search Operations across Theaters"},{combos:[["Esc"]],description:"Close the open overlay or menu"}]},{title:"Operations",entries:[{combos:[["Esc"]],description:"Close the carrier job stream"},{combos:[["Shift","Enter"]],description:"Insert a newline in the terminal instead of submitting"},{combos:[["Enter"],["Esc"]],description:"Confirm or cancel a session rename"},{combos:[["↑"],["↓"]],description:"Move between Theater, Theme, and launch menu items"}]},{title:"Map",entries:[{combos:[["Alt","←"],["Alt","→"]],description:"Cycle Operation and Shell panels; switch the maximized panel when maximized"},{combos:[["Drag"]],description:"Pan the operations map"},{combos:[["Shift","Drag"]],description:"Draw a new Operation terminal"},{combos:[["Space","Drag"]],description:"Pan even while a terminal has focus"},{combos:[["Scroll"]],description:"Zoom the map in or out"},{combos:[["Right-click"]],description:"Open the canvas actions menu"},{combos:[["Double-click"]],description:"Focus from a title bar; rename from an Operation name"},{combos:[["□"]],description:"Maximize the panel into the canvas overlay"},{combos:[["Click"]],description:"Clear terminal focus on the empty canvas"}]},{title:"Codex",entries:[{combos:[["Mod","K"]],description:"Toggle the command palette"},{combos:[["↑"],["↓"]],description:"Move through command palette results"},{combos:[["Enter"]],description:"Open the selected result"},{combos:[["Tab"]],description:"Move focus within the command palette"},{combos:[["Esc"]],description:"Close the command palette or diagram lightbox"},{combos:[["+"],["−"],["0"]],description:"Zoom the diagram lightbox in / out / reset"},{combos:[["F"]],description:"Fit the diagram lightbox to the viewport"}]}],_R=/mac|iphone|ipad|ipod/i,vR=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function bR({state:e}){const n=H.useRef(null),r=H.useRef(null),a=H.useRef(null);if(e.shortcutsOpen&&n.current===null&&(n.current=document.activeElement),H.useEffect(()=>{if(!e.shortcutsOpen)return;const f=_=>{_.key==="Escape"?(Uf(),_.preventDefault()):_.key==="Tab"&&SR(_,a.current),_.stopImmediatePropagation()};return r.current?.focus(),window.addEventListener("keydown",f,!0),()=>{window.removeEventListener("keydown",f,!0);const _=n.current;n.current=null,_?.focus?.()}},[e.shortcutsOpen]),!e.shortcutsOpen)return null;const o=yR();return y.jsxs("div",{className:"shortcuts-overlay",role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",children:[y.jsx("button",{type:"button",className:"shortcuts-overlay-scrim",onClick:Uf,"aria-label":"Close keyboard shortcuts"}),y.jsxs("section",{className:"shortcuts-overlay-card",ref:a,children:[y.jsxs("header",{className:"shortcuts-overlay-header",children:[y.jsx("span",{className:"shortcuts-overlay-kicker",children:"Reference Map"}),y.jsx("h2",{children:"Keyboard Shortcuts"})]}),y.jsx("button",{ref:r,type:"button",className:"shortcuts-overlay-close",onClick:Uf,"aria-label":"Close keyboard shortcuts",children:"×"}),y.jsx("div",{className:"shortcuts-overlay-groups",children:Aw.map(f=>y.jsxs("section",{className:"shortcuts-group","aria-labelledby":`shortcuts-${f.title.toLowerCase()}`,children:[y.jsx("h3",{id:`shortcuts-${f.title.toLowerCase()}`,children:f.title}),y.jsx("dl",{className:"shortcuts-list",children:f.entries.map(_=>y.jsxs("div",{className:"shortcuts-entry",children:[y.jsx("dt",{className:"shortcuts-combos",children:_.combos.map((c,u)=>y.jsxs("span",{className:"shortcuts-combo",children:[u>0?y.jsx("span",{className:"shortcuts-combo-separator",children:"or"}):null,y.jsx("span",{className:"shortcuts-keyset",children:c.map(d=>y.jsx("kbd",{children:d==="Mod"?o:d},d))})]},`${_.description}:${c.join("+")}`))}),y.jsx("dd",{children:_.description})]},`${f.title}:${_.description}`))})]},f.title))})]})]})}function yR(){const n=navigator.userAgentData?.platform??navigator.platform;return _R.test(n)?"⌘":"Ctrl"}function SR(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(vR)),a=r[0],o=r[r.length-1];!a||!o||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),a.focus()))}const wR="a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1'])",Vb="operation-search-listbox",kw="__unassigned__";function CR({state:e}){const n=_o(),[r,a]=H.useState(""),[o,f]=H.useState(0),_=H.useRef(null),c=H.useRef(null),u=H.useRef(null),d=H.useRef(new Map),S=H.useMemo(()=>Ik(e),[e]),g=H.useMemo(()=>qA(S,r),[S,r]),C=H.useMemo(()=>WA(g),[g]),E=H.useMemo(()=>WS(r),[r]),A=Yb(o,g.length),x=g[A]?Xb(g[A].sessionId):void 0;if(H.useEffect(()=>{if(!e.operationSearchOpen)return;u.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const h=document.body.style.overflow;return document.body.style.overflow="hidden",window.setTimeout(()=>_.current?.focus(),0),()=>{document.body.style.overflow=h,u.current?.focus()}},[e.operationSearchOpen]),H.useEffect(()=>{if(!e.operationSearchOpen){a(""),f(0);return}f(0)},[e.operationSearchOpen,r]),H.useEffect(()=>{if(!e.operationSearchOpen)return;const h=g[A];h&&d.current.get(h.sessionId)?.scrollIntoView({block:"nearest"})},[A,g,e.operationSearchOpen]),!e.operationSearchOpen)return null;const p=h=>{uw(h),n("/operations"),Hf()},v=h=>{if(h.key==="Escape"){h.preventDefault(),Hf();return}if(h.key==="ArrowDown"||h.key==="ArrowUp"){h.preventDefault(),f(b=>Yb(b+(h.key==="ArrowDown"?1:-1),g.length));return}if(h.key==="Enter"){const b=g[A];if(!b)return;h.preventDefault(),p(b.sessionId);return}h.key==="Tab"&&AR(h,c.current)};return y.jsx("div",{className:"operation-search-overlay",onMouseDown:h=>{h.target===h.currentTarget&&Hf()},children:y.jsxs("section",{ref:c,className:"operation-search-card",role:"dialog","aria-modal":"true","aria-label":"Operation quick search",tabIndex:-1,onKeyDown:v,children:[y.jsxs("div",{className:"operation-search-field",children:[y.jsx(kR,{}),y.jsx("input",{ref:_,id:"operation-search-input",type:"search",value:r,onChange:h=>a(h.target.value),placeholder:"Search Operations across Theaters",autoComplete:"off",role:"combobox","aria-expanded":!0,"aria-controls":Vb,"aria-activedescendant":x,"aria-autocomplete":"list",spellCheck:!1}),y.jsx("kbd",{children:"esc"})]}),y.jsx("div",{id:Vb,className:"operation-search-results",role:"listbox","aria-label":"Operation results",children:C.length>0?C.map(h=>{const b=ER(h.theaterId);return y.jsxs("section",{className:"operation-search-section",role:"group","aria-labelledby":b,children:[y.jsx("h2",{id:b,className:"operation-search-section-heading",children:Wf(h.theaterLabel,E)}),h.entries.map(T=>{const R=g.indexOf(T),L=R===A;return y.jsxs("button",{id:Xb(T.sessionId),ref:M=>{M?d.current.set(T.sessionId,M):d.current.delete(T.sessionId)},type:"button",className:`operation-search-result ${L?"is-active":""}`,role:"option","aria-selected":L,onMouseEnter:()=>f(R),onClick:()=>p(T.sessionId),children:[y.jsxs("span",{className:"operation-search-result-text",children:[y.jsx("strong",{children:Wf(T.operationName,E)}),y.jsx("small",{children:xR(T)})]}),y.jsx("span",{className:"operation-search-theater",children:Wf(T.theaterLabel,E)})]},T.sessionId)})]},h.theaterId??kw)}):y.jsx("p",{className:"operation-search-empty",children:"No matching Operations."})})]})})}function Yb(e,n){return n<=0?0:Math.max(0,Math.min(e,n-1))}function xR(e){return[e.cliLabel,e.status].filter(Boolean).join(" · ")}function ER(e){return`operation-search-heading-${Rw(e??kw)}`}function Xb(e){return`operation-search-option-${Rw(e)}`}function Rw(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}function Wf(e,n){if(n.length===0)return e;const r=[];let a=0;for(;a<e.length;){const o=TR(e,n,a);if(!o){r.push(e.slice(a));break}o.start>a&&r.push(e.slice(a,o.start)),r.push(y.jsx("mark",{children:e.slice(o.start,o.end)},`${o.start}-${o.end}`)),a=o.end}return r}function TR(e,n,r){const a=e.toLocaleLowerCase();let o=null;for(const f of n){const _=a.indexOf(f,r);_!==-1&&(!o||_<o.start)&&(o={start:_,end:_+f.length})}return o}function AR(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(wR)).filter(f=>f.offsetParent!==null);if(r.length===0)return;const a=r[0],o=r[r.length-1];if(e.shiftKey&&document.activeElement===a){e.preventDefault(),o?.focus();return}!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),a?.focus())}function kR(){return y.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:y.jsx("path",{d:"m14.2 14.2 3 3M8.9 15.2a6.3 6.3 0 1 1 0-12.6 6.3 6.3 0 0 1 0 12.6Z",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function RR({open:e,title:n,message:r,tone:a="info",onDismiss:o}){return e?y.jsx("div",{className:"app-toast-host",children:y.jsxs("div",{className:`app-toast app-toast--${a}`,role:"status","aria-live":"polite",children:[y.jsx("span",{className:"app-toast-dot","aria-hidden":"true"}),y.jsxs("div",{className:"app-toast-body",children:[y.jsx("p",{className:"app-toast-title",children:n}),r?y.jsx("p",{className:"app-toast-message",children:r}):null]}),o?y.jsx("button",{type:"button",className:"app-toast-close",onClick:o,"aria-label":"Dismiss notification",children:"×"}):null]})}):null}function LR({state:e}){if(e.releaseNotesLoading||e.releaseNotes.length===0||e.releaseNotesError&&!e.releaseNotesStale)return null;const n=e.releaseNotes.find(a=>a.version===e.version),r=n&&e.version?` v${n.version}`:"";return y.jsx("button",{type:"button",className:"topbar-whatsnew-button",onMouseDown:a=>a.preventDefault(),onClick:kk,"aria-label":`What's new${r}`,title:`What's new${r}`,children:y.jsx("span",{children:"What's new"})})}const MR=1400,DR="https://github.com/sbluemin/fleet-harness",OR="https://github.com/sbluemin/fleet-harness/stargazers",NR="https://api.github.com/repos/sbluemin/fleet-harness",Qg="fleet-console.github-stars",BR=360*60*1e3;function IR({state:e}){const n=e.connectionError!==null,r=Oi().pathname,a=_o(),o=r.startsWith("/carrier-settings"),f=r.startsWith("/settings"),_=u=>{a(r.startsWith(u)?"/operations":u)},c=r.startsWith("/codex")?y.jsx(e3,{}):r.startsWith("/carrier-settings")?y.jsx(Jb,{}):r.startsWith("/settings")?y.jsx(Zb,{}):r.startsWith("/operations")?y.jsx(QR,{}):y.jsx(JR,{});return y.jsxs("header",{className:"topbar",children:[y.jsxs("div",{className:"topbar-lead",children:[y.jsxs(Pl,{className:"topbar-brand",to:"/operations","aria-label":"Operations로 이동",children:[y.jsx("span",{className:`topbar-sigil ${n?"is-alert":""}`,"aria-hidden":"true",title:e.connectionError??void 0,children:c}),y.jsxs("h1",{className:"topbar-title",children:["Fleet",y.jsx("span",{className:"topbar-title-thin",children:"Console"})]})]}),y.jsxs("span",{className:"topbar-preview-badge",children:[y.jsx("span",{className:"topbar-preview-label",children:"Research Preview"}),e.version?y.jsxs("span",{className:"topbar-preview-version",children:["v",e.version]}):null]}),y.jsx(UR,{}),y.jsx(LR,{state:e})]}),y.jsx(HR,{state:e}),y.jsxs("div",{className:"topbar-meta",children:[e.updateAvailable?y.jsx(jR,{latestVersion:e.latestVersion}):null,y.jsx("button",{type:"button",className:"topbar-icon-button topbar-shortcuts-button",onMouseDown:u=>u.preventDefault(),onClick:Ak,"aria-label":"Keyboard shortcuts",title:"Keyboard shortcuts",children:y.jsx(r3,{})}),y.jsxs("button",{type:"button",className:`topbar-nav-link ${o?"is-active":""}`,title:o?"Back to Operations":"Carrier settings","aria-current":o?"page":void 0,onClick:()=>_("/carrier-settings"),children:[y.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:y.jsx(Jb,{})}),y.jsx("span",{children:"Carriers"})]}),y.jsxs("button",{type:"button",className:`topbar-nav-link ${f?"is-active":""}`,title:f?"Back to Operations":"Settings","aria-current":f?"page":void 0,onClick:()=>_("/settings"),children:[y.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:y.jsx(Zb,{})}),y.jsx("span",{children:"Settings"})]})]})]})}function jR({latestVersion:e}){const[n,r]=H.useState("idle"),[a,o]=H.useState(null),f=H.useRef(null),_=zR(n,a,e);H.useEffect(()=>()=>{f.current!==null&&window.clearTimeout(f.current)},[]);const c=async()=>{if(!_.disabled){f.current!==null&&(window.clearTimeout(f.current),f.current=null),r("applying"),o(null);try{if((await dA()).status!=="accepted"){r("error"),o("invalid_response");return}r("accepted"),f.current=window.setTimeout(()=>{f.current=null,r("completed")},MR)}catch(u){const d=u instanceof Ue?u.message:"network_error";o(d),r(PR(d)?"blocked":"error")}}};return y.jsx("button",{type:"button",className:`topbar-update-badge topbar-update-badge--${_.tone}`,onClick:c,disabled:_.disabled,title:_.title,"aria-live":"polite",children:_.label})}function zR(e,n,r){const a=r?`최신 버전 ${r}`:"업데이트 가능";return e==="applying"?{label:"요청 중",title:"업데이트 적용 요청을 보내는 중입니다.",tone:"live",disabled:!0}:e==="accepted"?{label:"업데이트 중",title:"서버가 곧 재시작되고 새 창에서 콘솔을 엽니다.",tone:"live",disabled:!0}:e==="completed"?{label:"완료: 새 창에서 계속",title:"새 창에서 재시작된 콘솔을 계속 사용하세요.",tone:"live",disabled:!0}:e==="blocked"?$R(n):e==="error"?{label:"재시도",title:"업데이트 요청에 실패했습니다. 다시 시도할 수 있습니다.",tone:"error",disabled:!1}:{label:"Update available",title:a,tone:"warn",disabled:!1}}function $R(e){return e==="local_channel"?{label:"로컬 빌드",title:"로컬 개발 빌드는 콘솔에서 업데이트하지 않습니다.",tone:"blocked",disabled:!0}:e==="active_terminal_sessions"?{label:"세션 종료 필요",title:"실행 중인 Operation을 종료한 뒤 업데이트하세요.",tone:"blocked",disabled:!1}:e==="update_already_in_progress"?{label:"이미 진행 중",title:"다른 업데이트 적용이 이미 진행 중입니다.",tone:"blocked",disabled:!0}:e==="update_not_available"?{label:"업데이트 없음",title:"서버 재확인 결과 적용할 업데이트가 없습니다.",tone:"blocked",disabled:!0}:{label:"콘솔 준비 안 됨",title:"콘솔이 업데이트를 시작할 준비가 되지 않았습니다. 잠시 뒤 다시 시도하세요.",tone:"error",disabled:!1}}function PR(e){return e==="active_terminal_sessions"||e==="local_channel"||e==="update_already_in_progress"||e==="update_not_available"}function HR({state:e}){const[n,r]=H.useState(!1),[a,o]=H.useState(!1),f=H.useRef(null),_=H.useRef(null),c=H.useRef(null),u=e.theaters.find(p=>p.id===e.activeTheaterId)??null,d=u?.label??(e.theaters.length===0?"No Theaters":"Theater");H.useEffect(()=>{if(!n)return;const p=h=>{f.current?.contains(h.target)||r(!1)},v=h=>{h.key==="Escape"&&(r(!1),_.current?.focus())};return document.addEventListener("mousedown",p),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",v)}},[n]),H.useEffect(()=>{if(!n)return;const p=c.current;if(!p)return;(p.querySelector('[data-active="true"]')??p.querySelector("[role^='menuitem']"))?.focus()},[n]);const S=p=>{bk(p),r(!1),_.current?.focus()},g=async()=>{r(!1),o(!0)},C=()=>{o(!1),yk()},E=async p=>{o(!1),lw();try{const v=await IS(p),h=await BS(v);cw(h)}catch(v){Yp(v instanceof Error?v.message:String(v))}},A=async()=>{if(u){r(!1);try{await pA(u.id),Gb(u.id)}catch(p){if(p instanceof Ue&&p.status===404){Gb(u.id);return}Yp(p instanceof Error?p.message:String(p))}}},x=p=>{if(p.key!=="ArrowDown"&&p.key!=="ArrowUp")return;p.preventDefault();const v=Array.from(c.current?.querySelectorAll("[role^='menuitem']")??[]);if(v.length===0)return;const h=v.indexOf(document.activeElement),b=p.key==="ArrowDown"?1:-1,T=(h+b+v.length)%v.length;v[T]?.focus()};return y.jsxs("div",{className:"theater-control",ref:f,children:[y.jsx("span",{className:"theater-eyebrow","aria-hidden":"true",children:"Theater"}),y.jsxs("button",{type:"button",ref:_,className:`theater-trigger ${n?"is-open":""}`,"aria-haspopup":"menu","aria-expanded":n,"aria-label":"Theater",title:u?.label??e.theaterError??void 0,onClick:()=>r(p=>!p),children:[y.jsx("span",{className:"theater-trigger-sigil","aria-hidden":"true",children:y.jsx(VR,{})}),y.jsx("span",{className:"theater-trigger-label",children:d}),y.jsx("span",{className:"theater-trigger-caret","aria-hidden":"true",children:y.jsx(YR,{})})]}),n?y.jsxs("div",{className:"theater-menu",role:"menu","aria-label":"Theater",ref:c,onKeyDown:x,children:[e.theaters.length>0?y.jsx("ul",{className:"theater-menu-list",children:e.theaters.map(p=>{const v=p.id===e.activeTheaterId;return y.jsx("li",{children:y.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":v,"data-active":v?"true":void 0,className:`theater-menu-item ${v?"is-active":""}`,title:p.label,onClick:()=>S(p.id),children:[y.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:v?y.jsx(XR,{}):null}),y.jsx("span",{className:"theater-menu-label",children:p.label})]})},p.id)})}):y.jsx("p",{className:"theater-menu-empty",children:"No Theaters yet."}),y.jsx("div",{className:"theater-menu-divider",role:"separator"}),u?y.jsxs(y.Fragment,{children:[y.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item theater-menu-forget",onClick:A,children:[y.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:y.jsx(ZR,{})}),y.jsx("span",{className:"theater-menu-label",children:"Forget Theater"})]}),y.jsx("div",{className:"theater-menu-divider",role:"separator"})]}):null,y.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item theater-menu-add",disabled:e.addingTheater,onClick:g,children:[y.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:y.jsx(t3,{})}),y.jsx("span",{className:"theater-menu-label",children:e.addingTheater?"Adding Theater…":"Add Theater…"})]}),e.theaterError?y.jsx("p",{className:"theater-menu-error",children:e.theaterError}):null]}):null,y.jsx(Ew,{open:a,onCancel:C,onConfirm:E})]})}function UR(){const e=FR(),n=e.count!==null;return y.jsxs("div",{className:"topbar-github",role:"group","aria-label":"GitHub",children:[y.jsx("a",{className:"topbar-github-link",href:DR,target:"_blank",rel:"noopener noreferrer","aria-label":"GitHub 저장소 열기",title:"GitHub 저장소",children:y.jsx(n3,{})}),y.jsxs("a",{className:"topbar-github-stars",href:OR,target:"_blank",rel:"noopener noreferrer","aria-label":n?`GitHub 스타 ${e.count.toLocaleString()}개 — 스타 누르기`:"GitHub에서 스타 누르기",title:"GitHub에서 스타 누르기",children:[y.jsx(i3,{}),n?y.jsx("span",{className:"topbar-github-stars-count",children:KR(e.count)}):null]})]})}function FR(){const[e,n]=H.useState(()=>{const r=qR();return r===null?{count:null,status:"idle"}:{count:r,status:"ready"}});return H.useEffect(()=>{if(WR())return;let r=!1;return n(a=>a.status==="ready"?a:{...a,status:"loading"}),fetch(NR,{headers:{Accept:"application/vnd.github+json"}}).then(a=>a.ok?a.json():Promise.reject(new Error(`status ${a.status}`))).then(a=>{if(r)return;const o=typeof a.stargazers_count=="number"?a.stargazers_count:null;if(o===null){n(f=>({count:f.count,status:f.count===null?"error":"ready"}));return}GR(o),n({count:o,status:"ready"})}).catch(()=>{r||n(a=>({count:a.count,status:a.count===null?"error":"ready"}))}),()=>{r=!0}},[]),e}function qR(){try{const e=window.localStorage.getItem(Qg);if(!e)return null;const n=JSON.parse(e);return typeof n.count=="number"?n.count:null}catch{return null}}function WR(){try{const e=window.localStorage.getItem(Qg);if(!e)return!1;const n=JSON.parse(e);return typeof n.at=="number"&&Date.now()-n.at<BR}catch{return!1}}function GR(e){try{window.localStorage.setItem(Qg,JSON.stringify({count:e,at:Date.now()}))}catch{}}function KR(e){if(e<1e3)return String(e);const n=e/1e3;return n<10?`${n.toFixed(1)}k`:`${Math.round(n)}k`}function VR(){return y.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[y.jsx("circle",{cx:"8",cy:"3.2",r:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),y.jsx("path",{d:"M8 4.7v8.1M4.3 8.2H11.7M3.4 9.1A4.7 4.7 0 0 0 12.6 9.1",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function YR(){return y.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:y.jsx("path",{d:"M4.5 6.5 8 10l3.5-3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}function XR(){return y.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:y.jsx("path",{d:"M3.5 8.5 6.5 11.5 12.5 5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ZR(){return y.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:y.jsx("path",{d:"M4.7 4.7 11.3 11.3M11.3 4.7 4.7 11.3",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round"})})}function JR(){return y.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16",children:[y.jsx("path",{d:"M8 1.8 9.5 6.5 14.2 8 9.5 9.5 8 14.2 6.5 9.5 1.8 8 6.5 6.5Z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),y.jsx("path",{d:"M8 4.7 8.7 7.3 11.3 8 8.7 8.7 8 11.3 7.3 8.7 4.7 8 7.3 7.3Z",fill:"currentColor"})]})}function QR(){return y.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[y.jsx("circle",{cx:"8",cy:"8",r:"5.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),y.jsx("path",{d:"M8 3.7v2.1M8 10.2v2.1M3.7 8h2.1M10.2 8h2.1M8 8l3.1-2.1",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),y.jsx("circle",{cx:"8",cy:"8",r:"1.1",fill:"currentColor"})]})}function e3(){return y.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[y.jsx("circle",{cx:"12",cy:"12",r:"9"}),y.jsx("circle",{cx:"12",cy:"12",r:"3.2",fill:"currentColor",stroke:"none",opacity:"0.16"}),y.jsx("path",{d:"M12 3v3.6M12 17.4V21M3 12h3.6M17.4 12H21"}),y.jsx("path",{d:"M12 8.6 14.2 12 12 15.4 9.8 12Z",fill:"currentColor",stroke:"none"})]})}function Zb(){return y.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[y.jsx("path",{d:"M3 4.4h10M3 8h10M3 11.6h10",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),y.jsx("circle",{cx:"6.2",cy:"4.4",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"}),y.jsx("circle",{cx:"10",cy:"8",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"}),y.jsx("circle",{cx:"7.4",cy:"11.6",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"})]})}function Jb(){return y.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[y.jsx("circle",{cx:"4",cy:"4.2",r:"1.15",fill:"currentColor"}),y.jsx("circle",{cx:"4",cy:"8",r:"1.15",fill:"currentColor"}),y.jsx("circle",{cx:"4",cy:"11.8",r:"1.15",fill:"currentColor"}),y.jsx("path",{d:"M7.2 4.2h6M7.2 8h6M7.2 11.8h6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function t3(){return y.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:y.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function n3(){return y.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:y.jsx("path",{fill:"currentColor",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.65 7.65 0 0 1 2-.27c.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"})})}function i3(){return y.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:y.jsx("path",{d:"M8 2.2 9.41 6.26 13.71 6.35 10.28 8.94 11.53 13.05 8 10.6 4.47 13.05 5.72 8.94 2.29 6.35 6.59 6.26Z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})})}function r3(){return y.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[y.jsx("rect",{x:"2.4",y:"4.1",width:"11.2",height:"7.8",rx:"1.8",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),y.jsx("path",{d:"M4.5 6.3h.1M6.8 6.3h.1M9.1 6.3h.1M11.4 6.3h.1M4.5 8.2h.1M6.8 8.2h.1M9.1 8.2h.1M11.4 8.2h.1M5.8 10.1h4.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}const s3=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),_l=10;function a3({state:e}){const n=H.useRef(null),r=H.useRef(null),a=H.useRef(null),o=!e.bootstrapped||e.onboardingOpen||e.operationSearchOpen||e.shortcutsOpen||e.timelineOpen;if(e.whatsNewOpen&&!o&&n.current===null&&(n.current=document.activeElement),H.useEffect(()=>{if(!e.whatsNewOpen||o)return;const x=p=>{p.key==="Escape"?(p.preventDefault(),fu()):p.key==="Tab"&&c3(p,a.current),p.stopImmediatePropagation()};return r.current?.focus(),window.addEventListener("keydown",x,!0),()=>{window.removeEventListener("keydown",x,!0);const p=n.current;n.current=null,p?.focus?.()}},[e.whatsNewOpen,o]),!e.whatsNewOpen||o||e.releaseNotes.length===0)return null;const f=e.selectedReleaseNoteKey??Wa(e.releaseNotes[0]?.version??"",0),_=e.releaseNotes.findIndex((x,p)=>Wa(x.version,p)===f),c=e.releaseNotes[_]??e.releaseNotes[0],u=Wa(c.version,_>=0?_:0),d=()=>{iw(),NS({force:!0}).then(rw).catch(x=>sw(x instanceof Error?x.message:String(x)))},S=Math.max(1,Math.ceil(e.releaseNotes.length/_l)),g=Math.min(S-1,Math.floor((_>=0?_:0)/_l)),C=g*_l,E=e.releaseNotes.slice(C,C+_l),A=x=>{const p=g+x;if(p<0||p>=S)return;const v=p*_l,h=e.releaseNotes[v];h&&qb(Wa(h.version,v))};return y.jsxs("div",{className:"whatsnew-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"whatsnew-title",children:[y.jsx("button",{type:"button",className:"whatsnew-scrim",onClick:fu,"aria-label":"Close What's new"}),y.jsxs("section",{className:"whatsnew-card",ref:a,children:[y.jsxs("header",{className:"whatsnew-header",children:[y.jsxs("div",{className:"whatsnew-heading-row",children:[y.jsx("h2",{id:"whatsnew-title",children:"What's new"}),y.jsxs("span",{className:"whatsnew-version-badge",children:["v",c.version]})]}),y.jsxs("div",{className:"whatsnew-meta-row",children:[c.date?y.jsxs("time",{className:"whatsnew-date",dateTime:c.date,children:["Released ",c.date]}):y.jsx("span",{className:"whatsnew-date",children:"Unreleased"}),e.releaseNotesStale?y.jsx("span",{className:"whatsnew-stale",children:"Stale"}):null]})]}),y.jsx("button",{ref:r,type:"button",className:"whatsnew-close",onClick:fu,"aria-label":"Close What's new",children:"x"}),y.jsxs("div",{className:"whatsnew-body",children:[y.jsxs("div",{className:"whatsnew-version-selector",children:[y.jsx("select",{"aria-label":"Release version",value:u,onChange:x=>qb(x.currentTarget.value),children:E.map((x,p)=>{const v=C+p;return y.jsxs("option",{value:Wa(x.version,v),children:[x.version==="Unreleased"?"Unreleased":`v${x.version}`,x.date?` · ${x.date}`:""]},Wa(x.version,v))})}),S>1?y.jsxs("div",{className:"whatsnew-pagination",children:[y.jsx("button",{type:"button",className:"whatsnew-page-button",onClick:()=>A(-1),disabled:g===0,"aria-label":"Newer versions",children:"‹"}),y.jsxs("span",{className:"whatsnew-page-status",children:[g+1," / ",S]}),y.jsx("button",{type:"button",className:"whatsnew-page-button",onClick:()=>A(1),disabled:g>=S-1,"aria-label":"Older versions",children:"›"})]}):null,y.jsx("button",{type:"button",className:"whatsnew-refresh",onClick:d,disabled:e.releaseNotesLoading,children:e.releaseNotesLoading?"Refreshing":"Refresh"})]}),e.releaseNotesError?y.jsx("p",{className:"whatsnew-error",children:"Release notes could not be refreshed."}):null,c.sections.map((x,p)=>y.jsx(o3,{section:x,index:p},x.heading))]}),y.jsx("footer",{className:"whatsnew-footer",children:y.jsx("button",{type:"button",className:"whatsnew-done",onClick:fu,children:"Close"})})]})]})}function o3({section:e,index:n}){const r=e.heading.toLowerCase().replaceAll(" ","-"),a={"--whatsnew-delay":`${n*55}ms`};return y.jsxs("section",{className:`whatsnew-section whatsnew-section--${r}`,style:a,children:[y.jsx("h3",{children:y.jsx("span",{className:"whatsnew-section-chip",children:e.heading})}),y.jsx("ul",{children:e.items.map((o,f)=>y.jsx("li",{children:y.jsx(l3,{item:o})},`${o.text}:${f}`))})]})}function l3({item:e}){return y.jsxs(y.Fragment,{children:[e.packageTags.map((n,r)=>y.jsx("span",{className:`whatsnew-package-chip whatsnew-package-chip--${r%2===0?"brass":"aurora"}`,children:n},`${n}:${r}`)),y.jsx("span",{children:e.text})]})}function Wa(e,n){return`${e}:${n}`}function c3(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(s3)),a=r[0],o=r[r.length-1];!a||!o||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),a.focus()))}const u3=new Set(["idle_prompt","permission_prompt","auth_success","elicitation_dialog","elicitation_complete","elicitation_response"]);function h3(){let e="";return n=>{e+=n;const r=[];let a=e.indexOf(`
13
+
14
+ `);for(;a>=0;){const o=e.slice(0,a);e=e.slice(a+2);const f=f3(o);f&&r.push(f),a=e.indexOf(`
15
+
16
+ `)}return r}}function d3(e){if(!e.data)return null;let n;try{n=JSON.parse(e.data)}catch{return null}if(e.event==="observer:truncated"){const a=n.tenant?.tenantId;return!a||!n.truncation?null:{kind:"truncation",tenantId:a,tenantLabel:n.tenant?.tenantLabel,truncation:n.truncation}}if(e.event==="session:updated"){const a=e1(n.session);return a?{kind:"session",tenantId:a.tenantId??a.sessionId,session:a}:null}if(e.event==="session:attention"){const a=e1(n.session);return a?{kind:"attention",tenantId:a.tenantId??a.sessionId,session:a,reason:p3(n.reason)}:null}const r=Qb(n.event)??Qb(n);return r?{kind:"event",tenantId:r.tenantId,tenantLabel:n.tenant?.tenantLabel,event:r}:null}function f3(e){const n=e.split(`
17
+ `),r=n.find(o=>o.startsWith("event:"))?.slice(6).trim()??"message",a=n.filter(o=>o.startsWith("data:")).map(o=>o.slice(5).trim()).join(`
18
+ `);return!a&&r==="message"?null:{event:r,data:a}}function Qb(e){if(typeof e!="object"||e===null)return null;const n=e;return typeof n.id!="number"||typeof n.tenantId!="string"||typeof n.type!="string"||typeof n.at!="number"?null:typeof n.event!="object"||n.event===null?{...n,event:{}}:n}function e1(e){if(typeof e!="object"||e===null)return null;const n=e;return typeof n.sessionId!="string"||typeof n.cwdLabel!="string"||typeof n.sequence!="number"||typeof n.status!="string"||typeof n.createdAt!="number"||"cwd"in n||"canonicalCwd"in n||"providerSession"in n||"ticket"in n||"token"in n||"transcriptPath"in n?null:{sessionId:n.sessionId,terminalSessionId:typeof n.terminalSessionId=="string"?n.terminalSessionId:n.sessionId,cwdLabel:n.cwdLabel,sequence:n.sequence,label:typeof n.label=="string"?n.label:void 0,cliId:typeof n.cliId=="string"?n.cliId:void 0,cliLabel:typeof n.cliLabel=="string"?n.cliLabel:void 0,status:n.status,turnState:n.turnState==="running"||n.turnState==="ended"?n.turnState:"none",createdAt:n.createdAt,theaterId:typeof n.theaterId=="string"?n.theaterId:void 0,tenantId:typeof n.tenantId=="string"?n.tenantId:void 0,registrationId:typeof n.registrationId=="string"?n.registrationId:void 0,resumeAvailable:n.resumeAvailable===!0}}function p3(e){return typeof e=="string"&&u3.has(e)?e:void 0}const t1=250,g3=5e3;function m3(){const e=new AbortController;return _3(e.signal),()=>e.abort()}async function _3(e){let n=t1,r=!1;const a=async()=>{if(!r){r=!0;try{fw(await DS(e))}catch{}finally{r=!1}}};for(;!e.aborted;){$e({connection:"connecting"});try{await b3(e);const o=await uA(e);$e({connection:"live",connectionError:null}),n=t1,await v3(o,e,a),e.aborted||$e({connection:"connecting",connectionError:null})}catch(o){if(e.aborted)return;$e({connection:"connecting",connectionError:o instanceof Error?o.message:String(o)})}if(e.aborted)return;await y3(n,e),n=Math.min(n*2,g3)}}async function v3(e,n,r){const a=new TextDecoder,o=h3();for(;!n.aborted;){const f=await e.read();if(f.done)return;for(const _ of o(a.decode(f.value,{stream:!0}))){const c=d3(_);if(c){if(c.kind==="truncation"&&c.truncation){Dk(c.tenantId,c.tenantLabel,c.truncation);continue}if(c.kind==="session"&&c.session){gh(c.session);continue}if(c.kind==="attention"&&c.session){wk(c.session,c.reason);continue}if(c.event){const{unknownTenant:u}=Mk(c.event,c.tenantLabel);u&&r()}}}}}async function b3(e){const[n,r]=await Promise.all([DS(e),cA(e)]);fw(n),Lk(r)}async function y3(e,n){await new Promise(r=>{const a=()=>{clearTimeout(o),n.removeEventListener("abort",a),r()},o=setTimeout(a,e);n.addEventListener("abort",a)})}const S3=new Set(["token","credential","cwd","path","persona","prompt","toolAllowlist","allowedExecutorTools"]);async function Lw(e){const n=await fetch("/carrier-settings/state",{signal:e});return await em(n),Mw(await n.json(),n.status)}async function w3(e){const n=await fetch("/carrier-settings/options",{signal:e});return await em(n),k3(await n.json(),n.status)}async function C3(e,n,r){return vo(`/carrier-settings/carriers/${encodeURIComponent(e)}/cli`,"PUT",{cliType:n},r)}async function x3(e,n,r){return vo(`/carrier-settings/carriers/${encodeURIComponent(e)}/model`,"PUT",n,r)}async function E3(e,n,r){return vo(`/carrier-settings/carriers/${encodeURIComponent(e)}/display-name`,"PATCH",{displayName:n},r)}async function n1(e,n,r){return vo(`/carrier-settings/carriers/${encodeURIComponent(e)}/agent-mode`,"PUT",{agentMode:n},r)}async function T3(e,n,r,a){return vo(`/carrier-settings/carriers/${encodeURIComponent(e)}/taskforce/${encodeURIComponent(n)}`,"PUT",r,a)}async function A3(e,n,r){return vo(`/carrier-settings/carriers/${encodeURIComponent(e)}/taskforce/${encodeURIComponent(n)}`,"DELETE",{},r)}async function vo(e,n,r,a){const o=await fetch(e,{method:n,headers:{"Content-Type":"application/json"},body:JSON.stringify(r),signal:a});await em(o);const f=await o.json();if(!f||typeof f!="object"||!("state"in f))throw new Ue(o.status,"Invalid carrier settings mutation response");return{state:Mw(f.state,o.status)}}async function em(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new Ue(e.status,n)}function Mw(e,n){Dw(e,n);const r=e;if(!r||typeof r.generation!="number"||!Array.isArray(r.carriers))throw new Ue(n,"Invalid carrier settings state response");return{generation:r.generation,carriers:r.carriers.map(a=>R3(a,n))}}function k3(e,n){Dw(e,n);const r=e;if(!r||!Array.isArray(r.cliTypes)||!r.taskForceConstraints||typeof r.taskForceConstraints.minBackends!="number")throw new Ue(n,"Invalid carrier settings options response");return{cliTypes:r.cliTypes.map(a=>L3(a,n)),taskForceConstraints:{minBackends:r.taskForceConstraints.minBackends}}}function R3(e,n){const r=e;if(!r||typeof r.carrierId!="string"||typeof r.displayName!="string"||typeof r.sourceDisplayName!="string"||typeof r.role!="string"||typeof r.roleDescription!="string"||typeof r.slot!="number"||typeof r.cliType!="string"||typeof r.defaultCliType!="string"||typeof r.model!="string"||r.effort!==void 0&&typeof r.effort!="string"||r.agentMode!=="cli"&&r.agentMode!=="subagent"||typeof r.subagentMode!="boolean"||typeof r.taskForceBackendCount!="number"||!r.taskforce||!Array.isArray(r.taskforce.backends))throw new Ue(n,"Invalid carrier settings carrier response");return{carrierId:r.carrierId,displayName:r.displayName,sourceDisplayName:r.sourceDisplayName,role:r.role,roleDescription:r.roleDescription,...r.category?{category:r.category}:{},slot:r.slot,cliType:r.cliType,defaultCliType:r.defaultCliType,model:r.model,...r.effort?{effort:r.effort}:{},agentMode:r.agentMode,subagentMode:r.subagentMode,taskForceBackendCount:r.taskForceBackendCount,taskforce:{backends:r.taskforce.backends.map(a=>D3(a,n))}}}function L3(e,n){const r=e;if(!r||typeof r.id!="string"||typeof r.displayName!="string"||typeof r.supportsSubagent!="boolean"||!Array.isArray(r.models)||typeof r.defaultModel!="string")throw new Ue(n,"Invalid carrier settings CLI option");return{id:r.id,displayName:r.displayName,supportsSubagent:r.supportsSubagent,models:r.models.map(a=>M3(a,n)),defaultModel:r.defaultModel}}function M3(e,n){const r=e;if(!r||typeof r.modelId!="string"||typeof r.name!="string")throw new Ue(n,"Invalid carrier settings model option");if(r.effort!==void 0&&(!Array.isArray(r.effort.levels)||typeof r.effort.default!="string"))throw new Ue(n,"Invalid carrier settings effort option");return{modelId:r.modelId,name:r.name,...r.effort?{effort:{levels:r.effort.levels.filter(a=>typeof a=="string"),default:r.effort.default}}:{}}}function D3(e,n){const r=e;if(!r||typeof r.cliType!="string"||typeof r.model!="string"||r.effort!==void 0&&typeof r.effort!="string")throw new Ue(n,"Invalid carrier settings Task Force backend");return{cliType:r.cliType,model:r.model,...r.effort?{effort:r.effort}:{}}}function Dw(e,n){const r=[e];for(;r.length>0;){const a=r.pop();if(!(!a||typeof a!="object"))for(const[o,f]of Object.entries(a)){if(S3.has(o))throw new Ue(n,"Carrier settings response leaked a restricted field");f&&typeof f=="object"&&r.push(f)}}}const O3={cliType:"",model:"",effort:"",displayName:"",agentMode:"cli",taskforce:{}},Xp=new Set;let Ln={loading:!1,state:null,options:null,activeCarrierId:null,draft:O3,savingActionId:null,error:null};function Ow(){return H.useSyncExternalStore(N3,i1,i1)}function i1(){return Ln}function N3(e){return Xp.add(e),()=>{Xp.delete(e)}}async function r1(e){nr({loading:!0,error:null});try{const[n,r]=await Promise.all([Lw(e),w3(e)]);Nw(n,r)}catch(n){if(e?.aborted)return;nr({loading:!1,error:Iw(n)})}}function B3(e){const n=Ln.state?.carriers.find(r=>r.carrierId===e);nr({activeCarrierId:e,draft:n?tm(n,Ln.options):Ln.draft,error:null})}function Zs(e){nr({draft:{...Ln.draft,...e},error:null})}function Zp(e,n){const r=Ln.draft.taskforce[e]??{model:"",effort:""};nr({draft:{...Ln.draft,taskforce:{...Ln.draft.taskforce,[e]:{...r,...n}}},error:null})}function I3(){const e=Bw();e&&nr({draft:tm(e,Ln.options),error:null})}async function j3(e){const n=Bw();return n?z3("save-all",async()=>{const r=Ln.draft;let a=null;r.displayName!==n.displayName&&(a=(await E3(n.carrierId,r.displayName)).state);const o=r.cliType!==n.cliType;return o&&(a=(await C3(n.carrierId,r.cliType)).state),(o||r.model!==n.model||(r.effort||"")!==(n.effort||""))&&(a=(await x3(n.carrierId,P3(r))).state),r.agentMode==="subagent"?(n.agentMode!=="subagent"||n.taskForceBackendCount>0)&&(a=(await n1(n.carrierId,"subagent")).state):(n.agentMode!=="cli"&&(a=(await n1(n.carrierId,"cli")).state),a=await H3(n,e,a)),{state:a??await Lw()}}):!1}function Nw(e,n){const r=U3(e,Ln.activeCarrierId),a=e.carriers.find(o=>o.carrierId===r)??null;nr({loading:!1,state:e,options:n,activeCarrierId:r,draft:a?tm(a,n):Ln.draft,error:null})}async function z3(e,n){nr({savingActionId:e,error:null});try{const r=await n();return Nw(r.state,Ln.options??{cliTypes:[],taskForceConstraints:{minBackends:2}}),nr({savingActionId:null}),!0}catch(r){return nr({savingActionId:null,error:Iw(r)}),!1}}function tm(e,n){const r=Object.fromEntries((n?.cliTypes??[]).map(a=>{const o=e.taskforce.backends.find(f=>f.cliType===a.id);return[a.id,{model:o?.model??a.defaultModel,effort:o?.effort??$3(a.id,o?.model??a.defaultModel,n)??""}]}));return{cliType:e.cliType,model:e.model,effort:e.effort??"",displayName:e.displayName,agentMode:e.agentMode,taskforce:r}}function $3(e,n,r){return r?.cliTypes.find(f=>f.id===e)?.models.find(f=>f.modelId===n)?.effort?.default??null}function P3(e){return{model:e.model,...e.effort?{effort:e.effort}:{}}}function Bw(){return Ln.state?.carriers.find(e=>e.carrierId===Ln.activeCarrierId)??null}async function H3(e,n,r){const a=new Set(n.map(o=>o.cliType));for(const o of e.taskforce.backends)a.has(o.cliType)||(r=(await A3(e.carrierId,o.cliType)).state);for(const o of n){const f=e.taskforce.backends.find(_=>_.cliType===o.cliType);f&&f.model===o.model&&(f.effort||"")===(o.effort||"")||(r=(await T3(e.carrierId,o.cliType,{model:o.model,...o.effort?{effort:o.effort}:{}})).state)}return r}function U3(e,n){return n&&e.carriers.some(r=>r.carrierId===n)?n:e.carriers[0]?.carrierId??null}function nr(e){Ln={...Ln,...e};for(const n of Xp)n()}function Iw(e){return e instanceof Error?e.message:String(e)}const F3=50,q3=2400,W3={nimitz:"var(--captain-nimitz)",kirov:"var(--captain-kirov)",genesis:"var(--captain-genesis)",ohio:"var(--captain-ohio)",sentinel:"var(--captain-sentinel)",vanguard:"var(--captain-vanguard)",tempest:"var(--captain-tempest)",chronicle:"var(--captain-chronicle)"};function G3(){const e=Ow(),n=e.state?.carriers.find(h=>h.carrierId===e.activeCarrierId)??null,r=e.options?.cliTypes.find(h=>h.id===e.draft.cliType)??null,a=r?.models.find(h=>h.modelId===e.draft.model)??null,[o,f]=H.useState(!1),[_,c]=H.useState([]),[u,d]=H.useState("idle"),S=_.length>0,g=e.draft.agentMode==="subagent",C=e.draft.agentMode==="subagent",E=e.savingActionId==="save-all",A=n?J3(n,e.draft,_):!1,x=n?.taskforce.backends.map(h=>`${h.cliType}:${h.model}:${h.effort??""}`).join("|")??"";H.useEffect(()=>{const h=new AbortController;return r1(h.signal),()=>h.abort()},[]),H.useEffect(()=>{f(!1),c(n?.taskforce.backends.map(h=>h.cliType)??[]),d("idle")},[n?.carrierId,x]),H.useEffect(()=>{if(u!=="saved")return;const h=window.setTimeout(()=>d("idle"),q3);return()=>window.clearTimeout(h)},[u]);function p(){n&&(I3(),c(n.taskforce.backends.map(h=>h.cliType)),f(!1),d("idle"))}async function v(){if(!n)return;if(d("saving"),!await j3(eL(_,e.draft.taskforce))){d("idle");return}f(!1),d("saved")}return y.jsxs("main",{className:"carrier-settings-page",children:[y.jsxs("section",{className:"carrier-settings-hero","aria-labelledby":"carrier-settings-title",children:[y.jsxs("div",{children:[y.jsx("p",{className:"bridge-kicker",children:"Carrier Control Surface"}),y.jsx("h2",{id:"carrier-settings-title",children:"Carrier Settings"})]}),y.jsxs("div",{className:"carrier-settings-hero-actions",children:[y.jsx("div",{className:`carrier-settings-save-status ${u==="saved"?"is-positive":""}`,role:"status","aria-live":"polite",children:u==="saving"||E?"Saving…":u==="saved"?"Saved ✓":""}),n?y.jsxs("div",{className:"carrier-settings-save-actions",children:[y.jsx("button",{type:"button",className:`carrier-settings-action-button ${A?"is-dirty":""}`,disabled:!A||E,onClick:()=>{v()},children:"Save"}),y.jsx("button",{type:"button",className:`carrier-settings-action-button ${A?"is-dirty":""}`,disabled:!A||E,onClick:p,children:"Discard"})]}):null,y.jsx("button",{type:"button",className:"carrier-settings-action-button carrier-settings-hero-refresh",disabled:e.loading,onClick:()=>{r1()},children:"Refresh"})]})]}),e.error?y.jsx("p",{className:"carrier-settings-error",role:"alert",children:e.error}):null,y.jsxs("section",{className:"carrier-settings-grid",children:[y.jsxs("div",{className:"carrier-settings-list","aria-label":"Carrier list",children:[e.loading&&!e.state?y.jsx("p",{className:"carrier-settings-empty",children:"Loading carrier settings."}):null,e.state&&e.state.carriers.length===0?y.jsx("p",{className:"carrier-settings-empty",children:"No carriers registered."}):null,e.state?.carriers.map(h=>y.jsx(K3,{carrier:h,active:h.carrierId===e.activeCarrierId,minBackends:e.options?.taskForceConstraints.minBackends??2,onSelect:()=>B3(h.carrierId)},h.carrierId))]}),n&&e.options&&r?y.jsxs("div",{className:"carrier-settings-detail",style:$w(n.carrierId),children:[y.jsxs("div",{className:"carrier-settings-detail-head",children:[y.jsxs("div",{className:"carrier-settings-detail-title-block",children:[y.jsxs("div",{className:"carrier-settings-captain-id",children:[y.jsx("span",{children:"Captain"})," · ",n.carrierId.toUpperCase()]}),y.jsx("div",{className:`carrier-settings-name-line ${o?"is-editing":""}`,children:o?y.jsxs(y.Fragment,{children:[y.jsx("input",{id:"carrier-display-name",className:"carrier-settings-input carrier-settings-name-input",value:e.draft.displayName,maxLength:F3,onChange:h=>Zs({displayName:h.target.value})}),y.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Save display name",disabled:E,onClick:()=>{f(!1)},children:y.jsx(nL,{})}),y.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Cancel display name edit",onClick:()=>{Zs({displayName:n.displayName}),f(!1)},children:y.jsx(iL,{})})]}):y.jsxs(y.Fragment,{children:[y.jsx("h3",{className:"carrier-settings-captain-name",children:n.displayName}),y.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Edit display name",onClick:()=>{Zs({displayName:n.displayName}),f(!0)},children:y.jsx(tL,{})})]})}),y.jsx("div",{className:"carrier-settings-captain-role",children:n.role})]}),y.jsxs("div",{className:"carrier-settings-cli-badge",children:[y.jsx("span",{className:"ind","aria-hidden":"true"}),n.cliType]})]}),y.jsxs("div",{className:"carrier-settings-body",children:[y.jsxs("div",{className:"carrier-settings-control-group",children:[y.jsx("div",{className:"carrier-settings-resp-title",children:"Identity"}),y.jsxs("div",{className:"carrier-settings-mission",children:['"',n.roleDescription,'"']})]}),y.jsxs("div",{className:"carrier-settings-control-group",children:[y.jsx("div",{className:"carrier-settings-resp-title",children:"Runtime"}),y.jsxs("div",{className:"carrier-settings-runtime",children:[y.jsx("div",{className:"carrier-settings-runtime-row carrier-settings-runtime-row--cli",children:y.jsxs("div",{className:"carrier-settings-field carrier-settings-field--wide",children:[y.jsx("label",{className:"carrier-settings-label",htmlFor:"carrier-cli",children:"CLI"}),y.jsx("select",{id:"carrier-cli",className:"carrier-settings-select",value:e.draft.cliType,onChange:h=>Y3(h.target.value,e.options?.cliTypes??[]),children:e.options.cliTypes.map(h=>y.jsx("option",{value:h.id,children:h.displayName},h.id))})]})}),y.jsxs("div",{className:"carrier-settings-runtime-row carrier-settings-runtime-row--model",children:[y.jsx(jw,{id:"carrier-model",label:"Model",models:r.models,value:e.draft.model,onChange:h=>X3(r,h)}),y.jsx(zw,{id:"carrier-effort",model:a,value:e.draft.effort,onChange:h=>Zs({effort:h})})]})]})]}),y.jsx("div",{className:"carrier-settings-control-group",children:y.jsxs("div",{className:"carrier-settings-toggle-row",children:[y.jsxs("div",{children:[y.jsx("p",{className:"carrier-settings-resp-title",children:"SubAgent"}),y.jsx("p",{className:"carrier-settings-help",children:S?"Task Force draft is present. Remove every backend to enable SubAgent.":r.supportsSubagent?"Enabling SubAgent clears Task Force backends when saved.":"This CLI does not support SubAgent mode."})]}),y.jsx("button",{type:"button",className:`carrier-settings-toggle ${g?"is-on":""}`,disabled:E||!g&&(!r.supportsSubagent||S),"aria-pressed":g,onClick:()=>Zs({agentMode:g?"cli":"subagent"}),children:y.jsx("span",{children:g?"On":"Off"})})]})}),y.jsx(V3,{carrier:n,cliOptions:e.options.cliTypes,minBackends:e.options.taskForceConstraints.minBackends,savingActionId:e.savingActionId,rows:_,disabled:C,onRowsChange:c})]})]},n.carrierId):y.jsx("div",{className:"carrier-settings-detail",children:y.jsx("p",{className:"carrier-settings-empty",children:"Select a carrier."})})]})]})}function K3({carrier:e,active:n,minBackends:r,onSelect:a}){const o=e.taskForceBackendCount>=r;return y.jsxs("button",{type:"button",className:`carrier-settings-row ${n?"is-active":""}`,style:$w(e.carrierId),onClick:a,children:[y.jsx("span",{className:"carrier-settings-captain-dot","aria-hidden":"true"}),y.jsxs("span",{className:"carrier-settings-row-text",children:[y.jsx("span",{className:"carrier-settings-row-name",children:e.displayName}),y.jsx("span",{className:"carrier-settings-row-role",children:e.role})]}),y.jsxs("span",{className:"carrier-settings-row-live","aria-hidden":"true",children:[y.jsx("span",{className:`carrier-settings-live-dot ${e.subagentMode?"is-live":""}`}),y.jsx("span",{className:`carrier-settings-live-dot ${o?"is-live":""}`})]})]})}function jw({id:e,label:n,models:r,value:a,disabled:o=!1,onChange:f}){return y.jsxs("div",{className:"carrier-settings-field",children:[y.jsx("label",{className:"carrier-settings-label",htmlFor:e,children:n}),y.jsx("select",{id:e,className:"carrier-settings-select",value:a,disabled:o,onChange:_=>f(_.target.value),children:r.map(_=>y.jsx("option",{value:_.modelId,children:_.name},_.modelId))})]})}function zw({id:e,model:n,value:r,disabled:a=!1,onChange:o}){return n?.effort?y.jsxs("div",{className:"carrier-settings-field",children:[y.jsx("label",{className:"carrier-settings-label",htmlFor:e,children:"Effort"}),y.jsx("select",{id:e,className:"carrier-settings-select",value:r||n.effort.default,disabled:a,onChange:f=>o(f.target.value),children:n.effort.levels.map(f=>y.jsx("option",{value:f,children:f},f))})]}):y.jsxs("div",{className:"carrier-settings-field",children:[y.jsx("span",{className:"carrier-settings-label",children:"Effort"}),y.jsx("p",{className:"carrier-settings-help",children:"Not supported for this model."})]})}function V3({carrier:e,cliOptions:n,minBackends:r,savingActionId:a,rows:o,disabled:f,onRowsChange:_}){const c=Ow(),u=e.taskforce.backends.length,[d,S]=H.useState(u>0),[g,C]=H.useState(!1),[E,A]=H.useState(""),x=e.taskForceBackendCount>=r,p=n.filter(h=>!o.includes(h.id)),v=E||p[0]?.id||"";return y.jsxs("div",{className:`carrier-settings-control-group carrier-settings-control-group--taskforce ${d?"is-expanded":""} ${f?"is-disabled":""}`,children:[y.jsxs("div",{className:"carrier-settings-section-head",children:[y.jsxs("div",{children:[y.jsx("p",{className:"carrier-settings-resp-title",children:"Task Force"}),y.jsx("p",{className:"carrier-settings-help",children:f?"Disabled while SubAgent is on. Turn SubAgent off before composing Task Force backends.":u>0?`${u} backend${u===1?"":"s"} configured${x?" · active":` · needs ${r}+ to activate`}.`:`Run this carrier across multiple CLI backends. Needs at least ${r} to activate.`})]}),y.jsx("div",{className:"carrier-settings-tf-head-actions",children:y.jsx("button",{type:"button",className:"carrier-settings-tf-toggle","aria-expanded":d,onClick:()=>S(h=>!h),children:d?"Hide":"Configure"})})]}),d?y.jsxs("div",{className:"carrier-settings-tf-list",children:[o.length===0?y.jsx("p",{className:"carrier-settings-tf-empty",children:"No Task Force backend drafted."}):null,o.map(h=>{const b=n.find(M=>M.id===h);if(!b)return null;const T=c.draft.taskforce[b.id]??{model:b.defaultModel,effort:""},R=b.models.find(M=>M.modelId===T.model)??b.models[0]??null,L=e.taskforce.backends.some(M=>M.cliType===b.id);return y.jsxs("div",{className:`carrier-settings-tf-item ${L?"is-active":""}`,children:[y.jsxs("div",{className:"carrier-settings-tf-title",children:[y.jsx("span",{className:`carrier-settings-live-dot ${L?"is-live":""}`,"aria-hidden":"true"}),y.jsx("strong",{children:b.displayName})]}),y.jsx(jw,{id:`tf-${b.id}-model`,label:"Model",models:b.models,value:T.model,disabled:f,onChange:M=>Z3(b,M)}),y.jsx(zw,{id:`tf-${b.id}-effort`,model:R,value:T.effort,disabled:f,onChange:M=>Zp(b.id,{effort:M})}),y.jsx("div",{className:"carrier-settings-tf-actions",children:y.jsx("button",{type:"button",className:"carrier-settings-ghost-button",disabled:f||a==="save-all",onClick:()=>_(o.filter(M=>M!==b.id)),children:"Remove"})})]},b.id)}),y.jsxs("div",{className:"carrier-settings-tf-add-row",children:[g&&p.length>0?y.jsx("select",{className:"carrier-settings-select carrier-settings-tf-add-select",value:v,onChange:h=>A(h.target.value),"aria-label":"Task Force CLI to add",children:p.map(h=>y.jsx("option",{value:h.id,children:h.displayName},h.id))}):null,y.jsx("button",{type:"button",className:"carrier-settings-ghost-button",disabled:f||p.length===0||a==="save-all",onClick:()=>{if(!g){C(!0);return}const h=v,b=n.find(R=>R.id===h),T=b?.models.find(R=>R.modelId===b.defaultModel)??b?.models[0]??null;!b||!T||(Zp(b.id,{model:T.modelId,effort:T.effort?.default??""}),_(o.includes(b.id)?o:[...o,b.id]),A(""),C(!1))},children:"Add"})]})]}):null]})}function Y3(e,n){const r=n.find(f=>f.id===e),a=r?.models.find(f=>f.modelId===r.defaultModel)??r?.models[0]??null,o={cliType:e,model:a?.modelId??"",effort:a?.effort?.default??""};r?.supportsSubagent||(o.agentMode="cli"),Zs(o)}function X3(e,n){const r=e.models.find(a=>a.modelId===n);Zs({model:n,effort:r?.effort?.default??""})}function Z3(e,n){const r=e.models.find(a=>a.modelId===n);Zp(e.id,{model:n,effort:r?.effort?.default??""})}function J3(e,n,r){return n.displayName!==e.displayName||n.cliType!==e.cliType||n.model!==e.model||(n.effort||"")!==(e.effort||"")||n.agentMode!==e.agentMode?!0:n.agentMode==="subagent"?e.taskForceBackendCount>0:Q3(e,r,n.taskforce)}function Q3(e,n,r){if(n.length!==e.taskforce.backends.length)return!0;const a=new Set(n);for(const o of e.taskforce.backends){if(!a.has(o.cliType))return!0;const f=r[o.cliType];if(!f||f.model!==o.model||(f.effort||"")!==(o.effort||""))return!0}return!1}function eL(e,n){return e.map(r=>{const a=n[r];return a?{cliType:r,model:a.model,...a.effort?{effort:a.effort}:{}}:null}).filter(r=>r!==null)}function $w(e){return{"--cap-color":W3[e]??"var(--brass)"}}function tL(){return y.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[y.jsx("path",{d:"M10.8 2.2 13.8 5.2 5.2 13.8 2 14.5 2.7 11.3 10.8 2.2Z"}),y.jsx("path",{d:"M9.7 3.4 12.6 6.3"})]})}function nL(){return y.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:y.jsx("path",{d:"M3 8.3 6.4 11.7 13.2 4.5"})})}function iL(){return y.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[y.jsx("path",{d:"M4.2 4.2 11.8 11.8"}),y.jsx("path",{d:"M11.8 4.2 4.2 11.8"})]})}function Ee(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Ye(e){return Ee(e).replace(/"/g,"&quot;")}const rL="contextual-knowledge-not-instructions";function sL(e,n,r){const a=r?.whyThisMatched??e.frontmatter.whyThisMatched,o=Uw(e,n);return`
19
+ <div class="context-actions-grid">
20
+ <button class="context-action-btn" type="button" data-action="copy-compact-context">
21
+ <span class="context-action-label">Compact context</span>
22
+ <span class="context-action-meta">${Bu(Pw(e))} tok</span>
23
+ </button>
24
+ <button class="context-action-btn" type="button" data-action="copy-provenance-context">
25
+ <span class="context-action-label">Provenance</span>
26
+ <span class="context-action-meta">${Bu(Hw(e))} tok</span>
27
+ </button>
28
+ <button class="context-action-btn" type="button" data-action="copy-related-context">
29
+ <span class="context-action-label">Context pack</span>
30
+ <span class="context-action-meta">${Bu(o)} tok</span>
31
+ </button>
32
+ ${a?`
33
+ <button class="context-action-btn context-action-btn--secondary" type="button" data-action="toggle-why-matched">
34
+ <span class="context-action-label">Why this matched</span>
35
+ </button>
36
+ <div class="context-why-matched" hidden>${Ee(a)}</div>
37
+ `:""}
38
+ </div>
39
+ `}function Pw(e){const n={id:e.frontmatter.id,title:e.frontmatter.title,status:e.frontmatter.status??null,tags:e.frontmatter.tags,updated:e.frontmatter.updated,summary:nm(e.body)};return JSON.stringify({...n,token_estimate:Bu(JSON.stringify(n))},null,2)}function Hw(e){return[`# ${e.frontmatter.title} (\`${e.frontmatter.id}\`)`,"",`- updated: ${e.frontmatter.updated}`,`- status: ${e.frontmatter.status??"unknown"}`,`- raw_source_ref: ${e.frontmatter.rawSourceRef??"(none)"}`,`- raw_source_refs: ${(e.frontmatter.rawSourceRefs??[]).join(", ")||"(none)"}`,"","## Summary",nm(e.body)].join(`
40
+ `)}function Uw(e,n){const r=new Set([...e.frontmatter.related??[]]),a=n.filter(o=>r.has(o.id)).sort((o,f)=>o.title.localeCompare(f.title));return[`<fleet-wiki-context boundary="${rL}">`,"# Fleet Wiki Context Pack","",`## Entry: ${e.frontmatter.title} (\`${e.frontmatter.id}\`)`,"",`- updated: ${e.frontmatter.updated}`,`- status: ${e.frontmatter.status??"unknown"}`,`- tags: ${e.frontmatter.tags.join(", ")||"(none)"}`,"","### Summary",nm(e.body),"","### Related Entries",...a.length>0?a.map(o=>`- [[wiki:${o.id}]] — ${o.title}`):["- (none)"],"","</fleet-wiki-context>"].join(`
41
+ `)}function Bu(e){return Math.max(1,Math.ceil(e.length/4))}function nm(e){return e.replace(/\s+/g," ").trim().slice(0,240)||"(empty)"}async function aL(){return or(ii("/health"))}async function oL(){return or(ii("/workspaces"))}async function lL(){return or(ii("/index"))}async function cL(){return qw(ii("/index-md"))}async function uL(e){return or(ii(`/entry/${encodeURIComponent(e)}`))}async function hL(e,n=[],r=!1){const a=new URLSearchParams;e&&a.set("q",e),n.length>0&&a.set("tags",n.join(",")),r&&a.set("enhanced","true");const o=a.toString();return or(ii(`/search${o?`?${o}`:""}`))}async function dL(e){return qw(ii(`/raw?ref=${encodeURIComponent(e)}`))}async function bh(e){return or(ii(`/queue?status=${encodeURIComponent(e)}`))}async function fL(e){return or(ii(`/queue/${encodeURIComponent(e)}`))}async function pL(e){return Ww(ii(`/queue/${encodeURIComponent(e)}/approve`),{})}async function gL(e,n){return Ww(ii(`/queue/${encodeURIComponent(e)}/reject`),{reason:n})}async function Fw(){return or(ii("/conflicts"))}async function mL(e){return or(ii(`/conflicts/${encodeURIComponent(e)}`))}async function _L(e){const n=typeof e=="number"?`?limit=${encodeURIComponent(String(e))}`:"";return or(ii(`/log${n}`))}function ii(e){const n=window.location.pathname.match(/^\/console\/codex\/w\/([^/]+)(?:\/|$)/),r=e.startsWith("/")?e:`/${e}`;return n?`/console/codex/w/${encodeURIComponent(decodeURIComponent(n[1]??""))}/api${r}`:`/console/codex/api${r}`}async function or(e){const n=await fetch(e,{headers:{accept:"application/json"}});if(!n.ok)throw new Error(await im(e,n));return n.json()}async function qw(e){const n=await fetch(e,{headers:{accept:"text/markdown,text/plain"}});if(!n.ok)throw new Error(await im(e,n));return n.text()}async function Ww(e,n){const r=await fetch(e,{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},body:JSON.stringify(n)});if(!r.ok)throw new Error(await im(e,r));return r.json()}async function im(e,n){return(await n.json().catch(()=>null))?.error??`${e} request failed: ${n.status}`}const vL=/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{3}Z-[0-9a-f]{8}$/,Fi="/console/codex",Jp=new Set;let ro=null;function Zl(){const e=TL(AL(Xw(window.location.pathname)).pathname);return e.name==="queue"?{name:"queue",tab:new URLSearchParams(window.location.search).get("tab")==="archived"?"archived":"pending"}:e}function Qp(){return Yw(Xw(window.location.pathname))?.wsId??null}function ra(e){e!==window.location.pathname+window.location.search&&(window.history.pushState({},"",e),sm(Zl()))}function bL(e){window.history.replaceState({},"",e),sm(Zl())}function yL(e){return Jp.add(e),()=>Jp.delete(e)}function SL(){ro||(ro=()=>sm(Zl()),window.addEventListener("popstate",ro))}function wL(){ro&&(window.removeEventListener("popstate",ro),ro=null)}function Ur(e){return rr(`/entry/${encodeURIComponent(e)}`)}function Gw(e){return rr(`/raw/${encodeURIComponent(e)}`)}function fo(e="pending"){return rr(e==="archived"?"/queue?tab=archived":"/queue")}function CL(e){return rr(`/queue/${encodeURIComponent(e)}`)}function xL(){return rr("/conflicts")}function EL(e){return rr(`/conflicts/${encodeURIComponent(e)}`)}function Kw(){return rr("/index-md")}function Vw(e){return rr(typeof e!="number"?"/log":`/log?limit=${encodeURIComponent(String(e))}`)}function rm(){return rr("/")}function s1(e){return`${Fi}/w/${encodeURIComponent(e)}/`}function TL(e){if(e==="/index"||e==="/index-md")return{name:"index-md"};if(e==="/log"){const f=new URLSearchParams(window.location.search).get("limit"),_=Number(f??20);return{name:"log",limit:Number.isInteger(_)?_:20}}if(e==="/conflicts")return{name:"conflicts"};const n=e.match(/^\/conflicts\/([^/]+)$/);if(n)return{name:"conflict-detail",id:decodeURIComponent(n[1]??"")};const r=e.match(/^\/entry\/([^/]+)$/);if(r)return{name:"entry",id:decodeURIComponent(r[1]??"")};const a=e.match(/^\/raw\/(.+)$/);if(a)return{name:"raw",ref:decodeURIComponent(a[1]??"")};if(e==="/queue")return{name:"queue",tab:"pending"};const o=e.match(/^\/queue\/([^/]+)$/);if(o){const f=decodeURIComponent(o[1]??"");return vL.test(f)?{name:"queue-detail",patchId:f}:{name:"home"}}return{name:"home"}}function rr(e){const n=Qp();return n?`${Fi}/w/${encodeURIComponent(n)}${e}`:`${Fi}${e}`}function AL(e){const n=Yw(e);return n?{pathname:n.pathname,wsId:n.wsId}:{pathname:e,wsId:null}}function Yw(e){const n=e.match(/^\/w\/([^/]+)(\/.*)?$/);return n?{wsId:decodeURIComponent(n[1]??""),pathname:n[2]??"/"}:null}function Xw(e){return e===Fi||e===`${Fi}/`?"/":e.startsWith(`${Fi}/`)?e.slice(Fi.length)||"/":e}function sm(e){for(const n of Jp)n(e)}const Zw="fleet-wiki-web-recent",eg=new Set,sa={health:null,index:[],currentEntry:null,currentMatchHint:null,conflicts:[],currentConflict:null,indexMarkdown:null,log:null,loading:!1,error:null,recentIds:IL(),pendingPatchCount:0,currentWorkspaceId:null,workspaces:[]};function Iu(){return sa}function kL(e){return eg.add(e),()=>eg.delete(e)}async function RL(){Qt({loading:!0,error:null});try{const[e,n,r,a]=await Promise.all([aL(),lL(),bh("pending").catch(()=>null),oL().catch(()=>null)]);Qt({health:e,index:n,pendingPatchCount:r?.pendingCount??0,currentWorkspaceId:a?.currentWorkspaceId??null,workspaces:a?.workspaces??[],loading:!1})}catch(e){Qt({loading:!1,error:bo(e)})}}async function LL(e){Qt({loading:!0,error:null,currentEntry:null,currentMatchHint:sa.currentMatchHint?.id===e?sa.currentMatchHint:null,currentConflict:null,indexMarkdown:null,log:null});try{const n=await uL(e),r=BL(e);Qt({currentEntry:n,currentConflict:null,indexMarkdown:null,log:null,recentIds:r,loading:!1})}catch(n){Qt({loading:!1,error:bo(n)})}}async function ML(){Qt({loading:!0,error:null,currentEntry:null,currentConflict:null,log:null});try{Qt({indexMarkdown:await cL(),loading:!1})}catch(e){Qt({loading:!1,error:bo(e)})}}async function DL(e){Qt({loading:!0,error:null,currentEntry:null,currentConflict:null,indexMarkdown:null});try{Qt({log:await _L(e),loading:!1})}catch(n){Qt({loading:!1,error:bo(n)})}}async function OL(){Qt({loading:!0,error:null,currentEntry:null,currentConflict:null,indexMarkdown:null,log:null});try{Qt({conflicts:await Fw(),loading:!1})}catch(e){Qt({loading:!1,error:bo(e)})}}async function NL(e){Qt({loading:!0,error:null,currentEntry:null,indexMarkdown:null,log:null});try{const[n,r]=await Promise.all([mL(e),Fw().catch(()=>sa.conflicts)]);Qt({currentConflict:n,conflicts:r,loading:!1})}catch(n){Qt({loading:!1,error:bo(n)})}}function Gf(){Qt({currentEntry:null,currentMatchHint:null,currentConflict:null,indexMarkdown:null,log:null,error:null,loading:!1})}function Jw(e){Qt({currentMatchHint:e})}function am(e){Qt({pendingPatchCount:e})}function Qt(e){Object.assign(sa,e);for(const n of eg)n(sa)}function BL(e){const n=[e,...sa.recentIds.filter(r=>r!==e)].slice(0,8);return window.localStorage.setItem(Zw,JSON.stringify(n)),n}function IL(){try{const e=window.localStorage.getItem(Zw),n=e?JSON.parse(e):[];return Array.isArray(n)?n.filter(r=>typeof r=="string").slice(0,8):[]}catch{return[]}}function bo(e){return e instanceof Error?e.message:String(e)}const ke={open:!1,query:"",selectedIndex:0,results:[],debounceId:null,searchSeq:0,previousBodyOverflow:null,previousActiveElement:null};let tg=[],om=[];function jL(e,n){tg=e,om=n,ke.open&&!ke.query&&(ke.results=lm(),ke.selectedIndex=0,Ju())}function Qw(){if(ke.open){o1();return}ke.open=!0,ke.query="",ke.selectedIndex=0,ke.results=lm(),ke.previousActiveElement=document.activeElement instanceof HTMLElement?document.activeElement:null,VL(),FL(),Ju(),o1()}function so(){ke.open&&(ke.open=!1,ke.searchSeq++,ke.debounceId!==null&&(window.clearTimeout(ke.debounceId),ke.debounceId=null),qL(),YL(),XL())}function zL(){document.addEventListener("keydown",eC),document.addEventListener("input",tC),document.addEventListener("click",nC),document.addEventListener("mouseover",iC)}function $L(){ke.open&&so(),document.removeEventListener("keydown",eC),document.removeEventListener("input",tC),document.removeEventListener("click",nC),document.removeEventListener("mouseover",iC)}function PL(){return ke.open}function eC(e){if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==="k"){e.preventDefault(),ke.open?so():Qw();return}if(ke.open){if(e.key==="Tab"){ZL(e);return}if(e.key==="Escape"){e.preventDefault(),so();return}if(e.key==="ArrowDown"){e.preventDefault(),ke.selectedIndex=Math.min(ke.selectedIndex+1,Math.max(0,ke.results.length-1)),ng({scroll:!0});return}if(e.key==="ArrowUp"){e.preventDefault(),ke.selectedIndex=Math.max(0,ke.selectedIndex-1),ng({scroll:!0});return}if(e.key==="Enter"){e.preventDefault();const r=ke.results[ke.selectedIndex];if(!r)return;Jw(r),ra(Ur(r.id)),so()}}}function tC(e){const n=e.target;!(n instanceof HTMLInputElement)||n.id!=="command-input"||(ke.query=n.value.trim(),ke.selectedIndex=0,ke.debounceId!==null&&window.clearTimeout(ke.debounceId),ke.debounceId=window.setTimeout(()=>{HL(ke.query)},150))}function nC(e){const n=e.target;if(!(n instanceof Element))return;if(n.matches("[data-action='open-command']")||n.closest("[data-action='open-command']")){Qw();return}if(!ke.open)return;if(n.classList.contains("command-overlay")){so();return}const r=n.closest("[data-command-entry-id]");if(r){const a=ke.results.find(o=>o.id===(r.dataset.commandEntryId??""));Jw(a??null),ra(Ur(r.dataset.commandEntryId??"")),so()}}function iC(e){if(!ke.open)return;const n=e.target;if(!(n instanceof Element))return;const r=n.closest("[data-command-index]");if(!r)return;const a=Number(r.dataset.commandIndex);!Number.isInteger(a)||a<0||a>=ke.results.length||(ke.selectedIndex=a,ng({scroll:!1}))}async function HL(e){const n=++ke.searchSeq;if(!e){ke.results=lm(),ke.selectedIndex=0,Ju();return}let r;try{r=await hL(e)}catch{r=[]}n!==ke.searchSeq||!ke.open||(ke.results=r,ke.selectedIndex=0,Ju())}function UL(){let e=document.querySelector("#command-palette-root");return e||(e=document.createElement("div"),e.id="command-palette-root",document.body.append(e)),e}function FL(){const e=UL();e.querySelector(".command-overlay")||(e.innerHTML=WL())}function qL(){const e=document.querySelector("#command-palette-root");e&&(e.innerHTML="")}function Ju(){const e=document.querySelector("#command-results-list");if(e){if(ke.results.length===0){e.innerHTML=`<p class="empty-state">${Ee("No results found.")}</p>`;return}e.innerHTML=ke.query?ke.results.map(rC).join(""):GL()}}function ng(e={scroll:!0}){const n=document.querySelectorAll(".command-result");n.forEach((a,o)=>{a.classList.toggle("active",o===ke.selectedIndex)});const r=n[ke.selectedIndex];e.scroll&&r?.scrollIntoView({block:"nearest"})}function WL(){const e=Ye("Command palette"),n=Ye("Search titles · tags · content");return`
42
+ <div class="command-overlay">
43
+ <section class="command-card" role="dialog" aria-modal="true" aria-label="${e}" tabindex="-1">
44
+ <div class="command-search">
45
+ <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
46
+ <circle cx="11" cy="11" r="6.5" />
47
+ <path d="m20 20-3.5-3.5" />
48
+ </svg>
49
+ <input id="command-input" type="search" autocomplete="off" spellcheck="false" placeholder="${n}" />
50
+ <kbd>esc</kbd>
51
+ </div>
52
+ <div class="command-results" id="command-results-list"></div>
53
+ </section>
54
+ </div>
55
+ `}function rC(e,n){const r=n===ke.selectedIndex?" active":"",a=Ye(e.title),o=e.tags.slice(0,2),f=e.tags.length-o.length,_=tM(e),c=o.map(d=>`<span class="chip chip-tag">${Ee(d)}</span>`).join(""),u=f>0?`<span class="chip chip-muted">+${f}</span>`:"";return`
56
+ <button class="command-result${r}" type="button" data-command-entry-id="${Ye(e.id)}" data-command-index="${n}" title="${a}">
57
+ <span class="command-result-text">
58
+ <strong>${QL(e.title,ke.query)}</strong>
59
+ <small>${Ee(eM(e))}</small>
60
+ ${_?`<small class="command-result-excerpt">${Ee(_)}</small>`:""}
61
+ </span>
62
+ <span class="command-result-aside">${c}${u}</span>
63
+ </button>
64
+ `}function GL(){const e=KL(),n=ke.results.slice(0,e),r=ke.results.slice(e);return[n.length>0?a1("Recent",n,0):"",r.length>0?a1("All",r,e):""].join("")}function a1(e,n,r){return`
65
+ <div class="command-section-heading">${Ee(e)}</div>
66
+ ${n.map((a,o)=>rC(a,r+o)).join("")}
67
+ `}function lm(){const e=new Set(om),n=sC().map(a=>tg.find(o=>o.id===a)).filter(a=>!!a),r=tg.filter(a=>!e.has(a.id));return[...n,...r].slice(0,12).map((a,o)=>({id:a.id,title:a.title,score:Math.max(1,100-o),reason:"title",excerpt:"",path:a.path,tags:a.tags,updated:a.updated}))}function KL(){return sC().filter((e,n)=>ke.results[n]?.id===e).length}function sC(){return Array.from(new Set(om))}function VL(){ke.previousBodyOverflow===null&&(ke.previousBodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden")}function YL(){ke.previousBodyOverflow!==null&&(document.body.style.overflow=ke.previousBodyOverflow,ke.previousBodyOverflow=null)}function XL(){const e=ke.previousActiveElement;ke.previousActiveElement=null,e?.isConnected&&e.focus()}function o1(){window.setTimeout(()=>{const e=document.querySelector("#command-input");e&&(e.focus(),e.select())},0)}function ZL(e){const n=document.querySelector(".command-card");if(!n)return;const r=JL(n);if(r.length===0){e.preventDefault(),n.focus();return}const a=document.activeElement,o=a instanceof HTMLElement?r.indexOf(a):-1,f=e.shiftKey?o<=0?r.length-1:o-1:o===-1||o===r.length-1?0:o+1;(o===-1||e.shiftKey&&o===0||!e.shiftKey&&o===r.length-1)&&(e.preventDefault(),r[f]?.focus())}function JL(e){const n=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");return Array.from(e.querySelectorAll(n)).filter(r=>!r.hasAttribute("hidden")&&r.offsetParent!==null)}function QL(e,n){if(!n)return Ee(e);const r=e.toLocaleLowerCase(),a=n.toLocaleLowerCase();if(!a)return Ee(e);let o=0,f="";for(;o<e.length;){const _=r.indexOf(a,o);if(_===-1)break;f+=Ee(e.slice(o,_)),f+=`<mark class="command-highlight">${Ee(e.slice(_,_+n.length))}</mark>`,o=_+n.length}return f+Ee(e.slice(o))}function eM(e){switch(e.reason){case"id":return"id match";case"alias":return"alias match";case"tag":return"tag match";case"title":return"title match";case"body":return"body match";default:return"match"}}function tM(e){const n=e.matchedSnippets?.find(a=>a.field==="body")?.snippet;if(e.reason!=="body")return"";const r=n??e.excerpt;return nM(r??"")}function nM(e){return rM(iM(e)).replace(/\s+/g," ").trim().slice(0,180)}function iM(e){return e.replace(/<<<[^>]*>>>/g," ")}function rM(e){return e.replace(/!\[[^\]]*]\([^)]*\)/g," ").replace(/\[\[wiki:([^\]\|]+)(?:\|[^\]]*)?]]/g,"$1").replace(/\[([^\]]+)]\([^)]*\)/g,"$1").replace(/^#{1,6}\s+/gm,"").replace(/^\s*(?:[-*]\s+|\d+\.\s+)/gm,"").replace(/^\s*>\s?/gm,"").replace(/`+/g,"").replace(/\*\*([^*]+)\*\*/g,"$1").replace(/__([^_]+)__/g,"$1").replace(/\*([^*\n]+)\*/g,"$1").replace(/_([^_\n]+)_/g,"$1")}function cm(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var la=cm();function aC(e){la=e}var Il={exec:()=>null};function ut(e,n=""){let r=typeof e=="string"?e:e.source,a={replace:(o,f)=>{let _=typeof f=="string"?f:f.source;return _=_.replace(Pn.caret,"$1"),r=r.replace(o,_),a},getRegex:()=>new RegExp(r,n)};return a}var sM=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Pn={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},aM=/^(?:[ \t]*(?:\n|$))+/,oM=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,lM=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Jl=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,cM=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,um=/(?:[*+-]|\d{1,9}[.)])/,oC=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,lC=ut(oC).replace(/bull/g,um).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),uM=ut(oC).replace(/bull/g,um).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),hm=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,hM=/^[^\n]+/,dm=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,dM=ut(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",dm).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),fM=ut(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,um).getRegex(),yh="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",fm=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,pM=ut("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",fm).replace("tag",yh).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),cC=ut(hm).replace("hr",Jl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",yh).getRegex(),gM=ut(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",cC).getRegex(),pm={blockquote:gM,code:oM,def:dM,fences:lM,heading:cM,hr:Jl,html:pM,lheading:lC,list:fM,newline:aM,paragraph:cC,table:Il,text:hM},l1=ut("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Jl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",yh).getRegex(),mM={...pm,lheading:uM,table:l1,paragraph:ut(hm).replace("hr",Jl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",l1).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",yh).getRegex()},_M={...pm,html:ut(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",fm).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Il,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ut(hm).replace("hr",Jl).replace("heading",` *#{1,6} *[^
68
+ ]`).replace("lheading",lC).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},vM=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,bM=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,uC=/^( {2,}|\\)\n(?!\s*$)/,yM=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Sh=/[\p{P}\p{S}]/u,gm=/[\s\p{P}\p{S}]/u,hC=/[^\s\p{P}\p{S}]/u,SM=ut(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,gm).getRegex(),dC=/(?!~)[\p{P}\p{S}]/u,wM=/(?!~)[\s\p{P}\p{S}]/u,CM=/(?:[^\s\p{P}\p{S}]|~)/u,xM=ut(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",sM?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),fC=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,EM=ut(fC,"u").replace(/punct/g,Sh).getRegex(),TM=ut(fC,"u").replace(/punct/g,dC).getRegex(),pC="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",AM=ut(pC,"gu").replace(/notPunctSpace/g,hC).replace(/punctSpace/g,gm).replace(/punct/g,Sh).getRegex(),kM=ut(pC,"gu").replace(/notPunctSpace/g,CM).replace(/punctSpace/g,wM).replace(/punct/g,dC).getRegex(),RM=ut("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,hC).replace(/punctSpace/g,gm).replace(/punct/g,Sh).getRegex(),LM=ut(/\\(punct)/,"gu").replace(/punct/g,Sh).getRegex(),MM=ut(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),DM=ut(fm).replace("(?:-->|$)","-->").getRegex(),OM=ut("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",DM).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Qu=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,NM=ut(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Qu).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),gC=ut(/^!?\[(label)\]\[(ref)\]/).replace("label",Qu).replace("ref",dm).getRegex(),mC=ut(/^!?\[(ref)\](?:\[\])?/).replace("ref",dm).getRegex(),BM=ut("reflink|nolink(?!\\()","g").replace("reflink",gC).replace("nolink",mC).getRegex(),c1=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,mm={_backpedal:Il,anyPunctuation:LM,autolink:MM,blockSkip:xM,br:uC,code:bM,del:Il,emStrongLDelim:EM,emStrongRDelimAst:AM,emStrongRDelimUnd:RM,escape:vM,link:NM,nolink:mC,punctuation:SM,reflink:gC,reflinkSearch:BM,tag:OM,text:yM,url:Il},IM={...mm,link:ut(/^!?\[(label)\]\((.*?)\)/).replace("label",Qu).getRegex(),reflink:ut(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Qu).getRegex()},ig={...mm,emStrongRDelimAst:kM,emStrongLDelim:TM,url:ut(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",c1).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ut(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",c1).getRegex()},jM={...ig,br:ut(uC).replace("{2,}","*").getRegex(),text:ut(ig.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},mu={normal:pm,gfm:mM,pedantic:_M},vl={normal:mm,gfm:ig,breaks:jM,pedantic:IM},zM={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},u1=e=>zM[e];function tr(e,n){if(n){if(Pn.escapeTest.test(e))return e.replace(Pn.escapeReplace,u1)}else if(Pn.escapeTestNoEncode.test(e))return e.replace(Pn.escapeReplaceNoEncode,u1);return e}function h1(e){try{e=encodeURI(e).replace(Pn.percentDecode,"%")}catch{return null}return e}function d1(e,n){let r=e.replace(Pn.findPipe,(f,_,c)=>{let u=!1,d=_;for(;--d>=0&&c[d]==="\\";)u=!u;return u?"|":" |"}),a=r.split(Pn.splitPipe),o=0;if(a[0].trim()||a.shift(),a.length>0&&!a.at(-1)?.trim()&&a.pop(),n)if(a.length>n)a.splice(n);else for(;a.length<n;)a.push("");for(;o<a.length;o++)a[o]=a[o].trim().replace(Pn.slashPipe,"|");return a}function bl(e,n,r){let a=e.length;if(a===0)return"";let o=0;for(;o<a&&e.charAt(a-o-1)===n;)o++;return e.slice(0,a-o)}function $M(e,n){if(e.indexOf(n[1])===-1)return-1;let r=0;for(let a=0;a<e.length;a++)if(e[a]==="\\")a++;else if(e[a]===n[0])r++;else if(e[a]===n[1]&&(r--,r<0))return a;return r>0?-2:-1}function f1(e,n,r,a,o){let f=n.href,_=n.title||null,c=e[1].replace(o.other.outputLinkReplace,"$1");a.state.inLink=!0;let u={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:f,title:_,text:c,tokens:a.inlineTokens(c)};return a.state.inLink=!1,u}function PM(e,n,r){let a=e.match(r.other.indentCodeCompensation);if(a===null)return n;let o=a[1];return n.split(`
69
+ `).map(f=>{let _=f.match(r.other.beginningSpace);if(_===null)return f;let[c]=_;return c.length>=o.length?f.slice(o.length):f}).join(`
70
+ `)}var eh=class{options;rules;lexer;constructor(e){this.options=e||la}space(e){let n=this.rules.block.newline.exec(e);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(e){let n=this.rules.block.code.exec(e);if(n){let r=n[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:bl(r,`
71
+ `)}}}fences(e){let n=this.rules.block.fences.exec(e);if(n){let r=n[0],a=PM(r,n[3]||"",this.rules);return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:a}}}heading(e){let n=this.rules.block.heading.exec(e);if(n){let r=n[2].trim();if(this.rules.other.endingHash.test(r)){let a=bl(r,"#");(this.options.pedantic||!a||this.rules.other.endingSpaceChar.test(a))&&(r=a.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let n=this.rules.block.hr.exec(e);if(n)return{type:"hr",raw:bl(n[0],`
72
+ `)}}blockquote(e){let n=this.rules.block.blockquote.exec(e);if(n){let r=bl(n[0],`
73
+ `).split(`
74
+ `),a="",o="",f=[];for(;r.length>0;){let _=!1,c=[],u;for(u=0;u<r.length;u++)if(this.rules.other.blockquoteStart.test(r[u]))c.push(r[u]),_=!0;else if(!_)c.push(r[u]);else break;r=r.slice(u);let d=c.join(`
75
+ `),S=d.replace(this.rules.other.blockquoteSetextReplace,`
76
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");a=a?`${a}
77
+ ${d}`:d,o=o?`${o}
78
+ ${S}`:S;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(S,f,!0),this.lexer.state.top=g,r.length===0)break;let C=f.at(-1);if(C?.type==="code")break;if(C?.type==="blockquote"){let E=C,A=E.raw+`
79
+ `+r.join(`
80
+ `),x=this.blockquote(A);f[f.length-1]=x,a=a.substring(0,a.length-E.raw.length)+x.raw,o=o.substring(0,o.length-E.text.length)+x.text;break}else if(C?.type==="list"){let E=C,A=E.raw+`
81
+ `+r.join(`
82
+ `),x=this.list(A);f[f.length-1]=x,a=a.substring(0,a.length-C.raw.length)+x.raw,o=o.substring(0,o.length-E.raw.length)+x.raw,r=A.substring(f.at(-1).raw.length).split(`
83
+ `);continue}}return{type:"blockquote",raw:a,tokens:f,text:o}}}list(e){let n=this.rules.block.list.exec(e);if(n){let r=n[1].trim(),a=r.length>1,o={type:"list",raw:"",ordered:a,start:a?+r.slice(0,-1):"",loose:!1,items:[]};r=a?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=a?r:"[*+-]");let f=this.rules.other.listItemRegex(r),_=!1;for(;e;){let u=!1,d="",S="";if(!(n=f.exec(e))||this.rules.block.hr.test(e))break;d=n[0],e=e.substring(d.length);let g=n[2].split(`
84
+ `,1)[0].replace(this.rules.other.listReplaceTabs,v=>" ".repeat(3*v.length)),C=e.split(`
85
+ `,1)[0],E=!g.trim(),A=0;if(this.options.pedantic?(A=2,S=g.trimStart()):E?A=n[1].length+1:(A=n[2].search(this.rules.other.nonSpaceChar),A=A>4?1:A,S=g.slice(A),A+=n[1].length),E&&this.rules.other.blankLine.test(C)&&(d+=C+`
86
+ `,e=e.substring(C.length+1),u=!0),!u){let v=this.rules.other.nextBulletRegex(A),h=this.rules.other.hrRegex(A),b=this.rules.other.fencesBeginRegex(A),T=this.rules.other.headingBeginRegex(A),R=this.rules.other.htmlBeginRegex(A);for(;e;){let L=e.split(`
87
+ `,1)[0],M;if(C=L,this.options.pedantic?(C=C.replace(this.rules.other.listReplaceNesting," "),M=C):M=C.replace(this.rules.other.tabCharGlobal," "),b.test(C)||T.test(C)||R.test(C)||v.test(C)||h.test(C))break;if(M.search(this.rules.other.nonSpaceChar)>=A||!C.trim())S+=`
88
+ `+M.slice(A);else{if(E||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||b.test(g)||T.test(g)||h.test(g))break;S+=`
89
+ `+C}!E&&!C.trim()&&(E=!0),d+=L+`
90
+ `,e=e.substring(L.length+1),g=M.slice(A)}}o.loose||(_?o.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(_=!0));let x=null,p;this.options.gfm&&(x=this.rules.other.listIsTask.exec(S),x&&(p=x[0]!=="[ ] ",S=S.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:d,task:!!x,checked:p,loose:!1,text:S,tokens:[]}),o.raw+=d}let c=o.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let u=0;u<o.items.length;u++)if(this.lexer.state.top=!1,o.items[u].tokens=this.lexer.blockTokens(o.items[u].text,[]),!o.loose){let d=o.items[u].tokens.filter(g=>g.type==="space"),S=d.length>0&&d.some(g=>this.rules.other.anyLine.test(g.raw));o.loose=S}if(o.loose)for(let u=0;u<o.items.length;u++)o.items[u].loose=!0;return o}}html(e){let n=this.rules.block.html.exec(e);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(e){let n=this.rules.block.def.exec(e);if(n){let r=n[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),a=n[2]?n[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:a,title:o}}}table(e){let n=this.rules.block.table.exec(e);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;let r=d1(n[1]),a=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=n[3]?.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(`
91
+ `):[],f={type:"table",raw:n[0],header:[],align:[],rows:[]};if(r.length===a.length){for(let _ of a)this.rules.other.tableAlignRight.test(_)?f.align.push("right"):this.rules.other.tableAlignCenter.test(_)?f.align.push("center"):this.rules.other.tableAlignLeft.test(_)?f.align.push("left"):f.align.push(null);for(let _=0;_<r.length;_++)f.header.push({text:r[_],tokens:this.lexer.inline(r[_]),header:!0,align:f.align[_]});for(let _ of o)f.rows.push(d1(_,f.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:f.align[u]})));return f}}lheading(e){let n=this.rules.block.lheading.exec(e);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(e){let n=this.rules.block.paragraph.exec(e);if(n){let r=n[1].charAt(n[1].length-1)===`
92
+ `?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let n=this.rules.block.text.exec(e);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(e){let n=this.rules.inline.escape.exec(e);if(n)return{type:"escape",raw:n[0],text:n[1]}}tag(e){let n=this.rules.inline.tag.exec(e);if(n)return!this.lexer.state.inLink&&this.rules.other.startATag.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(e){let n=this.rules.inline.link.exec(e);if(n){let r=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let f=bl(r.slice(0,-1),"\\");if((r.length-f.length)%2===0)return}else{let f=$M(n[2],"()");if(f===-2)return;if(f>-1){let _=(n[0].indexOf("!")===0?5:4)+n[1].length+f;n[2]=n[2].substring(0,f),n[0]=n[0].substring(0,_).trim(),n[3]=""}}let a=n[2],o="";if(this.options.pedantic){let f=this.rules.other.pedanticHrefTitle.exec(a);f&&(a=f[1],o=f[3])}else o=n[3]?n[3].slice(1,-1):"";return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?a=a.slice(1):a=a.slice(1,-1)),f1(n,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(e,n){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let a=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=n[a.toLowerCase()];if(!o){let f=r[0].charAt(0);return{type:"text",raw:f,text:f}}return f1(r,o,r[0],this.lexer,this.rules)}}emStrong(e,n,r=""){let a=this.rules.inline.emStrongLDelim.exec(e);if(!(!a||a[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(a[1]||a[2])||!r||this.rules.inline.punctuation.exec(r))){let o=[...a[0]].length-1,f,_,c=o,u=0,d=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,n=n.slice(-1*e.length+o);(a=d.exec(n))!=null;){if(f=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!f)continue;if(_=[...f].length,a[3]||a[4]){c+=_;continue}else if((a[5]||a[6])&&o%3&&!((o+_)%3)){u+=_;continue}if(c-=_,c>0)continue;_=Math.min(_,_+c+u);let S=[...a[0]][0].length,g=e.slice(0,o+a.index+S+_);if(Math.min(o,_)%2){let E=g.slice(1,-1);return{type:"em",raw:g,text:E,tokens:this.lexer.inlineTokens(E)}}let C=g.slice(2,-2);return{type:"strong",raw:g,text:C,tokens:this.lexer.inlineTokens(C)}}}}codespan(e){let n=this.rules.inline.code.exec(e);if(n){let r=n[2].replace(this.rules.other.newLineCharGlobal," "),a=this.rules.other.nonSpaceChar.test(r),o=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return a&&o&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:n[0],text:r}}}br(e){let n=this.rules.inline.br.exec(e);if(n)return{type:"br",raw:n[0]}}del(e){let n=this.rules.inline.del.exec(e);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(e){let n=this.rules.inline.autolink.exec(e);if(n){let r,a;return n[2]==="@"?(r=n[1],a="mailto:"+r):(r=n[1],a=r),{type:"link",raw:n[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let n;if(n=this.rules.inline.url.exec(e)){let r,a;if(n[2]==="@")r=n[0],a="mailto:"+r;else{let o;do o=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])?.[0]??"";while(o!==n[0]);r=n[0],n[1]==="www."?a="http://"+n[0]:a=n[0]}return{type:"link",raw:n[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let n=this.rules.inline.text.exec(e);if(n){let r=this.lexer.state.inRawBlock;return{type:"text",raw:n[0],text:n[0],escaped:r}}}},Hi=class rg{tokens;options;state;tokenizer;inlineQueue;constructor(n){this.tokens=[],this.tokens.links=Object.create(null),this.options=n||la,this.options.tokenizer=this.options.tokenizer||new eh,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:Pn,block:mu.normal,inline:vl.normal};this.options.pedantic?(r.block=mu.pedantic,r.inline=vl.pedantic):this.options.gfm&&(r.block=mu.gfm,this.options.breaks?r.inline=vl.breaks:r.inline=vl.gfm),this.tokenizer.rules=r}static get rules(){return{block:mu,inline:vl}}static lex(n,r){return new rg(r).lex(n)}static lexInline(n,r){return new rg(r).inlineTokens(n)}lex(n){n=n.replace(Pn.carriageReturn,`
93
+ `),this.blockTokens(n,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let a=this.inlineQueue[r];this.inlineTokens(a.src,a.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(n,r=[],a=!1){for(this.options.pedantic&&(n=n.replace(Pn.tabCharGlobal," ").replace(Pn.spaceLine,""));n;){let o;if(this.options.extensions?.block?.some(_=>(o=_.call({lexer:this},n,r))?(n=n.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(n)){n=n.substring(o.raw.length);let _=r.at(-1);o.raw.length===1&&_!==void 0?_.raw+=`
94
+ `:r.push(o);continue}if(o=this.tokenizer.code(n)){n=n.substring(o.raw.length);let _=r.at(-1);_?.type==="paragraph"||_?.type==="text"?(_.raw+=(_.raw.endsWith(`
95
+ `)?"":`
96
+ `)+o.raw,_.text+=`
97
+ `+o.text,this.inlineQueue.at(-1).src=_.text):r.push(o);continue}if(o=this.tokenizer.fences(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.heading(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.hr(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.blockquote(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.list(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.html(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.def(n)){n=n.substring(o.raw.length);let _=r.at(-1);_?.type==="paragraph"||_?.type==="text"?(_.raw+=(_.raw.endsWith(`
98
+ `)?"":`
99
+ `)+o.raw,_.text+=`
100
+ `+o.raw,this.inlineQueue.at(-1).src=_.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},r.push(o));continue}if(o=this.tokenizer.table(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.lheading(n)){n=n.substring(o.raw.length),r.push(o);continue}let f=n;if(this.options.extensions?.startBlock){let _=1/0,c=n.slice(1),u;this.options.extensions.startBlock.forEach(d=>{u=d.call({lexer:this},c),typeof u=="number"&&u>=0&&(_=Math.min(_,u))}),_<1/0&&_>=0&&(f=n.substring(0,_+1))}if(this.state.top&&(o=this.tokenizer.paragraph(f))){let _=r.at(-1);a&&_?.type==="paragraph"?(_.raw+=(_.raw.endsWith(`
101
+ `)?"":`
102
+ `)+o.raw,_.text+=`
103
+ `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=_.text):r.push(o),a=f.length!==n.length,n=n.substring(o.raw.length);continue}if(o=this.tokenizer.text(n)){n=n.substring(o.raw.length);let _=r.at(-1);_?.type==="text"?(_.raw+=(_.raw.endsWith(`
104
+ `)?"":`
105
+ `)+o.raw,_.text+=`
106
+ `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=_.text):r.push(o);continue}if(n){let _="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(_);break}else throw new Error(_)}}return this.state.top=!0,r}inline(n,r=[]){return this.inlineQueue.push({src:n,tokens:r}),r}inlineTokens(n,r=[]){let a=n,o=null;if(this.tokens.links){let u=Object.keys(this.tokens.links);if(u.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)u.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,o.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let f;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)f=o[2]?o[2].length:0,a=a.slice(0,o.index+f)+"["+"a".repeat(o[0].length-f-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);a=this.options.hooks?.emStrongMask?.call({lexer:this},a)??a;let _=!1,c="";for(;n;){_||(c=""),_=!1;let u;if(this.options.extensions?.inline?.some(S=>(u=S.call({lexer:this},n,r))?(n=n.substring(u.raw.length),r.push(u),!0):!1))continue;if(u=this.tokenizer.escape(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.tag(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.link(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.reflink(n,this.tokens.links)){n=n.substring(u.raw.length);let S=r.at(-1);u.type==="text"&&S?.type==="text"?(S.raw+=u.raw,S.text+=u.text):r.push(u);continue}if(u=this.tokenizer.emStrong(n,a,c)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.codespan(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.br(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.del(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.autolink(n)){n=n.substring(u.raw.length),r.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(n))){n=n.substring(u.raw.length),r.push(u);continue}let d=n;if(this.options.extensions?.startInline){let S=1/0,g=n.slice(1),C;this.options.extensions.startInline.forEach(E=>{C=E.call({lexer:this},g),typeof C=="number"&&C>=0&&(S=Math.min(S,C))}),S<1/0&&S>=0&&(d=n.substring(0,S+1))}if(u=this.tokenizer.inlineText(d)){n=n.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(c=u.raw.slice(-1)),_=!0;let S=r.at(-1);S?.type==="text"?(S.raw+=u.raw,S.text+=u.text):r.push(u);continue}if(n){let S="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(S);break}else throw new Error(S)}}return r}},th=class{options;parser;constructor(e){this.options=e||la}space(e){return""}code({text:e,lang:n,escaped:r}){let a=(n||"").match(Pn.notSpaceStart)?.[0],o=e.replace(Pn.endingNewline,"")+`
107
+ `;return a?'<pre><code class="language-'+tr(a)+'">'+(r?o:tr(o,!0))+`</code></pre>
108
+ `:"<pre><code>"+(r?o:tr(o,!0))+`</code></pre>
109
+ `}blockquote({tokens:e}){return`<blockquote>
110
+ ${this.parser.parse(e)}</blockquote>
111
+ `}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:n}){return`<h${n}>${this.parser.parseInline(e)}</h${n}>
112
+ `}hr(e){return`<hr>
113
+ `}list(e){let n=e.ordered,r=e.start,a="";for(let _=0;_<e.items.length;_++){let c=e.items[_];a+=this.listitem(c)}let o=n?"ol":"ul",f=n&&r!==1?' start="'+r+'"':"";return"<"+o+f+`>
114
+ `+a+"</"+o+`>
115
+ `}listitem(e){let n="";if(e.task){let r=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+tr(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):n+=r+" "}return n+=this.parser.parse(e.tokens,!!e.loose),`<li>${n}</li>
116
+ `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
117
+ `}table(e){let n="",r="";for(let o=0;o<e.header.length;o++)r+=this.tablecell(e.header[o]);n+=this.tablerow({text:r});let a="";for(let o=0;o<e.rows.length;o++){let f=e.rows[o];r="";for(let _=0;_<f.length;_++)r+=this.tablecell(f[_]);a+=this.tablerow({text:r})}return a&&(a=`<tbody>${a}</tbody>`),`<table>
118
+ <thead>
119
+ `+n+`</thead>
120
+ `+a+`</table>
121
+ `}tablerow({text:e}){return`<tr>
122
+ ${e}</tr>
123
+ `}tablecell(e){let n=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+n+`</${r}>
124
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${tr(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:n,tokens:r}){let a=this.parser.parseInline(r),o=h1(e);if(o===null)return a;e=o;let f='<a href="'+e+'"';return n&&(f+=' title="'+tr(n)+'"'),f+=">"+a+"</a>",f}image({href:e,title:n,text:r,tokens:a}){a&&(r=this.parser.parseInline(a,this.parser.textRenderer));let o=h1(e);if(o===null)return tr(r);e=o;let f=`<img src="${e}" alt="${r}"`;return n&&(f+=` title="${tr(n)}"`),f+=">",f}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:tr(e.text)}},_m=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Ui=class sg{options;renderer;textRenderer;constructor(n){this.options=n||la,this.options.renderer=this.options.renderer||new th,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new _m}static parse(n,r){return new sg(r).parse(n)}static parseInline(n,r){return new sg(r).parseInline(n)}parse(n,r=!0){let a="";for(let o=0;o<n.length;o++){let f=n[o];if(this.options.extensions?.renderers?.[f.type]){let c=f,u=this.options.extensions.renderers[c.type].call({parser:this},c);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){a+=u||"";continue}}let _=f;switch(_.type){case"space":{a+=this.renderer.space(_);continue}case"hr":{a+=this.renderer.hr(_);continue}case"heading":{a+=this.renderer.heading(_);continue}case"code":{a+=this.renderer.code(_);continue}case"table":{a+=this.renderer.table(_);continue}case"blockquote":{a+=this.renderer.blockquote(_);continue}case"list":{a+=this.renderer.list(_);continue}case"html":{a+=this.renderer.html(_);continue}case"def":{a+=this.renderer.def(_);continue}case"paragraph":{a+=this.renderer.paragraph(_);continue}case"text":{let c=_,u=this.renderer.text(c);for(;o+1<n.length&&n[o+1].type==="text";)c=n[++o],u+=`
125
+ `+this.renderer.text(c);r?a+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):a+=u;continue}default:{let c='Token with "'+_.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return a}parseInline(n,r=this.renderer){let a="";for(let o=0;o<n.length;o++){let f=n[o];if(this.options.extensions?.renderers?.[f.type]){let c=this.options.extensions.renderers[f.type].call({parser:this},f);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(f.type)){a+=c||"";continue}}let _=f;switch(_.type){case"escape":{a+=r.text(_);break}case"html":{a+=r.html(_);break}case"link":{a+=r.link(_);break}case"image":{a+=r.image(_);break}case"strong":{a+=r.strong(_);break}case"em":{a+=r.em(_);break}case"codespan":{a+=r.codespan(_);break}case"br":{a+=r.br(_);break}case"del":{a+=r.del(_);break}case"text":{a+=r.text(_);break}default:{let c='Token with "'+_.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return a}},Rl=class{options;block;constructor(e){this.options=e||la}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?Hi.lex:Hi.lexInline}provideParser(){return this.block?Ui.parse:Ui.parseInline}},_C=class{defaults=cm();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Ui;Renderer=th;TextRenderer=_m;Lexer=Hi;Tokenizer=eh;Hooks=Rl;constructor(...n){this.use(...n)}walkTokens(n,r){let a=[];for(let o of n)switch(a=a.concat(r.call(this,o)),o.type){case"table":{let f=o;for(let _ of f.header)a=a.concat(this.walkTokens(_.tokens,r));for(let _ of f.rows)for(let c of _)a=a.concat(this.walkTokens(c.tokens,r));break}case"list":{let f=o;a=a.concat(this.walkTokens(f.items,r));break}default:{let f=o;this.defaults.extensions?.childTokens?.[f.type]?this.defaults.extensions.childTokens[f.type].forEach(_=>{let c=f[_].flat(1/0);a=a.concat(this.walkTokens(c,r))}):f.tokens&&(a=a.concat(this.walkTokens(f.tokens,r)))}}return a}use(...n){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(a=>{let o={...a};if(o.async=this.defaults.async||o.async||!1,a.extensions&&(a.extensions.forEach(f=>{if(!f.name)throw new Error("extension name required");if("renderer"in f){let _=r.renderers[f.name];_?r.renderers[f.name]=function(...c){let u=f.renderer.apply(this,c);return u===!1&&(u=_.apply(this,c)),u}:r.renderers[f.name]=f.renderer}if("tokenizer"in f){if(!f.level||f.level!=="block"&&f.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let _=r[f.level];_?_.unshift(f.tokenizer):r[f.level]=[f.tokenizer],f.start&&(f.level==="block"?r.startBlock?r.startBlock.push(f.start):r.startBlock=[f.start]:f.level==="inline"&&(r.startInline?r.startInline.push(f.start):r.startInline=[f.start]))}"childTokens"in f&&f.childTokens&&(r.childTokens[f.name]=f.childTokens)}),o.extensions=r),a.renderer){let f=this.defaults.renderer||new th(this.defaults);for(let _ in a.renderer){if(!(_ in f))throw new Error(`renderer '${_}' does not exist`);if(["options","parser"].includes(_))continue;let c=_,u=a.renderer[c],d=f[c];f[c]=(...S)=>{let g=u.apply(f,S);return g===!1&&(g=d.apply(f,S)),g||""}}o.renderer=f}if(a.tokenizer){let f=this.defaults.tokenizer||new eh(this.defaults);for(let _ in a.tokenizer){if(!(_ in f))throw new Error(`tokenizer '${_}' does not exist`);if(["options","rules","lexer"].includes(_))continue;let c=_,u=a.tokenizer[c],d=f[c];f[c]=(...S)=>{let g=u.apply(f,S);return g===!1&&(g=d.apply(f,S)),g}}o.tokenizer=f}if(a.hooks){let f=this.defaults.hooks||new Rl;for(let _ in a.hooks){if(!(_ in f))throw new Error(`hook '${_}' does not exist`);if(["options","block"].includes(_))continue;let c=_,u=a.hooks[c],d=f[c];Rl.passThroughHooks.has(_)?f[c]=S=>{if(this.defaults.async&&Rl.passThroughHooksRespectAsync.has(_))return(async()=>{let C=await u.call(f,S);return d.call(f,C)})();let g=u.call(f,S);return d.call(f,g)}:f[c]=(...S)=>{if(this.defaults.async)return(async()=>{let C=await u.apply(f,S);return C===!1&&(C=await d.apply(f,S)),C})();let g=u.apply(f,S);return g===!1&&(g=d.apply(f,S)),g}}o.hooks=f}if(a.walkTokens){let f=this.defaults.walkTokens,_=a.walkTokens;o.walkTokens=function(c){let u=[];return u.push(_.call(this,c)),f&&(u=u.concat(f.call(this,c))),u}}this.defaults={...this.defaults,...o}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,r){return Hi.lex(n,r??this.defaults)}parser(n,r){return Ui.parse(n,r??this.defaults)}parseMarkdown(n){return(r,a)=>{let o={...a},f={...this.defaults,...o},_=this.onError(!!f.silent,!!f.async);if(this.defaults.async===!0&&o.async===!1)return _(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return _(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return _(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(f.hooks&&(f.hooks.options=f,f.hooks.block=n),f.async)return(async()=>{let c=f.hooks?await f.hooks.preprocess(r):r,u=await(f.hooks?await f.hooks.provideLexer():n?Hi.lex:Hi.lexInline)(c,f),d=f.hooks?await f.hooks.processAllTokens(u):u;f.walkTokens&&await Promise.all(this.walkTokens(d,f.walkTokens));let S=await(f.hooks?await f.hooks.provideParser():n?Ui.parse:Ui.parseInline)(d,f);return f.hooks?await f.hooks.postprocess(S):S})().catch(_);try{f.hooks&&(r=f.hooks.preprocess(r));let c=(f.hooks?f.hooks.provideLexer():n?Hi.lex:Hi.lexInline)(r,f);f.hooks&&(c=f.hooks.processAllTokens(c)),f.walkTokens&&this.walkTokens(c,f.walkTokens);let u=(f.hooks?f.hooks.provideParser():n?Ui.parse:Ui.parseInline)(c,f);return f.hooks&&(u=f.hooks.postprocess(u)),u}catch(c){return _(c)}}}onError(n,r){return a=>{if(a.message+=`
126
+ Please report this to https://github.com/markedjs/marked.`,n){let o="<p>An error occurred:</p><pre>"+tr(a.message+"",!0)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(a);throw a}}},aa=new _C;function St(e,n){return aa.parse(e,n)}St.options=St.setOptions=function(e){return aa.setOptions(e),St.defaults=aa.defaults,aC(St.defaults),St};St.getDefaults=cm;St.defaults=la;St.use=function(...e){return aa.use(...e),St.defaults=aa.defaults,aC(St.defaults),St};St.walkTokens=function(e,n){return aa.walkTokens(e,n)};St.parseInline=aa.parseInline;St.Parser=Ui;St.parser=Ui.parse;St.Renderer=th;St.TextRenderer=_m;St.Lexer=Hi;St.lexer=Hi.lex;St.Tokenizer=eh;St.Hooks=Rl;St.parse=St;St.options;St.setOptions;St.use;St.walkTokens;St.parseInline;Ui.parse;Hi.lex;const{entries:vC,setPrototypeOf:p1,isFrozen:HM,getPrototypeOf:UM,getOwnPropertyDescriptor:FM}=Object;let{freeze:Hn,seal:Di,create:Ya}=Object,{apply:ag,construct:og}=typeof Reflect<"u"&&Reflect;Hn||(Hn=function(n){return n});Di||(Di=function(n){return n});ag||(ag=function(n,r){for(var a=arguments.length,o=new Array(a>2?a-2:0),f=2;f<a;f++)o[f-2]=arguments[f];return n.apply(r,o)});og||(og=function(n){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];return new n(...a)});const yl=fn(Array.prototype.forEach),qM=fn(Array.prototype.lastIndexOf),g1=fn(Array.prototype.pop),Sl=fn(Array.prototype.push),WM=fn(Array.prototype.splice),zn=Array.isArray,Ll=fn(String.prototype.toLowerCase),Kf=fn(String.prototype.toString),m1=fn(String.prototype.match),Ga=fn(String.prototype.replace),_1=fn(String.prototype.indexOf),GM=fn(String.prototype.trim),KM=fn(Number.prototype.toString),VM=fn(Boolean.prototype.toString),v1=typeof BigInt>"u"?null:fn(BigInt.prototype.toString),b1=typeof Symbol>"u"?null:fn(Symbol.prototype.toString),Gt=fn(Object.prototype.hasOwnProperty),wl=fn(Object.prototype.toString),Rn=fn(RegExp.prototype.test),_u=YM(TypeError);function fn(e){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];return ag(e,n,a)}}function YM(e){return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return og(e,r)}}function Ve(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ll;if(p1&&p1(e,null),!zn(n))return e;let a=n.length;for(;a--;){let o=n[a];if(typeof o=="string"){const f=r(o);f!==o&&(HM(n)||(n[a]=f),o=f)}e[o]=!0}return e}function XM(e){for(let n=0;n<e.length;n++)Gt(e,n)||(e[n]=null);return e}function Qn(e){const n=Ya(null);for(const[r,a]of vC(e))Gt(e,r)&&(zn(a)?n[r]=XM(a):a&&typeof a=="object"&&a.constructor===Object?n[r]=Qn(a):n[r]=a);return n}function ZM(e){switch(typeof e){case"string":return e;case"number":return KM(e);case"boolean":return VM(e);case"bigint":return v1?v1(e):"0";case"symbol":return b1?b1(e):"Symbol()";case"undefined":return wl(e);case"function":case"object":{if(e===null)return wl(e);const n=e,r=Xa(n,"toString");if(typeof r=="function"){const a=r(n);return typeof a=="string"?a:wl(a)}return wl(e)}default:return wl(e)}}function Xa(e,n){for(;e!==null;){const a=FM(e,n);if(a){if(a.get)return fn(a.get);if(typeof a.value=="function")return fn(a.value)}e=UM(e)}function r(){return null}return r}function JM(e){try{return Rn(e,""),!0}catch{return!1}}const y1=Hn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Vf=Hn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Yf=Hn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),QM=Hn(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Xf=Hn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),e6=Hn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),S1=Hn(["#text"]),w1=Hn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Zf=Hn(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),C1=Hn(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),vu=Hn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),t6=Di(/\{\{[\w\W]*|[\w\W]*\}\}/gm),n6=Di(/<%[\w\W]*|[\w\W]*%>/gm),i6=Di(/\$\{[\w\W]*/gm),r6=Di(/^data-[\-\w.\u00B7-\uFFFF]+$/),s6=Di(/^aria-[\-\w]+$/),bC=Di(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),a6=Di(/^(?:\w+script|data):/i),o6=Di(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),yC=Di(/^html$/i),l6=Di(/^[a-z][.\w]*(-[.\w]+)+$/i);var x1=Object.freeze({__proto__:null,ARIA_ATTR:s6,ATTR_WHITESPACE:o6,CUSTOM_ELEMENT:l6,DATA_ATTR:r6,DOCTYPE_NAME:yC,ERB_EXPR:n6,IS_ALLOWED_URI:bC,IS_SCRIPT_OR_DATA:a6,MUSTACHE_EXPR:t6,TMPLIT_EXPR:i6});const Cl={element:1,text:3,progressingInstruction:7,comment:8,document:9},c6=function(){return typeof window>"u"?null:window},u6=function(n,r){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let a=null;const o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(a=r.getAttribute(o));const f="dompurify"+(a?"#"+a:"");try{return n.createPolicy(f,{createHTML(_){return _},createScriptURL(_){return _}})}catch{return console.warn("TrustedTypes policy "+f+" could not be created."),null}},E1=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function SC(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c6();const n=De=>SC(De);if(n.version="3.4.2",n.removed=[],!e||!e.document||e.document.nodeType!==Cl.document||!e.Element)return n.isSupported=!1,n;let{document:r}=e;const a=r,o=a.currentScript,{DocumentFragment:f,HTMLTemplateElement:_,Node:c,Element:u,NodeFilter:d,NamedNodeMap:S=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:g,DOMParser:C,trustedTypes:E}=e,A=u.prototype,x=Xa(A,"cloneNode"),p=Xa(A,"remove"),v=Xa(A,"nextSibling"),h=Xa(A,"childNodes"),b=Xa(A,"parentNode");if(typeof _=="function"){const De=r.createElement("template");De.content&&De.content.ownerDocument&&(r=De.content.ownerDocument)}let T,R="";const{implementation:L,createNodeIterator:M,createDocumentFragment:k,getElementsByTagName:B}=r,{importNode:F}=a;let U=E1();n.isSupported=typeof vC=="function"&&typeof b=="function"&&L&&L.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:W,ERB_EXPR:j,TMPLIT_EXPR:G,DATA_ATTR:ee,ARIA_ATTR:q,IS_SCRIPT_OR_DATA:V,ATTR_WHITESPACE:Y,CUSTOM_ELEMENT:D}=x1;let{IS_ALLOWED_URI:I}=x1,N=null;const P=Ve({},[...y1,...Vf,...Yf,...Xf,...S1]);let Z=null;const ae=Ve({},[...w1,...Zf,...C1,...vu]);let ce=Object.seal(Ya(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),_e=null,Q=null;const $=Object.seal(Ya(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let oe=!0,ge=!0,Se=!1,ye=!0,Pe=!1,qe=!0,Xe=!1,xt=!1,Ne=!1,en=!1,yn=!1,Sn=!1,mi=!0,Ni=!1;const tn="user-content-";let ht=!0,Vt=!1,zt={},$t=null;const nn=Ve({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Bi=null;const Dn=Ve({},["audio","video","img","source","image","track"]);let ri=null;const ft=Ve({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Un="http://www.w3.org/1998/Math/MathML",Yt="http://www.w3.org/2000/svg",Xt="http://www.w3.org/1999/xhtml";let Pt=Xt,ks=!1,cr=null;const ca=Ve({},[Un,Yt,Xt],Kf);let Ii=Ve({},["mi","mo","mn","ms","mtext"]),Vi=Ve({},["annotation-xml"]);const ur=Ve({},["title","style","font","a","script"]);let rn=null;const J=["application/xhtml+xml","text/html"],he="text/html";let be=null,Ie=null;const wt=r.createElement("form"),pt=function(K){return K instanceof RegExp||K instanceof Function},Te=function(){let K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ie&&Ie===K)return;(!K||typeof K!="object")&&(K={}),K=Qn(K),rn=J.indexOf(K.PARSER_MEDIA_TYPE)===-1?he:K.PARSER_MEDIA_TYPE,be=rn==="application/xhtml+xml"?Kf:Ll,N=Gt(K,"ALLOWED_TAGS")&&zn(K.ALLOWED_TAGS)?Ve({},K.ALLOWED_TAGS,be):P,Z=Gt(K,"ALLOWED_ATTR")&&zn(K.ALLOWED_ATTR)?Ve({},K.ALLOWED_ATTR,be):ae,cr=Gt(K,"ALLOWED_NAMESPACES")&&zn(K.ALLOWED_NAMESPACES)?Ve({},K.ALLOWED_NAMESPACES,Kf):ca,ri=Gt(K,"ADD_URI_SAFE_ATTR")&&zn(K.ADD_URI_SAFE_ATTR)?Ve(Qn(ft),K.ADD_URI_SAFE_ATTR,be):ft,Bi=Gt(K,"ADD_DATA_URI_TAGS")&&zn(K.ADD_DATA_URI_TAGS)?Ve(Qn(Dn),K.ADD_DATA_URI_TAGS,be):Dn,$t=Gt(K,"FORBID_CONTENTS")&&zn(K.FORBID_CONTENTS)?Ve({},K.FORBID_CONTENTS,be):nn,_e=Gt(K,"FORBID_TAGS")&&zn(K.FORBID_TAGS)?Ve({},K.FORBID_TAGS,be):Qn({}),Q=Gt(K,"FORBID_ATTR")&&zn(K.FORBID_ATTR)?Ve({},K.FORBID_ATTR,be):Qn({}),zt=Gt(K,"USE_PROFILES")?K.USE_PROFILES&&typeof K.USE_PROFILES=="object"?Qn(K.USE_PROFILES):K.USE_PROFILES:!1,oe=K.ALLOW_ARIA_ATTR!==!1,ge=K.ALLOW_DATA_ATTR!==!1,Se=K.ALLOW_UNKNOWN_PROTOCOLS||!1,ye=K.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Pe=K.SAFE_FOR_TEMPLATES||!1,qe=K.SAFE_FOR_XML!==!1,Xe=K.WHOLE_DOCUMENT||!1,en=K.RETURN_DOM||!1,yn=K.RETURN_DOM_FRAGMENT||!1,Sn=K.RETURN_TRUSTED_TYPE||!1,Ne=K.FORCE_BODY||!1,mi=K.SANITIZE_DOM!==!1,Ni=K.SANITIZE_NAMED_PROPS||!1,ht=K.KEEP_CONTENT!==!1,Vt=K.IN_PLACE||!1,I=JM(K.ALLOWED_URI_REGEXP)?K.ALLOWED_URI_REGEXP:bC,Pt=typeof K.NAMESPACE=="string"?K.NAMESPACE:Xt,Ii=Gt(K,"MATHML_TEXT_INTEGRATION_POINTS")&&K.MATHML_TEXT_INTEGRATION_POINTS&&typeof K.MATHML_TEXT_INTEGRATION_POINTS=="object"?Qn(K.MATHML_TEXT_INTEGRATION_POINTS):Ve({},["mi","mo","mn","ms","mtext"]),Vi=Gt(K,"HTML_INTEGRATION_POINTS")&&K.HTML_INTEGRATION_POINTS&&typeof K.HTML_INTEGRATION_POINTS=="object"?Qn(K.HTML_INTEGRATION_POINTS):Ve({},["annotation-xml"]);const pe=Gt(K,"CUSTOM_ELEMENT_HANDLING")&&K.CUSTOM_ELEMENT_HANDLING&&typeof K.CUSTOM_ELEMENT_HANDLING=="object"?Qn(K.CUSTOM_ELEMENT_HANDLING):Ya(null);if(ce=Ya(null),Gt(pe,"tagNameCheck")&&pt(pe.tagNameCheck)&&(ce.tagNameCheck=pe.tagNameCheck),Gt(pe,"attributeNameCheck")&&pt(pe.attributeNameCheck)&&(ce.attributeNameCheck=pe.attributeNameCheck),Gt(pe,"allowCustomizedBuiltInElements")&&typeof pe.allowCustomizedBuiltInElements=="boolean"&&(ce.allowCustomizedBuiltInElements=pe.allowCustomizedBuiltInElements),Pe&&(ge=!1),yn&&(en=!0),zt&&(N=Ve({},S1),Z=Ya(null),zt.html===!0&&(Ve(N,y1),Ve(Z,w1)),zt.svg===!0&&(Ve(N,Vf),Ve(Z,Zf),Ve(Z,vu)),zt.svgFilters===!0&&(Ve(N,Yf),Ve(Z,Zf),Ve(Z,vu)),zt.mathMl===!0&&(Ve(N,Xf),Ve(Z,C1),Ve(Z,vu))),$.tagCheck=null,$.attributeCheck=null,Gt(K,"ADD_TAGS")&&(typeof K.ADD_TAGS=="function"?$.tagCheck=K.ADD_TAGS:zn(K.ADD_TAGS)&&(N===P&&(N=Qn(N)),Ve(N,K.ADD_TAGS,be))),Gt(K,"ADD_ATTR")&&(typeof K.ADD_ATTR=="function"?$.attributeCheck=K.ADD_ATTR:zn(K.ADD_ATTR)&&(Z===ae&&(Z=Qn(Z)),Ve(Z,K.ADD_ATTR,be))),Gt(K,"ADD_URI_SAFE_ATTR")&&zn(K.ADD_URI_SAFE_ATTR)&&Ve(ri,K.ADD_URI_SAFE_ATTR,be),Gt(K,"FORBID_CONTENTS")&&zn(K.FORBID_CONTENTS)&&($t===nn&&($t=Qn($t)),Ve($t,K.FORBID_CONTENTS,be)),Gt(K,"ADD_FORBID_CONTENTS")&&zn(K.ADD_FORBID_CONTENTS)&&($t===nn&&($t=Qn($t)),Ve($t,K.ADD_FORBID_CONTENTS,be)),ht&&(N["#text"]=!0),Xe&&Ve(N,["html","head","body"]),N.table&&(Ve(N,["tbody"]),delete _e.tbody),K.TRUSTED_TYPES_POLICY){if(typeof K.TRUSTED_TYPES_POLICY.createHTML!="function")throw _u('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof K.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw _u('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=K.TRUSTED_TYPES_POLICY,R=T.createHTML("")}else T===void 0&&(T=u6(E,o)),T!==null&&typeof R=="string"&&(R=T.createHTML(""));Hn&&Hn(K),Ie=K},Ce=Ve({},[...Vf,...Yf,...QM]),je=Ve({},[...Xf,...e6]),It=function(K){let pe=b(K);(!pe||!pe.tagName)&&(pe={namespaceURI:Pt,tagName:"template"});const xe=Ll(K.tagName),st=Ll(pe.tagName);return cr[K.namespaceURI]?K.namespaceURI===Yt?pe.namespaceURI===Xt?xe==="svg":pe.namespaceURI===Un?xe==="svg"&&(st==="annotation-xml"||Ii[st]):!!Ce[xe]:K.namespaceURI===Un?pe.namespaceURI===Xt?xe==="math":pe.namespaceURI===Yt?xe==="math"&&Vi[st]:!!je[xe]:K.namespaceURI===Xt?pe.namespaceURI===Yt&&!Vi[st]||pe.namespaceURI===Un&&!Ii[st]?!1:!je[xe]&&(ur[xe]||!Ce[xe]):!!(rn==="application/xhtml+xml"&&cr[K.namespaceURI]):!1},et=function(K){Sl(n.removed,{element:K});try{b(K).removeChild(K)}catch{p(K)}},wn=function(K,pe){try{Sl(n.removed,{attribute:pe.getAttributeNode(K),from:pe})}catch{Sl(n.removed,{attribute:null,from:pe})}if(pe.removeAttribute(K),K==="is")if(en||yn)try{et(pe)}catch{}else try{pe.setAttribute(K,"")}catch{}},hr=function(K){let pe=null,xe=null;if(Ne)K="<remove></remove>"+K;else{const kt=m1(K,/^[\r\n\t ]+/);xe=kt&&kt[0]}rn==="application/xhtml+xml"&&Pt===Xt&&(K='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+K+"</body></html>");const st=T?T.createHTML(K):K;if(Pt===Xt)try{pe=new C().parseFromString(st,rn)}catch{}if(!pe||!pe.documentElement){pe=L.createDocument(Pt,"template",null);try{pe.documentElement.innerHTML=ks?R:st}catch{}}const Ze=pe.body||pe.documentElement;return K&&xe&&Ze.insertBefore(r.createTextNode(xe),Ze.childNodes[0]||null),Pt===Xt?B.call(pe,Xe?"html":"body")[0]:Xe?pe.documentElement:Ze},dr=function(K){return M.call(K.ownerDocument||K,K,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Fn=function(K){return K instanceof g&&(typeof K.nodeName!="string"||typeof K.textContent!="string"||typeof K.removeChild!="function"||!(K.attributes instanceof S)||typeof K.removeAttribute!="function"||typeof K.setAttribute!="function"||typeof K.namespaceURI!="string"||typeof K.insertBefore!="function"||typeof K.hasChildNodes!="function")},At=function(K){return typeof c=="function"&&K instanceof c};function Et(De,K,pe){yl(De,xe=>{xe.call(n,K,pe,Ie)})}const ji=function(K){let pe=null;if(Et(U.beforeSanitizeElements,K,null),Fn(K))return et(K),!0;const xe=be(K.nodeName);if(Et(U.uponSanitizeElement,K,{tagName:xe,allowedTags:N}),qe&&K.hasChildNodes()&&!At(K.firstElementChild)&&Rn(/<[/\w!]/g,K.innerHTML)&&Rn(/<[/\w!]/g,K.textContent)||qe&&K.namespaceURI===Xt&&xe==="style"&&At(K.firstElementChild)||K.nodeType===Cl.progressingInstruction||qe&&K.nodeType===Cl.comment&&Rn(/<[/\w]/g,K.data))return et(K),!0;if(_e[xe]||!($.tagCheck instanceof Function&&$.tagCheck(xe))&&!N[xe]){if(!_e[xe]&&fr(xe)&&(ce.tagNameCheck instanceof RegExp&&Rn(ce.tagNameCheck,xe)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(xe)))return!1;if(ht&&!$t[xe]){const st=b(K)||K.parentNode,Ze=h(K)||K.childNodes;if(Ze&&st){const kt=Ze.length;for(let Ht=kt-1;Ht>=0;--Ht){const Ut=x(Ze[Ht],!0);st.insertBefore(Ut,v(K))}}}return et(K),!0}return K instanceof u&&!It(K)||(xe==="noscript"||xe==="noembed"||xe==="noframes")&&Rn(/<\/no(script|embed|frames)/i,K.innerHTML)?(et(K),!0):(Pe&&K.nodeType===Cl.text&&(pe=K.textContent,yl([W,j,G],st=>{pe=Ga(pe,st," ")}),K.textContent!==pe&&(Sl(n.removed,{element:K.cloneNode()}),K.textContent=pe)),Et(U.afterSanitizeElements,K,null),!1)},Fr=function(K,pe,xe){if(Q[pe]||mi&&(pe==="id"||pe==="name")&&(xe in r||xe in wt))return!1;const st=Z[pe]||$.attributeCheck instanceof Function&&$.attributeCheck(pe,K);if(!(ge&&!Q[pe]&&Rn(ee,pe))){if(!(oe&&Rn(q,pe))){if(!st||Q[pe]){if(!(fr(K)&&(ce.tagNameCheck instanceof RegExp&&Rn(ce.tagNameCheck,K)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(K))&&(ce.attributeNameCheck instanceof RegExp&&Rn(ce.attributeNameCheck,pe)||ce.attributeNameCheck instanceof Function&&ce.attributeNameCheck(pe,K))||pe==="is"&&ce.allowCustomizedBuiltInElements&&(ce.tagNameCheck instanceof RegExp&&Rn(ce.tagNameCheck,xe)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(xe))))return!1}else if(!ri[pe]){if(!Rn(I,Ga(xe,Y,""))){if(!((pe==="src"||pe==="xlink:href"||pe==="href")&&K!=="script"&&_1(xe,"data:")===0&&Bi[K])){if(!(Se&&!Rn(V,Ga(xe,Y,"")))){if(xe)return!1}}}}}}return!0},ua=Ve({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),fr=function(K){return!ua[Ll(K)]&&Rn(D,K)},Rs=function(K){Et(U.beforeSanitizeAttributes,K,null);const{attributes:pe}=K;if(!pe||Fn(K))return;const xe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z,forceKeepAttr:void 0};let st=pe.length;for(;st--;){const Ze=pe[st],{name:kt,namespaceURI:Ht,value:Ut}=Ze,me=be(kt),Me=Ut;let Oe=kt==="value"?Me:GM(Me);if(xe.attrName=me,xe.attrValue=Oe,xe.keepAttr=!0,xe.forceKeepAttr=void 0,Et(U.uponSanitizeAttribute,K,xe),Oe=xe.attrValue,Ni&&(me==="id"||me==="name")&&_1(Oe,tn)!==0&&(wn(kt,K),Oe=tn+Oe),qe&&Rn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Oe)){wn(kt,K);continue}if(me==="attributename"&&m1(Oe,"href")){wn(kt,K);continue}if(xe.forceKeepAttr)continue;if(!xe.keepAttr){wn(kt,K);continue}if(!ye&&Rn(/\/>/i,Oe)){wn(kt,K);continue}Pe&&yl([W,j,G],Ot=>{Oe=Ga(Oe,Ot," ")});const ot=be(K.nodeName);if(!Fr(ot,me,Oe)){wn(kt,K);continue}if(T&&typeof E=="object"&&typeof E.getAttributeType=="function"&&!Ht)switch(E.getAttributeType(ot,me)){case"TrustedHTML":{Oe=T.createHTML(Oe);break}case"TrustedScriptURL":{Oe=T.createScriptURL(Oe);break}}if(Oe!==Me)try{Ht?K.setAttributeNS(Ht,kt,Oe):K.setAttribute(kt,Oe),Fn(K)?et(K):g1(n.removed)}catch{wn(kt,K)}}Et(U.afterSanitizeAttributes,K,null)},Yi=function(K){let pe=null;const xe=dr(K);for(Et(U.beforeSanitizeShadowDOM,K,null);pe=xe.nextNode();)Et(U.uponSanitizeShadowNode,pe,null),ji(pe),Rs(pe),pe.content instanceof f&&Yi(pe.content);Et(U.afterSanitizeShadowDOM,K,null)};return n.sanitize=function(De){let K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},pe=null,xe=null,st=null,Ze=null;if(ks=!De,ks&&(De="<!-->"),typeof De!="string"&&!At(De)&&(De=ZM(De),typeof De!="string"))throw _u("dirty is not a string, aborting");if(!n.isSupported)return De;if(xt||Te(K),n.removed=[],typeof De=="string"&&(Vt=!1),Vt){const Ut=De.nodeName;if(typeof Ut=="string"){const me=be(Ut);if(!N[me]||_e[me])throw _u("root node is forbidden and cannot be sanitized in-place")}}else if(De instanceof c)pe=hr("<!---->"),xe=pe.ownerDocument.importNode(De,!0),xe.nodeType===Cl.element&&xe.nodeName==="BODY"||xe.nodeName==="HTML"?pe=xe:pe.appendChild(xe);else{if(!en&&!Pe&&!Xe&&De.indexOf("<")===-1)return T&&Sn?T.createHTML(De):De;if(pe=hr(De),!pe)return en?null:Sn?R:""}pe&&Ne&&et(pe.firstChild);const kt=dr(Vt?De:pe);for(;st=kt.nextNode();)ji(st),Rs(st),st.content instanceof f&&Yi(st.content);if(Vt)return De;if(en){if(Pe){pe.normalize();let Ut=pe.innerHTML;yl([W,j,G],me=>{Ut=Ga(Ut,me," ")}),pe.innerHTML=Ut}if(yn)for(Ze=k.call(pe.ownerDocument);pe.firstChild;)Ze.appendChild(pe.firstChild);else Ze=pe;return(Z.shadowroot||Z.shadowrootmode)&&(Ze=F.call(a,Ze,!0)),Ze}let Ht=Xe?pe.outerHTML:pe.innerHTML;return Xe&&N["!doctype"]&&pe.ownerDocument&&pe.ownerDocument.doctype&&pe.ownerDocument.doctype.name&&Rn(yC,pe.ownerDocument.doctype.name)&&(Ht="<!DOCTYPE "+pe.ownerDocument.doctype.name+`>
127
+ `+Ht),Pe&&yl([W,j,G],Ut=>{Ht=Ga(Ht,Ut," ")}),T&&Sn?T.createHTML(Ht):Ht},n.setConfig=function(){let De=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Te(De),xt=!0},n.clearConfig=function(){Ie=null,xt=!1},n.isValidAttribute=function(De,K,pe){Ie||Te({});const xe=be(De),st=be(K);return Fr(xe,st,pe)},n.addHook=function(De,K){typeof K=="function"&&Sl(U[De],K)},n.removeHook=function(De,K){if(K!==void 0){const pe=qM(U[De],K);return pe===-1?void 0:WM(U[De],pe,1)[0]}return g1(U[De])},n.removeHooks=function(De){U[De]=[]},n.removeAllHooks=function(){U=E1()},n}var jl=SC(),Jf,T1;function h6(){if(T1)return Jf;T1=1;function e(J){return J instanceof Map?J.clear=J.delete=J.set=function(){throw new Error("map is read-only")}:J instanceof Set&&(J.add=J.clear=J.delete=function(){throw new Error("set is read-only")}),Object.freeze(J),Object.getOwnPropertyNames(J).forEach(he=>{const be=J[he],Ie=typeof be;(Ie==="object"||Ie==="function")&&!Object.isFrozen(be)&&e(be)}),J}class n{constructor(he){he.data===void 0&&(he.data={}),this.data=he.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(J){return J.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function a(J,...he){const be=Object.create(null);for(const Ie in J)be[Ie]=J[Ie];return he.forEach(function(Ie){for(const wt in Ie)be[wt]=Ie[wt]}),be}const o="</span>",f=J=>!!J.scope,_=(J,{prefix:he})=>{if(J.startsWith("language:"))return J.replace("language:","language-");if(J.includes(".")){const be=J.split(".");return[`${he}${be.shift()}`,...be.map((Ie,wt)=>`${Ie}${"_".repeat(wt+1)}`)].join(" ")}return`${he}${J}`};class c{constructor(he,be){this.buffer="",this.classPrefix=be.classPrefix,he.walk(this)}addText(he){this.buffer+=r(he)}openNode(he){if(!f(he))return;const be=_(he.scope,{prefix:this.classPrefix});this.span(be)}closeNode(he){f(he)&&(this.buffer+=o)}value(){return this.buffer}span(he){this.buffer+=`<span class="${he}">`}}const u=(J={})=>{const he={children:[]};return Object.assign(he,J),he};class d{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(he){this.top.children.push(he)}openNode(he){const be=u({scope:he});this.add(be),this.stack.push(be)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(he){return this.constructor._walk(he,this.rootNode)}static _walk(he,be){return typeof be=="string"?he.addText(be):be.children&&(he.openNode(be),be.children.forEach(Ie=>this._walk(he,Ie)),he.closeNode(be)),he}static _collapse(he){typeof he!="string"&&he.children&&(he.children.every(be=>typeof be=="string")?he.children=[he.children.join("")]:he.children.forEach(be=>{d._collapse(be)}))}}class S extends d{constructor(he){super(),this.options=he}addText(he){he!==""&&this.add(he)}startScope(he){this.openNode(he)}endScope(){this.closeNode()}__addSublanguage(he,be){const Ie=he.root;be&&(Ie.scope=`language:${be}`),this.add(Ie)}toHTML(){return new c(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function g(J){return J?typeof J=="string"?J:J.source:null}function C(J){return x("(?=",J,")")}function E(J){return x("(?:",J,")*")}function A(J){return x("(?:",J,")?")}function x(...J){return J.map(be=>g(be)).join("")}function p(J){const he=J[J.length-1];return typeof he=="object"&&he.constructor===Object?(J.splice(J.length-1,1),he):{}}function v(...J){return"("+(p(J).capture?"":"?:")+J.map(Ie=>g(Ie)).join("|")+")"}function h(J){return new RegExp(J.toString()+"|").exec("").length-1}function b(J,he){const be=J&&J.exec(he);return be&&be.index===0}const T=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function R(J,{joinWith:he}){let be=0;return J.map(Ie=>{be+=1;const wt=be;let pt=g(Ie),Te="";for(;pt.length>0;){const Ce=T.exec(pt);if(!Ce){Te+=pt;break}Te+=pt.substring(0,Ce.index),pt=pt.substring(Ce.index+Ce[0].length),Ce[0][0]==="\\"&&Ce[1]?Te+="\\"+String(Number(Ce[1])+wt):(Te+=Ce[0],Ce[0]==="("&&be++)}return Te}).map(Ie=>`(${Ie})`).join(he)}const L=/\b\B/,M="[a-zA-Z]\\w*",k="[a-zA-Z_]\\w*",B="\\b\\d+(\\.\\d+)?",F="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",U="\\b(0b[01]+)",W="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",j=(J={})=>{const he=/^#![ ]*\//;return J.binary&&(J.begin=x(he,/.*\b/,J.binary,/\b.*/)),a({scope:"meta",begin:he,end:/$/,relevance:0,"on:begin":(be,Ie)=>{be.index!==0&&Ie.ignoreMatch()}},J)},G={begin:"\\\\[\\s\\S]",relevance:0},ee={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[G]},q={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[G]},V={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Y=function(J,he,be={}){const Ie=a({scope:"comment",begin:J,end:he,contains:[]},be);Ie.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const wt=v("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Ie.contains.push({begin:x(/[ ]+/,"(",wt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Ie},D=Y("//","$"),I=Y("/\\*","\\*/"),N=Y("#","$"),P={scope:"number",begin:B,relevance:0},Z={scope:"number",begin:F,relevance:0},ae={scope:"number",begin:U,relevance:0},ce={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[G,{begin:/\[/,end:/\]/,relevance:0,contains:[G]}]},_e={scope:"title",begin:M,relevance:0},Q={scope:"title",begin:k,relevance:0},$={begin:"\\.\\s*"+k,relevance:0};var ge=Object.freeze({__proto__:null,APOS_STRING_MODE:ee,BACKSLASH_ESCAPE:G,BINARY_NUMBER_MODE:ae,BINARY_NUMBER_RE:U,COMMENT:Y,C_BLOCK_COMMENT_MODE:I,C_LINE_COMMENT_MODE:D,C_NUMBER_MODE:Z,C_NUMBER_RE:F,END_SAME_AS_BEGIN:function(J){return Object.assign(J,{"on:begin":(he,be)=>{be.data._beginMatch=he[1]},"on:end":(he,be)=>{be.data._beginMatch!==he[1]&&be.ignoreMatch()}})},HASH_COMMENT_MODE:N,IDENT_RE:M,MATCH_NOTHING_RE:L,METHOD_GUARD:$,NUMBER_MODE:P,NUMBER_RE:B,PHRASAL_WORDS_MODE:V,QUOTE_STRING_MODE:q,REGEXP_MODE:ce,RE_STARTERS_RE:W,SHEBANG:j,TITLE_MODE:_e,UNDERSCORE_IDENT_RE:k,UNDERSCORE_TITLE_MODE:Q});function Se(J,he){J.input[J.index-1]==="."&&he.ignoreMatch()}function ye(J,he){J.className!==void 0&&(J.scope=J.className,delete J.className)}function Pe(J,he){he&&J.beginKeywords&&(J.begin="\\b("+J.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",J.__beforeBegin=Se,J.keywords=J.keywords||J.beginKeywords,delete J.beginKeywords,J.relevance===void 0&&(J.relevance=0))}function qe(J,he){Array.isArray(J.illegal)&&(J.illegal=v(...J.illegal))}function Xe(J,he){if(J.match){if(J.begin||J.end)throw new Error("begin & end are not supported with match");J.begin=J.match,delete J.match}}function xt(J,he){J.relevance===void 0&&(J.relevance=1)}const Ne=(J,he)=>{if(!J.beforeMatch)return;if(J.starts)throw new Error("beforeMatch cannot be used with starts");const be=Object.assign({},J);Object.keys(J).forEach(Ie=>{delete J[Ie]}),J.keywords=be.keywords,J.begin=x(be.beforeMatch,C(be.begin)),J.starts={relevance:0,contains:[Object.assign(be,{endsParent:!0})]},J.relevance=0,delete be.beforeMatch},en=["of","and","for","in","not","or","if","then","parent","list","value"],yn="keyword";function Sn(J,he,be=yn){const Ie=Object.create(null);return typeof J=="string"?wt(be,J.split(" ")):Array.isArray(J)?wt(be,J):Object.keys(J).forEach(function(pt){Object.assign(Ie,Sn(J[pt],he,pt))}),Ie;function wt(pt,Te){he&&(Te=Te.map(Ce=>Ce.toLowerCase())),Te.forEach(function(Ce){const je=Ce.split("|");Ie[je[0]]=[pt,mi(je[0],je[1])]})}}function mi(J,he){return he?Number(he):Ni(J)?0:1}function Ni(J){return en.includes(J.toLowerCase())}const tn={},ht=J=>{console.error(J)},Vt=(J,...he)=>{console.log(`WARN: ${J}`,...he)},zt=(J,he)=>{tn[`${J}/${he}`]||(console.log(`Deprecated as of ${J}. ${he}`),tn[`${J}/${he}`]=!0)},$t=new Error;function nn(J,he,{key:be}){let Ie=0;const wt=J[be],pt={},Te={};for(let Ce=1;Ce<=he.length;Ce++)Te[Ce+Ie]=wt[Ce],pt[Ce+Ie]=!0,Ie+=h(he[Ce-1]);J[be]=Te,J[be]._emit=pt,J[be]._multi=!0}function Bi(J){if(Array.isArray(J.begin)){if(J.skip||J.excludeBegin||J.returnBegin)throw ht("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),$t;if(typeof J.beginScope!="object"||J.beginScope===null)throw ht("beginScope must be object"),$t;nn(J,J.begin,{key:"beginScope"}),J.begin=R(J.begin,{joinWith:""})}}function Dn(J){if(Array.isArray(J.end)){if(J.skip||J.excludeEnd||J.returnEnd)throw ht("skip, excludeEnd, returnEnd not compatible with endScope: {}"),$t;if(typeof J.endScope!="object"||J.endScope===null)throw ht("endScope must be object"),$t;nn(J,J.end,{key:"endScope"}),J.end=R(J.end,{joinWith:""})}}function ri(J){J.scope&&typeof J.scope=="object"&&J.scope!==null&&(J.beginScope=J.scope,delete J.scope)}function ft(J){ri(J),typeof J.beginScope=="string"&&(J.beginScope={_wrap:J.beginScope}),typeof J.endScope=="string"&&(J.endScope={_wrap:J.endScope}),Bi(J),Dn(J)}function Un(J){function he(Te,Ce){return new RegExp(g(Te),"m"+(J.case_insensitive?"i":"")+(J.unicodeRegex?"u":"")+(Ce?"g":""))}class be{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Ce,je){je.position=this.position++,this.matchIndexes[this.matchAt]=je,this.regexes.push([je,Ce]),this.matchAt+=h(Ce)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Ce=this.regexes.map(je=>je[1]);this.matcherRe=he(R(Ce,{joinWith:"|"}),!0),this.lastIndex=0}exec(Ce){this.matcherRe.lastIndex=this.lastIndex;const je=this.matcherRe.exec(Ce);if(!je)return null;const It=je.findIndex((wn,hr)=>hr>0&&wn!==void 0),et=this.matchIndexes[It];return je.splice(0,It),Object.assign(je,et)}}class Ie{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Ce){if(this.multiRegexes[Ce])return this.multiRegexes[Ce];const je=new be;return this.rules.slice(Ce).forEach(([It,et])=>je.addRule(It,et)),je.compile(),this.multiRegexes[Ce]=je,je}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Ce,je){this.rules.push([Ce,je]),je.type==="begin"&&this.count++}exec(Ce){const je=this.getMatcher(this.regexIndex);je.lastIndex=this.lastIndex;let It=je.exec(Ce);if(this.resumingScanAtSamePosition()&&!(It&&It.index===this.lastIndex)){const et=this.getMatcher(0);et.lastIndex=this.lastIndex+1,It=et.exec(Ce)}return It&&(this.regexIndex+=It.position+1,this.regexIndex===this.count&&this.considerAll()),It}}function wt(Te){const Ce=new Ie;return Te.contains.forEach(je=>Ce.addRule(je.begin,{rule:je,type:"begin"})),Te.terminatorEnd&&Ce.addRule(Te.terminatorEnd,{type:"end"}),Te.illegal&&Ce.addRule(Te.illegal,{type:"illegal"}),Ce}function pt(Te,Ce){const je=Te;if(Te.isCompiled)return je;[ye,Xe,ft,Ne].forEach(et=>et(Te,Ce)),J.compilerExtensions.forEach(et=>et(Te,Ce)),Te.__beforeBegin=null,[Pe,qe,xt].forEach(et=>et(Te,Ce)),Te.isCompiled=!0;let It=null;return typeof Te.keywords=="object"&&Te.keywords.$pattern&&(Te.keywords=Object.assign({},Te.keywords),It=Te.keywords.$pattern,delete Te.keywords.$pattern),It=It||/\w+/,Te.keywords&&(Te.keywords=Sn(Te.keywords,J.case_insensitive)),je.keywordPatternRe=he(It,!0),Ce&&(Te.begin||(Te.begin=/\B|\b/),je.beginRe=he(je.begin),!Te.end&&!Te.endsWithParent&&(Te.end=/\B|\b/),Te.end&&(je.endRe=he(je.end)),je.terminatorEnd=g(je.end)||"",Te.endsWithParent&&Ce.terminatorEnd&&(je.terminatorEnd+=(Te.end?"|":"")+Ce.terminatorEnd)),Te.illegal&&(je.illegalRe=he(Te.illegal)),Te.contains||(Te.contains=[]),Te.contains=[].concat(...Te.contains.map(function(et){return Xt(et==="self"?Te:et)})),Te.contains.forEach(function(et){pt(et,je)}),Te.starts&&pt(Te.starts,Ce),je.matcher=wt(je),je}if(J.compilerExtensions||(J.compilerExtensions=[]),J.contains&&J.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return J.classNameAliases=a(J.classNameAliases||{}),pt(J)}function Yt(J){return J?J.endsWithParent||Yt(J.starts):!1}function Xt(J){return J.variants&&!J.cachedVariants&&(J.cachedVariants=J.variants.map(function(he){return a(J,{variants:null},he)})),J.cachedVariants?J.cachedVariants:Yt(J)?a(J,{starts:J.starts?a(J.starts):null}):Object.isFrozen(J)?a(J):J}var Pt="11.11.1";class ks extends Error{constructor(he,be){super(he),this.name="HTMLInjectionError",this.html=be}}const cr=r,ca=a,Ii=Symbol("nomatch"),Vi=7,ur=function(J){const he=Object.create(null),be=Object.create(null),Ie=[];let wt=!0;const pt="Could not find the language '{}', did you forget to load/include a language module?",Te={disableAutodetect:!0,name:"Plain text",contains:[]};let Ce={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:S};function je(me){return Ce.noHighlightRe.test(me)}function It(me){let Me=me.className+" ";Me+=me.parentNode?me.parentNode.className:"";const Oe=Ce.languageDetectRe.exec(Me);if(Oe){const ot=K(Oe[1]);return ot||(Vt(pt.replace("{}",Oe[1])),Vt("Falling back to no-highlight mode for this block.",me)),ot?Oe[1]:"no-highlight"}return Me.split(/\s+/).find(ot=>je(ot)||K(ot))}function et(me,Me,Oe){let ot="",Ot="";typeof Me=="object"?(ot=me,Oe=Me.ignoreIllegals,Ot=Me.language):(zt("10.7.0","highlight(lang, code, ...args) has been deprecated."),zt("10.7.0",`Please use highlight(code, options) instead.
128
+ https://github.com/highlightjs/highlight.js/issues/2277`),Ot=me,ot=Me),Oe===void 0&&(Oe=!0);const On={code:ot,language:Ot};Ht("before:highlight",On);const si=On.result?On.result:wn(On.language,On.code,Oe);return si.code=On.code,Ht("after:highlight",si),si}function wn(me,Me,Oe,ot){const Ot=Object.create(null);function On(we,Re){return we.keywords[Re]}function si(){if(!He.keywords){sn.addText(gt);return}let we=0;He.keywordPatternRe.lastIndex=0;let Re=He.keywordPatternRe.exec(gt),We="";for(;Re;){We+=gt.substring(we,Re.index);const tt=Cn.case_insensitive?Re[0].toLowerCase():Re[0],jt=On(He,tt);if(jt){const[_i,Eo]=jt;if(sn.addText(We),We="",Ot[tt]=(Ot[tt]||0)+1,Ot[tt]<=Vi&&(qr+=Eo),_i.startsWith("_"))We+=Re[0];else{const nc=Cn.classNameAliases[_i]||_i;ai(Re[0],nc)}}else We+=Re[0];we=He.keywordPatternRe.lastIndex,Re=He.keywordPatternRe.exec(gt)}We+=gt.substring(we),sn.addText(We)}function qn(){if(gt==="")return;let we=null;if(typeof He.subLanguage=="string"){if(!he[He.subLanguage]){sn.addText(gt);return}we=wn(He.subLanguage,gt,!0,tc[He.subLanguage]),tc[He.subLanguage]=we._top}else we=dr(gt,He.subLanguage.length?He.subLanguage:null);He.relevance>0&&(qr+=we.relevance),sn.__addSublanguage(we._emitter,we.language)}function Tt(){He.subLanguage!=null?qn():si(),gt=""}function ai(we,Re){we!==""&&(sn.startScope(Re),sn.addText(we),sn.endScope())}function Ql(we,Re){let We=1;const tt=Re.length-1;for(;We<=tt;){if(!we._emit[We]){We++;continue}const jt=Cn.classNameAliases[we[We]]||we[We],_i=Re[We];jt?ai(_i,jt):(gt=_i,si(),gt=""),We++}}function ha(we,Re){return we.scope&&typeof we.scope=="string"&&sn.openNode(Cn.classNameAliases[we.scope]||we.scope),we.beginScope&&(we.beginScope._wrap?(ai(gt,Cn.classNameAliases[we.beginScope._wrap]||we.beginScope._wrap),gt=""):we.beginScope._multi&&(Ql(we.beginScope,Re),gt="")),He=Object.create(we,{parent:{value:He}}),He}function wo(we,Re,We){let tt=b(we.endRe,We);if(tt){if(we["on:end"]){const jt=new n(we);we["on:end"](Re,jt),jt.isMatchIgnored&&(tt=!1)}if(tt){for(;we.endsParent&&we.parent;)we=we.parent;return we}}if(we.endsWithParent)return wo(we.parent,Re,We)}function da(we){return He.matcher.regexIndex===0?(gt+=we[0],1):(Wr=!0,0)}function Eh(we){const Re=we[0],We=we.rule,tt=new n(We),jt=[We.__beforeBegin,We["on:begin"]];for(const _i of jt)if(_i&&(_i(we,tt),tt.isMatchIgnored))return da(Re);return We.skip?gt+=Re:(We.excludeBegin&&(gt+=Re),Tt(),!We.returnBegin&&!We.excludeBegin&&(gt=Re)),ha(We,we),We.returnBegin?0:Re.length}function Wn(we){const Re=we[0],We=Me.substring(we.index),tt=wo(He,we,We);if(!tt)return Ii;const jt=He;He.endScope&&He.endScope._wrap?(Tt(),ai(Re,He.endScope._wrap)):He.endScope&&He.endScope._multi?(Tt(),Ql(He.endScope,we)):jt.skip?gt+=Re:(jt.returnEnd||jt.excludeEnd||(gt+=Re),Tt(),jt.excludeEnd&&(gt=Re));do He.scope&&sn.closeNode(),!He.skip&&!He.subLanguage&&(qr+=He.relevance),He=He.parent;while(He!==tt.parent);return tt.starts&&ha(tt.starts,we),jt.returnEnd?0:Re.length}function Co(){const we=[];for(let Re=He;Re!==Cn;Re=Re.parent)Re.scope&&we.unshift(Re.scope);we.forEach(Re=>sn.openNode(Re))}let Ls={};function fa(we,Re){const We=Re&&Re[0];if(gt+=we,We==null)return Tt(),0;if(Ls.type==="begin"&&Re.type==="end"&&Ls.index===Re.index&&We===""){if(gt+=Me.slice(Re.index,Re.index+1),!wt){const tt=new Error(`0 width match regex (${me})`);throw tt.languageName=me,tt.badRule=Ls.rule,tt}return 1}if(Ls=Re,Re.type==="begin")return Eh(Re);if(Re.type==="illegal"&&!Oe){const tt=new Error('Illegal lexeme "'+We+'" for mode "'+(He.scope||"<unnamed>")+'"');throw tt.mode=He,tt}else if(Re.type==="end"){const tt=Wn(Re);if(tt!==Ii)return tt}if(Re.type==="illegal"&&We==="")return gt+=`
129
+ `,1;if(xo>1e5&&xo>Re.index*3)throw new Error("potential infinite loop, way more iterations than matches");return gt+=We,We.length}const Cn=K(me);if(!Cn)throw ht(pt.replace("{}",me)),new Error('Unknown language: "'+me+'"');const ec=Un(Cn);let pa="",He=ot||ec;const tc={},sn=new Ce.__emitter(Ce);Co();let gt="",qr=0,pr=0,xo=0,Wr=!1;try{if(Cn.__emitTokens)Cn.__emitTokens(Me,sn);else{for(He.matcher.considerAll();;){xo++,Wr?Wr=!1:He.matcher.considerAll(),He.matcher.lastIndex=pr;const we=He.matcher.exec(Me);if(!we)break;const Re=Me.substring(pr,we.index),We=fa(Re,we);pr=we.index+We}fa(Me.substring(pr))}return sn.finalize(),pa=sn.toHTML(),{language:me,value:pa,relevance:qr,illegal:!1,_emitter:sn,_top:He}}catch(we){if(we.message&&we.message.includes("Illegal"))return{language:me,value:cr(Me),illegal:!0,relevance:0,_illegalBy:{message:we.message,index:pr,context:Me.slice(pr-100,pr+100),mode:we.mode,resultSoFar:pa},_emitter:sn};if(wt)return{language:me,value:cr(Me),illegal:!1,relevance:0,errorRaised:we,_emitter:sn,_top:He};throw we}}function hr(me){const Me={value:cr(me),illegal:!1,relevance:0,_top:Te,_emitter:new Ce.__emitter(Ce)};return Me._emitter.addText(me),Me}function dr(me,Me){Me=Me||Ce.languages||Object.keys(he);const Oe=hr(me),ot=Me.filter(K).filter(xe).map(Tt=>wn(Tt,me,!1));ot.unshift(Oe);const Ot=ot.sort((Tt,ai)=>{if(Tt.relevance!==ai.relevance)return ai.relevance-Tt.relevance;if(Tt.language&&ai.language){if(K(Tt.language).supersetOf===ai.language)return 1;if(K(ai.language).supersetOf===Tt.language)return-1}return 0}),[On,si]=Ot,qn=On;return qn.secondBest=si,qn}function Fn(me,Me,Oe){const ot=Me&&be[Me]||Oe;me.classList.add("hljs"),me.classList.add(`language-${ot}`)}function At(me){let Me=null;const Oe=It(me);if(je(Oe))return;if(Ht("before:highlightElement",{el:me,language:Oe}),me.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",me);return}if(me.children.length>0&&(Ce.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(me)),Ce.throwUnescapedHTML))throw new ks("One of your code blocks includes unescaped HTML.",me.innerHTML);Me=me;const ot=Me.textContent,Ot=Oe?et(ot,{language:Oe,ignoreIllegals:!0}):dr(ot);me.innerHTML=Ot.value,me.dataset.highlighted="yes",Fn(me,Oe,Ot.language),me.result={language:Ot.language,re:Ot.relevance,relevance:Ot.relevance},Ot.secondBest&&(me.secondBest={language:Ot.secondBest.language,relevance:Ot.secondBest.relevance}),Ht("after:highlightElement",{el:me,result:Ot,text:ot})}function Et(me){Ce=ca(Ce,me)}const ji=()=>{fr(),zt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Fr(){fr(),zt("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let ua=!1;function fr(){function me(){fr()}if(document.readyState==="loading"){ua||window.addEventListener("DOMContentLoaded",me,!1),ua=!0;return}document.querySelectorAll(Ce.cssSelector).forEach(At)}function Rs(me,Me){let Oe=null;try{Oe=Me(J)}catch(ot){if(ht("Language definition for '{}' could not be registered.".replace("{}",me)),wt)ht(ot);else throw ot;Oe=Te}Oe.name||(Oe.name=me),he[me]=Oe,Oe.rawDefinition=Me.bind(null,J),Oe.aliases&&pe(Oe.aliases,{languageName:me})}function Yi(me){delete he[me];for(const Me of Object.keys(be))be[Me]===me&&delete be[Me]}function De(){return Object.keys(he)}function K(me){return me=(me||"").toLowerCase(),he[me]||he[be[me]]}function pe(me,{languageName:Me}){typeof me=="string"&&(me=[me]),me.forEach(Oe=>{be[Oe.toLowerCase()]=Me})}function xe(me){const Me=K(me);return Me&&!Me.disableAutodetect}function st(me){me["before:highlightBlock"]&&!me["before:highlightElement"]&&(me["before:highlightElement"]=Me=>{me["before:highlightBlock"](Object.assign({block:Me.el},Me))}),me["after:highlightBlock"]&&!me["after:highlightElement"]&&(me["after:highlightElement"]=Me=>{me["after:highlightBlock"](Object.assign({block:Me.el},Me))})}function Ze(me){st(me),Ie.push(me)}function kt(me){const Me=Ie.indexOf(me);Me!==-1&&Ie.splice(Me,1)}function Ht(me,Me){const Oe=me;Ie.forEach(function(ot){ot[Oe]&&ot[Oe](Me)})}function Ut(me){return zt("10.7.0","highlightBlock will be removed entirely in v12.0"),zt("10.7.0","Please use highlightElement now."),At(me)}Object.assign(J,{highlight:et,highlightAuto:dr,highlightAll:fr,highlightElement:At,highlightBlock:Ut,configure:Et,initHighlighting:ji,initHighlightingOnLoad:Fr,registerLanguage:Rs,unregisterLanguage:Yi,listLanguages:De,getLanguage:K,registerAliases:pe,autoDetection:xe,inherit:ca,addPlugin:Ze,removePlugin:kt}),J.debugMode=function(){wt=!1},J.safeMode=function(){wt=!0},J.versionString=Pt,J.regex={concat:x,lookahead:C,either:v,optional:A,anyNumberOfTimes:E};for(const me in ge)typeof ge[me]=="object"&&e(ge[me]);return Object.assign(J,ge),J},rn=ur({});return rn.newInstance=()=>ur({}),Jf=rn,rn.HighlightJS=rn,rn.default=rn,Jf}var d6=h6();const Ti=ME(d6);function A1(e){const n=e.regex,r={},a={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:n.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},a]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},f=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),_={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,r,o]};o.contains.push(c);const u={match:/\\"/},d={className:"string",begin:/'/,end:/'/},S={match:/\\'/},g={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,r]},C=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],E=e.SHEBANG({binary:`(${C.join("|")})`,relevance:10}),A={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},x=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],p=["true","false"],v={match:/(\/[a-z._-]+)+/},h=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],b=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],T=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],R=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:x,literal:p,built_in:[...h,...b,"set","shopt",...T,...R]},contains:[E,e.SHEBANG(),A,g,f,_,v,c,u,d,S,r]}}const k1="[A-Za-z$_][0-9A-Za-z$_]*",f6=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],p6=["true","false","null","undefined","NaN","Infinity"],wC=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],CC=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],xC=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],g6=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],m6=[].concat(xC,wC,CC);function R1(e){const n=e.regex,r=(Y,{after:D})=>{const I="</"+Y[0].slice(1);return Y.input.indexOf(I,D)!==-1},a=k1,o={begin:"<>",end:"</>"},f=/<[A-Za-z0-9\\._:-]+\s*\/>/,_={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Y,D)=>{const I=Y[0].length+Y.index,N=Y.input[I];if(N==="<"||N===","){D.ignoreMatch();return}N===">"&&(r(Y,{after:I})||D.ignoreMatch());let P;const Z=Y.input.substring(I);if(P=Z.match(/^\s*=/)){D.ignoreMatch();return}if((P=Z.match(/^\s+extends\s+/))&&P.index===0){D.ignoreMatch();return}}},c={$pattern:k1,keyword:f6,literal:p6,built_in:m6,"variable.language":g6},u="[0-9](_?[0-9])*",d=`\\.(${u})`,S="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${S})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${S})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},E={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},A={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"css"}},x={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},p={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,C]},h={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:a+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,E,A,x,p,{match:/\$\d+/},g];C.contains=b.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(b)});const T=[].concat(h,C.contains),R=T.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(T)}]),L={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:R},M={variants:[{match:[/class/,/\s+/,a,/\s+/,/extends/,/\s+/,n.concat(a,"(",n.concat(/\./,a),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,a],scope:{1:"keyword",3:"title.class"}}]},k={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...wC,...CC]}},B={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},F={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},U={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function W(Y){return n.concat("(?!",Y.join("|"),")")}const j={match:n.concat(/\b/,W([...xC,"super","import"].map(Y=>`${Y}\\s*\\(`)),a,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},G={begin:n.concat(/\./,n.lookahead(n.concat(a,/(?![0-9A-Za-z$_(])/))),end:a,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ee={match:[/get|set/,/\s+/,a,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},L]},q="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(q)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:R,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),B,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,E,A,x,p,h,{match:/\$\d+/},g,k,{scope:"attr",match:a+n.lookahead(":"),relevance:0},V,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[h,e.REGEXP_MODE,{className:"function",begin:q,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:R}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:f},{begin:_.begin,"on:begin":_.isTrulyOpeningTag,end:_.end}],subLanguage:"xml",contains:[{begin:_.begin,end:_.end,skip:!0,contains:["self"]}]}]},F,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,e.inherit(e.TITLE_MODE,{begin:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},G,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},j,U,M,ee,{match:/\$[(.]/}]}}function _6(e){const n={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},a=["true","false","null"],o={scope:"literal",beginKeywords:a.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:a},contains:[n,r,e.QUOTE_STRING_MODE,o,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function L1(e){const n=e.regex,r={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},a={begin:"^[-\\*]{3,}",end:"$"},o={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},f={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},_={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},c=/[A-Za-z][A-Za-z0-9+.-]*/,u={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:n.concat(/\[.+?\]\(/,c,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},d={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},S={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},g=e.inherit(d,{contains:[]}),C=e.inherit(S,{contains:[]});d.contains.push(C),S.contains.push(g);let E=[r,u];return[d,S,g,C].forEach(v=>{v.contains=v.contains.concat(E)}),E=E.concat(d,S),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:E},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:E}]}]},r,f,d,S,{className:"quote",begin:"^>\\s+",contains:E,end:"$"},o,a,u,_,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function M1(e){const n=e.regex,r=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),a=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],c={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:a,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},d={className:"subst",begin:/\{/,end:/\}/,keywords:c,illegal:/#/},S={begin:/\{\{/,relevance:0},g={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u,S,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u,S,d]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,S,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,S,d]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},C="[0-9](_?[0-9])*",E=`(\\b(${C}))?\\.(${C})|\\b(${C})\\.`,A=`\\b|${a.join("|")}`,x={className:"number",relevance:0,variants:[{begin:`(\\b(${C})|(${E}))[eE][+-]?(${C})[jJ]?(?=${A})`},{begin:`(${E})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${A})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${A})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${A})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${A})`},{begin:`\\b(${C})[jJ](?=${A})`}]},p={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:c,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},v={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",u,x,g,e.HASH_COMMENT_MODE]}]};return d.contains=[g,x,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[u,x,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},g,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[v]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[x,v,g]}]}}const nh="[A-Za-z$_][0-9A-Za-z$_]*",EC=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],TC=["true","false","null","undefined","NaN","Infinity"],AC=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],kC=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],RC=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],LC=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],MC=[].concat(RC,AC,kC);function v6(e){const n=e.regex,r=(Y,{after:D})=>{const I="</"+Y[0].slice(1);return Y.input.indexOf(I,D)!==-1},a=nh,o={begin:"<>",end:"</>"},f=/<[A-Za-z0-9\\._:-]+\s*\/>/,_={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Y,D)=>{const I=Y[0].length+Y.index,N=Y.input[I];if(N==="<"||N===","){D.ignoreMatch();return}N===">"&&(r(Y,{after:I})||D.ignoreMatch());let P;const Z=Y.input.substring(I);if(P=Z.match(/^\s*=/)){D.ignoreMatch();return}if((P=Z.match(/^\s+extends\s+/))&&P.index===0){D.ignoreMatch();return}}},c={$pattern:nh,keyword:EC,literal:TC,built_in:MC,"variable.language":LC},u="[0-9](_?[0-9])*",d=`\\.(${u})`,S="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${S})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${S})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},E={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},A={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"css"}},x={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},p={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,C]},h={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:a+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,E,A,x,p,{match:/\$\d+/},g];C.contains=b.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(b)});const T=[].concat(h,C.contains),R=T.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(T)}]),L={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:R},M={variants:[{match:[/class/,/\s+/,a,/\s+/,/extends/,/\s+/,n.concat(a,"(",n.concat(/\./,a),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,a],scope:{1:"keyword",3:"title.class"}}]},k={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...AC,...kC]}},B={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},F={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},U={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function W(Y){return n.concat("(?!",Y.join("|"),")")}const j={match:n.concat(/\b/,W([...RC,"super","import"].map(Y=>`${Y}\\s*\\(`)),a,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},G={begin:n.concat(/\./,n.lookahead(n.concat(a,/(?![0-9A-Za-z$_(])/))),end:a,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ee={match:[/get|set/,/\s+/,a,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},L]},q="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(q)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:R,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),B,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,E,A,x,p,h,{match:/\$\d+/},g,k,{scope:"attr",match:a+n.lookahead(":"),relevance:0},V,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[h,e.REGEXP_MODE,{className:"function",begin:q,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:R}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:f},{begin:_.begin,"on:begin":_.isTrulyOpeningTag,end:_.end}],subLanguage:"xml",contains:[{begin:_.begin,end:_.end,skip:!0,contains:["self"]}]}]},F,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,e.inherit(e.TITLE_MODE,{begin:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},G,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},j,U,M,ee,{match:/\$[(.]/}]}}function D1(e){const n=e.regex,r=v6(e),a=nh,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],f={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},_={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:o},contains:[r.exports.CLASS_REFERENCE]},c={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},u=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],d={$pattern:nh,keyword:EC.concat(u),literal:TC,built_in:MC.concat(o),"variable.language":LC},S={className:"meta",begin:"@"+a},g=(x,p,v)=>{const h=x.contains.findIndex(b=>b.label===p);if(h===-1)throw new Error("can not find mode to replace");x.contains.splice(h,1,v)};Object.assign(r.keywords,d),r.exports.PARAMS_CONTAINS.push(S);const C=r.contains.find(x=>x.scope==="attr"),E=Object.assign({},C,{match:n.concat(a,n.lookahead(/\s*\?:/))});r.exports.PARAMS_CONTAINS.push([r.exports.CLASS_REFERENCE,C,E]),r.contains=r.contains.concat([S,f,_,E]),g(r,"shebang",e.SHEBANG()),g(r,"use_strict",c);const A=r.contains.find(x=>x.label==="func.def");return A.relevance=0,Object.assign(r,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),r}const b6=/\[\[wiki:([^\]]+)\]\]/g,y6=new _C({gfm:!0,breaks:!1}),O1={ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto):|[#/]|\.{0,2}\/|[^:]+$)/i,ADD_ATTR:["target","rel","data-entry-id"]},Qf=M6();function yo(e,n={}){const r=C6(e),a=y6.parse(r,{async:!1}),o=jl.sanitize(a,O1),f=new DOMParser().parseFromString(o,"text/html");return E6(f,n.omitDuplicateTitle),x6(f),T6(f),k6(f),{html:jl.sanitize(f.body.innerHTML,O1),toc:R6(f)}}function S6(e){const n=new TextEncoder().encode(e);let r="";for(const a of n)r+=String.fromCharCode(a);return btoa(r)}function w6(e){const n=atob(e),r=new Uint8Array(n.length);for(let a=0;a<n.length;a++)r[a]=n.charCodeAt(a);return new TextDecoder().decode(r)}function C6(e){return e.replace(b6,(n,r)=>{const a=r.trim();if(!a)return"";const o=Ee(a),f=encodeURIComponent(a);return`<a href="${Ur(a)}" data-entry-id="${f}">${o}</a>`})}function x6(e){const n=new Map;for(const r of e.querySelectorAll("h2, h3")){const a=r.textContent?.trim()??"",o=N6(a||"section"),f=n.get(o)??0;n.set(o,f+1),r.id=f===0?o:`${o}-${f+1}`}}function E6(e,n){if(!n)return;const r=e.body.querySelector("h1, h2, h3, h4, h5, h6");!r||r.tagName.toLowerCase()!=="h1"||N1(r.textContent??"")===N1(n)&&r.remove()}function T6(e){for(const n of e.querySelectorAll("pre > code")){const r=D6(n.className),a=n.textContent??"",o=n.parentElement;if(!o)continue;if(r==="mermaid"){const _=e.createElement("div");_.className="diagram-block",_.setAttribute("data-mermaid-source",S6(a)),_.setAttribute("data-diagram-state","pending"),o.replaceWith(_);continue}const f=L6(a,r);n.innerHTML=f,n.classList.add("hljs"),o.classList.add("code-block"),o.dataset.code=a,o.insertBefore(A6(e,r||"text"),o.firstChild)}}function A6(e,n){const r=e.createElement("div");r.className="code-block-toolbar";const a=e.createElement("span");a.className="code-block-dots",a.setAttribute("aria-hidden","true");for(let _=0;_<3;_++)a.append(e.createElement("span"));const o=e.createElement("span");o.className="code-block-language",o.textContent=n;const f=e.createElement("button");return f.className="copy-code",f.type="button",f.dataset.action="copy-code",f.setAttribute("aria-label",`Copy ${n} code`),f.textContent="Copy",r.append(a,o,f),r}function k6(e){for(const n of e.querySelectorAll("a")){const r=n.getAttribute("href")??"";O6(r)&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"))}}function R6(e){return[...e.querySelectorAll("h2, h3")].map(n=>({id:n.id,text:n.textContent?.trim()??n.id,level:n.tagName.toLowerCase()==="h2"?2:3}))}function L6(e,n){return n&&Qf.getLanguage(n)?Qf.highlight(e,{language:n}).value:Qf.highlightAuto(e).value}function M6(){return Ti.registerLanguage("bash",A1),Ti.registerLanguage("sh",A1),Ti.registerLanguage("javascript",R1),Ti.registerLanguage("js",R1),Ti.registerLanguage("json",_6),Ti.registerLanguage("markdown",L1),Ti.registerLanguage("md",L1),Ti.registerLanguage("python",M1),Ti.registerLanguage("py",M1),Ti.registerLanguage("typescript",D1),Ti.registerLanguage("ts",D1),Ti}function D6(e){return e.match(/language-([a-z0-9_-]+)/i)?.[1]?.toLowerCase()??null}function O6(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)&&!e.startsWith(window.location.origin)}function N6(e){return e.trim().toLowerCase().replace(/[^\p{Letter}\p{Number}]+/gu,"-").replace(/^-+|-+$/g,"")||"section"}function N1(e){return e.trim().replace(/\s+/g," ").toLocaleLowerCase("en-US")}function B6(e){return`
130
+ <article class="document">
131
+ <header class="document-header">
132
+ <p class="eyebrow">MANIFEST · DRYDOCK</p>
133
+ <h1>Conflicts</h1>
134
+ </header>
135
+ ${e.length>0?`
136
+ <ul class="conflict-list">
137
+ ${e.map(n=>`
138
+ <li>
139
+ <a class="conflict-list-item" href="${EL(n.id)}">
140
+ <span class="conflict-list-copy">
141
+ <strong>${Ee(n.title)}</strong>
142
+ <small>${Ee(n.id)}</small>
143
+ </span>
144
+ <span class="chip ${n.status==="open"?"chip-coral":"chip"}">${Ee(n.status)}</span>
145
+ </a>
146
+ </li>
147
+ `).join("")}
148
+ </ul>
149
+ `:'<p class="empty-state">No conflicts to display.</p>'}
150
+ </article>
151
+ `}function I6(e){const n=[ep("Current",e.current),ep("Proposed",e.proposed),ep("Raw Source",e.rawSource)].filter(Boolean).join("");return`
152
+ <article class="document">
153
+ <header class="document-header">
154
+ <p class="eyebrow">MANIFEST · DRYDOCK</p>
155
+ <h1>${Ee(e.id)}</h1>
156
+ <div class="meta-chips">
157
+ <span class="chip chip-coral">${Ee(String(e.meta.status??"unknown"))}</span>
158
+ </div>
159
+ </header>
160
+ <section class="conflict-meta-card">
161
+ <pre>${Ee(JSON.stringify(e.meta,null,2))}</pre>
162
+ </section>
163
+ ${n||'<p class="empty-state">No conflicts to display.</p>'}
164
+ </article>
165
+ `}function ep(e,n){if(!n)return"";const r=yo(n);return`
166
+ <section class="conflict-section">
167
+ <h2>${Ee(e)}</h2>
168
+ <div class="markdown-body">${r.html}</div>
169
+ </section>
170
+ `}function j6(e){return`
171
+ <article class="document">
172
+ <header class="document-header">
173
+ <p class="eyebrow">MANIFEST · CODEX</p>
174
+ <h1>Index</h1>
175
+ </header>
176
+ <div class="markdown-body">${yo(e).html}</div>
177
+ </article>
178
+ `}function lg(e,n){try{return new Date(e).toLocaleString(n??"en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}catch{return e}}function ih(e){const n=Date.now()-new Date(e).getTime(),r=Math.floor(n/6e4);if(r<1)return"just now";if(r<60)return`${r} min ago`;const a=Math.floor(r/60);if(a<24)return`${a} hr ago`;const o=Math.floor(a/24);return o<30?`${o} days ago`:`${Math.floor(o/30)} months ago`}const z6=`
179
+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
180
+ <path d="M7 17 17 7M9 7h8v8" />
181
+ </svg>
182
+ `;function $6(e,n,r){if(!e)return"";const{frontmatter:a}=e,o=lg(a.created),f=ih(a.created),_=lg(a.updated),c=ih(a.updated),u=sL(e,n,r),d=a.tags.length>0?`<div class="queue-card-chips">${a.tags.map(g=>`<span class="chip chip-muted">${Ee(g)}</span>`).join("")}</div>`:'<span class="queue-dl-muted">None</span>',S=a.rawSourceRef?`<a class="manifest-link queue-raw-link" href="${Ye(Gw(a.rawSourceRef))}" data-raw-ref="${Ye(a.rawSourceRef)}">
183
+ <span class="manifest-ref">${Ee(a.rawSourceRef)}</span>
184
+ <span class="manifest-arrow" aria-hidden="true">${z6}</span>
185
+ </a>`:'<span class="queue-dl-muted">None</span>';return`
186
+ <details class="manifest-card" open>
187
+ <summary class="manifest-summary" aria-label="Toggle document manifest">
188
+ <span class="manifest-summary-copy">
189
+ <span class="drydock-eyebrow">MANIFEST · CODEX</span>
190
+ <span class="manifest-subtitle">Document Manifest</span>
191
+ </span>
192
+ <span class="manifest-summary-indicator" aria-hidden="true"></span>
193
+ </summary>
194
+ <dl class="queue-dl">
195
+ <dt class="queue-dl-key">Created</dt>
196
+ <dd class="queue-dl-value queue-dl-time">
197
+ <time datetime="${Ye(a.created)}" title="${Ye(o)}">
198
+ ${Ee(o)}
199
+ <span class="queue-dl-relative">(${Ee(f)})</span>
200
+ </time>
201
+ </dd>
202
+ <dt class="queue-dl-key">Updated</dt>
203
+ <dd class="queue-dl-value queue-dl-time">
204
+ <time datetime="${Ye(a.updated)}" title="${Ye(_)}">
205
+ ${Ee(_)}
206
+ <span class="queue-dl-relative">(${Ee(c)})</span>
207
+ </time>
208
+ </dd>
209
+ <dt class="queue-dl-key">Version</dt>
210
+ <dd class="queue-dl-value queue-dl-mono">v${a.version}</dd>
211
+ <dt class="queue-dl-key">Tags</dt>
212
+ <dd class="queue-dl-value">${d}</dd>
213
+ <dt class="queue-dl-key">Source</dt>
214
+ <dd class="queue-dl-value">${S}</dd>
215
+ </dl>
216
+ ${u?`<div class="manifest-actions">${u}</div>`:""}
217
+ </details>
218
+ `}const P6="modulepreload",H6=function(e){return"/console/"+e},B1={},U6=function(n,r,a){let o=Promise.resolve();if(r&&r.length>0){let u=function(d){return Promise.all(d.map(S=>Promise.resolve(S).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const _=document.querySelector("meta[property=csp-nonce]"),c=_?.nonce||_?.getAttribute("nonce");o=u(r.map(d=>{if(d=H6(d),d in B1)return;B1[d]=!0;const S=d.endsWith(".css"),g=S?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${g}`))return;const C=document.createElement("link");if(C.rel=S?"stylesheet":P6,S||(C.as="script"),C.crossOrigin="",C.href=d,c&&C.setAttribute("nonce",c),document.head.appendChild(C),S)return new Promise((E,A)=>{C.addEventListener("load",E),C.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${d}`)))})}))}function f(_){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=_,window.dispatchEvent(c),!c.defaultPrevented)throw _}return o.then(_=>{for(const c of _||[])c.status==="rejected"&&f(c.reason);return n().catch(f)})},F6=".diagram-block[data-mermaid-source]:not([data-diagram-state='rendered']):not([data-diagram-state='error'])",q6=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),W6=/^on/i,G6={USE_PROFILES:{svg:!0,svgFilters:!1},FORBID_TAGS:["foreignObject","script"],FORBID_ATTR:["href","xlink:href"]},I1="diagramInteractionBound",K6=/^oklch\s*\(\s*([^)]+)\s*\)$/i,V6=/^(-?\d+(?:\.\d+)?)(deg)?$/i,Ri=[25,50,75,100,125,150,200],Y6=["pie1","pie2","pie3","pie4","pie5","pie6","pie7","pie8","pie9","pie10","pie11","pie12"];let tp=null,j1=!1,X6=0,Z6=0,Ul=null;function ys(e){const n=e.trim();if(!n)return n;const r=y4(n);return r?S4(r):n}function J6(e){if(j1)return;j1=!0,z1(e);const n=e instanceof Node?e:document.body;new MutationObserver(a=>{let o=!1;for(const f of a)if(f.type==="childList"){Ul&&!Ul.trigger.isConnected&&Ml(!1);for(const _ of f.addedNodes)if(_ instanceof Element&&(_.matches?.(".diagram-block[data-mermaid-source]")||_.querySelector?.(".diagram-block[data-mermaid-source]"))){o=!0;break}if(o)break}o&&z1(e)}).observe(n,{childList:!0,subtree:!0})}function z1(e){const n=e.querySelectorAll(F6);for(const r of n)r.dataset.diagramHydrating!=="true"&&(r.dataset.diagramHydrating="true",r.dataset.diagramState="pending",Q6(r))}async function Q6(e){const n=e.getAttribute("data-mermaid-source")??"";let r="";try{r=w6(n)}catch{np(e,"Invalid diagram source");return}if(!r.trim()){np(e,"Empty diagram source");return}try{const a=await t4(),o=`mermaid-diagram-${++X6}`,{svg:f}=await a.render(o,r);e.innerHTML=e4(f),r4(e,f),s4(e),a4(e),e.dataset.diagramState="rendered"}catch(a){const o=a instanceof Error?a.message:String(a);np(e,o)}}function np(e,n){e.dataset.diagramState="error",e.textContent=`Diagram render failed: ${n}`}function e4(e){const n=(r,a)=>{W6.test(a.attrName)&&(a.keepAttr=!1)};jl.addHook("uponSanitizeAttribute",n);try{return jl.sanitize(e,G6)}finally{jl.removeHook("uponSanitizeAttribute",n)}}async function t4(){return tp||(tp=(async()=>{const e=await U6(()=>import("./mermaid.core-Dpt8s_19.js").then(r=>r.bC),[]),n=e.default??e;return n.initialize({securityLevel:"strict",htmlLabels:!1,suppressErrorRendering:!0,startOnLoad:!1,theme:"base",look:"handDrawn",themeVariables:n4(),themeCSS:i4(),flowchart:{htmlLabels:!1,useMaxWidth:!1}}),n})()),tp}function n4(){const e=getComputedStyle(document.documentElement),n=(x,p)=>{const v=e.getPropertyValue(x).trim();return ys(v||p)},r=(x,p)=>e.getPropertyValue(x).trim()||p,a=n("--brass","#c69a4a"),o=n("--brass-bright","#e6b86a"),f=n("--brass-deep","#a0782a"),_=n("--aurora","#8bd7e6"),c=n("--aurora-deep","#1f8aa8"),u=n("--coral","#ef7c63"),d=n("--ink-deep","#1d2734"),S=n("--ink-fog","#a6afbb"),g=n("--ink-pearl","#e6e9ef"),C=n("--ink-spectral","#bcc4d0"),E=[o,a,_,u,ys("oklch(70% 0.11 68)"),c,ys("oklch(76% 0.09 205)"),f,ys("oklch(68% 0.14 30)"),S,ys("oklch(62% 0.08 228)"),ys("oklch(52% 0.05 248)")],A=Object.fromEntries(Y6.map((x,p)=>[x,E[p]??d]));return{background:"transparent",primaryColor:"transparent",primaryTextColor:g,primaryBorderColor:a,secondaryColor:"transparent",secondaryTextColor:g,secondaryBorderColor:o,tertiaryColor:"transparent",tertiaryTextColor:C,tertiaryBorderColor:a,lineColor:c,edgeLabelBackground:"transparent",titleColor:o,fontFamily:"JetBrains Mono Variable, ui-monospace, monospace",mainBkg:"transparent",nodeBorder:a,clusterBkg:"transparent",clusterBorder:a,pieTitleTextColor:o,pieTitleTextSize:r("--font-size-title-lg","19px"),pieSectionTextColor:g,pieSectionTextSize:r("--font-size-md","13px"),pieLegendTextColor:g,pieLegendTextSize:r("--font-size-lg","14px"),pieStrokeColor:f,pieStrokeWidth:"1.35px",pieOuterStrokeColor:o,pieOuterStrokeWidth:"2.5px",pieOpacity:"0.96",...A}}function i4(){const e=getComputedStyle(document.documentElement),n=(d,S)=>{const g=e.getPropertyValue(d).trim();return ys(g||S)},r=n("--brass-deep","#a0782a"),a=n("--brass-bright","#e6b86a"),o=n("--aurora-deep","#1f8aa8"),f=n("--ink-abyss","#131920"),_=ys("oklch(15% 0.04 250 / 34%)"),c=n("--surface-glass","#1d2734"),u=n("--ink-pearl","#e6e9ef");return`
219
+ .node rect, .node polygon, .node circle, .node ellipse, .actor, .classGroup rect {
220
+ stroke: ${r};
221
+ fill: ${c};
222
+ }
223
+ .edgePath path, .messageLine0, .messageLine1, .relation {
224
+ stroke: ${o};
225
+ }
226
+ .nodeLabel, .edgeLabel, .actor text, .messageText {
227
+ fill: ${u};
228
+ font-family: "Manrope Variable", "Manrope", ui-sans-serif, sans-serif;
229
+ }
230
+ .pieCircle {
231
+ stroke: ${r};
232
+ stroke-width: 1.35px;
233
+ opacity: 0.96;
234
+ filter: drop-shadow(0 0 1.5px ${_});
235
+ }
236
+ .pieOuterCircle {
237
+ stroke: ${a};
238
+ opacity: 0.7;
239
+ }
240
+ .slice, .legend text, .pieTitleText {
241
+ fill: ${u};
242
+ paint-order: stroke;
243
+ stroke: ${f};
244
+ stroke-width: 3px;
245
+ stroke-linejoin: round;
246
+ font-family: "Manrope Variable", "Manrope", ui-sans-serif, sans-serif;
247
+ }
248
+ .slice {
249
+ font-weight: 600;
250
+ letter-spacing: 0.04em;
251
+ font-style: italic;
252
+ }
253
+ .pieTitleText {
254
+ font-weight: 600;
255
+ letter-spacing: 0.12em;
256
+ font-style: italic;
257
+ }
258
+ .legend text {
259
+ font-weight: 500;
260
+ letter-spacing: 0.03em;
261
+ }
262
+ .legend rect {
263
+ rx: 999px;
264
+ ry: 999px;
265
+ opacity: 0.9;
266
+ stroke: ${f};
267
+ stroke-width: 1.5px;
268
+ paint-order: stroke;
269
+ filter: saturate(0.78) brightness(0.92) drop-shadow(0 0 0.55px ${a});
270
+ }
271
+ `}function r4(e,n){const r=new DOMParser().parseFromString(n,"image/svg+xml"),a=Array.from(r.querySelectorAll("a")),o=Array.from(e.querySelectorAll("a")),f=Math.min(a.length,o.length);for(let _=0;_<f;_++){const c=a[_],u=o[_];if(!c||!u)continue;const d=c.getAttribute("href")??c.getAttribute("xlink:href")??"",S=OC(d);S&&u.setAttribute("href",S)}}function s4(e){const n=e.querySelector("svg");if(!n)return;let r;try{r=n.getBBox()}catch{return}const{x:a,y:o,width:f,height:_}=r;!Number.isFinite(a)||!Number.isFinite(o)||!Number.isFinite(f)||!Number.isFinite(_)||a<0||o<0||f<=0||_<=0||n.setAttribute("viewBox",`${Qa(a)} ${Qa(o)} ${Qa(f)} ${Qa(_)}`)}function a4(e){e.tabIndex=0,e.setAttribute("aria-label","Open diagram in expanded view"),_4(e),e.dataset[I1]!=="true"&&(e.dataset[I1]="true",e.addEventListener("click",o4),e.addEventListener("keydown",l4))}function o4(e){if(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0||rh(e.target))return;const n=e.currentTarget;n instanceof HTMLElement&&(e.preventDefault(),DC(n))}function l4(e){if(e.key!=="Enter"&&e.key!==" "||rh(e.target))return;const n=e.currentTarget;n instanceof HTMLElement&&(e.preventDefault(),DC(n))}function DC(e){const n=e.querySelector("svg");if(!n)return;Ml(!1);const r=typeof HTMLDialogElement<"u"&&typeof HTMLDialogElement.prototype.showModal=="function",a=document.createElement(r?"dialog":"div"),o=++Z6,f=`diagram-lightbox-title-${o}`;a.className="diagram-lightbox",a.setAttribute("aria-labelledby",f),r||(a.setAttribute("role","dialog"),a.setAttribute("aria-modal","true"),a.tabIndex=-1);const _=document.createElement("div");_.className="diagram-lightbox__frame";const c=document.createElement("div");c.className="diagram-lightbox__header";const u=document.createElement("h2");u.id=f,u.textContent="MANIFEST · DIAGRAM";const d=document.createElement("button");d.className="diagram-lightbox__close",d.type="button",d.setAttribute("aria-label","Close expanded diagram"),d.textContent="Close";const S=document.createElement("div");S.className="diagram-lightbox__controls",S.setAttribute("aria-label","Diagram zoom controls");const g=bu("−","Zoom out","out"),C=document.createElement("span");C.className="diagram-lightbox__zoom-readout",C.setAttribute("aria-live","polite");const E=bu("+","Zoom in","in"),A=bu("Fit","Fit diagram to viewport","fit"),x=bu("Reset","Reset diagram zoom","reset");S.append(g,C,E,A,x);const p=document.createElement("div");p.className="diagram-lightbox__viewport";const v=h4(n),h=n.cloneNode(!0);h.removeAttribute("style"),f4(h,`diagram-lightbox-svg-${o}`),p.append(h),c.append(u,S,d),_.append(c,p),a.append(_),document.body.append(a);const b=new c4(p,h,C,v);g.addEventListener("click",()=>b.zoomOut()),E.addEventListener("click",()=>b.zoomIn()),A.addEventListener("click",()=>b.fit()),x.addEventListener("click",()=>b.reset());const T=p4(a),R=k=>{(k.target===a||k.target===d)&&Ml(!0)},L=k=>{if(k.key==="Escape"){k.preventDefault(),Ml(!0);return}b.handleKeyboard(k)||k.key==="Tab"&&m4(k,a)},M={dialog:a,trigger:e,inertStates:T,onClick:R,onKeyDown:L,cleanupPanZoom:()=>b.destroy()};r&&(M.onCancel=k=>{k.preventDefault(),Ml(!0)},a.addEventListener("cancel",M.onCancel),a.showModal()),a.addEventListener("click",R),document.addEventListener("keydown",L,!0),Ul=M,b.fit(),d.focus()}function bu(e,n,r){const a=document.createElement("button");return a.className="diagram-lightbox__zoom-button",a.type="button",a.dataset.zoomAction=r,a.setAttribute("aria-label",n),a.textContent=e,a}class c4{constructor(n,r,a,o){this.viewport=n,this.svg=r,this.readout=a,this.baseSize=o,this.applyZoom(this.zoomIndex),n.addEventListener("pointerdown",this.onPointerDown),n.addEventListener("pointermove",this.onPointerMove),n.addEventListener("pointerup",this.onPointerEnd),n.addEventListener("pointercancel",this.onPointerEnd),n.addEventListener("wheel",this.onWheel,{passive:!1}),n.addEventListener("dblclick",this.onDoubleClick),window.addEventListener("resize",this.onResize)}viewport;svg;readout;baseSize;zoomIndex=Ri.indexOf(100);dragStart=null;pinchStart=null;pointers=new Map;destroy(){this.viewport.removeEventListener("pointerdown",this.onPointerDown),this.viewport.removeEventListener("pointermove",this.onPointerMove),this.viewport.removeEventListener("pointerup",this.onPointerEnd),this.viewport.removeEventListener("pointercancel",this.onPointerEnd),this.viewport.removeEventListener("wheel",this.onWheel),this.viewport.removeEventListener("dblclick",this.onDoubleClick),window.removeEventListener("resize",this.onResize),this.pointers.clear()}zoomIn(){this.zoomAroundViewportCenter(Math.min(this.zoomIndex+1,Ri.length-1))}zoomOut(){this.zoomAroundViewportCenter(Math.max(this.zoomIndex-1,0))}reset(){this.zoomAroundViewportCenter(Ri.indexOf(100))}fit(){const n=this.viewport.clientWidth||this.viewport.getBoundingClientRect().width||this.baseSize.width,r=this.viewport.clientHeight||this.viewport.getBoundingClientRect().height||this.baseSize.height,a=Math.min(n/this.baseSize.width,r/this.baseSize.height),o=Math.floor(a*100),f=Ri.findIndex(c=>c>o),_=f===-1?Ri.length-1:Math.max(0,f-1);this.applyZoom(_),this.viewport.scrollLeft=Math.max(0,(this.svgWidth-n)/2),this.viewport.scrollTop=Math.max(0,(this.svgHeight-r)/2)}handleKeyboard(n){return n.key==="+"||n.key==="="?(n.preventDefault(),this.zoomIn(),!0):n.key==="-"||n.key==="_"?(n.preventDefault(),this.zoomOut(),!0):n.key==="0"?(n.preventDefault(),this.reset(),!0):n.key.toLowerCase()==="f"?(n.preventDefault(),this.fit(),!0):!1}get svgWidth(){return this.baseSize.width*(yu(this.zoomIndex)/100)}get svgHeight(){return this.baseSize.height*(yu(this.zoomIndex)/100)}applyZoom(n){this.zoomIndex=n;const r=yu(this.zoomIndex),a=r/100;this.svg.setAttribute("width",Qa(this.baseSize.width*a)),this.svg.setAttribute("height",Qa(this.baseSize.height*a)),this.readout.textContent=`${r}%`}zoomAroundViewportCenter(n){const r=this.viewport.getBoundingClientRect();this.zoomAroundPoint(n,r.left+r.width/2,r.top+r.height/2)}zoomAroundPoint(n,r,a){if(n===this.zoomIndex)return;const o=this.svgWidth,f=this.svgHeight,_=this.viewport.getBoundingClientRect(),c=this.viewport.scrollLeft+r-_.left,u=this.viewport.scrollTop+a-_.top;this.applyZoom(n),this.viewport.scrollLeft=c/o*this.svgWidth-(r-_.left),this.viewport.scrollTop=u/f*this.svgHeight-(a-_.top)}onPointerDown=n=>{if(n.button!==0||rh(n.target))return;const r=n.pointerId??1;if(this.pointers.set(r,n),this.pointers.size===2){this.pinchStart={distance:this.pointerDistance(),zoomIndex:this.zoomIndex};return}this.dragStart={x:n.clientX,y:n.clientY,scrollLeft:this.viewport.scrollLeft,scrollTop:this.viewport.scrollTop,pointerId:r},this.viewport.setPointerCapture?.(r)};onPointerMove=n=>{const r=n.pointerId??1;if(this.pointers.has(r)&&this.pointers.set(r,n),this.pinchStart&&this.pointers.size>=2){const a=this.pointerDistance()/this.pinchStart.distance,o=yu(this.pinchStart.zoomIndex)*a;this.applyZoom(d4(o));return}!this.dragStart||this.dragStart.pointerId!==r||(n.preventDefault(),this.viewport.scrollLeft=this.dragStart.scrollLeft-(n.clientX-this.dragStart.x),this.viewport.scrollTop=this.dragStart.scrollTop-(n.clientY-this.dragStart.y))};onPointerEnd=n=>{const r=n.pointerId??1;this.pointers.delete(r),this.viewport.releasePointerCapture?.(r),this.dragStart?.pointerId===r&&(this.dragStart=null),this.pointers.size<2&&(this.pinchStart=null)};onWheel=n=>{if(!n.ctrlKey&&!n.metaKey)return;n.preventDefault();const r=n.deltaY<0?Math.min(this.zoomIndex+1,Ri.length-1):Math.max(this.zoomIndex-1,0);this.zoomAroundPoint(r,n.clientX,n.clientY)};onDoubleClick=n=>{rh(n.target)||(n.preventDefault(),this.zoomAroundPoint(this.zoomIndex===Ri.indexOf(200)?Ri.indexOf(100):Ri.indexOf(200),n.clientX,n.clientY))};onResize=()=>{this.fit()};pointerDistance(){const[n,r]=Array.from(this.pointers.values());return!n||!r?1:Math.hypot(r.clientX-n.clientX,r.clientY-n.clientY)}}function u4(e){const n=$1(e.getAttribute("width")),r=$1(e.getAttribute("height"));if(n&&r)return{width:n,height:r};const a=e.getAttribute("viewBox")?.trim().split(/[\s,]+/).map(Number)??[],o=a[2],f=a[3],_=o!==void 0&&Number.isFinite(o)&&o>0?o:null,c=f!==void 0&&Number.isFinite(f)&&f>0?f:null;return{width:n??_??800,height:r??c??600}}function h4(e){const n=e.getBoundingClientRect();return n.width>0&&n.height>0?{width:n.width,height:n.height}:u4(e)}function $1(e){if(!e)return null;const n=/^(\d+(?:\.\d+)?)/.exec(e.trim());if(!n)return null;const r=Number(n[1]);return Number.isFinite(r)&&r>0?r:null}function Qa(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/\.?0+$/,"")}function d4(e){let n=0,r=Number.POSITIVE_INFINITY;return Ri.forEach((a,o)=>{const f=Math.abs(a-e);f<r&&(r=f,n=o)}),n}function yu(e){return Ri[e]??Ri[0]}function f4(e,n){const r=e.getAttribute("id")??"";e.setAttribute("id",n);const a=e.querySelector("style");!r||!a?.textContent||(a.textContent=a.textContent.split(`#${r}`).join(`#${n}`))}function Ml(e){const n=Ul;n&&(n.dialog.removeEventListener("click",n.onClick),document.removeEventListener("keydown",n.onKeyDown,!0),n.onCancel&&n.dialog.removeEventListener("cancel",n.onCancel),n.cleanupPanZoom(),g4(n.inertStates),n.dialog instanceof HTMLDialogElement&&n.dialog.open&&typeof n.dialog.close=="function"&&n.dialog.close(),n.dialog.remove(),Ul=null,e&&n.trigger.isConnected&&n.trigger.focus())}function p4(e){const n=[];for(const r of Array.from(document.body.children))!(r instanceof HTMLElement)||r===e||(n.push({element:r,ariaHidden:r.getAttribute("aria-hidden"),inert:r.inert}),r.inert=!0,r.setAttribute("aria-hidden","true"));return n}function g4(e){for(const n of e)n.element.inert=n.inert,n.ariaHidden===null?n.element.removeAttribute("aria-hidden"):n.element.setAttribute("aria-hidden",n.ariaHidden)}function m4(e,n){const r=Array.from(n.querySelectorAll(q6)).filter(b4);if(r.length===0){e.preventDefault(),n.focus();return}const a=r[0],o=r[r.length-1];!a||!o||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),a.focus()))}function _4(e){e.querySelector("a[href]")?e.removeAttribute("role"):e.setAttribute("role","button")}function rh(e){if(!(e instanceof Element))return!1;const n=e.closest("a[href]");return!n||!(n.getAttribute("href")?.trim()??"")?!1:!v4(n)}function v4(e){return Array.from(e.children).some(n=>n.tagName.toLowerCase()==="svg")}function b4(e){return!(e.inert||e.hidden||e.getAttribute("aria-hidden")==="true"||"disabled"in e&&e.disabled)}function OC(e){const n=e.trim();if(!n||n.includes(".."))return null;if(/^[a-z][a-z0-9+.-]*:/i.test(n)){if(/^javascript:/i.test(n)||/^data:/i.test(n))return null;let a;try{a=new URL(n)}catch{return null}return a.origin!==window.location.origin?null:OC(a.pathname)}if(/^\/entry\/[^/?#]+$/.exec(n)){const a=n.slice(7);let o;try{o=decodeURIComponent(a)}catch{return null}return/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(o)?`/entry/${encodeURIComponent(o)}`:null}return/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(n)?`/entry/${encodeURIComponent(n)}`:null}function y4(e){const n=K6.exec(e);if(!n)return null;const r=n[1]?.trim();if(!r)return null;const a=r.indexOf("/"),o=a>=0?r.slice(0,a):r,f=a>=0?r.slice(a+1).trim():"",_=o.trim().split(/[\s,]+/).filter(Boolean);if(_.length!==3)return null;const[c,u,d]=_;if(!c||!u||!d)return null;const S=ip(c,1),g=ip(u,.4),C=w4(d);if(S===null||g===null||C===null)return null;let E=1;if(a>=0){const A=ip(f,1);if(A===null)return null;E=A}return{L:S,C:g,h:C,alpha:E}}function S4(e){const n=e.h*Math.PI/180,r=e.C*Math.cos(n),a=e.C*Math.sin(n),o=e.L,f=o+.3963377774*r+.2158037573*a,_=o-.1055613458*r-.0638541728*a,c=o-.0894841775*r-1.291485548*a,u=f**3,d=_**3,S=c**3,g=4.0767416621*u-3.3077115913*d+.2309699292*S,C=-1.2684380046*u+2.6097574011*d-.3413193965*S,E=-.0041960863*u-.7034186147*d+1.707614701*S,A=Su(rp(g)),x=Su(rp(C)),p=Su(rp(E));if(e.alpha<1){const v=Su(e.alpha);return`#${Ks(A)}${Ks(x)}${Ks(p)}${Ks(v)}`}return`#${Ks(A)}${Ks(x)}${Ks(p)}`}function ip(e,n){if(!e)return null;if(e.endsWith("%")){const a=Number(e.slice(0,-1));return Number.isFinite(a)?a/100*n:null}const r=Number(e);return Number.isFinite(r)?r:null}function w4(e){const n=V6.exec(e);if(!n)return null;const r=Number(n[1]);return Number.isFinite(r)?r:null}function rp(e){const n=Math.max(0,Math.min(1,e));return n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n}function Su(e){return Math.round(Math.max(0,Math.min(1,e))*255)}function Ks(e){return e.toString(16).padStart(2,"0")}function C4(e,n){const r=x4(e,n);return`
272
+ <nav class="breadcrumb" aria-label="Entry location">
273
+ <ol>
274
+ ${r.map((a,o)=>`
275
+ <li>
276
+ ${a.href?`<a href="${Ye(a.href)}">${Ee(a.label)}</a>`:`<span aria-current="${o===r.length-1?"page":"false"}">${Ee(a.label)}</span>`}
277
+ </li>
278
+ `).join("")}
279
+ </ol>
280
+ </nav>
281
+ `}function x4(e,n){const r=n.find(f=>f.id===e.frontmatter.id),a=e.frontmatter.tags[0]??r?.tags[0]??null,o=[{label:"Codex",href:rm()},{label:"Index",href:Kw()}];return a&&o.push({label:a}),o.push({label:e.frontmatter.title}),o}function E4(e){const n=e.tags.map(a=>`<span class="chip chip-tag">${Ee(a)}</span>`).join(""),r=A4(e);return`
282
+ <div class="meta-chips">
283
+ ${n}
284
+ ${r}
285
+ <span class="chip">Updated ${Ee(T4(e.updated))}</span>
286
+ </div>
287
+ `}function NC(e){return e.map(n=>`<span class="chip chip-muted">${Ee(n)}</span>`).join("")}function T4(e){const n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function A4(e){const n=k4(e);return n?`<span class="chip ${n.tone==="deprecated"?"chip-coral":n.tone==="stale"?"chip-stale":""}" title="${Ye(n.title)}">${Ee(n.label)}</span>`:""}function k4(e,n=new Date){const r=e.status,a=typeof e.revalidateAfter=="string"&&!Number.isNaN(Date.parse(e.revalidateAfter))&&Date.parse(e.revalidateAfter)<n.getTime();return r==="deprecated"||r==="superseded"?{label:r,tone:"deprecated",title:a?`${r} · stale`:r}:a?{label:"stale",tone:"stale",title:e.revalidateAfter??"stale"}:r==="current"||r==="draft"?{label:r,tone:"neutral",title:r}:null}function R4(e,n,r){const a=L4(e,n,r);return a.length===0?"":`
288
+ <section class="related-list">
289
+ <h2>Related entries</h2>
290
+ <div class="related-items">
291
+ ${a.map(o=>`
292
+ <a class="related-card" href="${Ur(o.entry.id)}" data-entry-id="${Ye(o.entry.id)}">
293
+ <strong>${Ee(o.entry.title)}</strong>
294
+ <span>${NC(o.matchingTags)}</span>
295
+ </a>
296
+ `).join("")}
297
+ </div>
298
+ </section>
299
+ `}function L4(e,n,r){const a=new Set(n),o="en-US";return r.filter(f=>f.id!==e).map(f=>({entry:f,matchingTags:f.tags.filter(_=>a.has(_))})).filter(f=>f.matchingTags.length>0).sort((f,_)=>_.matchingTags.length-f.matchingTags.length||f.entry.title.localeCompare(_.entry.title,o,{sensitivity:"base",numeric:!0})).slice(0,5)}const M4=`
300
+ <svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
301
+ <path d="M6 6 18 18M18 6 6 18" />
302
+ </svg>
303
+ `,D4=`
304
+ <svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
305
+ <path d="M8 6h12M8 12h12M8 18h12" />
306
+ <path d="M4 6h.01M4 12h.01M4 18h.01" />
307
+ </svg>
308
+ `;function O4(e){return e.length===0?"":`
309
+ <button class="toc-drawer-trigger" type="button" data-action="open-toc-drawer" aria-haspopup="dialog" aria-controls="toc-drawer">
310
+ ${D4}
311
+ <span>Contents</span>
312
+ </button>
313
+ `}function N4(e){return e.length===0?"":`
314
+ <div class="toc-drawer" id="toc-drawer" role="dialog" aria-modal="true" aria-labelledby="toc-drawer-title" hidden>
315
+ <button class="toc-drawer-backdrop" type="button" data-action="close-toc-drawer" aria-label="Close contents"></button>
316
+ <section class="toc-drawer-panel">
317
+ <header class="toc-drawer-header">
318
+ <div>
319
+ <p class="drydock-eyebrow">Reading Position</p>
320
+ <h2 id="toc-drawer-title">Contents</h2>
321
+ </div>
322
+ <button class="icon-button" type="button" data-action="close-toc-drawer" aria-label="Close contents">${M4}</button>
323
+ </header>
324
+ <nav class="toc-drawer-nav" aria-label="Document contents">
325
+ ${e.map(n=>`
326
+ <a class="toc-drawer-link toc-level-${n.level}" href="#${Ye(n.id)}" data-toc-id="${Ye(n.id)}">
327
+ ${Ee(n.text)}
328
+ </a>
329
+ `).join("")}
330
+ </nav>
331
+ </section>
332
+ </div>
333
+ `}const B4=`
334
+ <svg class="arrow" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" width="16" height="16">
335
+ <path d="M5 12h14M13 6l6 6-6 6" />
336
+ </svg>
337
+ `;function I4(e,n,r=!0){const a=e.length,o=e.slice(0,6),f=e[0]??null;return`
338
+ <article class="document welcome">
339
+ <header class="welcome-title">
340
+ <p class="eyebrow">Fleet · Codex</p>
341
+ <h1>The <em>Codex</em></h1>
342
+ </header>
343
+ <div class="welcome-divider"></div>
344
+ <p class="lead">Navigate your workspace Fleet Wiki. Browse entries by tag from the left compass, or jump instantly with the <kbd>⌘K</kbd> command palette.</p>
345
+ ${r?"":'<p class="error-box">No workspace is registered in this daemon. Re-run <code>fleet-wiki</code> in the target directory.</p>'}
346
+ <div class="workspace-meta">
347
+ <span class="chip chip-aurora">${a} entries</span>
348
+ ${n?`<span class="workspace-path">${Ee(n)}</span>`:""}
349
+ </div>
350
+ ${f?`
351
+ <a class="primary-link" href="${Ye(Ur(f.id))}" data-entry-id="${Ye(f.id)}">
352
+ <span>Open first entry — ${Ee(f.title)}</span>
353
+ ${B4}
354
+ </a>
355
+ `:'<p class="empty-state">No wiki entries yet. Add entries with <code>wiki_ingest</code>.</p>'}
356
+ ${o.length>0?`
357
+ <div class="welcome-grid">
358
+ ${o.map(_=>`
359
+ <a class="welcome-card" href="${Ye(Ur(_.id))}" data-entry-id="${Ye(_.id)}">
360
+ <strong>${Ee(_.title)}</strong>
361
+ <span class="welcome-card-tags">${NC(_.tags.slice(0,3))}</span>
362
+ </a>
363
+ `).join("")}
364
+ </div>
365
+ `:""}
366
+ </article>
367
+ `}function j4(e,n){const r=yo(e.body,{omitDuplicateTitle:e.frontmatter.title});return{toc:r.toc,html:`
368
+ <article class="document">
369
+ <header class="document-header">
370
+ ${C4(e,n)}
371
+ <p class="eyebrow">Current Entry</p>
372
+ <h1>${Ee(e.frontmatter.title)}</h1>
373
+ ${E4(e.frontmatter)}
374
+ ${O4(r.toc)}
375
+ </header>
376
+ <div class="markdown-body" id="markdown-body">
377
+ ${r.html}
378
+ </div>
379
+ ${R4(e.frontmatter.id,e.frontmatter.tags,n)}
380
+ ${N4(r.toc)}
381
+ </article>
382
+ `}}function z4(){return`
383
+ <article class="document">
384
+ <p class="loading">Loading entry</p>
385
+ </article>
386
+ `}function $4(e){return`
387
+ <article class="document">
388
+ <p class="error-box">${Ee(e)}</p>
389
+ </article>
390
+ `}const ju=new Set;let Nr="entries";const P4=`
391
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
392
+ <circle cx="11" cy="11" r="6.5" />
393
+ <path d="m20 20-3.5-3.5" />
394
+ </svg>
395
+ `,H4=`
396
+ <svg class="caret" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
397
+ <path d="m6 9 6 6 6-6" />
398
+ </svg>
399
+ `,U4=`
400
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" width="14" height="14">
401
+ <path d="M6 6 18 18M18 6 6 18" />
402
+ </svg>
403
+ `,F4=`
404
+ <svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
405
+ <circle cx="12" cy="5" r="2" />
406
+ <path d="M12 7v14M8 11H4a8 8 0 0 0 16 0h-4" />
407
+ </svg>
408
+ `;function q4(e,n,r,a=[],o=null,f){const _=e.length,c=K4(e),u=_===0?'<p class="empty-state">No wiki entries yet.</p>':Nr==="tags"?V4(e,n):Y4(e,n),d=Nr==="tags"?`Tags · ${c}`:`Entries · ${_}`,S=Nr==="tags"?"tag-tree":"entry-list",g=Nr==="tags"?"Entries by tag":"All entries",C=J4(f??(typeof window<"u"?window.location.pathname:"")),E=C.startsWith("/queue"),A=C==="/index",x=C==="/log",p=C.startsWith("/conflicts"),v=r>0?`<span class="nav-drydock-badge">${r}</span>`:"";return`
409
+ <aside class="sidebar" id="sidebar">
410
+ <div class="sidebar-header">
411
+ <div class="sidebar-header-actions">
412
+ <button class="icon-button mobile-close" type="button" data-action="toggle-nav" aria-label="Close">${U4}</button>
413
+ </div>
414
+ </div>
415
+ <button class="command-entry" type="button" data-action="open-command">
416
+ <span class="command-entry-label">${P4}<span>Search entries</span></span>
417
+ <kbd>⌘K</kbd>
418
+ </button>
419
+ <div class="nav-drydock-section">
420
+ <a class="nav-drydock-link${E?" active":""}" href="${Ye(fo())}">
421
+ <span class="nav-drydock-icon">${F4}</span>
422
+ <span class="nav-drydock-label">Drydock</span>
423
+ ${v}
424
+ </a>
425
+ <a class="nav-drydock-link${A?" active":""}" href="${Ye(Kw())}">
426
+ <span class="nav-drydock-label">Index</span>
427
+ </a>
428
+ <a class="nav-drydock-link${x?" active":""}" href="${Ye(Vw())}">
429
+ <span class="nav-drydock-label">Log</span>
430
+ </a>
431
+ <a class="nav-drydock-link${p?" active":""}" href="${Ye(xL())}">
432
+ <span class="nav-drydock-label">Conflicts</span>
433
+ </a>
434
+ </div>
435
+ <div class="nav-tabs" role="tablist" aria-label="Navigation mode">
436
+ <button class="nav-tab${Nr==="entries"?" active":""}" type="button" role="tab" aria-selected="${Nr==="entries"}" data-action="set-nav-mode" data-mode="entries">
437
+ Entries
438
+ </button>
439
+ <button class="nav-tab${Nr==="tags"?" active":""}" type="button" role="tab" aria-selected="${Nr==="tags"}" data-action="set-nav-mode" data-mode="tags">
440
+ Tags
441
+ </button>
442
+ </div>
443
+ <p class="nav-section-label">${d}</p>
444
+ <nav class="${S}" aria-label="${g}">
445
+ ${u}
446
+ </nav>
447
+ </aside>
448
+ `}function W4(e){if(ju.has(e)){ju.delete(e);return}ju.add(e)}function G4(e){Nr=e}function K4(e){const n=new Set;for(const r of e){if(r.tags.length===0){n.add("untagged");continue}for(const a of r.tags)n.add(a)}return n.size}function V4(e,n){return X4(e).map(a=>Z4(a,n)).join("")}function Y4(e,n){const r="en-US";return[...e].sort((o,f)=>o.title.localeCompare(f.title,r,{sensitivity:"base",numeric:!0})).map(o=>BC(o,n)).join("")}function X4(e){const n="en-US",r=new Map;for(const a of e){const o=a.tags.length>0?a.tags:["untagged"];for(const f of o){const _=r.get(f)??[];_.push(a),r.set(f,_)}}return[...r.entries()].map(([a,o])=>({tag:a,entries:o.sort((f,_)=>f.title.localeCompare(_.title,n,{sensitivity:"base",numeric:!0}))})).sort((a,o)=>a.tag.localeCompare(o.tag,n,{sensitivity:"base",numeric:!0}))}function Z4(e,n){const r=ju.has(e.tag),a=r?"":e.entries.map(o=>BC(o,n)).join("");return`
449
+ <section class="tag-group" data-collapsed="${r?"true":"false"}">
450
+ <button class="tag-group-button" type="button" data-action="toggle-tag" data-tag="${Ye(e.tag)}">
451
+ ${H4}
452
+ <span>${e.tag==="untagged"?"Untagged":Ee(e.tag)}</span>
453
+ <span class="count">${e.entries.length}</span>
454
+ </button>
455
+ <div class="tag-group-list">${a}</div>
456
+ </section>
457
+ `}function BC(e,n){const r=e.id===n?" active":"",a=Ye(e.title);return`
458
+ <a class="nav-entry${r}" href="${Ur(e.id)}" data-entry-id="${Ye(e.id)}" title="${a}">
459
+ <span class="nav-entry-text">${Ee(e.title)}</span>
460
+ </a>
461
+ `}function J4(e){const n=e===Fi||e===`${Fi}/`?"/":e.startsWith(`${Fi}/`)?e.slice(Fi.length)||"/":e,r=n.match(/^\/w\/[^/]+(\/.*)?$/);return r?r[1]??"/":n}const Q4=`
462
+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
463
+ <path d="M15 18 9 12l6-6" />
464
+ </svg>
465
+ `,eD=`
466
+ <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
467
+ <path d="M5 4h11a3 3 0 0 1 3 3v9.5a3.5 3.5 0 0 1-3.5 3.5H8a3 3 0 0 1-3-3V4z" />
468
+ <path d="M9 9h6M9 13h6" />
469
+ </svg>
470
+ `;function tD(e){const n=e.ref??"";let r;return e.loading?r='<p class="loading">Loading source</p>':e.error?r=`<p class="error-box">Failed to load source — ${Ee(e.error)}</p>`:e.content?r=`<div class="markdown-body">${yo(e.content).html}</div>`:r='<p class="empty-state">Source is empty.</p>',`
471
+ <div class="raw-shell">
472
+ <header class="raw-header">
473
+ <a class="raw-back" href="/" data-action="navigate-home" aria-label="Back to Codex">
474
+ ${Q4}
475
+ <span>Codex</span>
476
+ </a>
477
+ <div class="raw-meta">
478
+ <span class="raw-glyph">${eD}</span>
479
+ <div class="raw-meta-text">
480
+ <p class="eyebrow">Manifest · Raw Source</p>
481
+ <h1 class="raw-title">${Ee(n)}</h1>
482
+ </div>
483
+ </div>
484
+ <div class="raw-divider"></div>
485
+ </header>
486
+ <article class="raw-document">
487
+ ${r}
488
+ </article>
489
+ </div>
490
+ `}function vm(e,n){const r=e==="create_wiki"||!n,a=r?"+":"↻",o=r?"CREATE":"UPDATE";return`<span class="op-badge ${r?"op-badge--create":"op-badge--update"}" aria-label="${o}">
491
+ <span class="op-badge-glyph" aria-hidden="true">${a}</span>
492
+ <span class="op-badge-label">${o}</span>
493
+ </span>`}function nD(e){const{tab:n,items:r,pendingCount:a,archivedCount:o,loading:f,error:_}=e;if(f&&r.length===0)return'<div class="queue-view"><p class="loading">Loading patch queue</p></div>';if(_)return`<div class="queue-view"><p class="error-box">Failed to load queue — ${Ee(_)}</p></div>`;const c=r.length===0?iD(n):r.map(S=>rD(S)).join(""),u=a>0?`<span class="queue-badge">${a}</span>`:"",d=o>0?`<span class="queue-badge queue-badge--muted">${o}</span>`:"";return`
494
+ <div class="queue-view">
495
+ <div class="queue-header">
496
+ <p class="drydock-eyebrow">MANIFEST · DRYDOCK</p>
497
+ <h1 class="queue-title">Patch Queue</h1>
498
+ </div>
499
+ <div class="queue-tabs" role="tablist" aria-label="Queue tabs">
500
+ <a class="queue-tab${n==="pending"?" active":""}"
501
+ href="${Ye(fo("pending"))}"
502
+ role="tab"
503
+ aria-selected="${n==="pending"}">
504
+ Pending${u}
505
+ </a>
506
+ <a class="queue-tab${n==="archived"?" active":""}"
507
+ href="${Ye(fo("archived"))}"
508
+ role="tab"
509
+ aria-selected="${n==="archived"}">
510
+ Archived${d}
511
+ </a>
512
+ </div>
513
+ <div class="queue-list">
514
+ ${c}
515
+ </div>
516
+ </div>
517
+ `}function iD(e){return`<p class="queue-empty">${e==="pending"?"No pending patches.":"No archived patches."}</p>`}function rD(e){const{id:n,meta:r,source:a,summary:o,op:f,target:_}=e,c=sD(r.status),u=ih(r.createdAt),d=r.warnings??[],S=d.slice(0,3).map(p=>`<span class="chip chip-muted">${Ee(p)}</span>`).join(""),g=d.length>3?`<span class="chip chip-muted">+${d.length-3}</span>`:"",C=a==="archive"?`<span class="chip">${Ee(r.status)}</span>`:"",E=f?vm(f,!0):"",A=o?`<p class="queue-card-summary">${Ee(o)}</p>`:"",x=_?`<span class="queue-card-target">${Ee(_)}</span>`:"";return`
518
+ <a class="queue-card" href="${Ye(CL(n))}">
519
+ ${A}
520
+ <div class="queue-card-top">
521
+ <span class="queue-card-id">${Ee(n)}</span>
522
+ ${c}
523
+ </div>
524
+ <div class="queue-card-meta">
525
+ ${E}
526
+ ${x}
527
+ <span class="queue-card-time">${Ee(u)}</span>
528
+ ${C}
529
+ <div class="queue-card-chips">
530
+ ${S}${g}
531
+ </div>
532
+ </div>
533
+ </a>
534
+ `}function sD(e){return`<span class="status-dot ${e==="pending"?"status-dot--pending":e==="accepted"?"status-dot--accepted":"status-dot--rejected"}" aria-label="${Ye(e)}"></span>`}const aD=`
535
+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
536
+ <path d="M15 18 9 12l6-6" />
537
+ </svg>
538
+ `,oD=`
539
+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
540
+ <path d="M7 17 17 7M9 7h8v8" />
541
+ </svg>
542
+ `;function lD(e){const{current:n,loading:r,error:a}=e;return r?'<div class="queue-detail-view"><p class="loading">Loading patch</p></div>':a?`<div class="queue-detail-view"><p class="error-box">Failed to load patch — ${Ee(a)}</p></div>`:n?cD(n,e):'<div class="queue-detail-view"><p class="empty-state">Patch not found.</p></div>'}function cD(e,n){const{patch:r,meta:a,wikiEntry:o,targetExists:f}=e,{frontmatter:_}=r,c=yo(o.body),u=vm(_.op,f),d=a.rawSourceRef;return`
543
+ <div class="queue-detail-view">
544
+ <div class="queue-detail-layout">
545
+ <div class="queue-detail-main">
546
+ <a class="raw-back queue-back" href="${Ye(fo())}" aria-label="Back to Drydock">
547
+ ${aD}
548
+ <span>Drydock</span>
549
+ </a>
550
+ <div class="queue-detail-header">
551
+ <p class="drydock-eyebrow">MANIFEST · PATCH</p>
552
+ <p class="queue-patch-id">${Ee(a.id)}</p>
553
+ <h1 class="queue-summary">${Ee(_.summary)}</h1>
554
+ ${u}
555
+ </div>
556
+ <article class="document">
557
+ <div class="markdown-body" id="markdown-body">${c.html}</div>
558
+ </article>
559
+ </div>
560
+ <aside class="queue-rail">
561
+ ${uD(e,d)}
562
+ ${fD(c.toc)}
563
+ ${dD(e)}
564
+ ${hD(e,n)}
565
+ </aside>
566
+ </div>
567
+ </div>
568
+ `}function uD(e,n){const{patch:r,meta:a,targetExists:o}=e,{frontmatter:f}=r,_=vm(f.op,o),c=lg(a.createdAt),u=ih(a.createdAt),d=pD(a.status),S=a.warnings??[],g=n?`<dd class="queue-dl-value">
569
+ <a class="manifest-link queue-raw-link" href="${Ye(Gw(n))}" data-raw-ref="${Ye(n)}">
570
+ <span class="manifest-ref">${Ee(n)}</span>
571
+ <span class="manifest-arrow">${oD}</span>
572
+ </a>
573
+ </dd>`:'<dd class="queue-dl-value queue-dl-muted">None</dd>',C=S.length>0?`<dt class="queue-dl-key">Warnings</dt>
574
+ <dd class="queue-dl-value">
575
+ <div class="queue-card-chips">
576
+ ${S.map(E=>`<span class="chip chip-muted">${Ee(E)}</span>`).join("")}
577
+ </div>
578
+ </dd>`:"";return`
579
+ <div class="queue-rail-card">
580
+ <div class="queue-rail-header">
581
+ <p class="drydock-eyebrow">MANIFEST · PATCH</p>
582
+ <p class="queue-rail-subtitle">Patch Manifest</p>
583
+ </div>
584
+ <dl class="queue-dl">
585
+ <dt class="queue-dl-key">OP</dt>
586
+ <dd class="queue-dl-value">${_}</dd>
587
+ <dt class="queue-dl-key">Target</dt>
588
+ <dd class="queue-dl-value queue-dl-mono">${Ee(f.target)}</dd>
589
+ <dt class="queue-dl-key">Proposer</dt>
590
+ <dd class="queue-dl-value">${Ee(f.proposer)}</dd>
591
+ <dt class="queue-dl-key">Created</dt>
592
+ <dd class="queue-dl-value queue-dl-time">
593
+ <time datetime="${Ye(a.createdAt)}" title="${Ye(c)}">
594
+ ${Ee(c)}
595
+ <span class="queue-dl-relative">(${Ee(u)})</span>
596
+ </time>
597
+ </dd>
598
+ <dt class="queue-dl-key">Status</dt>
599
+ <dd class="queue-dl-value queue-dl-status">${d}<span>${Ee(a.status)}</span></dd>
600
+ <dt class="queue-dl-key">Source</dt>
601
+ ${g}
602
+ ${C}
603
+ </dl>
604
+ </div>
605
+ `}function hD(e,n){const{meta:r,source:a}=e;if(r.status!=="pending"||a!=="queue")return"";const{actionPending:o,actionError:f}=n,_=o?" disabled":"",c=Ye(r.id),u=f?`<p class="queue-action-error">${Ee(f)}</p>`:"";return`
606
+ <div class="queue-rail-card queue-actions-card">
607
+ <div class="queue-rail-header">
608
+ <p class="drydock-eyebrow">ACTIONS</p>
609
+ <p class="queue-rail-subtitle">Decision</p>
610
+ </div>
611
+ ${o?'<span class="queue-action-spinner" aria-label="Processing"></span>':""}
612
+ <div class="queue-action-buttons">
613
+ <button class="queue-action-btn queue-action-btn--approve" type="button"
614
+ data-action="queue-approve" data-patch-id="${c}"${_}
615
+ aria-label="Approve this patch">
616
+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true"><path d="M5 12h14M12 5l7 7-7 7"/></svg>
617
+ Approve
618
+ </button>
619
+ <button class="queue-action-btn queue-action-btn--reject" type="button"
620
+ data-action="queue-reject-toggle"${_}
621
+ aria-label="Reject this patch">
622
+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"/></svg>
623
+ Reject
624
+ </button>
625
+ </div>
626
+ <form class="queue-reject-form" hidden data-action="queue-reject-submit" data-patch-id="${c}">
627
+ <textarea class="queue-reject-textarea" name="reason" minlength="1" maxlength="256" required placeholder="Enter rejection reason (max 256 chars)"></textarea>
628
+ <div class="queue-action-buttons">
629
+ <button class="queue-action-btn queue-action-btn--reject-submit" type="submit"${_}>Confirm</button>
630
+ <button class="queue-action-btn queue-action-btn--cancel" type="button" data-action="queue-reject-cancel"${_}>Cancel</button>
631
+ </div>
632
+ </form>
633
+ ${u}
634
+ </div>
635
+ `}function dD(e){const n=e.patchSet;return!n||n.members.length===0?"":`
636
+ <div class="queue-rail-card">
637
+ <div class="queue-rail-header">
638
+ <p class="drydock-eyebrow">MANIFEST · DRYDOCK</p>
639
+ <p class="queue-rail-subtitle">Patch Set</p>
640
+ </div>
641
+ <p class="queue-patch-id">${Ee(n.id)}</p>
642
+ <ul class="patch-set-list">
643
+ ${n.members.map(r=>`
644
+ <li class="patch-set-item">
645
+ <span class="patch-set-item-copy">
646
+ <strong>${Ee(r.summary??r.id)}</strong>
647
+ <small>${Ee(r.target??r.id)}</small>
648
+ </span>
649
+ <span class="chip ${r.status==="rejected"?"chip-coral":""}">${Ee(r.status??r.source)}</span>
650
+ </li>
651
+ `).join("")}
652
+ </ul>
653
+ </div>
654
+ `}function fD(e){return e.length===0?"":`
655
+ <div class="queue-rail-card queue-toc-card">
656
+ <div class="queue-rail-header">
657
+ <p class="drydock-eyebrow">CONTENTS</p>
658
+ </div>
659
+ <nav class="queue-toc-nav" aria-label="Table of contents">
660
+ ${e.map(r=>`<a class="queue-toc-link queue-toc-level-${r.level}" href="#${Ye(r.id)}">${Ee(r.text)}</a>`).join("")}
661
+ </nav>
662
+ </div>
663
+ `}function pD(e){return`<span class="status-dot ${e==="pending"?"status-dot--pending":e==="accepted"?"status-dot--accepted":"status-dot--rejected"}" aria-label="${Ye(e)}"></span>`}const gD="active",mD=".toc-panel a[data-toc-id], .toc-drawer-link[data-toc-id]";function _D(e){return e.length===0?"":`
664
+ <nav class="toc-panel" aria-label="Table of contents">
665
+ <h2>Contents</h2>
666
+ ${e.map(n=>`
667
+ <a class="toc-level-${n.level}" href="#${Ye(n.id)}" data-toc-id="${Ye(n.id)}">
668
+ ${Ee(n.text)}
669
+ </a>
670
+ `).join("")}
671
+ </nav>
672
+ `}function vD(e,n){if(n.length===0||typeof IntersectionObserver>"u")return()=>{};const r=[...e.querySelectorAll(mD)],a=new Set(n.map(u=>u.id)),o=[...e.querySelectorAll("#markdown-body h2[id], #markdown-body h3[id]")].filter(u=>a.has(u.id));if(r.length===0||o.length===0)return()=>{};const f=e instanceof HTMLElement?e.closest(".codex-host"):null,_=new Set,c=new IntersectionObserver(u=>{for(const S of u){const g=S.target instanceof HTMLElement?S.target.id:"";g&&(S.isIntersecting?_.add(g):_.delete(g))}const d=bD(o,_)??yD(o,f)??o[0]?.id??null;P1(r,d)},{root:f,rootMargin:"-20% 0px -65% 0px",threshold:[0,.2,.6,1]});for(const u of o)c.observe(u);return P1(r,o[0]?.id??null),()=>c.disconnect()}function bD(e,n){for(const r of e)if(n.has(r.id))return r.id;return null}function yD(e,n){const r=n?n.getBoundingClientRect().top:0;let a=null;for(const o of e)if(o.getBoundingClientRect().top-r<=80)a=o.id;else break;return a}function P1(e,n){for(const r of e){const a=!!(n&&r.dataset.tocId===n);r.classList.toggle(gD,a),a?r.setAttribute("aria-current","location"):r.removeAttribute("aria-current")}}function SD(e){const n=e.entries.join(`
673
+
674
+ `),r=yo(n);return`
675
+ <article class="document">
676
+ <header class="document-header">
677
+ <p class="eyebrow">MANIFEST · DRYDOCK</p>
678
+ <h1>Log</h1>
679
+ <div class="log-controls">
680
+ ${[10,20,50,100].map(o=>`
681
+ <a class="chip ${o===e.limit?"chip-tag":""}" href="${Vw(o)}">${o}</a>
682
+ `).join("")}
683
+ </div>
684
+ </header>
685
+ <p class="empty-state">${`Latest ${e.limit} of ${e.totalEntries} entries`}</p>
686
+ <div class="markdown-body">${r.html}</div>
687
+ </article>
688
+ `}const cg=new Set,oa={tab:"pending",items:[],pendingCount:0,archivedCount:0,current:null,loading:!1,error:null,actionPending:!1,actionError:null};function sh(){return oa}function wD(e){return cg.add(e),()=>cg.delete(e)}async function CD(e){ti({tab:e,loading:!0,error:null,current:null});try{const n=await bh(e);ti({items:n.items,pendingCount:n.pendingCount,archivedCount:n.archivedCount,loading:!1}),am(n.pendingCount)}catch(n){ti({loading:!1,error:wh(n)})}}async function xD(e){ti({loading:!0,error:null,current:null});try{const n=await fL(e);ti({current:n,loading:!1})}catch(n){ti({loading:!1,error:wh(n)})}}function Vs(){ti({items:[],current:null,error:null,loading:!1,actionPending:!1,actionError:null})}async function ED(){if(oa.actionPending)return;const e=oa.current?.meta.id;if(e){ti({actionPending:!0,actionError:null});try{await pL(e);const n=await bh("pending");ti({actionPending:!1,pendingCount:n.pendingCount,archivedCount:n.archivedCount}),am(n.pendingCount),ra(fo("archived"))}catch(n){ti({actionPending:!1,actionError:wh(n)})}}}async function TD(e){if(oa.actionPending)return;const n=oa.current?.meta.id;if(!n)return;const r=e.trim();if(!r||r.length>256){ti({actionError:r?"Rejection reason must be 256 characters or less.":"Please enter a rejection reason."});return}ti({actionPending:!0,actionError:null});try{await gL(n,r);const a=await bh("pending");ti({actionPending:!1,pendingCount:a.pendingCount,archivedCount:a.archivedCount}),am(a.pendingCount),ra(fo("archived"))}catch(a){ti({actionPending:!1,actionError:wh(a)})}}function ti(e){Object.assign(oa,e);for(const n of cg)n(oa)}function wh(e){return e instanceof Error?e.message:String(e)}const ug=new Set,Ss={ref:null,content:null,loading:!1,error:null};function AD(){return Ss}function kD(e){return ug.add(e),()=>ug.delete(e)}async function RD(e){if(!(Ss.ref===e&&Ss.content!==null&&!Ss.error)){zu({ref:e,content:null,loading:!0,error:null});try{const n=await dL(e);if(Ss.ref!==e)return;zu({content:n,loading:!1})}catch(n){if(Ss.ref!==e)return;zu({loading:!1,error:LD(n)})}}}function gs(){zu({ref:null,content:null,loading:!1,error:null})}function zu(e){Object.assign(Ss,e);for(const n of ug)n(Ss)}function LD(e){return e instanceof Error?e.message:String(e)}let ao,hg=!1;const IC="fleet-console.codex.nav-collapsed",jC="fleet-console.codex.rail-collapsed";let ah=zC("nav"),oh=zC("rail"),dg=null,fg=null,zl="route";function MD(e,n={}){ao=e,hg=!1,document.documentElement.lang="en",SL(),zL();const r=kL(()=>zr()),a=kD(()=>zr()),o=wD(()=>zr()),f=yL(_=>{$C(_)});return document.addEventListener("click",U1),document.addEventListener("submit",q1),window.addEventListener("keydown",F1,!0),J6(e),n.initialWorkspaceId&&Qp()!==n.initialWorkspaceId&&bL(s1(n.initialWorkspaceId)),BD(),{navigateToWorkspace(_){Qp()!==_&&ra(s1(_))},destroy(){r(),a(),o(),f(),document.removeEventListener("click",U1),document.removeEventListener("submit",q1),window.removeEventListener("keydown",F1,!0),UC(),Fl(!1),$L(),wL(),e.innerHTML=""}}}function DD(e,n){e==="nav"?ah=n:oh=n,ND(e,n),ao&&zr()}function H1(e){return e==="nav"?ah:oh}function OD(e){zl!==e&&(zl=e,ao&&zr())}function zC(e){if(typeof window>"u")return!1;try{return window.localStorage.getItem(e==="nav"?IC:jC)==="true"}catch{return!1}}function ND(e,n){if(!(typeof window>"u"))try{window.localStorage.setItem(e==="nav"?IC:jC,String(n))}catch{}}async function BD(){zr(),await RL(),await $C(Zl())}async function $C(e){if(e.name==="entry"){Vs(),gs(),await LL(e.id);return}if(e.name==="raw"){Vs(),await RD(e.ref);return}if(e.name==="queue"){Gf(),gs(),await CD(e.tab);return}if(e.name==="queue-detail"){Gf(),gs(),await xD(e.patchId);return}if(e.name==="index-md"){Vs(),gs(),await ML();return}if(e.name==="log"){Vs(),gs(),await DL(e.limit);return}if(e.name==="conflicts"){Vs(),gs(),await OL();return}if(e.name==="conflict-detail"){Vs(),gs(),await NL(e.id);return}Gf(),gs(),Vs(),zr()}function zr(){const e=Zl();ID(Iu(),e)}function ID(e,n){const r=n.name==="entry"?n.id:null,a=$D(n),o=zl!=="side"||!ah,f=!HC(n)&&(zl!=="side"||!oh),_=e.currentEntry?j4(e.currentEntry,e.index):null;jL(e.index,e.recentIds);const c=zl==="side"?`${ah?" app-shell--nav-collapsed":""}${oh?" app-shell--rail-collapsed":""}`:"";UC(),Fl(!1),ao.innerHTML=`
689
+ <div class="app-shell${a}${c}">
690
+ <button class="mobile-menu" type="button" data-action="toggle-nav" aria-label="Open menu">
691
+ <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
692
+ <path d="M4 7h16M4 12h16M4 17h10" />
693
+ </svg>
694
+ </button>
695
+ ${o?q4(e.index,r,e.pendingPatchCount,e.workspaces,e.currentWorkspaceId,window.location.pathname):""}
696
+ <main class="content">
697
+ ${jD(e,n,_)}
698
+ </main>
699
+ ${f?`<div class="rail">${zD(e,n,_)}</div>`:""}
700
+ </div>
701
+ <div class="toast" id="toast" aria-live="polite"></div>
702
+ `,hg?ao.classList.add("is-revealed"):hg=!0,n.name==="entry"&&_&&(dg=vD(ao,_.toc))}function jD(e,n,r){return n.name==="raw"?tD(AD()):n.name==="queue"?nD(sh()):n.name==="queue-detail"?lD(sh()):e.error?$4(e.error):e.loading&&!e.currentEntry&&!e.indexMarkdown&&!e.log&&!e.currentConflict?z4():n.name==="index-md"&&e.indexMarkdown?j6(e.indexMarkdown):n.name==="log"&&e.log?SD(e.log):n.name==="conflicts"?B6(e.conflicts):n.name==="conflict-detail"&&e.currentConflict?I6(e.currentConflict):e.currentEntry&&r?r.html:I4(e.index,e.health?.cwd??null,!!e.currentWorkspaceId)}function zD(e,n,r){return HC(n)?"":`
703
+ ${r?_D(r.toc):""}
704
+ ${$6(e.currentEntry,e.index,e.currentMatchHint)}
705
+ `}function $D(e){return e.name==="raw"?" app-shell--raw":PC(e)?" app-shell--wide":""}function PC(e){return e.name==="home"||e.name==="index-md"||e.name==="log"||e.name==="conflicts"||e.name==="queue"||e.name==="queue-detail"}function HC(e){return e.name==="raw"||PC(e)}function U1(e){const n=e.target;if(!(n instanceof Element))return;const r=n.closest("[data-action]");if(r?.dataset.action==="toggle-nav"){document.body.classList.toggle("nav-open");return}if(r?.dataset.action==="navigate-home"){if(G1(e))return;e.preventDefault(),document.body.classList.remove("nav-open"),ra(rm());return}if(r?.dataset.action==="set-nav-mode"){const _=r.dataset.mode;(_==="tags"||_==="entries")&&(G4(_),zr());return}if(r?.dataset.action==="toggle-tag"){W4(r.dataset.tag??""),zr();return}if(r?.dataset.action==="open-toc-drawer"){HD(r);return}if(r?.dataset.action==="close-toc-drawer"){Fl(!0);return}if(r?.dataset.action==="copy-code"){UD(r);return}if(r?.dataset.action==="copy-compact-context"){const _=Iu();_.currentEntry&&$u(Pw(_.currentEntry),"Copied compact context.");return}if(r?.dataset.action==="copy-provenance-context"){const _=Iu();_.currentEntry&&$u(Hw(_.currentEntry),"Copied provenance context.");return}if(r?.dataset.action==="copy-related-context"){const _=Iu();_.currentEntry&&$u(Uw(_.currentEntry,_.index),"Copied related context pack.");return}if(r?.dataset.action==="toggle-why-matched"){const _=r.closest(".context-actions-grid")?.querySelector(".context-why-matched");_&&(_.hidden=!_.hidden);return}if(r?.dataset.action==="queue-approve"){if(sh().actionPending||!confirm("Approve this patch?"))return;r.setAttribute("disabled",""),ED();return}if(r?.dataset.action==="queue-reject-toggle"){const c=r.closest(".queue-actions-card")?.querySelector(".queue-reject-form");c&&(c.hidden=!c.hidden,c.hidden||c.querySelector("textarea")?.focus());return}if(r?.dataset.action==="queue-reject-cancel"){const c=r.closest(".queue-actions-card")?.querySelector(".queue-reject-form");c&&(c.hidden=!0);return}const a=n.closest("[data-toc-id]");if(a){e.preventDefault(),document.getElementById(a.dataset.tocId??"")?.scrollIntoView({block:"start"}),Fl(!1);return}const o=n.closest("a");if(!o||G1(e))return;const f=FD(o);f&&(e.preventDefault(),document.body.classList.remove("nav-open"),ra(f))}function F1(e){const n=document.querySelector("#toc-drawer:not([hidden])");if(!n)return;if(e.key==="Escape"){e.preventDefault(),e.stopImmediatePropagation(),Fl(!0);return}if(e.key==="Tab"){PD(n,e),e.stopImmediatePropagation();return}const r=e.target,a=r instanceof Node&&n.contains(r),o=e.metaKey||e.ctrlKey||e.altKey;(!a||o)&&(e.preventDefault(),e.stopImmediatePropagation())}function PD(e,n){const r=[...e.querySelectorAll("a[href], button:not([disabled])")].filter(_=>_.offsetParent!==null),a=r[0],o=r[r.length-1];if(!a||!o)return;const f=document.activeElement;e.contains(f)?n.shiftKey&&f===a?(n.preventDefault(),o.focus()):!n.shiftKey&&f===o&&(n.preventDefault(),a.focus()):(n.preventDefault(),a.focus())}function HD(e){const n=document.querySelector("#toc-drawer");n&&(fg=e,document.body.classList.remove("nav-open"),document.body.classList.add("toc-open"),n.hidden=!1,(n.querySelector(".toc-drawer-link")??n.querySelector(".toc-drawer-panel [data-action='close-toc-drawer']"))?.focus())}function Fl(e){const n=document.querySelector("#toc-drawer");n&&(n.hidden=!0,document.body.classList.remove("toc-open"),e&&fg?.focus(),fg=null)}function UC(){dg?.(),dg=null}function q1(e){const n=e.target;if(n instanceof HTMLFormElement&&n.dataset.action==="queue-reject-submit"){if(e.preventDefault(),sh().actionPending)return;const r=n.querySelector("button[type='submit']");r&&(r.disabled=!0);const a=n.querySelector("textarea[name='reason']");TD(a?.value??"")}}async function UD(e){const r=e.closest(".code-block")?.dataset.code??"";r&&await $u(r,"Code copied.")}async function $u(e,n){try{await navigator.clipboard.writeText(e),W1(n)}catch{W1("Failed to copy to clipboard.")}}function W1(e){const n=document.querySelector("#toast");n&&(n.textContent=e,n.classList.add("visible"),window.setTimeout(()=>n.classList.remove("visible"),1400))}function G1(e){return e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0}function FD(e){const n=e.getAttribute("href")??"",r=e.dataset.entryId;if(r)return Ur(decodeURIComponent(r));if(/^[a-z][a-z0-9+.-]*:/i.test(n)&&!n.startsWith(window.location.origin))return null;const a=new URL(n,window.location.origin);if(a.origin!==window.location.origin)return null;if(a.pathname==="/"||a.pathname==="/console/codex"||a.pathname==="/console/codex/")return rm();if(a.pathname.match(/^\/w\/[^/]+(\/|$)/)||a.pathname.match(/^\/console\/codex\/w\/[^/]+(\/|$)/))return a.pathname+a.search;if(a.pathname.startsWith("/console/codex/entry/")||a.pathname.startsWith("/console/codex/raw/"))return a.pathname;if(a.pathname.startsWith("/console/codex/queue")||a.pathname.startsWith("/console/codex/conflicts")||a.pathname==="/console/codex/index"||a.pathname==="/console/codex/index-md"||a.pathname==="/console/codex/log")return a.pathname+a.search;if(a.pathname.startsWith("/entry/")||a.pathname.startsWith("/raw/"))return a.pathname;if(a.pathname.startsWith("/queue")||a.pathname.startsWith("/conflicts")||a.pathname==="/index"||a.pathname==="/index-md"||a.pathname==="/log")return a.pathname+a.search;if(!a.pathname.endsWith(".md"))return null;const o=a.pathname.split("/").pop()??"",f=decodeURIComponent(o.replace(/\.md$/,""));return f?Ur(f):null}let Js=null,ql=null;function qD(e,n){const r=GD();r.parentElement!==e&&e.appendChild(r),ql||(ql=MD(r,{initialWorkspaceId:n}))}function WD(e){ql?.navigateToWorkspace(e)}function K1(){ql?.destroy(),ql=null,Js?.parentElement&&Js.parentElement.removeChild(Js)}function GD(){return Js||(Js=document.createElement("div"),Js.className="codex-host"),Js}function KD({state:e,mode:n,onClose:r}){const a=H.useRef(null),o=RS(),f=H.useRef(null),_=e.theaters.find(A=>A.id===e.activeTheaterId)??null,c=_?.id??null,u=!!_?.hasWiki;H.useEffect(()=>{if(!u){K1();return}return()=>{K1()}},[u]),H.useEffect(()=>{!u||!a.current||!c||(OD(n),qD(a.current,c))},[n,u,c]),H.useEffect(()=>{!u||!c||WD(c)},[c,u]),H.useEffect(()=>{if(n==="route")return;const A=x=>{x.key!=="Escape"||PL()||(x.preventDefault(),r())};return window.addEventListener("keydown",A,!0),()=>window.removeEventListener("keydown",A,!0)},[n,r]);const d=A=>{A.preventDefault(),f.current={pointerId:A.pointerId,startX:A.clientX,startWidth:o},A.currentTarget.setPointerCapture(A.pointerId),A.currentTarget.classList.add("is-dragging")},S=A=>{const x=f.current;!x||x.pointerId!==A.pointerId||sA(x.startWidth+(x.startX-A.clientX))},g=A=>{f.current?.pointerId===A.pointerId&&(f.current=null,A.currentTarget.releasePointerCapture(A.pointerId),A.currentTarget.classList.remove("is-dragging"))},C=_?.label??"Fleet Wiki",E=u?y.jsx("div",{className:"codex-surface-host",ref:a}):y.jsx(YD,{activeTheater:_,hasTheaters:e.theaters.length>0});return n==="route"?y.jsx("section",{className:"codex-route-host","aria-label":"Codex",children:E}):y.jsx("aside",{className:"codex-side-layer",style:{"--codex-side-width":`${o}px`},role:"complementary","aria-label":"Codex",children:y.jsxs("div",{className:"codex-side-panel",children:[y.jsx("div",{className:"codex-side-resize",role:"separator","aria-orientation":"vertical","aria-label":"Resize Codex panel",onPointerDown:d,onPointerMove:S,onPointerUp:g,onPointerCancel:g}),y.jsx(VD,{title:C,onClose:r}),E]})})}function VD({title:e,onClose:n}){const[r,a]=H.useState(()=>H1("nav")),[o,f]=H.useState(()=>H1("rail")),_=c=>{const u=c==="nav"?!r:!o;DD(c,u),c==="nav"?a(u):f(u)};return y.jsxs("header",{className:"codex-surface-header",children:[y.jsxs("div",{className:"codex-surface-heading",children:[y.jsx("span",{className:"codex-surface-eyebrow",children:"Codex"}),y.jsx("h2",{className:"codex-surface-title",title:e,children:e})]}),y.jsxs("div",{className:"codex-surface-actions",children:[y.jsx("button",{type:"button",className:`codex-pane-toggle ${r?"is-collapsed":""}`,onClick:()=>_("nav"),"aria-pressed":!r,"aria-label":r?"Nav 펼치기":"Nav 접기",title:r?"Nav 펼치기":"Nav 접기",children:y.jsx(XD,{})}),y.jsx("button",{type:"button",className:`codex-pane-toggle ${o?"is-collapsed":""}`,onClick:()=>_("rail"),"aria-pressed":!o,"aria-label":o?"ToC 펼치기":"ToC 접기",title:o?"ToC 펼치기":"ToC 접기",children:y.jsx(ZD,{})}),y.jsx("button",{type:"button",className:"codex-surface-close",onClick:n,"aria-label":"Close Codex",children:"×"})]})]})}function YD({activeTheater:e,hasTheaters:n}){return n?y.jsxs("section",{className:"codex-empty-state",children:[y.jsx("p",{className:"codex-empty-eyebrow",children:"Codex unavailable"}),y.jsx("h1",{children:e?.label??"This Theater"}),y.jsx("p",{children:"This Theater does not have Fleet Wiki data mounted."})]}):y.jsxs("section",{className:"codex-empty-state",children:[y.jsx("p",{className:"codex-empty-eyebrow",children:"Codex"}),y.jsx("h1",{children:"Add a Theater"}),y.jsx("p",{children:"Use the top bar Theater control to choose a project root before opening Codex."})]})}function XD(){return y.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[y.jsx("rect",{x:"2.5",y:"3.5",width:"11",height:"9",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),y.jsx("path",{d:"M6.1 3.5v9",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),y.jsx("rect",{x:"3.2",y:"4.2",width:"2.2",height:"7.6",rx:"0.7",fill:"currentColor",opacity:"0.5",stroke:"none"})]})}function ZD(){return y.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[y.jsx("rect",{x:"2.5",y:"3.5",width:"11",height:"9",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),y.jsx("path",{d:"M9.9 3.5v9",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),y.jsx("rect",{x:"10.6",y:"4.2",width:"2.2",height:"7.6",rx:"0.7",fill:"currentColor",opacity:"0.5",stroke:"none"})]})}async function JD(e){const n=await fetch("/agent-cli/state",{signal:e});return await QD(n),eO(await n.json(),n.status)}async function QD(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new Ue(e.status,n)}function eO(e,n){const r=e;if(!r||typeof r!="object"||!Array.isArray(r.clis))throw new Ue(n,"Invalid agent CLI state response");return{clis:r.clis.map(a=>tO(a,n))}}function tO(e,n){const r=e;if(!r||typeof r!="object"||typeof r.id!="string"||typeof r.displayName!="string"||typeof r.available!="boolean"||!(r.version===null||typeof r.version=="string"))throw new Ue(n,"Invalid agent CLI status entry");if(Object.prototype.hasOwnProperty.call(r,"path"))throw new Ue(n,"Agent CLI status must not expose filesystem paths");return{id:r.id,displayName:r.displayName,available:r.available,version:r.version}}const pg=new Set;let gg={loading:!1,state:null,error:null};function nO(){return H.useSyncExternalStore(iO,V1,V1)}function V1(){return gg}function iO(e){return pg.add(e),()=>{pg.delete(e)}}async function rO(e){sp({loading:!0,error:null});try{const n=await JD(e);sp({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;sp({loading:!1,error:sO(n)})}}function sp(e){gg={...gg,...e};for(const n of pg)n()}function sO(e){return e instanceof Error?e.message:String(e)}function aO(){const e=nO();return H.useEffect(()=>{const n=new AbortController;return rO(n.signal),()=>n.abort()},[]),y.jsxs("section",{className:"global-settings-card","aria-label":"Agent CLI availability",children:[y.jsxs("div",{className:"agent-cli-head",children:[y.jsx("p",{className:"global-settings-resp-title",children:"Agent CLI"}),y.jsx("p",{className:"global-settings-help",children:"Whether each Agent CLI is installed and discoverable on this machine's PATH, with its detected version. Carriers can only run on an Agent CLI shown as available here."})]}),e.error?y.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,e.loading&&!e.state?y.jsx("p",{className:"global-settings-help",children:"Checking Agent CLIs."}):null,e.state?.clis.map(n=>y.jsx(oO,{cli:n},n.id)),y.jsx("p",{className:"global-settings-foot",children:"Install or update a CLI, then reopen this page to re-check availability."})]})}function oO({cli:e}){return y.jsxs("div",{className:"agent-cli-row",children:[y.jsx("span",{className:"agent-cli-name",children:e.displayName}),y.jsxs("span",{className:"agent-cli-meta",children:[e.available&&e.version?y.jsx("span",{className:"agent-cli-version",children:e.version}):null,y.jsx("span",{className:`agent-cli-status ${e.available?"is-on":""}`,children:e.available?"Available":"Not found"})]})]})}async function lO(e){const n=await fetch("/observer/api-catalog",{signal:e});return await cO(n),uO(await n.json(),n.status).routes}async function cO(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new Ue(e.status,n)}function uO(e,n){const r=e;if(!r||typeof r!="object"||!("version"in r)||!Array.isArray(r.routes))throw new Ue(n,"Invalid backend API catalog response");return{routes:r.routes.map(a=>hO(a,n))}}function hO(e,n){const r=e;if(!r||typeof r!="object"||typeof r.method!="string"||typeof r.path!="string"||typeof r.summary!="string"||typeof r.category!="string"||typeof r.gate!="string")throw new Ue(n,"Invalid backend API catalog entry");return{method:r.method,path:r.path,summary:r.summary,category:r.category,gate:r.gate}}const mg=new Set;let _g={loading:!1,state:null,error:null};function dO(){return H.useSyncExternalStore(fO,Y1,Y1)}function Y1(){return _g}function fO(e){return mg.add(e),()=>{mg.delete(e)}}async function pO(e){ap({loading:!0,error:null});try{const n=await lO(e);ap({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;ap({loading:!1,error:gO(n)})}}function ap(e){_g={..._g,...e};for(const n of mg)n()}function gO(e){return e instanceof Error?e.message:String(e)}function mO(){const e=dO(),[n,r]=H.useState(!0),a=H.useMemo(()=>bO(e.state??[]),[e.state]),o=e.state?.length??0,f=a.length;return H.useEffect(()=>{const _=new AbortController;return pO(_.signal),()=>_.abort()},[]),y.jsxs("section",{className:"global-settings-card backend-api-section","aria-label":"Backend API catalog",children:[y.jsx("div",{className:`backend-api-control carrier-settings-control-group--taskforce ${n?"is-expanded":""}`,children:y.jsxs("div",{className:"carrier-settings-section-head",children:[y.jsxs("div",{className:"backend-api-head",children:[y.jsx("p",{className:"global-settings-resp-title",children:"Backend API"}),y.jsx("p",{className:"global-settings-help",children:o>0?`${o} loopback route${o===1?"":"s"} across ${f} categor${f===1?"y":"ies"} reported by backend introspection.`:"Backend introspection route list for this console."})]}),y.jsx("div",{className:"carrier-settings-tf-head-actions",children:y.jsx("button",{type:"button",className:"carrier-settings-tf-toggle","aria-expanded":n,onClick:()=>r(_=>!_),children:n?"Hide":"Show"})})]})}),e.error?y.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,e.loading&&!e.state?y.jsx("p",{className:"global-settings-help",children:"Loading backend API catalog."}):null,n?y.jsxs("div",{className:"backend-api-groups",children:[a.length>0?a.map(_=>y.jsx(_O,{group:_},_.category)):null,e.state&&a.length===0?y.jsx("p",{className:"global-settings-help",children:"No backend API routes reported."}):null]}):null,y.jsx("p",{className:"global-settings-foot",children:"Console backend routes are fetched from GET /observer/api-catalog, so newly registered routes appear here automatically. The Codex/Fleet Wiki API surface is not included."})]})}function _O({group:e}){return y.jsxs("div",{className:"backend-api-group",children:[y.jsxs("div",{className:"backend-api-group-head",children:[y.jsx("span",{children:e.category}),y.jsx("span",{children:e.entries.length})]}),y.jsx("div",{className:"backend-api-list",children:e.entries.map(n=>y.jsx(vO,{entry:n},`${n.method}:${n.path}`))})]})}function vO({entry:e}){return y.jsxs("div",{className:"backend-api-row",children:[y.jsx("span",{className:"backend-api-method",children:e.method.toUpperCase()}),y.jsx("code",{className:"backend-api-path",children:e.path}),y.jsx("span",{className:"backend-api-summary",children:e.summary}),y.jsx("span",{className:"backend-api-gate",children:e.gate})]})}function bO(e){const n=new Map;for(const r of e){const a=r.category.trim()||"Uncategorized",o=n.get(a);o?o.push(r):n.set(a,[r])}return Array.from(n.entries()).map(([r,a])=>({category:r,entries:a}))}async function yO(e){const n=await fetch("/model-auth/state",{signal:e});return await bm(n),qC(await n.json(),n.status)}async function SO(e,n,r){const a=await fetch(`/model-auth/providers/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:n}),signal:r});return await bm(a),FC(await a.json(),a.status)}async function wO(e,n){const r=await fetch(`/model-auth/providers/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});return await bm(r),FC(await r.json(),r.status)}async function bm(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new Ue(e.status,n)}function FC(e,n){const r=e;if(!r||typeof r!="object"||!("state"in r))throw new Ue(n,"Invalid model auth mutation response");return{state:qC(r.state,n)}}function qC(e,n){const r=e;if(!r||typeof r!="object"||!Array.isArray(r.providers))throw new Ue(n,"Invalid model auth state response");return{providers:r.providers.map(a=>CO(a,n))}}function CO(e,n){const r=e;if(typeof r.cli!="string"||typeof r.displayName!="string"||typeof r.signedIn!="boolean")throw new Ue(n,"Invalid model auth provider response");return{cli:r.cli,displayName:r.displayName,signedIn:r.signedIn}}const vg=new Set;let bg={loading:!1,state:null,busyCli:null,error:null};function xO(){return H.useSyncExternalStore(EO,X1,X1)}function X1(){return bg}function EO(e){return vg.add(e),()=>{vg.delete(e)}}async function TO(e){$r({loading:!0,error:null});try{const n=await yO(e);$r({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;$r({loading:!1,error:ym(n)})}}async function AO(e,n){$r({busyCli:e,error:null});try{const r=await SO(e,n);return $r({state:r.state,busyCli:null,error:null}),await WC(),!0}catch(r){return $r({busyCli:null,error:ym(r)}),!1}}async function kO(e){$r({busyCli:e,error:null});try{const n=await wO(e);return $r({state:n.state,busyCli:null,error:null}),await WC(),!0}catch(n){return $r({busyCli:null,error:ym(n)}),!1}}async function WC(){try{ow(await OS())}catch{}}function $r(e){bg={...bg,...e};for(const n of vg)n()}function ym(e){return e instanceof Error?e.message:String(e)}function RO(){const e=xO();return H.useEffect(()=>{const n=new AbortController;return TO(n.signal),()=>n.abort()},[]),y.jsxs("section",{className:"global-settings-card","aria-label":"Model sign-in",children:[y.jsxs("div",{className:"model-auth-head",children:[y.jsx("p",{className:"global-settings-resp-title",children:"Model Sign-in"}),y.jsx("p",{className:"global-settings-help",children:"Register a provider API key so carriers can run on that model. Keys are validated against the provider, stored locally, and never shown back in the browser."})]}),e.error?y.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,e.loading&&!e.state?y.jsx("p",{className:"global-settings-help",children:"Loading sign-in state."}):null,e.state?.providers.map(n=>y.jsx(LO,{provider:n,busy:e.busyCli===n.cli},n.cli)),y.jsx("p",{className:"global-settings-foot",children:"Sign-in changes apply to newly launched sessions. Running sessions keep their current credentials until relaunched."})]})}function LO({provider:e,busy:n}){const[r,a]=H.useState(""),o=async()=>{await AO(e.cli,r)&&a("")},f=async()=>{await kO(e.cli)};return y.jsxs("div",{className:"model-auth-row",children:[y.jsxs("div",{className:"model-auth-row-head",children:[y.jsx("span",{className:"model-auth-name",children:e.displayName}),y.jsx("span",{className:`model-auth-status ${e.signedIn?"is-on":""}`,children:e.signedIn?"Signed in":"Not signed in"})]}),e.signedIn?y.jsx("div",{className:"model-auth-actions",children:y.jsx("button",{type:"button",className:"model-auth-button",disabled:n,onClick:()=>{f()},children:n?"Working…":"Sign out"})}):y.jsxs("form",{className:"model-auth-form",onSubmit:_=>{_.preventDefault(),o()},children:[y.jsx("input",{type:"password",className:"model-auth-input",placeholder:"API key",value:r,autoComplete:"off",spellCheck:!1,disabled:n,"aria-label":`${e.displayName} API key`,onChange:_=>a(_.target.value)}),y.jsx("button",{type:"submit",className:"model-auth-button is-primary",disabled:n||r.trim().length===0,children:n?"Verifying…":"Sign in"})]})]})}async function MO(e){const n=await fetch("/global-settings/state",{signal:e});return await GC(n),KC(await n.json(),n.status)}async function DO(e,n){const r=await fetch("/global-settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:n});await GC(r);const a=await r.json();if(!a||typeof a!="object"||!("state"in a))throw new Ue(r.status,"Invalid global settings mutation response");return{state:KC(a.state,r.status)}}async function GC(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new Ue(e.status,n)}function KC(e,n){const r=e;if(!r||typeof r.replaceSystemPrompt!="boolean"||typeof r.enableMetaphor!="boolean")throw new Ue(n,"Invalid global settings state response");return{replaceSystemPrompt:r.replaceSystemPrompt,enableMetaphor:r.enableMetaphor}}const yg=new Set;let Sg={loading:!1,state:null,savingField:null,error:null};function OO(){return H.useSyncExternalStore(NO,Z1,Z1)}function Z1(){return Sg}function NO(e){return yg.add(e),()=>{yg.delete(e)}}async function BO(e){oo({loading:!0,error:null});try{const n=await MO(e);oo({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;oo({loading:!1,error:VC(n)})}}async function J1(e,n){oo({savingField:e,error:null});try{const r=await DO({[e]:n});return oo({state:r.state,savingField:null,error:null}),!0}catch(r){return oo({savingField:null,error:VC(r)}),!1}}function oo(e){Sg={...Sg,...e};for(const n of yg)n()}function VC(e){return e instanceof Error?e.message:String(e)}const IO=[{id:"maritime",label:"Maritime",swatch:["oklch(78% 0.13 75)","oklch(82% 0.13 195)","oklch(32% 0.04 248)"]},{id:"carbon",label:"Carbon",swatch:["oklch(76% 0.115 62)","oklch(80% 0.105 205)","oklch(25% 0.007 252)"]}],jO=[{id:"webgl",label:"WebGL"},{id:"dom",label:"DOM"}],zO=[{id:"appearance",label:"Appearance",eyebrow:"Theme · Renderer"},{id:"general",label:"General",eyebrow:"Prompt · Metaphor"},{id:"agent-cli",label:"Agent CLI",eyebrow:"Availability · Sign-in"},{id:"backend-api",label:"Backend API",eyebrow:"Loopback routes"}];function $O(){const e=OO(),n=e.state,r=e.savingField!==null,[a,o]=H.useState("appearance");return H.useEffect(()=>{const f=new AbortController;return BO(f.signal),()=>f.abort()},[]),y.jsxs("main",{className:"global-settings-page",children:[y.jsxs("section",{className:"global-settings-hero","aria-labelledby":"global-settings-title",children:[y.jsxs("div",{children:[y.jsx("p",{className:"bridge-kicker",children:"Fleet Control Surface"}),y.jsx("h2",{id:"global-settings-title",children:"Settings"})]}),y.jsx("div",{className:"global-settings-status",role:"status","aria-live":"polite",children:r?"Saving…":""})]}),e.error?y.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,y.jsxs("section",{className:"global-settings-grid",children:[y.jsx("div",{className:"global-settings-list","aria-label":"Settings sections",children:zO.map(f=>y.jsxs("button",{type:"button",className:`global-settings-nav-item ${f.id===a?"is-active":""}`,"aria-pressed":f.id===a,onClick:()=>o(f.id),children:[y.jsx("span",{className:"global-settings-nav-label",children:f.label}),y.jsx("span",{className:"global-settings-nav-eyebrow",children:f.eyebrow})]},f.id))}),y.jsx("div",{className:"global-settings-detail",children:PO(a,n,r)},a)]})]})}function PO(e,n,r){switch(e){case"appearance":return y.jsx(HO,{});case"general":return y.jsx(UO,{state:n,saving:r});case"agent-cli":return y.jsxs(y.Fragment,{children:[y.jsx(aO,{}),y.jsx(RO,{})]});case"backend-api":return y.jsx(mO,{})}}function HO(){const{activeTheme:e,terminalRenderer:n}=Xl();return y.jsxs("section",{className:"global-settings-card","aria-label":"Appearance",children:[y.jsxs("div",{className:"global-settings-row",children:[y.jsxs("div",{className:"global-settings-row-text",children:[y.jsx("p",{className:"global-settings-resp-title",children:"Theme"}),y.jsx("p",{className:"global-settings-help",children:"Console color scheme. Applies immediately and is remembered on this browser."})]}),y.jsx("div",{className:"theme-picker",role:"group","aria-label":"Theme",children:IO.map(r=>{const a=r.id===e;return y.jsxs("button",{type:"button","aria-pressed":a,className:`theme-card ${a?"is-active":""}`,onClick:()=>pk(r.id),children:[y.jsx("span",{className:"theme-card-swatch","aria-hidden":"true",children:r.swatch.map(o=>y.jsx("i",{style:{background:o}},o))}),y.jsx("span",{className:"theme-card-label",children:r.label}),y.jsx("span",{className:"theme-card-check","aria-hidden":"true",children:a?y.jsx(FO,{}):null})]},r.id)})})]}),y.jsxs("div",{className:"global-settings-row",children:[y.jsxs("div",{className:"global-settings-row-text",children:[y.jsx("p",{className:"global-settings-resp-title",children:"Terminal Renderer"}),y.jsx("p",{className:"global-settings-help",children:"WebGL paints the terminal on the GPU for sharper, faster output; DOM is a compatibility fallback. Switching applies to the live terminal instantly without dropping the session."})]}),y.jsx("div",{className:"segmented",role:"group","aria-label":"Terminal renderer",children:jO.map(r=>{const a=r.id===n;return y.jsx("button",{type:"button","aria-pressed":a,className:`segmented-option ${a?"is-active":""}`,onClick:()=>gk(r.id),children:r.label},r.id)})})]}),y.jsx("p",{className:"global-settings-foot",children:"Appearance preferences apply immediately and are stored per browser, separate from session settings."})]})}function UO({state:e,saving:n}){return y.jsxs("section",{className:"global-settings-card","aria-label":"General",children:[e?y.jsxs(y.Fragment,{children:[y.jsx(Q1,{title:"System Prompt Injection",help:"Append keeps the Agent CLI's built-in system prompt and layers Fleet doctrine on top. Replace swaps it entirely for Fleet doctrine. Affects Claude-family CLIs only; Codex always receives doctrine through its profile.",onLabel:"Replace",offLabel:"Append",value:e.replaceSystemPrompt,disabled:n,onToggle:()=>{J1("replaceSystemPrompt",!e.replaceSystemPrompt)}}),y.jsx(Q1,{title:"Metaphor",help:"Enabled layers the naval tone overlay — clipped reporting cadence and Fleet vocabulary — onto every session. Off keeps the Admiral persona without the tone.",onLabel:"Enabled",offLabel:"Off",value:e.enableMetaphor,disabled:n,onToggle:()=>{J1("enableMetaphor",!e.enableMetaphor)}})]}):y.jsx("p",{className:"global-settings-help",children:"Loading settings."}),y.jsx("p",{className:"global-settings-foot",children:"Changes apply to newly launched sessions. Running sessions keep their current configuration until relaunched."})]})}function Q1({title:e,help:n,onLabel:r,offLabel:a,value:o,disabled:f,onToggle:_}){return y.jsxs("div",{className:"global-settings-row",children:[y.jsxs("div",{className:"global-settings-row-text",children:[y.jsx("p",{className:"global-settings-resp-title",children:e}),y.jsx("p",{className:"global-settings-help",children:n})]}),y.jsx("button",{type:"button",className:`global-settings-toggle ${o?"is-on":""}`,disabled:f,"aria-pressed":o,onClick:_,children:y.jsx("span",{children:o?r:a})})]})}function FO(){return y.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:y.jsx("path",{d:"M3.5 8.5 6.5 11.5 12.5 5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const qO="button",WO=184,GO=320,wu=12;function KO({state:e,onSelect:n,mode:r=qO,anchor:a,viewportBounds:o,onClose:f}){const[_,c]=H.useState(r==="menu"),u=H.useRef(null),d=H.useRef(null),S=H.useRef(null),g=e.creatingTerminalSession||e.addingTheater||!e.activeTheaterId||e.agentClis.length===0,C=r==="menu"||_;H.useEffect(()=>{r==="menu"&&c(!0)},[r,a?.x,a?.y]),H.useEffect(()=>{if(!C)return;const p=h=>{u.current?.contains(h.target)||E()},v=h=>{h.key==="Escape"&&(E(),d.current?.focus())};return document.addEventListener("mousedown",p),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",v)}},[C]),H.useEffect(()=>{C&&S.current?.focus()},[C]);const E=()=>{c(!1),f?.()},A=async p=>{g||wg(p)!==null||(c(!1),d.current?.focus(),await n(p))},x=p=>{if(p.key!=="ArrowDown"&&p.key!=="ArrowUp")return;p.preventDefault();const v=Array.from(S.current?.querySelectorAll("[role^='menuitem']:not(:disabled)")??[]);if(v.length===0)return;const h=v.indexOf(document.activeElement),b=h===-1?p.key==="ArrowDown"?0:v.length-1:(h+(p.key==="ArrowDown"?1:-1)+v.length)%v.length;v[b]?.focus()};return y.jsxs("div",{className:`operation-launch-control ${r==="menu"?"operation-launch-control--canvas":""}`,ref:u,style:a?VO(a,o):void 0,"data-canvas-blocker":!0,children:[r==="button"?y.jsx("button",{type:"button",ref:d,className:`workspace-add-button ${_?"is-open":""}`,onClick:()=>c(p=>!p),disabled:g,"aria-haspopup":"menu","aria-expanded":_,"aria-label":"Launch operation",children:y.jsx(YO,{})}):null,C?y.jsx("div",{className:"operation-launch-menu theater-menu",role:"menu","aria-label":"Launch operation",tabIndex:-1,ref:S,onKeyDown:x,children:e.agentClis.length>0?y.jsx("ul",{className:"theater-menu-list",children:e.agentClis.map(p=>{const v=wg(p),h=g||v!==null;return y.jsx("li",{children:y.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item operation-launch-menu-item",disabled:h,"aria-disabled":h,title:v??void 0,onClick:()=>{A(p)},children:[y.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:YC(p.id)}),y.jsx("span",{className:"theater-menu-label",children:p.label}),v?y.jsx("span",{className:"operation-launch-menu-reason",children:v}):null]})},p.id)})}):y.jsx("p",{className:"theater-menu-empty",children:"No Agent CLI available."})}):null]})}function wg(e){return e.available?e.signedIn?null:"Sign-in required":"Not installed"}function VO(e,n){return n?{left:Math.max(wu,Math.min(e.x,n.width-WO-wu)),top:Math.max(wu,Math.min(e.y,n.height-GO-wu))}:{left:e.x,top:e.y}}function YO(){return y.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:y.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function YC(e){return e==="claude"?y.jsx(XO,{}):e==="claude-kimi"?y.jsx(ZO,{}):e==="claude-glm"?y.jsx(JO,{}):e==="codex"?y.jsx(QO,{}):y.jsx(eN,{})}function XO(){return y.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:y.jsx("path",{d:"M8 2.6 9.15 6.85 13.4 8 9.15 9.15 8 13.4 6.85 9.15 2.6 8 6.85 6.85Z",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinejoin:"round"})})}function ZO(){return y.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:y.jsx("path",{d:"M9.7 3.2A5 5 0 1 0 9.7 12.8 4 4 0 1 1 9.7 3.2Z",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinejoin:"round"})})}function JO(){return y.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",style:{display:"inline-block",verticalAlign:"middle"},children:y.jsx("polygon",{points:"5,1 8.5,3 8.5,7 5,9 1.5,7 1.5,3",stroke:"currentColor",strokeWidth:"1.2",fill:"none"})})}function QO(){return y.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:y.jsx("path",{d:"M6.2 4.8 3.2 8 6.2 11.2M9.8 4.8 12.8 8 9.8 11.2",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinecap:"round",strokeLinejoin:"round"})})}function eN(){return y.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[y.jsx("rect",{x:"2.8",y:"3.4",width:"10.4",height:"8.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.15"}),y.jsx("path",{d:"M5 6.2 6.7 8 5 9.8M7.8 9.8h3",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinecap:"round",strokeLinejoin:"round"})]})}const tN=208,nN=360,Cu=12;function iN({state:e,anchor:n,viewportBounds:r,onLaunchCli:a,onOpenShell:o,onResetView:f,onClose:_}){const c=H.useRef(null),u=H.useRef(null),d=e.creatingTerminalSession||e.addingTheater||!e.activeTheaterId||e.agentClis.length===0,S=!e.activeTheaterId;return H.useEffect(()=>{const g=E=>{c.current?.contains(E.target)||_()},C=E=>{E.key==="Escape"&&_()};return document.addEventListener("mousedown",g),document.addEventListener("keydown",C),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",C)}},[_]),H.useEffect(()=>{u.current?.focus()},[]),y.jsx("div",{className:"operation-launch-control operation-launch-control--canvas",ref:c,style:rN(n,r),"data-canvas-blocker":!0,children:y.jsxs("div",{className:"operation-launch-menu theater-menu canvas-context-menu",role:"menu","aria-label":"Canvas actions",tabIndex:-1,ref:u,children:[y.jsx("p",{className:"canvas-context-menu-group",children:"New Operation"}),e.agentClis.length>0?y.jsx("ul",{className:"theater-menu-list",children:e.agentClis.map(g=>{const C=wg(g),E=d||C!==null;return y.jsx("li",{children:y.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item operation-launch-menu-item",disabled:E,"aria-disabled":E,title:C??void 0,onClick:()=>{C===null&&!d&&a(g)},children:[y.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:YC(g.id)}),y.jsx("span",{className:"theater-menu-label",children:g.label}),C?y.jsx("span",{className:"operation-launch-menu-reason",children:C}):null]})},g.id)})}):y.jsx("p",{className:"theater-menu-empty",children:"No Agent CLI available."}),y.jsx("div",{className:"theater-menu-divider",role:"separator"}),y.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item canvas-context-menu-item",disabled:S,onClick:o,children:[y.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:y.jsx(sN,{})}),y.jsx("span",{className:"theater-menu-label",children:"Open Shell"})]}),y.jsx("div",{className:"theater-menu-divider",role:"separator"}),y.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item canvas-context-menu-item",onClick:f,children:[y.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:y.jsx(aN,{})}),y.jsx("span",{className:"theater-menu-label",children:"Reset view"})]})]})})}function rN(e,n){return n?{left:Math.max(Cu,Math.min(e.x,n.width-tN-Cu)),top:Math.max(Cu,Math.min(e.y,n.height-nN-Cu))}:{left:e.x,top:e.y}}function sN(){return y.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[y.jsx("rect",{x:"2.8",y:"3.4",width:"10.4",height:"9.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.15"}),y.jsx("path",{d:"M5 6.6 6.8 8.4 5 10.2M8.4 10.2h2.8",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinecap:"round",strokeLinejoin:"round"})]})}function aN(){return y.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[y.jsx("path",{d:"M4.4 7.2A4 4 0 1 1 4 9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),y.jsx("path",{d:"M2.4 4.6v2.8h2.8",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})]})}const ey=256,ty=176,op=12,xu=220,XC="fleet-console.map.radarCollapsed";function oN({panels:e,shellPanels:n,viewport:r,canvasSize:a,onJump:o}){const f=H.useRef(null),_=H.useRef(!1),[c,u]=H.useState(lN);if(a.width<=0||a.height<=0||r.zoom<=0)return null;const d=[...Object.entries(e).map(([j,G])=>({id:j,kind:"op",x:G.x,y:G.y,width:G.width,height:G.height})),...Object.entries(n).map(([j,G])=>({id:j,kind:"shell",x:G.geometry.x,y:G.geometry.y,width:G.geometry.width,height:G.geometry.height}))];if(d.length===0)return null;const S=()=>{u(j=>{const G=!j;return cN(G),G})};if(c)return y.jsx("button",{type:"button",className:"canvas-minimap-fab","data-canvas-blocker":!0,onClick:S,"aria-label":"Radar 펼치기",title:"Show radar",children:y.jsx(hN,{})});const g=ey-op*2,C=ty-op*2,E={x:-r.x/r.zoom,y:-r.y/r.zoom,width:a.width/r.zoom,height:a.height/r.zoom};let A=Math.min(E.x,...d.map(j=>j.x)),x=Math.min(E.y,...d.map(j=>j.y)),p=Math.max(E.x+E.width,...d.map(j=>j.x+j.width)),v=Math.max(E.y+E.height,...d.map(j=>j.y+j.height));A-=xu,x-=xu,p+=xu,v+=xu;const h=p-A,b=v-x,T=Math.min(g/h,C/b),R=(g-h*T)/2,L=(C-b*T)/2,M=j=>R+(j-A)*T,k=j=>L+(j-x)*T,B=j=>{const G=f.current?.getBoundingClientRect();if(!G)return;const ee=j.clientX-G.left,q=j.clientY-G.top;o({x:A+(ee-R)/T,y:x+(q-L)/T})},F=j=>{j.stopPropagation(),_.current=!0,j.currentTarget.setPointerCapture(j.pointerId),B(j)},U=j=>{_.current&&(j.stopPropagation(),B(j))},W=j=>{_.current=!1;try{j.currentTarget.releasePointerCapture(j.pointerId)}catch{}};return y.jsxs("div",{className:"canvas-minimap","data-canvas-blocker":!0,style:{width:ey,height:ty},children:[y.jsx("span",{className:"canvas-minimap-label","aria-hidden":"true",children:"Radar"}),y.jsx("button",{type:"button",className:"canvas-minimap-toggle",onClick:S,"aria-label":"Radar 접기",title:"Collapse radar",children:y.jsx(uN,{})}),y.jsxs("div",{ref:f,className:"canvas-minimap-inner",style:{inset:op},onPointerDown:F,onPointerMove:U,onPointerUp:W,onPointerCancel:W,role:"presentation","aria-label":"Canvas minimap — drag to navigate",children:[d.map(j=>y.jsx("div",{className:`canvas-minimap-panel ${j.kind==="shell"?"is-shell":""}`,style:{left:M(j.x),top:k(j.y),width:Math.max(2,j.width*T),height:Math.max(2,j.height*T)}},j.id)),y.jsx("div",{className:"canvas-minimap-view",style:{left:M(E.x),top:k(E.y),width:E.width*T,height:E.height*T}})]})]})}function lN(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(XC)==="true"}catch{return!1}}function cN(e){if(!(typeof window>"u"))try{window.localStorage.setItem(XC,String(e))}catch{}}function uN(){return y.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:y.jsx("path",{d:"M5.5 4.5 10.5 8l-5 3.5M11 8H5.5",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function hN(){return y.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[y.jsx("rect",{x:"2",y:"3",width:"12",height:"10",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),y.jsx("rect",{x:"4.2",y:"5",width:"4.2",height:"3.1",rx:"0.6",fill:"none",stroke:"currentColor",strokeWidth:"1"}),y.jsx("circle",{cx:"11",cy:"10.2",r:"0.95",fill:"currentColor"})]})}function dN({jobs:e,selectedJobId:n,onSelect:r}){const a=r??dw;return y.jsx("ol",{className:"terminal-job-lines",children:e.map(o=>y.jsx(fN,{job:o,active:n===o.jobId,onSelect:a},o.jobId))})}function fN({job:e,active:n,onSelect:r}){const a=ph(e.status),o=PA(e),f=e.ownerCarrierId?`${zA(e.ownerCarrierId)} · ${Pp(e.status)}`:Pp(e.status);return y.jsx("li",{children:y.jsxs("button",{type:"button",className:`terminal-job-line ${n?"is-active":""}`,onClick:()=>r(e.jobId),"aria-current":n||void 0,children:[y.jsx("span",{className:`status-dot status-dot--${a}`,"aria-hidden":"true"}),y.jsx("span",{className:"terminal-job-line-label",children:e.label??$p(e.jobId)}),y.jsx("span",{className:"terminal-job-line-meta",children:f}),o?y.jsxs(y.Fragment,{children:[y.jsx("span",{className:"terminal-job-line-sep","aria-hidden":"true",children:"-"}),y.jsx("span",{className:"terminal-job-line-stream",children:o})]}):null]})})}var lp={exports:{}},ny;function pN(){return ny||(ny=1,(function(e,n){(function(r,a){e.exports=a()})(self,(()=>(()=>{var r={};return(()=>{var a=r;Object.defineProperty(a,"__esModule",{value:!0}),a.FitAddon=void 0,a.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 f=this._terminal._core;this._terminal.rows===o.rows&&this._terminal.cols===o.cols||(f._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,f=o._renderService.dimensions;if(f.css.cell.width===0||f.css.cell.height===0)return;const _=this._terminal.options.scrollback===0?0:o.viewport.scrollBarWidth,c=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(c.getPropertyValue("height")),d=Math.max(0,parseInt(c.getPropertyValue("width"))),S=window.getComputedStyle(this._terminal.element),g=u-(parseInt(S.getPropertyValue("padding-top"))+parseInt(S.getPropertyValue("padding-bottom"))),C=d-(parseInt(S.getPropertyValue("padding-right"))+parseInt(S.getPropertyValue("padding-left")))-_;return{cols:Math.max(2,Math.floor(C/f.css.cell.width)),rows:Math.max(1,Math.floor(g/f.css.cell.height))}}}})(),r})()))})(lp)),lp.exports}var gN=pN(),Pu={exports:{}},mN=Pu.exports,iy;function _N(){return iy||(iy=1,(function(e,n){(function(r,a){e.exports=a()})(mN,(()=>(()=>{var r={433:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV11=void 0;const d=u(938),S=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],g=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],C=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],E=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let A;function x(p,v){let h,b=0,T=v.length-1;if(p<v[0][0]||p>v[T][1])return!1;for(;T>=b;)if(h=b+T>>1,p>v[h][1])b=h+1;else{if(!(p<v[h][0]))return!0;T=h-1}return!1}c.UnicodeV11=class{constructor(){if(this.version="11",!A){A=new Uint8Array(65536),A.fill(1),A[0]=0,A.fill(0,1,32),A.fill(0,127,160);for(let p=0;p<S.length;++p)A.fill(0,S[p][0],S[p][1]+1);for(let p=0;p<C.length;++p)A.fill(2,C[p][0],C[p][1]+1)}}wcwidth(p){return p<32?0:p<127?1:p<65536?A[p]:x(p,g)?0:x(p,E)?2:1}charProperties(p,v){let h=this.wcwidth(p),b=h===0&&v!==0;if(b){const T=d.UnicodeService.extractWidth(v);T===0?b=!1:T>h&&(h=T)}return d.UnicodeService.createPropertyValue(0,h,b)}}},345:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.runAndSubscribe=c.forwardEvent=c.EventEmitter=void 0,c.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const S=[];for(let g=0;g<this._listeners.length;g++)S.push(this._listeners[g]);for(let g=0;g<S.length;g++)S[g].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},c.forwardEvent=function(u,d){return u((S=>d.fire(S)))},c.runAndSubscribe=function(u,d){return d(void 0),u((S=>d(S)))}},490:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const d=u(938),S=[[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]],g=[[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 C;c.UnicodeV6=class{constructor(){if(this.version="6",!C){C=new Uint8Array(65536),C.fill(1),C[0]=0,C.fill(0,1,32),C.fill(0,127,160),C.fill(2,4352,4448),C[9001]=2,C[9002]=2,C.fill(2,11904,42192),C[12351]=1,C.fill(2,44032,55204),C.fill(2,63744,64256),C.fill(2,65040,65050),C.fill(2,65072,65136),C.fill(2,65280,65377),C.fill(2,65504,65511);for(let E=0;E<S.length;++E)C.fill(0,S[E][0],S[E][1]+1)}}wcwidth(E){return E<32?0:E<127?1:E<65536?C[E]:(function(A,x){let p,v=0,h=x.length-1;if(A<x[0][0]||A>x[h][1])return!1;for(;h>=v;)if(p=v+h>>1,A>x[p][1])v=p+1;else{if(!(A<x[p][0]))return!0;h=p-1}return!1})(E,g)?0:E>=131072&&E<=196605||E>=196608&&E<=262141?2:1}charProperties(E,A){let x=this.wcwidth(E),p=x===0&&A!==0;if(p){const v=d.UnicodeService.extractWidth(A);v===0?p=!1:v>x&&(x=v)}return d.UnicodeService.createPropertyValue(0,x,p)}}},938:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const d=u(345),S=u(490);class g{static extractShouldJoin(E){return(1&E)!=0}static extractWidth(E){return E>>1&3}static extractCharKind(E){return E>>3}static createPropertyValue(E,A,x=!1){return(16777215&E)<<3|(3&A)<<1|(x?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const E=new S.UnicodeV6;this.register(E),this._active=E.version,this._activeProvider=E}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(E){if(!this._providers[E])throw new Error(`unknown Unicode version "${E}"`);this._active=E,this._activeProvider=this._providers[E],this._onChange.fire(E)}register(E){this._providers[E.version]=E}wcwidth(E){return this._activeProvider.wcwidth(E)}getStringCellWidth(E){let A=0,x=0;const p=E.length;for(let v=0;v<p;++v){let h=E.charCodeAt(v);if(55296<=h&&h<=56319){if(++v>=p)return A+this.wcwidth(h);const R=E.charCodeAt(v);56320<=R&&R<=57343?h=1024*(h-55296)+R-56320+65536:A+=this.wcwidth(R)}const b=this.charProperties(h,x);let T=g.extractWidth(b);g.extractShouldJoin(b)&&(T-=g.extractWidth(x)),A+=T,x=b}return A}charProperties(E,A){return this._activeProvider.charProperties(E,A)}}c.UnicodeService=g}},a={};function o(_){var c=a[_];if(c!==void 0)return c.exports;var u=a[_]={exports:{}};return r[_](u,u.exports,o),u.exports}var f={};return(()=>{var _=f;Object.defineProperty(_,"__esModule",{value:!0}),_.Unicode11Addon=void 0;const c=o(433);_.Unicode11Addon=class{activate(u){u.unicode.register(new c.UnicodeV11)}dispose(){}}})(),f})()))})(Pu)),Pu.exports}var vN=_N();var bN=(e,n,r,a)=>{for(var o=n,f=e.length-1,_;f>=0;f--)(_=e[f])&&(o=_(o)||o);return o},yN=(e,n)=>(r,a)=>n(r,a,e),SN=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?ry.isErrorNoTelemetry(e)?new ry(e.message+`
706
+
707
+ `+e.stack):new Error(e.message+`
708
+
709
+ `+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(n=>{n(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},wN=new SN;function cp(e){CN(e)||wN.onUnexpectedError(e)}var Cg="Canceled";function CN(e){return e instanceof xN?!0:e instanceof Error&&e.name===Cg&&e.message===Cg}var xN=class extends Error{constructor(){super(Cg),this.name=this.message}},ry=class xg extends Error{constructor(n){super(n),this.name="CodeExpectedError"}static fromError(n){if(n instanceof xg)return n;let r=new xg;return r.message=n.message,r.stack=n.stack,r}static isErrorNoTelemetry(n){return n.name==="CodeExpectedError"}},EN;(e=>{function n(f){return f<0}e.isLessThan=n;function r(f){return f<=0}e.isLessThanOrEqual=r;function a(f){return f>0}e.isGreaterThan=a;function o(f){return f===0}e.isNeitherLessOrGreaterThan=o,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(EN||={});function TN(e,n){let r=this,a=!1,o;return function(){return a||(a=!0,n||(o=e.apply(r,arguments))),o}}var ZC;(e=>{function n(T){return T&&typeof T=="object"&&typeof T[Symbol.iterator]=="function"}e.is=n;let r=Object.freeze([]);function a(){return r}e.empty=a;function*o(T){yield T}e.single=o;function f(T){return n(T)?T:o(T)}e.wrap=f;function _(T){return T||r}e.from=_;function*c(T){for(let R=T.length-1;R>=0;R--)yield T[R]}e.reverse=c;function u(T){return!T||T[Symbol.iterator]().next().done===!0}e.isEmpty=u;function d(T){return T[Symbol.iterator]().next().value}e.first=d;function S(T,R){let L=0;for(let M of T)if(R(M,L++))return!0;return!1}e.some=S;function g(T,R){for(let L of T)if(R(L))return L}e.find=g;function*C(T,R){for(let L of T)R(L)&&(yield L)}e.filter=C;function*E(T,R){let L=0;for(let M of T)yield R(M,L++)}e.map=E;function*A(T,R){let L=0;for(let M of T)yield*R(M,L++)}e.flatMap=A;function*x(...T){for(let R of T)yield*R}e.concat=x;function p(T,R,L){let M=L;for(let k of T)M=R(M,k);return M}e.reduce=p;function*v(T,R,L=T.length){for(R<0&&(R+=T.length),L<0?L+=T.length:L>T.length&&(L=T.length);R<L;R++)yield T[R]}e.slice=v;function h(T,R=Number.POSITIVE_INFINITY){let L=[];if(R===0)return[L,T];let M=T[Symbol.iterator]();for(let k=0;k<R;k++){let B=M.next();if(B.done)return[L,e.empty()];L.push(B.value)}return[L,{[Symbol.iterator](){return M}}]}e.consume=h;async function b(T){let R=[];for await(let L of T)R.push(L);return Promise.resolve(R)}e.asyncToArray=b})(ZC||={});function JC(e){if(ZC.is(e)){let n=[];for(let r of e)if(r)try{r.dispose()}catch(a){n.push(a)}if(n.length===1)throw n[0];if(n.length>1)throw new AggregateError(n,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function QC(...e){return Bn(()=>JC(e))}function Bn(e){return{dispose:TN(()=>{e()})}}var ex=class tx{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{JC(this._toDispose)}finally{this._toDispose.clear()}}add(n){if(!n)return n;if(n===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?tx.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(n),n}delete(n){if(n){if(n===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(n),n.dispose()}}deleteAndLeak(n){n&&this._toDispose.has(n)&&(this._toDispose.delete(n),void 0)}};ex.DISABLE_DISPOSED_WARNING=!1;var lo=ex,Gi=class{constructor(){this._store=new lo,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Gi.None=Object.freeze({dispose(){}});var xl=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},Sm=typeof process<"u"&&"title"in process,Ch=Sm?"node":navigator.userAgent,AN=Sm?"node":navigator.platform,kN=Ch.includes("Firefox"),RN=Ch.includes("Edge"),nx=/^((?!chrome|android).)*safari/i.test(Ch);function LN(){if(!nx)return 0;let e=Ch.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}AN.indexOf("Linux")>=0;var MN="",_n=0,vn=0,bn=0,Kt=0,Ai={css:"#00000000",rgba:0},$n;(e=>{function n(o,f,_,c){return c!==void 0?`#${Ys(o)}${Ys(f)}${Ys(_)}${Ys(c)}`:`#${Ys(o)}${Ys(f)}${Ys(_)}`}e.toCss=n;function r(o,f,_,c=255){return(o<<24|f<<16|_<<8|c)>>>0}e.toRgba=r;function a(o,f,_,c){return{css:e.toCss(o,f,_,c),rgba:e.toRgba(o,f,_,c)}}e.toColor=a})($n||={});var Dl;(e=>{function n(u,d){if(Kt=(d.rgba&255)/255,Kt===1)return{css:d.css,rgba:d.rgba};let S=d.rgba>>24&255,g=d.rgba>>16&255,C=d.rgba>>8&255,E=u.rgba>>24&255,A=u.rgba>>16&255,x=u.rgba>>8&255;_n=E+Math.round((S-E)*Kt),vn=A+Math.round((g-A)*Kt),bn=x+Math.round((C-x)*Kt);let p=$n.toCss(_n,vn,bn),v=$n.toRgba(_n,vn,bn);return{css:p,rgba:v}}e.blend=n;function r(u){return(u.rgba&255)===255}e.isOpaque=r;function a(u,d,S){let g=ta.ensureContrastRatio(u.rgba,d.rgba,S);if(g)return $n.toColor(g>>24&255,g>>16&255,g>>8&255)}e.ensureContrastRatio=a;function o(u){let d=(u.rgba|255)>>>0;return[_n,vn,bn]=ta.toChannels(d),{css:$n.toCss(_n,vn,bn),rgba:d}}e.opaque=o;function f(u,d){return Kt=Math.round(d*255),[_n,vn,bn]=ta.toChannels(u.rgba),{css:$n.toCss(_n,vn,bn,Kt),rgba:$n.toRgba(_n,vn,bn,Kt)}}e.opacity=f;function _(u,d){return Kt=u.rgba&255,f(u,Kt*d/255)}e.multiplyOpacity=_;function c(u){return[u.rgba>>24&255,u.rgba>>16&255,u.rgba>>8&255]}e.toColorRGB=c})(Dl||={});var DN;(e=>{let n,r;try{let o=document.createElement("canvas");o.width=1,o.height=1;let f=o.getContext("2d",{willReadFrequently:!0});f&&(n=f,n.globalCompositeOperation="copy",r=n.createLinearGradient(0,0,1,1))}catch{}function a(o){if(o.match(/#[\da-f]{3,8}/i))switch(o.length){case 4:return _n=parseInt(o.slice(1,2).repeat(2),16),vn=parseInt(o.slice(2,3).repeat(2),16),bn=parseInt(o.slice(3,4).repeat(2),16),$n.toColor(_n,vn,bn);case 5:return _n=parseInt(o.slice(1,2).repeat(2),16),vn=parseInt(o.slice(2,3).repeat(2),16),bn=parseInt(o.slice(3,4).repeat(2),16),Kt=parseInt(o.slice(4,5).repeat(2),16),$n.toColor(_n,vn,bn,Kt);case 7:return{css:o,rgba:(parseInt(o.slice(1),16)<<8|255)>>>0};case 9:return{css:o,rgba:parseInt(o.slice(1),16)>>>0}}let f=o.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(f)return _n=parseInt(f[1]),vn=parseInt(f[2]),bn=parseInt(f[3]),Kt=Math.round((f[5]===void 0?1:parseFloat(f[5]))*255),$n.toColor(_n,vn,bn,Kt);if(!n||!r)throw new Error("css.toColor: Unsupported css format");if(n.fillStyle=r,n.fillStyle=o,typeof n.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(n.fillRect(0,0,1,1),[_n,vn,bn,Kt]=n.getImageData(0,0,1,1).data,Kt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:$n.toRgba(_n,vn,bn,Kt),css:o}}e.toColor=a})(DN||={});var jn;(e=>{function n(a){return r(a>>16&255,a>>8&255,a&255)}e.relativeLuminance=n;function r(a,o,f){let _=a/255,c=o/255,u=f/255,d=_<=.03928?_/12.92:Math.pow((_+.055)/1.055,2.4),S=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4),g=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4);return d*.2126+S*.7152+g*.0722}e.relativeLuminance2=r})(jn||={});var ta;(e=>{function n(_,c){if(Kt=(c&255)/255,Kt===1)return c;let u=c>>24&255,d=c>>16&255,S=c>>8&255,g=_>>24&255,C=_>>16&255,E=_>>8&255;return _n=g+Math.round((u-g)*Kt),vn=C+Math.round((d-C)*Kt),bn=E+Math.round((S-E)*Kt),$n.toRgba(_n,vn,bn)}e.blend=n;function r(_,c,u){let d=jn.relativeLuminance(_>>8),S=jn.relativeLuminance(c>>8);if(Mr(d,S)<u){if(S<d){let E=a(_,c,u),A=Mr(d,jn.relativeLuminance(E>>8));if(A<u){let x=o(_,c,u),p=Mr(d,jn.relativeLuminance(x>>8));return A>p?E:x}return E}let g=o(_,c,u),C=Mr(d,jn.relativeLuminance(g>>8));if(C<u){let E=a(_,c,u),A=Mr(d,jn.relativeLuminance(E>>8));return C>A?g:E}return g}}e.ensureContrastRatio=r;function a(_,c,u){let d=_>>24&255,S=_>>16&255,g=_>>8&255,C=c>>24&255,E=c>>16&255,A=c>>8&255,x=Mr(jn.relativeLuminance2(C,E,A),jn.relativeLuminance2(d,S,g));for(;x<u&&(C>0||E>0||A>0);)C-=Math.max(0,Math.ceil(C*.1)),E-=Math.max(0,Math.ceil(E*.1)),A-=Math.max(0,Math.ceil(A*.1)),x=Mr(jn.relativeLuminance2(C,E,A),jn.relativeLuminance2(d,S,g));return(C<<24|E<<16|A<<8|255)>>>0}e.reduceLuminance=a;function o(_,c,u){let d=_>>24&255,S=_>>16&255,g=_>>8&255,C=c>>24&255,E=c>>16&255,A=c>>8&255,x=Mr(jn.relativeLuminance2(C,E,A),jn.relativeLuminance2(d,S,g));for(;x<u&&(C<255||E<255||A<255);)C=Math.min(255,C+Math.ceil((255-C)*.1)),E=Math.min(255,E+Math.ceil((255-E)*.1)),A=Math.min(255,A+Math.ceil((255-A)*.1)),x=Mr(jn.relativeLuminance2(C,E,A),jn.relativeLuminance2(d,S,g));return(C<<24|E<<16|A<<8|255)>>>0}e.increaseLuminance=o;function f(_){return[_>>24&255,_>>16&255,_>>8&255,_&255]}e.toChannels=f})(ta||={});function Ys(e){let n=e.toString(16);return n.length<2?"0"+n:n}function Mr(e,n){return e<n?(n+.05)/(e+.05):(e+.05)/(n+.05)}function hn(e){if(!e)throw new Error("value must not be falsy");return e}function wm(e){return 57508<=e&&e<=57558}function ON(e){return 57520<=e&&e<=57527}function NN(e){return 57344<=e&&e<=63743}function BN(e){return 9472<=e&&e<=9631}function IN(e){return e>=128512&&e<=128591||e>=127744&&e<=128511||e>=128640&&e<=128767||e>=9728&&e<=9983||e>=9984&&e<=10175||e>=65024&&e<=65039||e>=129280&&e<=129535||e>=127462&&e<=127487}function jN(e,n,r,a){return n===1&&r>Math.ceil(a*1.5)&&e!==void 0&&e>255&&!IN(e)&&!wm(e)&&!NN(e)}function ix(e){return wm(e)||BN(e)}function zN(){return{css:{canvas:Eu(),cell:Eu()},device:{canvas:Eu(),cell:Eu(),char:{width:0,height:0,left:0,top:0}}}}function Eu(){return{width:0,height:0}}function $N(e,n,r=0){return(e-(Math.round(n)*2-r))%(Math.round(n)*2)}var kn=0,mn=0,er=!1,Dr=!1,Tu=!1,Jn,up=0,PN=class{constructor(e,n,r,a,o,f){this._terminal=e,this._optionService=n,this._selectionRenderModel=r,this._decorationService=a,this._coreBrowserService=o,this._themeService=f,this.result={fg:0,bg:0,ext:0}}resolve(e,n,r,a){if(this.result.bg=e.bg,this.result.fg=e.fg,this.result.ext=e.bg&268435456?e.extended.ext:0,mn=0,kn=0,Dr=!1,er=!1,Tu=!1,Jn=this._themeService.colors,up=0,e.getCode()!==0&&e.extended.underlineStyle===4){let o=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));up=n*a%(Math.round(o)*2)}if(this._decorationService.forEachDecorationAtCell(n,r,"bottom",o=>{o.backgroundColorRGB&&(mn=o.backgroundColorRGB.rgba>>8&16777215,Dr=!0),o.foregroundColorRGB&&(kn=o.foregroundColorRGB.rgba>>8&16777215,er=!0)}),Tu=this._selectionRenderModel.isCellSelected(this._terminal,n,r),Tu){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:mn=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:mn=(this.result.fg&16777215)<<8|255;break;default:mn=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:mn=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:mn=(this.result.bg&16777215)<<8|255;break}mn=ta.blend(mn,(this._coreBrowserService.isFocused?Jn.selectionBackgroundOpaque:Jn.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else mn=(this._coreBrowserService.isFocused?Jn.selectionBackgroundOpaque:Jn.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(Dr=!0,Jn.selectionForeground&&(kn=Jn.selectionForeground.rgba>>8&16777215,er=!0),ix(e.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)kn=(this._coreBrowserService.isFocused?Jn.selectionBackgroundOpaque:Jn.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:kn=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:kn=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:kn=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:kn=(this.result.fg&16777215)<<8|255;break;default:kn=this._themeService.colors.foreground.rgba}kn=ta.blend(kn,(this._coreBrowserService.isFocused?Jn.selectionBackgroundOpaque:Jn.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}er=!0}}this._decorationService.forEachDecorationAtCell(n,r,"top",o=>{o.backgroundColorRGB&&(mn=o.backgroundColorRGB.rgba>>8&16777215,Dr=!0),o.foregroundColorRGB&&(kn=o.foregroundColorRGB.rgba>>8&16777215,er=!0)}),Dr&&(Tu?mn=e.bg&-16777216&-134217729|mn|50331648:mn=e.bg&-16777216|mn|50331648),er&&(kn=e.fg&-16777216&-67108865|kn|50331648),this.result.fg&67108864&&(Dr&&!er&&((this.result.bg&50331648)===0?kn=this.result.fg&-134217728|Jn.background.rgba>>8&16777215&16777215|50331648:kn=this.result.fg&-134217728|this.result.bg&67108863,er=!0),!Dr&&er&&((this.result.fg&50331648)===0?mn=this.result.bg&-67108864|Jn.foreground.rgba>>8&16777215&16777215|50331648:mn=this.result.bg&-67108864|this.result.fg&67108863,Dr=!0)),Jn=void 0,this.result.bg=Dr?mn:this.result.bg,this.result.fg=er?kn:this.result.fg,this.result.ext&=536870911,this.result.ext|=up<<29&3758096384}},HN=.5,rx=kN||RN?"bottom":"ideographic",UN={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]},FN={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]},qN={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(e,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"║":{1:(e,n)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╒":{1:(e,n)=>`M.5,1 L.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╓":{1:(e,n)=>`M${.5-e},1 L${.5-e},.5 L1,.5 M${.5+e},.5 L${.5+e},1`},"╔":{1:(e,n)=>`M1,${.5-n} L${.5-e},${.5-n} L${.5-e},1 M1,${.5+n} L${.5+e},${.5+n} L${.5+e},1`},"╕":{1:(e,n)=>`M0,${.5-n} L.5,${.5-n} L.5,1 M0,${.5+n} L.5,${.5+n}`},"╖":{1:(e,n)=>`M${.5+e},1 L${.5+e},.5 L0,.5 M${.5-e},.5 L${.5-e},1`},"╗":{1:(e,n)=>`M0,${.5+n} L${.5-e},${.5+n} L${.5-e},1 M0,${.5-n} L${.5+e},${.5-n} L${.5+e},1`},"╘":{1:(e,n)=>`M.5,0 L.5,${.5+n} L1,${.5+n} M.5,${.5-n} L1,${.5-n}`},"╙":{1:(e,n)=>`M1,.5 L${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╚":{1:(e,n)=>`M1,${.5-n} L${.5+e},${.5-n} L${.5+e},0 M1,${.5+n} L${.5-e},${.5+n} L${.5-e},0`},"╛":{1:(e,n)=>`M0,${.5+n} L.5,${.5+n} L.5,0 M0,${.5-n} L.5,${.5-n}`},"╜":{1:(e,n)=>`M0,.5 L${.5+e},.5 L${.5+e},0 M${.5-e},.5 L${.5-e},0`},"╝":{1:(e,n)=>`M0,${.5-n} L${.5-e},${.5-n} L${.5-e},0 M0,${.5+n} L${.5+e},${.5+n} L${.5+e},0`},"╞":{1:(e,n)=>`M.5,0 L.5,1 M.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╟":{1:(e,n)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1 M${.5+e},.5 L1,.5`},"╠":{1:(e,n)=>`M${.5-e},0 L${.5-e},1 M1,${.5+n} L${.5+e},${.5+n} L${.5+e},1 M1,${.5-n} L${.5+e},${.5-n} L${.5+e},0`},"╡":{1:(e,n)=>`M.5,0 L.5,1 M0,${.5-n} L.5,${.5-n} M0,${.5+n} L.5,${.5+n}`},"╢":{1:(e,n)=>`M0,.5 L${.5-e},.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╣":{1:(e,n)=>`M${.5+e},0 L${.5+e},1 M0,${.5+n} L${.5-e},${.5+n} L${.5-e},1 M0,${.5-n} L${.5-e},${.5-n} L${.5-e},0`},"╤":{1:(e,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n} M.5,${.5+n} L.5,1`},"╥":{1:(e,n)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},1 M${.5+e},.5 L${.5+e},1`},"╦":{1:(e,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L${.5-e},${.5+n} L${.5-e},1 M1,${.5+n} L${.5+e},${.5+n} L${.5+e},1`},"╧":{1:(e,n)=>`M.5,0 L.5,${.5-n} M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╨":{1:(e,n)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╩":{1:(e,n)=>`M0,${.5+n} L1,${.5+n} M0,${.5-n} L${.5-e},${.5-n} L${.5-e},0 M1,${.5-n} L${.5+e},${.5-n} L${.5+e},0`},"╪":{1:(e,n)=>`M.5,0 L.5,1 M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╫":{1:(e,n)=>`M0,.5 L1,.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╬":{1:(e,n)=>`M0,${.5+n} L${.5-e},${.5+n} L${.5-e},1 M1,${.5+n} L${.5+e},${.5+n} L${.5+e},1 M0,${.5-n} L${.5-e},${.5-n} L${.5-e},0 M1,${.5-n} L${.5+e},${.5-n} L${.5+e},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(e,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,1,.5`},"╮":{1:(e,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,0,.5`},"╯":{1:(e,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,0,.5`},"╰":{1:(e,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,1,.5`}},Wl={"":{d:"M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655",type:0},"":{d:"M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5",type:0},"":{d:"M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82",type:0},"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}};Wl[""]=Wl[""];Wl[""]=Wl[""];function WN(e,n,r,a,o,f,_,c){let u=UN[n];if(u)return GN(e,u,r,a,o,f),!0;let d=FN[n];if(d)return KN(e,d,r,a,o,f),!0;let S=qN[n];if(S)return VN(e,S,r,a,o,f,c),!0;let g=Wl[n];return g?(YN(e,g,r,a,o,f,_,c),!0):!1}function GN(e,n,r,a,o,f){for(let _=0;_<n.length;_++){let c=n[_],u=o/8,d=f/8;e.fillRect(r+c.x*u,a+c.y*d,c.w*u,c.h*d)}}var sy=new Map;function KN(e,n,r,a,o,f){let _=sy.get(n);_||(_=new Map,sy.set(n,_));let c=e.fillStyle;if(typeof c!="string")throw new Error(`Unexpected fillStyle type "${c}"`);let u=_.get(c);if(!u){let d=n[0].length,S=n.length,g=e.canvas.ownerDocument.createElement("canvas");g.width=d,g.height=S;let C=hn(g.getContext("2d")),E=new ImageData(d,S),A,x,p,v;if(c.startsWith("#"))A=parseInt(c.slice(1,3),16),x=parseInt(c.slice(3,5),16),p=parseInt(c.slice(5,7),16),v=c.length>7&&parseInt(c.slice(7,9),16)||1;else if(c.startsWith("rgba"))[A,x,p,v]=c.substring(5,c.length-1).split(",").map(h=>parseFloat(h));else throw new Error(`Unexpected fillStyle color format "${c}" when drawing pattern glyph`);for(let h=0;h<S;h++)for(let b=0;b<d;b++)E.data[(h*d+b)*4]=A,E.data[(h*d+b)*4+1]=x,E.data[(h*d+b)*4+2]=p,E.data[(h*d+b)*4+3]=n[h][b]*(v*255);C.putImageData(E,0,0),u=hn(e.createPattern(g,null)),_.set(c,u)}e.fillStyle=u,e.fillRect(r,a,o,f)}function VN(e,n,r,a,o,f,_){e.strokeStyle=e.fillStyle;for(let[c,u]of Object.entries(n)){e.beginPath(),e.lineWidth=_*Number.parseInt(c);let d;if(typeof u=="function"){let S=.15/f*o;d=u(.15,S)}else d=u;for(let S of d.split(" ")){let g=S[0],C=sx[g];if(!C){console.error(`Could not find drawing instructions for "${g}"`);continue}let E=S.substring(1).split(",");!E[0]||!E[1]||C(e,ax(E,o,f,r,a,!0,_))}e.stroke(),e.closePath()}}function YN(e,n,r,a,o,f,_,c){let u=new Path2D;u.rect(r,a,o,f),e.clip(u),e.beginPath();let d=_/12;e.lineWidth=c*d;for(let S of n.d.split(" ")){let g=S[0],C=sx[g];if(!C){console.error(`Could not find drawing instructions for "${g}"`);continue}let E=S.substring(1).split(",");!E[0]||!E[1]||C(e,ax(E,o,f,r,a,!1,c,(n.leftPadding??0)*(d/2),(n.rightPadding??0)*(d/2)))}n.type===1?(e.strokeStyle=e.fillStyle,e.stroke()):e.fill(),e.closePath()}function ay(e,n,r=0){return Math.max(Math.min(e,n),r)}var sx={C:(e,n)=>e.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5]),L:(e,n)=>e.lineTo(n[0],n[1]),M:(e,n)=>e.moveTo(n[0],n[1])};function ax(e,n,r,a,o,f,_,c=0,u=0){let d=e.map(S=>parseFloat(S)||parseInt(S));if(d.length<2)throw new Error("Too few arguments for instruction");for(let S=0;S<d.length;S+=2)d[S]*=n-c*_-u*_,f&&d[S]!==0&&(d[S]=ay(Math.round(d[S]+.5)-.5,n,0)),d[S]+=a+c*_;for(let S=1;S<d.length;S+=2)d[S]*=r,f&&d[S]!==0&&(d[S]=ay(Math.round(d[S]+.5)-.5,r,0)),d[S]+=o;return d}var oy=class{constructor(){this._data={}}set(e,n,r){this._data[e]||(this._data[e]={}),this._data[e][n]=r}get(e,n){return this._data[e]?this._data[e][n]:void 0}clear(){this._data={}}},ly=class{constructor(){this._data=new oy}set(e,n,r,a,o){this._data.get(e,n)||this._data.set(e,n,new oy),this._data.get(e,n).set(r,a,o)}get(e,n,r,a){return this._data.get(e,n)?.get(r,a)}clear(){this._data.clear()}},ox=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),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(e){this._idleCallback=void 0;let n=0,r=0,a=e.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(n=performance.now(),this._tasks[this._i]()||this._i++,n=Math.max(1,performance.now()-n),r=Math.max(n,r),o=e.timeRemaining(),r*1.5>o){a-n<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(a-n))}ms`),this._start();return}a=o}this.clear()}},XN=class extends ox{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let n=performance.now()+e;return{timeRemaining:()=>Math.max(0,n-performance.now())}}},ZN=class extends ox{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},JN=!Sm&&"requestIdleCallback"in window?ZN:XN,eo=class lx{constructor(){this.fg=0,this.bg=0,this.extended=new cx}static toColorRGB(n){return[n>>>16&255,n>>>8&255,n&255]}static fromColorRGB(n){return(n[0]&255)<<16|(n[1]&255)<<8|n[2]&255}clone(){let n=new lx;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},cx=class ux{constructor(n=0,r=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=r}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(n){this._ext&=-67108864,this._ext|=n&67108863}get urlId(){return this._urlId}set urlId(n){this._urlId=n}get underlineVariantOffset(){let n=(this._ext&3758096384)>>29;return n<0?n^4294967288:n}set underlineVariantOffset(n){this._ext&=536870911,this._ext|=n<<29&3758096384}clone(){return new ux(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},QN=globalThis.performance&&typeof globalThis.performance.now=="function",e8=class hx{static create(n){return new hx(n)}constructor(n){this._now=QN&&n===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},jr;(e=>{e.None=()=>Gi.None;function n(W,j){return g(W,()=>{},0,void 0,!0,void 0,j)}e.defer=n;function r(W){return(j,G=null,ee)=>{let q=!1,V;return V=W(Y=>{if(!q)return V?V.dispose():q=!0,j.call(G,Y)},null,ee),q&&V.dispose(),V}}e.once=r;function a(W,j,G){return d((ee,q=null,V)=>W(Y=>ee.call(q,j(Y)),null,V),G)}e.map=a;function o(W,j,G){return d((ee,q=null,V)=>W(Y=>{j(Y),ee.call(q,Y)},null,V),G)}e.forEach=o;function f(W,j,G){return d((ee,q=null,V)=>W(Y=>j(Y)&&ee.call(q,Y),null,V),G)}e.filter=f;function _(W){return W}e.signal=_;function c(...W){return(j,G=null,ee)=>{let q=QC(...W.map(V=>V(Y=>j.call(G,Y))));return S(q,ee)}}e.any=c;function u(W,j,G,ee){let q=G;return a(W,V=>(q=j(q,V),q),ee)}e.reduce=u;function d(W,j){let G,ee={onWillAddFirstListener(){G=W(q.fire,q)},onDidRemoveLastListener(){G?.dispose()}},q=new Dt(ee);return j?.add(q),q.event}function S(W,j){return j instanceof Array?j.push(W):j&&j.add(W),W}function g(W,j,G=100,ee=!1,q=!1,V,Y){let D,I,N,P=0,Z,ae={leakWarningThreshold:V,onWillAddFirstListener(){D=W(_e=>{P++,I=j(I,_e),ee&&!N&&(ce.fire(I),I=void 0),Z=()=>{let Q=I;I=void 0,N=void 0,(!ee||P>1)&&ce.fire(Q),P=0},typeof G=="number"?(clearTimeout(N),N=setTimeout(Z,G)):N===void 0&&(N=0,queueMicrotask(Z))})},onWillRemoveListener(){q&&P>0&&Z?.()},onDidRemoveLastListener(){Z=void 0,D.dispose()}},ce=new Dt(ae);return Y?.add(ce),ce.event}e.debounce=g;function C(W,j=0,G){return e.debounce(W,(ee,q)=>ee?(ee.push(q),ee):[q],j,void 0,!0,void 0,G)}e.accumulate=C;function E(W,j=(ee,q)=>ee===q,G){let ee=!0,q;return f(W,V=>{let Y=ee||!j(V,q);return ee=!1,q=V,Y},G)}e.latch=E;function A(W,j,G){return[e.filter(W,j,G),e.filter(W,ee=>!j(ee),G)]}e.split=A;function x(W,j=!1,G=[],ee){let q=G.slice(),V=W(I=>{q?q.push(I):D.fire(I)});ee&&ee.add(V);let Y=()=>{q?.forEach(I=>D.fire(I)),q=null},D=new Dt({onWillAddFirstListener(){V||(V=W(I=>D.fire(I)),ee&&ee.add(V))},onDidAddFirstListener(){q&&(j?setTimeout(Y):Y())},onDidRemoveLastListener(){V&&V.dispose(),V=null}});return ee&&ee.add(D),D.event}e.buffer=x;function p(W,j){return(G,ee,q)=>{let V=j(new h);return W(function(Y){let D=V.evaluate(Y);D!==v&&G.call(ee,D)},void 0,q)}}e.chain=p;let v=Symbol("HaltChainable");class h{constructor(){this.steps=[]}map(j){return this.steps.push(j),this}forEach(j){return this.steps.push(G=>(j(G),G)),this}filter(j){return this.steps.push(G=>j(G)?G:v),this}reduce(j,G){let ee=G;return this.steps.push(q=>(ee=j(ee,q),ee)),this}latch(j=(G,ee)=>G===ee){let G=!0,ee;return this.steps.push(q=>{let V=G||!j(q,ee);return G=!1,ee=q,V?q:v}),this}evaluate(j){for(let G of this.steps)if(j=G(j),j===v)break;return j}}function b(W,j,G=ee=>ee){let ee=(...D)=>Y.fire(G(...D)),q=()=>W.on(j,ee),V=()=>W.removeListener(j,ee),Y=new Dt({onWillAddFirstListener:q,onDidRemoveLastListener:V});return Y.event}e.fromNodeEventEmitter=b;function T(W,j,G=ee=>ee){let ee=(...D)=>Y.fire(G(...D)),q=()=>W.addEventListener(j,ee),V=()=>W.removeEventListener(j,ee),Y=new Dt({onWillAddFirstListener:q,onDidRemoveLastListener:V});return Y.event}e.fromDOMEventEmitter=T;function R(W){return new Promise(j=>r(W)(j))}e.toPromise=R;function L(W){let j=new Dt;return W.then(G=>{j.fire(G)},()=>{j.fire(void 0)}).finally(()=>{j.dispose()}),j.event}e.fromPromise=L;function M(W,j){return W(G=>j.fire(G))}e.forward=M;function k(W,j,G){return j(G),W(ee=>j(ee))}e.runAndSubscribe=k;class B{constructor(j,G){this._observable=j,this._counter=0,this._hasChanged=!1;let ee={onWillAddFirstListener:()=>{j.addObserver(this)},onDidRemoveLastListener:()=>{j.removeObserver(this)}};this.emitter=new Dt(ee),G&&G.add(this.emitter)}beginUpdate(j){this._counter++}handlePossibleChange(j){}handleChange(j,G){this._hasChanged=!0}endUpdate(j){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function F(W,j){return new B(W,j).emitter.event}e.fromObservable=F;function U(W){return(j,G,ee)=>{let q=0,V=!1,Y={beginUpdate(){q++},endUpdate(){q--,q===0&&(W.reportChanges(),V&&(V=!1,j.call(G)))},handlePossibleChange(){},handleChange(){V=!0}};W.addObserver(Y),W.reportChanges();let D={dispose(){W.removeObserver(Y)}};return ee instanceof lo?ee.add(D):Array.isArray(ee)&&ee.push(D),D}}e.fromObservableLight=U})(jr||={});var Eg=class Tg{constructor(n){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${n}_${Tg._idPool++}`,Tg.all.add(this)}start(n){this._stopWatch=new e8,this.listenerCount=n}stop(){if(this._stopWatch){let n=this._stopWatch.elapsed();this.durations.push(n),this.elapsedOverall+=n,this.invocationCount+=1,this._stopWatch=void 0}}};Eg.all=new Set,Eg._idPool=0;var t8=Eg,n8=-1,dx=class fx{constructor(n,r,a=(fx._idPool++).toString(16).padStart(3,"0")){this._errorHandler=n,this.threshold=r,this.name=a,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(n,r){let a=this.threshold;if(a<=0||r<a)return;this._stacks||(this._stacks=new Map);let o=this._stacks.get(n.value)||0;if(this._stacks.set(n.value,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=a*.5;let[f,_]=this.getMostFrequentStack(),c=`[${this.name}] potential listener LEAK detected, having ${r} listeners already. MOST frequent listener (${_}):`;console.warn(c),console.warn(f);let u=new s8(c,f);this._errorHandler(u)}return()=>{let f=this._stacks.get(n.value)||0;this._stacks.set(n.value,f-1)}}getMostFrequentStack(){if(!this._stacks)return;let n,r=0;for(let[a,o]of this._stacks)(!n||r<o)&&(n=[a,o],r=o);return n}};dx._idPool=1;var i8=dx,r8=class px{constructor(n){this.value=n}static create(){let n=new Error;return new px(n.stack??"")}print(){console.warn(this.value.split(`
710
+ `).slice(2).join(`
711
+ `))}},s8=class extends Error{constructor(e,n){super(e),this.name="ListenerLeakError",this.stack=n}},a8=class extends Error{constructor(e,n){super(e),this.name="ListenerRefusalError",this.stack=n}},o8=0,hp=class{constructor(e){this.value=e,this.id=o8++}},l8=2,c8,Dt=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new i8(e?.onListenerError??cp,this._options?.leakWarningThreshold??n8):void 0,this._perfMon=this._options?._profName?new t8(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,n,r)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let _=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(_);let c=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],u=new a8(`${_}. HINT: Stack shows most frequent listener (${c[1]}-times)`,c[0]);return(this._options?.onListenerError||cp)(u),Gi.None}if(this._disposed)return Gi.None;n&&(e=e.bind(n));let a=new hp(e),o;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(a.stack=r8.create(),o=this._leakageMon.check(a.stack,this._size+1)),this._listeners?this._listeners instanceof hp?(this._deliveryQueue??=new u8,this._listeners=[this._listeners,a]):this._listeners.push(a):(this._options?.onWillAddFirstListener?.(this),this._listeners=a,this._options?.onDidAddFirstListener?.(this)),this._size++;let f=Bn(()=>{o?.(),this._removeListener(a)});return r instanceof lo?r.add(f):Array.isArray(r)&&r.push(f),f},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let n=this._listeners,r=n.indexOf(e);if(r===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,n[r]=void 0;let a=this._deliveryQueue.current===this;if(this._size*l8<=n.length){let o=0;for(let f=0;f<n.length;f++)n[f]?n[o++]=n[f]:a&&(this._deliveryQueue.end--,o<this._deliveryQueue.i&&this._deliveryQueue.i--);n.length=o}}_deliver(e,n){if(!e)return;let r=this._options?.onListenerError||cp;if(!r){e.value(n);return}try{e.value(n)}catch(a){r(a)}}_deliverQueue(e){let n=e.current._listeners;for(;e.i<e.end;)this._deliver(n[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof hp)this._deliver(this._listeners,e);else{let n=this._deliveryQueue;n.enqueue(this,e,this._listeners.length),this._deliverQueue(n)}this._perfMon?.stop()}hasListeners(){return this._size>0}},u8=class{constructor(){this.i=-1,this.end=0}enqueue(e,n,r){this.i=0,this.end=r,this.current=e,this.value=n}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},cy={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}},El=2,Tl,vs=class Za{constructor(n,r,a){this._document=n,this._config=r,this._unicodeService=a,this._didWarmUp=!1,this._cacheMap=new ly,this._cacheMapCombined=new ly,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new eo,this._textureSize=512,this._onAddTextureAtlasCanvas=new Dt,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new Dt,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=gx(n,this._config.deviceCellWidth*4+El*2,this._config.deviceCellHeight+El*2),this._tmpCtx=hn(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){this._tmpCanvas.remove();for(let n of this.pages)n.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let n=new JN;for(let r=33;r<126;r++)n.enqueue(()=>{if(!this._cacheMap.get(r,0,0,0)){let a=this._drawToCache(r,0,0,0,!1,void 0);this._cacheMap.set(r,0,0,0,a)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(!(this._pages[0].currentRow.x===0&&this._pages[0].currentRow.y===0)){for(let n of this._pages)n.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(Za.maxAtlasPages&&this._pages.length>=Math.max(4,Za.maxAtlasPages)){let r=this._pages.filter(d=>d.canvas.width*2<=(Za.maxTextureSize||4096)).sort((d,S)=>S.canvas.width!==d.canvas.width?S.canvas.width-d.canvas.width:S.percentageUsed-d.percentageUsed),a=-1,o=0;for(let d=0;d<r.length;d++)if(r[d].canvas.width!==o)a=d,o=r[d].canvas.width;else if(d-a===3)break;let f=r.slice(a,a+4),_=f.map(d=>d.glyphs[0].texturePage).sort((d,S)=>d>S?1:-1),c=this.pages.length-f.length,u=this._mergePages(f,c);u.version++;for(let d=_.length-1;d>=0;d--)this._deletePage(_[d]);this.pages.push(u),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(u.canvas)}let n=new dp(this._document,this._textureSize);return this._pages.push(n),this._activePages.push(n),this._onAddTextureAtlasCanvas.fire(n.canvas),n}_mergePages(n,r){let a=n[0].canvas.width*2,o=new dp(this._document,a,n);for(let[f,_]of n.entries()){let c=f*_.canvas.width%a,u=Math.floor(f/2)*_.canvas.height;o.ctx.drawImage(_.canvas,c,u);for(let S of _.glyphs)S.texturePage=r,S.sizeClipSpace.x=S.size.x/a,S.sizeClipSpace.y=S.size.y/a,S.texturePosition.x+=c,S.texturePosition.y+=u,S.texturePositionClipSpace.x=S.texturePosition.x/a,S.texturePositionClipSpace.y=S.texturePosition.y/a;this._onRemoveTextureAtlasCanvas.fire(_.canvas);let d=this._activePages.indexOf(_);d!==-1&&this._activePages.splice(d,1)}return o}_deletePage(n){this._pages.splice(n,1);for(let r=n;r<this._pages.length;r++){let a=this._pages[r];for(let o of a.glyphs)o.texturePage--;a.version++}}getRasterizedGlyphCombinedChar(n,r,a,o,f,_){return this._getFromCacheMap(this._cacheMapCombined,n,r,a,o,f,_)}getRasterizedGlyph(n,r,a,o,f,_){return this._getFromCacheMap(this._cacheMap,n,r,a,o,f,_)}_getFromCacheMap(n,r,a,o,f,_,c){return Tl=n.get(r,a,o,f),Tl||(Tl=this._drawToCache(r,a,o,f,_,c),n.set(r,a,o,f,Tl)),Tl}_getColorFromAnsiIndex(n){if(n>=this._config.colors.ansi.length)throw new Error("No color found for idx "+n);return this._config.colors.ansi[n]}_getBackgroundColor(n,r,a,o){if(this._config.allowTransparency)return Ai;let f;switch(n){case 16777216:case 33554432:f=this._getColorFromAnsiIndex(r);break;case 50331648:let _=eo.toColorRGB(r);f=$n.toColor(_[0],_[1],_[2]);break;default:a?f=Dl.opaque(this._config.colors.foreground):f=this._config.colors.background;break}return this._config.allowTransparency||(f=Dl.opaque(f)),f}_getForegroundColor(n,r,a,o,f,_,c,u,d,S){let g=this._getMinimumContrastColor(n,r,a,o,f,_,c,d,u,S);if(g)return g;let C;switch(f){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&d&&_<8&&(_+=8),C=this._getColorFromAnsiIndex(_);break;case 50331648:let E=eo.toColorRGB(_);C=$n.toColor(E[0],E[1],E[2]);break;default:c?C=this._config.colors.background:C=this._config.colors.foreground}return this._config.allowTransparency&&(C=Dl.opaque(C)),u&&(C=Dl.multiplyOpacity(C,HN)),C}_resolveBackgroundRgba(n,r,a){switch(n){case 16777216:case 33554432:return this._getColorFromAnsiIndex(r).rgba;case 50331648:return r<<8;default:return a?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(n,r,a,o){switch(n){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&o&&r<8&&(r+=8),this._getColorFromAnsiIndex(r).rgba;case 50331648:return r<<8;default:return a?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(n,r,a,o,f,_,c,u,d,S){if(this._config.minimumContrastRatio===1||S)return;let g=this._getContrastCache(d),C=g.getColor(n,o);if(C!==void 0)return C||void 0;let E=this._resolveBackgroundRgba(r,a,c),A=this._resolveForegroundRgba(f,_,c,u),x=ta.ensureContrastRatio(E,A,this._config.minimumContrastRatio/(d?2:1));if(!x){g.setColor(n,o,null);return}let p=$n.toColor(x>>24&255,x>>16&255,x>>8&255);return g.setColor(n,o,p),p}_getContrastCache(n){return n?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(n,r,a,o,f,_){let c=typeof n=="number"?String.fromCharCode(n):n;_&&this._tmpCanvas.parentElement!==_&&(this._tmpCanvas.style.display="none",_.append(this._tmpCanvas));let u=Math.min(this._config.deviceCellWidth*Math.max(c.length,2)+El*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width<u&&(this._tmpCanvas.width=u);let d=Math.min(this._config.deviceCellHeight+El*4,this._textureSize);if(this._tmpCanvas.height<d&&(this._tmpCanvas.height=d),this._tmpCtx.save(),this._workAttributeData.fg=a,this._workAttributeData.bg=r,this._workAttributeData.extended.ext=o,!!this._workAttributeData.isInvisible())return cy;let S=!!this._workAttributeData.isBold(),g=!!this._workAttributeData.isInverse(),C=!!this._workAttributeData.isDim(),E=!!this._workAttributeData.isItalic(),A=!!this._workAttributeData.isUnderline(),x=!!this._workAttributeData.isStrikethrough(),p=!!this._workAttributeData.isOverline(),v=this._workAttributeData.getFgColor(),h=this._workAttributeData.getFgColorMode(),b=this._workAttributeData.getBgColor(),T=this._workAttributeData.getBgColorMode();if(g){let I=v;v=b,b=I;let N=h;h=T,T=N}let R=this._getBackgroundColor(T,b,g,C);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=R.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";let L=S?this._config.fontWeightBold:this._config.fontWeight,M=E?"italic":"";this._tmpCtx.font=`${M} ${L} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=rx;let k=c.length===1&&wm(c.charCodeAt(0)),B=c.length===1&&ON(c.charCodeAt(0)),F=this._getForegroundColor(r,T,b,a,h,v,g,C,S,ix(c.charCodeAt(0)));this._tmpCtx.fillStyle=F.css;let U=B?0:El*2,W=!1;this._config.customGlyphs!==!1&&(W=WN(this._tmpCtx,c,U,U,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let j=!k,G;if(typeof n=="number"?G=this._unicodeService.wcwidth(n):G=this._unicodeService.getStringCellWidth(n),A){this._tmpCtx.save();let I=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),N=I%2===1?.5:0;if(this._tmpCtx.lineWidth=I,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())j=!1,this._tmpCtx.strokeStyle=`rgb(${eo.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{j=!1;let Q=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Q<8&&(Q+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Q).css}this._tmpCtx.beginPath();let P=U,Z=Math.ceil(U+this._config.deviceCharHeight)-N-(f?I*2:0),ae=Z+I,ce=Z+I*2,_e=this._workAttributeData.getUnderlineVariantOffset();for(let Q=0;Q<G;Q++){this._tmpCtx.save();let $=P+Q*this._config.deviceCellWidth,oe=P+(Q+1)*this._config.deviceCellWidth,ge=$+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo($,Z),this._tmpCtx.lineTo(oe,Z),this._tmpCtx.moveTo($,ce),this._tmpCtx.lineTo(oe,ce);break;case 3:let Se=I<=1?ce:Math.ceil(U+this._config.deviceCharHeight-I/2)-N,ye=I<=1?Z:Math.ceil(U+this._config.deviceCharHeight+I/2)-N,Pe=new Path2D;Pe.rect($,Z,this._config.deviceCellWidth,ce-Z),this._tmpCtx.clip(Pe),this._tmpCtx.moveTo($-this._config.deviceCellWidth/2,ae),this._tmpCtx.bezierCurveTo($-this._config.deviceCellWidth/2,ye,$,ye,$,ae),this._tmpCtx.bezierCurveTo($,Se,ge,Se,ge,ae),this._tmpCtx.bezierCurveTo(ge,ye,oe,ye,oe,ae),this._tmpCtx.bezierCurveTo(oe,Se,oe+this._config.deviceCellWidth/2,Se,oe+this._config.deviceCellWidth/2,ae);break;case 4:let qe=_e===0?0:_e>=I?I*2-_e:I-_e;_e>=I||qe===0?(this._tmpCtx.setLineDash([Math.round(I),Math.round(I)]),this._tmpCtx.moveTo($+qe,Z),this._tmpCtx.lineTo(oe,Z)):(this._tmpCtx.setLineDash([Math.round(I),Math.round(I)]),this._tmpCtx.moveTo($,Z),this._tmpCtx.lineTo($+qe,Z),this._tmpCtx.moveTo($+qe+I,Z),this._tmpCtx.lineTo(oe,Z)),_e=$N(oe-$,I,_e);break;case 5:let Xe=.6,xt=.3,Ne=oe-$,en=Math.floor(Xe*Ne),yn=Math.floor(xt*Ne),Sn=Ne-en-yn;this._tmpCtx.setLineDash([en,yn,Sn]),this._tmpCtx.moveTo($,Z),this._tmpCtx.lineTo(oe,Z);break;default:this._tmpCtx.moveTo($,Z),this._tmpCtx.lineTo(oe,Z);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!W&&this._config.fontSize>=12&&!this._config.allowTransparency&&c!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let Q=this._tmpCtx.measureText(c);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Q&&Q.actualBoundingBoxDescent>0){this._tmpCtx.save();let $=new Path2D;$.rect(P,Z-Math.ceil(I/2),this._config.deviceCellWidth*G,ce-Z+Math.ceil(I/2)),this._tmpCtx.clip($),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=R.css,this._tmpCtx.strokeText(c,U,U+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(p){let I=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),N=I%2===1?.5:0;this._tmpCtx.lineWidth=I,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(U,U+N),this._tmpCtx.lineTo(U+this._config.deviceCharWidth*G,U+N),this._tmpCtx.stroke()}if(W||this._tmpCtx.fillText(c,U,U+this._config.deviceCharHeight),c==="_"&&!this._config.allowTransparency){let I=fp(this._tmpCtx.getImageData(U,U,this._config.deviceCellWidth,this._config.deviceCellHeight),R,F,j);if(I)for(let N=1;N<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=R.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(c,U,U+this._config.deviceCharHeight-N),I=fp(this._tmpCtx.getImageData(U,U,this._config.deviceCellWidth,this._config.deviceCellHeight),R,F,j),!!I);N++);}if(x){let I=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),N=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=I,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(U,U+Math.floor(this._config.deviceCharHeight/2)-N),this._tmpCtx.lineTo(U+this._config.deviceCharWidth*G,U+Math.floor(this._config.deviceCharHeight/2)-N),this._tmpCtx.stroke()}this._tmpCtx.restore();let ee=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),q;if(this._config.allowTransparency?q=h8(ee):q=fp(ee,R,F,j),q)return cy;let V=this._findGlyphBoundingBox(ee,this._workBoundingBox,u,B,W,U),Y,D;for(;;){if(this._activePages.length===0){let I=this._createNewPage();Y=I,D=I.currentRow,D.height=V.size.y;break}Y=this._activePages[this._activePages.length-1],D=Y.currentRow;for(let I of this._activePages)V.size.y<=I.currentRow.height&&(Y=I,D=I.currentRow);for(let I=this._activePages.length-1;I>=0;I--)for(let N of this._activePages[I].fixedRows)N.height<=D.height&&V.size.y<=N.height&&(Y=this._activePages[I],D=N);if(V.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new dp(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),Y=this._overflowSizePage,D=this._overflowSizePage.currentRow,D.x+V.size.x>=Y.canvas.width&&(D.x=0,D.y+=D.height,D.height=0);break}if(D.y+V.size.y>=Y.canvas.height||D.height>V.size.y+2){let I=!1;if(Y.currentRow.y+Y.currentRow.height+V.size.y>=Y.canvas.height){let N;for(let P of this._activePages)if(P.currentRow.y+P.currentRow.height+V.size.y<P.canvas.height){N=P;break}if(N)Y=N;else if(Za.maxAtlasPages&&this._pages.length>=Za.maxAtlasPages&&D.y+V.size.y<=Y.canvas.height&&D.height>=V.size.y&&D.x+V.size.x<=Y.canvas.width)I=!0;else{let P=this._createNewPage();Y=P,D=P.currentRow,D.height=V.size.y,I=!0}}I||(Y.currentRow.height>0&&Y.fixedRows.push(Y.currentRow),D={x:0,y:Y.currentRow.y+Y.currentRow.height,height:V.size.y},Y.fixedRows.push(D),Y.currentRow={x:0,y:D.y+D.height,height:0})}if(D.x+V.size.x<=Y.canvas.width)break;D===Y.currentRow?(D.x=0,D.y+=D.height,D.height=0):Y.fixedRows.splice(Y.fixedRows.indexOf(D),1)}return V.texturePage=this._pages.indexOf(Y),V.texturePosition.x=D.x,V.texturePosition.y=D.y,V.texturePositionClipSpace.x=D.x/Y.canvas.width,V.texturePositionClipSpace.y=D.y/Y.canvas.height,V.sizeClipSpace.x/=Y.canvas.width,V.sizeClipSpace.y/=Y.canvas.height,D.height=Math.max(D.height,V.size.y),D.x+=V.size.x,Y.ctx.putImageData(ee,V.texturePosition.x-this._workBoundingBox.left,V.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,V.size.x,V.size.y),Y.addGlyph(V),Y.version++,V}_findGlyphBoundingBox(n,r,a,o,f,_){r.top=0;let c=o?this._config.deviceCellHeight:this._tmpCanvas.height,u=o?this._config.deviceCellWidth:a,d=!1;for(let S=0;S<c;S++){for(let g=0;g<u;g++){let C=S*this._tmpCanvas.width*4+g*4+3;if(n.data[C]!==0){r.top=S,d=!0;break}}if(d)break}r.left=0,d=!1;for(let S=0;S<_+u;S++){for(let g=0;g<c;g++){let C=g*this._tmpCanvas.width*4+S*4+3;if(n.data[C]!==0){r.left=S,d=!0;break}}if(d)break}r.right=u,d=!1;for(let S=_+u-1;S>=_;S--){for(let g=0;g<c;g++){let C=g*this._tmpCanvas.width*4+S*4+3;if(n.data[C]!==0){r.right=S,d=!0;break}}if(d)break}r.bottom=c,d=!1;for(let S=c-1;S>=0;S--){for(let g=0;g<u;g++){let C=S*this._tmpCanvas.width*4+g*4+3;if(n.data[C]!==0){r.bottom=S,d=!0;break}}if(d)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:r.right-r.left+1,y:r.bottom-r.top+1},sizeClipSpace:{x:r.right-r.left+1,y:r.bottom-r.top+1},offset:{x:-r.left+_+(o||f?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-r.top+_+(o||f?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}},dp=class{constructor(e,n,r){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],r)for(let a of r)this._glyphs.push(...a.glyphs),this._usedPixels+=a._usedPixels;this.canvas=gx(e,n,n),this.ctx=hn(this.canvas.getContext("2d",{alpha:!0}))}get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(e){this._glyphs.push(e),this._usedPixels+=e.size.x*e.size.y}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}};function fp(e,n,r,a){let o=n.rgba>>>24,f=n.rgba>>>16&255,_=n.rgba>>>8&255,c=r.rgba>>>24,u=r.rgba>>>16&255,d=r.rgba>>>8&255,S=Math.floor((Math.abs(o-c)+Math.abs(f-u)+Math.abs(_-d))/12),g=!0;for(let C=0;C<e.data.length;C+=4)e.data[C]===o&&e.data[C+1]===f&&e.data[C+2]===_||a&&Math.abs(e.data[C]-o)+Math.abs(e.data[C+1]-f)+Math.abs(e.data[C+2]-_)<S?e.data[C+3]=0:g=!1;return g}function h8(e){for(let n=0;n<e.data.length;n+=4)if(e.data[n+3]>0)return!1;return!0}function gx(e,n,r){let a=e.createElement("canvas");return a.width=n,a.height=r,a}function d8(e,n,r,a,o,f,_,c){let u={foreground:f.foreground,background:f.background,cursor:Ai,cursorAccent:Ai,selectionForeground:Ai,selectionBackgroundTransparent:Ai,selectionBackgroundOpaque:Ai,selectionInactiveBackgroundTransparent:Ai,selectionInactiveBackgroundOpaque:Ai,overviewRulerBorder:Ai,scrollbarSliderBackground:Ai,scrollbarSliderHoverBackground:Ai,scrollbarSliderActiveBackground:Ai,ansi:f.ansi.slice(),contrastCache:f.contrastCache,halfContrastCache:f.halfContrastCache};return{customGlyphs:o.customGlyphs,devicePixelRatio:_,deviceMaxTextureSize:c,letterSpacing:o.letterSpacing,lineHeight:o.lineHeight,deviceCellWidth:e,deviceCellHeight:n,deviceCharWidth:r,deviceCharHeight:a,fontFamily:o.fontFamily,fontSize:o.fontSize,fontWeight:o.fontWeight,fontWeightBold:o.fontWeightBold,allowTransparency:o.allowTransparency,drawBoldTextInBrightColors:o.drawBoldTextInBrightColors,minimumContrastRatio:o.minimumContrastRatio,colors:u}}function uy(e,n){for(let r=0;r<e.colors.ansi.length;r++)if(e.colors.ansi[r].rgba!==n.colors.ansi[r].rgba)return!1;return e.devicePixelRatio===n.devicePixelRatio&&e.customGlyphs===n.customGlyphs&&e.lineHeight===n.lineHeight&&e.letterSpacing===n.letterSpacing&&e.fontFamily===n.fontFamily&&e.fontSize===n.fontSize&&e.fontWeight===n.fontWeight&&e.fontWeightBold===n.fontWeightBold&&e.allowTransparency===n.allowTransparency&&e.deviceCharWidth===n.deviceCharWidth&&e.deviceCharHeight===n.deviceCharHeight&&e.drawBoldTextInBrightColors===n.drawBoldTextInBrightColors&&e.minimumContrastRatio===n.minimumContrastRatio&&e.colors.foreground.rgba===n.colors.foreground.rgba&&e.colors.background.rgba===n.colors.background.rgba}function f8(e){return(e&50331648)===16777216||(e&50331648)===33554432}var Li=[];function mx(e,n,r,a,o,f,_,c,u){let d=d8(a,o,f,_,n,r,c,u);for(let C=0;C<Li.length;C++){let E=Li[C],A=E.ownedBy.indexOf(e);if(A>=0){if(uy(E.config,d))return E.atlas;E.ownedBy.length===1?(E.atlas.dispose(),Li.splice(C,1)):E.ownedBy.splice(A,1);break}}for(let C=0;C<Li.length;C++){let E=Li[C];if(uy(E.config,d))return E.ownedBy.push(e),E.atlas}let S=e._core,g={atlas:new vs(document,d,S.unicodeService),config:d,ownedBy:[e]};return Li.push(g),g.atlas}function hy(e){for(let n=0;n<Li.length;n++){let r=Li[n].ownedBy.indexOf(e);if(r!==-1){Li[n].ownedBy.length===1?(Li[n].atlas.dispose(),Li.splice(n,1)):Li[n].ownedBy.splice(r,1);break}}}var Au=600,p8=class{constructor(e,n){this._renderCallback=e,this._coreBrowserService=n,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(e=Au){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let n=Au-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,n>0){this._restartInterval(n);return}}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){let n=Au-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(n);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},Au)},e)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}};function dy(e,n,r){let a=new n.ResizeObserver(o=>{let f=o.find(u=>u.target===e);if(!f)return;if(!("devicePixelContentBoxSize"in f)){a?.disconnect(),a=void 0;return}let _=f.devicePixelContentBoxSize[0].inlineSize,c=f.devicePixelContentBoxSize[0].blockSize;_>0&&c>0&&r(_,c)});try{a.observe(e,{box:["device-pixel-content-box"]})}catch{a.disconnect(),a=void 0}return Bn(()=>a?.disconnect())}function g8(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}var fy=class _x extends eo{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new cx,this.combinedData=""}static fromCharData(n){let r=new _x;return r.setFromCharData(n),r}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?g8(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(n){this.fg=n[0],this.bg=0;let r=!1;if(n[1].length>2)r=!0;else if(n[1].length===2){let a=n[1].charCodeAt(0);if(55296<=a&&a<=56319){let o=n[1].charCodeAt(1);56320<=o&&o<=57343?this.content=(a-55296)*1024+o-56320+65536|n[2]<<22:r=!0}else r=!0}else this.content=n[1].charCodeAt(0)|n[2]<<22;r&&(this.combinedData=n[1],this.content=2097152|n[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},vx=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function bx(e,n,r){let a=hn(e.createProgram());if(e.attachShader(a,hn(py(e,e.VERTEX_SHADER,n))),e.attachShader(a,hn(py(e,e.FRAGMENT_SHADER,r))),e.linkProgram(a),e.getProgramParameter(a,e.LINK_STATUS))return a;console.error(e.getProgramInfoLog(a)),e.deleteProgram(a)}function py(e,n,r){let a=hn(e.createShader(n));if(e.shaderSource(a,r),e.compileShader(a),e.getShaderParameter(a,e.COMPILE_STATUS))return a;console.error(e.getShaderInfoLog(a)),e.deleteShader(a)}function m8(e,n){let r=Math.min(e.length*2,n),a=new Float32Array(r);for(let o=0;o<e.length;o++)a[o]=e[o];return a}var _8=class{constructor(e){this.texture=e,this.version=-1}},v8=`#version 300 es
712
+ layout (location = 0) in vec2 a_unitquad;
713
+ layout (location = 1) in vec2 a_cellpos;
714
+ layout (location = 2) in vec2 a_offset;
715
+ layout (location = 3) in vec2 a_size;
716
+ layout (location = 4) in float a_texpage;
717
+ layout (location = 5) in vec2 a_texcoord;
718
+ layout (location = 6) in vec2 a_texsize;
719
+
720
+ uniform mat4 u_projection;
721
+ uniform vec2 u_resolution;
722
+
723
+ out vec2 v_texcoord;
724
+ flat out int v_texpage;
725
+
726
+ void main() {
727
+ vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
728
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
729
+ v_texpage = int(a_texpage);
730
+ v_texcoord = a_texcoord + a_unitquad * a_texsize;
731
+ }`;function b8(e){let n="";for(let r=1;r<e;r++)n+=` else if (v_texpage == ${r}) { outColor = texture(u_texture[${r}], v_texcoord); }`;return`#version 300 es
732
+ precision lowp float;
733
+
734
+ in vec2 v_texcoord;
735
+ flat in int v_texpage;
736
+
737
+ uniform sampler2D u_texture[${e}];
738
+
739
+ out vec4 outColor;
740
+
741
+ void main() {
742
+ if (v_texpage == 0) {
743
+ outColor = texture(u_texture[0], v_texcoord);
744
+ } ${n}
745
+ }`}var bs=11,Ka=bs*Float32Array.BYTES_PER_ELEMENT,y8=2,Wt=0,Mt,pp=0,Al=0,S8=class extends Gi{constructor(e,n,r,a){super(),this._terminal=e,this._gl=n,this._dimensions=r,this._optionsService=a,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};let o=this._gl;vs.maxAtlasPages===void 0&&(vs.maxAtlasPages=Math.min(32,hn(o.getParameter(o.MAX_TEXTURE_IMAGE_UNITS))),vs.maxTextureSize=hn(o.getParameter(o.MAX_TEXTURE_SIZE))),this._program=hn(bx(o,v8,b8(vs.maxAtlasPages))),this._register(Bn(()=>o.deleteProgram(this._program))),this._projectionLocation=hn(o.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=hn(o.getUniformLocation(this._program,"u_resolution")),this._textureLocation=hn(o.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=o.createVertexArray(),o.bindVertexArray(this._vertexArrayObject);let f=new Float32Array([0,0,1,0,0,1,1,1]),_=o.createBuffer();this._register(Bn(()=>o.deleteBuffer(_))),o.bindBuffer(o.ARRAY_BUFFER,_),o.bufferData(o.ARRAY_BUFFER,f,o.STATIC_DRAW),o.enableVertexAttribArray(0),o.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let c=new Uint8Array([0,1,2,3]),u=o.createBuffer();this._register(Bn(()=>o.deleteBuffer(u))),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,u),o.bufferData(o.ELEMENT_ARRAY_BUFFER,c,o.STATIC_DRAW),this._attributesBuffer=hn(o.createBuffer()),this._register(Bn(()=>o.deleteBuffer(this._attributesBuffer))),o.bindBuffer(o.ARRAY_BUFFER,this._attributesBuffer),o.enableVertexAttribArray(2),o.vertexAttribPointer(2,2,o.FLOAT,!1,Ka,0),o.vertexAttribDivisor(2,1),o.enableVertexAttribArray(3),o.vertexAttribPointer(3,2,o.FLOAT,!1,Ka,2*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(3,1),o.enableVertexAttribArray(4),o.vertexAttribPointer(4,1,o.FLOAT,!1,Ka,4*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(4,1),o.enableVertexAttribArray(5),o.vertexAttribPointer(5,2,o.FLOAT,!1,Ka,5*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(5,1),o.enableVertexAttribArray(6),o.vertexAttribPointer(6,2,o.FLOAT,!1,Ka,7*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(6,1),o.enableVertexAttribArray(1),o.vertexAttribPointer(1,2,o.FLOAT,!1,Ka,9*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(1,1),o.useProgram(this._program);let d=new Int32Array(vs.maxAtlasPages);for(let S=0;S<vs.maxAtlasPages;S++)d[S]=S;o.uniform1iv(this._textureLocation,d),o.uniformMatrix4fv(this._projectionLocation,!1,vx),this._atlasTextures=[];for(let S=0;S<vs.maxAtlasPages;S++){let g=new _8(hn(o.createTexture()));this._register(Bn(()=>o.deleteTexture(g.texture))),o.activeTexture(o.TEXTURE0+S),o.bindTexture(o.TEXTURE_2D,g.texture),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,1,1,0,o.RGBA,o.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[S]=g}o.enable(o.BLEND),o.blendFunc(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(e,n,r,a,o,f,_,c,u){this._updateCell(this._vertices.attributes,e,n,r,a,o,f,_,c,u)}_updateCell(e,n,r,a,o,f,_,c,u,d){if(Wt=(r*this._terminal.cols+n)*bs,a===0||a===void 0){e.fill(0,Wt,Wt+bs-1-y8);return}this._atlas&&(c&&c.length>1?Mt=this._atlas.getRasterizedGlyphCombinedChar(c,o,f,_,!1,this._terminal.element):Mt=this._atlas.getRasterizedGlyph(a,o,f,_,!1,this._terminal.element),pp=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),o!==d&&Mt.offset.x>pp?(Al=Mt.offset.x-pp,e[Wt]=-(Mt.offset.x-Al)+this._dimensions.device.char.left,e[Wt+1]=-Mt.offset.y+this._dimensions.device.char.top,e[Wt+2]=(Mt.size.x-Al)/this._dimensions.device.canvas.width,e[Wt+3]=Mt.size.y/this._dimensions.device.canvas.height,e[Wt+4]=Mt.texturePage,e[Wt+5]=Mt.texturePositionClipSpace.x+Al/this._atlas.pages[Mt.texturePage].canvas.width,e[Wt+6]=Mt.texturePositionClipSpace.y,e[Wt+7]=Mt.sizeClipSpace.x-Al/this._atlas.pages[Mt.texturePage].canvas.width,e[Wt+8]=Mt.sizeClipSpace.y):(e[Wt]=-Mt.offset.x+this._dimensions.device.char.left,e[Wt+1]=-Mt.offset.y+this._dimensions.device.char.top,e[Wt+2]=Mt.size.x/this._dimensions.device.canvas.width,e[Wt+3]=Mt.size.y/this._dimensions.device.canvas.height,e[Wt+4]=Mt.texturePage,e[Wt+5]=Mt.texturePositionClipSpace.x,e[Wt+6]=Mt.texturePositionClipSpace.y,e[Wt+7]=Mt.sizeClipSpace.x,e[Wt+8]=Mt.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&jN(a,u,Mt.size.x,this._dimensions.device.cell.width)&&(e[Wt+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let e=this._terminal,n=e.cols*e.rows*bs;this._vertices.count!==n?this._vertices.attributes=new Float32Array(n):this._vertices.attributes.fill(0);let r=0;for(;r<this._vertices.attributesBuffers.length;r++)this._vertices.count!==n?this._vertices.attributesBuffers[r]=new Float32Array(n):this._vertices.attributesBuffers[r].fill(0);this._vertices.count=n,r=0;for(let a=0;a<e.rows;a++)for(let o=0;o<e.cols;o++)this._vertices.attributes[r+9]=o/e.cols,this._vertices.attributes[r+10]=a/e.rows,r+=bs}handleResize(){let e=this._gl;e.useProgram(this._program),e.viewport(0,0,e.canvas.width,e.canvas.height),e.uniform2f(this._resolutionLocation,e.canvas.width,e.canvas.height),this.clear()}render(e){if(!this._atlas)return;let n=this._gl;n.useProgram(this._program),n.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;let r=this._vertices.attributesBuffers[this._activeBuffer],a=0;for(let o=0;o<e.lineLengths.length;o++){let f=o*this._terminal.cols*bs,_=this._vertices.attributes.subarray(f,f+e.lineLengths[o]*bs);r.set(_,a),a+=_.length}n.bindBuffer(n.ARRAY_BUFFER,this._attributesBuffer),n.bufferData(n.ARRAY_BUFFER,r.subarray(0,a),n.STREAM_DRAW);for(let o=0;o<this._atlas.pages.length;o++)this._atlas.pages[o].version!==this._atlasTextures[o].version&&this._bindAtlasPageTexture(n,this._atlas,o);n.drawElementsInstanced(n.TRIANGLE_STRIP,4,n.UNSIGNED_BYTE,0,a/bs)}setAtlas(e){this._atlas=e;for(let n of this._atlasTextures)n.version=-1}_bindAtlasPageTexture(e,n,r){e.activeTexture(e.TEXTURE0+r),e.bindTexture(e.TEXTURE_2D,this._atlasTextures[r].texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n.pages[r].canvas),e.generateMipmap(e.TEXTURE_2D),this._atlasTextures[r].version=n.pages[r].version}setDimensions(e){this._dimensions=e}},w8=class{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(e,n,r,a=!1){if(this.selectionStart=n,this.selectionEnd=r,!n||!r||n[0]===r[0]&&n[1]===r[1]){this.clear();return}let o=e.buffers.active.ydisp,f=n[1]-o,_=r[1]-o,c=Math.max(f,0),u=Math.min(_,e.rows-1);if(c>=e.rows||u<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=a,this.viewportStartRow=f,this.viewportEndRow=_,this.viewportCappedStartRow=c,this.viewportCappedEndRow=u,this.startCol=n[0],this.endCol=r[0]}isCellSelected(e,n,r){return this.hasSelection?(r-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&r>=this.viewportCappedStartRow&&n<this.endCol&&r<=this.viewportCappedEndRow:n<this.startCol&&r>=this.viewportCappedStartRow&&n>=this.endCol&&r<=this.viewportCappedEndRow:r>this.viewportStartRow&&r<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&r===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportStartRow&&n>=this.startCol):!1}};function C8(){return new w8}var lh=4,Hu=1,Uu=2,gp=3,x8=2147483648,E8=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=C8()}resize(e,n){let r=e*n*lh;r!==this.cells.length&&(this.cells=new Uint32Array(r),this.lineLengths=new Uint32Array(n))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},T8=`#version 300 es
746
+ layout (location = 0) in vec2 a_position;
747
+ layout (location = 1) in vec2 a_size;
748
+ layout (location = 2) in vec4 a_color;
749
+ layout (location = 3) in vec2 a_unitquad;
750
+
751
+ uniform mat4 u_projection;
752
+
753
+ out vec4 v_color;
754
+
755
+ void main() {
756
+ vec2 zeroToOne = a_position + (a_unitquad * a_size);
757
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
758
+ v_color = a_color;
759
+ }`,A8=`#version 300 es
760
+ precision lowp float;
761
+
762
+ in vec4 v_color;
763
+
764
+ out vec4 outColor;
765
+
766
+ void main() {
767
+ outColor = v_color;
768
+ }`,Ir=8,mp=Ir*Float32Array.BYTES_PER_ELEMENT,k8=20*Ir,gy=class{constructor(){this.attributes=new Float32Array(k8),this.count=0}},Or=0,my=0,_y=0,vy=0,by=0,yy=0,Sy=0,R8=class extends Gi{constructor(e,n,r,a){super(),this._terminal=e,this._gl=n,this._dimensions=r,this._themeService=a,this._vertices=new gy,this._verticesCursor=new gy;let o=this._gl;this._program=hn(bx(o,T8,A8)),this._register(Bn(()=>o.deleteProgram(this._program))),this._projectionLocation=hn(o.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=o.createVertexArray(),o.bindVertexArray(this._vertexArrayObject);let f=new Float32Array([0,0,1,0,0,1,1,1]),_=o.createBuffer();this._register(Bn(()=>o.deleteBuffer(_))),o.bindBuffer(o.ARRAY_BUFFER,_),o.bufferData(o.ARRAY_BUFFER,f,o.STATIC_DRAW),o.enableVertexAttribArray(3),o.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let c=new Uint8Array([0,1,2,3]),u=o.createBuffer();this._register(Bn(()=>o.deleteBuffer(u))),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,u),o.bufferData(o.ELEMENT_ARRAY_BUFFER,c,o.STATIC_DRAW),this._attributesBuffer=hn(o.createBuffer()),this._register(Bn(()=>o.deleteBuffer(this._attributesBuffer))),o.bindBuffer(o.ARRAY_BUFFER,this._attributesBuffer),o.enableVertexAttribArray(0),o.vertexAttribPointer(0,2,o.FLOAT,!1,mp,0),o.vertexAttribDivisor(0,1),o.enableVertexAttribArray(1),o.vertexAttribPointer(1,2,o.FLOAT,!1,mp,2*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(1,1),o.enableVertexAttribArray(2),o.vertexAttribPointer(2,4,o.FLOAT,!1,mp,4*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(2,1),this._updateCachedColors(a.colors),this._register(this._themeService.onChangeColors(d=>{this._updateCachedColors(d),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let n=this._gl;n.useProgram(this._program),n.bindVertexArray(this._vertexArrayObject),n.uniformMatrix4fv(this._projectionLocation,!1,vx),n.bindBuffer(n.ARRAY_BUFFER,this._attributesBuffer),n.bufferData(n.ARRAY_BUFFER,e.attributes,n.DYNAMIC_DRAW),n.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,n.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let n=this._terminal,r=this._vertices,a=1,o,f,_,c,u,d,S,g,C,E,A;for(o=0;o<n.rows;o++){for(_=-1,c=0,u=0,d=!1,f=0;f<n.cols;f++)S=(o*n.cols+f)*lh,g=e.cells[S+Hu],C=e.cells[S+Uu],E=!!(C&67108864),(g!==c||C!==u&&(d||E))&&((c!==0||d&&u!==0)&&(A=a++*Ir,this._updateRectangle(r,A,u,c,_,f,o)),_=f,c=g,u=C,d=E);(c!==0||d&&u!==0)&&(A=a++*Ir,this._updateRectangle(r,A,u,c,_,n.cols,o))}r.count=a}updateCursor(e){let n=this._verticesCursor,r=e.cursor;if(!r||r.style==="block"){n.count=0;return}let a,o=0;(r.style==="bar"||r.style==="outline")&&(a=o++*Ir,this._addRectangleFloat(n.attributes,a,r.x*this._dimensions.device.cell.width,r.y*this._dimensions.device.cell.height,r.style==="bar"?r.dpr*r.cursorWidth:r.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(r.style==="underline"||r.style==="outline")&&(a=o++*Ir,this._addRectangleFloat(n.attributes,a,r.x*this._dimensions.device.cell.width,(r.y+1)*this._dimensions.device.cell.height-r.dpr,r.width*this._dimensions.device.cell.width,r.dpr,this._cursorFloat)),r.style==="outline"&&(a=o++*Ir,this._addRectangleFloat(n.attributes,a,r.x*this._dimensions.device.cell.width,r.y*this._dimensions.device.cell.height,r.width*this._dimensions.device.cell.width,r.dpr,this._cursorFloat),a=o++*Ir,this._addRectangleFloat(n.attributes,a,(r.x+r.width)*this._dimensions.device.cell.width-r.dpr,r.y*this._dimensions.device.cell.height,r.dpr,this._dimensions.device.cell.height,this._cursorFloat)),n.count=o}_updateRectangle(e,n,r,a,o,f,_){if(r&67108864)switch(r&50331648){case 16777216:case 33554432:Or=this._themeService.colors.ansi[r&255].rgba;break;case 50331648:Or=(r&16777215)<<8;break;default:Or=this._themeService.colors.foreground.rgba}else switch(a&50331648){case 16777216:case 33554432:Or=this._themeService.colors.ansi[a&255].rgba;break;case 50331648:Or=(a&16777215)<<8;break;default:Or=this._themeService.colors.background.rgba}e.attributes.length<n+4&&(e.attributes=m8(e.attributes,this._terminal.rows*this._terminal.cols*Ir)),my=o*this._dimensions.device.cell.width,_y=_*this._dimensions.device.cell.height,vy=(Or>>24&255)/255,by=(Or>>16&255)/255,yy=(Or>>8&255)/255,Sy=1,this._addRectangle(e.attributes,n,my,_y,(f-o)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,vy,by,yy,Sy)}_addRectangle(e,n,r,a,o,f,_,c,u,d){e[n]=r/this._dimensions.device.canvas.width,e[n+1]=a/this._dimensions.device.canvas.height,e[n+2]=o/this._dimensions.device.canvas.width,e[n+3]=f/this._dimensions.device.canvas.height,e[n+4]=_,e[n+5]=c,e[n+6]=u,e[n+7]=d}_addRectangleFloat(e,n,r,a,o,f,_){e[n]=r/this._dimensions.device.canvas.width,e[n+1]=a/this._dimensions.device.canvas.height,e[n+2]=o/this._dimensions.device.canvas.width,e[n+3]=f/this._dimensions.device.canvas.height,e[n+4]=_[0],e[n+5]=_[1],e[n+6]=_[2],e[n+7]=_[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(e.rgba&255)/255])}},L8=class extends Gi{constructor(e,n,r,a,o,f,_,c){super(),this._container=n,this._alpha=o,this._coreBrowserService=f,this._optionsService=_,this._themeService=c,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${r}-layer`),this._canvas.style.zIndex=a.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(u=>{this._refreshCharAtlas(e,u),this.reset(e)})),this._register(Bn(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=hn(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,n,r){}handleSelectionChanged(e,n,r,a=!1){}_setTransparency(e,n){if(n===this._alpha)return;let r=this._canvas;this._alpha=n,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,r),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,n){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=mx(e,this._optionsService.rawOptions,n,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,n){this._deviceCellWidth=n.device.cell.width,this._deviceCellHeight=n.device.cell.height,this._deviceCharWidth=n.device.char.width,this._deviceCharHeight=n.device.char.height,this._deviceCharLeft=n.device.char.left,this._deviceCharTop=n.device.char.top,this._canvas.width=n.device.canvas.width,this._canvas.height=n.device.canvas.height,this._canvas.style.width=`${n.css.canvas.width}px`,this._canvas.style.height=`${n.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,n,r=1){this._ctx.fillRect(e*this._deviceCellWidth,(n+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,r*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,n,r,a){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,n*this._deviceCellHeight,r*this._deviceCellWidth,a*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,n*this._deviceCellHeight,r*this._deviceCellWidth,a*this._deviceCellHeight))}_fillCharTrueColor(e,n,r,a){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=rx,this._clipCell(r,a,n.getWidth()),this._ctx.fillText(n.getChars(),r*this._deviceCellWidth+this._deviceCharLeft,a*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,n,r){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,n*this._deviceCellHeight,r*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,n,r){let a=n?e.options.fontWeightBold:e.options.fontWeight;return`${r?"italic":""} ${a} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},M8=class extends L8{constructor(e,n,r,a,o,f,_){super(r,e,"link",n,!0,o,f,_),this._register(a.onShowLinkUnderline(c=>this._handleShowLinkUnderline(c))),this._register(a.onHideLinkUnderline(c=>this._handleHideLinkUnderline(c)))}resize(e,n){super.resize(e,n),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg!==void 0&&f8(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let n=e.y1+1;n<e.y2;n++)this._fillBottomLineAtCells(0,n,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},Qs=typeof window=="object"?window:globalThis,Ag=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Dt,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Dt,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(n){return this.mapWindowIdToZoomLevel.get(this.getWindowId(n))??0}setZoomLevel(n,r){if(this.getZoomLevel(r)===n)return;let a=this.getWindowId(r);this.mapWindowIdToZoomLevel.set(a,n),this._onDidChangeZoomLevel.fire(a)}getZoomFactor(n){return this.mapWindowIdToZoomFactor.get(this.getWindowId(n))??1}setZoomFactor(n,r){this.mapWindowIdToZoomFactor.set(this.getWindowId(r),n)}setFullscreen(n,r){if(this.isFullscreen(r)===n)return;let a=this.getWindowId(r);this.mapWindowIdToFullScreen.set(a,n),this._onDidChangeFullscreen.fire(a)}isFullscreen(n){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(n))}getWindowId(n){return n.vscodeWindowId}};Ag.INSTANCE=new Ag;var yx=Ag;function D8(e,n,r){typeof n=="string"&&(n=e.matchMedia(n)),n.addEventListener("change",r)}yx.INSTANCE.onDidChangeZoomLevel;yx.INSTANCE.onDidChangeFullscreen;var So=typeof navigator=="object"?navigator.userAgent:"";So.indexOf("Firefox")>=0;So.indexOf("AppleWebKit")>=0;var O8=So.indexOf("Chrome")>=0;!O8&&So.indexOf("Safari")>=0;So.indexOf("Electron/")>=0;So.indexOf("Android")>=0;var _p=!1;if(typeof Qs.matchMedia=="function"){let e=Qs.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),n=Qs.matchMedia("(display-mode: fullscreen)");_p=e.matches,D8(Qs,e,({matches:r})=>{_p&&n.matches||(_p=r)})}var to="en",vp=!1,Sx=!1,ku,Fu=to,wy=to,N8,Br,na=globalThis,pi;typeof na.vscode<"u"&&typeof na.vscode.process<"u"?pi=na.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(pi=process);var B8=typeof pi?.versions?.electron=="string",I8=B8&&pi?.type==="renderer";if(typeof pi=="object"){pi.platform,pi.platform,vp=pi.platform==="linux",vp&&pi.env.SNAP&&pi.env.SNAP_REVISION,pi.env.CI||pi.env.BUILD_ARTIFACTSTAGINGDIRECTORY,ku=to,Fu=to;let e=pi.env.VSCODE_NLS_CONFIG;if(e)try{let n=JSON.parse(e);ku=n.userLocale,wy=n.osLocale,Fu=n.resolvedLanguage||to,N8=n.languagePack?.translationsConfigFile}catch{}Sx=!0}else typeof navigator=="object"&&!I8?(Br=navigator.userAgent,Br.indexOf("Windows")>=0,Br.indexOf("Macintosh")>=0,(Br.indexOf("Macintosh")>=0||Br.indexOf("iPad")>=0||Br.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,vp=Br.indexOf("Linux")>=0,Br?.indexOf("Mobi")>=0,Fu=globalThis._VSCODE_NLS_LANGUAGE||to,ku=navigator.language.toLowerCase(),wy=ku):console.error("Unable to resolve platform.");var Cy=Sx,sr=Br,ms=Fu,j8;(e=>{function n(){return ms}e.value=n;function r(){return ms.length===2?ms==="en":ms.length>=3?ms[0]==="e"&&ms[1]==="n"&&ms[2]==="-":!1}e.isDefaultVariant=r;function a(){return ms==="en"}e.isDefault=a})(j8||={});var z8=typeof na.postMessage=="function"&&!na.importScripts;(()=>{if(z8){let e=[];na.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let a=0,o=e.length;a<o;a++){let f=e[a];if(f.id===r.data.vscodeScheduleAsyncWork){e.splice(a,1),f.callback();return}}});let n=0;return r=>{let a=++n;e.push({id:a,callback:r}),na.postMessage({vscodeScheduleAsyncWork:a},"*")}}return e=>setTimeout(e)})();var $8=!!(sr&&sr.indexOf("Chrome")>=0);sr&&sr.indexOf("Firefox")>=0;!$8&&sr&&sr.indexOf("Safari")>=0;sr&&sr.indexOf("Edg/")>=0;sr&&sr.indexOf("Android")>=0;var Va=typeof navigator=="object"?navigator:{};Cy||document.queryCommandSupported&&document.queryCommandSupported("copy")||Va&&Va.clipboard&&Va.clipboard.writeText,Cy||Va&&Va.clipboard&&Va.clipboard.readText;var Cm=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,n){this._keyCodeToStr[e]=n,this._strToKeyCode[n.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},bp=new Cm,xy=new Cm,Ey=new Cm;new Array(230);var P8;(e=>{function n(c){return bp.keyCodeToStr(c)}e.toString=n;function r(c){return bp.strToKeyCode(c)}e.fromString=r;function a(c){return xy.keyCodeToStr(c)}e.toUserSettingsUS=a;function o(c){return Ey.keyCodeToStr(c)}e.toUserSettingsGeneral=o;function f(c){return xy.strToKeyCode(c)||Ey.strToKeyCode(c)}e.fromUserSettings=f;function _(c){if(c>=98&&c<=113)return null;switch(c){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return bp.keyCodeToStr(c)}e.toElectronAccelerator=_})(P8||={});var wx=Object.freeze(function(e,n){let r=setTimeout(e.bind(n),0);return{dispose(){clearTimeout(r)}}}),H8;(e=>{function n(r){return r===e.None||r===e.Cancelled||r instanceof U8?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=n,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:jr.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:wx})})(H8||={});var U8=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?wx:(this._emitter||(this._emitter=new Dt),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},F8;(e=>{async function n(a){let o,f=await Promise.all(a.map(_=>_.then(c=>c,c=>{o||(o=c)})));if(typeof o<"u")throw o;return f}e.settled=n;function r(a){return new Promise(async(o,f)=>{try{await a(o,f)}catch(_){f(_)}})}e.withAsyncBody=r})(F8||={});var Ty=class ki{static fromArray(n){return new ki(r=>{r.emitMany(n)})}static fromPromise(n){return new ki(async r=>{r.emitMany(await n)})}static fromPromises(n){return new ki(async r=>{await Promise.all(n.map(async a=>r.emitOne(await a)))})}static merge(n){return new ki(async r=>{await Promise.all(n.map(async a=>{for await(let o of a)r.emitOne(o)}))})}constructor(n,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new Dt,queueMicrotask(async()=>{let a={emitOne:o=>this.emitOne(o),emitMany:o=>this.emitMany(o),reject:o=>this.reject(o)};try{await Promise.resolve(n(a)),this.resolve()}catch(o){this.reject(o)}finally{a.emitOne=void 0,a.emitMany=void 0,a.reject=void 0}})}[Symbol.asyncIterator](){let n=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(n<this._results.length)return{done:!1,value:this._results[n++]};if(this._state===1)return{done:!0,value:void 0};await jr.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(n,r){return new ki(async a=>{for await(let o of n)a.emitOne(r(o))})}map(n){return ki.map(this,n)}static filter(n,r){return new ki(async a=>{for await(let o of n)r(o)&&a.emitOne(o)})}filter(n){return ki.filter(this,n)}static coalesce(n){return ki.filter(n,r=>!!r)}coalesce(){return ki.coalesce(this)}static async toPromise(n){let r=[];for await(let a of n)r.push(a);return r}toPromise(){return ki.toPromise(this)}emitOne(n){this._state===0&&(this._results.push(n),this._onStateChanged.fire())}emitMany(n){this._state===0&&(this._results=this._results.concat(n),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(n){this._state===0&&(this._state=2,this._error=n,this._onStateChanged.fire())}};Ty.EMPTY=Ty.fromArray([]);var{getWindow:q8}=(function(){let e=new Map,n={window:Qs,disposables:new lo};e.set(Qs.vscodeWindowId,n);let r=new Dt,a=new Dt,o=new Dt;function f(_,c){return(typeof _=="number"?e.get(_):void 0)??(c?n:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:o.event,onDidUnregisterWindow:a.event,registerWindow(_){if(e.has(_.vscodeWindowId))return Gi.None;let c=new lo,u={window:_,disposables:c.add(new lo)};return e.set(_.vscodeWindowId,u),c.add(Bn(()=>{e.delete(_.vscodeWindowId),a.fire(_)})),c.add(kg(_,G8.BEFORE_UNLOAD,()=>{o.fire(_)})),r.fire(u),c},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(_){return _.vscodeWindowId},hasWindow(_){return e.has(_)},getWindowById:f,getWindow(_){let c=_;if(c?.ownerDocument?.defaultView)return c.ownerDocument.defaultView.window;let u=_;return u?.view?u.view.window:Qs},getDocument(_){return q8(_).document}}})(),W8=class{constructor(e,n,r,a){this._node=e,this._type=n,this._handler=r,this._options=a||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function kg(e,n,r,a){return new W8(e,n,r,a)}var G8={BEFORE_UNLOAD:"beforeunload"},K8=class extends Gi{constructor(e,n,r,a,o,f,_,c,u){super(),this._terminal=e,this._characterJoinerService=n,this._charSizeService=r,this._coreBrowserService=a,this._coreService=o,this._decorationService=f,this._optionsService=_,this._themeService=c,this._cursorBlinkStateManager=new xl,this._charAtlasDisposable=this._register(new xl),this._observerDisposable=this._register(new xl),this._model=new E8,this._workCell=new fy,this._workCell2=new fy,this._rectangleRenderer=this._register(new xl),this._glyphRenderer=this._register(new xl),this._onChangeTextureAtlas=this._register(new Dt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Dt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Dt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Dt),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Dt),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");let d={antialias:!1,depth:!1,preserveDrawingBuffer:u};if(this._gl=this._canvas.getContext("webgl2",d),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new PN(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new M8(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,_,this._themeService)],this.dimensions=zN(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(_.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(kg(this._canvas,"webglcontextlost",S=>{console.log("webglcontextlost event received"),S.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(S)},3e3)})),this._register(kg(this._canvas,"webglcontextrestored",S=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,hy(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=dy(this._canvas,this._coreBrowserService.window,(S,g)=>this._setCanvasDevicePixelDimensions(S,g)),this._register(this._coreBrowserService.onWindowChange(S=>{this._observerDisposable.value=dy(this._canvas,S,(g,C)=>this._setCanvasDevicePixelDimensions(g,C))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(Bn(()=>{for(let S of this._renderLayers)S.dispose();this._canvas.parentElement?.removeChild(this._canvas),hy(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,n){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let r of this._renderLayers)r.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,n,r){for(let a of this._renderLayers)a.handleSelectionChanged(this._terminal,e,n,r);this._model.selection.update(this._core,e,n,r),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new R8(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new S8(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=mx(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=QC(jr.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),jr.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,n){if(!this._isAttached)if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let r of this._renderLayers)r.handleGridChanged(this._terminal,e,n);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,n),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new p8(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,n){let r=this._core,a=this._workCell,o,f,_,c,u,d,S=0,g=!0,C,E,A,x,p,v,h,b,T;e=Ay(e,r.rows-1,0),n=Ay(n,r.rows-1,0);let R=this._coreService.decPrivateModes.cursorStyle??r.options.cursorStyle??"block",L=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,M=L-r.buffer.ydisp,k=Math.min(this._terminal.buffer.active.cursorX,r.cols-1),B=-1,F=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let U=!1;for(f=e;f<=n;f++)for(_=f+r.buffer.ydisp,c=r.buffer.lines.get(_),this._model.lineLengths[f]=0,A=L===_,S=0,u=this._characterJoinerService.getJoinedCharacters(_),b=0;b<r.cols;b++){if(o=this._cellColorResolver.result.bg,c.loadCell(b,a),b===0&&(o=this._cellColorResolver.result.bg),d=!1,g=b>=S,C=b,u.length>0&&b===u[0][0]&&g){E=u.shift();let W=this._model.selection.isCellSelected(this._terminal,E[0],_);for(h=E[0]+1;h<E[1];h++)g&&=W===this._model.selection.isCellSelected(this._terminal,h,_);g&&=!A||k<E[0]||k>=E[1],g?(d=!0,a=new V8(a,c.translateToString(!0,E[0],E[1]),E[1]-E[0]),C=E[1]-1):S=E[1]}if(x=a.getChars(),p=a.getCode(),h=(f*r.cols+b)*lh,this._cellColorResolver.resolve(a,b,_,this.dimensions.device.cell.width),F&&_===L&&(b===k&&(this._model.cursor={x:k,y:M,width:a.getWidth(),style:this._coreBrowserService.isFocused?R:r.options.cursorInactiveStyle,cursorWidth:r.options.cursorWidth,dpr:this._devicePixelRatio},B=k+a.getWidth()-1),b>=k&&b<=B&&(this._coreBrowserService.isFocused&&R==="block"||this._coreBrowserService.isFocused===!1&&r.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),p!==0&&(this._model.lineLengths[f]=b+1),!(this._model.cells[h]===p&&this._model.cells[h+Hu]===this._cellColorResolver.result.bg&&this._model.cells[h+Uu]===this._cellColorResolver.result.fg&&this._model.cells[h+gp]===this._cellColorResolver.result.ext)&&(U=!0,x.length>1&&(p|=x8),this._model.cells[h]=p,this._model.cells[h+Hu]=this._cellColorResolver.result.bg,this._model.cells[h+Uu]=this._cellColorResolver.result.fg,this._model.cells[h+gp]=this._cellColorResolver.result.ext,v=a.getWidth(),this._glyphRenderer.value.updateCell(b,f,p,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,x,v,o),d)){for(a=this._workCell,b++;b<=C;b++)T=(f*r.cols+b)*lh,this._glyphRenderer.value.updateCell(b,f,0,0,0,0,MN,0,0),this._model.cells[T]=0,this._model.cells[T+Hu]=this._cellColorResolver.result.bg,this._model.cells[T+Uu]=this._cellColorResolver.result.fg,this._model.cells[T+gp]=this._cellColorResolver.result.ext;b--}}U&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,n){this._canvas.width===e&&this._canvas.height===n||(this._canvas.width=e,this._canvas.height=n,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},V8=class extends eo{constructor(e,n,r){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=n,this._width=r}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function Ay(e,n,r=0){return Math.max(Math.min(e,n),r)}var ky="di$target",Ry="di$dependencies",yp=new Map;function lr(e){if(yp.has(e))return yp.get(e);let n=function(r,a,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Y8(n,r,o)};return n._id=e,yp.set(e,n),n}function Y8(e,n,r){n[ky]===n?n[Ry].push({id:e,index:r}):(n[Ry]=[{id:e,index:r}],n[ky]=n)}lr("BufferService");lr("CoreMouseService");lr("CoreService");lr("CharsetService");lr("InstantiationService");lr("LogService");var X8=lr("OptionsService");lr("OscLinkService");lr("UnicodeService");lr("DecorationService");var Z8={trace:0,debug:1,info:2,warn:3,error:4,off:5},J8="xterm.js: ",Ly=class extends Gi{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=Z8[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let n=0;n<e.length;n++)typeof e[n]=="function"&&(e[n]=e[n]())}_log(e,n,r){this._evalLazyOptionalParams(r),e.call(console,(this._optionsService.options.logger?"":J8)+n,...r)}trace(e,...n){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,n)}debug(e,...n){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,n)}info(e,...n){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,n)}warn(e,...n){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,n)}error(e,...n){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,n)}};Ly=bN([yN(0,X8)],Ly);var Q8=class extends Gi{constructor(e){if(nx&&LN()<16){let n={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",n))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new Dt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Dt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Dt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new Dt),this.onContextLoss=this._onContextLoss.event}activate(e){let n=e._core;if(!e.element){this._register(n.onWillOpen(()=>this.activate(e)));return}this._terminal=e;let r=n.coreService,a=n.optionsService,o=n,f=o._renderService,_=o._characterJoinerService,c=o._charSizeService,u=o._coreBrowserService,d=o._decorationService;o._logService;let S=o._themeService;this._renderer=this._register(new K8(e,_,c,u,r,d,a,S,this._preserveDrawingBuffer)),this._register(jr.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(jr.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(jr.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(jr.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),f.setRenderer(this._renderer),this._register(Bn(()=>{if(this._terminal._core._store._isDisposed)return;let g=this._terminal._core._renderService;g.setRenderer(this._terminal._core._createRenderer()),g.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},Sp={exports:{}},My;function e7(){return My||(My=1,(function(e,n){(function(r,a){e.exports=a()})(globalThis,(()=>(()=>{var r={4567:function(_,c,u){var d=this&&this.__decorate||function(h,b,T,R){var L,M=arguments.length,k=M<3?b:R===null?R=Object.getOwnPropertyDescriptor(b,T):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(h,b,T,R);else for(var B=h.length-1;B>=0;B--)(L=h[B])&&(k=(M<3?L(k):M>3?L(b,T,k):L(b,T))||k);return M>3&&k&&Object.defineProperty(b,T,k),k},S=this&&this.__param||function(h,b){return function(T,R){b(T,R,h)}};Object.defineProperty(c,"__esModule",{value:!0}),c.AccessibilityManager=void 0;const g=u(9042),C=u(9924),E=u(844),A=u(4725),x=u(2585),p=u(3656);let v=c.AccessibilityManager=class extends E.Disposable{constructor(h,b,T,R){super(),this._terminal=h,this._coreBrowserService=T,this._renderService=R,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 L=0;L<this._terminal.rows;L++)this._rowElements[L]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[L]);if(this._topBoundaryFocusListener=L=>this._handleBoundaryFocus(L,0),this._bottomBoundaryFocusListener=L=>this._handleBoundaryFocus(L,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 C.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((L=>this._handleResize(L.rows)))),this.register(this._terminal.onRender((L=>this._refreshRows(L.start,L.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((L=>this._handleChar(L)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
769
+ `)))),this.register(this._terminal.onA11yTab((L=>this._handleTab(L)))),this.register(this._terminal.onKey((L=>this._handleKey(L.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,p.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,E.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(h){for(let b=0;b<h;b++)this._handleChar(" ")}_handleChar(h){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==h&&(this._charsToAnnounce+=h):this._charsToAnnounce+=h,h===`
770
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=g.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(h){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(h)||this._charsToConsume.push(h)}_refreshRows(h,b){this._liveRegionDebouncer.refresh(h,b,this._terminal.rows)}_renderRows(h,b){const T=this._terminal.buffer,R=T.lines.length.toString();for(let L=h;L<=b;L++){const M=T.lines.get(T.ydisp+L),k=[],B=M?.translateToString(!0,void 0,void 0,k)||"",F=(T.ydisp+L+1).toString(),U=this._rowElements[L];U&&(B.length===0?(U.innerText=" ",this._rowColumns.set(U,[0,1])):(U.textContent=B,this._rowColumns.set(U,k)),U.setAttribute("aria-posinset",F),U.setAttribute("aria-setsize",R))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(h,b){const T=h.target,R=this._rowElements[b===0?1:this._rowElements.length-2];if(T.getAttribute("aria-posinset")===(b===0?"1":`${this._terminal.buffer.lines.length}`)||h.relatedTarget!==R)return;let L,M;if(b===0?(L=T,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(L=this._rowElements.shift(),M=T,this._rowContainer.removeChild(L)),L.removeEventListener("focus",this._topBoundaryFocusListener),M.removeEventListener("focus",this._bottomBoundaryFocusListener),b===0){const k=this._createAccessibilityTreeNode();this._rowElements.unshift(k),this._rowContainer.insertAdjacentElement("afterbegin",k)}else{const k=this._createAccessibilityTreeNode();this._rowElements.push(k),this._rowContainer.appendChild(k)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(b===0?-1:1),this._rowElements[b===0?1:this._rowElements.length-2].focus(),h.preventDefault(),h.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const h=document.getSelection();if(!h)return;if(h.isCollapsed)return void(this._rowContainer.contains(h.anchorNode)&&this._terminal.clearSelection());if(!h.anchorNode||!h.focusNode)return void console.error("anchorNode and/or focusNode are null");let b={node:h.anchorNode,offset:h.anchorOffset},T={node:h.focusNode,offset:h.focusOffset};if((b.node.compareDocumentPosition(T.node)&Node.DOCUMENT_POSITION_PRECEDING||b.node===T.node&&b.offset>T.offset)&&([b,T]=[T,b]),b.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(b={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(b.node))return;const R=this._rowElements.slice(-1)[0];if(T.node.compareDocumentPosition(R)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(T={node:R,offset:R.textContent?.length??0}),!this._rowContainer.contains(T.node))return;const L=({node:B,offset:F})=>{const U=B instanceof Text?B.parentNode:B;let W=parseInt(U?.getAttribute("aria-posinset"),10)-1;if(isNaN(W))return console.warn("row is invalid. Race condition?"),null;const j=this._rowColumns.get(U);if(!j)return console.warn("columns is null. Race condition?"),null;let G=F<j.length?j[F]:j.slice(-1)[0]+1;return G>=this._terminal.cols&&(++W,G=0),{row:W,column:G}},M=L(b),k=L(T);if(M&&k){if(M.row>k.row||M.row===k.row&&M.column>=k.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(k.row-M.row)*this._terminal.cols-M.column+k.column)}}_handleResize(h){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let b=this._rowContainer.children.length;b<this._terminal.rows;b++)this._rowElements[b]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[b]);for(;this._rowElements.length>h;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const h=this._coreBrowserService.mainDocument.createElement("div");return h.setAttribute("role","listitem"),h.tabIndex=-1,this._refreshRowDimensions(h),h}_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 h=0;h<this._terminal.rows;h++)this._refreshRowDimensions(this._rowElements[h])}}_refreshRowDimensions(h){h.style.height=`${this._renderService.dimensions.css.cell.height}px`}};c.AccessibilityManager=v=d([S(1,x.IInstantiationService),S(2,A.ICoreBrowserService),S(3,A.IRenderService)],v)},3614:(_,c)=>{function u(C){return C.replace(/\r?\n/g,"\r")}function d(C,E){return E?"\x1B[200~"+C+"\x1B[201~":C}function S(C,E,A,x){C=d(C=u(C),A.decPrivateModes.bracketedPasteMode&&x.rawOptions.ignoreBracketedPasteMode!==!0),A.triggerDataEvent(C,!0),E.value=""}function g(C,E,A){const x=A.getBoundingClientRect(),p=C.clientX-x.left-10,v=C.clientY-x.top-10;E.style.width="20px",E.style.height="20px",E.style.left=`${p}px`,E.style.top=`${v}px`,E.style.zIndex="1000",E.focus()}Object.defineProperty(c,"__esModule",{value:!0}),c.rightClickHandler=c.moveTextAreaUnderMouseCursor=c.paste=c.handlePasteEvent=c.copyHandler=c.bracketTextForPaste=c.prepareTextForTerminal=void 0,c.prepareTextForTerminal=u,c.bracketTextForPaste=d,c.copyHandler=function(C,E){C.clipboardData&&C.clipboardData.setData("text/plain",E.selectionText),C.preventDefault()},c.handlePasteEvent=function(C,E,A,x){C.stopPropagation(),C.clipboardData&&S(C.clipboardData.getData("text/plain"),E,A,x)},c.paste=S,c.moveTextAreaUnderMouseCursor=g,c.rightClickHandler=function(C,E,A,x,p){g(C,E,A),p&&x.rightClickSelect(C),E.value=x.selectionText,E.select()}},7239:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ColorContrastCache=void 0;const d=u(1505);c.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(S,g,C){this._css.set(S,g,C)}getCss(S,g){return this._css.get(S,g)}setColor(S,g,C){this._color.set(S,g,C)}getColor(S,g){return this._color.get(S,g)}clear(){this._color.clear(),this._css.clear()}}},3656:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.addDisposableDomListener=void 0,c.addDisposableDomListener=function(u,d,S,g){u.addEventListener(d,S,g);let C=!1;return{dispose:()=>{C||(C=!0,u.removeEventListener(d,S,g))}}}},3551:function(_,c,u){var d=this&&this.__decorate||function(v,h,b,T){var R,L=arguments.length,M=L<3?h:T===null?T=Object.getOwnPropertyDescriptor(h,b):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,h,b,T);else for(var k=v.length-1;k>=0;k--)(R=v[k])&&(M=(L<3?R(M):L>3?R(h,b,M):R(h,b))||M);return L>3&&M&&Object.defineProperty(h,b,M),M},S=this&&this.__param||function(v,h){return function(b,T){h(b,T,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Linkifier=void 0;const g=u(3656),C=u(8460),E=u(844),A=u(2585),x=u(4725);let p=c.Linkifier=class extends E.Disposable{get currentLink(){return this._currentLink}constructor(v,h,b,T,R){super(),this._element=v,this._mouseService=h,this._renderService=b,this._bufferService=T,this._linkProviderService=R,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new C.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new C.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,E.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,E.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,g.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,g.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,g.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,g.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(v){this._lastMouseEvent=v;const h=this._positionFromMouseEvent(v,this._element,this._mouseService);if(!h)return;this._isMouseOut=!1;const b=v.composedPath();for(let T=0;T<b.length;T++){const R=b[T];if(R.classList.contains("xterm"))break;if(R.classList.contains("xterm-hover"))return}this._lastBufferCell&&h.x===this._lastBufferCell.x&&h.y===this._lastBufferCell.y||(this._handleHover(h),this._lastBufferCell=h)}_handleHover(v){if(this._activeLine!==v.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(v,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,v)||(this._clearCurrentLink(),this._askForLink(v,!0))}_askForLink(v,h){this._activeProviderReplies&&h||(this._activeProviderReplies?.forEach((T=>{T?.forEach((R=>{R.link.dispose&&R.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=v.y);let b=!1;for(const[T,R]of this._linkProviderService.linkProviders.entries())h?this._activeProviderReplies?.get(T)&&(b=this._checkLinkProviderResult(T,v,b)):R.provideLinks(v.y,(L=>{if(this._isMouseOut)return;const M=L?.map((k=>({link:k})));this._activeProviderReplies?.set(T,M),b=this._checkLinkProviderResult(T,v,b),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(v.y,this._activeProviderReplies)}))}_removeIntersectingLinks(v,h){const b=new Set;for(let T=0;T<h.size;T++){const R=h.get(T);if(R)for(let L=0;L<R.length;L++){const M=R[L],k=M.link.range.start.y<v?0:M.link.range.start.x,B=M.link.range.end.y>v?this._bufferService.cols:M.link.range.end.x;for(let F=k;F<=B;F++){if(b.has(F)){R.splice(L--,1);break}b.add(F)}}}}_checkLinkProviderResult(v,h,b){if(!this._activeProviderReplies)return b;const T=this._activeProviderReplies.get(v);let R=!1;for(let L=0;L<v;L++)this._activeProviderReplies.has(L)&&!this._activeProviderReplies.get(L)||(R=!0);if(!R&&T){const L=T.find((M=>this._linkAtPosition(M.link,h)));L&&(b=!0,this._handleNewLink(L))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!b)for(let L=0;L<this._activeProviderReplies.size;L++){const M=this._activeProviderReplies.get(L)?.find((k=>this._linkAtPosition(k.link,h)));if(M){b=!0,this._handleNewLink(M);break}}return b}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(v){if(!this._currentLink)return;const h=this._positionFromMouseEvent(v,this._element,this._mouseService);h&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,h)&&this._currentLink.link.activate(v,this._currentLink.link.text)}_clearCurrentLink(v,h){this._currentLink&&this._lastMouseEvent&&(!v||!h||this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=h)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,E.disposeArray)(this._linkCacheDisposables))}_handleNewLink(v){if(!this._lastMouseEvent)return;const h=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);h&&this._linkAtPosition(v.link,h)&&(this._currentLink=v,this._currentLink.state={decorations:{underline:v.link.decorations===void 0||v.link.decorations.underline,pointerCursor:v.link.decorations===void 0||v.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,v.link,this._lastMouseEvent),v.link.decorations={},Object.defineProperties(v.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:b=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==b&&(this._currentLink.state.decorations.pointerCursor=b,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",b))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:b=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==b&&(this._currentLink.state.decorations.underline=b,this._currentLink.state.isHovered&&this._fireUnderlineEvent(v.link,b))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((b=>{if(!this._currentLink)return;const T=b.start===0?0:b.start+1+this._bufferService.buffer.ydisp,R=this._bufferService.buffer.ydisp+1+b.end;if(this._currentLink.link.range.start.y>=T&&this._currentLink.link.range.end.y<=R&&(this._clearCurrentLink(T,R),this._lastMouseEvent)){const L=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);L&&this._askForLink(L,!1)}}))))}_linkHover(v,h,b){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(h,!0),this._currentLink.state.decorations.pointerCursor&&v.classList.add("xterm-cursor-pointer")),h.hover&&h.hover(b,h.text)}_fireUnderlineEvent(v,h){const b=v.range,T=this._bufferService.buffer.ydisp,R=this._createLinkUnderlineEvent(b.start.x-1,b.start.y-T-1,b.end.x,b.end.y-T-1,void 0);(h?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(R)}_linkLeave(v,h,b){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(h,!1),this._currentLink.state.decorations.pointerCursor&&v.classList.remove("xterm-cursor-pointer")),h.leave&&h.leave(b,h.text)}_linkAtPosition(v,h){const b=v.range.start.y*this._bufferService.cols+v.range.start.x,T=v.range.end.y*this._bufferService.cols+v.range.end.x,R=h.y*this._bufferService.cols+h.x;return b<=R&&R<=T}_positionFromMouseEvent(v,h,b){const T=b.getCoords(v,h,this._bufferService.cols,this._bufferService.rows);if(T)return{x:T[0],y:T[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(v,h,b,T,R){return{x1:v,y1:h,x2:b,y2:T,cols:this._bufferService.cols,fg:R}}};c.Linkifier=p=d([S(1,x.IMouseService),S(2,x.IRenderService),S(3,A.IBufferService),S(4,x.ILinkProviderService)],p)},9042:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.tooMuchOutput=c.promptLabel=void 0,c.promptLabel="Terminal input",c.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(_,c,u){var d=this&&this.__decorate||function(x,p,v,h){var b,T=arguments.length,R=T<3?p:h===null?h=Object.getOwnPropertyDescriptor(p,v):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(x,p,v,h);else for(var L=x.length-1;L>=0;L--)(b=x[L])&&(R=(T<3?b(R):T>3?b(p,v,R):b(p,v))||R);return T>3&&R&&Object.defineProperty(p,v,R),R},S=this&&this.__param||function(x,p){return function(v,h){p(v,h,x)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkProvider=void 0;const g=u(511),C=u(2585);let E=c.OscLinkProvider=class{constructor(x,p,v){this._bufferService=x,this._optionsService=p,this._oscLinkService=v}provideLinks(x,p){const v=this._bufferService.buffer.lines.get(x-1);if(!v)return void p(void 0);const h=[],b=this._optionsService.rawOptions.linkHandler,T=new g.CellData,R=v.getTrimmedLength();let L=-1,M=-1,k=!1;for(let B=0;B<R;B++)if(M!==-1||v.hasContent(B)){if(v.loadCell(B,T),T.hasExtendedAttrs()&&T.extended.urlId){if(M===-1){M=B,L=T.extended.urlId;continue}k=T.extended.urlId!==L}else M!==-1&&(k=!0);if(k||M!==-1&&B===R-1){const F=this._oscLinkService.getLinkData(L)?.uri;if(F){const U={start:{x:M+1,y:x},end:{x:B+(k||B!==R-1?0:1),y:x}};let W=!1;if(!b?.allowNonHttpProtocols)try{const j=new URL(F);["http:","https:"].includes(j.protocol)||(W=!0)}catch{W=!0}W||h.push({text:F,range:U,activate:(j,G)=>b?b.activate(j,G,U):A(0,G),hover:(j,G)=>b?.hover?.(j,G,U),leave:(j,G)=>b?.leave?.(j,G,U)})}k=!1,T.hasExtendedAttrs()&&T.extended.urlId?(M=B,L=T.extended.urlId):(M=-1,L=-1)}}p(h)}};function A(x,p){if(confirm(`Do you want to navigate to ${p}?
771
+
772
+ WARNING: This link could potentially be dangerous`)){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=p}else console.warn("Opening link blocked as opener could not be cleared")}}c.OscLinkProvider=E=d([S(0,C.IBufferService),S(1,C.IOptionsService),S(2,C.IOscLinkService)],E)},6193:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.RenderDebouncer=void 0,c.RenderDebouncer=class{constructor(u,d){this._renderCallback=u,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,d,S){this._rowCount=S,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,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 u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;const d=u(3614),S=u(3656),g=u(3551),C=u(9042),E=u(3730),A=u(1680),x=u(3107),p=u(5744),v=u(2950),h=u(1296),b=u(428),T=u(4269),R=u(5114),L=u(8934),M=u(3230),k=u(9312),B=u(4725),F=u(6731),U=u(8055),W=u(8969),j=u(8460),G=u(844),ee=u(6114),q=u(8437),V=u(2584),Y=u(7399),D=u(5941),I=u(9074),N=u(2585),P=u(5435),Z=u(4567),ae=u(779);class ce extends W.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 G.MutableDisposable),this._onCursorMove=this.register(new j.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new j.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new j.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new j.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new j.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new j.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new j.EventEmitter),this._onBlur=this.register(new j.EventEmitter),this._onA11yCharEmitter=this.register(new j.EventEmitter),this._onA11yTabEmitter=this.register(new j.EventEmitter),this._onWillOpen=this.register(new j.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(I.DecorationService),this._instantiationService.setService(N.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ae.LinkProviderService),this._instantiationService.setService(B.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(E.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows((($,oe)=>this.refresh($,oe)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport(($=>this._reportWindowsOptions($)))),this.register(this._inputHandler.onColor(($=>this._handleColorEvent($)))),this.register((0,j.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,j.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,j.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,j.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(($=>this._afterResize($.cols,$.rows)))),this.register((0,G.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(Q){if(this._themeService)for(const $ of Q){let oe,ge="";switch($.index){case 256:oe="foreground",ge="10";break;case 257:oe="background",ge="11";break;case 258:oe="cursor",ge="12";break;default:oe="ansi",ge="4;"+$.index}switch($.type){case 0:const Se=U.color.toColorRGB(oe==="ansi"?this._themeService.colors.ansi[$.index]:this._themeService.colors[oe]);this.coreService.triggerDataEvent(`${V.C0.ESC}]${ge};${(0,D.toRgbString)(Se)}${V.C1_ESCAPED.ST}`);break;case 1:if(oe==="ansi")this._themeService.modifyColors((ye=>ye.ansi[$.index]=U.channels.toColor(...$.color)));else{const ye=oe;this._themeService.modifyColors((Pe=>Pe[ye]=U.channels.toColor(...$.color)))}break;case 2:this._themeService.restoreColor($.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(Z.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Q){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(V.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(V.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,$=this.buffer.lines.get(Q);if(!$)return;const oe=Math.min(this.buffer.x,this.cols-1),ge=this._renderService.dimensions.css.cell.height,Se=$.getWidth(oe),ye=this._renderService.dimensions.css.cell.width*Se,Pe=this.buffer.y*this._renderService.dimensions.css.cell.height,qe=oe*this._renderService.dimensions.css.cell.width;this.textarea.style.left=qe+"px",this.textarea.style.top=Pe+"px",this.textarea.style.width=ye+"px",this.textarea.style.height=ge+"px",this.textarea.style.lineHeight=ge+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,S.addDisposableDomListener)(this.element,"copy",($=>{this.hasSelection()&&(0,d.copyHandler)($,this._selectionService)})));const Q=$=>(0,d.handlePasteEvent)($,this.textarea,this.coreService,this.optionsService);this.register((0,S.addDisposableDomListener)(this.textarea,"paste",Q)),this.register((0,S.addDisposableDomListener)(this.element,"paste",Q)),ee.isFirefox?this.register((0,S.addDisposableDomListener)(this.element,"mousedown",($=>{$.button===2&&(0,d.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,S.addDisposableDomListener)(this.element,"contextmenu",($=>{(0,d.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),ee.isLinux&&this.register((0,S.addDisposableDomListener)(this.element,"auxclick",($=>{$.button===1&&(0,d.moveTextAreaUnderMouseCursor)($,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,S.addDisposableDomListener)(this.textarea,"keyup",(Q=>this._keyUp(Q)),!0)),this.register((0,S.addDisposableDomListener)(this.textarea,"keydown",(Q=>this._keyDown(Q)),!0)),this.register((0,S.addDisposableDomListener)(this.textarea,"keypress",(Q=>this._keyPress(Q)),!0)),this.register((0,S.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,S.addDisposableDomListener)(this.textarea,"compositionupdate",(Q=>this._compositionHelper.compositionupdate(Q)))),this.register((0,S.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,S.addDisposableDomListener)(this.textarea,"input",(Q=>this._inputEvent(Q)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Q){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"),this.element?.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 $=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),$.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,S.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),$.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",C.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(R.CoreBrowserService,this.textarea,Q.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(B.ICoreBrowserService,this._coreBrowserService),this.register((0,S.addDisposableDomListener)(this.textarea,"focus",(oe=>this._handleTextAreaFocus(oe)))),this.register((0,S.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(b.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(B.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(F.ThemeService),this._instantiationService.setService(B.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(T.CharacterJoinerService),this._instantiationService.setService(B.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(B.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(v.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(L.MouseService),this._instantiationService.setService(B.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(g.Linkifier,this.screenElement)),this.element.appendChild($);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(k.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(B.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,S.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(x.BufferDecorationRenderer,this.screenElement)),this.register((0,S.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(Z.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(p.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(p.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(h.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Q=this,$=this.element;function oe(ye){const Pe=Q._mouseService.getMouseReportCoords(ye,Q.screenElement);if(!Pe)return!1;let qe,Xe;switch(ye.overrideType||ye.type){case"mousemove":Xe=32,ye.buttons===void 0?(qe=3,ye.button!==void 0&&(qe=ye.button<3?ye.button:3)):qe=1&ye.buttons?0:4&ye.buttons?1:2&ye.buttons?2:3;break;case"mouseup":Xe=0,qe=ye.button<3?ye.button:3;break;case"mousedown":Xe=1,qe=ye.button<3?ye.button:3;break;case"wheel":if(Q._customWheelEventHandler&&Q._customWheelEventHandler(ye)===!1||Q.viewport.getLinesScrolled(ye)===0)return!1;Xe=ye.deltaY<0?0:1,qe=4;break;default:return!1}return!(Xe===void 0||qe===void 0||qe>4)&&Q.coreMouseService.triggerMouseEvent({col:Pe.col,row:Pe.row,x:Pe.x,y:Pe.y,button:qe,action:Xe,ctrl:ye.ctrlKey,alt:ye.altKey,shift:ye.shiftKey})}const ge={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Se={mouseup:ye=>(oe(ye),ye.buttons||(this._document.removeEventListener("mouseup",ge.mouseup),ge.mousedrag&&this._document.removeEventListener("mousemove",ge.mousedrag)),this.cancel(ye)),wheel:ye=>(oe(ye),this.cancel(ye,!0)),mousedrag:ye=>{ye.buttons&&oe(ye)},mousemove:ye=>{ye.buttons||oe(ye)}};this.register(this.coreMouseService.onProtocolChange((ye=>{ye?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ye)),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&ye?ge.mousemove||($.addEventListener("mousemove",Se.mousemove),ge.mousemove=Se.mousemove):($.removeEventListener("mousemove",ge.mousemove),ge.mousemove=null),16&ye?ge.wheel||($.addEventListener("wheel",Se.wheel,{passive:!1}),ge.wheel=Se.wheel):($.removeEventListener("wheel",ge.wheel),ge.wheel=null),2&ye?ge.mouseup||(ge.mouseup=Se.mouseup):(this._document.removeEventListener("mouseup",ge.mouseup),ge.mouseup=null),4&ye?ge.mousedrag||(ge.mousedrag=Se.mousedrag):(this._document.removeEventListener("mousemove",ge.mousedrag),ge.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,S.addDisposableDomListener)($,"mousedown",(ye=>{if(ye.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ye))return oe(ye),ge.mouseup&&this._document.addEventListener("mouseup",ge.mouseup),ge.mousedrag&&this._document.addEventListener("mousemove",ge.mousedrag),this.cancel(ye)}))),this.register((0,S.addDisposableDomListener)($,"wheel",(ye=>{if(!ge.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ye)===!1)return!1;if(!this.buffer.hasScrollback){const Pe=this.viewport.getLinesScrolled(ye);if(Pe===0)return;const qe=V.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ye.deltaY<0?"A":"B");let Xe="";for(let xt=0;xt<Math.abs(Pe);xt++)Xe+=qe;return this.coreService.triggerDataEvent(Xe,!0),this.cancel(ye,!0)}return this.viewport.handleWheel(ye)?this.cancel(ye):void 0}}),{passive:!1})),this.register((0,S.addDisposableDomListener)($,"touchstart",(ye=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ye),this.cancel(ye)}),{passive:!0})),this.register((0,S.addDisposableDomListener)($,"touchmove",(ye=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ye)?void 0:this.cancel(ye)}),{passive:!1}))}refresh(Q,$){this._renderService?.refreshRows(Q,$)}updateCursorStyle(Q){this._selectionService?.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,$,oe=0){oe===1?(super.scrollLines(Q,$,oe),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(Q)}paste(Q){(0,d.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 $=this._characterJoinerService.register(Q);return this.refresh(0,this.rows-1),$}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,$,oe){this._selectionService.setSelection(Q,$,oe)}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(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(Q,$){this._selectionService?.selectLines(Q,$)}_keyDown(Q){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;const $=this.browser.isMac&&this.options.macOptionIsMeta&&Q.altKey;if(!$&&!this._compositionHelper.keydown(Q))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;$||Q.key!=="Dead"&&Q.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const oe=(0,Y.evaluateKeyboardEvent)(Q,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Q),oe.type===3||oe.type===2){const ge=this.rows-1;return this.scrollLines(oe.type===2?-ge:ge),this.cancel(Q,!0)}return oe.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Q)||(oe.cancel&&this.cancel(Q,!0),!oe.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):(oe.key!==V.C0.ETX&&oe.key!==V.C0.CR||(this.textarea.value=""),this._onKey.fire({key:oe.key,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent(oe.key,!0),!this.optionsService.rawOptions.screenReaderMode||Q.altKey||Q.ctrlKey?this.cancel(Q,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Q,$){const oe=Q.isMac&&!this.options.macOptionIsMeta&&$.altKey&&!$.ctrlKey&&!$.metaKey||Q.isWindows&&$.altKey&&$.ctrlKey&&!$.metaKey||Q.isWindows&&$.getModifierState("AltGraph");return $.type==="keypress"?oe:oe&&(!$.keyCode||$.keyCode>47)}_keyUp(Q){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1||((function($){return $.keyCode===16||$.keyCode===17||$.keyCode===18})(Q)||this.focus(),this.updateCursorStyle(Q),this._keyPressHandled=!1)}_keyPress(Q){let $;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;if(this.cancel(Q),Q.charCode)$=Q.charCode;else if(Q.which===null||Q.which===void 0)$=Q.keyCode;else{if(Q.which===0||Q.charCode===0)return!1;$=Q.which}return!(!$||(Q.altKey||Q.ctrlKey||Q.metaKey)&&!this._isThirdLevelShift(this.browser,Q)||($=String.fromCharCode($),this._onKey.fire({key:$,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent($,!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 $=Q.data;return this.coreService.triggerDataEvent($,!0),this.cancel(Q),!0}return!1}resize(Q,$){Q!==this.cols||$!==this.rows?super.resize(Q,$):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Q,$){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){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 Q=1;Q<this.rows;Q++)this.buffer.lines.push(this.buffer.getBlankLine(q.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;const Q=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=Q,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(V.C0.ESC+"[I"):this.coreService.triggerDataEvent(V.C0.ESC+"[O")}_reportWindowsOptions(Q){if(this._renderService)switch(Q){case P.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const $=this._renderService.dimensions.css.canvas.width.toFixed(0),oe=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${V.C0.ESC}[4;${oe};${$}t`);break;case P.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ge=this._renderService.dimensions.css.cell.width.toFixed(0),Se=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${V.C0.ESC}[6;${Se};${ge}t`)}}cancel(Q,$){if(this.options.cancelEvents||$)return Q.preventDefault(),Q.stopPropagation(),!1}}c.Terminal=ce},9924:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TimeBasedDebouncer=void 0,c.TimeBasedDebouncer=class{constructor(u,d=1e3){this._renderCallback=u,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,d,S){this._rowCount=S,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const g=Date.now();if(g-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=g,this._innerRefresh();else if(!this._additionalRefreshRequested){const C=g-this._lastRefreshMs,E=this._debounceThresholdMS-C;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),E)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d)}}},1680:function(_,c,u){var d=this&&this.__decorate||function(v,h,b,T){var R,L=arguments.length,M=L<3?h:T===null?T=Object.getOwnPropertyDescriptor(h,b):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,h,b,T);else for(var k=v.length-1;k>=0;k--)(R=v[k])&&(M=(L<3?R(M):L>3?R(h,b,M):R(h,b))||M);return L>3&&M&&Object.defineProperty(h,b,M),M},S=this&&this.__param||function(v,h){return function(b,T){h(b,T,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Viewport=void 0;const g=u(3656),C=u(4725),E=u(8460),A=u(844),x=u(2585);let p=c.Viewport=class extends A.Disposable{constructor(v,h,b,T,R,L,M,k){super(),this._viewportElement=v,this._scrollArea=h,this._bufferService=b,this._optionsService=T,this._charSizeService=R,this._renderService=L,this._coreBrowserService=M,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 E.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((B=>this._activeBuffer=B.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((B=>this._renderDimensions=B))),this._handleThemeChange(k.colors),this.register(k.onChangeColors((B=>this._handleThemeChange(B)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(v){this._viewportElement.style.backgroundColor=v.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(v){if(v)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 h=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==h&&(this._lastRecordedBufferHeight=h,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const v=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==v&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=v),this._refreshAnimationFrame=null}syncScrollArea(v=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(v);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(v)}_handleScroll(v){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 h=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:h,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const v=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(v*(this._smoothScrollState.target-this._smoothScrollState.origin)),v<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(v,h){const b=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(h<0&&this._viewportElement.scrollTop!==0||h>0&&b<this._lastRecordedBufferHeight)||(v.cancelable&&v.preventDefault(),!1)}handleWheel(v){const h=this._getPixelsScrolled(v);return h!==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+h:this._smoothScrollState.target+=h,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=h,this._bubbleScroll(v,h))}scrollLines(v){if(v!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const h=v*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+h,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:v,suppressScrollEvent:!1})}_getPixelsScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let h=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_LINE?h*=this._currentRowHeight:v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(h*=this._currentRowHeight*this._bufferService.rows),h}getBufferElements(v,h){let b,T="";const R=[],L=h??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let k=v;k<L;k++){const B=M.get(k);if(!B)continue;const F=M.get(k+1)?.isWrapped;if(T+=B.translateToString(!F),!F||k===M.length-1){const U=document.createElement("div");U.textContent=T,R.push(U),T.length>0&&(b=U),T=""}}return{bufferElements:R,cursorElement:b}}getLinesScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let h=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(h/=this._currentRowHeight+0,this._wheelPartialScroll+=h,h=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(h*=this._bufferService.rows),h}_applyScrollModifier(v,h){const b=this._optionsService.rawOptions.fastScrollModifier;return b==="alt"&&h.altKey||b==="ctrl"&&h.ctrlKey||b==="shift"&&h.shiftKey?v*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:v*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(v){this._lastTouchY=v.touches[0].pageY}handleTouchMove(v){const h=this._lastTouchY-v.touches[0].pageY;return this._lastTouchY=v.touches[0].pageY,h!==0&&(this._viewportElement.scrollTop+=h,this._bubbleScroll(v,h))}};c.Viewport=p=d([S(2,x.IBufferService),S(3,x.IOptionsService),S(4,C.ICharSizeService),S(5,C.IRenderService),S(6,C.ICoreBrowserService),S(7,C.IThemeService)],p)},3107:function(_,c,u){var d=this&&this.__decorate||function(x,p,v,h){var b,T=arguments.length,R=T<3?p:h===null?h=Object.getOwnPropertyDescriptor(p,v):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(x,p,v,h);else for(var L=x.length-1;L>=0;L--)(b=x[L])&&(R=(T<3?b(R):T>3?b(p,v,R):b(p,v))||R);return T>3&&R&&Object.defineProperty(p,v,R),R},S=this&&this.__param||function(x,p){return function(v,h){p(v,h,x)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferDecorationRenderer=void 0;const g=u(4725),C=u(844),E=u(2585);let A=c.BufferDecorationRenderer=class extends C.Disposable{constructor(x,p,v,h,b){super(),this._screenElement=x,this._bufferService=p,this._coreBrowserService=v,this._decorationService=h,this._renderService=b,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,C.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 x of this._decorationService.decorations)this._renderDecoration(x);this._dimensionsChanged=!1}_renderDecoration(x){this._refreshStyle(x),this._dimensionsChanged&&this._refreshXPosition(x)}_createElement(x){const p=this._coreBrowserService.mainDocument.createElement("div");p.classList.add("xterm-decoration"),p.classList.toggle("xterm-decoration-top-layer",x?.options?.layer==="top"),p.style.width=`${Math.round((x.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,p.style.height=(x.options.height||1)*this._renderService.dimensions.css.cell.height+"px",p.style.top=(x.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",p.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const v=x.options.x??0;return v&&v>this._bufferService.cols&&(p.style.display="none"),this._refreshXPosition(x,p),p}_refreshStyle(x){const p=x.marker.line-this._bufferService.buffers.active.ydisp;if(p<0||p>=this._bufferService.rows)x.element&&(x.element.style.display="none",x.onRenderEmitter.fire(x.element));else{let v=this._decorationElements.get(x);v||(v=this._createElement(x),x.element=v,this._decorationElements.set(x,v),this._container.appendChild(v),x.onDispose((()=>{this._decorationElements.delete(x),v.remove()}))),v.style.top=p*this._renderService.dimensions.css.cell.height+"px",v.style.display=this._altBufferIsActive?"none":"block",x.onRenderEmitter.fire(v)}}_refreshXPosition(x,p=x.element){if(!p)return;const v=x.options.x??0;(x.options.anchor||"left")==="right"?p.style.right=v?v*this._renderService.dimensions.css.cell.width+"px":"":p.style.left=v?v*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(x){this._decorationElements.get(x)?.remove(),this._decorationElements.delete(x),x.dispose()}};c.BufferDecorationRenderer=A=d([S(1,E.IBufferService),S(2,g.ICoreBrowserService),S(3,E.IDecorationService),S(4,g.IRenderService)],A)},5871:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ColorZoneStore=void 0,c.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(u){if(u.options.overviewRulerOptions){for(const d of this._zones)if(d.color===u.options.overviewRulerOptions.color&&d.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,u.marker.line))return;if(this._lineAdjacentToZone(d,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(d,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,d){return d>=u.startBufferLine&&d<=u.endBufferLine}_lineAdjacentToZone(u,d,S){return d>=u.startBufferLine-this._linePadding[S||"full"]&&d<=u.endBufferLine+this._linePadding[S||"full"]}_addLineToZone(u,d){u.startBufferLine=Math.min(u.startBufferLine,d),u.endBufferLine=Math.max(u.endBufferLine,d)}}},5744:function(_,c,u){var d=this&&this.__decorate||function(b,T,R,L){var M,k=arguments.length,B=k<3?T:L===null?L=Object.getOwnPropertyDescriptor(T,R):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(b,T,R,L);else for(var F=b.length-1;F>=0;F--)(M=b[F])&&(B=(k<3?M(B):k>3?M(T,R,B):M(T,R))||B);return k>3&&B&&Object.defineProperty(T,R,B),B},S=this&&this.__param||function(b,T){return function(R,L){T(R,L,b)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OverviewRulerRenderer=void 0;const g=u(5871),C=u(4725),E=u(844),A=u(2585),x={full:0,left:0,center:0,right:0},p={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0};let h=c.OverviewRulerRenderer=class extends E.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(b,T,R,L,M,k,B){super(),this._viewportElement=b,this._screenElement=T,this._bufferService=R,this._decorationService=L,this._renderService=M,this._optionsService=k,this._coreBrowserService=B,this._colorZoneStore=new g.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?.insertBefore(this._canvas,this._viewportElement);const F=this._canvas.getContext("2d");if(!F)throw new Error("Ctx cannot be null");this._ctx=F,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,E.toDisposable)((()=>{this._canvas?.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 b=Math.floor(this._canvas.width/3),T=Math.ceil(this._canvas.width/3);p.full=this._canvas.width,p.left=b,p.center=T,p.right=b,this._refreshDrawHeightConstants(),v.full=0,v.left=0,v.center=p.left,v.right=p.left+p.center}_refreshDrawHeightConstants(){x.full=Math.round(2*this._coreBrowserService.dpr);const b=this._canvas.height/this._bufferService.buffer.lines.length,T=Math.round(Math.max(Math.min(b,12),6)*this._coreBrowserService.dpr);x.left=T,x.center=T,x.right=T}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.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 b=this._colorZoneStore.zones;for(const T of b)T.position!=="full"&&this._renderColorZone(T);for(const T of b)T.position==="full"&&this._renderColorZone(T);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(b){this._ctx.fillStyle=b.color,this._ctx.fillRect(v[b.position||"full"],Math.round((this._canvas.height-1)*(b.startBufferLine/this._bufferService.buffers.active.lines.length)-x[b.position||"full"]/2),p[b.position||"full"],Math.round((this._canvas.height-1)*((b.endBufferLine-b.startBufferLine)/this._bufferService.buffers.active.lines.length)+x[b.position||"full"]))}_queueRefresh(b,T){this._shouldUpdateDimensions=b||this._shouldUpdateDimensions,this._shouldUpdateAnchor=T||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};c.OverviewRulerRenderer=h=d([S(2,A.IBufferService),S(3,A.IDecorationService),S(4,C.IRenderService),S(5,A.IOptionsService),S(6,C.ICoreBrowserService)],h)},2950:function(_,c,u){var d=this&&this.__decorate||function(x,p,v,h){var b,T=arguments.length,R=T<3?p:h===null?h=Object.getOwnPropertyDescriptor(p,v):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(x,p,v,h);else for(var L=x.length-1;L>=0;L--)(b=x[L])&&(R=(T<3?b(R):T>3?b(p,v,R):b(p,v))||R);return T>3&&R&&Object.defineProperty(p,v,R),R},S=this&&this.__param||function(x,p){return function(v,h){p(v,h,x)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CompositionHelper=void 0;const g=u(4725),C=u(2585),E=u(2584);let A=c.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(x,p,v,h,b,T){this._textarea=x,this._compositionView=p,this._bufferService=v,this._optionsService=h,this._coreService=b,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(x){this._compositionView.textContent=x.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(x){if(this._isComposing||this._isSendingComposition){if(x.keyCode===229||x.keyCode===16||x.keyCode===17||x.keyCode===18)return!1;this._finalizeComposition(!1)}return x.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(x){if(this._compositionView.classList.remove("active"),this._isComposing=!1,x){const p={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let v;this._isSendingComposition=!1,p.start+=this._dataAlreadySent.length,v=this._isComposing?this._textarea.value.substring(p.start,p.end):this._textarea.value.substring(p.start),v.length>0&&this._coreService.triggerDataEvent(v,!0)}}),0)}else{this._isSendingComposition=!1;const p=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(p,!0)}}_handleAnyTextareaChanges(){const x=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const p=this._textarea.value,v=p.replace(x,"");this._dataAlreadySent=v,p.length>x.length?this._coreService.triggerDataEvent(v,!0):p.length<x.length?this._coreService.triggerDataEvent(`${E.C0.DEL}`,!0):p.length===x.length&&p!==x&&this._coreService.triggerDataEvent(p,!0)}}),0)}updateCompositionElements(x){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const p=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),v=this._renderService.dimensions.css.cell.height,h=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,b=p*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=b+"px",this._compositionView.style.top=h+"px",this._compositionView.style.height=v+"px",this._compositionView.style.lineHeight=v+"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=b+"px",this._textarea.style.top=h+"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"}x||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};c.CompositionHelper=A=d([S(2,C.IBufferService),S(3,C.IOptionsService),S(4,C.ICoreService),S(5,g.IRenderService)],A)},9806:(_,c)=>{function u(d,S,g){const C=g.getBoundingClientRect(),E=d.getComputedStyle(g),A=parseInt(E.getPropertyValue("padding-left")),x=parseInt(E.getPropertyValue("padding-top"));return[S.clientX-C.left-A,S.clientY-C.top-x]}Object.defineProperty(c,"__esModule",{value:!0}),c.getCoords=c.getCoordsRelativeToElement=void 0,c.getCoordsRelativeToElement=u,c.getCoords=function(d,S,g,C,E,A,x,p,v){if(!A)return;const h=u(d,S,g);return h?(h[0]=Math.ceil((h[0]+(v?x/2:0))/x),h[1]=Math.ceil(h[1]/p),h[0]=Math.min(Math.max(h[0],1),C+(v?1:0)),h[1]=Math.min(Math.max(h[1],1),E),h):void 0}},9504:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.moveToCellSequence=void 0;const d=u(2584);function S(p,v,h,b){const T=p-g(p,h),R=v-g(v,h),L=Math.abs(T-R)-(function(M,k,B){let F=0;const U=M-g(M,B),W=k-g(k,B);for(let j=0;j<Math.abs(U-W);j++){const G=C(M,k)==="A"?-1:1;B.buffer.lines.get(U+G*j)?.isWrapped&&F++}return F})(p,v,h);return x(L,A(C(p,v),b))}function g(p,v){let h=0,b=v.buffer.lines.get(p),T=b?.isWrapped;for(;T&&p>=0&&p<v.rows;)h++,b=v.buffer.lines.get(--p),T=b?.isWrapped;return h}function C(p,v){return p>v?"A":"B"}function E(p,v,h,b,T,R){let L=p,M=v,k="";for(;L!==h||M!==b;)L+=T?1:-1,T&&L>R.cols-1?(k+=R.buffer.translateBufferLineToString(M,!1,p,L),L=0,p=0,M++):!T&&L<0&&(k+=R.buffer.translateBufferLineToString(M,!1,0,p+1),L=R.cols-1,p=L,M--);return k+R.buffer.translateBufferLineToString(M,!1,p,L)}function A(p,v){const h=v?"O":"[";return d.C0.ESC+h+p}function x(p,v){p=Math.floor(p);let h="";for(let b=0;b<p;b++)h+=v;return h}c.moveToCellSequence=function(p,v,h,b){const T=h.buffer.x,R=h.buffer.y;if(!h.buffer.hasScrollback)return(function(k,B,F,U,W,j){return S(B,U,W,j).length===0?"":x(E(k,B,k,B-g(B,W),!1,W).length,A("D",j))})(T,R,0,v,h,b)+S(R,v,h,b)+(function(k,B,F,U,W,j){let G;G=S(B,U,W,j).length>0?U-g(U,W):B;const ee=U,q=(function(V,Y,D,I,N,P){let Z;return Z=S(D,I,N,P).length>0?I-g(I,N):Y,V<D&&Z<=I||V>=D&&Z<I?"C":"D"})(k,B,F,U,W,j);return x(E(k,G,F,ee,q==="C",W).length,A(q,j))})(T,R,p,v,h,b);let L;if(R===v)return L=T>p?"D":"C",x(Math.abs(T-p),A(L,b));L=R>v?"D":"C";const M=Math.abs(R-v);return x((function(k,B){return B.cols-k})(R>v?p:T,h)+(M-1)*h.cols+1+((R>v?T:p)-1),A(L,b))}},1296:function(_,c,u){var d=this&&this.__decorate||function(j,G,ee,q){var V,Y=arguments.length,D=Y<3?G:q===null?q=Object.getOwnPropertyDescriptor(G,ee):q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(j,G,ee,q);else for(var I=j.length-1;I>=0;I--)(V=j[I])&&(D=(Y<3?V(D):Y>3?V(G,ee,D):V(G,ee))||D);return Y>3&&D&&Object.defineProperty(G,ee,D),D},S=this&&this.__param||function(j,G){return function(ee,q){G(ee,q,j)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRenderer=void 0;const g=u(3787),C=u(2550),E=u(2223),A=u(6171),x=u(6052),p=u(4725),v=u(8055),h=u(8460),b=u(844),T=u(2585),R="xterm-dom-renderer-owner-",L="xterm-rows",M="xterm-fg-",k="xterm-bg-",B="xterm-focus",F="xterm-selection";let U=1,W=c.DomRenderer=class extends b.Disposable{constructor(j,G,ee,q,V,Y,D,I,N,P,Z,ae,ce){super(),this._terminal=j,this._document=G,this._element=ee,this._screenElement=q,this._viewportElement=V,this._helperContainer=Y,this._linkifier2=D,this._charSizeService=N,this._optionsService=P,this._bufferService=Z,this._coreBrowserService=ae,this._themeService=ce,this._terminalClass=U++,this._rowElements=[],this._selectionRenderModel=(0,x.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new h.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(L),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(F),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((_e=>this._injectCss(_e)))),this._injectCss(this._themeService.colors),this._rowFactory=I.createInstance(g.DomRendererRowFactory,document),this._element.classList.add(R+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((_e=>this._handleLinkHover(_e)))),this.register(this._linkifier2.onHideLinkUnderline((_e=>this._handleLinkLeave(_e)))),this.register((0,b.toDisposable)((()=>{this._element.classList.remove(R+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new C.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 j=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*j,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*j),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/j),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/j),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 G=`${this._terminalSelector} .${L} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=G,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(j){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let G=`${this._terminalSelector} .${L} { color: ${j.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;G+=`${this._terminalSelector} .${L} .xterm-dim { color: ${v.color.multiplyOpacity(j.foreground,.5).css};}`,G+=`${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}`,q=`blink_bar_${this._terminalClass}`,V=`blink_block_${this._terminalClass}`;G+=`@keyframes ${ee} { 50% { border-bottom-style: hidden; }}`,G+=`@keyframes ${q} { 50% { box-shadow: none; }}`,G+=`@keyframes ${V} { 0% { background-color: ${j.cursor.css}; color: ${j.cursorAccent.css}; } 50% { background-color: inherit; color: ${j.cursor.css}; }}`,G+=`${this._terminalSelector} .${L}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${ee} 1s step-end infinite;}${this._terminalSelector} .${L}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${L}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-block { background-color: ${j.cursor.css}; color: ${j.cursorAccent.css};}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${j.cursor.css} !important; color: ${j.cursorAccent.css} !important;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${j.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${j.cursor.css} inset;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${j.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,G+=`${this._terminalSelector} .${F} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${F} div { position: absolute; background-color: ${j.selectionBackgroundOpaque.css};}${this._terminalSelector} .${F} div { position: absolute; background-color: ${j.selectionInactiveBackgroundOpaque.css};}`;for(const[Y,D]of j.ansi.entries())G+=`${this._terminalSelector} .${M}${Y} { color: ${D.css}; }${this._terminalSelector} .${M}${Y}.xterm-dim { color: ${v.color.multiplyOpacity(D,.5).css}; }${this._terminalSelector} .${k}${Y} { background-color: ${D.css}; }`;G+=`${this._terminalSelector} .${M}${E.INVERTED_DEFAULT_COLOR} { color: ${v.color.opaque(j.background).css}; }${this._terminalSelector} .${M}${E.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${v.color.multiplyOpacity(v.color.opaque(j.background),.5).css}; }${this._terminalSelector} .${k}${E.INVERTED_DEFAULT_COLOR} { background-color: ${j.foreground.css}; }`,this._themeStyleElement.textContent=G}_setDefaultSpacing(){const j=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${j}px`,this._rowFactory.defaultSpacing=j}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(j,G){for(let ee=this._rowElements.length;ee<=G;ee++){const q=this._document.createElement("div");this._rowContainer.appendChild(q),this._rowElements.push(q)}for(;this._rowElements.length>G;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(j,G){this._refreshRowElements(j,G),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(B),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(B),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(j,G,ee){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(j,G,ee),this.renderRows(0,this._bufferService.rows-1),!j||!G)return;this._selectionRenderModel.update(this._terminal,j,G,ee);const q=this._selectionRenderModel.viewportStartRow,V=this._selectionRenderModel.viewportEndRow,Y=this._selectionRenderModel.viewportCappedStartRow,D=this._selectionRenderModel.viewportCappedEndRow;if(Y>=this._bufferService.rows||D<0)return;const I=this._document.createDocumentFragment();if(ee){const N=j[0]>G[0];I.appendChild(this._createSelectionElement(Y,N?G[0]:j[0],N?j[0]:G[0],D-Y+1))}else{const N=q===Y?j[0]:0,P=Y===V?G[0]:this._bufferService.cols;I.appendChild(this._createSelectionElement(Y,N,P));const Z=D-Y-1;if(I.appendChild(this._createSelectionElement(Y+1,0,this._bufferService.cols,Z)),Y!==D){const ae=V===D?G[0]:this._bufferService.cols;I.appendChild(this._createSelectionElement(D,0,ae))}}this._selectionContainer.appendChild(I)}_createSelectionElement(j,G,ee,q=1){const V=this._document.createElement("div"),Y=G*this.dimensions.css.cell.width;let D=this.dimensions.css.cell.width*(ee-G);return Y+D>this.dimensions.css.canvas.width&&(D=this.dimensions.css.canvas.width-Y),V.style.height=q*this.dimensions.css.cell.height+"px",V.style.top=j*this.dimensions.css.cell.height+"px",V.style.left=`${Y}px`,V.style.width=`${D}px`,V}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 j of this._rowElements)j.replaceChildren()}renderRows(j,G){const ee=this._bufferService.buffer,q=ee.ybase+ee.y,V=Math.min(ee.x,this._bufferService.cols-1),Y=this._optionsService.rawOptions.cursorBlink,D=this._optionsService.rawOptions.cursorStyle,I=this._optionsService.rawOptions.cursorInactiveStyle;for(let N=j;N<=G;N++){const P=N+ee.ydisp,Z=this._rowElements[N],ae=ee.lines.get(P);if(!Z||!ae)break;Z.replaceChildren(...this._rowFactory.createRow(ae,P,P===q,D,I,V,Y,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${R}${this._terminalClass}`}_handleLinkHover(j){this._setCellUnderline(j.x1,j.x2,j.y1,j.y2,j.cols,!0)}_handleLinkLeave(j){this._setCellUnderline(j.x1,j.x2,j.y1,j.y2,j.cols,!1)}_setCellUnderline(j,G,ee,q,V,Y){ee<0&&(j=0),q<0&&(G=0);const D=this._bufferService.rows-1;ee=Math.max(Math.min(ee,D),0),q=Math.max(Math.min(q,D),0),V=Math.min(V,this._bufferService.cols);const I=this._bufferService.buffer,N=I.ybase+I.y,P=Math.min(I.x,V-1),Z=this._optionsService.rawOptions.cursorBlink,ae=this._optionsService.rawOptions.cursorStyle,ce=this._optionsService.rawOptions.cursorInactiveStyle;for(let _e=ee;_e<=q;++_e){const Q=_e+I.ydisp,$=this._rowElements[_e],oe=I.lines.get(Q);if(!$||!oe)break;$.replaceChildren(...this._rowFactory.createRow(oe,Q,Q===N,ae,ce,P,Z,this.dimensions.css.cell.width,this._widthCache,Y?_e===ee?j:0:-1,Y?(_e===q?G:V)-1:-1))}}};c.DomRenderer=W=d([S(7,T.IInstantiationService),S(8,p.ICharSizeService),S(9,T.IOptionsService),S(10,T.IBufferService),S(11,p.ICoreBrowserService),S(12,p.IThemeService)],W)},3787:function(_,c,u){var d=this&&this.__decorate||function(L,M,k,B){var F,U=arguments.length,W=U<3?M:B===null?B=Object.getOwnPropertyDescriptor(M,k):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(L,M,k,B);else for(var j=L.length-1;j>=0;j--)(F=L[j])&&(W=(U<3?F(W):U>3?F(M,k,W):F(M,k))||W);return U>3&&W&&Object.defineProperty(M,k,W),W},S=this&&this.__param||function(L,M){return function(k,B){M(k,B,L)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRendererRowFactory=void 0;const g=u(2223),C=u(643),E=u(511),A=u(2585),x=u(8055),p=u(4725),v=u(4269),h=u(6171),b=u(3734);let T=c.DomRendererRowFactory=class{constructor(L,M,k,B,F,U,W){this._document=L,this._characterJoinerService=M,this._optionsService=k,this._coreBrowserService=B,this._coreService=F,this._decorationService=U,this._themeService=W,this._workCell=new E.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(L,M,k){this._selectionStart=L,this._selectionEnd=M,this._columnSelectMode=k}createRow(L,M,k,B,F,U,W,j,G,ee,q){const V=[],Y=this._characterJoinerService.getJoinedCharacters(M),D=this._themeService.colors;let I,N=L.getNoBgTrimmedLength();k&&N<U+1&&(N=U+1);let P=0,Z="",ae=0,ce=0,_e=0,Q=!1,$=0,oe=!1,ge=0;const Se=[],ye=ee!==-1&&q!==-1;for(let Pe=0;Pe<N;Pe++){L.loadCell(Pe,this._workCell);let qe=this._workCell.getWidth();if(qe===0)continue;let Xe=!1,xt=Pe,Ne=this._workCell;if(Y.length>0&&Pe===Y[0][0]){Xe=!0;const ft=Y.shift();Ne=new v.JoinedCellData(this._workCell,L.translateToString(!0,ft[0],ft[1]),ft[1]-ft[0]),xt=ft[1]-1,qe=Ne.getWidth()}const en=this._isCellInSelection(Pe,M),yn=k&&Pe===U,Sn=ye&&Pe>=ee&&Pe<=q;let mi=!1;this._decorationService.forEachDecorationAtCell(Pe,M,void 0,(ft=>{mi=!0}));let Ni=Ne.getChars()||C.WHITESPACE_CELL_CHAR;if(Ni===" "&&(Ne.isUnderline()||Ne.isOverline())&&(Ni=" "),ge=qe*j-G.get(Ni,Ne.isBold(),Ne.isItalic()),I){if(P&&(en&&oe||!en&&!oe&&Ne.bg===ae)&&(en&&oe&&D.selectionForeground||Ne.fg===ce)&&Ne.extended.ext===_e&&Sn===Q&&ge===$&&!yn&&!Xe&&!mi){Ne.isInvisible()?Z+=C.WHITESPACE_CELL_CHAR:Z+=Ni,P++;continue}P&&(I.textContent=Z),I=this._document.createElement("span"),P=0,Z=""}else I=this._document.createElement("span");if(ae=Ne.bg,ce=Ne.fg,_e=Ne.extended.ext,Q=Sn,$=ge,oe=en,Xe&&U>=Pe&&U<=xt&&(U=Pe),!this._coreService.isCursorHidden&&yn&&this._coreService.isCursorInitialized){if(Se.push("xterm-cursor"),this._coreBrowserService.isFocused)W&&Se.push("xterm-cursor-blink"),Se.push(B==="bar"?"xterm-cursor-bar":B==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(F)switch(F){case"outline":Se.push("xterm-cursor-outline");break;case"block":Se.push("xterm-cursor-block");break;case"bar":Se.push("xterm-cursor-bar");break;case"underline":Se.push("xterm-cursor-underline")}}if(Ne.isBold()&&Se.push("xterm-bold"),Ne.isItalic()&&Se.push("xterm-italic"),Ne.isDim()&&Se.push("xterm-dim"),Z=Ne.isInvisible()?C.WHITESPACE_CELL_CHAR:Ne.getChars()||C.WHITESPACE_CELL_CHAR,Ne.isUnderline()&&(Se.push(`xterm-underline-${Ne.extended.underlineStyle}`),Z===" "&&(Z=" "),!Ne.isUnderlineColorDefault()))if(Ne.isUnderlineColorRGB())I.style.textDecorationColor=`rgb(${b.AttributeData.toColorRGB(Ne.getUnderlineColor()).join(",")})`;else{let ft=Ne.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ne.isBold()&&ft<8&&(ft+=8),I.style.textDecorationColor=D.ansi[ft].css}Ne.isOverline()&&(Se.push("xterm-overline"),Z===" "&&(Z=" ")),Ne.isStrikethrough()&&Se.push("xterm-strikethrough"),Sn&&(I.style.textDecoration="underline");let tn=Ne.getFgColor(),ht=Ne.getFgColorMode(),Vt=Ne.getBgColor(),zt=Ne.getBgColorMode();const $t=!!Ne.isInverse();if($t){const ft=tn;tn=Vt,Vt=ft;const Un=ht;ht=zt,zt=Un}let nn,Bi,Dn,ri=!1;switch(this._decorationService.forEachDecorationAtCell(Pe,M,void 0,(ft=>{ft.options.layer!=="top"&&ri||(ft.backgroundColorRGB&&(zt=50331648,Vt=ft.backgroundColorRGB.rgba>>8&16777215,nn=ft.backgroundColorRGB),ft.foregroundColorRGB&&(ht=50331648,tn=ft.foregroundColorRGB.rgba>>8&16777215,Bi=ft.foregroundColorRGB),ri=ft.options.layer==="top")})),!ri&&en&&(nn=this._coreBrowserService.isFocused?D.selectionBackgroundOpaque:D.selectionInactiveBackgroundOpaque,Vt=nn.rgba>>8&16777215,zt=50331648,ri=!0,D.selectionForeground&&(ht=50331648,tn=D.selectionForeground.rgba>>8&16777215,Bi=D.selectionForeground)),ri&&Se.push("xterm-decoration-top"),zt){case 16777216:case 33554432:Dn=D.ansi[Vt],Se.push(`xterm-bg-${Vt}`);break;case 50331648:Dn=x.channels.toColor(Vt>>16,Vt>>8&255,255&Vt),this._addStyle(I,`background-color:#${R((Vt>>>0).toString(16),"0",6)}`);break;default:$t?(Dn=D.foreground,Se.push(`xterm-bg-${g.INVERTED_DEFAULT_COLOR}`)):Dn=D.background}switch(nn||Ne.isDim()&&(nn=x.color.multiplyOpacity(Dn,.5)),ht){case 16777216:case 33554432:Ne.isBold()&&tn<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(tn+=8),this._applyMinimumContrast(I,Dn,D.ansi[tn],Ne,nn,void 0)||Se.push(`xterm-fg-${tn}`);break;case 50331648:const ft=x.channels.toColor(tn>>16&255,tn>>8&255,255&tn);this._applyMinimumContrast(I,Dn,ft,Ne,nn,Bi)||this._addStyle(I,`color:#${R(tn.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(I,Dn,D.foreground,Ne,nn,Bi)||$t&&Se.push(`xterm-fg-${g.INVERTED_DEFAULT_COLOR}`)}Se.length&&(I.className=Se.join(" "),Se.length=0),yn||Xe||mi?I.textContent=Z:P++,ge!==this.defaultSpacing&&(I.style.letterSpacing=`${ge}px`),V.push(I),Pe=xt}return I&&P&&(I.textContent=Z),V}_applyMinimumContrast(L,M,k,B,F,U){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,h.treatGlyphAsBackgroundColor)(B.getCode()))return!1;const W=this._getContrastCache(B);let j;if(F||U||(j=W.getColor(M.rgba,k.rgba)),j===void 0){const G=this._optionsService.rawOptions.minimumContrastRatio/(B.isDim()?2:1);j=x.color.ensureContrastRatio(F||M,U||k,G),W.setColor((F||M).rgba,(U||k).rgba,j??null)}return!!j&&(this._addStyle(L,`color:${j.css}`),!0)}_getContrastCache(L){return L.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(L,M){L.setAttribute("style",`${L.getAttribute("style")||""}${M};`)}_isCellInSelection(L,M){const k=this._selectionStart,B=this._selectionEnd;return!(!k||!B)&&(this._columnSelectMode?k[0]<=B[0]?L>=k[0]&&M>=k[1]&&L<B[0]&&M<=B[1]:L<k[0]&&M>=k[1]&&L>=B[0]&&M<=B[1]:M>k[1]&&M<B[1]||k[1]===B[1]&&M===k[1]&&L>=k[0]&&L<B[0]||k[1]<B[1]&&M===B[1]&&L<B[0]||k[1]<B[1]&&M===k[1]&&L>=k[0])}};function R(L,M,k){for(;L.length<k;)L=M+L;return L}c.DomRendererRowFactory=T=d([S(1,p.ICharacterJoinerService),S(2,A.IOptionsService),S(3,p.ICoreBrowserService),S(4,A.ICoreService),S(5,A.IDecorationService),S(6,p.IThemeService)],T)},2550:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WidthCache=void 0,c.WidthCache=class{constructor(u,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.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 S=u.createElement("span");S.classList.add("xterm-char-measure-element");const g=u.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontWeight="bold";const C=u.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontStyle="italic";const E=u.createElement("span");E.classList.add("xterm-char-measure-element"),E.style.fontWeight="bold",E.style.fontStyle="italic",this._measureElements=[S,g,C,E],this._container.appendChild(S),this._container.appendChild(g),this._container.appendChild(C),this._container.appendChild(E),d.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(u,d,S,g){u===this._font&&d===this._fontSize&&S===this._weight&&g===this._weightBold||(this._font=u,this._fontSize=d,this._weight=S,this._weightBold=g,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${S}`,this._measureElements[1].style.fontWeight=`${g}`,this._measureElements[2].style.fontWeight=`${S}`,this._measureElements[3].style.fontWeight=`${g}`,this.clear())}get(u,d,S){let g=0;if(!d&&!S&&u.length===1&&(g=u.charCodeAt(0))<256){if(this._flat[g]!==-9999)return this._flat[g];const A=this._measure(u,0);return A>0&&(this._flat[g]=A),A}let C=u;d&&(C+="B"),S&&(C+="I");let E=this._holey.get(C);if(E===void 0){let A=0;d&&(A|=1),S&&(A|=2),E=this._measure(u,A),E>0&&this._holey.set(C,E)}return E}_measure(u,d){const S=this._measureElements[d];return S.textContent=u.repeat(32),S.offsetWidth/32}}},2223:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TEXT_BASELINE=c.DIM_OPACITY=c.INVERTED_DEFAULT_COLOR=void 0;const d=u(6114);c.INVERTED_DEFAULT_COLOR=257,c.DIM_OPACITY=.5,c.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(_,c)=>{function u(S){return 57508<=S&&S<=57558}function d(S){return S>=128512&&S<=128591||S>=127744&&S<=128511||S>=128640&&S<=128767||S>=9728&&S<=9983||S>=9984&&S<=10175||S>=65024&&S<=65039||S>=129280&&S<=129535||S>=127462&&S<=127487}Object.defineProperty(c,"__esModule",{value:!0}),c.computeNextVariantOffset=c.createRenderDimensions=c.treatGlyphAsBackgroundColor=c.allowRescaling=c.isEmoji=c.isRestrictedPowerlineGlyph=c.isPowerlineGlyph=c.throwIfFalsy=void 0,c.throwIfFalsy=function(S){if(!S)throw new Error("value must not be falsy");return S},c.isPowerlineGlyph=u,c.isRestrictedPowerlineGlyph=function(S){return 57520<=S&&S<=57527},c.isEmoji=d,c.allowRescaling=function(S,g,C,E){return g===1&&C>Math.ceil(1.5*E)&&S!==void 0&&S>255&&!d(S)&&!u(S)&&!(function(A){return 57344<=A&&A<=63743})(S)},c.treatGlyphAsBackgroundColor=function(S){return u(S)||(function(g){return 9472<=g&&g<=9631})(S)},c.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}}}},c.computeNextVariantOffset=function(S,g,C=0){return(S-(2*Math.round(g)-C))%(2*Math.round(g))}},6052:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createSelectionRenderModel=void 0;class u{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(S,g,C,E=!1){if(this.selectionStart=g,this.selectionEnd=C,!g||!C||g[0]===C[0]&&g[1]===C[1])return void this.clear();const A=S.buffers.active.ydisp,x=g[1]-A,p=C[1]-A,v=Math.max(x,0),h=Math.min(p,S.rows-1);v>=S.rows||h<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=E,this.viewportStartRow=x,this.viewportEndRow=p,this.viewportCappedStartRow=v,this.viewportCappedEndRow=h,this.startCol=g[0],this.endCol=C[0])}isCellSelected(S,g,C){return!!this.hasSelection&&(C-=S.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?g>=this.startCol&&C>=this.viewportCappedStartRow&&g<this.endCol&&C<=this.viewportCappedEndRow:g<this.startCol&&C>=this.viewportCappedStartRow&&g>=this.endCol&&C<=this.viewportCappedEndRow:C>this.viewportStartRow&&C<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&C===this.viewportStartRow&&g>=this.startCol&&g<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportEndRow&&g<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportStartRow&&g>=this.startCol)}}c.createSelectionRenderModel=function(){return new u}},456:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionModel=void 0,c.SelectionModel=class{constructor(u){this._bufferService=u,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 u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,d=this.selectionEnd;return!(!u||!d)&&(u[1]>d[1]||u[1]===d[1]&&u[0]>d[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(_,c,u){var d=this&&this.__decorate||function(h,b,T,R){var L,M=arguments.length,k=M<3?b:R===null?R=Object.getOwnPropertyDescriptor(b,T):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(h,b,T,R);else for(var B=h.length-1;B>=0;B--)(L=h[B])&&(k=(M<3?L(k):M>3?L(b,T,k):L(b,T))||k);return M>3&&k&&Object.defineProperty(b,T,k),k},S=this&&this.__param||function(h,b){return function(T,R){b(T,R,h)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharSizeService=void 0;const g=u(2585),C=u(8460),E=u(844);let A=c.CharSizeService=class extends E.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(h,b,T){super(),this._optionsService=T,this.width=0,this.height=0,this._onCharSizeChange=this.register(new C.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new v(this._optionsService))}catch{this._measureStrategy=this.register(new p(h,b,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const h=this._measureStrategy.measure();h.width===this.width&&h.height===this.height||(this.width=h.width,this.height=h.height,this._onCharSizeChange.fire())}};c.CharSizeService=A=d([S(2,g.IOptionsService)],A);class x extends E.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(b,T){b!==void 0&&b>0&&T!==void 0&&T>0&&(this._result.width=b,this._result.height=T)}}class p extends x{constructor(b,T,R){super(),this._document=b,this._parentElement=T,this._optionsService=R,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 v extends x{constructor(b){super(),this._optionsService=b,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 b=this._ctx.measureText("W");return this._validateAndSet(b.width,b.fontBoundingBoxAscent+b.fontBoundingBoxDescent),this._result}}},4269:function(_,c,u){var d=this&&this.__decorate||function(v,h,b,T){var R,L=arguments.length,M=L<3?h:T===null?T=Object.getOwnPropertyDescriptor(h,b):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,h,b,T);else for(var k=v.length-1;k>=0;k--)(R=v[k])&&(M=(L<3?R(M):L>3?R(h,b,M):R(h,b))||M);return L>3&&M&&Object.defineProperty(h,b,M),M},S=this&&this.__param||function(v,h){return function(b,T){h(b,T,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharacterJoinerService=c.JoinedCellData=void 0;const g=u(3734),C=u(643),E=u(511),A=u(2585);class x extends g.AttributeData{constructor(h,b,T){super(),this.content=0,this.combinedData="",this.fg=h.fg,this.bg=h.bg,this.combinedData=b,this._width=T}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(h){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.JoinedCellData=x;let p=c.CharacterJoinerService=class Cx{constructor(h){this._bufferService=h,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new E.CellData}register(h){const b={id:this._nextCharacterJoinerId++,handler:h};return this._characterJoiners.push(b),b.id}deregister(h){for(let b=0;b<this._characterJoiners.length;b++)if(this._characterJoiners[b].id===h)return this._characterJoiners.splice(b,1),!0;return!1}getJoinedCharacters(h){if(this._characterJoiners.length===0)return[];const b=this._bufferService.buffer.lines.get(h);if(!b||b.length===0)return[];const T=[],R=b.translateToString(!0);let L=0,M=0,k=0,B=b.getFg(0),F=b.getBg(0);for(let U=0;U<b.getTrimmedLength();U++)if(b.loadCell(U,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==B||this._workCell.bg!==F){if(U-L>1){const W=this._getJoinedRanges(R,k,M,b,L);for(let j=0;j<W.length;j++)T.push(W[j])}L=U,k=M,B=this._workCell.fg,F=this._workCell.bg}M+=this._workCell.getChars().length||C.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-L>1){const U=this._getJoinedRanges(R,k,M,b,L);for(let W=0;W<U.length;W++)T.push(U[W])}return T}_getJoinedRanges(h,b,T,R,L){const M=h.substring(b,T);let k=[];try{k=this._characterJoiners[0].handler(M)}catch(B){console.error(B)}for(let B=1;B<this._characterJoiners.length;B++)try{const F=this._characterJoiners[B].handler(M);for(let U=0;U<F.length;U++)Cx._mergeRanges(k,F[U])}catch(F){console.error(F)}return this._stringRangesToCellRanges(k,R,L),k}_stringRangesToCellRanges(h,b,T){let R=0,L=!1,M=0,k=h[R];if(k){for(let B=T;B<this._bufferService.cols;B++){const F=b.getWidth(B),U=b.getString(B).length||C.WHITESPACE_CELL_CHAR.length;if(F!==0){if(!L&&k[0]<=M&&(k[0]=B,L=!0),k[1]<=M){if(k[1]=B,k=h[++R],!k)break;k[0]<=M?(k[0]=B,L=!0):L=!1}M+=U}}k&&(k[1]=this._bufferService.cols)}}static _mergeRanges(h,b){let T=!1;for(let R=0;R<h.length;R++){const L=h[R];if(T){if(b[1]<=L[0])return h[R-1][1]=b[1],h;if(b[1]<=L[1])return h[R-1][1]=Math.max(b[1],L[1]),h.splice(R,1),h;h.splice(R,1),R--}else{if(b[1]<=L[0])return h.splice(R,0,b),h;if(b[1]<=L[1])return L[0]=Math.min(b[0],L[0]),h;b[0]<L[1]&&(L[0]=Math.min(b[0],L[0]),T=!0)}}return T?h[h.length-1][1]=b[1]:h.push(b),h}};c.CharacterJoinerService=p=d([S(0,A.IBufferService)],p)},5114:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreBrowserService=void 0;const d=u(844),S=u(8460),g=u(3656);class C extends d.Disposable{constructor(x,p,v){super(),this._textarea=x,this._window=p,this.mainDocument=v,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new E(this._window),this._onDprChange=this.register(new S.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new S.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((h=>this._screenDprMonitor.setWindow(h)))),this.register((0,S.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(x){this._window!==x&&(this._window=x,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}}c.CoreBrowserService=C;class E extends d.Disposable{constructor(x){super(),this._parentWindow=x,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new S.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,d.toDisposable)((()=>this.clearListener())))}setWindow(x){this._parentWindow=x,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,g.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.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:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.LinkProviderService=void 0;const d=u(844);class S extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(C){return this.linkProviders.push(C),{dispose:()=>{const E=this.linkProviders.indexOf(C);E!==-1&&this.linkProviders.splice(E,1)}}}}c.LinkProviderService=S},8934:function(_,c,u){var d=this&&this.__decorate||function(A,x,p,v){var h,b=arguments.length,T=b<3?x:v===null?v=Object.getOwnPropertyDescriptor(x,p):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(A,x,p,v);else for(var R=A.length-1;R>=0;R--)(h=A[R])&&(T=(b<3?h(T):b>3?h(x,p,T):h(x,p))||T);return b>3&&T&&Object.defineProperty(x,p,T),T},S=this&&this.__param||function(A,x){return function(p,v){x(p,v,A)}};Object.defineProperty(c,"__esModule",{value:!0}),c.MouseService=void 0;const g=u(4725),C=u(9806);let E=c.MouseService=class{constructor(A,x){this._renderService=A,this._charSizeService=x}getCoords(A,x,p,v,h){return(0,C.getCoords)(window,A,x,p,v,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,h)}getMouseReportCoords(A,x){const p=(0,C.getCoordsRelativeToElement)(window,A,x);if(this._charSizeService.hasValidSize)return p[0]=Math.min(Math.max(p[0],0),this._renderService.dimensions.css.canvas.width-1),p[1]=Math.min(Math.max(p[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(p[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(p[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(p[0]),y:Math.floor(p[1])}}};c.MouseService=E=d([S(0,g.IRenderService),S(1,g.ICharSizeService)],E)},3230:function(_,c,u){var d=this&&this.__decorate||function(h,b,T,R){var L,M=arguments.length,k=M<3?b:R===null?R=Object.getOwnPropertyDescriptor(b,T):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(h,b,T,R);else for(var B=h.length-1;B>=0;B--)(L=h[B])&&(k=(M<3?L(k):M>3?L(b,T,k):L(b,T))||k);return M>3&&k&&Object.defineProperty(b,T,k),k},S=this&&this.__param||function(h,b){return function(T,R){b(T,R,h)}};Object.defineProperty(c,"__esModule",{value:!0}),c.RenderService=void 0;const g=u(6193),C=u(4725),E=u(8460),A=u(844),x=u(7226),p=u(2585);let v=c.RenderService=class extends A.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(h,b,T,R,L,M,k,B){super(),this._rowCount=h,this._charSizeService=R,this._renderer=this.register(new A.MutableDisposable),this._pausedResizeTask=new x.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 E.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new E.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new E.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new E.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new g.RenderDebouncer(((F,U)=>this._renderRows(F,U)),k),this.register(this._renderDebouncer),this.register(k.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(M.onResize((()=>this._fullRefresh()))),this.register(M.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(T.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(L.onDecorationRegistered((()=>this._fullRefresh()))),this.register(L.onDecorationRemoved((()=>this._fullRefresh()))),this.register(T.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(M.cols,M.rows),this._fullRefresh()}))),this.register(T.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(M.buffer.y,M.buffer.y,!0)))),this.register(B.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(k.window,b),this.register(k.onWindowChange((F=>this._registerIntersectionObserver(F,b))))}_registerIntersectionObserver(h,b){if("IntersectionObserver"in h){const T=new h.IntersectionObserver((R=>this._handleIntersectionChange(R[R.length-1])),{threshold:0});T.observe(b),this._observerDisposable.value=(0,A.toDisposable)((()=>T.disconnect()))}}_handleIntersectionChange(h){this._isPaused=h.isIntersecting===void 0?h.intersectionRatio===0:!h.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(h,b,T=!1){this._isPaused?this._needsFullRefresh=!0:(T||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(h,b,this._rowCount))}_renderRows(h,b){this._renderer.value&&(h=Math.min(h,this._rowCount-1),b=Math.min(b,this._rowCount-1),this._renderer.value.renderRows(h,b),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:h,end:b}),this._onRender.fire({start:h,end:b}),this._isNextRenderRedrawOnly=!0)}resize(h,b){this._rowCount=b,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(h){this._renderer.value=h,this._renderer.value&&(this._renderer.value.onRequestRedraw((b=>this.refreshRows(b.start,b.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(h){return this._renderDebouncer.addRefreshCallback(h)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(h,b){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(h,b))):this._renderer.value.handleResize(h,b),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(h,b,T){this._selectionState.start=h,this._selectionState.end=b,this._selectionState.columnSelectMode=T,this._renderer.value?.handleSelectionChanged(h,b,T)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};c.RenderService=v=d([S(2,p.IOptionsService),S(3,C.ICharSizeService),S(4,p.IDecorationService),S(5,p.IBufferService),S(6,C.ICoreBrowserService),S(7,C.IThemeService)],v)},9312:function(_,c,u){var d=this&&this.__decorate||function(k,B,F,U){var W,j=arguments.length,G=j<3?B:U===null?U=Object.getOwnPropertyDescriptor(B,F):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(k,B,F,U);else for(var ee=k.length-1;ee>=0;ee--)(W=k[ee])&&(G=(j<3?W(G):j>3?W(B,F,G):W(B,F))||G);return j>3&&G&&Object.defineProperty(B,F,G),G},S=this&&this.__param||function(k,B){return function(F,U){B(F,U,k)}};Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionService=void 0;const g=u(9806),C=u(9504),E=u(456),A=u(4725),x=u(8460),p=u(844),v=u(6114),h=u(4841),b=u(511),T=u(2585),R=" ",L=new RegExp(R,"g");let M=c.SelectionService=class extends p.Disposable{constructor(k,B,F,U,W,j,G,ee,q){super(),this._element=k,this._screenElement=B,this._linkifier=F,this._bufferService=U,this._coreService=W,this._mouseService=j,this._optionsService=G,this._renderService=ee,this._coreBrowserService=q,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new b.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new x.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new x.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new x.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=V=>this._handleMouseMove(V),this._mouseUpListener=V=>this._handleMouseUp(V),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((V=>this._handleTrim(V))),this.register(this._bufferService.buffers.onBufferActivate((V=>this._handleBufferActivate(V)))),this.enable(),this._model=new E.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,p.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 k=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!k||!B||k[0]===B[0]&&k[1]===B[1])}get selectionText(){const k=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;if(!k||!B)return"";const F=this._bufferService.buffer,U=[];if(this._activeSelectionMode===3){if(k[0]===B[0])return"";const W=k[0]<B[0]?k[0]:B[0],j=k[0]<B[0]?B[0]:k[0];for(let G=k[1];G<=B[1];G++){const ee=F.translateBufferLineToString(G,!0,W,j);U.push(ee)}}else{const W=k[1]===B[1]?B[0]:void 0;U.push(F.translateBufferLineToString(k[1],!0,k[0],W));for(let j=k[1]+1;j<=B[1]-1;j++){const G=F.lines.get(j),ee=F.translateBufferLineToString(j,!0);G?.isWrapped?U[U.length-1]+=ee:U.push(ee)}if(k[1]!==B[1]){const j=F.lines.get(B[1]),G=F.translateBufferLineToString(B[1],!0,0,B[0]);j&&j.isWrapped?U[U.length-1]+=G:U.push(G)}}return U.map((W=>W.replace(L," "))).join(v.isWindows?`\r
773
+ `:`
774
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(k){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),v.isLinux&&k&&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(k){const B=this._getMouseBufferCoords(k),F=this._model.finalSelectionStart,U=this._model.finalSelectionEnd;return!!(F&&U&&B)&&this._areCoordsInSelection(B,F,U)}isCellInSelection(k,B){const F=this._model.finalSelectionStart,U=this._model.finalSelectionEnd;return!(!F||!U)&&this._areCoordsInSelection([k,B],F,U)}_areCoordsInSelection(k,B,F){return k[1]>B[1]&&k[1]<F[1]||B[1]===F[1]&&k[1]===B[1]&&k[0]>=B[0]&&k[0]<F[0]||B[1]<F[1]&&k[1]===F[1]&&k[0]<F[0]||B[1]<F[1]&&k[1]===B[1]&&k[0]>=B[0]}_selectWordAtCursor(k,B){const F=this._linkifier.currentLink?.link?.range;if(F)return this._model.selectionStart=[F.start.x-1,F.start.y-1],this._model.selectionStartLength=(0,h.getRangeLength)(F,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const U=this._getMouseBufferCoords(k);return!!U&&(this._selectWordAt(U,B),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(k,B){this._model.clearSelection(),k=Math.max(k,0),B=Math.min(B,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,k],this._model.selectionEnd=[this._bufferService.cols,B],this.refresh(),this._onSelectionChange.fire()}_handleTrim(k){this._model.handleTrim(k)&&this.refresh()}_getMouseBufferCoords(k){const B=this._mouseService.getCoords(k,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(B)return B[0]--,B[1]--,B[1]+=this._bufferService.buffer.ydisp,B}_getMouseEventScrollAmount(k){let B=(0,g.getCoordsRelativeToElement)(this._coreBrowserService.window,k,this._screenElement)[1];const F=this._renderService.dimensions.css.canvas.height;return B>=0&&B<=F?0:(B>F&&(B-=F),B=Math.min(Math.max(B,-50),50),B/=50,B/Math.abs(B)+Math.round(14*B))}shouldForceSelection(k){return v.isMac?k.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:k.shiftKey}handleMouseDown(k){if(this._mouseDownTimeStamp=k.timeStamp,(k.button!==2||!this.hasSelection)&&k.button===0){if(!this._enabled){if(!this.shouldForceSelection(k))return;k.stopPropagation()}k.preventDefault(),this._dragScrollAmount=0,this._enabled&&k.shiftKey?this._handleIncrementalClick(k):k.detail===1?this._handleSingleClick(k):k.detail===2?this._handleDoubleClick(k):k.detail===3&&this._handleTripleClick(k),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(k){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(k))}_handleSingleClick(k){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(k)?3:0,this._model.selectionStart=this._getMouseBufferCoords(k),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const B=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);B&&B.length!==this._model.selectionStart[0]&&B.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(k){this._selectWordAtCursor(k,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(k){const B=this._getMouseBufferCoords(k);B&&(this._activeSelectionMode=2,this._selectLineAt(B[1]))}shouldColumnSelect(k){return k.altKey&&!(v.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(k){if(k.stopImmediatePropagation(),!this._model.selectionStart)return;const B=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(k),!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(k),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const F=this._bufferService.buffer;if(this._model.selectionEnd[1]<F.lines.length){const U=F.lines.get(this._model.selectionEnd[1]);U&&U.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}B&&B[0]===this._model.selectionEnd[0]&&B[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 k=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(k.ydisp+this._bufferService.rows,k.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=k.ydisp),this.refresh()}}_handleMouseUp(k){const B=k.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&B<500&&k.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const F=this._mouseService.getCoords(k,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(F&&F[0]!==void 0&&F[1]!==void 0){const U=(0,C.moveToCellSequence)(F[0]-1,F[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(U,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const k=this._model.finalSelectionStart,B=this._model.finalSelectionEnd,F=!(!k||!B||k[0]===B[0]&&k[1]===B[1]);F?k&&B&&(this._oldSelectionStart&&this._oldSelectionEnd&&k[0]===this._oldSelectionStart[0]&&k[1]===this._oldSelectionStart[1]&&B[0]===this._oldSelectionEnd[0]&&B[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(k,B,F)):this._oldHasSelection&&this._fireOnSelectionChange(k,B,F)}_fireOnSelectionChange(k,B,F){this._oldSelectionStart=k,this._oldSelectionEnd=B,this._oldHasSelection=F,this._onSelectionChange.fire()}_handleBufferActivate(k){this.clearSelection(),this._trimListener.dispose(),this._trimListener=k.activeBuffer.lines.onTrim((B=>this._handleTrim(B)))}_convertViewportColToCharacterIndex(k,B){let F=B;for(let U=0;B>=U;U++){const W=k.loadCell(U,this._workCell).getChars().length;this._workCell.getWidth()===0?F--:W>1&&B!==U&&(F+=W-1)}return F}setSelection(k,B,F){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[k,B],this._model.selectionStartLength=F,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(k){this._isClickInSelection(k)||(this._selectWordAtCursor(k,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(k,B,F=!0,U=!0){if(k[0]>=this._bufferService.cols)return;const W=this._bufferService.buffer,j=W.lines.get(k[1]);if(!j)return;const G=W.translateBufferLineToString(k[1],!1);let ee=this._convertViewportColToCharacterIndex(j,k[0]),q=ee;const V=k[0]-ee;let Y=0,D=0,I=0,N=0;if(G.charAt(ee)===" "){for(;ee>0&&G.charAt(ee-1)===" ";)ee--;for(;q<G.length&&G.charAt(q+1)===" ";)q++}else{let ae=k[0],ce=k[0];j.getWidth(ae)===0&&(Y++,ae--),j.getWidth(ce)===2&&(D++,ce++);const _e=j.getString(ce).length;for(_e>1&&(N+=_e-1,q+=_e-1);ae>0&&ee>0&&!this._isCharWordSeparator(j.loadCell(ae-1,this._workCell));){j.loadCell(ae-1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===0?(Y++,ae--):Q>1&&(I+=Q-1,ee-=Q-1),ee--,ae--}for(;ce<j.length&&q+1<G.length&&!this._isCharWordSeparator(j.loadCell(ce+1,this._workCell));){j.loadCell(ce+1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===2?(D++,ce++):Q>1&&(N+=Q-1,q+=Q-1),q++,ce++}}q++;let P=ee+V-Y+I,Z=Math.min(this._bufferService.cols,q-ee+Y+D-I-N);if(B||G.slice(ee,q).trim()!==""){if(F&&P===0&&j.getCodePoint(0)!==32){const ae=W.lines.get(k[1]-1);if(ae&&j.isWrapped&&ae.getCodePoint(this._bufferService.cols-1)!==32){const ce=this._getWordAt([this._bufferService.cols-1,k[1]-1],!1,!0,!1);if(ce){const _e=this._bufferService.cols-ce.start;P-=_e,Z+=_e}}}if(U&&P+Z===this._bufferService.cols&&j.getCodePoint(this._bufferService.cols-1)!==32){const ae=W.lines.get(k[1]+1);if(ae?.isWrapped&&ae.getCodePoint(0)!==32){const ce=this._getWordAt([0,k[1]+1],!1,!1,!0);ce&&(Z+=ce.length)}}return{start:P,length:Z}}}_selectWordAt(k,B){const F=this._getWordAt(k,B);if(F){for(;F.start<0;)F.start+=this._bufferService.cols,k[1]--;this._model.selectionStart=[F.start,k[1]],this._model.selectionStartLength=F.length}}_selectToWordAt(k){const B=this._getWordAt(k,!0);if(B){let F=k[1];for(;B.start<0;)B.start+=this._bufferService.cols,F--;if(!this._model.areSelectionValuesReversed())for(;B.start+B.length>this._bufferService.cols;)B.length-=this._bufferService.cols,F++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?B.start:B.start+B.length,F]}}_isCharWordSeparator(k){return k.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(k.getChars())>=0}_selectLineAt(k){const B=this._bufferService.buffer.getWrappedRangeForLine(k),F={start:{x:0,y:B.first},end:{x:this._bufferService.cols-1,y:B.last}};this._model.selectionStart=[0,B.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,h.getRangeLength)(F,this._bufferService.cols)}};c.SelectionService=M=d([S(3,T.IBufferService),S(4,T.ICoreService),S(5,A.IMouseService),S(6,T.IOptionsService),S(7,A.IRenderService),S(8,A.ICoreBrowserService)],M)},4725:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ILinkProviderService=c.IThemeService=c.ICharacterJoinerService=c.ISelectionService=c.IRenderService=c.IMouseService=c.ICoreBrowserService=c.ICharSizeService=void 0;const d=u(8343);c.ICharSizeService=(0,d.createDecorator)("CharSizeService"),c.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),c.IMouseService=(0,d.createDecorator)("MouseService"),c.IRenderService=(0,d.createDecorator)("RenderService"),c.ISelectionService=(0,d.createDecorator)("SelectionService"),c.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),c.IThemeService=(0,d.createDecorator)("ThemeService"),c.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(_,c,u){var d=this&&this.__decorate||function(M,k,B,F){var U,W=arguments.length,j=W<3?k:F===null?F=Object.getOwnPropertyDescriptor(k,B):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(M,k,B,F);else for(var G=M.length-1;G>=0;G--)(U=M[G])&&(j=(W<3?U(j):W>3?U(k,B,j):U(k,B))||j);return W>3&&j&&Object.defineProperty(k,B,j),j},S=this&&this.__param||function(M,k){return function(B,F){k(B,F,M)}};Object.defineProperty(c,"__esModule",{value:!0}),c.ThemeService=c.DEFAULT_ANSI_COLORS=void 0;const g=u(7239),C=u(8055),E=u(8460),A=u(844),x=u(2585),p=C.css.toColor("#ffffff"),v=C.css.toColor("#000000"),h=C.css.toColor("#ffffff"),b=C.css.toColor("#000000"),T={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};c.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[C.css.toColor("#2e3436"),C.css.toColor("#cc0000"),C.css.toColor("#4e9a06"),C.css.toColor("#c4a000"),C.css.toColor("#3465a4"),C.css.toColor("#75507b"),C.css.toColor("#06989a"),C.css.toColor("#d3d7cf"),C.css.toColor("#555753"),C.css.toColor("#ef2929"),C.css.toColor("#8ae234"),C.css.toColor("#fce94f"),C.css.toColor("#729fcf"),C.css.toColor("#ad7fa8"),C.css.toColor("#34e2e2"),C.css.toColor("#eeeeec")],k=[0,95,135,175,215,255];for(let B=0;B<216;B++){const F=k[B/36%6|0],U=k[B/6%6|0],W=k[B%6];M.push({css:C.channels.toCss(F,U,W),rgba:C.channels.toRgba(F,U,W)})}for(let B=0;B<24;B++){const F=8+10*B;M.push({css:C.channels.toCss(F,F,F),rgba:C.channels.toRgba(F,F,F)})}return M})());let R=c.ThemeService=class extends A.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,this._contrastCache=new g.ColorContrastCache,this._halfContrastCache=new g.ColorContrastCache,this._onChangeColors=this.register(new E.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:p,background:v,cursor:h,cursorAccent:b,selectionForeground:void 0,selectionBackgroundTransparent:T,selectionBackgroundOpaque:C.color.blend(v,T),selectionInactiveBackgroundTransparent:T,selectionInactiveBackgroundOpaque:C.color.blend(v,T),ansi:c.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(M={}){const k=this._colors;if(k.foreground=L(M.foreground,p),k.background=L(M.background,v),k.cursor=L(M.cursor,h),k.cursorAccent=L(M.cursorAccent,b),k.selectionBackgroundTransparent=L(M.selectionBackground,T),k.selectionBackgroundOpaque=C.color.blend(k.background,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundTransparent=L(M.selectionInactiveBackground,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundOpaque=C.color.blend(k.background,k.selectionInactiveBackgroundTransparent),k.selectionForeground=M.selectionForeground?L(M.selectionForeground,C.NULL_COLOR):void 0,k.selectionForeground===C.NULL_COLOR&&(k.selectionForeground=void 0),C.color.isOpaque(k.selectionBackgroundTransparent)&&(k.selectionBackgroundTransparent=C.color.opacity(k.selectionBackgroundTransparent,.3)),C.color.isOpaque(k.selectionInactiveBackgroundTransparent)&&(k.selectionInactiveBackgroundTransparent=C.color.opacity(k.selectionInactiveBackgroundTransparent,.3)),k.ansi=c.DEFAULT_ANSI_COLORS.slice(),k.ansi[0]=L(M.black,c.DEFAULT_ANSI_COLORS[0]),k.ansi[1]=L(M.red,c.DEFAULT_ANSI_COLORS[1]),k.ansi[2]=L(M.green,c.DEFAULT_ANSI_COLORS[2]),k.ansi[3]=L(M.yellow,c.DEFAULT_ANSI_COLORS[3]),k.ansi[4]=L(M.blue,c.DEFAULT_ANSI_COLORS[4]),k.ansi[5]=L(M.magenta,c.DEFAULT_ANSI_COLORS[5]),k.ansi[6]=L(M.cyan,c.DEFAULT_ANSI_COLORS[6]),k.ansi[7]=L(M.white,c.DEFAULT_ANSI_COLORS[7]),k.ansi[8]=L(M.brightBlack,c.DEFAULT_ANSI_COLORS[8]),k.ansi[9]=L(M.brightRed,c.DEFAULT_ANSI_COLORS[9]),k.ansi[10]=L(M.brightGreen,c.DEFAULT_ANSI_COLORS[10]),k.ansi[11]=L(M.brightYellow,c.DEFAULT_ANSI_COLORS[11]),k.ansi[12]=L(M.brightBlue,c.DEFAULT_ANSI_COLORS[12]),k.ansi[13]=L(M.brightMagenta,c.DEFAULT_ANSI_COLORS[13]),k.ansi[14]=L(M.brightCyan,c.DEFAULT_ANSI_COLORS[14]),k.ansi[15]=L(M.brightWhite,c.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const B=Math.min(k.ansi.length-16,M.extendedAnsi.length);for(let F=0;F<B;F++)k.ansi[F+16]=L(M.extendedAnsi[F],c.DEFAULT_ANSI_COLORS[F+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(M){this._restoreColor(M),this._onChangeColors.fire(this.colors)}_restoreColor(M){if(M!==void 0)switch(M){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[M]=this._restoreColors.ansi[M]}else for(let k=0;k<this._restoreColors.ansi.length;++k)this._colors.ansi[k]=this._restoreColors.ansi[k]}modifyColors(M){M(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 L(M,k){if(M!==void 0)try{return C.css.toColor(M)}catch{}return k}c.ThemeService=R=d([S(0,x.IOptionsService)],R)},6349:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CircularList=void 0;const d=u(8460),S=u(844);class g extends S.Disposable{constructor(E){super(),this._maxLength=E,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.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(E){if(this._maxLength===E)return;const A=new Array(E);for(let x=0;x<Math.min(E,this.length);x++)A[x]=this._array[this._getCyclicIndex(x)];this._array=A,this._maxLength=E,this._startIndex=0}get length(){return this._length}set length(E){if(E>this._length)for(let A=this._length;A<E;A++)this._array[A]=void 0;this._length=E}get(E){return this._array[this._getCyclicIndex(E)]}set(E,A){this._array[this._getCyclicIndex(E)]=A}push(E){this._array[this._getCyclicIndex(this._length)]=E,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(E,A,...x){if(A){for(let p=E;p<this._length-A;p++)this._array[this._getCyclicIndex(p)]=this._array[this._getCyclicIndex(p+A)];this._length-=A,this.onDeleteEmitter.fire({index:E,amount:A})}for(let p=this._length-1;p>=E;p--)this._array[this._getCyclicIndex(p+x.length)]=this._array[this._getCyclicIndex(p)];for(let p=0;p<x.length;p++)this._array[this._getCyclicIndex(E+p)]=x[p];if(x.length&&this.onInsertEmitter.fire({index:E,amount:x.length}),this._length+x.length>this._maxLength){const p=this._length+x.length-this._maxLength;this._startIndex+=p,this._length=this._maxLength,this.onTrimEmitter.fire(p)}else this._length+=x.length}trimStart(E){E>this._length&&(E=this._length),this._startIndex+=E,this._length-=E,this.onTrimEmitter.fire(E)}shiftElements(E,A,x){if(!(A<=0)){if(E<0||E>=this._length)throw new Error("start argument out of range");if(E+x<0)throw new Error("Cannot shift elements in list beyond index 0");if(x>0){for(let v=A-1;v>=0;v--)this.set(E+v+x,this.get(E+v));const p=E+A+x-this._length;if(p>0)for(this._length+=p;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let p=0;p<A;p++)this.set(E+p+x,this.get(E+p))}}_getCyclicIndex(E){return(this._startIndex+E)%this._maxLength}}c.CircularList=g},1439:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.clone=void 0,c.clone=function u(d,S=5){if(typeof d!="object")return d;const g=Array.isArray(d)?[]:{};for(const C in d)g[C]=S<=1?d[C]:d[C]&&u(d[C],S-1);return g}},8055:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.contrastRatio=c.toPaddedHex=c.rgba=c.rgb=c.css=c.color=c.channels=c.NULL_COLOR=void 0;let u=0,d=0,S=0,g=0;var C,E,A,x,p;function v(b){const T=b.toString(16);return T.length<2?"0"+T:T}function h(b,T){return b<T?(T+.05)/(b+.05):(b+.05)/(T+.05)}c.NULL_COLOR={css:"#00000000",rgba:0},(function(b){b.toCss=function(T,R,L,M){return M!==void 0?`#${v(T)}${v(R)}${v(L)}${v(M)}`:`#${v(T)}${v(R)}${v(L)}`},b.toRgba=function(T,R,L,M=255){return(T<<24|R<<16|L<<8|M)>>>0},b.toColor=function(T,R,L,M){return{css:b.toCss(T,R,L,M),rgba:b.toRgba(T,R,L,M)}}})(C||(c.channels=C={})),(function(b){function T(R,L){return g=Math.round(255*L),[u,d,S]=p.toChannels(R.rgba),{css:C.toCss(u,d,S,g),rgba:C.toRgba(u,d,S,g)}}b.blend=function(R,L){if(g=(255&L.rgba)/255,g===1)return{css:L.css,rgba:L.rgba};const M=L.rgba>>24&255,k=L.rgba>>16&255,B=L.rgba>>8&255,F=R.rgba>>24&255,U=R.rgba>>16&255,W=R.rgba>>8&255;return u=F+Math.round((M-F)*g),d=U+Math.round((k-U)*g),S=W+Math.round((B-W)*g),{css:C.toCss(u,d,S),rgba:C.toRgba(u,d,S)}},b.isOpaque=function(R){return(255&R.rgba)==255},b.ensureContrastRatio=function(R,L,M){const k=p.ensureContrastRatio(R.rgba,L.rgba,M);if(k)return C.toColor(k>>24&255,k>>16&255,k>>8&255)},b.opaque=function(R){const L=(255|R.rgba)>>>0;return[u,d,S]=p.toChannels(L),{css:C.toCss(u,d,S),rgba:L}},b.opacity=T,b.multiplyOpacity=function(R,L){return g=255&R.rgba,T(R,g*L/255)},b.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}})(E||(c.color=E={})),(function(b){let T,R;try{const L=document.createElement("canvas");L.width=1,L.height=1;const M=L.getContext("2d",{willReadFrequently:!0});M&&(T=M,T.globalCompositeOperation="copy",R=T.createLinearGradient(0,0,1,1))}catch{}b.toColor=function(L){if(L.match(/#[\da-f]{3,8}/i))switch(L.length){case 4:return u=parseInt(L.slice(1,2).repeat(2),16),d=parseInt(L.slice(2,3).repeat(2),16),S=parseInt(L.slice(3,4).repeat(2),16),C.toColor(u,d,S);case 5:return u=parseInt(L.slice(1,2).repeat(2),16),d=parseInt(L.slice(2,3).repeat(2),16),S=parseInt(L.slice(3,4).repeat(2),16),g=parseInt(L.slice(4,5).repeat(2),16),C.toColor(u,d,S,g);case 7:return{css:L,rgba:(parseInt(L.slice(1),16)<<8|255)>>>0};case 9:return{css:L,rgba:parseInt(L.slice(1),16)>>>0}}const M=L.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(M)return u=parseInt(M[1]),d=parseInt(M[2]),S=parseInt(M[3]),g=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),C.toColor(u,d,S,g);if(!T||!R)throw new Error("css.toColor: Unsupported css format");if(T.fillStyle=R,T.fillStyle=L,typeof T.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(T.fillRect(0,0,1,1),[u,d,S,g]=T.getImageData(0,0,1,1).data,g!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:C.toRgba(u,d,S,g),css:L}}})(A||(c.css=A={})),(function(b){function T(R,L,M){const k=R/255,B=L/255,F=M/255;return .2126*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.7152*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))+.0722*(F<=.03928?F/12.92:Math.pow((F+.055)/1.055,2.4))}b.relativeLuminance=function(R){return T(R>>16&255,R>>8&255,255&R)},b.relativeLuminance2=T})(x||(c.rgb=x={})),(function(b){function T(L,M,k){const B=L>>24&255,F=L>>16&255,U=L>>8&255;let W=M>>24&255,j=M>>16&255,G=M>>8&255,ee=h(x.relativeLuminance2(W,j,G),x.relativeLuminance2(B,F,U));for(;ee<k&&(W>0||j>0||G>0);)W-=Math.max(0,Math.ceil(.1*W)),j-=Math.max(0,Math.ceil(.1*j)),G-=Math.max(0,Math.ceil(.1*G)),ee=h(x.relativeLuminance2(W,j,G),x.relativeLuminance2(B,F,U));return(W<<24|j<<16|G<<8|255)>>>0}function R(L,M,k){const B=L>>24&255,F=L>>16&255,U=L>>8&255;let W=M>>24&255,j=M>>16&255,G=M>>8&255,ee=h(x.relativeLuminance2(W,j,G),x.relativeLuminance2(B,F,U));for(;ee<k&&(W<255||j<255||G<255);)W=Math.min(255,W+Math.ceil(.1*(255-W))),j=Math.min(255,j+Math.ceil(.1*(255-j))),G=Math.min(255,G+Math.ceil(.1*(255-G))),ee=h(x.relativeLuminance2(W,j,G),x.relativeLuminance2(B,F,U));return(W<<24|j<<16|G<<8|255)>>>0}b.blend=function(L,M){if(g=(255&M)/255,g===1)return M;const k=M>>24&255,B=M>>16&255,F=M>>8&255,U=L>>24&255,W=L>>16&255,j=L>>8&255;return u=U+Math.round((k-U)*g),d=W+Math.round((B-W)*g),S=j+Math.round((F-j)*g),C.toRgba(u,d,S)},b.ensureContrastRatio=function(L,M,k){const B=x.relativeLuminance(L>>8),F=x.relativeLuminance(M>>8);if(h(B,F)<k){if(F<B){const j=T(L,M,k),G=h(B,x.relativeLuminance(j>>8));if(G<k){const ee=R(L,M,k);return G>h(B,x.relativeLuminance(ee>>8))?j:ee}return j}const U=R(L,M,k),W=h(B,x.relativeLuminance(U>>8));if(W<k){const j=T(L,M,k);return W>h(B,x.relativeLuminance(j>>8))?U:j}return U}},b.reduceLuminance=T,b.increaseLuminance=R,b.toChannels=function(L){return[L>>24&255,L>>16&255,L>>8&255,255&L]}})(p||(c.rgba=p={})),c.toPaddedHex=v,c.contrastRatio=h},8969:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreTerminal=void 0;const d=u(844),S=u(2585),g=u(4348),C=u(7866),E=u(744),A=u(7302),x=u(6975),p=u(8460),v=u(1753),h=u(1480),b=u(7994),T=u(9282),R=u(5435),L=u(5981),M=u(2660);let k=!1;class B extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new p.EventEmitter),this._onScroll.event((U=>{this._onScrollApi?.fire(U.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(U){for(const W in U)this.optionsService.options[W]=U[W]}constructor(U){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new p.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new p.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new p.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new p.EventEmitter),this._instantiationService=new g.InstantiationService,this.optionsService=this.register(new A.OptionsService(U)),this._instantiationService.setService(S.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(E.BufferService)),this._instantiationService.setService(S.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(C.LogService)),this._instantiationService.setService(S.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(x.CoreService)),this._instantiationService.setService(S.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(v.CoreMouseService)),this._instantiationService.setService(S.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(h.UnicodeService)),this._instantiationService.setService(S.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(b.CharsetService),this._instantiationService.setService(S.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(M.OscLinkService),this._instantiationService.setService(S.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new R.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,p.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,p.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,p.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,p.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((W=>{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((W=>{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 L.WriteBuffer(((W,j)=>this._inputHandler.parse(W,j)))),this.register((0,p.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(U,W){this._writeBuffer.write(U,W)}writeSync(U,W){this._logService.logLevel<=S.LogLevelEnum.WARN&&!k&&(this._logService.warn("writeSync is unreliable and will be removed soon."),k=!0),this._writeBuffer.writeSync(U,W)}input(U,W=!0){this.coreService.triggerDataEvent(U,W)}resize(U,W){isNaN(U)||isNaN(W)||(U=Math.max(U,E.MINIMUM_COLS),W=Math.max(W,E.MINIMUM_ROWS),this._bufferService.resize(U,W))}scroll(U,W=!1){this._bufferService.scroll(U,W)}scrollLines(U,W,j){this._bufferService.scrollLines(U,W,j)}scrollPages(U){this.scrollLines(U*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(U){const W=U-this._bufferService.buffer.ydisp;W!==0&&this.scrollLines(W)}registerEscHandler(U,W){return this._inputHandler.registerEscHandler(U,W)}registerDcsHandler(U,W){return this._inputHandler.registerDcsHandler(U,W)}registerCsiHandler(U,W){return this._inputHandler.registerCsiHandler(U,W)}registerOscHandler(U,W){return this._inputHandler.registerOscHandler(U,W)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let U=!1;const W=this.optionsService.rawOptions.windowsPty;W&&W.buildNumber!==void 0&&W.buildNumber!==void 0?U=W.backend==="conpty"&&W.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(U=!0),U?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const U=[];U.push(this.onLineFeed(T.updateWindowsModeWrappedState.bind(null,this._bufferService))),U.push(this.registerCsiHandler({final:"H"},(()=>((0,T.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const W of U)W.dispose()}))}}}c.CoreTerminal=B},8460:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.runAndSubscribe=c.forwardEvent=c.EventEmitter=void 0,c.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const S=[];for(let g=0;g<this._listeners.length;g++)S.push(this._listeners[g]);for(let g=0;g<S.length;g++)S[g].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},c.forwardEvent=function(u,d){return u((S=>d.fire(S)))},c.runAndSubscribe=function(u,d){return d(void 0),u((S=>d(S)))}},5435:function(_,c,u){var d=this&&this.__decorate||function(Y,D,I,N){var P,Z=arguments.length,ae=Z<3?D:N===null?N=Object.getOwnPropertyDescriptor(D,I):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ae=Reflect.decorate(Y,D,I,N);else for(var ce=Y.length-1;ce>=0;ce--)(P=Y[ce])&&(ae=(Z<3?P(ae):Z>3?P(D,I,ae):P(D,I))||ae);return Z>3&&ae&&Object.defineProperty(D,I,ae),ae},S=this&&this.__param||function(Y,D){return function(I,N){D(I,N,Y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.InputHandler=c.WindowsOptionsReportType=void 0;const g=u(2584),C=u(7116),E=u(2015),A=u(844),x=u(482),p=u(8437),v=u(8460),h=u(643),b=u(511),T=u(3734),R=u(2585),L=u(1480),M=u(6242),k=u(6351),B=u(5941),F={"(":0,")":1,"*":2,"+":3,"-":1,".":2},U=131072;function W(Y,D){if(Y>24)return D.setWinLines||!1;switch(Y){case 1:return!!D.restoreWin;case 2:return!!D.minimizeWin;case 3:return!!D.setWinPosition;case 4:return!!D.setWinSizePixels;case 5:return!!D.raiseWin;case 6:return!!D.lowerWin;case 7:return!!D.refreshWin;case 8:return!!D.setWinSizeChars;case 9:return!!D.maximizeWin;case 10:return!!D.fullscreenWin;case 11:return!!D.getWinState;case 13:return!!D.getWinPosition;case 14:return!!D.getWinSizePixels;case 15:return!!D.getScreenSizePixels;case 16:return!!D.getCellSizePixels;case 18:return!!D.getWinSizeChars;case 19:return!!D.getScreenSizeChars;case 20:return!!D.getIconTitle;case 21:return!!D.getWinTitle;case 22:return!!D.pushTitle;case 23:return!!D.popTitle;case 24:return!!D.setWinLines}return!1}var j;(function(Y){Y[Y.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Y[Y.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(j||(c.WindowsOptionsReportType=j={}));let G=0;class ee extends A.Disposable{getAttrData(){return this._curAttrData}constructor(D,I,N,P,Z,ae,ce,_e,Q=new E.EscapeSequenceParser){super(),this._bufferService=D,this._charsetService=I,this._coreService=N,this._logService=P,this._optionsService=Z,this._oscLinkService=ae,this._coreMouseService=ce,this._unicodeService=_e,this._parser=Q,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new x.StringToUtf32,this._utf8Decoder=new x.Utf8ToUtf32,this._workCell=new b.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=p.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=p.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new v.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new v.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new v.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new v.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new v.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new v.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new v.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new v.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new v.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new v.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new v.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new v.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 q(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(($=>this._activeBuffer=$.activeBuffer))),this._parser.setCsiHandlerFallback((($,oe)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString($),params:oe.toArray()})})),this._parser.setEscHandlerFallback(($=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString($)})})),this._parser.setExecuteHandlerFallback(($=>{this._logService.debug("Unknown EXECUTE code: ",{code:$})})),this._parser.setOscHandlerFallback((($,oe,ge)=>{this._logService.debug("Unknown OSC code: ",{identifier:$,action:oe,data:ge})})),this._parser.setDcsHandlerFallback((($,oe,ge)=>{oe==="HOOK"&&(ge=ge.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString($),action:oe,payload:ge})})),this._parser.setPrintHandler((($,oe,ge)=>this.print($,oe,ge))),this._parser.registerCsiHandler({final:"@"},($=>this.insertChars($))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},($=>this.scrollLeft($))),this._parser.registerCsiHandler({final:"A"},($=>this.cursorUp($))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},($=>this.scrollRight($))),this._parser.registerCsiHandler({final:"B"},($=>this.cursorDown($))),this._parser.registerCsiHandler({final:"C"},($=>this.cursorForward($))),this._parser.registerCsiHandler({final:"D"},($=>this.cursorBackward($))),this._parser.registerCsiHandler({final:"E"},($=>this.cursorNextLine($))),this._parser.registerCsiHandler({final:"F"},($=>this.cursorPrecedingLine($))),this._parser.registerCsiHandler({final:"G"},($=>this.cursorCharAbsolute($))),this._parser.registerCsiHandler({final:"H"},($=>this.cursorPosition($))),this._parser.registerCsiHandler({final:"I"},($=>this.cursorForwardTab($))),this._parser.registerCsiHandler({final:"J"},($=>this.eraseInDisplay($,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},($=>this.eraseInDisplay($,!0))),this._parser.registerCsiHandler({final:"K"},($=>this.eraseInLine($,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},($=>this.eraseInLine($,!0))),this._parser.registerCsiHandler({final:"L"},($=>this.insertLines($))),this._parser.registerCsiHandler({final:"M"},($=>this.deleteLines($))),this._parser.registerCsiHandler({final:"P"},($=>this.deleteChars($))),this._parser.registerCsiHandler({final:"S"},($=>this.scrollUp($))),this._parser.registerCsiHandler({final:"T"},($=>this.scrollDown($))),this._parser.registerCsiHandler({final:"X"},($=>this.eraseChars($))),this._parser.registerCsiHandler({final:"Z"},($=>this.cursorBackwardTab($))),this._parser.registerCsiHandler({final:"`"},($=>this.charPosAbsolute($))),this._parser.registerCsiHandler({final:"a"},($=>this.hPositionRelative($))),this._parser.registerCsiHandler({final:"b"},($=>this.repeatPrecedingCharacter($))),this._parser.registerCsiHandler({final:"c"},($=>this.sendDeviceAttributesPrimary($))),this._parser.registerCsiHandler({prefix:">",final:"c"},($=>this.sendDeviceAttributesSecondary($))),this._parser.registerCsiHandler({final:"d"},($=>this.linePosAbsolute($))),this._parser.registerCsiHandler({final:"e"},($=>this.vPositionRelative($))),this._parser.registerCsiHandler({final:"f"},($=>this.hVPosition($))),this._parser.registerCsiHandler({final:"g"},($=>this.tabClear($))),this._parser.registerCsiHandler({final:"h"},($=>this.setMode($))),this._parser.registerCsiHandler({prefix:"?",final:"h"},($=>this.setModePrivate($))),this._parser.registerCsiHandler({final:"l"},($=>this.resetMode($))),this._parser.registerCsiHandler({prefix:"?",final:"l"},($=>this.resetModePrivate($))),this._parser.registerCsiHandler({final:"m"},($=>this.charAttributes($))),this._parser.registerCsiHandler({final:"n"},($=>this.deviceStatus($))),this._parser.registerCsiHandler({prefix:"?",final:"n"},($=>this.deviceStatusPrivate($))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},($=>this.softReset($))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},($=>this.setCursorStyle($))),this._parser.registerCsiHandler({final:"r"},($=>this.setScrollRegion($))),this._parser.registerCsiHandler({final:"s"},($=>this.saveCursor($))),this._parser.registerCsiHandler({final:"t"},($=>this.windowOptions($))),this._parser.registerCsiHandler({final:"u"},($=>this.restoreCursor($))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},($=>this.insertColumns($))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},($=>this.deleteColumns($))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},($=>this.selectProtected($))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},($=>this.requestMode($,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},($=>this.requestMode($,!1))),this._parser.setExecuteHandler(g.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(g.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(g.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(g.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(g.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(g.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(g.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(g.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(g.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(g.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(g.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(g.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new M.OscHandler(($=>(this.setTitle($),this.setIconName($),!0)))),this._parser.registerOscHandler(1,new M.OscHandler(($=>this.setIconName($)))),this._parser.registerOscHandler(2,new M.OscHandler(($=>this.setTitle($)))),this._parser.registerOscHandler(4,new M.OscHandler(($=>this.setOrReportIndexedColor($)))),this._parser.registerOscHandler(8,new M.OscHandler(($=>this.setHyperlink($)))),this._parser.registerOscHandler(10,new M.OscHandler(($=>this.setOrReportFgColor($)))),this._parser.registerOscHandler(11,new M.OscHandler(($=>this.setOrReportBgColor($)))),this._parser.registerOscHandler(12,new M.OscHandler(($=>this.setOrReportCursorColor($)))),this._parser.registerOscHandler(104,new M.OscHandler(($=>this.restoreIndexedColor($)))),this._parser.registerOscHandler(110,new M.OscHandler(($=>this.restoreFgColor($)))),this._parser.registerOscHandler(111,new M.OscHandler(($=>this.restoreBgColor($)))),this._parser.registerOscHandler(112,new M.OscHandler(($=>this.restoreCursorColor($)))),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 $ in C.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:$},(()=>this.selectCharset("("+$))),this._parser.registerEscHandler({intermediates:")",final:$},(()=>this.selectCharset(")"+$))),this._parser.registerEscHandler({intermediates:"*",final:$},(()=>this.selectCharset("*"+$))),this._parser.registerEscHandler({intermediates:"+",final:$},(()=>this.selectCharset("+"+$))),this._parser.registerEscHandler({intermediates:"-",final:$},(()=>this.selectCharset("-"+$))),this._parser.registerEscHandler({intermediates:".",final:$},(()=>this.selectCharset("."+$))),this._parser.registerEscHandler({intermediates:"/",final:$},(()=>this.selectCharset("/"+$)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler(($=>(this._logService.error("Parsing error: ",$),$))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new k.DcsHandler((($,oe)=>this.requestStatusString($,oe))))}_preserveStack(D,I,N,P){this._parseStack.paused=!0,this._parseStack.cursorStartX=D,this._parseStack.cursorStartY=I,this._parseStack.decodedLength=N,this._parseStack.position=P}_logSlowResolvingAsync(D){this._logService.logLevel<=R.LogLevelEnum.WARN&&Promise.race([D,new Promise(((I,N)=>setTimeout((()=>N("#SLOW_TIMEOUT")),5e3)))]).catch((I=>{if(I!=="#SLOW_TIMEOUT")throw I;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(D,I){let N,P=this._activeBuffer.x,Z=this._activeBuffer.y,ae=0;const ce=this._parseStack.paused;if(ce){if(N=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,I))return this._logSlowResolvingAsync(N),N;P=this._parseStack.cursorStartX,Z=this._parseStack.cursorStartY,this._parseStack.paused=!1,D.length>U&&(ae=this._parseStack.position+U)}if(this._logService.logLevel<=R.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof D=="string"?` "${D}"`:` "${Array.prototype.map.call(D,($=>String.fromCharCode($))).join("")}"`),typeof D=="string"?D.split("").map(($=>$.charCodeAt(0))):D),this._parseBuffer.length<D.length&&this._parseBuffer.length<U&&(this._parseBuffer=new Uint32Array(Math.min(D.length,U))),ce||this._dirtyRowTracker.clearRange(),D.length>U)for(let $=ae;$<D.length;$+=U){const oe=$+U<D.length?$+U:D.length,ge=typeof D=="string"?this._stringDecoder.decode(D.substring($,oe),this._parseBuffer):this._utf8Decoder.decode(D.subarray($,oe),this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,ge))return this._preserveStack(P,Z,ge,$),this._logSlowResolvingAsync(N),N}else if(!ce){const $=typeof D=="string"?this._stringDecoder.decode(D,this._parseBuffer):this._utf8Decoder.decode(D,this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,$))return this._preserveStack(P,Z,$,0),this._logSlowResolvingAsync(N),N}this._activeBuffer.x===P&&this._activeBuffer.y===Z||this._onCursorMove.fire();const _e=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(_e,this._bufferService.rows-1))}print(D,I,N){let P,Z;const ae=this._charsetService.charset,ce=this._optionsService.rawOptions.screenReaderMode,_e=this._bufferService.cols,Q=this._coreService.decPrivateModes.wraparound,$=this._coreService.modes.insertMode,oe=this._curAttrData;let ge=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&N-I>0&&ge.getWidth(this._activeBuffer.x-1)===2&&ge.setCellFromCodepoint(this._activeBuffer.x-1,0,1,oe);let Se=this._parser.precedingJoinState;for(let ye=I;ye<N;++ye){if(P=D[ye],P<127&&ae){const xt=ae[String.fromCharCode(P)];xt&&(P=xt.charCodeAt(0))}const Pe=this._unicodeService.charProperties(P,Se);Z=L.UnicodeService.extractWidth(Pe);const qe=L.UnicodeService.extractShouldJoin(Pe),Xe=qe?L.UnicodeService.extractWidth(Se):0;if(Se=Pe,ce&&this._onA11yChar.fire((0,x.stringFromCodePoint)(P)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Z-Xe>_e){if(Q){const xt=ge;let Ne=this._activeBuffer.x-Xe;for(this._activeBuffer.x=Xe,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),ge=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Xe>0&&ge instanceof p.BufferLine&&ge.copyCellsFrom(xt,Ne,0,Xe,!1);Ne<_e;)xt.setCellFromCodepoint(Ne++,0,1,oe)}else if(this._activeBuffer.x=_e-1,Z===2)continue}if(qe&&this._activeBuffer.x){const xt=ge.getWidth(this._activeBuffer.x-1)?1:2;ge.addCodepointToCell(this._activeBuffer.x-xt,P,Z);for(let Ne=Z-Xe;--Ne>=0;)ge.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}else if($&&(ge.insertCells(this._activeBuffer.x,Z-Xe,this._activeBuffer.getNullCell(oe)),ge.getWidth(_e-1)===2&&ge.setCellFromCodepoint(_e-1,h.NULL_CELL_CODE,h.NULL_CELL_WIDTH,oe)),ge.setCellFromCodepoint(this._activeBuffer.x++,P,Z,oe),Z>0)for(;--Z;)ge.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}this._parser.precedingJoinState=Se,this._activeBuffer.x<_e&&N-I>0&&ge.getWidth(this._activeBuffer.x)===0&&!ge.hasContent(this._activeBuffer.x)&&ge.setCellFromCodepoint(this._activeBuffer.x,0,1,oe),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(D,I){return D.final!=="t"||D.prefix||D.intermediates?this._parser.registerCsiHandler(D,I):this._parser.registerCsiHandler(D,(N=>!W(N.params[0],this._optionsService.rawOptions.windowOptions)||I(N)))}registerDcsHandler(D,I){return this._parser.registerDcsHandler(D,new k.DcsHandler(I))}registerEscHandler(D,I){return this._parser.registerEscHandler(D,I)}registerOscHandler(D,I){return this._parser.registerOscHandler(D,new M.OscHandler(I))}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(){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&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);D.hasWidth(this._activeBuffer.x)&&!D.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const D=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-D),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(D=this._bufferService.cols-1){this._activeBuffer.x=Math.min(D,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(D,I){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=D,this._activeBuffer.y=this._activeBuffer.scrollTop+I):(this._activeBuffer.x=D,this._activeBuffer.y=I),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(D,I){this._restrictCursor(),this._setCursor(this._activeBuffer.x+D,this._activeBuffer.y+I)}cursorUp(D){const I=this._activeBuffer.y-this._activeBuffer.scrollTop;return I>=0?this._moveCursor(0,-Math.min(I,D.params[0]||1)):this._moveCursor(0,-(D.params[0]||1)),!0}cursorDown(D){const I=this._activeBuffer.scrollBottom-this._activeBuffer.y;return I>=0?this._moveCursor(0,Math.min(I,D.params[0]||1)):this._moveCursor(0,D.params[0]||1),!0}cursorForward(D){return this._moveCursor(D.params[0]||1,0),!0}cursorBackward(D){return this._moveCursor(-(D.params[0]||1),0),!0}cursorNextLine(D){return this.cursorDown(D),this._activeBuffer.x=0,!0}cursorPrecedingLine(D){return this.cursorUp(D),this._activeBuffer.x=0,!0}cursorCharAbsolute(D){return this._setCursor((D.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(D){return this._setCursor(D.length>=2?(D.params[1]||1)-1:0,(D.params[0]||1)-1),!0}charPosAbsolute(D){return this._setCursor((D.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(D){return this._moveCursor(D.params[0]||1,0),!0}linePosAbsolute(D){return this._setCursor(this._activeBuffer.x,(D.params[0]||1)-1),!0}vPositionRelative(D){return this._moveCursor(0,D.params[0]||1),!0}hVPosition(D){return this.cursorPosition(D),!0}tabClear(D){const I=D.params[0];return I===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:I===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(D){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let I=D.params[0]||1;for(;I--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(D){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let I=D.params[0]||1;for(;I--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(D){const I=D.params[0];return I===1&&(this._curAttrData.bg|=536870912),I!==2&&I!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(D,I,N,P=!1,Z=!1){const ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);ae.replaceCells(I,N,this._activeBuffer.getNullCell(this._eraseAttrData()),Z),P&&(ae.isWrapped=!1)}_resetBufferLine(D,I=!1){const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);N&&(N.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),I),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+D),N.isWrapped=!1)}eraseInDisplay(D,I=!1){let N;switch(this._restrictCursor(this._bufferService.cols),D.params[0]){case 0:for(N=this._activeBuffer.y,this._dirtyRowTracker.markDirty(N),this._eraseInBufferLine(N++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,I);N<this._bufferService.rows;N++)this._resetBufferLine(N,I);this._dirtyRowTracker.markDirty(N);break;case 1:for(N=this._activeBuffer.y,this._dirtyRowTracker.markDirty(N),this._eraseInBufferLine(N,0,this._activeBuffer.x+1,!0,I),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(N+1).isWrapped=!1);N--;)this._resetBufferLine(N,I);this._dirtyRowTracker.markDirty(0);break;case 2:for(N=this._bufferService.rows,this._dirtyRowTracker.markDirty(N-1);N--;)this._resetBufferLine(N,I);this._dirtyRowTracker.markDirty(0);break;case 3:const P=this._activeBuffer.lines.length-this._bufferService.rows;P>0&&(this._activeBuffer.lines.trimStart(P),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-P,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-P,0),this._onScroll.fire(0))}return!0}eraseInLine(D,I=!1){switch(this._restrictCursor(this._bufferService.cols),D.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,I);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,I);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,I)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(D){this._restrictCursor();let I=D.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=this._activeBuffer.ybase+this._activeBuffer.y,P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Z=this._bufferService.rows-1+this._activeBuffer.ybase-P+1;for(;I--;)this._activeBuffer.lines.splice(Z-1,1),this._activeBuffer.lines.splice(N,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(D){this._restrictCursor();let I=D.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=this._activeBuffer.ybase+this._activeBuffer.y;let P;for(P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,P=this._bufferService.rows-1+this._activeBuffer.ybase-P;I--;)this._activeBuffer.lines.splice(N,1),this._activeBuffer.lines.splice(P,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(D){this._restrictCursor();const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return I&&(I.insertCells(this._activeBuffer.x,D.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(D){this._restrictCursor();const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return I&&(I.deleteCells(this._activeBuffer.x,D.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(D){let I=D.params[0]||1;for(;I--;)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(D){let I=D.params[0]||1;for(;I--;)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(p.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=D.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);P.deleteCells(0,I,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=D.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);P.insertCells(0,I,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=D.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);P.insertCells(this._activeBuffer.x,I,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=D.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);P.deleteCells(this._activeBuffer.x,I,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(D){this._restrictCursor();const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return I&&(I.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(D.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(D){const I=this._parser.precedingJoinState;if(!I)return!0;const N=D.params[0]||1,P=L.UnicodeService.extractWidth(I),Z=this._activeBuffer.x-P,ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Z),ce=new Uint32Array(ae.length*N);let _e=0;for(let $=0;$<ae.length;){const oe=ae.codePointAt($)||0;ce[_e++]=oe,$+=oe>65535?2:1}let Q=_e;for(let $=1;$<N;++$)ce.copyWithin(Q,0,_e),Q+=_e;return this.print(ce,0,Q),!0}sendDeviceAttributesPrimary(D){return D.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(g.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(g.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(D){return D.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(g.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(g.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(D.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(g.C0.ESC+"[>83;40003;0c")),!0}_is(D){return(this._optionsService.rawOptions.termName+"").indexOf(D)===0}setMode(D){for(let I=0;I<D.length;I++)switch(D.params[I]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(D){for(let I=0;I<D.length;I++)switch(D.params[I]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,C.DEFAULT_CHARSET),this._charsetService.setgCharset(1,C.DEFAULT_CHARSET),this._charsetService.setgCharset(2,C.DEFAULT_CHARSET),this._charsetService.setgCharset(3,C.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(D){for(let I=0;I<D.length;I++)switch(D.params[I]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(D){for(let I=0;I<D.length;I++)switch(D.params[I]){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(),D.params[I]===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(D,I){const N=this._coreService.decPrivateModes,{activeProtocol:P,activeEncoding:Z}=this._coreMouseService,ae=this._coreService,{buffers:ce,cols:_e}=this._bufferService,{active:Q,alt:$}=ce,oe=this._optionsService.rawOptions,ge=qe=>qe?1:2,Se=D.params[0];return ye=Se,Pe=I?Se===2?4:Se===4?ge(ae.modes.insertMode):Se===12?3:Se===20?ge(oe.convertEol):0:Se===1?ge(N.applicationCursorKeys):Se===3?oe.windowOptions.setWinLines?_e===80?2:_e===132?1:0:0:Se===6?ge(N.origin):Se===7?ge(N.wraparound):Se===8?3:Se===9?ge(P==="X10"):Se===12?ge(oe.cursorBlink):Se===25?ge(!ae.isCursorHidden):Se===45?ge(N.reverseWraparound):Se===66?ge(N.applicationKeypad):Se===67?4:Se===1e3?ge(P==="VT200"):Se===1002?ge(P==="DRAG"):Se===1003?ge(P==="ANY"):Se===1004?ge(N.sendFocus):Se===1005?4:Se===1006?ge(Z==="SGR"):Se===1015?4:Se===1016?ge(Z==="SGR_PIXELS"):Se===1048?1:Se===47||Se===1047||Se===1049?ge(Q===$):Se===2004?ge(N.bracketedPasteMode):0,ae.triggerDataEvent(`${g.C0.ESC}[${I?"":"?"}${ye};${Pe}$y`),!0;var ye,Pe}_updateAttrColor(D,I,N,P,Z){return I===2?(D|=50331648,D&=-16777216,D|=T.AttributeData.fromColorRGB([N,P,Z])):I===5&&(D&=-50331904,D|=33554432|255&N),D}_extractColor(D,I,N){const P=[0,0,-1,0,0,0];let Z=0,ae=0;do{if(P[ae+Z]=D.params[I+ae],D.hasSubParams(I+ae)){const ce=D.getSubParams(I+ae);let _e=0;do P[1]===5&&(Z=1),P[ae+_e+1+Z]=ce[_e];while(++_e<ce.length&&_e+ae+1+Z<P.length);break}if(P[1]===5&&ae+Z>=2||P[1]===2&&ae+Z>=5)break;P[1]&&(Z=1)}while(++ae+I<D.length&&ae+Z<P.length);for(let ce=2;ce<P.length;++ce)P[ce]===-1&&(P[ce]=0);switch(P[0]){case 38:N.fg=this._updateAttrColor(N.fg,P[1],P[3],P[4],P[5]);break;case 48:N.bg=this._updateAttrColor(N.bg,P[1],P[3],P[4],P[5]);break;case 58:N.extended=N.extended.clone(),N.extended.underlineColor=this._updateAttrColor(N.extended.underlineColor,P[1],P[3],P[4],P[5])}return ae}_processUnderline(D,I){I.extended=I.extended.clone(),(!~D||D>5)&&(D=1),I.extended.underlineStyle=D,I.fg|=268435456,D===0&&(I.fg&=-268435457),I.updateExtended()}_processSGR0(D){D.fg=p.DEFAULT_ATTR_DATA.fg,D.bg=p.DEFAULT_ATTR_DATA.bg,D.extended=D.extended.clone(),D.extended.underlineStyle=0,D.extended.underlineColor&=-67108864,D.updateExtended()}charAttributes(D){if(D.length===1&&D.params[0]===0)return this._processSGR0(this._curAttrData),!0;const I=D.length;let N;const P=this._curAttrData;for(let Z=0;Z<I;Z++)N=D.params[Z],N>=30&&N<=37?(P.fg&=-50331904,P.fg|=16777216|N-30):N>=40&&N<=47?(P.bg&=-50331904,P.bg|=16777216|N-40):N>=90&&N<=97?(P.fg&=-50331904,P.fg|=16777224|N-90):N>=100&&N<=107?(P.bg&=-50331904,P.bg|=16777224|N-100):N===0?this._processSGR0(P):N===1?P.fg|=134217728:N===3?P.bg|=67108864:N===4?(P.fg|=268435456,this._processUnderline(D.hasSubParams(Z)?D.getSubParams(Z)[0]:1,P)):N===5?P.fg|=536870912:N===7?P.fg|=67108864:N===8?P.fg|=1073741824:N===9?P.fg|=2147483648:N===2?P.bg|=134217728:N===21?this._processUnderline(2,P):N===22?(P.fg&=-134217729,P.bg&=-134217729):N===23?P.bg&=-67108865:N===24?(P.fg&=-268435457,this._processUnderline(0,P)):N===25?P.fg&=-536870913:N===27?P.fg&=-67108865:N===28?P.fg&=-1073741825:N===29?P.fg&=2147483647:N===39?(P.fg&=-67108864,P.fg|=16777215&p.DEFAULT_ATTR_DATA.fg):N===49?(P.bg&=-67108864,P.bg|=16777215&p.DEFAULT_ATTR_DATA.bg):N===38||N===48||N===58?Z+=this._extractColor(D,Z,P):N===53?P.bg|=1073741824:N===55?P.bg&=-1073741825:N===59?(P.extended=P.extended.clone(),P.extended.underlineColor=-1,P.updateExtended()):N===100?(P.fg&=-67108864,P.fg|=16777215&p.DEFAULT_ATTR_DATA.fg,P.bg&=-67108864,P.bg|=16777215&p.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",N);return!0}deviceStatus(D){switch(D.params[0]){case 5:this._coreService.triggerDataEvent(`${g.C0.ESC}[0n`);break;case 6:const I=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${g.C0.ESC}[${I};${N}R`)}return!0}deviceStatusPrivate(D){if(D.params[0]===6){const I=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${g.C0.ESC}[?${I};${N}R`)}return!0}softReset(D){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=p.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(D){const I=D.params[0]||1;switch(I){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 N=I%2==1;return this._optionsService.options.cursorBlink=N,!0}setScrollRegion(D){const I=D.params[0]||1;let N;return(D.length<2||(N=D.params[1])>this._bufferService.rows||N===0)&&(N=this._bufferService.rows),N>I&&(this._activeBuffer.scrollTop=I-1,this._activeBuffer.scrollBottom=N-1,this._setCursor(0,0)),!0}windowOptions(D){if(!W(D.params[0],this._optionsService.rawOptions.windowOptions))return!0;const I=D.length>1?D.params[1]:0;switch(D.params[0]){case 14:I!==2&&this._onRequestWindowsOptionsReport.fire(j.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(j.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${g.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:I!==0&&I!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),I!==0&&I!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:I!==0&&I!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),I!==0&&I!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(D){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(D){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(D){return this._windowTitle=D,this._onTitleChange.fire(D),!0}setIconName(D){return this._iconName=D,!0}setOrReportIndexedColor(D){const I=[],N=D.split(";");for(;N.length>1;){const P=N.shift(),Z=N.shift();if(/^\d+$/.exec(P)){const ae=parseInt(P);if(V(ae))if(Z==="?")I.push({type:0,index:ae});else{const ce=(0,B.parseColor)(Z);ce&&I.push({type:1,index:ae,color:ce})}}}return I.length&&this._onColor.fire(I),!0}setHyperlink(D){const I=D.split(";");return!(I.length<2)&&(I[1]?this._createHyperlink(I[0],I[1]):!I[0]&&this._finishHyperlink())}_createHyperlink(D,I){this._getCurrentLinkId()&&this._finishHyperlink();const N=D.split(":");let P;const Z=N.findIndex((ae=>ae.startsWith("id=")));return Z!==-1&&(P=N[Z].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:P,uri:I}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(D,I){const N=D.split(";");for(let P=0;P<N.length&&!(I>=this._specialColors.length);++P,++I)if(N[P]==="?")this._onColor.fire([{type:0,index:this._specialColors[I]}]);else{const Z=(0,B.parseColor)(N[P]);Z&&this._onColor.fire([{type:1,index:this._specialColors[I],color:Z}])}return!0}setOrReportFgColor(D){return this._setOrReportSpecialColor(D,0)}setOrReportBgColor(D){return this._setOrReportSpecialColor(D,1)}setOrReportCursorColor(D){return this._setOrReportSpecialColor(D,2)}restoreIndexedColor(D){if(!D)return this._onColor.fire([{type:2}]),!0;const I=[],N=D.split(";");for(let P=0;P<N.length;++P)if(/^\d+$/.exec(N[P])){const Z=parseInt(N[P]);V(Z)&&I.push({type:2,index:Z})}return I.length&&this._onColor.fire(I),!0}restoreFgColor(D){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(D){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(D){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,C.DEFAULT_CHARSET),!0}selectCharset(D){return D.length!==2?(this.selectDefaultCharset(),!0):(D[0]==="/"||this._charsetService.setgCharset(F[D[0]],C.CHARSETS[D[1]]||C.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 D=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,D,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=p.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=p.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(D){return this._charsetService.setgLevel(D),!0}screenAlignmentPattern(){const D=new b.CellData;D.content=4194373,D.fg=this._curAttrData.fg,D.bg=this._curAttrData.bg,this._setCursor(0,0);for(let I=0;I<this._bufferService.rows;++I){const N=this._activeBuffer.ybase+this._activeBuffer.y+I,P=this._activeBuffer.lines.get(N);P&&(P.fill(D),P.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(D,I){const N=this._bufferService.buffer,P=this._optionsService.rawOptions;return(Z=>(this._coreService.triggerDataEvent(`${g.C0.ESC}${Z}${g.C0.ESC}\\`),!0))(D==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:D==='"p'?'P1$r61;1"p':D==="r"?`P1$r${N.scrollTop+1};${N.scrollBottom+1}r`:D==="m"?"P1$r0m":D===" q"?`P1$r${{block:2,underline:4,bar:6}[P.cursorStyle]-(P.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(D,I){this._dirtyRowTracker.markRangeDirty(D,I)}}c.InputHandler=ee;let q=class{constructor(Y){this._bufferService=Y,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Y){Y<this.start?this.start=Y:Y>this.end&&(this.end=Y)}markRangeDirty(Y,D){Y>D&&(G=Y,Y=D,D=G),Y<this.start&&(this.start=Y),D>this.end&&(this.end=D)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function V(Y){return 0<=Y&&Y<256}q=d([S(0,R.IBufferService)],q)},844:(_,c)=>{function u(d){for(const S of d)S.dispose();d.length=0}Object.defineProperty(c,"__esModule",{value:!0}),c.getDisposeArrayDisposable=c.disposeArray=c.toDisposable=c.MutableDisposable=c.Disposable=void 0,c.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const S=this._disposables.indexOf(d);S!==-1&&this._disposables.splice(S,1)}},c.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){this._isDisposed||d===this._value||(this._value?.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},c.toDisposable=function(d){return{dispose:d}},c.disposeArray=u,c.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},1505:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.FourKeyMap=c.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(S,g,C){this._data[S]||(this._data[S]={}),this._data[S][g]=C}get(S,g){return this._data[S]?this._data[S][g]:void 0}clear(){this._data={}}}c.TwoKeyMap=u,c.FourKeyMap=class{constructor(){this._data=new u}set(d,S,g,C,E){this._data.get(d,S)||this._data.set(d,S,new u),this._data.get(d,S).set(g,C,E)}get(d,S,g,C){return this._data.get(d,S)?.get(g,C)}clear(){this._data.clear()}}},6114:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.isChromeOS=c.isLinux=c.isWindows=c.isIphone=c.isIpad=c.isMac=c.getSafariVersion=c.isSafari=c.isLegacyEdge=c.isFirefox=c.isNode=void 0,c.isNode=typeof process<"u"&&"title"in process;const u=c.isNode?"node":navigator.userAgent,d=c.isNode?"node":navigator.platform;c.isFirefox=u.includes("Firefox"),c.isLegacyEdge=u.includes("Edge"),c.isSafari=/^((?!chrome|android).)*safari/i.test(u),c.getSafariVersion=function(){if(!c.isSafari)return 0;const S=u.match(/Version\/(\d+)/);return S===null||S.length<2?0:parseInt(S[1])},c.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),c.isIpad=d==="iPad",c.isIphone=d==="iPhone",c.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),c.isLinux=d.indexOf("Linux")>=0,c.isChromeOS=/\bCrOS\b/.test(u)},6106:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SortedList=void 0;let u=0;c.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(u=this._search(this._getKey(d)),this._array.splice(u,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const S=this._getKey(d);if(S===void 0||(u=this._search(S),u===-1)||this._getKey(this._array[u])!==S)return!1;do if(this._array[u]===d)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===S);return!1}*getKeyIterator(d){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===d)}forEachByKey(d,S){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do S(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===d)}values(){return[...this._array].values()}_search(d){let S=0,g=this._array.length-1;for(;g>=S;){let C=S+g>>1;const E=this._getKey(this._array[C]);if(E>d)g=C-1;else{if(!(E<d)){for(;C>0&&this._getKey(this._array[C-1])===d;)C--;return C}S=C+1}}return S}}},7226:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DebouncedIdleTask=c.IdleTaskQueue=c.PriorityTaskQueue=void 0;const d=u(6114);class S{constructor(){this._tasks=[],this._i=0}enqueue(E){this._tasks.push(E),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(E){this._idleCallback=void 0;let A=0,x=0,p=E.timeRemaining(),v=0;for(;this._i<this._tasks.length;){if(A=Date.now(),this._tasks[this._i]()||this._i++,A=Math.max(1,Date.now()-A),x=Math.max(A,x),v=E.timeRemaining(),1.5*x>v)return p-A<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(p-A))}ms`),void this._start();p=v}this.clear()}}class g extends S{_requestCallback(E){return setTimeout((()=>E(this._createDeadline(16))))}_cancelCallback(E){clearTimeout(E)}_createDeadline(E){const A=Date.now()+E;return{timeRemaining:()=>Math.max(0,A-Date.now())}}}c.PriorityTaskQueue=g,c.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends S{_requestCallback(C){return requestIdleCallback(C)}_cancelCallback(C){cancelIdleCallback(C)}}:g,c.DebouncedIdleTask=class{constructor(){this._queue=new c.IdleTaskQueue}set(C){this._queue.clear(),this._queue.enqueue(C)}flush(){this._queue.flush()}}},9282:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.updateWindowsModeWrappedState=void 0;const d=u(643);c.updateWindowsModeWrappedState=function(S){const g=S.buffer.lines.get(S.buffer.ybase+S.buffer.y-1),C=g?.get(S.cols-1),E=S.buffer.lines.get(S.buffer.ybase+S.buffer.y);E&&C&&(E.isWrapped=C[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&C[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ExtendedAttrs=c.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(g){return[g>>>16&255,g>>>8&255,255&g]}static fromColorRGB(g){return(255&g[0])<<16|(255&g[1])<<8|255&g[2]}clone(){const g=new u;return g.fg=this.fg,g.bg=this.bg,g.extended=this.extended.clone(),g}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}}c.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(g){this._ext=g}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(g){this._ext&=-469762049,this._ext|=g<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(g){this._ext&=-67108864,this._ext|=67108863&g}get urlId(){return this._urlId}set urlId(g){this._urlId=g}get underlineVariantOffset(){const g=(3758096384&this._ext)>>29;return g<0?4294967288^g:g}set underlineVariantOffset(g){this._ext&=536870911,this._ext|=g<<29&3758096384}constructor(g=0,C=0){this._ext=0,this._urlId=0,this._ext=g,this._urlId=C}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}c.ExtendedAttrs=d},9092:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Buffer=c.MAX_BUFFER_SIZE=void 0;const d=u(6349),S=u(7226),g=u(3734),C=u(8437),E=u(4634),A=u(511),x=u(643),p=u(4863),v=u(7116);c.MAX_BUFFER_SIZE=4294967295,c.Buffer=class{constructor(h,b,T){this._hasScrollback=h,this._optionsService=b,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=C.DEFAULT_ATTR_DATA.clone(),this.savedCharset=v.DEFAULT_CHARSET,this.markers=[],this._nullCell=A.CellData.fromCharData([0,x.NULL_CELL_CHAR,x.NULL_CELL_WIDTH,x.NULL_CELL_CODE]),this._whitespaceCell=A.CellData.fromCharData([0,x.WHITESPACE_CELL_CHAR,x.WHITESPACE_CELL_WIDTH,x.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new S.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(h){return h?(this._nullCell.fg=h.fg,this._nullCell.bg=h.bg,this._nullCell.extended=h.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new g.ExtendedAttrs),this._nullCell}getWhitespaceCell(h){return h?(this._whitespaceCell.fg=h.fg,this._whitespaceCell.bg=h.bg,this._whitespaceCell.extended=h.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new g.ExtendedAttrs),this._whitespaceCell}getBlankLine(h,b){return new C.BufferLine(this._bufferService.cols,this.getNullCell(h),b)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const h=this.ybase+this.y-this.ydisp;return h>=0&&h<this._rows}_getCorrectBufferLength(h){if(!this._hasScrollback)return h;const b=h+this._optionsService.rawOptions.scrollback;return b>c.MAX_BUFFER_SIZE?c.MAX_BUFFER_SIZE:b}fillViewportRows(h){if(this.lines.length===0){h===void 0&&(h=C.DEFAULT_ATTR_DATA);let b=this._rows;for(;b--;)this.lines.push(this.getBlankLine(h))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(h,b){const T=this.getNullCell(C.DEFAULT_ATTR_DATA);let R=0;const L=this._getCorrectBufferLength(b);if(L>this.lines.maxLength&&(this.lines.maxLength=L),this.lines.length>0){if(this._cols<h)for(let k=0;k<this.lines.length;k++)R+=+this.lines.get(k).resize(h,T);let M=0;if(this._rows<b)for(let k=this._rows;k<b;k++)this.lines.length<b+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new C.BufferLine(h,T)):this.ybase>0&&this.lines.length<=this.ybase+this.y+M+1?(this.ybase--,M++,this.ydisp>0&&this.ydisp--):this.lines.push(new C.BufferLine(h,T)));else for(let k=this._rows;k>b;k--)this.lines.length>b+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(L<this.lines.maxLength){const k=this.lines.length-L;k>0&&(this.lines.trimStart(k),this.ybase=Math.max(this.ybase-k,0),this.ydisp=Math.max(this.ydisp-k,0),this.savedY=Math.max(this.savedY-k,0)),this.lines.maxLength=L}this.x=Math.min(this.x,h-1),this.y=Math.min(this.y,b-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,h-1),this.scrollTop=0}if(this.scrollBottom=b-1,this._isReflowEnabled&&(this._reflow(h,b),this._cols>h))for(let M=0;M<this.lines.length;M++)R+=+this.lines.get(M).resize(h,T);this._cols=h,this._rows=b,this._memoryCleanupQueue.clear(),R>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let h=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,h=!1);let b=0;for(;this._memoryCleanupPosition<this.lines.length;)if(b+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),b>100)return!0;return h}get _isReflowEnabled(){const h=this._optionsService.rawOptions.windowsPty;return h&&h.buildNumber?this._hasScrollback&&h.backend==="conpty"&&h.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(h,b){this._cols!==h&&(h>this._cols?this._reflowLarger(h,b):this._reflowSmaller(h,b))}_reflowLarger(h,b){const T=(0,E.reflowLargerGetLinesToRemove)(this.lines,this._cols,h,this.ybase+this.y,this.getNullCell(C.DEFAULT_ATTR_DATA));if(T.length>0){const R=(0,E.reflowLargerCreateNewLayout)(this.lines,T);(0,E.reflowLargerApplyNewLayout)(this.lines,R.layout),this._reflowLargerAdjustViewport(h,b,R.countRemoved)}}_reflowLargerAdjustViewport(h,b,T){const R=this.getNullCell(C.DEFAULT_ATTR_DATA);let L=T;for(;L-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<b&&this.lines.push(new C.BufferLine(h,R))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-T,0)}_reflowSmaller(h,b){const T=this.getNullCell(C.DEFAULT_ATTR_DATA),R=[];let L=0;for(let M=this.lines.length-1;M>=0;M--){let k=this.lines.get(M);if(!k||!k.isWrapped&&k.getTrimmedLength()<=h)continue;const B=[k];for(;k.isWrapped&&M>0;)k=this.lines.get(--M),B.unshift(k);const F=this.ybase+this.y;if(F>=M&&F<M+B.length)continue;const U=B[B.length-1].getTrimmedLength(),W=(0,E.reflowSmallerGetNewLineLengths)(B,this._cols,h),j=W.length-B.length;let G;G=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+j):Math.max(0,this.lines.length-this.lines.maxLength+j);const ee=[];for(let N=0;N<j;N++){const P=this.getBlankLine(C.DEFAULT_ATTR_DATA,!0);ee.push(P)}ee.length>0&&(R.push({start:M+B.length+L,newLines:ee}),L+=ee.length),B.push(...ee);let q=W.length-1,V=W[q];V===0&&(q--,V=W[q]);let Y=B.length-j-1,D=U;for(;Y>=0;){const N=Math.min(D,V);if(B[q]===void 0)break;if(B[q].copyCellsFrom(B[Y],D-N,V-N,N,!0),V-=N,V===0&&(q--,V=W[q]),D-=N,D===0){Y--;const P=Math.max(Y,0);D=(0,E.getWrappedLineTrimmedLength)(B,P,this._cols)}}for(let N=0;N<B.length;N++)W[N]<h&&B[N].setCell(W[N],T);let I=j-G;for(;I-- >0;)this.ybase===0?this.y<b-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+L)-b&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+j,this.ybase+b-1)}if(R.length>0){const M=[],k=[];for(let q=0;q<this.lines.length;q++)k.push(this.lines.get(q));const B=this.lines.length;let F=B-1,U=0,W=R[U];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+L);let j=0;for(let q=Math.min(this.lines.maxLength-1,B+L-1);q>=0;q--)if(W&&W.start>F+j){for(let V=W.newLines.length-1;V>=0;V--)this.lines.set(q--,W.newLines[V]);q++,M.push({index:F+1,amount:W.newLines.length}),j+=W.newLines.length,W=R[++U]}else this.lines.set(q,k[F--]);let G=0;for(let q=M.length-1;q>=0;q--)M[q].index+=G,this.lines.onInsertEmitter.fire(M[q]),G+=M[q].amount;const ee=Math.max(0,B+L-this.lines.maxLength);ee>0&&this.lines.onTrimEmitter.fire(ee)}}translateBufferLineToString(h,b,T=0,R){const L=this.lines.get(h);return L?L.translateToString(b,T,R):""}getWrappedRangeForLine(h){let b=h,T=h;for(;b>0&&this.lines.get(b).isWrapped;)b--;for(;T+1<this.lines.length&&this.lines.get(T+1).isWrapped;)T++;return{first:b,last:T}}setupTabStops(h){for(h!=null?this.tabs[h]||(h=this.prevStop(h)):(this.tabs={},h=0);h<this._cols;h+=this._optionsService.rawOptions.tabStopWidth)this.tabs[h]=!0}prevStop(h){for(h==null&&(h=this.x);!this.tabs[--h]&&h>0;);return h>=this._cols?this._cols-1:h<0?0:h}nextStop(h){for(h==null&&(h=this.x);!this.tabs[++h]&&h<this._cols;);return h>=this._cols?this._cols-1:h<0?0:h}clearMarkers(h){this._isClearing=!0;for(let b=0;b<this.markers.length;b++)this.markers[b].line===h&&(this.markers[b].dispose(),this.markers.splice(b--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let h=0;h<this.markers.length;h++)this.markers[h].dispose(),this.markers.splice(h--,1);this._isClearing=!1}addMarker(h){const b=new p.Marker(h);return this.markers.push(b),b.register(this.lines.onTrim((T=>{b.line-=T,b.line<0&&b.dispose()}))),b.register(this.lines.onInsert((T=>{b.line>=T.index&&(b.line+=T.amount)}))),b.register(this.lines.onDelete((T=>{b.line>=T.index&&b.line<T.index+T.amount&&b.dispose(),b.line>T.index&&(b.line-=T.amount)}))),b.register(b.onDispose((()=>this._removeMarker(b)))),b}_removeMarker(h){this._isClearing||this.markers.splice(this.markers.indexOf(h),1)}}},8437:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLine=c.DEFAULT_ATTR_DATA=void 0;const d=u(3734),S=u(511),g=u(643),C=u(482);c.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let E=0;class A{constructor(p,v,h=!1){this.isWrapped=h,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*p);const b=v||S.CellData.fromCharData([0,g.NULL_CELL_CHAR,g.NULL_CELL_WIDTH,g.NULL_CELL_CODE]);for(let T=0;T<p;++T)this.setCell(T,b);this.length=p}get(p){const v=this._data[3*p+0],h=2097151&v;return[this._data[3*p+1],2097152&v?this._combined[p]:h?(0,C.stringFromCodePoint)(h):"",v>>22,2097152&v?this._combined[p].charCodeAt(this._combined[p].length-1):h]}set(p,v){this._data[3*p+1]=v[g.CHAR_DATA_ATTR_INDEX],v[g.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[p]=v[1],this._data[3*p+0]=2097152|p|v[g.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*p+0]=v[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[g.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(p){return this._data[3*p+0]>>22}hasWidth(p){return 12582912&this._data[3*p+0]}getFg(p){return this._data[3*p+1]}getBg(p){return this._data[3*p+2]}hasContent(p){return 4194303&this._data[3*p+0]}getCodePoint(p){const v=this._data[3*p+0];return 2097152&v?this._combined[p].charCodeAt(this._combined[p].length-1):2097151&v}isCombined(p){return 2097152&this._data[3*p+0]}getString(p){const v=this._data[3*p+0];return 2097152&v?this._combined[p]:2097151&v?(0,C.stringFromCodePoint)(2097151&v):""}isProtected(p){return 536870912&this._data[3*p+2]}loadCell(p,v){return E=3*p,v.content=this._data[E+0],v.fg=this._data[E+1],v.bg=this._data[E+2],2097152&v.content&&(v.combinedData=this._combined[p]),268435456&v.bg&&(v.extended=this._extendedAttrs[p]),v}setCell(p,v){2097152&v.content&&(this._combined[p]=v.combinedData),268435456&v.bg&&(this._extendedAttrs[p]=v.extended),this._data[3*p+0]=v.content,this._data[3*p+1]=v.fg,this._data[3*p+2]=v.bg}setCellFromCodepoint(p,v,h,b){268435456&b.bg&&(this._extendedAttrs[p]=b.extended),this._data[3*p+0]=v|h<<22,this._data[3*p+1]=b.fg,this._data[3*p+2]=b.bg}addCodepointToCell(p,v,h){let b=this._data[3*p+0];2097152&b?this._combined[p]+=(0,C.stringFromCodePoint)(v):2097151&b?(this._combined[p]=(0,C.stringFromCodePoint)(2097151&b)+(0,C.stringFromCodePoint)(v),b&=-2097152,b|=2097152):b=v|4194304,h&&(b&=-12582913,b|=h<<22),this._data[3*p+0]=b}insertCells(p,v,h){if((p%=this.length)&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p-1,0,1,h),v<this.length-p){const b=new S.CellData;for(let T=this.length-p-v-1;T>=0;--T)this.setCell(p+v+T,this.loadCell(p+T,b));for(let T=0;T<v;++T)this.setCell(p+T,h)}else for(let b=p;b<this.length;++b)this.setCell(b,h);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,h)}deleteCells(p,v,h){if(p%=this.length,v<this.length-p){const b=new S.CellData;for(let T=0;T<this.length-p-v;++T)this.setCell(p+T,this.loadCell(p+v+T,b));for(let T=this.length-v;T<this.length;++T)this.setCell(T,h)}else for(let b=p;b<this.length;++b)this.setCell(b,h);p&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p-1,0,1,h),this.getWidth(p)!==0||this.hasContent(p)||this.setCellFromCodepoint(p,0,1,h)}replaceCells(p,v,h,b=!1){if(b)for(p&&this.getWidth(p-1)===2&&!this.isProtected(p-1)&&this.setCellFromCodepoint(p-1,0,1,h),v<this.length&&this.getWidth(v-1)===2&&!this.isProtected(v)&&this.setCellFromCodepoint(v,0,1,h);p<v&&p<this.length;)this.isProtected(p)||this.setCell(p,h),p++;else for(p&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p-1,0,1,h),v<this.length&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v,0,1,h);p<v&&p<this.length;)this.setCell(p++,h)}resize(p,v){if(p===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const h=3*p;if(p>this.length){if(this._data.buffer.byteLength>=4*h)this._data=new Uint32Array(this._data.buffer,0,h);else{const b=new Uint32Array(h);b.set(this._data),this._data=b}for(let b=this.length;b<p;++b)this.setCell(b,v)}else{this._data=this._data.subarray(0,h);const b=Object.keys(this._combined);for(let R=0;R<b.length;R++){const L=parseInt(b[R],10);L>=p&&delete this._combined[L]}const T=Object.keys(this._extendedAttrs);for(let R=0;R<T.length;R++){const L=parseInt(T[R],10);L>=p&&delete this._extendedAttrs[L]}}return this.length=p,4*h*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const p=new Uint32Array(this._data.length);return p.set(this._data),this._data=p,1}return 0}fill(p,v=!1){if(v)for(let h=0;h<this.length;++h)this.isProtected(h)||this.setCell(h,p);else{this._combined={},this._extendedAttrs={};for(let h=0;h<this.length;++h)this.setCell(h,p)}}copyFrom(p){this.length!==p.length?this._data=new Uint32Array(p._data):this._data.set(p._data),this.length=p.length,this._combined={};for(const v in p._combined)this._combined[v]=p._combined[v];this._extendedAttrs={};for(const v in p._extendedAttrs)this._extendedAttrs[v]=p._extendedAttrs[v];this.isWrapped=p.isWrapped}clone(){const p=new A(0);p._data=new Uint32Array(this._data),p.length=this.length;for(const v in this._combined)p._combined[v]=this._combined[v];for(const v in this._extendedAttrs)p._extendedAttrs[v]=this._extendedAttrs[v];return p.isWrapped=this.isWrapped,p}getTrimmedLength(){for(let p=this.length-1;p>=0;--p)if(4194303&this._data[3*p+0])return p+(this._data[3*p+0]>>22);return 0}getNoBgTrimmedLength(){for(let p=this.length-1;p>=0;--p)if(4194303&this._data[3*p+0]||50331648&this._data[3*p+2])return p+(this._data[3*p+0]>>22);return 0}copyCellsFrom(p,v,h,b,T){const R=p._data;if(T)for(let M=b-1;M>=0;M--){for(let k=0;k<3;k++)this._data[3*(h+M)+k]=R[3*(v+M)+k];268435456&R[3*(v+M)+2]&&(this._extendedAttrs[h+M]=p._extendedAttrs[v+M])}else for(let M=0;M<b;M++){for(let k=0;k<3;k++)this._data[3*(h+M)+k]=R[3*(v+M)+k];268435456&R[3*(v+M)+2]&&(this._extendedAttrs[h+M]=p._extendedAttrs[v+M])}const L=Object.keys(p._combined);for(let M=0;M<L.length;M++){const k=parseInt(L[M],10);k>=v&&(this._combined[k-v+h]=p._combined[k])}}translateToString(p,v,h,b){v=v??0,h=h??this.length,p&&(h=Math.min(h,this.getTrimmedLength())),b&&(b.length=0);let T="";for(;v<h;){const R=this._data[3*v+0],L=2097151&R,M=2097152&R?this._combined[v]:L?(0,C.stringFromCodePoint)(L):g.WHITESPACE_CELL_CHAR;if(T+=M,b)for(let k=0;k<M.length;++k)b.push(v);v+=R>>22||1}return b&&b.push(v),T}}c.BufferLine=A},4841:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.getRangeLength=void 0,c.getRangeLength=function(u,d){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return d*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(_,c)=>{function u(d,S,g){if(S===d.length-1)return d[S].getTrimmedLength();const C=!d[S].hasContent(g-1)&&d[S].getWidth(g-1)===1,E=d[S+1].getWidth(0)===2;return C&&E?g-1:g}Object.defineProperty(c,"__esModule",{value:!0}),c.getWrappedLineTrimmedLength=c.reflowSmallerGetNewLineLengths=c.reflowLargerApplyNewLayout=c.reflowLargerCreateNewLayout=c.reflowLargerGetLinesToRemove=void 0,c.reflowLargerGetLinesToRemove=function(d,S,g,C,E){const A=[];for(let x=0;x<d.length-1;x++){let p=x,v=d.get(++p);if(!v.isWrapped)continue;const h=[d.get(x)];for(;p<d.length&&v.isWrapped;)h.push(v),v=d.get(++p);if(C>=x&&C<p){x+=h.length-1;continue}let b=0,T=u(h,b,S),R=1,L=0;for(;R<h.length;){const k=u(h,R,S),B=k-L,F=g-T,U=Math.min(B,F);h[b].copyCellsFrom(h[R],L,T,U,!1),T+=U,T===g&&(b++,T=0),L+=U,L===k&&(R++,L=0),T===0&&b!==0&&h[b-1].getWidth(g-1)===2&&(h[b].copyCellsFrom(h[b-1],g-1,T++,1,!1),h[b-1].setCell(g-1,E))}h[b].replaceCells(T,g,E);let M=0;for(let k=h.length-1;k>0&&(k>b||h[k].getTrimmedLength()===0);k--)M++;M>0&&(A.push(x+h.length-M),A.push(M)),x+=h.length-1}return A},c.reflowLargerCreateNewLayout=function(d,S){const g=[];let C=0,E=S[C],A=0;for(let x=0;x<d.length;x++)if(E===x){const p=S[++C];d.onDeleteEmitter.fire({index:x-A,amount:p}),x+=p-1,A+=p,E=S[++C]}else g.push(x);return{layout:g,countRemoved:A}},c.reflowLargerApplyNewLayout=function(d,S){const g=[];for(let C=0;C<S.length;C++)g.push(d.get(S[C]));for(let C=0;C<g.length;C++)d.set(C,g[C]);d.length=S.length},c.reflowSmallerGetNewLineLengths=function(d,S,g){const C=[],E=d.map(((v,h)=>u(d,h,S))).reduce(((v,h)=>v+h));let A=0,x=0,p=0;for(;p<E;){if(E-p<g){C.push(E-p);break}A+=g;const v=u(d,x,S);A>v&&(A-=v,x++);const h=d[x].getWidth(A-1)===2;h&&A--;const b=h?g-1:g;C.push(b),p+=b}return C},c.getWrappedLineTrimmedLength=u},5295:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferSet=void 0;const d=u(8460),S=u(844),g=u(9092);class C extends S.Disposable{constructor(A,x){super(),this._optionsService=A,this._bufferService=x,this._onBufferActivate=this.register(new d.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 g.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new g.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,x){this._normal.resize(A,x),this._alt.resize(A,x),this.setupTabStops(A)}setupTabStops(A){this._normal.setupTabStops(A),this._alt.setupTabStops(A)}}c.BufferSet=C},511:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CellData=void 0;const d=u(482),S=u(643),g=u(3734);class C extends g.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new g.ExtendedAttrs,this.combinedData=""}static fromCharData(A){const x=new C;return x.setFromCharData(A),x}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(A){this.fg=A[S.CHAR_DATA_ATTR_INDEX],this.bg=0;let x=!1;if(A[S.CHAR_DATA_CHAR_INDEX].length>2)x=!0;else if(A[S.CHAR_DATA_CHAR_INDEX].length===2){const p=A[S.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=p&&p<=56319){const v=A[S.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=v&&v<=57343?this.content=1024*(p-55296)+v-56320+65536|A[S.CHAR_DATA_WIDTH_INDEX]<<22:x=!0}else x=!0}else this.content=A[S.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|A[S.CHAR_DATA_WIDTH_INDEX]<<22;x&&(this.combinedData=A[S.CHAR_DATA_CHAR_INDEX],this.content=2097152|A[S.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.CellData=C},643:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WHITESPACE_CELL_CODE=c.WHITESPACE_CELL_WIDTH=c.WHITESPACE_CELL_CHAR=c.NULL_CELL_CODE=c.NULL_CELL_WIDTH=c.NULL_CELL_CHAR=c.CHAR_DATA_CODE_INDEX=c.CHAR_DATA_WIDTH_INDEX=c.CHAR_DATA_CHAR_INDEX=c.CHAR_DATA_ATTR_INDEX=c.DEFAULT_EXT=c.DEFAULT_ATTR=c.DEFAULT_COLOR=void 0,c.DEFAULT_COLOR=0,c.DEFAULT_ATTR=256|c.DEFAULT_COLOR<<9,c.DEFAULT_EXT=0,c.CHAR_DATA_ATTR_INDEX=0,c.CHAR_DATA_CHAR_INDEX=1,c.CHAR_DATA_WIDTH_INDEX=2,c.CHAR_DATA_CODE_INDEX=3,c.NULL_CELL_CHAR="",c.NULL_CELL_WIDTH=1,c.NULL_CELL_CODE=0,c.WHITESPACE_CELL_CHAR=" ",c.WHITESPACE_CELL_WIDTH=1,c.WHITESPACE_CELL_CODE=32},4863:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Marker=void 0;const d=u(8460),S=u(844);class g{get id(){return this._id}constructor(E){this.line=E,this.isDisposed=!1,this._disposables=[],this._id=g._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,S.disposeArray)(this._disposables),this._disposables.length=0)}register(E){return this._disposables.push(E),E}}c.Marker=g,g._nextId=1},7116:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DEFAULT_CHARSET=c.CHARSETS=void 0,c.CHARSETS={},c.DEFAULT_CHARSET=c.CHARSETS.B,c.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:"≥","{":"π","|":"≠","}":"£","~":"·"},c.CHARSETS.A={"#":"£"},c.CHARSETS.B=void 0,c.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},c.CHARSETS.C=c.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},c.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},c.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},c.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},c.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},c.CHARSETS.E=c.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},c.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},c.CHARSETS.H=c.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},c.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(_,c)=>{var u,d,S;Object.defineProperty(c,"__esModule",{value:!0}),c.C1_ESCAPED=c.C1=c.C0=void 0,(function(g){g.NUL="\0",g.SOH="",g.STX="",g.ETX="",g.EOT="",g.ENQ="",g.ACK="",g.BEL="\x07",g.BS="\b",g.HT=" ",g.LF=`
775
+ `,g.VT="\v",g.FF="\f",g.CR="\r",g.SO="",g.SI="",g.DLE="",g.DC1="",g.DC2="",g.DC3="",g.DC4="",g.NAK="",g.SYN="",g.ETB="",g.CAN="",g.EM="",g.SUB="",g.ESC="\x1B",g.FS="",g.GS="",g.RS="",g.US="",g.SP=" ",g.DEL=""})(u||(c.C0=u={})),(function(g){g.PAD="€",g.HOP="",g.BPH="‚",g.NBH="ƒ",g.IND="„",g.NEL="…",g.SSA="†",g.ESA="‡",g.HTS="ˆ",g.HTJ="‰",g.VTS="Š",g.PLD="‹",g.PLU="Œ",g.RI="",g.SS2="Ž",g.SS3="",g.DCS="",g.PU1="‘",g.PU2="’",g.STS="“",g.CCH="”",g.MW="•",g.SPA="–",g.EPA="—",g.SOS="˜",g.SGCI="™",g.SCI="š",g.CSI="›",g.ST="œ",g.OSC="",g.PM="ž",g.APC="Ÿ"})(d||(c.C1=d={})),(function(g){g.ST=`${u.ESC}\\`})(S||(c.C1_ESCAPED=S={}))},7399:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.evaluateKeyboardEvent=void 0;const d=u(2584),S={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:["'",'"']};c.evaluateKeyboardEvent=function(g,C,E,A){const x={type:0,cancel:!1,key:void 0},p=(g.shiftKey?1:0)|(g.altKey?2:0)|(g.ctrlKey?4:0)|(g.metaKey?8:0);switch(g.keyCode){case 0:g.key==="UIKeyInputUpArrow"?x.key=C?d.C0.ESC+"OA":d.C0.ESC+"[A":g.key==="UIKeyInputLeftArrow"?x.key=C?d.C0.ESC+"OD":d.C0.ESC+"[D":g.key==="UIKeyInputRightArrow"?x.key=C?d.C0.ESC+"OC":d.C0.ESC+"[C":g.key==="UIKeyInputDownArrow"&&(x.key=C?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:x.key=g.ctrlKey?"\b":d.C0.DEL,g.altKey&&(x.key=d.C0.ESC+x.key);break;case 9:if(g.shiftKey){x.key=d.C0.ESC+"[Z";break}x.key=d.C0.HT,x.cancel=!0;break;case 13:x.key=g.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,x.cancel=!0;break;case 27:x.key=d.C0.ESC,g.altKey&&(x.key=d.C0.ESC+d.C0.ESC),x.cancel=!0;break;case 37:if(g.metaKey)break;p?(x.key=d.C0.ESC+"[1;"+(p+1)+"D",x.key===d.C0.ESC+"[1;3D"&&(x.key=d.C0.ESC+(E?"b":"[1;5D"))):x.key=C?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(g.metaKey)break;p?(x.key=d.C0.ESC+"[1;"+(p+1)+"C",x.key===d.C0.ESC+"[1;3C"&&(x.key=d.C0.ESC+(E?"f":"[1;5C"))):x.key=C?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(g.metaKey)break;p?(x.key=d.C0.ESC+"[1;"+(p+1)+"A",E||x.key!==d.C0.ESC+"[1;3A"||(x.key=d.C0.ESC+"[1;5A")):x.key=C?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(g.metaKey)break;p?(x.key=d.C0.ESC+"[1;"+(p+1)+"B",E||x.key!==d.C0.ESC+"[1;3B"||(x.key=d.C0.ESC+"[1;5B")):x.key=C?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:g.shiftKey||g.ctrlKey||(x.key=d.C0.ESC+"[2~");break;case 46:x.key=p?d.C0.ESC+"[3;"+(p+1)+"~":d.C0.ESC+"[3~";break;case 36:x.key=p?d.C0.ESC+"[1;"+(p+1)+"H":C?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:x.key=p?d.C0.ESC+"[1;"+(p+1)+"F":C?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:g.shiftKey?x.type=2:g.ctrlKey?x.key=d.C0.ESC+"[5;"+(p+1)+"~":x.key=d.C0.ESC+"[5~";break;case 34:g.shiftKey?x.type=3:g.ctrlKey?x.key=d.C0.ESC+"[6;"+(p+1)+"~":x.key=d.C0.ESC+"[6~";break;case 112:x.key=p?d.C0.ESC+"[1;"+(p+1)+"P":d.C0.ESC+"OP";break;case 113:x.key=p?d.C0.ESC+"[1;"+(p+1)+"Q":d.C0.ESC+"OQ";break;case 114:x.key=p?d.C0.ESC+"[1;"+(p+1)+"R":d.C0.ESC+"OR";break;case 115:x.key=p?d.C0.ESC+"[1;"+(p+1)+"S":d.C0.ESC+"OS";break;case 116:x.key=p?d.C0.ESC+"[15;"+(p+1)+"~":d.C0.ESC+"[15~";break;case 117:x.key=p?d.C0.ESC+"[17;"+(p+1)+"~":d.C0.ESC+"[17~";break;case 118:x.key=p?d.C0.ESC+"[18;"+(p+1)+"~":d.C0.ESC+"[18~";break;case 119:x.key=p?d.C0.ESC+"[19;"+(p+1)+"~":d.C0.ESC+"[19~";break;case 120:x.key=p?d.C0.ESC+"[20;"+(p+1)+"~":d.C0.ESC+"[20~";break;case 121:x.key=p?d.C0.ESC+"[21;"+(p+1)+"~":d.C0.ESC+"[21~";break;case 122:x.key=p?d.C0.ESC+"[23;"+(p+1)+"~":d.C0.ESC+"[23~";break;case 123:x.key=p?d.C0.ESC+"[24;"+(p+1)+"~":d.C0.ESC+"[24~";break;default:if(!g.ctrlKey||g.shiftKey||g.altKey||g.metaKey)if(E&&!A||!g.altKey||g.metaKey)!E||g.altKey||g.ctrlKey||g.shiftKey||!g.metaKey?g.key&&!g.ctrlKey&&!g.altKey&&!g.metaKey&&g.keyCode>=48&&g.key.length===1?x.key=g.key:g.key&&g.ctrlKey&&(g.key==="_"&&(x.key=d.C0.US),g.key==="@"&&(x.key=d.C0.NUL)):g.keyCode===65&&(x.type=1);else{const v=S[g.keyCode],h=v?.[g.shiftKey?1:0];if(h)x.key=d.C0.ESC+h;else if(g.keyCode>=65&&g.keyCode<=90){const b=g.ctrlKey?g.keyCode-64:g.keyCode+32;let T=String.fromCharCode(b);g.shiftKey&&(T=T.toUpperCase()),x.key=d.C0.ESC+T}else if(g.keyCode===32)x.key=d.C0.ESC+(g.ctrlKey?d.C0.NUL:" ");else if(g.key==="Dead"&&g.code.startsWith("Key")){let b=g.code.slice(3,4);g.shiftKey||(b=b.toLowerCase()),x.key=d.C0.ESC+b,x.cancel=!0}}else g.keyCode>=65&&g.keyCode<=90?x.key=String.fromCharCode(g.keyCode-64):g.keyCode===32?x.key=d.C0.NUL:g.keyCode>=51&&g.keyCode<=55?x.key=String.fromCharCode(g.keyCode-51+27):g.keyCode===56?x.key=d.C0.DEL:g.keyCode===219?x.key=d.C0.ESC:g.keyCode===220?x.key=d.C0.FS:g.keyCode===221&&(x.key=d.C0.GS)}return x}},482:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Utf8ToUtf32=c.StringToUtf32=c.utf32ToString=c.stringFromCodePoint=void 0,c.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},c.utf32ToString=function(u,d=0,S=u.length){let g="";for(let C=d;C<S;++C){let E=u[C];E>65535?(E-=65536,g+=String.fromCharCode(55296+(E>>10))+String.fromCharCode(E%1024+56320)):g+=String.fromCharCode(E)}return g},c.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const S=u.length;if(!S)return 0;let g=0,C=0;if(this._interim){const E=u.charCodeAt(C++);56320<=E&&E<=57343?d[g++]=1024*(this._interim-55296)+E-56320+65536:(d[g++]=this._interim,d[g++]=E),this._interim=0}for(let E=C;E<S;++E){const A=u.charCodeAt(E);if(55296<=A&&A<=56319){if(++E>=S)return this._interim=A,g;const x=u.charCodeAt(E);56320<=x&&x<=57343?d[g++]=1024*(A-55296)+x-56320+65536:(d[g++]=A,d[g++]=x)}else A!==65279&&(d[g++]=A)}return g}},c.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,d){const S=u.length;if(!S)return 0;let g,C,E,A,x=0,p=0,v=0;if(this.interim[0]){let T=!1,R=this.interim[0];R&=(224&R)==192?31:(240&R)==224?15:7;let L,M=0;for(;(L=63&this.interim[++M])&&M<4;)R<<=6,R|=L;const k=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,B=k-M;for(;v<B;){if(v>=S)return 0;if(L=u[v++],(192&L)!=128){v--,T=!0;break}this.interim[M++]=L,R<<=6,R|=63&L}T||(k===2?R<128?v--:d[x++]=R:k===3?R<2048||R>=55296&&R<=57343||R===65279||(d[x++]=R):R<65536||R>1114111||(d[x++]=R)),this.interim.fill(0)}const h=S-4;let b=v;for(;b<S;){for(;!(!(b<h)||128&(g=u[b])||128&(C=u[b+1])||128&(E=u[b+2])||128&(A=u[b+3]));)d[x++]=g,d[x++]=C,d[x++]=E,d[x++]=A,b+=4;if(g=u[b++],g<128)d[x++]=g;else if((224&g)==192){if(b>=S)return this.interim[0]=g,x;if(C=u[b++],(192&C)!=128){b--;continue}if(p=(31&g)<<6|63&C,p<128){b--;continue}d[x++]=p}else if((240&g)==224){if(b>=S)return this.interim[0]=g,x;if(C=u[b++],(192&C)!=128){b--;continue}if(b>=S)return this.interim[0]=g,this.interim[1]=C,x;if(E=u[b++],(192&E)!=128){b--;continue}if(p=(15&g)<<12|(63&C)<<6|63&E,p<2048||p>=55296&&p<=57343||p===65279)continue;d[x++]=p}else if((248&g)==240){if(b>=S)return this.interim[0]=g,x;if(C=u[b++],(192&C)!=128){b--;continue}if(b>=S)return this.interim[0]=g,this.interim[1]=C,x;if(E=u[b++],(192&E)!=128){b--;continue}if(b>=S)return this.interim[0]=g,this.interim[1]=C,this.interim[2]=E,x;if(A=u[b++],(192&A)!=128){b--;continue}if(p=(7&g)<<18|(63&C)<<12|(63&E)<<6|63&A,p<65536||p>1114111)continue;d[x++]=p}}return x}}},225:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const d=u(1480),S=[[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]],g=[[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 C;c.UnicodeV6=class{constructor(){if(this.version="6",!C){C=new Uint8Array(65536),C.fill(1),C[0]=0,C.fill(0,1,32),C.fill(0,127,160),C.fill(2,4352,4448),C[9001]=2,C[9002]=2,C.fill(2,11904,42192),C[12351]=1,C.fill(2,44032,55204),C.fill(2,63744,64256),C.fill(2,65040,65050),C.fill(2,65072,65136),C.fill(2,65280,65377),C.fill(2,65504,65511);for(let E=0;E<S.length;++E)C.fill(0,S[E][0],S[E][1]+1)}}wcwidth(E){return E<32?0:E<127?1:E<65536?C[E]:(function(A,x){let p,v=0,h=x.length-1;if(A<x[0][0]||A>x[h][1])return!1;for(;h>=v;)if(p=v+h>>1,A>x[p][1])v=p+1;else{if(!(A<x[p][0]))return!0;h=p-1}return!1})(E,g)?0:E>=131072&&E<=196605||E>=196608&&E<=262141?2:1}charProperties(E,A){let x=this.wcwidth(E),p=x===0&&A!==0;if(p){const v=d.UnicodeService.extractWidth(A);v===0?p=!1:v>x&&(x=v)}return d.UnicodeService.createPropertyValue(0,x,p)}}},5981:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WriteBuffer=void 0;const d=u(8460),S=u(844);class g extends S.Disposable{constructor(E){super(),this._action=E,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(E,A){if(A!==void 0&&this._syncCalls>A)return void(this._syncCalls=0);if(this._pendingData+=E.length,this._writeBuffer.push(E),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let x;for(this._isSyncWriting=!0;x=this._writeBuffer.shift();){this._action(x);const p=this._callbacks.shift();p&&p()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(E,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+=E.length,this._writeBuffer.push(E),this._callbacks.push(A),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=E.length,this._writeBuffer.push(E),this._callbacks.push(A)}_innerWrite(E=0,A=!0){const x=E||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const p=this._writeBuffer[this._bufferOffset],v=this._action(p,A);if(v){const b=T=>Date.now()-x>=12?setTimeout((()=>this._innerWrite(0,T))):this._innerWrite(x,T);return void v.catch((T=>(queueMicrotask((()=>{throw T})),Promise.resolve(!1)))).then(b)}const h=this._callbacks[this._bufferOffset];if(h&&h(),this._bufferOffset++,this._pendingData-=p.length,Date.now()-x>=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()}}c.WriteBuffer=g},5941:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.toRgbString=c.parseColor=void 0;const u=/^([\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})$/,d=/^[\da-f]+$/;function S(g,C){const E=g.toString(16),A=E.length<2?"0"+E:E;switch(C){case 4:return E[0];case 8:return A;case 12:return(A+A).slice(0,3);default:return A+A}}c.parseColor=function(g){if(!g)return;let C=g.toLowerCase();if(C.indexOf("rgb:")===0){C=C.slice(4);const E=u.exec(C);if(E){const A=E[1]?15:E[4]?255:E[7]?4095:65535;return[Math.round(parseInt(E[1]||E[4]||E[7]||E[10],16)/A*255),Math.round(parseInt(E[2]||E[5]||E[8]||E[11],16)/A*255),Math.round(parseInt(E[3]||E[6]||E[9]||E[12],16)/A*255)]}}else if(C.indexOf("#")===0&&(C=C.slice(1),d.exec(C)&&[3,6,9,12].includes(C.length))){const E=C.length/3,A=[0,0,0];for(let x=0;x<3;++x){const p=parseInt(C.slice(E*x,E*x+E),16);A[x]=E===1?p<<4:E===2?p:E===3?p>>4:p>>8}return A}},c.toRgbString=function(g,C=16){const[E,A,x]=g;return`rgb:${S(E,C)}/${S(A,C)}/${S(x,C)}`}},5770:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.PAYLOAD_LIMIT=void 0,c.PAYLOAD_LIMIT=1e7},6351:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DcsHandler=c.DcsParser=void 0;const d=u(482),S=u(8742),g=u(5770),C=[];c.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=C,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=C}registerHandler(A,x){this._handlers[A]===void 0&&(this._handlers[A]=[]);const p=this._handlers[A];return p.push(x),{dispose:()=>{const v=p.indexOf(x);v!==-1&&p.splice(v,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=C,this._ident=0}hook(A,x){if(this.reset(),this._ident=A,this._active=this._handlers[A]||C,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].hook(x);else this._handlerFb(this._ident,"HOOK",x)}put(A,x,p){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(A,x,p);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(A,x,p))}unhook(A,x=!0){if(this._active.length){let p=!1,v=this._active.length-1,h=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,p=x,h=this._stack.fallThrough,this._stack.paused=!1),!h&&p===!1){for(;v>=0&&(p=this._active[v].unhook(A),p!==!0);v--)if(p instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,p;v--}for(;v>=0;v--)if(p=this._active[v].unhook(!1),p instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,p}else this._handlerFb(this._ident,"UNHOOK",A);this._active=C,this._ident=0}};const E=new S.Params;E.addParam(0),c.DcsHandler=class{constructor(A){this._handler=A,this._data="",this._params=E,this._hitLimit=!1}hook(A){this._params=A.length>1||A.params[0]?A.clone():E,this._data="",this._hitLimit=!1}put(A,x,p){this._hitLimit||(this._data+=(0,d.utf32ToString)(A,x,p),this._data.length>g.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(A){let x=!1;if(this._hitLimit)x=!1;else if(A&&(x=this._handler(this._data,this._params),x instanceof Promise))return x.then((p=>(this._params=E,this._data="",this._hitLimit=!1,p)));return this._params=E,this._data="",this._hitLimit=!1,x}}},2015:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.EscapeSequenceParser=c.VT500_TRANSITION_TABLE=c.TransitionTable=void 0;const d=u(844),S=u(8742),g=u(6242),C=u(6351);class E{constructor(v){this.table=new Uint8Array(v)}setDefault(v,h){this.table.fill(v<<4|h)}add(v,h,b,T){this.table[h<<8|v]=b<<4|T}addMany(v,h,b,T){for(let R=0;R<v.length;R++)this.table[h<<8|v[R]]=b<<4|T}}c.TransitionTable=E;const A=160;c.VT500_TRANSITION_TABLE=(function(){const p=new E(4095),v=Array.apply(null,Array(256)).map(((M,k)=>k)),h=(M,k)=>v.slice(M,k),b=h(32,127),T=h(0,24);T.push(25),T.push.apply(T,h(28,32));const R=h(0,14);let L;for(L in p.setDefault(1,0),p.addMany(b,0,2,0),R)p.addMany([24,26,153,154],L,3,0),p.addMany(h(128,144),L,3,0),p.addMany(h(144,152),L,3,0),p.add(156,L,0,0),p.add(27,L,11,1),p.add(157,L,4,8),p.addMany([152,158,159],L,0,7),p.add(155,L,11,3),p.add(144,L,11,9);return p.addMany(T,0,3,0),p.addMany(T,1,3,1),p.add(127,1,0,1),p.addMany(T,8,0,8),p.addMany(T,3,3,3),p.add(127,3,0,3),p.addMany(T,4,3,4),p.add(127,4,0,4),p.addMany(T,6,3,6),p.addMany(T,5,3,5),p.add(127,5,0,5),p.addMany(T,2,3,2),p.add(127,2,0,2),p.add(93,1,4,8),p.addMany(b,8,5,8),p.add(127,8,5,8),p.addMany([156,27,24,26,7],8,6,0),p.addMany(h(28,32),8,0,8),p.addMany([88,94,95],1,0,7),p.addMany(b,7,0,7),p.addMany(T,7,0,7),p.add(156,7,0,0),p.add(127,7,0,7),p.add(91,1,11,3),p.addMany(h(64,127),3,7,0),p.addMany(h(48,60),3,8,4),p.addMany([60,61,62,63],3,9,4),p.addMany(h(48,60),4,8,4),p.addMany(h(64,127),4,7,0),p.addMany([60,61,62,63],4,0,6),p.addMany(h(32,64),6,0,6),p.add(127,6,0,6),p.addMany(h(64,127),6,0,0),p.addMany(h(32,48),3,9,5),p.addMany(h(32,48),5,9,5),p.addMany(h(48,64),5,0,6),p.addMany(h(64,127),5,7,0),p.addMany(h(32,48),4,9,5),p.addMany(h(32,48),1,9,2),p.addMany(h(32,48),2,9,2),p.addMany(h(48,127),2,10,0),p.addMany(h(48,80),1,10,0),p.addMany(h(81,88),1,10,0),p.addMany([89,90,92],1,10,0),p.addMany(h(96,127),1,10,0),p.add(80,1,11,9),p.addMany(T,9,0,9),p.add(127,9,0,9),p.addMany(h(28,32),9,0,9),p.addMany(h(32,48),9,9,12),p.addMany(h(48,60),9,8,10),p.addMany([60,61,62,63],9,9,10),p.addMany(T,11,0,11),p.addMany(h(32,128),11,0,11),p.addMany(h(28,32),11,0,11),p.addMany(T,10,0,10),p.add(127,10,0,10),p.addMany(h(28,32),10,0,10),p.addMany(h(48,60),10,8,10),p.addMany([60,61,62,63],10,0,11),p.addMany(h(32,48),10,9,12),p.addMany(T,12,0,12),p.add(127,12,0,12),p.addMany(h(28,32),12,0,12),p.addMany(h(32,48),12,9,12),p.addMany(h(48,64),12,0,11),p.addMany(h(64,127),12,12,13),p.addMany(h(64,127),10,12,13),p.addMany(h(64,127),9,12,13),p.addMany(T,13,13,13),p.addMany(b,13,13,13),p.add(127,13,0,13),p.addMany([27,156,24,26],13,14,0),p.add(A,0,2,0),p.add(A,8,5,8),p.add(A,6,0,6),p.add(A,11,0,11),p.add(A,13,13,13),p})();class x extends d.Disposable{constructor(v=c.VT500_TRANSITION_TABLE){super(),this._transitions=v,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new S.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(h,b,T)=>{},this._executeHandlerFb=h=>{},this._csiHandlerFb=(h,b)=>{},this._escHandlerFb=h=>{},this._errorHandlerFb=h=>h,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new g.OscParser),this._dcsParser=this.register(new C.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(v,h=[64,126]){let b=0;if(v.prefix){if(v.prefix.length>1)throw new Error("only one byte as prefix supported");if(b=v.prefix.charCodeAt(0),b&&60>b||b>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(v.intermediates){if(v.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let R=0;R<v.intermediates.length;++R){const L=v.intermediates.charCodeAt(R);if(32>L||L>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");b<<=8,b|=L}}if(v.final.length!==1)throw new Error("final must be a single byte");const T=v.final.charCodeAt(0);if(h[0]>T||T>h[1])throw new Error(`final must be in range ${h[0]} .. ${h[1]}`);return b<<=8,b|=T,b}identToString(v){const h=[];for(;v;)h.push(String.fromCharCode(255&v)),v>>=8;return h.reverse().join("")}setPrintHandler(v){this._printHandler=v}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(v,h){const b=this._identifier(v,[48,126]);this._escHandlers[b]===void 0&&(this._escHandlers[b]=[]);const T=this._escHandlers[b];return T.push(h),{dispose:()=>{const R=T.indexOf(h);R!==-1&&T.splice(R,1)}}}clearEscHandler(v){this._escHandlers[this._identifier(v,[48,126])]&&delete this._escHandlers[this._identifier(v,[48,126])]}setEscHandlerFallback(v){this._escHandlerFb=v}setExecuteHandler(v,h){this._executeHandlers[v.charCodeAt(0)]=h}clearExecuteHandler(v){this._executeHandlers[v.charCodeAt(0)]&&delete this._executeHandlers[v.charCodeAt(0)]}setExecuteHandlerFallback(v){this._executeHandlerFb=v}registerCsiHandler(v,h){const b=this._identifier(v);this._csiHandlers[b]===void 0&&(this._csiHandlers[b]=[]);const T=this._csiHandlers[b];return T.push(h),{dispose:()=>{const R=T.indexOf(h);R!==-1&&T.splice(R,1)}}}clearCsiHandler(v){this._csiHandlers[this._identifier(v)]&&delete this._csiHandlers[this._identifier(v)]}setCsiHandlerFallback(v){this._csiHandlerFb=v}registerDcsHandler(v,h){return this._dcsParser.registerHandler(this._identifier(v),h)}clearDcsHandler(v){this._dcsParser.clearHandler(this._identifier(v))}setDcsHandlerFallback(v){this._dcsParser.setHandlerFallback(v)}registerOscHandler(v,h){return this._oscParser.registerHandler(v,h)}clearOscHandler(v){this._oscParser.clearHandler(v)}setOscHandlerFallback(v){this._oscParser.setHandlerFallback(v)}setErrorHandler(v){this._errorHandler=v}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(v,h,b,T,R){this._parseStack.state=v,this._parseStack.handlers=h,this._parseStack.handlerPos=b,this._parseStack.transition=T,this._parseStack.chunkPos=R}parse(v,h,b){let T,R=0,L=0,M=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,M=this._parseStack.chunkPos+1;else{if(b===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const k=this._parseStack.handlers;let B=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(b===!1&&B>-1){for(;B>=0&&(T=k[B](this._params),T!==!0);B--)if(T instanceof Promise)return this._parseStack.handlerPos=B,T}this._parseStack.handlers=[];break;case 4:if(b===!1&&B>-1){for(;B>=0&&(T=k[B](),T!==!0);B--)if(T instanceof Promise)return this._parseStack.handlerPos=B,T}this._parseStack.handlers=[];break;case 6:if(R=v[this._parseStack.chunkPos],T=this._dcsParser.unhook(R!==24&&R!==26,b),T)return T;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(R=v[this._parseStack.chunkPos],T=this._oscParser.end(R!==24&&R!==26,b),T)return T;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,M=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let k=M;k<h;++k){switch(R=v[k],L=this._transitions.table[this.currentState<<8|(R<160?R:A)],L>>4){case 2:for(let j=k+1;;++j){if(j>=h||(R=v[j])<32||R>126&&R<A){this._printHandler(v,k,j),k=j-1;break}if(++j>=h||(R=v[j])<32||R>126&&R<A){this._printHandler(v,k,j),k=j-1;break}if(++j>=h||(R=v[j])<32||R>126&&R<A){this._printHandler(v,k,j),k=j-1;break}if(++j>=h||(R=v[j])<32||R>126&&R<A){this._printHandler(v,k,j),k=j-1;break}}break;case 3:this._executeHandlers[R]?this._executeHandlers[R]():this._executeHandlerFb(R),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:k,code:R,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const B=this._csiHandlers[this._collect<<8|R];let F=B?B.length-1:-1;for(;F>=0&&(T=B[F](this._params),T!==!0);F--)if(T instanceof Promise)return this._preserveStack(3,B,F,L,k),T;F<0&&this._csiHandlerFb(this._collect<<8|R,this._params),this.precedingJoinState=0;break;case 8:do switch(R){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(R-48)}while(++k<h&&(R=v[k])>47&&R<60);k--;break;case 9:this._collect<<=8,this._collect|=R;break;case 10:const U=this._escHandlers[this._collect<<8|R];let W=U?U.length-1:-1;for(;W>=0&&(T=U[W](),T!==!0);W--)if(T instanceof Promise)return this._preserveStack(4,U,W,L,k),T;W<0&&this._escHandlerFb(this._collect<<8|R),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|R,this._params);break;case 13:for(let j=k+1;;++j)if(j>=h||(R=v[j])===24||R===26||R===27||R>127&&R<A){this._dcsParser.put(v,k,j),k=j-1;break}break;case 14:if(T=this._dcsParser.unhook(R!==24&&R!==26),T)return this._preserveStack(6,[],0,L,k),T;R===27&&(L|=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 j=k+1;;j++)if(j>=h||(R=v[j])<32||R>127&&R<A){this._oscParser.put(v,k,j),k=j-1;break}break;case 6:if(T=this._oscParser.end(R!==24&&R!==26),T)return this._preserveStack(5,[],0,L,k),T;R===27&&(L|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&L}}}c.EscapeSequenceParser=x},6242:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OscHandler=c.OscParser=void 0;const d=u(5770),S=u(482),g=[];c.OscParser=class{constructor(){this._state=0,this._active=g,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(C,E){this._handlers[C]===void 0&&(this._handlers[C]=[]);const A=this._handlers[C];return A.push(E),{dispose:()=>{const x=A.indexOf(E);x!==-1&&A.splice(x,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}reset(){if(this._state===2)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].end(!1);this._stack.paused=!1,this._active=g,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||g,this._active.length)for(let C=this._active.length-1;C>=0;C--)this._active[C].start();else this._handlerFb(this._id,"START")}_put(C,E,A){if(this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].put(C,E,A);else this._handlerFb(this._id,"PUT",(0,S.utf32ToString)(C,E,A))}start(){this.reset(),this._state=1}put(C,E,A){if(this._state!==3){if(this._state===1)for(;E<A;){const x=C[E++];if(x===59){this._state=2,this._start();break}if(x<48||57<x)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+x-48}this._state===2&&A-E>0&&this._put(C,E,A)}}end(C,E=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let A=!1,x=this._active.length-1,p=!1;if(this._stack.paused&&(x=this._stack.loopPosition-1,A=E,p=this._stack.fallThrough,this._stack.paused=!1),!p&&A===!1){for(;x>=0&&(A=this._active[x].end(C),A!==!0);x--)if(A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!1,A;x--}for(;x>=0;x--)if(A=this._active[x].end(!1),A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!0,A}else this._handlerFb(this._id,"END",C);this._active=g,this._id=-1,this._state=0}}},c.OscHandler=class{constructor(C){this._handler=C,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(C,E,A){this._hitLimit||(this._data+=(0,S.utf32ToString)(C,E,A),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(C){let E=!1;if(this._hitLimit)E=!1;else if(C&&(E=this._handler(this._data),E instanceof Promise))return E.then((A=>(this._data="",this._hitLimit=!1,A)));return this._data="",this._hitLimit=!1,E}}},8742:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Params=void 0;const u=2147483647;class d{static fromArray(g){const C=new d;if(!g.length)return C;for(let E=Array.isArray(g[0])?1:0;E<g.length;++E){const A=g[E];if(Array.isArray(A))for(let x=0;x<A.length;++x)C.addSubParam(A[x]);else C.addParam(A)}return C}constructor(g=32,C=32){if(this.maxLength=g,this.maxSubParamsLength=C,C>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(g),this.length=0,this._subParams=new Int32Array(C),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(g),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const g=new d(this.maxLength,this.maxSubParamsLength);return g.params.set(this.params),g.length=this.length,g._subParams.set(this._subParams),g._subParamsLength=this._subParamsLength,g._subParamsIdx.set(this._subParamsIdx),g._rejectDigits=this._rejectDigits,g._rejectSubDigits=this._rejectSubDigits,g._digitIsSub=this._digitIsSub,g}toArray(){const g=[];for(let C=0;C<this.length;++C){g.push(this.params[C]);const E=this._subParamsIdx[C]>>8,A=255&this._subParamsIdx[C];A-E>0&&g.push(Array.prototype.slice.call(this._subParams,E,A))}return g}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(g){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(g<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=g>u?u:g}}addSubParam(g){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(g<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=g>u?u:g,this._subParamsIdx[this.length-1]++}}hasSubParams(g){return(255&this._subParamsIdx[g])-(this._subParamsIdx[g]>>8)>0}getSubParams(g){const C=this._subParamsIdx[g]>>8,E=255&this._subParamsIdx[g];return E-C>0?this._subParams.subarray(C,E):null}getSubParamsAll(){const g={};for(let C=0;C<this.length;++C){const E=this._subParamsIdx[C]>>8,A=255&this._subParamsIdx[C];A-E>0&&(g[C]=this._subParams.slice(E,A))}return g}addDigit(g){let C;if(this._rejectDigits||!(C=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const E=this._digitIsSub?this._subParams:this.params,A=E[C-1];E[C-1]=~A?Math.min(10*A+g,u):g}}c.Params=d},5741:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.AddonManager=void 0,c.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,d){const S={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(S),d.dispose=()=>this._wrappedAddonDispose(S),d.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let d=-1;for(let S=0;S<this._addons.length;S++)if(this._addons[S]===u){d=S;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(d,1)}}},8771:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferApiView=void 0;const d=u(3785),S=u(511);c.BufferApiView=class{constructor(g,C){this._buffer=g,this.type=C}init(g){return this._buffer=g,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(g){const C=this._buffer.lines.get(g);if(C)return new d.BufferLineApiView(C)}getNullCell(){return new S.CellData}}},3785:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLineApiView=void 0;const d=u(511);c.BufferLineApiView=class{constructor(S){this._line=S}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(S,g){if(!(S<0||S>=this._line.length))return g?(this._line.loadCell(S,g),g):this._line.loadCell(S,new d.CellData)}translateToString(S,g,C){return this._line.translateToString(S,g,C)}}},8285:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferNamespaceApi=void 0;const d=u(8771),S=u(8460),g=u(844);class C extends g.Disposable{constructor(A){super(),this._core=A,this._onBufferChange=this.register(new S.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.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)}}c.BufferNamespaceApi=C},7975:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ParserApi=void 0,c.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,d){return this._core.registerCsiHandler(u,(S=>d(S.toArray())))}addCsiHandler(u,d){return this.registerCsiHandler(u,d)}registerDcsHandler(u,d){return this._core.registerDcsHandler(u,((S,g)=>d(S,g.toArray())))}addDcsHandler(u,d){return this.registerDcsHandler(u,d)}registerEscHandler(u,d){return this._core.registerEscHandler(u,d)}addEscHandler(u,d){return this.registerEscHandler(u,d)}registerOscHandler(u,d){return this._core.registerOscHandler(u,d)}addOscHandler(u,d){return this.registerOscHandler(u,d)}}},7090:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeApi=void 0,c.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(_,c,u){var d=this&&this.__decorate||function(p,v,h,b){var T,R=arguments.length,L=R<3?v:b===null?b=Object.getOwnPropertyDescriptor(v,h):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(p,v,h,b);else for(var M=p.length-1;M>=0;M--)(T=p[M])&&(L=(R<3?T(L):R>3?T(v,h,L):T(v,h))||L);return R>3&&L&&Object.defineProperty(v,h,L),L},S=this&&this.__param||function(p,v){return function(h,b){v(h,b,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferService=c.MINIMUM_ROWS=c.MINIMUM_COLS=void 0;const g=u(8460),C=u(844),E=u(5295),A=u(2585);c.MINIMUM_COLS=2,c.MINIMUM_ROWS=1;let x=c.BufferService=class extends C.Disposable{get buffer(){return this.buffers.active}constructor(p){super(),this.isUserScrolling=!1,this._onResize=this.register(new g.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new g.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(p.rawOptions.cols||0,c.MINIMUM_COLS),this.rows=Math.max(p.rawOptions.rows||0,c.MINIMUM_ROWS),this.buffers=this.register(new E.BufferSet(p,this))}resize(p,v){this.cols=p,this.rows=v,this.buffers.resize(p,v),this._onResize.fire({cols:p,rows:v})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(p,v=!1){const h=this.buffer;let b;b=this._cachedBlankLine,b&&b.length===this.cols&&b.getFg(0)===p.fg&&b.getBg(0)===p.bg||(b=h.getBlankLine(p,v),this._cachedBlankLine=b),b.isWrapped=v;const T=h.ybase+h.scrollTop,R=h.ybase+h.scrollBottom;if(h.scrollTop===0){const L=h.lines.isFull;R===h.lines.length-1?L?h.lines.recycle().copyFrom(b):h.lines.push(b.clone()):h.lines.splice(R+1,0,b.clone()),L?this.isUserScrolling&&(h.ydisp=Math.max(h.ydisp-1,0)):(h.ybase++,this.isUserScrolling||h.ydisp++)}else{const L=R-T+1;h.lines.shiftElements(T+1,L-1,-1),h.lines.set(R,b.clone())}this.isUserScrolling||(h.ydisp=h.ybase),this._onScroll.fire(h.ydisp)}scrollLines(p,v,h){const b=this.buffer;if(p<0){if(b.ydisp===0)return;this.isUserScrolling=!0}else p+b.ydisp>=b.ybase&&(this.isUserScrolling=!1);const T=b.ydisp;b.ydisp=Math.max(Math.min(b.ydisp+p,b.ybase),0),T!==b.ydisp&&(v||this._onScroll.fire(b.ydisp))}};c.BufferService=x=d([S(0,A.IOptionsService)],x)},7994:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CharsetService=void 0,c.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,d){this._charsets[u]=d,this.glevel===u&&(this.charset=d)}}},1753:function(_,c,u){var d=this&&this.__decorate||function(b,T,R,L){var M,k=arguments.length,B=k<3?T:L===null?L=Object.getOwnPropertyDescriptor(T,R):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(b,T,R,L);else for(var F=b.length-1;F>=0;F--)(M=b[F])&&(B=(k<3?M(B):k>3?M(T,R,B):M(T,R))||B);return k>3&&B&&Object.defineProperty(T,R,B),B},S=this&&this.__param||function(b,T){return function(R,L){T(R,L,b)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreMouseService=void 0;const g=u(2585),C=u(8460),E=u(844),A={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:b=>b.button!==4&&b.action===1&&(b.ctrl=!1,b.alt=!1,b.shift=!1,!0)},VT200:{events:19,restrict:b=>b.action!==32},DRAG:{events:23,restrict:b=>b.action!==32||b.button!==3},ANY:{events:31,restrict:b=>!0}};function x(b,T){let R=(b.ctrl?16:0)|(b.shift?4:0)|(b.alt?8:0);return b.button===4?(R|=64,R|=b.action):(R|=3&b.button,4&b.button&&(R|=64),8&b.button&&(R|=128),b.action===32?R|=32:b.action!==0||T||(R|=3)),R}const p=String.fromCharCode,v={DEFAULT:b=>{const T=[x(b,!1)+32,b.col+32,b.row+32];return T[0]>255||T[1]>255||T[2]>255?"":`\x1B[M${p(T[0])}${p(T[1])}${p(T[2])}`},SGR:b=>{const T=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${x(b,!0)};${b.col};${b.row}${T}`},SGR_PIXELS:b=>{const T=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${x(b,!0)};${b.x};${b.y}${T}`}};let h=c.CoreMouseService=class extends E.Disposable{constructor(b,T){super(),this._bufferService=b,this._coreService=T,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new C.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const R of Object.keys(A))this.addProtocol(R,A[R]);for(const R of Object.keys(v))this.addEncoding(R,v[R]);this.reset()}addProtocol(b,T){this._protocols[b]=T}addEncoding(b,T){this._encodings[b]=T}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(b){if(!this._protocols[b])throw new Error(`unknown protocol "${b}"`);this._activeProtocol=b,this._onProtocolChange.fire(this._protocols[b].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(b){if(!this._encodings[b])throw new Error(`unknown encoding "${b}"`);this._activeEncoding=b}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(b){if(b.col<0||b.col>=this._bufferService.cols||b.row<0||b.row>=this._bufferService.rows||b.button===4&&b.action===32||b.button===3&&b.action!==32||b.button!==4&&(b.action===2||b.action===3)||(b.col++,b.row++,b.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,b,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(b))return!1;const T=this._encodings[this._activeEncoding](b);return T&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(T):this._coreService.triggerDataEvent(T,!0)),this._lastEvent=b,!0}explainEvents(b){return{down:!!(1&b),up:!!(2&b),drag:!!(4&b),move:!!(8&b),wheel:!!(16&b)}}_equalEvents(b,T,R){if(R){if(b.x!==T.x||b.y!==T.y)return!1}else if(b.col!==T.col||b.row!==T.row)return!1;return b.button===T.button&&b.action===T.action&&b.ctrl===T.ctrl&&b.alt===T.alt&&b.shift===T.shift}};c.CoreMouseService=h=d([S(0,g.IBufferService),S(1,g.ICoreService)],h)},6975:function(_,c,u){var d=this&&this.__decorate||function(h,b,T,R){var L,M=arguments.length,k=M<3?b:R===null?R=Object.getOwnPropertyDescriptor(b,T):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(h,b,T,R);else for(var B=h.length-1;B>=0;B--)(L=h[B])&&(k=(M<3?L(k):M>3?L(b,T,k):L(b,T))||k);return M>3&&k&&Object.defineProperty(b,T,k),k},S=this&&this.__param||function(h,b){return function(T,R){b(T,R,h)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreService=void 0;const g=u(1439),C=u(8460),E=u(844),A=u(2585),x=Object.freeze({insertMode:!1}),p=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let v=c.CoreService=class extends E.Disposable{constructor(h,b,T){super(),this._bufferService=h,this._logService=b,this._optionsService=T,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new C.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new C.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new C.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new C.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,g.clone)(x),this.decPrivateModes=(0,g.clone)(p)}reset(){this.modes=(0,g.clone)(x),this.decPrivateModes=(0,g.clone)(p)}triggerDataEvent(h,b=!1){if(this._optionsService.rawOptions.disableStdin)return;const T=this._bufferService.buffer;b&&this._optionsService.rawOptions.scrollOnUserInput&&T.ybase!==T.ydisp&&this._onRequestScrollToBottom.fire(),b&&this._onUserInput.fire(),this._logService.debug(`sending data "${h}"`,(()=>h.split("").map((R=>R.charCodeAt(0))))),this._onData.fire(h)}triggerBinaryEvent(h){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${h}"`,(()=>h.split("").map((b=>b.charCodeAt(0))))),this._onBinary.fire(h))}};c.CoreService=v=d([S(0,A.IBufferService),S(1,A.ILogService),S(2,A.IOptionsService)],v)},9074:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DecorationService=void 0;const d=u(8055),S=u(8460),g=u(844),C=u(6106);let E=0,A=0;class x extends g.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new C.SortedList((h=>h?.marker.line)),this._onDecorationRegistered=this.register(new S.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new S.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,g.toDisposable)((()=>this.reset())))}registerDecoration(h){if(h.marker.isDisposed)return;const b=new p(h);if(b){const T=b.marker.onDispose((()=>b.dispose()));b.onDispose((()=>{b&&(this._decorations.delete(b)&&this._onDecorationRemoved.fire(b),T.dispose())})),this._decorations.insert(b),this._onDecorationRegistered.fire(b)}return b}reset(){for(const h of this._decorations.values())h.dispose();this._decorations.clear()}*getDecorationsAtCell(h,b,T){let R=0,L=0;for(const M of this._decorations.getKeyIterator(b))R=M.options.x??0,L=R+(M.options.width??1),h>=R&&h<L&&(!T||(M.options.layer??"bottom")===T)&&(yield M)}forEachDecorationAtCell(h,b,T,R){this._decorations.forEachByKey(b,(L=>{E=L.options.x??0,A=E+(L.options.width??1),h>=E&&h<A&&(!T||(L.options.layer??"bottom")===T)&&R(L)}))}}c.DecorationService=x;class p extends g.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(h){super(),this.options=h,this.onRenderEmitter=this.register(new S.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new S.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=h.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.InstantiationService=c.ServiceCollection=void 0;const d=u(2585),S=u(8343);class g{constructor(...E){this._entries=new Map;for(const[A,x]of E)this.set(A,x)}set(E,A){const x=this._entries.get(E);return this._entries.set(E,A),x}forEach(E){for(const[A,x]of this._entries.entries())E(A,x)}has(E){return this._entries.has(E)}get(E){return this._entries.get(E)}}c.ServiceCollection=g,c.InstantiationService=class{constructor(){this._services=new g,this._services.set(d.IInstantiationService,this)}setService(C,E){this._services.set(C,E)}getService(C){return this._services.get(C)}createInstance(C,...E){const A=(0,S.getServiceDependencies)(C).sort(((v,h)=>v.index-h.index)),x=[];for(const v of A){const h=this._services.get(v.id);if(!h)throw new Error(`[createInstance] ${C.name} depends on UNKNOWN service ${v.id}.`);x.push(h)}const p=A.length>0?A[0].index:E.length;if(E.length!==p)throw new Error(`[createInstance] First service dependency of ${C.name} at position ${p+1} conflicts with ${E.length} static arguments`);return new C(...E,...x)}}},7866:function(_,c,u){var d=this&&this.__decorate||function(p,v,h,b){var T,R=arguments.length,L=R<3?v:b===null?b=Object.getOwnPropertyDescriptor(v,h):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(p,v,h,b);else for(var M=p.length-1;M>=0;M--)(T=p[M])&&(L=(R<3?T(L):R>3?T(v,h,L):T(v,h))||L);return R>3&&L&&Object.defineProperty(v,h,L),L},S=this&&this.__param||function(p,v){return function(h,b){v(h,b,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.traceCall=c.setTraceLogger=c.LogService=void 0;const g=u(844),C=u(2585),E={trace:C.LogLevelEnum.TRACE,debug:C.LogLevelEnum.DEBUG,info:C.LogLevelEnum.INFO,warn:C.LogLevelEnum.WARN,error:C.LogLevelEnum.ERROR,off:C.LogLevelEnum.OFF};let A,x=c.LogService=class extends g.Disposable{get logLevel(){return this._logLevel}constructor(p){super(),this._optionsService=p,this._logLevel=C.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),A=this}_updateLogLevel(){this._logLevel=E[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(p){for(let v=0;v<p.length;v++)typeof p[v]=="function"&&(p[v]=p[v]())}_log(p,v,h){this._evalLazyOptionalParams(h),p.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+v,...h)}trace(p,...v){this._logLevel<=C.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,p,v)}debug(p,...v){this._logLevel<=C.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,p,v)}info(p,...v){this._logLevel<=C.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,p,v)}warn(p,...v){this._logLevel<=C.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,p,v)}error(p,...v){this._logLevel<=C.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,p,v)}};c.LogService=x=d([S(0,C.IOptionsService)],x),c.setTraceLogger=function(p){A=p},c.traceCall=function(p,v,h){if(typeof h.value!="function")throw new Error("not supported");const b=h.value;h.value=function(...T){if(A.logLevel!==C.LogLevelEnum.TRACE)return b.apply(this,T);A.trace(`GlyphRenderer#${b.name}(${T.map((L=>JSON.stringify(L))).join(", ")})`);const R=b.apply(this,T);return A.trace(`GlyphRenderer#${b.name} return`,R),R}}},7302:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OptionsService=c.DEFAULT_OPTIONS=void 0;const d=u(8460),S=u(844),g=u(6114);c.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:g.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const C=["normal","bold","100","200","300","400","500","600","700","800","900"];class E extends S.Disposable{constructor(x){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const p={...c.DEFAULT_OPTIONS};for(const v in x)if(v in p)try{const h=x[v];p[v]=this._sanitizeAndValidateOption(v,h)}catch(h){console.error(h)}this.rawOptions=p,this.options={...p},this._setupOptions(),this.register((0,S.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(x,p){return this.onOptionChange((v=>{v===x&&p(this.rawOptions[x])}))}onMultipleOptionChange(x,p){return this.onOptionChange((v=>{x.indexOf(v)!==-1&&p()}))}_setupOptions(){const x=v=>{if(!(v in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);return this.rawOptions[v]},p=(v,h)=>{if(!(v in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);h=this._sanitizeAndValidateOption(v,h),this.rawOptions[v]!==h&&(this.rawOptions[v]=h,this._onOptionChange.fire(v))};for(const v in this.rawOptions){const h={get:x.bind(this,v),set:p.bind(this,v)};Object.defineProperty(this.options,v,h)}}_sanitizeAndValidateOption(x,p){switch(x){case"cursorStyle":if(p||(p=c.DEFAULT_OPTIONS[x]),!(function(v){return v==="block"||v==="underline"||v==="bar"})(p))throw new Error(`"${p}" is not a valid value for ${x}`);break;case"wordSeparator":p||(p=c.DEFAULT_OPTIONS[x]);break;case"fontWeight":case"fontWeightBold":if(typeof p=="number"&&1<=p&&p<=1e3)break;p=C.includes(p)?p:c.DEFAULT_OPTIONS[x];break;case"cursorWidth":p=Math.floor(p);case"lineHeight":case"tabStopWidth":if(p<1)throw new Error(`${x} cannot be less than 1, value: ${p}`);break;case"minimumContrastRatio":p=Math.max(1,Math.min(21,Math.round(10*p)/10));break;case"scrollback":if((p=Math.min(p,4294967295))<0)throw new Error(`${x} cannot be less than 0, value: ${p}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(p<=0)throw new Error(`${x} cannot be less than or equal to 0, value: ${p}`);break;case"rows":case"cols":if(!p&&p!==0)throw new Error(`${x} must be numeric, value: ${p}`);break;case"windowsPty":p=p??{}}return p}}c.OptionsService=E},2660:function(_,c,u){var d=this&&this.__decorate||function(E,A,x,p){var v,h=arguments.length,b=h<3?A:p===null?p=Object.getOwnPropertyDescriptor(A,x):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(E,A,x,p);else for(var T=E.length-1;T>=0;T--)(v=E[T])&&(b=(h<3?v(b):h>3?v(A,x,b):v(A,x))||b);return h>3&&b&&Object.defineProperty(A,x,b),b},S=this&&this.__param||function(E,A){return function(x,p){A(x,p,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkService=void 0;const g=u(2585);let C=c.OscLinkService=class{constructor(E){this._bufferService=E,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(E){const A=this._bufferService.buffer;if(E.id===void 0){const T=A.addMarker(A.ybase+A.y),R={data:E,id:this._nextId++,lines:[T]};return T.onDispose((()=>this._removeMarkerFromLink(R,T))),this._dataByLinkId.set(R.id,R),R.id}const x=E,p=this._getEntryIdKey(x),v=this._entriesWithId.get(p);if(v)return this.addLineToLink(v.id,A.ybase+A.y),v.id;const h=A.addMarker(A.ybase+A.y),b={id:this._nextId++,key:this._getEntryIdKey(x),data:x,lines:[h]};return h.onDispose((()=>this._removeMarkerFromLink(b,h))),this._entriesWithId.set(b.key,b),this._dataByLinkId.set(b.id,b),b.id}addLineToLink(E,A){const x=this._dataByLinkId.get(E);if(x&&x.lines.every((p=>p.line!==A))){const p=this._bufferService.buffer.addMarker(A);x.lines.push(p),p.onDispose((()=>this._removeMarkerFromLink(x,p)))}}getLinkData(E){return this._dataByLinkId.get(E)?.data}_getEntryIdKey(E){return`${E.id};;${E.uri}`}_removeMarkerFromLink(E,A){const x=E.lines.indexOf(A);x!==-1&&(E.lines.splice(x,1),E.lines.length===0&&(E.data.id!==void 0&&this._entriesWithId.delete(E.key),this._dataByLinkId.delete(E.id)))}};c.OscLinkService=C=d([S(0,g.IBufferService)],C)},8343:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createDecorator=c.getServiceDependencies=c.serviceRegistry=void 0;const u="di$target",d="di$dependencies";c.serviceRegistry=new Map,c.getServiceDependencies=function(S){return S[d]||[]},c.createDecorator=function(S){if(c.serviceRegistry.has(S))return c.serviceRegistry.get(S);const g=function(C,E,A){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(x,p,v){p[u]===p?p[d].push({id:x,index:v}):(p[d]=[{id:x,index:v}],p[u]=p)})(g,C,A)};return g.toString=()=>S,c.serviceRegistry.set(S,g),g}},2585:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.IDecorationService=c.IUnicodeService=c.IOscLinkService=c.IOptionsService=c.ILogService=c.LogLevelEnum=c.IInstantiationService=c.ICharsetService=c.ICoreService=c.ICoreMouseService=c.IBufferService=void 0;const d=u(8343);var S;c.IBufferService=(0,d.createDecorator)("BufferService"),c.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),c.ICoreService=(0,d.createDecorator)("CoreService"),c.ICharsetService=(0,d.createDecorator)("CharsetService"),c.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(g){g[g.TRACE=0]="TRACE",g[g.DEBUG=1]="DEBUG",g[g.INFO=2]="INFO",g[g.WARN=3]="WARN",g[g.ERROR=4]="ERROR",g[g.OFF=5]="OFF"})(S||(c.LogLevelEnum=S={})),c.ILogService=(0,d.createDecorator)("LogService"),c.IOptionsService=(0,d.createDecorator)("OptionsService"),c.IOscLinkService=(0,d.createDecorator)("OscLinkService"),c.IUnicodeService=(0,d.createDecorator)("UnicodeService"),c.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const d=u(8460),S=u(225);class g{static extractShouldJoin(E){return(1&E)!=0}static extractWidth(E){return E>>1&3}static extractCharKind(E){return E>>3}static createPropertyValue(E,A,x=!1){return(16777215&E)<<3|(3&A)<<1|(x?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const E=new S.UnicodeV6;this.register(E),this._active=E.version,this._activeProvider=E}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(E){if(!this._providers[E])throw new Error(`unknown Unicode version "${E}"`);this._active=E,this._activeProvider=this._providers[E],this._onChange.fire(E)}register(E){this._providers[E.version]=E}wcwidth(E){return this._activeProvider.wcwidth(E)}getStringCellWidth(E){let A=0,x=0;const p=E.length;for(let v=0;v<p;++v){let h=E.charCodeAt(v);if(55296<=h&&h<=56319){if(++v>=p)return A+this.wcwidth(h);const R=E.charCodeAt(v);56320<=R&&R<=57343?h=1024*(h-55296)+R-56320+65536:A+=this.wcwidth(R)}const b=this.charProperties(h,x);let T=g.extractWidth(b);g.extractShouldJoin(b)&&(T-=g.extractWidth(x)),A+=T,x=b}return A}charProperties(E,A){return this._activeProvider.charProperties(E,A)}}c.UnicodeService=g}},a={};function o(_){var c=a[_];if(c!==void 0)return c.exports;var u=a[_]={exports:{}};return r[_].call(u.exports,u,u.exports,o),u.exports}var f={};return(()=>{var _=f;Object.defineProperty(_,"__esModule",{value:!0}),_.Terminal=void 0;const c=o(9042),u=o(3236),d=o(844),S=o(5741),g=o(8285),C=o(7975),E=o(7090),A=["cols","rows"];class x extends d.Disposable{constructor(v){super(),this._core=this.register(new u.Terminal(v)),this._addonManager=this.register(new S.AddonManager),this._publicOptions={...this._core.options};const h=T=>this._core.options[T],b=(T,R)=>{this._checkReadonlyOptions(T),this._core.options[T]=R};for(const T in this._core.options){const R={get:h.bind(this,T),set:b.bind(this,T)};Object.defineProperty(this._publicOptions,T,R)}}_checkReadonlyOptions(v){if(A.includes(v))throw new Error(`Option "${v}" 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 C.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new E.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 g.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const v=this._core.coreService.decPrivateModes;let h="none";switch(this._core.coreMouseService.activeProtocol){case"X10":h="x10";break;case"VT200":h="vt200";break;case"DRAG":h="drag";break;case"ANY":h="any"}return{applicationCursorKeysMode:v.applicationCursorKeys,applicationKeypadMode:v.applicationKeypad,bracketedPasteMode:v.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:h,originMode:v.origin,reverseWraparoundMode:v.reverseWraparound,sendFocusMode:v.sendFocus,wraparoundMode:v.wraparound}}get options(){return this._publicOptions}set options(v){for(const h in v)this._publicOptions[h]=v[h]}blur(){this._core.blur()}focus(){this._core.focus()}input(v,h=!0){this._core.input(v,h)}resize(v,h){this._verifyIntegers(v,h),this._core.resize(v,h)}open(v){this._core.open(v)}attachCustomKeyEventHandler(v){this._core.attachCustomKeyEventHandler(v)}attachCustomWheelEventHandler(v){this._core.attachCustomWheelEventHandler(v)}registerLinkProvider(v){return this._core.registerLinkProvider(v)}registerCharacterJoiner(v){return this._checkProposedApi(),this._core.registerCharacterJoiner(v)}deregisterCharacterJoiner(v){this._checkProposedApi(),this._core.deregisterCharacterJoiner(v)}registerMarker(v=0){return this._verifyIntegers(v),this._core.registerMarker(v)}registerDecoration(v){return this._checkProposedApi(),this._verifyPositiveIntegers(v.x??0,v.width??0,v.height??0),this._core.registerDecoration(v)}hasSelection(){return this._core.hasSelection()}select(v,h,b){this._verifyIntegers(v,h,b),this._core.select(v,h,b)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(v,h){this._verifyIntegers(v,h),this._core.selectLines(v,h)}dispose(){super.dispose()}scrollLines(v){this._verifyIntegers(v),this._core.scrollLines(v)}scrollPages(v){this._verifyIntegers(v),this._core.scrollPages(v)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(v){this._verifyIntegers(v),this._core.scrollToLine(v)}clear(){this._core.clear()}write(v,h){this._core.write(v,h)}writeln(v,h){this._core.write(v),this._core.write(`\r
776
+ `,h)}paste(v){this._core.paste(v)}refresh(v,h){this._verifyIntegers(v,h),this._core.refresh(v,h)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(v){this._addonManager.loadAddon(this,v)}static get strings(){return c}_verifyIntegers(...v){for(const h of v)if(h===1/0||isNaN(h)||h%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...v){for(const h of v)if(h&&(h===1/0||isNaN(h)||h%1!=0||h<0))throw new Error("This API only accepts positive integers")}}_.Terminal=x})(),f})()))})(Sp)),Sp.exports}var t7=e7();const Dy=250,n7=5e3,Oy=1,i7=4e3,r7=4001;function s7(e){const n=new AbortController,r=new TextEncoder;let a=Dy,o=null,f=null,_=null,c=!1;const u=()=>{f?.dispose(),f=null},d=(C,E)=>{_={cols:C,rows:E},o?.readyState===Oy&&o.send(JSON.stringify({type:"resize",cols:C,rows:E}))},S=async()=>{for(;!n.signal.aborted;){e.onStatus?.("connecting");try{const C=e.fetchTicket??_A,{ticket:E}=await C(e.sessionId,{kind:e.kind,theaterId:e.theaterId,signal:n.signal});if(n.signal.aborted)return;await g(a7(E,e.location),e),a=Dy}catch(C){if(n.signal.aborted)return;e.onStatus?.("connecting",C instanceof Error?C.message:String(C))}await l7(a,n.signal),a=Math.min(a*2,n7)}},g=async(C,E)=>{await new Promise((A,x)=>{const p=(E.webSocketFactory??o7)(C);o=p,p.binaryType="arraybuffer",p.onopen=()=>{E.onStatus?.("live"),u(),f=E.terminal.onData(v=>{p.readyState===Oy&&p.send(r.encode(v))}),_&&d(_.cols,_.rows)},p.onmessage=v=>{v.data instanceof ArrayBuffer&&E.terminal.write(new Uint8Array(v.data))},p.onerror=()=>{x(new Error("Terminal WebSocket error"))},p.onclose=v=>{u(),o===p&&(o=null);const h=v?.code;h===i7?n.abort():h===r7&&(n.abort(),E.onExit?.()),A()}})};return{start:()=>{c||(c=!0,S())},resize:d,dispose:()=>{n.abort(),u(),e.onStatus?.("closed"),o?.close(),o=null}}}function a7(e,n=window.location){return`${n.protocol==="https:"?"wss":"ws"}://${n.host}/terminal/ws?ticket=${encodeURIComponent(e)}`}function o7(e){return new WebSocket(e)}async function l7(e,n){await new Promise(r=>{const a=()=>{clearTimeout(o),n.removeEventListener("abort",a),r()},o=setTimeout(a,e);n.addEventListener("abort",a)})}const xx=14,c7={allowProposedApi:!0,convertEol:!0,cursorBlink:!0,cursorStyle:"block",fontFamily:'"Cascadia Code", "Cascadia Mono", "JetBrains Mono Variable", ui-monospace, "SF Mono", Menlo, monospace',fontSize:xx,lineHeight:1.2},u7=80,h7=120,d7={background:"oklch(23% 0.03 248)",foreground:"oklch(86% 0.018 90)",cursor:"oklch(82% 0.13 195)",selectionBackground:"oklch(78% 0.13 75 / 28%)",black:"oklch(18% 0.045 248)",brightBlack:"oklch(48% 0.03 248)",red:"oklch(72% 0.17 25)",green:"oklch(82% 0.13 195)",yellow:"oklch(86% 0.16 78)",blue:"oklch(70% 0.08 248)",magenta:"oklch(75% 0.11 320)",cyan:"oklch(82% 0.13 195)",white:"oklch(82% 0.018 90)",brightRed:"oklch(78% 0.18 25)",brightGreen:"oklch(88% 0.14 195)",brightYellow:"oklch(90% 0.16 78)",brightBlue:"oklch(78% 0.09 248)",brightMagenta:"oklch(82% 0.12 320)",brightCyan:"oklch(88% 0.14 195)",brightWhite:"oklch(96% 0.012 88)"},f7={background:"oklch(19% 0.008 252)",foreground:"oklch(85% 0.005 250)",cursor:"oklch(80% 0.105 205)",selectionBackground:"oklch(76% 0.115 62 / 28%)",black:"oklch(16% 0.008 252)",brightBlack:"oklch(46% 0.006 250)",red:"oklch(72% 0.17 25)",green:"oklch(80% 0.11 205)",yellow:"oklch(84% 0.14 64)",blue:"oklch(68% 0.05 250)",magenta:"oklch(75% 0.11 320)",cyan:"oklch(80% 0.11 205)",white:"oklch(81% 0.005 250)",brightRed:"oklch(78% 0.18 25)",brightGreen:"oklch(86% 0.13 205)",brightYellow:"oklch(88% 0.15 66)",brightBlue:"oklch(74% 0.06 250)",brightMagenta:"oklch(82% 0.12 320)",brightCyan:"oklch(86% 0.13 205)",brightWhite:"oklch(95% 0.003 250)"};function Ex({sessionId:e,kind:n,theaterId:r,onExit:a,active:o,zoom:f=1}){const{activeTheme:_,terminalRenderer:c}=Xl(),u=H.useRef(null),d=H.useRef(null),S=H.useRef(null),g=H.useRef(null),C=H.useRef(null),[E,A]=H.useState(f),x=H.useRef(a);x.current=a;const p=H.useRef(o);p.current=o;const[v,h]=H.useState("connecting");H.useEffect(()=>{const R=u.current;if(!R)return;let L=!1;const M=new t7.Terminal({...c7,theme:Ny(_)});d.current=M;const k=new gN.FitAddon;C.current=k,M.loadAddon(k),M.open(R),M.loadAddon(new vN.Unicode11Addon),M.unicode.activeVersion="11",M.attachCustomKeyEventHandler(q=>q.key==="Enter"&&q.shiftKey?(q.type==="keydown"&&M.input(`
777
+ `),!1):!0);const B=s7({sessionId:e,kind:n,theaterId:r,terminal:M,onExit:()=>x.current?.(),onStatus:(q,V)=>{h(V?`${q}: ${V}`:q)}});S.current=B;let F=null;const U=()=>{k.fit(),B.resize(M.cols,M.rows)},W=()=>{U(),M.refresh(0,M.rows-1)},j=()=>{F&&clearTimeout(F),F=setTimeout(()=>{F=null,L||W()},u7)},G=async()=>{await document.fonts?.ready,!L&&(U(),B.start(),p.current!==!1&&M.focus())},ee=new ResizeObserver(j);return ee.observe(R),G(),()=>{L=!0,ee.disconnect(),F&&clearTimeout(F),B.dispose(),d.current=null,S.current=null,C.current=null;try{M.dispose()}catch{}}},[n,e,r]),H.useEffect(()=>{o&&d.current?.focus()},[o]),H.useEffect(()=>{const R=d.current;if(!R)return;let L=!1;if(c==="webgl")try{const M=new Q8;g.current=M,M.onContextLoss(()=>{if(!L){try{M.dispose()}catch{}g.current===M&&(g.current=null)}}),R.loadAddon(M)}catch{try{g.current?.dispose()}catch{}g.current=null}return()=>{L=!0;const M=g.current;if(M){g.current=null;try{M.dispose()}catch{}}}},[c,n,e]),H.useEffect(()=>{const R=d.current;R&&(R.options.theme=Ny(_))},[_]),H.useEffect(()=>{if(f===E)return;const R=setTimeout(()=>A(f),h7);return()=>clearTimeout(R)},[f,E]),H.useEffect(()=>{const R=d.current,L=C.current;!R||!L||(R.options.fontSize=xx*E,L.fit(),R.refresh(0,R.rows-1))},[E]);const b=v.startsWith("live"),T=E===1?void 0:{width:`${E*100}%`,height:`${E*100}%`,transform:`scale(${1/E})`,transformOrigin:"0 0"};return y.jsx("section",{className:"terminal-stage","aria-label":n==="shell"?"Shell terminal":"Fleet terminal",children:y.jsxs("div",{className:"terminal-shell",children:[b?null:y.jsxs("div",{className:"terminal-status","aria-live":"polite",children:[y.jsx("span",{className:"terminal-status-dot","aria-hidden":"true"}),v]}),y.jsx("div",{className:"terminal-viewport",children:y.jsx("div",{className:"terminal-canvas",ref:u,style:T})})]})})}function Ny(e){return e==="carbon"?f7:d7}const p7=["n","ne","e","se","s","sw","w","nw"],wp=320,Cp=200;function Tx({geometry:e,zoom:n,onResize:r}){const a=H.useRef(null),o=(c,u)=>{u.preventDefault(),u.stopPropagation(),a.current={direction:c,pointerId:u.pointerId,startX:u.clientX,startY:u.clientY,geometry:e},u.currentTarget.setPointerCapture(u.pointerId)},f=c=>{const u=a.current;if(!u||u.pointerId!==c.pointerId)return;c.preventDefault(),c.stopPropagation();const d=(c.clientX-u.startX)/n,S=(c.clientY-u.startY)/n;r(g7(u.geometry,u.direction,d,S))},_=c=>{a.current?.pointerId===c.pointerId&&(c.preventDefault(),c.stopPropagation(),a.current=null,c.currentTarget.releasePointerCapture(c.pointerId))};return y.jsx(y.Fragment,{children:p7.map(c=>y.jsx("div",{className:`canvas-panel-resize canvas-panel-resize--${c}`,onPointerDown:u=>o(c,u),onPointerMove:f,onPointerUp:_,onPointerCancel:_,"data-canvas-blocker":!0,"aria-hidden":"true"},c))})}function g7(e,n,r,a){let{x:o,y:f,width:_,height:c}=e;return n.includes("e")&&(_+=r),n.includes("s")&&(c+=a),n.includes("w")&&(o+=r,_-=r),n.includes("n")&&(f+=a,c-=a),_<wp&&(n.includes("w")&&(o-=wp-_),_=wp),c<Cp&&(n.includes("n")&&(f-=Cp-c),c=Cp),{...e,x:o,y:f,width:_,height:c}}const Rg=new Set,By=96,m7=.25,_7=1;let Ki=null;function v7(){return H.useSyncExternalStore(E7,Lg,Lg)}function Lg(){return Ki}function b7(e){Ki!==e&&(Ki=e,Ax())}function ni(){Ki!==null&&(Ki=null,Ax())}function Mg(e){return{kind:"operation",id:e,createdAt:0}}function Dg(e){return{kind:"shell",id:e,createdAt:0}}function xh(e){const n=Op(),r=e.filter(o=>n.panels[o]).map(o=>({kind:"operation",id:o,createdAt:n.panelCreatedAt[o]??0})),a=Object.entries(KS()).map(([o,f])=>({kind:"shell",id:o,createdAt:f.createdAt}));return[...r,...a].sort((o,f)=>o.createdAt-f.createdAt||o.id.localeCompare(f.id))}function y7(e,n,r){if(e.length===0)return null;const a=e.findIndex(o=>o.id===n);return a===-1?(r>=0?e[0]:e[e.length-1])??null:e[(a+r+e.length)%e.length]??null}function no(e,n){if(e.kind==="operation"){ei(e.id),bS(e.id,n);return}const r=KS()[e.id];if(!r)return;VS(e.id),ei(null),ho(e.id);const a=Es();Ou(e.id,{...r.geometry,zIndex:a}),mS(T7(r.geometry,n))}function S7(e,n,r){if(Ki!==null){Em(e,n);return}no(e,r)}function xm(e){if(Ki===e.id&&ni(),e.kind==="operation"){AT(e.id);return}QA(e.id)}function w7(e){if(ni(),e.kind==="operation"){kT(e.id),ei(e.id);return}VS(e.id),ei(null),ho(e.id)}function Em(e,n){for(const r of n)r.id!==e.id&&xm(r);w7(e),b7(e.id)}function C7(e){if(e.kind==="operation"){Vu(e.id).then(()=>Yg(e.id)).catch(n=>Yu(n instanceof Error?n.message:String(n))),Ki===e.id&&ni();return}Fp(e.id),Vu(e.id).catch(n=>{Yu(n instanceof Error?n.message:String(n))}),Ki===e.id&&ni()}function x7(e,n){return!n.operationSessionsHydrated||!n.theaterReady||Ki===null||xh(e).some(r=>r.id===Ki)?!1:(ni(),!0)}function E7(e){return Rg.add(e),()=>{Rg.delete(e)}}function Ax(){for(const e of Rg)e()}function T7(e,n){const r=Math.max(m7,Math.min(_7,Math.min((n.width-By)/e.width,(n.height-By)/e.height)));return{x:n.width/2-(e.x+e.width/2)*r,y:n.height/2-(e.y+e.height/2)*r,zoom:r}}function Iy({state:e,session:n,geometry:r,viewport:a,active:o,maximized:f=!1,onFocusRequest:_,onMaximize:c}){const u=H.useRef(null),[d,S]=H.useState(!1),[g,C]=H.useState(""),E=H.useRef(null),A=H.useRef(!1),x=H.useRef(!1),v=pw(e,n).filter(({job:I})=>!Gg(I.status)).map(({job:I})=>I),h=v.length,b=n.status==="dormant",T=fh(n),R=e.operationNotifications[n.sessionId]?.kind==="input-waiting",L=b?null:R?"awaiting":h>0?"live":n.turnState==="running"?"turn":null,M=()=>{ei(n.sessionId),f||Nl(n.sessionId,r)},k=I=>{o||ei(n.sessionId),dw(I)},B=I=>{I.button===0&&(f||(I.preventDefault(),I.stopPropagation(),M(),u.current={pointerId:I.pointerId,startX:I.clientX,startY:I.clientY,geometry:r},I.currentTarget.setPointerCapture(I.pointerId)))},F=I=>{const N=u.current;!N||N.pointerId!==I.pointerId||(I.preventDefault(),I.stopPropagation(),Nl(n.sessionId,{...N.geometry,x:N.geometry.x+(I.clientX-N.startX)/a.zoom,y:N.geometry.y+(I.clientY-N.startY)/a.zoom}))},U=I=>{u.current?.pointerId===I.pointerId&&(I.preventDefault(),I.stopPropagation(),u.current=null,I.currentTarget.releasePointerCapture(I.pointerId))},W=I=>{I.stopPropagation()};H.useEffect(()=>{d&&(E.current?.focus(),E.current?.select())},[d]);const j=()=>{M(),x.current=!1,C(T),S(!0)},G=()=>{x.current=!0,S(!1),C("")},ee=async()=>{if(!A.current){A.current=!0;try{gh(await gA(n.sessionId,g))}catch(I){Rk(I instanceof Error?I.message:String(I))}finally{A.current=!1,x.current=!0,S(!1)}}},q=I=>{if(I.key==="Enter"){I.preventDefault(),ee();return}I.key==="Escape"&&(I.preventDefault(),G())},V=I=>{I.stopPropagation(),M()},Y=I=>{I.stopPropagation(),M()},D=I=>{I.stopPropagation()};return y.jsxs(y.Fragment,{children:[y.jsxs("article",{className:`canvas-panel ${o?"is-active":""} ${L?`is-running is-running--${L}`:""}`,style:{left:r.x,top:r.y,width:r.width,height:r.height,zIndex:r.zIndex},onPointerDown:M,"data-canvas-panel":!0,"aria-label":`Operation ${T}`,children:[y.jsxs("div",{className:"canvas-panel-titlebar",onPointerDown:B,onPointerMove:F,onPointerUp:U,onPointerCancel:U,onDoubleClick:_,"data-canvas-blocker":!0,children:[y.jsx("span",{className:qS(n,h),"aria-hidden":"true"}),d?y.jsx("input",{ref:E,className:"canvas-panel-rename-input",value:g,"aria-label":`${T} 이름 변경`,onPointerDown:I=>I.stopPropagation(),onChange:I=>C(I.target.value),onKeyDown:q,onBlur:()=>{if(x.current){x.current=!1;return}ee()}}):y.jsx("span",{className:"canvas-panel-title",onPointerDown:V,onDoubleClick:I=>{I.stopPropagation(),j()},title:"Double-click to rename",children:T}),y.jsx("span",{className:"canvas-panel-cli",children:n.cliLabel??n.cliId??"CLI"}),h>0?y.jsx("span",{className:"canvas-panel-job-count",children:h}):null,y.jsx("button",{type:"button",className:"canvas-panel-icon-button",onPointerDown:W,onClick:()=>{xm(Mg(n.sessionId))},"aria-label":`Minimize operation ${T}`,title:"Minimize panel",children:y.jsx(R7,{})}),y.jsx("button",{type:"button",className:`canvas-panel-icon-button ${f?"is-active":""}`,onPointerDown:W,onClick:c,"aria-label":f?`Restore operation ${T}`:`Maximize operation ${T}`,title:f?"Restore panel":"Maximize panel",children:y.jsx(L7,{})}),y.jsx("button",{type:"button",className:"canvas-panel-icon-button",onPointerDown:W,onClick:()=>{f&&ni(),k7(n.sessionId)},"aria-label":`${b?"Forget":"Terminate"} operation ${T}`,title:b?"Forget operation":"Terminate operation",children:y.jsx(M7,{})})]}),y.jsx("div",{className:"canvas-panel-terminal",onPointerDown:Y,onWheel:D,"data-canvas-blocker":!0,children:b?y.jsxs("button",{type:"button",className:"canvas-panel-dormant",onClick:()=>{A7(n.sessionId)},children:[y.jsx("span",{className:"canvas-panel-dormant-status",children:"Dormant"}),y.jsx("span",{className:"canvas-panel-dormant-action",children:"Resume"})]}):y.jsx(Ex,{sessionId:n.sessionId,active:o,zoom:a.zoom,onExit:()=>{f&&ni(),Yg(n.sessionId)}})}),y.jsx(Tx,{geometry:r,zoom:a.zoom,onResize:I=>Nl(n.sessionId,I)})]}),v.length>0?y.jsx("div",{className:"canvas-panel-jobdock",style:{left:r.x,top:r.y+r.height,width:r.width,zIndex:r.zIndex},"data-canvas-blocker":!0,"aria-label":`Active carrier jobs for ${T}`,children:y.jsx(dN,{jobs:v,selectedJobId:e.selectedJobId,onSelect:k})}):null]})}async function A7(e){try{const n=await jS(e);gh(n),ei(n.sessionId)}catch(n){hw(n instanceof Error?n.message:String(n))}}async function k7(e){try{await Vu(e)}catch(n){Yu(n instanceof Error?n.message:String(n));return}Yg(e)}function R7(){return y.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:y.jsx("path",{d:"M3.5 11.5h9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function L7(){return y.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:y.jsx("path",{d:"M4.2 4.2h7.6v7.6H4.2z",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinejoin:"round"})})}function M7(){return y.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:y.jsx("path",{d:"M4.6 4.6 11.4 11.4M11.4 4.6 4.6 11.4",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round"})})}const D7={overflow:!1,atStart:!1,atEnd:!0,page:1,pages:1};function O7({state:e,sessions:n,canvasSize:r}){const a=H.useRef(null),o=H.useRef(!0),[f,_]=H.useState(D7),c=GS(),u=new Map(n.map(v=>[v.sessionId,v])),d=n.map(v=>v.sessionId),S=xh(d),g=S.map(v=>{const h=u.get(v.id);if(!h)return{handle:v,label:"Shell",meta:"shell",beaconClassName:"tenant-beacon is-live",activeJobCount:0,underway:null,active:c===v.id};const b=pw(e,h).filter(({job:R})=>!Gg(R.status)).length,T=h.status==="dormant"?null:b>0?"live":h.turnState==="running"?"turn":null;return{handle:v,label:fh(h),meta:h.cliLabel??h.cliId??"CLI",beaconClassName:qS(h,b),activeJobCount:b,underway:T,active:e.activeTerminalSessionId===h.sessionId}}).filter(v=>!!v),C=g.map(v=>v.handle.id).join(","),E=g.map(v=>`${v.label}${v.meta}${v.activeJobCount}`).join(""),A=H.useCallback(()=>{const v=a.current;if(!v)return;const{scrollLeft:h,clientWidth:b,scrollWidth:T}=v,R=Math.max(0,T-b),L=b>0&&R>1,M=L?Math.max(1,Math.ceil(T/b)):1,k=h>=R-1,B=L?k?1:Math.min(M,Math.ceil((R-h)/b)+1):1;_({overflow:L,atStart:h<=1,atEnd:k,page:B,pages:M})},[]);if(H.useEffect(()=>{const v=a.current;if(!v)return;o.current=!0,v.scrollLeft=v.scrollWidth,A();const h=typeof ResizeObserver<"u"?new ResizeObserver(()=>{o.current&&(v.scrollLeft=v.scrollWidth),A()}):null;h?.observe(v);const b=()=>{const T=Math.max(0,v.scrollWidth-v.clientWidth);o.current=v.scrollLeft>=T-1,A()};return v.addEventListener("scroll",b,{passive:!0}),()=>{h?.disconnect(),v.removeEventListener("scroll",b)}},[C,A]),H.useEffect(()=>{const v=a.current;v&&(o.current&&(v.scrollLeft=v.scrollWidth),A())},[E,A]),g.length===0)return null;const x=f.overflow,p=v=>{const h=a.current;if(!h)return;const b=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;h.scrollBy({left:v*h.clientWidth,behavior:b?"auto":"smooth"})};return y.jsx("div",{className:"canvas-dock is-taskbar","data-canvas-blocker":!0,children:y.jsxs("div",{className:"canvas-dock-rail",role:"toolbar","aria-label":"Open windows",children:[x?y.jsx("button",{type:"button",className:"canvas-dock-pager canvas-dock-pager--prev",onClick:()=>p(-1),disabled:f.atStart,"aria-label":"Show older windows",title:"Older",children:y.jsx(jy,{direction:"prev"})}):null,y.jsx("div",{className:"canvas-dock-chips",ref:a,children:g.map((v,h)=>y.jsx(N7,{entry:v,index:h,canvasSize:r,allHandles:S},v.handle.id))}),x?y.jsx("button",{type:"button",className:"canvas-dock-pager canvas-dock-pager--next",onClick:()=>p(1),disabled:f.atEnd,"aria-label":"Show newer windows",title:"Newer",children:y.jsx(jy,{direction:"next"})}):null,x?y.jsxs("span",{className:"canvas-dock-page","aria-label":`Page ${f.page} of ${f.pages}`,children:[f.page,"/",f.pages]}):null]})})}function N7({entry:e,index:n,canvasSize:r,allHandles:a}){const o=["canvas-dock-chip",e.active?"canvas-dock-chip--active":"",e.underway?`canvas-dock-chip--underway canvas-dock-chip--underway-${e.underway}`:""].filter(Boolean).join(" "),f=()=>S7(e.handle,a,r),_=u=>{u.stopPropagation()},c=u=>{u.stopPropagation(),C7(e.handle)};return y.jsxs("div",{className:o,role:"button",tabIndex:0,"aria-label":e.active?`${e.label} (focused)`:`Focus ${e.label}`,"aria-current":e.active?"true":void 0,title:e.active?"Focused":"Click to focus",style:{"--i":n},onClick:f,onKeyDown:u=>{u.target===u.currentTarget&&(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),f())},children:[y.jsx("span",{className:e.beaconClassName,"aria-hidden":"true"}),y.jsx("span",{className:"canvas-dock-chip-name",children:e.label}),y.jsx("span",{className:"canvas-dock-chip-cli",children:e.meta}),e.activeJobCount>0?y.jsx("span",{className:"canvas-dock-chip-count",children:e.activeJobCount}):null,y.jsx("button",{type:"button",className:"canvas-dock-chip-close",onPointerDown:_,onClick:c,"aria-label":`Close ${e.label}`,title:"Close",children:y.jsx(B7,{})})]})}function B7(){return y.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:y.jsx("path",{d:"M4.6 4.6 11.4 11.4M11.4 4.6 4.6 11.4",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round"})})}function jy({direction:e}){return y.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:y.jsx("path",{d:e==="prev"?"M10 3.5 5.5 8 10 12.5":"M6 3.5 10.5 8 6 12.5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const I7="is-animation-paused";function j7({viewport:e,backgroundAnimationEnabled:n}){const[r,a]=H.useState(()=>document.hidden);return H.useEffect(()=>{function o(){a(document.hidden)}return document.addEventListener("visibilitychange",o),()=>{document.removeEventListener("visibilitychange",o)}},[]),y.jsxs("div",{className:"operations-canvas-background","aria-hidden":"true",children:[y.jsx("div",{className:"operations-canvas-sea"}),y.jsx("div",{className:"operations-canvas-grid",style:{backgroundPosition:`${e.x}px ${e.y}px`,backgroundSize:`${48*e.zoom}px ${48*e.zoom}px, ${12*e.zoom}px ${12*e.zoom}px`}}),n?y.jsxs("div",{className:`operations-radar${r?` ${I7}`:""}`,children:[y.jsx("span",{className:"operations-radar-ring operations-radar-ring--outer"}),y.jsx("span",{className:"operations-radar-ring operations-radar-ring--middle"}),y.jsx("span",{className:"operations-radar-ring operations-radar-ring--inner"}),y.jsx("span",{className:"operations-radar-sweep"})]}):null]})}const kx="fleet-console.map.shortcutsCollapsed",zy=Aw.find(e=>e.title==="Map")??null;function z7(){const[e,n]=H.useState($7);if(!zy)return null;const r=()=>{n(a=>{const o=!a;return P7(o),o})};return e?y.jsx("button",{type:"button",className:"map-shortcuts-fab","data-canvas-blocker":!0,onClick:r,"aria-label":"맵 단축키 보기",title:"Map shortcuts",children:y.jsx(H7,{})}):y.jsxs("aside",{className:"map-shortcuts","data-canvas-blocker":!0,"aria-label":"Map shortcuts",children:[y.jsxs("div",{className:"map-shortcuts-head",children:[y.jsx("span",{className:"map-shortcuts-label",children:"Shortcuts"}),y.jsx("button",{type:"button",className:"map-shortcuts-toggle",onClick:r,"aria-label":"맵 단축키 접기",title:"Collapse",children:y.jsx(U7,{})})]}),y.jsx("dl",{className:"map-shortcuts-list",children:zy.entries.map(a=>y.jsxs("div",{className:"map-shortcuts-entry",children:[y.jsx("dt",{className:"map-shortcuts-combos",children:a.combos.map((o,f)=>y.jsxs("span",{className:"map-shortcuts-combo",children:[f>0?y.jsx("span",{className:"map-shortcuts-or",children:"or"}):null,y.jsx("span",{className:"map-shortcuts-keyset",children:o.map(_=>y.jsx("kbd",{children:_},_))})]},o.join("+")))}),y.jsx("dd",{children:a.description})]},a.description))})]})}function $7(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(kx)==="true"}catch{return!1}}function P7(e){if(!(typeof window>"u"))try{window.localStorage.setItem(kx,String(e))}catch{}}function H7(){return y.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[y.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),y.jsx("path",{d:"M6.3 6.1a1.8 1.8 0 1 1 2.5 1.7c-.5.3-.8.6-.8 1.2v.3",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),y.jsx("circle",{cx:"8",cy:"11.4",r:".8",fill:"currentColor"})]})}function U7(){return y.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:y.jsx("path",{d:"M4.5 10.5 8 5.5l3.5 5M8 11V5.5",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function F7(e,n){return{x:e.x*n.zoom+n.x,y:e.y*n.zoom+n.y}}function Gl(e,n){return{x:(e.x-n.x)/n.zoom,y:(e.y-n.y)/n.zoom}}function q7(e,n){return{...F7(e,n),width:e.width*n.zoom,height:e.height*n.zoom}}function W7({rect:e,viewport:n}){const r=q7(e,n);return y.jsx("div",{className:"canvas-rubber-band",style:{left:r.x,top:r.y,width:r.width,height:r.height},"aria-hidden":"true"})}function $y({id:e,theaterId:n,geometry:r,viewport:a,active:o,minimized:f=!1,maximized:_=!1,onFocusRequest:c,onMaximize:u}){const d=H.useRef(null),S=()=>{ei(null),ho(e),_||Ou(e,{...r,zIndex:Es()})},g=h=>{h.button===0&&(_||(h.preventDefault(),h.stopPropagation(),S(),d.current={pointerId:h.pointerId,startX:h.clientX,startY:h.clientY,geometry:r},h.currentTarget.setPointerCapture(h.pointerId)))},C=h=>{const b=d.current;!b||b.pointerId!==h.pointerId||(h.preventDefault(),h.stopPropagation(),Ou(e,{...b.geometry,x:b.geometry.x+(h.clientX-b.startX)/a.zoom,y:b.geometry.y+(h.clientY-b.startY)/a.zoom}))},E=h=>{d.current?.pointerId===h.pointerId&&(h.preventDefault(),h.stopPropagation(),d.current=null,h.currentTarget.releasePointerCapture(h.pointerId))},A=h=>{h.stopPropagation()},x=h=>{h.stopPropagation(),S()},p=h=>{h.stopPropagation()},v=()=>{_&&ni(),Fp(e),Vu(e).catch(h=>{Yu(h instanceof Error?h.message:String(h))})};return y.jsxs("article",{className:`canvas-panel canvas-panel--shell ${f?"is-minimized":""} ${o?"is-active":""}`,style:{left:r.x,top:r.y,width:r.width,height:r.height,zIndex:r.zIndex},onPointerDown:S,"data-canvas-panel":!0,inert:f,"aria-label":"Shell panel",children:[y.jsxs("div",{className:"canvas-panel-titlebar",onPointerDown:g,onPointerMove:C,onPointerUp:E,onPointerCancel:E,onDoubleClick:c,"data-canvas-blocker":!0,children:[y.jsx("span",{className:"tenant-beacon is-live","aria-hidden":"true"}),y.jsx("span",{className:"canvas-panel-title",children:"Shell"}),y.jsx("span",{className:"canvas-panel-cli",children:"shell"}),y.jsx("button",{type:"button",className:"canvas-panel-icon-button",onPointerDown:A,onClick:()=>{xm(Dg(e))},"aria-label":"Minimize shell panel",title:"Minimize panel",children:y.jsx(K7,{})}),y.jsx("button",{type:"button",className:`canvas-panel-icon-button ${_?"is-active":""}`,onPointerDown:A,onClick:u,"aria-label":_?"Restore shell panel":"Maximize shell panel",title:_?"Restore panel":"Maximize panel",children:y.jsx(V7,{})}),y.jsx("button",{type:"button",className:"canvas-panel-icon-button",onPointerDown:A,onClick:v,"aria-label":"Close shell panel",title:"Close shell",children:y.jsx(G7,{})})]}),y.jsx("div",{className:"canvas-panel-terminal",onPointerDown:x,onWheel:p,"data-canvas-blocker":!0,children:y.jsx(Ex,{sessionId:e,kind:"shell",theaterId:n,active:o,zoom:a.zoom,onExit:()=>{_&&ni(),Fp(e)}})}),y.jsx(Tx,{geometry:r,zoom:a.zoom,onResize:h=>Ou(e,h)})]})}function G7(){return y.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:y.jsx("path",{d:"M4.6 4.6 11.4 11.4M11.4 4.6 4.6 11.4",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round"})})}function K7(){return y.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:y.jsx("path",{d:"M3.5 11.5h9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function V7(){return y.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:y.jsx("path",{d:"M4.2 4.2h7.6v7.6H4.2z",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinejoin:"round"})})}const Y7=.25,X7=2,Z7=200,J7=150,Py=5,Q7=.0018;function eB({viewport:e,disabled:n=!1,consumePointerDown:r=!1,onViewportChange:a,onZoom:o,onCreate:f,onConsumePointerDown:_,onClick:c}){const u=H.useRef(null),d=H.useRef(e),[S,g]=H.useState(null),[C,E]=H.useState(!1),[A,x]=H.useState(!1);H.useEffect(()=>{d.current=e},[e]),H.useEffect(()=>{const L=k=>{k.key==="Shift"&&x(!0),!tB(k.target)&&k.code==="Space"&&(k.preventDefault(),E(!0))},M=k=>{k.key==="Shift"&&x(!1),k.code==="Space"&&E(!1)};return window.addEventListener("keydown",L),window.addEventListener("keyup",M),()=>{window.removeEventListener("keydown",L),window.removeEventListener("keyup",M)}},[]);const p=L=>{if(n||Hy(L.target)||L.button!==0&&L.button!==1)return;if(L.preventDefault(),r){_?.();return}const M=Ep(L),k=L.shiftKey&&L.button===0&&!C?"create":"pan";u.current={pointerId:L.pointerId,mode:k,startScreen:M,currentScreen:M,startViewport:d.current},L.currentTarget.setPointerCapture(L.pointerId),k==="create"&&g(xp(M,M,d.current))},v=L=>{const M=u.current;if(!M||M.pointerId!==L.pointerId)return;L.preventDefault();const k=Ep(L);if(u.current={...M,currentScreen:k},M.mode==="pan"){a({...M.startViewport,x:M.startViewport.x+k.x-M.startScreen.x,y:M.startViewport.y+k.y-M.startScreen.y});return}g(xp(M.startScreen,k,d.current))},h=L=>{R(L,!0)},b=L=>{R(L,!1)},T=L=>{if(n||Hy(L.target))return;L.preventDefault();const M=Ep(L),k=d.current,B=nB(k.zoom*Math.exp(-L.deltaY*Q7),Y7,X7),F=Gl(M,k);o({x:M.x-F.x*B,y:M.y-F.y*B,zoom:B})},R=(L,M)=>{const k=u.current;if(!k||k.pointerId!==L.pointerId||(u.current=null,L.currentTarget.releasePointerCapture(L.pointerId),g(null),!M))return;const B=Math.abs(k.currentScreen.x-k.startScreen.x),F=Math.abs(k.currentScreen.y-k.startScreen.y);if(B<Py&&F<Py){c?.();return}if(k.mode!=="create")return;const U=xp(k.startScreen,k.currentScreen,d.current),W={x:U.x,y:U.y,width:Math.max(U.width,Z7),height:Math.max(U.height,J7)};f(W,k.currentScreen)};return{rubberBand:S,spaceActive:C,shiftActive:A,onPointerDown:p,onPointerMove:v,onPointerUp:h,onPointerCancel:b,onWheel:T}}function xp(e,n,r){const a=Gl(e,r),o=Gl(n,r),f=Math.min(a.x,o.x),_=Math.min(a.y,o.y);return{x:f,y:_,width:Math.abs(a.x-o.x),height:Math.abs(a.y-o.y)}}function Ep(e){const n=e.currentTarget.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function Hy(e){return e instanceof Element&&!!e.closest("[data-canvas-blocker], [data-canvas-panel]")}function tB(e){return e instanceof HTMLElement&&!!e.closest("input, textarea, select, [contenteditable='true']")}function nB(e,n,r){return Math.min(r,Math.max(n,e))}const iB="Shift-drag to create an Operation. Right-click for actions. Drag to pan; scroll to zoom.",rB=640,sB=400,aB=560,oB=360,lB={x:0,y:0,zoom:1};function cB({state:e}){const n=H.useRef(null),r=xT(),a=ET(),o=gS(),f=TT(),_=v7(),c=XA(),u=GS(),d=ZA(),S=Bk(e),[g,C]=H.useState(null),[E,A]=H.useState(null),[x,p]=H.useState({width:0,height:0}),v=!e.activeTheaterId||e.agentClis.length===0||e.creatingTerminalSession||e.addingTheater;H.useEffect(()=>{const D=n.current;if(!D||typeof ResizeObserver>"u")return;const I=()=>p({width:D.clientWidth,height:D.clientHeight});I();const N=new ResizeObserver(I);return N.observe(D),()=>N.disconnect()},[]),H.useEffect(()=>{e.activeTerminalSessionId!==null&&ho(null)},[e.activeTerminalSessionId]),H.useEffect(()=>{e.activeTerminalSessionId!==null&&f.includes(e.activeTerminalSessionId)&&ei(null)},[e.activeTerminalSessionId,f]);const h=eB({viewport:r.viewport,disabled:v,onViewportChange:Du,onZoom:mS,onCreate:(D,I)=>{A(null),C({rect:D,anchor:I})},consumePointerDown:g!==null||E!==null,onConsumePointerDown:()=>{C(null),A(null)},onClick:pB}),b=async D=>{if(!(!e.activeTheaterId||!g)){Hb();try{const I=await Rb(e.activeTheaterId,D.id);Nl(I.sessionId,gB(g.rect)),Ub(I),ei(I.sessionId),C(null)}catch(I){Fb(I instanceof Error?I.message:String(I))}}},T=async D=>{const I=E?.canvasPoint;if(A(null),!(!e.activeTheaterId||!I)){ni(),Hb();try{const N=await Rb(e.activeTheaterId,D.id);Nl(N.sessionId,Fy(I,rB,sB)),Ub(N),ei(N.sessionId)}catch(N){Fb(N instanceof Error?N.message:String(N))}}},R=()=>{const D=E?.canvasPoint;if(A(null),!e.activeTheaterId||!D)return;ni(),ei(null);const I=JA(e.activeTheaterId,{...Fy(D,aB,oB),zIndex:Es()});ho(I)},L=()=>{A(null),Du({...lB})},M=()=>{const D=n.current?.getBoundingClientRect();if(!D)return;const I={x:16,y:D.height-52},N=Gl({x:D.width/2,y:D.height/2},r.viewport);C(null),A({anchor:I,canvasPoint:N})},k=D=>{if(D.target instanceof Element&&D.target.closest("[data-canvas-blocker], [data-canvas-panel]"))return;D.preventDefault();const I=n.current?.getBoundingClientRect();if(!I)return;const N={x:D.clientX-I.left,y:D.clientY-I.top};C(null),A({anchor:N,canvasPoint:Gl(N,r.viewport)})},B=new Set(f),F=new Set(d),U=Object.fromEntries(Object.entries(r.panels).filter(([D])=>!B.has(D))),W=Object.fromEntries(Object.entries(c).filter(([D])=>!F.has(D))),j=S.length>0||Object.keys(c).length>0,G=S.map(D=>D.sessionId),ee=xh(G),q=_?ee.find(D=>D.id===_)??null:null,V=D=>Em(D,ee),Y={x:0,y:0,width:Math.max(320,x.width),height:Math.max(240,x.height-72),zIndex:20};return y.jsxs("main",{className:`operations-canvas ${h.spaceActive?"is-panning":""} ${h.shiftActive?"is-creating":""} ${_?"is-panel-maximized":""}`,onPointerDown:h.onPointerDown,onPointerMove:h.onPointerMove,onPointerUp:h.onPointerUp,onPointerCancel:h.onPointerCancel,onWheel:h.onWheel,onContextMenu:k,ref:n,children:[y.jsx(j7,{viewport:r.viewport,backgroundAnimationEnabled:a}),y.jsx("button",{type:"button",className:`canvas-background-toggle canvas-maximize-toggle ${o?"is-active":""}`,onClick:NT,"data-canvas-blocker":!0,"aria-label":o?"맵 전체화면 해제":"맵 전체화면","aria-pressed":o,title:o?"Exit map fullscreen":"Enter map fullscreen",children:o?y.jsx(fB,{}):y.jsx(dB,{})}),y.jsx("button",{type:"button",className:`canvas-background-toggle ${a?"is-active":""}`,onClick:OT,"data-canvas-blocker":!0,"aria-label":a?"배경 애니메이션 끄기":"배경 애니메이션 켜기",title:a?"Background animation: on":"Background animation: off",children:y.jsx(hB,{})}),y.jsxs("div",{className:"operations-canvas-world",style:{transform:`translate(${r.viewport.x}px, ${r.viewport.y}px) scale(${r.viewport.zoom})`},children:[S.map(D=>{const I=r.panels[D.sessionId];if(!I||B.has(D.sessionId)||_===D.sessionId)return null;const N=ee.find(P=>P.id===D.sessionId)??Mg(D.sessionId);return y.jsx(Iy,{state:e,session:D,geometry:I,viewport:r.viewport,active:e.activeTerminalSessionId===D.sessionId,onFocusRequest:()=>no(Mg(D.sessionId),x),onMaximize:()=>V(N)},D.sessionId)}),Object.entries(c).map(([D,I])=>{if(_===D)return null;const N=F.has(D),P=ee.find(Z=>Z.id===D)??Dg(D);return y.jsx($y,{id:D,theaterId:I.theaterId,geometry:I.geometry,viewport:r.viewport,active:!N&&u===D,minimized:N,onFocusRequest:()=>no(Dg(D),x),onMaximize:()=>V(P)},D)})]}),q?y.jsxs("div",{className:"canvas-panel-maximized-layer","data-canvas-blocker":!0,children:[S.map(D=>D.sessionId===q.id?y.jsx(Iy,{state:e,session:D,geometry:Y,viewport:{x:0,y:0,zoom:1},maximized:!0,active:e.activeTerminalSessionId===D.sessionId,onFocusRequest:()=>no(q,x),onMaximize:ni},D.sessionId):null),Object.entries(c).map(([D,I])=>D===q.id?y.jsx($y,{id:D,theaterId:I.theaterId,geometry:Y,viewport:{x:0,y:0,zoom:1},maximized:!0,active:u===D,onFocusRequest:()=>no(q,x),onMaximize:ni},D):null)]}):null,j?null:y.jsxs("div",{className:"operations-canvas-empty","data-canvas-blocker":!0,children:[y.jsx("span",{className:"operations-canvas-empty-mark","aria-hidden":"true"}),y.jsx("p",{children:e.activeTheaterId?iB:"Add a Theater from the top bar to start operations."}),e.terminalSessionError?y.jsx("p",{className:"operations-canvas-error",children:e.terminalSessionError}):null]}),h.rubberBand?y.jsx(W7,{rect:h.rubberBand,viewport:r.viewport}):null,g?y.jsx(KO,{state:e,mode:"menu",anchor:g.anchor,viewportBounds:Uy(n.current),onSelect:b,onClose:()=>C(null)},`${g.anchor.x}:${g.anchor.y}`):null,E?y.jsx(iN,{state:e,anchor:E.anchor,viewportBounds:Uy(n.current),onLaunchCli:D=>{T(D)},onOpenShell:R,onResetView:L,onClose:()=>A(null)},`${E.anchor.x}:${E.anchor.y}`):null,y.jsx(oN,{panels:U,shellPanels:W,viewport:r.viewport,canvasSize:x,onJump:D=>Du({x:x.width/2-D.x*r.viewport.zoom,y:x.height/2-D.y*r.viewport.zoom,zoom:r.viewport.zoom})}),j?y.jsx(z7,{}):null,e.activeTheaterId?y.jsx("button",{type:"button",className:"canvas-launcher-fab",onClick:M,"data-canvas-blocker":!0,"aria-label":"새 패널 만들기",title:"New panel",children:y.jsx(uB,{})}):null,y.jsx(O7,{state:e,sessions:S,canvasSize:x})]})}function uB(){return y.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:y.jsx("path",{d:"M8 3.5v9M3.5 8h9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function hB(){return y.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[y.jsx("circle",{cx:"8",cy:"8",r:"5.2",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeDasharray:"2 2"}),y.jsx("circle",{cx:"8",cy:"8",r:"2.6",fill:"none",stroke:"currentColor",strokeWidth:"1.1",opacity:"0.72"}),y.jsx("path",{d:"M8 8 12.2 5.8",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),y.jsx("circle",{cx:"8",cy:"8",r:".9",fill:"currentColor"})]})}function dB(){return y.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:y.jsx("path",{d:"M3 6.4V3h3.4M13 6.4V3H9.6M3 9.6V13h3.4M13 9.6V13H9.6",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function fB(){return y.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:y.jsx("path",{d:"M6.4 3v3.4H3M9.6 3v3.4H13M6.4 13V9.6H3M9.6 13V9.6H13",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function Uy(e){if(!e)return;const n=e.getBoundingClientRect();return{width:n.width,height:n.height}}function pB(){if(typeof document<"u"){const e=document.activeElement;e instanceof HTMLElement&&e.blur()}ei(null),ho(null)}function gB(e){return{x:e.x,y:e.y,width:e.width,height:e.height,zIndex:0}}function Fy(e,n,r){return{x:e.x,y:e.y,width:n,height:r,zIndex:0}}const mB=56;function _B(e,n){const r=H.useRef(null),a=H.useRef(!0),[o,f]=H.useState(!0),_=H.useCallback(u=>{a.current!==u&&(a.current=u,f(u))},[]);H.useEffect(()=>{const u=r.current;if(!u)return;const d=()=>{const S=u.scrollHeight-u.scrollTop-u.clientHeight;_(S<=mB)};return u.addEventListener("scroll",d,{passive:!0}),()=>u.removeEventListener("scroll",d)},[_]),H.useLayoutEffect(()=>{_(!0);const u=r.current;u&&(u.scrollTop=u.scrollHeight)},[e,_]),H.useLayoutEffect(()=>{const u=r.current;!u||!a.current||(u.scrollTop=u.scrollHeight)},[n]);const c=H.useCallback(()=>{const u=r.current;u&&(u.scrollTop=u.scrollHeight,u.focus({preventScroll:!0}),_(!0))},[_]);return{containerRef:r,pinned:o,jumpToLatest:c}}const qy=400,vB=["text","fallbackText","fallbackThought"],bB=H.memo(function({events:n}){return y.jsxs("ol",{className:"timeline","aria-label":"Raw event timeline",children:[n.length===0?y.jsx("li",{className:"timeline-empty",children:"No events observed."}):null,n.map((r,a)=>{const o=n[n.length-1-a];return o?y.jsx(yB,{event:o},o.id):null})]})}),yB=H.memo(function({event:n}){return y.jsxs("li",{className:"timeline-row",children:[y.jsx("time",{className:"timeline-time",children:FS(n.at)}),y.jsx("span",{className:"timeline-type",children:n.type}),y.jsx("code",{className:"timeline-payload",children:SB(n.event)})]})});function SB(e){const n={...e};delete n.type;for(const a of vB){const o=n[a];typeof o=="string"&&(n[a]=o.length>60?`${o.slice(0,60)}… (${o.length} chars)`:o)}const r=JSON.stringify(n);return r.length>qy?`${r.slice(0,qy)}…`:r}const wB=H.memo(function({track:n}){const r=ph(n.status),a=n.status==="stream",o=n.sentTextLength>n.text.length||n.sentThoughtLength>n.thought.length,f=n.sentTextLength+n.sentThoughtLength;return y.jsxs("article",{className:`track-card track-card--${r}`,children:[y.jsxs("header",{className:"track-head",children:[y.jsx("span",{className:`status-dot status-dot--${r}`,"aria-hidden":"true"}),y.jsx("h3",{className:"track-name",children:n.displayName}),n.displayCli?y.jsx("span",{className:"track-tag",children:n.displayCli}):null,n.model?y.jsx("span",{className:"track-tag track-tag--dim",children:n.model}):null,n.effort?y.jsx("span",{className:"track-tag track-tag--dim",children:n.effort}):null,y.jsx("span",{className:`track-status track-status--${r}`,children:$A(n.status)})]}),n.subtitle?y.jsx("p",{className:"track-subtitle",children:n.subtitle}):null,n.requestPreview?y.jsx(CB,{preview:n.requestPreview}):null,n.thought?y.jsx(xB,{thought:n.thought,streaming:a&&!n.text}):null,y.jsx(EB,{track:n}),n.text?y.jsx("div",{className:"track-output","data-streaming":a||void 0,children:y.jsxs("pre",{className:"track-text",children:[n.text,a?y.jsx("span",{className:"stream-caret","aria-hidden":"true"}):null]})}):a||n.status==="conn"||n.status==="queued"?y.jsxs("p",{className:"track-waiting",children:[y.jsx("span",{className:"stream-caret","aria-hidden":"true"})," awaiting output"]}):null,o?y.jsxs("p",{className:"track-notice",children:["Output partially retained — ",f.toLocaleString()," chars emitted in total."]}):null,n.error?y.jsx("p",{className:"track-error",children:n.error}):null]})});function CB({preview:e}){return y.jsxs("p",{className:"track-request",title:e,children:[y.jsx("span",{className:"track-request-mark","aria-hidden":"true",children:"▸"}),e]})}function xB({thought:e,streaming:n}){const[r,a]=H.useState(!1);return y.jsxs("div",{className:`thought-fold ${r?"is-open":""}`,children:[y.jsxs("button",{type:"button",className:"thought-toggle",onClick:()=>a(o=>!o),"aria-expanded":r,children:[y.jsx("span",{className:"thought-chevron","aria-hidden":"true",children:r?"▾":"▸"}),"reasoning",n?y.jsx("span",{className:"stream-caret stream-caret--dim","aria-hidden":"true"}):null]}),r?y.jsx("pre",{className:"thought-text",children:e}):null]})}function EB({track:e}){return e.tools.length===0?null:y.jsx("ul",{className:"tool-rail","aria-label":"Tool calls",children:e.tools.map(n=>y.jsxs("li",{className:`tool-chip tool-chip--${TB(n.status)}`,children:[y.jsx("span",{className:"tool-chip-glyph","aria-hidden":"true",children:"⚙"}),y.jsx("span",{className:"tool-chip-title",children:n.title}),n.status?y.jsx("span",{className:"tool-chip-status",children:n.status}):null]},n.key))})}function TB(e){const n=e.toLowerCase();return n.includes("error")||n.includes("fail")?"bad":n.includes("done")||n.includes("ok")||n.includes("complete")?"ok":n.includes("run")||n.includes("progress")||n.includes("stream")?"live":"idle"}function AB({job:e,timelineOpen:n}){const{containerRef:r,pinned:a,jumpToLatest:o}=_B(e?.jobId??"none",e?.lastEventId??0);return e?y.jsxs("main",{className:"stage",children:[y.jsx(kB,{job:e}),y.jsxs("div",{className:"stage-stream",children:[y.jsx("div",{className:"stage-scroll",ref:r,tabIndex:-1,children:y.jsxs("div",{className:"stage-content",children:[e.trackOrder.length===0?y.jsxs("p",{className:"stage-waiting",children:[y.jsx("span",{className:"stream-caret","aria-hidden":"true"})," waiting for track registration"]}):e.trackOrder.map(f=>{const _=e.tracks[f];return _?y.jsx(wB,{track:_},`${e.jobId}:${f}`):null}),e.summary?y.jsx(RB,{summary:e.summary,status:e.status,error:e.error}):null]})}),a?null:y.jsx("button",{type:"button",className:"follow-button",onClick:o,children:"↓ Follow stream"})]}),y.jsxs("section",{className:`timeline-dock ${n?"is-open":""}`,children:[y.jsxs("button",{type:"button",className:"timeline-toggle",onClick:Tk,"aria-expanded":n,children:[y.jsx("span",{className:"timeline-chevron","aria-hidden":"true",children:n?"▾":"▴"}),"Event timeline",y.jsx("span",{className:"timeline-count",children:e.recentEvents.length})]}),n?y.jsx(bB,{events:e.recentEvents}):null]})]}):y.jsx("main",{className:"stage",children:y.jsxs("div",{className:"stage-idle",children:[y.jsx("p",{className:"stage-idle-mark","aria-hidden":"true",children:"▵"}),y.jsx("h2",{children:"Standing by"}),y.jsx("p",{children:"Select a job from the left rail, or dispatch carriers from a Fleet session."})]})})}const kB=H.memo(function({job:n}){const r=ph(n.status),a=n.startedAt?jA(n.startedAt,n.finishedAt??n.updatedAt):null;return y.jsxs("header",{className:"job-head",children:[y.jsxs("div",{className:"job-head-id",children:[y.jsx("span",{className:`status-dot status-dot--${r} status-dot--lg`,"aria-hidden":"true"}),y.jsxs("div",{children:[y.jsx("h2",{className:"job-title",children:n.label??$p(n.jobId)}),y.jsxs("p",{className:"job-meta",children:[y.jsx("span",{className:`job-status job-status--${r}`,children:Pp(n.status)}),n.ownerCarrierId?y.jsxs("span",{children:["· ",n.ownerCarrierId]}):null,n.kind?y.jsxs("span",{children:["· ",n.kind]}):null,a?y.jsxs("span",{children:["· ",a]}):null,n.startedAt?y.jsxs("span",{children:["· started ",FS(n.startedAt)]}):null]})]})]}),y.jsx("code",{className:"job-id",title:n.jobId,children:$p(n.jobId)})]})});function RB({summary:e,status:n,error:r}){return y.jsxs("aside",{className:`job-summary job-summary--${ph(n)}`,children:[y.jsx("p",{className:"job-summary-eyebrow",children:n==="error"?"Finalized with error":"Finalized"}),y.jsx("p",{className:"job-summary-text",children:e}),r?y.jsx("p",{className:"job-summary-error",children:r}):null]})}function LB({state:e}){const n=Ok(e);return H.useEffect(()=>{const r=a=>{a.key==="Escape"&&Ff()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[]),n?y.jsxs("div",{className:"job-overlay",role:"dialog","aria-modal":"true","aria-label":"Carrier job stream",children:[y.jsx("button",{type:"button",className:"job-overlay-scrim",onClick:Ff,"aria-label":"Close job stream"}),y.jsxs("div",{className:"job-overlay-card",children:[y.jsx("button",{type:"button",className:"job-overlay-close",onClick:Ff,"aria-label":"Close job stream",children:"×"}),y.jsx(AB,{job:n,timelineOpen:e.timelineOpen})]})]}):null}function MB({state:e}){return y.jsx("div",{className:"floating-job-overlay","data-canvas-blocker":!0,children:y.jsx(LB,{state:e})})}function DB({state:e}){const n=H.useRef(null),r=H.useMemo(()=>Xu(e),[e.sessions,e.sessionOrder,e.activeTheaterId]),a=H.useRef(e);return a.current=e,H.useEffect(()=>{DT(e.activeTheaterId),ek(e.activeTheaterId)},[e.activeTheaterId]),H.useEffect(()=>{const o=f=>{if(!f.altKey||f.metaKey||f.ctrlKey||f.key!=="ArrowLeft"&&f.key!=="ArrowRight")return;const _=document.activeElement;if(_ instanceof HTMLElement&&_.matches("input, textarea, [contenteditable='true']")&&!_.closest(".xterm"))return;const c=Xu(a.current),u=xh(c);if(u.length===0)return;f.preventDefault(),f.stopImmediatePropagation();const d=Lg(),S=d??a.current.activeTerminalSessionId??Up(),g=f.key==="ArrowRight"?1:-1,C=y7(u,S,g);if(!C)return;if(d){Em(C,u);return}const E=Wy(n.current);E&&no(C,E)};return window.addEventListener("keydown",o,!0),()=>window.removeEventListener("keydown",o,!0)},[]),H.useEffect(()=>{for(const o of r)LT(o);e.terminalSessionsHydrated&&MT(r)},[r,e.terminalSessionsHydrated]),H.useEffect(()=>{x7(r,{operationSessionsHydrated:e.terminalSessionsHydrated,theaterReady:e.activeTheaterId!==null})},[r,e.activeTheaterId,e.terminalSessionsHydrated]),H.useEffect(()=>{const o=e.pendingOperationFocus;if(o===null)return;let f=!1;return(async()=>{let c=o;if(e.sessions[o]?.status==="dormant")try{const S=await jS(o);if(f)return;gh(S),ei(S.sessionId),c=S.sessionId}catch(S){f||hw(S instanceof Error?S.message:String(S)),Pb();return}if(f)return;ni();const d=Wy(n.current);d&&bS(c,d),Pb()})(),()=>{f=!0}},[e.pendingOperationFocus]),y.jsxs("div",{className:"console-body is-canvas",ref:n,children:[y.jsx(cB,{state:e}),y.jsx(MB,{state:e})]})}function Wy(e){if(!e)return null;const n=e.getBoundingClientRect();return{width:n.width,height:n.height}}const OB=6e3;function NB(){const e=Xl(),n=Oi(),r=n.pathname,a=_o(),o=gS(),f=nA(),_=rA(),c=RS(),u=r.startsWith("/codex"),d=H.useRef(n),S=H.useRef(!u),g=o&&r.startsWith("/operations"),C=u&&f!=="route"&&(S.current||_),E=C?f:"route",A=u&&E==="side",x=S.current?d.current:{pathname:"/operations",search:"",hash:"",state:null,key:"codex-fallback"},p=C?x:n,v=p.pathname.startsWith("/operations");H.useEffect(()=>m3(),[]),H.useEffect(()=>{u||(d.current=n,S.current=!0)},[u,n]),H.useEffect(()=>{dk(v)},[v]),H.useEffect(()=>{const{body:T}=document;return A?(T.dataset.codexSide="true",T.style.setProperty("--codex-side-width",`${c}px`)):(delete T.dataset.codexSide,T.style.removeProperty("--codex-side-width")),()=>{delete T.dataset.codexSide,T.style.removeProperty("--codex-side-width")}},[A,c]),H.useEffect(()=>{const T=document.querySelector(".topbar");if(!T)return;const R=()=>{document.documentElement.style.setProperty("--console-topbar-offset",`${Math.round(T.getBoundingClientRect().bottom)}px`)};R();const L=new ResizeObserver(R);return L.observe(T),window.addEventListener("resize",R),()=>{L.disconnect(),window.removeEventListener("resize",R)}},[]),H.useEffect(()=>{const T=new AbortController;OS(T.signal).then(M=>{ow(M),Wb()}).catch(M=>{T.signal.aborted||($e({theaterError:M instanceof Error?M.message:String(M)}),Wb())}),mA(T.signal).then(vk).catch(M=>{T.signal.aborted||$e({terminalSessionError:M instanceof Error?M.message:String(M)})}),iw(),NS({signal:T.signal}).then(rw).catch(M=>{T.signal.aborted||sw(M instanceof Error?M.message:String(M))});const R=()=>{hA(e.activeTheaterId,T.signal).then(_k).catch(()=>{})};R();const L=window.setTimeout(R,OB);return()=>{window.clearTimeout(L),T.abort()}},[]),H.useEffect(()=>{const T=R=>{window.location.pathname.includes("/codex")||(R.metaKey||R.ctrlKey)&&R.key.toLowerCase()==="k"&&(R.preventDefault(),R.stopImmediatePropagation(),Sk())};return window.addEventListener("keydown",T,!0),()=>window.removeEventListener("keydown",T,!0)},[]);const h=()=>{const T=d.current;S.current?a({pathname:T.pathname,search:T.search,hash:T.hash},{state:T.state}):a("/operations")},b=()=>{a("/codex"),iA("side")};return y.jsxs("div",{className:`console-shell ${g?"is-map-fullscreen":""}`,children:[y.jsx(IR,{state:e}),y.jsxs(z5,{location:p,children:[y.jsx(Xs,{path:"/",element:y.jsx(vb,{to:"/operations",replace:!0})}),y.jsx(Xs,{path:"/operations",element:y.jsx(DB,{state:e})}),y.jsx(Xs,{path:"/carrier-settings",element:y.jsx(G3,{})}),y.jsx(Xs,{path:"/settings",element:y.jsx($O,{})}),y.jsx(Xs,{path:"/codex/*",element:null}),y.jsx(Xs,{path:"*",element:y.jsx(vb,{to:"/operations",replace:!0})})]}),u?y.jsx(KD,{state:e,mode:E,onClose:h}):null,u?null:y.jsx(BB,{onOpen:b}),y.jsx(CR,{state:e}),y.jsx(bR,{state:e}),y.jsx(a3,{state:e}),y.jsx(sR,{state:e}),y.jsx(RR,{open:e.connectionError!==null,tone:"error",title:"Console link interrupted",message:e.connectionError??void 0}),y.jsx(lR,{})]})}function BB({onOpen:e}){return y.jsxs("button",{type:"button",className:"codex-edge-handle",onClick:e,"aria-label":"Open Codex side panel",title:"Codex (Side)",children:[y.jsx("span",{className:"codex-edge-handle-chevron","aria-hidden":"true",children:y.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:y.jsx("path",{d:"M9.5 4 5.5 8l4 4"})})}),y.jsx("span",{className:"codex-edge-handle-label",children:"Codex"})]})}fk();const Gy=document.querySelector("#app");Gy&&PE.createRoot(Gy).render(y.jsx(H.StrictMode,{children:y.jsx(lT,{basename:"/console",children:y.jsx(NB,{})})}));export{U6 as _,IB as a,ME as g,St as k,jl as p};