@dotobokuri/fleet-console 1.15.0 → 1.16.1

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 (68) hide show
  1. package/AGENTS.md +160 -23
  2. package/README.md +18 -16
  3. package/dist/cli.d.ts +1 -20
  4. package/dist/cli.mjs +14116 -22237
  5. package/dist/client/assets/{_baseUniq-cnqj2OOU.js → _baseUniq-Bvbp_jlP.js} +1 -1
  6. package/dist/client/assets/{arc-DKvQCH7P.js → arc-BIE5Buf8.js} +1 -1
  7. package/dist/client/assets/{architectureDiagram-Q4EWVU46-iJqnsZ6O.js → architectureDiagram-Q4EWVU46-D5XMG93D.js} +1 -1
  8. package/dist/client/assets/{blockDiagram-DXYQGD6D-CkJhTJZi.js → blockDiagram-DXYQGD6D-DF6L79td.js} +1 -1
  9. package/dist/client/assets/{c4Diagram-AHTNJAMY-DHkUfhoy.js → c4Diagram-AHTNJAMY-DhF1h0OW.js} +1 -1
  10. package/dist/client/assets/channel-BSjWiXu9.js +1 -0
  11. package/dist/client/assets/{chunk-4BX2VUAB-CJmFkUz-.js → chunk-4BX2VUAB-HIDhmpsY.js} +1 -1
  12. package/dist/client/assets/{chunk-4TB4RGXK-Dp00Zwg3.js → chunk-4TB4RGXK-WM3UvlRe.js} +1 -1
  13. package/dist/client/assets/{chunk-55IACEB6-DFBvwrH_.js → chunk-55IACEB6-D9kCAM0-.js} +1 -1
  14. package/dist/client/assets/{chunk-EDXVE4YY-Dik0hYho.js → chunk-EDXVE4YY-CHGSf6YA.js} +1 -1
  15. package/dist/client/assets/{chunk-FMBD7UC4-DYcmg67a.js → chunk-FMBD7UC4-saa1UCmo.js} +1 -1
  16. package/dist/client/assets/{chunk-OYMX7WX6-B9bhXkOc.js → chunk-OYMX7WX6-BrlxxClZ.js} +1 -1
  17. package/dist/client/assets/{chunk-QZHKN3VN-CW_BXRdy.js → chunk-QZHKN3VN-CVnd5MX8.js} +1 -1
  18. package/dist/client/assets/{chunk-YZCP3GAM-uJM9wQJs.js → chunk-YZCP3GAM-BpsFNlbM.js} +1 -1
  19. package/dist/client/assets/classDiagram-6PBFFD2Q-DIEVc5gp.js +1 -0
  20. package/dist/client/assets/classDiagram-v2-HSJHXN6E-DIEVc5gp.js +1 -0
  21. package/dist/client/assets/clone-VuQnnBA0.js +1 -0
  22. package/dist/client/assets/{cose-bilkent-S5V4N54A-BpsaUYJS.js → cose-bilkent-S5V4N54A-AdFIrmD1.js} +1 -1
  23. package/dist/client/assets/{dagre-KV5264BT-CLaMczco.js → dagre-KV5264BT-YPE_DPjG.js} +1 -1
  24. package/dist/client/assets/{diagram-5BDNPKRD-CFOnN2pM.js → diagram-5BDNPKRD-sW7JSe_o.js} +1 -1
  25. package/dist/client/assets/{diagram-G4DWMVQ6-CkLTTvmR.js → diagram-G4DWMVQ6-CdoUA7HM.js} +1 -1
  26. package/dist/client/assets/{diagram-MMDJMWI5-c8R_KOlQ.js → diagram-MMDJMWI5-Dr_Q44k2.js} +1 -1
  27. package/dist/client/assets/{diagram-TYMM5635-Cfz4vDC5.js → diagram-TYMM5635-CgWLDdO4.js} +1 -1
  28. package/dist/client/assets/{erDiagram-SMLLAGMA-BZFJRBcT.js → erDiagram-SMLLAGMA-BS5jKQII.js} +1 -1
  29. package/dist/client/assets/{flowDiagram-DWJPFMVM-CSbwVNst.js → flowDiagram-DWJPFMVM-DM_ZIfsi.js} +1 -1
  30. package/dist/client/assets/{ganttDiagram-T4ZO3ILL-Z3BPe1vZ.js → ganttDiagram-T4ZO3ILL-D1ASi2pt.js} +1 -1
  31. package/dist/client/assets/{gitGraphDiagram-UUTBAWPF-7Ka8NeSE.js → gitGraphDiagram-UUTBAWPF-DTS8qu5f.js} +1 -1
  32. package/dist/client/assets/{graph-DG6E-jsV.js → graph-BSP3V12O.js} +1 -1
  33. package/dist/client/assets/index-D3a51i1X.js +402 -0
  34. package/dist/client/assets/index-DNtncJ2Y.css +1 -0
  35. package/dist/client/assets/{infoDiagram-42DDH7IO-CN7rF9WG.js → infoDiagram-42DDH7IO-C6rS44Vv.js} +1 -1
  36. package/dist/client/assets/{ishikawaDiagram-UXIWVN3A-jus38Ki6.js → ishikawaDiagram-UXIWVN3A-BysMV0Yj.js} +1 -1
  37. package/dist/client/assets/{journeyDiagram-VCZTEJTY-CCn-AdDe.js → journeyDiagram-VCZTEJTY-Cq1tDTjK.js} +1 -1
  38. package/dist/client/assets/{kanban-definition-6JOO6SKY-BOfals_F.js → kanban-definition-6JOO6SKY-CV7fuoIo.js} +1 -1
  39. package/dist/client/assets/{layout-B2qTAIS5.js → layout-mBwNdhT9.js} +1 -1
  40. package/dist/client/assets/{linear-BmsYolMA.js → linear-B8Mqzhqu.js} +1 -1
  41. package/dist/client/assets/{mermaid.core-D0OYO4L1.js → mermaid.core-mTVIRAe-.js} +4 -4
  42. package/dist/client/assets/{min-jZihhkYo.js → min-LkS4GBrL.js} +1 -1
  43. package/dist/client/assets/{mindmap-definition-QFDTVHPH-35wK1xy9.js → mindmap-definition-QFDTVHPH-CuK4DHsN.js} +1 -1
  44. package/dist/client/assets/{pieDiagram-DEJITSTG-BynWLFT0.js → pieDiagram-DEJITSTG-yKtYS0aG.js} +1 -1
  45. package/dist/client/assets/{quadrantDiagram-34T5L4WZ-w5UoFlnr.js → quadrantDiagram-34T5L4WZ-CQYBuUXw.js} +1 -1
  46. package/dist/client/assets/{requirementDiagram-MS252O5E-BQ9zR_XY.js → requirementDiagram-MS252O5E-DExCsGb_.js} +1 -1
  47. package/dist/client/assets/{sankeyDiagram-XADWPNL6-BL1Lj8dz.js → sankeyDiagram-XADWPNL6-kqoN-VmQ.js} +1 -1
  48. package/dist/client/assets/{sequenceDiagram-FGHM5R23-jC78BST4.js → sequenceDiagram-FGHM5R23-Dsk6zp0F.js} +1 -1
  49. package/dist/client/assets/{stateDiagram-FHFEXIEX-iVYQ2VCC.js → stateDiagram-FHFEXIEX-Bg-kY2ci.js} +1 -1
  50. package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-Dlqv8bJ9.js +1 -0
  51. package/dist/client/assets/{timeline-definition-GMOUNBTQ-CYAlka_x.js → timeline-definition-GMOUNBTQ-DkeszYPW.js} +1 -1
  52. package/dist/client/assets/{vennDiagram-DHZGUBPP-BFcj10GU.js → vennDiagram-DHZGUBPP-a9aq_CaS.js} +1 -1
  53. package/dist/client/assets/{wardley-RL74JXVD-CIUgshxb.js → wardley-RL74JXVD-BioIIFLl.js} +1 -1
  54. package/dist/client/assets/{wardleyDiagram-NUSXRM2D-BEV516Os.js → wardleyDiagram-NUSXRM2D-Bpy2nx7x.js} +1 -1
  55. package/dist/client/assets/{xychartDiagram-5P7HB3ND-D1DFk2ax.js → xychartDiagram-5P7HB3ND-N7vhpanC.js} +1 -1
  56. package/dist/client/index.html +2 -2
  57. package/dist/fleet-plugins/diff/routes.mjs +304 -0
  58. package/dist/fleet-plugins/file-explorer/routes.mjs +446 -0
  59. package/dist/{cli-bin.mjs → fleet-plugins/terminal/routes.mjs} +17313 -21404
  60. package/package.json +7 -6
  61. package/dist/cli-bin.d.ts +0 -2
  62. package/dist/client/assets/channel-C3r_coHh.js +0 -1
  63. package/dist/client/assets/classDiagram-6PBFFD2Q-DmoF5itQ.js +0 -1
  64. package/dist/client/assets/classDiagram-v2-HSJHXN6E-DmoF5itQ.js +0 -1
  65. package/dist/client/assets/clone-CJPQGOBM.js +0 -1
  66. package/dist/client/assets/index-B-bmeDQZ.js +0 -777
  67. package/dist/client/assets/index-BfTQyXzZ.css +0 -1
  68. package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-BEYzM5Cb.js +0 -1
@@ -1,777 +0,0 @@
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 h of o)if(h.type==="childList")for(const g of h.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&a(g)}).observe(document,{childList:!0,subtree:!0});function r(o){const h={};return o.integrity&&(h.integrity=o.integrity),o.referrerPolicy&&(h.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?h.credentials="include":o.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function a(o){if(o.ep)return;o.ep=!0;const h=r(o);fetch(o.href,h)}})();function c5(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function qB(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 jf={exports:{}},gl={};var mb;function u5(){if(mb)return gl;mb=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(a,o,h){var g=null;if(h!==void 0&&(g=""+h),o.key!==void 0&&(g=""+o.key),"key"in o){h={};for(var c in o)c!=="key"&&(h[c]=o[c])}else h=o;return o=h.ref,{$$typeof:e,type:a,key:g,ref:o!==void 0?o:null,props:h}}return gl.Fragment=n,gl.jsx=r,gl.jsxs=r,gl}var gb;function h5(){return gb||(gb=1,jf.exports=u5()),jf.exports}var v=h5(),Pf={exports:{}},qe={};var _b;function d5(){if(_b)return qe;_b=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"),h=Symbol.for("react.consumer"),g=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"),p=Symbol.for("react.activity"),C=Symbol.iterator;function x(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(){}},E=Object.assign,m={};function y(N,H,Q){this.props=N,this.context=H,this.refs=m,this.updater=Q||A}y.prototype.isReactComponent={},y.prototype.setState=function(N,H){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,H,"setState")},y.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function f(){}f.prototype=y.prototype;function b(N,H,Q){this.props=N,this.context=H,this.refs=m,this.updater=Q||A}var T=b.prototype=new f;T.constructor=b,E(T,y.prototype),T.isPureReactComponent=!0;var L=Array.isArray;function R(){}var M={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function I(N,H,Q){var le=Q.ref;return{$$typeof:e,type:N,key:H,ref:le!==void 0?le:null,props:Q}}function G(N,H){return I(N.type,H,N.props)}function q(N){return typeof N=="object"&&N!==null&&N.$$typeof===e}function W(N){var H={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(Q){return H[Q]})}var j=/\/+/g;function V(N,H){return typeof N=="object"&&N!==null&&N.key!=null?W(""+N.key):H.toString(36)}function U(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(R,R):(N.status="pending",N.then(function(H){N.status==="pending"&&(N.status="fulfilled",N.value=H)},function(H){N.status==="pending"&&(N.status="rejected",N.reason=H)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function F(N,H,Q,le,ee){var ce=typeof N;(ce==="undefined"||ce==="boolean")&&(N=null);var Y=!1;if(N===null)Y=!0;else switch(ce){case"bigint":case"string":case"number":Y=!0;break;case"object":switch(N.$$typeof){case e:case n:Y=!0;break;case S:return Y=N._init,F(Y(N._payload),H,Q,le,ee)}}if(Y)return ee=ee(N),Y=le===""?"."+V(N,0):le,L(ee)?(Q="",Y!=null&&(Q=Y.replace(j,"$&/")+"/"),F(ee,H,Q,"",function(fe){return fe})):ee!=null&&(q(ee)&&(ee=G(ee,Q+(ee.key==null||N&&N.key===ee.key?"":(""+ee.key).replace(j,"$&/")+"/")+Y)),H.push(ee)),1;Y=0;var P=le===""?".":le+":";if(L(N))for(var re=0;re<N.length;re++)le=N[re],ce=P+V(le,re),Y+=F(le,H,Q,ce,ee);else if(re=x(N),typeof re=="function")for(N=re.call(N),re=0;!(le=N.next()).done;)le=le.value,ce=P+V(le,re++),Y+=F(le,H,Q,ce,ee);else if(ce==="object"){if(typeof N.then=="function")return F(U(N),H,Q,le,ee);throw H=String(N),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return Y}function K(N,H,Q){if(N==null)return N;var le=[],ee=0;return F(N,le,"","",function(ce){return H.call(Q,ce,ee++)}),le}function X(N){if(N._status===-1){var H=N._result;H=H(),H.then(function(Q){(N._status===0||N._status===-1)&&(N._status=1,N._result=Q)},function(Q){(N._status===0||N._status===-1)&&(N._status=2,N._result=Q)}),N._status===-1&&(N._status=0,N._result=H)}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 H=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(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},B={map:K,forEach:function(N,H,Q){K(N,function(){H.apply(this,arguments)},Q)},count:function(N){var H=0;return K(N,function(){H++}),H},toArray:function(N){return K(N,function(H){return H})||[]},only:function(N){if(!q(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return qe.Activity=p,qe.Children=B,qe.Component=y,qe.Fragment=r,qe.Profiler=o,qe.PureComponent=b,qe.StrictMode=a,qe.Suspense=u,qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,qe.__COMPILER_RUNTIME={__proto__:null,c:function(N){return M.H.useMemoCache(N)}},qe.cache=function(N){return function(){return N.apply(null,arguments)}},qe.cacheSignal=function(){return null},qe.cloneElement=function(N,H,Q){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var le=E({},N.props),ee=N.key;if(H!=null)for(ce in H.key!==void 0&&(ee=""+H.key),H)!k.call(H,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&H.ref===void 0||(le[ce]=H[ce]);var ce=arguments.length-2;if(ce===1)le.children=Q;else if(1<ce){for(var Y=Array(ce),P=0;P<ce;P++)Y[P]=arguments[P+2];le.children=Y}return I(N.type,ee,le)},qe.createContext=function(N){return N={$$typeof:g,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:h,_context:N},N},qe.createElement=function(N,H,Q){var le,ee={},ce=null;if(H!=null)for(le in H.key!==void 0&&(ce=""+H.key),H)k.call(H,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(ee[le]=H[le]);var Y=arguments.length-2;if(Y===1)ee.children=Q;else if(1<Y){for(var P=Array(Y),re=0;re<Y;re++)P[re]=arguments[re+2];ee.children=P}if(N&&N.defaultProps)for(le in Y=N.defaultProps,Y)ee[le]===void 0&&(ee[le]=Y[le]);return I(N,ce,ee)},qe.createRef=function(){return{current:null}},qe.forwardRef=function(N){return{$$typeof:c,render:N}},qe.isValidElement=q,qe.lazy=function(N){return{$$typeof:S,_payload:{_status:-1,_result:N},_init:X}},qe.memo=function(N,H){return{$$typeof:d,type:N,compare:H===void 0?null:H}},qe.startTransition=function(N){var H=M.T,Q={};M.T=Q;try{var le=N(),ee=M.S;ee!==null&&ee(Q,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(R,D)}catch(ce){D(ce)}finally{H!==null&&Q.types!==null&&(H.types=Q.types),M.T=H}},qe.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},qe.use=function(N){return M.H.use(N)},qe.useActionState=function(N,H,Q){return M.H.useActionState(N,H,Q)},qe.useCallback=function(N,H){return M.H.useCallback(N,H)},qe.useContext=function(N){return M.H.useContext(N)},qe.useDebugValue=function(){},qe.useDeferredValue=function(N,H){return M.H.useDeferredValue(N,H)},qe.useEffect=function(N,H){return M.H.useEffect(N,H)},qe.useEffectEvent=function(N){return M.H.useEffectEvent(N)},qe.useId=function(){return M.H.useId()},qe.useImperativeHandle=function(N,H,Q){return M.H.useImperativeHandle(N,H,Q)},qe.useInsertionEffect=function(N,H){return M.H.useInsertionEffect(N,H)},qe.useLayoutEffect=function(N,H){return M.H.useLayoutEffect(N,H)},qe.useMemo=function(N,H){return M.H.useMemo(N,H)},qe.useOptimistic=function(N,H){return M.H.useOptimistic(N,H)},qe.useReducer=function(N,H,Q){return M.H.useReducer(N,H,Q)},qe.useRef=function(N){return M.H.useRef(N)},qe.useState=function(N){return M.H.useState(N)},qe.useSyncExternalStore=function(N,H,Q){return M.H.useSyncExternalStore(N,H,Q)},qe.useTransition=function(){return M.H.useTransition()},qe.version="19.2.7",qe}var vb;function Hm(){return vb||(vb=1,Pf.exports=d5()),Pf.exports}var $=Hm(),zf={exports:{}},_l={},$f={exports:{}},Hf={};var bb;function f5(){return bb||(bb=1,(function(e){function n(F,K){var X=F.length;F.push(K);e:for(;0<X;){var D=X-1>>>1,B=F[D];if(0<o(B,K))F[D]=K,F[X]=B,X=D;else break e}}function r(F){return F.length===0?null:F[0]}function a(F){if(F.length===0)return null;var K=F[0],X=F.pop();if(X!==K){F[0]=X;e:for(var D=0,B=F.length,N=B>>>1;D<N;){var H=2*(D+1)-1,Q=F[H],le=H+1,ee=F[le];if(0>o(Q,X))le<B&&0>o(ee,Q)?(F[D]=ee,F[le]=X,D=le):(F[D]=Q,F[H]=X,D=H);else if(le<B&&0>o(ee,X))F[D]=ee,F[le]=X,D=le;else break e}}return K}function o(F,K){var X=F.sortIndex-K.sortIndex;return X!==0?X:F.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;e.unstable_now=function(){return h.now()}}else{var g=Date,c=g.now();e.unstable_now=function(){return g.now()-c}}var u=[],d=[],S=1,p=null,C=3,x=!1,A=!1,E=!1,m=!1,y=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function T(F){for(var K=r(d);K!==null;){if(K.callback===null)a(d);else if(K.startTime<=F)a(d),K.sortIndex=K.expirationTime,n(u,K);else break;K=r(d)}}function L(F){if(E=!1,T(F),!A)if(r(u)!==null)A=!0,R||(R=!0,W());else{var K=r(d);K!==null&&U(L,K.startTime-F)}}var R=!1,M=-1,k=5,I=-1;function G(){return m?!0:!(e.unstable_now()-I<k)}function q(){if(m=!1,R){var F=e.unstable_now();I=F;var K=!0;try{e:{A=!1,E&&(E=!1,f(M),M=-1),x=!0;var X=C;try{t:{for(T(F),p=r(u);p!==null&&!(p.expirationTime>F&&G());){var D=p.callback;if(typeof D=="function"){p.callback=null,C=p.priorityLevel;var B=D(p.expirationTime<=F);if(F=e.unstable_now(),typeof B=="function"){p.callback=B,T(F),K=!0;break t}p===r(u)&&a(u),T(F)}else a(u);p=r(u)}if(p!==null)K=!0;else{var N=r(d);N!==null&&U(L,N.startTime-F),K=!1}}break e}finally{p=null,C=X,x=!1}K=void 0}}finally{K?W():R=!1}}}var W;if(typeof b=="function")W=function(){b(q)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,V=j.port2;j.port1.onmessage=q,W=function(){V.postMessage(null)}}else W=function(){y(q,0)};function U(F,K){M=y(function(){F(e.unstable_now())},K)}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(F){F.callback=null},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return C},e.unstable_next=function(F){switch(C){case 1:case 2:case 3:var K=3;break;default:K=C}var X=C;C=K;try{return F()}finally{C=X}},e.unstable_requestPaint=function(){m=!0},e.unstable_runWithPriority=function(F,K){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var X=C;C=F;try{return K()}finally{C=X}},e.unstable_scheduleCallback=function(F,K,X){var D=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?D+X:D):X=D,F){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=X+B,F={id:S++,callback:K,priorityLevel:F,startTime:X,expirationTime:B,sortIndex:-1},X>D?(F.sortIndex=X,n(d,F),r(u)===null&&F===r(d)&&(E?(f(M),M=-1):E=!0,U(L,X-D))):(F.sortIndex=B,n(u,F),A||x||(A=!0,R||(R=!0,W()))),F},e.unstable_shouldYield=G,e.unstable_wrapCallback=function(F){var K=C;return function(){var X=C;C=K;try{return F.apply(this,arguments)}finally{C=X}}}})(Hf)),Hf}var yb;function p5(){return yb||(yb=1,$f.exports=f5()),$f.exports}var Uf={exports:{}},Nn={};var Sb;function m5(){if(Sb)return Nn;Sb=1;var e=Hm();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 h(u,d,S){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:p==null?null:""+p,children:u,containerInfo:d,implementation:S}}var g=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 h(u,d,null,S)},Nn.flushSync=function(u){var d=g.T,S=a.p;try{if(g.T=null,a.p=2,u)return u()}finally{g.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,p=c(S,d.crossOrigin),C=typeof d.integrity=="string"?d.integrity:void 0,x=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;S==="style"?a.d.S(u,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:p,integrity:C,fetchPriority:x}):S==="script"&&a.d.X(u,{crossOrigin:p,integrity:C,fetchPriority:x,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,p=c(S,d.crossOrigin);a.d.L(u,S,{crossOrigin:p,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 g.H.useFormState(u,d,S)},Nn.useFormStatus=function(){return g.H.useHostTransitionStatus()},Nn.version="19.2.7",Nn}var wb;function _S(){if(wb)return Uf.exports;wb=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(),Uf.exports=m5(),Uf.exports}var Cb;function g5(){if(Cb)return _l;Cb=1;var e=p5(),n=Hm(),r=_S();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 h(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 g(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(h(t)!==t)throw Error(a(188))}function d(t){var i=t.alternate;if(!i){if(i=h(t),i===null)throw Error(a(188));return i!==t?null:t}for(var s=t,l=i;;){var _=s.return;if(_===null)break;var w=_.alternate;if(w===null){if(l=_.return,l!==null){s=l;continue}break}if(_.child===w.child){for(w=_.child;w;){if(w===s)return u(_),t;if(w===l)return u(_),i;w=w.sibling}throw Error(a(188))}if(s.return!==l.return)s=_,l=w;else{for(var O=!1,z=_.child;z;){if(z===s){O=!0,s=_,l=w;break}if(z===l){O=!0,l=_,s=w;break}z=z.sibling}if(!O){for(z=w.child;z;){if(z===s){O=!0,s=w,l=_;break}if(z===l){O=!0,l=w,s=_;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 p=Object.assign,C=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),b=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),G=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function W(t){return t===null||typeof t!="object"?null:(t=q&&t[q]||t["@@iterator"],typeof t=="function"?t:null)}var j=Symbol.for("react.client.reference");function V(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 E:return"Fragment";case y:return"Profiler";case m:return"StrictMode";case L:return"Suspense";case R:return"SuspenseList";case I:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case A:return"Portal";case b:return t.displayName||"Context";case f: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:V(t.type)||"Memo";case k:i=t._payload,t=t._init;try{return V(t(i))}catch{}}return null}var U=Array.isArray,F=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},D=[],B=-1;function N(t){return{current:t}}function H(t){0>B||(t.current=D[B],D[B]=null,B--)}function Q(t,i){B++,D[B]=t.current,t.current=i}var le=N(null),ee=N(null),ce=N(null),Y=N(null);function P(t,i){switch(Q(ce,i),Q(ee,t),Q(le,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?P0(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=P0(i),t=z0(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}H(le),Q(le,t)}function re(){H(le),H(ee),H(ce)}function fe(t){t.memoizedState!==null&&Q(Y,t);var i=le.current,s=z0(i,t.type);i!==s&&(Q(ee,t),Q(le,s))}function Se(t){ee.current===t&&(H(le),H(ee)),Y.current===t&&(H(Y),dl._currentValue=X)}var ye,Pe;function We(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 Ze=!1;function xt(t,i){if(!t||Ze)return"";Ze=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(i){var me=function(){throw Error()};if(Object.defineProperty(me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(me,[])}catch(ue){var oe=ue}Reflect.construct(t,[],me)}else{try{me.call()}catch(ue){oe=ue}t.call(me.prototype)}}else{try{throw Error()}catch(ue){oe=ue}(me=t())&&typeof me.catch=="function"&&me.catch(function(){})}}catch(ue){if(ue&&oe&&typeof ue.stack=="string")return[ue.stack,oe.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var _=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");_&&_.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=l.DetermineComponentFrameRoot(),O=w[0],z=w[1];if(O&&z){var J=O.split(`
4
- `),ae=z.split(`
5
- `);for(_=l=0;l<J.length&&!J[l].includes("DetermineComponentFrameRoot");)l++;for(;_<ae.length&&!ae[_].includes("DetermineComponentFrameRoot");)_++;if(l===J.length||_===ae.length)for(l=J.length-1,_=ae.length-1;1<=l&&0<=_&&J[l]!==ae[_];)_--;for(;1<=l&&0<=_;l--,_--)if(J[l]!==ae[_]){if(l!==1||_!==1)do if(l--,_--,0>_||J[l]!==ae[_]){var he=`
6
- `+J[l].replace(" at new "," at ");return t.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",t.displayName)),he}while(1<=l&&0<=_);break}}}finally{Ze=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?We(s):""}function Ne(t,i){switch(t.tag){case 26:case 27:case 5:return We(t.type);case 16:return We("Lazy");case 13:return t.child!==i&&i!==null?We("Suspense Fallback"):We("Suspense");case 19:return We("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 We("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 Sn=Object.prototype.hasOwnProperty,wn=e.unstable_scheduleCallback,_i=e.unstable_cancelCallback,Bi=e.unstable_shouldYield,tn=e.unstable_requestPaint,ht=e.unstable_now,Vt=e.unstable_getCurrentPriorityLevel,Pt=e.unstable_ImmediatePriority,zt=e.unstable_UserBlockingPriority,nn=e.unstable_NormalPriority,ji=e.unstable_LowPriority,Dn=e.unstable_IdlePriority,ri=e.log,ft=e.unstable_setDisableYieldValue,Fn=null,Yt=null;function Xt(t){if(typeof ri=="function"&&ft(t),Yt&&typeof Yt.setStrictMode=="function")try{Yt.setStrictMode(Fn,t)}catch{}}var $t=Math.clz32?Math.clz32:da,Rs=Math.log,cr=Math.LN2;function da(t){return t>>>=0,t===0?32:31-(Rs(t)/cr|0)|0}var Pi=256,Yi=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 te(t,i,s){var l=t.pendingLanes;if(l===0)return 0;var _=0,w=t.suspendedLanes,O=t.pingedLanes;t=t.warmLanes;var z=l&134217727;return z!==0?(l=z&~w,l!==0?_=rn(l):(O&=z,O!==0?_=rn(O):s||(s=z&~t,s!==0&&(_=rn(s))))):(z=l&~w,z!==0?_=rn(z):O!==0?_=rn(O):s||(s=l&~t,s!==0&&(_=rn(s)))),_===0?0:i!==0&&i!==_&&(i&w)===0&&(w=_&-_,s=i&-i,w>=s||w===32&&(s&4194048)!==0)?i:_}function de(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 Be(){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,_,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,J=t.expirationTimes,ae=t.hiddenUpdates;for(s=O&~s;0<s;){var he=31-$t(s),me=1<<he;z[he]=0,J[he]=-1;var oe=ae[he];if(oe!==null)for(ae[he]=null,he=0;he<oe.length;he++){var ue=oe[he];ue!==null&&(ue.lane&=-536870913)}s&=~me}l!==0&&Ce(t,l,0),w!==0&&_===0&&t.tag!==0&&(t.suspendedLanes|=w&~(O&~i))}function Ce(t,i,s){t.pendingLanes|=i,t.suspendedLanes&=~i;var l=31-$t(i);t.entangledLanes|=i,t.entanglements[l]=t.entanglements[l]|1073741824|s&261930}function ze(t,i){var s=t.entangledLanes|=i;for(t=t.entanglements;s;){var l=31-$t(s),_=1<<l;_&i|t[l]&i&&(t[l]|=i),s&=~_}}function Bt(t,i){var s=i&-i;return s=(s&42)!==0?1:tt(s),(s&(t.suspendedLanes|i))!==0?0:s}function tt(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 Cn(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function hr(){var t=K.p;return t!==0?t:(t=window.event,t===void 0?32:lb(t.type))}function dr(t,i){var s=K.p;try{return K.p=t,i()}finally{K.p=s}}var qn=Math.random().toString(36).slice(2),At="__reactFiber$"+qn,Et="__reactProps$"+qn,zi="__reactContainer$"+qn,Fr="__reactEvents$"+qn,fa="__reactListeners$"+qn,fr="__reactHandles$"+qn,Ls="__reactResources$"+qn,Xi="__reactMarker$"+qn;function De(t){delete t[At],delete t[Et],delete t[Fr],delete t[fa],delete t[fr]}function Z(t){var i=t[At];if(i)return i;for(var s=t.parentNode;s;){if(i=s[zi]||s[At]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(t=G0(t);t!==null;){if(s=t[At])return s;t=G0(t)}return i}t=s,s=t.parentNode}return null}function ge(t){if(t=t[At]||t[zi]){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[Ls];return i||(i=t[Ls]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Je(t){t[Xi]=!0}var kt=new Set,Ht={};function Ut(t,i){_e(t,i),_e(t+"Capture",i)}function _e(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 Sn.call(ot,t)?!0:Sn.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 Wn(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 rc(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 _=l.get,w=l.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return _.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 pa(t){if(!t._valueTracker){var i=ai(t)?"checked":"value";t._valueTracker=rc(t,i,""+t[i])}}function Eo(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 ma(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 Ih=/[\n"\\]/g;function Gn(t){return t.replace(Ih,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function To(t,i,s,l,_,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?ga(t,O,Tt(i)):s!=null?ga(t,O,Tt(s)):l!=null&&t.removeAttribute("value"),_==null&&w!=null&&(t.defaultChecked=!!w),_!=null&&(t.checked=_&&typeof _!="function"&&typeof _!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?t.name=""+Tt(z):t.removeAttribute("name")}function Ms(t,i,s,l,_,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)){pa(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??_,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),pa(t)}function ga(t,i,s){i==="number"&&ma(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function xn(t,i,s,l){if(t=t.options,i){i={};for(var _=0;_<s.length;_++)i["$"+s[_]]=!0;for(s=0;s<t.length;s++)_=i.hasOwnProperty("$"+t[s].value),t[s].selected!==_&&(t[s].selected=_),_&&l&&(t[s].defaultSelected=!0)}else{for(s=""+Tt(s),i=null,_=0;_<t.length;_++){if(t[_].value===s){t[_].selected=!0,l&&(t[_].defaultSelected=!0);return}i!==null||t[_].disabled||(i=t[_])}i!==null&&(i.selected=!0)}}function sc(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 _a(t,i,s,l){if(i==null){if(l!=null){if(s!=null)throw Error(a(92));if(U(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),pa(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 ac=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||ac.has(i)?i==="float"?t.cssFloat=s:t[i]=(""+s).trim():t[i]=s+"px"}function mt(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 _ in i)l=i[_],i.hasOwnProperty(_)&&s[_]!==l&&sn(t,_,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"]]),Ao=/^[\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 Ao.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function we(){}var Re=null;function Ge(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var nt=null,jt=null;function vi(t){var i=ge(t);if(i&&(t=i.stateNode)){var s=t[Et]||null;e:switch(t=i.stateNode,i.type){case"input":if(To(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="'+Gn(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var l=s[i];if(l!==t&&l.form===t.form){var _=l[Et]||null;if(!_)throw Error(a(90));To(l,_.value,_.defaultValue,_.defaultValue,_.checked,_.defaultChecked,_.type,_.name)}}for(i=0;i<s.length;i++)l=s[i],l.form===t.form&&Eo(l)}break e;case"textarea":sc(t,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&xn(t,!!s.multiple,i,!1)}}}var ko=!1;function oc(t,i,s){if(ko)return t(i,s);ko=!0;try{var l=t(i);return l}finally{if(ko=!1,(nt!==null||jt!==null)&&(Vc(),nt&&(i=nt,t=jt,jt=nt=null,vi(i),t)))for(i=0;i<t.length;i++)vi(t[i])}}function Ro(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 mr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bh=!1;if(mr)try{var Lo={};Object.defineProperty(Lo,"passive",{get:function(){Bh=!0}}),window.addEventListener("test",Lo,Lo),window.removeEventListener("test",Lo,Lo)}catch{Bh=!1}var Gr=null,jh=null,lc=null;function zg(){if(lc)return lc;var t,i=jh,s=i.length,l,_="value"in Gr?Gr.value:Gr.textContent,w=_.length;for(t=0;t<s&&i[t]===_[t];t++);var O=s-t;for(l=1;l<=O&&i[s-l]===_[w-l];l++);return lc=_.slice(t,1<l?1-l:void 0)}function cc(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 uc(){return!0}function $g(){return!1}function Kn(t){function i(s,l,_,w,O){this._reactName=s,this._targetInst=_,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)?uc:$g,this.isPropagationStopped=$g,this}return p(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=uc)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=uc)},persist:function(){},isPersistent:uc}),i}var Ds={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hc=Kn(Ds),Mo=p({},Ds,{view:0,detail:0}),o2=Kn(Mo),Ph,zh,Do,dc=p({},Mo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hh,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!==Do&&(Do&&t.type==="mousemove"?(Ph=t.screenX-Do.screenX,zh=t.screenY-Do.screenY):zh=Ph=0,Do=t),Ph)},movementY:function(t){return"movementY"in t?t.movementY:zh}}),Hg=Kn(dc),l2=p({},dc,{dataTransfer:0}),c2=Kn(l2),u2=p({},Mo,{relatedTarget:0}),$h=Kn(u2),h2=p({},Ds,{animationName:0,elapsedTime:0,pseudoElement:0}),d2=Kn(h2),f2=p({},Ds,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),p2=Kn(f2),m2=p({},Ds,{data:0}),Ug=Kn(m2),g2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_2={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"},v2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function b2(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=v2[t])?!!i[t]:!1}function Hh(){return b2}var y2=p({},Mo,{key:function(t){if(t.key){var i=g2[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=cc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?_2[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hh,charCode:function(t){return t.type==="keypress"?cc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?cc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),S2=Kn(y2),w2=p({},dc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fg=Kn(w2),C2=p({},Mo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hh}),x2=Kn(C2),E2=p({},Ds,{propertyName:0,elapsedTime:0,pseudoElement:0}),T2=Kn(E2),A2=p({},dc,{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}),k2=Kn(A2),R2=p({},Ds,{newState:0,oldState:0}),L2=Kn(R2),M2=[9,13,27,32],Uh=mr&&"CompositionEvent"in window,Oo=null;mr&&"documentMode"in document&&(Oo=document.documentMode);var D2=mr&&"TextEvent"in window&&!Oo,qg=mr&&(!Uh||Oo&&8<Oo&&11>=Oo),Wg=" ",Gg=!1;function Kg(t,i){switch(t){case"keyup":return M2.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vg(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var va=!1;function O2(t,i){switch(t){case"compositionend":return Vg(i);case"keypress":return i.which!==32?null:(Gg=!0,Wg);case"textInput":return t=i.data,t===Wg&&Gg?null:t;default:return null}}function N2(t,i){if(va)return t==="compositionend"||!Uh&&Kg(t,i)?(t=zg(),lc=jh=Gr=null,va=!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 qg&&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 Yg(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!I2[t.type]:i==="textarea"}function Xg(t,i,s,l){nt?jt?jt.push(l):jt=[l]:nt=l,i=tu(i,"onChange"),0<i.length&&(s=new hc("onChange","change",null,s,l),t.push({event:s,listeners:i}))}var No=null,Io=null;function B2(t){D0(t,0)}function fc(t){var i=xe(t);if(Eo(i))return t}function Zg(t,i){if(t==="change")return i}var Jg=!1;if(mr){var Fh;if(mr){var qh="oninput"in document;if(!qh){var Qg=document.createElement("div");Qg.setAttribute("oninput","return;"),qh=typeof Qg.oninput=="function"}Fh=qh}else Fh=!1;Jg=Fh&&(!document.documentMode||9<document.documentMode)}function e_(){No&&(No.detachEvent("onpropertychange",t_),Io=No=null)}function t_(t){if(t.propertyName==="value"&&fc(Io)){var i=[];Xg(i,Io,t,Ge(t)),oc(B2,i)}}function j2(t,i,s){t==="focusin"?(e_(),No=i,Io=s,No.attachEvent("onpropertychange",t_)):t==="focusout"&&e_()}function P2(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return fc(Io)}function z2(t,i){if(t==="click")return fc(i)}function $2(t,i){if(t==="input"||t==="change")return fc(i)}function H2(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var oi=typeof Object.is=="function"?Object.is:H2;function Bo(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 _=s[l];if(!Sn.call(i,_)||!oi(t[_],i[_]))return!1}return!0}function n_(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function i_(t,i){var s=n_(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=n_(s)}}function r_(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?r_(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function s_(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var i=ma(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=ma(t.document)}return i}function Wh(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=mr&&"documentMode"in document&&11>=document.documentMode,ba=null,Gh=null,jo=null,Kh=!1;function a_(t,i,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Kh||ba==null||ba!==ma(l)||(l=ba,"selectionStart"in l&&Wh(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}),jo&&Bo(jo,l)||(jo=l,l=tu(Gh,"onSelect"),0<l.length&&(i=new hc("onSelect","select",null,i,s),t.push({event:i,listeners:l}),i.target=ba)))}function Os(t,i){var s={};return s[t.toLowerCase()]=i.toLowerCase(),s["Webkit"+t]="webkit"+i,s["Moz"+t]="moz"+i,s}var ya={animationend:Os("Animation","AnimationEnd"),animationiteration:Os("Animation","AnimationIteration"),animationstart:Os("Animation","AnimationStart"),transitionrun:Os("Transition","TransitionRun"),transitionstart:Os("Transition","TransitionStart"),transitioncancel:Os("Transition","TransitionCancel"),transitionend:Os("Transition","TransitionEnd")},Vh={},o_={};mr&&(o_=document.createElement("div").style,"AnimationEvent"in window||(delete ya.animationend.animation,delete ya.animationiteration.animation,delete ya.animationstart.animation),"TransitionEvent"in window||delete ya.transitionend.transition);function Ns(t){if(Vh[t])return Vh[t];if(!ya[t])return t;var i=ya[t],s;for(s in i)if(i.hasOwnProperty(s)&&s in o_)return Vh[t]=i[s];return t}var l_=Ns("animationend"),c_=Ns("animationiteration"),u_=Ns("animationstart"),F2=Ns("transitionrun"),q2=Ns("transitionstart"),W2=Ns("transitioncancel"),h_=Ns("transitionend"),d_=new Map,Yh="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(" ");Yh.push("scrollEnd");function $i(t,i){d_.set(t,i),Ut(i,[t])}var pc=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)},bi=[],Sa=0,Xh=0;function mc(){for(var t=Sa,i=Xh=Sa=0;i<t;){var s=bi[i];bi[i++]=null;var l=bi[i];bi[i++]=null;var _=bi[i];bi[i++]=null;var w=bi[i];if(bi[i++]=null,l!==null&&_!==null){var O=l.pending;O===null?_.next=_:(_.next=O.next,O.next=_),l.pending=_}w!==0&&f_(s,_,w)}}function gc(t,i,s,l){bi[Sa++]=t,bi[Sa++]=i,bi[Sa++]=s,bi[Sa++]=l,Xh|=l,t.lanes|=l,t=t.alternate,t!==null&&(t.lanes|=l)}function Zh(t,i,s,l){return gc(t,i,s,l),_c(t)}function Is(t,i){return gc(t,null,null,i),_c(t)}function f_(t,i,s){t.lanes|=s;var l=t.alternate;l!==null&&(l.lanes|=s);for(var _=!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||(_=!0)),t=w,w=w.return;return t.tag===3?(w=t.stateNode,_&&i!==null&&(_=31-$t(s),t=w.hiddenUpdates,l=t[_],l===null?t[_]=[i]:l.push(i),i.lane=s|536870912),w):null}function _c(t){if(50<sl)throw sl=0,of=null,Error(a(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var wa={};function G2(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 G2(t,i,s,l)}function Jh(t){return t=t.prototype,!(!t||!t.isReactComponent)}function gr(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 p_(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 vc(t,i,s,l,_,w){var O=0;if(l=t,typeof t=="function")Jh(t)&&(O=1);else if(typeof t=="string")O=ZE(t,s,le.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case I:return t=li(31,s,i,_),t.elementType=I,t.lanes=w,t;case E:return Bs(s.children,_,w,i);case m:O=8,_|=24;break;case y:return t=li(12,s,i,_|2),t.elementType=y,t.lanes=w,t;case L:return t=li(13,s,i,_),t.elementType=L,t.lanes=w,t;case R:return t=li(19,s,i,_),t.elementType=R,t.lanes=w,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case b:O=10;break e;case f: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,_),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 Qh(t,i,s){return t=li(6,t,null,i),t.lanes=s,t}function m_(t){var i=li(18,null,null,0);return i.stateNode=t,i}function ed(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 g_=new WeakMap;function yi(t,i){if(typeof t=="object"&&t!==null){var s=g_.get(t);return s!==void 0?s:(i={value:t,source:i,stack:en(i)},g_.set(t,i),i)}return{value:t,source:i,stack:en(i)}}var Ca=[],xa=0,bc=null,Po=0,Si=[],wi=0,Kr=null,Zi=1,Ji="";function _r(t,i){Ca[xa++]=Po,Ca[xa++]=bc,bc=t,Po=i}function __(t,i,s){Si[wi++]=Zi,Si[wi++]=Ji,Si[wi++]=Kr,Kr=t;var l=Zi;t=Ji;var _=32-$t(l)-1;l&=~(1<<_),s+=1;var w=32-$t(i)+_;if(30<w){var O=_-_%5;w=(l&(1<<O)-1).toString(32),l>>=O,_-=O,Zi=1<<32-$t(i)+_|s<<_|l,Ji=w+t}else Zi=1<<w|s<<_|l,Ji=t}function td(t){t.return!==null&&(_r(t,1),__(t,1,0))}function nd(t){for(;t===bc;)bc=Ca[--xa],Ca[xa]=null,Po=Ca[--xa],Ca[xa]=null;for(;t===Kr;)Kr=Si[--wi],Si[wi]=null,Ji=Si[--wi],Si[wi]=null,Zi=Si[--wi],Si[wi]=null}function v_(t,i){Si[wi++]=Zi,Si[wi++]=Ji,Si[wi++]=Kr,Zi=i.id,Ji=i.overflow,Kr=t}var En=null,Rt=null,at=!1,Vr=null,Ci=!1,id=Error(a(519));function Yr(t){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw zo(yi(i,t)),id}function b_(t){var i=t.stateNode,s=t.type,l=t.memoizedProps;switch(i[At]=t,i[Et]=l,s){case"dialog":et("cancel",i),et("close",i);break;case"iframe":case"object":case"embed":et("load",i);break;case"video":case"audio":for(s=0;s<ol.length;s++)et(ol[s],i);break;case"source":et("error",i);break;case"img":case"image":case"link":et("error",i),et("load",i);break;case"details":et("toggle",i);break;case"input":et("invalid",i),Ms(i,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":et("invalid",i);break;case"textarea":et("invalid",i),_a(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||B0(i.textContent,s)?(l.popover!=null&&(et("beforetoggle",i),et("toggle",i)),l.onScroll!=null&&et("scroll",i),l.onScrollEnd!=null&&et("scrollend",i),l.onClick!=null&&(i.onclick=we),i=!0):i=!1,i||Yr(t,!0)}function y_(t){for(En=t.return;En;)switch(En.tag){case 5:case 31:case 13:Ci=!1;return;case 27:case 3:Ci=!0;return;default:En=En.return}}function Ea(t){if(t!==En)return!1;if(!at)return y_(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")||wf(t.type,t.memoizedProps)),s=!s),s&&Rt&&Yr(t),y_(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));Rt=W0(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));Rt=W0(t)}else i===27?(i=Rt,cs(t.type)?(t=Af,Af=null,Rt=t):Rt=i):Rt=En?Ei(t.stateNode.nextSibling):null;return!0}function js(){Rt=En=null,at=!1}function rd(){var t=Vr;return t!==null&&(Zn===null?Zn=t:Zn.push.apply(Zn,t),Vr=null),t}function zo(t){Vr===null?Vr=[t]:Vr.push(t)}var sd=N(null),Ps=null,vr=null;function Xr(t,i,s){Q(sd,i._currentValue),i._currentValue=s}function br(t){t._currentValue=sd.current,H(sd)}function ad(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 od(t,i,s,l){var _=t.child;for(_!==null&&(_.return=t);_!==null;){var w=_.dependencies;if(w!==null){var O=_.child;w=w.firstContext;e:for(;w!==null;){var z=w;w=_;for(var J=0;J<i.length;J++)if(z.context===i[J]){w.lanes|=s,z=w.alternate,z!==null&&(z.lanes|=s),ad(w.return,s,t),l||(O=null);break e}w=z.next}}else if(_.tag===18){if(O=_.return,O===null)throw Error(a(341));O.lanes|=s,w=O.alternate,w!==null&&(w.lanes|=s),ad(O,s,t),O=null}else O=_.child;if(O!==null)O.return=_;else for(O=_;O!==null;){if(O===t){O=null;break}if(_=O.sibling,_!==null){_.return=O.return,O=_;break}O=O.return}_=O}}function Ta(t,i,s,l){t=null;for(var _=i,w=!1;_!==null;){if(!w){if((_.flags&524288)!==0)w=!0;else if((_.flags&262144)!==0)break}if(_.tag===10){var O=_.alternate;if(O===null)throw Error(a(387));if(O=O.memoizedProps,O!==null){var z=_.type;oi(_.pendingProps.value,O.value)||(t!==null?t.push(z):t=[z])}}else if(_===Y.current){if(O=_.alternate,O===null)throw Error(a(387));O.memoizedState.memoizedState!==_.memoizedState.memoizedState&&(t!==null?t.push(dl):t=[dl])}_=_.return}t!==null&&od(i,t,s,l),i.flags|=262144}function yc(t){for(t=t.firstContext;t!==null;){if(!oi(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function zs(t){Ps=t,vr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Tn(t){return S_(Ps,t)}function Sc(t,i){return Ps===null&&zs(t),S_(t,i)}function S_(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 K2=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()})}},V2=e.unstable_scheduleCallback,Y2=e.unstable_NormalPriority,an={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ld(){return{controller:new K2,data:new Map,refCount:0}}function $o(t){t.refCount--,t.refCount===0&&V2(Y2,function(){t.controller.abort()})}var Ho=null,cd=0,Aa=0,ka=null;function X2(t,i){if(Ho===null){var s=Ho=[];cd=0,Aa=ff(),ka={status:"pending",value:void 0,then:function(l){s.push(l)}}}return cd++,i.then(w_,w_),i}function w_(){if(--cd===0&&Ho!==null){ka!==null&&(ka.status="fulfilled");var t=Ho;Ho=null,Aa=0,ka=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function Z2(t,i){var s=[],l={status:"pending",value:null,reason:null,then:function(_){s.push(_)}};return t.then(function(){l.status="fulfilled",l.value=i;for(var _=0;_<s.length;_++)(0,s[_])(i)},function(_){for(l.status="rejected",l.reason=_,_=0;_<s.length;_++)(0,s[_])(void 0)}),l}var C_=F.S;F.S=function(t,i){a0=ht(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&X2(t,i),C_!==null&&C_(t,i)};var $s=N(null);function ud(){var t=$s.current;return t!==null?t:Ct.pooledCache}function wc(t,i){i===null?Q($s,$s.current):Q($s,i.pool)}function x_(){var t=ud();return t===null?null:{parent:an._currentValue,pool:t}}var Ra=Error(a(460)),hd=Error(a(474)),Cc=Error(a(542)),xc={then:function(){}};function E_(t){return t=t.status,t==="fulfilled"||t==="rejected"}function T_(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,k_(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 _=i;_.status="fulfilled",_.value=l}},function(l){if(i.status==="pending"){var _=i;_.status="rejected",_.reason=l}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,k_(t),t}throw Us=i,Ra}}function Hs(t){try{var i=t._init;return i(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Us=s,Ra):s}}var Us=null;function A_(){if(Us===null)throw Error(a(459));var t=Us;return Us=null,t}function k_(t){if(t===Ra||t===Cc)throw Error(a(483))}var La=null,Uo=0;function Ec(t){var i=Uo;return Uo+=1,La===null&&(La=[]),T_(La,t,i)}function Fo(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function Tc(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 R_(t){function i(ie,ne){if(t){var se=ie.deletions;se===null?(ie.deletions=[ne],ie.flags|=16):se.push(ne)}}function s(ie,ne){if(!t)return null;for(;ne!==null;)i(ie,ne),ne=ne.sibling;return null}function l(ie){for(var ne=new Map;ie!==null;)ie.key!==null?ne.set(ie.key,ie):ne.set(ie.index,ie),ie=ie.sibling;return ne}function _(ie,ne){return ie=gr(ie,ne),ie.index=0,ie.sibling=null,ie}function w(ie,ne,se){return ie.index=se,t?(se=ie.alternate,se!==null?(se=se.index,se<ne?(ie.flags|=67108866,ne):se):(ie.flags|=67108866,ne)):(ie.flags|=1048576,ne)}function O(ie){return t&&ie.alternate===null&&(ie.flags|=67108866),ie}function z(ie,ne,se,pe){return ne===null||ne.tag!==6?(ne=Qh(se,ie.mode,pe),ne.return=ie,ne):(ne=_(ne,se),ne.return=ie,ne)}function J(ie,ne,se,pe){var Ie=se.type;return Ie===E?he(ie,ne,se.props.children,pe,se.key):ne!==null&&(ne.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===k&&Hs(Ie)===ne.type)?(ne=_(ne,se.props),Fo(ne,se),ne.return=ie,ne):(ne=vc(se.type,se.key,se.props,null,ie.mode,pe),Fo(ne,se),ne.return=ie,ne)}function ae(ie,ne,se,pe){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==se.containerInfo||ne.stateNode.implementation!==se.implementation?(ne=ed(se,ie.mode,pe),ne.return=ie,ne):(ne=_(ne,se.children||[]),ne.return=ie,ne)}function he(ie,ne,se,pe,Ie){return ne===null||ne.tag!==7?(ne=Bs(se,ie.mode,pe,Ie),ne.return=ie,ne):(ne=_(ne,se),ne.return=ie,ne)}function me(ie,ne,se){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return ne=Qh(""+ne,ie.mode,se),ne.return=ie,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case x:return se=vc(ne.type,ne.key,ne.props,null,ie.mode,se),Fo(se,ne),se.return=ie,se;case A:return ne=ed(ne,ie.mode,se),ne.return=ie,ne;case k:return ne=Hs(ne),me(ie,ne,se)}if(U(ne)||W(ne))return ne=Bs(ne,ie.mode,se,null),ne.return=ie,ne;if(typeof ne.then=="function")return me(ie,Ec(ne),se);if(ne.$$typeof===b)return me(ie,Sc(ie,ne),se);Tc(ie,ne)}return null}function oe(ie,ne,se,pe){var Ie=ne!==null?ne.key:null;if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return Ie!==null?null:z(ie,ne,""+se,pe);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case x:return se.key===Ie?J(ie,ne,se,pe):null;case A:return se.key===Ie?ae(ie,ne,se,pe):null;case k:return se=Hs(se),oe(ie,ne,se,pe)}if(U(se)||W(se))return Ie!==null?null:he(ie,ne,se,pe,null);if(typeof se.then=="function")return oe(ie,ne,Ec(se),pe);if(se.$$typeof===b)return oe(ie,ne,Sc(ie,se),pe);Tc(ie,se)}return null}function ue(ie,ne,se,pe,Ie){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return ie=ie.get(se)||null,z(ne,ie,""+pe,Ie);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case x:return ie=ie.get(pe.key===null?se:pe.key)||null,J(ne,ie,pe,Ie);case A:return ie=ie.get(pe.key===null?se:pe.key)||null,ae(ne,ie,pe,Ie);case k:return pe=Hs(pe),ue(ie,ne,se,pe,Ie)}if(U(pe)||W(pe))return ie=ie.get(se)||null,he(ne,ie,pe,Ie,null);if(typeof pe.then=="function")return ue(ie,ne,se,Ec(pe),Ie);if(pe.$$typeof===b)return ue(ie,ne,se,Sc(ne,pe),Ie);Tc(ne,pe)}return null}function Ae(ie,ne,se,pe){for(var Ie=null,lt=null,Le=ne,Ve=ne=0,rt=null;Le!==null&&Ve<se.length;Ve++){Le.index>Ve?(rt=Le,Le=null):rt=Le.sibling;var ct=oe(ie,Le,se[Ve],pe);if(ct===null){Le===null&&(Le=rt);break}t&&Le&&ct.alternate===null&&i(ie,Le),ne=w(ct,ne,Ve),lt===null?Ie=ct:lt.sibling=ct,lt=ct,Le=rt}if(Ve===se.length)return s(ie,Le),at&&_r(ie,Ve),Ie;if(Le===null){for(;Ve<se.length;Ve++)Le=me(ie,se[Ve],pe),Le!==null&&(ne=w(Le,ne,Ve),lt===null?Ie=Le:lt.sibling=Le,lt=Le);return at&&_r(ie,Ve),Ie}for(Le=l(Le);Ve<se.length;Ve++)rt=ue(Le,ie,Ve,se[Ve],pe),rt!==null&&(t&&rt.alternate!==null&&Le.delete(rt.key===null?Ve:rt.key),ne=w(rt,ne,Ve),lt===null?Ie=rt:lt.sibling=rt,lt=rt);return t&&Le.forEach(function(ps){return i(ie,ps)}),at&&_r(ie,Ve),Ie}function $e(ie,ne,se,pe){if(se==null)throw Error(a(151));for(var Ie=null,lt=null,Le=ne,Ve=ne=0,rt=null,ct=se.next();Le!==null&&!ct.done;Ve++,ct=se.next()){Le.index>Ve?(rt=Le,Le=null):rt=Le.sibling;var ps=oe(ie,Le,ct.value,pe);if(ps===null){Le===null&&(Le=rt);break}t&&Le&&ps.alternate===null&&i(ie,Le),ne=w(ps,ne,Ve),lt===null?Ie=ps:lt.sibling=ps,lt=ps,Le=rt}if(ct.done)return s(ie,Le),at&&_r(ie,Ve),Ie;if(Le===null){for(;!ct.done;Ve++,ct=se.next())ct=me(ie,ct.value,pe),ct!==null&&(ne=w(ct,ne,Ve),lt===null?Ie=ct:lt.sibling=ct,lt=ct);return at&&_r(ie,Ve),Ie}for(Le=l(Le);!ct.done;Ve++,ct=se.next())ct=ue(Le,ie,Ve,ct.value,pe),ct!==null&&(t&&ct.alternate!==null&&Le.delete(ct.key===null?Ve:ct.key),ne=w(ct,ne,Ve),lt===null?Ie=ct:lt.sibling=ct,lt=ct);return t&&Le.forEach(function(l5){return i(ie,l5)}),at&&_r(ie,Ve),Ie}function yt(ie,ne,se,pe){if(typeof se=="object"&&se!==null&&se.type===E&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case x:e:{for(var Ie=se.key;ne!==null;){if(ne.key===Ie){if(Ie=se.type,Ie===E){if(ne.tag===7){s(ie,ne.sibling),pe=_(ne,se.props.children),pe.return=ie,ie=pe;break e}}else if(ne.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===k&&Hs(Ie)===ne.type){s(ie,ne.sibling),pe=_(ne,se.props),Fo(pe,se),pe.return=ie,ie=pe;break e}s(ie,ne);break}else i(ie,ne);ne=ne.sibling}se.type===E?(pe=Bs(se.props.children,ie.mode,pe,se.key),pe.return=ie,ie=pe):(pe=vc(se.type,se.key,se.props,null,ie.mode,pe),Fo(pe,se),pe.return=ie,ie=pe)}return O(ie);case A:e:{for(Ie=se.key;ne!==null;){if(ne.key===Ie)if(ne.tag===4&&ne.stateNode.containerInfo===se.containerInfo&&ne.stateNode.implementation===se.implementation){s(ie,ne.sibling),pe=_(ne,se.children||[]),pe.return=ie,ie=pe;break e}else{s(ie,ne);break}else i(ie,ne);ne=ne.sibling}pe=ed(se,ie.mode,pe),pe.return=ie,ie=pe}return O(ie);case k:return se=Hs(se),yt(ie,ne,se,pe)}if(U(se))return Ae(ie,ne,se,pe);if(W(se)){if(Ie=W(se),typeof Ie!="function")throw Error(a(150));return se=Ie.call(se),$e(ie,ne,se,pe)}if(typeof se.then=="function")return yt(ie,ne,Ec(se),pe);if(se.$$typeof===b)return yt(ie,ne,Sc(ie,se),pe);Tc(ie,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,ne!==null&&ne.tag===6?(s(ie,ne.sibling),pe=_(ne,se),pe.return=ie,ie=pe):(s(ie,ne),pe=Qh(se,ie.mode,pe),pe.return=ie,ie=pe),O(ie)):s(ie,ne)}return function(ie,ne,se,pe){try{Uo=0;var Ie=yt(ie,ne,se,pe);return La=null,Ie}catch(Le){if(Le===Ra||Le===Cc)throw Le;var lt=li(29,Le,null,ie.mode);return lt.lanes=pe,lt.return=ie,lt}}}var Fs=R_(!0),L_=R_(!1),Zr=!1;function dd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fd(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 _=l.pending;return _===null?i.next=i:(i.next=_.next,_.next=i),l.pending=i,i=_c(t),f_(t,null,s),i}return gc(t,l,i,s),_c(t)}function qo(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,ze(t,s)}}function pd(t,i){var s=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,s===l)){var _=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?_=w=O:w=w.next=O,s=s.next}while(s!==null);w===null?_=w=i:w=w.next=i}else _=w=i;s={baseState:l.baseState,firstBaseUpdate:_,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 md=!1;function Wo(){if(md){var t=ka;if(t!==null)throw t}}function Go(t,i,s,l){md=!1;var _=t.updateQueue;Zr=!1;var w=_.firstBaseUpdate,O=_.lastBaseUpdate,z=_.shared.pending;if(z!==null){_.shared.pending=null;var J=z,ae=J.next;J.next=null,O===null?w=ae:O.next=ae,O=J;var he=t.alternate;he!==null&&(he=he.updateQueue,z=he.lastBaseUpdate,z!==O&&(z===null?he.firstBaseUpdate=ae:z.next=ae,he.lastBaseUpdate=J))}if(w!==null){var me=_.baseState;O=0,he=ae=J=null,z=w;do{var oe=z.lane&-536870913,ue=oe!==z.lane;if(ue?(it&oe)===oe:(l&oe)===oe){oe!==0&&oe===Aa&&(md=!0),he!==null&&(he=he.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var Ae=t,$e=z;oe=i;var yt=s;switch($e.tag){case 1:if(Ae=$e.payload,typeof Ae=="function"){me=Ae.call(yt,me,oe);break e}me=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=$e.payload,oe=typeof Ae=="function"?Ae.call(yt,me,oe):Ae,oe==null)break e;me=p({},me,oe);break e;case 2:Zr=!0}}oe=z.callback,oe!==null&&(t.flags|=64,ue&&(t.flags|=8192),ue=_.callbacks,ue===null?_.callbacks=[oe]:ue.push(oe))}else ue={lane:oe,tag:z.tag,payload:z.payload,callback:z.callback,next:null},he===null?(ae=he=ue,J=me):he=he.next=ue,O|=oe;if(z=z.next,z===null){if(z=_.shared.pending,z===null)break;ue=z,z=ue.next,ue.next=null,_.lastBaseUpdate=ue,_.shared.pending=null}}while(!0);he===null&&(J=me),_.baseState=J,_.firstBaseUpdate=ae,_.lastBaseUpdate=he,w===null&&(_.shared.lanes=0),rs|=O,t.lanes=O,t.memoizedState=me}}function M_(t,i){if(typeof t!="function")throw Error(a(191,t));t.call(i)}function D_(t,i){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)M_(s[t],i)}var Ma=N(null),Ac=N(0);function O_(t,i){t=kr,Q(Ac,t),Q(Ma,i),kr=t|i.baseLanes}function gd(){Q(Ac,kr),Q(Ma,Ma.current)}function _d(){kr=Ac.current,H(Ma),H(Ac)}var ci=N(null),xi=null;function es(t){var i=t.alternate;Q(Zt,Zt.current&1),Q(ci,t),xi===null&&(i===null||Ma.current!==null||i.memoizedState!==null)&&(xi=t)}function vd(t){Q(Zt,Zt.current),Q(ci,t),xi===null&&(xi=t)}function N_(t){t.tag===22?(Q(Zt,Zt.current),Q(ci,t),xi===null&&(xi=t)):ts()}function ts(){Q(Zt,Zt.current),Q(ci,ci.current)}function ui(t){H(ci),xi===t&&(xi=null),H(Zt)}var Zt=N(0);function kc(t){for(var i=t;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Ef(s)||Tf(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,Ke=null,vt=null,on=null,Rc=!1,Da=!1,qs=!1,Lc=0,Ko=0,Oa=null,J2=0;function Ft(){throw Error(a(321))}function bd(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 yd(t,i,s,l,_,w){return yr=w,Ke=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,F.H=t===null||t.memoizedState===null?_v:Id,qs=!1,w=s(l,_),qs=!1,Da&&(w=B_(i,s,l,_)),I_(t),w}function I_(t){F.H=Xo;var i=vt!==null&&vt.next!==null;if(yr=0,on=vt=Ke=null,Rc=!1,Ko=0,Oa=null,i)throw Error(a(300));t===null||ln||(t=t.dependencies,t!==null&&yc(t)&&(ln=!0))}function B_(t,i,s,l){Ke=t;var _=0;do{if(Da&&(Oa=null),Ko=0,Da=!1,25<=_)throw Error(a(301));if(_+=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)}F.H=vv,w=i(s,l)}while(Da);return w}function Q2(){var t=F.H,i=t.useState()[0];return i=typeof i.then=="function"?Vo(i):i,t=t.useState()[0],(vt!==null?vt.memoizedState:null)!==t&&(Ke.flags|=1024),i}function Sd(){var t=Lc!==0;return Lc=0,t}function wd(t,i,s){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~s}function Cd(t){if(Rc){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}Rc=!1}yr=0,on=vt=Ke=null,Da=!1,Ko=Lc=0,Oa=null}function Bn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return on===null?Ke.memoizedState=on=t:on=on.next=t,on}function Jt(){if(vt===null){var t=Ke.alternate;t=t!==null?t.memoizedState:null}else t=vt.next;var i=on===null?Ke.memoizedState:on.next;if(i!==null)on=i,vt=t;else{if(t===null)throw Ke.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?Ke.memoizedState=on=t:on=on.next=t}return on}function Mc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Vo(t){var i=Ko;return Ko+=1,Oa===null&&(Oa=[]),t=T_(Oa,t,i),i=Ke,(on===null?i.memoizedState:on.next)===null&&(i=i.alternate,F.H=i===null||i.memoizedState===null?_v:Id),t}function Dc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Vo(t);if(t.$$typeof===b)return Tn(t)}throw Error(a(438,String(t)))}function xd(t){var i=null,s=Ke.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var l=Ke.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(i={data:l.data.map(function(_){return _.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=Mc(),Ke.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]=G;return i.index++,s}function Sr(t,i){return typeof i=="function"?i(t):i}function Oc(t){var i=Jt();return Ed(i,vt,t)}function Ed(t,i,s){var l=t.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=s;var _=t.baseQueue,w=l.pending;if(w!==null){if(_!==null){var O=_.next;_.next=w.next,w.next=O}i.baseQueue=_=w,l.pending=null}if(w=t.baseState,_===null)t.memoizedState=w;else{i=_.next;var z=O=null,J=null,ae=i,he=!1;do{var me=ae.lane&-536870913;if(me!==ae.lane?(it&me)===me:(yr&me)===me){var oe=ae.revertLane;if(oe===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),me===Aa&&(he=!0);else if((yr&oe)===oe){ae=ae.next,oe===Aa&&(he=!0);continue}else me={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},J===null?(z=J=me,O=w):J=J.next=me,Ke.lanes|=oe,rs|=oe;me=ae.action,qs&&s(w,me),w=ae.hasEagerState?ae.eagerState:s(w,me)}else oe={lane:me,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},J===null?(z=J=oe,O=w):J=J.next=oe,Ke.lanes|=me,rs|=me;ae=ae.next}while(ae!==null&&ae!==i);if(J===null?O=w:J.next=z,!oi(w,t.memoizedState)&&(ln=!0,he&&(s=ka,s!==null)))throw s;t.memoizedState=w,t.baseState=O,t.baseQueue=J,l.lastRenderedState=w}return _===null&&(l.lanes=0),[t.memoizedState,l.dispatch]}function Td(t){var i=Jt(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=t;var l=s.dispatch,_=s.pending,w=i.memoizedState;if(_!==null){s.pending=null;var O=_=_.next;do w=t(w,O.action),O=O.next;while(O!==_);oi(w,i.memoizedState)||(ln=!0),i.memoizedState=w,i.baseQueue===null&&(i.baseState=w),s.lastRenderedState=w}return[w,l]}function j_(t,i,s){var l=Ke,_=Jt(),w=at;if(w){if(s===void 0)throw Error(a(407));s=s()}else s=i();var O=!oi((vt||_).memoizedState,s);if(O&&(_.memoizedState=s,ln=!0),_=_.queue,Rd($_.bind(null,l,_,t),[t]),_.getSnapshot!==i||O||on!==null&&on.memoizedState.tag&1){if(l.flags|=2048,Na(9,{destroy:void 0},z_.bind(null,l,_,s,i),null),Ct===null)throw Error(a(349));w||(yr&127)!==0||P_(l,i,s)}return s}function P_(t,i,s){t.flags|=16384,t={getSnapshot:i,value:s},i=Ke.updateQueue,i===null?(i=Mc(),Ke.updateQueue=i,i.stores=[t]):(s=i.stores,s===null?i.stores=[t]:s.push(t))}function z_(t,i,s,l){i.value=s,i.getSnapshot=l,H_(i)&&U_(t)}function $_(t,i,s){return s(function(){H_(i)&&U_(t)})}function H_(t){var i=t.getSnapshot;t=t.value;try{var s=i();return!oi(t,s)}catch{return!0}}function U_(t){var i=Is(t,2);i!==null&&Jn(i,t,2)}function Ad(t){var i=Bn();if(typeof t=="function"){var s=t;if(t=s(),qs){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 F_(t,i,s,l){return t.baseState=s,Ed(t,vt,typeof l=="function"?l:Sr)}function eE(t,i,s,l,_){if(Bc(t))throw Error(a(485));if(t=i.action,t!==null){var w={payload:_,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){w.listeners.push(O)}};F.T!==null?s(!0):w.isTransition=!1,l(w),s=i.pending,s===null?(w.next=i.pending=w,q_(i,w)):(w.next=s.next,i.pending=s.next=w)}}function q_(t,i){var s=i.action,l=i.payload,_=t.state;if(i.isTransition){var w=F.T,O={};F.T=O;try{var z=s(_,l),J=F.S;J!==null&&J(O,z),W_(t,i,z)}catch(ae){kd(t,i,ae)}finally{w!==null&&O.types!==null&&(w.types=O.types),F.T=w}}else try{w=s(_,l),W_(t,i,w)}catch(ae){kd(t,i,ae)}}function W_(t,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(l){G_(t,i,l)},function(l){return kd(t,i,l)}):G_(t,i,s)}function G_(t,i,s){i.status="fulfilled",i.value=s,K_(i),t.state=s,i=t.pending,i!==null&&(s=i.next,s===i?t.pending=null:(s=s.next,i.next=s,q_(t,s)))}function kd(t,i,s){var l=t.pending;if(t.pending=null,l!==null){l=l.next;do i.status="rejected",i.reason=s,K_(i),i=i.next;while(i!==l)}t.action=null}function K_(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function V_(t,i){return i}function Y_(t,i){if(at){var s=Ct.formState;if(s!==null){e:{var l=Ke;if(at){if(Rt){t:{for(var _=Rt,w=Ci;_.nodeType!==8;){if(!w){_=null;break t}if(_=Ei(_.nextSibling),_===null){_=null;break t}}w=_.data,_=w==="F!"||w==="F"?_:null}if(_){Rt=Ei(_.nextSibling),l=_.data==="F!";break e}}Yr(l)}l=!1}l&&(i=s[0])}}return s=Bn(),s.memoizedState=s.baseState=i,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:V_,lastRenderedState:i},s.queue=l,s=pv.bind(null,Ke,l),l.dispatch=s,l=Ad(!1),w=Nd.bind(null,Ke,!1,l.queue),l=Bn(),_={state:i,dispatch:null,action:t,pending:null},l.queue=_,s=eE.bind(null,Ke,_,w,s),_.dispatch=s,l.memoizedState=t,[i,s,!1]}function X_(t){var i=Jt();return Z_(i,vt,t)}function Z_(t,i,s){if(i=Ed(t,i,V_)[0],t=Oc(Sr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var l=Vo(i)}catch(O){throw O===Ra?Cc:O}else l=i;i=Jt();var _=i.queue,w=_.dispatch;return s!==i.memoizedState&&(Ke.flags|=2048,Na(9,{destroy:void 0},tE.bind(null,_,s),null)),[l,w,t]}function tE(t,i){t.action=i}function J_(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 Na(t,i,s,l){return t={tag:t,create:s,deps:l,inst:i,next:null},i=Ke.updateQueue,i===null&&(i=Mc(),Ke.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 Q_(){return Jt().memoizedState}function Nc(t,i,s,l){var _=Bn();Ke.flags|=t,_.memoizedState=Na(1|i,{destroy:void 0},s,l===void 0?null:l)}function Ic(t,i,s,l){var _=Jt();l=l===void 0?null:l;var w=_.memoizedState.inst;vt!==null&&l!==null&&bd(l,vt.memoizedState.deps)?_.memoizedState=Na(i,w,s,l):(Ke.flags|=t,_.memoizedState=Na(1|i,w,s,l))}function ev(t,i){Nc(8390656,8,t,i)}function Rd(t,i){Ic(2048,8,t,i)}function nE(t){Ke.flags|=4;var i=Ke.updateQueue;if(i===null)i=Mc(),Ke.updateQueue=i,i.events=[t];else{var s=i.events;s===null?i.events=[t]:s.push(t)}}function tv(t){var i=Jt().memoizedState;return nE({ref:i,nextImpl:t}),function(){if((dt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function nv(t,i){return Ic(4,2,t,i)}function iv(t,i){return Ic(4,4,t,i)}function rv(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 sv(t,i,s){s=s!=null?s.concat([t]):null,Ic(4,4,rv.bind(null,i,t),s)}function Ld(){}function av(t,i){var s=Jt();i=i===void 0?null:i;var l=s.memoizedState;return i!==null&&bd(i,l[1])?l[0]:(s.memoizedState=[t,i],t)}function ov(t,i){var s=Jt();i=i===void 0?null:i;var l=s.memoizedState;if(i!==null&&bd(i,l[1]))return l[0];if(l=t(),qs){Xt(!0);try{t()}finally{Xt(!1)}}return s.memoizedState=[l,i],l}function Md(t,i,s){return s===void 0||(yr&1073741824)!==0&&(it&261930)===0?t.memoizedState=i:(t.memoizedState=s,t=l0(),Ke.lanes|=t,rs|=t,s)}function lv(t,i,s,l){return oi(s,i)?s:Ma.current!==null?(t=Md(t,s,l),oi(t,i)||(ln=!0),t):(yr&42)===0||(yr&1073741824)!==0&&(it&261930)===0?(ln=!0,t.memoizedState=s):(t=l0(),Ke.lanes|=t,rs|=t,i)}function cv(t,i,s,l,_){var w=K.p;K.p=w!==0&&8>w?w:8;var O=F.T,z={};F.T=z,Nd(t,!1,i,s);try{var J=_(),ae=F.S;if(ae!==null&&ae(z,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var he=Z2(J,l);Yo(t,i,he,fi(t))}else Yo(t,i,l,fi(t))}catch(me){Yo(t,i,{then:function(){},status:"rejected",reason:me},fi())}finally{K.p=w,O!==null&&z.types!==null&&(O.types=z.types),F.T=O}}function iE(){}function Dd(t,i,s,l){if(t.tag!==5)throw Error(a(476));var _=uv(t).queue;cv(t,_,i,X,s===null?iE:function(){return hv(t),s(l)})}function uv(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sr,lastRenderedState:X},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 hv(t){var i=uv(t);i.next===null&&(i=t.alternate.memoizedState),Yo(t,i.next.queue,{},fi())}function Od(){return Tn(dl)}function dv(){return Jt().memoizedState}function fv(){return Jt().memoizedState}function rE(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&&(Jn(l,i,s),qo(l,i,s)),i={cache:ld()},t.payload=i;return}i=i.return}}function sE(t,i,s){var l=fi();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Bc(t)?mv(i,s):(s=Zh(t,i,s,l),s!==null&&(Jn(s,t,l),gv(s,i,l)))}function pv(t,i,s){var l=fi();Yo(t,i,s,l)}function Yo(t,i,s,l){var _={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Bc(t))mv(i,_);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(_.hasEagerState=!0,_.eagerState=z,oi(z,O))return gc(t,i,_,0),Ct===null&&mc(),!1}catch{}if(s=Zh(t,i,_,l),s!==null)return Jn(s,t,l),gv(s,i,l),!0}return!1}function Nd(t,i,s,l){if(l={lane:2,revertLane:ff(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Bc(t)){if(i)throw Error(a(479))}else i=Zh(t,s,l,2),i!==null&&Jn(i,t,2)}function Bc(t){var i=t.alternate;return t===Ke||i!==null&&i===Ke}function mv(t,i){Da=Rc=!0;var s=t.pending;s===null?i.next=i:(i.next=s.next,s.next=i),t.pending=i}function gv(t,i,s){if((s&4194048)!==0){var l=i.lanes;l&=t.pendingLanes,s|=l,i.lanes=s,ze(t,s)}}var Xo={readContext:Tn,use:Dc,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};Xo.useEffectEvent=Ft;var _v={readContext:Tn,use:Dc,useCallback:function(t,i){return Bn().memoizedState=[t,i===void 0?null:i],t},useContext:Tn,useEffect:ev,useImperativeHandle:function(t,i,s){s=s!=null?s.concat([t]):null,Nc(4194308,4,rv.bind(null,i,t),s)},useLayoutEffect:function(t,i){return Nc(4194308,4,t,i)},useInsertionEffect:function(t,i){Nc(4,2,t,i)},useMemo:function(t,i){var s=Bn();i=i===void 0?null:i;var l=t();if(qs){Xt(!0);try{t()}finally{Xt(!1)}}return s.memoizedState=[l,i],l},useReducer:function(t,i,s){var l=Bn();if(s!==void 0){var _=s(i);if(qs){Xt(!0);try{s(i)}finally{Xt(!1)}}}else _=i;return l.memoizedState=l.baseState=_,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:_},l.queue=t,t=t.dispatch=sE.bind(null,Ke,t),[l.memoizedState,t]},useRef:function(t){var i=Bn();return t={current:t},i.memoizedState=t},useState:function(t){t=Ad(t);var i=t.queue,s=pv.bind(null,Ke,i);return i.dispatch=s,[t.memoizedState,s]},useDebugValue:Ld,useDeferredValue:function(t,i){var s=Bn();return Md(s,t,i)},useTransition:function(){var t=Ad(!1);return t=cv.bind(null,Ke,t.queue,!0,!1),Bn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,s){var l=Ke,_=Bn();if(at){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),Ct===null)throw Error(a(349));(it&127)!==0||P_(l,i,s)}_.memoizedState=s;var w={value:s,getSnapshot:i};return _.queue=w,ev($_.bind(null,l,w,t),[t]),l.flags|=2048,Na(9,{destroy:void 0},z_.bind(null,l,w,s,i),null),s},useId:function(){var t=Bn(),i=Ct.identifierPrefix;if(at){var s=Ji,l=Zi;s=(l&~(1<<32-$t(l)-1)).toString(32)+s,i="_"+i+"R_"+s,s=Lc++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=J2++,i="_"+i+"r_"+s.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:Od,useFormState:Y_,useActionState:Y_,useOptimistic:function(t){var i=Bn();i.memoizedState=i.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=Nd.bind(null,Ke,!0,s),s.dispatch=i,[t,i]},useMemoCache:xd,useCacheRefresh:function(){return Bn().memoizedState=rE.bind(null,Ke)},useEffectEvent:function(t){var i=Bn(),s={impl:t};return i.memoizedState=s,function(){if((dt&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},Id={readContext:Tn,use:Dc,useCallback:av,useContext:Tn,useEffect:Rd,useImperativeHandle:sv,useInsertionEffect:nv,useLayoutEffect:iv,useMemo:ov,useReducer:Oc,useRef:Q_,useState:function(){return Oc(Sr)},useDebugValue:Ld,useDeferredValue:function(t,i){var s=Jt();return lv(s,vt.memoizedState,t,i)},useTransition:function(){var t=Oc(Sr)[0],i=Jt().memoizedState;return[typeof t=="boolean"?t:Vo(t),i]},useSyncExternalStore:j_,useId:dv,useHostTransitionStatus:Od,useFormState:X_,useActionState:X_,useOptimistic:function(t,i){var s=Jt();return F_(s,vt,t,i)},useMemoCache:xd,useCacheRefresh:fv};Id.useEffectEvent=tv;var vv={readContext:Tn,use:Dc,useCallback:av,useContext:Tn,useEffect:Rd,useImperativeHandle:sv,useInsertionEffect:nv,useLayoutEffect:iv,useMemo:ov,useReducer:Td,useRef:Q_,useState:function(){return Td(Sr)},useDebugValue:Ld,useDeferredValue:function(t,i){var s=Jt();return vt===null?Md(s,t,i):lv(s,vt.memoizedState,t,i)},useTransition:function(){var t=Td(Sr)[0],i=Jt().memoizedState;return[typeof t=="boolean"?t:Vo(t),i]},useSyncExternalStore:j_,useId:dv,useHostTransitionStatus:Od,useFormState:J_,useActionState:J_,useOptimistic:function(t,i){var s=Jt();return vt!==null?F_(s,vt,t,i):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:xd,useCacheRefresh:fv};vv.useEffectEvent=tv;function Bd(t,i,s,l){i=t.memoizedState,s=s(l,i),s=s==null?i:p({},i,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var jd={enqueueSetState:function(t,i,s){t=t._reactInternals;var l=fi(),_=Jr(l);_.payload=i,s!=null&&(_.callback=s),i=Qr(t,_,l),i!==null&&(Jn(i,t,l),qo(i,t,l))},enqueueReplaceState:function(t,i,s){t=t._reactInternals;var l=fi(),_=Jr(l);_.tag=1,_.payload=i,s!=null&&(_.callback=s),i=Qr(t,_,l),i!==null&&(Jn(i,t,l),qo(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&&(Jn(i,t,s),qo(i,t,s))}};function bv(t,i,s,l,_,w,O){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(l,w,O):i.prototype&&i.prototype.isPureReactComponent?!Bo(s,l)||!Bo(_,w):!0}function yv(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&&jd.enqueueReplaceState(i,i.state,null)}function Ws(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=p({},s));for(var _ in t)s[_]===void 0&&(s[_]=t[_])}return s}function Sv(t){pc(t)}function wv(t){console.error(t)}function Cv(t){pc(t)}function jc(t,i){try{var s=t.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(l){setTimeout(function(){throw l})}}function xv(t,i,s){try{var l=t.onCaughtError;l(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(_){setTimeout(function(){throw _})}}function Pd(t,i,s){return s=Jr(s),s.tag=3,s.payload={element:null},s.callback=function(){jc(t,i)},s}function Ev(t){return t=Jr(t),t.tag=3,t}function Tv(t,i,s,l){var _=s.type.getDerivedStateFromError;if(typeof _=="function"){var w=l.value;t.payload=function(){return _(w)},t.callback=function(){xv(i,s,l)}}var O=s.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(t.callback=function(){xv(i,s,l),typeof _!="function"&&(ss===null?ss=new Set([this]):ss.add(this));var z=l.stack;this.componentDidCatch(l.value,{componentStack:z!==null?z:""})})}function aE(t,i,s,l,_){if(s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(i=s.alternate,i!==null&&Ta(i,s,_,!0),s=ci.current,s!==null){switch(s.tag){case 31:case 13:return xi===null?Yc():s.alternate===null&&qt===0&&(qt=3),s.flags&=-257,s.flags|=65536,s.lanes=_,l===xc?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([l]):i.add(l),uf(t,l,_)),!1;case 22:return s.flags|=65536,l===xc?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)),uf(t,l,_)),!1}throw Error(a(435,s.tag))}return uf(t,l,_),Yc(),!1}if(at)return i=ci.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=_,l!==id&&(t=Error(a(422),{cause:l}),zo(yi(t,s)))):(l!==id&&(i=Error(a(423),{cause:l}),zo(yi(i,s))),t=t.current.alternate,t.flags|=65536,_&=-_,t.lanes|=_,l=yi(l,s),_=Pd(t.stateNode,l,_),pd(t,_),qt!==4&&(qt=2)),!1;var w=Error(a(520),{cause:l});if(w=yi(w,s),rl===null?rl=[w]:rl.push(w),qt!==4&&(qt=2),i===null)return!0;l=yi(l,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,t=_&-_,s.lanes|=t,t=Pd(s.stateNode,l,t),pd(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,_&=-_,s.lanes|=_,_=Ev(_),Tv(_,t,s,l),pd(s,_),!1}s=s.return}while(s!==null);return!1}var zd=Error(a(461)),ln=!1;function An(t,i,s,l){i.child=t===null?L_(i,null,s,l):Fs(i,t.child,s,l)}function Av(t,i,s,l,_){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=yd(t,i,s,O,w,_),z=Sd(),t!==null&&!ln?(wd(t,i,_),wr(t,i,_)):(at&&z&&td(i),i.flags|=1,An(t,i,l,_),i.child)}function kv(t,i,s,l,_){if(t===null){var w=s.type;return typeof w=="function"&&!Jh(w)&&w.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=w,Rv(t,i,w,l,_)):(t=vc(s.type,null,l,i,i.mode,_),t.ref=i.ref,t.return=i,i.child=t)}if(w=t.child,!Kd(t,_)){var O=w.memoizedProps;if(s=s.compare,s=s!==null?s:Bo,s(O,l)&&t.ref===i.ref)return wr(t,i,_)}return i.flags|=1,t=gr(w,l),t.ref=i.ref,t.return=i,i.child=t}function Rv(t,i,s,l,_){if(t!==null){var w=t.memoizedProps;if(Bo(w,l)&&t.ref===i.ref)if(ln=!1,i.pendingProps=l=w,Kd(t,_))(t.flags&131072)!==0&&(ln=!0);else return i.lanes=t.lanes,wr(t,i,_)}return $d(t,i,s,l,_)}function Lv(t,i,s,l){var _=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,_=0;l!==null;)_=_|l.lanes|l.childLanes,l=l.sibling;l=_&~w}else l=0,i.child=null;return Mv(t,i,w,s,l)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&wc(i,w!==null?w.cachePool:null),w!==null?O_(i,w):gd(),N_(i);else return l=i.lanes=536870912,Mv(t,i,w!==null?w.baseLanes|s:s,s,l)}else w!==null?(wc(i,w.cachePool),O_(i,w),ts(),i.memoizedState=null):(t!==null&&wc(i,null),gd(),ts());return An(t,i,_,s),i.child}function Zo(t,i){return t!==null&&t.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Mv(t,i,s,l,_){var w=ud();return w=w===null?null:{parent:an._currentValue,pool:w},i.memoizedState={baseLanes:s,cachePool:w},t!==null&&wc(i,null),gd(),N_(i),t!==null&&Ta(t,i,l,!0),i.childLanes=_,null}function Pc(t,i){return i=$c({mode:i.mode,children:i.children},t.mode),i.ref=t.ref,t.child=i,i.return=t,i}function Dv(t,i,s){return Fs(i,t.child,null,s),t=Pc(i,i.pendingProps),t.flags|=2,ui(i),i.memoizedState=null,t}function oE(t,i,s){var l=i.pendingProps,_=(i.flags&128)!==0;if(i.flags&=-129,t===null){if(at){if(l.mode==="hidden")return t=Pc(i,l),i.lanes=536870912,Zo(null,t);if(vd(i),(t=Rt)?(t=q0(t,Ci),t=t!==null&&t.data==="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Kr!==null?{id:Zi,overflow:Ji}:null,retryLane:536870912,hydrationErrors:null},s=m_(t),s.return=i,i.child=s,En=i,Rt=null)):t=null,t===null)throw Yr(i);return i.lanes=536870912,null}return Pc(i,l)}var w=t.memoizedState;if(w!==null){var O=w.dehydrated;if(vd(i),_)if(i.flags&256)i.flags&=-257,i=Dv(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||Ta(t,i,s,!1),_=(s&t.childLanes)!==0,ln||_){if(l=Ct,l!==null&&(O=Bt(l,s),O!==0&&O!==w.retryLane))throw w.retryLane=O,Is(t,O),Jn(l,t,O),zd;Yc(),i=Dv(t,i,s)}else t=w.treeContext,Rt=Ei(O.nextSibling),En=i,at=!0,Vr=null,Ci=!1,t!==null&&v_(i,t),i=Pc(i,l),i.flags|=4096;return i}return t=gr(t.child,{mode:l.mode,children:l.children}),t.ref=i.ref,i.child=t,t.return=i,t}function zc(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 $d(t,i,s,l,_){return zs(i),s=yd(t,i,s,l,void 0,_),l=Sd(),t!==null&&!ln?(wd(t,i,_),wr(t,i,_)):(at&&l&&td(i),i.flags|=1,An(t,i,s,_),i.child)}function Ov(t,i,s,l,_,w){return zs(i),i.updateQueue=null,s=B_(i,l,s,_),I_(t),l=Sd(),t!==null&&!ln?(wd(t,i,w),wr(t,i,w)):(at&&l&&td(i),i.flags|=1,An(t,i,s,w),i.child)}function Nv(t,i,s,l,_){if(zs(i),i.stateNode===null){var w=wa,O=s.contextType;typeof O=="object"&&O!==null&&(w=Tn(O)),w=new s(l,w),i.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=jd,i.stateNode=w,w._reactInternals=i,w=i.stateNode,w.props=l,w.state=i.memoizedState,w.refs={},dd(i),O=s.contextType,w.context=typeof O=="object"&&O!==null?Tn(O):wa,w.state=i.memoizedState,O=s.getDerivedStateFromProps,typeof O=="function"&&(Bd(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&&jd.enqueueReplaceState(w,w.state,null),Go(i,l,w,_),Wo(),w.state=i.memoizedState),typeof w.componentDidMount=="function"&&(i.flags|=4194308),l=!0}else if(t===null){w=i.stateNode;var z=i.memoizedProps,J=Ws(s,z);w.props=J;var ae=w.context,he=s.contextType;O=wa,typeof he=="object"&&he!==null&&(O=Tn(he));var me=s.getDerivedStateFromProps;he=typeof me=="function"||typeof w.getSnapshotBeforeUpdate=="function",z=i.pendingProps!==z,he||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(z||ae!==O)&&yv(i,w,l,O),Zr=!1;var oe=i.memoizedState;w.state=oe,Go(i,l,w,_),Wo(),ae=i.memoizedState,z||oe!==ae||Zr?(typeof me=="function"&&(Bd(i,s,me,l),ae=i.memoizedState),(J=Zr||bv(i,s,J,l,oe,ae,O))?(he||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=ae),w.props=l,w.state=ae,w.context=O,l=J):(typeof w.componentDidMount=="function"&&(i.flags|=4194308),l=!1)}else{w=i.stateNode,fd(t,i),O=i.memoizedProps,he=Ws(s,O),w.props=he,me=i.pendingProps,oe=w.context,ae=s.contextType,J=wa,typeof ae=="object"&&ae!==null&&(J=Tn(ae)),z=s.getDerivedStateFromProps,(ae=typeof z=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(O!==me||oe!==J)&&yv(i,w,l,J),Zr=!1,oe=i.memoizedState,w.state=oe,Go(i,l,w,_),Wo();var ue=i.memoizedState;O!==me||oe!==ue||Zr||t!==null&&t.dependencies!==null&&yc(t.dependencies)?(typeof z=="function"&&(Bd(i,s,z,l),ue=i.memoizedState),(he=Zr||bv(i,s,he,l,oe,ue,J)||t!==null&&t.dependencies!==null&&yc(t.dependencies))?(ae||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(l,ue,J),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(l,ue,J)),typeof w.componentDidUpdate=="function"&&(i.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof w.componentDidUpdate!="function"||O===t.memoizedProps&&oe===t.memoizedState||(i.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||O===t.memoizedProps&&oe===t.memoizedState||(i.flags|=1024),i.memoizedProps=l,i.memoizedState=ue),w.props=l,w.state=ue,w.context=J,l=he):(typeof w.componentDidUpdate!="function"||O===t.memoizedProps&&oe===t.memoizedState||(i.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||O===t.memoizedProps&&oe===t.memoizedState||(i.flags|=1024),l=!1)}return w=l,zc(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=Fs(i,t.child,null,_),i.child=Fs(i,null,s,_)):An(t,i,s,_),i.memoizedState=w.state,t=i.child):t=wr(t,i,_),t}function Iv(t,i,s,l){return js(),i.flags|=256,An(t,i,s,l),i.child}var Hd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ud(t){return{baseLanes:t,cachePool:x_()}}function Fd(t,i,s){return t=t!==null?t.childLanes&~s:0,i&&(t|=di),t}function Bv(t,i,s){var l=i.pendingProps,_=!1,w=(i.flags&128)!==0,O;if((O=w)||(O=t!==null&&t.memoizedState===null?!1:(Zt.current&2)!==0),O&&(_=!0,i.flags&=-129),O=(i.flags&32)!==0,i.flags&=-33,t===null){if(at){if(_?es(i):ts(),(t=Rt)?(t=q0(t,Ci),t=t!==null&&t.data!=="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Kr!==null?{id:Zi,overflow:Ji}:null,retryLane:536870912,hydrationErrors:null},s=m_(t),s.return=i,i.child=s,En=i,Rt=null)):t=null,t===null)throw Yr(i);return Tf(t)?i.lanes=32:i.lanes=536870912,null}var z=l.children;return l=l.fallback,_?(ts(),_=i.mode,z=$c({mode:"hidden",children:z},_),l=Bs(l,_,s,null),z.return=i,l.return=i,z.sibling=l,i.child=z,l=i.child,l.memoizedState=Ud(s),l.childLanes=Fd(t,O,s),i.memoizedState=Hd,Zo(null,l)):(es(i),qd(i,z))}var J=t.memoizedState;if(J!==null&&(z=J.dehydrated,z!==null)){if(w)i.flags&256?(es(i),i.flags&=-257,i=Wd(t,i,s)):i.memoizedState!==null?(ts(),i.child=t.child,i.flags|=128,i=null):(ts(),z=l.fallback,_=i.mode,l=$c({mode:"visible",children:l.children},_),z=Bs(z,_,s,null),z.flags|=2,l.return=i,z.return=i,l.sibling=z,i.child=l,Fs(i,t.child,null,s),l=i.child,l.memoizedState=Ud(s),l.childLanes=Fd(t,O,s),i.memoizedState=Hd,i=Zo(null,l));else if(es(i),Tf(z)){if(O=z.nextSibling&&z.nextSibling.dataset,O)var ae=O.dgst;O=ae,l=Error(a(419)),l.stack="",l.digest=O,zo({value:l,source:null,stack:null}),i=Wd(t,i,s)}else if(ln||Ta(t,i,s,!1),O=(s&t.childLanes)!==0,ln||O){if(O=Ct,O!==null&&(l=Bt(O,s),l!==0&&l!==J.retryLane))throw J.retryLane=l,Is(t,l),Jn(O,t,l),zd;Ef(z)||Yc(),i=Wd(t,i,s)}else Ef(z)?(i.flags|=192,i.child=t.child,i=null):(t=J.treeContext,Rt=Ei(z.nextSibling),En=i,at=!0,Vr=null,Ci=!1,t!==null&&v_(i,t),i=qd(i,l.children),i.flags|=4096);return i}return _?(ts(),z=l.fallback,_=i.mode,J=t.child,ae=J.sibling,l=gr(J,{mode:"hidden",children:l.children}),l.subtreeFlags=J.subtreeFlags&65011712,ae!==null?z=gr(ae,z):(z=Bs(z,_,s,null),z.flags|=2),z.return=i,l.return=i,l.sibling=z,i.child=l,Zo(null,l),l=i.child,z=t.child.memoizedState,z===null?z=Ud(s):(_=z.cachePool,_!==null?(J=an._currentValue,_=_.parent!==J?{parent:J,pool:J}:_):_=x_(),z={baseLanes:z.baseLanes|s,cachePool:_}),l.memoizedState=z,l.childLanes=Fd(t,O,s),i.memoizedState=Hd,Zo(t.child,l)):(es(i),s=t.child,t=s.sibling,s=gr(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 qd(t,i){return i=$c({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function $c(t,i){return t=li(22,t,null,i),t.lanes=0,t}function Wd(t,i,s){return Fs(i,t.child,null,s),t=qd(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function jv(t,i,s){t.lanes|=i;var l=t.alternate;l!==null&&(l.lanes|=i),ad(t.return,i,s)}function Gd(t,i,s,l,_,w){var O=t.memoizedState;O===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:l,tail:s,tailMode:_,treeForkCount:w}:(O.isBackwards=i,O.rendering=null,O.renderingStartTime=0,O.last=l,O.tail=s,O.tailMode=_,O.treeForkCount=w)}function Pv(t,i,s){var l=i.pendingProps,_=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,Q(Zt,O),An(t,i,l,s),l=at?Po:0,!z&&t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&jv(t,s,i);else if(t.tag===19)jv(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(_){case"forwards":for(s=i.child,_=null;s!==null;)t=s.alternate,t!==null&&kc(t)===null&&(_=s),s=s.sibling;s=_,s===null?(_=i.child,i.child=null):(_=s.sibling,s.sibling=null),Gd(i,!1,_,s,w,l);break;case"backwards":case"unstable_legacy-backwards":for(s=null,_=i.child,i.child=null;_!==null;){if(t=_.alternate,t!==null&&kc(t)===null){i.child=_;break}t=_.sibling,_.sibling=s,s=_,_=t}Gd(i,!0,s,null,w,l);break;case"together":Gd(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(Ta(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=gr(t,t.pendingProps),i.child=s,s.return=i;t.sibling!==null;)t=t.sibling,s=s.sibling=gr(t,t.pendingProps),s.return=i;s.sibling=null}return i.child}function Kd(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&yc(t)))}function lE(t,i,s){switch(i.tag){case 3:P(i,i.stateNode.containerInfo),Xr(i,an,t.memoizedState.cache),js();break;case 27:case 5:fe(i);break;case 4:P(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,vd(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?Bv(t,i,s):(es(i),t=wr(t,i,s),t!==null?t.sibling:null);es(i);break;case 19:var _=(t.flags&128)!==0;if(l=(s&i.childLanes)!==0,l||(Ta(t,i,s,!1),l=(s&i.childLanes)!==0),_){if(l)return Pv(t,i,s);i.flags|=128}if(_=i.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),Q(Zt,Zt.current),l)break;return null;case 22:return i.lanes=0,Lv(t,i,s,i.pendingProps);case 24:Xr(i,an,t.memoizedState.cache)}return wr(t,i,s)}function zv(t,i,s){if(t!==null)if(t.memoizedProps!==i.pendingProps)ln=!0;else{if(!Kd(t,s)&&(i.flags&128)===0)return ln=!1,lE(t,i,s);ln=(t.flags&131072)!==0}else ln=!1,at&&(i.flags&1048576)!==0&&__(i,Po,i.index);switch(i.lanes=0,i.tag){case 16:e:{var l=i.pendingProps;if(t=Hs(i.elementType),i.type=t,typeof t=="function")Jh(t)?(l=Ws(t,l),i.tag=1,i=Nv(null,i,t,l,s)):(i.tag=0,i=$d(null,i,t,l,s));else{if(t!=null){var _=t.$$typeof;if(_===T){i.tag=11,i=Av(null,i,t,l,s);break e}else if(_===M){i.tag=14,i=kv(null,i,t,l,s);break e}}throw i=V(t)||t,Error(a(306,i,""))}}return i;case 0:return $d(t,i,i.type,i.pendingProps,s);case 1:return l=i.type,_=Ws(l,i.pendingProps),Nv(t,i,l,_,s);case 3:e:{if(P(i,i.stateNode.containerInfo),t===null)throw Error(a(387));l=i.pendingProps;var w=i.memoizedState;_=w.element,fd(t,i),Go(i,l,null,s);var O=i.memoizedState;if(l=O.cache,Xr(i,an,l),l!==w.cache&&od(i,[an],s,!0),Wo(),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=Iv(t,i,l,s);break e}else if(l!==_){_=yi(Error(a(424)),i),zo(_),i=Iv(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=Ei(t.firstChild),En=i,at=!0,Vr=null,Ci=!0,s=L_(i,null,l,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(js(),l===_){i=wr(t,i,s);break e}An(t,i,l,s)}i=i.child}return i;case 26:return zc(t,i),t===null?(s=X0(i.type,null,i.pendingProps,null))?i.memoizedState=s:at||(s=i.type,t=i.pendingProps,l=nu(ce.current).createElement(s),l[At]=i,l[Et]=t,kn(l,s,t),Je(l),i.stateNode=l):i.memoizedState=X0(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return fe(i),t===null&&at&&(l=i.stateNode=K0(i.type,i.pendingProps,ce.current),En=i,Ci=!0,_=Rt,cs(i.type)?(Af=_,Rt=Ei(l.firstChild)):Rt=_),An(t,i,i.pendingProps.children,s),zc(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&&at&&((_=l=Rt)&&(l=PE(l,i.type,i.pendingProps,Ci),l!==null?(i.stateNode=l,En=i,Rt=Ei(l.firstChild),Ci=!1,_=!0):_=!1),_||Yr(i)),fe(i),_=i.type,w=i.pendingProps,O=t!==null?t.memoizedProps:null,l=w.children,wf(_,w)?l=null:O!==null&&wf(_,O)&&(i.flags|=32),i.memoizedState!==null&&(_=yd(t,i,Q2,null,null,s),dl._currentValue=_),zc(t,i),An(t,i,l,s),i.child;case 6:return t===null&&at&&((t=s=Rt)&&(s=zE(s,i.pendingProps,Ci),s!==null?(i.stateNode=s,En=i,Rt=null,t=!0):t=!1),t||Yr(i)),null;case 13:return Bv(t,i,s);case 4:return P(i,i.stateNode.containerInfo),l=i.pendingProps,t===null?i.child=Fs(i,null,l,s):An(t,i,l,s),i.child;case 11:return Av(t,i,i.type,i.pendingProps,s);case 7:return An(t,i,i.pendingProps,s),i.child;case 8:return An(t,i,i.pendingProps.children,s),i.child;case 12:return An(t,i,i.pendingProps.children,s),i.child;case 10:return l=i.pendingProps,Xr(i,i.type,l.value),An(t,i,l.children,s),i.child;case 9:return _=i.type._context,l=i.pendingProps.children,zs(i),_=Tn(_),l=l(_),i.flags|=1,An(t,i,l,s),i.child;case 14:return kv(t,i,i.type,i.pendingProps,s);case 15:return Rv(t,i,i.type,i.pendingProps,s);case 19:return Pv(t,i,s);case 31:return oE(t,i,s);case 22:return Lv(t,i,s,i.pendingProps);case 24:return zs(i),l=Tn(an),t===null?(_=ud(),_===null&&(_=Ct,w=ld(),_.pooledCache=w,w.refCount++,w!==null&&(_.pooledCacheLanes|=s),_=w),i.memoizedState={parent:l,cache:_},dd(i),Xr(i,an,_)):((t.lanes&s)!==0&&(fd(t,i),Go(i,null,null,s),Wo()),_=t.memoizedState,w=i.memoizedState,_.parent!==l?(_={parent:l,cache:l},i.memoizedState=_,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=_),Xr(i,an,l)):(l=w.cache,Xr(i,an,l),l!==_.cache&&od(i,[an],s,!0))),An(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 Vd(t,i,s,l,_){if((i=(t.mode&32)!==0)&&(i=!1),i){if(t.flags|=16777216,(_&335544128)===_)if(t.stateNode.complete)t.flags|=8192;else if(d0())t.flags|=8192;else throw Us=xc,hd}else t.flags&=-16777217}function $v(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!tb(i))if(d0())t.flags|=8192;else throw Us=xc,hd}function Hc(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?Be():536870912,t.lanes|=i,Pa|=i)}function Jo(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 _=t.child;_!==null;)s|=_.lanes|_.childLanes,l|=_.subtreeFlags&65011712,l|=_.flags&65011712,_.return=t,_=_.sibling;else for(_=t.child;_!==null;)s|=_.lanes|_.childLanes,l|=_.subtreeFlags,l|=_.flags,_.return=t,_=_.sibling;return t.subtreeFlags|=l,t.childLanes=s,i}function cE(t,i,s){var l=i.pendingProps;switch(nd(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),re(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(Ea(i)?Cr(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,rd())),Lt(i),null;case 26:var _=i.type,w=i.memoizedState;return t===null?(Cr(i),w!==null?(Lt(i),$v(i,w)):(Lt(i),Vd(i,_,null,l,s))):w?w!==t.memoizedState?(Cr(i),Lt(i),$v(i,w)):(Lt(i),i.flags&=-16777217):(t=t.memoizedProps,t!==l&&Cr(i),Lt(i),Vd(i,_,t,l,s)),null;case 27:if(Se(i),s=ce.current,_=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=le.current,Ea(i)?b_(i):(t=K0(_,l,s),i.stateNode=t,Cr(i))}return Lt(i),null;case 5:if(Se(i),_=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=le.current,Ea(i))b_(i);else{var O=nu(ce.current);switch(w){case 1:w=O.createElementNS("http://www.w3.org/2000/svg",_);break;case 2:w=O.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;default:switch(_){case"svg":w=O.createElementNS("http://www.w3.org/2000/svg",_);break;case"math":w=O.createElementNS("http://www.w3.org/1998/Math/MathML",_);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(_,{is:l.is}):O.createElement(_)}}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(kn(w,_,l),_){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),Vd(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=ce.current,Ea(i)){if(t=i.stateNode,s=i.memoizedProps,l=null,_=En,_!==null)switch(_.tag){case 27:case 5:l=_.memoizedProps}t[At]=i,t=!!(t.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||B0(t.nodeValue,s)),t||Yr(i,!0)}else t=nu(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=Ea(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 js(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Lt(i),t=!1}else s=rd(),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(_=Ea(i),l!==null&&l.dehydrated!==null){if(t===null){if(!_)throw Error(a(318));if(_=i.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(a(317));_[At]=i}else js(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Lt(i),_=!1}else _=rd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=_),_=!0;if(!_)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,_=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(_=l.alternate.memoizedState.cachePool.pool),w=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(w=l.memoizedState.cachePool.pool),w!==_&&(l.flags|=2048)),s!==t&&s&&(i.child.flags|=8192),Hc(i,i.updateQueue),Lt(i),null);case 4:return re(),t===null&&_f(i.stateNode.containerInfo),Lt(i),null;case 10:return br(i.type),Lt(i),null;case 19:if(H(Zt),l=i.memoizedState,l===null)return Lt(i),null;if(_=(i.flags&128)!==0,w=l.rendering,w===null)if(_)Jo(l,!1);else{if(qt!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(w=kc(t),w!==null){for(i.flags|=128,Jo(l,!1),t=w.updateQueue,i.updateQueue=t,Hc(i,t),i.subtreeFlags=0,t=s,s=i.child;s!==null;)p_(s,t),s=s.sibling;return Q(Zt,Zt.current&1|2),at&&_r(i,l.treeForkCount),i.child}t=t.sibling}l.tail!==null&&ht()>Gc&&(i.flags|=128,_=!0,Jo(l,!1),i.lanes=4194304)}else{if(!_)if(t=kc(w),t!==null){if(i.flags|=128,_=!0,t=t.updateQueue,i.updateQueue=t,Hc(i,t),Jo(l,!0),l.tail===null&&l.tailMode==="hidden"&&!w.alternate&&!at)return Lt(i),null}else 2*ht()-l.renderingStartTime>Gc&&s!==536870912&&(i.flags|=128,_=!0,Jo(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,Q(Zt,_?s&1|2:s&1),at&&_r(i,l.treeForkCount),t):(Lt(i),null);case 22:case 23:return ui(i),_d(),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&&Hc(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&&H($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 uE(t,i){switch(nd(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return br(an),re(),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));js()}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));js()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return H(Zt),null;case 4:return re(),null;case 10:return br(i.type),null;case 22:case 23:return ui(i),_d(),t!==null&&H($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 Hv(t,i){switch(nd(i),i.tag){case 3:br(an),re();break;case 26:case 27:case 5:Se(i);break;case 4:re();break;case 31:i.memoizedState!==null&&ui(i);break;case 13:ui(i);break;case 19:H(Zt);break;case 10:br(i.type);break;case 22:case 23:ui(i),_d(),t!==null&&H($s);break;case 24:br(an)}}function Qo(t,i){try{var s=i.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var _=l.next;s=_;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!==_)}}catch(z){_t(i,i.return,z)}}function ns(t,i,s){try{var l=i.updateQueue,_=l!==null?l.lastEffect:null;if(_!==null){var w=_.next;l=w;do{if((l.tag&t)===t){var O=l.inst,z=O.destroy;if(z!==void 0){O.destroy=void 0,_=i;var J=s,ae=z;try{ae()}catch(he){_t(_,J,he)}}}l=l.next}while(l!==w)}}catch(he){_t(i,i.return,he)}}function Uv(t){var i=t.updateQueue;if(i!==null){var s=t.stateNode;try{D_(i,s)}catch(l){_t(t,t.return,l)}}}function Fv(t,i,s){s.props=Ws(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(l){_t(t,i,l)}}function el(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(_){_t(t,i,_)}}function Qi(t,i){var s=t.ref,l=t.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(_){_t(t,i,_)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(_){_t(t,i,_)}else s.current=null}function qv(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(_){_t(t,t.return,_)}}function Yd(t,i,s){try{var l=t.stateNode;DE(l,t.type,s,i),l[Et]=i}catch(_){_t(t,t.return,_)}}function Wv(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&cs(t.type)||t.tag===4}function Xd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Wv(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 Zd(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(Zd(t,i,s),t=t.sibling;t!==null;)Zd(t,i,s),t=t.sibling}function Uc(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(Uc(t,i,s),t=t.sibling;t!==null;)Uc(t,i,s),t=t.sibling}function Gv(t){var i=t.stateNode,s=t.memoizedProps;try{for(var l=t.type,_=i.attributes;_.length;)i.removeAttributeNode(_[0]);kn(i,l,s),i[At]=t,i[Et]=s}catch(w){_t(t,t.return,w)}}var xr=!1,cn=!1,Jd=!1,Kv=typeof WeakSet=="function"?WeakSet:Set,mn=null;function hE(t,i){if(t=t.containerInfo,yf=cu,t=s_(t),Wh(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 _=l.anchorOffset,w=l.focusNode;l=l.focusOffset;try{s.nodeType,w.nodeType}catch{s=null;break e}var O=0,z=-1,J=-1,ae=0,he=0,me=t,oe=null;t:for(;;){for(var ue;me!==s||_!==0&&me.nodeType!==3||(z=O+_),me!==w||l!==0&&me.nodeType!==3||(J=O+l),me.nodeType===3&&(O+=me.nodeValue.length),(ue=me.firstChild)!==null;)oe=me,me=ue;for(;;){if(me===t)break t;if(oe===s&&++ae===_&&(z=O),oe===w&&++he===l&&(J=O),(ue=me.nextSibling)!==null)break;me=oe,oe=me.parentNode}me=ue}s=z===-1||J===-1?null:{start:z,end:J}}else s=null}s=s||{start:0,end:0}}else s=null;for(Sf={focusedElem:t,selectionRange:s},cu=!1,mn=i;mn!==null;)if(i=mn,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,mn=t;else for(;mn!==null;){switch(i=mn,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++)_=t[s],_.ref.impl=_.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&w!==null){t=void 0,s=i,_=w.memoizedProps,w=w.memoizedState,l=s.stateNode;try{var Ae=Ws(s.type,_);t=l.getSnapshotBeforeUpdate(Ae,w),l.__reactInternalSnapshotBeforeUpdate=t}catch($e){_t(s,s.return,$e)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,s=t.nodeType,s===9)xf(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":xf(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,mn=t;break}mn=i.return}}function Vv(t,i,s){var l=s.flags;switch(s.tag){case 0:case 11:case 15:Tr(t,s),l&4&&Qo(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 _=Ws(s.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(_,i,t.__reactInternalSnapshotBeforeUpdate)}catch(O){_t(s,s.return,O)}}l&64&&Uv(s),l&512&&el(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{D_(t,i)}catch(O){_t(s,s.return,O)}}break;case 27:i===null&&l&4&&Gv(s);case 26:case 5:Tr(t,s),i===null&&l&4&&qv(s),l&512&&el(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&&Jv(t,s),l&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=yE.bind(null,s),$E(t,s))));break;case 22:if(l=s.memoizedState!==null||xr,!l){i=i!==null&&i.memoizedState!==null||cn,_=xr;var w=cn;xr=l,(cn=i)&&!w?Ar(t,s,(s.subtreeFlags&8772)!==0):Tr(t,s),xr=_,cn=w}break;case 30:break;default:Tr(t,s)}}function Yv(t){var i=t.alternate;i!==null&&(t.alternate=null,Yv(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,Vn=!1;function Er(t,i,s){for(s=s.child;s!==null;)Xv(t,i,s),s=s.sibling}function Xv(t,i,s){if(Yt&&typeof Yt.onCommitFiberUnmount=="function")try{Yt.onCommitFiberUnmount(Fn,s)}catch{}switch(s.tag){case 26:cn||Qi(s,i),Er(t,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:cn||Qi(s,i);var l=Nt,_=Vn;cs(s.type)&&(Nt=s.stateNode,Vn=!1),Er(t,i,s),cl(s.stateNode),Nt=l,Vn=_;break;case 5:cn||Qi(s,i);case 6:if(l=Nt,_=Vn,Nt=null,Er(t,i,s),Nt=l,Vn=_,Nt!==null)if(Vn)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&&(Vn?(t=Nt,U0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),Ga(t)):U0(Nt,s.stateNode));break;case 4:l=Nt,_=Vn,Nt=s.stateNode.containerInfo,Vn=!0,Er(t,i,s),Nt=l,Vn=_;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||(Qi(s,i),l=s.stateNode,typeof l.componentWillUnmount=="function"&&Fv(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{Ga(t)}catch(s){_t(i,i.return,s)}}}function Jv(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ga(t)}catch(s){_t(i,i.return,s)}}function dE(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new Kv),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new Kv),i;default:throw Error(a(435,t.tag))}}function Fc(t,i){var s=dE(t);i.forEach(function(l){if(!s.has(l)){s.add(l);var _=SE.bind(null,t,l);l.then(_,_)}})}function Yn(t,i){var s=i.deletions;if(s!==null)for(var l=0;l<s.length;l++){var _=s[l],w=t,O=i,z=O;e:for(;z!==null;){switch(z.tag){case 27:if(cs(z.type)){Nt=z.stateNode,Vn=!1;break e}break;case 5:Nt=z.stateNode,Vn=!1;break e;case 3:case 4:Nt=z.stateNode.containerInfo,Vn=!0;break e}z=z.return}if(Nt===null)throw Error(a(160));Xv(w,O,_),Nt=null,Vn=!1,w=_.alternate,w!==null&&(w.return=null),_.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Qv(i,t),i=i.sibling}var Hi=null;function Qv(t,i){var s=t.alternate,l=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Yn(i,t),Xn(t),l&4&&(ns(3,t,t.return),Qo(3,t),ns(5,t,t.return));break;case 1:Yn(i,t),Xn(t),l&512&&(cn||s===null||Qi(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 _=Hi;if(Yn(i,t),Xn(t),l&512&&(cn||s===null||Qi(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,_=_.ownerDocument||_;t:switch(l){case"title":w=_.getElementsByTagName("title")[0],(!w||w[Xi]||w[At]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=_.createElement(l),_.head.insertBefore(w,_.querySelector("head > title"))),kn(w,l,s),w[At]=t,Je(w),l=w;break e;case"link":var O=Q0("link","href",_).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=_.createElement(l),kn(w,l,s),_.head.appendChild(w);break;case"meta":if(O=Q0("meta","content",_).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=_.createElement(l),kn(w,l,s),_.head.appendChild(w);break;default:throw Error(a(468,l))}w[At]=t,Je(w),l=w}t.stateNode=l}else eb(_,t.type,t.stateNode);else t.stateNode=J0(_,l,t.memoizedProps);else w!==l?(w===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):w.count--,l===null?eb(_,t.type,t.stateNode):J0(_,l,t.memoizedProps)):l===null&&t.stateNode!==null&&Yd(t,t.memoizedProps,s.memoizedProps)}break;case 27:Yn(i,t),Xn(t),l&512&&(cn||s===null||Qi(s,s.return)),s!==null&&l&4&&Yd(t,t.memoizedProps,s.memoizedProps);break;case 5:if(Yn(i,t),Xn(t),l&512&&(cn||s===null||Qi(s,s.return)),t.flags&32){_=t.stateNode;try{He(_,"")}catch(Ae){_t(t,t.return,Ae)}}l&4&&t.stateNode!=null&&(_=t.memoizedProps,Yd(t,_,s!==null?s.memoizedProps:_)),l&1024&&(Jd=!0);break;case 6:if(Yn(i,t),Xn(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(su=null,_=Hi,Hi=iu(i.containerInfo),Yn(i,t),Hi=_,Xn(t),l&4&&s!==null&&s.memoizedState.isDehydrated)try{Ga(i.containerInfo)}catch(Ae){_t(t,t.return,Ae)}Jd&&(Jd=!1,e0(t));break;case 4:l=Hi,Hi=iu(t.stateNode.containerInfo),Yn(i,t),Xn(t),Hi=l;break;case 12:Yn(i,t),Xn(t);break;case 31:Yn(i,t),Xn(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,Fc(t,l)));break;case 13:Yn(i,t),Xn(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Wc=ht()),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,Fc(t,l)));break;case 22:_=t.memoizedState!==null;var J=s!==null&&s.memoizedState!==null,ae=xr,he=cn;if(xr=ae||_,cn=he||J,Yn(i,t),cn=he,xr=ae,Xn(t),l&8192)e:for(i=t.stateNode,i._visibility=_?i._visibility&-2:i._visibility|1,_&&(s===null||J||xr||cn||Gs(t)),s=null,i=t;;){if(i.tag===5||i.tag===26){if(s===null){J=s=i;try{if(w=J.stateNode,_)O=w.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{z=J.stateNode;var me=J.memoizedProps.style,oe=me!=null&&me.hasOwnProperty("display")?me.display:null;z.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(Ae){_t(J,J.return,Ae)}}}else if(i.tag===6){if(s===null){J=i;try{J.stateNode.nodeValue=_?"":J.memoizedProps}catch(Ae){_t(J,J.return,Ae)}}}else if(i.tag===18){if(s===null){J=i;try{var ue=J.stateNode;_?F0(ue,!0):F0(J.stateNode,!1)}catch(Ae){_t(J,J.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,Fc(t,s))));break;case 19:Yn(i,t),Xn(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,Fc(t,l)));break;case 30:break;case 21:break;default:Yn(i,t),Xn(t)}}function Xn(t){var i=t.flags;if(i&2){try{for(var s,l=t.return;l!==null;){if(Wv(l)){s=l;break}l=l.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var _=s.stateNode,w=Xd(t);Uc(t,w,_);break;case 5:var O=s.stateNode;s.flags&32&&(He(O,""),s.flags&=-33);var z=Xd(t);Uc(t,z,O);break;case 3:case 4:var J=s.stateNode.containerInfo,ae=Xd(t);Zd(t,ae,J);break;default:throw Error(a(161))}}catch(he){_t(t,t.return,he)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function e0(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;e0(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;)Vv(t,i.alternate,i),i=i.sibling}function Gs(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),Gs(i);break;case 1:Qi(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&Fv(i,i.return,s),Gs(i);break;case 27:cl(i.stateNode);case 26:case 5:Qi(i,i.return),Gs(i);break;case 22:i.memoizedState===null&&Gs(i);break;case 30:Gs(i);break;default:Gs(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,_=t,w=i,O=w.flags;switch(w.tag){case 0:case 11:case 15:Ar(_,w,s),Qo(4,w);break;case 1:if(Ar(_,w,s),l=w,_=l.stateNode,typeof _.componentDidMount=="function")try{_.componentDidMount()}catch(ae){_t(l,l.return,ae)}if(l=w,_=l.updateQueue,_!==null){var z=l.stateNode;try{var J=_.shared.hiddenCallbacks;if(J!==null)for(_.shared.hiddenCallbacks=null,_=0;_<J.length;_++)M_(J[_],z)}catch(ae){_t(l,l.return,ae)}}s&&O&64&&Uv(w),el(w,w.return);break;case 27:Gv(w);case 26:case 5:Ar(_,w,s),s&&l===null&&O&4&&qv(w),el(w,w.return);break;case 12:Ar(_,w,s);break;case 31:Ar(_,w,s),s&&O&4&&Zv(_,w);break;case 13:Ar(_,w,s),s&&O&4&&Jv(_,w);break;case 22:w.memoizedState===null&&Ar(_,w,s),el(w,w.return);break;case 30:break;default:Ar(_,w,s)}i=i.sibling}}function Qd(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&&$o(s))}function ef(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&$o(t))}function Ui(t,i,s,l){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)t0(t,i,s,l),i=i.sibling}function t0(t,i,s,l){var _=i.flags;switch(i.tag){case 0:case 11:case 15:Ui(t,i,s,l),_&2048&&Qo(9,i);break;case 1:Ui(t,i,s,l);break;case 3:Ui(t,i,s,l),_&2048&&(t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&$o(t)));break;case 12:if(_&2048){Ui(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(J){_t(i,i.return,J)}}else Ui(t,i,s,l);break;case 31:Ui(t,i,s,l);break;case 13:Ui(t,i,s,l);break;case 23:break;case 22:w=i.stateNode,O=i.alternate,i.memoizedState!==null?w._visibility&2?Ui(t,i,s,l):tl(t,i):w._visibility&2?Ui(t,i,s,l):(w._visibility|=2,Ia(t,i,s,l,(i.subtreeFlags&10256)!==0||!1)),_&2048&&Qd(O,i);break;case 24:Ui(t,i,s,l),_&2048&&ef(i.alternate,i);break;default:Ui(t,i,s,l)}}function Ia(t,i,s,l,_){for(_=_&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var w=t,O=i,z=s,J=l,ae=O.flags;switch(O.tag){case 0:case 11:case 15:Ia(w,O,z,J,_),Qo(8,O);break;case 23:break;case 22:var he=O.stateNode;O.memoizedState!==null?he._visibility&2?Ia(w,O,z,J,_):tl(w,O):(he._visibility|=2,Ia(w,O,z,J,_)),_&&ae&2048&&Qd(O.alternate,O);break;case 24:Ia(w,O,z,J,_),_&&ae&2048&&ef(O.alternate,O);break;default:Ia(w,O,z,J,_)}i=i.sibling}}function tl(t,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=t,l=i,_=l.flags;switch(l.tag){case 22:tl(s,l),_&2048&&Qd(l.alternate,l);break;case 24:tl(s,l),_&2048&&ef(l.alternate,l);break;default:tl(s,l)}i=i.sibling}}var nl=8192;function Ba(t,i,s){if(t.subtreeFlags&nl)for(t=t.child;t!==null;)n0(t,i,s),t=t.sibling}function n0(t,i,s){switch(t.tag){case 26:Ba(t,i,s),t.flags&nl&&t.memoizedState!==null&&JE(s,Hi,t.memoizedState,t.memoizedProps);break;case 5:Ba(t,i,s);break;case 3:case 4:var l=Hi;Hi=iu(t.stateNode.containerInfo),Ba(t,i,s),Hi=l;break;case 22:t.memoizedState===null&&(l=t.alternate,l!==null&&l.memoizedState!==null?(l=nl,nl=16777216,Ba(t,i,s),nl=l):Ba(t,i,s));break;default:Ba(t,i,s)}}function i0(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 il(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];mn=l,s0(l,t)}i0(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)r0(t),t=t.sibling}function r0(t){switch(t.tag){case 0:case 11:case 15:il(t),t.flags&2048&&ns(9,t,t.return);break;case 3:il(t);break;case 12:il(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,qc(t)):il(t);break;default:il(t)}}function qc(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];mn=l,s0(l,t)}i0(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:ns(8,i,i.return),qc(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,qc(i));break;default:qc(i)}t=t.sibling}}function s0(t,i){for(;mn!==null;){var s=mn;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:$o(s.memoizedState.cache)}if(l=s.child,l!==null)l.return=s,mn=l;else e:for(s=t;mn!==null;){l=mn;var _=l.sibling,w=l.return;if(Yv(l),l===s){mn=null;break e}if(_!==null){_.return=w,mn=_;break e}mn=w}}}var fE={getCacheForType:function(t){var i=Tn(an),s=i.data.get(t);return s===void 0&&(s=t(),i.data.set(t,s)),s},cacheSignal:function(){return Tn(an).controller.signal}},pE=typeof WeakMap=="function"?WeakMap:Map,dt=0,Ct=null,Qe=null,it=0,gt=0,hi=null,is=!1,ja=!1,tf=!1,kr=0,qt=0,rs=0,Ks=0,nf=0,di=0,Pa=0,rl=null,Zn=null,rf=!1,Wc=0,a0=0,Gc=1/0,Kc=null,ss=null,pn=0,as=null,za=null,Rr=0,sf=0,af=null,o0=null,sl=0,of=null;function fi(){return(dt&2)!==0&&it!==0?it&-it:F.T!==null?ff():hr()}function l0(){if(di===0)if((it&536870912)===0||at){var t=Yi;Yi<<=1,(Yi&3932160)===0&&(Yi=262144),di=t}else di=536870912;return t=ci.current,t!==null&&(t.flags|=32),di}function Jn(t,i,s){(t===Ct&&(gt===2||gt===9)||t.cancelPendingCommit!==null)&&($a(t,0),os(t,it,di,!1)),pt(t,s),((dt&2)===0||t!==Ct)&&(t===Ct&&((dt&2)===0&&(Ks|=s),qt===4&&os(t,it,di,!1)),er(t))}function c0(t,i,s){if((dt&6)!==0)throw Error(a(327));var l=!s&&(i&127)===0&&(i&t.expiredLanes)===0||de(t,i),_=l?_E(t,i):cf(t,i,!0),w=l;do{if(_===0){ja&&!l&&os(t,i,0,!1);break}else{if(s=t.current.alternate,w&&!mE(s)){_=cf(t,i,!1),w=!1;continue}if(_===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;_=rl;var J=z.current.memoizedState.isDehydrated;if(J&&($a(z,O).flags|=256),O=cf(z,O,!1),O!==2){if(tf&&!J){z.errorRecoveryDisabledLanes|=w,Ks|=w,_=4;break e}w=Zn,Zn=_,w!==null&&(Zn===null?Zn=w:Zn.push.apply(Zn,w))}_=O}if(w=!1,_!==2)continue}}if(_===1){$a(t,0),os(t,i,0,!0);break}e:{switch(l=t,w=_,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:Zn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(_=Wc+300-ht(),10<_)){if(os(l,i,di,!is),te(l,0,!0)!==0)break e;Rr=i,l.timeoutHandle=$0(u0.bind(null,l,s,Zn,Kc,rf,i,di,Ks,Pa,is,w,"Throttled",-0,0),_);break e}u0(l,s,Zn,Kc,rf,i,di,Ks,Pa,is,w,null,-0,0)}}break}while(!0);er(t)}function u0(t,i,s,l,_,w,O,z,J,ae,he,me,oe,ue){if(t.timeoutHandle=-1,me=i.subtreeFlags,me&8192||(me&16785408)===16785408){me={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:we},n0(i,w,me);var Ae=(w&62914560)===w?Wc-ht():(w&4194048)===w?a0-ht():0;if(Ae=QE(me,Ae),Ae!==null){Rr=w,t.cancelPendingCommit=Ae(v0.bind(null,t,i,w,s,l,_,O,z,J,he,me,null,oe,ue)),os(t,w,O,!ae);return}}v0(t,i,w,s,l,_,O,z,J)}function mE(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 _=s[l],w=_.getSnapshot;_=_.value;try{if(!oi(w(),_))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&=~nf,i&=~Ks,t.suspendedLanes|=i,t.pingedLanes&=~i,l&&(t.warmLanes|=i),l=t.expirationTimes;for(var _=i;0<_;){var w=31-$t(_),O=1<<w;l[w]=-1,_&=~O}s!==0&&Ce(t,s,i)}function Vc(){return(dt&6)===0?(al(0),!1):!0}function lf(){if(Qe!==null){if(gt===0)var t=Qe.return;else t=Qe,vr=Ps=null,Cd(t),La=null,Uo=0,t=Qe;for(;t!==null;)Hv(t.alternate,t),t=t.return;Qe=null}}function $a(t,i){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,IE(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),Rr=0,lf(),Ct=t,Qe=s=gr(t.current,null),it=i,gt=0,hi=null,is=!1,ja=de(t,i),tf=!1,Pa=di=nf=Ks=rs=qt=0,Zn=rl=null,rf=!1,(i&8)!==0&&(i|=i&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=i;0<l;){var _=31-$t(l),w=1<<_;i|=t[_],l&=~w}return kr=i,mc(),s}function h0(t,i){Ke=null,F.H=Xo,i===Ra||i===Cc?(i=A_(),gt=3):i===hd?(i=A_(),gt=4):gt=i===zd?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,hi=i,Qe===null&&(qt=1,jc(t,yi(i,t.current)))}function d0(){var t=ci.current;return t===null?!0:(it&4194048)===it?xi===null:(it&62914560)===it||(it&536870912)!==0?t===xi:!1}function f0(){var t=F.H;return F.H=Xo,t===null?Xo:t}function p0(){var t=F.A;return F.A=fE,t}function Yc(){qt=4,is||(it&4194048)!==it&&ci.current!==null||(ja=!0),(rs&134217727)===0&&(Ks&134217727)===0||Ct===null||os(Ct,it,di,!1)}function cf(t,i,s){var l=dt;dt|=2;var _=f0(),w=p0();(Ct!==t||it!==i)&&(Kc=null,$a(t,i)),i=!1;var O=qt;e:do try{if(gt!==0&&Qe!==null){var z=Qe,J=hi;switch(gt){case 8:lf(),O=6;break e;case 3:case 2:case 9:case 6:ci.current===null&&(i=!0);var ae=gt;if(gt=0,hi=null,Ha(t,z,J,ae),s&&ja){O=0;break e}break;default:ae=gt,gt=0,hi=null,Ha(t,z,J,ae)}}gE(),O=qt;break}catch(he){h0(t,he)}while(!0);return i&&t.shellSuspendCounter++,vr=Ps=null,dt=l,F.H=_,F.A=w,Qe===null&&(Ct=null,it=0,mc()),O}function gE(){for(;Qe!==null;)m0(Qe)}function _E(t,i){var s=dt;dt|=2;var l=f0(),_=p0();Ct!==t||it!==i?(Kc=null,Gc=ht()+500,$a(t,i)):ja=de(t,i);e:do try{if(gt!==0&&Qe!==null){i=Qe;var w=hi;t:switch(gt){case 1:gt=0,hi=null,Ha(t,i,w,1);break;case 2:case 9:if(E_(w)){gt=0,hi=null,g0(i);break}i=function(){gt!==2&&gt!==9||Ct!==t||(gt=7),er(t)},w.then(i,i);break e;case 3:gt=7;break e;case 4:gt=5;break e;case 7:E_(w)?(gt=0,hi=null,g0(i)):(gt=0,hi=null,Ha(t,i,w,7));break;case 5:var O=null;switch(Qe.tag){case 26:O=Qe.memoizedState;case 5:case 27:var z=Qe;if(O?tb(O):z.stateNode.complete){gt=0,hi=null;var J=z.sibling;if(J!==null)Qe=J;else{var ae=z.return;ae!==null?(Qe=ae,Xc(ae)):Qe=null}break t}}gt=0,hi=null,Ha(t,i,w,5);break;case 6:gt=0,hi=null,Ha(t,i,w,6);break;case 8:lf(),qt=6;break e;default:throw Error(a(462))}}vE();break}catch(he){h0(t,he)}while(!0);return vr=Ps=null,F.H=l,F.A=_,dt=s,Qe!==null?0:(Ct=null,it=0,mc(),qt)}function vE(){for(;Qe!==null&&!Bi();)m0(Qe)}function m0(t){var i=zv(t.alternate,t,kr);t.memoizedProps=t.pendingProps,i===null?Xc(t):Qe=i}function g0(t){var i=t,s=i.alternate;switch(i.tag){case 15:case 0:i=Ov(s,i,i.pendingProps,i.type,void 0,it);break;case 11:i=Ov(s,i,i.pendingProps,i.type.render,i.ref,it);break;case 5:Cd(i);default:Hv(s,i),i=Qe=p_(i,kr),i=zv(s,i,kr)}t.memoizedProps=t.pendingProps,i===null?Xc(t):Qe=i}function Ha(t,i,s,l){vr=Ps=null,Cd(i),La=null,Uo=0;var _=i.return;try{if(aE(t,_,i,s,it)){qt=1,jc(t,yi(s,t.current)),Qe=null;return}}catch(w){if(_!==null)throw Qe=_,w;qt=1,jc(t,yi(s,t.current)),Qe=null;return}i.flags&32768?(at||l===1?t=!0:ja||(it&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))),_0(i,t)):Xc(i)}function Xc(t){var i=t;do{if((i.flags&32768)!==0){_0(i,is);return}t=i.return;var s=cE(i.alternate,i,kr);if(s!==null){Qe=s;return}if(i=i.sibling,i!==null){Qe=i;return}Qe=i=t}while(i!==null);qt===0&&(qt=5)}function _0(t,i){do{var s=uE(t.alternate,t);if(s!==null){s.flags&=32767,Qe=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(t=t.sibling,t!==null)){Qe=t;return}Qe=t=s}while(t!==null);qt=6,Qe=null}function v0(t,i,s,l,_,w,O,z,J){t.cancelPendingCommit=null;do Zc();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|=Xh,Te(t,s,w,O,z,J),t===Ct&&(Qe=Ct=null,it=0),za=i,as=t,Rr=s,sf=w,af=_,o0=l,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,wE(nn,function(){return C0(),null})):(t.callbackNode=null,t.callbackPriority=0),l=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||l){l=F.T,F.T=null,_=K.p,K.p=2,O=dt,dt|=4;try{hE(t,i,s)}finally{dt=O,K.p=_,F.T=l}}pn=1,b0(),y0(),S0()}}function b0(){if(pn===1){pn=0;var t=as,i=za,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=F.T,F.T=null;var l=K.p;K.p=2;var _=dt;dt|=4;try{Qv(i,t);var w=Sf,O=s_(t.containerInfo),z=w.focusedElem,J=w.selectionRange;if(O!==z&&z&&z.ownerDocument&&r_(z.ownerDocument.documentElement,z)){if(J!==null&&Wh(z)){var ae=J.start,he=J.end;if(he===void 0&&(he=ae),"selectionStart"in z)z.selectionStart=ae,z.selectionEnd=Math.min(he,z.value.length);else{var me=z.ownerDocument||document,oe=me&&me.defaultView||window;if(oe.getSelection){var ue=oe.getSelection(),Ae=z.textContent.length,$e=Math.min(J.start,Ae),yt=J.end===void 0?$e:Math.min(J.end,Ae);!ue.extend&&$e>yt&&(O=yt,yt=$e,$e=O);var ie=i_(z,$e),ne=i_(z,yt);if(ie&&ne&&(ue.rangeCount!==1||ue.anchorNode!==ie.node||ue.anchorOffset!==ie.offset||ue.focusNode!==ne.node||ue.focusOffset!==ne.offset)){var se=me.createRange();se.setStart(ie.node,ie.offset),ue.removeAllRanges(),$e>yt?(ue.addRange(se),ue.extend(ne.node,ne.offset)):(se.setEnd(ne.node,ne.offset),ue.addRange(se))}}}}for(me=[],ue=z;ue=ue.parentNode;)ue.nodeType===1&&me.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;z<me.length;z++){var pe=me[z];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}cu=!!yf,Sf=yf=null}finally{dt=_,K.p=l,F.T=s}}t.current=i,pn=2}}function y0(){if(pn===2){pn=0;var t=as,i=za,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=F.T,F.T=null;var l=K.p;K.p=2;var _=dt;dt|=4;try{Vv(t,i.alternate,i)}finally{dt=_,K.p=l,F.T=s}}pn=3}}function S0(){if(pn===4||pn===3){pn=0,tn();var t=as,i=za,s=Rr,l=o0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?pn=5:(pn=0,za=as=null,w0(t,t.pendingLanes));var _=t.pendingLanes;if(_===0&&(ss=null),Cn(s),i=i.stateNode,Yt&&typeof Yt.onCommitFiberRoot=="function")try{Yt.onCommitFiberRoot(Fn,i,void 0,(i.current.flags&128)===128)}catch{}if(l!==null){i=F.T,_=K.p,K.p=2,F.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{F.T=i,K.p=_}}(Rr&3)!==0&&Zc(),er(t),_=t.pendingLanes,(s&261930)!==0&&(_&42)!==0?t===of?sl++:(sl=0,of=t):sl=0,al(0)}}function w0(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,$o(i)))}function Zc(){return b0(),y0(),S0(),C0()}function C0(){if(pn!==5)return!1;var t=as,i=sf;sf=0;var s=Cn(Rr),l=F.T,_=K.p;try{K.p=32>s?32:s,F.T=null,s=af,af=null;var w=as,O=Rr;if(pn=0,za=as=null,Rr=0,(dt&6)!==0)throw Error(a(331));var z=dt;if(dt|=4,r0(w.current),t0(w,w.current,O,s),dt=z,al(0,!1),Yt&&typeof Yt.onPostCommitFiberRoot=="function")try{Yt.onPostCommitFiberRoot(Fn,w)}catch{}return!0}finally{K.p=_,F.T=l,w0(t,i)}}function x0(t,i,s){i=yi(s,i),i=Pd(t.stateNode,i,2),t=Qr(t,i,2),t!==null&&(pt(t,2),er(t))}function _t(t,i,s){if(t.tag===3)x0(t,t,s);else for(;i!==null;){if(i.tag===3){x0(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=yi(s,t),s=Ev(2),l=Qr(i,s,2),l!==null&&(Tv(s,l,i,t),pt(l,2),er(l));break}}i=i.return}}function uf(t,i,s){var l=t.pingCache;if(l===null){l=t.pingCache=new pE;var _=new Set;l.set(i,_)}else _=l.get(i),_===void 0&&(_=new Set,l.set(i,_));_.has(s)||(tf=!0,_.add(s),t=bE.bind(null,t,i,s),i.then(t,t))}function bE(t,i,s){var l=t.pingCache;l!==null&&l.delete(i),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,Ct===t&&(it&s)===s&&(qt===4||qt===3&&(it&62914560)===it&&300>ht()-Wc?(dt&2)===0&&$a(t,0):nf|=s,Pa===it&&(Pa=0)),er(t)}function E0(t,i){i===0&&(i=Be()),t=Is(t,i),t!==null&&(pt(t,i),er(t))}function yE(t){var i=t.memoizedState,s=0;i!==null&&(s=i.retryLane),E0(t,s)}function SE(t,i){var s=0;switch(t.tag){case 31:case 13:var l=t.stateNode,_=t.memoizedState;_!==null&&(s=_.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),E0(t,s)}function wE(t,i){return wn(t,i)}var Jc=null,Ua=null,hf=!1,Qc=!1,df=!1,ls=0;function er(t){t!==Ua&&t.next===null&&(Ua===null?Jc=Ua=t:Ua=Ua.next=t),Qc=!0,hf||(hf=!0,xE())}function al(t,i){if(!df&&Qc){df=!0;do for(var s=!1,l=Jc;l!==null;){if(t!==0){var _=l.pendingLanes;if(_===0)var w=0;else{var O=l.suspendedLanes,z=l.pingedLanes;w=(1<<31-$t(42|t)+1)-1,w&=_&~(O&~z),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(s=!0,R0(l,w))}else w=it,w=te(l,l===Ct?w:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(w&3)===0||de(l,w)||(s=!0,R0(l,w));l=l.next}while(s);df=!1}}function CE(){T0()}function T0(){Qc=hf=!1;var t=0;ls!==0&&NE()&&(t=ls);for(var i=ht(),s=null,l=Jc;l!==null;){var _=l.next,w=A0(l,i);w===0?(l.next=null,s===null?Jc=_:s.next=_,_===null&&(Ua=s)):(s=l,(t!==0||(w&3)!==0)&&(Qc=!0)),l=_}pn!==0&&pn!==5||al(t),ls!==0&&(ls=0)}function A0(t,i){for(var s=t.suspendedLanes,l=t.pingedLanes,_=t.expirationTimes,w=t.pendingLanes&-62914561;0<w;){var O=31-$t(w),z=1<<O,J=_[O];J===-1?((z&s)===0||(z&l)!==0)&&(_[O]=be(z,i)):J<=i&&(t.expiredLanes|=z),w&=~z}if(i=Ct,s=it,s=te(t,t===i?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l=t.callbackNode,s===0||t===i&&(gt===2||gt===9)||t.cancelPendingCommit!==null)return l!==null&&l!==null&&_i(l),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||de(t,s)){if(i=s&-s,i===t.callbackPriority)return i;switch(l!==null&&_i(l),Cn(s)){case 2:case 8:s=zt;break;case 32:s=nn;break;case 268435456:s=Dn;break;default:s=nn}return l=k0.bind(null,t),s=wn(s,l),t.callbackPriority=i,t.callbackNode=s,i}return l!==null&&l!==null&&_i(l),t.callbackPriority=2,t.callbackNode=null,2}function k0(t,i){if(pn!==0&&pn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(Zc()&&t.callbackNode!==s)return null;var l=it;return l=te(t,t===Ct?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l===0?null:(c0(t,l,i),A0(t,ht()),t.callbackNode!=null&&t.callbackNode===s?k0.bind(null,t):null)}function R0(t,i){if(Zc())return null;c0(t,i,!0)}function xE(){BE(function(){(dt&6)!==0?wn(Pt,CE):T0()})}function ff(){if(ls===0){var t=Aa;t===0&&(t=Pi,Pi<<=1,(Pi&261888)===0&&(Pi=256)),ls=t}return ls}function L0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Wr(""+t)}function M0(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 EE(t,i,s,l,_){if(i==="submit"&&s&&s.stateNode===_){var w=L0((_[Et]||null).action),O=l.submitter;O&&(i=(i=O[Et]||null)?L0(i.formAction):O.getAttribute("formAction"),i!==null&&(w=i,O=null));var z=new hc("action","action",null,l,_);t.push({event:z,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(ls!==0){var J=O?M0(_,O):new FormData(_);Dd(s,{pending:!0,data:J,method:_.method,action:w},null,J)}}else typeof w=="function"&&(z.preventDefault(),J=O?M0(_,O):new FormData(_),Dd(s,{pending:!0,data:J,method:_.method,action:w},w,J))},currentTarget:_}]})}}for(var pf=0;pf<Yh.length;pf++){var mf=Yh[pf],TE=mf.toLowerCase(),AE=mf[0].toUpperCase()+mf.slice(1);$i(TE,"on"+AE)}$i(l_,"onAnimationEnd"),$i(c_,"onAnimationIteration"),$i(u_,"onAnimationStart"),$i("dblclick","onDoubleClick"),$i("focusin","onFocus"),$i("focusout","onBlur"),$i(F2,"onTransitionRun"),$i(q2,"onTransitionStart"),$i(W2,"onTransitionCancel"),$i(h_,"onTransitionEnd"),_e("onMouseEnter",["mouseout","mouseover"]),_e("onMouseLeave",["mouseout","mouseover"]),_e("onPointerEnter",["pointerout","pointerover"]),_e("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 ol="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),kE=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ol));function D0(t,i){i=(i&4)!==0;for(var s=0;s<t.length;s++){var l=t[s],_=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],J=z.instance,ae=z.currentTarget;if(z=z.listener,J!==w&&_.isPropagationStopped())break e;w=z,_.currentTarget=ae;try{w(_)}catch(he){pc(he)}_.currentTarget=null,w=J}else for(O=0;O<l.length;O++){if(z=l[O],J=z.instance,ae=z.currentTarget,z=z.listener,J!==w&&_.isPropagationStopped())break e;w=z,_.currentTarget=ae;try{w(_)}catch(he){pc(he)}_.currentTarget=null,w=J}}}}function et(t,i){var s=i[Fr];s===void 0&&(s=i[Fr]=new Set);var l=t+"__bubble";s.has(l)||(O0(i,t,2,!1),s.add(l))}function gf(t,i,s){var l=0;i&&(l|=4),O0(s,t,l,i)}var eu="_reactListening"+Math.random().toString(36).slice(2);function _f(t){if(!t[eu]){t[eu]=!0,kt.forEach(function(s){s!=="selectionchange"&&(kE.has(s)||gf(s,!1,t),gf(s,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[eu]||(i[eu]=!0,gf("selectionchange",!1,i))}}function O0(t,i,s,l){switch(lb(i)){case 2:var _=n5;break;case 8:_=i5;break;default:_=Df}s=_.bind(null,i,s,t),_=void 0,!Bh||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(_=!0),l?_!==void 0?t.addEventListener(i,s,{capture:!0,passive:_}):t.addEventListener(i,s,!0):_!==void 0?t.addEventListener(i,s,{passive:_}):t.addEventListener(i,s,!1)}function vf(t,i,s,l,_){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===_)break;if(O===4)for(O=l.return;O!==null;){var J=O.tag;if((J===3||J===4)&&O.stateNode.containerInfo===_)return;O=O.return}for(;z!==null;){if(O=Z(z),O===null)return;if(J=O.tag,J===5||J===6||J===26||J===27){l=w=O;continue e}z=z.parentNode}}l=l.return}oc(function(){var ae=w,he=Ge(s),me=[];e:{var oe=d_.get(t);if(oe!==void 0){var ue=hc,Ae=t;switch(t){case"keypress":if(cc(s)===0)break e;case"keydown":case"keyup":ue=S2;break;case"focusin":Ae="focus",ue=$h;break;case"focusout":Ae="blur",ue=$h;break;case"beforeblur":case"afterblur":ue=$h;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":ue=Hg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=c2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=x2;break;case l_:case c_:case u_:ue=d2;break;case h_:ue=T2;break;case"scroll":case"scrollend":ue=o2;break;case"wheel":ue=k2;break;case"copy":case"cut":case"paste":ue=p2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=Fg;break;case"toggle":case"beforetoggle":ue=L2}var $e=(i&4)!==0,yt=!$e&&(t==="scroll"||t==="scrollend"),ie=$e?oe!==null?oe+"Capture":null:oe;$e=[];for(var ne=ae,se;ne!==null;){var pe=ne;if(se=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||se===null||ie===null||(pe=Ro(ne,ie),pe!=null&&$e.push(ll(ne,pe,se))),yt)break;ne=ne.return}0<$e.length&&(oe=new ue(oe,Ae,null,s,he),me.push({event:oe,listeners:$e}))}}if((i&7)===0){e:{if(oe=t==="mouseover"||t==="pointerover",ue=t==="mouseout"||t==="pointerout",oe&&s!==Re&&(Ae=s.relatedTarget||s.fromElement)&&(Z(Ae)||Ae[zi]))break e;if((ue||oe)&&(oe=he.window===he?he:(oe=he.ownerDocument)?oe.defaultView||oe.parentWindow:window,ue?(Ae=s.relatedTarget||s.toElement,ue=ae,Ae=Ae?Z(Ae):null,Ae!==null&&(yt=h(Ae),$e=Ae.tag,Ae!==yt||$e!==5&&$e!==27&&$e!==6)&&(Ae=null)):(ue=null,Ae=ae),ue!==Ae)){if($e=Hg,pe="onMouseLeave",ie="onMouseEnter",ne="mouse",(t==="pointerout"||t==="pointerover")&&($e=Fg,pe="onPointerLeave",ie="onPointerEnter",ne="pointer"),yt=ue==null?oe:xe(ue),se=Ae==null?oe:xe(Ae),oe=new $e(pe,ne+"leave",ue,s,he),oe.target=yt,oe.relatedTarget=se,pe=null,Z(he)===ae&&($e=new $e(ie,ne+"enter",Ae,s,he),$e.target=se,$e.relatedTarget=yt,pe=$e),yt=pe,ue&&Ae)t:{for($e=RE,ie=ue,ne=Ae,se=0,pe=ie;pe;pe=$e(pe))se++;pe=0;for(var Ie=ne;Ie;Ie=$e(Ie))pe++;for(;0<se-pe;)ie=$e(ie),se--;for(;0<pe-se;)ne=$e(ne),pe--;for(;se--;){if(ie===ne||ne!==null&&ie===ne.alternate){$e=ie;break t}ie=$e(ie),ne=$e(ne)}$e=null}else $e=null;ue!==null&&N0(me,oe,ue,$e,!1),Ae!==null&&yt!==null&&N0(me,yt,Ae,$e,!0)}}e:{if(oe=ae?xe(ae):window,ue=oe.nodeName&&oe.nodeName.toLowerCase(),ue==="select"||ue==="input"&&oe.type==="file")var lt=Zg;else if(Yg(oe))if(Jg)lt=$2;else{lt=P2;var Le=j2}else ue=oe.nodeName,!ue||ue.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?ae&&qr(ae.elementType)&&(lt=Zg):lt=z2;if(lt&&(lt=lt(t,ae))){Xg(me,lt,s,he);break e}Le&&Le(t,oe,ae),t==="focusout"&&ae&&oe.type==="number"&&ae.memoizedProps.value!=null&&ga(oe,"number",oe.value)}switch(Le=ae?xe(ae):window,t){case"focusin":(Yg(Le)||Le.contentEditable==="true")&&(ba=Le,Gh=ae,jo=null);break;case"focusout":jo=Gh=ba=null;break;case"mousedown":Kh=!0;break;case"contextmenu":case"mouseup":case"dragend":Kh=!1,a_(me,s,he);break;case"selectionchange":if(U2)break;case"keydown":case"keyup":a_(me,s,he)}var Ve;if(Uh)e:{switch(t){case"compositionstart":var rt="onCompositionStart";break e;case"compositionend":rt="onCompositionEnd";break e;case"compositionupdate":rt="onCompositionUpdate";break e}rt=void 0}else va?Kg(t,s)&&(rt="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(rt="onCompositionStart");rt&&(qg&&s.locale!=="ko"&&(va||rt!=="onCompositionStart"?rt==="onCompositionEnd"&&va&&(Ve=zg()):(Gr=he,jh="value"in Gr?Gr.value:Gr.textContent,va=!0)),Le=tu(ae,rt),0<Le.length&&(rt=new Ug(rt,t,null,s,he),me.push({event:rt,listeners:Le}),Ve?rt.data=Ve:(Ve=Vg(s),Ve!==null&&(rt.data=Ve)))),(Ve=D2?O2(t,s):N2(t,s))&&(rt=tu(ae,"onBeforeInput"),0<rt.length&&(Le=new Ug("onBeforeInput","beforeinput",null,s,he),me.push({event:Le,listeners:rt}),Le.data=Ve)),EE(me,t,ae,s,he)}D0(me,i)})}function ll(t,i,s){return{instance:t,listener:i,currentTarget:s}}function tu(t,i){for(var s=i+"Capture",l=[];t!==null;){var _=t,w=_.stateNode;if(_=_.tag,_!==5&&_!==26&&_!==27||w===null||(_=Ro(t,s),_!=null&&l.unshift(ll(t,_,w)),_=Ro(t,i),_!=null&&l.push(ll(t,_,w))),t.tag===3)return l;t=t.return}return[]}function RE(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function N0(t,i,s,l,_){for(var w=i._reactName,O=[];s!==null&&s!==l;){var z=s,J=z.alternate,ae=z.stateNode;if(z=z.tag,J!==null&&J===l)break;z!==5&&z!==26&&z!==27||ae===null||(J=ae,_?(ae=Ro(s,w),ae!=null&&O.unshift(ll(s,ae,J))):_||(ae=Ro(s,w),ae!=null&&O.push(ll(s,ae,J)))),s=s.return}O.length!==0&&t.push({event:i,listeners:O})}var LE=/\r\n?/g,ME=/\u0000|\uFFFD/g;function I0(t){return(typeof t=="string"?t:""+t).replace(LE,`
9
- `).replace(ME,"")}function B0(t,i){return i=I0(i),I0(t)===i}function bt(t,i,s,l,_,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":mt(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",_.name,_,null),bt(t,i,"formEncType",_.formEncType,_,null),bt(t,i,"formMethod",_.formMethod,_,null),bt(t,i,"formTarget",_.formTarget,_,null)):(bt(t,i,"encType",_.encType,_,null),bt(t,i,"method",_.method,_,null),bt(t,i,"target",_.target,_,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&&et("scroll",t);break;case"onScrollEnd":l!=null&&et("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(_.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":et("beforetoggle",t),et("toggle",t),On(t,"popover",l);break;case"xlinkActuate":Wn(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Wn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Wn(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Wn(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Wn(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Wn(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Wn(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Wn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Wn(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 bf(t,i,s,l,_,w){switch(s){case"style":mt(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(_.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&&et("scroll",t);break;case"onScrollEnd":l!=null&&et("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"&&(_=s.endsWith("Capture"),i=s.slice(2,_?s.length-7:void 0),w=t[Et]||null,w=w!=null?w[s]:null,typeof w=="function"&&t.removeEventListener(i,w,_),typeof l=="function")){typeof w!="function"&&w!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(i,l,_);break e}s in t?t[s]=l:l===!0?t.setAttribute(s,""):On(t,s,l)}}}function kn(t,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":et("error",t),et("load",t);var l=!1,_=!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":_=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:bt(t,i,w,O,s,null)}}_&&bt(t,i,"srcSet",s.srcSet,s,null),l&&bt(t,i,"src",s.src,s,null);return;case"input":et("invalid",t);var z=w=O=_=null,J=null,ae=null;for(l in s)if(s.hasOwnProperty(l)){var he=s[l];if(he!=null)switch(l){case"name":_=he;break;case"type":O=he;break;case"checked":J=he;break;case"defaultChecked":ae=he;break;case"value":w=he;break;case"defaultValue":z=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(a(137,i));break;default:bt(t,i,l,he,s,null)}}Ms(t,w,z,J,ae,O,_,!1);return;case"select":et("invalid",t),l=O=w=null;for(_ in s)if(s.hasOwnProperty(_)&&(z=s[_],z!=null))switch(_){case"value":w=z;break;case"defaultValue":O=z;break;case"multiple":l=z;default:bt(t,i,_,z,s,null)}i=w,s=O,t.multiple=!!l,i!=null?xn(t,!!l,i,!1):s!=null&&xn(t,!!l,s,!0);return;case"textarea":et("invalid",t),w=_=l=null;for(O in s)if(s.hasOwnProperty(O)&&(z=s[O],z!=null))switch(O){case"value":l=z;break;case"defaultValue":_=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)}_a(t,l,_,w);return;case"option":for(J in s)s.hasOwnProperty(J)&&(l=s[J],l!=null)&&(J==="selected"?t.selected=l&&typeof l!="function"&&typeof l!="symbol":bt(t,i,J,l,s,null));return;case"dialog":et("beforetoggle",t),et("toggle",t),et("cancel",t),et("close",t);break;case"iframe":case"object":et("load",t);break;case"video":case"audio":for(l=0;l<ol.length;l++)et(ol[l],t);break;case"image":et("error",t),et("load",t);break;case"details":et("toggle",t);break;case"embed":case"source":case"link":et("error",t),et("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ae in s)if(s.hasOwnProperty(ae)&&(l=s[ae],l!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:bt(t,i,ae,l,s,null)}return;default:if(qr(i)){for(he in s)s.hasOwnProperty(he)&&(l=s[he],l!==void 0&&bf(t,i,he,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 DE(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 _=null,w=null,O=null,z=null,J=null,ae=null,he=null;for(ue in s){var me=s[ue];if(s.hasOwnProperty(ue)&&me!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":J=me;default:l.hasOwnProperty(ue)||bt(t,i,ue,null,l,me)}}for(var oe in l){var ue=l[oe];if(me=s[oe],l.hasOwnProperty(oe)&&(ue!=null||me!=null))switch(oe){case"type":w=ue;break;case"name":_=ue;break;case"checked":ae=ue;break;case"defaultChecked":he=ue;break;case"value":O=ue;break;case"defaultValue":z=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(a(137,i));break;default:ue!==me&&bt(t,i,oe,ue,l,me)}}To(t,O,z,J,ae,he,w,_);return;case"select":ue=O=z=oe=null;for(w in s)if(J=s[w],s.hasOwnProperty(w)&&J!=null)switch(w){case"value":break;case"multiple":ue=J;default:l.hasOwnProperty(w)||bt(t,i,w,null,l,J)}for(_ in l)if(w=l[_],J=s[_],l.hasOwnProperty(_)&&(w!=null||J!=null))switch(_){case"value":oe=w;break;case"defaultValue":z=w;break;case"multiple":O=w;default:w!==J&&bt(t,i,_,w,l,J)}i=z,s=O,l=ue,oe!=null?xn(t,!!s,oe,!1):!!l!=!!s&&(i!=null?xn(t,!!s,i,!0):xn(t,!!s,s?[]:"",!1));return;case"textarea":ue=oe=null;for(z in s)if(_=s[z],s.hasOwnProperty(z)&&_!=null&&!l.hasOwnProperty(z))switch(z){case"value":break;case"children":break;default:bt(t,i,z,null,l,_)}for(O in l)if(_=l[O],w=s[O],l.hasOwnProperty(O)&&(_!=null||w!=null))switch(O){case"value":oe=_;break;case"defaultValue":ue=_;break;case"children":break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(a(91));break;default:_!==w&&bt(t,i,O,_,l,w)}sc(t,oe,ue);return;case"option":for(var Ae in s)oe=s[Ae],s.hasOwnProperty(Ae)&&oe!=null&&!l.hasOwnProperty(Ae)&&(Ae==="selected"?t.selected=!1:bt(t,i,Ae,null,l,oe));for(J in l)oe=l[J],ue=s[J],l.hasOwnProperty(J)&&oe!==ue&&(oe!=null||ue!=null)&&(J==="selected"?t.selected=oe&&typeof oe!="function"&&typeof oe!="symbol":bt(t,i,J,oe,l,ue));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 $e in s)oe=s[$e],s.hasOwnProperty($e)&&oe!=null&&!l.hasOwnProperty($e)&&bt(t,i,$e,null,l,oe);for(ae in l)if(oe=l[ae],ue=s[ae],l.hasOwnProperty(ae)&&oe!==ue&&(oe!=null||ue!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(a(137,i));break;default:bt(t,i,ae,oe,l,ue)}return;default:if(qr(i)){for(var yt in s)oe=s[yt],s.hasOwnProperty(yt)&&oe!==void 0&&!l.hasOwnProperty(yt)&&bf(t,i,yt,void 0,l,oe);for(he in l)oe=l[he],ue=s[he],!l.hasOwnProperty(he)||oe===ue||oe===void 0&&ue===void 0||bf(t,i,he,oe,l,ue);return}}for(var ie in s)oe=s[ie],s.hasOwnProperty(ie)&&oe!=null&&!l.hasOwnProperty(ie)&&bt(t,i,ie,null,l,oe);for(me in l)oe=l[me],ue=s[me],!l.hasOwnProperty(me)||oe===ue||oe==null&&ue==null||bt(t,i,me,oe,l,ue)}function j0(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function OE(){if(typeof performance.getEntriesByType=="function"){for(var t=0,i=0,s=performance.getEntriesByType("resource"),l=0;l<s.length;l++){var _=s[l],w=_.transferSize,O=_.initiatorType,z=_.duration;if(w&&z&&j0(O)){for(O=0,z=_.responseEnd,l+=1;l<s.length;l++){var J=s[l],ae=J.startTime;if(ae>z)break;var he=J.transferSize,me=J.initiatorType;he&&j0(me)&&(J=J.responseEnd,O+=he*(J<z?1:(z-ae)/(J-ae)))}if(--l,i+=8*(w+O)/(_.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 yf=null,Sf=null;function nu(t){return t.nodeType===9?t:t.ownerDocument}function P0(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 z0(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 wf(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 Cf=null;function NE(){var t=window.event;return t&&t.type==="popstate"?t===Cf?!1:(Cf=t,!0):(Cf=null,!1)}var $0=typeof setTimeout=="function"?setTimeout:void 0,IE=typeof clearTimeout=="function"?clearTimeout:void 0,H0=typeof Promise=="function"?Promise:void 0,BE=typeof queueMicrotask=="function"?queueMicrotask:typeof H0<"u"?function(t){return H0.resolve(null).then(t).catch(jE)}:$0;function jE(t){setTimeout(function(){throw t})}function cs(t){return t==="head"}function U0(t,i){var s=i,l=0;do{var _=s.nextSibling;if(t.removeChild(s),_&&_.nodeType===8)if(s=_.data,s==="/$"||s==="/&"){if(l===0){t.removeChild(_),Ga(i);return}l--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")l++;else if(s==="html")cl(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,cl(s);for(var w=s.firstChild;w;){var O=w.nextSibling,z=w.nodeName;w[Xi]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&w.rel.toLowerCase()==="stylesheet"||s.removeChild(w),w=O}}else s==="body"&&cl(t.ownerDocument.body);s=_}while(s);Ga(i)}function F0(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 xf(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":xf(s),De(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function PE(t,i,s,l){for(;t.nodeType===1;){var _=s;if(t.nodeName.toLowerCase()!==i.toLowerCase()){if(!l&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(l){if(!t[Xi])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!==_.rel||t.getAttribute("href")!==(_.href==null||_.href===""?null:_.href)||t.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin)||t.getAttribute("title")!==(_.title==null?null:_.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(w=t.getAttribute("src"),(w!==(_.src==null?null:_.src)||t.getAttribute("type")!==(_.type==null?null:_.type)||t.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin))&&w&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(i==="input"&&t.type==="hidden"){var w=_.name==null?null:""+_.name;if(_.type==="hidden"&&t.getAttribute("name")===w)return t}else return t;if(t=Ei(t.nextSibling),t===null)break}return null}function zE(t,i,s){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=Ei(t.nextSibling),t===null))return null;return t}function q0(t,i){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=Ei(t.nextSibling),t===null))return null;return t}function Ef(t){return t.data==="$?"||t.data==="$~"}function Tf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function $E(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 Ei(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 Af=null;function W0(t){t=t.nextSibling;for(var i=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(i===0)return Ei(t.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}t=t.nextSibling}return null}function G0(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 K0(t,i,s){switch(i=nu(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 cl(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);De(t)}var Ti=new Map,V0=new Set;function iu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Lr=K.d;K.d={f:HE,r:UE,D:FE,C:qE,L:WE,m:GE,X:VE,S:KE,M:YE};function HE(){var t=Lr.f(),i=Vc();return t||i}function UE(t){var i=ge(t);i!==null&&i.tag===5&&i.type==="form"?hv(i):Lr.r(t)}var Fa=typeof document>"u"?null:document;function Y0(t,i,s){var l=Fa;if(l&&typeof i=="string"&&i){var _=Gn(i);_='link[rel="'+t+'"][href="'+_+'"]',typeof s=="string"&&(_+='[crossorigin="'+s+'"]'),V0.has(_)||(V0.add(_),t={rel:t,crossOrigin:s,href:i},l.querySelector(_)===null&&(i=l.createElement("link"),kn(i,"link",t),Je(i),l.head.appendChild(i)))}}function FE(t){Lr.D(t),Y0("dns-prefetch",t,null)}function qE(t,i){Lr.C(t,i),Y0("preconnect",t,i)}function WE(t,i,s){Lr.L(t,i,s);var l=Fa;if(l&&t&&i){var _='link[rel="preload"][as="'+Gn(i)+'"]';i==="image"&&s&&s.imageSrcSet?(_+='[imagesrcset="'+Gn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(_+='[imagesizes="'+Gn(s.imageSizes)+'"]')):_+='[href="'+Gn(t)+'"]';var w=_;switch(i){case"style":w=qa(t);break;case"script":w=Wa(t)}Ti.has(w)||(t=p({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:t,as:i},s),Ti.set(w,t),l.querySelector(_)!==null||i==="style"&&l.querySelector(ul(w))||i==="script"&&l.querySelector(hl(w))||(i=l.createElement("link"),kn(i,"link",t),Je(i),l.head.appendChild(i)))}}function GE(t,i){Lr.m(t,i);var s=Fa;if(s&&t){var l=i&&typeof i.as=="string"?i.as:"script",_='link[rel="modulepreload"][as="'+Gn(l)+'"][href="'+Gn(t)+'"]',w=_;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=Wa(t)}if(!Ti.has(w)&&(t=p({rel:"modulepreload",href:t},i),Ti.set(w,t),s.querySelector(_)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(hl(w)))return}l=s.createElement("link"),kn(l,"link",t),Je(l),s.head.appendChild(l)}}}function KE(t,i,s){Lr.S(t,i,s);var l=Fa;if(l&&t){var _=st(l).hoistableStyles,w=qa(t);i=i||"default";var O=_.get(w);if(!O){var z={loading:0,preload:null};if(O=l.querySelector(ul(w)))z.loading=5;else{t=p({rel:"stylesheet",href:t,"data-precedence":i},s),(s=Ti.get(w))&&kf(t,s);var J=O=l.createElement("link");Je(J),kn(J,"link",t),J._p=new Promise(function(ae,he){J.onload=ae,J.onerror=he}),J.addEventListener("load",function(){z.loading|=1}),J.addEventListener("error",function(){z.loading|=2}),z.loading|=4,ru(O,i,l)}O={type:"stylesheet",instance:O,count:1,state:z},_.set(w,O)}}}function VE(t,i){Lr.X(t,i);var s=Fa;if(s&&t){var l=st(s).hoistableScripts,_=Wa(t),w=l.get(_);w||(w=s.querySelector(hl(_)),w||(t=p({src:t,async:!0},i),(i=Ti.get(_))&&Rf(t,i),w=s.createElement("script"),Je(w),kn(w,"link",t),s.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},l.set(_,w))}}function YE(t,i){Lr.M(t,i);var s=Fa;if(s&&t){var l=st(s).hoistableScripts,_=Wa(t),w=l.get(_);w||(w=s.querySelector(hl(_)),w||(t=p({src:t,async:!0,type:"module"},i),(i=Ti.get(_))&&Rf(t,i),w=s.createElement("script"),Je(w),kn(w,"link",t),s.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},l.set(_,w))}}function X0(t,i,s,l){var _=(_=ce.current)?iu(_):null;if(!_)throw Error(a(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=qa(s.href),s=st(_).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=qa(s.href);var w=st(_).hoistableStyles,O=w.get(t);if(O||(_=_.ownerDocument||_,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(t,O),(w=_.querySelector(ul(t)))&&!w._p&&(O.instance=w,O.state.loading=5),Ti.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},Ti.set(t,s),w||XE(_,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=Wa(s),s=st(_).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 qa(t){return'href="'+Gn(t)+'"'}function ul(t){return'link[rel="stylesheet"]['+t+"]"}function Z0(t){return p({},t,{"data-precedence":t.precedence,precedence:null})}function XE(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}),kn(i,"link",s),Je(i),t.head.appendChild(i))}function Wa(t){return'[src="'+Gn(t)+'"]'}function hl(t){return"script[async]"+t}function J0(t,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var l=t.querySelector('style[data-href~="'+Gn(s.href)+'"]');if(l)return i.instance=l,Je(l),l;var _=p({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),Je(l),kn(l,"style",_),ru(l,s.precedence,t),i.instance=l;case"stylesheet":_=qa(s.href);var w=t.querySelector(ul(_));if(w)return i.state.loading|=4,i.instance=w,Je(w),w;l=Z0(s),(_=Ti.get(_))&&kf(l,_),w=(t.ownerDocument||t).createElement("link"),Je(w);var O=w;return O._p=new Promise(function(z,J){O.onload=z,O.onerror=J}),kn(w,"link",l),i.state.loading|=4,ru(w,s.precedence,t),i.instance=w;case"script":return w=Wa(s.src),(_=t.querySelector(hl(w)))?(i.instance=_,Je(_),_):(l=s,(_=Ti.get(w))&&(l=p({},s),Rf(l,_)),t=t.ownerDocument||t,_=t.createElement("script"),Je(_),kn(_,"link",l),t.head.appendChild(_),i.instance=_);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,ru(l,s.precedence,t));return i.instance}function ru(t,i,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),_=l.length?l[l.length-1]:null,w=_,O=0;O<l.length;O++){var z=l[O];if(z.dataset.precedence===i)w=z;else if(w!==_)break}w?w.parentNode.insertBefore(t,w.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(t,i.firstChild))}function kf(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function Rf(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var su=null;function Q0(t,i,s){if(su===null){var l=new Map,_=su=new Map;_.set(s,l)}else _=su,l=_.get(s),l||(l=new Map,_.set(s,l));if(l.has(t))return l;for(l.set(t,null),s=s.getElementsByTagName(t),_=0;_<s.length;_++){var w=s[_];if(!(w[Xi]||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 eb(t,i,s){t=t.ownerDocument||t,t.head.insertBefore(s,i==="title"?t.querySelector("head > title"):null)}function ZE(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 tb(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function JE(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 _=qa(l.href),w=i.querySelector(ul(_));if(w){i=w._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(t.count++,t=au.bind(t),i.then(t,t)),s.state.loading|=4,s.instance=w,Je(w);return}w=i.ownerDocument||i,l=Z0(l),(_=Ti.get(_))&&kf(l,_),w=w.createElement("link"),Je(w);var O=w;O._p=new Promise(function(z,J){O.onload=z,O.onerror=J}),kn(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=au.bind(t),i.addEventListener("load",s),i.addEventListener("error",s))}}var Lf=0;function QE(t,i){return t.stylesheets&&t.count===0&&lu(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var l=setTimeout(function(){if(t.stylesheets&&lu(t,t.stylesheets),t.unsuspend){var w=t.unsuspend;t.unsuspend=null,w()}},6e4+i);0<t.imgBytes&&Lf===0&&(Lf=62500*OE());var _=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&lu(t,t.stylesheets),t.unsuspend)){var w=t.unsuspend;t.unsuspend=null,w()}},(t.imgBytes>Lf?50:800)+i);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(_)}}:null}function au(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)lu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var ou=null;function lu(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,ou=new Map,i.forEach(e5,t),ou=null,au.call(t))}function e5(t,i){if(!(i.state.loading&4)){var s=ou.get(t);if(s)var l=s.get(null);else{s=new Map,ou.set(t,s);for(var _=t.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<_.length;w++){var O=_[w];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(s.set(O.dataset.precedence,O),l=O)}l&&s.set(null,l)}_=i.instance,O=_.getAttribute("data-precedence"),w=s.get(O)||l,w===l&&s.set(null,_),s.set(O,_),this.count++,l=au.bind(this),_.addEventListener("load",l),_.addEventListener("error",l),w?w.parentNode.insertBefore(_,w.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(_,t.firstChild)),i.state.loading|=4}}var dl={$$typeof:b,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function t5(t,i,s,l,_,w,O,z,J){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=_,this.onCaughtError=w,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.incompleteTransitions=new Map}function nb(t,i,s,l,_,w,O,z,J,ae,he,me){return t=new t5(t,i,s,O,J,ae,he,me,z),i=1,w===!0&&(i|=24),w=li(3,null,null,i),t.current=w,w.stateNode=t,i=ld(),i.refCount++,t.pooledCache=i,i.refCount++,w.memoizedState={element:l,isDehydrated:s,cache:i},dd(w),t}function ib(t){return t?(t=wa,t):wa}function rb(t,i,s,l,_,w){_=ib(_),l.context===null?l.context=_:l.pendingContext=_,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&&(Jn(s,t,i),qo(s,t,i))}function sb(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<i?s:i}}function Mf(t,i){sb(t,i),(t=t.alternate)&&sb(t,i)}function ab(t){if(t.tag===13||t.tag===31){var i=Is(t,67108864);i!==null&&Jn(i,t,67108864),Mf(t,67108864)}}function ob(t){if(t.tag===13||t.tag===31){var i=fi();i=tt(i);var s=Is(t,i);s!==null&&Jn(s,t,i),Mf(t,i)}}var cu=!0;function n5(t,i,s,l){var _=F.T;F.T=null;var w=K.p;try{K.p=2,Df(t,i,s,l)}finally{K.p=w,F.T=_}}function i5(t,i,s,l){var _=F.T;F.T=null;var w=K.p;try{K.p=8,Df(t,i,s,l)}finally{K.p=w,F.T=_}}function Df(t,i,s,l){if(cu){var _=Of(l);if(_===null)vf(t,i,l,uu,s),cb(t,l);else if(s5(_,t,i,s,l))l.stopPropagation();else if(cb(t,l),i&4&&-1<r5.indexOf(t)){for(;_!==null;){var w=ge(_);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 J=1<<31-$t(O);z.entanglements[1]|=J,O&=~J}er(w),(dt&6)===0&&(Gc=ht()+500,al(0))}}break;case 31:case 13:z=Is(w,2),z!==null&&Jn(z,w,2),Vc(),Mf(w,2)}if(w=Of(l),w===null&&vf(t,i,l,uu,s),w===_)break;_=w}_!==null&&l.stopPropagation()}else vf(t,i,l,null,s)}}function Of(t){return t=Ge(t),Nf(t)}var uu=null;function Nf(t){if(uu=null,t=Z(t),t!==null){var i=h(t);if(i===null)t=null;else{var s=i.tag;if(s===13){if(t=g(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 uu=t,null}function lb(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 Pt:return 2;case zt:return 8;case nn:case ji:return 32;case Dn:return 268435456;default:return 32}default:return 32}}var If=!1,us=null,hs=null,ds=null,fl=new Map,pl=new Map,fs=[],r5="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 cb(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":fl.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":pl.delete(i.pointerId)}}function ml(t,i,s,l,_,w){return t===null||t.nativeEvent!==w?(t={blockedOn:i,domEventName:s,eventSystemFlags:l,nativeEvent:w,targetContainers:[_]},i!==null&&(i=ge(i),i!==null&&ab(i)),t):(t.eventSystemFlags|=l,i=t.targetContainers,_!==null&&i.indexOf(_)===-1&&i.push(_),t)}function s5(t,i,s,l,_){switch(i){case"focusin":return us=ml(us,t,i,s,l,_),!0;case"dragenter":return hs=ml(hs,t,i,s,l,_),!0;case"mouseover":return ds=ml(ds,t,i,s,l,_),!0;case"pointerover":var w=_.pointerId;return fl.set(w,ml(fl.get(w)||null,t,i,s,l,_)),!0;case"gotpointercapture":return w=_.pointerId,pl.set(w,ml(pl.get(w)||null,t,i,s,l,_)),!0}return!1}function ub(t){var i=Z(t.target);if(i!==null){var s=h(i);if(s!==null){if(i=s.tag,i===13){if(i=g(s),i!==null){t.blockedOn=i,dr(t.priority,function(){ob(s)});return}}else if(i===31){if(i=c(s),i!==null){t.blockedOn=i,dr(t.priority,function(){ob(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 hu(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var s=Of(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=ge(s),i!==null&&ab(i),t.blockedOn=s,!1;i.shift()}return!0}function hb(t,i,s){hu(t)&&s.delete(i)}function a5(){If=!1,us!==null&&hu(us)&&(us=null),hs!==null&&hu(hs)&&(hs=null),ds!==null&&hu(ds)&&(ds=null),fl.forEach(hb),pl.forEach(hb)}function du(t,i){t.blockedOn===i&&(t.blockedOn=null,If||(If=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,a5)))}var fu=null;function db(t){fu!==t&&(fu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){fu===t&&(fu=null);for(var i=0;i<t.length;i+=3){var s=t[i],l=t[i+1],_=t[i+2];if(typeof l!="function"){if(Nf(l||s)===null)continue;break}var w=ge(s);w!==null&&(t.splice(i,3),i-=3,Dd(w,{pending:!0,data:_,method:s.method,action:l},l,_))}}))}function Ga(t){function i(J){return du(J,t)}us!==null&&du(us,t),hs!==null&&du(hs,t),ds!==null&&du(ds,t),fl.forEach(i),pl.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);)ub(s),s.blockedOn===null&&fs.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(l=0;l<s.length;l+=3){var _=s[l],w=s[l+1],O=_[Et]||null;if(typeof w=="function")O||db(s);else if(O){var z=null;if(w&&w.hasAttribute("formAction")){if(_=w,O=w[Et]||null)z=O.formAction;else if(Nf(_)!==null)continue}else z=O.action;typeof z=="function"?s[l+1]=z:(s.splice(l,3),l-=3),db(s)}}}function fb(){function t(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(O){return _=O})},focusReset:"manual",scroll:"manual"})}function i(){_!==null&&(_(),_=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,_=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),_!==null&&(_(),_=null)}}}function Bf(t){this._internalRoot=t}pu.prototype.render=Bf.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,l=fi();rb(s,l,t,i,null,null)},pu.prototype.unmount=Bf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;rb(t.current,2,null,t,null,null),Vc(),i[zi]=null}};function pu(t){this._internalRoot=t}pu.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&&ub(t)}};var pb=n.version;if(pb!=="19.2.7")throw Error(a(527,pb,"19.2.7"));K.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 o5={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var mu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!mu.isDisabled&&mu.supportsFiber)try{Fn=mu.inject(o5),Yt=mu}catch{}}return _l.createRoot=function(t,i){if(!o(t))throw Error(a(299));var s=!1,l="",_=Sv,w=wv,O=Cv;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(l=i.identifierPrefix),i.onUncaughtError!==void 0&&(_=i.onUncaughtError),i.onCaughtError!==void 0&&(w=i.onCaughtError),i.onRecoverableError!==void 0&&(O=i.onRecoverableError)),i=nb(t,1,!1,null,null,s,l,null,_,w,O,fb),t[zi]=i.current,_f(t),new Bf(i)},_l.hydrateRoot=function(t,i,s){if(!o(t))throw Error(a(299));var l=!1,_="",w=Sv,O=wv,z=Cv,J=null;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(_=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&&(J=s.formState)),i=nb(t,1,!0,i,s??null,l,_,J,w,O,z,fb),i.context=ib(null),s=i.current,l=fi(),l=tt(l),_=Jr(l),_.callback=null,Qr(s,_,l),s=l,i.current.lanes=s,pt(i,s),er(i),t[zi]=i.current,_f(t),new pu(i)},_l.version="19.2.7",_l}var xb;function _5(){if(xb)return zf.exports;xb=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(),zf.exports=g5(),zf.exports}var v5=_5();var Eb="popstate";function Tb(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function b5(e={}){function n(a,o){let h=o.state?.masked,{pathname:g,search:c,hash:u}=h||a.location;return jp("",{pathname:g,search:c,hash:u},o.state&&o.state.usr||null,o.state&&o.state.key||"default",h?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,o){return typeof o=="string"?o:Fl(o)}return S5(n,r,null,e)}function It(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Ki(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function y5(){return Math.random().toString(36).substring(2,10)}function Ab(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 jp(e,n,r=null,a,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?go(n):n,state:r,key:n&&n.key||a||y5(),mask:o}}function Fl({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 go(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 S5(e,n,r,a={}){let{window:o=document.defaultView,v5Compat:h=!1}=a,g=o.history,c="POP",u=null,d=S();d==null&&(d=0,g.replaceState({...g.state,idx:d},""));function S(){return(g.state||{idx:null}).idx}function p(){c="POP";let m=S(),y=m==null?null:m-d;d=m,u&&u({action:c,location:E.location,delta:y})}function C(m,y){c="PUSH";let f=Tb(m)?m:jp(E.location,m,y);d=S()+1;let b=Ab(f,d),T=E.createHref(f.mask||f);try{g.pushState(b,"",T)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;o.location.assign(T)}h&&u&&u({action:c,location:E.location,delta:1})}function x(m,y){c="REPLACE";let f=Tb(m)?m:jp(E.location,m,y);d=S();let b=Ab(f,d),T=E.createHref(f.mask||f);g.replaceState(b,"",T),h&&u&&u({action:c,location:E.location,delta:0})}function A(m){return w5(o,m)}let E={get action(){return c},get location(){return e(o,g)},listen(m){if(u)throw new Error("A history only accepts one active listener");return o.addEventListener(Eb,p),u=m,()=>{o.removeEventListener(Eb,p),u=null}},createHref(m){return n(o,m)},createURL:A,encodeLocation(m){let y=A(m);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:C,replace:x,go(m){return g.go(m)}};return E}function w5(e,n,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),It(a,"No window.location.(origin|href) available to create URL");let o=typeof n=="string"?n:Fl(n);return o=o.replace(/ $/,"%20"),!r&&o.startsWith("//")&&(o=a+o),new URL(o,a)}function vS(e,n,r="/"){return C5(e,n,r,!1)}function C5(e,n,r,a,o){let h=typeof n=="string"?go(n):n,g=$r(h.pathname||"/",r);if(g==null)return null;let c=x5(e),u=null,d=B5(g);for(let S=0;u==null&&S<c.length;++S)u=N5(c[S],d,a);return u}function x5(e){let n=bS(e);return E5(n),n}function bS(e,n=[],r=[],a="",o=!1){let h=(g,c,u=o,d)=>{let S={relativePath:d===void 0?g.path||"":d,caseSensitive:g.caseSensitive===!0,childrenIndex:c,route:g};if(S.relativePath.startsWith("/")){if(!S.relativePath.startsWith(a)&&u)return;It(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 p=Gi([a,S.relativePath]),C=r.concat(S);g.children&&g.children.length>0&&(It(g.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),bS(g.children,n,C,p,u)),!(g.path==null&&!g.index)&&n.push({path:p,score:D5(p,g.index),routesMeta:C})};return e.forEach((g,c)=>{if(g.path===""||!g.path?.includes("?"))h(g,c);else for(let u of yS(g.path))h(g,c,!0,u)}),n}function yS(e){let n=e.split("/");if(n.length===0)return[];let[r,...a]=n,o=r.endsWith("?"),h=r.replace(/\?$/,"");if(a.length===0)return o?[h,""]:[h];let g=yS(a.join("/")),c=[];return c.push(...g.map(u=>u===""?h:[h,u].join("/"))),o&&c.push(...g),c.map(u=>e.startsWith("/")&&u===""?"/":u)}function E5(e){e.sort((n,r)=>n.score!==r.score?r.score-n.score:O5(n.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var T5=/^:[\w-]+$/,A5=3,k5=2,R5=1,L5=10,M5=-2,kb=e=>e==="*";function D5(e,n){let r=e.split("/"),a=r.length;return r.some(kb)&&(a+=M5),n&&(a+=k5),r.filter(o=>!kb(o)).reduce((o,h)=>o+(T5.test(h)?A5:h===""?R5:L5),a)}function O5(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={},h="/",g=[];for(let c=0;c<a.length;++c){let u=a[c],d=c===a.length-1,S=h==="/"?n:n.slice(h.length)||"/",p=Zu({path:u.relativePath,caseSensitive:u.caseSensitive,end:d},S),C=u.route;if(!p&&d&&r&&!a[a.length-1].route.index&&(p=Zu({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},S)),!p)return null;Object.assign(o,p.params),g.push({params:o,pathname:Gi([h,p.pathname]),pathnameBase:$5(Gi([h,p.pathnameBase])),route:C}),p.pathnameBase!=="/"&&(h=Gi([h,p.pathnameBase]))}return g}function Zu(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 h=o[0],g=h.replace(/(.)\/+$/,"$1"),c=o.slice(1);return{params:a.reduce((d,{paramName:S,isOptional:p},C)=>{if(S==="*"){let A=c[C]||"";g=h.slice(0,h.length-A.length).replace(/(.)\/+$/,"$1")}const x=c[C];return p&&!x?d[S]=void 0:d[S]=(x||"").replace(/%2F/g,"/"),d},{}),pathname:h,pathnameBase:g,pattern:e}}function I5(e,n=!1,r=!0){Ki(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,(g,c,u,d,S)=>{if(a.push({paramName:c,isOptional:u!=null}),u){let p=S.charAt(d+g.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}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 B5(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Ki(!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 $r(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 j5=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function P5(e,n="/"){let{pathname:r,search:a="",hash:o=""}=typeof e=="string"?go(e):e,h;return r?(r=SS(r),r.startsWith("/")?h=Rb(r.substring(1),"/"):h=Rb(r,n)):h=n,{pathname:h,search:H5(a),hash:U5(o)}}function Rb(e,n){let r=Ju(n).split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function Ff(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 z5(e){return e.filter((n,r)=>r===0||n.route.path&&n.route.path.length>0)}function Um(e){let n=z5(e);return n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase)}function bh(e,n,r,a=!1){let o;typeof e=="string"?o=go(e):(o={...e},It(!o.pathname||!o.pathname.includes("?"),Ff("?","pathname","search",o)),It(!o.pathname||!o.pathname.includes("#"),Ff("#","pathname","hash",o)),It(!o.search||!o.search.includes("#"),Ff("#","search","hash",o)));let h=e===""||o.pathname==="",g=h?"/":o.pathname,c;if(g==null)c=r;else{let p=n.length-1;if(!a&&g.startsWith("..")){let C=g.split("/");for(;C[0]==="..";)C.shift(),p-=1;o.pathname=C.join("/")}c=p>=0?n[p]:"/"}let u=P5(o,c),d=g&&g!=="/"&&g.endsWith("/"),S=(h||g===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(d||S)&&(u.pathname+="/"),u}var SS=e=>e.replace(/\/\/+/g,"/"),Gi=e=>SS(e.join("/")),Ju=e=>e.replace(/\/+$/,""),$5=e=>Ju(e).replace(/^\/*/,"/"),H5=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,U5=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,F5=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 q5(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function W5(e){let n=e.map(r=>r.route.path).filter(Boolean);return Gi(n)||"/"}var wS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function CS(e,n){let r=e;if(typeof r!="string"||!j5.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,o=!1;if(wS)try{let h=new URL(window.location.href),g=r.startsWith("//")?new URL(h.protocol+r):new URL(r),c=$r(g.pathname,n);g.origin===h.origin&&c!=null?r=c+g.search+g.hash:o=!0}catch{Ki(!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 xS=["POST","PUT","PATCH","DELETE"];new Set(xS);var G5=["GET",...xS];new Set(G5);var _o=$.createContext(null);_o.displayName="DataRouter";var yh=$.createContext(null);yh.displayName="DataRouterState";var ES=$.createContext(!1);function K5(){return $.useContext(ES)}var TS=$.createContext({isTransitioning:!1});TS.displayName="ViewTransition";var V5=$.createContext(new Map);V5.displayName="Fetchers";var Y5=$.createContext(null);Y5.displayName="Await";var gi=$.createContext(null);gi.displayName="Navigation";var Jl=$.createContext(null);Jl.displayName="Location";var ar=$.createContext({outlet:null,matches:[],isDataRoute:!1});ar.displayName="Route";var Fm=$.createContext(null);Fm.displayName="RouteError";var AS="REACT_ROUTER_ERROR",X5="REDIRECT",Z5="ROUTE_ERROR_RESPONSE";function J5(e){if(e.startsWith(`${AS}:${X5}:{`))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 Q5(e){if(e.startsWith(`${AS}:${Z5}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new F5(n.status,n.statusText,n.data)}catch{}}function eT(e,{relative:n}={}){It(vo(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=$.useContext(gi),{hash:o,pathname:h,search:g}=Ql(e,{relative:n}),c=h;return r!=="/"&&(c=h==="/"?r:Gi([r,h])),a.createHref({pathname:c,search:g,hash:o})}function vo(){return $.useContext(Jl)!=null}function Ii(){return It(vo(),"useLocation() may be used only in the context of a <Router> component."),$.useContext(Jl).location}var kS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function RS(e){$.useContext(gi).static||$.useLayoutEffect(e)}function bo(){let{isDataRoute:e}=$.useContext(ar);return e?fT():tT()}function tT(){It(vo(),"useNavigate() may be used only in the context of a <Router> component.");let e=$.useContext(_o),{basename:n,navigator:r}=$.useContext(gi),{matches:a}=$.useContext(ar),{pathname:o}=Ii(),h=JSON.stringify(Um(a)),g=$.useRef(!1);return RS(()=>{g.current=!0}),$.useCallback((u,d={})=>{if(Ki(g.current,kS),!g.current)return;if(typeof u=="number"){r.go(u);return}let S=bh(u,JSON.parse(h),o,d.relative==="path");e==null&&n!=="/"&&(S.pathname=S.pathname==="/"?n:Gi([n,S.pathname])),(d.replace?r.replace:r.push)(S,d.state,d)},[n,r,h,o,e])}$.createContext(null);function Ql(e,{relative:n}={}){let{matches:r}=$.useContext(ar),{pathname:a}=Ii(),o=JSON.stringify(Um(r));return $.useMemo(()=>bh(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function nT(e,n){return LS(e,n)}function LS(e,n,r){It(vo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=$.useContext(gi),{matches:o}=$.useContext(ar),h=o[o.length-1],g=h?h.params:{},c=h?h.pathname:"/",u=h?h.pathnameBase:"/",d=h&&h.route;{let m=d&&d.path||"";DS(c,!d||m.endsWith("*")||m.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${m}">) 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="${m}"> to <Route path="${m==="/"?"*":`${m}/*`}">.`)}let S=Ii(),p;if(n){let m=typeof n=="string"?go(n):n;It(u==="/"||m.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 "${m.pathname}" was given in the \`location\` prop.`),p=m}else p=S;let C=p.pathname||"/",x=C;if(u!=="/"){let m=u.replace(/^\//,"").split("/");x="/"+C.replace(/^\//,"").split("/").slice(m.length).join("/")}let A=r&&r.state.matches.length?r.state.matches.map(m=>Object.assign(m,{route:r.manifest[m.route.id]||m.route})):vS(e,{pathname:x});Ki(d||A!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),Ki(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 "${p.pathname}${p.search}${p.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 E=oT(A&&A.map(m=>Object.assign({},m,{params:Object.assign({},g,m.params),pathname:Gi([u,a.encodeLocation?a.encodeLocation(m.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?u:Gi([u,a.encodeLocation?a.encodeLocation(m.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:m.pathnameBase])})),o,r);return n&&E?$.createElement(Jl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...p},navigationType:"POP"}},E):E}function iT(){let e=dT(),n=q5(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},h={padding:"2px 4px",backgroundColor:a},g=null;return console.error("Error handled by React Router default ErrorBoundary:",e),g=$.createElement($.Fragment,null,$.createElement("p",null,"💿 Hey developer 👋"),$.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",$.createElement("code",{style:h},"ErrorBoundary")," or"," ",$.createElement("code",{style:h},"errorElement")," prop on your route.")),$.createElement($.Fragment,null,$.createElement("h2",null,"Unexpected Application Error!"),$.createElement("h3",{style:{fontStyle:"italic"}},n),r?$.createElement("pre",{style:o},r):null,g)}var rT=$.createElement(iT,null),MS=class extends $.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=Q5(e.digest);r&&(e=r)}let n=e!==void 0?$.createElement(ar.Provider,{value:this.props.routeContext},$.createElement(Fm.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?$.createElement(sT,{error:e},n):n}};MS.contextType=ES;var qf=new WeakMap;function sT({children:e,error:n}){let{basename:r}=$.useContext(gi);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let a=J5(n.digest);if(a){let o=qf.get(n);if(o)throw o;let h=CS(a.location,r);if(wS&&!qf.get(n))if(h.isExternal||a.reloadDocument)window.location.href=h.absoluteURL||h.to;else{const g=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(h.to,{replace:a.replace}));throw qf.set(n,g),g}return $.createElement("meta",{httpEquiv:"refresh",content:`0;url=${h.absoluteURL||h.to}`})}}return e}function aT({routeContext:e,match:n,children:r}){let a=$.useContext(_o);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),$.createElement(ar.Provider,{value:e},r)}function oT(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,h=a?.errors;if(h!=null){let S=o.findIndex(p=>p.route.id&&h?.[p.route.id]!==void 0);It(S>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(h).join(",")}`),o=o.slice(0,Math.min(o.length,S+1))}let g=!1,c=-1;if(r&&a){g=a.renderFallback;for(let S=0;S<o.length;S++){let p=o[S];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(c=S),p.route.id){let{loaderData:C,errors:x}=a,A=p.route.loader&&!C.hasOwnProperty(p.route.id)&&(!x||x[p.route.id]===void 0);if(p.route.lazy||A){r.isStatic&&(g=!0),c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}}let u=r?.onError,d=a&&u?(S,p)=>{u(S,{location:a.location,params:a.matches?.[0]?.params??{},pattern:W5(a.matches),errorInfo:p})}:void 0;return o.reduceRight((S,p,C)=>{let x,A=!1,E=null,m=null;a&&(x=h&&p.route.id?h[p.route.id]:void 0,E=p.route.errorElement||rT,g&&(c<0&&C===0?(DS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),A=!0,m=null):c===C&&(A=!0,m=p.route.hydrateFallbackElement||null)));let y=n.concat(o.slice(0,C+1)),f=()=>{let b;return x?b=E:A?b=m:p.route.Component?b=$.createElement(p.route.Component,null):p.route.element?b=p.route.element:b=S,$.createElement(aT,{match:p,routeContext:{outlet:S,matches:y,isDataRoute:a!=null},children:b})};return a&&(p.route.ErrorBoundary||p.route.errorElement||C===0)?$.createElement(MS,{location:a.location,revalidation:a.revalidation,component:E,error:x,children:f(),routeContext:{outlet:null,matches:y,isDataRoute:!0},onError:d}):f()},null)}function qm(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function lT(e){let n=$.useContext(_o);return It(n,qm(e)),n}function cT(e){let n=$.useContext(yh);return It(n,qm(e)),n}function uT(e){let n=$.useContext(ar);return It(n,qm(e)),n}function Wm(e){let n=uT(e),r=n.matches[n.matches.length-1];return It(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function hT(){return Wm("useRouteId")}function dT(){let e=$.useContext(Fm),n=cT("useRouteError"),r=Wm("useRouteError");return e!==void 0?e:n.errors?.[r]}function fT(){let{router:e}=lT("useNavigate"),n=Wm("useNavigate"),r=$.useRef(!1);return RS(()=>{r.current=!0}),$.useCallback(async(o,h={})=>{Ki(r.current,kS),r.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:n,...h}))},[e,n])}var Lb={};function DS(e,n,r){!n&&!Lb[e]&&(Lb[e]=!0,Ki(!1,r))}$.memo(pT);function pT({routes:e,manifest:n,future:r,state:a,isStatic:o,onError:h}){return LS(e,void 0,{manifest:n,state:a,isStatic:o,onError:h})}function Mb({to:e,replace:n,state:r,relative:a}){It(vo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=$.useContext(gi);Ki(!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:h}=$.useContext(ar),{pathname:g}=Ii(),c=bo(),u=bh(e,Um(h),g,a==="path"),d=JSON.stringify(u);return $.useEffect(()=>{c(JSON.parse(d),{replace:n,state:r,relative:a})},[c,d,a,n,r]),null}function Zs(e){It(!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 mT({basename:e="/",children:n=null,location:r,navigationType:a="POP",navigator:o,static:h=!1,useTransitions:g}){It(!vo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),u=$.useMemo(()=>({basename:c,navigator:o,static:h,useTransitions:g,future:{}}),[c,o,h,g]);typeof r=="string"&&(r=go(r));let{pathname:d="/",search:S="",hash:p="",state:C=null,key:x="default",mask:A}=r,E=$.useMemo(()=>{let m=$r(d,c);return m==null?null:{location:{pathname:m,search:S,hash:p,state:C,key:x,mask:A},navigationType:a}},[c,d,S,p,C,x,a,A]);return Ki(E!=null,`<Router basename="${c}"> is not able to match the URL "${d}${S}${p}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:$.createElement(gi.Provider,{value:u},$.createElement(Jl.Provider,{children:n,value:E}))}function gT({children:e,location:n}){return nT(Pp(e),n)}function Pp(e,n=[]){let r=[];return $.Children.forEach(e,(a,o)=>{if(!$.isValidElement(a))return;let h=[...n,o];if(a.type===$.Fragment){r.push.apply(r,Pp(a.props.children,h));return}It(a.type===Zs,`[${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>`),It(!a.props.index||!a.props.children,"An index route cannot have child routes.");let g={id:a.props.id||h.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&&(g.children=Pp(a.props.children,h)),r.push(g)}),r}var Nu="get",Iu="application/x-www-form-urlencoded";function Sh(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function _T(e){return Sh(e)&&e.tagName.toLowerCase()==="button"}function vT(e){return Sh(e)&&e.tagName.toLowerCase()==="form"}function bT(e){return Sh(e)&&e.tagName.toLowerCase()==="input"}function yT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ST(e,n){return e.button===0&&(!n||n==="_self")&&!yT(e)}var gu=null;function wT(){if(gu===null)try{new FormData(document.createElement("form"),0),gu=!1}catch{gu=!0}return gu}var CT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Wf(e){return e!=null&&!CT.has(e)?(Ki(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Iu}"`),null):e}function xT(e,n){let r,a,o,h,g;if(vT(e)){let c=e.getAttribute("action");a=c?$r(c,n):null,r=e.getAttribute("method")||Nu,o=Wf(e.getAttribute("enctype"))||Iu,h=new FormData(e)}else if(_T(e)||bT(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?$r(u,n):null,r=e.getAttribute("formmethod")||c.getAttribute("method")||Nu,o=Wf(e.getAttribute("formenctype"))||Wf(c.getAttribute("enctype"))||Iu,h=new FormData(c,e),!wT()){let{name:d,type:S,value:p}=e;if(S==="image"){let C=d?`${d}.`:"";h.append(`${C}x`,"0"),h.append(`${C}y`,"0")}else d&&h.append(d,p)}}else{if(Sh(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Nu,a=null,o=Iu,g=e}return h&&o==="text/plain"&&(g=h,h=void 0),{action:a,method:r.toLowerCase(),encType:o,formData:h,body:g}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Gm(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function OS(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&&$r(o.pathname,n)==="/"?o.pathname=`${Ju(n)}/_root.${a}`:o.pathname=`${Ju(o.pathname)}.${a}`,o}async function ET(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 TT(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 AT(e,n,r){let a=await Promise.all(e.map(async o=>{let h=n.routes[o.route.id];if(h){let g=await ET(h,r);return g.links?g.links():[]}return[]}));return MT(a.flat(1).filter(TT).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function Db(e,n,r,a,o,h){let g=(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 h==="assets"?n.filter((u,d)=>g(u,d)||c(u,d)):h==="data"?n.filter((u,d)=>{let S=a.routes[u.route.id];if(!S||!S.hasLoader)return!1;if(g(u,d)||c(u,d))return!0;if(u.route.shouldRevalidate){let p=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 p=="boolean")return p}return!0}):[]}function kT(e,n,{includeHydrateFallback:r}={}){return RT(e.map(a=>{let o=n.routes[a.route.id];if(!o)return[];let h=[o.module];return o.clientActionModule&&(h=h.concat(o.clientActionModule)),o.clientLoaderModule&&(h=h.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(h=h.concat(o.hydrateFallbackModule)),o.imports&&(h=h.concat(o.imports)),h}).flat(1))}function RT(e){return[...new Set(e)]}function LT(e){let n={},r=Object.keys(e).sort();for(let a of r)n[a]=e[a];return n}function MT(e,n){let r=new Set;return new Set(n),e.reduce((a,o)=>{let h=JSON.stringify(LT(o));return r.has(h)||(r.add(h),a.push({key:h,link:o})),a},[])}function Km(){let e=$.useContext(_o);return Gm(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function DT(){let e=$.useContext(yh);return Gm(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Vm=$.createContext(void 0);Vm.displayName="FrameworkContext";function Ym(){let e=$.useContext(Vm);return Gm(e,"You must render this element inside a <HydratedRouter> element"),e}function OT(e,n){let r=$.useContext(Vm),[a,o]=$.useState(!1),[h,g]=$.useState(!1),{onFocus:c,onBlur:u,onMouseEnter:d,onMouseLeave:S,onTouchStart:p}=n,C=$.useRef(null);$.useEffect(()=>{if(e==="render"&&g(!0),e==="viewport"){let E=y=>{y.forEach(f=>{g(f.isIntersecting)})},m=new IntersectionObserver(E,{threshold:.5});return C.current&&m.observe(C.current),()=>{m.disconnect()}}},[e]),$.useEffect(()=>{if(a){let E=setTimeout(()=>{g(!0)},100);return()=>{clearTimeout(E)}}},[a]);let x=()=>{o(!0)},A=()=>{o(!1),g(!1)};return r?e!=="intent"?[h,C,{}]:[h,C,{onFocus:vl(c,x),onBlur:vl(u,A),onMouseEnter:vl(d,x),onMouseLeave:vl(S,A),onTouchStart:vl(p,x)}]:[!1,C,{}]}function vl(e,n){return r=>{e&&e(r),r.defaultPrevented||n(r)}}function NT({page:e,...n}){let r=K5(),{router:a}=Km(),o=$.useMemo(()=>vS(a.routes,e,a.basename),[a.routes,e,a.basename]);return o?r?$.createElement(BT,{page:e,matches:o,...n}):$.createElement(jT,{page:e,matches:o,...n}):null}function IT(e){let{manifest:n,routeModules:r}=Ym(),[a,o]=$.useState([]);return $.useEffect(()=>{let h=!1;return AT(e,n,r).then(g=>{h||o(g)}),()=>{h=!0}},[e,n,r]),a}function BT({page:e,matches:n,...r}){let a=Ii(),{future:o}=Ym(),{basename:h}=Km(),g=$.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let c=OS(e,h,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]},[h,o.v8_trailingSlashAwareDataRequests,e,a,n]);return $.createElement($.Fragment,null,g.map(c=>$.createElement("link",{key:c,rel:"prefetch",as:"fetch",href:c,...r})))}function jT({page:e,matches:n,...r}){let a=Ii(),{future:o,manifest:h,routeModules:g}=Ym(),{basename:c}=Km(),{loaderData:u,matches:d}=DT(),S=$.useMemo(()=>Db(e,n,d,h,a,"data"),[e,n,d,h,a]),p=$.useMemo(()=>Db(e,n,d,h,a,"assets"),[e,n,d,h,a]),C=$.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let E=new Set,m=!1;if(n.forEach(f=>{let b=h.routes[f.route.id];!b||!b.hasLoader||(!S.some(T=>T.route.id===f.route.id)&&f.route.id in u&&g[f.route.id]?.shouldRevalidate||b.hasClientLoader?m=!0:E.add(f.route.id))}),E.size===0)return[];let y=OS(e,c,o.v8_trailingSlashAwareDataRequests,"data");return m&&E.size>0&&y.searchParams.set("_routes",n.filter(f=>E.has(f.route.id)).map(f=>f.route.id).join(",")),[y.pathname+y.search]},[c,o.v8_trailingSlashAwareDataRequests,u,a,h,S,n,e,g]),x=$.useMemo(()=>kT(p,h),[p,h]),A=IT(p);return $.createElement($.Fragment,null,C.map(E=>$.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...r})),x.map(E=>$.createElement("link",{key:E,rel:"modulepreload",href:E,...r})),A.map(({key:E,link:m})=>$.createElement("link",{key:E,nonce:r.nonce,...m,crossOrigin:m.crossOrigin??r.crossOrigin})))}function PT(...e){return n=>{e.forEach(r=>{typeof r=="function"?r(n):r!=null&&(r.current=n)})}}var zT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{zT&&(window.__reactRouterVersion="7.17.0")}catch{}function $T({basename:e,children:n,useTransitions:r,window:a}){let o=$.useRef();o.current==null&&(o.current=b5({window:a,v5Compat:!0}));let h=o.current,[g,c]=$.useState({action:h.action,location:h.location}),u=$.useCallback(d=>{r===!1?c(d):$.startTransition(()=>c(d))},[r]);return $.useLayoutEffect(()=>h.listen(u),[h,u]),$.createElement(mT,{basename:e,children:n,location:g.location,navigationType:g.action,navigator:h,useTransitions:r})}var NS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ql=$.forwardRef(function({onClick:n,discover:r="render",prefetch:a="none",relative:o,reloadDocument:h,replace:g,mask:c,state:u,target:d,to:S,preventScrollReset:p,viewTransition:C,defaultShouldRevalidate:x,...A},E){let{basename:m,navigator:y,useTransitions:f}=$.useContext(gi),b=typeof S=="string"&&NS.test(S),T=CS(S,m);S=T.to;let L=eT(S,{relative:o}),R=Ii(),M=null;if(c){let U=bh(c,[],R.mask?R.mask.pathname:"/",!0);m!=="/"&&(U.pathname=U.pathname==="/"?m:Gi([m,U.pathname])),M=y.createHref(U)}let[k,I,G]=OT(a,A),q=qT(S,{replace:g,mask:c,state:u,target:d,preventScrollReset:p,relative:o,viewTransition:C,defaultShouldRevalidate:x,useTransitions:f});function W(U){n&&n(U),U.defaultPrevented||q(U)}let j=!(T.isExternal||h),V=$.createElement("a",{...A,...G,href:(j?M:void 0)||T.absoluteURL||L,onClick:j?W:n,ref:PT(E,I),target:d,"data-discover":!b&&r==="render"?"true":void 0});return k&&!b?$.createElement($.Fragment,null,V,$.createElement(NT,{page:L})):V});ql.displayName="Link";var HT=$.forwardRef(function({"aria-current":n="page",caseSensitive:r=!1,className:a="",end:o=!1,style:h,to:g,viewTransition:c,children:u,...d},S){let p=Ql(g,{relative:d.relative}),C=Ii(),x=$.useContext(yh),{navigator:A,basename:E}=$.useContext(gi),m=x!=null&&YT(p)&&c===!0,y=A.encodeLocation?A.encodeLocation(p).pathname:p.pathname,f=C.pathname,b=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;r||(f=f.toLowerCase(),b=b?b.toLowerCase():null,y=y.toLowerCase()),b&&E&&(b=$r(b,E)||b);const T=y!=="/"&&y.endsWith("/")?y.length-1:y.length;let L=f===y||!o&&f.startsWith(y)&&f.charAt(T)==="/",R=b!=null&&(b===y||!o&&b.startsWith(y)&&b.charAt(y.length)==="/"),M={isActive:L,isPending:R,isTransitioning:m},k=L?n:void 0,I;typeof a=="function"?I=a(M):I=[a,L?"active":null,R?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let G=typeof h=="function"?h(M):h;return $.createElement(ql,{...d,"aria-current":k,className:I,ref:S,style:G,to:g,viewTransition:c},typeof u=="function"?u(M):u)});HT.displayName="NavLink";var UT=$.forwardRef(({discover:e="render",fetcherKey:n,navigate:r,reloadDocument:a,replace:o,state:h,method:g=Nu,action:c,onSubmit:u,relative:d,preventScrollReset:S,viewTransition:p,defaultShouldRevalidate:C,...x},A)=>{let{useTransitions:E}=$.useContext(gi),m=KT(),y=VT(c,{relative:d}),f=g.toLowerCase()==="get"?"get":"post",b=typeof c=="string"&&NS.test(c),T=L=>{if(u&&u(L),L.defaultPrevented)return;L.preventDefault();let R=L.nativeEvent.submitter,M=R?.getAttribute("formmethod")||g,k=()=>m(R||L.currentTarget,{fetcherKey:n,method:M,navigate:r,replace:o,state:h,relative:d,preventScrollReset:S,viewTransition:p,defaultShouldRevalidate:C});E&&r!==!1?$.startTransition(()=>k()):k()};return $.createElement("form",{ref:A,method:f,action:y,onSubmit:a?u:T,...x,"data-discover":!b&&e==="render"?"true":void 0})});UT.displayName="Form";function FT(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function IS(e){let n=$.useContext(_o);return It(n,FT(e)),n}function qT(e,{target:n,replace:r,mask:a,state:o,preventScrollReset:h,relative:g,viewTransition:c,defaultShouldRevalidate:u,useTransitions:d}={}){let S=bo(),p=Ii(),C=Ql(e,{relative:g});return $.useCallback(x=>{if(ST(x,n)){x.preventDefault();let A=r!==void 0?r:Fl(p)===Fl(C),E=()=>S(e,{replace:A,mask:a,state:o,preventScrollReset:h,relative:g,viewTransition:c,defaultShouldRevalidate:u});d?$.startTransition(()=>E()):E()}},[p,S,C,r,a,o,n,e,h,g,c,u,d])}var WT=0,GT=()=>`__${String(++WT)}__`;function KT(){let{router:e}=IS("useSubmit"),{basename:n}=$.useContext(gi),r=hT(),a=e.fetch,o=e.navigate;return $.useCallback(async(h,g={})=>{let{action:c,method:u,encType:d,formData:S,body:p}=xT(h,n);if(g.navigate===!1){let C=g.fetcherKey||GT();await a(C,r,g.action||c,{defaultShouldRevalidate:g.defaultShouldRevalidate,preventScrollReset:g.preventScrollReset,formData:S,body:p,formMethod:g.method||u,formEncType:g.encType||d,flushSync:g.flushSync})}else await o(g.action||c,{defaultShouldRevalidate:g.defaultShouldRevalidate,preventScrollReset:g.preventScrollReset,formData:S,body:p,formMethod:g.method||u,formEncType:g.encType||d,replace:g.replace,state:g.state,fromRouteId:r,flushSync:g.flushSync,viewTransition:g.viewTransition})},[a,o,n,r])}function VT(e,{relative:n}={}){let{basename:r}=$.useContext(gi),a=$.useContext(ar);It(a,"useFormAction must be used inside a RouteContext");let[o]=a.matches.slice(-1),h={...Ql(e||".",{relative:n})},g=Ii();if(e==null){h.search=g.search;let c=new URLSearchParams(h.search),u=c.getAll("index");if(u.some(S=>S==="")){c.delete("index"),u.filter(p=>p).forEach(p=>c.append("index",p));let S=c.toString();h.search=S?`?${S}`:""}}return(!e||e===".")&&o.route.index&&(h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(h.pathname=h.pathname==="/"?r:Gi([r,h.pathname])),Fl(h)}function YT(e,{relative:n}={}){let r=$.useContext(TS);It(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=IS("useViewTransitionState"),o=Ql(e,{relative:n});if(!r.isTransitioning)return!1;let h=$r(r.currentLocation.pathname,a)||r.currentLocation.pathname,g=$r(r.nextLocation.pathname,a)||r.nextLocation.pathname;return Zu(o.pathname,g)!=null||Zu(o.pathname,h)!=null}var BS=_S();const XT="fleet-console.canvas.",jS="fleet-console.canvas.backgroundAnimation",PS="fleet-console.canvas.maximized",ZT=400,zp=640,$p=400,Ob=40,Nb=96,JT=.25,QT=1,Gf=.2,Ib=.5,eA=.001,to={x:0,y:0,zoom:1},ao={viewport:to,panels:{},panelCreatedAt:{},panelOrder:[],panelAccent:{},minimized:[]},Hp=new Set,Up=new Set,Fp=new Set;let Wl=null,Cs=null,Ue=ao,Bu=wA(),Bl=xA(),ws=to,ta=null,Qu=0,fo=0;function zS(e){return Hp.add(e),()=>{Hp.delete(e)}}function eh(){return Ue}function $S(){return $.useSyncExternalStore(zS,eh,eh)}function tA(){return $.useSyncExternalStore(fA,jb,jb)}function HS(){return $.useSyncExternalStore(mA,Pb,Pb)}function nA(){return $.useSyncExternalStore(zS,zb,zb)}function mi(e){Ue={viewport:e.viewport??Ue.viewport,panels:e.panels??Ue.panels,panelCreatedAt:e.panelCreatedAt??Ue.panelCreatedAt,panelOrder:e.panelOrder??Ue.panelOrder,panelAccent:e.panelAccent??Ue.panelAccent,minimized:e.minimized??Ue.minimized},vA(),KS()}function ju(e){Xm();const n=Zm(e);ws=n,mi({viewport:n})}function US(e){const n=Zm(e);if(typeof window>"u"||typeof window.requestAnimationFrame!="function"||_A()){ju(n);return}ws=n,ta===null&&(ta=window.requestAnimationFrame(VS))}function jl(e,n){const r=Ts();mi({panels:{...Ue.panels,[e]:{...Jm(n,r),zIndex:r}},panelCreatedAt:XS(e)})}function iA(e){Ue.minimized.includes(e)||mi({minimized:[...Ue.minimized,e]})}function rA(e){if(!Ue.minimized.includes(e))return;const n=Ue.minimized.filter(o=>o!==e),r=Ue.panels[e];if(!r){mi({minimized:n});return}const a=Ts();mi({minimized:n,panels:{...Ue.panels,[e]:{...r,zIndex:a}}})}function Bb(e){const n=JS(e),r=new Set(n),a=Ue.panelOrder.filter(o=>o.startsWith("shell:")&&!r.has(o));mi({panelOrder:[...n,...a]})}function FS(e,n){const r={...Ue.panelAccent};n===null||n.trim()===""?delete r[e]:r[e]=n,mi({panelAccent:r})}function sA(e){const n=Ue.panelOrder.filter(h=>h!==e),r=n.length!==Ue.panelOrder.length,a=e in Ue.panelAccent;if(!r&&!a)return;const o={...Ue.panelAccent};delete o[e],mi({panelOrder:n,panelAccent:o})}function Ts(){return fo+=1,fo}function aA(e){fo=Math.max(fo,e)}function qS(){return Qu+=1,Qu}function WS(e){Qu=Math.max(Qu,e)}function oA(e){const n=Ue.panels[e];if(n)return n;const r=Object.keys(Ue.panels).length,a={x:r*Ob,y:r*Ob,width:zp,height:$p,zIndex:Ts()};return mi({panels:{...Ue.panels,[e]:a},panelCreatedAt:XS(e)}),a}function lA(e){const n=new Set(e),r={};let a=!1;for(const[x,A]of Object.entries(Ue.panels))n.has(x)?r[x]=A:a=!0;const o=Ue.minimized.filter(x=>n.has(x)),h=o.length!==Ue.minimized.length,g=Object.fromEntries(Object.entries(Ue.panelCreatedAt).filter(([x])=>n.has(x))),c=Object.keys(g).length!==Object.keys(Ue.panelCreatedAt).length,u=x=>n.has(x)||x.startsWith("shell:"),d=Ue.panelOrder.filter(u),S=d.length!==Ue.panelOrder.length,p=Object.fromEntries(Object.entries(Ue.panelAccent).filter(([x])=>u(x))),C=Object.keys(p).length!==Object.keys(Ue.panelAccent).length;(a||h||c||S||C)&&mi({panels:r,panelCreatedAt:g,panelOrder:d,panelAccent:p,minimized:o})}function cA(e){bA(),Xm(),Wl=e,Ue=e?SA(e):ao,WS(DA(Ue.panelCreatedAt)),ws=Ue.viewport,fo=Math.max(fo,QS(Ue.panels)),KS()}function GS(e,n){const r=Ue.panels[e];if(!r)return;const a=Math.max(JT,Math.min(QT,Math.min((n.width-Nb)/r.width,(n.height-Nb)/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};Xm(),ws=o;const h=Ts(),g=Ue.minimized.includes(e);mi({viewport:o,panels:{...Ue.panels,[e]:{...Jm(r,h),zIndex:h}},...g?{minimized:Ue.minimized.filter(c=>c!==e)}:{}})}function uA(){Bu=!Bu,CA(Bu),pA()}function hA(){dA(!Bl)}function dA(e){Bl!==e&&(Bl=e,EA(Bl),gA())}function fA(e){return Up.add(e),()=>{Up.delete(e)}}function jb(){return Bu}function KS(){for(const e of Hp)e()}function pA(){for(const e of Up)e()}function mA(e){return Fp.add(e),()=>{Fp.delete(e)}}function Pb(){return Bl}function zb(){return Ue.minimized}function gA(){for(const e of Fp)e()}function VS(){const e=Ue.viewport,n=ws.x-e.x,r=ws.y-e.y,a=ws.zoom-e.zoom;if(Math.abs(n)<Ib&&Math.abs(r)<Ib&&Math.abs(a)<eA){ta=null,mi({viewport:ws});return}mi({viewport:{x:e.x+n*Gf,y:e.y+r*Gf,zoom:e.zoom+a*Gf}}),ta=typeof window<"u"?window.requestAnimationFrame(VS):null}function Xm(){ta===null||typeof window>"u"||(window.cancelAnimationFrame(ta),ta=null)}function _A(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function vA(){!Wl||typeof window>"u"||(yA(),Cs=window.setTimeout(()=>{Cs=null,YS(Wl,Ue)},ZT))}function bA(){!Cs||!Wl||typeof window>"u"||(window.clearTimeout(Cs),Cs=null,YS(Wl,Ue))}function yA(){!Cs||typeof window>"u"||(window.clearTimeout(Cs),Cs=null)}function SA(e){if(typeof window>"u")return ao;try{const n=window.localStorage.getItem(ZS(e));if(!n)return ao;const r=JSON.parse(n);return TA(r)}catch{return ao}}function YS(e,n){if(!(!e||typeof window>"u"))try{window.localStorage.setItem(ZS(e),JSON.stringify(n))}catch{}}function XS(e){return Ue.panelCreatedAt[e]!==void 0?Ue.panelCreatedAt:{...Ue.panelCreatedAt,[e]:qS()}}function wA(){if(typeof window>"u")return!0;try{const e=window.localStorage.getItem(jS);return e===null?!0:e==="true"}catch{return!0}}function CA(e){if(!(typeof window>"u"))try{window.localStorage.setItem(jS,String(e))}catch{}}function xA(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(PS)==="true"}catch{return!1}}function EA(e){if(!(typeof window>"u"))try{window.localStorage.setItem(PS,String(e))}catch{}}function ZS(e){return`${XT}${e}`}function TA(e){if(!sa(e))return ao;const n=LA(e.panels);return{viewport:Zm(e.viewport),panels:n,panelCreatedAt:kA(e.panelCreatedAt,n),panelOrder:JS(e.panelOrder),panelAccent:AA(e.panelAccent),minimized:RA(e.minimized,n)}}function JS(e){if(!Array.isArray(e))return[];const n=new Set,r=[];for(const a of e)typeof a!="string"||n.has(a)||(n.add(a),r.push(a));return r}function AA(e){if(!sa(e))return{};const n={};for(const[r,a]of Object.entries(e))typeof a=="string"&&(n[r]=a);return n}function kA(e,n){const r={},a=sa(e)?e:{};let o=0;for(const h of Object.keys(n))o+=1,r[h]=th(a[h],o);return r}function RA(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 Zm(e){if(!sa(e))return to;const n=Pl(e.x,to.x),r=Pl(e.y,to.y),a=th(e.zoom,to.zoom);return{x:n,y:r,zoom:a}}function LA(e){if(!sa(e))return{};const n={};for(const[r,a]of Object.entries(e))sa(a)&&(n[r]=Jm(a,MA(n)));return n}function Jm(e,n){return sa(e)?{x:Pl(e.x,0),y:Pl(e.y,0),width:th(e.width,zp),height:th(e.height,$p),zIndex:Pl(e.zIndex,n)}:{x:0,y:0,width:zp,height:$p,zIndex:n}}function MA(e){return QS(e)+1}function QS(e){return Math.max(0,...Object.values(e).map(n=>n.zIndex))}function DA(e){return Math.max(0,...Object.values(e))}function Pl(e,n){return typeof e=="number"&&Number.isFinite(e)?e:n}function th(e,n){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:n}function sa(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const ew="fleet-console.codex.view-mode",tw="fleet-console.codex.side-width",Kf="route",Ml=460,OA=120,qp=new Set;let Wp=PA(),Gp=zA(),nw=!1;function NA(){return $.useSyncExternalStore(Qm,$b,$b)}function IA(e){if(nw=!0,Wp===e){Kp();return}Wp=e,sw(ew,e),Kp()}function BA(){return $.useSyncExternalStore(Qm,Ub,Ub)}function iw(){return $.useSyncExternalStore(Qm,Hb,Hb)}function jA(e){const n=rw(e);Gp!==n&&(Gp=n,sw(tw,String(n)),Kp())}function Qm(e){return qp.add(e),()=>{qp.delete(e)}}function $b(){return Wp}function Hb(){return Gp}function Ub(){return nw}function Kp(){for(const e of qp)e()}function rw(e){return Number.isFinite(e)?Math.max(OA,Math.round(e)):Ml}function PA(){if(typeof window>"u")return Kf;try{const e=window.localStorage.getItem(ew);return e==="route"||e==="side"?e:Kf}catch{return Kf}}function zA(){if(typeof window>"u")return Ml;try{const e=window.localStorage.getItem(tw);if(e===null)return Ml;const n=Number.parseInt(e,10);return Number.isNaN(n)?Ml:rw(n)}catch{return Ml}}function sw(e,n){if(!(typeof window>"u"))try{window.localStorage.setItem(e,n)}catch{}}const $A=["canonicalCwd","cwd","providerSession","ticket","token","transcriptPath"];class Fe extends Error{status;constructor(n,r){super(r),this.name="ApiError",this.status=n}}async function aw(e){const n=await fetch("/observer/tenants",{signal:e});await yn(n);const r=await n.json();if(!Array.isArray(r.tenants))throw new Fe(n.status,"Invalid tenants response");return r.tenants.map(a=>tk(a,n.status))}async function HA(e){const n=await fetch("/observer/jobs",{signal:e});return await yn(n),(await n.json()).tenants}async function UA(e){const n=await fetch("/observer/events",{signal:e});if(await yn(n),!n.body)throw new Fe(n.status,"Observer stream unavailable");return n.body.getReader()}async function ow(e){const n=await fetch("/observer/theaters",{signal:e});await yn(n);const r=await n.json();if(!Array.isArray(r.theaters))throw new Fe(n.status,"Invalid Theater response");const a=Array.isArray(r.agentClis)?r.agentClis.map(o=>ek(o,n.status)):[];return{theaters:r.theaters.map(o=>fw(o,n.status)),agentClis:a}}async function FA(e,n){const r=e?`?theaterId=${encodeURIComponent(e)}`:"",a=await fetch(`/observer/status${r}`,{signal:n});return await yn(a),nk(await a.json(),a.status)}async function lw(e={}){const n=e.force?"?force=true":"",r=await fetch(`/observer/release-notes${n}`,{signal:e.signal});return await yn(r),rk(await r.json(),r.status)}async function qA(e){const n=await fetch("/update/apply",{method:"POST",signal:e});return await yn(n),ik(await n.json(),n.status)}async function cw(e,n){const r=await fetch("/observer/theaters",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folderGrantId:e}),signal:n});await yn(r);const a=await r.json();return fw(a,r.status)}async function Fb(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 yn(a),ec(await a.json(),a.status)}async function WA(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 yn(r),JA(await r.json(),r.status)}async function uw(e,n){const r=await fetch("/terminal/folders/grants",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:n});await yn(r);const a=await r.json();if(typeof a.folderGrantId!="string")throw new Fe(r.status,"Invalid folder grant response");return a.folderGrantId}async function nh(e,n){const r=await fetch(`/terminal/sessions/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});await yn(r)}async function hw(e,n){const r=await fetch(`/terminal/sessions/${encodeURIComponent(e)}/resume`,{method:"POST",signal:n});return await yn(r),ec(await r.json(),r.status)}async function GA(e,n){const r=await fetch(`/observer/theaters/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});await yn(r)}async function KA(e,n){const r=await fetch(`/terminal/sessions/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({label:n})});return await yn(r),ec(await r.json(),r.status)}async function VA(e,n){const r=await fetch(`/terminal/sessions/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({accent:n})});return await yn(r),ec(await r.json(),r.status)}async function YA(e){const n=await fetch("/terminal/sessions",{signal:e});await yn(n);const r=await n.json();if(!Array.isArray(r.sessions))throw new Fe(n.status,"Invalid terminal sessions response");return r.sessions.map(a=>ec(a,n.status))}async function XA(e,n){const r=ZA(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 yn(a);const o=await a.json();if(typeof o.ticket!="string"||typeof o.ttlMs!="number")throw new Fe(a.status,"Invalid terminal ticket response");return{ticket:o.ticket,ttlMs:o.ttlMs}}function ZA(e){return e?e instanceof AbortSignal?{signal:e}:e:{}}function ec(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"||dw(r))throw new Fe(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,accent:typeof r.accent=="string"?r.accent: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 JA(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 Fe(n,"Invalid folder list response");return{path:r.path,parentPath:r.parentPath,roots:r.roots,entries:r.entries.map(a=>QA(a,n)),...r.truncated===!0?{truncated:!0}:{}}}function QA(e,n){const r=e;if(!r||typeof r.name!="string"||typeof r.path!="string"||r.kind!=="dir"||typeof r.accessible!="boolean")throw new Fe(n,"Invalid folder list response");return{name:r.name,path:r.path,kind:"dir",accessible:r.accessible}}function ek(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 Fe(n,"Invalid Agent CLI metadata response");return{id:r.id,label:r.label,available:r.available,signedIn:r.signedIn}}function tk(e,n){const r=e;if(!r||typeof r.tenantId!="string"||typeof r.tenantLabel!="string"||typeof r.createdAt!="number"||typeof r.sessions!="number"||dw(r))throw new Fe(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 dw(e){return $A.some(n=>n in e)}function nk(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.portMode!=="dynamic"&&r.portMode!=="static"||r.requestedPort!==null&&typeof r.requestedPort!="number"||typeof r.effectivePort!="number"||typeof r.portHonored!="boolean"||r.wikiServerStatus!=="available"&&r.wikiServerStatus!=="unavailable"&&r.wikiServerStatus!=="unknown"||"token"in r||"path"in r||"cwd"in r||"knowledgeRoot"in r)throw new Fe(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,portMode:r.portMode,requestedPort:r.requestedPort,effectivePort:r.effectivePort,portHonored:r.portHonored,wikiServerStatus:r.wikiServerStatus}}function ik(e,n){const r=e;if(!r||r.status!=="accepted"||"packageName"in r||"packageVersion"in r||"path"in r||"token"in r)throw new Fe(n,"Invalid update apply response");return{status:"accepted"}}function rk(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 Fe(n,"Invalid release notes response");return{notes:r.notes.map(a=>sk(a,n)),sourceRef:"main",fetchedAt:r.fetchedAt,stale:r.stale}}function sk(e,n){const r=e;if(!r||typeof r.version!="string"||r.date!==null&&typeof r.date!="string"||!Array.isArray(r.sections))throw new Fe(n,"Invalid release notes response");return{version:r.version,date:r.date,sections:r.sections.map(a=>ak(a,n))}}function ak(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 Fe(n,"Invalid release notes response");return{heading:r.heading,items:r.items.map(a=>ok(a,n))}}function ok(e,n){const r=e;if(!r||!Array.isArray(r.packageTags)||!r.packageTags.every(a=>typeof a=="string")||typeof r.text!="string")throw new Fe(n,"Invalid release notes response");return{packageTags:r.packageTags,text:r.text}}function fw(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 Fe(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 yn(e){if(e.ok)return;let n=e.statusText;try{n=(await e.json()).error??n}catch{}throw new Fe(e.status,n||`HTTP ${e.status}`)}const qb=120,lk="active",Vp=new Set(["done","error","aborted"]);function ck(e,n){let r=mw(e,n.jobId,n.updatedAt);for(const a of n.events)r=pw(r,a);return Vp.has(n.status)&&!Vp.has(r.status)&&(r={...r,status:n.status}),r}function pw(e,n){if(n.id<=e.lastEventId)return e;const r=n.event,a={...e,updatedAt:n.at,lastEventId:n.id,recentEvents:mk(e.recentEvents,n)};switch(n.type){case"job:registered":return fk(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 Ka(a,r,o=>({...o,startedAt:_s(r.startedAt)??n.at,requestPreview:un(r.requestPreview)}));case"track:status":return Ka(a,r,o=>({...o,status:un(r.status)??o.status}));case"track:text":return Ka(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 Ka(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 Ka(a,r,o=>({...o,status:"stream",tools:pk(o.tools,r)}));case"track:finalized":return Ka(a,r,o=>{const h=Gb(o.text,o.sentTextLength,un(r.fallbackText),_s(r.fallbackTextLength)),g=Gb(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:h.text,sentTextLength:h.sentLength,thought:g.text,sentThoughtLength:g.sentLength}});default:return a}}function mw(e,n,r){return{jobId:n,tenantId:e,status:lk,updatedAt:r,trackOrder:[],tracks:{},lastEventId:0,recentEvents:[]}}function eg(e){return Vp.has(e)}function uk(e){return e.operationsViewActive?new Set:new Set}function hk(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 Wb(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 dk(e,n){return n.globalMute||n.dnd?[]:e.filter(r=>!r.theaterId||n.mutedTheaterIds[r.theaterId]!==!0)}function fk(e,n){const r=Array.isArray(n.tracks)?n.tracks:[];let a=e.trackOrder,o=e.tracks;for(const h of r){if(!h.trackId)continue;const g=o[h.trackId],c={...g??gw(h.trackId),displayName:h.displayName??g?.displayName??h.trackId,displayCli:h.displayCli??g?.displayCli,model:h.model??g?.model,effort:h.effort??g?.effort,subtitle:h.subtitle??g?.subtitle,kind:h.kind??g?.kind,startedAt:h.startedAt??g?.startedAt};g||(a=[...a,h.trackId]),o={...o,[h.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 Ka(e,n,r){const a=un(n.trackId);if(!a)return e;const o=e.tracks[a],h=r(o??gw(a));return{...e,trackOrder:o?e.trackOrder:[...e.trackOrder,a],tracks:{...e.tracks,[a]:h}}}function gw(e){return{trackId:e,displayName:e,status:"queued",text:"",thought:"",sentTextLength:0,sentThoughtLength:0,tools:[]}}function Gb(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 pk(e,n){const r=un(n.title)??"tool",a=un(n.status)??"",o=un(n.toolCallId),h=o??`${r}#${e.length}`;if(o){const g=e.findIndex(c=>c.key===o);if(g>=0){const c=[...e];return c[g]={key:o,title:r,status:a},c}}return[...e,{key:h,title:r,status:a}]}function mk(e,n){const r=[...e,n];return r.length>qb?r.slice(-qb):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 _w(e){return new Date(e).toLocaleTimeString([],{hour12:!1})}function wh(e){return e.label?.trim()||`#${e.sequence} Operation`}function gk(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 Yp(e){return e.length<=14?e:`${e.slice(0,6)}…${e.slice(-6)}`}function _k(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function Xp(e){switch(e){case"active":return"running";case"done":return"done";case"error":return"error";case"aborted":return"aborted";default:return e}}function vk(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 vw(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 Ch(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 bk(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 h=a[o],g=h?yk(h):null;if(g)return g}return null}function yk(e){return Kb(e.text)??Kb(e.thought)??e.tools[e.tools.length-1]?.title??null}function Kb(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 Sk="__unassigned__";function wk(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(Ek(o,n.get(o.theaterId)))}return r}function Ck(e,n){const r=bw(n);return r.length===0?e:e.filter(a=>{const o=Tk(a);return r.every(h=>o.includes(h))})}function xk(e){const n=[],r=new Map;for(const a of e){const o=a.theaterId??Sk,h=r.get(o);if(h!==void 0){const g=n[h];g&&(n[h]={...g,entries:[...g.entries,a]});continue}r.set(o,n.length),n.push({theaterId:a.theaterId,theaterLabel:a.theaterLabel,entries:[a]})}return n}function bw(e){return e.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean)}function Ek(e,n){return{sessionId:e.sessionId,theaterId:e.theaterId??null,theaterLabel:n?.label??e.theaterId??"",operationName:wh(e),cliLabel:e.cliLabel,status:e.status}}function Tk(e){return[e.operationName,e.theaterLabel,e.cliLabel??""].join(" ").toLocaleLowerCase()}const Ak="fleet-console.canvas.shell.",kk=400,Vb=560,Yb=360,Zp=new Set;let dn={},Di=[],Hr=null,aa=null,xs=null;function Rk(){return $.useSyncExternalStore(tg,Zb,Zb)}function yw(){return $.useSyncExternalStore(tg,Jp,Jp)}function Sw(){return dn}function Jp(){return Hr}function Xb(){return Di}function Lk(){return $.useSyncExternalStore(tg,Xb,Xb)}function po(e){Hr!==e&&(Hr=e,As())}function Mk(e,n){const r=Fk();return dn={...dn,[r]:{theaterId:e,geometry:n,createdAt:Uk()}},tc(),As(),r}function Pu(e,n){const r=dn[e];r&&(dn={...dn,[e]:{...r,geometry:n}},tc(),As())}function Dk(e){!(e in dn)||Di.includes(e)||(Di=[...Di,e],Hr===e&&(Hr=null),tc(),As())}function ww(e){if(!Di.includes(e))return;Di=Di.filter(r=>r!==e);const n=dn[e];n&&(dn={...dn,[e]:{...n,geometry:{...n.geometry,zIndex:Ts()}}}),tc(),As()}function Qp(e){if(!(e in dn))return;const n={...dn};delete n[e],dn=n,Di=Di.filter(r=>r!==e),Hr===e&&(Hr=null),tc(),As()}function Ok(e){Ik(),aa=e;const n=e?Bk(e):{panels:{},minimized:[]};dn=n.panels,Di=n.minimized,WS(Hk(dn)),Hr=null,aA($k(dn)),As()}function Nk(e){if(typeof window<"u")try{window.sessionStorage.removeItem(ng(e))}catch{}aa===e&&(Cw(),aa=null,dn={},Di=[],Hr=null,As())}function tg(e){return Zp.add(e),()=>{Zp.delete(e)}}function Zb(){return dn}function As(){for(const e of Zp)e()}function tc(){!aa||typeof window>"u"||(Cw(),xs=window.setTimeout(()=>{xs=null,xw(aa,dn)},kk))}function Ik(){!xs||!aa||typeof window>"u"||(window.clearTimeout(xs),xs=null,xw(aa,dn))}function Cw(){!xs||typeof window>"u"||(window.clearTimeout(xs),xs=null)}function Bk(e){if(typeof window>"u")return{panels:{},minimized:[]};try{const n=window.sessionStorage.getItem(ng(e));return n?jk(JSON.parse(n),e):{panels:{},minimized:[]}}catch{return{panels:{},minimized:[]}}}function xw(e,n){if(!(!e||typeof window>"u"))try{window.sessionStorage.setItem(ng(e),JSON.stringify({panels:n,minimized:Di}))}catch{}}function ng(e){return`${Ak}${e}`}function jk(e,n){if(!zu(e)||!zu(e.panels))return{panels:{},minimized:[]};const r={};let a=0;for(const[o,h]of Object.entries(e.panels))!o.startsWith("shell:")||!zu(h)||h.theaterId===n&&(a+=1,r[o]={theaterId:n,geometry:zk(h.geometry),createdAt:em(h.createdAt,a)});return{panels:r,minimized:Pk(e.minimized,r)}}function Pk(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 zk(e){return zu(e)?{x:Vf(e.x,0),y:Vf(e.y,0),width:em(e.width,Vb),height:em(e.height,Yb),zIndex:Vf(e.zIndex,0)}:{x:0,y:0,width:Vb,height:Yb,zIndex:0}}function $k(e){return Math.max(0,...Object.values(e).map(n=>n.geometry.zIndex))}function Hk(e){return Math.max(0,...Object.values(e).map(n=>n.createdAt))}function Uk(){return qS()}function Vf(e,n){return typeof e=="number"&&Number.isFinite(e)?e:n}function em(e,n){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:n}function zu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Fk(){return`shell:${typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}`}const ig=14,Ew=10,Tw=22,qk=128,Wk=.5,Gk="mmmmmmmmmmwwwwiIl1 0O-_|┌ABCxyz",Kk=/[\x00-\x1F\x7F]/g,Jb={min:Ew,max:Tw},Vk="cascadia",xh=[{id:"cascadia",name:"Cascadia Code",familyName:"Cascadia Code Variable",family:'"Cascadia Code Variable", ui-monospace, "SF Mono", Menlo, monospace',meta:"Variable · terminal tuned"},{id:"jetbrains",name:"JetBrains Mono",familyName:"JetBrains Mono Variable",family:'"JetBrains Mono Variable", ui-monospace, "SF Mono", Menlo, monospace',meta:"Variable · console mono"},{id:"fira-code",name:"Fira Code",familyName:"Fira Code Variable",family:'"Fira Code Variable", ui-monospace, "SF Mono", Menlo, monospace',meta:"Variable · ligatures"},{id:"source-code-pro",name:"Source Code Pro",familyName:"Source Code Pro Variable",family:'"Source Code Pro Variable", ui-monospace, "SF Mono", Menlo, monospace',meta:"Variable · Adobe mono"}],na=xh[0];function ih(e){return xh.find(n=>n.id===e)??na}function Qb(){return{source:"curated",id:Vk,customName:"",family:na.family,size:ig}}function rg(e,n){const r=ih(e);return{source:"curated",id:r.id,customName:"",family:r.family,size:ag(n)}}function sg(e,n){const r=Jk(e);return{source:"custom",id:null,customName:r,family:r?`"${kw(r)}", ${na.family}`:na.family,size:ag(n)}}function Yf(e){if(!e)return Qb();try{const n=JSON.parse(e),r=ag(typeof n.size=="number"?n.size:ig);if(n.source==="custom"&&typeof n.customName=="string")return sg(n.customName,r);if(typeof n.id=="string"&&Zk(n.id))return rg(n.id,r)}catch{}return Qb()}function Yk(e){return JSON.stringify({source:e.source,id:e.id,customName:e.customName,size:e.size})}function ag(e){return Number.isFinite(e)?Math.min(Tw,Math.max(Ew,Math.round(e))):ig}function Aw(e){return e.source==="curated"?{status:"self-hosted",fallbackName:na.name}:e.customName?{status:Xk(e.customName)?"resolved":"fallback",fallbackName:na.name}:{status:"fallback",fallbackName:na.name}}function Xk(e){if(typeof document>"u")return!1;const n=document.createElement("canvas").getContext("2d");if(!n)return!1;for(const r of["monospace","serif","sans-serif"]){const a=e1(n,`"${kw(e)}", ${r}`),o=e1(n,r);if(Math.abs(a-o)>Wk)return!0}return!1}function e1(e,n){return e.font=`28px ${n}`,e.measureText(Gk).width}function Zk(e){return xh.some(n=>n.id===e)}function Jk(e){return e.replace(Kk,"").trim().slice(0,qk)}function kw(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}const tm=200,nm="fleet-console.activeTheaterId",Rw="fleet-console.activeTheme",Lw="fleet-console.terminalRenderer",Mw="fleet-console.terminalFont",Dw="fleet-console.commissioningSeen",Ow="fleet-console.whatsNewSeenVersion",Nw="fleet-console.notificationPreferences",Iw=1,Xf="maritime",Zf="webgl",_u={globalMute:!1,dnd:!1,mutedTheaterIds:{}},im=new Set;let rm=null,ve={connection:"connecting",connectionError:null,activeTheme:nC(),terminalRenderer:sR(),terminalFont:aR(),version:"",updateAvailable:!1,latestVersion:null,portMode:"dynamic",requestedPort:null,effectivePort:0,portHonored:!0,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:DR()},t1=0;function n1(){return ve}function Qk(e){return im.add(e),()=>{im.delete(e)}}function je(e){ve={...ve,...e},iC()}function eR(e){ve.operationsViewActive!==e&&je({operationsViewActive:e})}function tR(){zw(nC())}function nR(e){IR(e),zw(e),je({activeTheme:e})}function iR(e){BR(e),je({terminalRenderer:e})}function rR(e){const n=rg(e,ve.terminalFont.size);ug(n),je({terminalFont:n})}function i1(e){const n=sg(e,ve.terminalFont.size);ug(n),je({terminalFont:n})}function r1(e){const n=ve.terminalFont.source==="custom"?sg(ve.terminalFont.customName,e):rg(ve.terminalFont.id,e);ug(n),je({terminalFont:n})}function sR(){if(typeof window>"u")return Zf;try{const e=window.localStorage.getItem(Lw);return e==="webgl"||e==="dom"?e:Zf}catch{return Zf}}function aR(){if(typeof window>"u")return Yf(null);try{return Yf(window.localStorage.getItem(Mw))}catch{return Yf(null)}}function oR(e){je({version:e.version,updateAvailable:e.updateAvailable,latestVersion:e.latestVersion??null,portMode:e.portMode,requestedPort:e.requestedPort,effectivePort:e.effectivePort,portHonored:e.portHonored,...Vw({...ve,version:e.version})})}function Bw(){je({releaseNotesLoading:!0,releaseNotesError:null})}function jw(e){const n={...ve,releaseNotes:e.notes,releaseNotesLoading:!1,releaseNotesError:null,releaseNotesSourceRef:e.sourceRef,releaseNotesFetchedAt:e.fetchedAt,releaseNotesStale:e.stale,selectedReleaseNoteKey:ve.selectedReleaseNoteKey&&Xw(e.notes,ve.selectedReleaseNoteKey)?ve.selectedReleaseNoteKey:Yw(e.notes)};je({releaseNotes:n.releaseNotes,releaseNotesLoading:n.releaseNotesLoading,releaseNotesError:n.releaseNotesError,releaseNotesSourceRef:n.releaseNotesSourceRef,releaseNotesFetchedAt:n.releaseNotesFetchedAt,releaseNotesStale:n.releaseNotesStale,...Vw(n)})}function Pw(e){je({releaseNotesLoading:!1,releaseNotesError:e})}function zw(e){if(!(typeof document>"u")){if(e==="maritime"){document.documentElement.removeAttribute("data-theme");return}document.documentElement.setAttribute("data-theme",e)}}function lR(e){const n={};for(const o of e)n[o.sessionId]=Th(o);const r=[...e].sort((o,h)=>h.createdAt-o.createdAt).map(o=>o.sessionId),a=eC(n,ve.tenants);je({sessions:a,sessionOrder:r,activeTerminalSessionId:ks(ve.activeTheaterId,a,r,ve.activeTerminalSessionId),terminalSessionsHydrated:!0})}function $w(e){const n=tC(e.theaters,ve.activeTheaterId);je({theaters:e.theaters,agentClis:e.agentClis,activeTheaterId:n,activeTerminalSessionId:ks(n,ve.sessions,ve.sessionOrder,ve.activeTerminalSessionId),selectedJobId:null})}function cR(e){kh(e),je({activeTheaterId:e,activeTerminalSessionId:ks(e,ve.sessions,ve.sessionOrder,null),selectedJobId:null})}function Hw(){je({addingTheater:!0,theaterError:null})}function Uw(e){const n=[e,...ve.theaters.filter(r=>r.id!==e.id)];kh(e.id),je({theaters:n,activeTheaterId:e.id,addingTheater:!1,theaterError:null,activeTerminalSessionId:ks(e.id,ve.sessions,ve.sessionOrder,null),selectedJobId:null})}function uR(){je({addingTheater:!1,theaterError:null})}function sm(e){je({addingTheater:!1,theaterError:e})}function ti(e){je({activeTerminalSessionId:e,selectedJobId:null,operationNotifications:e?Ah(ve.operationNotifications,e):ve.operationNotifications})}function Fw(e){const n=ve.sessions[e];n&&(kh(n.theaterId??null),je({activeTheaterId:n.theaterId??null,activeTerminalSessionId:e,selectedJobId:null,pendingOperationFocus:e,operationNotifications:Ah(ve.operationNotifications,e)}))}function s1(){ve.pendingOperationFocus!==null&&je({pendingOperationFocus:null})}function Jf(){je({operationSearchOpen:!1})}function hR(){je({operationSearchOpen:!ve.operationSearchOpen})}function a1(){je({creatingTerminalSession:!0,terminalSessionError:null})}function o1(e){const n=Th(e);je({sessions:{...ve.sessions,[n.sessionId]:n},sessionOrder:[n.sessionId,...ve.sessionOrder.filter(r=>r!==n.sessionId)],activeTerminalSessionId:!ve.activeTheaterId||ah(n,ve.activeTheaterId)?n.sessionId:ve.activeTerminalSessionId,creatingTerminalSession:!1,terminalSessionError:null,selectedJobId:null})}function Eh(e){const n=ve.sessions[e.sessionId],r=Th({...n??{},...e,label:e.label,accent:e.accent}),a=!!n,o={...ve.sessions,[r.sessionId]:r},h=a?ve.sessionOrder:[r.sessionId,...ve.sessionOrder.filter(c=>c!==r.sessionId)],g=n?kR(ve.operationNotifications,n,r):ve.operationNotifications;je({sessions:o,sessionOrder:h,activeTerminalSessionId:ks(ve.activeTheaterId,o,h,ve.activeTerminalSessionId),operationNotifications:g})}function dR(e,n){const r=ve.sessions[e.sessionId]??Th(e);n==="idle_prompt"&&Qw(r)||je({operationNotifications:Jw(ve.operationNotifications,Zw("input-waiting",r))})}function fR(e){const n={...ve.notificationPreferences,globalMute:e};hg(n),je({notificationPreferences:n})}function pR(e){const n={...ve.notificationPreferences,dnd:e};hg(n),je({notificationPreferences:n})}function mR(e){const n={...ve.notificationPreferences.mutedTheaterIds};n[e]?delete n[e]:n[e]=!0;const r={...ve.notificationPreferences,mutedTheaterIds:n};hg(r),je({notificationPreferences:r})}function l1(e){je({creatingTerminalSession:!1,terminalSessionError:e})}function gR(){je({timelineOpen:!ve.timelineOpen})}function _R(){ve.shortcutsOpen||je({shortcutsOpen:!0})}function Qf(){ve.shortcutsOpen&&je({shortcutsOpen:!1})}function vR(){ve.releaseNotes.length===0||ve.whatsNewOpen||je({whatsNewOpen:!0,selectedReleaseNoteKey:ve.selectedReleaseNoteKey??Yw(ve.releaseNotes)})}function vu(){ve.whatsNewOpen&&(ve.automaticWhatsNewVersion&&PR(ve.automaticWhatsNewVersion),je({whatsNewOpen:!1,automaticWhatsNewVersion:null}))}function c1(e){Xw(ve.releaseNotes,e)&&je({selectedReleaseNoteKey:e})}function bl(){jR(!0),ve.onboardingOpen&&je({onboardingOpen:!1})}function u1(){if(ve.bootstrapped)return;const e=ve.theaters.length===0&&!OR();je({bootstrapped:!0,onboardingOpen:e?!0:ve.onboardingOpen})}function rh(e){je({terminalSessionError:e})}function qw(e){je({terminalSessionError:e})}function bR(e){je({terminalSessionError:e})}function h1(e){Nk(e);const n=ve.theaters.filter(g=>g.id!==e),r={},a=[];for(const g of ve.sessionOrder){const c=ve.sessions[g];!c||c.theaterId===e||(r[g]=c,a.push(g))}const o=tC(n,ve.activeTheaterId===e?null:ve.activeTheaterId),h=RR(ve.operationNotifications,e);kh(o),je({theaters:n,sessions:r,sessionOrder:a,activeTheaterId:o,activeTerminalSessionId:ks(o,r,a,ve.activeTerminalSessionId),selectedJobId:null,operationNotifications:h})}function og(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;je({sessions:n,sessionOrder:r,activeTerminalSessionId:a?ks(ve.activeTheaterId,n,r,null):ve.activeTerminalSessionId,selectedJobId:a?null:ve.selectedJobId,operationNotifications:Ah(ve.operationNotifications,e)})}function Ww(e){je({selectedJobId:ve.selectedJobId===e?null:e})}function ep(){je({selectedJobId:null})}function Gw(e){const n=new Set(e.map(o=>o.tenantId)),r=eC(ve.sessions,e),a=[...e.map(o=>o.tenantId),...ve.tenantOrder.filter(o=>!n.has(o)&&ve.tenantJobs[o])];je({tenants:e,sessions:r,tenantOrder:a,activeTerminalSessionId:ks(ve.activeTheaterId,r,ve.sessionOrder,ve.activeTerminalSessionId)})}function yR(e){const n={},r=[];for(const o of e){const h={};for(const c of o.jobs)h[c.jobId]=ck(o.tenantId,c);const g=Object.values(h).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:g,jobs:h,truncation:o.truncation},r.push(o.tenantId)}const a=[...ve.tenantOrder.filter(o=>n[o]),...r.filter(o=>!ve.tenantOrder.includes(o))];je({tenantJobs:n,tenantOrder:a.length>0?a:r})}function SR(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 h=n&&o.tenantLabel!==n?{...o,tenantLabel:n}:o;if(e.jobId){const c=h.jobs[e.jobId],u=pw(c??mw(e.tenantId,e.jobId,e.at),e),d=c?h.jobOrder:[...h.jobOrder,e.jobId];h={...h,jobs:zR({...h.jobs,[e.jobId]:u},d),jobOrder:d.slice(-tm)}}const g={...ve.tenantJobs,[e.tenantId]:h};return ve={...ve,connection:"live",connectionError:null,tenantJobs:g,tenantOrder:ve.tenantOrder.includes(e.tenantId)?ve.tenantOrder:[...ve.tenantOrder,e.tenantId]},iC(),{unknownTenant:a}}function wR(e,n,r){const a=ve.tenantJobs[e]??{tenantId:e,tenantLabel:n,jobOrder:[],jobs:{},truncation:{droppedCount:0}};je({tenantJobs:{...ve.tenantJobs,[e]:{...a,truncation:r}},tenantOrder:ve.tenantOrder.includes(e)?ve.tenantOrder:[...ve.tenantOrder,e]})}function CR(e){if(!e.selectedJobId||e.activeTheaterId&&e.activeTerminalSessionId&&!sh(e).includes(e.activeTerminalSessionId))return null;const n=xR(e);return n?e.tenantJobs[n]?.jobs[e.selectedJobId]??null:null}function xR(e){return e.activeTerminalSessionId?lg(e.sessions[e.activeTerminalSessionId]):null}function ER(e){return sh(e).map(n=>e.sessions[n]).filter(n=>!!n)}function sh(e){return e.activeTheaterId?e.sessionOrder.filter(n=>ah(e.sessions[n],e.activeTheaterId)):[]}function TR(e){return wk(e)}function Kw(e,n){const r=lg(n);if(!r)return[];const a=e.tenantJobs[r];if(!a)return[];const o=[];for(const h of a.jobOrder){const g=a.jobs[h];g&&o.push({job:g,tenant:a})}return o}function lg(e){return e?.tenantId??e?.sessionId??null}function Th(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 Vw(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||NR()===r.version?{whatsNewOpen:e.whatsNewOpen,automaticWhatsNewVersion:e.automaticWhatsNewVersion,selectedReleaseNoteKey:e.selectedReleaseNoteKey}:{whatsNewOpen:!0,automaticWhatsNewVersion:r.version,selectedReleaseNoteKey:cg(r.version,n)}}function Yw(e){return e[0]?cg(e[0].version,0):null}function Xw(e,n){return e.some((r,a)=>cg(r.version,a)===n)}function cg(e,n){return`${e}:${n}`}function AR(e){return e?ve.theaters.find(n=>n.id===e)?.label??e:"—"}function Zw(e,n){return t1+=1,{kind:e,sessionId:n.sessionId,theaterId:n.theaterId??null,theaterLabel:AR(n.theaterId),operationLabel:wh(n),count:1,lastRaisedSeq:t1}}function kR(e,n,r){return n.turnState!=="running"&&r.turnState==="running"?Ah(e,r.sessionId):n.turnState!=="ended"&&r.turnState==="ended"&&!Qw(r)?Jw(e,Zw("ended",r)):e}function Jw(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 Ah(e,n){if(!e[n])return e;const r={...e};return delete r[n],r}function RR(e,n){let r=!1;const a={};for(const[o,h]of Object.entries(e)){if(h.theaterId===n){r=!0;continue}a[o]=h}return r?a:e}function Qw(e){const n=lg(e);return n?LR(ve.tenantJobs[n]):!1}function LR(e){return e?e.jobOrder.some(n=>{const r=e.jobs[n];return r?!r.finishedAt&&!eg(r.status):!1}):!1}function eC(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 tC(e,n){const r=new Set(e.map(o=>o.id)),a=MR();return a&&r.has(a)?a:n&&r.has(n)?n:e[0]?.id??null}function ks(e,n,r,a){return e?a&&ah(n[a],e)&&bu(n[a])?a:r.find(o=>ah(n[o],e)&&bu(n[o]))??null:a&&n[a]&&bu(n[a])?a:r.find(o=>bu(n[o]))??null}function ah(e,n){return!e||!n?!1:e.theaterId===n}function bu(e){return!!(e&&e.status!=="dormant")}function MR(){if(typeof window>"u")return null;try{return window.localStorage.getItem(nm)}catch{return null}}function kh(e){if(!(typeof window>"u"))try{e?window.localStorage.setItem(nm,e):window.localStorage.removeItem(nm)}catch{}}function nC(){if(typeof window>"u")return Xf;try{const e=window.localStorage.getItem(Rw);return e==="maritime"||e==="carbon"?e:Xf}catch{return Xf}}function DR(){if(typeof window>"u")return _u;try{const e=window.localStorage.getItem(Nw);if(!e)return _u;const n=JSON.parse(e);return $R(n)?{globalMute:n.preferences.globalMute,dnd:n.preferences.dnd,mutedTheaterIds:n.preferences.mutedTheaterIds}:_u}catch{return _u}}function OR(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Dw)==="1"}catch{return!1}}function NR(){if(rm!==null)return rm;if(typeof window>"u")return null;try{return window.localStorage.getItem(Ow)}catch{return null}}function IR(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Rw,e)}catch{}}function BR(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Lw,e)}catch{}}function ug(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Mw,Yk(e))}catch{}}function hg(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Nw,JSON.stringify({version:Iw,preferences:e}))}catch{}}function jR(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Dw,e?"1":"0")}catch{}}function PR(e){if(rm=e,!(typeof window>"u"))try{window.localStorage.setItem(Ow,e)}catch{}}function zR(e,n){if(n.length<=tm)return e;const r=new Set(n.slice(-tm)),a={};for(const o of Object.keys(e))r.has(o)&&(a[o]=e[o]);return a}function $R(e){if(!e||typeof e!="object")return!1;const n=e;if(n.version!==Iw||!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 iC(){for(const e of im)e()}const yu="directory-browser-sectors";function rC({open:e,onCancel:n,onConfirm:r}){const[a,o]=$.useState(null),[h,g]=$.useState(null),[c,u]=$.useState(null),[d,S]=$.useState(""),[p,C]=$.useState(""),[x,A]=$.useState(0),E=$.useRef(null),m=$.useRef(null),y=async(U,F)=>{g(U),u(null),S(""),A(0);try{const K=await WA(U,F);o(K)}catch(K){if(K instanceof DOMException&&K.name==="AbortError")return;u(K instanceof Fe?K.message:String(K))}finally{g(null)}};$.useEffect(()=>{if(!e)return;const U=new AbortController;return y(null,U.signal),()=>U.abort()},[e]),$.useEffect(()=>{e&&E.current?.focus()},[e,a?.path]);const f=a?.entries??[],b=$.useMemo(()=>{const U=d.trim().toLowerCase();return U===""?f:f.filter(F=>F.name.toLowerCase().includes(U))},[f,d]),T=$.useMemo(()=>a?HR(a):[],[a]),L=a?d1(a.path):null,R=a?.roots??[],M=R.length>1,k=b.length===0?-1:Math.min(x,b.length-1);if($.useEffect(()=>{if(k<0)return;m.current?.querySelector(`[data-index="${k}"]`)?.scrollIntoView({block:"nearest"})},[k,a?.path]),!e)return null;const I=U=>{U.accessible&&h===null&&y(U.path)},G=()=>{a?.parentPath!=null&&h===null&&y(a.parentPath)},q=()=>{const U=p.trim();U!==""&&h===null&&y(U)},W=a?.path??null,j=k>=0?`${yu}-${k}`:void 0,V=U=>{switch(U.key){case"Escape":d!==""?S(""):n();return;case"ArrowDown":U.preventDefault(),A(F=>Math.min(F+1,Math.max(b.length-1,0)));return;case"ArrowUp":U.preventDefault(),A(F=>Math.max(F-1,0));return;case"Enter":{U.preventDefault();const F=b[k];F&&I(F);return}case"Backspace":d===""&&(U.preventDefault(),G());return;default:return}};return BS.createPortal(v.jsxs("div",{className:"directory-browser-overlay",role:"presentation",children:[v.jsx("button",{type:"button",className:"directory-browser-scrim","aria-label":"Close",onClick:n}),v.jsxs("section",{className:"directory-browser-card",role:"dialog","aria-modal":"true","aria-label":"Establish Theater of Operations",onKeyDown:V,children:[v.jsxs("header",{className:"directory-browser-header",children:[v.jsx("span",{className:"directory-browser-sigil","aria-hidden":"true",children:v.jsx(qR,{})}),v.jsxs("div",{className:"directory-browser-heading",children:[v.jsx("span",{className:"directory-browser-kicker",children:"Theater of Operations"}),v.jsx("h2",{children:"Establish Theater"})]}),v.jsx("button",{type:"button",className:"directory-browser-close",onClick:n,"aria-label":"Close",children:"×"})]}),M?v.jsxs("div",{className:"directory-browser-roots",role:"group","aria-label":"Drives",children:[v.jsx("span",{className:"directory-browser-kicker",children:"Stations"}),v.jsx("div",{className:"directory-browser-root-chips",children:R.map(U=>{const F=L!=null&&d1(U)===L;return v.jsx("button",{type:"button",className:`directory-browser-root-chip ${F?"is-active":""}`,"aria-current":F?"location":void 0,disabled:h!==null,title:U,onClick:()=>{h===null&&y(U)},onKeyDown:K=>K.stopPropagation(),children:FR(U)},U)})})]}):null,v.jsx("nav",{className:"directory-browser-course","aria-label":"Path",children:T.map((U,F)=>{const K=F===T.length-1;return v.jsxs("span",{className:"directory-browser-course-seg",children:[F>0?v.jsx("span",{className:"directory-browser-course-sep","aria-hidden":"true",children:"›"}):null,v.jsx("button",{type:"button",className:`directory-browser-crumb ${K?"is-current":""}`,"aria-current":K?"location":void 0,disabled:K||h!==null,title:U.path,onClick:()=>{y(U.path)},children:U.label})]},U.path)})}),v.jsxs("div",{className:"directory-browser-toolbar",children:[v.jsxs("div",{className:"directory-browser-filter",children:[v.jsx("span",{className:"directory-browser-filter-glyph","aria-hidden":"true",children:v.jsx(GR,{})}),v.jsx("input",{ref:E,type:"text",className:"directory-browser-filter-input",placeholder:"Filter sectors…","aria-label":"Filter folders","aria-controls":yu,value:d,spellCheck:!1,autoComplete:"off",onChange:U=>{S(U.target.value),A(0)}})]}),v.jsxs("button",{type:"button",className:"directory-browser-up",disabled:a?.parentPath==null||h!==null,title:"Up one sector (Backspace)",onClick:G,children:[v.jsx(KR,{}),v.jsx("span",{children:"Up"})]})]}),v.jsxs("div",{className:"directory-browser-jump",children:[v.jsx("input",{type:"text",className:"directory-browser-jump-input",placeholder:"Or jump to a path — e.g. D:\\\\projects","aria-label":"Jump to absolute path",value:p,spellCheck:!1,autoComplete:"off",onChange:U=>C(U.target.value),onKeyDown:U=>{U.stopPropagation(),U.key==="Enter"&&(U.preventDefault(),q())}}),v.jsx("button",{type:"button",className:"directory-browser-jump-button",disabled:p.trim()===""||h!==null,onClick:q,onKeyDown:U=>U.stopPropagation(),children:"Go"})]}),c?v.jsx("p",{className:"directory-browser-error",role:"alert",children:c}):null,v.jsx("div",{className:"directory-browser-list",id:yu,role:"listbox","aria-label":"Folders","aria-busy":h!==null,"aria-activedescendant":j,ref:m,children:h!==null?v.jsxs("p",{className:"directory-browser-state is-live",children:[v.jsx("span",{className:"directory-browser-scan-dot","aria-hidden":"true"}),"Scouting…"]}):b.length===0?v.jsx("p",{className:"directory-browser-state",children:d!==""?"No sectors match the filter.":"No sectors to advance into."}):b.map((U,F)=>v.jsxs("div",{id:`${yu}-${F}`,"data-index":F,role:"option","aria-selected":F===k,"aria-disabled":!U.accessible,className:`directory-browser-sector ${F===k?"is-active":""} ${U.accessible?"":"is-locked"}`,title:U.path,onClick:()=>{A(F),I(U)},children:[v.jsx("span",{className:"directory-browser-sector-glyph","aria-hidden":"true",children:v.jsx(WR,{})}),v.jsx("span",{className:"directory-browser-sector-name",children:U.name}),U.accessible?v.jsx("span",{className:"directory-browser-sector-advance","aria-hidden":"true",children:"›"}):v.jsxs("span",{className:"directory-browser-sector-lock",children:[v.jsx(VR,{})," Locked"]})]},U.path))}),a?.truncated?v.jsx("p",{className:"directory-browser-note",children:"Charting first 500 sectors only."}):null,v.jsxs("footer",{className:"directory-browser-actions",children:[v.jsxs("div",{className:"directory-browser-target",children:[v.jsx("span",{className:"directory-browser-target-label",children:"Theater Root"}),v.jsx("span",{className:"directory-browser-target-path",title:W??"",children:W??"Scouting…"})]}),v.jsxs("div",{className:"directory-browser-buttons",children:[v.jsx("button",{type:"button",className:"directory-browser-button",onClick:n,children:"Cancel"}),v.jsx("button",{type:"button",className:"directory-browser-button is-primary",disabled:W===null||h!==null,onClick:()=>W&&r(W),children:"Establish Theater"})]})]})]})]}),document.body)}function HR(e){if(UR(e)==="/"){const g=[{label:"/",path:"/"}];let c="";for(const u of e.path.split("/").filter(Boolean))c+=`/${u}`,g.push({label:u,path:c});return g}const r=/^([A-Za-z]:)\\?/.exec(e.path),a=r?`${r[1]}\\`:e.roots[0]??"C:\\",o=[{label:a,path:a}];let h=a.replace(/\\$/,"");for(const g of e.path.slice(a.length).split("\\").filter(Boolean))h+=`\\${g}`,o.push({label:g,path:h});return o}function UR(e){return e.roots.some(n=>/^[A-Za-z]:\\$/.test(n))||/^[A-Za-z]:\\/.test(e.path)?"\\":"/"}function d1(e){return/^([A-Za-z]:)\\?/.exec(e)?.[1]?.toLowerCase()??null}function FR(e){return e.replace(/[\\/]+$/,"")||e}function qR(){return v.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[v.jsx("circle",{cx:"10",cy:"10",r:"6.6",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),v.jsx("circle",{cx:"10",cy:"10",r:"2.1",fill:"currentColor"}),v.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 WR(){return v.jsx("svg",{viewBox:"0 0 18 18","aria-hidden":"true",children:v.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 GR(){return v.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[v.jsx("circle",{cx:"7",cy:"7",r:"4.2",fill:"none",stroke:"currentColor",strokeWidth:"1.3"}),v.jsx("path",{d:"M10.2 10.2 13.5 13.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})}function KR(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.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 VR(){return v.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[v.jsx("rect",{x:"3.6",y:"7",width:"8.8",height:"6.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),v.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 YR=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function XR({state:e}){const[n,r]=$.useState(!1),a=$.useRef(null),o=$.useRef(null),h=$.useRef(null),g=e.theaters.length>0;if($.useEffect(()=>{if(e.onboardingOpen)return a.current=document.activeElement,o.current?.focus(),()=>{const S=a.current;a.current=null,S?.focus?.()}},[e.onboardingOpen]),$.useEffect(()=>{if(!e.onboardingOpen)return;const S=p=>{n||(p.key==="Escape"?(p.preventDefault(),bl()):p.key==="Tab"&&ZR(p,h.current),p.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),Hw();try{const p=await uw(S),C=await cw(p);Uw(C)}catch(p){sm(p instanceof Error?p.message:String(p))}};return v.jsxs("div",{className:"commissioning-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"commissioning-title",children:[v.jsx("button",{type:"button",className:"commissioning-scrim",onClick:bl,"aria-label":"Close Commissioning guide"}),v.jsxs("section",{className:"commissioning-card",ref:h,children:[v.jsxs("header",{className:"commissioning-header",children:[v.jsx("span",{className:"commissioning-eyebrow",children:"COMMISSIONING · FLEET CONSOLE"}),v.jsx("h2",{id:"commissioning-title",children:"Bring your fleet online"}),v.jsx("p",{children:"Three steps to go from an empty bridge to live carrier operations."})]}),v.jsxs("ol",{className:"commissioning-steps",children:[v.jsxs("li",{className:`commissioning-step commissioning-step--primary ${g?"is-complete":"is-current"}`,children:[v.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:g?"✓":"01"}),v.jsxs("div",{className:"commissioning-step-body",children:[v.jsx("h3",{children:"Register a Theater"}),v.jsx("p",{children:"A Theater is a project directory the fleet operates in. Choose the folder you want to work from."}),g?v.jsx(ql,{ref:S=>{o.current=S},className:"commissioning-primary-action",to:"/operations",onClick:bl,children:"Go to Operations →"}):v.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?v.jsx("p",{className:"commissioning-error",role:"alert",children:e.theaterError}):null]})]}),v.jsxs("li",{className:"commissioning-step",children:[v.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:"02"}),v.jsxs("div",{className:"commissioning-step-body",children:[v.jsx("h3",{children:"Open an Operation"}),v.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."}),v.jsx(ql,{className:"commissioning-secondary-link",to:"/operations",onClick:bl,children:"Go to Operations"})]})]}),v.jsxs("li",{className:"commissioning-step",children:[v.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:"03"}),v.jsxs("div",{className:"commissioning-step-body",children:[v.jsx("h3",{children:"Observe carriers"}),v.jsx("p",{children:"Carriers are specialist agents your Admiral dispatches. Their sorties stream here in real time as they run."})]})]})]}),v.jsxs("footer",{className:"commissioning-footer",children:[v.jsx("p",{children:"Theaters with a Fleet Wiki knowledge root also unlock Codex — your decision log and reference library."}),v.jsx("button",{type:"button",className:"commissioning-skip",onClick:bl,children:"Skip for now"})]})]}),v.jsx(rC,{open:n,onCancel:u,onConfirm:d})]})}function ZR(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(YR)),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 yo(){return $.useSyncExternalStore(Qk,n1,n1)}const JR={ended:"Stood down","input-waiting":"Awaiting orders"},sC="fleet-console.notificationsDockOpen",tp=!1;function QR(){const e=yo(),n=bo(),[r,a]=$.useState(e3),[o,h]=$.useState(!1),g=$.useRef(null),c=$.useRef(null),u=$.useMemo(()=>Object.values(e.operationNotifications),[e.operationNotifications]),d=uk(e),S=hk(u,d).hidden,p=dk(S,e.notificationPreferences),C=Wb(p),x=Wb(S),A=C.reduce((I,G)=>I+G.totalCount,0),E=f1(C,"input-waiting"),m=f1(C,"ended");n3(e.notificationPreferences);const y=C.length===0,f=y?"muted":E>0?"awaiting":"ended",b=$.useMemo(()=>p.reduce((I,G)=>Math.max(I,G.lastRaisedSeq),0),[p]),T=$.useRef(b),[L,R]=$.useState(0),M=$.useCallback(I=>{a(I),t3(I)},[]);$.useEffect(()=>{b>T.current&&!r&&R(I=>I+1),T.current=b},[b,r]),$.useEffect(()=>{if(!r)return;const I=G=>{const q=G.target;if(!(q instanceof Node)){M(!1);return}c.current?.contains(q)||g.current?.contains(q)||M(!1)};return document.addEventListener("pointerdown",I),()=>{document.removeEventListener("pointerdown",I)}},[r,M]);const k=I=>{Fw(I.sessionId),n("/operations"),M(!1)};return r?v.jsx("div",{className:"notification-dock-layer",children:v.jsxs("aside",{ref:c,className:`notification-dock ${f==="awaiting"?"has-awaiting":""}`,"aria-live":"polite","aria-label":"Operation notifications",children:[v.jsxs("header",{className:"notification-dock-head",children:[v.jsx("span",{className:"notification-dock-eyebrow",children:"Notifications"}),y?null:v.jsxs("span",{className:"notification-dock-tallies","aria-hidden":"true",children:[E>0?v.jsx("span",{className:"notification-tally is-input-waiting",children:E}):null,m>0?v.jsx("span",{className:"notification-tally is-ended",children:m}):null]}),v.jsx("button",{type:"button",className:"notification-dock-icon",onClick:()=>h(!o),"aria-expanded":o,"aria-label":"Notification settings",title:"Notification settings",children:v.jsx(s3,{})}),v.jsx("button",{type:"button",className:"notification-dock-icon",onClick:()=>M(!1),"aria-label":"Close notifications",title:"Close",children:v.jsx(a3,{})})]}),o?v.jsx(i3,{groups:x}):null,y?v.jsx("p",{className:"notification-dock-empty",children:"No active alerts"}):v.jsx("div",{className:"notification-dock-deck",children:C.map(I=>v.jsxs("section",{className:"notification-cluster-group",children:[v.jsxs("header",{className:"notification-cluster-group-head",children:[v.jsx("span",{className:"notification-cluster-theater",children:I.theaterLabel}),v.jsx("span",{className:"notification-cluster-group-count",children:I.totalCount})]}),v.jsx("ul",{className:"notification-cluster-roster",children:I.notifications.map(G=>v.jsxs("li",{className:`notification-row is-${G.kind}`,children:[v.jsx("span",{className:"notification-row-beacon","aria-hidden":"true"}),v.jsxs("span",{className:"notification-row-body",children:[v.jsx("span",{className:"notification-row-op",children:G.operationLabel}),v.jsx("span",{className:"notification-row-state",children:JR[G.kind]})]}),G.count>1?v.jsx("span",{className:"notification-row-count",children:G.count}):null,v.jsx("button",{type:"button",className:"notification-row-move",onClick:()=>k(G),"aria-label":`Open ${I.theaterLabel} ${G.operationLabel}`,children:"Open"})]},G.sessionId))})]},I.theaterId??"__unknown__"))})]})}):v.jsxs("button",{ref:g,type:"button",className:`notification-handle is-${f} ${f==="awaiting"?"has-awaiting":""}`,onClick:()=>M(!0),"aria-label":`Open notifications (${A})`,children:[v.jsx("span",{className:"notification-handle-count",children:y?0:A}),v.jsx("span",{className:"notification-handle-label",children:"Alerts"}),v.jsx(o3,{className:"notification-handle-chevron"}),L>0?v.jsx("span",{className:"notification-handle-pulse","aria-hidden":"true"},L):null]})}function e3(){if(typeof window>"u")return tp;try{const e=window.localStorage.getItem(sC);return e===null?tp:e==="true"}catch{return tp}}function t3(e){if(!(typeof window>"u"))try{window.localStorage.setItem(sC,String(e))}catch{}}function n3(e){return e.globalMute||e.dnd||Object.keys(e.mutedTheaterIds).length>0}function f1(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 i3({groups:e}){const n=yo(),r=r3(e,n.notificationPreferences.mutedTheaterIds,n.theaters);return v.jsxs("div",{className:"notification-cluster-settings",role:"dialog","aria-label":"Notification settings",children:[v.jsx("p",{className:"notification-cluster-settings-eyebrow",children:"Display"}),v.jsxs("label",{className:"notification-cluster-setting",children:[v.jsx("input",{type:"checkbox",checked:n.notificationPreferences.globalMute,onChange:a=>fR(a.currentTarget.checked)}),v.jsx("span",{children:"Mute all"})]}),v.jsxs("label",{className:"notification-cluster-setting",children:[v.jsx("input",{type:"checkbox",checked:n.notificationPreferences.dnd,onChange:a=>pR(a.currentTarget.checked)}),v.jsx("span",{children:"Do not disturb"})]}),r.length>0?v.jsx("p",{className:"notification-cluster-settings-eyebrow",children:"By Theater"}):null,r.map(a=>v.jsxs("label",{className:"notification-cluster-setting",children:[v.jsx("input",{type:"checkbox",checked:a.theaterId?n.notificationPreferences.mutedTheaterIds[a.theaterId]===!0:!1,onChange:()=>{a.theaterId&&mR(a.theaterId)}}),v.jsx("span",{children:a.theaterLabel})]},a.theaterId))]})}function r3(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(h=>h.id===o)?.label??o,notifications:[],totalCount:0});return[...a.values()]}function s3(){return v.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[v.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"}),v.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 a3(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.jsx("path",{d:"M4 4l8 8M12 4l-8 8",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function o3({className:e}){return v.jsx("svg",{className:e,viewBox:"0 0 16 16","aria-hidden":"true",children:v.jsx("path",{d:"M10 4l-4 4 4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}const aC=[{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"}]}],l3=/mac|iphone|ipad|ipod/i,c3=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function u3({state:e}){const n=$.useRef(null),r=$.useRef(null),a=$.useRef(null);if(e.shortcutsOpen&&n.current===null&&(n.current=document.activeElement),$.useEffect(()=>{if(!e.shortcutsOpen)return;const h=g=>{g.key==="Escape"?(Qf(),g.preventDefault()):g.key==="Tab"&&d3(g,a.current),g.stopImmediatePropagation()};return r.current?.focus(),window.addEventListener("keydown",h,!0),()=>{window.removeEventListener("keydown",h,!0);const g=n.current;n.current=null,g?.focus?.()}},[e.shortcutsOpen]),!e.shortcutsOpen)return null;const o=h3();return v.jsxs("div",{className:"shortcuts-overlay",role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",children:[v.jsx("button",{type:"button",className:"shortcuts-overlay-scrim",onClick:Qf,"aria-label":"Close keyboard shortcuts"}),v.jsxs("section",{className:"shortcuts-overlay-card",ref:a,children:[v.jsxs("header",{className:"shortcuts-overlay-header",children:[v.jsx("span",{className:"shortcuts-overlay-kicker",children:"Reference Map"}),v.jsx("h2",{children:"Keyboard Shortcuts"})]}),v.jsx("button",{ref:r,type:"button",className:"shortcuts-overlay-close",onClick:Qf,"aria-label":"Close keyboard shortcuts",children:"×"}),v.jsx("div",{className:"shortcuts-overlay-groups",children:aC.map(h=>v.jsxs("section",{className:"shortcuts-group","aria-labelledby":`shortcuts-${h.title.toLowerCase()}`,children:[v.jsx("h3",{id:`shortcuts-${h.title.toLowerCase()}`,children:h.title}),v.jsx("dl",{className:"shortcuts-list",children:h.entries.map(g=>v.jsxs("div",{className:"shortcuts-entry",children:[v.jsx("dt",{className:"shortcuts-combos",children:g.combos.map((c,u)=>v.jsxs("span",{className:"shortcuts-combo",children:[u>0?v.jsx("span",{className:"shortcuts-combo-separator",children:"or"}):null,v.jsx("span",{className:"shortcuts-keyset",children:c.map(d=>v.jsx("kbd",{children:d==="Mod"?o:d},d))})]},`${g.description}:${c.join("+")}`))}),v.jsx("dd",{children:g.description})]},`${h.title}:${g.description}`))})]},h.title))})]})]})}function h3(){const n=navigator.userAgentData?.platform??navigator.platform;return l3.test(n)?"⌘":"Ctrl"}function d3(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(c3)),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 f3="a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1'])",p1="operation-search-listbox",oC="__unassigned__";function p3({state:e}){const n=bo(),[r,a]=$.useState(""),[o,h]=$.useState(0),g=$.useRef(null),c=$.useRef(null),u=$.useRef(null),d=$.useRef(new Map),S=$.useMemo(()=>TR(e),[e]),p=$.useMemo(()=>Ck(S,r),[S,r]),C=$.useMemo(()=>xk(p),[p]),x=$.useMemo(()=>bw(r),[r]),A=m1(o,p.length),E=p[A]?g1(p[A].sessionId):void 0;if($.useEffect(()=>{if(!e.operationSearchOpen)return;u.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const f=document.body.style.overflow;return document.body.style.overflow="hidden",window.setTimeout(()=>g.current?.focus(),0),()=>{document.body.style.overflow=f,u.current?.focus()}},[e.operationSearchOpen]),$.useEffect(()=>{if(!e.operationSearchOpen){a(""),h(0);return}h(0)},[e.operationSearchOpen,r]),$.useEffect(()=>{if(!e.operationSearchOpen)return;const f=p[A];f&&d.current.get(f.sessionId)?.scrollIntoView({block:"nearest"})},[A,p,e.operationSearchOpen]),!e.operationSearchOpen)return null;const m=f=>{Fw(f),n("/operations"),Jf()},y=f=>{if(f.key==="Escape"){f.preventDefault(),Jf();return}if(f.key==="ArrowDown"||f.key==="ArrowUp"){f.preventDefault(),h(b=>m1(b+(f.key==="ArrowDown"?1:-1),p.length));return}if(f.key==="Enter"){const b=p[A];if(!b)return;f.preventDefault(),m(b.sessionId);return}f.key==="Tab"&&v3(f,c.current)};return v.jsx("div",{className:"operation-search-overlay",onMouseDown:f=>{f.target===f.currentTarget&&Jf()},children:v.jsxs("section",{ref:c,className:"operation-search-card",role:"dialog","aria-modal":"true","aria-label":"Operation quick search",tabIndex:-1,onKeyDown:y,children:[v.jsxs("div",{className:"operation-search-field",children:[v.jsx(b3,{}),v.jsx("input",{ref:g,id:"operation-search-input",type:"search",value:r,onChange:f=>a(f.target.value),placeholder:"Search Operations across Theaters",autoComplete:"off",role:"combobox","aria-expanded":!0,"aria-controls":p1,"aria-activedescendant":E,"aria-autocomplete":"list",spellCheck:!1}),v.jsx("kbd",{children:"esc"})]}),v.jsx("div",{id:p1,className:"operation-search-results",role:"listbox","aria-label":"Operation results",children:C.length>0?C.map(f=>{const b=g3(f.theaterId);return v.jsxs("section",{className:"operation-search-section",role:"group","aria-labelledby":b,children:[v.jsx("h2",{id:b,className:"operation-search-section-heading",children:np(f.theaterLabel,x)}),f.entries.map(T=>{const L=p.indexOf(T),R=L===A;return v.jsxs("button",{id:g1(T.sessionId),ref:M=>{M?d.current.set(T.sessionId,M):d.current.delete(T.sessionId)},type:"button",className:`operation-search-result ${R?"is-active":""}`,role:"option","aria-selected":R,onMouseEnter:()=>h(L),onClick:()=>m(T.sessionId),children:[v.jsxs("span",{className:"operation-search-result-text",children:[v.jsx("strong",{children:np(T.operationName,x)}),v.jsx("small",{children:m3(T)})]}),v.jsx("span",{className:"operation-search-theater",children:np(T.theaterLabel,x)})]},T.sessionId)})]},f.theaterId??oC)}):v.jsx("p",{className:"operation-search-empty",children:"No matching Operations."})})]})})}function m1(e,n){return n<=0?0:Math.max(0,Math.min(e,n-1))}function m3(e){return[e.cliLabel,e.status].filter(Boolean).join(" · ")}function g3(e){return`operation-search-heading-${lC(e??oC)}`}function g1(e){return`operation-search-option-${lC(e)}`}function lC(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}function np(e,n){if(n.length===0)return e;const r=[];let a=0;for(;a<e.length;){const o=_3(e,n,a);if(!o){r.push(e.slice(a));break}o.start>a&&r.push(e.slice(a,o.start)),r.push(v.jsx("mark",{children:e.slice(o.start,o.end)},`${o.start}-${o.end}`)),a=o.end}return r}function _3(e,n,r){const a=e.toLocaleLowerCase();let o=null;for(const h of n){const g=a.indexOf(h,r);g!==-1&&(!o||g<o.start)&&(o={start:g,end:g+h.length})}return o}function v3(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(f3)).filter(h=>h.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 b3(){return v.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:v.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 y3({open:e,title:n,message:r,tone:a="info",onDismiss:o}){return e?v.jsx("div",{className:"app-toast-host",children:v.jsxs("div",{className:`app-toast app-toast--${a}`,role:"status","aria-live":"polite",children:[v.jsx("span",{className:"app-toast-dot","aria-hidden":"true"}),v.jsxs("div",{className:"app-toast-body",children:[v.jsx("p",{className:"app-toast-title",children:n}),r?v.jsx("p",{className:"app-toast-message",children:r}):null]}),o?v.jsx("button",{type:"button",className:"app-toast-close",onClick:o,"aria-label":"Dismiss notification",children:"×"}):null]})}):null}function S3({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 v.jsx("button",{type:"button",className:"topbar-whatsnew-button",onMouseDown:a=>a.preventDefault(),onClick:vR,"aria-label":`What's new${r}`,title:`What's new${r}`,children:v.jsx("span",{children:"What's new"})})}const w3=1400,C3="https://github.com/sbluemin/fleet-harness",x3="https://github.com/sbluemin/fleet-harness/stargazers",E3="https://api.github.com/repos/sbluemin/fleet-harness",dg="fleet-console.github-stars",T3=360*60*1e3;function A3({state:e}){const n=e.connectionError!==null,r=Ii().pathname,a=bo(),o=r.startsWith("/carrier-settings"),h=r.startsWith("/settings"),g=u=>{a(r.startsWith(u)?"/operations":u)},c=r.startsWith("/codex")?v.jsx(W3,{}):r.startsWith("/carrier-settings")?v.jsx(v1,{}):r.startsWith("/settings")?v.jsx(_1,{}):r.startsWith("/operations")?v.jsx(q3,{}):v.jsx(F3,{});return v.jsxs("header",{className:"topbar",children:[v.jsxs("div",{className:"topbar-lead",children:[v.jsxs(ql,{className:"topbar-brand",to:"/operations","aria-label":"Operations로 이동",children:[v.jsx("span",{className:`topbar-sigil ${n?"is-alert":""}`,"aria-hidden":"true",title:e.connectionError??void 0,children:c}),v.jsxs("h1",{className:"topbar-title",children:["Fleet",v.jsx("span",{className:"topbar-title-thin",children:"Console"})]})]}),v.jsxs("span",{className:"topbar-preview-badge",children:[v.jsx("span",{className:"topbar-preview-label",children:"Research Preview"}),e.version?v.jsxs("span",{className:"topbar-preview-version",children:["v",e.version]}):null]}),v.jsx(O3,{}),v.jsx(S3,{state:e})]}),v.jsx(D3,{state:e}),v.jsxs("div",{className:"topbar-meta",children:[e.updateAvailable?v.jsx(k3,{latestVersion:e.latestVersion}):null,v.jsx("button",{type:"button",className:"topbar-icon-button topbar-shortcuts-button",onMouseDown:u=>u.preventDefault(),onClick:_R,"aria-label":"Keyboard shortcuts",title:"Keyboard shortcuts",children:v.jsx(Y3,{})}),v.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:()=>g("/carrier-settings"),children:[v.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:v.jsx(v1,{})}),v.jsx("span",{children:"Carriers"})]}),v.jsxs("button",{type:"button",className:`topbar-nav-link ${h?"is-active":""}`,title:h?"Back to Operations":"Settings","aria-current":h?"page":void 0,onClick:()=>g("/settings"),children:[v.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:v.jsx(_1,{})}),v.jsx("span",{children:"Settings"})]})]})]})}function k3({latestVersion:e}){const[n,r]=$.useState("idle"),[a,o]=$.useState(null),h=$.useRef(null),g=R3(n,a,e);$.useEffect(()=>()=>{h.current!==null&&window.clearTimeout(h.current)},[]);const c=async()=>{if(!g.disabled){h.current!==null&&(window.clearTimeout(h.current),h.current=null),r("applying"),o(null);try{if((await qA()).status!=="accepted"){r("error"),o("invalid_response");return}r("accepted"),h.current=window.setTimeout(()=>{h.current=null,r("completed")},w3)}catch(u){const d=u instanceof Fe?u.message:"network_error";o(d),r(M3(d)?"blocked":"error")}}};return v.jsx("button",{type:"button",className:`topbar-update-badge topbar-update-badge--${g.tone}`,onClick:c,disabled:g.disabled,title:g.title,"aria-live":"polite",children:g.label})}function R3(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"?L3(n):e==="error"?{label:"재시도",title:"업데이트 요청에 실패했습니다. 다시 시도할 수 있습니다.",tone:"error",disabled:!1}:{label:"Update available",title:a,tone:"warn",disabled:!1}}function L3(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 M3(e){return e==="active_terminal_sessions"||e==="local_channel"||e==="update_already_in_progress"||e==="update_not_available"}function D3({state:e}){const[n,r]=$.useState(!1),[a,o]=$.useState(!1),h=$.useRef(null),g=$.useRef(null),c=$.useRef(null),u=e.theaters.find(m=>m.id===e.activeTheaterId)??null,d=u?.label??(e.theaters.length===0?"No Theaters":"Theater");$.useEffect(()=>{if(!n)return;const m=f=>{h.current?.contains(f.target)||r(!1)},y=f=>{f.key==="Escape"&&(r(!1),g.current?.focus())};return document.addEventListener("mousedown",m),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",y)}},[n]),$.useEffect(()=>{if(!n)return;const m=c.current;if(!m)return;(m.querySelector('[data-active="true"]')??m.querySelector("[role^='menuitem']"))?.focus()},[n]);const S=m=>{cR(m),r(!1),g.current?.focus()},p=async()=>{r(!1),o(!0)},C=()=>{o(!1),uR()},x=async m=>{o(!1),Hw();try{const y=await uw(m),f=await cw(y);Uw(f)}catch(y){sm(y instanceof Error?y.message:String(y))}},A=async()=>{if(u){r(!1);try{await GA(u.id),h1(u.id)}catch(m){if(m instanceof Fe&&m.status===404){h1(u.id);return}sm(m instanceof Error?m.message:String(m))}}},E=m=>{if(m.key!=="ArrowDown"&&m.key!=="ArrowUp")return;m.preventDefault();const y=Array.from(c.current?.querySelectorAll("[role^='menuitem']")??[]);if(y.length===0)return;const f=y.indexOf(document.activeElement),b=m.key==="ArrowDown"?1:-1,T=(f+b+y.length)%y.length;y[T]?.focus()};return v.jsxs("div",{className:"theater-control",ref:h,children:[v.jsx("span",{className:"theater-eyebrow","aria-hidden":"true",children:"Theater"}),v.jsxs("button",{type:"button",ref:g,className:`theater-trigger ${n?"is-open":""}`,"aria-haspopup":"menu","aria-expanded":n,"aria-label":"Theater",title:u?.label??e.theaterError??void 0,onClick:()=>r(m=>!m),children:[v.jsx("span",{className:"theater-trigger-sigil","aria-hidden":"true",children:v.jsx(z3,{})}),v.jsx("span",{className:"theater-trigger-label",children:d}),v.jsx("span",{className:"theater-trigger-caret","aria-hidden":"true",children:v.jsx($3,{})})]}),n?v.jsxs("div",{className:"theater-menu",role:"menu","aria-label":"Theater",ref:c,onKeyDown:E,children:[e.theaters.length>0?v.jsx("ul",{className:"theater-menu-list",children:e.theaters.map(m=>{const y=m.id===e.activeTheaterId;return v.jsx("li",{children:v.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":y,"data-active":y?"true":void 0,className:`theater-menu-item ${y?"is-active":""}`,title:m.label,onClick:()=>S(m.id),children:[v.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:y?v.jsx(H3,{}):null}),v.jsx("span",{className:"theater-menu-label",children:m.label})]})},m.id)})}):v.jsx("p",{className:"theater-menu-empty",children:"No Theaters yet."}),v.jsx("div",{className:"theater-menu-divider",role:"separator"}),u?v.jsxs(v.Fragment,{children:[v.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item theater-menu-forget",onClick:A,children:[v.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:v.jsx(U3,{})}),v.jsx("span",{className:"theater-menu-label",children:"Forget Theater"})]}),v.jsx("div",{className:"theater-menu-divider",role:"separator"})]}):null,v.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item theater-menu-add",disabled:e.addingTheater,onClick:p,children:[v.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:v.jsx(G3,{})}),v.jsx("span",{className:"theater-menu-label",children:e.addingTheater?"Adding Theater…":"Add Theater…"})]}),e.theaterError?v.jsx("p",{className:"theater-menu-error",children:e.theaterError}):null]}):null,v.jsx(rC,{open:a,onCancel:C,onConfirm:x})]})}function O3(){const e=N3(),n=e.count!==null;return v.jsxs("div",{className:"topbar-github",role:"group","aria-label":"GitHub",children:[v.jsx("a",{className:"topbar-github-link",href:C3,target:"_blank",rel:"noopener noreferrer","aria-label":"GitHub 저장소 열기",title:"GitHub 저장소",children:v.jsx(K3,{})}),v.jsxs("a",{className:"topbar-github-stars",href:x3,target:"_blank",rel:"noopener noreferrer","aria-label":n?`GitHub 스타 ${e.count.toLocaleString()}개 — 스타 누르기`:"GitHub에서 스타 누르기",title:"GitHub에서 스타 누르기",children:[v.jsx(V3,{}),n?v.jsx("span",{className:"topbar-github-stars-count",children:P3(e.count)}):null]})]})}function N3(){const[e,n]=$.useState(()=>{const r=I3();return r===null?{count:null,status:"idle"}:{count:r,status:"ready"}});return $.useEffect(()=>{if(B3())return;let r=!1;return n(a=>a.status==="ready"?a:{...a,status:"loading"}),fetch(E3,{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(h=>({count:h.count,status:h.count===null?"error":"ready"}));return}j3(o),n({count:o,status:"ready"})}).catch(()=>{r||n(a=>({count:a.count,status:a.count===null?"error":"ready"}))}),()=>{r=!0}},[]),e}function I3(){try{const e=window.localStorage.getItem(dg);if(!e)return null;const n=JSON.parse(e);return typeof n.count=="number"?n.count:null}catch{return null}}function B3(){try{const e=window.localStorage.getItem(dg);if(!e)return!1;const n=JSON.parse(e);return typeof n.at=="number"&&Date.now()-n.at<T3}catch{return!1}}function j3(e){try{window.localStorage.setItem(dg,JSON.stringify({count:e,at:Date.now()}))}catch{}}function P3(e){if(e<1e3)return String(e);const n=e/1e3;return n<10?`${n.toFixed(1)}k`:`${Math.round(n)}k`}function z3(){return v.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[v.jsx("circle",{cx:"8",cy:"3.2",r:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),v.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 $3(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.jsx("path",{d:"M4.5 6.5 8 10l3.5-3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}function H3(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.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 U3(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.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 F3(){return v.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16",children:[v.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"}),v.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 q3(){return v.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[v.jsx("circle",{cx:"8",cy:"8",r:"5.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),v.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"}),v.jsx("circle",{cx:"8",cy:"8",r:"1.1",fill:"currentColor"})]})}function W3(){return v.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[v.jsx("circle",{cx:"12",cy:"12",r:"9"}),v.jsx("circle",{cx:"12",cy:"12",r:"3.2",fill:"currentColor",stroke:"none",opacity:"0.16"}),v.jsx("path",{d:"M12 3v3.6M12 17.4V21M3 12h3.6M17.4 12H21"}),v.jsx("path",{d:"M12 8.6 14.2 12 12 15.4 9.8 12Z",fill:"currentColor",stroke:"none"})]})}function _1(){return v.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[v.jsx("path",{d:"M3 4.4h10M3 8h10M3 11.6h10",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),v.jsx("circle",{cx:"6.2",cy:"4.4",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"}),v.jsx("circle",{cx:"10",cy:"8",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"}),v.jsx("circle",{cx:"7.4",cy:"11.6",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"})]})}function v1(){return v.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[v.jsx("circle",{cx:"4",cy:"4.2",r:"1.15",fill:"currentColor"}),v.jsx("circle",{cx:"4",cy:"8",r:"1.15",fill:"currentColor"}),v.jsx("circle",{cx:"4",cy:"11.8",r:"1.15",fill:"currentColor"}),v.jsx("path",{d:"M7.2 4.2h6M7.2 8h6M7.2 11.8h6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function G3(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function K3(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.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 V3(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.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 Y3(){return v.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[v.jsx("rect",{x:"2.4",y:"4.1",width:"11.2",height:"7.8",rx:"1.8",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),v.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 X3=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),yl=10;function Z3({state:e}){const n=$.useRef(null),r=$.useRef(null),a=$.useRef(null),o=!e.bootstrapped||e.onboardingOpen||e.operationSearchOpen||e.shortcutsOpen||e.timelineOpen;if(e.whatsNewOpen&&!o&&n.current===null&&(n.current=document.activeElement),$.useEffect(()=>{if(!e.whatsNewOpen||o)return;const E=m=>{m.key==="Escape"?(m.preventDefault(),vu()):m.key==="Tab"&&eL(m,a.current),m.stopImmediatePropagation()};return r.current?.focus(),window.addEventListener("keydown",E,!0),()=>{window.removeEventListener("keydown",E,!0);const m=n.current;n.current=null,m?.focus?.()}},[e.whatsNewOpen,o]),!e.whatsNewOpen||o||e.releaseNotes.length===0)return null;const h=e.selectedReleaseNoteKey??Va(e.releaseNotes[0]?.version??"",0),g=e.releaseNotes.findIndex((E,m)=>Va(E.version,m)===h),c=e.releaseNotes[g]??e.releaseNotes[0],u=Va(c.version,g>=0?g:0),d=()=>{Bw(),lw({force:!0}).then(jw).catch(E=>Pw(E instanceof Error?E.message:String(E)))},S=Math.max(1,Math.ceil(e.releaseNotes.length/yl)),p=Math.min(S-1,Math.floor((g>=0?g:0)/yl)),C=p*yl,x=e.releaseNotes.slice(C,C+yl),A=E=>{const m=p+E;if(m<0||m>=S)return;const y=m*yl,f=e.releaseNotes[y];f&&c1(Va(f.version,y))};return v.jsxs("div",{className:"whatsnew-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"whatsnew-title",children:[v.jsx("button",{type:"button",className:"whatsnew-scrim",onClick:vu,"aria-label":"Close What's new"}),v.jsxs("section",{className:"whatsnew-card",ref:a,children:[v.jsxs("header",{className:"whatsnew-header",children:[v.jsxs("div",{className:"whatsnew-heading-row",children:[v.jsx("h2",{id:"whatsnew-title",children:"What's new"}),v.jsxs("span",{className:"whatsnew-version-badge",children:["v",c.version]})]}),v.jsxs("div",{className:"whatsnew-meta-row",children:[c.date?v.jsxs("time",{className:"whatsnew-date",dateTime:c.date,children:["Released ",c.date]}):v.jsx("span",{className:"whatsnew-date",children:"Unreleased"}),e.releaseNotesStale?v.jsx("span",{className:"whatsnew-stale",children:"Stale"}):null]})]}),v.jsx("button",{ref:r,type:"button",className:"whatsnew-close",onClick:vu,"aria-label":"Close What's new",children:"x"}),v.jsxs("div",{className:"whatsnew-body",children:[v.jsxs("div",{className:"whatsnew-version-selector",children:[v.jsx("select",{"aria-label":"Release version",value:u,onChange:E=>c1(E.currentTarget.value),children:x.map((E,m)=>{const y=C+m;return v.jsxs("option",{value:Va(E.version,y),children:[E.version==="Unreleased"?"Unreleased":`v${E.version}`,E.date?` · ${E.date}`:""]},Va(E.version,y))})}),S>1?v.jsxs("div",{className:"whatsnew-pagination",children:[v.jsx("button",{type:"button",className:"whatsnew-page-button",onClick:()=>A(-1),disabled:p===0,"aria-label":"Newer versions",children:"‹"}),v.jsxs("span",{className:"whatsnew-page-status",children:[p+1," / ",S]}),v.jsx("button",{type:"button",className:"whatsnew-page-button",onClick:()=>A(1),disabled:p>=S-1,"aria-label":"Older versions",children:"›"})]}):null,v.jsx("button",{type:"button",className:"whatsnew-refresh",onClick:d,disabled:e.releaseNotesLoading,children:e.releaseNotesLoading?"Refreshing":"Refresh"})]}),e.releaseNotesError?v.jsx("p",{className:"whatsnew-error",children:"Release notes could not be refreshed."}):null,c.sections.map((E,m)=>v.jsx(J3,{section:E,index:m},E.heading))]}),v.jsx("footer",{className:"whatsnew-footer",children:v.jsx("button",{type:"button",className:"whatsnew-done",onClick:vu,children:"Close"})})]})]})}function J3({section:e,index:n}){const r=e.heading.toLowerCase().replaceAll(" ","-"),a={"--whatsnew-delay":`${n*55}ms`};return v.jsxs("section",{className:`whatsnew-section whatsnew-section--${r}`,style:a,children:[v.jsx("h3",{children:v.jsx("span",{className:"whatsnew-section-chip",children:e.heading})}),v.jsx("ul",{children:e.items.map((o,h)=>v.jsx("li",{children:v.jsx(Q3,{item:o})},`${o.text}:${h}`))})]})}function Q3({item:e}){return v.jsxs(v.Fragment,{children:[e.packageTags.map((n,r)=>v.jsx("span",{className:`whatsnew-package-chip whatsnew-package-chip--${r%2===0?"brass":"aurora"}`,children:n},`${n}:${r}`)),v.jsx("span",{children:e.text})]})}function Va(e,n){return`${e}:${n}`}function eL(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(X3)),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 tL=new Set(["idle_prompt","permission_prompt","auth_success","elicitation_dialog","elicitation_complete","elicitation_response"]);function nL(){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 h=rL(o);h&&r.push(h),a=e.indexOf(`
15
-
16
- `)}return r}}function iL(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=y1(n.session);return a?{kind:"session",tenantId:a.tenantId??a.sessionId,session:a}:null}if(e.event==="session:attention"){const a=y1(n.session);return a?{kind:"attention",tenantId:a.tenantId??a.sessionId,session:a,reason:sL(n.reason)}:null}const r=b1(n.event)??b1(n);return r?{kind:"event",tenantId:r.tenantId,tenantLabel:n.tenant?.tenantLabel,event:r}:null}function rL(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 b1(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 y1(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,accent:typeof n.accent=="string"?n.accent: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 sL(e){return typeof e=="string"&&tL.has(e)?e:void 0}const S1=250,aL=5e3;function oL(){const e=new AbortController;return lL(e.signal),()=>e.abort()}async function lL(e){let n=S1,r=!1;const a=async()=>{if(!r){r=!0;try{Gw(await aw(e))}catch{}finally{r=!1}}};for(;!e.aborted;){je({connection:"connecting"});try{await uL(e);const o=await UA(e);je({connection:"live",connectionError:null}),n=S1,await cL(o,e,a),e.aborted||je({connection:"connecting",connectionError:null})}catch(o){if(e.aborted)return;je({connection:"connecting",connectionError:o instanceof Error?o.message:String(o)})}if(e.aborted)return;await hL(n,e),n=Math.min(n*2,aL)}}async function cL(e,n,r){const a=new TextDecoder,o=nL();for(;!n.aborted;){const h=await e.read();if(h.done)return;for(const g of o(a.decode(h.value,{stream:!0}))){const c=iL(g);if(c){if(c.kind==="truncation"&&c.truncation){wR(c.tenantId,c.tenantLabel,c.truncation);continue}if(c.kind==="session"&&c.session){Eh(c.session);continue}if(c.kind==="attention"&&c.session){dR(c.session,c.reason);continue}if(c.event){const{unknownTenant:u}=SR(c.event,c.tenantLabel);u&&r()}}}}}async function uL(e){const[n,r]=await Promise.all([aw(e),HA(e)]);Gw(n),yR(r)}async function hL(e,n){await new Promise(r=>{const a=()=>{clearTimeout(o),n.removeEventListener("abort",a),r()},o=setTimeout(a,e);n.addEventListener("abort",a)})}const dL=new Set(["token","credential","cwd","path","persona","prompt","toolAllowlist","allowedExecutorTools"]);async function cC(e){const n=await fetch("/carrier-settings/state",{signal:e});return await fg(n),uC(await n.json(),n.status)}async function fL(e){const n=await fetch("/carrier-settings/options",{signal:e});return await fg(n),bL(await n.json(),n.status)}async function pL(e,n,r){return So(`/carrier-settings/carriers/${encodeURIComponent(e)}/cli`,"PUT",{cliType:n},r)}async function mL(e,n,r){return So(`/carrier-settings/carriers/${encodeURIComponent(e)}/model`,"PUT",n,r)}async function gL(e,n,r){return So(`/carrier-settings/carriers/${encodeURIComponent(e)}/display-name`,"PATCH",{displayName:n},r)}async function w1(e,n,r){return So(`/carrier-settings/carriers/${encodeURIComponent(e)}/agent-mode`,"PUT",{agentMode:n},r)}async function _L(e,n,r,a){return So(`/carrier-settings/carriers/${encodeURIComponent(e)}/taskforce/${encodeURIComponent(n)}`,"PUT",r,a)}async function vL(e,n,r){return So(`/carrier-settings/carriers/${encodeURIComponent(e)}/taskforce/${encodeURIComponent(n)}`,"DELETE",{},r)}async function So(e,n,r,a){const o=await fetch(e,{method:n,headers:{"Content-Type":"application/json"},body:JSON.stringify(r),signal:a});await fg(o);const h=await o.json();if(!h||typeof h!="object"||!("state"in h))throw new Fe(o.status,"Invalid carrier settings mutation response");return{state:uC(h.state,o.status)}}async function fg(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 Fe(e.status,n)}function uC(e,n){hC(e,n);const r=e;if(!r||typeof r.generation!="number"||!Array.isArray(r.carriers))throw new Fe(n,"Invalid carrier settings state response");return{generation:r.generation,carriers:r.carriers.map(a=>yL(a,n))}}function bL(e,n){hC(e,n);const r=e;if(!r||!Array.isArray(r.cliTypes)||!r.taskForceConstraints||typeof r.taskForceConstraints.minBackends!="number")throw new Fe(n,"Invalid carrier settings options response");return{cliTypes:r.cliTypes.map(a=>SL(a,n)),taskForceConstraints:{minBackends:r.taskForceConstraints.minBackends}}}function yL(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 Fe(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=>CL(a,n))}}}function SL(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 Fe(n,"Invalid carrier settings CLI option");return{id:r.id,displayName:r.displayName,supportsSubagent:r.supportsSubagent,models:r.models.map(a=>wL(a,n)),defaultModel:r.defaultModel}}function wL(e,n){const r=e;if(!r||typeof r.modelId!="string"||typeof r.name!="string")throw new Fe(n,"Invalid carrier settings model option");if(r.effort!==void 0&&(!Array.isArray(r.effort.levels)||typeof r.effort.default!="string"))throw new Fe(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 CL(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 Fe(n,"Invalid carrier settings Task Force backend");return{cliType:r.cliType,model:r.model,...r.effort?{effort:r.effort}:{}}}function hC(e,n){const r=[e];for(;r.length>0;){const a=r.pop();if(!(!a||typeof a!="object"))for(const[o,h]of Object.entries(a)){if(dL.has(o))throw new Fe(n,"Carrier settings response leaked a restricted field");h&&typeof h=="object"&&r.push(h)}}}const xL={cliType:"",model:"",effort:"",displayName:"",agentMode:"cli",taskforce:{}},am=new Set;let Mn={loading:!1,state:null,options:null,activeCarrierId:null,draft:xL,savingActionId:null,error:null};function dC(){return $.useSyncExternalStore(EL,C1,C1)}function C1(){return Mn}function EL(e){return am.add(e),()=>{am.delete(e)}}async function x1(e){ir({loading:!0,error:null});try{const[n,r]=await Promise.all([cC(e),fL(e)]);fC(n,r)}catch(n){if(e?.aborted)return;ir({loading:!1,error:mC(n)})}}function TL(e){const n=Mn.state?.carriers.find(r=>r.carrierId===e);ir({activeCarrierId:e,draft:n?pg(n,Mn.options):Mn.draft,error:null})}function Js(e){ir({draft:{...Mn.draft,...e},error:null})}function om(e,n){const r=Mn.draft.taskforce[e]??{model:"",effort:""};ir({draft:{...Mn.draft,taskforce:{...Mn.draft.taskforce,[e]:{...r,...n}}},error:null})}function AL(){const e=pC();e&&ir({draft:pg(e,Mn.options),error:null})}async function kL(e){const n=pC();return n?RL("save-all",async()=>{const r=Mn.draft;let a=null;r.displayName!==n.displayName&&(a=(await gL(n.carrierId,r.displayName)).state);const o=r.cliType!==n.cliType;return o&&(a=(await pL(n.carrierId,r.cliType)).state),(o||r.model!==n.model||(r.effort||"")!==(n.effort||""))&&(a=(await mL(n.carrierId,ML(r))).state),r.agentMode==="subagent"?(n.agentMode!=="subagent"||n.taskForceBackendCount>0)&&(a=(await w1(n.carrierId,"subagent")).state):(n.agentMode!=="cli"&&(a=(await w1(n.carrierId,"cli")).state),a=await DL(n,e,a)),{state:a??await cC()}}):!1}function fC(e,n){const r=OL(e,Mn.activeCarrierId),a=e.carriers.find(o=>o.carrierId===r)??null;ir({loading:!1,state:e,options:n,activeCarrierId:r,draft:a?pg(a,n):Mn.draft,error:null})}async function RL(e,n){ir({savingActionId:e,error:null});try{const r=await n();return fC(r.state,Mn.options??{cliTypes:[],taskForceConstraints:{minBackends:2}}),ir({savingActionId:null}),!0}catch(r){return ir({savingActionId:null,error:mC(r)}),!1}}function pg(e,n){const r=Object.fromEntries((n?.cliTypes??[]).map(a=>{const o=e.taskforce.backends.find(h=>h.cliType===a.id);return[a.id,{model:o?.model??a.defaultModel,effort:o?.effort??LL(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 LL(e,n,r){return r?.cliTypes.find(h=>h.id===e)?.models.find(h=>h.modelId===n)?.effort?.default??null}function ML(e){return{model:e.model,...e.effort?{effort:e.effort}:{}}}function pC(){return Mn.state?.carriers.find(e=>e.carrierId===Mn.activeCarrierId)??null}async function DL(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 vL(e.carrierId,o.cliType)).state);for(const o of n){const h=e.taskforce.backends.find(g=>g.cliType===o.cliType);h&&h.model===o.model&&(h.effort||"")===(o.effort||"")||(r=(await _L(e.carrierId,o.cliType,{model:o.model,...o.effort?{effort:o.effort}:{}})).state)}return r}function OL(e,n){return n&&e.carriers.some(r=>r.carrierId===n)?n:e.carriers[0]?.carrierId??null}function ir(e){Mn={...Mn,...e};for(const n of am)n()}function mC(e){return e instanceof Error?e.message:String(e)}const NL=50,IL=2400,BL={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 jL(){const e=dC(),n=e.state?.carriers.find(f=>f.carrierId===e.activeCarrierId)??null,r=e.options?.cliTypes.find(f=>f.id===e.draft.cliType)??null,a=r?.models.find(f=>f.modelId===e.draft.model)??null,[o,h]=$.useState(!1),[g,c]=$.useState([]),[u,d]=$.useState("idle"),S=g.length>0,p=e.draft.agentMode==="subagent",C=e.draft.agentMode==="subagent",x=e.savingActionId==="save-all",A=n?FL(n,e.draft,g):!1,E=n?.taskforce.backends.map(f=>`${f.cliType}:${f.model}:${f.effort??""}`).join("|")??"";$.useEffect(()=>{const f=new AbortController;return x1(f.signal),()=>f.abort()},[]),$.useEffect(()=>{h(!1),c(n?.taskforce.backends.map(f=>f.cliType)??[]),d("idle")},[n?.carrierId,E]),$.useEffect(()=>{if(u!=="saved")return;const f=window.setTimeout(()=>d("idle"),IL);return()=>window.clearTimeout(f)},[u]);function m(){n&&(AL(),c(n.taskforce.backends.map(f=>f.cliType)),h(!1),d("idle"))}async function y(){if(!n)return;if(d("saving"),!await kL(WL(g,e.draft.taskforce))){d("idle");return}h(!1),d("saved")}return v.jsxs("main",{className:"carrier-settings-page",children:[v.jsxs("section",{className:"carrier-settings-hero","aria-labelledby":"carrier-settings-title",children:[v.jsxs("div",{children:[v.jsx("p",{className:"bridge-kicker",children:"Carrier Control Surface"}),v.jsx("h2",{id:"carrier-settings-title",children:"Carrier Settings"})]}),v.jsxs("div",{className:"carrier-settings-hero-actions",children:[v.jsx("div",{className:`carrier-settings-save-status ${u==="saved"?"is-positive":""}`,role:"status","aria-live":"polite",children:u==="saving"||x?"Saving…":u==="saved"?"Saved ✓":""}),n?v.jsxs("div",{className:"carrier-settings-save-actions",children:[v.jsx("button",{type:"button",className:`carrier-settings-action-button ${A?"is-dirty":""}`,disabled:!A||x,onClick:()=>{y()},children:"Save"}),v.jsx("button",{type:"button",className:`carrier-settings-action-button ${A?"is-dirty":""}`,disabled:!A||x,onClick:m,children:"Discard"})]}):null,v.jsx("button",{type:"button",className:"carrier-settings-action-button carrier-settings-hero-refresh",disabled:e.loading,onClick:()=>{x1()},children:"Refresh"})]})]}),e.error?v.jsx("p",{className:"carrier-settings-error",role:"alert",children:e.error}):null,v.jsxs("section",{className:"carrier-settings-grid",children:[v.jsxs("div",{className:"carrier-settings-list","aria-label":"Carrier list",children:[e.loading&&!e.state?v.jsx("p",{className:"carrier-settings-empty",children:"Loading carrier settings."}):null,e.state&&e.state.carriers.length===0?v.jsx("p",{className:"carrier-settings-empty",children:"No carriers registered."}):null,e.state?.carriers.map(f=>v.jsx(PL,{carrier:f,active:f.carrierId===e.activeCarrierId,minBackends:e.options?.taskForceConstraints.minBackends??2,onSelect:()=>TL(f.carrierId)},f.carrierId))]}),n&&e.options&&r?v.jsxs("div",{className:"carrier-settings-detail",style:vC(n.carrierId),children:[v.jsxs("div",{className:"carrier-settings-detail-head",children:[v.jsxs("div",{className:"carrier-settings-detail-title-block",children:[v.jsxs("div",{className:"carrier-settings-captain-id",children:[v.jsx("span",{children:"Captain"})," · ",n.carrierId.toUpperCase()]}),v.jsx("div",{className:`carrier-settings-name-line ${o?"is-editing":""}`,children:o?v.jsxs(v.Fragment,{children:[v.jsx("input",{id:"carrier-display-name",className:"carrier-settings-input carrier-settings-name-input",value:e.draft.displayName,maxLength:NL,onChange:f=>Js({displayName:f.target.value})}),v.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Save display name",disabled:x,onClick:()=>{h(!1)},children:v.jsx(KL,{})}),v.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Cancel display name edit",onClick:()=>{Js({displayName:n.displayName}),h(!1)},children:v.jsx(VL,{})})]}):v.jsxs(v.Fragment,{children:[v.jsx("h3",{className:"carrier-settings-captain-name",children:n.displayName}),v.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Edit display name",onClick:()=>{Js({displayName:n.displayName}),h(!0)},children:v.jsx(GL,{})})]})}),v.jsx("div",{className:"carrier-settings-captain-role",children:n.role})]}),v.jsxs("div",{className:"carrier-settings-cli-badge",children:[v.jsx("span",{className:"ind","aria-hidden":"true"}),n.cliType]})]}),v.jsxs("div",{className:"carrier-settings-body",children:[v.jsxs("div",{className:"carrier-settings-control-group",children:[v.jsx("div",{className:"carrier-settings-resp-title",children:"Identity"}),v.jsxs("div",{className:"carrier-settings-mission",children:['"',n.roleDescription,'"']})]}),v.jsxs("div",{className:"carrier-settings-control-group",children:[v.jsx("div",{className:"carrier-settings-resp-title",children:"Runtime"}),v.jsxs("div",{className:"carrier-settings-runtime",children:[v.jsx("div",{className:"carrier-settings-runtime-row carrier-settings-runtime-row--cli",children:v.jsxs("div",{className:"carrier-settings-field carrier-settings-field--wide",children:[v.jsx("label",{className:"carrier-settings-label",htmlFor:"carrier-cli",children:"CLI"}),v.jsx("select",{id:"carrier-cli",className:"carrier-settings-select",value:e.draft.cliType,onChange:f=>$L(f.target.value,e.options?.cliTypes??[]),children:e.options.cliTypes.map(f=>v.jsx("option",{value:f.id,children:f.displayName},f.id))})]})}),v.jsxs("div",{className:"carrier-settings-runtime-row carrier-settings-runtime-row--model",children:[v.jsx(gC,{id:"carrier-model",label:"Model",models:r.models,value:e.draft.model,onChange:f=>HL(r,f)}),v.jsx(_C,{id:"carrier-effort",model:a,value:e.draft.effort,onChange:f=>Js({effort:f})})]})]})]}),v.jsx("div",{className:"carrier-settings-control-group",children:v.jsxs("div",{className:"carrier-settings-toggle-row",children:[v.jsxs("div",{children:[v.jsx("p",{className:"carrier-settings-resp-title",children:"SubAgent"}),v.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."})]}),v.jsx("button",{type:"button",className:`carrier-settings-toggle ${p?"is-on":""}`,disabled:x||!p&&(!r.supportsSubagent||S),"aria-pressed":p,onClick:()=>Js({agentMode:p?"cli":"subagent"}),children:v.jsx("span",{children:p?"On":"Off"})})]})}),v.jsx(zL,{carrier:n,cliOptions:e.options.cliTypes,minBackends:e.options.taskForceConstraints.minBackends,savingActionId:e.savingActionId,rows:g,disabled:C,onRowsChange:c})]})]},n.carrierId):v.jsx("div",{className:"carrier-settings-detail",children:v.jsx("p",{className:"carrier-settings-empty",children:"Select a carrier."})})]})]})}function PL({carrier:e,active:n,minBackends:r,onSelect:a}){const o=e.taskForceBackendCount>=r;return v.jsxs("button",{type:"button",className:`carrier-settings-row ${n?"is-active":""}`,style:vC(e.carrierId),onClick:a,children:[v.jsx("span",{className:"carrier-settings-captain-dot","aria-hidden":"true"}),v.jsxs("span",{className:"carrier-settings-row-text",children:[v.jsx("span",{className:"carrier-settings-row-name",children:e.displayName}),v.jsx("span",{className:"carrier-settings-row-role",children:e.role})]}),v.jsxs("span",{className:"carrier-settings-row-live","aria-hidden":"true",children:[v.jsx("span",{className:`carrier-settings-live-dot ${e.subagentMode?"is-live":""}`}),v.jsx("span",{className:`carrier-settings-live-dot ${o?"is-live":""}`})]})]})}function gC({id:e,label:n,models:r,value:a,disabled:o=!1,onChange:h}){return v.jsxs("div",{className:"carrier-settings-field",children:[v.jsx("label",{className:"carrier-settings-label",htmlFor:e,children:n}),v.jsx("select",{id:e,className:"carrier-settings-select",value:a,disabled:o,onChange:g=>h(g.target.value),children:r.map(g=>v.jsx("option",{value:g.modelId,children:g.name},g.modelId))})]})}function _C({id:e,model:n,value:r,disabled:a=!1,onChange:o}){return n?.effort?v.jsxs("div",{className:"carrier-settings-field",children:[v.jsx("label",{className:"carrier-settings-label",htmlFor:e,children:"Effort"}),v.jsx("select",{id:e,className:"carrier-settings-select",value:r||n.effort.default,disabled:a,onChange:h=>o(h.target.value),children:n.effort.levels.map(h=>v.jsx("option",{value:h,children:h},h))})]}):v.jsxs("div",{className:"carrier-settings-field",children:[v.jsx("span",{className:"carrier-settings-label",children:"Effort"}),v.jsx("p",{className:"carrier-settings-help",children:"Not supported for this model."})]})}function zL({carrier:e,cliOptions:n,minBackends:r,savingActionId:a,rows:o,disabled:h,onRowsChange:g}){const c=dC(),u=e.taskforce.backends.length,[d,S]=$.useState(u>0),[p,C]=$.useState(!1),[x,A]=$.useState(""),E=e.taskForceBackendCount>=r,m=n.filter(f=>!o.includes(f.id)),y=x||m[0]?.id||"";return v.jsxs("div",{className:`carrier-settings-control-group carrier-settings-control-group--taskforce ${d?"is-expanded":""} ${h?"is-disabled":""}`,children:[v.jsxs("div",{className:"carrier-settings-section-head",children:[v.jsxs("div",{children:[v.jsx("p",{className:"carrier-settings-resp-title",children:"Task Force"}),v.jsx("p",{className:"carrier-settings-help",children:h?"Disabled while SubAgent is on. Turn SubAgent off before composing Task Force backends.":u>0?`${u} backend${u===1?"":"s"} configured${E?" · active":` · needs ${r}+ to activate`}.`:`Run this carrier across multiple CLI backends. Needs at least ${r} to activate.`})]}),v.jsx("div",{className:"carrier-settings-tf-head-actions",children:v.jsx("button",{type:"button",className:"carrier-settings-tf-toggle","aria-expanded":d,onClick:()=>S(f=>!f),children:d?"Hide":"Configure"})})]}),d?v.jsxs("div",{className:"carrier-settings-tf-list",children:[o.length===0?v.jsx("p",{className:"carrier-settings-tf-empty",children:"No Task Force backend drafted."}):null,o.map(f=>{const b=n.find(M=>M.id===f);if(!b)return null;const T=c.draft.taskforce[b.id]??{model:b.defaultModel,effort:""},L=b.models.find(M=>M.modelId===T.model)??b.models[0]??null,R=e.taskforce.backends.some(M=>M.cliType===b.id);return v.jsxs("div",{className:`carrier-settings-tf-item ${R?"is-active":""}`,children:[v.jsxs("div",{className:"carrier-settings-tf-title",children:[v.jsx("span",{className:`carrier-settings-live-dot ${R?"is-live":""}`,"aria-hidden":"true"}),v.jsx("strong",{children:b.displayName})]}),v.jsx(gC,{id:`tf-${b.id}-model`,label:"Model",models:b.models,value:T.model,disabled:h,onChange:M=>UL(b,M)}),v.jsx(_C,{id:`tf-${b.id}-effort`,model:L,value:T.effort,disabled:h,onChange:M=>om(b.id,{effort:M})}),v.jsx("div",{className:"carrier-settings-tf-actions",children:v.jsx("button",{type:"button",className:"carrier-settings-ghost-button",disabled:h||a==="save-all",onClick:()=>g(o.filter(M=>M!==b.id)),children:"Remove"})})]},b.id)}),v.jsxs("div",{className:"carrier-settings-tf-add-row",children:[p&&m.length>0?v.jsx("select",{className:"carrier-settings-select carrier-settings-tf-add-select",value:y,onChange:f=>A(f.target.value),"aria-label":"Task Force CLI to add",children:m.map(f=>v.jsx("option",{value:f.id,children:f.displayName},f.id))}):null,v.jsx("button",{type:"button",className:"carrier-settings-ghost-button",disabled:h||m.length===0||a==="save-all",onClick:()=>{if(!p){C(!0);return}const f=y,b=n.find(L=>L.id===f),T=b?.models.find(L=>L.modelId===b.defaultModel)??b?.models[0]??null;!b||!T||(om(b.id,{model:T.modelId,effort:T.effort?.default??""}),g(o.includes(b.id)?o:[...o,b.id]),A(""),C(!1))},children:"Add"})]})]}):null]})}function $L(e,n){const r=n.find(h=>h.id===e),a=r?.models.find(h=>h.modelId===r.defaultModel)??r?.models[0]??null,o={cliType:e,model:a?.modelId??"",effort:a?.effort?.default??""};r?.supportsSubagent||(o.agentMode="cli"),Js(o)}function HL(e,n){const r=e.models.find(a=>a.modelId===n);Js({model:n,effort:r?.effort?.default??""})}function UL(e,n){const r=e.models.find(a=>a.modelId===n);om(e.id,{model:n,effort:r?.effort?.default??""})}function FL(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:qL(e,r,n.taskforce)}function qL(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 h=r[o.cliType];if(!h||h.model!==o.model||(h.effort||"")!==(o.effort||""))return!0}return!1}function WL(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 vC(e){return{"--cap-color":BL[e]??"var(--brass)"}}function GL(){return v.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[v.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"}),v.jsx("path",{d:"M9.7 3.4 12.6 6.3"})]})}function KL(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:v.jsx("path",{d:"M3 8.3 6.4 11.7 13.2 4.5"})})}function VL(){return v.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[v.jsx("path",{d:"M4.2 4.2 11.8 11.8"}),v.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 Xe(e){return Ee(e).replace(/"/g,"&quot;")}const YL="contextual-knowledge-not-instructions";function XL(e,n,r){const a=r?.whyThisMatched??e.frontmatter.whyThisMatched,o=SC(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">${$u(bC(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">${$u(yC(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">${$u(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 bC(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:mg(e.body)};return JSON.stringify({...n,token_estimate:$u(JSON.stringify(n))},null,2)}function yC(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",mg(e.body)].join(`
40
- `)}function SC(e,n){const r=new Set([...e.frontmatter.related??[]]),a=n.filter(o=>r.has(o.id)).sort((o,h)=>o.title.localeCompare(h.title));return[`<fleet-wiki-context boundary="${YL}">`,"# 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",mg(e.body),"","### Related Entries",...a.length>0?a.map(o=>`- [[wiki:${o.id}]] — ${o.title}`):["- (none)"],"","</fleet-wiki-context>"].join(`
41
- `)}function $u(e){return Math.max(1,Math.ceil(e.length/4))}function mg(e){return e.replace(/\s+/g," ").trim().slice(0,240)||"(empty)"}async function ZL(){return or(ii("/health"))}async function JL(){return or(ii("/workspaces"))}async function QL(){return or(ii("/index"))}async function eM(){return CC(ii("/index-md"))}async function tM(e){return or(ii(`/entry/${encodeURIComponent(e)}`))}async function nM(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 iM(e){return CC(ii(`/raw?ref=${encodeURIComponent(e)}`))}async function Rh(e){return or(ii(`/queue?status=${encodeURIComponent(e)}`))}async function rM(e){return or(ii(`/queue/${encodeURIComponent(e)}`))}async function sM(e){return xC(ii(`/queue/${encodeURIComponent(e)}/approve`),{})}async function aM(e,n){return xC(ii(`/queue/${encodeURIComponent(e)}/reject`),{reason:n})}async function wC(){return or(ii("/conflicts"))}async function oM(e){return or(ii(`/conflicts/${encodeURIComponent(e)}`))}async function lM(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 gg(e,n));return n.json()}async function CC(e){const n=await fetch(e,{headers:{accept:"text/markdown,text/plain"}});if(!n.ok)throw new Error(await gg(e,n));return n.text()}async function xC(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 gg(e,r));return r.json()}async function gg(e,n){return(await n.json().catch(()=>null))?.error??`${e} request failed: ${n.status}`}const cM=/^[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}$/,Wi="/console/codex",lm=new Set;let oo=null;function nc(){const e=_M(vM(RC(window.location.pathname)).pathname);return e.name==="queue"?{name:"queue",tab:new URLSearchParams(window.location.search).get("tab")==="archived"?"archived":"pending"}:e}function cm(){return kC(RC(window.location.pathname))?.wsId??null}function oa(e){e!==window.location.pathname+window.location.search&&(window.history.pushState({},"",e),vg(nc()))}function uM(e){window.history.replaceState({},"",e),vg(nc())}function hM(e){return lm.add(e),()=>lm.delete(e)}function dM(){oo||(oo=()=>vg(nc()),window.addEventListener("popstate",oo))}function fM(){oo&&(window.removeEventListener("popstate",oo),oo=null)}function Ur(e){return rr(`/entry/${encodeURIComponent(e)}`)}function EC(e){return rr(`/raw/${encodeURIComponent(e)}`)}function mo(e="pending"){return rr(e==="archived"?"/queue?tab=archived":"/queue")}function pM(e){return rr(`/queue/${encodeURIComponent(e)}`)}function mM(){return rr("/conflicts")}function gM(e){return rr(`/conflicts/${encodeURIComponent(e)}`)}function TC(){return rr("/index-md")}function AC(e){return rr(typeof e!="number"?"/log":`/log?limit=${encodeURIComponent(String(e))}`)}function _g(){return rr("/")}function E1(e){return`${Wi}/w/${encodeURIComponent(e)}/`}function _M(e){if(e==="/index"||e==="/index-md")return{name:"index-md"};if(e==="/log"){const h=new URLSearchParams(window.location.search).get("limit"),g=Number(h??20);return{name:"log",limit:Number.isInteger(g)?g: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 h=decodeURIComponent(o[1]??"");return cM.test(h)?{name:"queue-detail",patchId:h}:{name:"home"}}return{name:"home"}}function rr(e){const n=cm();return n?`${Wi}/w/${encodeURIComponent(n)}${e}`:`${Wi}${e}`}function vM(e){const n=kC(e);return n?{pathname:n.pathname,wsId:n.wsId}:{pathname:e,wsId:null}}function kC(e){const n=e.match(/^\/w\/([^/]+)(\/.*)?$/);return n?{wsId:decodeURIComponent(n[1]??""),pathname:n[2]??"/"}:null}function RC(e){return e===Wi||e===`${Wi}/`?"/":e.startsWith(`${Wi}/`)?e.slice(Wi.length)||"/":e}function vg(e){for(const n of lm)n(e)}const LC="fleet-wiki-web-recent",um=new Set,la={health:null,index:[],currentEntry:null,currentMatchHint:null,conflicts:[],currentConflict:null,indexMarkdown:null,log:null,loading:!1,error:null,recentIds:AM(),pendingPatchCount:0,currentWorkspaceId:null,workspaces:[]};function Hu(){return la}function bM(e){return um.add(e),()=>um.delete(e)}async function yM(){Qt({loading:!0,error:null});try{const[e,n,r,a]=await Promise.all([ZL(),QL(),Rh("pending").catch(()=>null),JL().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:wo(e)})}}async function SM(e){Qt({loading:!0,error:null,currentEntry:null,currentMatchHint:la.currentMatchHint?.id===e?la.currentMatchHint:null,currentConflict:null,indexMarkdown:null,log:null});try{const n=await tM(e),r=TM(e);Qt({currentEntry:n,currentConflict:null,indexMarkdown:null,log:null,recentIds:r,loading:!1})}catch(n){Qt({loading:!1,error:wo(n)})}}async function wM(){Qt({loading:!0,error:null,currentEntry:null,currentConflict:null,log:null});try{Qt({indexMarkdown:await eM(),loading:!1})}catch(e){Qt({loading:!1,error:wo(e)})}}async function CM(e){Qt({loading:!0,error:null,currentEntry:null,currentConflict:null,indexMarkdown:null});try{Qt({log:await lM(e),loading:!1})}catch(n){Qt({loading:!1,error:wo(n)})}}async function xM(){Qt({loading:!0,error:null,currentEntry:null,currentConflict:null,indexMarkdown:null,log:null});try{Qt({conflicts:await wC(),loading:!1})}catch(e){Qt({loading:!1,error:wo(e)})}}async function EM(e){Qt({loading:!0,error:null,currentEntry:null,indexMarkdown:null,log:null});try{const[n,r]=await Promise.all([oM(e),wC().catch(()=>la.conflicts)]);Qt({currentConflict:n,conflicts:r,loading:!1})}catch(n){Qt({loading:!1,error:wo(n)})}}function ip(){Qt({currentEntry:null,currentMatchHint:null,currentConflict:null,indexMarkdown:null,log:null,error:null,loading:!1})}function MC(e){Qt({currentMatchHint:e})}function bg(e){Qt({pendingPatchCount:e})}function Qt(e){Object.assign(la,e);for(const n of um)n(la)}function TM(e){const n=[e,...la.recentIds.filter(r=>r!==e)].slice(0,8);return window.localStorage.setItem(LC,JSON.stringify(n)),n}function AM(){try{const e=window.localStorage.getItem(LC),n=e?JSON.parse(e):[];return Array.isArray(n)?n.filter(r=>typeof r=="string").slice(0,8):[]}catch{return[]}}function wo(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 hm=[],yg=[];function kM(e,n){hm=e,yg=n,ke.open&&!ke.query&&(ke.results=Sg(),ke.selectedIndex=0,oh())}function DC(){if(ke.open){A1();return}ke.open=!0,ke.query="",ke.selectedIndex=0,ke.results=Sg(),ke.previousActiveElement=document.activeElement instanceof HTMLElement?document.activeElement:null,zM(),NM(),oh(),A1()}function lo(){ke.open&&(ke.open=!1,ke.searchSeq++,ke.debounceId!==null&&(window.clearTimeout(ke.debounceId),ke.debounceId=null),IM(),$M(),HM())}function RM(){document.addEventListener("keydown",OC),document.addEventListener("input",NC),document.addEventListener("click",IC),document.addEventListener("mouseover",BC)}function LM(){ke.open&&lo(),document.removeEventListener("keydown",OC),document.removeEventListener("input",NC),document.removeEventListener("click",IC),document.removeEventListener("mouseover",BC)}function MM(){return ke.open}function OC(e){if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==="k"){e.preventDefault(),ke.open?lo():DC();return}if(ke.open){if(e.key==="Tab"){UM(e);return}if(e.key==="Escape"){e.preventDefault(),lo();return}if(e.key==="ArrowDown"){e.preventDefault(),ke.selectedIndex=Math.min(ke.selectedIndex+1,Math.max(0,ke.results.length-1)),dm({scroll:!0});return}if(e.key==="ArrowUp"){e.preventDefault(),ke.selectedIndex=Math.max(0,ke.selectedIndex-1),dm({scroll:!0});return}if(e.key==="Enter"){e.preventDefault();const r=ke.results[ke.selectedIndex];if(!r)return;MC(r),oa(Ur(r.id)),lo()}}}function NC(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(()=>{DM(ke.query)},150))}function IC(e){const n=e.target;if(!(n instanceof Element))return;if(n.matches("[data-action='open-command']")||n.closest("[data-action='open-command']")){DC();return}if(!ke.open)return;if(n.classList.contains("command-overlay")){lo();return}const r=n.closest("[data-command-entry-id]");if(r){const a=ke.results.find(o=>o.id===(r.dataset.commandEntryId??""));MC(a??null),oa(Ur(r.dataset.commandEntryId??"")),lo()}}function BC(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,dm({scroll:!1}))}async function DM(e){const n=++ke.searchSeq;if(!e){ke.results=Sg(),ke.selectedIndex=0,oh();return}let r;try{r=await nM(e)}catch{r=[]}n!==ke.searchSeq||!ke.open||(ke.results=r,ke.selectedIndex=0,oh())}function OM(){let e=document.querySelector("#command-palette-root");return e||(e=document.createElement("div"),e.id="command-palette-root",document.body.append(e)),e}function NM(){const e=OM();e.querySelector(".command-overlay")||(e.innerHTML=BM())}function IM(){const e=document.querySelector("#command-palette-root");e&&(e.innerHTML="")}function oh(){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(jC).join(""):jM()}}function dm(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 BM(){const e=Xe("Command palette"),n=Xe("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 jC(e,n){const r=n===ke.selectedIndex?" active":"",a=Xe(e.title),o=e.tags.slice(0,2),h=e.tags.length-o.length,g=GM(e),c=o.map(d=>`<span class="chip chip-tag">${Ee(d)}</span>`).join(""),u=h>0?`<span class="chip chip-muted">+${h}</span>`:"";return`
56
- <button class="command-result${r}" type="button" data-command-entry-id="${Xe(e.id)}" data-command-index="${n}" title="${a}">
57
- <span class="command-result-text">
58
- <strong>${qM(e.title,ke.query)}</strong>
59
- <small>${Ee(WM(e))}</small>
60
- ${g?`<small class="command-result-excerpt">${Ee(g)}</small>`:""}
61
- </span>
62
- <span class="command-result-aside">${c}${u}</span>
63
- </button>
64
- `}function jM(){const e=PM(),n=ke.results.slice(0,e),r=ke.results.slice(e);return[n.length>0?T1("Recent",n,0):"",r.length>0?T1("All",r,e):""].join("")}function T1(e,n,r){return`
65
- <div class="command-section-heading">${Ee(e)}</div>
66
- ${n.map((a,o)=>jC(a,r+o)).join("")}
67
- `}function Sg(){const e=new Set(yg),n=PC().map(a=>hm.find(o=>o.id===a)).filter(a=>!!a),r=hm.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 PM(){return PC().filter((e,n)=>ke.results[n]?.id===e).length}function PC(){return Array.from(new Set(yg))}function zM(){ke.previousBodyOverflow===null&&(ke.previousBodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden")}function $M(){ke.previousBodyOverflow!==null&&(document.body.style.overflow=ke.previousBodyOverflow,ke.previousBodyOverflow=null)}function HM(){const e=ke.previousActiveElement;ke.previousActiveElement=null,e?.isConnected&&e.focus()}function A1(){window.setTimeout(()=>{const e=document.querySelector("#command-input");e&&(e.focus(),e.select())},0)}function UM(e){const n=document.querySelector(".command-card");if(!n)return;const r=FM(n);if(r.length===0){e.preventDefault(),n.focus();return}const a=document.activeElement,o=a instanceof HTMLElement?r.indexOf(a):-1,h=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[h]?.focus())}function FM(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 qM(e,n){if(!n)return Ee(e);const r=e.toLocaleLowerCase(),a=n.toLocaleLowerCase();if(!a)return Ee(e);let o=0,h="";for(;o<e.length;){const g=r.indexOf(a,o);if(g===-1)break;h+=Ee(e.slice(o,g)),h+=`<mark class="command-highlight">${Ee(e.slice(g,g+n.length))}</mark>`,o=g+n.length}return h+Ee(e.slice(o))}function WM(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 GM(e){const n=e.matchedSnippets?.find(a=>a.field==="body")?.snippet;if(e.reason!=="body")return"";const r=n??e.excerpt;return KM(r??"")}function KM(e){return YM(VM(e)).replace(/\s+/g," ").trim().slice(0,180)}function VM(e){return e.replace(/<<<[^>]*>>>/g," ")}function YM(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 wg(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ha=wg();function zC(e){ha=e}var zl={exec:()=>null};function ut(e,n=""){let r=typeof e=="string"?e:e.source,a={replace:(o,h)=>{let g=typeof h=="string"?h:h.source;return g=g.replace($n.caret,"$1"),r=r.replace(o,g),a},getRegex:()=>new RegExp(r,n)};return a}var XM=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),$n={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")},ZM=/^(?:[ \t]*(?:\n|$))+/,JM=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,QM=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ic=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,e6=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Cg=/(?:[*+-]|\d{1,9}[.)])/,$C=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,HC=ut($C).replace(/bull/g,Cg).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(),t6=ut($C).replace(/bull/g,Cg).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(),xg=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,n6=/^[^\n]+/,Eg=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,i6=ut(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Eg).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),r6=ut(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Cg).getRegex(),Lh="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",Tg=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,s6=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",Tg).replace("tag",Lh).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),UC=ut(xg).replace("hr",ic).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",Lh).getRegex(),a6=ut(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",UC).getRegex(),Ag={blockquote:a6,code:JM,def:i6,fences:QM,heading:e6,hr:ic,html:s6,lheading:HC,list:r6,newline:ZM,paragraph:UC,table:zl,text:n6},k1=ut("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ic).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",Lh).getRegex(),o6={...Ag,lheading:t6,table:k1,paragraph:ut(xg).replace("hr",ic).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",k1).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",Lh).getRegex()},l6={...Ag,html:ut(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Tg).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:zl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ut(xg).replace("hr",ic).replace("heading",` *#{1,6} *[^
68
- ]`).replace("lheading",HC).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},c6=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,u6=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,FC=/^( {2,}|\\)\n(?!\s*$)/,h6=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Mh=/[\p{P}\p{S}]/u,kg=/[\s\p{P}\p{S}]/u,qC=/[^\s\p{P}\p{S}]/u,d6=ut(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,kg).getRegex(),WC=/(?!~)[\p{P}\p{S}]/u,f6=/(?!~)[\s\p{P}\p{S}]/u,p6=/(?:[^\s\p{P}\p{S}]|~)/u,m6=ut(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",XM?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),GC=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,g6=ut(GC,"u").replace(/punct/g,Mh).getRegex(),_6=ut(GC,"u").replace(/punct/g,WC).getRegex(),KC="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",v6=ut(KC,"gu").replace(/notPunctSpace/g,qC).replace(/punctSpace/g,kg).replace(/punct/g,Mh).getRegex(),b6=ut(KC,"gu").replace(/notPunctSpace/g,p6).replace(/punctSpace/g,f6).replace(/punct/g,WC).getRegex(),y6=ut("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,qC).replace(/punctSpace/g,kg).replace(/punct/g,Mh).getRegex(),S6=ut(/\\(punct)/,"gu").replace(/punct/g,Mh).getRegex(),w6=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(),C6=ut(Tg).replace("(?:-->|$)","-->").getRegex(),x6=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",C6).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),lh=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,E6=ut(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",lh).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),VC=ut(/^!?\[(label)\]\[(ref)\]/).replace("label",lh).replace("ref",Eg).getRegex(),YC=ut(/^!?\[(ref)\](?:\[\])?/).replace("ref",Eg).getRegex(),T6=ut("reflink|nolink(?!\\()","g").replace("reflink",VC).replace("nolink",YC).getRegex(),R1=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Rg={_backpedal:zl,anyPunctuation:S6,autolink:w6,blockSkip:m6,br:FC,code:u6,del:zl,emStrongLDelim:g6,emStrongRDelimAst:v6,emStrongRDelimUnd:y6,escape:c6,link:E6,nolink:YC,punctuation:d6,reflink:VC,reflinkSearch:T6,tag:x6,text:h6,url:zl},A6={...Rg,link:ut(/^!?\[(label)\]\((.*?)\)/).replace("label",lh).getRegex(),reflink:ut(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",lh).getRegex()},fm={...Rg,emStrongRDelimAst:b6,emStrongLDelim:_6,url:ut(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",R1).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",R1).getRegex()},k6={...fm,br:ut(FC).replace("{2,}","*").getRegex(),text:ut(fm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Su={normal:Ag,gfm:o6,pedantic:l6},Sl={normal:Rg,gfm:fm,breaks:k6,pedantic:A6},R6={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},L1=e=>R6[e];function nr(e,n){if(n){if($n.escapeTest.test(e))return e.replace($n.escapeReplace,L1)}else if($n.escapeTestNoEncode.test(e))return e.replace($n.escapeReplaceNoEncode,L1);return e}function M1(e){try{e=encodeURI(e).replace($n.percentDecode,"%")}catch{return null}return e}function D1(e,n){let r=e.replace($n.findPipe,(h,g,c)=>{let u=!1,d=g;for(;--d>=0&&c[d]==="\\";)u=!u;return u?"|":" |"}),a=r.split($n.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($n.slashPipe,"|");return a}function wl(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 L6(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 O1(e,n,r,a,o){let h=n.href,g=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:h,title:g,text:c,tokens:a.inlineTokens(c)};return a.state.inLink=!1,u}function M6(e,n,r){let a=e.match(r.other.indentCodeCompensation);if(a===null)return n;let o=a[1];return n.split(`
69
- `).map(h=>{let g=h.match(r.other.beginningSpace);if(g===null)return h;let[c]=g;return c.length>=o.length?h.slice(o.length):h}).join(`
70
- `)}var ch=class{options;rules;lexer;constructor(e){this.options=e||ha}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:wl(r,`
71
- `)}}}fences(e){let n=this.rules.block.fences.exec(e);if(n){let r=n[0],a=M6(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=wl(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:wl(n[0],`
72
- `)}}blockquote(e){let n=this.rules.block.blockquote.exec(e);if(n){let r=wl(n[0],`
73
- `).split(`
74
- `),a="",o="",h=[];for(;r.length>0;){let g=!1,c=[],u;for(u=0;u<r.length;u++)if(this.rules.other.blockquoteStart.test(r[u]))c.push(r[u]),g=!0;else if(!g)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 p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(S,h,!0),this.lexer.state.top=p,r.length===0)break;let C=h.at(-1);if(C?.type==="code")break;if(C?.type==="blockquote"){let x=C,A=x.raw+`
79
- `+r.join(`
80
- `),E=this.blockquote(A);h[h.length-1]=E,a=a.substring(0,a.length-x.raw.length)+E.raw,o=o.substring(0,o.length-x.text.length)+E.text;break}else if(C?.type==="list"){let x=C,A=x.raw+`
81
- `+r.join(`
82
- `),E=this.list(A);h[h.length-1]=E,a=a.substring(0,a.length-C.raw.length)+E.raw,o=o.substring(0,o.length-x.raw.length)+E.raw,r=A.substring(h.at(-1).raw.length).split(`
83
- `);continue}}return{type:"blockquote",raw:a,tokens:h,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 h=this.rules.other.listItemRegex(r),g=!1;for(;e;){let u=!1,d="",S="";if(!(n=h.exec(e))||this.rules.block.hr.test(e))break;d=n[0],e=e.substring(d.length);let p=n[2].split(`
84
- `,1)[0].replace(this.rules.other.listReplaceTabs,y=>" ".repeat(3*y.length)),C=e.split(`
85
- `,1)[0],x=!p.trim(),A=0;if(this.options.pedantic?(A=2,S=p.trimStart()):x?A=n[1].length+1:(A=n[2].search(this.rules.other.nonSpaceChar),A=A>4?1:A,S=p.slice(A),A+=n[1].length),x&&this.rules.other.blankLine.test(C)&&(d+=C+`
86
- `,e=e.substring(C.length+1),u=!0),!u){let y=this.rules.other.nextBulletRegex(A),f=this.rules.other.hrRegex(A),b=this.rules.other.fencesBeginRegex(A),T=this.rules.other.headingBeginRegex(A),L=this.rules.other.htmlBeginRegex(A);for(;e;){let R=e.split(`
87
- `,1)[0],M;if(C=R,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)||L.test(C)||y.test(C)||f.test(C))break;if(M.search(this.rules.other.nonSpaceChar)>=A||!C.trim())S+=`
88
- `+M.slice(A);else{if(x||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||b.test(p)||T.test(p)||f.test(p))break;S+=`
89
- `+C}!x&&!C.trim()&&(x=!0),d+=R+`
90
- `,e=e.substring(R.length+1),p=M.slice(A)}}o.loose||(g?o.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(g=!0));let E=null,m;this.options.gfm&&(E=this.rules.other.listIsTask.exec(S),E&&(m=E[0]!=="[ ] ",S=S.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:d,task:!!E,checked:m,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(p=>p.type==="space"),S=d.length>0&&d.some(p=>this.rules.other.anyLine.test(p.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
- `):[],h={type:"table",raw:n[0],header:[],align:[],rows:[]};if(r.length===a.length){for(let g of a)this.rules.other.tableAlignRight.test(g)?h.align.push("right"):this.rules.other.tableAlignCenter.test(g)?h.align.push("center"):this.rules.other.tableAlignLeft.test(g)?h.align.push("left"):h.align.push(null);for(let g=0;g<r.length;g++)h.header.push({text:r[g],tokens:this.lexer.inline(r[g]),header:!0,align:h.align[g]});for(let g of o)h.rows.push(D1(g,h.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:h.align[u]})));return h}}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 h=wl(r.slice(0,-1),"\\");if((r.length-h.length)%2===0)return}else{let h=L6(n[2],"()");if(h===-2)return;if(h>-1){let g=(n[0].indexOf("!")===0?5:4)+n[1].length+h;n[2]=n[2].substring(0,h),n[0]=n[0].substring(0,g).trim(),n[3]=""}}let a=n[2],o="";if(this.options.pedantic){let h=this.rules.other.pedanticHrefTitle.exec(a);h&&(a=h[1],o=h[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)),O1(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 h=r[0].charAt(0);return{type:"text",raw:h,text:h}}return O1(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,h,g,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(h=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!h)continue;if(g=[...h].length,a[3]||a[4]){c+=g;continue}else if((a[5]||a[6])&&o%3&&!((o+g)%3)){u+=g;continue}if(c-=g,c>0)continue;g=Math.min(g,g+c+u);let S=[...a[0]][0].length,p=e.slice(0,o+a.index+S+g);if(Math.min(o,g)%2){let x=p.slice(1,-1);return{type:"em",raw:p,text:x,tokens:this.lexer.inlineTokens(x)}}let C=p.slice(2,-2);return{type:"strong",raw:p,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}}}},Fi=class pm{tokens;options;state;tokenizer;inlineQueue;constructor(n){this.tokens=[],this.tokens.links=Object.create(null),this.options=n||ha,this.options.tokenizer=this.options.tokenizer||new ch,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:$n,block:Su.normal,inline:Sl.normal};this.options.pedantic?(r.block=Su.pedantic,r.inline=Sl.pedantic):this.options.gfm&&(r.block=Su.gfm,this.options.breaks?r.inline=Sl.breaks:r.inline=Sl.gfm),this.tokenizer.rules=r}static get rules(){return{block:Su,inline:Sl}}static lex(n,r){return new pm(r).lex(n)}static lexInline(n,r){return new pm(r).inlineTokens(n)}lex(n){n=n.replace($n.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($n.tabCharGlobal," ").replace($n.spaceLine,""));n;){let o;if(this.options.extensions?.block?.some(g=>(o=g.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 g=r.at(-1);o.raw.length===1&&g!==void 0?g.raw+=`
94
- `:r.push(o);continue}if(o=this.tokenizer.code(n)){n=n.substring(o.raw.length);let g=r.at(-1);g?.type==="paragraph"||g?.type==="text"?(g.raw+=(g.raw.endsWith(`
95
- `)?"":`
96
- `)+o.raw,g.text+=`
97
- `+o.text,this.inlineQueue.at(-1).src=g.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 g=r.at(-1);g?.type==="paragraph"||g?.type==="text"?(g.raw+=(g.raw.endsWith(`
98
- `)?"":`
99
- `)+o.raw,g.text+=`
100
- `+o.raw,this.inlineQueue.at(-1).src=g.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 h=n;if(this.options.extensions?.startBlock){let g=1/0,c=n.slice(1),u;this.options.extensions.startBlock.forEach(d=>{u=d.call({lexer:this},c),typeof u=="number"&&u>=0&&(g=Math.min(g,u))}),g<1/0&&g>=0&&(h=n.substring(0,g+1))}if(this.state.top&&(o=this.tokenizer.paragraph(h))){let g=r.at(-1);a&&g?.type==="paragraph"?(g.raw+=(g.raw.endsWith(`
101
- `)?"":`
102
- `)+o.raw,g.text+=`
103
- `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=g.text):r.push(o),a=h.length!==n.length,n=n.substring(o.raw.length);continue}if(o=this.tokenizer.text(n)){n=n.substring(o.raw.length);let g=r.at(-1);g?.type==="text"?(g.raw+=(g.raw.endsWith(`
104
- `)?"":`
105
- `)+o.raw,g.text+=`
106
- `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=g.text):r.push(o);continue}if(n){let g="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(g);break}else throw new Error(g)}}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 h;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)h=o[2]?o[2].length:0,a=a.slice(0,o.index+h)+"["+"a".repeat(o[0].length-h-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);a=this.options.hooks?.emStrongMask?.call({lexer:this},a)??a;let g=!1,c="";for(;n;){g||(c=""),g=!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,p=n.slice(1),C;this.options.extensions.startInline.forEach(x=>{C=x.call({lexer:this},p),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)),g=!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}},uh=class{options;parser;constructor(e){this.options=e||ha}space(e){return""}code({text:e,lang:n,escaped:r}){let a=(n||"").match($n.notSpaceStart)?.[0],o=e.replace($n.endingNewline,"")+`
107
- `;return a?'<pre><code class="language-'+nr(a)+'">'+(r?o:nr(o,!0))+`</code></pre>
108
- `:"<pre><code>"+(r?o:nr(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 g=0;g<e.items.length;g++){let c=e.items[g];a+=this.listitem(c)}let o=n?"ol":"ul",h=n&&r!==1?' start="'+r+'"':"";return"<"+o+h+`>
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+" "+nr(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 h=e.rows[o];r="";for(let g=0;g<h.length;g++)r+=this.tablecell(h[g]);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>${nr(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=M1(e);if(o===null)return a;e=o;let h='<a href="'+e+'"';return n&&(h+=' title="'+nr(n)+'"'),h+=">"+a+"</a>",h}image({href:e,title:n,text:r,tokens:a}){a&&(r=this.parser.parseInline(a,this.parser.textRenderer));let o=M1(e);if(o===null)return nr(r);e=o;let h=`<img src="${e}" alt="${r}"`;return n&&(h+=` title="${nr(n)}"`),h+=">",h}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:nr(e.text)}},Lg=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""}},qi=class mm{options;renderer;textRenderer;constructor(n){this.options=n||ha,this.options.renderer=this.options.renderer||new uh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Lg}static parse(n,r){return new mm(r).parse(n)}static parseInline(n,r){return new mm(r).parseInline(n)}parse(n,r=!0){let a="";for(let o=0;o<n.length;o++){let h=n[o];if(this.options.extensions?.renderers?.[h.type]){let c=h,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 g=h;switch(g.type){case"space":{a+=this.renderer.space(g);continue}case"hr":{a+=this.renderer.hr(g);continue}case"heading":{a+=this.renderer.heading(g);continue}case"code":{a+=this.renderer.code(g);continue}case"table":{a+=this.renderer.table(g);continue}case"blockquote":{a+=this.renderer.blockquote(g);continue}case"list":{a+=this.renderer.list(g);continue}case"html":{a+=this.renderer.html(g);continue}case"def":{a+=this.renderer.def(g);continue}case"paragraph":{a+=this.renderer.paragraph(g);continue}case"text":{let c=g,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 "'+g.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 h=n[o];if(this.options.extensions?.renderers?.[h.type]){let c=this.options.extensions.renderers[h.type].call({parser:this},h);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(h.type)){a+=c||"";continue}}let g=h;switch(g.type){case"escape":{a+=r.text(g);break}case"html":{a+=r.html(g);break}case"link":{a+=r.link(g);break}case"image":{a+=r.image(g);break}case"strong":{a+=r.strong(g);break}case"em":{a+=r.em(g);break}case"codespan":{a+=r.codespan(g);break}case"br":{a+=r.br(g);break}case"del":{a+=r.del(g);break}case"text":{a+=r.text(g);break}default:{let c='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return a}},Dl=class{options;block;constructor(e){this.options=e||ha}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?Fi.lex:Fi.lexInline}provideParser(){return this.block?qi.parse:qi.parseInline}},XC=class{defaults=wg();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=qi;Renderer=uh;TextRenderer=Lg;Lexer=Fi;Tokenizer=ch;Hooks=Dl;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 h=o;for(let g of h.header)a=a.concat(this.walkTokens(g.tokens,r));for(let g of h.rows)for(let c of g)a=a.concat(this.walkTokens(c.tokens,r));break}case"list":{let h=o;a=a.concat(this.walkTokens(h.items,r));break}default:{let h=o;this.defaults.extensions?.childTokens?.[h.type]?this.defaults.extensions.childTokens[h.type].forEach(g=>{let c=h[g].flat(1/0);a=a.concat(this.walkTokens(c,r))}):h.tokens&&(a=a.concat(this.walkTokens(h.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(h=>{if(!h.name)throw new Error("extension name required");if("renderer"in h){let g=r.renderers[h.name];g?r.renderers[h.name]=function(...c){let u=h.renderer.apply(this,c);return u===!1&&(u=g.apply(this,c)),u}:r.renderers[h.name]=h.renderer}if("tokenizer"in h){if(!h.level||h.level!=="block"&&h.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let g=r[h.level];g?g.unshift(h.tokenizer):r[h.level]=[h.tokenizer],h.start&&(h.level==="block"?r.startBlock?r.startBlock.push(h.start):r.startBlock=[h.start]:h.level==="inline"&&(r.startInline?r.startInline.push(h.start):r.startInline=[h.start]))}"childTokens"in h&&h.childTokens&&(r.childTokens[h.name]=h.childTokens)}),o.extensions=r),a.renderer){let h=this.defaults.renderer||new uh(this.defaults);for(let g in a.renderer){if(!(g in h))throw new Error(`renderer '${g}' does not exist`);if(["options","parser"].includes(g))continue;let c=g,u=a.renderer[c],d=h[c];h[c]=(...S)=>{let p=u.apply(h,S);return p===!1&&(p=d.apply(h,S)),p||""}}o.renderer=h}if(a.tokenizer){let h=this.defaults.tokenizer||new ch(this.defaults);for(let g in a.tokenizer){if(!(g in h))throw new Error(`tokenizer '${g}' does not exist`);if(["options","rules","lexer"].includes(g))continue;let c=g,u=a.tokenizer[c],d=h[c];h[c]=(...S)=>{let p=u.apply(h,S);return p===!1&&(p=d.apply(h,S)),p}}o.tokenizer=h}if(a.hooks){let h=this.defaults.hooks||new Dl;for(let g in a.hooks){if(!(g in h))throw new Error(`hook '${g}' does not exist`);if(["options","block"].includes(g))continue;let c=g,u=a.hooks[c],d=h[c];Dl.passThroughHooks.has(g)?h[c]=S=>{if(this.defaults.async&&Dl.passThroughHooksRespectAsync.has(g))return(async()=>{let C=await u.call(h,S);return d.call(h,C)})();let p=u.call(h,S);return d.call(h,p)}:h[c]=(...S)=>{if(this.defaults.async)return(async()=>{let C=await u.apply(h,S);return C===!1&&(C=await d.apply(h,S)),C})();let p=u.apply(h,S);return p===!1&&(p=d.apply(h,S)),p}}o.hooks=h}if(a.walkTokens){let h=this.defaults.walkTokens,g=a.walkTokens;o.walkTokens=function(c){let u=[];return u.push(g.call(this,c)),h&&(u=u.concat(h.call(this,c))),u}}this.defaults={...this.defaults,...o}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,r){return Fi.lex(n,r??this.defaults)}parser(n,r){return qi.parse(n,r??this.defaults)}parseMarkdown(n){return(r,a)=>{let o={...a},h={...this.defaults,...o},g=this.onError(!!h.silent,!!h.async);if(this.defaults.async===!0&&o.async===!1)return g(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 g(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return g(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(h.hooks&&(h.hooks.options=h,h.hooks.block=n),h.async)return(async()=>{let c=h.hooks?await h.hooks.preprocess(r):r,u=await(h.hooks?await h.hooks.provideLexer():n?Fi.lex:Fi.lexInline)(c,h),d=h.hooks?await h.hooks.processAllTokens(u):u;h.walkTokens&&await Promise.all(this.walkTokens(d,h.walkTokens));let S=await(h.hooks?await h.hooks.provideParser():n?qi.parse:qi.parseInline)(d,h);return h.hooks?await h.hooks.postprocess(S):S})().catch(g);try{h.hooks&&(r=h.hooks.preprocess(r));let c=(h.hooks?h.hooks.provideLexer():n?Fi.lex:Fi.lexInline)(r,h);h.hooks&&(c=h.hooks.processAllTokens(c)),h.walkTokens&&this.walkTokens(c,h.walkTokens);let u=(h.hooks?h.hooks.provideParser():n?qi.parse:qi.parseInline)(c,h);return h.hooks&&(u=h.hooks.postprocess(u)),u}catch(c){return g(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>"+nr(a.message+"",!0)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(a);throw a}}},ca=new XC;function St(e,n){return ca.parse(e,n)}St.options=St.setOptions=function(e){return ca.setOptions(e),St.defaults=ca.defaults,zC(St.defaults),St};St.getDefaults=wg;St.defaults=ha;St.use=function(...e){return ca.use(...e),St.defaults=ca.defaults,zC(St.defaults),St};St.walkTokens=function(e,n){return ca.walkTokens(e,n)};St.parseInline=ca.parseInline;St.Parser=qi;St.parser=qi.parse;St.Renderer=uh;St.TextRenderer=Lg;St.Lexer=Fi;St.lexer=Fi.lex;St.Tokenizer=ch;St.Hooks=Dl;St.parse=St;St.options;St.setOptions;St.use;St.walkTokens;St.parseInline;qi.parse;Fi.lex;const{entries:ZC,setPrototypeOf:N1,isFrozen:D6,getPrototypeOf:O6,getOwnPropertyDescriptor:N6}=Object;let{freeze:Hn,seal:Oi,create:Ja}=Object,{apply:gm,construct:_m}=typeof Reflect<"u"&&Reflect;Hn||(Hn=function(n){return n});Oi||(Oi=function(n){return n});gm||(gm=function(n,r){for(var a=arguments.length,o=new Array(a>2?a-2:0),h=2;h<a;h++)o[h-2]=arguments[h];return n.apply(r,o)});_m||(_m=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 Cl=fn(Array.prototype.forEach),I6=fn(Array.prototype.lastIndexOf),I1=fn(Array.prototype.pop),xl=fn(Array.prototype.push),B6=fn(Array.prototype.splice),Pn=Array.isArray,Ol=fn(String.prototype.toLowerCase),rp=fn(String.prototype.toString),B1=fn(String.prototype.match),Ya=fn(String.prototype.replace),j1=fn(String.prototype.indexOf),j6=fn(String.prototype.trim),P6=fn(Number.prototype.toString),z6=fn(Boolean.prototype.toString),P1=typeof BigInt>"u"?null:fn(BigInt.prototype.toString),z1=typeof Symbol>"u"?null:fn(Symbol.prototype.toString),Gt=fn(Object.prototype.hasOwnProperty),El=fn(Object.prototype.toString),Ln=fn(RegExp.prototype.test),wu=$6(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 gm(e,n,a)}}function $6(e){return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return _m(e,r)}}function Ye(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ol;if(N1&&N1(e,null),!Pn(n))return e;let a=n.length;for(;a--;){let o=n[a];if(typeof o=="string"){const h=r(o);h!==o&&(D6(n)||(n[a]=h),o=h)}e[o]=!0}return e}function H6(e){for(let n=0;n<e.length;n++)Gt(e,n)||(e[n]=null);return e}function ei(e){const n=Ja(null);for(const[r,a]of ZC(e))Gt(e,r)&&(Pn(a)?n[r]=H6(a):a&&typeof a=="object"&&a.constructor===Object?n[r]=ei(a):n[r]=a);return n}function U6(e){switch(typeof e){case"string":return e;case"number":return P6(e);case"boolean":return z6(e);case"bigint":return P1?P1(e):"0";case"symbol":return z1?z1(e):"Symbol()";case"undefined":return El(e);case"function":case"object":{if(e===null)return El(e);const n=e,r=Qa(n,"toString");if(typeof r=="function"){const a=r(n);return typeof a=="string"?a:El(a)}return El(e)}default:return El(e)}}function Qa(e,n){for(;e!==null;){const a=N6(e,n);if(a){if(a.get)return fn(a.get);if(typeof a.value=="function")return fn(a.value)}e=O6(e)}function r(){return null}return r}function F6(e){try{return Ln(e,""),!0}catch{return!1}}const $1=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"]),sp=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"]),ap=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"]),q6=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"]),op=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"]),W6=Hn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),H1=Hn(["#text"]),U1=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"]),lp=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"]),F1=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"]),Cu=Hn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),G6=Oi(/\{\{[\w\W]*|[\w\W]*\}\}/gm),K6=Oi(/<%[\w\W]*|[\w\W]*%>/gm),V6=Oi(/\$\{[\w\W]*/gm),Y6=Oi(/^data-[\-\w.\u00B7-\uFFFF]+$/),X6=Oi(/^aria-[\-\w]+$/),JC=Oi(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Z6=Oi(/^(?:\w+script|data):/i),J6=Oi(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),QC=Oi(/^html$/i),Q6=Oi(/^[a-z][.\w]*(-[.\w]+)+$/i);var q1=Object.freeze({__proto__:null,ARIA_ATTR:X6,ATTR_WHITESPACE:J6,CUSTOM_ELEMENT:Q6,DATA_ATTR:Y6,DOCTYPE_NAME:QC,ERB_EXPR:K6,IS_ALLOWED_URI:JC,IS_SCRIPT_OR_DATA:Z6,MUSTACHE_EXPR:G6,TMPLIT_EXPR:V6});const Tl={element:1,text:3,progressingInstruction:7,comment:8,document:9},e4=function(){return typeof window>"u"?null:window},t4=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 h="dompurify"+(a?"#"+a:"");try{return n.createPolicy(h,{createHTML(g){return g},createScriptURL(g){return g}})}catch{return console.warn("TrustedTypes policy "+h+" could not be created."),null}},W1=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function ex(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e4();const n=De=>ex(De);if(n.version="3.4.2",n.removed=[],!e||!e.document||e.document.nodeType!==Tl.document||!e.Element)return n.isSupported=!1,n;let{document:r}=e;const a=r,o=a.currentScript,{DocumentFragment:h,HTMLTemplateElement:g,Node:c,Element:u,NodeFilter:d,NamedNodeMap:S=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:p,DOMParser:C,trustedTypes:x}=e,A=u.prototype,E=Qa(A,"cloneNode"),m=Qa(A,"remove"),y=Qa(A,"nextSibling"),f=Qa(A,"childNodes"),b=Qa(A,"parentNode");if(typeof g=="function"){const De=r.createElement("template");De.content&&De.content.ownerDocument&&(r=De.content.ownerDocument)}let T,L="";const{implementation:R,createNodeIterator:M,createDocumentFragment:k,getElementsByTagName:I}=r,{importNode:G}=a;let q=W1();n.isSupported=typeof ZC=="function"&&typeof b=="function"&&R&&R.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:W,ERB_EXPR:j,TMPLIT_EXPR:V,DATA_ATTR:U,ARIA_ATTR:F,IS_SCRIPT_OR_DATA:K,ATTR_WHITESPACE:X,CUSTOM_ELEMENT:D}=q1;let{IS_ALLOWED_URI:B}=q1,N=null;const H=Ye({},[...$1,...sp,...ap,...op,...H1]);let Q=null;const le=Ye({},[...U1,...lp,...F1,...Cu]);let ee=Object.seal(Ja(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}})),ce=null,Y=null;const P=Object.seal(Ja(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let re=!0,fe=!0,Se=!1,ye=!0,Pe=!1,We=!0,Ze=!1,xt=!1,Ne=!1,en=!1,Sn=!1,wn=!1,_i=!0,Bi=!1;const tn="user-content-";let ht=!0,Vt=!1,Pt={},zt=null;const nn=Ye({},["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 ji=null;const Dn=Ye({},["audio","video","img","source","image","track"]);let ri=null;const ft=Ye({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Fn="http://www.w3.org/1998/Math/MathML",Yt="http://www.w3.org/2000/svg",Xt="http://www.w3.org/1999/xhtml";let $t=Xt,Rs=!1,cr=null;const da=Ye({},[Fn,Yt,Xt],rp);let Pi=Ye({},["mi","mo","mn","ms","mtext"]),Yi=Ye({},["annotation-xml"]);const ur=Ye({},["title","style","font","a","script"]);let rn=null;const te=["application/xhtml+xml","text/html"],de="text/html";let be=null,Be=null;const wt=r.createElement("form"),pt=function(Z){return Z instanceof RegExp||Z instanceof Function},Te=function(){let Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Be&&Be===Z)return;(!Z||typeof Z!="object")&&(Z={}),Z=ei(Z),rn=te.indexOf(Z.PARSER_MEDIA_TYPE)===-1?de:Z.PARSER_MEDIA_TYPE,be=rn==="application/xhtml+xml"?rp:Ol,N=Gt(Z,"ALLOWED_TAGS")&&Pn(Z.ALLOWED_TAGS)?Ye({},Z.ALLOWED_TAGS,be):H,Q=Gt(Z,"ALLOWED_ATTR")&&Pn(Z.ALLOWED_ATTR)?Ye({},Z.ALLOWED_ATTR,be):le,cr=Gt(Z,"ALLOWED_NAMESPACES")&&Pn(Z.ALLOWED_NAMESPACES)?Ye({},Z.ALLOWED_NAMESPACES,rp):da,ri=Gt(Z,"ADD_URI_SAFE_ATTR")&&Pn(Z.ADD_URI_SAFE_ATTR)?Ye(ei(ft),Z.ADD_URI_SAFE_ATTR,be):ft,ji=Gt(Z,"ADD_DATA_URI_TAGS")&&Pn(Z.ADD_DATA_URI_TAGS)?Ye(ei(Dn),Z.ADD_DATA_URI_TAGS,be):Dn,zt=Gt(Z,"FORBID_CONTENTS")&&Pn(Z.FORBID_CONTENTS)?Ye({},Z.FORBID_CONTENTS,be):nn,ce=Gt(Z,"FORBID_TAGS")&&Pn(Z.FORBID_TAGS)?Ye({},Z.FORBID_TAGS,be):ei({}),Y=Gt(Z,"FORBID_ATTR")&&Pn(Z.FORBID_ATTR)?Ye({},Z.FORBID_ATTR,be):ei({}),Pt=Gt(Z,"USE_PROFILES")?Z.USE_PROFILES&&typeof Z.USE_PROFILES=="object"?ei(Z.USE_PROFILES):Z.USE_PROFILES:!1,re=Z.ALLOW_ARIA_ATTR!==!1,fe=Z.ALLOW_DATA_ATTR!==!1,Se=Z.ALLOW_UNKNOWN_PROTOCOLS||!1,ye=Z.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Pe=Z.SAFE_FOR_TEMPLATES||!1,We=Z.SAFE_FOR_XML!==!1,Ze=Z.WHOLE_DOCUMENT||!1,en=Z.RETURN_DOM||!1,Sn=Z.RETURN_DOM_FRAGMENT||!1,wn=Z.RETURN_TRUSTED_TYPE||!1,Ne=Z.FORCE_BODY||!1,_i=Z.SANITIZE_DOM!==!1,Bi=Z.SANITIZE_NAMED_PROPS||!1,ht=Z.KEEP_CONTENT!==!1,Vt=Z.IN_PLACE||!1,B=F6(Z.ALLOWED_URI_REGEXP)?Z.ALLOWED_URI_REGEXP:JC,$t=typeof Z.NAMESPACE=="string"?Z.NAMESPACE:Xt,Pi=Gt(Z,"MATHML_TEXT_INTEGRATION_POINTS")&&Z.MATHML_TEXT_INTEGRATION_POINTS&&typeof Z.MATHML_TEXT_INTEGRATION_POINTS=="object"?ei(Z.MATHML_TEXT_INTEGRATION_POINTS):Ye({},["mi","mo","mn","ms","mtext"]),Yi=Gt(Z,"HTML_INTEGRATION_POINTS")&&Z.HTML_INTEGRATION_POINTS&&typeof Z.HTML_INTEGRATION_POINTS=="object"?ei(Z.HTML_INTEGRATION_POINTS):Ye({},["annotation-xml"]);const ge=Gt(Z,"CUSTOM_ELEMENT_HANDLING")&&Z.CUSTOM_ELEMENT_HANDLING&&typeof Z.CUSTOM_ELEMENT_HANDLING=="object"?ei(Z.CUSTOM_ELEMENT_HANDLING):Ja(null);if(ee=Ja(null),Gt(ge,"tagNameCheck")&&pt(ge.tagNameCheck)&&(ee.tagNameCheck=ge.tagNameCheck),Gt(ge,"attributeNameCheck")&&pt(ge.attributeNameCheck)&&(ee.attributeNameCheck=ge.attributeNameCheck),Gt(ge,"allowCustomizedBuiltInElements")&&typeof ge.allowCustomizedBuiltInElements=="boolean"&&(ee.allowCustomizedBuiltInElements=ge.allowCustomizedBuiltInElements),Pe&&(fe=!1),Sn&&(en=!0),Pt&&(N=Ye({},H1),Q=Ja(null),Pt.html===!0&&(Ye(N,$1),Ye(Q,U1)),Pt.svg===!0&&(Ye(N,sp),Ye(Q,lp),Ye(Q,Cu)),Pt.svgFilters===!0&&(Ye(N,ap),Ye(Q,lp),Ye(Q,Cu)),Pt.mathMl===!0&&(Ye(N,op),Ye(Q,F1),Ye(Q,Cu))),P.tagCheck=null,P.attributeCheck=null,Gt(Z,"ADD_TAGS")&&(typeof Z.ADD_TAGS=="function"?P.tagCheck=Z.ADD_TAGS:Pn(Z.ADD_TAGS)&&(N===H&&(N=ei(N)),Ye(N,Z.ADD_TAGS,be))),Gt(Z,"ADD_ATTR")&&(typeof Z.ADD_ATTR=="function"?P.attributeCheck=Z.ADD_ATTR:Pn(Z.ADD_ATTR)&&(Q===le&&(Q=ei(Q)),Ye(Q,Z.ADD_ATTR,be))),Gt(Z,"ADD_URI_SAFE_ATTR")&&Pn(Z.ADD_URI_SAFE_ATTR)&&Ye(ri,Z.ADD_URI_SAFE_ATTR,be),Gt(Z,"FORBID_CONTENTS")&&Pn(Z.FORBID_CONTENTS)&&(zt===nn&&(zt=ei(zt)),Ye(zt,Z.FORBID_CONTENTS,be)),Gt(Z,"ADD_FORBID_CONTENTS")&&Pn(Z.ADD_FORBID_CONTENTS)&&(zt===nn&&(zt=ei(zt)),Ye(zt,Z.ADD_FORBID_CONTENTS,be)),ht&&(N["#text"]=!0),Ze&&Ye(N,["html","head","body"]),N.table&&(Ye(N,["tbody"]),delete ce.tbody),Z.TRUSTED_TYPES_POLICY){if(typeof Z.TRUSTED_TYPES_POLICY.createHTML!="function")throw wu('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Z.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw wu('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=Z.TRUSTED_TYPES_POLICY,L=T.createHTML("")}else T===void 0&&(T=t4(x,o)),T!==null&&typeof L=="string"&&(L=T.createHTML(""));Hn&&Hn(Z),Be=Z},Ce=Ye({},[...sp,...ap,...q6]),ze=Ye({},[...op,...W6]),Bt=function(Z){let ge=b(Z);(!ge||!ge.tagName)&&(ge={namespaceURI:$t,tagName:"template"});const xe=Ol(Z.tagName),st=Ol(ge.tagName);return cr[Z.namespaceURI]?Z.namespaceURI===Yt?ge.namespaceURI===Xt?xe==="svg":ge.namespaceURI===Fn?xe==="svg"&&(st==="annotation-xml"||Pi[st]):!!Ce[xe]:Z.namespaceURI===Fn?ge.namespaceURI===Xt?xe==="math":ge.namespaceURI===Yt?xe==="math"&&Yi[st]:!!ze[xe]:Z.namespaceURI===Xt?ge.namespaceURI===Yt&&!Yi[st]||ge.namespaceURI===Fn&&!Pi[st]?!1:!ze[xe]&&(ur[xe]||!Ce[xe]):!!(rn==="application/xhtml+xml"&&cr[Z.namespaceURI]):!1},tt=function(Z){xl(n.removed,{element:Z});try{b(Z).removeChild(Z)}catch{m(Z)}},Cn=function(Z,ge){try{xl(n.removed,{attribute:ge.getAttributeNode(Z),from:ge})}catch{xl(n.removed,{attribute:null,from:ge})}if(ge.removeAttribute(Z),Z==="is")if(en||Sn)try{tt(ge)}catch{}else try{ge.setAttribute(Z,"")}catch{}},hr=function(Z){let ge=null,xe=null;if(Ne)Z="<remove></remove>"+Z;else{const kt=B1(Z,/^[\r\n\t ]+/);xe=kt&&kt[0]}rn==="application/xhtml+xml"&&$t===Xt&&(Z='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Z+"</body></html>");const st=T?T.createHTML(Z):Z;if($t===Xt)try{ge=new C().parseFromString(st,rn)}catch{}if(!ge||!ge.documentElement){ge=R.createDocument($t,"template",null);try{ge.documentElement.innerHTML=Rs?L:st}catch{}}const Je=ge.body||ge.documentElement;return Z&&xe&&Je.insertBefore(r.createTextNode(xe),Je.childNodes[0]||null),$t===Xt?I.call(ge,Ze?"html":"body")[0]:Ze?ge.documentElement:Je},dr=function(Z){return M.call(Z.ownerDocument||Z,Z,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},qn=function(Z){return Z instanceof p&&(typeof Z.nodeName!="string"||typeof Z.textContent!="string"||typeof Z.removeChild!="function"||!(Z.attributes instanceof S)||typeof Z.removeAttribute!="function"||typeof Z.setAttribute!="function"||typeof Z.namespaceURI!="string"||typeof Z.insertBefore!="function"||typeof Z.hasChildNodes!="function")},At=function(Z){return typeof c=="function"&&Z instanceof c};function Et(De,Z,ge){Cl(De,xe=>{xe.call(n,Z,ge,Be)})}const zi=function(Z){let ge=null;if(Et(q.beforeSanitizeElements,Z,null),qn(Z))return tt(Z),!0;const xe=be(Z.nodeName);if(Et(q.uponSanitizeElement,Z,{tagName:xe,allowedTags:N}),We&&Z.hasChildNodes()&&!At(Z.firstElementChild)&&Ln(/<[/\w!]/g,Z.innerHTML)&&Ln(/<[/\w!]/g,Z.textContent)||We&&Z.namespaceURI===Xt&&xe==="style"&&At(Z.firstElementChild)||Z.nodeType===Tl.progressingInstruction||We&&Z.nodeType===Tl.comment&&Ln(/<[/\w]/g,Z.data))return tt(Z),!0;if(ce[xe]||!(P.tagCheck instanceof Function&&P.tagCheck(xe))&&!N[xe]){if(!ce[xe]&&fr(xe)&&(ee.tagNameCheck instanceof RegExp&&Ln(ee.tagNameCheck,xe)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(xe)))return!1;if(ht&&!zt[xe]){const st=b(Z)||Z.parentNode,Je=f(Z)||Z.childNodes;if(Je&&st){const kt=Je.length;for(let Ht=kt-1;Ht>=0;--Ht){const Ut=E(Je[Ht],!0);st.insertBefore(Ut,y(Z))}}}return tt(Z),!0}return Z instanceof u&&!Bt(Z)||(xe==="noscript"||xe==="noembed"||xe==="noframes")&&Ln(/<\/no(script|embed|frames)/i,Z.innerHTML)?(tt(Z),!0):(Pe&&Z.nodeType===Tl.text&&(ge=Z.textContent,Cl([W,j,V],st=>{ge=Ya(ge,st," ")}),Z.textContent!==ge&&(xl(n.removed,{element:Z.cloneNode()}),Z.textContent=ge)),Et(q.afterSanitizeElements,Z,null),!1)},Fr=function(Z,ge,xe){if(Y[ge]||_i&&(ge==="id"||ge==="name")&&(xe in r||xe in wt))return!1;const st=Q[ge]||P.attributeCheck instanceof Function&&P.attributeCheck(ge,Z);if(!(fe&&!Y[ge]&&Ln(U,ge))){if(!(re&&Ln(F,ge))){if(!st||Y[ge]){if(!(fr(Z)&&(ee.tagNameCheck instanceof RegExp&&Ln(ee.tagNameCheck,Z)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(Z))&&(ee.attributeNameCheck instanceof RegExp&&Ln(ee.attributeNameCheck,ge)||ee.attributeNameCheck instanceof Function&&ee.attributeNameCheck(ge,Z))||ge==="is"&&ee.allowCustomizedBuiltInElements&&(ee.tagNameCheck instanceof RegExp&&Ln(ee.tagNameCheck,xe)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(xe))))return!1}else if(!ri[ge]){if(!Ln(B,Ya(xe,X,""))){if(!((ge==="src"||ge==="xlink:href"||ge==="href")&&Z!=="script"&&j1(xe,"data:")===0&&ji[Z])){if(!(Se&&!Ln(K,Ya(xe,X,"")))){if(xe)return!1}}}}}}return!0},fa=Ye({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),fr=function(Z){return!fa[Ol(Z)]&&Ln(D,Z)},Ls=function(Z){Et(q.beforeSanitizeAttributes,Z,null);const{attributes:ge}=Z;if(!ge||qn(Z))return;const xe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Q,forceKeepAttr:void 0};let st=ge.length;for(;st--;){const Je=ge[st],{name:kt,namespaceURI:Ht,value:Ut}=Je,_e=be(kt),Me=Ut;let Oe=kt==="value"?Me:j6(Me);if(xe.attrName=_e,xe.attrValue=Oe,xe.keepAttr=!0,xe.forceKeepAttr=void 0,Et(q.uponSanitizeAttribute,Z,xe),Oe=xe.attrValue,Bi&&(_e==="id"||_e==="name")&&j1(Oe,tn)!==0&&(Cn(kt,Z),Oe=tn+Oe),We&&Ln(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Oe)){Cn(kt,Z);continue}if(_e==="attributename"&&B1(Oe,"href")){Cn(kt,Z);continue}if(xe.forceKeepAttr)continue;if(!xe.keepAttr){Cn(kt,Z);continue}if(!ye&&Ln(/\/>/i,Oe)){Cn(kt,Z);continue}Pe&&Cl([W,j,V],Ot=>{Oe=Ya(Oe,Ot," ")});const ot=be(Z.nodeName);if(!Fr(ot,_e,Oe)){Cn(kt,Z);continue}if(T&&typeof x=="object"&&typeof x.getAttributeType=="function"&&!Ht)switch(x.getAttributeType(ot,_e)){case"TrustedHTML":{Oe=T.createHTML(Oe);break}case"TrustedScriptURL":{Oe=T.createScriptURL(Oe);break}}if(Oe!==Me)try{Ht?Z.setAttributeNS(Ht,kt,Oe):Z.setAttribute(kt,Oe),qn(Z)?tt(Z):I1(n.removed)}catch{Cn(kt,Z)}}Et(q.afterSanitizeAttributes,Z,null)},Xi=function(Z){let ge=null;const xe=dr(Z);for(Et(q.beforeSanitizeShadowDOM,Z,null);ge=xe.nextNode();)Et(q.uponSanitizeShadowNode,ge,null),zi(ge),Ls(ge),ge.content instanceof h&&Xi(ge.content);Et(q.afterSanitizeShadowDOM,Z,null)};return n.sanitize=function(De){let Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ge=null,xe=null,st=null,Je=null;if(Rs=!De,Rs&&(De="<!-->"),typeof De!="string"&&!At(De)&&(De=U6(De),typeof De!="string"))throw wu("dirty is not a string, aborting");if(!n.isSupported)return De;if(xt||Te(Z),n.removed=[],typeof De=="string"&&(Vt=!1),Vt){const Ut=De.nodeName;if(typeof Ut=="string"){const _e=be(Ut);if(!N[_e]||ce[_e])throw wu("root node is forbidden and cannot be sanitized in-place")}}else if(De instanceof c)ge=hr("<!---->"),xe=ge.ownerDocument.importNode(De,!0),xe.nodeType===Tl.element&&xe.nodeName==="BODY"||xe.nodeName==="HTML"?ge=xe:ge.appendChild(xe);else{if(!en&&!Pe&&!Ze&&De.indexOf("<")===-1)return T&&wn?T.createHTML(De):De;if(ge=hr(De),!ge)return en?null:wn?L:""}ge&&Ne&&tt(ge.firstChild);const kt=dr(Vt?De:ge);for(;st=kt.nextNode();)zi(st),Ls(st),st.content instanceof h&&Xi(st.content);if(Vt)return De;if(en){if(Pe){ge.normalize();let Ut=ge.innerHTML;Cl([W,j,V],_e=>{Ut=Ya(Ut,_e," ")}),ge.innerHTML=Ut}if(Sn)for(Je=k.call(ge.ownerDocument);ge.firstChild;)Je.appendChild(ge.firstChild);else Je=ge;return(Q.shadowroot||Q.shadowrootmode)&&(Je=G.call(a,Je,!0)),Je}let Ht=Ze?ge.outerHTML:ge.innerHTML;return Ze&&N["!doctype"]&&ge.ownerDocument&&ge.ownerDocument.doctype&&ge.ownerDocument.doctype.name&&Ln(QC,ge.ownerDocument.doctype.name)&&(Ht="<!DOCTYPE "+ge.ownerDocument.doctype.name+`>
127
- `+Ht),Pe&&Cl([W,j,V],Ut=>{Ht=Ya(Ht,Ut," ")}),T&&wn?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(){Be=null,xt=!1},n.isValidAttribute=function(De,Z,ge){Be||Te({});const xe=be(De),st=be(Z);return Fr(xe,st,ge)},n.addHook=function(De,Z){typeof Z=="function"&&xl(q[De],Z)},n.removeHook=function(De,Z){if(Z!==void 0){const ge=I6(q[De],Z);return ge===-1?void 0:B6(q[De],ge,1)[0]}return I1(q[De])},n.removeHooks=function(De){q[De]=[]},n.removeAllHooks=function(){q=W1()},n}var $l=ex(),cp,G1;function n4(){if(G1)return cp;G1=1;function e(te){return te instanceof Map?te.clear=te.delete=te.set=function(){throw new Error("map is read-only")}:te instanceof Set&&(te.add=te.clear=te.delete=function(){throw new Error("set is read-only")}),Object.freeze(te),Object.getOwnPropertyNames(te).forEach(de=>{const be=te[de],Be=typeof be;(Be==="object"||Be==="function")&&!Object.isFrozen(be)&&e(be)}),te}class n{constructor(de){de.data===void 0&&(de.data={}),this.data=de.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(te){return te.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function a(te,...de){const be=Object.create(null);for(const Be in te)be[Be]=te[Be];return de.forEach(function(Be){for(const wt in Be)be[wt]=Be[wt]}),be}const o="</span>",h=te=>!!te.scope,g=(te,{prefix:de})=>{if(te.startsWith("language:"))return te.replace("language:","language-");if(te.includes(".")){const be=te.split(".");return[`${de}${be.shift()}`,...be.map((Be,wt)=>`${Be}${"_".repeat(wt+1)}`)].join(" ")}return`${de}${te}`};class c{constructor(de,be){this.buffer="",this.classPrefix=be.classPrefix,de.walk(this)}addText(de){this.buffer+=r(de)}openNode(de){if(!h(de))return;const be=g(de.scope,{prefix:this.classPrefix});this.span(be)}closeNode(de){h(de)&&(this.buffer+=o)}value(){return this.buffer}span(de){this.buffer+=`<span class="${de}">`}}const u=(te={})=>{const de={children:[]};return Object.assign(de,te),de};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(de){this.top.children.push(de)}openNode(de){const be=u({scope:de});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(de){return this.constructor._walk(de,this.rootNode)}static _walk(de,be){return typeof be=="string"?de.addText(be):be.children&&(de.openNode(be),be.children.forEach(Be=>this._walk(de,Be)),de.closeNode(be)),de}static _collapse(de){typeof de!="string"&&de.children&&(de.children.every(be=>typeof be=="string")?de.children=[de.children.join("")]:de.children.forEach(be=>{d._collapse(be)}))}}class S extends d{constructor(de){super(),this.options=de}addText(de){de!==""&&this.add(de)}startScope(de){this.openNode(de)}endScope(){this.closeNode()}__addSublanguage(de,be){const Be=de.root;be&&(Be.scope=`language:${be}`),this.add(Be)}toHTML(){return new c(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p(te){return te?typeof te=="string"?te:te.source:null}function C(te){return E("(?=",te,")")}function x(te){return E("(?:",te,")*")}function A(te){return E("(?:",te,")?")}function E(...te){return te.map(be=>p(be)).join("")}function m(te){const de=te[te.length-1];return typeof de=="object"&&de.constructor===Object?(te.splice(te.length-1,1),de):{}}function y(...te){return"("+(m(te).capture?"":"?:")+te.map(Be=>p(Be)).join("|")+")"}function f(te){return new RegExp(te.toString()+"|").exec("").length-1}function b(te,de){const be=te&&te.exec(de);return be&&be.index===0}const T=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function L(te,{joinWith:de}){let be=0;return te.map(Be=>{be+=1;const wt=be;let pt=p(Be),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(Be=>`(${Be})`).join(de)}const R=/\b\B/,M="[a-zA-Z]\\w*",k="[a-zA-Z_]\\w*",I="\\b\\d+(\\.\\d+)?",G="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",q="\\b(0b[01]+)",W="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",j=(te={})=>{const de=/^#![ ]*\//;return te.binary&&(te.begin=E(de,/.*\b/,te.binary,/\b.*/)),a({scope:"meta",begin:de,end:/$/,relevance:0,"on:begin":(be,Be)=>{be.index!==0&&Be.ignoreMatch()}},te)},V={begin:"\\\\[\\s\\S]",relevance:0},U={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[V]},F={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[V]},K={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/},X=function(te,de,be={}){const Be=a({scope:"comment",begin:te,end:de,contains:[]},be);Be.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=y("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 Be.contains.push({begin:E(/[ ]+/,"(",wt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Be},D=X("//","$"),B=X("/\\*","\\*/"),N=X("#","$"),H={scope:"number",begin:I,relevance:0},Q={scope:"number",begin:G,relevance:0},le={scope:"number",begin:q,relevance:0},ee={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[V,{begin:/\[/,end:/\]/,relevance:0,contains:[V]}]},ce={scope:"title",begin:M,relevance:0},Y={scope:"title",begin:k,relevance:0},P={begin:"\\.\\s*"+k,relevance:0};var fe=Object.freeze({__proto__:null,APOS_STRING_MODE:U,BACKSLASH_ESCAPE:V,BINARY_NUMBER_MODE:le,BINARY_NUMBER_RE:q,COMMENT:X,C_BLOCK_COMMENT_MODE:B,C_LINE_COMMENT_MODE:D,C_NUMBER_MODE:Q,C_NUMBER_RE:G,END_SAME_AS_BEGIN:function(te){return Object.assign(te,{"on:begin":(de,be)=>{be.data._beginMatch=de[1]},"on:end":(de,be)=>{be.data._beginMatch!==de[1]&&be.ignoreMatch()}})},HASH_COMMENT_MODE:N,IDENT_RE:M,MATCH_NOTHING_RE:R,METHOD_GUARD:P,NUMBER_MODE:H,NUMBER_RE:I,PHRASAL_WORDS_MODE:K,QUOTE_STRING_MODE:F,REGEXP_MODE:ee,RE_STARTERS_RE:W,SHEBANG:j,TITLE_MODE:ce,UNDERSCORE_IDENT_RE:k,UNDERSCORE_TITLE_MODE:Y});function Se(te,de){te.input[te.index-1]==="."&&de.ignoreMatch()}function ye(te,de){te.className!==void 0&&(te.scope=te.className,delete te.className)}function Pe(te,de){de&&te.beginKeywords&&(te.begin="\\b("+te.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",te.__beforeBegin=Se,te.keywords=te.keywords||te.beginKeywords,delete te.beginKeywords,te.relevance===void 0&&(te.relevance=0))}function We(te,de){Array.isArray(te.illegal)&&(te.illegal=y(...te.illegal))}function Ze(te,de){if(te.match){if(te.begin||te.end)throw new Error("begin & end are not supported with match");te.begin=te.match,delete te.match}}function xt(te,de){te.relevance===void 0&&(te.relevance=1)}const Ne=(te,de)=>{if(!te.beforeMatch)return;if(te.starts)throw new Error("beforeMatch cannot be used with starts");const be=Object.assign({},te);Object.keys(te).forEach(Be=>{delete te[Be]}),te.keywords=be.keywords,te.begin=E(be.beforeMatch,C(be.begin)),te.starts={relevance:0,contains:[Object.assign(be,{endsParent:!0})]},te.relevance=0,delete be.beforeMatch},en=["of","and","for","in","not","or","if","then","parent","list","value"],Sn="keyword";function wn(te,de,be=Sn){const Be=Object.create(null);return typeof te=="string"?wt(be,te.split(" ")):Array.isArray(te)?wt(be,te):Object.keys(te).forEach(function(pt){Object.assign(Be,wn(te[pt],de,pt))}),Be;function wt(pt,Te){de&&(Te=Te.map(Ce=>Ce.toLowerCase())),Te.forEach(function(Ce){const ze=Ce.split("|");Be[ze[0]]=[pt,_i(ze[0],ze[1])]})}}function _i(te,de){return de?Number(de):Bi(te)?0:1}function Bi(te){return en.includes(te.toLowerCase())}const tn={},ht=te=>{console.error(te)},Vt=(te,...de)=>{console.log(`WARN: ${te}`,...de)},Pt=(te,de)=>{tn[`${te}/${de}`]||(console.log(`Deprecated as of ${te}. ${de}`),tn[`${te}/${de}`]=!0)},zt=new Error;function nn(te,de,{key:be}){let Be=0;const wt=te[be],pt={},Te={};for(let Ce=1;Ce<=de.length;Ce++)Te[Ce+Be]=wt[Ce],pt[Ce+Be]=!0,Be+=f(de[Ce-1]);te[be]=Te,te[be]._emit=pt,te[be]._multi=!0}function ji(te){if(Array.isArray(te.begin)){if(te.skip||te.excludeBegin||te.returnBegin)throw ht("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),zt;if(typeof te.beginScope!="object"||te.beginScope===null)throw ht("beginScope must be object"),zt;nn(te,te.begin,{key:"beginScope"}),te.begin=L(te.begin,{joinWith:""})}}function Dn(te){if(Array.isArray(te.end)){if(te.skip||te.excludeEnd||te.returnEnd)throw ht("skip, excludeEnd, returnEnd not compatible with endScope: {}"),zt;if(typeof te.endScope!="object"||te.endScope===null)throw ht("endScope must be object"),zt;nn(te,te.end,{key:"endScope"}),te.end=L(te.end,{joinWith:""})}}function ri(te){te.scope&&typeof te.scope=="object"&&te.scope!==null&&(te.beginScope=te.scope,delete te.scope)}function ft(te){ri(te),typeof te.beginScope=="string"&&(te.beginScope={_wrap:te.beginScope}),typeof te.endScope=="string"&&(te.endScope={_wrap:te.endScope}),ji(te),Dn(te)}function Fn(te){function de(Te,Ce){return new RegExp(p(Te),"m"+(te.case_insensitive?"i":"")+(te.unicodeRegex?"u":"")+(Ce?"g":""))}class be{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Ce,ze){ze.position=this.position++,this.matchIndexes[this.matchAt]=ze,this.regexes.push([ze,Ce]),this.matchAt+=f(Ce)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Ce=this.regexes.map(ze=>ze[1]);this.matcherRe=de(L(Ce,{joinWith:"|"}),!0),this.lastIndex=0}exec(Ce){this.matcherRe.lastIndex=this.lastIndex;const ze=this.matcherRe.exec(Ce);if(!ze)return null;const Bt=ze.findIndex((Cn,hr)=>hr>0&&Cn!==void 0),tt=this.matchIndexes[Bt];return ze.splice(0,Bt),Object.assign(ze,tt)}}class Be{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 ze=new be;return this.rules.slice(Ce).forEach(([Bt,tt])=>ze.addRule(Bt,tt)),ze.compile(),this.multiRegexes[Ce]=ze,ze}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Ce,ze){this.rules.push([Ce,ze]),ze.type==="begin"&&this.count++}exec(Ce){const ze=this.getMatcher(this.regexIndex);ze.lastIndex=this.lastIndex;let Bt=ze.exec(Ce);if(this.resumingScanAtSamePosition()&&!(Bt&&Bt.index===this.lastIndex)){const tt=this.getMatcher(0);tt.lastIndex=this.lastIndex+1,Bt=tt.exec(Ce)}return Bt&&(this.regexIndex+=Bt.position+1,this.regexIndex===this.count&&this.considerAll()),Bt}}function wt(Te){const Ce=new Be;return Te.contains.forEach(ze=>Ce.addRule(ze.begin,{rule:ze,type:"begin"})),Te.terminatorEnd&&Ce.addRule(Te.terminatorEnd,{type:"end"}),Te.illegal&&Ce.addRule(Te.illegal,{type:"illegal"}),Ce}function pt(Te,Ce){const ze=Te;if(Te.isCompiled)return ze;[ye,Ze,ft,Ne].forEach(tt=>tt(Te,Ce)),te.compilerExtensions.forEach(tt=>tt(Te,Ce)),Te.__beforeBegin=null,[Pe,We,xt].forEach(tt=>tt(Te,Ce)),Te.isCompiled=!0;let Bt=null;return typeof Te.keywords=="object"&&Te.keywords.$pattern&&(Te.keywords=Object.assign({},Te.keywords),Bt=Te.keywords.$pattern,delete Te.keywords.$pattern),Bt=Bt||/\w+/,Te.keywords&&(Te.keywords=wn(Te.keywords,te.case_insensitive)),ze.keywordPatternRe=de(Bt,!0),Ce&&(Te.begin||(Te.begin=/\B|\b/),ze.beginRe=de(ze.begin),!Te.end&&!Te.endsWithParent&&(Te.end=/\B|\b/),Te.end&&(ze.endRe=de(ze.end)),ze.terminatorEnd=p(ze.end)||"",Te.endsWithParent&&Ce.terminatorEnd&&(ze.terminatorEnd+=(Te.end?"|":"")+Ce.terminatorEnd)),Te.illegal&&(ze.illegalRe=de(Te.illegal)),Te.contains||(Te.contains=[]),Te.contains=[].concat(...Te.contains.map(function(tt){return Xt(tt==="self"?Te:tt)})),Te.contains.forEach(function(tt){pt(tt,ze)}),Te.starts&&pt(Te.starts,Ce),ze.matcher=wt(ze),ze}if(te.compilerExtensions||(te.compilerExtensions=[]),te.contains&&te.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return te.classNameAliases=a(te.classNameAliases||{}),pt(te)}function Yt(te){return te?te.endsWithParent||Yt(te.starts):!1}function Xt(te){return te.variants&&!te.cachedVariants&&(te.cachedVariants=te.variants.map(function(de){return a(te,{variants:null},de)})),te.cachedVariants?te.cachedVariants:Yt(te)?a(te,{starts:te.starts?a(te.starts):null}):Object.isFrozen(te)?a(te):te}var $t="11.11.1";class Rs extends Error{constructor(de,be){super(de),this.name="HTMLInjectionError",this.html=be}}const cr=r,da=a,Pi=Symbol("nomatch"),Yi=7,ur=function(te){const de=Object.create(null),be=Object.create(null),Be=[];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 ze(_e){return Ce.noHighlightRe.test(_e)}function Bt(_e){let Me=_e.className+" ";Me+=_e.parentNode?_e.parentNode.className:"";const Oe=Ce.languageDetectRe.exec(Me);if(Oe){const ot=Z(Oe[1]);return ot||(Vt(pt.replace("{}",Oe[1])),Vt("Falling back to no-highlight mode for this block.",_e)),ot?Oe[1]:"no-highlight"}return Me.split(/\s+/).find(ot=>ze(ot)||Z(ot))}function tt(_e,Me,Oe){let ot="",Ot="";typeof Me=="object"?(ot=_e,Oe=Me.ignoreIllegals,Ot=Me.language):(Pt("10.7.0","highlight(lang, code, ...args) has been deprecated."),Pt("10.7.0",`Please use highlight(code, options) instead.
128
- https://github.com/highlightjs/highlight.js/issues/2277`),Ot=_e,ot=Me),Oe===void 0&&(Oe=!0);const On={code:ot,language:Ot};Ht("before:highlight",On);const si=On.result?On.result:Cn(On.language,On.code,Oe);return si.code=On.code,Ht("after:highlight",si),si}function Cn(_e,Me,Oe,ot){const Ot=Object.create(null);function On(we,Re){return we.keywords[Re]}function si(){if(!He.keywords){sn.addText(mt);return}let we=0;He.keywordPatternRe.lastIndex=0;let Re=He.keywordPatternRe.exec(mt),Ge="";for(;Re;){Ge+=mt.substring(we,Re.index);const nt=xn.case_insensitive?Re[0].toLowerCase():Re[0],jt=On(He,nt);if(jt){const[vi,ko]=jt;if(sn.addText(Ge),Ge="",Ot[nt]=(Ot[nt]||0)+1,Ot[nt]<=Yi&&(qr+=ko),vi.startsWith("_"))Ge+=Re[0];else{const oc=xn.classNameAliases[vi]||vi;ai(Re[0],oc)}}else Ge+=Re[0];we=He.keywordPatternRe.lastIndex,Re=He.keywordPatternRe.exec(mt)}Ge+=mt.substring(we),sn.addText(Ge)}function Wn(){if(mt==="")return;let we=null;if(typeof He.subLanguage=="string"){if(!de[He.subLanguage]){sn.addText(mt);return}we=Cn(He.subLanguage,mt,!0,ac[He.subLanguage]),ac[He.subLanguage]=we._top}else we=dr(mt,He.subLanguage.length?He.subLanguage:null);He.relevance>0&&(qr+=we.relevance),sn.__addSublanguage(we._emitter,we.language)}function Tt(){He.subLanguage!=null?Wn():si(),mt=""}function ai(we,Re){we!==""&&(sn.startScope(Re),sn.addText(we),sn.endScope())}function rc(we,Re){let Ge=1;const nt=Re.length-1;for(;Ge<=nt;){if(!we._emit[Ge]){Ge++;continue}const jt=xn.classNameAliases[we[Ge]]||we[Ge],vi=Re[Ge];jt?ai(vi,jt):(mt=vi,si(),mt=""),Ge++}}function pa(we,Re){return we.scope&&typeof we.scope=="string"&&sn.openNode(xn.classNameAliases[we.scope]||we.scope),we.beginScope&&(we.beginScope._wrap?(ai(mt,xn.classNameAliases[we.beginScope._wrap]||we.beginScope._wrap),mt=""):we.beginScope._multi&&(rc(we.beginScope,Re),mt="")),He=Object.create(we,{parent:{value:He}}),He}function Eo(we,Re,Ge){let nt=b(we.endRe,Ge);if(nt){if(we["on:end"]){const jt=new n(we);we["on:end"](Re,jt),jt.isMatchIgnored&&(nt=!1)}if(nt){for(;we.endsParent&&we.parent;)we=we.parent;return we}}if(we.endsWithParent)return Eo(we.parent,Re,Ge)}function ma(we){return He.matcher.regexIndex===0?(mt+=we[0],1):(Wr=!0,0)}function Ih(we){const Re=we[0],Ge=we.rule,nt=new n(Ge),jt=[Ge.__beforeBegin,Ge["on:begin"]];for(const vi of jt)if(vi&&(vi(we,nt),nt.isMatchIgnored))return ma(Re);return Ge.skip?mt+=Re:(Ge.excludeBegin&&(mt+=Re),Tt(),!Ge.returnBegin&&!Ge.excludeBegin&&(mt=Re)),pa(Ge,we),Ge.returnBegin?0:Re.length}function Gn(we){const Re=we[0],Ge=Me.substring(we.index),nt=Eo(He,we,Ge);if(!nt)return Pi;const jt=He;He.endScope&&He.endScope._wrap?(Tt(),ai(Re,He.endScope._wrap)):He.endScope&&He.endScope._multi?(Tt(),rc(He.endScope,we)):jt.skip?mt+=Re:(jt.returnEnd||jt.excludeEnd||(mt+=Re),Tt(),jt.excludeEnd&&(mt=Re));do He.scope&&sn.closeNode(),!He.skip&&!He.subLanguage&&(qr+=He.relevance),He=He.parent;while(He!==nt.parent);return nt.starts&&pa(nt.starts,we),jt.returnEnd?0:Re.length}function To(){const we=[];for(let Re=He;Re!==xn;Re=Re.parent)Re.scope&&we.unshift(Re.scope);we.forEach(Re=>sn.openNode(Re))}let Ms={};function ga(we,Re){const Ge=Re&&Re[0];if(mt+=we,Ge==null)return Tt(),0;if(Ms.type==="begin"&&Re.type==="end"&&Ms.index===Re.index&&Ge===""){if(mt+=Me.slice(Re.index,Re.index+1),!wt){const nt=new Error(`0 width match regex (${_e})`);throw nt.languageName=_e,nt.badRule=Ms.rule,nt}return 1}if(Ms=Re,Re.type==="begin")return Ih(Re);if(Re.type==="illegal"&&!Oe){const nt=new Error('Illegal lexeme "'+Ge+'" for mode "'+(He.scope||"<unnamed>")+'"');throw nt.mode=He,nt}else if(Re.type==="end"){const nt=Gn(Re);if(nt!==Pi)return nt}if(Re.type==="illegal"&&Ge==="")return mt+=`
129
- `,1;if(Ao>1e5&&Ao>Re.index*3)throw new Error("potential infinite loop, way more iterations than matches");return mt+=Ge,Ge.length}const xn=Z(_e);if(!xn)throw ht(pt.replace("{}",_e)),new Error('Unknown language: "'+_e+'"');const sc=Fn(xn);let _a="",He=ot||sc;const ac={},sn=new Ce.__emitter(Ce);To();let mt="",qr=0,pr=0,Ao=0,Wr=!1;try{if(xn.__emitTokens)xn.__emitTokens(Me,sn);else{for(He.matcher.considerAll();;){Ao++,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),Ge=ga(Re,we);pr=we.index+Ge}ga(Me.substring(pr))}return sn.finalize(),_a=sn.toHTML(),{language:_e,value:_a,relevance:qr,illegal:!1,_emitter:sn,_top:He}}catch(we){if(we.message&&we.message.includes("Illegal"))return{language:_e,value:cr(Me),illegal:!0,relevance:0,_illegalBy:{message:we.message,index:pr,context:Me.slice(pr-100,pr+100),mode:we.mode,resultSoFar:_a},_emitter:sn};if(wt)return{language:_e,value:cr(Me),illegal:!1,relevance:0,errorRaised:we,_emitter:sn,_top:He};throw we}}function hr(_e){const Me={value:cr(_e),illegal:!1,relevance:0,_top:Te,_emitter:new Ce.__emitter(Ce)};return Me._emitter.addText(_e),Me}function dr(_e,Me){Me=Me||Ce.languages||Object.keys(de);const Oe=hr(_e),ot=Me.filter(Z).filter(xe).map(Tt=>Cn(Tt,_e,!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(Z(Tt.language).supersetOf===ai.language)return 1;if(Z(ai.language).supersetOf===Tt.language)return-1}return 0}),[On,si]=Ot,Wn=On;return Wn.secondBest=si,Wn}function qn(_e,Me,Oe){const ot=Me&&be[Me]||Oe;_e.classList.add("hljs"),_e.classList.add(`language-${ot}`)}function At(_e){let Me=null;const Oe=Bt(_e);if(ze(Oe))return;if(Ht("before:highlightElement",{el:_e,language:Oe}),_e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",_e);return}if(_e.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(_e)),Ce.throwUnescapedHTML))throw new Rs("One of your code blocks includes unescaped HTML.",_e.innerHTML);Me=_e;const ot=Me.textContent,Ot=Oe?tt(ot,{language:Oe,ignoreIllegals:!0}):dr(ot);_e.innerHTML=Ot.value,_e.dataset.highlighted="yes",qn(_e,Oe,Ot.language),_e.result={language:Ot.language,re:Ot.relevance,relevance:Ot.relevance},Ot.secondBest&&(_e.secondBest={language:Ot.secondBest.language,relevance:Ot.secondBest.relevance}),Ht("after:highlightElement",{el:_e,result:Ot,text:ot})}function Et(_e){Ce=da(Ce,_e)}const zi=()=>{fr(),Pt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Fr(){fr(),Pt("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let fa=!1;function fr(){function _e(){fr()}if(document.readyState==="loading"){fa||window.addEventListener("DOMContentLoaded",_e,!1),fa=!0;return}document.querySelectorAll(Ce.cssSelector).forEach(At)}function Ls(_e,Me){let Oe=null;try{Oe=Me(te)}catch(ot){if(ht("Language definition for '{}' could not be registered.".replace("{}",_e)),wt)ht(ot);else throw ot;Oe=Te}Oe.name||(Oe.name=_e),de[_e]=Oe,Oe.rawDefinition=Me.bind(null,te),Oe.aliases&&ge(Oe.aliases,{languageName:_e})}function Xi(_e){delete de[_e];for(const Me of Object.keys(be))be[Me]===_e&&delete be[Me]}function De(){return Object.keys(de)}function Z(_e){return _e=(_e||"").toLowerCase(),de[_e]||de[be[_e]]}function ge(_e,{languageName:Me}){typeof _e=="string"&&(_e=[_e]),_e.forEach(Oe=>{be[Oe.toLowerCase()]=Me})}function xe(_e){const Me=Z(_e);return Me&&!Me.disableAutodetect}function st(_e){_e["before:highlightBlock"]&&!_e["before:highlightElement"]&&(_e["before:highlightElement"]=Me=>{_e["before:highlightBlock"](Object.assign({block:Me.el},Me))}),_e["after:highlightBlock"]&&!_e["after:highlightElement"]&&(_e["after:highlightElement"]=Me=>{_e["after:highlightBlock"](Object.assign({block:Me.el},Me))})}function Je(_e){st(_e),Be.push(_e)}function kt(_e){const Me=Be.indexOf(_e);Me!==-1&&Be.splice(Me,1)}function Ht(_e,Me){const Oe=_e;Be.forEach(function(ot){ot[Oe]&&ot[Oe](Me)})}function Ut(_e){return Pt("10.7.0","highlightBlock will be removed entirely in v12.0"),Pt("10.7.0","Please use highlightElement now."),At(_e)}Object.assign(te,{highlight:tt,highlightAuto:dr,highlightAll:fr,highlightElement:At,highlightBlock:Ut,configure:Et,initHighlighting:zi,initHighlightingOnLoad:Fr,registerLanguage:Ls,unregisterLanguage:Xi,listLanguages:De,getLanguage:Z,registerAliases:ge,autoDetection:xe,inherit:da,addPlugin:Je,removePlugin:kt}),te.debugMode=function(){wt=!1},te.safeMode=function(){wt=!0},te.versionString=$t,te.regex={concat:E,lookahead:C,either:y,optional:A,anyNumberOfTimes:x};for(const _e in fe)typeof fe[_e]=="object"&&e(fe[_e]);return Object.assign(te,fe),te},rn=ur({});return rn.newInstance=()=>ur({}),cp=rn,rn.HighlightJS=rn,rn.default=rn,cp}var i4=n4();const Ai=c5(i4);function K1(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]},h=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),g={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:/\\'/},p={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,r]},C=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],x=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},E=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],m=["true","false"],y={match:/(\/[a-z._-]+)+/},f=["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"],L=["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:E,literal:m,built_in:[...f,...b,"set","shopt",...T,...L]},contains:[x,e.SHEBANG(),A,p,h,g,y,c,u,d,S,r]}}const V1="[A-Za-z$_][0-9A-Za-z$_]*",r4=["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"],s4=["true","false","null","undefined","NaN","Infinity"],tx=["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"],nx=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ix=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],a4=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],o4=[].concat(ix,tx,nx);function Y1(e){const n=e.regex,r=(X,{after:D})=>{const B="</"+X[0].slice(1);return X.input.indexOf(B,D)!==-1},a=V1,o={begin:"<>",end:"</>"},h=/<[A-Za-z0-9\\._:-]+\s*\/>/,g={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(X,D)=>{const B=X[0].length+X.index,N=X.input[B];if(N==="<"||N===","){D.ignoreMatch();return}N===">"&&(r(X,{after:B})||D.ignoreMatch());let H;const Q=X.input.substring(B);if(H=Q.match(/^\s*=/)){D.ignoreMatch();return}if((H=Q.match(/^\s+extends\s+/))&&H.index===0){D.ignoreMatch();return}}},c={$pattern:V1,keyword:r4,literal:s4,built_in:o4,"variable.language":a4},u="[0-9](_?[0-9])*",d=`\\.(${u})`,S="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={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:[]},x={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"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},m={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,C]},f={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,x,A,E,m,{match:/\$\d+/},p];C.contains=b.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(b)});const T=[].concat(f,C.contains),L=T.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(T)}]),R={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:L},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:{_:[...tx,...nx]}},I={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},G={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},q={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function W(X){return n.concat("(?!",X.join("|"),")")}const j={match:n.concat(/\b/,W([...ix,"super","import"].map(X=>`${X}\\s*\\(`)),a,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},V={begin:n.concat(/\./,n.lookahead(n.concat(a,/(?![0-9A-Za-z$_(])/))),end:a,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},U={match:[/get|set/,/\s+/,a,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},F="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",K={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(F)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[R]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:L,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),I,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,A,E,m,f,{match:/\$\d+/},p,k,{scope:"attr",match:a+n.lookahead(":"),relevance:0},K,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[f,e.REGEXP_MODE,{className:"function",begin:F,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:L}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:h},{begin:g.begin,"on:begin":g.isTrulyOpeningTag,end:g.end}],subLanguage:"xml",contains:[{begin:g.begin,end:g.end,skip:!0,contains:["self"]}]}]},G,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[R,e.inherit(e.TITLE_MODE,{begin:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},V,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},j,q,M,U,{match:/\$[(.]/}]}}function l4(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 X1(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}]},h={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},g={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}]},p=e.inherit(d,{contains:[]}),C=e.inherit(S,{contains:[]});d.contains.push(C),S.contains.push(p);let x=[r,u];return[d,S,p,C].forEach(y=>{y.contains=y.contains.concat(x)}),x=x.concat(d,S),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:x},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:x}]}]},r,h,d,S,{className:"quote",begin:"^>\\s+",contains:x,end:"$"},o,a,u,g,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Z1(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},p={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])*",x=`(\\b(${C}))?\\.(${C})|\\b(${C})\\.`,A=`\\b|${a.join("|")}`,E={className:"number",relevance:0,variants:[{begin:`(\\b(${C})|(${x}))[eE][+-]?(${C})[jJ]?(?=${A})`},{begin:`(${x})[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})`}]},m={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:c,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",u,E,p,e.HASH_COMMENT_MODE]}]};return d.contains=[p,E,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[u,E,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},p,m,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[y]},{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:[E,y,p]}]}}const hh="[A-Za-z$_][0-9A-Za-z$_]*",rx=["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"],sx=["true","false","null","undefined","NaN","Infinity"],ax=["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"],ox=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],lx=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],cx=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ux=[].concat(lx,ax,ox);function c4(e){const n=e.regex,r=(X,{after:D})=>{const B="</"+X[0].slice(1);return X.input.indexOf(B,D)!==-1},a=hh,o={begin:"<>",end:"</>"},h=/<[A-Za-z0-9\\._:-]+\s*\/>/,g={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(X,D)=>{const B=X[0].length+X.index,N=X.input[B];if(N==="<"||N===","){D.ignoreMatch();return}N===">"&&(r(X,{after:B})||D.ignoreMatch());let H;const Q=X.input.substring(B);if(H=Q.match(/^\s*=/)){D.ignoreMatch();return}if((H=Q.match(/^\s+extends\s+/))&&H.index===0){D.ignoreMatch();return}}},c={$pattern:hh,keyword:rx,literal:sx,built_in:ux,"variable.language":cx},u="[0-9](_?[0-9])*",d=`\\.(${u})`,S="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={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:[]},x={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"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},m={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,C]},f={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,x,A,E,m,{match:/\$\d+/},p];C.contains=b.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(b)});const T=[].concat(f,C.contains),L=T.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(T)}]),R={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:L},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:{_:[...ax,...ox]}},I={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},G={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},q={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function W(X){return n.concat("(?!",X.join("|"),")")}const j={match:n.concat(/\b/,W([...lx,"super","import"].map(X=>`${X}\\s*\\(`)),a,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},V={begin:n.concat(/\./,n.lookahead(n.concat(a,/(?![0-9A-Za-z$_(])/))),end:a,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},U={match:[/get|set/,/\s+/,a,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},F="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",K={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(F)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[R]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:L,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),I,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,A,E,m,f,{match:/\$\d+/},p,k,{scope:"attr",match:a+n.lookahead(":"),relevance:0},K,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[f,e.REGEXP_MODE,{className:"function",begin:F,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:L}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:h},{begin:g.begin,"on:begin":g.isTrulyOpeningTag,end:g.end}],subLanguage:"xml",contains:[{begin:g.begin,end:g.end,skip:!0,contains:["self"]}]}]},G,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[R,e.inherit(e.TITLE_MODE,{begin:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},V,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},j,q,M,U,{match:/\$[(.]/}]}}function J1(e){const n=e.regex,r=c4(e),a=hh,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],h={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},g={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:hh,keyword:rx.concat(u),literal:sx,built_in:ux.concat(o),"variable.language":cx},S={className:"meta",begin:"@"+a},p=(E,m,y)=>{const f=E.contains.findIndex(b=>b.label===m);if(f===-1)throw new Error("can not find mode to replace");E.contains.splice(f,1,y)};Object.assign(r.keywords,d),r.exports.PARAMS_CONTAINS.push(S);const C=r.contains.find(E=>E.scope==="attr"),x=Object.assign({},C,{match:n.concat(a,n.lookahead(/\s*\?:/))});r.exports.PARAMS_CONTAINS.push([r.exports.CLASS_REFERENCE,C,x]),r.contains=r.contains.concat([S,h,g,x]),p(r,"shebang",e.SHEBANG()),p(r,"use_strict",c);const A=r.contains.find(E=>E.label==="func.def");return A.relevance=0,Object.assign(r,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),r}const u4=/\[\[wiki:([^\]]+)\]\]/g,h4=new XC({gfm:!0,breaks:!1}),Q1={ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto):|[#/]|\.{0,2}\/|[^:]+$)/i,ADD_ATTR:["target","rel","data-entry-id"]},up=w4();function Co(e,n={}){const r=p4(e),a=h4.parse(r,{async:!1}),o=$l.sanitize(a,Q1),h=new DOMParser().parseFromString(o,"text/html");return g4(h,n.omitDuplicateTitle),m4(h),_4(h),b4(h),{html:$l.sanitize(h.body.innerHTML,Q1),toc:y4(h)}}function d4(e){const n=new TextEncoder().encode(e);let r="";for(const a of n)r+=String.fromCharCode(a);return btoa(r)}function f4(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 p4(e){return e.replace(u4,(n,r)=>{const a=r.trim();if(!a)return"";const o=Ee(a),h=encodeURIComponent(a);return`<a href="${Ur(a)}" data-entry-id="${h}">${o}</a>`})}function m4(e){const n=new Map;for(const r of e.querySelectorAll("h2, h3")){const a=r.textContent?.trim()??"",o=E4(a||"section"),h=n.get(o)??0;n.set(o,h+1),r.id=h===0?o:`${o}-${h+1}`}}function g4(e,n){if(!n)return;const r=e.body.querySelector("h1, h2, h3, h4, h5, h6");!r||r.tagName.toLowerCase()!=="h1"||ey(r.textContent??"")===ey(n)&&r.remove()}function _4(e){for(const n of e.querySelectorAll("pre > code")){const r=C4(n.className),a=n.textContent??"",o=n.parentElement;if(!o)continue;if(r==="mermaid"){const g=e.createElement("div");g.className="diagram-block",g.setAttribute("data-mermaid-source",d4(a)),g.setAttribute("data-diagram-state","pending"),o.replaceWith(g);continue}const h=S4(a,r);n.innerHTML=h,n.classList.add("hljs"),o.classList.add("code-block"),o.dataset.code=a,o.insertBefore(v4(e,r||"text"),o.firstChild)}}function v4(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 g=0;g<3;g++)a.append(e.createElement("span"));const o=e.createElement("span");o.className="code-block-language",o.textContent=n;const h=e.createElement("button");return h.className="copy-code",h.type="button",h.dataset.action="copy-code",h.setAttribute("aria-label",`Copy ${n} code`),h.textContent="Copy",r.append(a,o,h),r}function b4(e){for(const n of e.querySelectorAll("a")){const r=n.getAttribute("href")??"";x4(r)&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"))}}function y4(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 S4(e,n){return n&&up.getLanguage(n)?up.highlight(e,{language:n}).value:up.highlightAuto(e).value}function w4(){return Ai.registerLanguage("bash",K1),Ai.registerLanguage("sh",K1),Ai.registerLanguage("javascript",Y1),Ai.registerLanguage("js",Y1),Ai.registerLanguage("json",l4),Ai.registerLanguage("markdown",X1),Ai.registerLanguage("md",X1),Ai.registerLanguage("python",Z1),Ai.registerLanguage("py",Z1),Ai.registerLanguage("typescript",J1),Ai.registerLanguage("ts",J1),Ai}function C4(e){return e.match(/language-([a-z0-9_-]+)/i)?.[1]?.toLowerCase()??null}function x4(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)&&!e.startsWith(window.location.origin)}function E4(e){return e.trim().toLowerCase().replace(/[^\p{Letter}\p{Number}]+/gu,"-").replace(/^-+|-+$/g,"")||"section"}function ey(e){return e.trim().replace(/\s+/g," ").toLocaleLowerCase("en-US")}function T4(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="${gM(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 A4(e){const n=[hp("Current",e.current),hp("Proposed",e.proposed),hp("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 hp(e,n){if(!n)return"";const r=Co(n);return`
166
- <section class="conflict-section">
167
- <h2>${Ee(e)}</h2>
168
- <div class="markdown-body">${r.html}</div>
169
- </section>
170
- `}function k4(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">${Co(e).html}</div>
177
- </article>
178
- `}function vm(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 dh(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 R4=`
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 L4(e,n,r){if(!e)return"";const{frontmatter:a}=e,o=vm(a.created),h=dh(a.created),g=vm(a.updated),c=dh(a.updated),u=XL(e,n,r),d=a.tags.length>0?`<div class="queue-card-chips">${a.tags.map(p=>`<span class="chip chip-muted">${Ee(p)}</span>`).join("")}</div>`:'<span class="queue-dl-muted">None</span>',S=a.rawSourceRef?`<a class="manifest-link queue-raw-link" href="${Xe(EC(a.rawSourceRef))}" data-raw-ref="${Xe(a.rawSourceRef)}">
183
- <span class="manifest-ref">${Ee(a.rawSourceRef)}</span>
184
- <span class="manifest-arrow" aria-hidden="true">${R4}</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="${Xe(a.created)}" title="${Xe(o)}">
198
- ${Ee(o)}
199
- <span class="queue-dl-relative">(${Ee(h)})</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="${Xe(a.updated)}" title="${Xe(g)}">
205
- ${Ee(g)}
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 M4="modulepreload",D4=function(e){return"/console/"+e},ty={},O4=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(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const g=document.querySelector("meta[property=csp-nonce]"),c=g?.nonce||g?.getAttribute("nonce");o=u(r.map(d=>{if(d=D4(d),d in ty)return;ty[d]=!0;const S=d.endsWith(".css"),p=S?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const C=document.createElement("link");if(C.rel=S?"stylesheet":M4,S||(C.as="script"),C.crossOrigin="",C.href=d,c&&C.setAttribute("nonce",c),document.head.appendChild(C),S)return new Promise((x,A)=>{C.addEventListener("load",x),C.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${d}`)))})}))}function h(g){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=g,window.dispatchEvent(c),!c.defaultPrevented)throw g}return o.then(g=>{for(const c of g||[])c.status==="rejected"&&h(c.reason);return n().catch(h)})},N4=".diagram-block[data-mermaid-source]:not([data-diagram-state='rendered']):not([data-diagram-state='error'])",I4=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),B4=/^on/i,j4={USE_PROFILES:{svg:!0,svgFilters:!1},FORBID_TAGS:["foreignObject","script"],FORBID_ATTR:["href","xlink:href"]},ny="diagramInteractionBound",P4=/^oklch\s*\(\s*([^)]+)\s*\)$/i,z4=/^(-?\d+(?:\.\d+)?)(deg)?$/i,Li=[25,50,75,100,125,150,200],$4=["pie1","pie2","pie3","pie4","pie5","pie6","pie7","pie8","pie9","pie10","pie11","pie12"];let dp=null,iy=!1,H4=0,U4=0,Gl=null;function ys(e){const n=e.trim();if(!n)return n;const r=hD(n);return r?dD(r):n}function F4(e){if(iy)return;iy=!0,ry(e);const n=e instanceof Node?e:document.body;new MutationObserver(a=>{let o=!1;for(const h of a)if(h.type==="childList"){Gl&&!Gl.trigger.isConnected&&Nl(!1);for(const g of h.addedNodes)if(g instanceof Element&&(g.matches?.(".diagram-block[data-mermaid-source]")||g.querySelector?.(".diagram-block[data-mermaid-source]"))){o=!0;break}if(o)break}o&&ry(e)}).observe(n,{childList:!0,subtree:!0})}function ry(e){const n=e.querySelectorAll(N4);for(const r of n)r.dataset.diagramHydrating!=="true"&&(r.dataset.diagramHydrating="true",r.dataset.diagramState="pending",q4(r))}async function q4(e){const n=e.getAttribute("data-mermaid-source")??"";let r="";try{r=f4(n)}catch{fp(e,"Invalid diagram source");return}if(!r.trim()){fp(e,"Empty diagram source");return}try{const a=await G4(),o=`mermaid-diagram-${++H4}`,{svg:h}=await a.render(o,r);e.innerHTML=W4(h),Y4(e,h),X4(e),Z4(e),e.dataset.diagramState="rendered"}catch(a){const o=a instanceof Error?a.message:String(a);fp(e,o)}}function fp(e,n){e.dataset.diagramState="error",e.textContent=`Diagram render failed: ${n}`}function W4(e){const n=(r,a)=>{B4.test(a.attrName)&&(a.keepAttr=!1)};$l.addHook("uponSanitizeAttribute",n);try{return $l.sanitize(e,j4)}finally{$l.removeHook("uponSanitizeAttribute",n)}}async function G4(){return dp||(dp=(async()=>{const e=await O4(()=>import("./mermaid.core-D0OYO4L1.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:K4(),themeCSS:V4(),flowchart:{htmlLabels:!1,useMaxWidth:!1}}),n})()),dp}function K4(){const e=getComputedStyle(document.documentElement),n=(E,m)=>{const y=e.getPropertyValue(E).trim();return ys(y||m)},r=(E,m)=>e.getPropertyValue(E).trim()||m,a=n("--brass","#c69a4a"),o=n("--brass-bright","#e6b86a"),h=n("--brass-deep","#a0782a"),g=n("--aurora","#8bd7e6"),c=n("--aurora-deep","#1f8aa8"),u=n("--coral","#ef7c63"),d=n("--ink-deep","#1d2734"),S=n("--ink-fog","#a6afbb"),p=n("--ink-pearl","#e6e9ef"),C=n("--ink-spectral","#bcc4d0"),x=[o,a,g,u,ys("oklch(70% 0.11 68)"),c,ys("oklch(76% 0.09 205)"),h,ys("oklch(68% 0.14 30)"),S,ys("oklch(62% 0.08 228)"),ys("oklch(52% 0.05 248)")],A=Object.fromEntries($4.map((E,m)=>[E,x[m]??d]));return{background:"transparent",primaryColor:"transparent",primaryTextColor:p,primaryBorderColor:a,secondaryColor:"transparent",secondaryTextColor:p,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:p,pieSectionTextSize:r("--font-size-md","13px"),pieLegendTextColor:p,pieLegendTextSize:r("--font-size-lg","14px"),pieStrokeColor:h,pieStrokeWidth:"1.35px",pieOuterStrokeColor:o,pieOuterStrokeWidth:"2.5px",pieOpacity:"0.96",...A}}function V4(){const e=getComputedStyle(document.documentElement),n=(d,S)=>{const p=e.getPropertyValue(d).trim();return ys(p||S)},r=n("--brass-deep","#a0782a"),a=n("--brass-bright","#e6b86a"),o=n("--aurora-deep","#1f8aa8"),h=n("--ink-abyss","#131920"),g=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 ${g});
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: ${h};
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: ${h};
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 Y4(e,n){const r=new DOMParser().parseFromString(n,"image/svg+xml"),a=Array.from(r.querySelectorAll("a")),o=Array.from(e.querySelectorAll("a")),h=Math.min(a.length,o.length);for(let g=0;g<h;g++){const c=a[g],u=o[g];if(!c||!u)continue;const d=c.getAttribute("href")??c.getAttribute("xlink:href")??"",S=dx(d);S&&u.setAttribute("href",S)}}function X4(e){const n=e.querySelector("svg");if(!n)return;let r;try{r=n.getBBox()}catch{return}const{x:a,y:o,width:h,height:g}=r;!Number.isFinite(a)||!Number.isFinite(o)||!Number.isFinite(h)||!Number.isFinite(g)||a<0||o<0||h<=0||g<=0||n.setAttribute("viewBox",`${no(a)} ${no(o)} ${no(h)} ${no(g)}`)}function Z4(e){e.tabIndex=0,e.setAttribute("aria-label","Open diagram in expanded view"),lD(e),e.dataset[ny]!=="true"&&(e.dataset[ny]="true",e.addEventListener("click",J4),e.addEventListener("keydown",Q4))}function J4(e){if(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0||fh(e.target))return;const n=e.currentTarget;n instanceof HTMLElement&&(e.preventDefault(),hx(n))}function Q4(e){if(e.key!=="Enter"&&e.key!==" "||fh(e.target))return;const n=e.currentTarget;n instanceof HTMLElement&&(e.preventDefault(),hx(n))}function hx(e){const n=e.querySelector("svg");if(!n)return;Nl(!1);const r=typeof HTMLDialogElement<"u"&&typeof HTMLDialogElement.prototype.showModal=="function",a=document.createElement(r?"dialog":"div"),o=++U4,h=`diagram-lightbox-title-${o}`;a.className="diagram-lightbox",a.setAttribute("aria-labelledby",h),r||(a.setAttribute("role","dialog"),a.setAttribute("aria-modal","true"),a.tabIndex=-1);const g=document.createElement("div");g.className="diagram-lightbox__frame";const c=document.createElement("div");c.className="diagram-lightbox__header";const u=document.createElement("h2");u.id=h,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 p=xu("−","Zoom out","out"),C=document.createElement("span");C.className="diagram-lightbox__zoom-readout",C.setAttribute("aria-live","polite");const x=xu("+","Zoom in","in"),A=xu("Fit","Fit diagram to viewport","fit"),E=xu("Reset","Reset diagram zoom","reset");S.append(p,C,x,A,E);const m=document.createElement("div");m.className="diagram-lightbox__viewport";const y=nD(n),f=n.cloneNode(!0);f.removeAttribute("style"),rD(f,`diagram-lightbox-svg-${o}`),m.append(f),c.append(u,S,d),g.append(c,m),a.append(g),document.body.append(a);const b=new eD(m,f,C,y);p.addEventListener("click",()=>b.zoomOut()),x.addEventListener("click",()=>b.zoomIn()),A.addEventListener("click",()=>b.fit()),E.addEventListener("click",()=>b.reset());const T=sD(a),L=k=>{(k.target===a||k.target===d)&&Nl(!0)},R=k=>{if(k.key==="Escape"){k.preventDefault(),Nl(!0);return}b.handleKeyboard(k)||k.key==="Tab"&&oD(k,a)},M={dialog:a,trigger:e,inertStates:T,onClick:L,onKeyDown:R,cleanupPanZoom:()=>b.destroy()};r&&(M.onCancel=k=>{k.preventDefault(),Nl(!0)},a.addEventListener("cancel",M.onCancel),a.showModal()),a.addEventListener("click",L),document.addEventListener("keydown",R,!0),Gl=M,b.fit(),d.focus()}function xu(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 eD{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=Li.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,Li.length-1))}zoomOut(){this.zoomAroundViewportCenter(Math.max(this.zoomIndex-1,0))}reset(){this.zoomAroundViewportCenter(Li.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),h=Li.findIndex(c=>c>o),g=h===-1?Li.length-1:Math.max(0,h-1);this.applyZoom(g),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*(Eu(this.zoomIndex)/100)}get svgHeight(){return this.baseSize.height*(Eu(this.zoomIndex)/100)}applyZoom(n){this.zoomIndex=n;const r=Eu(this.zoomIndex),a=r/100;this.svg.setAttribute("width",no(this.baseSize.width*a)),this.svg.setAttribute("height",no(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,h=this.svgHeight,g=this.viewport.getBoundingClientRect(),c=this.viewport.scrollLeft+r-g.left,u=this.viewport.scrollTop+a-g.top;this.applyZoom(n),this.viewport.scrollLeft=c/o*this.svgWidth-(r-g.left),this.viewport.scrollTop=u/h*this.svgHeight-(a-g.top)}onPointerDown=n=>{if(n.button!==0||fh(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=Eu(this.pinchStart.zoomIndex)*a;this.applyZoom(iD(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,Li.length-1):Math.max(this.zoomIndex-1,0);this.zoomAroundPoint(r,n.clientX,n.clientY)};onDoubleClick=n=>{fh(n.target)||(n.preventDefault(),this.zoomAroundPoint(this.zoomIndex===Li.indexOf(200)?Li.indexOf(100):Li.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 tD(e){const n=sy(e.getAttribute("width")),r=sy(e.getAttribute("height"));if(n&&r)return{width:n,height:r};const a=e.getAttribute("viewBox")?.trim().split(/[\s,]+/).map(Number)??[],o=a[2],h=a[3],g=o!==void 0&&Number.isFinite(o)&&o>0?o:null,c=h!==void 0&&Number.isFinite(h)&&h>0?h:null;return{width:n??g??800,height:r??c??600}}function nD(e){const n=e.getBoundingClientRect();return n.width>0&&n.height>0?{width:n.width,height:n.height}:tD(e)}function sy(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 no(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/\.?0+$/,"")}function iD(e){let n=0,r=Number.POSITIVE_INFINITY;return Li.forEach((a,o)=>{const h=Math.abs(a-e);h<r&&(r=h,n=o)}),n}function Eu(e){return Li[e]??Li[0]}function rD(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 Nl(e){const n=Gl;n&&(n.dialog.removeEventListener("click",n.onClick),document.removeEventListener("keydown",n.onKeyDown,!0),n.onCancel&&n.dialog.removeEventListener("cancel",n.onCancel),n.cleanupPanZoom(),aD(n.inertStates),n.dialog instanceof HTMLDialogElement&&n.dialog.open&&typeof n.dialog.close=="function"&&n.dialog.close(),n.dialog.remove(),Gl=null,e&&n.trigger.isConnected&&n.trigger.focus())}function sD(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 aD(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 oD(e,n){const r=Array.from(n.querySelectorAll(I4)).filter(uD);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 lD(e){e.querySelector("a[href]")?e.removeAttribute("role"):e.setAttribute("role","button")}function fh(e){if(!(e instanceof Element))return!1;const n=e.closest("a[href]");return!n||!(n.getAttribute("href")?.trim()??"")?!1:!cD(n)}function cD(e){return Array.from(e.children).some(n=>n.tagName.toLowerCase()==="svg")}function uD(e){return!(e.inert||e.hidden||e.getAttribute("aria-hidden")==="true"||"disabled"in e&&e.disabled)}function dx(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:dx(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 hD(e){const n=P4.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,h=a>=0?r.slice(a+1).trim():"",g=o.trim().split(/[\s,]+/).filter(Boolean);if(g.length!==3)return null;const[c,u,d]=g;if(!c||!u||!d)return null;const S=pp(c,1),p=pp(u,.4),C=fD(d);if(S===null||p===null||C===null)return null;let x=1;if(a>=0){const A=pp(h,1);if(A===null)return null;x=A}return{L:S,C:p,h:C,alpha:x}}function dD(e){const n=e.h*Math.PI/180,r=e.C*Math.cos(n),a=e.C*Math.sin(n),o=e.L,h=o+.3963377774*r+.2158037573*a,g=o-.1055613458*r-.0638541728*a,c=o-.0894841775*r-1.291485548*a,u=h**3,d=g**3,S=c**3,p=4.0767416621*u-3.3077115913*d+.2309699292*S,C=-1.2684380046*u+2.6097574011*d-.3413193965*S,x=-.0041960863*u-.7034186147*d+1.707614701*S,A=Tu(mp(p)),E=Tu(mp(C)),m=Tu(mp(x));if(e.alpha<1){const y=Tu(e.alpha);return`#${Vs(A)}${Vs(E)}${Vs(m)}${Vs(y)}`}return`#${Vs(A)}${Vs(E)}${Vs(m)}`}function pp(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 fD(e){const n=z4.exec(e);if(!n)return null;const r=Number(n[1]);return Number.isFinite(r)?r:null}function mp(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 Tu(e){return Math.round(Math.max(0,Math.min(1,e))*255)}function Vs(e){return e.toString(16).padStart(2,"0")}function pD(e,n){const r=mD(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="${Xe(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 mD(e,n){const r=n.find(h=>h.id===e.frontmatter.id),a=e.frontmatter.tags[0]??r?.tags[0]??null,o=[{label:"Codex",href:_g()},{label:"Index",href:TC()}];return a&&o.push({label:a}),o.push({label:e.frontmatter.title}),o}function gD(e){const n=e.tags.map(a=>`<span class="chip chip-tag">${Ee(a)}</span>`).join(""),r=vD(e);return`
282
- <div class="meta-chips">
283
- ${n}
284
- ${r}
285
- <span class="chip">Updated ${Ee(_D(e.updated))}</span>
286
- </div>
287
- `}function fx(e){return e.map(n=>`<span class="chip chip-muted">${Ee(n)}</span>`).join("")}function _D(e){const n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function vD(e){const n=bD(e);return n?`<span class="chip ${n.tone==="deprecated"?"chip-coral":n.tone==="stale"?"chip-stale":""}" title="${Xe(n.title)}">${Ee(n.label)}</span>`:""}function bD(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 yD(e,n,r){const a=SD(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="${Xe(o.entry.id)}">
293
- <strong>${Ee(o.entry.title)}</strong>
294
- <span>${fx(o.matchingTags)}</span>
295
- </a>
296
- `).join("")}
297
- </div>
298
- </section>
299
- `}function SD(e,n,r){const a=new Set(n),o="en-US";return r.filter(h=>h.id!==e).map(h=>({entry:h,matchingTags:h.tags.filter(g=>a.has(g))})).filter(h=>h.matchingTags.length>0).sort((h,g)=>g.matchingTags.length-h.matchingTags.length||h.entry.title.localeCompare(g.entry.title,o,{sensitivity:"base",numeric:!0})).slice(0,5)}const wD=`
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
- `,CD=`
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 xD(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
- ${CD}
311
- <span>Contents</span>
312
- </button>
313
- `}function ED(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">${wD}</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="#${Xe(n.id)}" data-toc-id="${Xe(n.id)}">
327
- ${Ee(n.text)}
328
- </a>
329
- `).join("")}
330
- </nav>
331
- </section>
332
- </div>
333
- `}const TD=`
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 AD(e,n,r=!0){const a=e.length,o=e.slice(0,6),h=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
- ${h?`
351
- <a class="primary-link" href="${Xe(Ur(h.id))}" data-entry-id="${Xe(h.id)}">
352
- <span>Open first entry — ${Ee(h.title)}</span>
353
- ${TD}
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(g=>`
359
- <a class="welcome-card" href="${Xe(Ur(g.id))}" data-entry-id="${Xe(g.id)}">
360
- <strong>${Ee(g.title)}</strong>
361
- <span class="welcome-card-tags">${fx(g.tags.slice(0,3))}</span>
362
- </a>
363
- `).join("")}
364
- </div>
365
- `:""}
366
- </article>
367
- `}function kD(e,n){const r=Co(e.body,{omitDuplicateTitle:e.frontmatter.title});return{toc:r.toc,html:`
368
- <article class="document">
369
- <header class="document-header">
370
- ${pD(e,n)}
371
- <p class="eyebrow">Current Entry</p>
372
- <h1>${Ee(e.frontmatter.title)}</h1>
373
- ${gD(e.frontmatter)}
374
- ${xD(r.toc)}
375
- </header>
376
- <div class="markdown-body" id="markdown-body">
377
- ${r.html}
378
- </div>
379
- ${yD(e.frontmatter.id,e.frontmatter.tags,n)}
380
- ${ED(r.toc)}
381
- </article>
382
- `}}function RD(){return`
383
- <article class="document">
384
- <p class="loading">Loading entry</p>
385
- </article>
386
- `}function LD(e){return`
387
- <article class="document">
388
- <p class="error-box">${Ee(e)}</p>
389
- </article>
390
- `}const Uu=new Set;let Nr="entries";const MD=`
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
- `,DD=`
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
- `,OD=`
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
- `,ND=`
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 ID(e,n,r,a=[],o=null,h){const g=e.length,c=PD(e),u=g===0?'<p class="empty-state">No wiki entries yet.</p>':Nr==="tags"?zD(e,n):$D(e,n),d=Nr==="tags"?`Tags · ${c}`:`Entries · ${g}`,S=Nr==="tags"?"tag-tree":"entry-list",p=Nr==="tags"?"Entries by tag":"All entries",C=FD(h??(typeof window<"u"?window.location.pathname:"")),x=C.startsWith("/queue"),A=C==="/index",E=C==="/log",m=C.startsWith("/conflicts"),y=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">${OD}</button>
413
- </div>
414
- </div>
415
- <button class="command-entry" type="button" data-action="open-command">
416
- <span class="command-entry-label">${MD}<span>Search entries</span></span>
417
- <kbd>⌘K</kbd>
418
- </button>
419
- <div class="nav-drydock-section">
420
- <a class="nav-drydock-link${x?" active":""}" href="${Xe(mo())}">
421
- <span class="nav-drydock-icon">${ND}</span>
422
- <span class="nav-drydock-label">Drydock</span>
423
- ${y}
424
- </a>
425
- <a class="nav-drydock-link${A?" active":""}" href="${Xe(TC())}">
426
- <span class="nav-drydock-label">Index</span>
427
- </a>
428
- <a class="nav-drydock-link${E?" active":""}" href="${Xe(AC())}">
429
- <span class="nav-drydock-label">Log</span>
430
- </a>
431
- <a class="nav-drydock-link${m?" active":""}" href="${Xe(mM())}">
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="${p}">
445
- ${u}
446
- </nav>
447
- </aside>
448
- `}function BD(e){if(Uu.has(e)){Uu.delete(e);return}Uu.add(e)}function jD(e){Nr=e}function PD(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 zD(e,n){return HD(e).map(a=>UD(a,n)).join("")}function $D(e,n){const r="en-US";return[...e].sort((o,h)=>o.title.localeCompare(h.title,r,{sensitivity:"base",numeric:!0})).map(o=>px(o,n)).join("")}function HD(e){const n="en-US",r=new Map;for(const a of e){const o=a.tags.length>0?a.tags:["untagged"];for(const h of o){const g=r.get(h)??[];g.push(a),r.set(h,g)}}return[...r.entries()].map(([a,o])=>({tag:a,entries:o.sort((h,g)=>h.title.localeCompare(g.title,n,{sensitivity:"base",numeric:!0}))})).sort((a,o)=>a.tag.localeCompare(o.tag,n,{sensitivity:"base",numeric:!0}))}function UD(e,n){const r=Uu.has(e.tag),a=r?"":e.entries.map(o=>px(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="${Xe(e.tag)}">
451
- ${DD}
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 px(e,n){const r=e.id===n?" active":"",a=Xe(e.title);return`
458
- <a class="nav-entry${r}" href="${Ur(e.id)}" data-entry-id="${Xe(e.id)}" title="${a}">
459
- <span class="nav-entry-text">${Ee(e.title)}</span>
460
- </a>
461
- `}function FD(e){const n=e===Wi||e===`${Wi}/`?"/":e.startsWith(`${Wi}/`)?e.slice(Wi.length)||"/":e,r=n.match(/^\/w\/[^/]+(\/.*)?$/);return r?r[1]??"/":n}const qD=`
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
- `,WD=`
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 GD(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">${Co(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
- ${qD}
475
- <span>Codex</span>
476
- </a>
477
- <div class="raw-meta">
478
- <span class="raw-glyph">${WD}</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 Mg(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 KD(e){const{tab:n,items:r,pendingCount:a,archivedCount:o,loading:h,error:g}=e;if(h&&r.length===0)return'<div class="queue-view"><p class="loading">Loading patch queue</p></div>';if(g)return`<div class="queue-view"><p class="error-box">Failed to load queue — ${Ee(g)}</p></div>`;const c=r.length===0?VD(n):r.map(S=>YD(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="${Xe(mo("pending"))}"
502
- role="tab"
503
- aria-selected="${n==="pending"}">
504
- Pending${u}
505
- </a>
506
- <a class="queue-tab${n==="archived"?" active":""}"
507
- href="${Xe(mo("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 VD(e){return`<p class="queue-empty">${e==="pending"?"No pending patches.":"No archived patches."}</p>`}function YD(e){const{id:n,meta:r,source:a,summary:o,op:h,target:g}=e,c=XD(r.status),u=dh(r.createdAt),d=r.warnings??[],S=d.slice(0,3).map(m=>`<span class="chip chip-muted">${Ee(m)}</span>`).join(""),p=d.length>3?`<span class="chip chip-muted">+${d.length-3}</span>`:"",C=a==="archive"?`<span class="chip">${Ee(r.status)}</span>`:"",x=h?Mg(h,!0):"",A=o?`<p class="queue-card-summary">${Ee(o)}</p>`:"",E=g?`<span class="queue-card-target">${Ee(g)}</span>`:"";return`
518
- <a class="queue-card" href="${Xe(pM(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
- ${x}
526
- ${E}
527
- <span class="queue-card-time">${Ee(u)}</span>
528
- ${C}
529
- <div class="queue-card-chips">
530
- ${S}${p}
531
- </div>
532
- </div>
533
- </a>
534
- `}function XD(e){return`<span class="status-dot ${e==="pending"?"status-dot--pending":e==="accepted"?"status-dot--accepted":"status-dot--rejected"}" aria-label="${Xe(e)}"></span>`}const ZD=`
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
- `,JD=`
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 QD(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?eO(n,e):'<div class="queue-detail-view"><p class="empty-state">Patch not found.</p></div>'}function eO(e,n){const{patch:r,meta:a,wikiEntry:o,targetExists:h}=e,{frontmatter:g}=r,c=Co(o.body),u=Mg(g.op,h),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="${Xe(mo())}" aria-label="Back to Drydock">
547
- ${ZD}
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(g.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
- ${tO(e,d)}
562
- ${rO(c.toc)}
563
- ${iO(e)}
564
- ${nO(e,n)}
565
- </aside>
566
- </div>
567
- </div>
568
- `}function tO(e,n){const{patch:r,meta:a,targetExists:o}=e,{frontmatter:h}=r,g=Mg(h.op,o),c=vm(a.createdAt),u=dh(a.createdAt),d=sO(a.status),S=a.warnings??[],p=n?`<dd class="queue-dl-value">
569
- <a class="manifest-link queue-raw-link" href="${Xe(EC(n))}" data-raw-ref="${Xe(n)}">
570
- <span class="manifest-ref">${Ee(n)}</span>
571
- <span class="manifest-arrow">${JD}</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(x=>`<span class="chip chip-muted">${Ee(x)}</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">${g}</dd>
587
- <dt class="queue-dl-key">Target</dt>
588
- <dd class="queue-dl-value queue-dl-mono">${Ee(h.target)}</dd>
589
- <dt class="queue-dl-key">Proposer</dt>
590
- <dd class="queue-dl-value">${Ee(h.proposer)}</dd>
591
- <dt class="queue-dl-key">Created</dt>
592
- <dd class="queue-dl-value queue-dl-time">
593
- <time datetime="${Xe(a.createdAt)}" title="${Xe(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
- ${p}
602
- ${C}
603
- </dl>
604
- </div>
605
- `}function nO(e,n){const{meta:r,source:a}=e;if(r.status!=="pending"||a!=="queue")return"";const{actionPending:o,actionError:h}=n,g=o?" disabled":"",c=Xe(r.id),u=h?`<p class="queue-action-error">${Ee(h)}</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}"${g}
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"${g}
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"${g}>Confirm</button>
630
- <button class="queue-action-btn queue-action-btn--cancel" type="button" data-action="queue-reject-cancel"${g}>Cancel</button>
631
- </div>
632
- </form>
633
- ${u}
634
- </div>
635
- `}function iO(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 rO(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="#${Xe(r.id)}">${Ee(r.text)}</a>`).join("")}
661
- </nav>
662
- </div>
663
- `}function sO(e){return`<span class="status-dot ${e==="pending"?"status-dot--pending":e==="accepted"?"status-dot--accepted":"status-dot--rejected"}" aria-label="${Xe(e)}"></span>`}const aO="active",oO=".toc-panel a[data-toc-id], .toc-drawer-link[data-toc-id]";function lO(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="#${Xe(n.id)}" data-toc-id="${Xe(n.id)}">
668
- ${Ee(n.text)}
669
- </a>
670
- `).join("")}
671
- </nav>
672
- `}function cO(e,n){if(n.length===0||typeof IntersectionObserver>"u")return()=>{};const r=[...e.querySelectorAll(oO)],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 h=e instanceof HTMLElement?e.closest(".codex-host"):null,g=new Set,c=new IntersectionObserver(u=>{for(const S of u){const p=S.target instanceof HTMLElement?S.target.id:"";p&&(S.isIntersecting?g.add(p):g.delete(p))}const d=uO(o,g)??hO(o,h)??o[0]?.id??null;ay(r,d)},{root:h,rootMargin:"-20% 0px -65% 0px",threshold:[0,.2,.6,1]});for(const u of o)c.observe(u);return ay(r,o[0]?.id??null),()=>c.disconnect()}function uO(e,n){for(const r of e)if(n.has(r.id))return r.id;return null}function hO(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 ay(e,n){for(const r of e){const a=!!(n&&r.dataset.tocId===n);r.classList.toggle(aO,a),a?r.setAttribute("aria-current","location"):r.removeAttribute("aria-current")}}function dO(e){const n=e.entries.join(`
673
-
674
- `),r=Co(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="${AC(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 bm=new Set,ua={tab:"pending",items:[],pendingCount:0,archivedCount:0,current:null,loading:!1,error:null,actionPending:!1,actionError:null};function ph(){return ua}function fO(e){return bm.add(e),()=>bm.delete(e)}async function pO(e){ni({tab:e,loading:!0,error:null,current:null});try{const n=await Rh(e);ni({items:n.items,pendingCount:n.pendingCount,archivedCount:n.archivedCount,loading:!1}),bg(n.pendingCount)}catch(n){ni({loading:!1,error:Dh(n)})}}async function mO(e){ni({loading:!0,error:null,current:null});try{const n=await rM(e);ni({current:n,loading:!1})}catch(n){ni({loading:!1,error:Dh(n)})}}function Ys(){ni({items:[],current:null,error:null,loading:!1,actionPending:!1,actionError:null})}async function gO(){if(ua.actionPending)return;const e=ua.current?.meta.id;if(e){ni({actionPending:!0,actionError:null});try{await sM(e);const n=await Rh("pending");ni({actionPending:!1,pendingCount:n.pendingCount,archivedCount:n.archivedCount}),bg(n.pendingCount),oa(mo("archived"))}catch(n){ni({actionPending:!1,actionError:Dh(n)})}}}async function _O(e){if(ua.actionPending)return;const n=ua.current?.meta.id;if(!n)return;const r=e.trim();if(!r||r.length>256){ni({actionError:r?"Rejection reason must be 256 characters or less.":"Please enter a rejection reason."});return}ni({actionPending:!0,actionError:null});try{await aM(n,r);const a=await Rh("pending");ni({actionPending:!1,pendingCount:a.pendingCount,archivedCount:a.archivedCount}),bg(a.pendingCount),oa(mo("archived"))}catch(a){ni({actionPending:!1,actionError:Dh(a)})}}function ni(e){Object.assign(ua,e);for(const n of bm)n(ua)}function Dh(e){return e instanceof Error?e.message:String(e)}const ym=new Set,Ss={ref:null,content:null,loading:!1,error:null};function vO(){return Ss}function bO(e){return ym.add(e),()=>ym.delete(e)}async function yO(e){if(!(Ss.ref===e&&Ss.content!==null&&!Ss.error)){Fu({ref:e,content:null,loading:!0,error:null});try{const n=await iM(e);if(Ss.ref!==e)return;Fu({content:n,loading:!1})}catch(n){if(Ss.ref!==e)return;Fu({loading:!1,error:SO(n)})}}}function ms(){Fu({ref:null,content:null,loading:!1,error:null})}function Fu(e){Object.assign(Ss,e);for(const n of ym)n(Ss)}function SO(e){return e instanceof Error?e.message:String(e)}let co,Sm=!1;const mx="fleet-console.codex.nav-collapsed",gx="fleet-console.codex.rail-collapsed";let mh=_x("nav"),gh=_x("rail"),wm=null,Cm=null,Hl="route";function wO(e,n={}){co=e,Sm=!1,document.documentElement.lang="en",dM(),RM();const r=bM(()=>Pr()),a=bO(()=>Pr()),o=fO(()=>Pr()),h=hM(g=>{vx(g)});return document.addEventListener("click",ly),document.addEventListener("submit",uy),window.addEventListener("keydown",cy,!0),F4(e),n.initialWorkspaceId&&cm()!==n.initialWorkspaceId&&uM(E1(n.initialWorkspaceId)),TO(),{navigateToWorkspace(g){cm()!==g&&oa(E1(g))},destroy(){r(),a(),o(),h(),document.removeEventListener("click",ly),document.removeEventListener("submit",uy),window.removeEventListener("keydown",cy,!0),Sx(),Kl(!1),LM(),fM(),e.innerHTML=""}}}function CO(e,n){e==="nav"?mh=n:gh=n,EO(e,n),co&&Pr()}function oy(e){return e==="nav"?mh:gh}function xO(e){Hl!==e&&(Hl=e,co&&Pr())}function _x(e){if(typeof window>"u")return!1;try{return window.localStorage.getItem(e==="nav"?mx:gx)==="true"}catch{return!1}}function EO(e,n){if(!(typeof window>"u"))try{window.localStorage.setItem(e==="nav"?mx:gx,String(n))}catch{}}async function TO(){Pr(),await yM(),await vx(nc())}async function vx(e){if(e.name==="entry"){Ys(),ms(),await SM(e.id);return}if(e.name==="raw"){Ys(),await yO(e.ref);return}if(e.name==="queue"){ip(),ms(),await pO(e.tab);return}if(e.name==="queue-detail"){ip(),ms(),await mO(e.patchId);return}if(e.name==="index-md"){Ys(),ms(),await wM();return}if(e.name==="log"){Ys(),ms(),await CM(e.limit);return}if(e.name==="conflicts"){Ys(),ms(),await xM();return}if(e.name==="conflict-detail"){Ys(),ms(),await EM(e.id);return}ip(),ms(),Ys(),Pr()}function Pr(){const e=nc();AO(Hu(),e)}function AO(e,n){const r=n.name==="entry"?n.id:null,a=LO(n),o=Hl!=="side"||!mh,h=!yx(n)&&(Hl!=="side"||!gh),g=e.currentEntry?kD(e.currentEntry,e.index):null;kM(e.index,e.recentIds);const c=Hl==="side"?`${mh?" app-shell--nav-collapsed":""}${gh?" app-shell--rail-collapsed":""}`:"";Sx(),Kl(!1),co.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?ID(e.index,r,e.pendingPatchCount,e.workspaces,e.currentWorkspaceId,window.location.pathname):""}
696
- <main class="content">
697
- ${kO(e,n,g)}
698
- </main>
699
- ${h?`<div class="rail">${RO(e,n,g)}</div>`:""}
700
- </div>
701
- <div class="toast" id="toast" aria-live="polite"></div>
702
- `,Sm?co.classList.add("is-revealed"):Sm=!0,n.name==="entry"&&g&&(wm=cO(co,g.toc))}function kO(e,n,r){return n.name==="raw"?GD(vO()):n.name==="queue"?KD(ph()):n.name==="queue-detail"?QD(ph()):e.error?LD(e.error):e.loading&&!e.currentEntry&&!e.indexMarkdown&&!e.log&&!e.currentConflict?RD():n.name==="index-md"&&e.indexMarkdown?k4(e.indexMarkdown):n.name==="log"&&e.log?dO(e.log):n.name==="conflicts"?T4(e.conflicts):n.name==="conflict-detail"&&e.currentConflict?A4(e.currentConflict):e.currentEntry&&r?r.html:AD(e.index,e.health?.cwd??null,!!e.currentWorkspaceId)}function RO(e,n,r){return yx(n)?"":`
703
- ${r?lO(r.toc):""}
704
- ${L4(e.currentEntry,e.index,e.currentMatchHint)}
705
- `}function LO(e){return e.name==="raw"?" app-shell--raw":bx(e)?" app-shell--wide":""}function bx(e){return e.name==="home"||e.name==="index-md"||e.name==="log"||e.name==="conflicts"||e.name==="queue"||e.name==="queue-detail"}function yx(e){return e.name==="raw"||bx(e)}function ly(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(dy(e))return;e.preventDefault(),document.body.classList.remove("nav-open"),oa(_g());return}if(r?.dataset.action==="set-nav-mode"){const g=r.dataset.mode;(g==="tags"||g==="entries")&&(jD(g),Pr());return}if(r?.dataset.action==="toggle-tag"){BD(r.dataset.tag??""),Pr();return}if(r?.dataset.action==="open-toc-drawer"){DO(r);return}if(r?.dataset.action==="close-toc-drawer"){Kl(!0);return}if(r?.dataset.action==="copy-code"){OO(r);return}if(r?.dataset.action==="copy-compact-context"){const g=Hu();g.currentEntry&&qu(bC(g.currentEntry),"Copied compact context.");return}if(r?.dataset.action==="copy-provenance-context"){const g=Hu();g.currentEntry&&qu(yC(g.currentEntry),"Copied provenance context.");return}if(r?.dataset.action==="copy-related-context"){const g=Hu();g.currentEntry&&qu(SC(g.currentEntry,g.index),"Copied related context pack.");return}if(r?.dataset.action==="toggle-why-matched"){const g=r.closest(".context-actions-grid")?.querySelector(".context-why-matched");g&&(g.hidden=!g.hidden);return}if(r?.dataset.action==="queue-approve"){if(ph().actionPending||!confirm("Approve this patch?"))return;r.setAttribute("disabled",""),gO();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"}),Kl(!1);return}const o=n.closest("a");if(!o||dy(e))return;const h=NO(o);h&&(e.preventDefault(),document.body.classList.remove("nav-open"),oa(h))}function cy(e){const n=document.querySelector("#toc-drawer:not([hidden])");if(!n)return;if(e.key==="Escape"){e.preventDefault(),e.stopImmediatePropagation(),Kl(!0);return}if(e.key==="Tab"){MO(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 MO(e,n){const r=[...e.querySelectorAll("a[href], button:not([disabled])")].filter(g=>g.offsetParent!==null),a=r[0],o=r[r.length-1];if(!a||!o)return;const h=document.activeElement;e.contains(h)?n.shiftKey&&h===a?(n.preventDefault(),o.focus()):!n.shiftKey&&h===o&&(n.preventDefault(),a.focus()):(n.preventDefault(),a.focus())}function DO(e){const n=document.querySelector("#toc-drawer");n&&(Cm=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 Kl(e){const n=document.querySelector("#toc-drawer");n&&(n.hidden=!0,document.body.classList.remove("toc-open"),e&&Cm?.focus(),Cm=null)}function Sx(){wm?.(),wm=null}function uy(e){const n=e.target;if(n instanceof HTMLFormElement&&n.dataset.action==="queue-reject-submit"){if(e.preventDefault(),ph().actionPending)return;const r=n.querySelector("button[type='submit']");r&&(r.disabled=!0);const a=n.querySelector("textarea[name='reason']");_O(a?.value??"")}}async function OO(e){const r=e.closest(".code-block")?.dataset.code??"";r&&await qu(r,"Code copied.")}async function qu(e,n){try{await navigator.clipboard.writeText(e),hy(n)}catch{hy("Failed to copy to clipboard.")}}function hy(e){const n=document.querySelector("#toast");n&&(n.textContent=e,n.classList.add("visible"),window.setTimeout(()=>n.classList.remove("visible"),1400))}function dy(e){return e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0}function NO(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 _g();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()??"",h=decodeURIComponent(o.replace(/\.md$/,""));return h?Ur(h):null}let Qs=null,Vl=null;function IO(e,n){const r=jO();r.parentElement!==e&&e.appendChild(r),Vl||(Vl=wO(r,{initialWorkspaceId:n}))}function BO(e){Vl?.navigateToWorkspace(e)}function fy(){Vl?.destroy(),Vl=null,Qs?.parentElement&&Qs.parentElement.removeChild(Qs)}function jO(){return Qs||(Qs=document.createElement("div"),Qs.className="codex-host"),Qs}function PO({state:e,mode:n,onClose:r}){const a=$.useRef(null),o=iw(),h=$.useRef(null),g=e.theaters.find(A=>A.id===e.activeTheaterId)??null,c=g?.id??null,u=!!g?.hasWiki;$.useEffect(()=>{if(!u){fy();return}return()=>{fy()}},[u]),$.useEffect(()=>{!u||!a.current||!c||(xO(n),IO(a.current,c))},[n,u,c]),$.useEffect(()=>{!u||!c||BO(c)},[c,u]),$.useEffect(()=>{if(n==="route")return;const A=E=>{E.key!=="Escape"||MM()||(E.preventDefault(),r())};return window.addEventListener("keydown",A,!0),()=>window.removeEventListener("keydown",A,!0)},[n,r]);const d=A=>{A.preventDefault(),h.current={pointerId:A.pointerId,startX:A.clientX,startWidth:o},A.currentTarget.setPointerCapture(A.pointerId),A.currentTarget.classList.add("is-dragging")},S=A=>{const E=h.current;!E||E.pointerId!==A.pointerId||jA(E.startWidth+(E.startX-A.clientX))},p=A=>{h.current?.pointerId===A.pointerId&&(h.current=null,A.currentTarget.releasePointerCapture(A.pointerId),A.currentTarget.classList.remove("is-dragging"))},C=g?.label??"Fleet Wiki",x=u?v.jsx("div",{className:"codex-surface-host",ref:a}):v.jsx($O,{activeTheater:g,hasTheaters:e.theaters.length>0});return n==="route"?v.jsx("section",{className:"codex-route-host","aria-label":"Codex",children:x}):v.jsx("aside",{className:"codex-side-layer",style:{"--codex-side-width":`${o}px`},role:"complementary","aria-label":"Codex",children:v.jsxs("div",{className:"codex-side-panel",children:[v.jsx("div",{className:"codex-side-resize",role:"separator","aria-orientation":"vertical","aria-label":"Resize Codex panel",onPointerDown:d,onPointerMove:S,onPointerUp:p,onPointerCancel:p}),v.jsx(zO,{title:C,onClose:r}),x]})})}function zO({title:e,onClose:n}){const[r,a]=$.useState(()=>oy("nav")),[o,h]=$.useState(()=>oy("rail")),g=c=>{const u=c==="nav"?!r:!o;CO(c,u),c==="nav"?a(u):h(u)};return v.jsxs("header",{className:"codex-surface-header",children:[v.jsxs("div",{className:"codex-surface-heading",children:[v.jsx("span",{className:"codex-surface-eyebrow",children:"Codex"}),v.jsx("h2",{className:"codex-surface-title",title:e,children:e})]}),v.jsxs("div",{className:"codex-surface-actions",children:[v.jsx("button",{type:"button",className:`codex-pane-toggle ${r?"is-collapsed":""}`,onClick:()=>g("nav"),"aria-pressed":!r,"aria-label":r?"Nav 펼치기":"Nav 접기",title:r?"Nav 펼치기":"Nav 접기",children:v.jsx(HO,{})}),v.jsx("button",{type:"button",className:`codex-pane-toggle ${o?"is-collapsed":""}`,onClick:()=>g("rail"),"aria-pressed":!o,"aria-label":o?"ToC 펼치기":"ToC 접기",title:o?"ToC 펼치기":"ToC 접기",children:v.jsx(UO,{})}),v.jsx("button",{type:"button",className:"codex-surface-close",onClick:n,"aria-label":"Close Codex",children:"×"})]})]})}function $O({activeTheater:e,hasTheaters:n}){return n?v.jsxs("section",{className:"codex-empty-state",children:[v.jsx("p",{className:"codex-empty-eyebrow",children:"Codex unavailable"}),v.jsx("h1",{children:e?.label??"This Theater"}),v.jsx("p",{children:"This Theater does not have Fleet Wiki data mounted."})]}):v.jsxs("section",{className:"codex-empty-state",children:[v.jsx("p",{className:"codex-empty-eyebrow",children:"Codex"}),v.jsx("h1",{children:"Add a Theater"}),v.jsx("p",{children:"Use the top bar Theater control to choose a project root before opening Codex."})]})}function HO(){return v.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[v.jsx("rect",{x:"2.5",y:"3.5",width:"11",height:"9",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),v.jsx("path",{d:"M6.1 3.5v9",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),v.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 UO(){return v.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[v.jsx("rect",{x:"2.5",y:"3.5",width:"11",height:"9",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),v.jsx("path",{d:"M9.9 3.5v9",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),v.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 FO(e){const n=await fetch("/agent-cli/state",{signal:e});return await qO(n),WO(await n.json(),n.status)}async function qO(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 Fe(e.status,n)}function WO(e,n){const r=e;if(!r||typeof r!="object"||!Array.isArray(r.clis))throw new Fe(n,"Invalid agent CLI state response");return{clis:r.clis.map(a=>GO(a,n))}}function GO(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 Fe(n,"Invalid agent CLI status entry");if(Object.prototype.hasOwnProperty.call(r,"path"))throw new Fe(n,"Agent CLI status must not expose filesystem paths");return{id:r.id,displayName:r.displayName,available:r.available,version:r.version}}const xm=new Set;let Em={loading:!1,state:null,error:null};function KO(){return $.useSyncExternalStore(VO,py,py)}function py(){return Em}function VO(e){return xm.add(e),()=>{xm.delete(e)}}async function YO(e){gp({loading:!0,error:null});try{const n=await FO(e);gp({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;gp({loading:!1,error:XO(n)})}}function gp(e){Em={...Em,...e};for(const n of xm)n()}function XO(e){return e instanceof Error?e.message:String(e)}function ZO(){const e=KO();return $.useEffect(()=>{const n=new AbortController;return YO(n.signal),()=>n.abort()},[]),v.jsxs("section",{className:"global-settings-card","aria-label":"Agent CLI availability",children:[v.jsxs("div",{className:"agent-cli-head",children:[v.jsx("p",{className:"global-settings-resp-title",children:"Agent CLI"}),v.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?v.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,e.loading&&!e.state?v.jsx("p",{className:"global-settings-help",children:"Checking Agent CLIs."}):null,e.state?.clis.map(n=>v.jsx(JO,{cli:n},n.id)),v.jsx("p",{className:"global-settings-foot",children:"Install or update a CLI, then reopen this page to re-check availability."})]})}function JO({cli:e}){return v.jsxs("div",{className:"agent-cli-row",children:[v.jsx("span",{className:"agent-cli-name",children:e.displayName}),v.jsxs("span",{className:"agent-cli-meta",children:[e.available&&e.version?v.jsx("span",{className:"agent-cli-version",children:e.version}):null,v.jsx("span",{className:`agent-cli-status ${e.available?"is-on":""}`,children:e.available?"Available":"Not found"})]})]})}async function QO(e){const n=await fetch("/observer/api-catalog",{signal:e});return await eN(n),tN(await n.json(),n.status).routes}async function eN(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 Fe(e.status,n)}function tN(e,n){const r=e;if(!r||typeof r!="object"||!("version"in r)||!Array.isArray(r.routes))throw new Fe(n,"Invalid backend API catalog response");return{routes:r.routes.map(a=>nN(a,n))}}function nN(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 Fe(n,"Invalid backend API catalog entry");return{method:r.method,path:r.path,summary:r.summary,category:r.category,gate:r.gate}}const Tm=new Set;let Am={loading:!1,state:null,error:null};function iN(){return $.useSyncExternalStore(rN,my,my)}function my(){return Am}function rN(e){return Tm.add(e),()=>{Tm.delete(e)}}async function sN(e){_p({loading:!0,error:null});try{const n=await QO(e);_p({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;_p({loading:!1,error:aN(n)})}}function _p(e){Am={...Am,...e};for(const n of Tm)n()}function aN(e){return e instanceof Error?e.message:String(e)}function oN(){const e=iN(),[n,r]=$.useState(!0),a=$.useMemo(()=>uN(e.state??[]),[e.state]),o=e.state?.length??0,h=a.length;return $.useEffect(()=>{const g=new AbortController;return sN(g.signal),()=>g.abort()},[]),v.jsxs("section",{className:"global-settings-card backend-api-section","aria-label":"Backend API catalog",children:[v.jsx("div",{className:`backend-api-control carrier-settings-control-group--taskforce ${n?"is-expanded":""}`,children:v.jsxs("div",{className:"carrier-settings-section-head",children:[v.jsxs("div",{className:"backend-api-head",children:[v.jsx("p",{className:"global-settings-resp-title",children:"Backend API"}),v.jsx("p",{className:"global-settings-help",children:o>0?`${o} loopback route${o===1?"":"s"} across ${h} categor${h===1?"y":"ies"} reported by backend introspection.`:"Backend introspection route list for this console."})]}),v.jsx("div",{className:"carrier-settings-tf-head-actions",children:v.jsx("button",{type:"button",className:"carrier-settings-tf-toggle","aria-expanded":n,onClick:()=>r(g=>!g),children:n?"Hide":"Show"})})]})}),e.error?v.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,e.loading&&!e.state?v.jsx("p",{className:"global-settings-help",children:"Loading backend API catalog."}):null,n?v.jsxs("div",{className:"backend-api-groups",children:[a.length>0?a.map(g=>v.jsx(lN,{group:g},g.category)):null,e.state&&a.length===0?v.jsx("p",{className:"global-settings-help",children:"No backend API routes reported."}):null]}):null,v.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 lN({group:e}){return v.jsxs("div",{className:"backend-api-group",children:[v.jsxs("div",{className:"backend-api-group-head",children:[v.jsx("span",{children:e.category}),v.jsx("span",{children:e.entries.length})]}),v.jsx("div",{className:"backend-api-list",children:e.entries.map(n=>v.jsx(cN,{entry:n},`${n.method}:${n.path}`))})]})}function cN({entry:e}){return v.jsxs("div",{className:"backend-api-row",children:[v.jsx("span",{className:"backend-api-method",children:e.method.toUpperCase()}),v.jsx("code",{className:"backend-api-path",children:e.path}),v.jsx("span",{className:"backend-api-summary",children:e.summary}),v.jsx("span",{className:"backend-api-gate",children:e.gate})]})}function uN(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 hN(e){const n=await fetch("/model-auth/state",{signal:e});return await Dg(n),Cx(await n.json(),n.status)}async function dN(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 Dg(a),wx(await a.json(),a.status)}async function fN(e,n){const r=await fetch(`/model-auth/providers/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});return await Dg(r),wx(await r.json(),r.status)}async function Dg(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 Fe(e.status,n)}function wx(e,n){const r=e;if(!r||typeof r!="object"||!("state"in r))throw new Fe(n,"Invalid model auth mutation response");return{state:Cx(r.state,n)}}function Cx(e,n){const r=e;if(!r||typeof r!="object"||!Array.isArray(r.providers))throw new Fe(n,"Invalid model auth state response");return{providers:r.providers.map(a=>pN(a,n))}}function pN(e,n){const r=e;if(typeof r.cli!="string"||typeof r.displayName!="string"||typeof r.signedIn!="boolean")throw new Fe(n,"Invalid model auth provider response");return{cli:r.cli,displayName:r.displayName,signedIn:r.signedIn}}const km=new Set;let Rm={loading:!1,state:null,busyCli:null,error:null};function mN(){return $.useSyncExternalStore(gN,gy,gy)}function gy(){return Rm}function gN(e){return km.add(e),()=>{km.delete(e)}}async function _N(e){zr({loading:!0,error:null});try{const n=await hN(e);zr({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;zr({loading:!1,error:Og(n)})}}async function vN(e,n){zr({busyCli:e,error:null});try{const r=await dN(e,n);return zr({state:r.state,busyCli:null,error:null}),await xx(),!0}catch(r){return zr({busyCli:null,error:Og(r)}),!1}}async function bN(e){zr({busyCli:e,error:null});try{const n=await fN(e);return zr({state:n.state,busyCli:null,error:null}),await xx(),!0}catch(n){return zr({busyCli:null,error:Og(n)}),!1}}async function xx(){try{$w(await ow())}catch{}}function zr(e){Rm={...Rm,...e};for(const n of km)n()}function Og(e){return e instanceof Error?e.message:String(e)}function yN(){const e=mN();return $.useEffect(()=>{const n=new AbortController;return _N(n.signal),()=>n.abort()},[]),v.jsxs("section",{className:"global-settings-card","aria-label":"Model sign-in",children:[v.jsxs("div",{className:"model-auth-head",children:[v.jsx("p",{className:"global-settings-resp-title",children:"Model Sign-in"}),v.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?v.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,e.loading&&!e.state?v.jsx("p",{className:"global-settings-help",children:"Loading sign-in state."}):null,e.state?.providers.map(n=>v.jsx(SN,{provider:n,busy:e.busyCli===n.cli},n.cli)),v.jsx("p",{className:"global-settings-foot",children:"Sign-in changes apply to newly launched sessions. Running sessions keep their current credentials until relaunched."})]})}function SN({provider:e,busy:n}){const[r,a]=$.useState(""),o=async()=>{await vN(e.cli,r)&&a("")},h=async()=>{await bN(e.cli)};return v.jsxs("div",{className:"model-auth-row",children:[v.jsxs("div",{className:"model-auth-row-head",children:[v.jsx("span",{className:"model-auth-name",children:e.displayName}),v.jsx("span",{className:`model-auth-status ${e.signedIn?"is-on":""}`,children:e.signedIn?"Signed in":"Not signed in"})]}),e.signedIn?v.jsx("div",{className:"model-auth-actions",children:v.jsx("button",{type:"button",className:"model-auth-button",disabled:n,onClick:()=>{h()},children:n?"Working…":"Sign out"})}):v.jsxs("form",{className:"model-auth-form",onSubmit:g=>{g.preventDefault(),o()},children:[v.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:g=>a(g.target.value)}),v.jsx("button",{type:"submit",className:"model-auth-button is-primary",disabled:n||r.trim().length===0,children:n?"Verifying…":"Sign in"})]})]})}async function wN(e){const n=await fetch("/global-settings/state",{signal:e});return await Ex(n),Tx(await n.json(),n.status)}async function CN(e,n){const r=await fetch("/global-settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:n});await Ex(r);const a=await r.json();if(!a||typeof a!="object"||!("state"in a))throw new Fe(r.status,"Invalid global settings mutation response");return{state:Tx(a.state,r.status)}}async function Ex(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 Fe(e.status,n)}function Tx(e,n){const r=e;if(!r||typeof r.replaceSystemPrompt!="boolean"||typeof r.enableMetaphor!="boolean"||r.consolePortMode!=="dynamic"&&r.consolePortMode!=="static"||r.consoleStaticPort!==null&&!xN(r.consoleStaticPort))throw new Fe(n,"Invalid global settings state response");return{replaceSystemPrompt:r.replaceSystemPrompt,enableMetaphor:r.enableMetaphor,consolePortMode:r.consolePortMode,consoleStaticPort:r.consoleStaticPort}}function xN(e){return typeof e=="number"&&Number.isInteger(e)&&e>=1024&&e<=65535}const Lm=new Set;let Mm={loading:!1,state:null,savingField:null,error:null};function EN(){return $.useSyncExternalStore(TN,_y,_y)}function _y(){return Mm}function TN(e){return Lm.add(e),()=>{Lm.delete(e)}}async function AN(e){uo({loading:!0,error:null});try{const n=await wN(e);uo({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;uo({loading:!1,error:Ax(n)})}}async function _h(e,n){uo({savingField:e,error:null});try{const r=await CN({[e]:n});return uo({state:r.state,savingField:null,error:null}),!0}catch(r){return uo({savingField:null,error:Ax(r)}),!1}}function uo(e){Mm={...Mm,...e};for(const n of Lm)n()}function Ax(e){return e instanceof Error?e.message:String(e)}const kN=[{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)"]}],RN=[{id:"webgl",label:"WebGL"},{id:"dom",label:"DOM"}],LN=[{id:"dynamic",label:"Dynamic"},{id:"static",label:"Static"}],MN=1024,DN=65535,ON=[{id:"appearance",label:"Appearance",eyebrow:"Theme · Renderer"},{id:"general",label:"General",eyebrow:"Port · Prompt"},{id:"agent-cli",label:"Agent CLI",eyebrow:"Availability · Sign-in"},{id:"backend-api",label:"Backend API",eyebrow:"Loopback routes"}];function NN(){const e=EN(),n=e.state,r=e.savingField!==null,[a,o]=$.useState("appearance");return $.useEffect(()=>{const h=new AbortController;return AN(h.signal),()=>h.abort()},[]),v.jsxs("main",{className:"global-settings-page",children:[v.jsxs("section",{className:"global-settings-hero","aria-labelledby":"global-settings-title",children:[v.jsxs("div",{children:[v.jsx("p",{className:"bridge-kicker",children:"Fleet Control Surface"}),v.jsx("h2",{id:"global-settings-title",children:"Settings"})]}),v.jsx("div",{className:"global-settings-status",role:"status","aria-live":"polite",children:r?"Saving…":""})]}),e.error?v.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,v.jsxs("section",{className:"global-settings-grid",children:[v.jsx("div",{className:"global-settings-list","aria-label":"Settings sections",children:ON.map(h=>v.jsxs("button",{type:"button",className:`global-settings-nav-item ${h.id===a?"is-active":""}`,"aria-pressed":h.id===a,onClick:()=>o(h.id),children:[v.jsx("span",{className:"global-settings-nav-label",children:h.label}),v.jsx("span",{className:"global-settings-nav-eyebrow",children:h.eyebrow})]},h.id))}),v.jsx("div",{className:"global-settings-detail",children:IN(a,n,r)},a)]})]})}function IN(e,n,r){switch(e){case"appearance":return v.jsx(BN,{});case"general":return v.jsx($N,{state:n,saving:r});case"agent-cli":return v.jsxs(v.Fragment,{children:[v.jsx(ZO,{}),v.jsx(yN,{})]});case"backend-api":return v.jsx(oN,{})}}function BN(){const{activeTheme:e,terminalRenderer:n,terminalFont:r}=yo(),a=Aw(r),o=PN(r);return v.jsxs("section",{className:"global-settings-card","aria-label":"Appearance",children:[v.jsxs("div",{className:"global-settings-row",children:[v.jsxs("div",{className:"global-settings-row-text",children:[v.jsx("p",{className:"global-settings-resp-title",children:"Theme"}),v.jsx("p",{className:"global-settings-help",children:"Console color scheme. Applies immediately and is remembered on this browser."})]}),v.jsx("div",{className:"theme-picker",role:"group","aria-label":"Theme",children:kN.map(h=>{const g=h.id===e;return v.jsxs("button",{type:"button","aria-pressed":g,className:`theme-card ${g?"is-active":""}`,onClick:()=>nR(h.id),children:[v.jsx("span",{className:"theme-card-swatch","aria-hidden":"true",children:h.swatch.map(c=>v.jsx("i",{style:{background:c}},c))}),v.jsx("span",{className:"theme-card-label",children:h.label}),v.jsx("span",{className:"theme-card-check","aria-hidden":"true",children:g?v.jsx(UN,{}):null})]},h.id)})})]}),v.jsxs("div",{className:"global-settings-row",children:[v.jsxs("div",{className:"global-settings-row-text",children:[v.jsx("p",{className:"global-settings-resp-title",children:"Terminal Renderer"}),v.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."})]}),v.jsx("div",{className:"segmented",role:"group","aria-label":"Terminal renderer",children:RN.map(h=>{const g=h.id===n;return v.jsx("button",{type:"button","aria-pressed":g,className:`segmented-option ${g?"is-active":""}`,onClick:()=>iR(h.id),children:h.label},h.id)})})]}),v.jsxs("div",{className:"global-settings-row is-stack",children:[v.jsxs("div",{className:"global-settings-row-text",children:[v.jsxs("p",{className:"global-settings-resp-title",children:["Terminal Font ",v.jsx("span",{className:"new-badge",children:"New"})]}),v.jsx("p",{className:"global-settings-help",id:"terminal-font-help",children:"Typeface and size for every terminal panel — agent-cli and shell alike. Applies live to all open terminals; remembered on this browser."})]}),v.jsxs("div",{className:"font-control","aria-describedby":"terminal-font-help",children:[v.jsxs("div",{className:"current-readout","aria-live":"polite",children:[v.jsx("span",{className:"cr-label",children:"Currently"}),v.jsx("span",{className:"cr-value",children:o}),v.jsx("span",{className:"cr-sep",children:"·"}),v.jsxs("span",{className:"cr-value",children:[r.size,"px"]}),v.jsx("span",{className:"cr-sep",children:"·"}),v.jsx("span",{className:`cr-value ${a.status==="fallback"?"is-fallback":"is-ok"}`,children:a.status})]}),v.jsxs("div",{className:"font-cards",role:"group","aria-label":"Terminal font family",children:[xh.map(h=>v.jsx(jN,{font:h,active:r.source==="curated"&&r.id===h.id,onSelect:()=>rR(h.id)},h.id)),v.jsxs("button",{type:"button","aria-pressed":r.source==="custom",className:`font-card ${r.source==="custom"?"is-active":""}`,onClick:()=>{r.source!=="custom"&&i1("")},children:[v.jsxs("span",{className:"fc-name",children:["Custom…",v.jsx("span",{className:"fc-check","aria-hidden":"true",children:"✓"})]}),v.jsx("span",{className:"fc-sample is-custom","aria-hidden":"true",children:"type a font"}),v.jsx("span",{className:"fc-meta",children:"your installed face"}),v.jsx("span",{className:"fc-bundled fc-addon",children:"local OS font"})]})]}),v.jsx("div",{className:`custom-reveal ${r.source==="custom"?"is-open":""}`,children:v.jsxs("div",{className:"font-field-wrap",children:[v.jsxs("label",{className:"font-field",children:[v.jsx("span",{className:"field-icon","aria-hidden":"true",children:"Aa"}),v.jsx("input",{type:"text",spellCheck:!1,value:r.customName,placeholder:"e.g. MesloLGS NF, Fira Code, IBM Plex Mono","aria-label":"Custom terminal font family",onChange:h=>i1(h.currentTarget.value)})]}),v.jsxs("div",{className:`resolve-chip ${a.status==="fallback"?"is-fallback":"is-ok"}`,"aria-live":"polite",children:[v.jsx("span",{className:"rc-dot","aria-hidden":"true"}),v.jsx("span",{children:zN(r)})]})]})}),v.jsxs("div",{className:"size-row",children:[v.jsxs("div",{className:"size-stepper",role:"group","aria-label":"Font size",children:[v.jsx("button",{type:"button","aria-label":"Decrease terminal font size",disabled:r.size<=Jb.min,onClick:()=>r1(r.size-1),children:"−"}),v.jsxs("span",{className:"size-val",children:[r.size,v.jsx("span",{children:" px"})]}),v.jsx("button",{type:"button","aria-label":"Increase terminal font size",disabled:r.size>=Jb.max,onClick:()=>r1(r.size+1),children:"+"})]}),v.jsx("span",{className:"size-label",children:"Cell size — rescales every panel; zoom stays relative"})]})]})]}),v.jsx("p",{className:"global-settings-foot",children:"Appearance preferences apply immediately and are stored per browser, separate from session settings."})]})}function jN({active:e,font:n,onSelect:r}){return v.jsxs("button",{type:"button","aria-pressed":e,className:`font-card ${e?"is-active":""}`,onClick:r,children:[v.jsxs("span",{className:"fc-name",children:[n.name,v.jsx("span",{className:"fc-check","aria-hidden":"true",children:"✓"})]}),v.jsx("span",{className:"fc-sample",style:{fontFamily:n.family},"aria-hidden":"true",children:"Ag 0O ─┼ =>"}),v.jsx("span",{className:"fc-meta",children:n.meta}),v.jsx("span",{className:"fc-bundled",children:"self-hosted"})]})}function PN(e){return e.source==="custom"?e.customName||`${ih(null).name} (default)`:ih(e.id).name}function zN(e){if(!e.customName)return`Empty — using default ${ih(null).name}`;const n=Aw(e);return n.status==="resolved"?`"${e.customName}" resolves on this machine`:`"${e.customName}" not found — falls back to ${n.fallbackName}`}function $N({state:e,saving:n}){const r=yo();return v.jsxs("section",{className:"global-settings-card","aria-label":"General",children:[e?v.jsxs(v.Fragment,{children:[v.jsx(HN,{state:e,saving:n,consoleState:r}),v.jsx(vy,{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:()=>{_h("replaceSystemPrompt",!e.replaceSystemPrompt)}}),v.jsx(vy,{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:()=>{_h("enableMetaphor",!e.enableMetaphor)}})]}):v.jsx("p",{className:"global-settings-help",children:"Loading settings."}),v.jsx("p",{className:"global-settings-foot",children:"Changes apply to newly launched sessions. Running sessions keep their current configuration until relaunched."})]})}function HN({state:e,saving:n,consoleState:r}){const[a,o]=$.useState(e.consoleStaticPort?.toString()??""),h=r.effectivePort,g=r.portMode==="static"&&!r.portHonored,c=r.requestedPort,u=e.consolePortMode==="static"&&e.consoleStaticPort!==null,d=a.trim(),S=Number(d),p=d.length>0,C=p&&by(S),x=e.consolePortMode==="static"&&p&&!C;return $.useEffect(()=>{o(e.consoleStaticPort?.toString()??"")},[e.consoleStaticPort]),v.jsxs("div",{className:"global-settings-row is-stack console-port-row",children:[v.jsxs("div",{className:"global-settings-row-text",children:[v.jsxs("p",{className:"global-settings-resp-title",children:["Console Port ",v.jsx("span",{className:"new-badge",children:"New"})]}),v.jsx("p",{className:"global-settings-help",children:"Dynamic lets the OS pick a free loopback port each time the console starts. Static pins a port you choose so the console URL stays the same across restarts."})]}),v.jsxs("div",{className:"console-port-control",children:[v.jsx("div",{className:"segmented",role:"group","aria-label":"Console port mode",children:LN.map(A=>{const E=e.consolePortMode===A.id;return v.jsx("button",{type:"button","aria-pressed":E,className:`segmented-option ${E?"is-active":""}`,disabled:n,onClick:()=>{_h("consolePortMode",A.id)},children:A.label},A.id)})}),v.jsx("div",{className:`console-port-reveal ${e.consolePortMode==="static"?"is-open":""}`,children:v.jsxs("div",{className:"console-port-reveal-inner",children:[v.jsx("label",{className:"console-port-input-label",htmlFor:"console-static-port-input",children:"Static port"}),v.jsx("input",{id:"console-static-port-input",className:`console-port-input ${x?"is-invalid":""}`,inputMode:"numeric",placeholder:"8080",value:a,disabled:n,"aria-invalid":x,"aria-describedby":"console-static-port-hint",onChange:A=>{const E=A.target.value;o(E);const m=Number(E.trim());by(m)&&_h("consoleStaticPort",m)}}),v.jsx("span",{id:"console-static-port-hint",className:`console-port-hint ${x?"is-invalid":""}`,children:"1024–65535"})]})}),v.jsxs("div",{className:`console-port-effective ${g?"is-fallback":""}`,"aria-live":"polite",children:[v.jsx("span",{className:"console-port-effective-dot","aria-hidden":"true"}),v.jsxs("div",{children:[v.jsx("p",{className:"console-port-effective-label",children:"Currently reachable on"}),v.jsxs("p",{className:"console-port-effective-value",children:["127.0.0.1:",v.jsx("span",{children:h||"..."}),g?" · Dynamic":""]})]})]}),g&&c?v.jsxs("div",{className:"console-port-warning",role:"status",children:["Port ",v.jsx("strong",{children:c})," was unavailable — the console fell back to a ",v.jsx("strong",{children:"Dynamic"})," port and is running on ",v.jsxs("strong",{children:["127.0.0.1:",h||"..."]}),"."," ",u?v.jsxs(v.Fragment,{children:["Next restart will try ",v.jsx("strong",{children:e.consoleStaticPort}),"."]}):v.jsx(v.Fragment,{children:"Next restart will use a dynamic port."})]}):null,v.jsx("p",{className:"console-port-note",children:"Applies when the console restarts. Console-wide — shared across every browser."})]})]})}function vy({title:e,help:n,onLabel:r,offLabel:a,value:o,disabled:h,onToggle:g}){return v.jsxs("div",{className:"global-settings-row",children:[v.jsxs("div",{className:"global-settings-row-text",children:[v.jsx("p",{className:"global-settings-resp-title",children:e}),v.jsx("p",{className:"global-settings-help",children:n})]}),v.jsx("button",{type:"button",className:`global-settings-toggle ${o?"is-on":""}`,disabled:h,"aria-pressed":o,onClick:g,children:v.jsx("span",{children:o?r:a})})]})}function by(e){return Number.isInteger(e)&&e>=MN&&e<=DN}function UN(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.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 FN="button",qN=184,WN=320,Au=12;function GN({state:e,onSelect:n,mode:r=FN,anchor:a,viewportBounds:o,onClose:h}){const[g,c]=$.useState(r==="menu"),u=$.useRef(null),d=$.useRef(null),S=$.useRef(null),p=e.creatingTerminalSession||e.addingTheater||!e.activeTheaterId||e.agentClis.length===0,C=r==="menu"||g;$.useEffect(()=>{r==="menu"&&c(!0)},[r,a?.x,a?.y]),$.useEffect(()=>{if(!C)return;const m=f=>{u.current?.contains(f.target)||x()},y=f=>{f.key==="Escape"&&(x(),d.current?.focus())};return document.addEventListener("mousedown",m),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",y)}},[C]),$.useEffect(()=>{C&&S.current?.focus()},[C]);const x=()=>{c(!1),h?.()},A=async m=>{p||Dm(m)!==null||(c(!1),d.current?.focus(),await n(m))},E=m=>{if(m.key!=="ArrowDown"&&m.key!=="ArrowUp")return;m.preventDefault();const y=Array.from(S.current?.querySelectorAll("[role^='menuitem']:not(:disabled)")??[]);if(y.length===0)return;const f=y.indexOf(document.activeElement),b=f===-1?m.key==="ArrowDown"?0:y.length-1:(f+(m.key==="ArrowDown"?1:-1)+y.length)%y.length;y[b]?.focus()};return v.jsxs("div",{className:`operation-launch-control ${r==="menu"?"operation-launch-control--canvas":""}`,ref:u,style:a?KN(a,o):void 0,"data-canvas-blocker":!0,children:[r==="button"?v.jsx("button",{type:"button",ref:d,className:`workspace-add-button ${g?"is-open":""}`,onClick:()=>c(m=>!m),disabled:p,"aria-haspopup":"menu","aria-expanded":g,"aria-label":"Launch operation",children:v.jsx(VN,{})}):null,C?v.jsx("div",{className:"operation-launch-menu theater-menu",role:"menu","aria-label":"Launch operation",tabIndex:-1,ref:S,onKeyDown:E,children:e.agentClis.length>0?v.jsx("ul",{className:"theater-menu-list",children:e.agentClis.map(m=>{const y=Dm(m),f=p||y!==null;return v.jsx("li",{children:v.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item operation-launch-menu-item",disabled:f,"aria-disabled":f,title:y??void 0,onClick:()=>{A(m)},children:[v.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:kx(m.id)}),v.jsx("span",{className:"theater-menu-label",children:m.label}),y?v.jsx("span",{className:"operation-launch-menu-reason",children:y}):null]})},m.id)})}):v.jsx("p",{className:"theater-menu-empty",children:"No Agent CLI available."})}):null]})}function Dm(e){return e.available?e.signedIn?null:"Sign-in required":"Not installed"}function KN(e,n){return n?{left:Math.max(Au,Math.min(e.x,n.width-qN-Au)),top:Math.max(Au,Math.min(e.y,n.height-WN-Au))}:{left:e.x,top:e.y}}function VN(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function kx(e){return e==="claude"?v.jsx(YN,{}):e==="claude-kimi"?v.jsx(XN,{}):e==="claude-glm"?v.jsx(ZN,{}):e==="codex"?v.jsx(JN,{}):v.jsx(QN,{})}function YN(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.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 XN(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.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 ZN(){return v.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",style:{display:"inline-block",verticalAlign:"middle"},children:v.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 JN(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.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 QN(){return v.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[v.jsx("rect",{x:"2.8",y:"3.4",width:"10.4",height:"8.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.15"}),v.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 e8=208,t8=360,ku=12;function n8({state:e,anchor:n,viewportBounds:r,onLaunchCli:a,onOpenShell:o,onResetView:h,onClose:g}){const c=$.useRef(null),u=$.useRef(null),d=e.creatingTerminalSession||e.addingTheater||!e.activeTheaterId||e.agentClis.length===0,S=!e.activeTheaterId;return $.useEffect(()=>{const p=x=>{c.current?.contains(x.target)||g()},C=x=>{x.key==="Escape"&&g()};return document.addEventListener("mousedown",p),document.addEventListener("keydown",C),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",C)}},[g]),$.useEffect(()=>{u.current?.focus()},[]),v.jsx("div",{className:"operation-launch-control operation-launch-control--canvas",ref:c,style:i8(n,r),"data-canvas-blocker":!0,children:v.jsxs("div",{className:"operation-launch-menu theater-menu canvas-context-menu",role:"menu","aria-label":"Canvas actions",tabIndex:-1,ref:u,children:[v.jsx("p",{className:"canvas-context-menu-group",children:"New Operation"}),e.agentClis.length>0?v.jsx("ul",{className:"theater-menu-list",children:e.agentClis.map(p=>{const C=Dm(p),x=d||C!==null;return v.jsx("li",{children:v.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item operation-launch-menu-item",disabled:x,"aria-disabled":x,title:C??void 0,onClick:()=>{C===null&&!d&&a(p)},children:[v.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:kx(p.id)}),v.jsx("span",{className:"theater-menu-label",children:p.label}),C?v.jsx("span",{className:"operation-launch-menu-reason",children:C}):null]})},p.id)})}):v.jsx("p",{className:"theater-menu-empty",children:"No Agent CLI available."}),v.jsx("div",{className:"theater-menu-divider",role:"separator"}),v.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item canvas-context-menu-item",disabled:S,onClick:o,children:[v.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:v.jsx(r8,{})}),v.jsx("span",{className:"theater-menu-label",children:"Open Shell"})]}),v.jsx("div",{className:"theater-menu-divider",role:"separator"}),v.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item canvas-context-menu-item",onClick:h,children:[v.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:v.jsx(s8,{})}),v.jsx("span",{className:"theater-menu-label",children:"Reset view"})]})]})})}function i8(e,n){return n?{left:Math.max(ku,Math.min(e.x,n.width-e8-ku)),top:Math.max(ku,Math.min(e.y,n.height-t8-ku))}:{left:e.x,top:e.y}}function r8(){return v.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[v.jsx("rect",{x:"2.8",y:"3.4",width:"10.4",height:"9.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.15"}),v.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 s8(){return v.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[v.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"}),v.jsx("path",{d:"M2.4 4.6v2.8h2.8",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})]})}const yy=256,Sy=176,vp=12,Ru=220,Rx="fleet-console.map.radarCollapsed";function a8({panels:e,shellPanels:n,viewport:r,canvasSize:a,onJump:o}){const h=$.useRef(null),g=$.useRef(!1),[c,u]=$.useState(o8);if(a.width<=0||a.height<=0||r.zoom<=0)return null;const d=[...Object.entries(e).map(([j,V])=>({id:j,kind:"op",x:V.x,y:V.y,width:V.width,height:V.height})),...Object.entries(n).map(([j,V])=>({id:j,kind:"shell",x:V.geometry.x,y:V.geometry.y,width:V.geometry.width,height:V.geometry.height}))];if(d.length===0)return null;const S=()=>{u(j=>{const V=!j;return l8(V),V})};if(c)return v.jsx("button",{type:"button",className:"canvas-minimap-fab","data-canvas-blocker":!0,onClick:S,"aria-label":"Radar 펼치기",title:"Show radar",children:v.jsx(u8,{})});const p=yy-vp*2,C=Sy-vp*2,x={x:-r.x/r.zoom,y:-r.y/r.zoom,width:a.width/r.zoom,height:a.height/r.zoom};let A=Math.min(x.x,...d.map(j=>j.x)),E=Math.min(x.y,...d.map(j=>j.y)),m=Math.max(x.x+x.width,...d.map(j=>j.x+j.width)),y=Math.max(x.y+x.height,...d.map(j=>j.y+j.height));A-=Ru,E-=Ru,m+=Ru,y+=Ru;const f=m-A,b=y-E,T=Math.min(p/f,C/b),L=(p-f*T)/2,R=(C-b*T)/2,M=j=>L+(j-A)*T,k=j=>R+(j-E)*T,I=j=>{const V=h.current?.getBoundingClientRect();if(!V)return;const U=j.clientX-V.left,F=j.clientY-V.top;o({x:A+(U-L)/T,y:E+(F-R)/T})},G=j=>{j.stopPropagation(),g.current=!0,j.currentTarget.setPointerCapture(j.pointerId),I(j)},q=j=>{g.current&&(j.stopPropagation(),I(j))},W=j=>{g.current=!1;try{j.currentTarget.releasePointerCapture(j.pointerId)}catch{}};return v.jsxs("div",{className:"canvas-minimap","data-canvas-blocker":!0,style:{width:yy,height:Sy},children:[v.jsx("span",{className:"canvas-minimap-label","aria-hidden":"true",children:"Radar"}),v.jsx("button",{type:"button",className:"canvas-minimap-toggle",onClick:S,"aria-label":"Radar 접기",title:"Collapse radar",children:v.jsx(c8,{})}),v.jsxs("div",{ref:h,className:"canvas-minimap-inner",style:{inset:vp},onPointerDown:G,onPointerMove:q,onPointerUp:W,onPointerCancel:W,role:"presentation","aria-label":"Canvas minimap — drag to navigate",children:[d.map(j=>v.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)),v.jsx("div",{className:"canvas-minimap-view",style:{left:M(x.x),top:k(x.y),width:x.width*T,height:x.height*T}})]})]})}function o8(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Rx)==="true"}catch{return!1}}function l8(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Rx,String(e))}catch{}}function c8(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.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 u8(){return v.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[v.jsx("rect",{x:"2",y:"3",width:"12",height:"10",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),v.jsx("rect",{x:"4.2",y:"5",width:"4.2",height:"3.1",rx:"0.6",fill:"none",stroke:"currentColor",strokeWidth:"1"}),v.jsx("circle",{cx:"11",cy:"10.2",r:"0.95",fill:"currentColor"})]})}function h8({jobs:e,selectedJobId:n,onSelect:r}){const a=r??Ww;return v.jsx("ol",{className:"terminal-job-lines",children:e.map(o=>v.jsx(d8,{job:o,active:n===o.jobId,onSelect:a},o.jobId))})}function d8({job:e,active:n,onSelect:r}){const a=Ch(e.status),o=bk(e),h=e.ownerCarrierId?`${_k(e.ownerCarrierId)} · ${Xp(e.status)}`:Xp(e.status);return v.jsx("li",{children:v.jsxs("button",{type:"button",className:`terminal-job-line ${n?"is-active":""}`,onClick:()=>r(e.jobId),"aria-current":n||void 0,children:[v.jsx("span",{className:`status-dot status-dot--${a}`,"aria-hidden":"true"}),v.jsx("span",{className:"terminal-job-line-label",children:e.label??Yp(e.jobId)}),v.jsx("span",{className:"terminal-job-line-meta",children:h}),o?v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"terminal-job-line-sep","aria-hidden":"true",children:"-"}),v.jsx("span",{className:"terminal-job-line-stream",children:o})]}):null]})})}var bp={exports:{}},wy;function f8(){return wy||(wy=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 h=this._terminal._core;this._terminal.rows===o.rows&&this._terminal.cols===o.cols||(h._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,h=o._renderService.dimensions;if(h.css.cell.width===0||h.css.cell.height===0)return;const g=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),p=u-(parseInt(S.getPropertyValue("padding-top"))+parseInt(S.getPropertyValue("padding-bottom"))),C=d-(parseInt(S.getPropertyValue("padding-right"))+parseInt(S.getPropertyValue("padding-left")))-g;return{cols:Math.max(2,Math.floor(C/h.css.cell.width)),rows:Math.max(1,Math.floor(p/h.css.cell.height))}}}})(),r})()))})(bp)),bp.exports}var p8=f8(),Wu={exports:{}},m8=Wu.exports,Cy;function g8(){return Cy||(Cy=1,(function(e,n){(function(r,a){e.exports=a()})(m8,(()=>(()=>{var r={433:(g,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]],p=[[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]],x=[[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 E(m,y){let f,b=0,T=y.length-1;if(m<y[0][0]||m>y[T][1])return!1;for(;T>=b;)if(f=b+T>>1,m>y[f][1])b=f+1;else{if(!(m<y[f][0]))return!0;T=f-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 m=0;m<S.length;++m)A.fill(0,S[m][0],S[m][1]+1);for(let m=0;m<C.length;++m)A.fill(2,C[m][0],C[m][1]+1)}}wcwidth(m){return m<32?0:m<127?1:m<65536?A[m]:E(m,p)?0:E(m,x)?2:1}charProperties(m,y){let f=this.wcwidth(m),b=f===0&&y!==0;if(b){const T=d.UnicodeService.extractWidth(y);T===0?b=!1:T>f&&(f=T)}return d.UnicodeService.createPropertyValue(0,f,b)}}},345:(g,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 p=0;p<this._listeners.length;p++)S.push(this._listeners[p]);for(let p=0;p<S.length;p++)S[p].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:(g,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]],p=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let 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 x=0;x<S.length;++x)C.fill(0,S[x][0],S[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?C[x]:(function(A,E){let m,y=0,f=E.length-1;if(A<E[0][0]||A>E[f][1])return!1;for(;f>=y;)if(m=y+f>>1,A>E[m][1])y=m+1;else{if(!(A<E[m][0]))return!0;f=m-1}return!1})(x,p)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,A){let E=this.wcwidth(x),m=E===0&&A!==0;if(m){const y=d.UnicodeService.extractWidth(A);y===0?m=!1:y>E&&(E=y)}return d.UnicodeService.createPropertyValue(0,E,m)}}},938:(g,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const d=u(345),S=u(490);class p{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,A,E=!1){return(16777215&x)<<3|(3&A)<<1|(E?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const x=new S.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let A=0,E=0;const m=x.length;for(let y=0;y<m;++y){let f=x.charCodeAt(y);if(55296<=f&&f<=56319){if(++y>=m)return A+this.wcwidth(f);const L=x.charCodeAt(y);56320<=L&&L<=57343?f=1024*(f-55296)+L-56320+65536:A+=this.wcwidth(L)}const b=this.charProperties(f,E);let T=p.extractWidth(b);p.extractShouldJoin(b)&&(T-=p.extractWidth(E)),A+=T,E=b}return A}charProperties(x,A){return this._activeProvider.charProperties(x,A)}}c.UnicodeService=p}},a={};function o(g){var c=a[g];if(c!==void 0)return c.exports;var u=a[g]={exports:{}};return r[g](u,u.exports,o),u.exports}var h={};return(()=>{var g=h;Object.defineProperty(g,"__esModule",{value:!0}),g.Unicode11Addon=void 0;const c=o(433);g.Unicode11Addon=class{activate(u){u.unicode.register(new c.UnicodeV11)}dispose(){}}})(),h})()))})(Wu)),Wu.exports}var _8=g8();var v8=(e,n,r,a)=>{for(var o=n,h=e.length-1,g;h>=0;h--)(g=e[h])&&(o=g(o)||o);return o},b8=(e,n)=>(r,a)=>n(r,a,e),y8=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?xy.isErrorNoTelemetry(e)?new xy(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)}},S8=new y8;function yp(e){w8(e)||S8.onUnexpectedError(e)}var Om="Canceled";function w8(e){return e instanceof C8?!0:e instanceof Error&&e.name===Om&&e.message===Om}var C8=class extends Error{constructor(){super(Om),this.name=this.message}},xy=class Nm extends Error{constructor(n){super(n),this.name="CodeExpectedError"}static fromError(n){if(n instanceof Nm)return n;let r=new Nm;return r.message=n.message,r.stack=n.stack,r}static isErrorNoTelemetry(n){return n.name==="CodeExpectedError"}},x8;(e=>{function n(h){return h<0}e.isLessThan=n;function r(h){return h<=0}e.isLessThanOrEqual=r;function a(h){return h>0}e.isGreaterThan=a;function o(h){return h===0}e.isNeitherLessOrGreaterThan=o,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(x8||={});function E8(e,n){let r=this,a=!1,o;return function(){return a||(a=!0,n||(o=e.apply(r,arguments))),o}}var Lx;(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 h(T){return n(T)?T:o(T)}e.wrap=h;function g(T){return T||r}e.from=g;function*c(T){for(let L=T.length-1;L>=0;L--)yield T[L]}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,L){let R=0;for(let M of T)if(L(M,R++))return!0;return!1}e.some=S;function p(T,L){for(let R of T)if(L(R))return R}e.find=p;function*C(T,L){for(let R of T)L(R)&&(yield R)}e.filter=C;function*x(T,L){let R=0;for(let M of T)yield L(M,R++)}e.map=x;function*A(T,L){let R=0;for(let M of T)yield*L(M,R++)}e.flatMap=A;function*E(...T){for(let L of T)yield*L}e.concat=E;function m(T,L,R){let M=R;for(let k of T)M=L(M,k);return M}e.reduce=m;function*y(T,L,R=T.length){for(L<0&&(L+=T.length),R<0?R+=T.length:R>T.length&&(R=T.length);L<R;L++)yield T[L]}e.slice=y;function f(T,L=Number.POSITIVE_INFINITY){let R=[];if(L===0)return[R,T];let M=T[Symbol.iterator]();for(let k=0;k<L;k++){let I=M.next();if(I.done)return[R,e.empty()];R.push(I.value)}return[R,{[Symbol.iterator](){return M}}]}e.consume=f;async function b(T){let L=[];for await(let R of T)L.push(R);return Promise.resolve(L)}e.asyncToArray=b})(Lx||={});function Mx(e){if(Lx.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 Dx(...e){return In(()=>Mx(e))}function In(e){return{dispose:E8(()=>{e()})}}var Ox=class Nx{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{Mx(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?Nx.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)}};Ox.DISABLE_DISPOSED_WARNING=!1;var ho=Ox,Vi=class{constructor(){this._store=new ho,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)}};Vi.None=Object.freeze({dispose(){}});var Al=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}},Ng=typeof process<"u"&&"title"in process,Oh=Ng?"node":navigator.userAgent,T8=Ng?"node":navigator.platform,A8=Oh.includes("Firefox"),k8=Oh.includes("Edge"),Ix=/^((?!chrome|android).)*safari/i.test(Oh);function R8(){if(!Ix)return 0;let e=Oh.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}T8.indexOf("Linux")>=0;var L8="",_n=0,vn=0,bn=0,Kt=0,ki={css:"#00000000",rgba:0},zn;(e=>{function n(o,h,g,c){return c!==void 0?`#${Xs(o)}${Xs(h)}${Xs(g)}${Xs(c)}`:`#${Xs(o)}${Xs(h)}${Xs(g)}`}e.toCss=n;function r(o,h,g,c=255){return(o<<24|h<<16|g<<8|c)>>>0}e.toRgba=r;function a(o,h,g,c){return{css:e.toCss(o,h,g,c),rgba:e.toRgba(o,h,g,c)}}e.toColor=a})(zn||={});var Il;(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,p=d.rgba>>16&255,C=d.rgba>>8&255,x=u.rgba>>24&255,A=u.rgba>>16&255,E=u.rgba>>8&255;_n=x+Math.round((S-x)*Kt),vn=A+Math.round((p-A)*Kt),bn=E+Math.round((C-E)*Kt);let m=zn.toCss(_n,vn,bn),y=zn.toRgba(_n,vn,bn);return{css:m,rgba:y}}e.blend=n;function r(u){return(u.rgba&255)===255}e.isOpaque=r;function a(u,d,S){let p=ia.ensureContrastRatio(u.rgba,d.rgba,S);if(p)return zn.toColor(p>>24&255,p>>16&255,p>>8&255)}e.ensureContrastRatio=a;function o(u){let d=(u.rgba|255)>>>0;return[_n,vn,bn]=ia.toChannels(d),{css:zn.toCss(_n,vn,bn),rgba:d}}e.opaque=o;function h(u,d){return Kt=Math.round(d*255),[_n,vn,bn]=ia.toChannels(u.rgba),{css:zn.toCss(_n,vn,bn,Kt),rgba:zn.toRgba(_n,vn,bn,Kt)}}e.opacity=h;function g(u,d){return Kt=u.rgba&255,h(u,Kt*d/255)}e.multiplyOpacity=g;function c(u){return[u.rgba>>24&255,u.rgba>>16&255,u.rgba>>8&255]}e.toColorRGB=c})(Il||={});var M8;(e=>{let n,r;try{let o=document.createElement("canvas");o.width=1,o.height=1;let h=o.getContext("2d",{willReadFrequently:!0});h&&(n=h,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),zn.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),zn.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 h=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(h)return _n=parseInt(h[1]),vn=parseInt(h[2]),bn=parseInt(h[3]),Kt=Math.round((h[5]===void 0?1:parseFloat(h[5]))*255),zn.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:zn.toRgba(_n,vn,bn,Kt),css:o}}e.toColor=a})(M8||={});var jn;(e=>{function n(a){return r(a>>16&255,a>>8&255,a&255)}e.relativeLuminance=n;function r(a,o,h){let g=a/255,c=o/255,u=h/255,d=g<=.03928?g/12.92:Math.pow((g+.055)/1.055,2.4),S=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4),p=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4);return d*.2126+S*.7152+p*.0722}e.relativeLuminance2=r})(jn||={});var ia;(e=>{function n(g,c){if(Kt=(c&255)/255,Kt===1)return c;let u=c>>24&255,d=c>>16&255,S=c>>8&255,p=g>>24&255,C=g>>16&255,x=g>>8&255;return _n=p+Math.round((u-p)*Kt),vn=C+Math.round((d-C)*Kt),bn=x+Math.round((S-x)*Kt),zn.toRgba(_n,vn,bn)}e.blend=n;function r(g,c,u){let d=jn.relativeLuminance(g>>8),S=jn.relativeLuminance(c>>8);if(Mr(d,S)<u){if(S<d){let x=a(g,c,u),A=Mr(d,jn.relativeLuminance(x>>8));if(A<u){let E=o(g,c,u),m=Mr(d,jn.relativeLuminance(E>>8));return A>m?x:E}return x}let p=o(g,c,u),C=Mr(d,jn.relativeLuminance(p>>8));if(C<u){let x=a(g,c,u),A=Mr(d,jn.relativeLuminance(x>>8));return C>A?p:x}return p}}e.ensureContrastRatio=r;function a(g,c,u){let d=g>>24&255,S=g>>16&255,p=g>>8&255,C=c>>24&255,x=c>>16&255,A=c>>8&255,E=Mr(jn.relativeLuminance2(C,x,A),jn.relativeLuminance2(d,S,p));for(;E<u&&(C>0||x>0||A>0);)C-=Math.max(0,Math.ceil(C*.1)),x-=Math.max(0,Math.ceil(x*.1)),A-=Math.max(0,Math.ceil(A*.1)),E=Mr(jn.relativeLuminance2(C,x,A),jn.relativeLuminance2(d,S,p));return(C<<24|x<<16|A<<8|255)>>>0}e.reduceLuminance=a;function o(g,c,u){let d=g>>24&255,S=g>>16&255,p=g>>8&255,C=c>>24&255,x=c>>16&255,A=c>>8&255,E=Mr(jn.relativeLuminance2(C,x,A),jn.relativeLuminance2(d,S,p));for(;E<u&&(C<255||x<255||A<255);)C=Math.min(255,C+Math.ceil((255-C)*.1)),x=Math.min(255,x+Math.ceil((255-x)*.1)),A=Math.min(255,A+Math.ceil((255-A)*.1)),E=Mr(jn.relativeLuminance2(C,x,A),jn.relativeLuminance2(d,S,p));return(C<<24|x<<16|A<<8|255)>>>0}e.increaseLuminance=o;function h(g){return[g>>24&255,g>>16&255,g>>8&255,g&255]}e.toChannels=h})(ia||={});function Xs(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 Ig(e){return 57508<=e&&e<=57558}function D8(e){return 57520<=e&&e<=57527}function O8(e){return 57344<=e&&e<=63743}function N8(e){return 9472<=e&&e<=9631}function I8(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 B8(e,n,r,a){return n===1&&r>Math.ceil(a*1.5)&&e!==void 0&&e>255&&!I8(e)&&!Ig(e)&&!O8(e)}function Bx(e){return Ig(e)||N8(e)}function j8(){return{css:{canvas:Lu(),cell:Lu()},device:{canvas:Lu(),cell:Lu(),char:{width:0,height:0,left:0,top:0}}}}function Lu(){return{width:0,height:0}}function P8(e,n,r=0){return(e-(Math.round(n)*2-r))%(Math.round(n)*2)}var Rn=0,gn=0,tr=!1,Dr=!1,Mu=!1,Qn,Sp=0,z8=class{constructor(e,n,r,a,o,h){this._terminal=e,this._optionService=n,this._selectionRenderModel=r,this._decorationService=a,this._coreBrowserService=o,this._themeService=h,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,gn=0,Rn=0,Dr=!1,tr=!1,Mu=!1,Qn=this._themeService.colors,Sp=0,e.getCode()!==0&&e.extended.underlineStyle===4){let o=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));Sp=n*a%(Math.round(o)*2)}if(this._decorationService.forEachDecorationAtCell(n,r,"bottom",o=>{o.backgroundColorRGB&&(gn=o.backgroundColorRGB.rgba>>8&16777215,Dr=!0),o.foregroundColorRGB&&(Rn=o.foregroundColorRGB.rgba>>8&16777215,tr=!0)}),Mu=this._selectionRenderModel.isCellSelected(this._terminal,n,r),Mu){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:gn=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:gn=(this.result.fg&16777215)<<8|255;break;default:gn=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:gn=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:gn=(this.result.bg&16777215)<<8|255;break}gn=ia.blend(gn,(this._coreBrowserService.isFocused?Qn.selectionBackgroundOpaque:Qn.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else gn=(this._coreBrowserService.isFocused?Qn.selectionBackgroundOpaque:Qn.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(Dr=!0,Qn.selectionForeground&&(Rn=Qn.selectionForeground.rgba>>8&16777215,tr=!0),Bx(e.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)Rn=(this._coreBrowserService.isFocused?Qn.selectionBackgroundOpaque:Qn.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:Rn=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Rn=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:Rn=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Rn=(this.result.fg&16777215)<<8|255;break;default:Rn=this._themeService.colors.foreground.rgba}Rn=ia.blend(Rn,(this._coreBrowserService.isFocused?Qn.selectionBackgroundOpaque:Qn.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}tr=!0}}this._decorationService.forEachDecorationAtCell(n,r,"top",o=>{o.backgroundColorRGB&&(gn=o.backgroundColorRGB.rgba>>8&16777215,Dr=!0),o.foregroundColorRGB&&(Rn=o.foregroundColorRGB.rgba>>8&16777215,tr=!0)}),Dr&&(Mu?gn=e.bg&-16777216&-134217729|gn|50331648:gn=e.bg&-16777216|gn|50331648),tr&&(Rn=e.fg&-16777216&-67108865|Rn|50331648),this.result.fg&67108864&&(Dr&&!tr&&((this.result.bg&50331648)===0?Rn=this.result.fg&-134217728|Qn.background.rgba>>8&16777215&16777215|50331648:Rn=this.result.fg&-134217728|this.result.bg&67108863,tr=!0),!Dr&&tr&&((this.result.fg&50331648)===0?gn=this.result.bg&-67108864|Qn.foreground.rgba>>8&16777215&16777215|50331648:gn=this.result.bg&-67108864|this.result.fg&67108863,Dr=!0)),Qn=void 0,this.result.bg=Dr?gn:this.result.bg,this.result.fg=tr?Rn:this.result.fg,this.result.ext&=536870911,this.result.ext|=Sp<<29&3758096384}},$8=.5,jx=A8||k8?"bottom":"ideographic",H8={"▀":[{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}]},U8={"░":[[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]]},F8={"─":{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`}},Yl={"":{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}};Yl[""]=Yl[""];Yl[""]=Yl[""];function q8(e,n,r,a,o,h,g,c){let u=H8[n];if(u)return W8(e,u,r,a,o,h),!0;let d=U8[n];if(d)return G8(e,d,r,a,o,h),!0;let S=F8[n];if(S)return K8(e,S,r,a,o,h,c),!0;let p=Yl[n];return p?(V8(e,p,r,a,o,h,g,c),!0):!1}function W8(e,n,r,a,o,h){for(let g=0;g<n.length;g++){let c=n[g],u=o/8,d=h/8;e.fillRect(r+c.x*u,a+c.y*d,c.w*u,c.h*d)}}var Ey=new Map;function G8(e,n,r,a,o,h){let g=Ey.get(n);g||(g=new Map,Ey.set(n,g));let c=e.fillStyle;if(typeof c!="string")throw new Error(`Unexpected fillStyle type "${c}"`);let u=g.get(c);if(!u){let d=n[0].length,S=n.length,p=e.canvas.ownerDocument.createElement("canvas");p.width=d,p.height=S;let C=hn(p.getContext("2d")),x=new ImageData(d,S),A,E,m,y;if(c.startsWith("#"))A=parseInt(c.slice(1,3),16),E=parseInt(c.slice(3,5),16),m=parseInt(c.slice(5,7),16),y=c.length>7&&parseInt(c.slice(7,9),16)||1;else if(c.startsWith("rgba"))[A,E,m,y]=c.substring(5,c.length-1).split(",").map(f=>parseFloat(f));else throw new Error(`Unexpected fillStyle color format "${c}" when drawing pattern glyph`);for(let f=0;f<S;f++)for(let b=0;b<d;b++)x.data[(f*d+b)*4]=A,x.data[(f*d+b)*4+1]=E,x.data[(f*d+b)*4+2]=m,x.data[(f*d+b)*4+3]=n[f][b]*(y*255);C.putImageData(x,0,0),u=hn(e.createPattern(p,null)),g.set(c,u)}e.fillStyle=u,e.fillRect(r,a,o,h)}function K8(e,n,r,a,o,h,g){e.strokeStyle=e.fillStyle;for(let[c,u]of Object.entries(n)){e.beginPath(),e.lineWidth=g*Number.parseInt(c);let d;if(typeof u=="function"){let S=.15/h*o;d=u(.15,S)}else d=u;for(let S of d.split(" ")){let p=S[0],C=Px[p];if(!C){console.error(`Could not find drawing instructions for "${p}"`);continue}let x=S.substring(1).split(",");!x[0]||!x[1]||C(e,zx(x,o,h,r,a,!0,g))}e.stroke(),e.closePath()}}function V8(e,n,r,a,o,h,g,c){let u=new Path2D;u.rect(r,a,o,h),e.clip(u),e.beginPath();let d=g/12;e.lineWidth=c*d;for(let S of n.d.split(" ")){let p=S[0],C=Px[p];if(!C){console.error(`Could not find drawing instructions for "${p}"`);continue}let x=S.substring(1).split(",");!x[0]||!x[1]||C(e,zx(x,o,h,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 Ty(e,n,r=0){return Math.max(Math.min(e,n),r)}var Px={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 zx(e,n,r,a,o,h,g,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*g-u*g,h&&d[S]!==0&&(d[S]=Ty(Math.round(d[S]+.5)-.5,n,0)),d[S]+=a+c*g;for(let S=1;S<d.length;S+=2)d[S]*=r,h&&d[S]!==0&&(d[S]=Ty(Math.round(d[S]+.5)-.5,r,0)),d[S]+=o;return d}var Ay=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={}}},ky=class{constructor(){this._data=new Ay}set(e,n,r,a,o){this._data.get(e,n)||this._data.set(e,n,new Ay),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()}},$x=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()}},Y8=class extends $x{_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())}}},X8=class extends $x{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},Z8=!Ng&&"requestIdleCallback"in window?X8:Y8,io=class Hx{constructor(){this.fg=0,this.bg=0,this.extended=new Ux}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 Hx;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}},Ux=class Fx{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 Fx(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},J8=globalThis.performance&&typeof globalThis.performance.now=="function",Q8=class qx{static create(n){return new qx(n)}constructor(n){this._now=J8&&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=()=>Vi.None;function n(W,j){return p(W,()=>{},0,void 0,!0,void 0,j)}e.defer=n;function r(W){return(j,V=null,U)=>{let F=!1,K;return K=W(X=>{if(!F)return K?K.dispose():F=!0,j.call(V,X)},null,U),F&&K.dispose(),K}}e.once=r;function a(W,j,V){return d((U,F=null,K)=>W(X=>U.call(F,j(X)),null,K),V)}e.map=a;function o(W,j,V){return d((U,F=null,K)=>W(X=>{j(X),U.call(F,X)},null,K),V)}e.forEach=o;function h(W,j,V){return d((U,F=null,K)=>W(X=>j(X)&&U.call(F,X),null,K),V)}e.filter=h;function g(W){return W}e.signal=g;function c(...W){return(j,V=null,U)=>{let F=Dx(...W.map(K=>K(X=>j.call(V,X))));return S(F,U)}}e.any=c;function u(W,j,V,U){let F=V;return a(W,K=>(F=j(F,K),F),U)}e.reduce=u;function d(W,j){let V,U={onWillAddFirstListener(){V=W(F.fire,F)},onDidRemoveLastListener(){V?.dispose()}},F=new Dt(U);return j?.add(F),F.event}function S(W,j){return j instanceof Array?j.push(W):j&&j.add(W),W}function p(W,j,V=100,U=!1,F=!1,K,X){let D,B,N,H=0,Q,le={leakWarningThreshold:K,onWillAddFirstListener(){D=W(ce=>{H++,B=j(B,ce),U&&!N&&(ee.fire(B),B=void 0),Q=()=>{let Y=B;B=void 0,N=void 0,(!U||H>1)&&ee.fire(Y),H=0},typeof V=="number"?(clearTimeout(N),N=setTimeout(Q,V)):N===void 0&&(N=0,queueMicrotask(Q))})},onWillRemoveListener(){F&&H>0&&Q?.()},onDidRemoveLastListener(){Q=void 0,D.dispose()}},ee=new Dt(le);return X?.add(ee),ee.event}e.debounce=p;function C(W,j=0,V){return e.debounce(W,(U,F)=>U?(U.push(F),U):[F],j,void 0,!0,void 0,V)}e.accumulate=C;function x(W,j=(U,F)=>U===F,V){let U=!0,F;return h(W,K=>{let X=U||!j(K,F);return U=!1,F=K,X},V)}e.latch=x;function A(W,j,V){return[e.filter(W,j,V),e.filter(W,U=>!j(U),V)]}e.split=A;function E(W,j=!1,V=[],U){let F=V.slice(),K=W(B=>{F?F.push(B):D.fire(B)});U&&U.add(K);let X=()=>{F?.forEach(B=>D.fire(B)),F=null},D=new Dt({onWillAddFirstListener(){K||(K=W(B=>D.fire(B)),U&&U.add(K))},onDidAddFirstListener(){F&&(j?setTimeout(X):X())},onDidRemoveLastListener(){K&&K.dispose(),K=null}});return U&&U.add(D),D.event}e.buffer=E;function m(W,j){return(V,U,F)=>{let K=j(new f);return W(function(X){let D=K.evaluate(X);D!==y&&V.call(U,D)},void 0,F)}}e.chain=m;let y=Symbol("HaltChainable");class f{constructor(){this.steps=[]}map(j){return this.steps.push(j),this}forEach(j){return this.steps.push(V=>(j(V),V)),this}filter(j){return this.steps.push(V=>j(V)?V:y),this}reduce(j,V){let U=V;return this.steps.push(F=>(U=j(U,F),U)),this}latch(j=(V,U)=>V===U){let V=!0,U;return this.steps.push(F=>{let K=V||!j(F,U);return V=!1,U=F,K?F:y}),this}evaluate(j){for(let V of this.steps)if(j=V(j),j===y)break;return j}}function b(W,j,V=U=>U){let U=(...D)=>X.fire(V(...D)),F=()=>W.on(j,U),K=()=>W.removeListener(j,U),X=new Dt({onWillAddFirstListener:F,onDidRemoveLastListener:K});return X.event}e.fromNodeEventEmitter=b;function T(W,j,V=U=>U){let U=(...D)=>X.fire(V(...D)),F=()=>W.addEventListener(j,U),K=()=>W.removeEventListener(j,U),X=new Dt({onWillAddFirstListener:F,onDidRemoveLastListener:K});return X.event}e.fromDOMEventEmitter=T;function L(W){return new Promise(j=>r(W)(j))}e.toPromise=L;function R(W){let j=new Dt;return W.then(V=>{j.fire(V)},()=>{j.fire(void 0)}).finally(()=>{j.dispose()}),j.event}e.fromPromise=R;function M(W,j){return W(V=>j.fire(V))}e.forward=M;function k(W,j,V){return j(V),W(U=>j(U))}e.runAndSubscribe=k;class I{constructor(j,V){this._observable=j,this._counter=0,this._hasChanged=!1;let U={onWillAddFirstListener:()=>{j.addObserver(this)},onDidRemoveLastListener:()=>{j.removeObserver(this)}};this.emitter=new Dt(U),V&&V.add(this.emitter)}beginUpdate(j){this._counter++}handlePossibleChange(j){}handleChange(j,V){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 G(W,j){return new I(W,j).emitter.event}e.fromObservable=G;function q(W){return(j,V,U)=>{let F=0,K=!1,X={beginUpdate(){F++},endUpdate(){F--,F===0&&(W.reportChanges(),K&&(K=!1,j.call(V)))},handlePossibleChange(){},handleChange(){K=!0}};W.addObserver(X),W.reportChanges();let D={dispose(){W.removeObserver(X)}};return U instanceof ho?U.add(D):Array.isArray(U)&&U.push(D),D}}e.fromObservableLight=q})(jr||={});var Im=class Bm{constructor(n){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${n}_${Bm._idPool++}`,Bm.all.add(this)}start(n){this._stopWatch=new Q8,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}}};Im.all=new Set,Im._idPool=0;var eI=Im,tI=-1,Wx=class Gx{constructor(n,r,a=(Gx._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[h,g]=this.getMostFrequentStack(),c=`[${this.name}] potential listener LEAK detected, having ${r} listeners already. MOST frequent listener (${g}):`;console.warn(c),console.warn(h);let u=new rI(c,h);this._errorHandler(u)}return()=>{let h=this._stacks.get(n.value)||0;this._stacks.set(n.value,h-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}};Wx._idPool=1;var nI=Wx,iI=class Kx{constructor(n){this.value=n}static create(){let n=new Error;return new Kx(n.stack??"")}print(){console.warn(this.value.split(`
710
- `).slice(2).join(`
711
- `))}},rI=class extends Error{constructor(e,n){super(e),this.name="ListenerLeakError",this.stack=n}},sI=class extends Error{constructor(e,n){super(e),this.name="ListenerRefusalError",this.stack=n}},aI=0,wp=class{constructor(e){this.value=e,this.id=aI++}},oI=2,lI,Dt=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new nI(e?.onListenerError??yp,this._options?.leakWarningThreshold??tI):void 0,this._perfMon=this._options?._profName?new eI(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 g=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(g);let c=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],u=new sI(`${g}. HINT: Stack shows most frequent listener (${c[1]}-times)`,c[0]);return(this._options?.onListenerError||yp)(u),Vi.None}if(this._disposed)return Vi.None;n&&(e=e.bind(n));let a=new wp(e),o;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(a.stack=iI.create(),o=this._leakageMon.check(a.stack,this._size+1)),this._listeners?this._listeners instanceof wp?(this._deliveryQueue??=new cI,this._listeners=[this._listeners,a]):this._listeners.push(a):(this._options?.onWillAddFirstListener?.(this),this._listeners=a,this._options?.onDidAddFirstListener?.(this)),this._size++;let h=In(()=>{o?.(),this._removeListener(a)});return r instanceof ho?r.add(h):Array.isArray(r)&&r.push(h),h},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*oI<=n.length){let o=0;for(let h=0;h<n.length;h++)n[h]?n[o++]=n[h]: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||yp;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 wp)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}},cI=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}},Ry={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}},kl=2,Rl,vs=class eo{constructor(n,r,a){this._document=n,this._config=r,this._unicodeService=a,this._didWarmUp=!1,this._cacheMap=new ky,this._cacheMapCombined=new ky,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new io,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=Vx(n,this._config.deviceCellWidth*4+kl*2,this._config.deviceCellHeight+kl*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 Z8;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(eo.maxAtlasPages&&this._pages.length>=Math.max(4,eo.maxAtlasPages)){let r=this._pages.filter(d=>d.canvas.width*2<=(eo.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 h=r.slice(a,a+4),g=h.map(d=>d.glyphs[0].texturePage).sort((d,S)=>d>S?1:-1),c=this.pages.length-h.length,u=this._mergePages(h,c);u.version++;for(let d=g.length-1;d>=0;d--)this._deletePage(g[d]);this.pages.push(u),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(u.canvas)}let n=new Cp(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 Cp(this._document,a,n);for(let[h,g]of n.entries()){let c=h*g.canvas.width%a,u=Math.floor(h/2)*g.canvas.height;o.ctx.drawImage(g.canvas,c,u);for(let S of g.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(g.canvas);let d=this._activePages.indexOf(g);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,h,g){return this._getFromCacheMap(this._cacheMapCombined,n,r,a,o,h,g)}getRasterizedGlyph(n,r,a,o,h,g){return this._getFromCacheMap(this._cacheMap,n,r,a,o,h,g)}_getFromCacheMap(n,r,a,o,h,g,c){return Rl=n.get(r,a,o,h),Rl||(Rl=this._drawToCache(r,a,o,h,g,c),n.set(r,a,o,h,Rl)),Rl}_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 ki;let h;switch(n){case 16777216:case 33554432:h=this._getColorFromAnsiIndex(r);break;case 50331648:let g=io.toColorRGB(r);h=zn.toColor(g[0],g[1],g[2]);break;default:a?h=Il.opaque(this._config.colors.foreground):h=this._config.colors.background;break}return this._config.allowTransparency||(h=Il.opaque(h)),h}_getForegroundColor(n,r,a,o,h,g,c,u,d,S){let p=this._getMinimumContrastColor(n,r,a,o,h,g,c,d,u,S);if(p)return p;let C;switch(h){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&d&&g<8&&(g+=8),C=this._getColorFromAnsiIndex(g);break;case 50331648:let x=io.toColorRGB(g);C=zn.toColor(x[0],x[1],x[2]);break;default:c?C=this._config.colors.background:C=this._config.colors.foreground}return this._config.allowTransparency&&(C=Il.opaque(C)),u&&(C=Il.multiplyOpacity(C,$8)),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,h,g,c,u,d,S){if(this._config.minimumContrastRatio===1||S)return;let p=this._getContrastCache(d),C=p.getColor(n,o);if(C!==void 0)return C||void 0;let x=this._resolveBackgroundRgba(r,a,c),A=this._resolveForegroundRgba(h,g,c,u),E=ia.ensureContrastRatio(x,A,this._config.minimumContrastRatio/(d?2:1));if(!E){p.setColor(n,o,null);return}let m=zn.toColor(E>>24&255,E>>16&255,E>>8&255);return p.setColor(n,o,m),m}_getContrastCache(n){return n?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(n,r,a,o,h,g){let c=typeof n=="number"?String.fromCharCode(n):n;g&&this._tmpCanvas.parentElement!==g&&(this._tmpCanvas.style.display="none",g.append(this._tmpCanvas));let u=Math.min(this._config.deviceCellWidth*Math.max(c.length,2)+kl*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width<u&&(this._tmpCanvas.width=u);let d=Math.min(this._config.deviceCellHeight+kl*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 Ry;let S=!!this._workAttributeData.isBold(),p=!!this._workAttributeData.isInverse(),C=!!this._workAttributeData.isDim(),x=!!this._workAttributeData.isItalic(),A=!!this._workAttributeData.isUnderline(),E=!!this._workAttributeData.isStrikethrough(),m=!!this._workAttributeData.isOverline(),y=this._workAttributeData.getFgColor(),f=this._workAttributeData.getFgColorMode(),b=this._workAttributeData.getBgColor(),T=this._workAttributeData.getBgColorMode();if(p){let B=y;y=b,b=B;let N=f;f=T,T=N}let L=this._getBackgroundColor(T,b,p,C);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=L.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";let R=S?this._config.fontWeightBold:this._config.fontWeight,M=x?"italic":"";this._tmpCtx.font=`${M} ${R} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=jx;let k=c.length===1&&Ig(c.charCodeAt(0)),I=c.length===1&&D8(c.charCodeAt(0)),G=this._getForegroundColor(r,T,b,a,f,y,p,C,S,Bx(c.charCodeAt(0)));this._tmpCtx.fillStyle=G.css;let q=I?0:kl*2,W=!1;this._config.customGlyphs!==!1&&(W=q8(this._tmpCtx,c,q,q,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let j=!k,V;if(typeof n=="number"?V=this._unicodeService.wcwidth(n):V=this._unicodeService.getStringCellWidth(n),A){this._tmpCtx.save();let B=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),N=B%2===1?.5:0;if(this._tmpCtx.lineWidth=B,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())j=!1,this._tmpCtx.strokeStyle=`rgb(${io.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{j=!1;let Y=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Y<8&&(Y+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Y).css}this._tmpCtx.beginPath();let H=q,Q=Math.ceil(q+this._config.deviceCharHeight)-N-(h?B*2:0),le=Q+B,ee=Q+B*2,ce=this._workAttributeData.getUnderlineVariantOffset();for(let Y=0;Y<V;Y++){this._tmpCtx.save();let P=H+Y*this._config.deviceCellWidth,re=H+(Y+1)*this._config.deviceCellWidth,fe=P+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(P,Q),this._tmpCtx.lineTo(re,Q),this._tmpCtx.moveTo(P,ee),this._tmpCtx.lineTo(re,ee);break;case 3:let Se=B<=1?ee:Math.ceil(q+this._config.deviceCharHeight-B/2)-N,ye=B<=1?Q:Math.ceil(q+this._config.deviceCharHeight+B/2)-N,Pe=new Path2D;Pe.rect(P,Q,this._config.deviceCellWidth,ee-Q),this._tmpCtx.clip(Pe),this._tmpCtx.moveTo(P-this._config.deviceCellWidth/2,le),this._tmpCtx.bezierCurveTo(P-this._config.deviceCellWidth/2,ye,P,ye,P,le),this._tmpCtx.bezierCurveTo(P,Se,fe,Se,fe,le),this._tmpCtx.bezierCurveTo(fe,ye,re,ye,re,le),this._tmpCtx.bezierCurveTo(re,Se,re+this._config.deviceCellWidth/2,Se,re+this._config.deviceCellWidth/2,le);break;case 4:let We=ce===0?0:ce>=B?B*2-ce:B-ce;ce>=B||We===0?(this._tmpCtx.setLineDash([Math.round(B),Math.round(B)]),this._tmpCtx.moveTo(P+We,Q),this._tmpCtx.lineTo(re,Q)):(this._tmpCtx.setLineDash([Math.round(B),Math.round(B)]),this._tmpCtx.moveTo(P,Q),this._tmpCtx.lineTo(P+We,Q),this._tmpCtx.moveTo(P+We+B,Q),this._tmpCtx.lineTo(re,Q)),ce=P8(re-P,B,ce);break;case 5:let Ze=.6,xt=.3,Ne=re-P,en=Math.floor(Ze*Ne),Sn=Math.floor(xt*Ne),wn=Ne-en-Sn;this._tmpCtx.setLineDash([en,Sn,wn]),this._tmpCtx.moveTo(P,Q),this._tmpCtx.lineTo(re,Q);break;default:this._tmpCtx.moveTo(P,Q),this._tmpCtx.lineTo(re,Q);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 Y=this._tmpCtx.measureText(c);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Y&&Y.actualBoundingBoxDescent>0){this._tmpCtx.save();let P=new Path2D;P.rect(H,Q-Math.ceil(B/2),this._config.deviceCellWidth*V,ee-Q+Math.ceil(B/2)),this._tmpCtx.clip(P),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=L.css,this._tmpCtx.strokeText(c,q,q+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(m){let B=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),N=B%2===1?.5:0;this._tmpCtx.lineWidth=B,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(q,q+N),this._tmpCtx.lineTo(q+this._config.deviceCharWidth*V,q+N),this._tmpCtx.stroke()}if(W||this._tmpCtx.fillText(c,q,q+this._config.deviceCharHeight),c==="_"&&!this._config.allowTransparency){let B=xp(this._tmpCtx.getImageData(q,q,this._config.deviceCellWidth,this._config.deviceCellHeight),L,G,j);if(B)for(let N=1;N<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=L.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(c,q,q+this._config.deviceCharHeight-N),B=xp(this._tmpCtx.getImageData(q,q,this._config.deviceCellWidth,this._config.deviceCellHeight),L,G,j),!!B);N++);}if(E){let B=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),N=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=B,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(q,q+Math.floor(this._config.deviceCharHeight/2)-N),this._tmpCtx.lineTo(q+this._config.deviceCharWidth*V,q+Math.floor(this._config.deviceCharHeight/2)-N),this._tmpCtx.stroke()}this._tmpCtx.restore();let U=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),F;if(this._config.allowTransparency?F=uI(U):F=xp(U,L,G,j),F)return Ry;let K=this._findGlyphBoundingBox(U,this._workBoundingBox,u,I,W,q),X,D;for(;;){if(this._activePages.length===0){let B=this._createNewPage();X=B,D=B.currentRow,D.height=K.size.y;break}X=this._activePages[this._activePages.length-1],D=X.currentRow;for(let B of this._activePages)K.size.y<=B.currentRow.height&&(X=B,D=B.currentRow);for(let B=this._activePages.length-1;B>=0;B--)for(let N of this._activePages[B].fixedRows)N.height<=D.height&&K.size.y<=N.height&&(X=this._activePages[B],D=N);if(K.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new Cp(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),X=this._overflowSizePage,D=this._overflowSizePage.currentRow,D.x+K.size.x>=X.canvas.width&&(D.x=0,D.y+=D.height,D.height=0);break}if(D.y+K.size.y>=X.canvas.height||D.height>K.size.y+2){let B=!1;if(X.currentRow.y+X.currentRow.height+K.size.y>=X.canvas.height){let N;for(let H of this._activePages)if(H.currentRow.y+H.currentRow.height+K.size.y<H.canvas.height){N=H;break}if(N)X=N;else if(eo.maxAtlasPages&&this._pages.length>=eo.maxAtlasPages&&D.y+K.size.y<=X.canvas.height&&D.height>=K.size.y&&D.x+K.size.x<=X.canvas.width)B=!0;else{let H=this._createNewPage();X=H,D=H.currentRow,D.height=K.size.y,B=!0}}B||(X.currentRow.height>0&&X.fixedRows.push(X.currentRow),D={x:0,y:X.currentRow.y+X.currentRow.height,height:K.size.y},X.fixedRows.push(D),X.currentRow={x:0,y:D.y+D.height,height:0})}if(D.x+K.size.x<=X.canvas.width)break;D===X.currentRow?(D.x=0,D.y+=D.height,D.height=0):X.fixedRows.splice(X.fixedRows.indexOf(D),1)}return K.texturePage=this._pages.indexOf(X),K.texturePosition.x=D.x,K.texturePosition.y=D.y,K.texturePositionClipSpace.x=D.x/X.canvas.width,K.texturePositionClipSpace.y=D.y/X.canvas.height,K.sizeClipSpace.x/=X.canvas.width,K.sizeClipSpace.y/=X.canvas.height,D.height=Math.max(D.height,K.size.y),D.x+=K.size.x,X.ctx.putImageData(U,K.texturePosition.x-this._workBoundingBox.left,K.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,K.size.x,K.size.y),X.addGlyph(K),X.version++,K}_findGlyphBoundingBox(n,r,a,o,h,g){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 p=0;p<u;p++){let C=S*this._tmpCanvas.width*4+p*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<g+u;S++){for(let p=0;p<c;p++){let C=p*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=g+u-1;S>=g;S--){for(let p=0;p<c;p++){let C=p*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 p=0;p<u;p++){let C=S*this._tmpCanvas.width*4+p*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+g+(o||h?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-r.top+g+(o||h?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}},Cp=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=Vx(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 xp(e,n,r,a){let o=n.rgba>>>24,h=n.rgba>>>16&255,g=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(h-u)+Math.abs(g-d))/12),p=!0;for(let C=0;C<e.data.length;C+=4)e.data[C]===o&&e.data[C+1]===h&&e.data[C+2]===g||a&&Math.abs(e.data[C]-o)+Math.abs(e.data[C+1]-h)+Math.abs(e.data[C+2]-g)<S?e.data[C+3]=0:p=!1;return p}function uI(e){for(let n=0;n<e.data.length;n+=4)if(e.data[n+3]>0)return!1;return!0}function Vx(e,n,r){let a=e.createElement("canvas");return a.width=n,a.height=r,a}function hI(e,n,r,a,o,h,g,c){let u={foreground:h.foreground,background:h.background,cursor:ki,cursorAccent:ki,selectionForeground:ki,selectionBackgroundTransparent:ki,selectionBackgroundOpaque:ki,selectionInactiveBackgroundTransparent:ki,selectionInactiveBackgroundOpaque:ki,overviewRulerBorder:ki,scrollbarSliderBackground:ki,scrollbarSliderHoverBackground:ki,scrollbarSliderActiveBackground:ki,ansi:h.ansi.slice(),contrastCache:h.contrastCache,halfContrastCache:h.halfContrastCache};return{customGlyphs:o.customGlyphs,devicePixelRatio:g,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 Ly(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 dI(e){return(e&50331648)===16777216||(e&50331648)===33554432}var Mi=[];function Yx(e,n,r,a,o,h,g,c,u){let d=hI(a,o,h,g,n,r,c,u);for(let C=0;C<Mi.length;C++){let x=Mi[C],A=x.ownedBy.indexOf(e);if(A>=0){if(Ly(x.config,d))return x.atlas;x.ownedBy.length===1?(x.atlas.dispose(),Mi.splice(C,1)):x.ownedBy.splice(A,1);break}}for(let C=0;C<Mi.length;C++){let x=Mi[C];if(Ly(x.config,d))return x.ownedBy.push(e),x.atlas}let S=e._core,p={atlas:new vs(document,d,S.unicodeService),config:d,ownedBy:[e]};return Mi.push(p),p.atlas}function My(e){for(let n=0;n<Mi.length;n++){let r=Mi[n].ownedBy.indexOf(e);if(r!==-1){Mi[n].ownedBy.length===1?(Mi[n].atlas.dispose(),Mi.splice(n,1)):Mi[n].ownedBy.splice(r,1);break}}}var Du=600,fI=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=Du){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let n=Du-(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=Du-(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})},Du)},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 h=o.find(u=>u.target===e);if(!h)return;if(!("devicePixelContentBoxSize"in h)){a?.disconnect(),a=void 0;return}let g=h.devicePixelContentBoxSize[0].inlineSize,c=h.devicePixelContentBoxSize[0].blockSize;g>0&&c>0&&r(g,c)});try{a.observe(e,{box:["device-pixel-content-box"]})}catch{a.disconnect(),a=void 0}return In(()=>a?.disconnect())}function pI(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}var Oy=class Xx extends io{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Ux,this.combinedData=""}static fromCharData(n){let r=new Xx;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?pI(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()]}},Zx=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function Jx(e,n,r){let a=hn(e.createProgram());if(e.attachShader(a,hn(Ny(e,e.VERTEX_SHADER,n))),e.attachShader(a,hn(Ny(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 Ny(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 mI(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 gI=class{constructor(e){this.texture=e,this.version=-1}},_I=`#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 vI(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,Xa=bs*Float32Array.BYTES_PER_ELEMENT,bI=2,Wt=0,Mt,Ep=0,Ll=0,yI=class extends Vi{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(Jx(o,_I,vI(vs.maxAtlasPages))),this._register(In(()=>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 h=new Float32Array([0,0,1,0,0,1,1,1]),g=o.createBuffer();this._register(In(()=>o.deleteBuffer(g))),o.bindBuffer(o.ARRAY_BUFFER,g),o.bufferData(o.ARRAY_BUFFER,h,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(In(()=>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(In(()=>o.deleteBuffer(this._attributesBuffer))),o.bindBuffer(o.ARRAY_BUFFER,this._attributesBuffer),o.enableVertexAttribArray(2),o.vertexAttribPointer(2,2,o.FLOAT,!1,Xa,0),o.vertexAttribDivisor(2,1),o.enableVertexAttribArray(3),o.vertexAttribPointer(3,2,o.FLOAT,!1,Xa,2*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(3,1),o.enableVertexAttribArray(4),o.vertexAttribPointer(4,1,o.FLOAT,!1,Xa,4*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(4,1),o.enableVertexAttribArray(5),o.vertexAttribPointer(5,2,o.FLOAT,!1,Xa,5*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(5,1),o.enableVertexAttribArray(6),o.vertexAttribPointer(6,2,o.FLOAT,!1,Xa,7*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(6,1),o.enableVertexAttribArray(1),o.vertexAttribPointer(1,2,o.FLOAT,!1,Xa,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,Zx),this._atlasTextures=[];for(let S=0;S<vs.maxAtlasPages;S++){let p=new gI(hn(o.createTexture()));this._register(In(()=>o.deleteTexture(p.texture))),o.activeTexture(o.TEXTURE0+S),o.bindTexture(o.TEXTURE_2D,p.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]=p}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,h,g,c,u){this._updateCell(this._vertices.attributes,e,n,r,a,o,h,g,c,u)}_updateCell(e,n,r,a,o,h,g,c,u,d){if(Wt=(r*this._terminal.cols+n)*bs,a===0||a===void 0){e.fill(0,Wt,Wt+bs-1-bI);return}this._atlas&&(c&&c.length>1?Mt=this._atlas.getRasterizedGlyphCombinedChar(c,o,h,g,!1,this._terminal.element):Mt=this._atlas.getRasterizedGlyph(a,o,h,g,!1,this._terminal.element),Ep=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),o!==d&&Mt.offset.x>Ep?(Ll=Mt.offset.x-Ep,e[Wt]=-(Mt.offset.x-Ll)+this._dimensions.device.char.left,e[Wt+1]=-Mt.offset.y+this._dimensions.device.char.top,e[Wt+2]=(Mt.size.x-Ll)/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+Ll/this._atlas.pages[Mt.texturePage].canvas.width,e[Wt+6]=Mt.texturePositionClipSpace.y,e[Wt+7]=Mt.sizeClipSpace.x-Ll/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&&B8(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 h=o*this._terminal.cols*bs,g=this._vertices.attributes.subarray(h,h+e.lineLengths[o]*bs);r.set(g,a),a+=g.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}},SI=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,h=n[1]-o,g=r[1]-o,c=Math.max(h,0),u=Math.min(g,e.rows-1);if(c>=e.rows||u<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=a,this.viewportStartRow=h,this.viewportEndRow=g,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 wI(){return new SI}var vh=4,Gu=1,Ku=2,Tp=3,CI=2147483648,xI=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=wI()}resize(e,n){let r=e*n*vh;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)}},EI=`#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
- }`,TI=`#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
- }`,Br=8,Ap=Br*Float32Array.BYTES_PER_ELEMENT,AI=20*Br,Iy=class{constructor(){this.attributes=new Float32Array(AI),this.count=0}},Or=0,By=0,jy=0,Py=0,zy=0,$y=0,Hy=0,kI=class extends Vi{constructor(e,n,r,a){super(),this._terminal=e,this._gl=n,this._dimensions=r,this._themeService=a,this._vertices=new Iy,this._verticesCursor=new Iy;let o=this._gl;this._program=hn(Jx(o,EI,TI)),this._register(In(()=>o.deleteProgram(this._program))),this._projectionLocation=hn(o.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=o.createVertexArray(),o.bindVertexArray(this._vertexArrayObject);let h=new Float32Array([0,0,1,0,0,1,1,1]),g=o.createBuffer();this._register(In(()=>o.deleteBuffer(g))),o.bindBuffer(o.ARRAY_BUFFER,g),o.bufferData(o.ARRAY_BUFFER,h,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(In(()=>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(In(()=>o.deleteBuffer(this._attributesBuffer))),o.bindBuffer(o.ARRAY_BUFFER,this._attributesBuffer),o.enableVertexAttribArray(0),o.vertexAttribPointer(0,2,o.FLOAT,!1,Ap,0),o.vertexAttribDivisor(0,1),o.enableVertexAttribArray(1),o.vertexAttribPointer(1,2,o.FLOAT,!1,Ap,2*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(1,1),o.enableVertexAttribArray(2),o.vertexAttribPointer(2,4,o.FLOAT,!1,Ap,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,Zx),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,h,g,c,u,d,S,p,C,x,A;for(o=0;o<n.rows;o++){for(g=-1,c=0,u=0,d=!1,h=0;h<n.cols;h++)S=(o*n.cols+h)*vh,p=e.cells[S+Gu],C=e.cells[S+Ku],x=!!(C&67108864),(p!==c||C!==u&&(d||x))&&((c!==0||d&&u!==0)&&(A=a++*Br,this._updateRectangle(r,A,u,c,g,h,o)),g=h,c=p,u=C,d=x);(c!==0||d&&u!==0)&&(A=a++*Br,this._updateRectangle(r,A,u,c,g,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++*Br,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++*Br,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++*Br,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++*Br,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,h,g){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=mI(e.attributes,this._terminal.rows*this._terminal.cols*Br)),By=o*this._dimensions.device.cell.width,jy=g*this._dimensions.device.cell.height,Py=(Or>>24&255)/255,zy=(Or>>16&255)/255,$y=(Or>>8&255)/255,Hy=1,this._addRectangle(e.attributes,n,By,jy,(h-o)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,Py,zy,$y,Hy)}_addRectangle(e,n,r,a,o,h,g,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]=h/this._dimensions.device.canvas.height,e[n+4]=g,e[n+5]=c,e[n+6]=u,e[n+7]=d}_addRectangleFloat(e,n,r,a,o,h,g){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]=h/this._dimensions.device.canvas.height,e[n+4]=g[0],e[n+5]=g[1],e[n+6]=g[2],e[n+7]=g[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])}},RI=class extends Vi{constructor(e,n,r,a,o,h,g,c){super(),this._container=n,this._alpha=o,this._coreBrowserService=h,this._optionsService=g,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(In(()=>{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=Yx(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=jx,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}`}},LI=class extends RI{constructor(e,n,r,a,o,h,g){super(r,e,"link",n,!0,o,h,g),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&&dI(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()}},ea=typeof window=="object"?window:globalThis,jm=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}};jm.INSTANCE=new jm;var Qx=jm;function MI(e,n,r){typeof n=="string"&&(n=e.matchMedia(n)),n.addEventListener("change",r)}Qx.INSTANCE.onDidChangeZoomLevel;Qx.INSTANCE.onDidChangeFullscreen;var xo=typeof navigator=="object"?navigator.userAgent:"";xo.indexOf("Firefox")>=0;xo.indexOf("AppleWebKit")>=0;var DI=xo.indexOf("Chrome")>=0;!DI&&xo.indexOf("Safari")>=0;xo.indexOf("Electron/")>=0;xo.indexOf("Android")>=0;var kp=!1;if(typeof ea.matchMedia=="function"){let e=ea.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),n=ea.matchMedia("(display-mode: fullscreen)");kp=e.matches,MI(ea,e,({matches:r})=>{kp&&n.matches||(kp=r)})}var ro="en",Rp=!1,e2=!1,Ou,Vu=ro,Uy=ro,OI,Ir,ra=globalThis,pi;typeof ra.vscode<"u"&&typeof ra.vscode.process<"u"?pi=ra.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(pi=process);var NI=typeof pi?.versions?.electron=="string",II=NI&&pi?.type==="renderer";if(typeof pi=="object"){pi.platform,pi.platform,Rp=pi.platform==="linux",Rp&&pi.env.SNAP&&pi.env.SNAP_REVISION,pi.env.CI||pi.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Ou=ro,Vu=ro;let e=pi.env.VSCODE_NLS_CONFIG;if(e)try{let n=JSON.parse(e);Ou=n.userLocale,Uy=n.osLocale,Vu=n.resolvedLanguage||ro,OI=n.languagePack?.translationsConfigFile}catch{}e2=!0}else typeof navigator=="object"&&!II?(Ir=navigator.userAgent,Ir.indexOf("Windows")>=0,Ir.indexOf("Macintosh")>=0,(Ir.indexOf("Macintosh")>=0||Ir.indexOf("iPad")>=0||Ir.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Rp=Ir.indexOf("Linux")>=0,Ir?.indexOf("Mobi")>=0,Vu=globalThis._VSCODE_NLS_LANGUAGE||ro,Ou=navigator.language.toLowerCase(),Uy=Ou):console.error("Unable to resolve platform.");var Fy=e2,sr=Ir,gs=Vu,BI;(e=>{function n(){return gs}e.value=n;function r(){return gs.length===2?gs==="en":gs.length>=3?gs[0]==="e"&&gs[1]==="n"&&gs[2]==="-":!1}e.isDefaultVariant=r;function a(){return gs==="en"}e.isDefault=a})(BI||={});var jI=typeof ra.postMessage=="function"&&!ra.importScripts;(()=>{if(jI){let e=[];ra.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let a=0,o=e.length;a<o;a++){let h=e[a];if(h.id===r.data.vscodeScheduleAsyncWork){e.splice(a,1),h.callback();return}}});let n=0;return r=>{let a=++n;e.push({id:a,callback:r}),ra.postMessage({vscodeScheduleAsyncWork:a},"*")}}return e=>setTimeout(e)})();var PI=!!(sr&&sr.indexOf("Chrome")>=0);sr&&sr.indexOf("Firefox")>=0;!PI&&sr&&sr.indexOf("Safari")>=0;sr&&sr.indexOf("Edg/")>=0;sr&&sr.indexOf("Android")>=0;var Za=typeof navigator=="object"?navigator:{};Fy||document.queryCommandSupported&&document.queryCommandSupported("copy")||Za&&Za.clipboard&&Za.clipboard.writeText,Fy||Za&&Za.clipboard&&Za.clipboard.readText;var Bg=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}},Lp=new Bg,qy=new Bg,Wy=new Bg;new Array(230);var zI;(e=>{function n(c){return Lp.keyCodeToStr(c)}e.toString=n;function r(c){return Lp.strToKeyCode(c)}e.fromString=r;function a(c){return qy.keyCodeToStr(c)}e.toUserSettingsUS=a;function o(c){return Wy.keyCodeToStr(c)}e.toUserSettingsGeneral=o;function h(c){return qy.strToKeyCode(c)||Wy.strToKeyCode(c)}e.fromUserSettings=h;function g(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 Lp.keyCodeToStr(c)}e.toElectronAccelerator=g})(zI||={});var t2=Object.freeze(function(e,n){let r=setTimeout(e.bind(n),0);return{dispose(){clearTimeout(r)}}}),$I;(e=>{function n(r){return r===e.None||r===e.Cancelled||r instanceof HI?!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:t2})})($I||={});var HI=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?t2:(this._emitter||(this._emitter=new Dt),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},UI;(e=>{async function n(a){let o,h=await Promise.all(a.map(g=>g.then(c=>c,c=>{o||(o=c)})));if(typeof o<"u")throw o;return h}e.settled=n;function r(a){return new Promise(async(o,h)=>{try{await a(o,h)}catch(g){h(g)}})}e.withAsyncBody=r})(UI||={});var Gy=class Ri{static fromArray(n){return new Ri(r=>{r.emitMany(n)})}static fromPromise(n){return new Ri(async r=>{r.emitMany(await n)})}static fromPromises(n){return new Ri(async r=>{await Promise.all(n.map(async a=>r.emitOne(await a)))})}static merge(n){return new Ri(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 Ri(async a=>{for await(let o of n)a.emitOne(r(o))})}map(n){return Ri.map(this,n)}static filter(n,r){return new Ri(async a=>{for await(let o of n)r(o)&&a.emitOne(o)})}filter(n){return Ri.filter(this,n)}static coalesce(n){return Ri.filter(n,r=>!!r)}coalesce(){return Ri.coalesce(this)}static async toPromise(n){let r=[];for await(let a of n)r.push(a);return r}toPromise(){return Ri.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())}};Gy.EMPTY=Gy.fromArray([]);var{getWindow:FI}=(function(){let e=new Map,n={window:ea,disposables:new ho};e.set(ea.vscodeWindowId,n);let r=new Dt,a=new Dt,o=new Dt;function h(g,c){return(typeof g=="number"?e.get(g):void 0)??(c?n:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:o.event,onDidUnregisterWindow:a.event,registerWindow(g){if(e.has(g.vscodeWindowId))return Vi.None;let c=new ho,u={window:g,disposables:c.add(new ho)};return e.set(g.vscodeWindowId,u),c.add(In(()=>{e.delete(g.vscodeWindowId),a.fire(g)})),c.add(Pm(g,WI.BEFORE_UNLOAD,()=>{o.fire(g)})),r.fire(u),c},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(g){return g.vscodeWindowId},hasWindow(g){return e.has(g)},getWindowById:h,getWindow(g){let c=g;if(c?.ownerDocument?.defaultView)return c.ownerDocument.defaultView.window;let u=g;return u?.view?u.view.window:ea},getDocument(g){return FI(g).document}}})(),qI=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 Pm(e,n,r,a){return new qI(e,n,r,a)}var WI={BEFORE_UNLOAD:"beforeunload"},GI=class extends Vi{constructor(e,n,r,a,o,h,g,c,u){super(),this._terminal=e,this._characterJoinerService=n,this._charSizeService=r,this._coreBrowserService=a,this._coreService=o,this._decorationService=h,this._optionsService=g,this._themeService=c,this._cursorBlinkStateManager=new Al,this._charAtlasDisposable=this._register(new Al),this._observerDisposable=this._register(new Al),this._model=new xI,this._workCell=new Oy,this._workCell2=new Oy,this._rectangleRenderer=this._register(new Al),this._glyphRenderer=this._register(new Al),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 z8(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new LI(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,g,this._themeService)],this.dimensions=j8(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(g.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(Pm(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(Pm(this._canvas,"webglcontextrestored",S=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,My(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=Dy(this._canvas,this._coreBrowserService.window,(S,p)=>this._setCanvasDevicePixelDimensions(S,p)),this._register(this._coreBrowserService.onWindowChange(S=>{this._observerDisposable.value=Dy(this._canvas,S,(p,C)=>this._setCanvasDevicePixelDimensions(p,C))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(In(()=>{for(let S of this._renderLayers)S.dispose();this._canvas.parentElement?.removeChild(this._canvas),My(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 kI(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new yI(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=Yx(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=Dx(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 fI(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,n){let r=this._core,a=this._workCell,o,h,g,c,u,d,S=0,p=!0,C,x,A,E,m,y,f,b,T;e=Ky(e,r.rows-1,0),n=Ky(n,r.rows-1,0);let L=this._coreService.decPrivateModes.cursorStyle??r.options.cursorStyle??"block",R=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,M=R-r.buffer.ydisp,k=Math.min(this._terminal.buffer.active.cursorX,r.cols-1),I=-1,G=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let q=!1;for(h=e;h<=n;h++)for(g=h+r.buffer.ydisp,c=r.buffer.lines.get(g),this._model.lineLengths[h]=0,A=R===g,S=0,u=this._characterJoinerService.getJoinedCharacters(g),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,p=b>=S,C=b,u.length>0&&b===u[0][0]&&p){x=u.shift();let W=this._model.selection.isCellSelected(this._terminal,x[0],g);for(f=x[0]+1;f<x[1];f++)p&&=W===this._model.selection.isCellSelected(this._terminal,f,g);p&&=!A||k<x[0]||k>=x[1],p?(d=!0,a=new KI(a,c.translateToString(!0,x[0],x[1]),x[1]-x[0]),C=x[1]-1):S=x[1]}if(E=a.getChars(),m=a.getCode(),f=(h*r.cols+b)*vh,this._cellColorResolver.resolve(a,b,g,this.dimensions.device.cell.width),G&&g===R&&(b===k&&(this._model.cursor={x:k,y:M,width:a.getWidth(),style:this._coreBrowserService.isFocused?L:r.options.cursorInactiveStyle,cursorWidth:r.options.cursorWidth,dpr:this._devicePixelRatio},I=k+a.getWidth()-1),b>=k&&b<=I&&(this._coreBrowserService.isFocused&&L==="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)),m!==0&&(this._model.lineLengths[h]=b+1),!(this._model.cells[f]===m&&this._model.cells[f+Gu]===this._cellColorResolver.result.bg&&this._model.cells[f+Ku]===this._cellColorResolver.result.fg&&this._model.cells[f+Tp]===this._cellColorResolver.result.ext)&&(q=!0,E.length>1&&(m|=CI),this._model.cells[f]=m,this._model.cells[f+Gu]=this._cellColorResolver.result.bg,this._model.cells[f+Ku]=this._cellColorResolver.result.fg,this._model.cells[f+Tp]=this._cellColorResolver.result.ext,y=a.getWidth(),this._glyphRenderer.value.updateCell(b,h,m,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,E,y,o),d)){for(a=this._workCell,b++;b<=C;b++)T=(h*r.cols+b)*vh,this._glyphRenderer.value.updateCell(b,h,0,0,0,0,L8,0,0),this._model.cells[T]=0,this._model.cells[T+Gu]=this._cellColorResolver.result.bg,this._model.cells[T+Ku]=this._cellColorResolver.result.fg,this._model.cells[T+Tp]=this._cellColorResolver.result.ext;b--}}q&&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})}},KI=class extends io{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 Ky(e,n,r=0){return Math.max(Math.min(e,n),r)}var Vy="di$target",Yy="di$dependencies",Mp=new Map;function lr(e){if(Mp.has(e))return Mp.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");VI(n,r,o)};return n._id=e,Mp.set(e,n),n}function VI(e,n,r){n[Vy]===n?n[Yy].push({id:e,index:r}):(n[Yy]=[{id:e,index:r}],n[Vy]=n)}lr("BufferService");lr("CoreMouseService");lr("CoreService");lr("CharsetService");lr("InstantiationService");lr("LogService");var YI=lr("OptionsService");lr("OscLinkService");lr("UnicodeService");lr("DecorationService");var XI={trace:0,debug:1,info:2,warn:3,error:4,off:5},ZI="xterm.js: ",Xy=class extends Vi{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=XI[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?"":ZI)+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)}};Xy=v8([b8(0,YI)],Xy);var JI=class extends Vi{constructor(e){if(Ix&&R8()<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,h=o._renderService,g=o._characterJoinerService,c=o._charSizeService,u=o._coreBrowserService,d=o._decorationService;o._logService;let S=o._themeService;this._renderer=this._register(new GI(e,g,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)),h.setRenderer(this._renderer),this._register(In(()=>{if(this._terminal._core._store._isDisposed)return;let p=this._terminal._core._renderService;p.setRenderer(this._terminal._core._createRenderer()),p.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},Dp={exports:{}},Zy;function QI(){return Zy||(Zy=1,(function(e,n){(function(r,a){e.exports=a()})(globalThis,(()=>(()=>{var r={4567:function(g,c,u){var d=this&&this.__decorate||function(f,b,T,L){var R,M=arguments.length,k=M<3?b:L===null?L=Object.getOwnPropertyDescriptor(b,T):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(f,b,T,L);else for(var I=f.length-1;I>=0;I--)(R=f[I])&&(k=(M<3?R(k):M>3?R(b,T,k):R(b,T))||k);return M>3&&k&&Object.defineProperty(b,T,k),k},S=this&&this.__param||function(f,b){return function(T,L){b(T,L,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.AccessibilityManager=void 0;const p=u(9042),C=u(9924),x=u(844),A=u(4725),E=u(2585),m=u(3656);let y=c.AccessibilityManager=class extends x.Disposable{constructor(f,b,T,L){super(),this._terminal=f,this._coreBrowserService=T,this._renderService=L,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 R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,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((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
769
- `)))),this.register(this._terminal.onA11yTab((R=>this._handleTab(R)))),this.register(this._terminal.onKey((R=>this._handleKey(R.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,m.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,x.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(f){for(let b=0;b<f;b++)this._handleChar(" ")}_handleChar(f){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==f&&(this._charsToAnnounce+=f):this._charsToAnnounce+=f,f===`
770
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=p.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(f){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(f)||this._charsToConsume.push(f)}_refreshRows(f,b){this._liveRegionDebouncer.refresh(f,b,this._terminal.rows)}_renderRows(f,b){const T=this._terminal.buffer,L=T.lines.length.toString();for(let R=f;R<=b;R++){const M=T.lines.get(T.ydisp+R),k=[],I=M?.translateToString(!0,void 0,void 0,k)||"",G=(T.ydisp+R+1).toString(),q=this._rowElements[R];q&&(I.length===0?(q.innerText=" ",this._rowColumns.set(q,[0,1])):(q.textContent=I,this._rowColumns.set(q,k)),q.setAttribute("aria-posinset",G),q.setAttribute("aria-setsize",L))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(f,b){const T=f.target,L=this._rowElements[b===0?1:this._rowElements.length-2];if(T.getAttribute("aria-posinset")===(b===0?"1":`${this._terminal.buffer.lines.length}`)||f.relatedTarget!==L)return;let R,M;if(b===0?(R=T,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(R=this._rowElements.shift(),M=T,this._rowContainer.removeChild(R)),R.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(),f.preventDefault(),f.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const f=document.getSelection();if(!f)return;if(f.isCollapsed)return void(this._rowContainer.contains(f.anchorNode)&&this._terminal.clearSelection());if(!f.anchorNode||!f.focusNode)return void console.error("anchorNode and/or focusNode are null");let b={node:f.anchorNode,offset:f.anchorOffset},T={node:f.focusNode,offset:f.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 L=this._rowElements.slice(-1)[0];if(T.node.compareDocumentPosition(L)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(T={node:L,offset:L.textContent?.length??0}),!this._rowContainer.contains(T.node))return;const R=({node:I,offset:G})=>{const q=I instanceof Text?I.parentNode:I;let W=parseInt(q?.getAttribute("aria-posinset"),10)-1;if(isNaN(W))return console.warn("row is invalid. Race condition?"),null;const j=this._rowColumns.get(q);if(!j)return console.warn("columns is null. Race condition?"),null;let V=G<j.length?j[G]:j.slice(-1)[0]+1;return V>=this._terminal.cols&&(++W,V=0),{row:W,column:V}},M=R(b),k=R(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(f){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>f;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const f=this._coreBrowserService.mainDocument.createElement("div");return f.setAttribute("role","listitem"),f.tabIndex=-1,this._refreshRowDimensions(f),f}_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 f=0;f<this._terminal.rows;f++)this._refreshRowDimensions(this._rowElements[f])}}_refreshRowDimensions(f){f.style.height=`${this._renderService.dimensions.css.cell.height}px`}};c.AccessibilityManager=y=d([S(1,E.IInstantiationService),S(2,A.ICoreBrowserService),S(3,A.IRenderService)],y)},3614:(g,c)=>{function u(C){return C.replace(/\r?\n/g,"\r")}function d(C,x){return x?"\x1B[200~"+C+"\x1B[201~":C}function S(C,x,A,E){C=d(C=u(C),A.decPrivateModes.bracketedPasteMode&&E.rawOptions.ignoreBracketedPasteMode!==!0),A.triggerDataEvent(C,!0),x.value=""}function p(C,x,A){const E=A.getBoundingClientRect(),m=C.clientX-E.left-10,y=C.clientY-E.top-10;x.style.width="20px",x.style.height="20px",x.style.left=`${m}px`,x.style.top=`${y}px`,x.style.zIndex="1000",x.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,x){C.clipboardData&&C.clipboardData.setData("text/plain",x.selectionText),C.preventDefault()},c.handlePasteEvent=function(C,x,A,E){C.stopPropagation(),C.clipboardData&&S(C.clipboardData.getData("text/plain"),x,A,E)},c.paste=S,c.moveTextAreaUnderMouseCursor=p,c.rightClickHandler=function(C,x,A,E,m){p(C,x,A),m&&E.rightClickSelect(C),x.value=E.selectionText,x.select()}},7239:(g,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,p,C){this._css.set(S,p,C)}getCss(S,p){return this._css.get(S,p)}setColor(S,p,C){this._color.set(S,p,C)}getColor(S,p){return this._color.get(S,p)}clear(){this._color.clear(),this._css.clear()}}},3656:(g,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.addDisposableDomListener=void 0,c.addDisposableDomListener=function(u,d,S,p){u.addEventListener(d,S,p);let C=!1;return{dispose:()=>{C||(C=!0,u.removeEventListener(d,S,p))}}}},3551:function(g,c,u){var d=this&&this.__decorate||function(y,f,b,T){var L,R=arguments.length,M=R<3?f:T===null?T=Object.getOwnPropertyDescriptor(f,b):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,f,b,T);else for(var k=y.length-1;k>=0;k--)(L=y[k])&&(M=(R<3?L(M):R>3?L(f,b,M):L(f,b))||M);return R>3&&M&&Object.defineProperty(f,b,M),M},S=this&&this.__param||function(y,f){return function(b,T){f(b,T,y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Linkifier=void 0;const p=u(3656),C=u(8460),x=u(844),A=u(2585),E=u(4725);let m=c.Linkifier=class extends x.Disposable{get currentLink(){return this._currentLink}constructor(y,f,b,T,L){super(),this._element=y,this._mouseService=f,this._renderService=b,this._bufferService=T,this._linkProviderService=L,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,x.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,x.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,p.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,p.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,p.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,p.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(y){this._lastMouseEvent=y;const f=this._positionFromMouseEvent(y,this._element,this._mouseService);if(!f)return;this._isMouseOut=!1;const b=y.composedPath();for(let T=0;T<b.length;T++){const L=b[T];if(L.classList.contains("xterm"))break;if(L.classList.contains("xterm-hover"))return}this._lastBufferCell&&f.x===this._lastBufferCell.x&&f.y===this._lastBufferCell.y||(this._handleHover(f),this._lastBufferCell=f)}_handleHover(y){if(this._activeLine!==y.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(y,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,y)||(this._clearCurrentLink(),this._askForLink(y,!0))}_askForLink(y,f){this._activeProviderReplies&&f||(this._activeProviderReplies?.forEach((T=>{T?.forEach((L=>{L.link.dispose&&L.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=y.y);let b=!1;for(const[T,L]of this._linkProviderService.linkProviders.entries())f?this._activeProviderReplies?.get(T)&&(b=this._checkLinkProviderResult(T,y,b)):L.provideLinks(y.y,(R=>{if(this._isMouseOut)return;const M=R?.map((k=>({link:k})));this._activeProviderReplies?.set(T,M),b=this._checkLinkProviderResult(T,y,b),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(y.y,this._activeProviderReplies)}))}_removeIntersectingLinks(y,f){const b=new Set;for(let T=0;T<f.size;T++){const L=f.get(T);if(L)for(let R=0;R<L.length;R++){const M=L[R],k=M.link.range.start.y<y?0:M.link.range.start.x,I=M.link.range.end.y>y?this._bufferService.cols:M.link.range.end.x;for(let G=k;G<=I;G++){if(b.has(G)){L.splice(R--,1);break}b.add(G)}}}}_checkLinkProviderResult(y,f,b){if(!this._activeProviderReplies)return b;const T=this._activeProviderReplies.get(y);let L=!1;for(let R=0;R<y;R++)this._activeProviderReplies.has(R)&&!this._activeProviderReplies.get(R)||(L=!0);if(!L&&T){const R=T.find((M=>this._linkAtPosition(M.link,f)));R&&(b=!0,this._handleNewLink(R))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!b)for(let R=0;R<this._activeProviderReplies.size;R++){const M=this._activeProviderReplies.get(R)?.find((k=>this._linkAtPosition(k.link,f)));if(M){b=!0,this._handleNewLink(M);break}}return b}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(y){if(!this._currentLink)return;const f=this._positionFromMouseEvent(y,this._element,this._mouseService);f&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,f)&&this._currentLink.link.activate(y,this._currentLink.link.text)}_clearCurrentLink(y,f){this._currentLink&&this._lastMouseEvent&&(!y||!f||this._currentLink.link.range.start.y>=y&&this._currentLink.link.range.end.y<=f)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,x.disposeArray)(this._linkCacheDisposables))}_handleNewLink(y){if(!this._lastMouseEvent)return;const f=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);f&&this._linkAtPosition(y.link,f)&&(this._currentLink=y,this._currentLink.state={decorations:{underline:y.link.decorations===void 0||y.link.decorations.underline,pointerCursor:y.link.decorations===void 0||y.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,y.link,this._lastMouseEvent),y.link.decorations={},Object.defineProperties(y.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(y.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,L=this._bufferService.buffer.ydisp+1+b.end;if(this._currentLink.link.range.start.y>=T&&this._currentLink.link.range.end.y<=L&&(this._clearCurrentLink(T,L),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(y,f,b){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!0),this._currentLink.state.decorations.pointerCursor&&y.classList.add("xterm-cursor-pointer")),f.hover&&f.hover(b,f.text)}_fireUnderlineEvent(y,f){const b=y.range,T=this._bufferService.buffer.ydisp,L=this._createLinkUnderlineEvent(b.start.x-1,b.start.y-T-1,b.end.x,b.end.y-T-1,void 0);(f?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(L)}_linkLeave(y,f,b){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!1),this._currentLink.state.decorations.pointerCursor&&y.classList.remove("xterm-cursor-pointer")),f.leave&&f.leave(b,f.text)}_linkAtPosition(y,f){const b=y.range.start.y*this._bufferService.cols+y.range.start.x,T=y.range.end.y*this._bufferService.cols+y.range.end.x,L=f.y*this._bufferService.cols+f.x;return b<=L&&L<=T}_positionFromMouseEvent(y,f,b){const T=b.getCoords(y,f,this._bufferService.cols,this._bufferService.rows);if(T)return{x:T[0],y:T[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(y,f,b,T,L){return{x1:y,y1:f,x2:b,y2:T,cols:this._bufferService.cols,fg:L}}};c.Linkifier=m=d([S(1,E.IMouseService),S(2,E.IRenderService),S(3,A.IBufferService),S(4,E.ILinkProviderService)],m)},9042:(g,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(g,c,u){var d=this&&this.__decorate||function(E,m,y,f){var b,T=arguments.length,L=T<3?m:f===null?f=Object.getOwnPropertyDescriptor(m,y):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,m,y,f);else for(var R=E.length-1;R>=0;R--)(b=E[R])&&(L=(T<3?b(L):T>3?b(m,y,L):b(m,y))||L);return T>3&&L&&Object.defineProperty(m,y,L),L},S=this&&this.__param||function(E,m){return function(y,f){m(y,f,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkProvider=void 0;const p=u(511),C=u(2585);let x=c.OscLinkProvider=class{constructor(E,m,y){this._bufferService=E,this._optionsService=m,this._oscLinkService=y}provideLinks(E,m){const y=this._bufferService.buffer.lines.get(E-1);if(!y)return void m(void 0);const f=[],b=this._optionsService.rawOptions.linkHandler,T=new p.CellData,L=y.getTrimmedLength();let R=-1,M=-1,k=!1;for(let I=0;I<L;I++)if(M!==-1||y.hasContent(I)){if(y.loadCell(I,T),T.hasExtendedAttrs()&&T.extended.urlId){if(M===-1){M=I,R=T.extended.urlId;continue}k=T.extended.urlId!==R}else M!==-1&&(k=!0);if(k||M!==-1&&I===L-1){const G=this._oscLinkService.getLinkData(R)?.uri;if(G){const q={start:{x:M+1,y:E},end:{x:I+(k||I!==L-1?0:1),y:E}};let W=!1;if(!b?.allowNonHttpProtocols)try{const j=new URL(G);["http:","https:"].includes(j.protocol)||(W=!0)}catch{W=!0}W||f.push({text:G,range:q,activate:(j,V)=>b?b.activate(j,V,q):A(0,V),hover:(j,V)=>b?.hover?.(j,V,q),leave:(j,V)=>b?.leave?.(j,V,q)})}k=!1,T.hasExtendedAttrs()&&T.extended.urlId?(M=I,R=T.extended.urlId):(M=-1,R=-1)}}m(f)}};function A(E,m){if(confirm(`Do you want to navigate to ${m}?
771
-
772
- WARNING: This link could potentially be dangerous`)){const y=window.open();if(y){try{y.opener=null}catch{}y.location.href=m}else console.warn("Opening link blocked as opener could not be cleared")}}c.OscLinkProvider=x=d([S(0,C.IBufferService),S(1,C.IOptionsService),S(2,C.IOscLinkService)],x)},6193:(g,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:(g,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;const d=u(3614),S=u(3656),p=u(3551),C=u(9042),x=u(3730),A=u(1680),E=u(3107),m=u(5744),y=u(2950),f=u(1296),b=u(428),T=u(4269),L=u(5114),R=u(8934),M=u(3230),k=u(9312),I=u(4725),G=u(6731),q=u(8055),W=u(8969),j=u(8460),V=u(844),U=u(6114),F=u(8437),K=u(2584),X=u(7399),D=u(5941),B=u(9074),N=u(2585),H=u(5435),Q=u(4567),le=u(779);class ee 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(Y={}){super(Y),this.browser=U,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new V.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(B.DecorationService),this._instantiationService.setService(N.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(le.LinkProviderService),this._instantiationService.setService(I.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(x.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((P,re)=>this.refresh(P,re)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((P=>this._reportWindowsOptions(P)))),this.register(this._inputHandler.onColor((P=>this._handleColorEvent(P)))),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((P=>this._afterResize(P.cols,P.rows)))),this.register((0,V.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(Y){if(this._themeService)for(const P of Y){let re,fe="";switch(P.index){case 256:re="foreground",fe="10";break;case 257:re="background",fe="11";break;case 258:re="cursor",fe="12";break;default:re="ansi",fe="4;"+P.index}switch(P.type){case 0:const Se=q.color.toColorRGB(re==="ansi"?this._themeService.colors.ansi[P.index]:this._themeService.colors[re]);this.coreService.triggerDataEvent(`${K.C0.ESC}]${fe};${(0,D.toRgbString)(Se)}${K.C1_ESCAPED.ST}`);break;case 1:if(re==="ansi")this._themeService.modifyColors((ye=>ye.ansi[P.index]=q.channels.toColor(...P.color)));else{const ye=re;this._themeService.modifyColors((Pe=>Pe[ye]=q.channels.toColor(...P.color)))}break;case 2:this._themeService.restoreColor(P.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Y){Y?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Q.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Y){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.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(K.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 Y=this.buffer.ybase+this.buffer.y,P=this.buffer.lines.get(Y);if(!P)return;const re=Math.min(this.buffer.x,this.cols-1),fe=this._renderService.dimensions.css.cell.height,Se=P.getWidth(re),ye=this._renderService.dimensions.css.cell.width*Se,Pe=this.buffer.y*this._renderService.dimensions.css.cell.height,We=re*this._renderService.dimensions.css.cell.width;this.textarea.style.left=We+"px",this.textarea.style.top=Pe+"px",this.textarea.style.width=ye+"px",this.textarea.style.height=fe+"px",this.textarea.style.lineHeight=fe+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,S.addDisposableDomListener)(this.element,"copy",(P=>{this.hasSelection()&&(0,d.copyHandler)(P,this._selectionService)})));const Y=P=>(0,d.handlePasteEvent)(P,this.textarea,this.coreService,this.optionsService);this.register((0,S.addDisposableDomListener)(this.textarea,"paste",Y)),this.register((0,S.addDisposableDomListener)(this.element,"paste",Y)),U.isFirefox?this.register((0,S.addDisposableDomListener)(this.element,"mousedown",(P=>{P.button===2&&(0,d.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,S.addDisposableDomListener)(this.element,"contextmenu",(P=>{(0,d.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),U.isLinux&&this.register((0,S.addDisposableDomListener)(this.element,"auxclick",(P=>{P.button===1&&(0,d.moveTextAreaUnderMouseCursor)(P,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,S.addDisposableDomListener)(this.textarea,"keyup",(Y=>this._keyUp(Y)),!0)),this.register((0,S.addDisposableDomListener)(this.textarea,"keydown",(Y=>this._keyDown(Y)),!0)),this.register((0,S.addDisposableDomListener)(this.textarea,"keypress",(Y=>this._keyPress(Y)),!0)),this.register((0,S.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,S.addDisposableDomListener)(this.textarea,"compositionupdate",(Y=>this._compositionHelper.compositionupdate(Y)))),this.register((0,S.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,S.addDisposableDomListener)(this.textarea,"input",(Y=>this._inputEvent(Y)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Y){if(!Y)throw new Error("Terminal requires a parent element.");if(Y.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=Y.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"),Y.appendChild(this.element);const P=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),P.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",(re=>this.updateCursorStyle(re)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),P.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",C.promptLabel),U.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(L.CoreBrowserService,this.textarea,Y.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(I.ICoreBrowserService,this._coreBrowserService),this.register((0,S.addDisposableDomListener)(this.textarea,"focus",(re=>this._handleTextAreaFocus(re)))),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(I.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(G.ThemeService),this._instantiationService.setService(I.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(T.CharacterJoinerService),this._instantiationService.setService(I.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(I.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((re=>this._onRender.fire(re)))),this.onResize((re=>this._renderService.resize(re.cols,re.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(y.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(R.MouseService),this._instantiationService.setService(I.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(p.Linkifier,this.screenElement)),this.element.appendChild(P);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((re=>this.scrollLines(re.amount,re.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(I.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((re=>this.scrollLines(re.amount,re.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((re=>this._renderService.handleSelectionChanged(re.start,re.end,re.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((re=>{this.textarea.value=re,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((re=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,S.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(E.BufferDecorationRenderer,this.screenElement)),this.register((0,S.addDisposableDomListener)(this.element,"mousedown",(re=>this._selectionService.handleMouseDown(re)))),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(Q.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(re=>this._handleScreenReaderModeOptionChange(re)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(m.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(re=>{!this._overviewRulerRenderer&&re&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(m.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(f.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Y=this,P=this.element;function re(ye){const Pe=Y._mouseService.getMouseReportCoords(ye,Y.screenElement);if(!Pe)return!1;let We,Ze;switch(ye.overrideType||ye.type){case"mousemove":Ze=32,ye.buttons===void 0?(We=3,ye.button!==void 0&&(We=ye.button<3?ye.button:3)):We=1&ye.buttons?0:4&ye.buttons?1:2&ye.buttons?2:3;break;case"mouseup":Ze=0,We=ye.button<3?ye.button:3;break;case"mousedown":Ze=1,We=ye.button<3?ye.button:3;break;case"wheel":if(Y._customWheelEventHandler&&Y._customWheelEventHandler(ye)===!1||Y.viewport.getLinesScrolled(ye)===0)return!1;Ze=ye.deltaY<0?0:1,We=4;break;default:return!1}return!(Ze===void 0||We===void 0||We>4)&&Y.coreMouseService.triggerMouseEvent({col:Pe.col,row:Pe.row,x:Pe.x,y:Pe.y,button:We,action:Ze,ctrl:ye.ctrlKey,alt:ye.altKey,shift:ye.shiftKey})}const fe={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Se={mouseup:ye=>(re(ye),ye.buttons||(this._document.removeEventListener("mouseup",fe.mouseup),fe.mousedrag&&this._document.removeEventListener("mousemove",fe.mousedrag)),this.cancel(ye)),wheel:ye=>(re(ye),this.cancel(ye,!0)),mousedrag:ye=>{ye.buttons&&re(ye)},mousemove:ye=>{ye.buttons||re(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?fe.mousemove||(P.addEventListener("mousemove",Se.mousemove),fe.mousemove=Se.mousemove):(P.removeEventListener("mousemove",fe.mousemove),fe.mousemove=null),16&ye?fe.wheel||(P.addEventListener("wheel",Se.wheel,{passive:!1}),fe.wheel=Se.wheel):(P.removeEventListener("wheel",fe.wheel),fe.wheel=null),2&ye?fe.mouseup||(fe.mouseup=Se.mouseup):(this._document.removeEventListener("mouseup",fe.mouseup),fe.mouseup=null),4&ye?fe.mousedrag||(fe.mousedrag=Se.mousedrag):(this._document.removeEventListener("mousemove",fe.mousedrag),fe.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,S.addDisposableDomListener)(P,"mousedown",(ye=>{if(ye.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ye))return re(ye),fe.mouseup&&this._document.addEventListener("mouseup",fe.mouseup),fe.mousedrag&&this._document.addEventListener("mousemove",fe.mousedrag),this.cancel(ye)}))),this.register((0,S.addDisposableDomListener)(P,"wheel",(ye=>{if(!fe.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 We=K.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ye.deltaY<0?"A":"B");let Ze="";for(let xt=0;xt<Math.abs(Pe);xt++)Ze+=We;return this.coreService.triggerDataEvent(Ze,!0),this.cancel(ye,!0)}return this.viewport.handleWheel(ye)?this.cancel(ye):void 0}}),{passive:!1})),this.register((0,S.addDisposableDomListener)(P,"touchstart",(ye=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ye),this.cancel(ye)}),{passive:!0})),this.register((0,S.addDisposableDomListener)(P,"touchmove",(ye=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ye)?void 0:this.cancel(ye)}),{passive:!1}))}refresh(Y,P){this._renderService?.refreshRows(Y,P)}updateCursorStyle(Y){this._selectionService?.shouldColumnSelect(Y)?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(Y,P,re=0){re===1?(super.scrollLines(Y,P,re),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(Y)}paste(Y){(0,d.paste)(Y,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Y){this._customKeyEventHandler=Y}attachCustomWheelEventHandler(Y){this._customWheelEventHandler=Y}registerLinkProvider(Y){return this._linkProviderService.registerLinkProvider(Y)}registerCharacterJoiner(Y){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const P=this._characterJoinerService.register(Y);return this.refresh(0,this.rows-1),P}deregisterCharacterJoiner(Y){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Y)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Y){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Y)}registerDecoration(Y){return this._decorationService.registerDecoration(Y)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Y,P,re){this._selectionService.setSelection(Y,P,re)}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(Y,P){this._selectionService?.selectLines(Y,P)}_keyDown(Y){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1)return!1;const P=this.browser.isMac&&this.options.macOptionIsMeta&&Y.altKey;if(!P&&!this._compositionHelper.keydown(Y))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;P||Y.key!=="Dead"&&Y.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const re=(0,X.evaluateKeyboardEvent)(Y,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Y),re.type===3||re.type===2){const fe=this.rows-1;return this.scrollLines(re.type===2?-fe:fe),this.cancel(Y,!0)}return re.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Y)||(re.cancel&&this.cancel(Y,!0),!re.key||!!(Y.key&&!Y.ctrlKey&&!Y.altKey&&!Y.metaKey&&Y.key.length===1&&Y.key.charCodeAt(0)>=65&&Y.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(re.key!==K.C0.ETX&&re.key!==K.C0.CR||(this.textarea.value=""),this._onKey.fire({key:re.key,domEvent:Y}),this._showCursor(),this.coreService.triggerDataEvent(re.key,!0),!this.optionsService.rawOptions.screenReaderMode||Y.altKey||Y.ctrlKey?this.cancel(Y,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Y,P){const re=Y.isMac&&!this.options.macOptionIsMeta&&P.altKey&&!P.ctrlKey&&!P.metaKey||Y.isWindows&&P.altKey&&P.ctrlKey&&!P.metaKey||Y.isWindows&&P.getModifierState("AltGraph");return P.type==="keypress"?re:re&&(!P.keyCode||P.keyCode>47)}_keyUp(Y){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1||((function(P){return P.keyCode===16||P.keyCode===17||P.keyCode===18})(Y)||this.focus(),this.updateCursorStyle(Y),this._keyPressHandled=!1)}_keyPress(Y){let P;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1)return!1;if(this.cancel(Y),Y.charCode)P=Y.charCode;else if(Y.which===null||Y.which===void 0)P=Y.keyCode;else{if(Y.which===0||Y.charCode===0)return!1;P=Y.which}return!(!P||(Y.altKey||Y.ctrlKey||Y.metaKey)&&!this._isThirdLevelShift(this.browser,Y)||(P=String.fromCharCode(P),this._onKey.fire({key:P,domEvent:Y}),this._showCursor(),this.coreService.triggerDataEvent(P,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Y){if(Y.data&&Y.inputType==="insertText"&&(!Y.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const P=Y.data;return this.coreService.triggerDataEvent(P,!0),this.cancel(Y),!0}return!1}resize(Y,P){Y!==this.cols||P!==this.rows?super.resize(Y,P):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Y,P){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 Y=1;Y<this.rows;Y++)this.buffer.lines.push(this.buffer.getBlankLine(F.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 Y=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=Y,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(K.C0.ESC+"[I"):this.coreService.triggerDataEvent(K.C0.ESC+"[O")}_reportWindowsOptions(Y){if(this._renderService)switch(Y){case H.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const P=this._renderService.dimensions.css.canvas.width.toFixed(0),re=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[4;${re};${P}t`);break;case H.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const fe=this._renderService.dimensions.css.cell.width.toFixed(0),Se=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[6;${Se};${fe}t`)}}cancel(Y,P){if(this.options.cancelEvents||P)return Y.preventDefault(),Y.stopPropagation(),!1}}c.Terminal=ee},9924:(g,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 p=Date.now();if(p-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=p,this._innerRefresh();else if(!this._additionalRefreshRequested){const C=p-this._lastRefreshMs,x=this._debounceThresholdMS-C;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),x)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const 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(g,c,u){var d=this&&this.__decorate||function(y,f,b,T){var L,R=arguments.length,M=R<3?f:T===null?T=Object.getOwnPropertyDescriptor(f,b):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,f,b,T);else for(var k=y.length-1;k>=0;k--)(L=y[k])&&(M=(R<3?L(M):R>3?L(f,b,M):L(f,b))||M);return R>3&&M&&Object.defineProperty(f,b,M),M},S=this&&this.__param||function(y,f){return function(b,T){f(b,T,y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Viewport=void 0;const p=u(3656),C=u(4725),x=u(8460),A=u(844),E=u(2585);let m=c.Viewport=class extends A.Disposable{constructor(y,f,b,T,L,R,M,k){super(),this._viewportElement=y,this._scrollArea=f,this._bufferService=b,this._optionsService=T,this._charSizeService=L,this._renderService=R,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 x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((I=>this._activeBuffer=I.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((I=>this._renderDimensions=I))),this._handleThemeChange(k.colors),this.register(k.onChangeColors((I=>this._handleThemeChange(I)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(y){this._viewportElement.style.backgroundColor=y.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(y){if(y)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 f=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==f&&(this._lastRecordedBufferHeight=f,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const y=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==y&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=y),this._refreshAnimationFrame=null}syncScrollArea(y=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(y);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(y)}_handleScroll(y){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 f=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:f,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const y=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(y*(this._smoothScrollState.target-this._smoothScrollState.origin)),y<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(y,f){const b=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(f<0&&this._viewportElement.scrollTop!==0||f>0&&b<this._lastRecordedBufferHeight)||(y.cancelable&&y.preventDefault(),!1)}handleWheel(y){const f=this._getPixelsScrolled(y);return f!==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+f:this._smoothScrollState.target+=f,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=f,this._bubbleScroll(y,f))}scrollLines(y){if(y!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const f=y*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+f,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:y,suppressScrollEvent:!1})}_getPixelsScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let f=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_LINE?f*=this._currentRowHeight:y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._currentRowHeight*this._bufferService.rows),f}getBufferElements(y,f){let b,T="";const L=[],R=f??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let k=y;k<R;k++){const I=M.get(k);if(!I)continue;const G=M.get(k+1)?.isWrapped;if(T+=I.translateToString(!G),!G||k===M.length-1){const q=document.createElement("div");q.textContent=T,L.push(q),T.length>0&&(b=q),T=""}}return{bufferElements:L,cursorElement:b}}getLinesScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let f=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(f/=this._currentRowHeight+0,this._wheelPartialScroll+=f,f=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._bufferService.rows),f}_applyScrollModifier(y,f){const b=this._optionsService.rawOptions.fastScrollModifier;return b==="alt"&&f.altKey||b==="ctrl"&&f.ctrlKey||b==="shift"&&f.shiftKey?y*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:y*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(y){this._lastTouchY=y.touches[0].pageY}handleTouchMove(y){const f=this._lastTouchY-y.touches[0].pageY;return this._lastTouchY=y.touches[0].pageY,f!==0&&(this._viewportElement.scrollTop+=f,this._bubbleScroll(y,f))}};c.Viewport=m=d([S(2,E.IBufferService),S(3,E.IOptionsService),S(4,C.ICharSizeService),S(5,C.IRenderService),S(6,C.ICoreBrowserService),S(7,C.IThemeService)],m)},3107:function(g,c,u){var d=this&&this.__decorate||function(E,m,y,f){var b,T=arguments.length,L=T<3?m:f===null?f=Object.getOwnPropertyDescriptor(m,y):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,m,y,f);else for(var R=E.length-1;R>=0;R--)(b=E[R])&&(L=(T<3?b(L):T>3?b(m,y,L):b(m,y))||L);return T>3&&L&&Object.defineProperty(m,y,L),L},S=this&&this.__param||function(E,m){return function(y,f){m(y,f,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferDecorationRenderer=void 0;const p=u(4725),C=u(844),x=u(2585);let A=c.BufferDecorationRenderer=class extends C.Disposable{constructor(E,m,y,f,b){super(),this._screenElement=E,this._bufferService=m,this._coreBrowserService=y,this._decorationService=f,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 E of this._decorationService.decorations)this._renderDecoration(E);this._dimensionsChanged=!1}_renderDecoration(E){this._refreshStyle(E),this._dimensionsChanged&&this._refreshXPosition(E)}_createElement(E){const m=this._coreBrowserService.mainDocument.createElement("div");m.classList.add("xterm-decoration"),m.classList.toggle("xterm-decoration-top-layer",E?.options?.layer==="top"),m.style.width=`${Math.round((E.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,m.style.height=(E.options.height||1)*this._renderService.dimensions.css.cell.height+"px",m.style.top=(E.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",m.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const y=E.options.x??0;return y&&y>this._bufferService.cols&&(m.style.display="none"),this._refreshXPosition(E,m),m}_refreshStyle(E){const m=E.marker.line-this._bufferService.buffers.active.ydisp;if(m<0||m>=this._bufferService.rows)E.element&&(E.element.style.display="none",E.onRenderEmitter.fire(E.element));else{let y=this._decorationElements.get(E);y||(y=this._createElement(E),E.element=y,this._decorationElements.set(E,y),this._container.appendChild(y),E.onDispose((()=>{this._decorationElements.delete(E),y.remove()}))),y.style.top=m*this._renderService.dimensions.css.cell.height+"px",y.style.display=this._altBufferIsActive?"none":"block",E.onRenderEmitter.fire(y)}}_refreshXPosition(E,m=E.element){if(!m)return;const y=E.options.x??0;(E.options.anchor||"left")==="right"?m.style.right=y?y*this._renderService.dimensions.css.cell.width+"px":"":m.style.left=y?y*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(E){this._decorationElements.get(E)?.remove(),this._decorationElements.delete(E),E.dispose()}};c.BufferDecorationRenderer=A=d([S(1,x.IBufferService),S(2,p.ICoreBrowserService),S(3,x.IDecorationService),S(4,p.IRenderService)],A)},5871:(g,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(g,c,u){var d=this&&this.__decorate||function(b,T,L,R){var M,k=arguments.length,I=k<3?T:R===null?R=Object.getOwnPropertyDescriptor(T,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(b,T,L,R);else for(var G=b.length-1;G>=0;G--)(M=b[G])&&(I=(k<3?M(I):k>3?M(T,L,I):M(T,L))||I);return k>3&&I&&Object.defineProperty(T,L,I),I},S=this&&this.__param||function(b,T){return function(L,R){T(L,R,b)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OverviewRulerRenderer=void 0;const p=u(5871),C=u(4725),x=u(844),A=u(2585),E={full:0,left:0,center:0,right:0},m={full:0,left:0,center:0,right:0},y={full:0,left:0,center:0,right:0};let f=c.OverviewRulerRenderer=class extends x.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(b,T,L,R,M,k,I){super(),this._viewportElement=b,this._screenElement=T,this._bufferService=L,this._decorationService=R,this._renderService=M,this._optionsService=k,this._coreBrowserService=I,this._colorZoneStore=new p.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);const G=this._canvas.getContext("2d");if(!G)throw new Error("Ctx cannot be null");this._ctx=G,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,x.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);m.full=this._canvas.width,m.left=b,m.center=T,m.right=b,this._refreshDrawHeightConstants(),y.full=0,y.left=0,y.center=m.left,y.right=m.left+m.center}_refreshDrawHeightConstants(){E.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);E.left=T,E.center=T,E.right=T}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.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(y[b.position||"full"],Math.round((this._canvas.height-1)*(b.startBufferLine/this._bufferService.buffers.active.lines.length)-E[b.position||"full"]/2),m[b.position||"full"],Math.round((this._canvas.height-1)*((b.endBufferLine-b.startBufferLine)/this._bufferService.buffers.active.lines.length)+E[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=f=d([S(2,A.IBufferService),S(3,A.IDecorationService),S(4,C.IRenderService),S(5,A.IOptionsService),S(6,C.ICoreBrowserService)],f)},2950:function(g,c,u){var d=this&&this.__decorate||function(E,m,y,f){var b,T=arguments.length,L=T<3?m:f===null?f=Object.getOwnPropertyDescriptor(m,y):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,m,y,f);else for(var R=E.length-1;R>=0;R--)(b=E[R])&&(L=(T<3?b(L):T>3?b(m,y,L):b(m,y))||L);return T>3&&L&&Object.defineProperty(m,y,L),L},S=this&&this.__param||function(E,m){return function(y,f){m(y,f,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CompositionHelper=void 0;const p=u(4725),C=u(2585),x=u(2584);let A=c.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(E,m,y,f,b,T){this._textarea=E,this._compositionView=m,this._bufferService=y,this._optionsService=f,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(E){this._compositionView.textContent=E.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(E){if(this._isComposing||this._isSendingComposition){if(E.keyCode===229||E.keyCode===16||E.keyCode===17||E.keyCode===18)return!1;this._finalizeComposition(!1)}return E.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(E){if(this._compositionView.classList.remove("active"),this._isComposing=!1,E){const m={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let y;this._isSendingComposition=!1,m.start+=this._dataAlreadySent.length,y=this._isComposing?this._textarea.value.substring(m.start,m.end):this._textarea.value.substring(m.start),y.length>0&&this._coreService.triggerDataEvent(y,!0)}}),0)}else{this._isSendingComposition=!1;const m=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(m,!0)}}_handleAnyTextareaChanges(){const E=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const m=this._textarea.value,y=m.replace(E,"");this._dataAlreadySent=y,m.length>E.length?this._coreService.triggerDataEvent(y,!0):m.length<E.length?this._coreService.triggerDataEvent(`${x.C0.DEL}`,!0):m.length===E.length&&m!==E&&this._coreService.triggerDataEvent(m,!0)}}),0)}updateCompositionElements(E){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const m=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),y=this._renderService.dimensions.css.cell.height,f=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,b=m*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=b+"px",this._compositionView.style.top=f+"px",this._compositionView.style.height=y+"px",this._compositionView.style.lineHeight=y+"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=f+"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"}E||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};c.CompositionHelper=A=d([S(2,C.IBufferService),S(3,C.IOptionsService),S(4,C.ICoreService),S(5,p.IRenderService)],A)},9806:(g,c)=>{function u(d,S,p){const C=p.getBoundingClientRect(),x=d.getComputedStyle(p),A=parseInt(x.getPropertyValue("padding-left")),E=parseInt(x.getPropertyValue("padding-top"));return[S.clientX-C.left-A,S.clientY-C.top-E]}Object.defineProperty(c,"__esModule",{value:!0}),c.getCoords=c.getCoordsRelativeToElement=void 0,c.getCoordsRelativeToElement=u,c.getCoords=function(d,S,p,C,x,A,E,m,y){if(!A)return;const f=u(d,S,p);return f?(f[0]=Math.ceil((f[0]+(y?E/2:0))/E),f[1]=Math.ceil(f[1]/m),f[0]=Math.min(Math.max(f[0],1),C+(y?1:0)),f[1]=Math.min(Math.max(f[1],1),x),f):void 0}},9504:(g,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.moveToCellSequence=void 0;const d=u(2584);function S(m,y,f,b){const T=m-p(m,f),L=y-p(y,f),R=Math.abs(T-L)-(function(M,k,I){let G=0;const q=M-p(M,I),W=k-p(k,I);for(let j=0;j<Math.abs(q-W);j++){const V=C(M,k)==="A"?-1:1;I.buffer.lines.get(q+V*j)?.isWrapped&&G++}return G})(m,y,f);return E(R,A(C(m,y),b))}function p(m,y){let f=0,b=y.buffer.lines.get(m),T=b?.isWrapped;for(;T&&m>=0&&m<y.rows;)f++,b=y.buffer.lines.get(--m),T=b?.isWrapped;return f}function C(m,y){return m>y?"A":"B"}function x(m,y,f,b,T,L){let R=m,M=y,k="";for(;R!==f||M!==b;)R+=T?1:-1,T&&R>L.cols-1?(k+=L.buffer.translateBufferLineToString(M,!1,m,R),R=0,m=0,M++):!T&&R<0&&(k+=L.buffer.translateBufferLineToString(M,!1,0,m+1),R=L.cols-1,m=R,M--);return k+L.buffer.translateBufferLineToString(M,!1,m,R)}function A(m,y){const f=y?"O":"[";return d.C0.ESC+f+m}function E(m,y){m=Math.floor(m);let f="";for(let b=0;b<m;b++)f+=y;return f}c.moveToCellSequence=function(m,y,f,b){const T=f.buffer.x,L=f.buffer.y;if(!f.buffer.hasScrollback)return(function(k,I,G,q,W,j){return S(I,q,W,j).length===0?"":E(x(k,I,k,I-p(I,W),!1,W).length,A("D",j))})(T,L,0,y,f,b)+S(L,y,f,b)+(function(k,I,G,q,W,j){let V;V=S(I,q,W,j).length>0?q-p(q,W):I;const U=q,F=(function(K,X,D,B,N,H){let Q;return Q=S(D,B,N,H).length>0?B-p(B,N):X,K<D&&Q<=B||K>=D&&Q<B?"C":"D"})(k,I,G,q,W,j);return E(x(k,V,G,U,F==="C",W).length,A(F,j))})(T,L,m,y,f,b);let R;if(L===y)return R=T>m?"D":"C",E(Math.abs(T-m),A(R,b));R=L>y?"D":"C";const M=Math.abs(L-y);return E((function(k,I){return I.cols-k})(L>y?m:T,f)+(M-1)*f.cols+1+((L>y?T:m)-1),A(R,b))}},1296:function(g,c,u){var d=this&&this.__decorate||function(j,V,U,F){var K,X=arguments.length,D=X<3?V:F===null?F=Object.getOwnPropertyDescriptor(V,U):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(j,V,U,F);else for(var B=j.length-1;B>=0;B--)(K=j[B])&&(D=(X<3?K(D):X>3?K(V,U,D):K(V,U))||D);return X>3&&D&&Object.defineProperty(V,U,D),D},S=this&&this.__param||function(j,V){return function(U,F){V(U,F,j)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRenderer=void 0;const p=u(3787),C=u(2550),x=u(2223),A=u(6171),E=u(6052),m=u(4725),y=u(8055),f=u(8460),b=u(844),T=u(2585),L="xterm-dom-renderer-owner-",R="xterm-rows",M="xterm-fg-",k="xterm-bg-",I="xterm-focus",G="xterm-selection";let q=1,W=c.DomRenderer=class extends b.Disposable{constructor(j,V,U,F,K,X,D,B,N,H,Q,le,ee){super(),this._terminal=j,this._document=V,this._element=U,this._screenElement=F,this._viewportElement=K,this._helperContainer=X,this._linkifier2=D,this._charSizeService=N,this._optionsService=H,this._bufferService=Q,this._coreBrowserService=le,this._themeService=ee,this._terminalClass=q++,this._rowElements=[],this._selectionRenderModel=(0,E.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new f.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(R),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(G),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((ce=>this._injectCss(ce)))),this._injectCss(this._themeService.colors),this._rowFactory=B.createInstance(p.DomRendererRowFactory,document),this._element.classList.add(L+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ce=>this._handleLinkHover(ce)))),this.register(this._linkifier2.onHideLinkUnderline((ce=>this._handleLinkLeave(ce)))),this.register((0,b.toDisposable)((()=>{this._element.classList.remove(L+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 U of this._rowElements)U.style.width=`${this.dimensions.css.canvas.width}px`,U.style.height=`${this.dimensions.css.cell.height}px`,U.style.lineHeight=`${this.dimensions.css.cell.height}px`,U.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const V=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=V,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 V=`${this._terminalSelector} .${R} { color: ${j.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;V+=`${this._terminalSelector} .${R} .xterm-dim { color: ${y.color.multiplyOpacity(j.foreground,.5).css};}`,V+=`${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 U=`blink_underline_${this._terminalClass}`,F=`blink_bar_${this._terminalClass}`,K=`blink_block_${this._terminalClass}`;V+=`@keyframes ${U} { 50% { border-bottom-style: hidden; }}`,V+=`@keyframes ${F} { 50% { box-shadow: none; }}`,V+=`@keyframes ${K} { 0% { background-color: ${j.cursor.css}; color: ${j.cursorAccent.css}; } 50% { background-color: inherit; color: ${j.cursor.css}; }}`,V+=`${this._terminalSelector} .${R}.${I} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${U} 1s step-end infinite;}${this._terminalSelector} .${R}.${I} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${F} 1s step-end infinite;}${this._terminalSelector} .${R}.${I} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block { background-color: ${j.cursor.css}; color: ${j.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${j.cursor.css} !important; color: ${j.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${j.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${j.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${j.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,V+=`${this._terminalSelector} .${G} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${G} div { position: absolute; background-color: ${j.selectionBackgroundOpaque.css};}${this._terminalSelector} .${G} div { position: absolute; background-color: ${j.selectionInactiveBackgroundOpaque.css};}`;for(const[X,D]of j.ansi.entries())V+=`${this._terminalSelector} .${M}${X} { color: ${D.css}; }${this._terminalSelector} .${M}${X}.xterm-dim { color: ${y.color.multiplyOpacity(D,.5).css}; }${this._terminalSelector} .${k}${X} { background-color: ${D.css}; }`;V+=`${this._terminalSelector} .${M}${x.INVERTED_DEFAULT_COLOR} { color: ${y.color.opaque(j.background).css}; }${this._terminalSelector} .${M}${x.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${y.color.multiplyOpacity(y.color.opaque(j.background),.5).css}; }${this._terminalSelector} .${k}${x.INVERTED_DEFAULT_COLOR} { background-color: ${j.foreground.css}; }`,this._themeStyleElement.textContent=V}_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,V){for(let U=this._rowElements.length;U<=V;U++){const F=this._document.createElement("div");this._rowContainer.appendChild(F),this._rowElements.push(F)}for(;this._rowElements.length>V;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(j,V){this._refreshRowElements(j,V),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(I),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(I),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(j,V,U){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(j,V,U),this.renderRows(0,this._bufferService.rows-1),!j||!V)return;this._selectionRenderModel.update(this._terminal,j,V,U);const F=this._selectionRenderModel.viewportStartRow,K=this._selectionRenderModel.viewportEndRow,X=this._selectionRenderModel.viewportCappedStartRow,D=this._selectionRenderModel.viewportCappedEndRow;if(X>=this._bufferService.rows||D<0)return;const B=this._document.createDocumentFragment();if(U){const N=j[0]>V[0];B.appendChild(this._createSelectionElement(X,N?V[0]:j[0],N?j[0]:V[0],D-X+1))}else{const N=F===X?j[0]:0,H=X===K?V[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(X,N,H));const Q=D-X-1;if(B.appendChild(this._createSelectionElement(X+1,0,this._bufferService.cols,Q)),X!==D){const le=K===D?V[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(D,0,le))}}this._selectionContainer.appendChild(B)}_createSelectionElement(j,V,U,F=1){const K=this._document.createElement("div"),X=V*this.dimensions.css.cell.width;let D=this.dimensions.css.cell.width*(U-V);return X+D>this.dimensions.css.canvas.width&&(D=this.dimensions.css.canvas.width-X),K.style.height=F*this.dimensions.css.cell.height+"px",K.style.top=j*this.dimensions.css.cell.height+"px",K.style.left=`${X}px`,K.style.width=`${D}px`,K}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,V){const U=this._bufferService.buffer,F=U.ybase+U.y,K=Math.min(U.x,this._bufferService.cols-1),X=this._optionsService.rawOptions.cursorBlink,D=this._optionsService.rawOptions.cursorStyle,B=this._optionsService.rawOptions.cursorInactiveStyle;for(let N=j;N<=V;N++){const H=N+U.ydisp,Q=this._rowElements[N],le=U.lines.get(H);if(!Q||!le)break;Q.replaceChildren(...this._rowFactory.createRow(le,H,H===F,D,B,K,X,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${L}${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,V,U,F,K,X){U<0&&(j=0),F<0&&(V=0);const D=this._bufferService.rows-1;U=Math.max(Math.min(U,D),0),F=Math.max(Math.min(F,D),0),K=Math.min(K,this._bufferService.cols);const B=this._bufferService.buffer,N=B.ybase+B.y,H=Math.min(B.x,K-1),Q=this._optionsService.rawOptions.cursorBlink,le=this._optionsService.rawOptions.cursorStyle,ee=this._optionsService.rawOptions.cursorInactiveStyle;for(let ce=U;ce<=F;++ce){const Y=ce+B.ydisp,P=this._rowElements[ce],re=B.lines.get(Y);if(!P||!re)break;P.replaceChildren(...this._rowFactory.createRow(re,Y,Y===N,le,ee,H,Q,this.dimensions.css.cell.width,this._widthCache,X?ce===U?j:0:-1,X?(ce===F?V:K)-1:-1))}}};c.DomRenderer=W=d([S(7,T.IInstantiationService),S(8,m.ICharSizeService),S(9,T.IOptionsService),S(10,T.IBufferService),S(11,m.ICoreBrowserService),S(12,m.IThemeService)],W)},3787:function(g,c,u){var d=this&&this.__decorate||function(R,M,k,I){var G,q=arguments.length,W=q<3?M:I===null?I=Object.getOwnPropertyDescriptor(M,k):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(R,M,k,I);else for(var j=R.length-1;j>=0;j--)(G=R[j])&&(W=(q<3?G(W):q>3?G(M,k,W):G(M,k))||W);return q>3&&W&&Object.defineProperty(M,k,W),W},S=this&&this.__param||function(R,M){return function(k,I){M(k,I,R)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRendererRowFactory=void 0;const p=u(2223),C=u(643),x=u(511),A=u(2585),E=u(8055),m=u(4725),y=u(4269),f=u(6171),b=u(3734);let T=c.DomRendererRowFactory=class{constructor(R,M,k,I,G,q,W){this._document=R,this._characterJoinerService=M,this._optionsService=k,this._coreBrowserService=I,this._coreService=G,this._decorationService=q,this._themeService=W,this._workCell=new x.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,M,k){this._selectionStart=R,this._selectionEnd=M,this._columnSelectMode=k}createRow(R,M,k,I,G,q,W,j,V,U,F){const K=[],X=this._characterJoinerService.getJoinedCharacters(M),D=this._themeService.colors;let B,N=R.getNoBgTrimmedLength();k&&N<q+1&&(N=q+1);let H=0,Q="",le=0,ee=0,ce=0,Y=!1,P=0,re=!1,fe=0;const Se=[],ye=U!==-1&&F!==-1;for(let Pe=0;Pe<N;Pe++){R.loadCell(Pe,this._workCell);let We=this._workCell.getWidth();if(We===0)continue;let Ze=!1,xt=Pe,Ne=this._workCell;if(X.length>0&&Pe===X[0][0]){Ze=!0;const ft=X.shift();Ne=new y.JoinedCellData(this._workCell,R.translateToString(!0,ft[0],ft[1]),ft[1]-ft[0]),xt=ft[1]-1,We=Ne.getWidth()}const en=this._isCellInSelection(Pe,M),Sn=k&&Pe===q,wn=ye&&Pe>=U&&Pe<=F;let _i=!1;this._decorationService.forEachDecorationAtCell(Pe,M,void 0,(ft=>{_i=!0}));let Bi=Ne.getChars()||C.WHITESPACE_CELL_CHAR;if(Bi===" "&&(Ne.isUnderline()||Ne.isOverline())&&(Bi=" "),fe=We*j-V.get(Bi,Ne.isBold(),Ne.isItalic()),B){if(H&&(en&&re||!en&&!re&&Ne.bg===le)&&(en&&re&&D.selectionForeground||Ne.fg===ee)&&Ne.extended.ext===ce&&wn===Y&&fe===P&&!Sn&&!Ze&&!_i){Ne.isInvisible()?Q+=C.WHITESPACE_CELL_CHAR:Q+=Bi,H++;continue}H&&(B.textContent=Q),B=this._document.createElement("span"),H=0,Q=""}else B=this._document.createElement("span");if(le=Ne.bg,ee=Ne.fg,ce=Ne.extended.ext,Y=wn,P=fe,re=en,Ze&&q>=Pe&&q<=xt&&(q=Pe),!this._coreService.isCursorHidden&&Sn&&this._coreService.isCursorInitialized){if(Se.push("xterm-cursor"),this._coreBrowserService.isFocused)W&&Se.push("xterm-cursor-blink"),Se.push(I==="bar"?"xterm-cursor-bar":I==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(G)switch(G){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"),Q=Ne.isInvisible()?C.WHITESPACE_CELL_CHAR:Ne.getChars()||C.WHITESPACE_CELL_CHAR,Ne.isUnderline()&&(Se.push(`xterm-underline-${Ne.extended.underlineStyle}`),Q===" "&&(Q=" "),!Ne.isUnderlineColorDefault()))if(Ne.isUnderlineColorRGB())B.style.textDecorationColor=`rgb(${b.AttributeData.toColorRGB(Ne.getUnderlineColor()).join(",")})`;else{let ft=Ne.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ne.isBold()&&ft<8&&(ft+=8),B.style.textDecorationColor=D.ansi[ft].css}Ne.isOverline()&&(Se.push("xterm-overline"),Q===" "&&(Q=" ")),Ne.isStrikethrough()&&Se.push("xterm-strikethrough"),wn&&(B.style.textDecoration="underline");let tn=Ne.getFgColor(),ht=Ne.getFgColorMode(),Vt=Ne.getBgColor(),Pt=Ne.getBgColorMode();const zt=!!Ne.isInverse();if(zt){const ft=tn;tn=Vt,Vt=ft;const Fn=ht;ht=Pt,Pt=Fn}let nn,ji,Dn,ri=!1;switch(this._decorationService.forEachDecorationAtCell(Pe,M,void 0,(ft=>{ft.options.layer!=="top"&&ri||(ft.backgroundColorRGB&&(Pt=50331648,Vt=ft.backgroundColorRGB.rgba>>8&16777215,nn=ft.backgroundColorRGB),ft.foregroundColorRGB&&(ht=50331648,tn=ft.foregroundColorRGB.rgba>>8&16777215,ji=ft.foregroundColorRGB),ri=ft.options.layer==="top")})),!ri&&en&&(nn=this._coreBrowserService.isFocused?D.selectionBackgroundOpaque:D.selectionInactiveBackgroundOpaque,Vt=nn.rgba>>8&16777215,Pt=50331648,ri=!0,D.selectionForeground&&(ht=50331648,tn=D.selectionForeground.rgba>>8&16777215,ji=D.selectionForeground)),ri&&Se.push("xterm-decoration-top"),Pt){case 16777216:case 33554432:Dn=D.ansi[Vt],Se.push(`xterm-bg-${Vt}`);break;case 50331648:Dn=E.channels.toColor(Vt>>16,Vt>>8&255,255&Vt),this._addStyle(B,`background-color:#${L((Vt>>>0).toString(16),"0",6)}`);break;default:zt?(Dn=D.foreground,Se.push(`xterm-bg-${p.INVERTED_DEFAULT_COLOR}`)):Dn=D.background}switch(nn||Ne.isDim()&&(nn=E.color.multiplyOpacity(Dn,.5)),ht){case 16777216:case 33554432:Ne.isBold()&&tn<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(tn+=8),this._applyMinimumContrast(B,Dn,D.ansi[tn],Ne,nn,void 0)||Se.push(`xterm-fg-${tn}`);break;case 50331648:const ft=E.channels.toColor(tn>>16&255,tn>>8&255,255&tn);this._applyMinimumContrast(B,Dn,ft,Ne,nn,ji)||this._addStyle(B,`color:#${L(tn.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(B,Dn,D.foreground,Ne,nn,ji)||zt&&Se.push(`xterm-fg-${p.INVERTED_DEFAULT_COLOR}`)}Se.length&&(B.className=Se.join(" "),Se.length=0),Sn||Ze||_i?B.textContent=Q:H++,fe!==this.defaultSpacing&&(B.style.letterSpacing=`${fe}px`),K.push(B),Pe=xt}return B&&H&&(B.textContent=Q),K}_applyMinimumContrast(R,M,k,I,G,q){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,f.treatGlyphAsBackgroundColor)(I.getCode()))return!1;const W=this._getContrastCache(I);let j;if(G||q||(j=W.getColor(M.rgba,k.rgba)),j===void 0){const V=this._optionsService.rawOptions.minimumContrastRatio/(I.isDim()?2:1);j=E.color.ensureContrastRatio(G||M,q||k,V),W.setColor((G||M).rgba,(q||k).rgba,j??null)}return!!j&&(this._addStyle(R,`color:${j.css}`),!0)}_getContrastCache(R){return R.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(R,M){R.setAttribute("style",`${R.getAttribute("style")||""}${M};`)}_isCellInSelection(R,M){const k=this._selectionStart,I=this._selectionEnd;return!(!k||!I)&&(this._columnSelectMode?k[0]<=I[0]?R>=k[0]&&M>=k[1]&&R<I[0]&&M<=I[1]:R<k[0]&&M>=k[1]&&R>=I[0]&&M<=I[1]:M>k[1]&&M<I[1]||k[1]===I[1]&&M===k[1]&&R>=k[0]&&R<I[0]||k[1]<I[1]&&M===I[1]&&R<I[0]||k[1]<I[1]&&M===k[1]&&R>=k[0])}};function L(R,M,k){for(;R.length<k;)R=M+R;return R}c.DomRendererRowFactory=T=d([S(1,m.ICharacterJoinerService),S(2,A.IOptionsService),S(3,m.ICoreBrowserService),S(4,A.ICoreService),S(5,A.IDecorationService),S(6,m.IThemeService)],T)},2550:(g,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 p=u.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontWeight="bold";const C=u.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontStyle="italic";const x=u.createElement("span");x.classList.add("xterm-char-measure-element"),x.style.fontWeight="bold",x.style.fontStyle="italic",this._measureElements=[S,p,C,x],this._container.appendChild(S),this._container.appendChild(p),this._container.appendChild(C),this._container.appendChild(x),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,p){u===this._font&&d===this._fontSize&&S===this._weight&&p===this._weightBold||(this._font=u,this._fontSize=d,this._weight=S,this._weightBold=p,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${S}`,this._measureElements[1].style.fontWeight=`${p}`,this._measureElements[2].style.fontWeight=`${S}`,this._measureElements[3].style.fontWeight=`${p}`,this.clear())}get(u,d,S){let p=0;if(!d&&!S&&u.length===1&&(p=u.charCodeAt(0))<256){if(this._flat[p]!==-9999)return this._flat[p];const A=this._measure(u,0);return A>0&&(this._flat[p]=A),A}let C=u;d&&(C+="B"),S&&(C+="I");let x=this._holey.get(C);if(x===void 0){let A=0;d&&(A|=1),S&&(A|=2),x=this._measure(u,A),x>0&&this._holey.set(C,x)}return x}_measure(u,d){const S=this._measureElements[d];return S.textContent=u.repeat(32),S.offsetWidth/32}}},2223:(g,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:(g,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,p,C,x){return p===1&&C>Math.ceil(1.5*x)&&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(p){return 9472<=p&&p<=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,p,C=0){return(S-(2*Math.round(p)-C))%(2*Math.round(p))}},6052:(g,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,p,C,x=!1){if(this.selectionStart=p,this.selectionEnd=C,!p||!C||p[0]===C[0]&&p[1]===C[1])return void this.clear();const A=S.buffers.active.ydisp,E=p[1]-A,m=C[1]-A,y=Math.max(E,0),f=Math.min(m,S.rows-1);y>=S.rows||f<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=x,this.viewportStartRow=E,this.viewportEndRow=m,this.viewportCappedStartRow=y,this.viewportCappedEndRow=f,this.startCol=p[0],this.endCol=C[0])}isCellSelected(S,p,C){return!!this.hasSelection&&(C-=S.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?p>=this.startCol&&C>=this.viewportCappedStartRow&&p<this.endCol&&C<=this.viewportCappedEndRow:p<this.startCol&&C>=this.viewportCappedStartRow&&p>=this.endCol&&C<=this.viewportCappedEndRow:C>this.viewportStartRow&&C<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&C===this.viewportStartRow&&p>=this.startCol&&p<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportEndRow&&p<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportStartRow&&p>=this.startCol)}}c.createSelectionRenderModel=function(){return new u}},456:(g,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(g,c,u){var d=this&&this.__decorate||function(f,b,T,L){var R,M=arguments.length,k=M<3?b:L===null?L=Object.getOwnPropertyDescriptor(b,T):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(f,b,T,L);else for(var I=f.length-1;I>=0;I--)(R=f[I])&&(k=(M<3?R(k):M>3?R(b,T,k):R(b,T))||k);return M>3&&k&&Object.defineProperty(b,T,k),k},S=this&&this.__param||function(f,b){return function(T,L){b(T,L,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharSizeService=void 0;const p=u(2585),C=u(8460),x=u(844);let A=c.CharSizeService=class extends x.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(f,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 y(this._optionsService))}catch{this._measureStrategy=this.register(new m(f,b,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const f=this._measureStrategy.measure();f.width===this.width&&f.height===this.height||(this.width=f.width,this.height=f.height,this._onCharSizeChange.fire())}};c.CharSizeService=A=d([S(2,p.IOptionsService)],A);class E extends x.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 m extends E{constructor(b,T,L){super(),this._document=b,this._parentElement=T,this._optionsService=L,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 y extends E{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(g,c,u){var d=this&&this.__decorate||function(y,f,b,T){var L,R=arguments.length,M=R<3?f:T===null?T=Object.getOwnPropertyDescriptor(f,b):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,f,b,T);else for(var k=y.length-1;k>=0;k--)(L=y[k])&&(M=(R<3?L(M):R>3?L(f,b,M):L(f,b))||M);return R>3&&M&&Object.defineProperty(f,b,M),M},S=this&&this.__param||function(y,f){return function(b,T){f(b,T,y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharacterJoinerService=c.JoinedCellData=void 0;const p=u(3734),C=u(643),x=u(511),A=u(2585);class E extends p.AttributeData{constructor(f,b,T){super(),this.content=0,this.combinedData="",this.fg=f.fg,this.bg=f.bg,this.combinedData=b,this._width=T}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(f){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.JoinedCellData=E;let m=c.CharacterJoinerService=class n2{constructor(f){this._bufferService=f,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new x.CellData}register(f){const b={id:this._nextCharacterJoinerId++,handler:f};return this._characterJoiners.push(b),b.id}deregister(f){for(let b=0;b<this._characterJoiners.length;b++)if(this._characterJoiners[b].id===f)return this._characterJoiners.splice(b,1),!0;return!1}getJoinedCharacters(f){if(this._characterJoiners.length===0)return[];const b=this._bufferService.buffer.lines.get(f);if(!b||b.length===0)return[];const T=[],L=b.translateToString(!0);let R=0,M=0,k=0,I=b.getFg(0),G=b.getBg(0);for(let q=0;q<b.getTrimmedLength();q++)if(b.loadCell(q,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==I||this._workCell.bg!==G){if(q-R>1){const W=this._getJoinedRanges(L,k,M,b,R);for(let j=0;j<W.length;j++)T.push(W[j])}R=q,k=M,I=this._workCell.fg,G=this._workCell.bg}M+=this._workCell.getChars().length||C.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-R>1){const q=this._getJoinedRanges(L,k,M,b,R);for(let W=0;W<q.length;W++)T.push(q[W])}return T}_getJoinedRanges(f,b,T,L,R){const M=f.substring(b,T);let k=[];try{k=this._characterJoiners[0].handler(M)}catch(I){console.error(I)}for(let I=1;I<this._characterJoiners.length;I++)try{const G=this._characterJoiners[I].handler(M);for(let q=0;q<G.length;q++)n2._mergeRanges(k,G[q])}catch(G){console.error(G)}return this._stringRangesToCellRanges(k,L,R),k}_stringRangesToCellRanges(f,b,T){let L=0,R=!1,M=0,k=f[L];if(k){for(let I=T;I<this._bufferService.cols;I++){const G=b.getWidth(I),q=b.getString(I).length||C.WHITESPACE_CELL_CHAR.length;if(G!==0){if(!R&&k[0]<=M&&(k[0]=I,R=!0),k[1]<=M){if(k[1]=I,k=f[++L],!k)break;k[0]<=M?(k[0]=I,R=!0):R=!1}M+=q}}k&&(k[1]=this._bufferService.cols)}}static _mergeRanges(f,b){let T=!1;for(let L=0;L<f.length;L++){const R=f[L];if(T){if(b[1]<=R[0])return f[L-1][1]=b[1],f;if(b[1]<=R[1])return f[L-1][1]=Math.max(b[1],R[1]),f.splice(L,1),f;f.splice(L,1),L--}else{if(b[1]<=R[0])return f.splice(L,0,b),f;if(b[1]<=R[1])return R[0]=Math.min(b[0],R[0]),f;b[0]<R[1]&&(R[0]=Math.min(b[0],R[0]),T=!0)}}return T?f[f.length-1][1]=b[1]:f.push(b),f}};c.CharacterJoinerService=m=d([S(0,A.IBufferService)],m)},5114:(g,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreBrowserService=void 0;const d=u(844),S=u(8460),p=u(3656);class C extends d.Disposable{constructor(E,m,y){super(),this._textarea=E,this._window=m,this.mainDocument=y,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new x(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((f=>this._screenDprMonitor.setWindow(f)))),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(E){this._window!==E&&(this._window=E,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 x extends d.Disposable{constructor(E){super(),this._parentWindow=E,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(E){this._parentWindow=E,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,p.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){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:(g,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 x=this.linkProviders.indexOf(C);x!==-1&&this.linkProviders.splice(x,1)}}}}c.LinkProviderService=S},8934:function(g,c,u){var d=this&&this.__decorate||function(A,E,m,y){var f,b=arguments.length,T=b<3?E:y===null?y=Object.getOwnPropertyDescriptor(E,m):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(A,E,m,y);else for(var L=A.length-1;L>=0;L--)(f=A[L])&&(T=(b<3?f(T):b>3?f(E,m,T):f(E,m))||T);return b>3&&T&&Object.defineProperty(E,m,T),T},S=this&&this.__param||function(A,E){return function(m,y){E(m,y,A)}};Object.defineProperty(c,"__esModule",{value:!0}),c.MouseService=void 0;const p=u(4725),C=u(9806);let x=c.MouseService=class{constructor(A,E){this._renderService=A,this._charSizeService=E}getCoords(A,E,m,y,f){return(0,C.getCoords)(window,A,E,m,y,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,f)}getMouseReportCoords(A,E){const m=(0,C.getCoordsRelativeToElement)(window,A,E);if(this._charSizeService.hasValidSize)return m[0]=Math.min(Math.max(m[0],0),this._renderService.dimensions.css.canvas.width-1),m[1]=Math.min(Math.max(m[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(m[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(m[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(m[0]),y:Math.floor(m[1])}}};c.MouseService=x=d([S(0,p.IRenderService),S(1,p.ICharSizeService)],x)},3230:function(g,c,u){var d=this&&this.__decorate||function(f,b,T,L){var R,M=arguments.length,k=M<3?b:L===null?L=Object.getOwnPropertyDescriptor(b,T):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(f,b,T,L);else for(var I=f.length-1;I>=0;I--)(R=f[I])&&(k=(M<3?R(k):M>3?R(b,T,k):R(b,T))||k);return M>3&&k&&Object.defineProperty(b,T,k),k},S=this&&this.__param||function(f,b){return function(T,L){b(T,L,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.RenderService=void 0;const p=u(6193),C=u(4725),x=u(8460),A=u(844),E=u(7226),m=u(2585);let y=c.RenderService=class extends A.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(f,b,T,L,R,M,k,I){super(),this._rowCount=f,this._charSizeService=L,this._renderer=this.register(new A.MutableDisposable),this._pausedResizeTask=new E.DebouncedIdleTask,this._observerDisposable=this.register(new A.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new x.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new x.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new x.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new x.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new p.RenderDebouncer(((G,q)=>this._renderRows(G,q)),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(R.onDecorationRegistered((()=>this._fullRefresh()))),this.register(R.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(I.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(k.window,b),this.register(k.onWindowChange((G=>this._registerIntersectionObserver(G,b))))}_registerIntersectionObserver(f,b){if("IntersectionObserver"in f){const T=new f.IntersectionObserver((L=>this._handleIntersectionChange(L[L.length-1])),{threshold:0});T.observe(b),this._observerDisposable.value=(0,A.toDisposable)((()=>T.disconnect()))}}_handleIntersectionChange(f){this._isPaused=f.isIntersecting===void 0?f.intersectionRatio===0:!f.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(f,b,T=!1){this._isPaused?this._needsFullRefresh=!0:(T||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(f,b,this._rowCount))}_renderRows(f,b){this._renderer.value&&(f=Math.min(f,this._rowCount-1),b=Math.min(b,this._rowCount-1),this._renderer.value.renderRows(f,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:f,end:b}),this._onRender.fire({start:f,end:b}),this._isNextRenderRedrawOnly=!0)}resize(f,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(f){this._renderer.value=f,this._renderer.value&&(this._renderer.value.onRequestRedraw((b=>this.refreshRows(b.start,b.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(f){return this._renderDebouncer.addRefreshCallback(f)}_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(f,b){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(f,b))):this._renderer.value.handleResize(f,b),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(f,b,T){this._selectionState.start=f,this._selectionState.end=b,this._selectionState.columnSelectMode=T,this._renderer.value?.handleSelectionChanged(f,b,T)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};c.RenderService=y=d([S(2,m.IOptionsService),S(3,C.ICharSizeService),S(4,m.IDecorationService),S(5,m.IBufferService),S(6,C.ICoreBrowserService),S(7,C.IThemeService)],y)},9312:function(g,c,u){var d=this&&this.__decorate||function(k,I,G,q){var W,j=arguments.length,V=j<3?I:q===null?q=Object.getOwnPropertyDescriptor(I,G):q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(k,I,G,q);else for(var U=k.length-1;U>=0;U--)(W=k[U])&&(V=(j<3?W(V):j>3?W(I,G,V):W(I,G))||V);return j>3&&V&&Object.defineProperty(I,G,V),V},S=this&&this.__param||function(k,I){return function(G,q){I(G,q,k)}};Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionService=void 0;const p=u(9806),C=u(9504),x=u(456),A=u(4725),E=u(8460),m=u(844),y=u(6114),f=u(4841),b=u(511),T=u(2585),L=" ",R=new RegExp(L,"g");let M=c.SelectionService=class extends m.Disposable{constructor(k,I,G,q,W,j,V,U,F){super(),this._element=k,this._screenElement=I,this._linkifier=G,this._bufferService=q,this._coreService=W,this._mouseService=j,this._optionsService=V,this._renderService=U,this._coreBrowserService=F,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 E.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new E.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new E.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new E.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=K=>this._handleMouseMove(K),this._mouseUpListener=K=>this._handleMouseUp(K),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((K=>this._handleTrim(K))),this.register(this._bufferService.buffers.onBufferActivate((K=>this._handleBufferActivate(K)))),this.enable(),this._model=new x.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,m.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,I=this._model.finalSelectionEnd;return!(!k||!I||k[0]===I[0]&&k[1]===I[1])}get selectionText(){const k=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;if(!k||!I)return"";const G=this._bufferService.buffer,q=[];if(this._activeSelectionMode===3){if(k[0]===I[0])return"";const W=k[0]<I[0]?k[0]:I[0],j=k[0]<I[0]?I[0]:k[0];for(let V=k[1];V<=I[1];V++){const U=G.translateBufferLineToString(V,!0,W,j);q.push(U)}}else{const W=k[1]===I[1]?I[0]:void 0;q.push(G.translateBufferLineToString(k[1],!0,k[0],W));for(let j=k[1]+1;j<=I[1]-1;j++){const V=G.lines.get(j),U=G.translateBufferLineToString(j,!0);V?.isWrapped?q[q.length-1]+=U:q.push(U)}if(k[1]!==I[1]){const j=G.lines.get(I[1]),V=G.translateBufferLineToString(I[1],!0,0,I[0]);j&&j.isWrapped?q[q.length-1]+=V:q.push(V)}}return q.map((W=>W.replace(R," "))).join(y.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()))),y.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 I=this._getMouseBufferCoords(k),G=this._model.finalSelectionStart,q=this._model.finalSelectionEnd;return!!(G&&q&&I)&&this._areCoordsInSelection(I,G,q)}isCellInSelection(k,I){const G=this._model.finalSelectionStart,q=this._model.finalSelectionEnd;return!(!G||!q)&&this._areCoordsInSelection([k,I],G,q)}_areCoordsInSelection(k,I,G){return k[1]>I[1]&&k[1]<G[1]||I[1]===G[1]&&k[1]===I[1]&&k[0]>=I[0]&&k[0]<G[0]||I[1]<G[1]&&k[1]===G[1]&&k[0]<G[0]||I[1]<G[1]&&k[1]===I[1]&&k[0]>=I[0]}_selectWordAtCursor(k,I){const G=this._linkifier.currentLink?.link?.range;if(G)return this._model.selectionStart=[G.start.x-1,G.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)(G,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const q=this._getMouseBufferCoords(k);return!!q&&(this._selectWordAt(q,I),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(k,I){this._model.clearSelection(),k=Math.max(k,0),I=Math.min(I,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,k],this._model.selectionEnd=[this._bufferService.cols,I],this.refresh(),this._onSelectionChange.fire()}_handleTrim(k){this._model.handleTrim(k)&&this.refresh()}_getMouseBufferCoords(k){const I=this._mouseService.getCoords(k,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(I)return I[0]--,I[1]--,I[1]+=this._bufferService.buffer.ydisp,I}_getMouseEventScrollAmount(k){let I=(0,p.getCoordsRelativeToElement)(this._coreBrowserService.window,k,this._screenElement)[1];const G=this._renderService.dimensions.css.canvas.height;return I>=0&&I<=G?0:(I>G&&(I-=G),I=Math.min(Math.max(I,-50),50),I/=50,I/Math.abs(I)+Math.round(14*I))}shouldForceSelection(k){return y.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 I=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);I&&I.length!==this._model.selectionStart[0]&&I.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(k){this._selectWordAtCursor(k,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(k){const I=this._getMouseBufferCoords(k);I&&(this._activeSelectionMode=2,this._selectLineAt(I[1]))}shouldColumnSelect(k){return k.altKey&&!(y.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(k){if(k.stopImmediatePropagation(),!this._model.selectionStart)return;const I=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 G=this._bufferService.buffer;if(this._model.selectionEnd[1]<G.lines.length){const q=G.lines.get(this._model.selectionEnd[1]);q&&q.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}I&&I[0]===this._model.selectionEnd[0]&&I[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 I=k.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&I<500&&k.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const G=this._mouseService.getCoords(k,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(G&&G[0]!==void 0&&G[1]!==void 0){const q=(0,C.moveToCellSequence)(G[0]-1,G[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(q,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const k=this._model.finalSelectionStart,I=this._model.finalSelectionEnd,G=!(!k||!I||k[0]===I[0]&&k[1]===I[1]);G?k&&I&&(this._oldSelectionStart&&this._oldSelectionEnd&&k[0]===this._oldSelectionStart[0]&&k[1]===this._oldSelectionStart[1]&&I[0]===this._oldSelectionEnd[0]&&I[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(k,I,G)):this._oldHasSelection&&this._fireOnSelectionChange(k,I,G)}_fireOnSelectionChange(k,I,G){this._oldSelectionStart=k,this._oldSelectionEnd=I,this._oldHasSelection=G,this._onSelectionChange.fire()}_handleBufferActivate(k){this.clearSelection(),this._trimListener.dispose(),this._trimListener=k.activeBuffer.lines.onTrim((I=>this._handleTrim(I)))}_convertViewportColToCharacterIndex(k,I){let G=I;for(let q=0;I>=q;q++){const W=k.loadCell(q,this._workCell).getChars().length;this._workCell.getWidth()===0?G--:W>1&&I!==q&&(G+=W-1)}return G}setSelection(k,I,G){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[k,I],this._model.selectionStartLength=G,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(k){this._isClickInSelection(k)||(this._selectWordAtCursor(k,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(k,I,G=!0,q=!0){if(k[0]>=this._bufferService.cols)return;const W=this._bufferService.buffer,j=W.lines.get(k[1]);if(!j)return;const V=W.translateBufferLineToString(k[1],!1);let U=this._convertViewportColToCharacterIndex(j,k[0]),F=U;const K=k[0]-U;let X=0,D=0,B=0,N=0;if(V.charAt(U)===" "){for(;U>0&&V.charAt(U-1)===" ";)U--;for(;F<V.length&&V.charAt(F+1)===" ";)F++}else{let le=k[0],ee=k[0];j.getWidth(le)===0&&(X++,le--),j.getWidth(ee)===2&&(D++,ee++);const ce=j.getString(ee).length;for(ce>1&&(N+=ce-1,F+=ce-1);le>0&&U>0&&!this._isCharWordSeparator(j.loadCell(le-1,this._workCell));){j.loadCell(le-1,this._workCell);const Y=this._workCell.getChars().length;this._workCell.getWidth()===0?(X++,le--):Y>1&&(B+=Y-1,U-=Y-1),U--,le--}for(;ee<j.length&&F+1<V.length&&!this._isCharWordSeparator(j.loadCell(ee+1,this._workCell));){j.loadCell(ee+1,this._workCell);const Y=this._workCell.getChars().length;this._workCell.getWidth()===2?(D++,ee++):Y>1&&(N+=Y-1,F+=Y-1),F++,ee++}}F++;let H=U+K-X+B,Q=Math.min(this._bufferService.cols,F-U+X+D-B-N);if(I||V.slice(U,F).trim()!==""){if(G&&H===0&&j.getCodePoint(0)!==32){const le=W.lines.get(k[1]-1);if(le&&j.isWrapped&&le.getCodePoint(this._bufferService.cols-1)!==32){const ee=this._getWordAt([this._bufferService.cols-1,k[1]-1],!1,!0,!1);if(ee){const ce=this._bufferService.cols-ee.start;H-=ce,Q+=ce}}}if(q&&H+Q===this._bufferService.cols&&j.getCodePoint(this._bufferService.cols-1)!==32){const le=W.lines.get(k[1]+1);if(le?.isWrapped&&le.getCodePoint(0)!==32){const ee=this._getWordAt([0,k[1]+1],!1,!1,!0);ee&&(Q+=ee.length)}}return{start:H,length:Q}}}_selectWordAt(k,I){const G=this._getWordAt(k,I);if(G){for(;G.start<0;)G.start+=this._bufferService.cols,k[1]--;this._model.selectionStart=[G.start,k[1]],this._model.selectionStartLength=G.length}}_selectToWordAt(k){const I=this._getWordAt(k,!0);if(I){let G=k[1];for(;I.start<0;)I.start+=this._bufferService.cols,G--;if(!this._model.areSelectionValuesReversed())for(;I.start+I.length>this._bufferService.cols;)I.length-=this._bufferService.cols,G++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?I.start:I.start+I.length,G]}}_isCharWordSeparator(k){return k.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(k.getChars())>=0}_selectLineAt(k){const I=this._bufferService.buffer.getWrappedRangeForLine(k),G={start:{x:0,y:I.first},end:{x:this._bufferService.cols-1,y:I.last}};this._model.selectionStart=[0,I.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)(G,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:(g,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(g,c,u){var d=this&&this.__decorate||function(M,k,I,G){var q,W=arguments.length,j=W<3?k:G===null?G=Object.getOwnPropertyDescriptor(k,I):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(M,k,I,G);else for(var V=M.length-1;V>=0;V--)(q=M[V])&&(j=(W<3?q(j):W>3?q(k,I,j):q(k,I))||j);return W>3&&j&&Object.defineProperty(k,I,j),j},S=this&&this.__param||function(M,k){return function(I,G){k(I,G,M)}};Object.defineProperty(c,"__esModule",{value:!0}),c.ThemeService=c.DEFAULT_ANSI_COLORS=void 0;const p=u(7239),C=u(8055),x=u(8460),A=u(844),E=u(2585),m=C.css.toColor("#ffffff"),y=C.css.toColor("#000000"),f=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 I=0;I<216;I++){const G=k[I/36%6|0],q=k[I/6%6|0],W=k[I%6];M.push({css:C.channels.toCss(G,q,W),rgba:C.channels.toRgba(G,q,W)})}for(let I=0;I<24;I++){const G=8+10*I;M.push({css:C.channels.toCss(G,G,G),rgba:C.channels.toRgba(G,G,G)})}return M})());let L=c.ThemeService=class extends A.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,this._contrastCache=new p.ColorContrastCache,this._halfContrastCache=new p.ColorContrastCache,this._onChangeColors=this.register(new x.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:m,background:y,cursor:f,cursorAccent:b,selectionForeground:void 0,selectionBackgroundTransparent:T,selectionBackgroundOpaque:C.color.blend(y,T),selectionInactiveBackgroundTransparent:T,selectionInactiveBackgroundOpaque:C.color.blend(y,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=R(M.foreground,m),k.background=R(M.background,y),k.cursor=R(M.cursor,f),k.cursorAccent=R(M.cursorAccent,b),k.selectionBackgroundTransparent=R(M.selectionBackground,T),k.selectionBackgroundOpaque=C.color.blend(k.background,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundTransparent=R(M.selectionInactiveBackground,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundOpaque=C.color.blend(k.background,k.selectionInactiveBackgroundTransparent),k.selectionForeground=M.selectionForeground?R(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]=R(M.black,c.DEFAULT_ANSI_COLORS[0]),k.ansi[1]=R(M.red,c.DEFAULT_ANSI_COLORS[1]),k.ansi[2]=R(M.green,c.DEFAULT_ANSI_COLORS[2]),k.ansi[3]=R(M.yellow,c.DEFAULT_ANSI_COLORS[3]),k.ansi[4]=R(M.blue,c.DEFAULT_ANSI_COLORS[4]),k.ansi[5]=R(M.magenta,c.DEFAULT_ANSI_COLORS[5]),k.ansi[6]=R(M.cyan,c.DEFAULT_ANSI_COLORS[6]),k.ansi[7]=R(M.white,c.DEFAULT_ANSI_COLORS[7]),k.ansi[8]=R(M.brightBlack,c.DEFAULT_ANSI_COLORS[8]),k.ansi[9]=R(M.brightRed,c.DEFAULT_ANSI_COLORS[9]),k.ansi[10]=R(M.brightGreen,c.DEFAULT_ANSI_COLORS[10]),k.ansi[11]=R(M.brightYellow,c.DEFAULT_ANSI_COLORS[11]),k.ansi[12]=R(M.brightBlue,c.DEFAULT_ANSI_COLORS[12]),k.ansi[13]=R(M.brightMagenta,c.DEFAULT_ANSI_COLORS[13]),k.ansi[14]=R(M.brightCyan,c.DEFAULT_ANSI_COLORS[14]),k.ansi[15]=R(M.brightWhite,c.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const I=Math.min(k.ansi.length-16,M.extendedAnsi.length);for(let G=0;G<I;G++)k.ansi[G+16]=R(M.extendedAnsi[G],c.DEFAULT_ANSI_COLORS[G+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 R(M,k){if(M!==void 0)try{return C.css.toColor(M)}catch{}return k}c.ThemeService=L=d([S(0,E.IOptionsService)],L)},6349:(g,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CircularList=void 0;const d=u(8460),S=u(844);class p extends S.Disposable{constructor(x){super(),this._maxLength=x,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(x){if(this._maxLength===x)return;const A=new Array(x);for(let E=0;E<Math.min(x,this.length);E++)A[E]=this._array[this._getCyclicIndex(E)];this._array=A,this._maxLength=x,this._startIndex=0}get length(){return this._length}set length(x){if(x>this._length)for(let A=this._length;A<x;A++)this._array[A]=void 0;this._length=x}get(x){return this._array[this._getCyclicIndex(x)]}set(x,A){this._array[this._getCyclicIndex(x)]=A}push(x){this._array[this._getCyclicIndex(this._length)]=x,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(x,A,...E){if(A){for(let m=x;m<this._length-A;m++)this._array[this._getCyclicIndex(m)]=this._array[this._getCyclicIndex(m+A)];this._length-=A,this.onDeleteEmitter.fire({index:x,amount:A})}for(let m=this._length-1;m>=x;m--)this._array[this._getCyclicIndex(m+E.length)]=this._array[this._getCyclicIndex(m)];for(let m=0;m<E.length;m++)this._array[this._getCyclicIndex(x+m)]=E[m];if(E.length&&this.onInsertEmitter.fire({index:x,amount:E.length}),this._length+E.length>this._maxLength){const m=this._length+E.length-this._maxLength;this._startIndex+=m,this._length=this._maxLength,this.onTrimEmitter.fire(m)}else this._length+=E.length}trimStart(x){x>this._length&&(x=this._length),this._startIndex+=x,this._length-=x,this.onTrimEmitter.fire(x)}shiftElements(x,A,E){if(!(A<=0)){if(x<0||x>=this._length)throw new Error("start argument out of range");if(x+E<0)throw new Error("Cannot shift elements in list beyond index 0");if(E>0){for(let y=A-1;y>=0;y--)this.set(x+y+E,this.get(x+y));const m=x+A+E-this._length;if(m>0)for(this._length+=m;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let m=0;m<A;m++)this.set(x+m+E,this.get(x+m))}}_getCyclicIndex(x){return(this._startIndex+x)%this._maxLength}}c.CircularList=p},1439:(g,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 p=Array.isArray(d)?[]:{};for(const C in d)p[C]=S<=1?d[C]:d[C]&&u(d[C],S-1);return p}},8055:(g,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,p=0;var C,x,A,E,m;function y(b){const T=b.toString(16);return T.length<2?"0"+T:T}function f(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,L,R,M){return M!==void 0?`#${y(T)}${y(L)}${y(R)}${y(M)}`:`#${y(T)}${y(L)}${y(R)}`},b.toRgba=function(T,L,R,M=255){return(T<<24|L<<16|R<<8|M)>>>0},b.toColor=function(T,L,R,M){return{css:b.toCss(T,L,R,M),rgba:b.toRgba(T,L,R,M)}}})(C||(c.channels=C={})),(function(b){function T(L,R){return p=Math.round(255*R),[u,d,S]=m.toChannels(L.rgba),{css:C.toCss(u,d,S,p),rgba:C.toRgba(u,d,S,p)}}b.blend=function(L,R){if(p=(255&R.rgba)/255,p===1)return{css:R.css,rgba:R.rgba};const M=R.rgba>>24&255,k=R.rgba>>16&255,I=R.rgba>>8&255,G=L.rgba>>24&255,q=L.rgba>>16&255,W=L.rgba>>8&255;return u=G+Math.round((M-G)*p),d=q+Math.round((k-q)*p),S=W+Math.round((I-W)*p),{css:C.toCss(u,d,S),rgba:C.toRgba(u,d,S)}},b.isOpaque=function(L){return(255&L.rgba)==255},b.ensureContrastRatio=function(L,R,M){const k=m.ensureContrastRatio(L.rgba,R.rgba,M);if(k)return C.toColor(k>>24&255,k>>16&255,k>>8&255)},b.opaque=function(L){const R=(255|L.rgba)>>>0;return[u,d,S]=m.toChannels(R),{css:C.toCss(u,d,S),rgba:R}},b.opacity=T,b.multiplyOpacity=function(L,R){return p=255&L.rgba,T(L,p*R/255)},b.toColorRGB=function(L){return[L.rgba>>24&255,L.rgba>>16&255,L.rgba>>8&255]}})(x||(c.color=x={})),(function(b){let T,L;try{const R=document.createElement("canvas");R.width=1,R.height=1;const M=R.getContext("2d",{willReadFrequently:!0});M&&(T=M,T.globalCompositeOperation="copy",L=T.createLinearGradient(0,0,1,1))}catch{}b.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return u=parseInt(R.slice(1,2).repeat(2),16),d=parseInt(R.slice(2,3).repeat(2),16),S=parseInt(R.slice(3,4).repeat(2),16),C.toColor(u,d,S);case 5:return u=parseInt(R.slice(1,2).repeat(2),16),d=parseInt(R.slice(2,3).repeat(2),16),S=parseInt(R.slice(3,4).repeat(2),16),p=parseInt(R.slice(4,5).repeat(2),16),C.toColor(u,d,S,p);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const M=R.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]),p=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),C.toColor(u,d,S,p);if(!T||!L)throw new Error("css.toColor: Unsupported css format");if(T.fillStyle=L,T.fillStyle=R,typeof T.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(T.fillRect(0,0,1,1),[u,d,S,p]=T.getImageData(0,0,1,1).data,p!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:C.toRgba(u,d,S,p),css:R}}})(A||(c.css=A={})),(function(b){function T(L,R,M){const k=L/255,I=R/255,G=M/255;return .2126*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.7152*(I<=.03928?I/12.92:Math.pow((I+.055)/1.055,2.4))+.0722*(G<=.03928?G/12.92:Math.pow((G+.055)/1.055,2.4))}b.relativeLuminance=function(L){return T(L>>16&255,L>>8&255,255&L)},b.relativeLuminance2=T})(E||(c.rgb=E={})),(function(b){function T(R,M,k){const I=R>>24&255,G=R>>16&255,q=R>>8&255;let W=M>>24&255,j=M>>16&255,V=M>>8&255,U=f(E.relativeLuminance2(W,j,V),E.relativeLuminance2(I,G,q));for(;U<k&&(W>0||j>0||V>0);)W-=Math.max(0,Math.ceil(.1*W)),j-=Math.max(0,Math.ceil(.1*j)),V-=Math.max(0,Math.ceil(.1*V)),U=f(E.relativeLuminance2(W,j,V),E.relativeLuminance2(I,G,q));return(W<<24|j<<16|V<<8|255)>>>0}function L(R,M,k){const I=R>>24&255,G=R>>16&255,q=R>>8&255;let W=M>>24&255,j=M>>16&255,V=M>>8&255,U=f(E.relativeLuminance2(W,j,V),E.relativeLuminance2(I,G,q));for(;U<k&&(W<255||j<255||V<255);)W=Math.min(255,W+Math.ceil(.1*(255-W))),j=Math.min(255,j+Math.ceil(.1*(255-j))),V=Math.min(255,V+Math.ceil(.1*(255-V))),U=f(E.relativeLuminance2(W,j,V),E.relativeLuminance2(I,G,q));return(W<<24|j<<16|V<<8|255)>>>0}b.blend=function(R,M){if(p=(255&M)/255,p===1)return M;const k=M>>24&255,I=M>>16&255,G=M>>8&255,q=R>>24&255,W=R>>16&255,j=R>>8&255;return u=q+Math.round((k-q)*p),d=W+Math.round((I-W)*p),S=j+Math.round((G-j)*p),C.toRgba(u,d,S)},b.ensureContrastRatio=function(R,M,k){const I=E.relativeLuminance(R>>8),G=E.relativeLuminance(M>>8);if(f(I,G)<k){if(G<I){const j=T(R,M,k),V=f(I,E.relativeLuminance(j>>8));if(V<k){const U=L(R,M,k);return V>f(I,E.relativeLuminance(U>>8))?j:U}return j}const q=L(R,M,k),W=f(I,E.relativeLuminance(q>>8));if(W<k){const j=T(R,M,k);return W>f(I,E.relativeLuminance(j>>8))?q:j}return q}},b.reduceLuminance=T,b.increaseLuminance=L,b.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(m||(c.rgba=m={})),c.toPaddedHex=y,c.contrastRatio=f},8969:(g,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreTerminal=void 0;const d=u(844),S=u(2585),p=u(4348),C=u(7866),x=u(744),A=u(7302),E=u(6975),m=u(8460),y=u(1753),f=u(1480),b=u(7994),T=u(9282),L=u(5435),R=u(5981),M=u(2660);let k=!1;class I extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new m.EventEmitter),this._onScroll.event((q=>{this._onScrollApi?.fire(q.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(q){for(const W in q)this.optionsService.options[W]=q[W]}constructor(q){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new m.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new m.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new m.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new m.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new m.EventEmitter),this._instantiationService=new p.InstantiationService,this.optionsService=this.register(new A.OptionsService(q)),this._instantiationService.setService(S.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(x.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(E.CoreService)),this._instantiationService.setService(S.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(y.CoreMouseService)),this._instantiationService.setService(S.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(f.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 L.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,m.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,m.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,m.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,m.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 R.WriteBuffer(((W,j)=>this._inputHandler.parse(W,j)))),this.register((0,m.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(q,W){this._writeBuffer.write(q,W)}writeSync(q,W){this._logService.logLevel<=S.LogLevelEnum.WARN&&!k&&(this._logService.warn("writeSync is unreliable and will be removed soon."),k=!0),this._writeBuffer.writeSync(q,W)}input(q,W=!0){this.coreService.triggerDataEvent(q,W)}resize(q,W){isNaN(q)||isNaN(W)||(q=Math.max(q,x.MINIMUM_COLS),W=Math.max(W,x.MINIMUM_ROWS),this._bufferService.resize(q,W))}scroll(q,W=!1){this._bufferService.scroll(q,W)}scrollLines(q,W,j){this._bufferService.scrollLines(q,W,j)}scrollPages(q){this.scrollLines(q*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(q){const W=q-this._bufferService.buffer.ydisp;W!==0&&this.scrollLines(W)}registerEscHandler(q,W){return this._inputHandler.registerEscHandler(q,W)}registerDcsHandler(q,W){return this._inputHandler.registerDcsHandler(q,W)}registerCsiHandler(q,W){return this._inputHandler.registerCsiHandler(q,W)}registerOscHandler(q,W){return this._inputHandler.registerOscHandler(q,W)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let q=!1;const W=this.optionsService.rawOptions.windowsPty;W&&W.buildNumber!==void 0&&W.buildNumber!==void 0?q=W.backend==="conpty"&&W.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(q=!0),q?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const q=[];q.push(this.onLineFeed(T.updateWindowsModeWrappedState.bind(null,this._bufferService))),q.push(this.registerCsiHandler({final:"H"},(()=>((0,T.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const W of q)W.dispose()}))}}}c.CoreTerminal=I},8460:(g,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 p=0;p<this._listeners.length;p++)S.push(this._listeners[p]);for(let p=0;p<S.length;p++)S[p].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(g,c,u){var d=this&&this.__decorate||function(X,D,B,N){var H,Q=arguments.length,le=Q<3?D:N===null?N=Object.getOwnPropertyDescriptor(D,B):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")le=Reflect.decorate(X,D,B,N);else for(var ee=X.length-1;ee>=0;ee--)(H=X[ee])&&(le=(Q<3?H(le):Q>3?H(D,B,le):H(D,B))||le);return Q>3&&le&&Object.defineProperty(D,B,le),le},S=this&&this.__param||function(X,D){return function(B,N){D(B,N,X)}};Object.defineProperty(c,"__esModule",{value:!0}),c.InputHandler=c.WindowsOptionsReportType=void 0;const p=u(2584),C=u(7116),x=u(2015),A=u(844),E=u(482),m=u(8437),y=u(8460),f=u(643),b=u(511),T=u(3734),L=u(2585),R=u(1480),M=u(6242),k=u(6351),I=u(5941),G={"(":0,")":1,"*":2,"+":3,"-":1,".":2},q=131072;function W(X,D){if(X>24)return D.setWinLines||!1;switch(X){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(X){X[X.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",X[X.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(j||(c.WindowsOptionsReportType=j={}));let V=0;class U extends A.Disposable{getAttrData(){return this._curAttrData}constructor(D,B,N,H,Q,le,ee,ce,Y=new x.EscapeSequenceParser){super(),this._bufferService=D,this._charsetService=B,this._coreService=N,this._logService=H,this._optionsService=Q,this._oscLinkService=le,this._coreMouseService=ee,this._unicodeService=ce,this._parser=Y,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new E.StringToUtf32,this._utf8Decoder=new E.Utf8ToUtf32,this._workCell=new b.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=m.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=m.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new y.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new y.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new y.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new y.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new y.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new y.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new y.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new y.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new y.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new y.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new y.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new y.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new y.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 F(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((P=>this._activeBuffer=P.activeBuffer))),this._parser.setCsiHandlerFallback(((P,re)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(P),params:re.toArray()})})),this._parser.setEscHandlerFallback((P=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(P)})})),this._parser.setExecuteHandlerFallback((P=>{this._logService.debug("Unknown EXECUTE code: ",{code:P})})),this._parser.setOscHandlerFallback(((P,re,fe)=>{this._logService.debug("Unknown OSC code: ",{identifier:P,action:re,data:fe})})),this._parser.setDcsHandlerFallback(((P,re,fe)=>{re==="HOOK"&&(fe=fe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(P),action:re,payload:fe})})),this._parser.setPrintHandler(((P,re,fe)=>this.print(P,re,fe))),this._parser.registerCsiHandler({final:"@"},(P=>this.insertChars(P))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(P=>this.scrollLeft(P))),this._parser.registerCsiHandler({final:"A"},(P=>this.cursorUp(P))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(P=>this.scrollRight(P))),this._parser.registerCsiHandler({final:"B"},(P=>this.cursorDown(P))),this._parser.registerCsiHandler({final:"C"},(P=>this.cursorForward(P))),this._parser.registerCsiHandler({final:"D"},(P=>this.cursorBackward(P))),this._parser.registerCsiHandler({final:"E"},(P=>this.cursorNextLine(P))),this._parser.registerCsiHandler({final:"F"},(P=>this.cursorPrecedingLine(P))),this._parser.registerCsiHandler({final:"G"},(P=>this.cursorCharAbsolute(P))),this._parser.registerCsiHandler({final:"H"},(P=>this.cursorPosition(P))),this._parser.registerCsiHandler({final:"I"},(P=>this.cursorForwardTab(P))),this._parser.registerCsiHandler({final:"J"},(P=>this.eraseInDisplay(P,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(P=>this.eraseInDisplay(P,!0))),this._parser.registerCsiHandler({final:"K"},(P=>this.eraseInLine(P,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(P=>this.eraseInLine(P,!0))),this._parser.registerCsiHandler({final:"L"},(P=>this.insertLines(P))),this._parser.registerCsiHandler({final:"M"},(P=>this.deleteLines(P))),this._parser.registerCsiHandler({final:"P"},(P=>this.deleteChars(P))),this._parser.registerCsiHandler({final:"S"},(P=>this.scrollUp(P))),this._parser.registerCsiHandler({final:"T"},(P=>this.scrollDown(P))),this._parser.registerCsiHandler({final:"X"},(P=>this.eraseChars(P))),this._parser.registerCsiHandler({final:"Z"},(P=>this.cursorBackwardTab(P))),this._parser.registerCsiHandler({final:"`"},(P=>this.charPosAbsolute(P))),this._parser.registerCsiHandler({final:"a"},(P=>this.hPositionRelative(P))),this._parser.registerCsiHandler({final:"b"},(P=>this.repeatPrecedingCharacter(P))),this._parser.registerCsiHandler({final:"c"},(P=>this.sendDeviceAttributesPrimary(P))),this._parser.registerCsiHandler({prefix:">",final:"c"},(P=>this.sendDeviceAttributesSecondary(P))),this._parser.registerCsiHandler({final:"d"},(P=>this.linePosAbsolute(P))),this._parser.registerCsiHandler({final:"e"},(P=>this.vPositionRelative(P))),this._parser.registerCsiHandler({final:"f"},(P=>this.hVPosition(P))),this._parser.registerCsiHandler({final:"g"},(P=>this.tabClear(P))),this._parser.registerCsiHandler({final:"h"},(P=>this.setMode(P))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(P=>this.setModePrivate(P))),this._parser.registerCsiHandler({final:"l"},(P=>this.resetMode(P))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(P=>this.resetModePrivate(P))),this._parser.registerCsiHandler({final:"m"},(P=>this.charAttributes(P))),this._parser.registerCsiHandler({final:"n"},(P=>this.deviceStatus(P))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(P=>this.deviceStatusPrivate(P))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(P=>this.softReset(P))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(P=>this.setCursorStyle(P))),this._parser.registerCsiHandler({final:"r"},(P=>this.setScrollRegion(P))),this._parser.registerCsiHandler({final:"s"},(P=>this.saveCursor(P))),this._parser.registerCsiHandler({final:"t"},(P=>this.windowOptions(P))),this._parser.registerCsiHandler({final:"u"},(P=>this.restoreCursor(P))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(P=>this.insertColumns(P))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(P=>this.deleteColumns(P))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(P=>this.selectProtected(P))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(P=>this.requestMode(P,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(P=>this.requestMode(P,!1))),this._parser.setExecuteHandler(p.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(p.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(p.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(p.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(p.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(p.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(p.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(p.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(p.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(p.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(p.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(p.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new M.OscHandler((P=>(this.setTitle(P),this.setIconName(P),!0)))),this._parser.registerOscHandler(1,new M.OscHandler((P=>this.setIconName(P)))),this._parser.registerOscHandler(2,new M.OscHandler((P=>this.setTitle(P)))),this._parser.registerOscHandler(4,new M.OscHandler((P=>this.setOrReportIndexedColor(P)))),this._parser.registerOscHandler(8,new M.OscHandler((P=>this.setHyperlink(P)))),this._parser.registerOscHandler(10,new M.OscHandler((P=>this.setOrReportFgColor(P)))),this._parser.registerOscHandler(11,new M.OscHandler((P=>this.setOrReportBgColor(P)))),this._parser.registerOscHandler(12,new M.OscHandler((P=>this.setOrReportCursorColor(P)))),this._parser.registerOscHandler(104,new M.OscHandler((P=>this.restoreIndexedColor(P)))),this._parser.registerOscHandler(110,new M.OscHandler((P=>this.restoreFgColor(P)))),this._parser.registerOscHandler(111,new M.OscHandler((P=>this.restoreBgColor(P)))),this._parser.registerOscHandler(112,new M.OscHandler((P=>this.restoreCursorColor(P)))),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 P in C.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:P},(()=>this.selectCharset("("+P))),this._parser.registerEscHandler({intermediates:")",final:P},(()=>this.selectCharset(")"+P))),this._parser.registerEscHandler({intermediates:"*",final:P},(()=>this.selectCharset("*"+P))),this._parser.registerEscHandler({intermediates:"+",final:P},(()=>this.selectCharset("+"+P))),this._parser.registerEscHandler({intermediates:"-",final:P},(()=>this.selectCharset("-"+P))),this._parser.registerEscHandler({intermediates:".",final:P},(()=>this.selectCharset("."+P))),this._parser.registerEscHandler({intermediates:"/",final:P},(()=>this.selectCharset("/"+P)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((P=>(this._logService.error("Parsing error: ",P),P))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new k.DcsHandler(((P,re)=>this.requestStatusString(P,re))))}_preserveStack(D,B,N,H){this._parseStack.paused=!0,this._parseStack.cursorStartX=D,this._parseStack.cursorStartY=B,this._parseStack.decodedLength=N,this._parseStack.position=H}_logSlowResolvingAsync(D){this._logService.logLevel<=L.LogLevelEnum.WARN&&Promise.race([D,new Promise(((B,N)=>setTimeout((()=>N("#SLOW_TIMEOUT")),5e3)))]).catch((B=>{if(B!=="#SLOW_TIMEOUT")throw B;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(D,B){let N,H=this._activeBuffer.x,Q=this._activeBuffer.y,le=0;const ee=this._parseStack.paused;if(ee){if(N=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,B))return this._logSlowResolvingAsync(N),N;H=this._parseStack.cursorStartX,Q=this._parseStack.cursorStartY,this._parseStack.paused=!1,D.length>q&&(le=this._parseStack.position+q)}if(this._logService.logLevel<=L.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof D=="string"?` "${D}"`:` "${Array.prototype.map.call(D,(P=>String.fromCharCode(P))).join("")}"`),typeof D=="string"?D.split("").map((P=>P.charCodeAt(0))):D),this._parseBuffer.length<D.length&&this._parseBuffer.length<q&&(this._parseBuffer=new Uint32Array(Math.min(D.length,q))),ee||this._dirtyRowTracker.clearRange(),D.length>q)for(let P=le;P<D.length;P+=q){const re=P+q<D.length?P+q:D.length,fe=typeof D=="string"?this._stringDecoder.decode(D.substring(P,re),this._parseBuffer):this._utf8Decoder.decode(D.subarray(P,re),this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,fe))return this._preserveStack(H,Q,fe,P),this._logSlowResolvingAsync(N),N}else if(!ee){const P=typeof D=="string"?this._stringDecoder.decode(D,this._parseBuffer):this._utf8Decoder.decode(D,this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,P))return this._preserveStack(H,Q,P,0),this._logSlowResolvingAsync(N),N}this._activeBuffer.x===H&&this._activeBuffer.y===Q||this._onCursorMove.fire();const ce=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Y=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Y<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Y,this._bufferService.rows-1),Math.min(ce,this._bufferService.rows-1))}print(D,B,N){let H,Q;const le=this._charsetService.charset,ee=this._optionsService.rawOptions.screenReaderMode,ce=this._bufferService.cols,Y=this._coreService.decPrivateModes.wraparound,P=this._coreService.modes.insertMode,re=this._curAttrData;let fe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&N-B>0&&fe.getWidth(this._activeBuffer.x-1)===2&&fe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,re);let Se=this._parser.precedingJoinState;for(let ye=B;ye<N;++ye){if(H=D[ye],H<127&&le){const xt=le[String.fromCharCode(H)];xt&&(H=xt.charCodeAt(0))}const Pe=this._unicodeService.charProperties(H,Se);Q=R.UnicodeService.extractWidth(Pe);const We=R.UnicodeService.extractShouldJoin(Pe),Ze=We?R.UnicodeService.extractWidth(Se):0;if(Se=Pe,ee&&this._onA11yChar.fire((0,E.stringFromCodePoint)(H)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Q-Ze>ce){if(Y){const xt=fe;let Ne=this._activeBuffer.x-Ze;for(this._activeBuffer.x=Ze,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),fe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ze>0&&fe instanceof m.BufferLine&&fe.copyCellsFrom(xt,Ne,0,Ze,!1);Ne<ce;)xt.setCellFromCodepoint(Ne++,0,1,re)}else if(this._activeBuffer.x=ce-1,Q===2)continue}if(We&&this._activeBuffer.x){const xt=fe.getWidth(this._activeBuffer.x-1)?1:2;fe.addCodepointToCell(this._activeBuffer.x-xt,H,Q);for(let Ne=Q-Ze;--Ne>=0;)fe.setCellFromCodepoint(this._activeBuffer.x++,0,0,re)}else if(P&&(fe.insertCells(this._activeBuffer.x,Q-Ze,this._activeBuffer.getNullCell(re)),fe.getWidth(ce-1)===2&&fe.setCellFromCodepoint(ce-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,re)),fe.setCellFromCodepoint(this._activeBuffer.x++,H,Q,re),Q>0)for(;--Q;)fe.setCellFromCodepoint(this._activeBuffer.x++,0,0,re)}this._parser.precedingJoinState=Se,this._activeBuffer.x<ce&&N-B>0&&fe.getWidth(this._activeBuffer.x)===0&&!fe.hasContent(this._activeBuffer.x)&&fe.setCellFromCodepoint(this._activeBuffer.x,0,1,re),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(D,B){return D.final!=="t"||D.prefix||D.intermediates?this._parser.registerCsiHandler(D,B):this._parser.registerCsiHandler(D,(N=>!W(N.params[0],this._optionsService.rawOptions.windowOptions)||B(N)))}registerDcsHandler(D,B){return this._parser.registerDcsHandler(D,new k.DcsHandler(B))}registerEscHandler(D,B){return this._parser.registerEscHandler(D,B)}registerOscHandler(D,B){return this._parser.registerOscHandler(D,new M.OscHandler(B))}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,B){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=D,this._activeBuffer.y=this._activeBuffer.scrollTop+B):(this._activeBuffer.x=D,this._activeBuffer.y=B),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(D,B){this._restrictCursor(),this._setCursor(this._activeBuffer.x+D,this._activeBuffer.y+B)}cursorUp(D){const B=this._activeBuffer.y-this._activeBuffer.scrollTop;return B>=0?this._moveCursor(0,-Math.min(B,D.params[0]||1)):this._moveCursor(0,-(D.params[0]||1)),!0}cursorDown(D){const B=this._activeBuffer.scrollBottom-this._activeBuffer.y;return B>=0?this._moveCursor(0,Math.min(B,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 B=D.params[0];return B===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:B===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(D){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=D.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(D){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=D.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(D){const B=D.params[0];return B===1&&(this._curAttrData.bg|=536870912),B!==2&&B!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(D,B,N,H=!1,Q=!1){const le=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);le.replaceCells(B,N,this._activeBuffer.getNullCell(this._eraseAttrData()),Q),H&&(le.isWrapped=!1)}_resetBufferLine(D,B=!1){const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);N&&(N.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),B),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+D),N.isWrapped=!1)}eraseInDisplay(D,B=!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,B);N<this._bufferService.rows;N++)this._resetBufferLine(N,B);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,B),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(N+1).isWrapped=!1);N--;)this._resetBufferLine(N,B);this._dirtyRowTracker.markDirty(0);break;case 2:for(N=this._bufferService.rows,this._dirtyRowTracker.markDirty(N-1);N--;)this._resetBufferLine(N,B);this._dirtyRowTracker.markDirty(0);break;case 3:const H=this._activeBuffer.lines.length-this._bufferService.rows;H>0&&(this._activeBuffer.lines.trimStart(H),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-H,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-H,0),this._onScroll.fire(0))}return!0}eraseInLine(D,B=!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,B);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,B);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,B)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(D){this._restrictCursor();let B=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,H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Q=this._bufferService.rows-1+this._activeBuffer.ybase-H+1;for(;B--;)this._activeBuffer.lines.splice(Q-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 B=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 H;for(H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,H=this._bufferService.rows-1+this._activeBuffer.ybase-H;B--;)this._activeBuffer.lines.splice(N,1),this._activeBuffer.lines.splice(H,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 B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.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 B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.deleteCells(this._activeBuffer.x,D.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(D){let B=D.params[0]||1;for(;B--;)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 B=D.params[0]||1;for(;B--;)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(m.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 B=D.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);H.deleteCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),H.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 B=D.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);H.insertCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),H.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 B=D.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);H.insertCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),H.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 B=D.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);H.deleteCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(D){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.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 B=this._parser.precedingJoinState;if(!B)return!0;const N=D.params[0]||1,H=R.UnicodeService.extractWidth(B),Q=this._activeBuffer.x-H,le=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Q),ee=new Uint32Array(le.length*N);let ce=0;for(let P=0;P<le.length;){const re=le.codePointAt(P)||0;ee[ce++]=re,P+=re>65535?2:1}let Y=ce;for(let P=1;P<N;++P)ee.copyWithin(Y,0,ce),Y+=ce;return this.print(ee,0,Y),!0}sendDeviceAttributesPrimary(D){return D.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(p.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(p.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(D){return D.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(p.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(p.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(D.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(p.C0.ESC+"[>83;40003;0c")),!0}_is(D){return(this._optionsService.rawOptions.termName+"").indexOf(D)===0}setMode(D){for(let B=0;B<D.length;B++)switch(D.params[B]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(D){for(let B=0;B<D.length;B++)switch(D.params[B]){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 B=0;B<D.length;B++)switch(D.params[B]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(D){for(let B=0;B<D.length;B++)switch(D.params[B]){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[B]===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,B){const N=this._coreService.decPrivateModes,{activeProtocol:H,activeEncoding:Q}=this._coreMouseService,le=this._coreService,{buffers:ee,cols:ce}=this._bufferService,{active:Y,alt:P}=ee,re=this._optionsService.rawOptions,fe=We=>We?1:2,Se=D.params[0];return ye=Se,Pe=B?Se===2?4:Se===4?fe(le.modes.insertMode):Se===12?3:Se===20?fe(re.convertEol):0:Se===1?fe(N.applicationCursorKeys):Se===3?re.windowOptions.setWinLines?ce===80?2:ce===132?1:0:0:Se===6?fe(N.origin):Se===7?fe(N.wraparound):Se===8?3:Se===9?fe(H==="X10"):Se===12?fe(re.cursorBlink):Se===25?fe(!le.isCursorHidden):Se===45?fe(N.reverseWraparound):Se===66?fe(N.applicationKeypad):Se===67?4:Se===1e3?fe(H==="VT200"):Se===1002?fe(H==="DRAG"):Se===1003?fe(H==="ANY"):Se===1004?fe(N.sendFocus):Se===1005?4:Se===1006?fe(Q==="SGR"):Se===1015?4:Se===1016?fe(Q==="SGR_PIXELS"):Se===1048?1:Se===47||Se===1047||Se===1049?fe(Y===P):Se===2004?fe(N.bracketedPasteMode):0,le.triggerDataEvent(`${p.C0.ESC}[${B?"":"?"}${ye};${Pe}$y`),!0;var ye,Pe}_updateAttrColor(D,B,N,H,Q){return B===2?(D|=50331648,D&=-16777216,D|=T.AttributeData.fromColorRGB([N,H,Q])):B===5&&(D&=-50331904,D|=33554432|255&N),D}_extractColor(D,B,N){const H=[0,0,-1,0,0,0];let Q=0,le=0;do{if(H[le+Q]=D.params[B+le],D.hasSubParams(B+le)){const ee=D.getSubParams(B+le);let ce=0;do H[1]===5&&(Q=1),H[le+ce+1+Q]=ee[ce];while(++ce<ee.length&&ce+le+1+Q<H.length);break}if(H[1]===5&&le+Q>=2||H[1]===2&&le+Q>=5)break;H[1]&&(Q=1)}while(++le+B<D.length&&le+Q<H.length);for(let ee=2;ee<H.length;++ee)H[ee]===-1&&(H[ee]=0);switch(H[0]){case 38:N.fg=this._updateAttrColor(N.fg,H[1],H[3],H[4],H[5]);break;case 48:N.bg=this._updateAttrColor(N.bg,H[1],H[3],H[4],H[5]);break;case 58:N.extended=N.extended.clone(),N.extended.underlineColor=this._updateAttrColor(N.extended.underlineColor,H[1],H[3],H[4],H[5])}return le}_processUnderline(D,B){B.extended=B.extended.clone(),(!~D||D>5)&&(D=1),B.extended.underlineStyle=D,B.fg|=268435456,D===0&&(B.fg&=-268435457),B.updateExtended()}_processSGR0(D){D.fg=m.DEFAULT_ATTR_DATA.fg,D.bg=m.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 B=D.length;let N;const H=this._curAttrData;for(let Q=0;Q<B;Q++)N=D.params[Q],N>=30&&N<=37?(H.fg&=-50331904,H.fg|=16777216|N-30):N>=40&&N<=47?(H.bg&=-50331904,H.bg|=16777216|N-40):N>=90&&N<=97?(H.fg&=-50331904,H.fg|=16777224|N-90):N>=100&&N<=107?(H.bg&=-50331904,H.bg|=16777224|N-100):N===0?this._processSGR0(H):N===1?H.fg|=134217728:N===3?H.bg|=67108864:N===4?(H.fg|=268435456,this._processUnderline(D.hasSubParams(Q)?D.getSubParams(Q)[0]:1,H)):N===5?H.fg|=536870912:N===7?H.fg|=67108864:N===8?H.fg|=1073741824:N===9?H.fg|=2147483648:N===2?H.bg|=134217728:N===21?this._processUnderline(2,H):N===22?(H.fg&=-134217729,H.bg&=-134217729):N===23?H.bg&=-67108865:N===24?(H.fg&=-268435457,this._processUnderline(0,H)):N===25?H.fg&=-536870913:N===27?H.fg&=-67108865:N===28?H.fg&=-1073741825:N===29?H.fg&=2147483647:N===39?(H.fg&=-67108864,H.fg|=16777215&m.DEFAULT_ATTR_DATA.fg):N===49?(H.bg&=-67108864,H.bg|=16777215&m.DEFAULT_ATTR_DATA.bg):N===38||N===48||N===58?Q+=this._extractColor(D,Q,H):N===53?H.bg|=1073741824:N===55?H.bg&=-1073741825:N===59?(H.extended=H.extended.clone(),H.extended.underlineColor=-1,H.updateExtended()):N===100?(H.fg&=-67108864,H.fg|=16777215&m.DEFAULT_ATTR_DATA.fg,H.bg&=-67108864,H.bg|=16777215&m.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(`${p.C0.ESC}[0n`);break;case 6:const B=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[${B};${N}R`)}return!0}deviceStatusPrivate(D){if(D.params[0]===6){const B=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[?${B};${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=m.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 B=D.params[0]||1;switch(B){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=B%2==1;return this._optionsService.options.cursorBlink=N,!0}setScrollRegion(D){const B=D.params[0]||1;let N;return(D.length<2||(N=D.params[1])>this._bufferService.rows||N===0)&&(N=this._bufferService.rows),N>B&&(this._activeBuffer.scrollTop=B-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 B=D.length>1?D.params[1]:0;switch(D.params[0]){case 14:B!==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(`${p.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:B!==0&&B!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),B!==0&&B!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:B!==0&&B!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),B!==0&&B!==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 B=[],N=D.split(";");for(;N.length>1;){const H=N.shift(),Q=N.shift();if(/^\d+$/.exec(H)){const le=parseInt(H);if(K(le))if(Q==="?")B.push({type:0,index:le});else{const ee=(0,I.parseColor)(Q);ee&&B.push({type:1,index:le,color:ee})}}}return B.length&&this._onColor.fire(B),!0}setHyperlink(D){const B=D.split(";");return!(B.length<2)&&(B[1]?this._createHyperlink(B[0],B[1]):!B[0]&&this._finishHyperlink())}_createHyperlink(D,B){this._getCurrentLinkId()&&this._finishHyperlink();const N=D.split(":");let H;const Q=N.findIndex((le=>le.startsWith("id=")));return Q!==-1&&(H=N[Q].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:H,uri:B}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(D,B){const N=D.split(";");for(let H=0;H<N.length&&!(B>=this._specialColors.length);++H,++B)if(N[H]==="?")this._onColor.fire([{type:0,index:this._specialColors[B]}]);else{const Q=(0,I.parseColor)(N[H]);Q&&this._onColor.fire([{type:1,index:this._specialColors[B],color:Q}])}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 B=[],N=D.split(";");for(let H=0;H<N.length;++H)if(/^\d+$/.exec(N[H])){const Q=parseInt(N[H]);K(Q)&&B.push({type:2,index:Q})}return B.length&&this._onColor.fire(B),!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(G[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=m.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=m.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 B=0;B<this._bufferService.rows;++B){const N=this._activeBuffer.ybase+this._activeBuffer.y+B,H=this._activeBuffer.lines.get(N);H&&(H.fill(D),H.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(D,B){const N=this._bufferService.buffer,H=this._optionsService.rawOptions;return(Q=>(this._coreService.triggerDataEvent(`${p.C0.ESC}${Q}${p.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}[H.cursorStyle]-(H.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(D,B){this._dirtyRowTracker.markRangeDirty(D,B)}}c.InputHandler=U;let F=class{constructor(X){this._bufferService=X,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(X){X<this.start?this.start=X:X>this.end&&(this.end=X)}markRangeDirty(X,D){X>D&&(V=X,X=D,D=V),X<this.start&&(this.start=X),D>this.end&&(this.end=D)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function K(X){return 0<=X&&X<256}F=d([S(0,L.IBufferService)],F)},844:(g,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:(g,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.FourKeyMap=c.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(S,p,C){this._data[S]||(this._data[S]={}),this._data[S][p]=C}get(S,p){return this._data[S]?this._data[S][p]:void 0}clear(){this._data={}}}c.TwoKeyMap=u,c.FourKeyMap=class{constructor(){this._data=new u}set(d,S,p,C,x){this._data.get(d,S)||this._data.set(d,S,new u),this._data.get(d,S).set(p,C,x)}get(d,S,p,C){return this._data.get(d,S)?.get(p,C)}clear(){this._data.clear()}}},6114:(g,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:(g,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,p=this._array.length-1;for(;p>=S;){let C=S+p>>1;const x=this._getKey(this._array[C]);if(x>d)p=C-1;else{if(!(x<d)){for(;C>0&&this._getKey(this._array[C-1])===d;)C--;return C}S=C+1}}return S}}},7226:(g,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(x){this._tasks.push(x),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(x){this._idleCallback=void 0;let A=0,E=0,m=x.timeRemaining(),y=0;for(;this._i<this._tasks.length;){if(A=Date.now(),this._tasks[this._i]()||this._i++,A=Math.max(1,Date.now()-A),E=Math.max(A,E),y=x.timeRemaining(),1.5*E>y)return m-A<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(m-A))}ms`),void this._start();m=y}this.clear()}}class p extends S{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const A=Date.now()+x;return{timeRemaining:()=>Math.max(0,A-Date.now())}}}c.PriorityTaskQueue=p,c.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends S{_requestCallback(C){return requestIdleCallback(C)}_cancelCallback(C){cancelIdleCallback(C)}}:p,c.DebouncedIdleTask=class{constructor(){this._queue=new c.IdleTaskQueue}set(C){this._queue.clear(),this._queue.enqueue(C)}flush(){this._queue.flush()}}},9282:(g,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.updateWindowsModeWrappedState=void 0;const d=u(643);c.updateWindowsModeWrappedState=function(S){const p=S.buffer.lines.get(S.buffer.ybase+S.buffer.y-1),C=p?.get(S.cols-1),x=S.buffer.lines.get(S.buffer.ybase+S.buffer.y);x&&C&&(x.isWrapped=C[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&C[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(g,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(p){return[p>>>16&255,p>>>8&255,255&p]}static fromColorRGB(p){return(255&p[0])<<16|(255&p[1])<<8|255&p[2]}clone(){const p=new u;return p.fg=this.fg,p.bg=this.bg,p.extended=this.extended.clone(),p}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}c.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(p){this._ext=p}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(p){this._ext&=-469762049,this._ext|=p<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(p){this._ext&=-67108864,this._ext|=67108863&p}get urlId(){return this._urlId}set urlId(p){this._urlId=p}get underlineVariantOffset(){const p=(3758096384&this._ext)>>29;return p<0?4294967288^p:p}set underlineVariantOffset(p){this._ext&=536870911,this._ext|=p<<29&3758096384}constructor(p=0,C=0){this._ext=0,this._urlId=0,this._ext=p,this._urlId=C}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}c.ExtendedAttrs=d},9092:(g,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Buffer=c.MAX_BUFFER_SIZE=void 0;const d=u(6349),S=u(7226),p=u(3734),C=u(8437),x=u(4634),A=u(511),E=u(643),m=u(4863),y=u(7116);c.MAX_BUFFER_SIZE=4294967295,c.Buffer=class{constructor(f,b,T){this._hasScrollback=f,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=y.DEFAULT_CHARSET,this.markers=[],this._nullCell=A.CellData.fromCharData([0,E.NULL_CELL_CHAR,E.NULL_CELL_WIDTH,E.NULL_CELL_CODE]),this._whitespaceCell=A.CellData.fromCharData([0,E.WHITESPACE_CELL_CHAR,E.WHITESPACE_CELL_WIDTH,E.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(f){return f?(this._nullCell.fg=f.fg,this._nullCell.bg=f.bg,this._nullCell.extended=f.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new p.ExtendedAttrs),this._nullCell}getWhitespaceCell(f){return f?(this._whitespaceCell.fg=f.fg,this._whitespaceCell.bg=f.bg,this._whitespaceCell.extended=f.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new p.ExtendedAttrs),this._whitespaceCell}getBlankLine(f,b){return new C.BufferLine(this._bufferService.cols,this.getNullCell(f),b)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const f=this.ybase+this.y-this.ydisp;return f>=0&&f<this._rows}_getCorrectBufferLength(f){if(!this._hasScrollback)return f;const b=f+this._optionsService.rawOptions.scrollback;return b>c.MAX_BUFFER_SIZE?c.MAX_BUFFER_SIZE:b}fillViewportRows(f){if(this.lines.length===0){f===void 0&&(f=C.DEFAULT_ATTR_DATA);let b=this._rows;for(;b--;)this.lines.push(this.getBlankLine(f))}}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(f,b){const T=this.getNullCell(C.DEFAULT_ATTR_DATA);let L=0;const R=this._getCorrectBufferLength(b);if(R>this.lines.maxLength&&(this.lines.maxLength=R),this.lines.length>0){if(this._cols<f)for(let k=0;k<this.lines.length;k++)L+=+this.lines.get(k).resize(f,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(f,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(f,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(R<this.lines.maxLength){const k=this.lines.length-R;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=R}this.x=Math.min(this.x,f-1),this.y=Math.min(this.y,b-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,f-1),this.scrollTop=0}if(this.scrollBottom=b-1,this._isReflowEnabled&&(this._reflow(f,b),this._cols>f))for(let M=0;M<this.lines.length;M++)L+=+this.lines.get(M).resize(f,T);this._cols=f,this._rows=b,this._memoryCleanupQueue.clear(),L>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let f=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,f=!1);let b=0;for(;this._memoryCleanupPosition<this.lines.length;)if(b+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),b>100)return!0;return f}get _isReflowEnabled(){const f=this._optionsService.rawOptions.windowsPty;return f&&f.buildNumber?this._hasScrollback&&f.backend==="conpty"&&f.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(f,b){this._cols!==f&&(f>this._cols?this._reflowLarger(f,b):this._reflowSmaller(f,b))}_reflowLarger(f,b){const T=(0,x.reflowLargerGetLinesToRemove)(this.lines,this._cols,f,this.ybase+this.y,this.getNullCell(C.DEFAULT_ATTR_DATA));if(T.length>0){const L=(0,x.reflowLargerCreateNewLayout)(this.lines,T);(0,x.reflowLargerApplyNewLayout)(this.lines,L.layout),this._reflowLargerAdjustViewport(f,b,L.countRemoved)}}_reflowLargerAdjustViewport(f,b,T){const L=this.getNullCell(C.DEFAULT_ATTR_DATA);let R=T;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<b&&this.lines.push(new C.BufferLine(f,L))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-T,0)}_reflowSmaller(f,b){const T=this.getNullCell(C.DEFAULT_ATTR_DATA),L=[];let R=0;for(let M=this.lines.length-1;M>=0;M--){let k=this.lines.get(M);if(!k||!k.isWrapped&&k.getTrimmedLength()<=f)continue;const I=[k];for(;k.isWrapped&&M>0;)k=this.lines.get(--M),I.unshift(k);const G=this.ybase+this.y;if(G>=M&&G<M+I.length)continue;const q=I[I.length-1].getTrimmedLength(),W=(0,x.reflowSmallerGetNewLineLengths)(I,this._cols,f),j=W.length-I.length;let V;V=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 U=[];for(let N=0;N<j;N++){const H=this.getBlankLine(C.DEFAULT_ATTR_DATA,!0);U.push(H)}U.length>0&&(L.push({start:M+I.length+R,newLines:U}),R+=U.length),I.push(...U);let F=W.length-1,K=W[F];K===0&&(F--,K=W[F]);let X=I.length-j-1,D=q;for(;X>=0;){const N=Math.min(D,K);if(I[F]===void 0)break;if(I[F].copyCellsFrom(I[X],D-N,K-N,N,!0),K-=N,K===0&&(F--,K=W[F]),D-=N,D===0){X--;const H=Math.max(X,0);D=(0,x.getWrappedLineTrimmedLength)(I,H,this._cols)}}for(let N=0;N<I.length;N++)W[N]<f&&I[N].setCell(W[N],T);let B=j-V;for(;B-- >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+R)-b&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+j,this.ybase+b-1)}if(L.length>0){const M=[],k=[];for(let F=0;F<this.lines.length;F++)k.push(this.lines.get(F));const I=this.lines.length;let G=I-1,q=0,W=L[q];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let j=0;for(let F=Math.min(this.lines.maxLength-1,I+R-1);F>=0;F--)if(W&&W.start>G+j){for(let K=W.newLines.length-1;K>=0;K--)this.lines.set(F--,W.newLines[K]);F++,M.push({index:G+1,amount:W.newLines.length}),j+=W.newLines.length,W=L[++q]}else this.lines.set(F,k[G--]);let V=0;for(let F=M.length-1;F>=0;F--)M[F].index+=V,this.lines.onInsertEmitter.fire(M[F]),V+=M[F].amount;const U=Math.max(0,I+R-this.lines.maxLength);U>0&&this.lines.onTrimEmitter.fire(U)}}translateBufferLineToString(f,b,T=0,L){const R=this.lines.get(f);return R?R.translateToString(b,T,L):""}getWrappedRangeForLine(f){let b=f,T=f;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(f){for(f!=null?this.tabs[f]||(f=this.prevStop(f)):(this.tabs={},f=0);f<this._cols;f+=this._optionsService.rawOptions.tabStopWidth)this.tabs[f]=!0}prevStop(f){for(f==null&&(f=this.x);!this.tabs[--f]&&f>0;);return f>=this._cols?this._cols-1:f<0?0:f}nextStop(f){for(f==null&&(f=this.x);!this.tabs[++f]&&f<this._cols;);return f>=this._cols?this._cols-1:f<0?0:f}clearMarkers(f){this._isClearing=!0;for(let b=0;b<this.markers.length;b++)this.markers[b].line===f&&(this.markers[b].dispose(),this.markers.splice(b--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let f=0;f<this.markers.length;f++)this.markers[f].dispose(),this.markers.splice(f--,1);this._isClearing=!1}addMarker(f){const b=new m.Marker(f);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(f){this._isClearing||this.markers.splice(this.markers.indexOf(f),1)}}},8437:(g,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLine=c.DEFAULT_ATTR_DATA=void 0;const d=u(3734),S=u(511),p=u(643),C=u(482);c.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let x=0;class A{constructor(m,y,f=!1){this.isWrapped=f,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*m);const b=y||S.CellData.fromCharData([0,p.NULL_CELL_CHAR,p.NULL_CELL_WIDTH,p.NULL_CELL_CODE]);for(let T=0;T<m;++T)this.setCell(T,b);this.length=m}get(m){const y=this._data[3*m+0],f=2097151&y;return[this._data[3*m+1],2097152&y?this._combined[m]:f?(0,C.stringFromCodePoint)(f):"",y>>22,2097152&y?this._combined[m].charCodeAt(this._combined[m].length-1):f]}set(m,y){this._data[3*m+1]=y[p.CHAR_DATA_ATTR_INDEX],y[p.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[m]=y[1],this._data[3*m+0]=2097152|m|y[p.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*m+0]=y[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[p.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(m){return this._data[3*m+0]>>22}hasWidth(m){return 12582912&this._data[3*m+0]}getFg(m){return this._data[3*m+1]}getBg(m){return this._data[3*m+2]}hasContent(m){return 4194303&this._data[3*m+0]}getCodePoint(m){const y=this._data[3*m+0];return 2097152&y?this._combined[m].charCodeAt(this._combined[m].length-1):2097151&y}isCombined(m){return 2097152&this._data[3*m+0]}getString(m){const y=this._data[3*m+0];return 2097152&y?this._combined[m]:2097151&y?(0,C.stringFromCodePoint)(2097151&y):""}isProtected(m){return 536870912&this._data[3*m+2]}loadCell(m,y){return x=3*m,y.content=this._data[x+0],y.fg=this._data[x+1],y.bg=this._data[x+2],2097152&y.content&&(y.combinedData=this._combined[m]),268435456&y.bg&&(y.extended=this._extendedAttrs[m]),y}setCell(m,y){2097152&y.content&&(this._combined[m]=y.combinedData),268435456&y.bg&&(this._extendedAttrs[m]=y.extended),this._data[3*m+0]=y.content,this._data[3*m+1]=y.fg,this._data[3*m+2]=y.bg}setCellFromCodepoint(m,y,f,b){268435456&b.bg&&(this._extendedAttrs[m]=b.extended),this._data[3*m+0]=y|f<<22,this._data[3*m+1]=b.fg,this._data[3*m+2]=b.bg}addCodepointToCell(m,y,f){let b=this._data[3*m+0];2097152&b?this._combined[m]+=(0,C.stringFromCodePoint)(y):2097151&b?(this._combined[m]=(0,C.stringFromCodePoint)(2097151&b)+(0,C.stringFromCodePoint)(y),b&=-2097152,b|=2097152):b=y|4194304,f&&(b&=-12582913,b|=f<<22),this._data[3*m+0]=b}insertCells(m,y,f){if((m%=this.length)&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,f),y<this.length-m){const b=new S.CellData;for(let T=this.length-m-y-1;T>=0;--T)this.setCell(m+y+T,this.loadCell(m+T,b));for(let T=0;T<y;++T)this.setCell(m+T,f)}else for(let b=m;b<this.length;++b)this.setCell(b,f);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,f)}deleteCells(m,y,f){if(m%=this.length,y<this.length-m){const b=new S.CellData;for(let T=0;T<this.length-m-y;++T)this.setCell(m+T,this.loadCell(m+y+T,b));for(let T=this.length-y;T<this.length;++T)this.setCell(T,f)}else for(let b=m;b<this.length;++b)this.setCell(b,f);m&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,f),this.getWidth(m)!==0||this.hasContent(m)||this.setCellFromCodepoint(m,0,1,f)}replaceCells(m,y,f,b=!1){if(b)for(m&&this.getWidth(m-1)===2&&!this.isProtected(m-1)&&this.setCellFromCodepoint(m-1,0,1,f),y<this.length&&this.getWidth(y-1)===2&&!this.isProtected(y)&&this.setCellFromCodepoint(y,0,1,f);m<y&&m<this.length;)this.isProtected(m)||this.setCell(m,f),m++;else for(m&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,f),y<this.length&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y,0,1,f);m<y&&m<this.length;)this.setCell(m++,f)}resize(m,y){if(m===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const f=3*m;if(m>this.length){if(this._data.buffer.byteLength>=4*f)this._data=new Uint32Array(this._data.buffer,0,f);else{const b=new Uint32Array(f);b.set(this._data),this._data=b}for(let b=this.length;b<m;++b)this.setCell(b,y)}else{this._data=this._data.subarray(0,f);const b=Object.keys(this._combined);for(let L=0;L<b.length;L++){const R=parseInt(b[L],10);R>=m&&delete this._combined[R]}const T=Object.keys(this._extendedAttrs);for(let L=0;L<T.length;L++){const R=parseInt(T[L],10);R>=m&&delete this._extendedAttrs[R]}}return this.length=m,4*f*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const m=new Uint32Array(this._data.length);return m.set(this._data),this._data=m,1}return 0}fill(m,y=!1){if(y)for(let f=0;f<this.length;++f)this.isProtected(f)||this.setCell(f,m);else{this._combined={},this._extendedAttrs={};for(let f=0;f<this.length;++f)this.setCell(f,m)}}copyFrom(m){this.length!==m.length?this._data=new Uint32Array(m._data):this._data.set(m._data),this.length=m.length,this._combined={};for(const y in m._combined)this._combined[y]=m._combined[y];this._extendedAttrs={};for(const y in m._extendedAttrs)this._extendedAttrs[y]=m._extendedAttrs[y];this.isWrapped=m.isWrapped}clone(){const m=new A(0);m._data=new Uint32Array(this._data),m.length=this.length;for(const y in this._combined)m._combined[y]=this._combined[y];for(const y in this._extendedAttrs)m._extendedAttrs[y]=this._extendedAttrs[y];return m.isWrapped=this.isWrapped,m}getTrimmedLength(){for(let m=this.length-1;m>=0;--m)if(4194303&this._data[3*m+0])return m+(this._data[3*m+0]>>22);return 0}getNoBgTrimmedLength(){for(let m=this.length-1;m>=0;--m)if(4194303&this._data[3*m+0]||50331648&this._data[3*m+2])return m+(this._data[3*m+0]>>22);return 0}copyCellsFrom(m,y,f,b,T){const L=m._data;if(T)for(let M=b-1;M>=0;M--){for(let k=0;k<3;k++)this._data[3*(f+M)+k]=L[3*(y+M)+k];268435456&L[3*(y+M)+2]&&(this._extendedAttrs[f+M]=m._extendedAttrs[y+M])}else for(let M=0;M<b;M++){for(let k=0;k<3;k++)this._data[3*(f+M)+k]=L[3*(y+M)+k];268435456&L[3*(y+M)+2]&&(this._extendedAttrs[f+M]=m._extendedAttrs[y+M])}const R=Object.keys(m._combined);for(let M=0;M<R.length;M++){const k=parseInt(R[M],10);k>=y&&(this._combined[k-y+f]=m._combined[k])}}translateToString(m,y,f,b){y=y??0,f=f??this.length,m&&(f=Math.min(f,this.getTrimmedLength())),b&&(b.length=0);let T="";for(;y<f;){const L=this._data[3*y+0],R=2097151&L,M=2097152&L?this._combined[y]:R?(0,C.stringFromCodePoint)(R):p.WHITESPACE_CELL_CHAR;if(T+=M,b)for(let k=0;k<M.length;++k)b.push(y);y+=L>>22||1}return b&&b.push(y),T}}c.BufferLine=A},4841:(g,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:(g,c)=>{function u(d,S,p){if(S===d.length-1)return d[S].getTrimmedLength();const C=!d[S].hasContent(p-1)&&d[S].getWidth(p-1)===1,x=d[S+1].getWidth(0)===2;return C&&x?p-1:p}Object.defineProperty(c,"__esModule",{value:!0}),c.getWrappedLineTrimmedLength=c.reflowSmallerGetNewLineLengths=c.reflowLargerApplyNewLayout=c.reflowLargerCreateNewLayout=c.reflowLargerGetLinesToRemove=void 0,c.reflowLargerGetLinesToRemove=function(d,S,p,C,x){const A=[];for(let E=0;E<d.length-1;E++){let m=E,y=d.get(++m);if(!y.isWrapped)continue;const f=[d.get(E)];for(;m<d.length&&y.isWrapped;)f.push(y),y=d.get(++m);if(C>=E&&C<m){E+=f.length-1;continue}let b=0,T=u(f,b,S),L=1,R=0;for(;L<f.length;){const k=u(f,L,S),I=k-R,G=p-T,q=Math.min(I,G);f[b].copyCellsFrom(f[L],R,T,q,!1),T+=q,T===p&&(b++,T=0),R+=q,R===k&&(L++,R=0),T===0&&b!==0&&f[b-1].getWidth(p-1)===2&&(f[b].copyCellsFrom(f[b-1],p-1,T++,1,!1),f[b-1].setCell(p-1,x))}f[b].replaceCells(T,p,x);let M=0;for(let k=f.length-1;k>0&&(k>b||f[k].getTrimmedLength()===0);k--)M++;M>0&&(A.push(E+f.length-M),A.push(M)),E+=f.length-1}return A},c.reflowLargerCreateNewLayout=function(d,S){const p=[];let C=0,x=S[C],A=0;for(let E=0;E<d.length;E++)if(x===E){const m=S[++C];d.onDeleteEmitter.fire({index:E-A,amount:m}),E+=m-1,A+=m,x=S[++C]}else p.push(E);return{layout:p,countRemoved:A}},c.reflowLargerApplyNewLayout=function(d,S){const p=[];for(let C=0;C<S.length;C++)p.push(d.get(S[C]));for(let C=0;C<p.length;C++)d.set(C,p[C]);d.length=S.length},c.reflowSmallerGetNewLineLengths=function(d,S,p){const C=[],x=d.map(((y,f)=>u(d,f,S))).reduce(((y,f)=>y+f));let A=0,E=0,m=0;for(;m<x;){if(x-m<p){C.push(x-m);break}A+=p;const y=u(d,E,S);A>y&&(A-=y,E++);const f=d[E].getWidth(A-1)===2;f&&A--;const b=f?p-1:p;C.push(b),m+=b}return C},c.getWrappedLineTrimmedLength=u},5295:(g,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferSet=void 0;const d=u(8460),S=u(844),p=u(9092);class C extends S.Disposable{constructor(A,E){super(),this._optionsService=A,this._bufferService=E,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 p.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new p.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(A){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(A),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(A,E){this._normal.resize(A,E),this._alt.resize(A,E),this.setupTabStops(A)}setupTabStops(A){this._normal.setupTabStops(A),this._alt.setupTabStops(A)}}c.BufferSet=C},511:(g,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CellData=void 0;const d=u(482),S=u(643),p=u(3734);class C extends p.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new p.ExtendedAttrs,this.combinedData=""}static fromCharData(A){const E=new C;return E.setFromCharData(A),E}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 E=!1;if(A[S.CHAR_DATA_CHAR_INDEX].length>2)E=!0;else if(A[S.CHAR_DATA_CHAR_INDEX].length===2){const m=A[S.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=m&&m<=56319){const y=A[S.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=y&&y<=57343?this.content=1024*(m-55296)+y-56320+65536|A[S.CHAR_DATA_WIDTH_INDEX]<<22:E=!0}else E=!0}else this.content=A[S.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|A[S.CHAR_DATA_WIDTH_INDEX]<<22;E&&(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:(g,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:(g,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Marker=void 0;const d=u(8460),S=u(844);class p{get id(){return this._id}constructor(x){this.line=x,this.isDisposed=!1,this._disposables=[],this._id=p._nextId++,this._onDispose=this.register(new 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(x){return this._disposables.push(x),x}}c.Marker=p,p._nextId=1},7116:(g,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:(g,c)=>{var u,d,S;Object.defineProperty(c,"__esModule",{value:!0}),c.C1_ESCAPED=c.C1=c.C0=void 0,(function(p){p.NUL="\0",p.SOH="",p.STX="",p.ETX="",p.EOT="",p.ENQ="",p.ACK="",p.BEL="\x07",p.BS="\b",p.HT=" ",p.LF=`
775
- `,p.VT="\v",p.FF="\f",p.CR="\r",p.SO="",p.SI="",p.DLE="",p.DC1="",p.DC2="",p.DC3="",p.DC4="",p.NAK="",p.SYN="",p.ETB="",p.CAN="",p.EM="",p.SUB="",p.ESC="\x1B",p.FS="",p.GS="",p.RS="",p.US="",p.SP=" ",p.DEL=""})(u||(c.C0=u={})),(function(p){p.PAD="€",p.HOP="",p.BPH="‚",p.NBH="ƒ",p.IND="„",p.NEL="…",p.SSA="†",p.ESA="‡",p.HTS="ˆ",p.HTJ="‰",p.VTS="Š",p.PLD="‹",p.PLU="Œ",p.RI="",p.SS2="Ž",p.SS3="",p.DCS="",p.PU1="‘",p.PU2="’",p.STS="“",p.CCH="”",p.MW="•",p.SPA="–",p.EPA="—",p.SOS="˜",p.SGCI="™",p.SCI="š",p.CSI="›",p.ST="œ",p.OSC="",p.PM="ž",p.APC="Ÿ"})(d||(c.C1=d={})),(function(p){p.ST=`${u.ESC}\\`})(S||(c.C1_ESCAPED=S={}))},7399:(g,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(p,C,x,A){const E={type:0,cancel:!1,key:void 0},m=(p.shiftKey?1:0)|(p.altKey?2:0)|(p.ctrlKey?4:0)|(p.metaKey?8:0);switch(p.keyCode){case 0:p.key==="UIKeyInputUpArrow"?E.key=C?d.C0.ESC+"OA":d.C0.ESC+"[A":p.key==="UIKeyInputLeftArrow"?E.key=C?d.C0.ESC+"OD":d.C0.ESC+"[D":p.key==="UIKeyInputRightArrow"?E.key=C?d.C0.ESC+"OC":d.C0.ESC+"[C":p.key==="UIKeyInputDownArrow"&&(E.key=C?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:E.key=p.ctrlKey?"\b":d.C0.DEL,p.altKey&&(E.key=d.C0.ESC+E.key);break;case 9:if(p.shiftKey){E.key=d.C0.ESC+"[Z";break}E.key=d.C0.HT,E.cancel=!0;break;case 13:E.key=p.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,E.cancel=!0;break;case 27:E.key=d.C0.ESC,p.altKey&&(E.key=d.C0.ESC+d.C0.ESC),E.cancel=!0;break;case 37:if(p.metaKey)break;m?(E.key=d.C0.ESC+"[1;"+(m+1)+"D",E.key===d.C0.ESC+"[1;3D"&&(E.key=d.C0.ESC+(x?"b":"[1;5D"))):E.key=C?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(p.metaKey)break;m?(E.key=d.C0.ESC+"[1;"+(m+1)+"C",E.key===d.C0.ESC+"[1;3C"&&(E.key=d.C0.ESC+(x?"f":"[1;5C"))):E.key=C?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(p.metaKey)break;m?(E.key=d.C0.ESC+"[1;"+(m+1)+"A",x||E.key!==d.C0.ESC+"[1;3A"||(E.key=d.C0.ESC+"[1;5A")):E.key=C?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(p.metaKey)break;m?(E.key=d.C0.ESC+"[1;"+(m+1)+"B",x||E.key!==d.C0.ESC+"[1;3B"||(E.key=d.C0.ESC+"[1;5B")):E.key=C?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:p.shiftKey||p.ctrlKey||(E.key=d.C0.ESC+"[2~");break;case 46:E.key=m?d.C0.ESC+"[3;"+(m+1)+"~":d.C0.ESC+"[3~";break;case 36:E.key=m?d.C0.ESC+"[1;"+(m+1)+"H":C?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:E.key=m?d.C0.ESC+"[1;"+(m+1)+"F":C?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:p.shiftKey?E.type=2:p.ctrlKey?E.key=d.C0.ESC+"[5;"+(m+1)+"~":E.key=d.C0.ESC+"[5~";break;case 34:p.shiftKey?E.type=3:p.ctrlKey?E.key=d.C0.ESC+"[6;"+(m+1)+"~":E.key=d.C0.ESC+"[6~";break;case 112:E.key=m?d.C0.ESC+"[1;"+(m+1)+"P":d.C0.ESC+"OP";break;case 113:E.key=m?d.C0.ESC+"[1;"+(m+1)+"Q":d.C0.ESC+"OQ";break;case 114:E.key=m?d.C0.ESC+"[1;"+(m+1)+"R":d.C0.ESC+"OR";break;case 115:E.key=m?d.C0.ESC+"[1;"+(m+1)+"S":d.C0.ESC+"OS";break;case 116:E.key=m?d.C0.ESC+"[15;"+(m+1)+"~":d.C0.ESC+"[15~";break;case 117:E.key=m?d.C0.ESC+"[17;"+(m+1)+"~":d.C0.ESC+"[17~";break;case 118:E.key=m?d.C0.ESC+"[18;"+(m+1)+"~":d.C0.ESC+"[18~";break;case 119:E.key=m?d.C0.ESC+"[19;"+(m+1)+"~":d.C0.ESC+"[19~";break;case 120:E.key=m?d.C0.ESC+"[20;"+(m+1)+"~":d.C0.ESC+"[20~";break;case 121:E.key=m?d.C0.ESC+"[21;"+(m+1)+"~":d.C0.ESC+"[21~";break;case 122:E.key=m?d.C0.ESC+"[23;"+(m+1)+"~":d.C0.ESC+"[23~";break;case 123:E.key=m?d.C0.ESC+"[24;"+(m+1)+"~":d.C0.ESC+"[24~";break;default:if(!p.ctrlKey||p.shiftKey||p.altKey||p.metaKey)if(x&&!A||!p.altKey||p.metaKey)!x||p.altKey||p.ctrlKey||p.shiftKey||!p.metaKey?p.key&&!p.ctrlKey&&!p.altKey&&!p.metaKey&&p.keyCode>=48&&p.key.length===1?E.key=p.key:p.key&&p.ctrlKey&&(p.key==="_"&&(E.key=d.C0.US),p.key==="@"&&(E.key=d.C0.NUL)):p.keyCode===65&&(E.type=1);else{const y=S[p.keyCode],f=y?.[p.shiftKey?1:0];if(f)E.key=d.C0.ESC+f;else if(p.keyCode>=65&&p.keyCode<=90){const b=p.ctrlKey?p.keyCode-64:p.keyCode+32;let T=String.fromCharCode(b);p.shiftKey&&(T=T.toUpperCase()),E.key=d.C0.ESC+T}else if(p.keyCode===32)E.key=d.C0.ESC+(p.ctrlKey?d.C0.NUL:" ");else if(p.key==="Dead"&&p.code.startsWith("Key")){let b=p.code.slice(3,4);p.shiftKey||(b=b.toLowerCase()),E.key=d.C0.ESC+b,E.cancel=!0}}else p.keyCode>=65&&p.keyCode<=90?E.key=String.fromCharCode(p.keyCode-64):p.keyCode===32?E.key=d.C0.NUL:p.keyCode>=51&&p.keyCode<=55?E.key=String.fromCharCode(p.keyCode-51+27):p.keyCode===56?E.key=d.C0.DEL:p.keyCode===219?E.key=d.C0.ESC:p.keyCode===220?E.key=d.C0.FS:p.keyCode===221&&(E.key=d.C0.GS)}return E}},482:(g,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 p="";for(let C=d;C<S;++C){let x=u[C];x>65535?(x-=65536,p+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):p+=String.fromCharCode(x)}return p},c.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const S=u.length;if(!S)return 0;let p=0,C=0;if(this._interim){const x=u.charCodeAt(C++);56320<=x&&x<=57343?d[p++]=1024*(this._interim-55296)+x-56320+65536:(d[p++]=this._interim,d[p++]=x),this._interim=0}for(let x=C;x<S;++x){const A=u.charCodeAt(x);if(55296<=A&&A<=56319){if(++x>=S)return this._interim=A,p;const E=u.charCodeAt(x);56320<=E&&E<=57343?d[p++]=1024*(A-55296)+E-56320+65536:(d[p++]=A,d[p++]=E)}else A!==65279&&(d[p++]=A)}return p}},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 p,C,x,A,E=0,m=0,y=0;if(this.interim[0]){let T=!1,L=this.interim[0];L&=(224&L)==192?31:(240&L)==224?15:7;let R,M=0;for(;(R=63&this.interim[++M])&&M<4;)L<<=6,L|=R;const k=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,I=k-M;for(;y<I;){if(y>=S)return 0;if(R=u[y++],(192&R)!=128){y--,T=!0;break}this.interim[M++]=R,L<<=6,L|=63&R}T||(k===2?L<128?y--:d[E++]=L:k===3?L<2048||L>=55296&&L<=57343||L===65279||(d[E++]=L):L<65536||L>1114111||(d[E++]=L)),this.interim.fill(0)}const f=S-4;let b=y;for(;b<S;){for(;!(!(b<f)||128&(p=u[b])||128&(C=u[b+1])||128&(x=u[b+2])||128&(A=u[b+3]));)d[E++]=p,d[E++]=C,d[E++]=x,d[E++]=A,b+=4;if(p=u[b++],p<128)d[E++]=p;else if((224&p)==192){if(b>=S)return this.interim[0]=p,E;if(C=u[b++],(192&C)!=128){b--;continue}if(m=(31&p)<<6|63&C,m<128){b--;continue}d[E++]=m}else if((240&p)==224){if(b>=S)return this.interim[0]=p,E;if(C=u[b++],(192&C)!=128){b--;continue}if(b>=S)return this.interim[0]=p,this.interim[1]=C,E;if(x=u[b++],(192&x)!=128){b--;continue}if(m=(15&p)<<12|(63&C)<<6|63&x,m<2048||m>=55296&&m<=57343||m===65279)continue;d[E++]=m}else if((248&p)==240){if(b>=S)return this.interim[0]=p,E;if(C=u[b++],(192&C)!=128){b--;continue}if(b>=S)return this.interim[0]=p,this.interim[1]=C,E;if(x=u[b++],(192&x)!=128){b--;continue}if(b>=S)return this.interim[0]=p,this.interim[1]=C,this.interim[2]=x,E;if(A=u[b++],(192&A)!=128){b--;continue}if(m=(7&p)<<18|(63&C)<<12|(63&x)<<6|63&A,m<65536||m>1114111)continue;d[E++]=m}}return E}}},225:(g,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]],p=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let 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 x=0;x<S.length;++x)C.fill(0,S[x][0],S[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?C[x]:(function(A,E){let m,y=0,f=E.length-1;if(A<E[0][0]||A>E[f][1])return!1;for(;f>=y;)if(m=y+f>>1,A>E[m][1])y=m+1;else{if(!(A<E[m][0]))return!0;f=m-1}return!1})(x,p)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,A){let E=this.wcwidth(x),m=E===0&&A!==0;if(m){const y=d.UnicodeService.extractWidth(A);y===0?m=!1:y>E&&(E=y)}return d.UnicodeService.createPropertyValue(0,E,m)}}},5981:(g,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WriteBuffer=void 0;const d=u(8460),S=u(844);class p extends S.Disposable{constructor(x){super(),this._action=x,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(x,A){if(A!==void 0&&this._syncCalls>A)return void(this._syncCalls=0);if(this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let E;for(this._isSyncWriting=!0;E=this._writeBuffer.shift();){this._action(E);const m=this._callbacks.shift();m&&m()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(x,A){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(A),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(A)}_innerWrite(x=0,A=!0){const E=x||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const m=this._writeBuffer[this._bufferOffset],y=this._action(m,A);if(y){const b=T=>Date.now()-E>=12?setTimeout((()=>this._innerWrite(0,T))):this._innerWrite(E,T);return void y.catch((T=>(queueMicrotask((()=>{throw T})),Promise.resolve(!1)))).then(b)}const f=this._callbacks[this._bufferOffset];if(f&&f(),this._bufferOffset++,this._pendingData-=m.length,Date.now()-E>=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=p},5941:(g,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(p,C){const x=p.toString(16),A=x.length<2?"0"+x:x;switch(C){case 4:return x[0];case 8:return A;case 12:return(A+A).slice(0,3);default:return A+A}}c.parseColor=function(p){if(!p)return;let C=p.toLowerCase();if(C.indexOf("rgb:")===0){C=C.slice(4);const x=u.exec(C);if(x){const A=x[1]?15:x[4]?255:x[7]?4095:65535;return[Math.round(parseInt(x[1]||x[4]||x[7]||x[10],16)/A*255),Math.round(parseInt(x[2]||x[5]||x[8]||x[11],16)/A*255),Math.round(parseInt(x[3]||x[6]||x[9]||x[12],16)/A*255)]}}else if(C.indexOf("#")===0&&(C=C.slice(1),d.exec(C)&&[3,6,9,12].includes(C.length))){const x=C.length/3,A=[0,0,0];for(let E=0;E<3;++E){const m=parseInt(C.slice(x*E,x*E+x),16);A[E]=x===1?m<<4:x===2?m:x===3?m>>4:m>>8}return A}},c.toRgbString=function(p,C=16){const[x,A,E]=p;return`rgb:${S(x,C)}/${S(A,C)}/${S(E,C)}`}},5770:(g,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.PAYLOAD_LIMIT=void 0,c.PAYLOAD_LIMIT=1e7},6351:(g,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DcsHandler=c.DcsParser=void 0;const d=u(482),S=u(8742),p=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,E){this._handlers[A]===void 0&&(this._handlers[A]=[]);const m=this._handlers[A];return m.push(E),{dispose:()=>{const y=m.indexOf(E);y!==-1&&m.splice(y,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,E){if(this.reset(),this._ident=A,this._active=this._handlers[A]||C,this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].hook(E);else this._handlerFb(this._ident,"HOOK",E)}put(A,E,m){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(A,E,m);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(A,E,m))}unhook(A,E=!0){if(this._active.length){let m=!1,y=this._active.length-1,f=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,m=E,f=this._stack.fallThrough,this._stack.paused=!1),!f&&m===!1){for(;y>=0&&(m=this._active[y].unhook(A),m!==!0);y--)if(m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,m;y--}for(;y>=0;y--)if(m=this._active[y].unhook(!1),m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,m}else this._handlerFb(this._ident,"UNHOOK",A);this._active=C,this._ident=0}};const x=new S.Params;x.addParam(0),c.DcsHandler=class{constructor(A){this._handler=A,this._data="",this._params=x,this._hitLimit=!1}hook(A){this._params=A.length>1||A.params[0]?A.clone():x,this._data="",this._hitLimit=!1}put(A,E,m){this._hitLimit||(this._data+=(0,d.utf32ToString)(A,E,m),this._data.length>p.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(A){let E=!1;if(this._hitLimit)E=!1;else if(A&&(E=this._handler(this._data,this._params),E instanceof Promise))return E.then((m=>(this._params=x,this._data="",this._hitLimit=!1,m)));return this._params=x,this._data="",this._hitLimit=!1,E}}},2015:(g,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),p=u(6242),C=u(6351);class x{constructor(y){this.table=new Uint8Array(y)}setDefault(y,f){this.table.fill(y<<4|f)}add(y,f,b,T){this.table[f<<8|y]=b<<4|T}addMany(y,f,b,T){for(let L=0;L<y.length;L++)this.table[f<<8|y[L]]=b<<4|T}}c.TransitionTable=x;const A=160;c.VT500_TRANSITION_TABLE=(function(){const m=new x(4095),y=Array.apply(null,Array(256)).map(((M,k)=>k)),f=(M,k)=>y.slice(M,k),b=f(32,127),T=f(0,24);T.push(25),T.push.apply(T,f(28,32));const L=f(0,14);let R;for(R in m.setDefault(1,0),m.addMany(b,0,2,0),L)m.addMany([24,26,153,154],R,3,0),m.addMany(f(128,144),R,3,0),m.addMany(f(144,152),R,3,0),m.add(156,R,0,0),m.add(27,R,11,1),m.add(157,R,4,8),m.addMany([152,158,159],R,0,7),m.add(155,R,11,3),m.add(144,R,11,9);return m.addMany(T,0,3,0),m.addMany(T,1,3,1),m.add(127,1,0,1),m.addMany(T,8,0,8),m.addMany(T,3,3,3),m.add(127,3,0,3),m.addMany(T,4,3,4),m.add(127,4,0,4),m.addMany(T,6,3,6),m.addMany(T,5,3,5),m.add(127,5,0,5),m.addMany(T,2,3,2),m.add(127,2,0,2),m.add(93,1,4,8),m.addMany(b,8,5,8),m.add(127,8,5,8),m.addMany([156,27,24,26,7],8,6,0),m.addMany(f(28,32),8,0,8),m.addMany([88,94,95],1,0,7),m.addMany(b,7,0,7),m.addMany(T,7,0,7),m.add(156,7,0,0),m.add(127,7,0,7),m.add(91,1,11,3),m.addMany(f(64,127),3,7,0),m.addMany(f(48,60),3,8,4),m.addMany([60,61,62,63],3,9,4),m.addMany(f(48,60),4,8,4),m.addMany(f(64,127),4,7,0),m.addMany([60,61,62,63],4,0,6),m.addMany(f(32,64),6,0,6),m.add(127,6,0,6),m.addMany(f(64,127),6,0,0),m.addMany(f(32,48),3,9,5),m.addMany(f(32,48),5,9,5),m.addMany(f(48,64),5,0,6),m.addMany(f(64,127),5,7,0),m.addMany(f(32,48),4,9,5),m.addMany(f(32,48),1,9,2),m.addMany(f(32,48),2,9,2),m.addMany(f(48,127),2,10,0),m.addMany(f(48,80),1,10,0),m.addMany(f(81,88),1,10,0),m.addMany([89,90,92],1,10,0),m.addMany(f(96,127),1,10,0),m.add(80,1,11,9),m.addMany(T,9,0,9),m.add(127,9,0,9),m.addMany(f(28,32),9,0,9),m.addMany(f(32,48),9,9,12),m.addMany(f(48,60),9,8,10),m.addMany([60,61,62,63],9,9,10),m.addMany(T,11,0,11),m.addMany(f(32,128),11,0,11),m.addMany(f(28,32),11,0,11),m.addMany(T,10,0,10),m.add(127,10,0,10),m.addMany(f(28,32),10,0,10),m.addMany(f(48,60),10,8,10),m.addMany([60,61,62,63],10,0,11),m.addMany(f(32,48),10,9,12),m.addMany(T,12,0,12),m.add(127,12,0,12),m.addMany(f(28,32),12,0,12),m.addMany(f(32,48),12,9,12),m.addMany(f(48,64),12,0,11),m.addMany(f(64,127),12,12,13),m.addMany(f(64,127),10,12,13),m.addMany(f(64,127),9,12,13),m.addMany(T,13,13,13),m.addMany(b,13,13,13),m.add(127,13,0,13),m.addMany([27,156,24,26],13,14,0),m.add(A,0,2,0),m.add(A,8,5,8),m.add(A,6,0,6),m.add(A,11,0,11),m.add(A,13,13,13),m})();class E extends d.Disposable{constructor(y=c.VT500_TRANSITION_TABLE){super(),this._transitions=y,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=(f,b,T)=>{},this._executeHandlerFb=f=>{},this._csiHandlerFb=(f,b)=>{},this._escHandlerFb=f=>{},this._errorHandlerFb=f=>f,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 p.OscParser),this._dcsParser=this.register(new C.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(y,f=[64,126]){let b=0;if(y.prefix){if(y.prefix.length>1)throw new Error("only one byte as prefix supported");if(b=y.prefix.charCodeAt(0),b&&60>b||b>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(y.intermediates){if(y.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let L=0;L<y.intermediates.length;++L){const R=y.intermediates.charCodeAt(L);if(32>R||R>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");b<<=8,b|=R}}if(y.final.length!==1)throw new Error("final must be a single byte");const T=y.final.charCodeAt(0);if(f[0]>T||T>f[1])throw new Error(`final must be in range ${f[0]} .. ${f[1]}`);return b<<=8,b|=T,b}identToString(y){const f=[];for(;y;)f.push(String.fromCharCode(255&y)),y>>=8;return f.reverse().join("")}setPrintHandler(y){this._printHandler=y}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(y,f){const b=this._identifier(y,[48,126]);this._escHandlers[b]===void 0&&(this._escHandlers[b]=[]);const T=this._escHandlers[b];return T.push(f),{dispose:()=>{const L=T.indexOf(f);L!==-1&&T.splice(L,1)}}}clearEscHandler(y){this._escHandlers[this._identifier(y,[48,126])]&&delete this._escHandlers[this._identifier(y,[48,126])]}setEscHandlerFallback(y){this._escHandlerFb=y}setExecuteHandler(y,f){this._executeHandlers[y.charCodeAt(0)]=f}clearExecuteHandler(y){this._executeHandlers[y.charCodeAt(0)]&&delete this._executeHandlers[y.charCodeAt(0)]}setExecuteHandlerFallback(y){this._executeHandlerFb=y}registerCsiHandler(y,f){const b=this._identifier(y);this._csiHandlers[b]===void 0&&(this._csiHandlers[b]=[]);const T=this._csiHandlers[b];return T.push(f),{dispose:()=>{const L=T.indexOf(f);L!==-1&&T.splice(L,1)}}}clearCsiHandler(y){this._csiHandlers[this._identifier(y)]&&delete this._csiHandlers[this._identifier(y)]}setCsiHandlerFallback(y){this._csiHandlerFb=y}registerDcsHandler(y,f){return this._dcsParser.registerHandler(this._identifier(y),f)}clearDcsHandler(y){this._dcsParser.clearHandler(this._identifier(y))}setDcsHandlerFallback(y){this._dcsParser.setHandlerFallback(y)}registerOscHandler(y,f){return this._oscParser.registerHandler(y,f)}clearOscHandler(y){this._oscParser.clearHandler(y)}setOscHandlerFallback(y){this._oscParser.setHandlerFallback(y)}setErrorHandler(y){this._errorHandler=y}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(y,f,b,T,L){this._parseStack.state=y,this._parseStack.handlers=f,this._parseStack.handlerPos=b,this._parseStack.transition=T,this._parseStack.chunkPos=L}parse(y,f,b){let T,L=0,R=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 I=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(b===!1&&I>-1){for(;I>=0&&(T=k[I](this._params),T!==!0);I--)if(T instanceof Promise)return this._parseStack.handlerPos=I,T}this._parseStack.handlers=[];break;case 4:if(b===!1&&I>-1){for(;I>=0&&(T=k[I](),T!==!0);I--)if(T instanceof Promise)return this._parseStack.handlerPos=I,T}this._parseStack.handlers=[];break;case 6:if(L=y[this._parseStack.chunkPos],T=this._dcsParser.unhook(L!==24&&L!==26,b),T)return T;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(L=y[this._parseStack.chunkPos],T=this._oscParser.end(L!==24&&L!==26,b),T)return T;L===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<f;++k){switch(L=y[k],R=this._transitions.table[this.currentState<<8|(L<160?L:A)],R>>4){case 2:for(let j=k+1;;++j){if(j>=f||(L=y[j])<32||L>126&&L<A){this._printHandler(y,k,j),k=j-1;break}if(++j>=f||(L=y[j])<32||L>126&&L<A){this._printHandler(y,k,j),k=j-1;break}if(++j>=f||(L=y[j])<32||L>126&&L<A){this._printHandler(y,k,j),k=j-1;break}if(++j>=f||(L=y[j])<32||L>126&&L<A){this._printHandler(y,k,j),k=j-1;break}}break;case 3:this._executeHandlers[L]?this._executeHandlers[L]():this._executeHandlerFb(L),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:k,code:L,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const I=this._csiHandlers[this._collect<<8|L];let G=I?I.length-1:-1;for(;G>=0&&(T=I[G](this._params),T!==!0);G--)if(T instanceof Promise)return this._preserveStack(3,I,G,R,k),T;G<0&&this._csiHandlerFb(this._collect<<8|L,this._params),this.precedingJoinState=0;break;case 8:do switch(L){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(L-48)}while(++k<f&&(L=y[k])>47&&L<60);k--;break;case 9:this._collect<<=8,this._collect|=L;break;case 10:const q=this._escHandlers[this._collect<<8|L];let W=q?q.length-1:-1;for(;W>=0&&(T=q[W](),T!==!0);W--)if(T instanceof Promise)return this._preserveStack(4,q,W,R,k),T;W<0&&this._escHandlerFb(this._collect<<8|L),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|L,this._params);break;case 13:for(let j=k+1;;++j)if(j>=f||(L=y[j])===24||L===26||L===27||L>127&&L<A){this._dcsParser.put(y,k,j),k=j-1;break}break;case 14:if(T=this._dcsParser.unhook(L!==24&&L!==26),T)return this._preserveStack(6,[],0,R,k),T;L===27&&(R|=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>=f||(L=y[j])<32||L>127&&L<A){this._oscParser.put(y,k,j),k=j-1;break}break;case 6:if(T=this._oscParser.end(L!==24&&L!==26),T)return this._preserveStack(5,[],0,R,k),T;L===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&R}}}c.EscapeSequenceParser=E},6242:(g,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OscHandler=c.OscParser=void 0;const d=u(5770),S=u(482),p=[];c.OscParser=class{constructor(){this._state=0,this._active=p,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(C,x){this._handlers[C]===void 0&&(this._handlers[C]=[]);const A=this._handlers[C];return A.push(x),{dispose:()=>{const E=A.indexOf(x);E!==-1&&A.splice(E,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=p}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=p,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||p,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,x,A){if(this._active.length)for(let E=this._active.length-1;E>=0;E--)this._active[E].put(C,x,A);else this._handlerFb(this._id,"PUT",(0,S.utf32ToString)(C,x,A))}start(){this.reset(),this._state=1}put(C,x,A){if(this._state!==3){if(this._state===1)for(;x<A;){const E=C[x++];if(E===59){this._state=2,this._start();break}if(E<48||57<E)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+E-48}this._state===2&&A-x>0&&this._put(C,x,A)}}end(C,x=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let A=!1,E=this._active.length-1,m=!1;if(this._stack.paused&&(E=this._stack.loopPosition-1,A=x,m=this._stack.fallThrough,this._stack.paused=!1),!m&&A===!1){for(;E>=0&&(A=this._active[E].end(C),A!==!0);E--)if(A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!1,A;E--}for(;E>=0;E--)if(A=this._active[E].end(!1),A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!0,A}else this._handlerFb(this._id,"END",C);this._active=p,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,x,A){this._hitLimit||(this._data+=(0,S.utf32ToString)(C,x,A),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(C){let x=!1;if(this._hitLimit)x=!1;else if(C&&(x=this._handler(this._data),x instanceof Promise))return x.then((A=>(this._data="",this._hitLimit=!1,A)));return this._data="",this._hitLimit=!1,x}}},8742:(g,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Params=void 0;const u=2147483647;class d{static fromArray(p){const C=new d;if(!p.length)return C;for(let x=Array.isArray(p[0])?1:0;x<p.length;++x){const A=p[x];if(Array.isArray(A))for(let E=0;E<A.length;++E)C.addSubParam(A[E]);else C.addParam(A)}return C}constructor(p=32,C=32){if(this.maxLength=p,this.maxSubParamsLength=C,C>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(p),this.length=0,this._subParams=new Int32Array(C),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(p),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const p=new d(this.maxLength,this.maxSubParamsLength);return p.params.set(this.params),p.length=this.length,p._subParams.set(this._subParams),p._subParamsLength=this._subParamsLength,p._subParamsIdx.set(this._subParamsIdx),p._rejectDigits=this._rejectDigits,p._rejectSubDigits=this._rejectSubDigits,p._digitIsSub=this._digitIsSub,p}toArray(){const p=[];for(let C=0;C<this.length;++C){p.push(this.params[C]);const x=this._subParamsIdx[C]>>8,A=255&this._subParamsIdx[C];A-x>0&&p.push(Array.prototype.slice.call(this._subParams,x,A))}return p}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(p){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(p<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=p>u?u:p}}addSubParam(p){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(p<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=p>u?u:p,this._subParamsIdx[this.length-1]++}}hasSubParams(p){return(255&this._subParamsIdx[p])-(this._subParamsIdx[p]>>8)>0}getSubParams(p){const C=this._subParamsIdx[p]>>8,x=255&this._subParamsIdx[p];return x-C>0?this._subParams.subarray(C,x):null}getSubParamsAll(){const p={};for(let C=0;C<this.length;++C){const x=this._subParamsIdx[C]>>8,A=255&this._subParamsIdx[C];A-x>0&&(p[C]=this._subParams.slice(x,A))}return p}addDigit(p){let C;if(this._rejectDigits||!(C=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const x=this._digitIsSub?this._subParams:this.params,A=x[C-1];x[C-1]=~A?Math.min(10*A+p,u):p}}c.Params=d},5741:(g,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:(g,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferApiView=void 0;const d=u(3785),S=u(511);c.BufferApiView=class{constructor(p,C){this._buffer=p,this.type=C}init(p){return this._buffer=p,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(p){const C=this._buffer.lines.get(p);if(C)return new d.BufferLineApiView(C)}getNullCell(){return new S.CellData}}},3785:(g,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,p){if(!(S<0||S>=this._line.length))return p?(this._line.loadCell(S,p),p):this._line.loadCell(S,new d.CellData)}translateToString(S,p,C){return this._line.translateToString(S,p,C)}}},8285:(g,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferNamespaceApi=void 0;const d=u(8771),S=u(8460),p=u(844);class C extends p.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:(g,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,p)=>d(S,p.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:(g,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(g,c,u){var d=this&&this.__decorate||function(m,y,f,b){var T,L=arguments.length,R=L<3?y:b===null?b=Object.getOwnPropertyDescriptor(y,f):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(m,y,f,b);else for(var M=m.length-1;M>=0;M--)(T=m[M])&&(R=(L<3?T(R):L>3?T(y,f,R):T(y,f))||R);return L>3&&R&&Object.defineProperty(y,f,R),R},S=this&&this.__param||function(m,y){return function(f,b){y(f,b,m)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferService=c.MINIMUM_ROWS=c.MINIMUM_COLS=void 0;const p=u(8460),C=u(844),x=u(5295),A=u(2585);c.MINIMUM_COLS=2,c.MINIMUM_ROWS=1;let E=c.BufferService=class extends C.Disposable{get buffer(){return this.buffers.active}constructor(m){super(),this.isUserScrolling=!1,this._onResize=this.register(new p.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(m.rawOptions.cols||0,c.MINIMUM_COLS),this.rows=Math.max(m.rawOptions.rows||0,c.MINIMUM_ROWS),this.buffers=this.register(new x.BufferSet(m,this))}resize(m,y){this.cols=m,this.rows=y,this.buffers.resize(m,y),this._onResize.fire({cols:m,rows:y})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(m,y=!1){const f=this.buffer;let b;b=this._cachedBlankLine,b&&b.length===this.cols&&b.getFg(0)===m.fg&&b.getBg(0)===m.bg||(b=f.getBlankLine(m,y),this._cachedBlankLine=b),b.isWrapped=y;const T=f.ybase+f.scrollTop,L=f.ybase+f.scrollBottom;if(f.scrollTop===0){const R=f.lines.isFull;L===f.lines.length-1?R?f.lines.recycle().copyFrom(b):f.lines.push(b.clone()):f.lines.splice(L+1,0,b.clone()),R?this.isUserScrolling&&(f.ydisp=Math.max(f.ydisp-1,0)):(f.ybase++,this.isUserScrolling||f.ydisp++)}else{const R=L-T+1;f.lines.shiftElements(T+1,R-1,-1),f.lines.set(L,b.clone())}this.isUserScrolling||(f.ydisp=f.ybase),this._onScroll.fire(f.ydisp)}scrollLines(m,y,f){const b=this.buffer;if(m<0){if(b.ydisp===0)return;this.isUserScrolling=!0}else m+b.ydisp>=b.ybase&&(this.isUserScrolling=!1);const T=b.ydisp;b.ydisp=Math.max(Math.min(b.ydisp+m,b.ybase),0),T!==b.ydisp&&(y||this._onScroll.fire(b.ydisp))}};c.BufferService=E=d([S(0,A.IOptionsService)],E)},7994:(g,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(g,c,u){var d=this&&this.__decorate||function(b,T,L,R){var M,k=arguments.length,I=k<3?T:R===null?R=Object.getOwnPropertyDescriptor(T,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(b,T,L,R);else for(var G=b.length-1;G>=0;G--)(M=b[G])&&(I=(k<3?M(I):k>3?M(T,L,I):M(T,L))||I);return k>3&&I&&Object.defineProperty(T,L,I),I},S=this&&this.__param||function(b,T){return function(L,R){T(L,R,b)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreMouseService=void 0;const p=u(2585),C=u(8460),x=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 E(b,T){let L=(b.ctrl?16:0)|(b.shift?4:0)|(b.alt?8:0);return b.button===4?(L|=64,L|=b.action):(L|=3&b.button,4&b.button&&(L|=64),8&b.button&&(L|=128),b.action===32?L|=32:b.action!==0||T||(L|=3)),L}const m=String.fromCharCode,y={DEFAULT:b=>{const T=[E(b,!1)+32,b.col+32,b.row+32];return T[0]>255||T[1]>255||T[2]>255?"":`\x1B[M${m(T[0])}${m(T[1])}${m(T[2])}`},SGR:b=>{const T=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${E(b,!0)};${b.col};${b.row}${T}`},SGR_PIXELS:b=>{const T=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${E(b,!0)};${b.x};${b.y}${T}`}};let f=c.CoreMouseService=class extends x.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 L of Object.keys(A))this.addProtocol(L,A[L]);for(const L of Object.keys(y))this.addEncoding(L,y[L]);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,L){if(L){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=f=d([S(0,p.IBufferService),S(1,p.ICoreService)],f)},6975:function(g,c,u){var d=this&&this.__decorate||function(f,b,T,L){var R,M=arguments.length,k=M<3?b:L===null?L=Object.getOwnPropertyDescriptor(b,T):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(f,b,T,L);else for(var I=f.length-1;I>=0;I--)(R=f[I])&&(k=(M<3?R(k):M>3?R(b,T,k):R(b,T))||k);return M>3&&k&&Object.defineProperty(b,T,k),k},S=this&&this.__param||function(f,b){return function(T,L){b(T,L,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreService=void 0;const p=u(1439),C=u(8460),x=u(844),A=u(2585),E=Object.freeze({insertMode:!1}),m=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let y=c.CoreService=class extends x.Disposable{constructor(f,b,T){super(),this._bufferService=f,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,p.clone)(E),this.decPrivateModes=(0,p.clone)(m)}reset(){this.modes=(0,p.clone)(E),this.decPrivateModes=(0,p.clone)(m)}triggerDataEvent(f,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 "${f}"`,(()=>f.split("").map((L=>L.charCodeAt(0))))),this._onData.fire(f)}triggerBinaryEvent(f){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${f}"`,(()=>f.split("").map((b=>b.charCodeAt(0))))),this._onBinary.fire(f))}};c.CoreService=y=d([S(0,A.IBufferService),S(1,A.ILogService),S(2,A.IOptionsService)],y)},9074:(g,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DecorationService=void 0;const d=u(8055),S=u(8460),p=u(844),C=u(6106);let x=0,A=0;class E extends p.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new C.SortedList((f=>f?.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,p.toDisposable)((()=>this.reset())))}registerDecoration(f){if(f.marker.isDisposed)return;const b=new m(f);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 f of this._decorations.values())f.dispose();this._decorations.clear()}*getDecorationsAtCell(f,b,T){let L=0,R=0;for(const M of this._decorations.getKeyIterator(b))L=M.options.x??0,R=L+(M.options.width??1),f>=L&&f<R&&(!T||(M.options.layer??"bottom")===T)&&(yield M)}forEachDecorationAtCell(f,b,T,L){this._decorations.forEachByKey(b,(R=>{x=R.options.x??0,A=x+(R.options.width??1),f>=x&&f<A&&(!T||(R.options.layer??"bottom")===T)&&L(R)}))}}c.DecorationService=E;class m extends p.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(f){super(),this.options=f,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=f.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(g,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.InstantiationService=c.ServiceCollection=void 0;const d=u(2585),S=u(8343);class p{constructor(...x){this._entries=new Map;for(const[A,E]of x)this.set(A,E)}set(x,A){const E=this._entries.get(x);return this._entries.set(x,A),E}forEach(x){for(const[A,E]of this._entries.entries())x(A,E)}has(x){return this._entries.has(x)}get(x){return this._entries.get(x)}}c.ServiceCollection=p,c.InstantiationService=class{constructor(){this._services=new p,this._services.set(d.IInstantiationService,this)}setService(C,x){this._services.set(C,x)}getService(C){return this._services.get(C)}createInstance(C,...x){const A=(0,S.getServiceDependencies)(C).sort(((y,f)=>y.index-f.index)),E=[];for(const y of A){const f=this._services.get(y.id);if(!f)throw new Error(`[createInstance] ${C.name} depends on UNKNOWN service ${y.id}.`);E.push(f)}const m=A.length>0?A[0].index:x.length;if(x.length!==m)throw new Error(`[createInstance] First service dependency of ${C.name} at position ${m+1} conflicts with ${x.length} static arguments`);return new C(...x,...E)}}},7866:function(g,c,u){var d=this&&this.__decorate||function(m,y,f,b){var T,L=arguments.length,R=L<3?y:b===null?b=Object.getOwnPropertyDescriptor(y,f):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(m,y,f,b);else for(var M=m.length-1;M>=0;M--)(T=m[M])&&(R=(L<3?T(R):L>3?T(y,f,R):T(y,f))||R);return L>3&&R&&Object.defineProperty(y,f,R),R},S=this&&this.__param||function(m,y){return function(f,b){y(f,b,m)}};Object.defineProperty(c,"__esModule",{value:!0}),c.traceCall=c.setTraceLogger=c.LogService=void 0;const p=u(844),C=u(2585),x={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,E=c.LogService=class extends p.Disposable{get logLevel(){return this._logLevel}constructor(m){super(),this._optionsService=m,this._logLevel=C.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),A=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(m){for(let y=0;y<m.length;y++)typeof m[y]=="function"&&(m[y]=m[y]())}_log(m,y,f){this._evalLazyOptionalParams(f),m.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+y,...f)}trace(m,...y){this._logLevel<=C.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,m,y)}debug(m,...y){this._logLevel<=C.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,m,y)}info(m,...y){this._logLevel<=C.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,m,y)}warn(m,...y){this._logLevel<=C.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,m,y)}error(m,...y){this._logLevel<=C.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,m,y)}};c.LogService=E=d([S(0,C.IOptionsService)],E),c.setTraceLogger=function(m){A=m},c.traceCall=function(m,y,f){if(typeof f.value!="function")throw new Error("not supported");const b=f.value;f.value=function(...T){if(A.logLevel!==C.LogLevelEnum.TRACE)return b.apply(this,T);A.trace(`GlyphRenderer#${b.name}(${T.map((R=>JSON.stringify(R))).join(", ")})`);const L=b.apply(this,T);return A.trace(`GlyphRenderer#${b.name} return`,L),L}}},7302:(g,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OptionsService=c.DEFAULT_OPTIONS=void 0;const d=u(8460),S=u(844),p=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:p.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 x extends S.Disposable{constructor(E){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const m={...c.DEFAULT_OPTIONS};for(const y in E)if(y in m)try{const f=E[y];m[y]=this._sanitizeAndValidateOption(y,f)}catch(f){console.error(f)}this.rawOptions=m,this.options={...m},this._setupOptions(),this.register((0,S.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(E,m){return this.onOptionChange((y=>{y===E&&m(this.rawOptions[E])}))}onMultipleOptionChange(E,m){return this.onOptionChange((y=>{E.indexOf(y)!==-1&&m()}))}_setupOptions(){const E=y=>{if(!(y in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);return this.rawOptions[y]},m=(y,f)=>{if(!(y in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);f=this._sanitizeAndValidateOption(y,f),this.rawOptions[y]!==f&&(this.rawOptions[y]=f,this._onOptionChange.fire(y))};for(const y in this.rawOptions){const f={get:E.bind(this,y),set:m.bind(this,y)};Object.defineProperty(this.options,y,f)}}_sanitizeAndValidateOption(E,m){switch(E){case"cursorStyle":if(m||(m=c.DEFAULT_OPTIONS[E]),!(function(y){return y==="block"||y==="underline"||y==="bar"})(m))throw new Error(`"${m}" is not a valid value for ${E}`);break;case"wordSeparator":m||(m=c.DEFAULT_OPTIONS[E]);break;case"fontWeight":case"fontWeightBold":if(typeof m=="number"&&1<=m&&m<=1e3)break;m=C.includes(m)?m:c.DEFAULT_OPTIONS[E];break;case"cursorWidth":m=Math.floor(m);case"lineHeight":case"tabStopWidth":if(m<1)throw new Error(`${E} cannot be less than 1, value: ${m}`);break;case"minimumContrastRatio":m=Math.max(1,Math.min(21,Math.round(10*m)/10));break;case"scrollback":if((m=Math.min(m,4294967295))<0)throw new Error(`${E} cannot be less than 0, value: ${m}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(m<=0)throw new Error(`${E} cannot be less than or equal to 0, value: ${m}`);break;case"rows":case"cols":if(!m&&m!==0)throw new Error(`${E} must be numeric, value: ${m}`);break;case"windowsPty":m=m??{}}return m}}c.OptionsService=x},2660:function(g,c,u){var d=this&&this.__decorate||function(x,A,E,m){var y,f=arguments.length,b=f<3?A:m===null?m=Object.getOwnPropertyDescriptor(A,E):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(x,A,E,m);else for(var T=x.length-1;T>=0;T--)(y=x[T])&&(b=(f<3?y(b):f>3?y(A,E,b):y(A,E))||b);return f>3&&b&&Object.defineProperty(A,E,b),b},S=this&&this.__param||function(x,A){return function(E,m){A(E,m,x)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkService=void 0;const p=u(2585);let C=c.OscLinkService=class{constructor(x){this._bufferService=x,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(x){const A=this._bufferService.buffer;if(x.id===void 0){const T=A.addMarker(A.ybase+A.y),L={data:x,id:this._nextId++,lines:[T]};return T.onDispose((()=>this._removeMarkerFromLink(L,T))),this._dataByLinkId.set(L.id,L),L.id}const E=x,m=this._getEntryIdKey(E),y=this._entriesWithId.get(m);if(y)return this.addLineToLink(y.id,A.ybase+A.y),y.id;const f=A.addMarker(A.ybase+A.y),b={id:this._nextId++,key:this._getEntryIdKey(E),data:E,lines:[f]};return f.onDispose((()=>this._removeMarkerFromLink(b,f))),this._entriesWithId.set(b.key,b),this._dataByLinkId.set(b.id,b),b.id}addLineToLink(x,A){const E=this._dataByLinkId.get(x);if(E&&E.lines.every((m=>m.line!==A))){const m=this._bufferService.buffer.addMarker(A);E.lines.push(m),m.onDispose((()=>this._removeMarkerFromLink(E,m)))}}getLinkData(x){return this._dataByLinkId.get(x)?.data}_getEntryIdKey(x){return`${x.id};;${x.uri}`}_removeMarkerFromLink(x,A){const E=x.lines.indexOf(A);E!==-1&&(x.lines.splice(E,1),x.lines.length===0&&(x.data.id!==void 0&&this._entriesWithId.delete(x.key),this._dataByLinkId.delete(x.id)))}};c.OscLinkService=C=d([S(0,p.IBufferService)],C)},8343:(g,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 p=function(C,x,A){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(E,m,y){m[u]===m?m[d].push({id:E,index:y}):(m[d]=[{id:E,index:y}],m[u]=m)})(p,C,A)};return p.toString=()=>S,c.serviceRegistry.set(S,p),p}},2585:(g,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(p){p[p.TRACE=0]="TRACE",p[p.DEBUG=1]="DEBUG",p[p.INFO=2]="INFO",p[p.WARN=3]="WARN",p[p.ERROR=4]="ERROR",p[p.OFF=5]="OFF"})(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:(g,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const d=u(8460),S=u(225);class p{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,A,E=!1){return(16777215&x)<<3|(3&A)<<1|(E?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const x=new S.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let A=0,E=0;const m=x.length;for(let y=0;y<m;++y){let f=x.charCodeAt(y);if(55296<=f&&f<=56319){if(++y>=m)return A+this.wcwidth(f);const L=x.charCodeAt(y);56320<=L&&L<=57343?f=1024*(f-55296)+L-56320+65536:A+=this.wcwidth(L)}const b=this.charProperties(f,E);let T=p.extractWidth(b);p.extractShouldJoin(b)&&(T-=p.extractWidth(E)),A+=T,E=b}return A}charProperties(x,A){return this._activeProvider.charProperties(x,A)}}c.UnicodeService=p}},a={};function o(g){var c=a[g];if(c!==void 0)return c.exports;var u=a[g]={exports:{}};return r[g].call(u.exports,u,u.exports,o),u.exports}var h={};return(()=>{var g=h;Object.defineProperty(g,"__esModule",{value:!0}),g.Terminal=void 0;const c=o(9042),u=o(3236),d=o(844),S=o(5741),p=o(8285),C=o(7975),x=o(7090),A=["cols","rows"];class E extends d.Disposable{constructor(y){super(),this._core=this.register(new u.Terminal(y)),this._addonManager=this.register(new S.AddonManager),this._publicOptions={...this._core.options};const f=T=>this._core.options[T],b=(T,L)=>{this._checkReadonlyOptions(T),this._core.options[T]=L};for(const T in this._core.options){const L={get:f.bind(this,T),set:b.bind(this,T)};Object.defineProperty(this._publicOptions,T,L)}}_checkReadonlyOptions(y){if(A.includes(y))throw new Error(`Option "${y}" 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 x.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new p.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const y=this._core.coreService.decPrivateModes;let f="none";switch(this._core.coreMouseService.activeProtocol){case"X10":f="x10";break;case"VT200":f="vt200";break;case"DRAG":f="drag";break;case"ANY":f="any"}return{applicationCursorKeysMode:y.applicationCursorKeys,applicationKeypadMode:y.applicationKeypad,bracketedPasteMode:y.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:f,originMode:y.origin,reverseWraparoundMode:y.reverseWraparound,sendFocusMode:y.sendFocus,wraparoundMode:y.wraparound}}get options(){return this._publicOptions}set options(y){for(const f in y)this._publicOptions[f]=y[f]}blur(){this._core.blur()}focus(){this._core.focus()}input(y,f=!0){this._core.input(y,f)}resize(y,f){this._verifyIntegers(y,f),this._core.resize(y,f)}open(y){this._core.open(y)}attachCustomKeyEventHandler(y){this._core.attachCustomKeyEventHandler(y)}attachCustomWheelEventHandler(y){this._core.attachCustomWheelEventHandler(y)}registerLinkProvider(y){return this._core.registerLinkProvider(y)}registerCharacterJoiner(y){return this._checkProposedApi(),this._core.registerCharacterJoiner(y)}deregisterCharacterJoiner(y){this._checkProposedApi(),this._core.deregisterCharacterJoiner(y)}registerMarker(y=0){return this._verifyIntegers(y),this._core.registerMarker(y)}registerDecoration(y){return this._checkProposedApi(),this._verifyPositiveIntegers(y.x??0,y.width??0,y.height??0),this._core.registerDecoration(y)}hasSelection(){return this._core.hasSelection()}select(y,f,b){this._verifyIntegers(y,f,b),this._core.select(y,f,b)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(y,f){this._verifyIntegers(y,f),this._core.selectLines(y,f)}dispose(){super.dispose()}scrollLines(y){this._verifyIntegers(y),this._core.scrollLines(y)}scrollPages(y){this._verifyIntegers(y),this._core.scrollPages(y)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(y){this._verifyIntegers(y),this._core.scrollToLine(y)}clear(){this._core.clear()}write(y,f){this._core.write(y,f)}writeln(y,f){this._core.write(y),this._core.write(`\r
776
- `,f)}paste(y){this._core.paste(y)}refresh(y,f){this._verifyIntegers(y,f),this._core.refresh(y,f)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(y){this._addonManager.loadAddon(this,y)}static get strings(){return c}_verifyIntegers(...y){for(const f of y)if(f===1/0||isNaN(f)||f%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...y){for(const f of y)if(f&&(f===1/0||isNaN(f)||f%1!=0||f<0))throw new Error("This API only accepts positive integers")}}g.Terminal=E})(),h})()))})(Dp)),Dp.exports}var e7=QI();const Jy=250,t7=5e3,Qy=1,n7=4e3,i7=4001;function r7(e){const n=new AbortController,r=new TextEncoder;let a=Jy,o=null,h=null,g=null,c=!1;const u=()=>{h?.dispose(),h=null},d=(C,x)=>{g={cols:C,rows:x},o?.readyState===Qy&&o.send(JSON.stringify({type:"resize",cols:C,rows:x}))},S=async()=>{for(;!n.signal.aborted;){e.onStatus?.("connecting");try{const C=e.fetchTicket??XA,{ticket:x}=await C(e.sessionId,{kind:e.kind,theaterId:e.theaterId,signal:n.signal});if(n.signal.aborted)return;await p(s7(x,e.location),e),a=Jy}catch(C){if(n.signal.aborted)return;e.onStatus?.("connecting",C instanceof Error?C.message:String(C))}await o7(a,n.signal),a=Math.min(a*2,t7)}},p=async(C,x)=>{await new Promise((A,E)=>{const m=(x.webSocketFactory??a7)(C);o=m,m.binaryType="arraybuffer",m.onopen=()=>{x.onStatus?.("live"),u(),h=x.terminal.onData(y=>{m.readyState===Qy&&m.send(r.encode(y))}),g&&d(g.cols,g.rows)},m.onmessage=y=>{y.data instanceof ArrayBuffer&&x.terminal.write(new Uint8Array(y.data))},m.onerror=()=>{E(new Error("Terminal WebSocket error"))},m.onclose=y=>{u(),o===m&&(o=null);const f=y?.code;f===n7?n.abort():f===i7&&(n.abort(),x.onExit?.()),A()}})};return{start:()=>{c||(c=!0,S())},resize:d,dispose:()=>{n.abort(),u(),e.onStatus?.("closed"),o?.close(),o=null}}}function s7(e,n=window.location){return`${n.protocol==="https:"?"wss":"ws"}://${n.host}/terminal/ws?ticket=${encodeURIComponent(e)}`}function a7(e){return new WebSocket(e)}async function o7(e,n){await new Promise(r=>{const a=()=>{clearTimeout(o),n.removeEventListener("abort",a),r()},o=setTimeout(a,e);n.addEventListener("abort",a)})}const l7={allowProposedApi:!0,convertEol:!0,cursorBlink:!0,cursorStyle:"block",lineHeight:1.2},c7=80,u7=120,h7={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)"},d7={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 i2({sessionId:e,kind:n,theaterId:r,onExit:a,active:o,zoom:h=1}){const{activeTheme:g,terminalRenderer:c,terminalFont:u}=yo(),d=$.useRef(null),S=$.useRef(null),p=$.useRef(null),C=$.useRef(null),x=$.useRef(null),[A,E]=$.useState(h),m=$.useRef(a);m.current=a;const y=$.useRef(o);y.current=o;const[f,b]=$.useState("connecting");$.useEffect(()=>{const R=d.current;if(!R)return;let M=!1;const k=new e7.Terminal({...l7,fontFamily:u.family,fontSize:u.size*A,theme:eS(g)});S.current=k;const I=new p8.FitAddon;x.current=I,k.loadAddon(I),k.open(R),k.loadAddon(new _8.Unicode11Addon),k.unicode.activeVersion="11",k.attachCustomKeyEventHandler(K=>K.key==="Enter"&&K.shiftKey?(K.type==="keydown"&&k.input(`
777
- `),!1):!0);const G=r7({sessionId:e,kind:n,theaterId:r,terminal:k,onExit:()=>m.current?.(),onStatus:(K,X)=>{b(X?`${K}: ${X}`:K)}});p.current=G;let q=null;const W=()=>{I.fit(),G.resize(k.cols,k.rows)},j=()=>{W(),k.refresh(0,k.rows-1)},V=()=>{q&&clearTimeout(q),q=setTimeout(()=>{q=null,M||j()},c7)},U=async()=>{await document.fonts?.ready,!M&&(W(),G.start(),y.current!==!1&&k.focus())},F=new ResizeObserver(V);return F.observe(R),U(),()=>{M=!0,F.disconnect(),q&&clearTimeout(q),G.dispose(),S.current=null,p.current=null,x.current=null;try{k.dispose()}catch{}}},[n,e,r]),$.useEffect(()=>{o&&S.current?.focus()},[o]),$.useEffect(()=>{const R=S.current;if(!R)return;let M=!1;if(c==="webgl")try{const k=new JI;C.current=k,k.onContextLoss(()=>{if(!M){try{k.dispose()}catch{}C.current===k&&(C.current=null)}}),R.loadAddon(k)}catch{try{C.current?.dispose()}catch{}C.current=null}return()=>{M=!0;const k=C.current;if(k){C.current=null;try{k.dispose()}catch{}}}},[c,n,e]),$.useEffect(()=>{const R=S.current;R&&(R.options.theme=eS(g))},[g]),$.useEffect(()=>{const R=S.current;R&&(R.options.fontFamily=u.family,tS(R,x.current,p.current))},[u.family]),$.useEffect(()=>{if(h===A)return;const R=setTimeout(()=>E(h),u7);return()=>clearTimeout(R)},[h,A]),$.useEffect(()=>{const R=S.current;R&&(R.options.fontSize=u.size*A,tS(R,x.current,p.current))},[A,u.size]);const T=f.startsWith("live"),L=A===1?void 0:{width:`${A*100}%`,height:`${A*100}%`,transform:`scale(${1/A})`,transformOrigin:"0 0"};return v.jsx("section",{className:"terminal-stage","aria-label":n==="shell"?"Shell terminal":"Fleet terminal",children:v.jsxs("div",{className:"terminal-shell",children:[T?null:v.jsxs("div",{className:"terminal-status","aria-live":"polite",children:[v.jsx("span",{className:"terminal-status-dot","aria-hidden":"true"}),f]}),v.jsx("div",{className:"terminal-viewport",children:v.jsx("div",{className:"terminal-canvas",ref:d,style:L})})]})})}function eS(e){return e==="carbon"?d7:h7}function tS(e,n,r){n?.fit(),r?.resize(e.cols,e.rows),e.refresh(0,e.rows-1)}const f7=["n","ne","e","se","s","sw","w","nw"],Op=320,Np=200;function r2({geometry:e,zoom:n,onResize:r}){const a=$.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)},h=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(p7(u.geometry,u.direction,d,S))},g=c=>{a.current?.pointerId===c.pointerId&&(c.preventDefault(),c.stopPropagation(),a.current=null,c.currentTarget.releasePointerCapture(c.pointerId))};return v.jsx(v.Fragment,{children:f7.map(c=>v.jsx("div",{className:`canvas-panel-resize canvas-panel-resize--${c}`,onPointerDown:u=>o(c,u),onPointerMove:h,onPointerUp:g,onPointerCancel:g,"data-canvas-blocker":!0,"aria-hidden":"true"},c))})}function p7(e,n,r,a){let{x:o,y:h,width:g,height:c}=e;return n.includes("e")&&(g+=r),n.includes("s")&&(c+=a),n.includes("w")&&(o+=r,g-=r),n.includes("n")&&(h+=a,c-=a),g<Op&&(n.includes("w")&&(o-=Op-g),g=Op),c<Np&&(n.includes("n")&&(h-=Np-c),c=Np),{...e,x:o,y:h,width:g,height:c}}const zm=new Set,nS=96,m7=.25,g7=1;let Un=null,Es=null;const Xl=new Map;function _7(){return $.useSyncExternalStore(E7,$m,$m)}function $m(){return Un}function v7(e){T7(),Es=e;const n=e?Xl.get(e)??null:null;Un!==n&&(Un=n,Pg())}function b7(e){Es&&Xl.set(Es,e),Un!==e&&(Un=e,Pg())}function Ni(){Es&&Xl.delete(Es),Un!==null&&(Un=null,Pg())}function Yu(e){return{kind:"operation",id:e,createdAt:0}}function Xu(e){return{kind:"shell",id:e,createdAt:0}}function Nh(e){const n=eh(),r=e.filter(o=>n.panels[o]).map(o=>({kind:"operation",id:o,createdAt:n.panelCreatedAt[o]??0})),a=Object.entries(Sw()).map(([o,h])=>({kind:"shell",id:o,createdAt:h.createdAt}));return A7([...r,...a],n.panelOrder)}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 so(e,n){if(e.kind==="operation"){ti(e.id),GS(e.id,n);return}const r=Sw()[e.id];if(!r)return;ww(e.id),ti(null),po(e.id);const a=Ts();Pu(e.id,{...r.geometry,zIndex:a}),US(k7(r.geometry,n))}function S7(e,n,r){if(Un!==null){Ul(e,n);return}so(e,r)}function jg(e){if(Un===e.id&&Ni(),e.kind==="operation"){iA(e.id);return}Dk(e.id)}function w7(e){if(Ni(),e.kind==="operation"){rA(e.id),ti(e.id);return}ww(e.id),ti(null),po(e.id)}function Ul(e,n){for(const r of n)r.id!==e.id&&jg(r);w7(e),b7(e.id)}function C7(e){if(e.kind==="operation"){nh(e.id).then(()=>og(e.id)).catch(n=>rh(n instanceof Error?n.message:String(n))),Un===e.id&&Ni();return}Qp(e.id),sA(e.id),nh(e.id).catch(n=>{rh(n instanceof Error?n.message:String(n))}),Un===e.id&&Ni()}function x7(e,n){return!n.operationSessionsHydrated||!n.theaterReady||Un===null||Nh(e).some(r=>r.id===Un)?!1:(Ni(),!0)}function E7(e){return zm.add(e),()=>{zm.delete(e)}}function Pg(){for(const e of zm)e()}function T7(){Es&&(Un?Xl.set(Es,Un):Xl.delete(Es))}function A7(e,n){if(n.length===0)return[...e].sort(iS);const r=new Map(n.map((a,o)=>[a,o]));return[...e].sort((a,o)=>{const h=r.get(a.id),g=r.get(o.id);return h!==void 0&&g!==void 0?h-g:h!==void 0?-1:g!==void 0?1:iS(a,o)})}function iS(e,n){return e.createdAt-n.createdAt||e.id.localeCompare(n.id)}function k7(e,n){const r=Math.max(m7,Math.min(g7,Math.min((n.width-nS)/e.width,(n.height-nS)/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 rS({state:e,session:n,geometry:r,viewport:a,active:o,maximized:h=!1,onFocusRequest:g,onMaximize:c}){const u=$.useRef(null),[d,S]=$.useState(!1),[p,C]=$.useState(""),x=$.useRef(null),A=$.useRef(!1),E=$.useRef(!1),y=Kw(e,n).filter(({job:B})=>!eg(B.status)).map(({job:B})=>B),f=y.length,b=n.status==="dormant",T=wh(n),L=e.operationNotifications[n.sessionId]?.kind==="input-waiting",R=b?null:L?"awaiting":f>0?"live":n.turnState==="running"?"turn":null,M=()=>{ti(n.sessionId),h||jl(n.sessionId,r)},k=B=>{o||ti(n.sessionId),Ww(B)},I=B=>{B.button===0&&(h||(B.preventDefault(),B.stopPropagation(),M(),u.current={pointerId:B.pointerId,startX:B.clientX,startY:B.clientY,geometry:r},B.currentTarget.setPointerCapture(B.pointerId)))},G=B=>{const N=u.current;!N||N.pointerId!==B.pointerId||(B.preventDefault(),B.stopPropagation(),jl(n.sessionId,{...N.geometry,x:N.geometry.x+(B.clientX-N.startX)/a.zoom,y:N.geometry.y+(B.clientY-N.startY)/a.zoom}))},q=B=>{u.current?.pointerId===B.pointerId&&(B.preventDefault(),B.stopPropagation(),u.current=null,B.currentTarget.releasePointerCapture(B.pointerId))},W=B=>{B.stopPropagation()};$.useEffect(()=>{d&&(x.current?.focus(),x.current?.select())},[d]);const j=()=>{M(),E.current=!1,C(T),S(!0)},V=()=>{E.current=!0,S(!1),C("")},U=async()=>{if(!A.current){A.current=!0;try{Eh(await KA(n.sessionId,p))}catch(B){bR(B instanceof Error?B.message:String(B))}finally{A.current=!1,E.current=!0,S(!1)}}},F=B=>{if(B.key==="Enter"){B.preventDefault(),U();return}B.key==="Escape"&&(B.preventDefault(),V())},K=B=>{B.stopPropagation(),M()},X=B=>{B.stopPropagation(),M()},D=B=>{B.stopPropagation()};return v.jsxs(v.Fragment,{children:[v.jsxs("article",{className:`canvas-panel ${o?"is-active":""} ${R?`is-running is-running--${R}`:""}`,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:[v.jsxs("div",{className:"canvas-panel-titlebar",onPointerDown:I,onPointerMove:G,onPointerUp:q,onPointerCancel:q,onDoubleClick:g,"data-canvas-blocker":!0,children:[v.jsx("span",{className:vw(n,f),"aria-hidden":"true"}),d?v.jsx("input",{ref:x,className:"canvas-panel-rename-input",value:p,"aria-label":`${T} 이름 변경`,onPointerDown:B=>B.stopPropagation(),onChange:B=>C(B.target.value),onKeyDown:F,onBlur:()=>{if(E.current){E.current=!1;return}U()}}):v.jsx("span",{className:"canvas-panel-title",onPointerDown:K,onDoubleClick:B=>{B.stopPropagation(),j()},title:"Double-click to rename",children:T}),v.jsx("span",{className:"canvas-panel-cli",children:n.cliLabel??n.cliId??"CLI"}),f>0?v.jsx("span",{className:"canvas-panel-job-count",children:f}):null,v.jsx("button",{type:"button",className:"canvas-panel-icon-button",onPointerDown:W,onClick:()=>{jg(Yu(n.sessionId))},"aria-label":`Minimize operation ${T}`,title:"Minimize panel",children:v.jsx(M7,{})}),v.jsx("button",{type:"button",className:`canvas-panel-icon-button ${h?"is-active":""}`,onPointerDown:W,onClick:c,"aria-label":h?`Restore operation ${T}`:`Maximize operation ${T}`,title:h?"Restore panel":"Maximize panel",children:v.jsx(D7,{})}),v.jsx("button",{type:"button",className:"canvas-panel-icon-button",onPointerDown:W,onClick:()=>{h&&Ni(),L7(n.sessionId)},"aria-label":`${b?"Forget":"Terminate"} operation ${T}`,title:b?"Forget operation":"Terminate operation",children:v.jsx(O7,{})})]}),v.jsx("div",{className:"canvas-panel-terminal",onPointerDown:X,onWheel:D,"data-canvas-blocker":!0,children:b?v.jsxs("button",{type:"button",className:"canvas-panel-dormant",onClick:()=>{R7(n.sessionId)},children:[v.jsx("span",{className:"canvas-panel-dormant-status",children:"Dormant"}),v.jsx("span",{className:"canvas-panel-dormant-action",children:"Resume"})]}):v.jsx(i2,{sessionId:n.sessionId,active:o,zoom:a.zoom,onExit:()=>{h&&Ni(),og(n.sessionId)}})}),v.jsx(r2,{geometry:r,zoom:a.zoom,onResize:B=>jl(n.sessionId,B)})]}),y.length>0?v.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:v.jsx(h8,{jobs:y,selectedJobId:e.selectedJobId,onSelect:k})}):null]})}async function R7(e){try{const n=await hw(e);Eh(n),ti(n.sessionId)}catch(n){qw(n instanceof Error?n.message:String(n))}}async function L7(e){try{await nh(e)}catch(n){rh(n instanceof Error?n.message:String(n));return}og(e)}function M7(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.jsx("path",{d:"M3.5 11.5h9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function D7(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.jsx("path",{d:"M4.2 4.2h7.6v7.6H4.2z",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinejoin:"round"})})}function O7(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.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 N7(e,n,r,a){if(!r)return 0;const o=Array.from(r.querySelectorAll("[data-dock-chip-id]"));for(const h of o){const g=h.dataset.dockChipId;if(!g||g===a)continue;const c=h.getBoundingClientRect();if(e<=c.left+c.width/2)return Math.max(0,n.indexOf(g))}return n.length}const I7={overflow:!1,atStart:!1,atEnd:!0,page:1,pages:1},B7=1500,j7=6,sS=34,aS=18,s2=[{key:"red",label:"Red",color:"oklch(70% 0.12 25)"},{key:"orange",label:"Orange",color:"oklch(73% 0.12 50)"},{key:"amber",label:"Amber",color:"oklch(78% 0.11 70)"},{key:"yellow",label:"Yellow",color:"oklch(84% 0.11 95)"},{key:"lime",label:"Lime",color:"oklch(81% 0.12 120)"},{key:"green",label:"Green",color:"oklch(74% 0.12 145)"},{key:"emerald",label:"Emerald",color:"oklch(73% 0.10 165)"},{key:"teal",label:"Teal",color:"oklch(74% 0.09 185)"},{key:"cyan",label:"Cyan",color:"oklch(76% 0.09 205)"},{key:"sky",label:"Sky",color:"oklch(74% 0.10 230)"},{key:"blue",label:"Blue",color:"oklch(70% 0.11 255)"},{key:"indigo",label:"Indigo",color:"oklch(68% 0.11 278)"},{key:"violet",label:"Violet",color:"oklch(70% 0.11 300)"},{key:"purple",label:"Purple",color:"oklch(70% 0.12 320)"},{key:"magenta",label:"Magenta",color:"oklch(71% 0.12 340)"},{key:"rose",label:"Rose",color:"oklch(72% 0.11 5)"}];function P7({state:e,sessions:n,canvasSize:r,minimizedIds:a}){const o=$.useRef(null),h=$.useRef(!0),g=$.useRef(null),[c,u]=$.useState(I7),[d,S]=$.useState(null),[p,C]=$.useState(null),[x,A]=$.useState(null),[E,m]=$.useState(""),y=$S(),f=yw(),b=new Map(n.map(ee=>[ee.sessionId,ee])),T=n.map(ee=>ee.sessionId),L=Nh(T),R=new Set(a),M=L.map(ee=>{const ce=b.get(ee.id);if(!ce)return{handle:ee,label:"Shell",meta:"shell",beaconClassName:"tenant-beacon is-live",activeJobCount:0,underway:null,showRing:!1,active:f===ee.id};const Y=Kw(e,ce).filter(({job:re})=>!eg(re.status)).length,P=ce.status==="dormant"?null:Y>0?"live":ce.turnState==="running"?"turn":null;return{handle:ee,label:wh(ce),meta:ce.cliLabel??ce.cliId??"CLI",beaconClassName:vw(ce,Y),activeJobCount:Y,underway:P,showRing:P!==null&&R.has(ee.id),active:e.activeTerminalSessionId===ce.sessionId}}).filter(ee=>!!ee),k=M.map(ee=>ee.handle.id).join(","),I=M.map(ee=>`${ee.label}${ee.meta}${ee.activeJobCount}`).join(""),G=p?M.findIndex(ee=>ee.handle.id===p.sourceId):-1,q=$.useCallback(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},[]),W=$.useCallback(()=>{q(),S(null)},[q]),j=$.useCallback(ee=>{q(),S(ee),g.current=window.setTimeout(()=>{g.current=null,S(null)},B7)},[q]),V=$.useCallback(()=>{const ee=o.current;if(!ee)return;const{scrollLeft:ce,clientWidth:Y,scrollWidth:P}=ee,re=Math.max(0,P-Y),fe=Y>0&&re>1,Se=fe?Math.max(1,Math.ceil(P/Y)):1,ye=ce>=re-1,Pe=fe?ye?1:Math.min(Se,Math.ceil((re-ce)/Y)+1):1;u({overflow:fe,atStart:ce<=1,atEnd:ye,page:Pe,pages:Se})},[]);if($.useEffect(()=>{const ee=o.current;if(!ee)return;h.current=!0,ee.scrollLeft=ee.scrollWidth,V();const ce=typeof ResizeObserver<"u"?new ResizeObserver(()=>{h.current&&(ee.scrollLeft=ee.scrollWidth),V()}):null;ce?.observe(ee);const Y=()=>{const P=Math.max(0,ee.scrollWidth-ee.clientWidth);h.current=ee.scrollLeft>=P-1,V()};return ee.addEventListener("scroll",Y,{passive:!0}),()=>{ce?.disconnect(),ee.removeEventListener("scroll",Y)}},[k,V]),$.useEffect(()=>q,[q]),$.useEffect(()=>{const ee=o.current;ee&&(h.current&&(ee.scrollLeft=ee.scrollWidth),V())},[I,V]),$.useEffect(()=>{d!==null&&(M.some(ee=>ee.handle.id===d)||W())},[d,M,W]),$.useEffect(()=>{if(x===null)return;const ee=P=>{P.target instanceof Element&&P.target.closest(".canvas-dock-accent-popover, .canvas-dock-accent-trigger")||A(null)},ce=()=>A(null),Y=o.current;return window.addEventListener("pointerdown",ee,!0),window.addEventListener("resize",ce),Y?.addEventListener("scroll",ce,{passive:!0}),()=>{window.removeEventListener("pointerdown",ee,!0),window.removeEventListener("resize",ce),Y?.removeEventListener("scroll",ce)}},[x]),M.length===0)return null;const U=c.overflow,F=ee=>{const ce=o.current;if(!ce)return;const Y=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;ce.scrollBy({left:ee*ce.clientWidth,behavior:Y?"auto":"smooth"})},K=M.map(ee=>ee.handle.id),X=(ee,ce)=>{const Y=M.find(P=>P.handle.id===ee);m(`${Y?.label??"Window"} moved to position ${ce+1} of ${M.length}.`)},D=(ee,ce)=>{const Y=K.indexOf(ee);if(Y===-1)return;const P=Math.max(0,Math.min(K.length-1,Y+ce));if(P===Y)return;const re=[...K],[fe]=re.splice(Y,1);fe!==void 0&&(re.splice(P,0,fe),Bb(re),X(ee,P))},B=(ee,ce)=>{ee.button===0&&(ee.target instanceof Element&&ee.target.closest("button")||(ee.currentTarget.setPointerCapture(ee.pointerId),A(null),C({sourceId:ce,pointerId:ee.pointerId,startX:ee.clientX,startY:ee.clientY,currentX:ee.clientX,dragging:!1,dropIndex:K.indexOf(ce)})))},N=ee=>{if(!p||p.pointerId!==ee.pointerId)return;const ce=Math.hypot(ee.clientX-p.startX,ee.clientY-p.startY);if(!p.dragging&&ce<j7)return;const Y=N7(ee.clientX,K,o.current,p.sourceId);U7(ee.clientX,o.current),C({...p,currentX:ee.clientX,dragging:!0,dropIndex:Y})},H=ee=>{if(!p||p.pointerId!==ee.pointerId)return;ee.currentTarget.hasPointerCapture(ee.pointerId)&&ee.currentTarget.releasePointerCapture(ee.pointerId);const{sourceId:ce,dragging:Y,dropIndex:P}=p;if(C(null),!Y)return;const re=K.indexOf(ce);if(re===-1||P===re)return;const fe=H7(K,ce,P);Bb(fe),X(ce,fe.indexOf(ce))},Q=ee=>{p&&ee.currentTarget.hasPointerCapture(ee.pointerId)&&ee.currentTarget.releasePointerCapture(ee.pointerId),C(null)},le=(ee,ce)=>{FS(ee,ce),b.has(ee)&&VA(ee,ce).catch(()=>{}),A(null)};return v.jsx("div",{className:"canvas-dock is-taskbar","data-canvas-blocker":!0,children:v.jsxs("div",{className:"canvas-dock-rail",role:"toolbar","aria-label":"Open windows",children:[U?v.jsx("button",{type:"button",className:"canvas-dock-pager canvas-dock-pager--prev",onClick:()=>F(-1),disabled:c.atStart,"aria-label":"Show older windows",title:"Older",children:v.jsx(oS,{direction:"prev"})}):null,v.jsx("div",{className:"canvas-dock-chips",ref:o,children:M.map((ee,ce)=>{const Y=y.panelAccent[ee.handle.id]??null,P=Y?$7(Y):null;return v.jsx(z7,{entry:ee,index:ce,canvasSize:r,allHandles:L,isCloseArmed:d===ee.handle.id,onArmClose:j,onDisarmClose:W,accentKey:P?Y:null,accentValue:P,accentMenuOpen:x===ee.handle.id,dragging:p?.sourceId===ee.handle.id&&p.dragging,dragOffsetX:p?.sourceId===ee.handle.id&&p.dragging?p.currentX-p.startX:0,dropTarget:p?.dragging===!0&&p.dropIndex===ce&&G!==ce,onKeyboardMove:D,onPointerDragStart:B,onPointerDragMove:N,onPointerDragEnd:H,onPointerDragCancel:Q,onOpenAccentMenu:A,onSetAccent:le},ee.handle.id)})}),U?v.jsx("button",{type:"button",className:"canvas-dock-pager canvas-dock-pager--next",onClick:()=>F(1),disabled:c.atEnd,"aria-label":"Show newer windows",title:"Newer",children:v.jsx(oS,{direction:"next"})}):null,U?v.jsxs("span",{className:"canvas-dock-page","aria-label":`Page ${c.page} of ${c.pages}`,children:[c.page,"/",c.pages]}):null,v.jsx("span",{className:"sr-only","aria-live":"polite",children:E})]})})}function z7({entry:e,index:n,canvasSize:r,allHandles:a,isCloseArmed:o,onArmClose:h,onDisarmClose:g,accentKey:c,accentValue:u,accentMenuOpen:d,dragging:S,dragOffsetX:p,dropTarget:C,onKeyboardMove:x,onPointerDragStart:A,onPointerDragMove:E,onPointerDragEnd:m,onPointerDragCancel:y,onOpenAccentMenu:f,onSetAccent:b}){const T=$.useRef(!1),L=$.useRef(null),[R,M]=$.useState(void 0);$.useLayoutEffect(()=>{if(!d||!L.current)return;const U=L.current.getBoundingClientRect();M({position:"fixed",left:Math.max(8,U.left),top:"auto",bottom:Math.round(window.innerHeight-U.top+8)})},[d]);const k=["canvas-dock-chip",e.active?"canvas-dock-chip--active":"",e.underway?`canvas-dock-chip--underway canvas-dock-chip--underway-${e.underway}`:"",e.showRing?"canvas-dock-chip--underway-ring":"",S?"canvas-dock-chip--dragging":"",C?"canvas-dock-chip--drop-target":""].filter(Boolean).join(" "),I=["canvas-dock-chip-close",o?"is-armed":""].filter(Boolean).join(" "),G={"--i":n,...u?{"--chip-accent":u}:{},...S?{"--drag-dx":`${Math.round(p)}px`}:{}},q=()=>{if(g(),T.current){T.current=!1;return}S7(e.handle,a,r)},W=U=>{U.stopPropagation()},j=U=>{if(U.stopPropagation(),!o){h(e.handle.id);return}g(),C7(e.handle)},V=U=>{U.preventDefault(),U.stopPropagation(),f(e.handle.id)};return v.jsxs("div",{"data-dock-chip-id":e.handle.id,className:k,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:G,onClick:q,onFocus:()=>{o||g()},onContextMenu:V,onPointerDown:U=>A(U,e.handle.id),onPointerMove:U=>{U.currentTarget.hasPointerCapture(U.pointerId)&&(U.preventDefault(),U.stopPropagation())},onPointerUp:U=>{S&&(T.current=!0),U.currentTarget.hasPointerCapture(U.pointerId)&&U.stopPropagation()},onKeyDown:U=>{if(U.target===U.currentTarget){if(U.altKey&&U.shiftKey&&(U.key==="ArrowLeft"||U.key==="ArrowRight")){U.preventDefault(),x(e.handle.id,U.key==="ArrowLeft"?-1:1);return}(U.key==="Enter"||U.key===" ")&&(U.preventDefault(),q())}},onPointerMoveCapture:U=>E(U),onPointerUpCapture:U=>m(U),onPointerCancelCapture:U=>y(U),children:[v.jsx("span",{className:e.beaconClassName,"aria-hidden":"true"}),v.jsx("span",{className:"canvas-dock-chip-name",children:e.label}),v.jsx("span",{className:"canvas-dock-chip-cli",children:e.meta}),e.activeJobCount>0?v.jsx("span",{className:"canvas-dock-chip-count",children:e.activeJobCount}):null,v.jsx("button",{ref:L,type:"button",className:"canvas-dock-accent-trigger",onPointerDown:W,onClick:V,"aria-label":`Accent ${e.label}`,title:"Accent",children:v.jsx("span",{style:u?{background:u}:void 0})}),d&&R?BS.createPortal(v.jsxs("div",{className:"canvas-dock-accent-popover",role:"menu","aria-label":`Accent ${e.label}`,style:R,onPointerDown:U=>U.stopPropagation(),children:[v.jsxs("button",{type:"button",className:"canvas-dock-accent-swatch canvas-dock-accent-swatch--clear",role:"menuitem","aria-label":"No accent","aria-pressed":c===null,onClick:U=>{U.stopPropagation(),b(e.handle.id,null)},children:[v.jsx("span",{}),"None"]}),s2.map(U=>v.jsx("button",{type:"button",className:"canvas-dock-accent-swatch",role:"menuitem","aria-label":U.label,"aria-pressed":c===U.key,onClick:F=>{F.stopPropagation(),b(e.handle.id,U.key)},children:v.jsx("span",{style:{background:U.color}})},U.key))]}),document.body):null,v.jsx("button",{type:"button",className:I,onPointerDown:W,onClick:j,"aria-label":o?`Confirm close ${e.label}`:`Close ${e.label}`,title:o?"Confirm close":"Close",children:o?"Close?":v.jsx(F7,{})})]})}function $7(e){return s2.find(n=>n.key===e)?.color??null}function H7(e,n,r){const a=e.indexOf(n);if(a===-1)return[...e];const o=e.filter(c=>c!==n),h=r>a?r-1:r,g=Math.max(0,Math.min(h,o.length));return o.splice(g,0,n),o}function U7(e,n){if(!n)return;const r=n.getBoundingClientRect();e<r.left+sS?n.scrollLeft-=aS:e>r.right-sS&&(n.scrollLeft+=aS)}function F7(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.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 oS({direction:e}){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.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 q7="is-animation-paused";function W7({viewport:e,backgroundAnimationEnabled:n}){const[r,a]=$.useState(()=>document.hidden);return $.useEffect(()=>{function o(){a(document.hidden)}return document.addEventListener("visibilitychange",o),()=>{document.removeEventListener("visibilitychange",o)}},[]),v.jsxs("div",{className:"operations-canvas-background","aria-hidden":"true",children:[v.jsx("div",{className:"operations-canvas-sea"}),v.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?v.jsxs("div",{className:`operations-radar${r?` ${q7}`:""}`,children:[v.jsx("span",{className:"operations-radar-ring operations-radar-ring--outer"}),v.jsx("span",{className:"operations-radar-ring operations-radar-ring--middle"}),v.jsx("span",{className:"operations-radar-ring operations-radar-ring--inner"}),v.jsx("span",{className:"operations-radar-sweep"})]}):null]})}const a2="fleet-console.map.shortcutsCollapsed",lS=aC.find(e=>e.title==="Map")??null;function G7(){const[e,n]=$.useState(K7);if(!lS)return null;const r=()=>{n(a=>{const o=!a;return V7(o),o})};return e?v.jsx("button",{type:"button",className:"map-shortcuts-fab","data-canvas-blocker":!0,onClick:r,"aria-label":"맵 단축키 보기",title:"Map shortcuts",children:v.jsx(Y7,{})}):v.jsxs("aside",{className:"map-shortcuts","data-canvas-blocker":!0,"aria-label":"Map shortcuts",children:[v.jsxs("div",{className:"map-shortcuts-head",children:[v.jsx("span",{className:"map-shortcuts-label",children:"Shortcuts"}),v.jsx("button",{type:"button",className:"map-shortcuts-toggle",onClick:r,"aria-label":"맵 단축키 접기",title:"Collapse",children:v.jsx(X7,{})})]}),v.jsx("dl",{className:"map-shortcuts-list",children:lS.entries.map(a=>v.jsxs("div",{className:"map-shortcuts-entry",children:[v.jsx("dt",{className:"map-shortcuts-combos",children:a.combos.map((o,h)=>v.jsxs("span",{className:"map-shortcuts-combo",children:[h>0?v.jsx("span",{className:"map-shortcuts-or",children:"or"}):null,v.jsx("span",{className:"map-shortcuts-keyset",children:o.map(g=>v.jsx("kbd",{children:g},g))})]},o.join("+")))}),v.jsx("dd",{children:a.description})]},a.description))})]})}function K7(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(a2)==="true"}catch{return!1}}function V7(e){if(!(typeof window>"u"))try{window.localStorage.setItem(a2,String(e))}catch{}}function Y7(){return v.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[v.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),v.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"}),v.jsx("circle",{cx:"8",cy:"11.4",r:".8",fill:"currentColor"})]})}function X7(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.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 Z7(e,n){return{x:e.x*n.zoom+n.x,y:e.y*n.zoom+n.y}}function Zl(e,n){return{x:(e.x-n.x)/n.zoom,y:(e.y-n.y)/n.zoom}}function J7(e,n){return{...Z7(e,n),width:e.width*n.zoom,height:e.height*n.zoom}}function Q7({rect:e,viewport:n}){const r=J7(e,n);return v.jsx("div",{className:"canvas-rubber-band",style:{left:r.x,top:r.y,width:r.width,height:r.height},"aria-hidden":"true"})}function cS({id:e,theaterId:n,geometry:r,viewport:a,active:o,minimized:h=!1,maximized:g=!1,onFocusRequest:c,onMaximize:u}){const d=$.useRef(null),S=()=>{ti(null),po(e),g||Pu(e,{...r,zIndex:Ts()})},p=f=>{f.button===0&&(g||(f.preventDefault(),f.stopPropagation(),S(),d.current={pointerId:f.pointerId,startX:f.clientX,startY:f.clientY,geometry:r},f.currentTarget.setPointerCapture(f.pointerId)))},C=f=>{const b=d.current;!b||b.pointerId!==f.pointerId||(f.preventDefault(),f.stopPropagation(),Pu(e,{...b.geometry,x:b.geometry.x+(f.clientX-b.startX)/a.zoom,y:b.geometry.y+(f.clientY-b.startY)/a.zoom}))},x=f=>{d.current?.pointerId===f.pointerId&&(f.preventDefault(),f.stopPropagation(),d.current=null,f.currentTarget.releasePointerCapture(f.pointerId))},A=f=>{f.stopPropagation()},E=f=>{f.stopPropagation(),S()},m=f=>{f.stopPropagation()},y=()=>{g&&Ni(),Qp(e),nh(e).catch(f=>{rh(f instanceof Error?f.message:String(f))})};return v.jsxs("article",{className:`canvas-panel canvas-panel--shell ${h?"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:h,"aria-label":"Shell panel",children:[v.jsxs("div",{className:"canvas-panel-titlebar",onPointerDown:p,onPointerMove:C,onPointerUp:x,onPointerCancel:x,onDoubleClick:c,"data-canvas-blocker":!0,children:[v.jsx("span",{className:"tenant-beacon is-live","aria-hidden":"true"}),v.jsx("span",{className:"canvas-panel-title",children:"Shell"}),v.jsx("span",{className:"canvas-panel-cli",children:"shell"}),v.jsx("button",{type:"button",className:"canvas-panel-icon-button",onPointerDown:A,onClick:()=>{jg(Xu(e))},"aria-label":"Minimize shell panel",title:"Minimize panel",children:v.jsx(tB,{})}),v.jsx("button",{type:"button",className:`canvas-panel-icon-button ${g?"is-active":""}`,onPointerDown:A,onClick:u,"aria-label":g?"Restore shell panel":"Maximize shell panel",title:g?"Restore panel":"Maximize panel",children:v.jsx(nB,{})}),v.jsx("button",{type:"button",className:"canvas-panel-icon-button",onPointerDown:A,onClick:y,"aria-label":"Close shell panel",title:"Close shell",children:v.jsx(eB,{})})]}),v.jsx("div",{className:"canvas-panel-terminal",onPointerDown:E,onWheel:m,"data-canvas-blocker":!0,children:v.jsx(i2,{sessionId:e,kind:"shell",theaterId:n,active:o,zoom:a.zoom,onExit:()=>{g&&Ni(),Qp(e)}})}),v.jsx(r2,{geometry:r,zoom:a.zoom,onResize:f=>Pu(e,f)})]})}function eB(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.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 tB(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.jsx("path",{d:"M3.5 11.5h9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function nB(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.jsx("path",{d:"M4.2 4.2h7.6v7.6H4.2z",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinejoin:"round"})})}const iB=.25,rB=2,sB=200,aB=150,uS=5,oB=.0018;function lB({viewport:e,disabled:n=!1,consumePointerDown:r=!1,onViewportChange:a,onZoom:o,onCreate:h,onConsumePointerDown:g,onClick:c}){const u=$.useRef(null),d=$.useRef(e),[S,p]=$.useState(null),[C,x]=$.useState(!1),[A,E]=$.useState(!1);$.useEffect(()=>{d.current=e},[e]),$.useEffect(()=>{const R=k=>{k.key==="Shift"&&E(!0),!cB(k.target)&&k.code==="Space"&&(k.preventDefault(),x(!0))},M=k=>{k.key==="Shift"&&E(!1),k.code==="Space"&&x(!1)};return window.addEventListener("keydown",R),window.addEventListener("keyup",M),()=>{window.removeEventListener("keydown",R),window.removeEventListener("keyup",M)}},[]);const m=R=>{if(n||hS(R.target)||R.button!==0&&R.button!==1)return;if(R.preventDefault(),r){g?.();return}const M=Bp(R),k=R.shiftKey&&R.button===0&&!C?"create":"pan";u.current={pointerId:R.pointerId,mode:k,startScreen:M,currentScreen:M,startViewport:d.current},R.currentTarget.setPointerCapture(R.pointerId),k==="create"&&p(Ip(M,M,d.current))},y=R=>{const M=u.current;if(!M||M.pointerId!==R.pointerId)return;R.preventDefault();const k=Bp(R);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}p(Ip(M.startScreen,k,d.current))},f=R=>{L(R,!0)},b=R=>{L(R,!1)},T=R=>{if(n||hS(R.target))return;R.preventDefault();const M=Bp(R),k=d.current,I=uB(k.zoom*Math.exp(-R.deltaY*oB),iB,rB),G=Zl(M,k);o({x:M.x-G.x*I,y:M.y-G.y*I,zoom:I})},L=(R,M)=>{const k=u.current;if(!k||k.pointerId!==R.pointerId||(u.current=null,R.currentTarget.releasePointerCapture(R.pointerId),p(null),!M))return;const I=Math.abs(k.currentScreen.x-k.startScreen.x),G=Math.abs(k.currentScreen.y-k.startScreen.y);if(I<uS&&G<uS){c?.();return}if(k.mode!=="create")return;const q=Ip(k.startScreen,k.currentScreen,d.current),W={x:q.x,y:q.y,width:Math.max(q.width,sB),height:Math.max(q.height,aB)};h(W,k.currentScreen)};return{rubberBand:S,spaceActive:C,shiftActive:A,onPointerDown:m,onPointerMove:y,onPointerUp:f,onPointerCancel:b,onWheel:T}}function Ip(e,n,r){const a=Zl(e,r),o=Zl(n,r),h=Math.min(a.x,o.x),g=Math.min(a.y,o.y);return{x:h,y:g,width:Math.abs(a.x-o.x),height:Math.abs(a.y-o.y)}}function Bp(e){const n=e.currentTarget.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function hS(e){return e instanceof Element&&!!e.closest("[data-canvas-blocker], [data-canvas-panel]")}function cB(e){return e instanceof HTMLElement&&!!e.closest("input, textarea, select, [contenteditable='true']")}function uB(e,n,r){return Math.min(r,Math.max(n,e))}const hB="Shift-drag to create an Operation. Right-click for actions. Drag to pan; scroll to zoom.",dB=640,fB=400,pB=560,mB=360,gB={x:0,y:0,zoom:1};function _B({state:e}){const n=$.useRef(null),r=$S(),a=tA(),o=HS(),h=nA(),g=_7(),c=Rk(),u=yw(),d=Lk(),S=ER(e),[p,C]=$.useState(null),[x,A]=$.useState(null),[E,m]=$.useState({width:0,height:0}),y=!e.activeTheaterId||e.agentClis.length===0||e.creatingTerminalSession||e.addingTheater;$.useEffect(()=>{const D=n.current;if(!D||typeof ResizeObserver>"u")return;const B=()=>m({width:D.clientWidth,height:D.clientHeight});B();const N=new ResizeObserver(B);return N.observe(D),()=>N.disconnect()},[]),$.useEffect(()=>{e.activeTerminalSessionId!==null&&po(null)},[e.activeTerminalSessionId]),$.useEffect(()=>{e.activeTerminalSessionId!==null&&h.includes(e.activeTerminalSessionId)&&ti(null)},[e.activeTerminalSessionId,h]);const f=lB({viewport:r.viewport,disabled:y,onViewportChange:ju,onZoom:US,onCreate:(D,B)=>{A(null),C({rect:D,anchor:B})},consumePointerDown:p!==null||x!==null,onConsumePointerDown:()=>{C(null),A(null)},onClick:wB}),b=async D=>{if(!(!e.activeTheaterId||!p)){a1();try{const B=await Fb(e.activeTheaterId,D.id);jl(B.sessionId,CB(p.rect)),o1(B),ti(B.sessionId),C(null)}catch(B){l1(B instanceof Error?B.message:String(B))}}},T=async D=>{const B=x?.canvasPoint;if(A(null),!e.activeTheaterId||!B)return;const N=g!==null?U:null;a1();try{const H=await Fb(e.activeTheaterId,D.id);jl(H.sessionId,fS(B,dB,fB)),o1(H),ti(H.sessionId),N&&Ul(Yu(H.sessionId),N)}catch(H){l1(H instanceof Error?H.message:String(H))}},L=()=>{const D=x?.canvasPoint;if(A(null),!e.activeTheaterId||!D)return;const B=g!==null?U:null;ti(null);const N=Mk(e.activeTheaterId,{...fS(D,pB,mB),zIndex:Ts()});po(N),B&&Ul(Xu(N),B)},R=()=>{A(null),ju({...gB})},M=()=>{const D=n.current?.getBoundingClientRect();if(!D)return;const B={x:16,y:D.height-52},N=Zl({x:D.width/2,y:D.height/2},r.viewport);C(null),A({anchor:B,canvasPoint:N})},k=D=>{if(D.target instanceof Element&&D.target.closest("[data-canvas-blocker], [data-canvas-panel]"))return;D.preventDefault();const B=n.current?.getBoundingClientRect();if(!B)return;const N={x:D.clientX-B.left,y:D.clientY-B.top};C(null),A({anchor:N,canvasPoint:Zl(N,r.viewport)})},I=new Set(h),G=new Set(d),q=Object.fromEntries(Object.entries(r.panels).filter(([D])=>!I.has(D))),W=Object.fromEntries(Object.entries(c).filter(([D])=>!G.has(D))),j=S.length>0||Object.keys(c).length>0,V=S.map(D=>D.sessionId),U=Nh(V),F=g?U.find(D=>D.id===g)??null:null,K=D=>Ul(D,U),X={x:0,y:0,width:Math.max(320,E.width),height:Math.max(240,E.height-72),zIndex:20};return v.jsxs("main",{className:`operations-canvas ${f.spaceActive?"is-panning":""} ${f.shiftActive?"is-creating":""} ${g?"is-panel-maximized":""}`,onPointerDown:f.onPointerDown,onPointerMove:f.onPointerMove,onPointerUp:f.onPointerUp,onPointerCancel:f.onPointerCancel,onWheel:f.onWheel,onContextMenu:k,ref:n,children:[v.jsx(W7,{viewport:r.viewport,backgroundAnimationEnabled:a}),v.jsx("button",{type:"button",className:`canvas-background-toggle canvas-maximize-toggle ${o?"is-active":""}`,onClick:hA,"data-canvas-blocker":!0,"aria-label":o?"맵 전체화면 해제":"맵 전체화면","aria-pressed":o,title:o?"Exit map fullscreen":"Enter map fullscreen",children:o?v.jsx(SB,{}):v.jsx(yB,{})}),v.jsx("button",{type:"button",className:`canvas-background-toggle ${a?"is-active":""}`,onClick:uA,"data-canvas-blocker":!0,"aria-label":a?"배경 애니메이션 끄기":"배경 애니메이션 켜기",title:a?"Background animation: on":"Background animation: off",children:v.jsx(bB,{})}),v.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 B=r.panels[D.sessionId];if(!B||I.has(D.sessionId)||g===D.sessionId)return null;const N=U.find(H=>H.id===D.sessionId)??Yu(D.sessionId);return v.jsx(rS,{state:e,session:D,geometry:B,viewport:r.viewport,active:e.activeTerminalSessionId===D.sessionId,onFocusRequest:()=>so(Yu(D.sessionId),E),onMaximize:()=>K(N)},D.sessionId)}),Object.entries(c).map(([D,B])=>{if(g===D)return null;const N=G.has(D),H=U.find(Q=>Q.id===D)??Xu(D);return v.jsx(cS,{id:D,theaterId:B.theaterId,geometry:B.geometry,viewport:r.viewport,active:!N&&u===D,minimized:N,onFocusRequest:()=>so(Xu(D),E),onMaximize:()=>K(H)},D)})]}),F?v.jsxs("div",{className:"canvas-panel-maximized-layer","data-canvas-blocker":!0,children:[S.map(D=>D.sessionId===F.id?v.jsx(rS,{state:e,session:D,geometry:X,viewport:{x:0,y:0,zoom:1},maximized:!0,active:e.activeTerminalSessionId===D.sessionId,onFocusRequest:()=>so(F,E),onMaximize:Ni},D.sessionId):null),Object.entries(c).map(([D,B])=>D===F.id?v.jsx(cS,{id:D,theaterId:B.theaterId,geometry:X,viewport:{x:0,y:0,zoom:1},maximized:!0,active:u===D,onFocusRequest:()=>so(F,E),onMaximize:Ni},D):null)]}):null,j?null:v.jsxs("div",{className:"operations-canvas-empty","data-canvas-blocker":!0,children:[v.jsx("span",{className:"operations-canvas-empty-mark","aria-hidden":"true"}),v.jsx("p",{children:e.activeTheaterId?hB:"Add a Theater from the top bar to start operations."}),e.terminalSessionError?v.jsx("p",{className:"operations-canvas-error",children:e.terminalSessionError}):null]}),f.rubberBand?v.jsx(Q7,{rect:f.rubberBand,viewport:r.viewport}):null,p?v.jsx(GN,{state:e,mode:"menu",anchor:p.anchor,viewportBounds:dS(n.current),onSelect:b,onClose:()=>C(null)},`${p.anchor.x}:${p.anchor.y}`):null,x?v.jsx(n8,{state:e,anchor:x.anchor,viewportBounds:dS(n.current),onLaunchCli:D=>{T(D)},onOpenShell:L,onResetView:R,onClose:()=>A(null)},`${x.anchor.x}:${x.anchor.y}`):null,v.jsx(a8,{panels:q,shellPanels:W,viewport:r.viewport,canvasSize:E,onJump:D=>ju({x:E.width/2-D.x*r.viewport.zoom,y:E.height/2-D.y*r.viewport.zoom,zoom:r.viewport.zoom})}),j?v.jsx(G7,{}):null,e.activeTheaterId?v.jsx("button",{type:"button",className:"canvas-launcher-fab",onClick:M,"data-canvas-blocker":!0,"aria-label":"새 패널 만들기",title:"New panel",children:v.jsx(vB,{})}):null,v.jsx(P7,{state:e,sessions:S,canvasSize:E,minimizedIds:h})]})}function vB(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.jsx("path",{d:"M8 3.5v9M3.5 8h9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function bB(){return v.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[v.jsx("circle",{cx:"8",cy:"8",r:"5.2",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeDasharray:"2 2"}),v.jsx("circle",{cx:"8",cy:"8",r:"2.6",fill:"none",stroke:"currentColor",strokeWidth:"1.1",opacity:"0.72"}),v.jsx("path",{d:"M8 8 12.2 5.8",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),v.jsx("circle",{cx:"8",cy:"8",r:".9",fill:"currentColor"})]})}function yB(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.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 SB(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.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 dS(e){if(!e)return;const n=e.getBoundingClientRect();return{width:n.width,height:n.height}}function wB(){if(typeof document<"u"){const e=document.activeElement;e instanceof HTMLElement&&e.blur()}ti(null),po(null)}function CB(e){return{x:e.x,y:e.y,width:e.width,height:e.height,zIndex:0}}function fS(e,n,r){return{x:e.x,y:e.y,width:n,height:r,zIndex:0}}const xB=56;function EB(e,n){const r=$.useRef(null),a=$.useRef(!0),[o,h]=$.useState(!0),g=$.useCallback(u=>{a.current!==u&&(a.current=u,h(u))},[]);$.useEffect(()=>{const u=r.current;if(!u)return;const d=()=>{const S=u.scrollHeight-u.scrollTop-u.clientHeight;g(S<=xB)};return u.addEventListener("scroll",d,{passive:!0}),()=>u.removeEventListener("scroll",d)},[g]),$.useLayoutEffect(()=>{g(!0);const u=r.current;u&&(u.scrollTop=u.scrollHeight)},[e,g]),$.useLayoutEffect(()=>{const u=r.current;!u||!a.current||(u.scrollTop=u.scrollHeight)},[n]);const c=$.useCallback(()=>{const u=r.current;u&&(u.scrollTop=u.scrollHeight,u.focus({preventScroll:!0}),g(!0))},[g]);return{containerRef:r,pinned:o,jumpToLatest:c}}const pS=400,TB=["text","fallbackText","fallbackThought"],AB=$.memo(function({events:n}){return v.jsxs("ol",{className:"timeline","aria-label":"Raw event timeline",children:[n.length===0?v.jsx("li",{className:"timeline-empty",children:"No events observed."}):null,n.map((r,a)=>{const o=n[n.length-1-a];return o?v.jsx(kB,{event:o},o.id):null})]})}),kB=$.memo(function({event:n}){return v.jsxs("li",{className:"timeline-row",children:[v.jsx("time",{className:"timeline-time",children:_w(n.at)}),v.jsx("span",{className:"timeline-type",children:n.type}),v.jsx("code",{className:"timeline-payload",children:RB(n.event)})]})});function RB(e){const n={...e};delete n.type;for(const a of TB){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>pS?`${r.slice(0,pS)}…`:r}const LB=$.memo(function({track:n}){const r=Ch(n.status),a=n.status==="stream",o=n.sentTextLength>n.text.length||n.sentThoughtLength>n.thought.length,h=n.sentTextLength+n.sentThoughtLength;return v.jsxs("article",{className:`track-card track-card--${r}`,children:[v.jsxs("header",{className:"track-head",children:[v.jsx("span",{className:`status-dot status-dot--${r}`,"aria-hidden":"true"}),v.jsx("h3",{className:"track-name",children:n.displayName}),n.displayCli?v.jsx("span",{className:"track-tag",children:n.displayCli}):null,n.model?v.jsx("span",{className:"track-tag track-tag--dim",children:n.model}):null,n.effort?v.jsx("span",{className:"track-tag track-tag--dim",children:n.effort}):null,v.jsx("span",{className:`track-status track-status--${r}`,children:vk(n.status)})]}),n.subtitle?v.jsx("p",{className:"track-subtitle",children:n.subtitle}):null,n.requestPreview?v.jsx(MB,{preview:n.requestPreview}):null,n.thought?v.jsx(DB,{thought:n.thought,streaming:a&&!n.text}):null,v.jsx(OB,{track:n}),n.text?v.jsx("div",{className:"track-output","data-streaming":a||void 0,children:v.jsxs("pre",{className:"track-text",children:[n.text,a?v.jsx("span",{className:"stream-caret","aria-hidden":"true"}):null]})}):a||n.status==="conn"||n.status==="queued"?v.jsxs("p",{className:"track-waiting",children:[v.jsx("span",{className:"stream-caret","aria-hidden":"true"})," awaiting output"]}):null,o?v.jsxs("p",{className:"track-notice",children:["Output partially retained — ",h.toLocaleString()," chars emitted in total."]}):null,n.error?v.jsx("p",{className:"track-error",children:n.error}):null]})});function MB({preview:e}){return v.jsxs("p",{className:"track-request",title:e,children:[v.jsx("span",{className:"track-request-mark","aria-hidden":"true",children:"▸"}),e]})}function DB({thought:e,streaming:n}){const[r,a]=$.useState(!1);return v.jsxs("div",{className:`thought-fold ${r?"is-open":""}`,children:[v.jsxs("button",{type:"button",className:"thought-toggle",onClick:()=>a(o=>!o),"aria-expanded":r,children:[v.jsx("span",{className:"thought-chevron","aria-hidden":"true",children:r?"▾":"▸"}),"reasoning",n?v.jsx("span",{className:"stream-caret stream-caret--dim","aria-hidden":"true"}):null]}),r?v.jsx("pre",{className:"thought-text",children:e}):null]})}function OB({track:e}){return e.tools.length===0?null:v.jsx("ul",{className:"tool-rail","aria-label":"Tool calls",children:e.tools.map(n=>v.jsxs("li",{className:`tool-chip tool-chip--${NB(n.status)}`,children:[v.jsx("span",{className:"tool-chip-glyph","aria-hidden":"true",children:"⚙"}),v.jsx("span",{className:"tool-chip-title",children:n.title}),n.status?v.jsx("span",{className:"tool-chip-status",children:n.status}):null]},n.key))})}function NB(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 IB({job:e,timelineOpen:n}){const{containerRef:r,pinned:a,jumpToLatest:o}=EB(e?.jobId??"none",e?.lastEventId??0);return e?v.jsxs("main",{className:"stage",children:[v.jsx(BB,{job:e}),v.jsxs("div",{className:"stage-stream",children:[v.jsx("div",{className:"stage-scroll",ref:r,tabIndex:-1,children:v.jsxs("div",{className:"stage-content",children:[e.trackOrder.length===0?v.jsxs("p",{className:"stage-waiting",children:[v.jsx("span",{className:"stream-caret","aria-hidden":"true"})," waiting for track registration"]}):e.trackOrder.map(h=>{const g=e.tracks[h];return g?v.jsx(LB,{track:g},`${e.jobId}:${h}`):null}),e.summary?v.jsx(jB,{summary:e.summary,status:e.status,error:e.error}):null]})}),a?null:v.jsx("button",{type:"button",className:"follow-button",onClick:o,children:"↓ Follow stream"})]}),v.jsxs("section",{className:`timeline-dock ${n?"is-open":""}`,children:[v.jsxs("button",{type:"button",className:"timeline-toggle",onClick:gR,"aria-expanded":n,children:[v.jsx("span",{className:"timeline-chevron","aria-hidden":"true",children:n?"▾":"▴"}),"Event timeline",v.jsx("span",{className:"timeline-count",children:e.recentEvents.length})]}),n?v.jsx(AB,{events:e.recentEvents}):null]})]}):v.jsx("main",{className:"stage",children:v.jsxs("div",{className:"stage-idle",children:[v.jsx("p",{className:"stage-idle-mark","aria-hidden":"true",children:"▵"}),v.jsx("h2",{children:"Standing by"}),v.jsx("p",{children:"Select a job from the left rail, or dispatch carriers from a Fleet session."})]})})}const BB=$.memo(function({job:n}){const r=Ch(n.status),a=n.startedAt?gk(n.startedAt,n.finishedAt??n.updatedAt):null;return v.jsxs("header",{className:"job-head",children:[v.jsxs("div",{className:"job-head-id",children:[v.jsx("span",{className:`status-dot status-dot--${r} status-dot--lg`,"aria-hidden":"true"}),v.jsxs("div",{children:[v.jsx("h2",{className:"job-title",children:n.label??Yp(n.jobId)}),v.jsxs("p",{className:"job-meta",children:[v.jsx("span",{className:`job-status job-status--${r}`,children:Xp(n.status)}),n.ownerCarrierId?v.jsxs("span",{children:["· ",n.ownerCarrierId]}):null,n.kind?v.jsxs("span",{children:["· ",n.kind]}):null,a?v.jsxs("span",{children:["· ",a]}):null,n.startedAt?v.jsxs("span",{children:["· started ",_w(n.startedAt)]}):null]})]})]}),v.jsx("code",{className:"job-id",title:n.jobId,children:Yp(n.jobId)})]})});function jB({summary:e,status:n,error:r}){return v.jsxs("aside",{className:`job-summary job-summary--${Ch(n)}`,children:[v.jsx("p",{className:"job-summary-eyebrow",children:n==="error"?"Finalized with error":"Finalized"}),v.jsx("p",{className:"job-summary-text",children:e}),r?v.jsx("p",{className:"job-summary-error",children:r}):null]})}function PB({state:e}){const n=CR(e);return $.useEffect(()=>{const r=a=>{a.key==="Escape"&&ep()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[]),n?v.jsxs("div",{className:"job-overlay",role:"dialog","aria-modal":"true","aria-label":"Carrier job stream",children:[v.jsx("button",{type:"button",className:"job-overlay-scrim",onClick:ep,"aria-label":"Close job stream"}),v.jsxs("div",{className:"job-overlay-card",children:[v.jsx("button",{type:"button",className:"job-overlay-close",onClick:ep,"aria-label":"Close job stream",children:"×"}),v.jsx(IB,{job:n,timelineOpen:e.timelineOpen})]})]}):null}function zB({state:e}){return v.jsx("div",{className:"floating-job-overlay","data-canvas-blocker":!0,children:v.jsx(PB,{state:e})})}function $B({state:e}){const n=$.useRef(null),r=$.useMemo(()=>sh(e),[e.sessions,e.sessionOrder,e.activeTheaterId]),a=$.useRef(e);return a.current=e,$.useEffect(()=>{cA(e.activeTheaterId),Ok(e.activeTheaterId),v7(e.activeTheaterId)},[e.activeTheaterId]),$.useEffect(()=>{const o=h=>{if(!h.altKey||h.metaKey||h.ctrlKey||h.shiftKey||h.key!=="ArrowLeft"&&h.key!=="ArrowRight")return;const g=document.activeElement;if(g instanceof HTMLElement&&g.matches("input, textarea, [contenteditable='true']")&&!g.closest(".xterm"))return;const c=sh(a.current),u=Nh(c);if(u.length===0)return;h.preventDefault(),h.stopImmediatePropagation();const d=$m(),S=d??a.current.activeTerminalSessionId??Jp(),p=h.key==="ArrowRight"?1:-1,C=y7(u,S,p);if(!C)return;if(d){Ul(C,u);return}const x=mS(n.current);x&&so(C,x)};return window.addEventListener("keydown",o,!0),()=>window.removeEventListener("keydown",o,!0)},[]),$.useEffect(()=>{for(const o of r)oA(o);e.terminalSessionsHydrated&&lA(r)},[r,e.terminalSessionsHydrated]),$.useEffect(()=>{if(!e.terminalSessionsHydrated)return;const o=eh().panelAccent;for(const h of r){const g=e.sessions[h];if(!g)continue;const c=g.accent??null,u=o[h]??null;c!==u&&FS(h,c)}},[r,e.sessions,e.terminalSessionsHydrated]),$.useEffect(()=>{x7(r,{operationSessionsHydrated:e.terminalSessionsHydrated,theaterReady:e.activeTheaterId!==null})},[r,e.activeTheaterId,e.terminalSessionsHydrated]),$.useEffect(()=>{const o=e.pendingOperationFocus;if(o===null)return;let h=!1;return(async()=>{let c=o;if(e.sessions[o]?.status==="dormant")try{const S=await hw(o);if(h)return;Eh(S),ti(S.sessionId),c=S.sessionId}catch(S){h||qw(S instanceof Error?S.message:String(S)),s1();return}if(h)return;Ni();const d=mS(n.current);d&&GS(c,d),s1()})(),()=>{h=!0}},[e.pendingOperationFocus]),v.jsxs("div",{className:"console-body is-canvas",ref:n,children:[v.jsx(_B,{state:e}),v.jsx(zB,{state:e})]})}function mS(e){if(!e)return null;const n=e.getBoundingClientRect();return{width:n.width,height:n.height}}const HB=6e3;function UB(){const e=yo(),n=Ii(),r=n.pathname,a=bo(),o=HS(),h=NA(),g=BA(),c=iw(),u=r.startsWith("/codex"),d=$.useRef(n),S=$.useRef(!u),p=o&&r.startsWith("/operations"),C=u&&h!=="route"&&(S.current||g),x=C?h:"route",A=u&&x==="side",E=S.current?d.current:{pathname:"/operations",search:"",hash:"",state:null,key:"codex-fallback"},m=C?E:n,y=m.pathname.startsWith("/operations");$.useEffect(()=>oL(),[]),$.useEffect(()=>{u||(d.current=n,S.current=!0)},[u,n]),$.useEffect(()=>{eR(y)},[y]),$.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]),$.useEffect(()=>{const T=document.querySelector(".topbar");if(!T)return;const L=()=>{document.documentElement.style.setProperty("--console-topbar-offset",`${Math.round(T.getBoundingClientRect().bottom)}px`)};L();const R=new ResizeObserver(L);return R.observe(T),window.addEventListener("resize",L),()=>{R.disconnect(),window.removeEventListener("resize",L)}},[]),$.useEffect(()=>{const T=new AbortController;ow(T.signal).then(M=>{$w(M),u1()}).catch(M=>{T.signal.aborted||(je({theaterError:M instanceof Error?M.message:String(M)}),u1())}),YA(T.signal).then(lR).catch(M=>{T.signal.aborted||je({terminalSessionError:M instanceof Error?M.message:String(M)})}),Bw(),lw({signal:T.signal}).then(jw).catch(M=>{T.signal.aborted||Pw(M instanceof Error?M.message:String(M))});const L=()=>{FA(e.activeTheaterId,T.signal).then(oR).catch(()=>{})};L();const R=window.setTimeout(L,HB);return()=>{window.clearTimeout(R),T.abort()}},[]),$.useEffect(()=>{const T=L=>{window.location.pathname.includes("/codex")||(L.metaKey||L.ctrlKey)&&L.key.toLowerCase()==="k"&&(L.preventDefault(),L.stopImmediatePropagation(),hR())};return window.addEventListener("keydown",T,!0),()=>window.removeEventListener("keydown",T,!0)},[]);const f=()=>{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 v.jsxs("div",{className:`console-shell ${p?"is-map-fullscreen":""}`,children:[v.jsx(A3,{state:e}),v.jsxs(gT,{location:m,children:[v.jsx(Zs,{path:"/",element:v.jsx(Mb,{to:"/operations",replace:!0})}),v.jsx(Zs,{path:"/operations",element:v.jsx($B,{state:e})}),v.jsx(Zs,{path:"/carrier-settings",element:v.jsx(jL,{})}),v.jsx(Zs,{path:"/settings",element:v.jsx(NN,{})}),v.jsx(Zs,{path:"/codex/*",element:null}),v.jsx(Zs,{path:"*",element:v.jsx(Mb,{to:"/operations",replace:!0})})]}),u?v.jsx(PO,{state:e,mode:x,onClose:f}):null,u?null:v.jsx(FB,{onOpen:b}),v.jsx(p3,{state:e}),v.jsx(u3,{state:e}),v.jsx(Z3,{state:e}),v.jsx(XR,{state:e}),v.jsx(y3,{open:e.connectionError!==null,tone:"error",title:"Console link interrupted",message:e.connectionError??void 0}),v.jsx(QR,{})]})}function FB({onOpen:e}){return v.jsxs("button",{type:"button",className:"codex-edge-handle",onClick:e,"aria-label":"Open Codex side panel",title:"Codex (Side)",children:[v.jsx("span",{className:"codex-edge-handle-chevron","aria-hidden":"true",children:v.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:v.jsx("path",{d:"M9.5 4 5.5 8l4 4"})})}),v.jsx("span",{className:"codex-edge-handle-label",children:"Codex"})]})}tR();const gS=document.querySelector("#app");gS&&v5.createRoot(gS).render(v.jsx($.StrictMode,{children:v.jsx($T,{basename:"/console",children:v.jsx(UB,{})})}));export{O4 as _,qB as a,c5 as g,St as k,$l as p};