@dotobokuri/fleet-console 1.14.0 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/AGENTS.md +160 -23
  2. package/README.md +18 -16
  3. package/dist/cli.d.ts +5 -20
  4. package/dist/cli.mjs +14176 -22199
  5. package/dist/client/assets/{_baseUniq--pkWMMvp.js → _baseUniq-Dl47hoBn.js} +1 -1
  6. package/dist/client/assets/{arc-DIAmGa-L.js → arc-gTL65oBG.js} +1 -1
  7. package/dist/client/assets/{architectureDiagram-Q4EWVU46-C1rKH9j8.js → architectureDiagram-Q4EWVU46-B4ysOekM.js} +1 -1
  8. package/dist/client/assets/{blockDiagram-DXYQGD6D-pUE19ZBm.js → blockDiagram-DXYQGD6D-Cn9GJTRY.js} +1 -1
  9. package/dist/client/assets/{c4Diagram-AHTNJAMY-D9ojglXD.js → c4Diagram-AHTNJAMY-BIub3g5q.js} +1 -1
  10. package/dist/client/assets/channel-kIwNtTP-.js +1 -0
  11. package/dist/client/assets/{chunk-4BX2VUAB-BbHyV-q7.js → chunk-4BX2VUAB-DFHyuJK_.js} +1 -1
  12. package/dist/client/assets/{chunk-4TB4RGXK-DvK0LRYh.js → chunk-4TB4RGXK-CV_laQzm.js} +1 -1
  13. package/dist/client/assets/{chunk-55IACEB6-CyZurxBS.js → chunk-55IACEB6-Cs5LeHXe.js} +1 -1
  14. package/dist/client/assets/{chunk-EDXVE4YY-OXfpLkhv.js → chunk-EDXVE4YY-D_LyOot5.js} +1 -1
  15. package/dist/client/assets/{chunk-FMBD7UC4-Bp492nAE.js → chunk-FMBD7UC4-B1dz5YRM.js} +1 -1
  16. package/dist/client/assets/{chunk-OYMX7WX6-Dp06iRbU.js → chunk-OYMX7WX6-CT0D_NEN.js} +1 -1
  17. package/dist/client/assets/{chunk-QZHKN3VN-CGFb41af.js → chunk-QZHKN3VN-CWNbvQat.js} +1 -1
  18. package/dist/client/assets/{chunk-YZCP3GAM-CPemnVAa.js → chunk-YZCP3GAM-C_fp6KvG.js} +1 -1
  19. package/dist/client/assets/classDiagram-6PBFFD2Q-DGNebVYt.js +1 -0
  20. package/dist/client/assets/classDiagram-v2-HSJHXN6E-DGNebVYt.js +1 -0
  21. package/dist/client/assets/clone-DFRxH9FR.js +1 -0
  22. package/dist/client/assets/{cose-bilkent-S5V4N54A-DzLbihnc.js → cose-bilkent-S5V4N54A-B6xq1D1R.js} +1 -1
  23. package/dist/client/assets/{dagre-KV5264BT-gIu_mIwG.js → dagre-KV5264BT-_leuW1pD.js} +1 -1
  24. package/dist/client/assets/{diagram-5BDNPKRD-BQtHJXn-.js → diagram-5BDNPKRD-4wH1x31-.js} +1 -1
  25. package/dist/client/assets/{diagram-G4DWMVQ6-Dvu5rGtf.js → diagram-G4DWMVQ6-nlP8pQsq.js} +1 -1
  26. package/dist/client/assets/{diagram-MMDJMWI5-DffZ4K1f.js → diagram-MMDJMWI5-CWgyNhRW.js} +1 -1
  27. package/dist/client/assets/{diagram-TYMM5635-CgIAxnvO.js → diagram-TYMM5635-DfGqjepr.js} +1 -1
  28. package/dist/client/assets/{erDiagram-SMLLAGMA-uThpoDTJ.js → erDiagram-SMLLAGMA-CMpgXQfn.js} +1 -1
  29. package/dist/client/assets/{flowDiagram-DWJPFMVM-CSgTIvvw.js → flowDiagram-DWJPFMVM-BaLRDaS7.js} +1 -1
  30. package/dist/client/assets/{ganttDiagram-T4ZO3ILL-B-QOGtBC.js → ganttDiagram-T4ZO3ILL-CAuXJ2xz.js} +1 -1
  31. package/dist/client/assets/{gitGraphDiagram-UUTBAWPF-Cb_lpM0D.js → gitGraphDiagram-UUTBAWPF-KsfuOuTW.js} +1 -1
  32. package/dist/client/assets/{graph-BSnp6JSF.js → graph-3375lXck.js} +1 -1
  33. package/dist/client/assets/index-BRniWsxl.css +1 -0
  34. package/dist/client/assets/index-OEz1YKt3.js +361 -0
  35. package/dist/client/assets/{infoDiagram-42DDH7IO-BfdmGjc0.js → infoDiagram-42DDH7IO-GYhjUtOi.js} +1 -1
  36. package/dist/client/assets/{ishikawaDiagram-UXIWVN3A-B7IxhAyp.js → ishikawaDiagram-UXIWVN3A-DfjzfJ87.js} +1 -1
  37. package/dist/client/assets/{journeyDiagram-VCZTEJTY-BLcjOlni.js → journeyDiagram-VCZTEJTY-CjF_oAe2.js} +1 -1
  38. package/dist/client/assets/{kanban-definition-6JOO6SKY-D7ZIyiF_.js → kanban-definition-6JOO6SKY-DkIK9azu.js} +1 -1
  39. package/dist/client/assets/{layout-D3OG5NbT.js → layout-g4DCAcmJ.js} +1 -1
  40. package/dist/client/assets/{linear-BvWfoqQq.js → linear-BXtneTLA.js} +1 -1
  41. package/dist/client/assets/{mermaid.core-cauuvPfO.js → mermaid.core-CFCyolqU.js} +4 -4
  42. package/dist/client/assets/{min-BlleJrkQ.js → min-BOlS-Kpi.js} +1 -1
  43. package/dist/client/assets/{mindmap-definition-QFDTVHPH-Clkt11oj.js → mindmap-definition-QFDTVHPH-pM2WtK3x.js} +1 -1
  44. package/dist/client/assets/{pieDiagram-DEJITSTG-DdFtIn-F.js → pieDiagram-DEJITSTG-DDIwX7uR.js} +1 -1
  45. package/dist/client/assets/{quadrantDiagram-34T5L4WZ-D-s3xVqQ.js → quadrantDiagram-34T5L4WZ-BXaToAll.js} +1 -1
  46. package/dist/client/assets/{requirementDiagram-MS252O5E-CAOgs_ga.js → requirementDiagram-MS252O5E-DcniSPVW.js} +1 -1
  47. package/dist/client/assets/{sankeyDiagram-XADWPNL6-CwNe6T7F.js → sankeyDiagram-XADWPNL6-BRSO8kbj.js} +1 -1
  48. package/dist/client/assets/{sequenceDiagram-FGHM5R23-a2KprIq8.js → sequenceDiagram-FGHM5R23-CUIcqpcf.js} +1 -1
  49. package/dist/client/assets/{stateDiagram-FHFEXIEX-zhB1rn0b.js → stateDiagram-FHFEXIEX-DwQwUYPD.js} +1 -1
  50. package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-oBGjXrxd.js +1 -0
  51. package/dist/client/assets/{timeline-definition-GMOUNBTQ-BlA9nDAP.js → timeline-definition-GMOUNBTQ-DNrziHKp.js} +1 -1
  52. package/dist/client/assets/{vennDiagram-DHZGUBPP-CWLLKd9C.js → vennDiagram-DHZGUBPP-BEVuQytw.js} +1 -1
  53. package/dist/client/assets/{wardley-RL74JXVD-B9fBOng-.js → wardley-RL74JXVD-Cwp-Pzm_.js} +1 -1
  54. package/dist/client/assets/{wardleyDiagram-NUSXRM2D-B7b_tMc3.js → wardleyDiagram-NUSXRM2D-Cd3w820H.js} +1 -1
  55. package/dist/client/assets/{xychartDiagram-5P7HB3ND-D9kDqkfZ.js → xychartDiagram-5P7HB3ND-CSVs_RZN.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} +17244 -21250
  60. package/package.json +7 -6
  61. package/dist/cli-bin.d.ts +0 -2
  62. package/dist/client/assets/channel-BSqChC9B.js +0 -1
  63. package/dist/client/assets/classDiagram-6PBFFD2Q-DLPKVOP5.js +0 -1
  64. package/dist/client/assets/classDiagram-v2-HSJHXN6E-DLPKVOP5.js +0 -1
  65. package/dist/client/assets/clone-TN0j087k.js +0 -1
  66. package/dist/client/assets/index-BsgvDcDS.js +0 -777
  67. package/dist/client/assets/index-DouvozK2.css +0 -1
  68. package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-8QLfjXWZ.js +0 -1
@@ -0,0 +1,361 @@
1
+ function aS(e,n){for(var r=0;r<n.length;r++){const a=n[r];if(typeof a!="string"&&!Array.isArray(a)){for(const o in a)if(o!=="default"&&!(o in e)){const g=Object.getOwnPropertyDescriptor(a,o);g&&Object.defineProperty(e,o,g.get?g:{enumerable:!0,get:()=>a[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(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 g of o)if(g.type==="childList")for(const _ of g.addedNodes)_.tagName==="LINK"&&_.rel==="modulepreload"&&a(_)}).observe(document,{childList:!0,subtree:!0});function r(o){const g={};return o.integrity&&(g.integrity=o.integrity),o.referrerPolicy&&(g.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?g.credentials="include":o.crossOrigin==="anonymous"?g.credentials="omit":g.credentials="same-origin",g}function a(o){if(o.ep)return;o.ep=!0;const g=r(o);fetch(o.href,g)}})();function Mg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function jj(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 wf={exports:{}},al={};var n1;function VE(){if(n1)return al;n1=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(a,o,g){var _=null;if(g!==void 0&&(_=""+g),o.key!==void 0&&(_=""+o.key),"key"in o){g={};for(var c in o)c!=="key"&&(g[c]=o[c])}else g=o;return o=g.ref,{$$typeof:e,type:a,key:_,ref:o!==void 0?o:null,props:g}}return al.Fragment=n,al.jsx=r,al.jsxs=r,al}var i1;function YE(){return i1||(i1=1,wf.exports=VE()),wf.exports}var h=YE();const XE=Mg(h),ZE=aS({__proto__:null,default:XE},[h]);var xf={exports:{}},Fe={};var r1;function JE(){if(r1)return Fe;r1=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"),g=Symbol.for("react.consumer"),_=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),w=Symbol.iterator;function C(O){return O===null||typeof O!="object"?null:(O=w&&O[w]||O["@@iterator"],typeof O=="function"?O:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,f={};function y(O,z,W){this.props=O,this.context=z,this.refs=f,this.updater=W||A}y.prototype.isReactComponent={},y.prototype.setState=function(O,z){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,z,"setState")},y.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function m(){}m.prototype=y.prototype;function S(O,z,W){this.props=O,this.context=z,this.refs=f,this.updater=W||A}var k=S.prototype=new m;k.constructor=S,E(k,y.prototype),k.isPureReactComponent=!0;var L=Array.isArray;function R(){}var M={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function I(O,z,W){var Z=W.ref;return{$$typeof:e,type:O,key:z,ref:Z!==void 0?Z:null,props:W}}function K(O,z){return I(O.type,z,O.props)}function F(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function G(O){var z={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(W){return z[W]})}var B=/\/+/g;function Y(O,z){return typeof O=="object"&&O!==null&&O.key!=null?G(""+O.key):z.toString(36)}function X(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(R,R):(O.status="pending",O.then(function(z){O.status==="pending"&&(O.status="fulfilled",O.value=z)},function(z){O.status==="pending"&&(O.status="rejected",O.reason=z)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function H(O,z,W,Z,ie){var he=typeof O;(he==="undefined"||he==="boolean")&&(O=null);var te=!1;if(O===null)te=!0;else switch(he){case"bigint":case"string":case"number":te=!0;break;case"object":switch(O.$$typeof){case e:case n:te=!0;break;case b:return te=O._init,H(te(O._payload),z,W,Z,ie)}}if(te)return ie=ie(O),te=Z===""?"."+Y(O,0):Z,L(ie)?(W="",te!=null&&(W=te.replace(B,"$&/")+"/"),H(ie,z,W,"",function(ge){return ge})):ie!=null&&(F(ie)&&(ie=K(ie,W+(ie.key==null||O&&O.key===ie.key?"":(""+ie.key).replace(B,"$&/")+"/")+te)),z.push(ie)),1;te=0;var $=Z===""?".":Z+":";if(L(O))for(var le=0;le<O.length;le++)Z=O[le],he=$+Y(Z,le),te+=H(Z,z,W,he,ie);else if(le=C(O),typeof le=="function")for(O=le.call(O),le=0;!(Z=O.next()).done;)Z=Z.value,he=$+Y(Z,le++),te+=H(Z,z,W,he,ie);else if(he==="object"){if(typeof O.then=="function")return H(X(O),z,W,Z,ie);throw z=String(O),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.")}return te}function q(O,z,W){if(O==null)return O;var Z=[],ie=0;return H(O,Z,"","",function(he){return z.call(W,he,ie++)}),Z}function V(O){if(O._status===-1){var z=O._result;z=z(),z.then(function(W){(O._status===0||O._status===-1)&&(O._status=1,O._result=W)},function(W){(O._status===0||O._status===-1)&&(O._status=2,O._result=W)}),O._status===-1&&(O._status=0,O._result=z)}if(O._status===1)return O._result.default;throw O._result}var D=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},P={map:q,forEach:function(O,z,W){q(O,function(){z.apply(this,arguments)},W)},count:function(O){var z=0;return q(O,function(){z++}),z},toArray:function(O){return q(O,function(z){return z})||[]},only:function(O){if(!F(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return Fe.Activity=p,Fe.Children=P,Fe.Component=y,Fe.Fragment=r,Fe.Profiler=o,Fe.PureComponent=S,Fe.StrictMode=a,Fe.Suspense=u,Fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Fe.__COMPILER_RUNTIME={__proto__:null,c:function(O){return M.H.useMemoCache(O)}},Fe.cache=function(O){return function(){return O.apply(null,arguments)}},Fe.cacheSignal=function(){return null},Fe.cloneElement=function(O,z,W){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var Z=E({},O.props),ie=O.key;if(z!=null)for(he in z.key!==void 0&&(ie=""+z.key),z)!T.call(z,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&z.ref===void 0||(Z[he]=z[he]);var he=arguments.length-2;if(he===1)Z.children=W;else if(1<he){for(var te=Array(he),$=0;$<he;$++)te[$]=arguments[$+2];Z.children=te}return I(O.type,ie,Z)},Fe.createContext=function(O){return O={$$typeof:_,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:g,_context:O},O},Fe.createElement=function(O,z,W){var Z,ie={},he=null;if(z!=null)for(Z in z.key!==void 0&&(he=""+z.key),z)T.call(z,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(ie[Z]=z[Z]);var te=arguments.length-2;if(te===1)ie.children=W;else if(1<te){for(var $=Array(te),le=0;le<te;le++)$[le]=arguments[le+2];ie.children=$}if(O&&O.defaultProps)for(Z in te=O.defaultProps,te)ie[Z]===void 0&&(ie[Z]=te[Z]);return I(O,he,ie)},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(O){return{$$typeof:c,render:O}},Fe.isValidElement=F,Fe.lazy=function(O){return{$$typeof:b,_payload:{_status:-1,_result:O},_init:V}},Fe.memo=function(O,z){return{$$typeof:d,type:O,compare:z===void 0?null:z}},Fe.startTransition=function(O){var z=M.T,W={};M.T=W;try{var Z=O(),ie=M.S;ie!==null&&ie(W,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(R,D)}catch(he){D(he)}finally{z!==null&&W.types!==null&&(z.types=W.types),M.T=z}},Fe.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Fe.use=function(O){return M.H.use(O)},Fe.useActionState=function(O,z,W){return M.H.useActionState(O,z,W)},Fe.useCallback=function(O,z){return M.H.useCallback(O,z)},Fe.useContext=function(O){return M.H.useContext(O)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(O,z){return M.H.useDeferredValue(O,z)},Fe.useEffect=function(O,z){return M.H.useEffect(O,z)},Fe.useEffectEvent=function(O){return M.H.useEffectEvent(O)},Fe.useId=function(){return M.H.useId()},Fe.useImperativeHandle=function(O,z,W){return M.H.useImperativeHandle(O,z,W)},Fe.useInsertionEffect=function(O,z){return M.H.useInsertionEffect(O,z)},Fe.useLayoutEffect=function(O,z){return M.H.useLayoutEffect(O,z)},Fe.useMemo=function(O,z){return M.H.useMemo(O,z)},Fe.useOptimistic=function(O,z){return M.H.useOptimistic(O,z)},Fe.useReducer=function(O,z,W){return M.H.useReducer(O,z,W)},Fe.useRef=function(O){return M.H.useRef(O)},Fe.useState=function(O){return M.H.useState(O)},Fe.useSyncExternalStore=function(O,z,W){return M.H.useSyncExternalStore(O,z,W)},Fe.useTransition=function(){return M.H.useTransition()},Fe.version="19.2.7",Fe}var s1;function Ng(){return s1||(s1=1,xf.exports=JE()),xf.exports}var j=Ng();const QE=Mg(j),zu=aS({__proto__:null,default:QE},[j]),e5="fc-operation-body";let Ii=class extends Error{status;constructor(n,r){super(r),this.name="ApiError",this.status=n}};async function oS(e){const n=await fetch("/api/v1/operations/catalog",{signal:e});if(!n.ok)throw new Ii(n.status,`Operation catalog request failed: ${n.status}`);const r=await n.json();return Array.isArray(r.plugins)?r.plugins.map(n5).filter(a=>a!==null):[]}function Hu(e){const n=e;if(!n||typeof n.id!="string"||typeof n.theaterId!="string"||typeof n.type!="string"||typeof n.pluginId!="string"||typeof n.title!="string"||!n.payload||typeof n.payload!="object"||Array.isArray(n.payload)||lS(n))throw new Ii(500,"Invalid operation response");return n}function lS(e){return xp(e,new Set(["canonicalCwd","cwd","persona","prompt","providerSession","ticket","token","toolAllowlist","tools","transcriptPath"]))}function t5({children:e,className:n}){return h.jsx("div",{className:r5(e5,n),children:e})}function n5(e){if(!cS(e)||typeof e.id!="string"||typeof e.title!="string"||!Array.isArray(e.kinds))return null;const n=e.kinds.map(i5).filter(r=>r!==null);return n.length===0?null:{id:e.id,title:e.title,kinds:n}}function i5(e){return!cS(e)||typeof e.id!="string"||typeof e.type!="string"||typeof e.title!="string"?null:{id:e.id,type:e.type,title:e.title,...typeof e.disabled=="boolean"?{disabled:e.disabled}:{},...typeof e.disabledReason=="string"?{disabledReason:e.disabledReason}:{}}}function cS(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function xp(e,n){return!e||typeof e!="object"?!1:Array.isArray(e)?e.some(r=>xp(r,n)):Object.entries(e).some(([r,a])=>n.has(r)||xp(a,n))}function r5(...e){return e.filter(n=>!!n).join(" ")}const s5=Object.freeze(Object.defineProperty({__proto__:null,ApiError:Ii,OperationBody:t5,assertOperationNode:Hu,fetchOperationCatalog:oS,hasForbiddenBrowserPayloadKey:lS},Symbol.toStringTag,{value:"Module"}));function a5(e){return e}function o5(e){return e}function uS(e=()=>{}){const n=new Set;return{api:{fetch:(r,a,o)=>fetch(Cf(r,a),o).then(d5),subscribe:(r,a,o)=>{const g=new EventSource(Cf(r,a));g.onmessage=o;const _=()=>g.close();return n.add(_),()=>{_(),n.delete(_)}},resync:e},lifecycle:{onDispose:r=>(n.add(r),()=>n.delete(r))},terminal:{requestTicket:async(r,a,o,g)=>{const _=await fetch(Cf(r,a),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operationId:o}),signal:g});if(!_.ok)throw new Ii(_.status,`Terminal ticket request failed: ${_.status}`);const c=await _.json();if(typeof c.ticket!="string"||typeof c.ttlMs!="number")throw new Ii(_.status,"Invalid terminal ticket response");return{ticket:c.ticket,ttlMs:c.ttlMs}}},notifications:{emit:()=>{},dismiss:()=>{}},operations:{create:async r=>{const a=await fetch("/api/v1/operations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!a.ok)throw new Ii(a.status,`Operation create failed: ${a.status}`);const o=await a.json();return Hu(o.operation)},rename:async(r,a)=>{const o=await fetch(`/api/v1/operations/${encodeURIComponent(r)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:a})});if(!o.ok)throw new Ii(o.status,`Operation rename failed: ${o.status}`);const g=await o.json();return Hu(g.operation)},remove:async r=>{const a=await fetch(`/api/v1/operations/${encodeURIComponent(r)}`,{method:"DELETE"});if(!a.ok)throw new Ii(a.status,`Operation remove failed: ${a.status}`)}},preferences:{read:(r,a)=>f5(r,a),write:(r,a)=>p5(r,a)},status:{set:()=>{},clear:()=>{}}}}function hS(e,n){return j.useSyncExternalStore(e,n,n)}function l5(){const[e,n]=j.useState([]),r=j.useCallback(async()=>{const a=await fetch("/api/v1/operations");if(!a.ok)throw new Ii(a.status,`Operations request failed: ${a.status}`);const o=await a.json();n(Array.isArray(o.operations)?o.operations.map(Hu):[])},[]);return j.useEffect(()=>{r()},[r]),{operations:e,refresh:r}}function c5(e,n){return j.useMemo(()=>({fetch:(r,a)=>e.fetch(n,r,a),subscribe:(r,a)=>e.subscribe(n,r,a)}),[e,n])}function u5(e,n,r){const[a,o]=j.useState(()=>e.read(n,r)),g=j.useCallback(_=>{o(_),e.write(n,_)},[e,n]);return[a,g]}function h5(e,n){return j.useMemo(()=>({set:r=>e.set(n,r),clear:()=>e.clear(n)}),[e,n])}async function d5(e){if(!e.ok)throw new Ii(e.status,`Plugin request failed: ${e.status}`);return e}function Cf(e,n){if(!/^[a-z0-9][a-z0-9._-]*$/i.test(e))throw new Ii(400,"Invalid plugin id");const r=n.startsWith("/")?n:`/${n}`;if(r.includes(".."))throw new Ii(400,"Invalid plugin path");return`/plugins/${e}${r}`}function f5(e,n){if(typeof window>"u")return n;try{const r=window.localStorage.getItem(`fleet-plugin.${e}`);return r===null?n:JSON.parse(r)}catch{return n}}function p5(e,n){if(!(typeof window>"u"))try{window.localStorage.setItem(`fleet-plugin.${e}`,JSON.stringify(n))}catch{}}const g5=Object.freeze(Object.defineProperty({__proto__:null,React:zu,createClientCapabilities:uS,defineOperationKind:o5,definePlugin:a5,useOperationStatus:h5,useOperations:l5,usePluginApi:c5,usePluginStorage:u5,useStoreSnapshot:hS},Symbol.toStringTag,{value:"Module"}));function m5(e){return e}function _5({title:e,description:n,children:r}){return h.jsxs("section",{className:"fc-settings-card",children:[e?h.jsx("h3",{className:"fc-settings-card__title",children:e}):null,n?h.jsx("p",{className:"fc-settings-card__desc",children:n}):null,h.jsx("div",{className:"fc-settings-card__body",children:r})]})}function v5({label:e,hint:n,children:r}){const a=j.useId(),o=j.useId();return h.jsxs("div",{className:"fc-settings-row",role:"group","aria-labelledby":a,"aria-describedby":n?o:void 0,children:[h.jsxs("div",{className:"fc-settings-row__copy",children:[h.jsx("div",{className:"fc-settings-row__label",id:a,children:e}),n?h.jsx("div",{className:"fc-settings-row__hint",id:o,children:n}):null]}),h.jsx("div",{className:"fc-settings-row__control",children:r})]})}function b5({checked:e,onChange:n,label:r,disabled:a=!1}){const o=j.useId();return h.jsxs("label",{className:"fc-settings-toggle",htmlFor:o,children:[h.jsx("input",{id:o,className:"fc-settings-toggle__input",type:"checkbox",checked:e,disabled:a,"aria-label":r?void 0:"Toggle setting",onChange:g=>n(g.currentTarget.checked)}),h.jsx("span",{className:"fc-settings-toggle__control","aria-hidden":"true"}),r?h.jsx("span",{className:"fc-settings-toggle__label",children:r}):null]})}function y5({value:e,options:n,onChange:r,label:a,disabled:o=!1}){const g=j.useId(),_=h.jsx("select",{id:g,className:"fc-settings-select__control",value:e,disabled:o,"aria-label":a?void 0:"Select setting",onChange:c=>r(c.currentTarget.value),children:n.map(c=>h.jsx("option",{value:c.value,children:c.label},c.value))});return a?h.jsxs("label",{className:"fc-settings-select",htmlFor:g,children:[h.jsx("span",{className:"fc-settings-select__label",children:a}),_]}):h.jsx("div",{className:"fc-settings-select",children:_})}function S5({label:e,hint:n,children:r}){const a=j.useId(),o=j.useId();return h.jsxs("div",{className:"fc-settings-field",role:"group","aria-labelledby":a,"aria-describedby":n?o:void 0,children:[h.jsx("div",{className:"fc-settings-field__label",id:a,children:e}),n?h.jsx("div",{className:"fc-settings-field__hint",id:o,children:n}):null,h.jsx("div",{className:"fc-settings-field__control",children:r})]})}const w5=Object.freeze(Object.defineProperty({__proto__:null,SettingsCard:_5,SettingsField:S5,SettingsRow:v5,SettingsSelect:y5,SettingsToggle:b5,defineSettingsSection:m5},Symbol.toStringTag,{value:"Module"}));function x5(e){return e}const C5=Object.freeze(Object.defineProperty({__proto__:null,defineNotificationKind:x5},Symbol.toStringTag,{value:"Module"})),E5=h.jsx("div",{className:"fc-plugin-error",children:"Plugin failed to render."});class Og extends j.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(n){this.props.onError?.(n)}render(){return this.state.hasError?this.props.fallback??E5:this.props.children}}const k5=Object.freeze(Object.defineProperty({__proto__:null,PluginErrorBoundary:Og,React:zu,default:zu},Symbol.toStringTag,{value:"Module"}));var Ef={exports:{}},ol={},kf={exports:{}},Af={};var a1;function A5(){return a1||(a1=1,(function(e){function n(H,q){var V=H.length;H.push(q);e:for(;0<V;){var D=V-1>>>1,P=H[D];if(0<o(P,q))H[D]=q,H[V]=P,V=D;else break e}}function r(H){return H.length===0?null:H[0]}function a(H){if(H.length===0)return null;var q=H[0],V=H.pop();if(V!==q){H[0]=V;e:for(var D=0,P=H.length,O=P>>>1;D<O;){var z=2*(D+1)-1,W=H[z],Z=z+1,ie=H[Z];if(0>o(W,V))Z<P&&0>o(ie,W)?(H[D]=ie,H[Z]=V,D=Z):(H[D]=W,H[z]=V,D=z);else if(Z<P&&0>o(ie,V))H[D]=ie,H[Z]=V,D=Z;else break e}}return q}function o(H,q){var V=H.sortIndex-q.sortIndex;return V!==0?V:H.id-q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var g=performance;e.unstable_now=function(){return g.now()}}else{var _=Date,c=_.now();e.unstable_now=function(){return _.now()-c}}var u=[],d=[],b=1,p=null,w=3,C=!1,A=!1,E=!1,f=!1,y=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function k(H){for(var q=r(d);q!==null;){if(q.callback===null)a(d);else if(q.startTime<=H)a(d),q.sortIndex=q.expirationTime,n(u,q);else break;q=r(d)}}function L(H){if(E=!1,k(H),!A)if(r(u)!==null)A=!0,R||(R=!0,G());else{var q=r(d);q!==null&&X(L,q.startTime-H)}}var R=!1,M=-1,T=5,I=-1;function K(){return f?!0:!(e.unstable_now()-I<T)}function F(){if(f=!1,R){var H=e.unstable_now();I=H;var q=!0;try{e:{A=!1,E&&(E=!1,m(M),M=-1),C=!0;var V=w;try{t:{for(k(H),p=r(u);p!==null&&!(p.expirationTime>H&&K());){var D=p.callback;if(typeof D=="function"){p.callback=null,w=p.priorityLevel;var P=D(p.expirationTime<=H);if(H=e.unstable_now(),typeof P=="function"){p.callback=P,k(H),q=!0;break t}p===r(u)&&a(u),k(H)}else a(u);p=r(u)}if(p!==null)q=!0;else{var O=r(d);O!==null&&X(L,O.startTime-H),q=!1}}break e}finally{p=null,w=V,C=!1}q=void 0}}finally{q?G():R=!1}}}var G;if(typeof S=="function")G=function(){S(F)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,Y=B.port2;B.port1.onmessage=F,G=function(){Y.postMessage(null)}}else G=function(){y(F,0)};function X(H,q){M=y(function(){H(e.unstable_now())},q)}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(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return w},e.unstable_next=function(H){switch(w){case 1:case 2:case 3:var q=3;break;default:q=w}var V=w;w=q;try{return H()}finally{w=V}},e.unstable_requestPaint=function(){f=!0},e.unstable_runWithPriority=function(H,q){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var V=w;w=H;try{return q()}finally{w=V}},e.unstable_scheduleCallback=function(H,q,V){var D=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?D+V:D):V=D,H){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=V+P,H={id:b++,callback:q,priorityLevel:H,startTime:V,expirationTime:P,sortIndex:-1},V>D?(H.sortIndex=V,n(d,H),r(u)===null&&H===r(d)&&(E?(m(M),M=-1):E=!0,X(L,V-D))):(H.sortIndex=P,n(u,H),A||C||(A=!0,R||(R=!0,G()))),H},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(H){var q=w;return function(){var V=w;w=q;try{return H.apply(this,arguments)}finally{w=V}}}})(Af)),Af}var o1;function T5(){return o1||(o1=1,kf.exports=A5()),kf.exports}var Tf={exports:{}},Hn={};var l1;function R5(){if(l1)return Hn;l1=1;var e=Ng();function n(u){var d="https://react.dev/errors/"+u;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)d+="&args[]="+encodeURIComponent(arguments[b])}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 g(u,d,b){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:b}}var _=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(u,d){if(u==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Hn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Hn.createPortal=function(u,d){var b=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 g(u,d,null,b)},Hn.flushSync=function(u){var d=_.T,b=a.p;try{if(_.T=null,a.p=2,u)return u()}finally{_.T=d,a.p=b,a.d.f()}},Hn.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))},Hn.prefetchDNS=function(u){typeof u=="string"&&a.d.D(u)},Hn.preinit=function(u,d){if(typeof u=="string"&&d&&typeof d.as=="string"){var b=d.as,p=c(b,d.crossOrigin),w=typeof d.integrity=="string"?d.integrity:void 0,C=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;b==="style"?a.d.S(u,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:p,integrity:w,fetchPriority:C}):b==="script"&&a.d.X(u,{crossOrigin:p,integrity:w,fetchPriority:C,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Hn.preinitModule=function(u,d){if(typeof u=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var b=c(d.as,d.crossOrigin);a.d.M(u,{crossOrigin:b,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)},Hn.preload=function(u,d){if(typeof u=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var b=d.as,p=c(b,d.crossOrigin);a.d.L(u,b,{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})}},Hn.preloadModule=function(u,d){if(typeof u=="string")if(d){var b=c(d.as,d.crossOrigin);a.d.m(u,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:b,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else a.d.m(u)},Hn.requestFormReset=function(u){a.d.r(u)},Hn.unstable_batchedUpdates=function(u,d){return u(d)},Hn.useFormState=function(u,d,b){return _.H.useFormState(u,d,b)},Hn.useFormStatus=function(){return _.H.useHostTransitionStatus()},Hn.version="19.2.7",Hn}var c1;function dS(){if(c1)return Tf.exports;c1=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(),Tf.exports=R5(),Tf.exports}var u1;function L5(){if(u1)return ol;u1=1;var e=T5(),n=Ng(),r=dS();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 g(t){var i=t,s=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(s=i.return),t=i.return;while(t)}return i.tag===3?s:null}function _(t){if(t.tag===13){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function c(t){if(t.tag===31){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function u(t){if(g(t)!==t)throw Error(a(188))}function d(t){var i=t.alternate;if(!i){if(i=g(t),i===null)throw Error(a(188));return i!==t?null:t}for(var s=t,l=i;;){var v=s.return;if(v===null)break;var x=v.alternate;if(x===null){if(l=v.return,l!==null){s=l;continue}break}if(v.child===x.child){for(x=v.child;x;){if(x===s)return u(v),t;if(x===l)return u(v),i;x=x.sibling}throw Error(a(188))}if(s.return!==l.return)s=v,l=x;else{for(var N=!1,U=v.child;U;){if(U===s){N=!0,s=v,l=x;break}if(U===l){N=!0,l=v,s=x;break}U=U.sibling}if(!N){for(U=x.child;U;){if(U===s){N=!0,s=x,l=v;break}if(U===l){N=!0,l=x,s=v;break}U=U.sibling}if(!N)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 b(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t;for(t=t.child;t!==null;){if(i=b(t),i!==null)return i;t=t.sibling}return null}var p=Object.assign,w=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),S=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function G(t){return t===null||typeof t!="object"?null:(t=F&&t[F]||t["@@iterator"],typeof t=="function"?t:null)}var B=Symbol.for("react.client.reference");function Y(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===B?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case E:return"Fragment";case y:return"Profiler";case f: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 S:return t.displayName||"Context";case m:return(t._context.displayName||"Context")+".Consumer";case k: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:Y(t.type)||"Memo";case T:i=t._payload,t=t._init;try{return Y(t(i))}catch{}}return null}var X=Array.isArray,H=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V={pending:!1,data:null,method:null,action:null},D=[],P=-1;function O(t){return{current:t}}function z(t){0>P||(t.current=D[P],D[P]=null,P--)}function W(t,i){P++,D[P]=t.current,t.current=i}var Z=O(null),ie=O(null),he=O(null),te=O(null);function $(t,i){switch(W(he,i),W(ie,t),W(Z,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?E0(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=E0(i),t=k0(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}z(Z),W(Z,t)}function le(){z(Z),z(ie),z(he)}function ge(t){t.memoizedState!==null&&W(te,t);var i=Z.current,s=k0(i,t.type);i!==s&&(W(ie,t),W(Z,s))}function we(t){ie.current===t&&(z(Z),z(ie)),te.current===t&&(z(te),nl._currentValue=V)}var Se,je;function Ie(t){if(Se===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);Se=i&&i[1]||"",je=-1<s.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+Se+t+je}var Ge=!1;function vt(t,i){if(!t||Ge)return"";Ge=!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 ce=ue}Reflect.construct(t,[],me)}else{try{me.call()}catch(ue){ce=ue}t.call(me.prototype)}}else{try{throw Error()}catch(ue){ce=ue}(me=t())&&typeof me.catch=="function"&&me.catch(function(){})}}catch(ue){if(ue&&ce&&typeof ue.stack=="string")return[ue.stack,ce.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=l.DetermineComponentFrameRoot(),N=x[0],U=x[1];if(N&&U){var ee=N.split(`
4
+ `),oe=U.split(`
5
+ `);for(v=l=0;l<ee.length&&!ee[l].includes("DetermineComponentFrameRoot");)l++;for(;v<oe.length&&!oe[v].includes("DetermineComponentFrameRoot");)v++;if(l===ee.length||v===oe.length)for(l=ee.length-1,v=oe.length-1;1<=l&&0<=v&&ee[l]!==oe[v];)v--;for(;1<=l&&0<=v;l--,v--)if(ee[l]!==oe[v]){if(l!==1||v!==1)do if(l--,v--,0>v||ee[l]!==oe[v]){var de=`
6
+ `+ee[l].replace(" at new "," at ");return t.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",t.displayName)),de}while(1<=l&&0<=v);break}}}finally{Ge=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?Ie(s):""}function Le(t,i){switch(t.tag){case 26:case 27:case 5:return Ie(t.type);case 16:return Ie("Lazy");case 13:return t.child!==i&&i!==null?Ie("Suspense Fallback"):Ie("Suspense");case 19:return Ie("SuspenseList");case 0:case 15:return vt(t.type,!1);case 11:return vt(t.type.render,!1);case 1:return vt(t.type,!0);case 31:return Ie("Activity");default:return""}}function Tt(t){try{var i="",s=null;do i+=Le(t,s),s=t,t=t.return;while(t);return i}catch(l){return`
7
+ Error generating stack: `+l.message+`
8
+ `+l.stack}}var Xt=Object.prototype.hasOwnProperty,vn=e.unstable_scheduleCallback,an=e.unstable_cancelCallback,kn=e.unstable_shouldYield,Zt=e.unstable_requestPaint,ut=e.unstable_now,Rt=e.unstable_getCurrentPriorityLevel,xt=e.unstable_ImmediatePriority,Ut=e.unstable_UserBlockingPriority,Kt=e.unstable_NormalPriority,Xn=e.unstable_LowPriority,bn=e.unstable_IdlePriority,Pn=e.log,dt=e.unstable_setDisableYieldValue,An=null,ve=null;function $e(t){if(typeof Pn=="function"&&dt(t),ve&&typeof ve.setStrictMode=="function")try{ve.setStrictMode(An,t)}catch{}}var Ze=Math.clz32?Math.clz32:on,at=Math.log,Ve=Math.LN2;function on(t){return t>>>=0,t===0?32:31-(at(t)/Ve|0)|0}var Ot=256,Tn=262144,Un=4194304;function Dt(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 Q(t,i,s){var l=t.pendingLanes;if(l===0)return 0;var v=0,x=t.suspendedLanes,N=t.pingedLanes;t=t.warmLanes;var U=l&134217727;return U!==0?(l=U&~x,l!==0?v=Dt(l):(N&=U,N!==0?v=Dt(N):s||(s=U&~t,s!==0&&(v=Dt(s))))):(U=l&~x,U!==0?v=Dt(U):N!==0?v=Dt(N):s||(s=l&~t,s!==0&&(v=Dt(s)))),v===0?0:i!==0&&i!==v&&(i&x)===0&&(x=v&-v,s=i&-i,x>=s||x===32&&(s&4194048)!==0)?i:v}function fe(t,i){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&i)===0}function ye(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 Oe(){var t=Un;return Un<<=1,(Un&62914560)===0&&(Un=4194304),t}function bt(t){for(var i=[],s=0;31>s;s++)i.push(t);return i}function ht(t,i){t.pendingLanes|=i,i!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function ke(t,i,s,l,v,x){var N=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 U=t.entanglements,ee=t.expirationTimes,oe=t.hiddenUpdates;for(s=N&~s;0<s;){var de=31-Ze(s),me=1<<de;U[de]=0,ee[de]=-1;var ce=oe[de];if(ce!==null)for(oe[de]=null,de=0;de<ce.length;de++){var ue=ce[de];ue!==null&&(ue.lane&=-536870913)}s&=~me}l!==0&&Ce(t,l,0),x!==0&&v===0&&t.tag!==0&&(t.suspendedLanes|=x&~(N&~i))}function Ce(t,i,s){t.pendingLanes|=i,t.suspendedLanes&=~i;var l=31-Ze(i);t.entangledLanes|=i,t.entanglements[l]=t.entanglements[l]|1073741824|s&261930}function Pe(t,i){var s=t.entangledLanes|=i;for(t=t.entanglements;s;){var l=31-Ze(s),v=1<<l;v&i|t[l]&i&&(t[l]|=i),s&=~v}}function Vt(t,i){var s=i&-i;return s=(s&42)!==0?1:nt(s),(s&(t.suspendedLanes|i))!==0?0:s}function nt(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 Rn(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function hr(){var t=q.p;return t!==0?t:(t=window.event,t===void 0?32:Y0(t.type))}function dr(t,i){var s=q.p;try{return q.p=t,i()}finally{q.p=s}}var Zn=Math.random().toString(36).slice(2),Bt="__reactFiber$"+Zn,Mt="__reactProps$"+Zn,Ui="__reactContainer$"+Zn,Ur="__reactEvents$"+Zn,ra="__reactListeners$"+Zn,fr="__reactHandles$"+Zn,Es="__reactResources$"+Zn,Qi="__reactMarker$"+Zn;function Ne(t){delete t[Bt],delete t[Mt],delete t[Ur],delete t[ra],delete t[fr]}function J(t){var i=t[Bt];if(i)return i;for(var s=t.parentNode;s;){if(i=s[Ui]||s[Bt]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(t=O0(t);t!==null;){if(s=t[Bt])return s;t=O0(t)}return i}t=s,s=t.parentNode}return null}function _e(t){if(t=t[Bt]||t[Ui]){var i=t.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return t}return null}function Ee(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t.stateNode;throw Error(a(33))}function ot(t){var i=t[Es];return i||(i=t[Es]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Je(t){t[Qi]=!0}var jt=new Set,Jt={};function Qt(t,i){be(t,i),be(t+"Capture",i)}function be(t,i){for(Jt[t]=i,t=0;t<i.length;t++)jt.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]*$"),De={},ft={};function Ft(t){return Xt.call(ft,t)?!0:Xt.call(De,t)?!1:Me.test(t)?ft[t]=!0:(De[t]=!0,!1)}function zn(t,i,s){if(Ft(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 ci(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 Jn(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 Nt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ui(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Jl(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 v=l.get,x=l.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return v.call(this)},set:function(N){s=""+N,x.call(this,N)}}),Object.defineProperty(t,i,{enumerable:l.enumerable}),{getValue:function(){return s},setValue:function(N){s=""+N},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function sa(t){if(!t._valueTracker){var i=ui(t)?"checked":"value";t._valueTracker=Jl(t,i,""+t[i])}}function go(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var s=i.getValue(),l="";return t&&(l=ui(t)?t.checked?"true":"false":t.value),t=l,t!==s?(i.setValue(t),!0):!1}function aa(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 yh=/[\n"\\]/g;function Qn(t){return t.replace(yh,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function mo(t,i,s,l,v,x,N,U){t.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?t.type=N:t.removeAttribute("type"),i!=null?N==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+Nt(i)):t.value!==""+Nt(i)&&(t.value=""+Nt(i)):N!=="submit"&&N!=="reset"||t.removeAttribute("value"),i!=null?oa(t,N,Nt(i)):s!=null?oa(t,N,Nt(s)):l!=null&&t.removeAttribute("value"),v==null&&x!=null&&(t.defaultChecked=!!x),v!=null&&(t.checked=v&&typeof v!="function"&&typeof v!="symbol"),U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?t.name=""+Nt(U):t.removeAttribute("name")}function ks(t,i,s,l,v,x,N,U){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(t.type=x),i!=null||s!=null){if(!(x!=="submit"&&x!=="reset"||i!=null)){sa(t);return}s=s!=null?""+Nt(s):"",i=i!=null?""+Nt(i):s,U||i===t.value||(t.value=i),t.defaultValue=i}l=l??v,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=U?t.checked:!!l,t.defaultChecked=!!l,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(t.name=N),sa(t)}function oa(t,i,s){i==="number"&&aa(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function Ln(t,i,s,l){if(t=t.options,i){i={};for(var v=0;v<s.length;v++)i["$"+s[v]]=!0;for(s=0;s<t.length;s++)v=i.hasOwnProperty("$"+t[s].value),t[s].selected!==v&&(t[s].selected=v),v&&l&&(t[s].defaultSelected=!0)}else{for(s=""+Nt(s),i=null,v=0;v<t.length;v++){if(t[v].value===s){t[v].selected=!0,l&&(t[v].defaultSelected=!0);return}i!==null||t[v].disabled||(i=t[v])}i!==null&&(i.selected=!0)}}function Ql(t,i,s){if(i!=null&&(i=""+Nt(i),i!==t.value&&(t.value=i),s==null)){t.defaultValue!==i&&(t.defaultValue=i);return}t.defaultValue=s!=null?""+Nt(s):""}function la(t,i,s,l){if(i==null){if(l!=null){if(s!=null)throw Error(a(92));if(X(l)){if(1<l.length)throw Error(a(93));l=l[0]}s=l}s==null&&(s=""),i=s}s=Nt(i),t.defaultValue=s,l=t.textContent,l===s&&l!==""&&l!==null&&(t.value=l),sa(t)}function Ue(t,i){if(i){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=i;return}}t.textContent=i}var ec=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 hn(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||ec.has(i)?i==="float"?t.cssFloat=s:t[i]=(""+s).trim():t[i]=s+"px"}function yt(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 v in i)l=i[v],i.hasOwnProperty(v)&&s[v]!==l&&hn(t,v,l)}else for(var x in i)i.hasOwnProperty(x)&&hn(t,x,i[x])}function Fr(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"]]),_o=/^[\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 _o.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function xe(){}var Te=null;function We(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var it=null,Yt=null;function xi(t){var i=_e(t);if(i&&(t=i.stateNode)){var s=t[Mt]||null;e:switch(t=i.stateNode,i.type){case"input":if(mo(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="'+Qn(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var l=s[i];if(l!==t&&l.form===t.form){var v=l[Mt]||null;if(!v)throw Error(a(90));mo(l,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(i=0;i<s.length;i++)l=s[i],l.form===t.form&&go(l)}break e;case"textarea":Ql(t,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&Ln(t,!!s.multiple,i,!1)}}}var vo=!1;function tc(t,i,s){if(vo)return t(i,s);vo=!0;try{var l=t(i);return l}finally{if(vo=!1,(it!==null||Yt!==null)&&(Uc(),it&&(i=it,t=Yt,Yt=it=null,xi(i),t)))for(i=0;i<t.length;i++)xi(t[i])}}function bo(t,i){var s=t.stateNode;if(s===null)return null;var l=s[Mt]||null;if(l===null)return null;s=l[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(t=t.type,l=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!l;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var gr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sh=!1;if(gr)try{var yo={};Object.defineProperty(yo,"passive",{get:function(){Sh=!0}}),window.addEventListener("test",yo,yo),window.removeEventListener("test",yo,yo)}catch{Sh=!1}var Gr=null,wh=null,nc=null;function km(){if(nc)return nc;var t,i=wh,s=i.length,l,v="value"in Gr?Gr.value:Gr.textContent,x=v.length;for(t=0;t<s&&i[t]===v[t];t++);var N=s-t;for(l=1;l<=N&&i[s-l]===v[x-l];l++);return nc=v.slice(t,1<l?1-l:void 0)}function ic(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 rc(){return!0}function Am(){return!1}function ei(t){function i(s,l,v,x,N){this._reactName=s,this._targetInst=v,this.type=l,this.nativeEvent=x,this.target=N,this.currentTarget=null;for(var U in t)t.hasOwnProperty(U)&&(s=t[U],this[U]=s?s(x):x[U]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?rc:Am,this.isPropagationStopped=Am,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=rc)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=rc)},persist:function(){},isPersistent:rc}),i}var As={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sc=ei(As),So=p({},As,{view:0,detail:0}),qC=ei(So),xh,Ch,wo,ac=p({},So,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kh,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!==wo&&(wo&&t.type==="mousemove"?(xh=t.screenX-wo.screenX,Ch=t.screenY-wo.screenY):Ch=xh=0,wo=t),xh)},movementY:function(t){return"movementY"in t?t.movementY:Ch}}),Tm=ei(ac),KC=p({},ac,{dataTransfer:0}),VC=ei(KC),YC=p({},So,{relatedTarget:0}),Eh=ei(YC),XC=p({},As,{animationName:0,elapsedTime:0,pseudoElement:0}),ZC=ei(XC),JC=p({},As,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),QC=ei(JC),e2=p({},As,{data:0}),Rm=ei(e2),t2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},n2={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"},i2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function r2(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=i2[t])?!!i[t]:!1}function kh(){return r2}var s2=p({},So,{key:function(t){if(t.key){var i=t2[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=ic(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?n2[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kh,charCode:function(t){return t.type==="keypress"?ic(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?ic(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),a2=ei(s2),o2=p({},ac,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Lm=ei(o2),l2=p({},So,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kh}),c2=ei(l2),u2=p({},As,{propertyName:0,elapsedTime:0,pseudoElement:0}),h2=ei(u2),d2=p({},ac,{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}),f2=ei(d2),p2=p({},As,{newState:0,oldState:0}),g2=ei(p2),m2=[9,13,27,32],Ah=gr&&"CompositionEvent"in window,xo=null;gr&&"documentMode"in document&&(xo=document.documentMode);var _2=gr&&"TextEvent"in window&&!xo,Mm=gr&&(!Ah||xo&&8<xo&&11>=xo),Nm=" ",Om=!1;function Dm(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 Bm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ca=!1;function v2(t,i){switch(t){case"compositionend":return Bm(i);case"keypress":return i.which!==32?null:(Om=!0,Nm);case"textInput":return t=i.data,t===Nm&&Om?null:t;default:return null}}function b2(t,i){if(ca)return t==="compositionend"||!Ah&&Dm(t,i)?(t=km(),nc=wh=Gr=null,ca=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Mm&&i.locale!=="ko"?null:i.data;default:return null}}var y2={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 jm(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!y2[t.type]:i==="textarea"}function Im(t,i,s,l){it?Yt?Yt.push(l):Yt=[l]:it=l,i=Yc(i,"onChange"),0<i.length&&(s=new sc("onChange","change",null,s,l),t.push({event:s,listeners:i}))}var Co=null,Eo=null;function S2(t){b0(t,0)}function oc(t){var i=Ee(t);if(go(i))return t}function Pm(t,i){if(t==="change")return i}var zm=!1;if(gr){var Th;if(gr){var Rh="oninput"in document;if(!Rh){var Hm=document.createElement("div");Hm.setAttribute("oninput","return;"),Rh=typeof Hm.oninput=="function"}Th=Rh}else Th=!1;zm=Th&&(!document.documentMode||9<document.documentMode)}function $m(){Co&&(Co.detachEvent("onpropertychange",Um),Eo=Co=null)}function Um(t){if(t.propertyName==="value"&&oc(Eo)){var i=[];Im(i,Eo,t,We(t)),tc(S2,i)}}function w2(t,i,s){t==="focusin"?($m(),Co=i,Eo=s,Co.attachEvent("onpropertychange",Um)):t==="focusout"&&$m()}function x2(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return oc(Eo)}function C2(t,i){if(t==="click")return oc(i)}function E2(t,i){if(t==="input"||t==="change")return oc(i)}function k2(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var hi=typeof Object.is=="function"?Object.is:k2;function ko(t,i){if(hi(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 v=s[l];if(!Xt.call(i,v)||!hi(t[v],i[v]))return!1}return!0}function Fm(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Wm(t,i){var s=Fm(t);t=0;for(var l;s;){if(s.nodeType===3){if(l=t+s.textContent.length,t<=i&&l>=i)return{node:s,offset:i-t};t=l}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Fm(s)}}function Gm(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?Gm(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function qm(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var i=aa(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=aa(t.document)}return i}function Lh(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 A2=gr&&"documentMode"in document&&11>=document.documentMode,ua=null,Mh=null,Ao=null,Nh=!1;function Km(t,i,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Nh||ua==null||ua!==aa(l)||(l=ua,"selectionStart"in l&&Lh(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}),Ao&&ko(Ao,l)||(Ao=l,l=Yc(Mh,"onSelect"),0<l.length&&(i=new sc("onSelect","select",null,i,s),t.push({event:i,listeners:l}),i.target=ua)))}function Ts(t,i){var s={};return s[t.toLowerCase()]=i.toLowerCase(),s["Webkit"+t]="webkit"+i,s["Moz"+t]="moz"+i,s}var ha={animationend:Ts("Animation","AnimationEnd"),animationiteration:Ts("Animation","AnimationIteration"),animationstart:Ts("Animation","AnimationStart"),transitionrun:Ts("Transition","TransitionRun"),transitionstart:Ts("Transition","TransitionStart"),transitioncancel:Ts("Transition","TransitionCancel"),transitionend:Ts("Transition","TransitionEnd")},Oh={},Vm={};gr&&(Vm=document.createElement("div").style,"AnimationEvent"in window||(delete ha.animationend.animation,delete ha.animationiteration.animation,delete ha.animationstart.animation),"TransitionEvent"in window||delete ha.transitionend.transition);function Rs(t){if(Oh[t])return Oh[t];if(!ha[t])return t;var i=ha[t],s;for(s in i)if(i.hasOwnProperty(s)&&s in Vm)return Oh[t]=i[s];return t}var Ym=Rs("animationend"),Xm=Rs("animationiteration"),Zm=Rs("animationstart"),T2=Rs("transitionrun"),R2=Rs("transitionstart"),L2=Rs("transitioncancel"),Jm=Rs("transitionend"),Qm=new Map,Dh="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(" ");Dh.push("scrollEnd");function Fi(t,i){Qm.set(t,i),Qt(i,[t])}var lc=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)},Ci=[],da=0,Bh=0;function cc(){for(var t=da,i=Bh=da=0;i<t;){var s=Ci[i];Ci[i++]=null;var l=Ci[i];Ci[i++]=null;var v=Ci[i];Ci[i++]=null;var x=Ci[i];if(Ci[i++]=null,l!==null&&v!==null){var N=l.pending;N===null?v.next=v:(v.next=N.next,N.next=v),l.pending=v}x!==0&&e_(s,v,x)}}function uc(t,i,s,l){Ci[da++]=t,Ci[da++]=i,Ci[da++]=s,Ci[da++]=l,Bh|=l,t.lanes|=l,t=t.alternate,t!==null&&(t.lanes|=l)}function jh(t,i,s,l){return uc(t,i,s,l),hc(t)}function Ls(t,i){return uc(t,null,null,i),hc(t)}function e_(t,i,s){t.lanes|=s;var l=t.alternate;l!==null&&(l.lanes|=s);for(var v=!1,x=t.return;x!==null;)x.childLanes|=s,l=x.alternate,l!==null&&(l.childLanes|=s),x.tag===22&&(t=x.stateNode,t===null||t._visibility&1||(v=!0)),t=x,x=x.return;return t.tag===3?(x=t.stateNode,v&&i!==null&&(v=31-Ze(s),t=x.hiddenUpdates,l=t[v],l===null?t[v]=[i]:l.push(i),i.lane=s|536870912),x):null}function hc(t){if(50<Yo)throw Yo=0,Gd=null,Error(a(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var fa={};function M2(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 di(t,i,s,l){return new M2(t,i,s,l)}function Ih(t){return t=t.prototype,!(!t||!t.isReactComponent)}function mr(t,i){var s=t.alternate;return s===null?(s=di(t.tag,i,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=i,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&65011712,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,i=t.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s.refCleanup=t.refCleanup,s}function t_(t,i){t.flags&=65011714;var s=t.alternate;return s===null?(t.childLanes=0,t.lanes=i,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=s.childLanes,t.lanes=s.lanes,t.child=s.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=s.memoizedProps,t.memoizedState=s.memoizedState,t.updateQueue=s.updateQueue,t.type=s.type,i=s.dependencies,t.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),t}function dc(t,i,s,l,v,x){var N=0;if(l=t,typeof t=="function")Ih(t)&&(N=1);else if(typeof t=="string")N=jE(t,s,Z.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case I:return t=di(31,s,i,v),t.elementType=I,t.lanes=x,t;case E:return Ms(s.children,v,x,i);case f:N=8,v|=24;break;case y:return t=di(12,s,i,v|2),t.elementType=y,t.lanes=x,t;case L:return t=di(13,s,i,v),t.elementType=L,t.lanes=x,t;case R:return t=di(19,s,i,v),t.elementType=R,t.lanes=x,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case S:N=10;break e;case m:N=9;break e;case k:N=11;break e;case M:N=14;break e;case T:N=16,l=null;break e}N=29,s=Error(a(130,t===null?"null":typeof t,"")),l=null}return i=di(N,s,i,v),i.elementType=t,i.type=l,i.lanes=x,i}function Ms(t,i,s,l){return t=di(7,t,l,i),t.lanes=s,t}function Ph(t,i,s){return t=di(6,t,null,i),t.lanes=s,t}function n_(t){var i=di(18,null,null,0);return i.stateNode=t,i}function zh(t,i,s){return i=di(4,t.children!==null?t.children:[],t.key,i),i.lanes=s,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}var i_=new WeakMap;function Ei(t,i){if(typeof t=="object"&&t!==null){var s=i_.get(t);return s!==void 0?s:(i={value:t,source:i,stack:Tt(i)},i_.set(t,i),i)}return{value:t,source:i,stack:Tt(i)}}var pa=[],ga=0,fc=null,To=0,ki=[],Ai=0,qr=null,er=1,tr="";function _r(t,i){pa[ga++]=To,pa[ga++]=fc,fc=t,To=i}function r_(t,i,s){ki[Ai++]=er,ki[Ai++]=tr,ki[Ai++]=qr,qr=t;var l=er;t=tr;var v=32-Ze(l)-1;l&=~(1<<v),s+=1;var x=32-Ze(i)+v;if(30<x){var N=v-v%5;x=(l&(1<<N)-1).toString(32),l>>=N,v-=N,er=1<<32-Ze(i)+v|s<<v|l,tr=x+t}else er=1<<x|s<<v|l,tr=t}function Hh(t){t.return!==null&&(_r(t,1),r_(t,1,0))}function $h(t){for(;t===fc;)fc=pa[--ga],pa[ga]=null,To=pa[--ga],pa[ga]=null;for(;t===qr;)qr=ki[--Ai],ki[Ai]=null,tr=ki[--Ai],ki[Ai]=null,er=ki[--Ai],ki[Ai]=null}function s_(t,i){ki[Ai++]=er,ki[Ai++]=tr,ki[Ai++]=qr,er=i.id,tr=i.overflow,qr=t}var Mn=null,It=null,lt=!1,Kr=null,Ti=!1,Uh=Error(a(519));function Vr(t){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ro(Ei(i,t)),Uh}function a_(t){var i=t.stateNode,s=t.type,l=t.memoizedProps;switch(i[Bt]=t,i[Mt]=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<Zo.length;s++)et(Zo[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),ks(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),la(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||x0(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=xe),i=!0):i=!1,i||Vr(t,!0)}function o_(t){for(Mn=t.return;Mn;)switch(Mn.tag){case 5:case 31:case 13:Ti=!1;return;case 27:case 3:Ti=!0;return;default:Mn=Mn.return}}function ma(t){if(t!==Mn)return!1;if(!lt)return o_(t),lt=!0,!1;var i=t.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||of(t.type,t.memoizedProps)),s=!s),s&&It&&Vr(t),o_(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));It=N0(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));It=N0(t)}else i===27?(i=It,ls(t.type)?(t=df,df=null,It=t):It=i):It=Mn?Li(t.stateNode.nextSibling):null;return!0}function Ns(){It=Mn=null,lt=!1}function Fh(){var t=Kr;return t!==null&&(ri===null?ri=t:ri.push.apply(ri,t),Kr=null),t}function Ro(t){Kr===null?Kr=[t]:Kr.push(t)}var Wh=O(null),Os=null,vr=null;function Yr(t,i,s){W(Wh,i._currentValue),i._currentValue=s}function br(t){t._currentValue=Wh.current,z(Wh)}function Gh(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 qh(t,i,s,l){var v=t.child;for(v!==null&&(v.return=t);v!==null;){var x=v.dependencies;if(x!==null){var N=v.child;x=x.firstContext;e:for(;x!==null;){var U=x;x=v;for(var ee=0;ee<i.length;ee++)if(U.context===i[ee]){x.lanes|=s,U=x.alternate,U!==null&&(U.lanes|=s),Gh(x.return,s,t),l||(N=null);break e}x=U.next}}else if(v.tag===18){if(N=v.return,N===null)throw Error(a(341));N.lanes|=s,x=N.alternate,x!==null&&(x.lanes|=s),Gh(N,s,t),N=null}else N=v.child;if(N!==null)N.return=v;else for(N=v;N!==null;){if(N===t){N=null;break}if(v=N.sibling,v!==null){v.return=N.return,N=v;break}N=N.return}v=N}}function _a(t,i,s,l){t=null;for(var v=i,x=!1;v!==null;){if(!x){if((v.flags&524288)!==0)x=!0;else if((v.flags&262144)!==0)break}if(v.tag===10){var N=v.alternate;if(N===null)throw Error(a(387));if(N=N.memoizedProps,N!==null){var U=v.type;hi(v.pendingProps.value,N.value)||(t!==null?t.push(U):t=[U])}}else if(v===te.current){if(N=v.alternate,N===null)throw Error(a(387));N.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(t!==null?t.push(nl):t=[nl])}v=v.return}t!==null&&qh(i,t,s,l),i.flags|=262144}function pc(t){for(t=t.firstContext;t!==null;){if(!hi(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Ds(t){Os=t,vr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Nn(t){return l_(Os,t)}function gc(t,i){return Os===null&&Ds(t),l_(t,i)}function l_(t,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},vr===null){if(t===null)throw Error(a(308));vr=i,t.dependencies={lanes:0,firstContext:i},t.flags|=524288}else vr=vr.next=i;return s}var N2=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()})}},O2=e.unstable_scheduleCallback,D2=e.unstable_NormalPriority,dn={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Kh(){return{controller:new N2,data:new Map,refCount:0}}function Lo(t){t.refCount--,t.refCount===0&&O2(D2,function(){t.controller.abort()})}var Mo=null,Vh=0,va=0,ba=null;function B2(t,i){if(Mo===null){var s=Mo=[];Vh=0,va=Zd(),ba={status:"pending",value:void 0,then:function(l){s.push(l)}}}return Vh++,i.then(c_,c_),i}function c_(){if(--Vh===0&&Mo!==null){ba!==null&&(ba.status="fulfilled");var t=Mo;Mo=null,va=0,ba=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function j2(t,i){var s=[],l={status:"pending",value:null,reason:null,then:function(v){s.push(v)}};return t.then(function(){l.status="fulfilled",l.value=i;for(var v=0;v<s.length;v++)(0,s[v])(i)},function(v){for(l.status="rejected",l.reason=v,v=0;v<s.length;v++)(0,s[v])(void 0)}),l}var u_=H.S;H.S=function(t,i){Kv=ut(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&B2(t,i),u_!==null&&u_(t,i)};var Bs=O(null);function Yh(){var t=Bs.current;return t!==null?t:Lt.pooledCache}function mc(t,i){i===null?W(Bs,Bs.current):W(Bs,i.pool)}function h_(){var t=Yh();return t===null?null:{parent:dn._currentValue,pool:t}}var ya=Error(a(460)),Xh=Error(a(474)),_c=Error(a(542)),vc={then:function(){}};function d_(t){return t=t.status,t==="fulfilled"||t==="rejected"}function f_(t,i,s){switch(s=t[s],s===void 0?t.push(i):s!==i&&(i.then(xe,xe),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,g_(t),t;default:if(typeof i.status=="string")i.then(xe,xe);else{if(t=Lt,t!==null&&100<t.shellSuspendCounter)throw Error(a(482));t=i,t.status="pending",t.then(function(l){if(i.status==="pending"){var v=i;v.status="fulfilled",v.value=l}},function(l){if(i.status==="pending"){var v=i;v.status="rejected",v.reason=l}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,g_(t),t}throw Is=i,ya}}function js(t){try{var i=t._init;return i(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Is=s,ya):s}}var Is=null;function p_(){if(Is===null)throw Error(a(459));var t=Is;return Is=null,t}function g_(t){if(t===ya||t===_c)throw Error(a(483))}var Sa=null,No=0;function bc(t){var i=No;return No+=1,Sa===null&&(Sa=[]),f_(Sa,t,i)}function Oo(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function yc(t,i){throw i.$$typeof===w?Error(a(525)):(t=Object.prototype.toString.call(i),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t)))}function m_(t){function i(re,ne){if(t){var ae=re.deletions;ae===null?(re.deletions=[ne],re.flags|=16):ae.push(ne)}}function s(re,ne){if(!t)return null;for(;ne!==null;)i(re,ne),ne=ne.sibling;return null}function l(re){for(var ne=new Map;re!==null;)re.key!==null?ne.set(re.key,re):ne.set(re.index,re),re=re.sibling;return ne}function v(re,ne){return re=mr(re,ne),re.index=0,re.sibling=null,re}function x(re,ne,ae){return re.index=ae,t?(ae=re.alternate,ae!==null?(ae=ae.index,ae<ne?(re.flags|=67108866,ne):ae):(re.flags|=67108866,ne)):(re.flags|=1048576,ne)}function N(re){return t&&re.alternate===null&&(re.flags|=67108866),re}function U(re,ne,ae,pe){return ne===null||ne.tag!==6?(ne=Ph(ae,re.mode,pe),ne.return=re,ne):(ne=v(ne,ae),ne.return=re,ne)}function ee(re,ne,ae,pe){var Be=ae.type;return Be===E?de(re,ne,ae.props.children,pe,ae.key):ne!==null&&(ne.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===T&&js(Be)===ne.type)?(ne=v(ne,ae.props),Oo(ne,ae),ne.return=re,ne):(ne=dc(ae.type,ae.key,ae.props,null,re.mode,pe),Oo(ne,ae),ne.return=re,ne)}function oe(re,ne,ae,pe){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==ae.containerInfo||ne.stateNode.implementation!==ae.implementation?(ne=zh(ae,re.mode,pe),ne.return=re,ne):(ne=v(ne,ae.children||[]),ne.return=re,ne)}function de(re,ne,ae,pe,Be){return ne===null||ne.tag!==7?(ne=Ms(ae,re.mode,pe,Be),ne.return=re,ne):(ne=v(ne,ae),ne.return=re,ne)}function me(re,ne,ae){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return ne=Ph(""+ne,re.mode,ae),ne.return=re,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case C:return ae=dc(ne.type,ne.key,ne.props,null,re.mode,ae),Oo(ae,ne),ae.return=re,ae;case A:return ne=zh(ne,re.mode,ae),ne.return=re,ne;case T:return ne=js(ne),me(re,ne,ae)}if(X(ne)||G(ne))return ne=Ms(ne,re.mode,ae,null),ne.return=re,ne;if(typeof ne.then=="function")return me(re,bc(ne),ae);if(ne.$$typeof===S)return me(re,gc(re,ne),ae);yc(re,ne)}return null}function ce(re,ne,ae,pe){var Be=ne!==null?ne.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return Be!==null?null:U(re,ne,""+ae,pe);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case C:return ae.key===Be?ee(re,ne,ae,pe):null;case A:return ae.key===Be?oe(re,ne,ae,pe):null;case T:return ae=js(ae),ce(re,ne,ae,pe)}if(X(ae)||G(ae))return Be!==null?null:de(re,ne,ae,pe,null);if(typeof ae.then=="function")return ce(re,ne,bc(ae),pe);if(ae.$$typeof===S)return ce(re,ne,gc(re,ae),pe);yc(re,ae)}return null}function ue(re,ne,ae,pe,Be){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return re=re.get(ae)||null,U(ne,re,""+pe,Be);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case C:return re=re.get(pe.key===null?ae:pe.key)||null,ee(ne,re,pe,Be);case A:return re=re.get(pe.key===null?ae:pe.key)||null,oe(ne,re,pe,Be);case T:return pe=js(pe),ue(re,ne,ae,pe,Be)}if(X(pe)||G(pe))return re=re.get(ae)||null,de(ne,re,pe,Be,null);if(typeof pe.then=="function")return ue(re,ne,ae,bc(pe),Be);if(pe.$$typeof===S)return ue(re,ne,ae,gc(ne,pe),Be);yc(ne,pe)}return null}function Ae(re,ne,ae,pe){for(var Be=null,pt=null,Re=ne,Ye=ne=0,st=null;Re!==null&&Ye<ae.length;Ye++){Re.index>Ye?(st=Re,Re=null):st=Re.sibling;var gt=ce(re,Re,ae[Ye],pe);if(gt===null){Re===null&&(Re=st);break}t&&Re&&gt.alternate===null&&i(re,Re),ne=x(gt,ne,Ye),pt===null?Be=gt:pt.sibling=gt,pt=gt,Re=st}if(Ye===ae.length)return s(re,Re),lt&&_r(re,Ye),Be;if(Re===null){for(;Ye<ae.length;Ye++)Re=me(re,ae[Ye],pe),Re!==null&&(ne=x(Re,ne,Ye),pt===null?Be=Re:pt.sibling=Re,pt=Re);return lt&&_r(re,Ye),Be}for(Re=l(Re);Ye<ae.length;Ye++)st=ue(Re,re,Ye,ae[Ye],pe),st!==null&&(t&&st.alternate!==null&&Re.delete(st.key===null?Ye:st.key),ne=x(st,ne,Ye),pt===null?Be=st:pt.sibling=st,pt=st);return t&&Re.forEach(function(fs){return i(re,fs)}),lt&&_r(re,Ye),Be}function ze(re,ne,ae,pe){if(ae==null)throw Error(a(151));for(var Be=null,pt=null,Re=ne,Ye=ne=0,st=null,gt=ae.next();Re!==null&&!gt.done;Ye++,gt=ae.next()){Re.index>Ye?(st=Re,Re=null):st=Re.sibling;var fs=ce(re,Re,gt.value,pe);if(fs===null){Re===null&&(Re=st);break}t&&Re&&fs.alternate===null&&i(re,Re),ne=x(fs,ne,Ye),pt===null?Be=fs:pt.sibling=fs,pt=fs,Re=st}if(gt.done)return s(re,Re),lt&&_r(re,Ye),Be;if(Re===null){for(;!gt.done;Ye++,gt=ae.next())gt=me(re,gt.value,pe),gt!==null&&(ne=x(gt,ne,Ye),pt===null?Be=gt:pt.sibling=gt,pt=gt);return lt&&_r(re,Ye),Be}for(Re=l(Re);!gt.done;Ye++,gt=ae.next())gt=ue(Re,re,Ye,gt.value,pe),gt!==null&&(t&&gt.alternate!==null&&Re.delete(gt.key===null?Ye:gt.key),ne=x(gt,ne,Ye),pt===null?Be=gt:pt.sibling=gt,pt=gt);return t&&Re.forEach(function(KE){return i(re,KE)}),lt&&_r(re,Ye),Be}function kt(re,ne,ae,pe){if(typeof ae=="object"&&ae!==null&&ae.type===E&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case C:e:{for(var Be=ae.key;ne!==null;){if(ne.key===Be){if(Be=ae.type,Be===E){if(ne.tag===7){s(re,ne.sibling),pe=v(ne,ae.props.children),pe.return=re,re=pe;break e}}else if(ne.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===T&&js(Be)===ne.type){s(re,ne.sibling),pe=v(ne,ae.props),Oo(pe,ae),pe.return=re,re=pe;break e}s(re,ne);break}else i(re,ne);ne=ne.sibling}ae.type===E?(pe=Ms(ae.props.children,re.mode,pe,ae.key),pe.return=re,re=pe):(pe=dc(ae.type,ae.key,ae.props,null,re.mode,pe),Oo(pe,ae),pe.return=re,re=pe)}return N(re);case A:e:{for(Be=ae.key;ne!==null;){if(ne.key===Be)if(ne.tag===4&&ne.stateNode.containerInfo===ae.containerInfo&&ne.stateNode.implementation===ae.implementation){s(re,ne.sibling),pe=v(ne,ae.children||[]),pe.return=re,re=pe;break e}else{s(re,ne);break}else i(re,ne);ne=ne.sibling}pe=zh(ae,re.mode,pe),pe.return=re,re=pe}return N(re);case T:return ae=js(ae),kt(re,ne,ae,pe)}if(X(ae))return Ae(re,ne,ae,pe);if(G(ae)){if(Be=G(ae),typeof Be!="function")throw Error(a(150));return ae=Be.call(ae),ze(re,ne,ae,pe)}if(typeof ae.then=="function")return kt(re,ne,bc(ae),pe);if(ae.$$typeof===S)return kt(re,ne,gc(re,ae),pe);yc(re,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,ne!==null&&ne.tag===6?(s(re,ne.sibling),pe=v(ne,ae),pe.return=re,re=pe):(s(re,ne),pe=Ph(ae,re.mode,pe),pe.return=re,re=pe),N(re)):s(re,ne)}return function(re,ne,ae,pe){try{No=0;var Be=kt(re,ne,ae,pe);return Sa=null,Be}catch(Re){if(Re===ya||Re===_c)throw Re;var pt=di(29,Re,null,re.mode);return pt.lanes=pe,pt.return=re,pt}}}var Ps=m_(!0),__=m_(!1),Xr=!1;function Zh(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jh(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 Zr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Jr(t,i,s){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(_t&2)!==0){var v=l.pending;return v===null?i.next=i:(i.next=v.next,v.next=i),l.pending=i,i=hc(t),e_(t,null,s),i}return uc(t,l,i,s),hc(t)}function Do(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,Pe(t,s)}}function Qh(t,i){var s=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,s===l)){var v=null,x=null;if(s=s.firstBaseUpdate,s!==null){do{var N={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};x===null?v=x=N:x=x.next=N,s=s.next}while(s!==null);x===null?v=x=i:x=x.next=i}else v=x=i;s={baseState:l.baseState,firstBaseUpdate:v,lastBaseUpdate:x,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 ed=!1;function Bo(){if(ed){var t=ba;if(t!==null)throw t}}function jo(t,i,s,l){ed=!1;var v=t.updateQueue;Xr=!1;var x=v.firstBaseUpdate,N=v.lastBaseUpdate,U=v.shared.pending;if(U!==null){v.shared.pending=null;var ee=U,oe=ee.next;ee.next=null,N===null?x=oe:N.next=oe,N=ee;var de=t.alternate;de!==null&&(de=de.updateQueue,U=de.lastBaseUpdate,U!==N&&(U===null?de.firstBaseUpdate=oe:U.next=oe,de.lastBaseUpdate=ee))}if(x!==null){var me=v.baseState;N=0,de=oe=ee=null,U=x;do{var ce=U.lane&-536870913,ue=ce!==U.lane;if(ue?(rt&ce)===ce:(l&ce)===ce){ce!==0&&ce===va&&(ed=!0),de!==null&&(de=de.next={lane:0,tag:U.tag,payload:U.payload,callback:null,next:null});e:{var Ae=t,ze=U;ce=i;var kt=s;switch(ze.tag){case 1:if(Ae=ze.payload,typeof Ae=="function"){me=Ae.call(kt,me,ce);break e}me=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=ze.payload,ce=typeof Ae=="function"?Ae.call(kt,me,ce):Ae,ce==null)break e;me=p({},me,ce);break e;case 2:Xr=!0}}ce=U.callback,ce!==null&&(t.flags|=64,ue&&(t.flags|=8192),ue=v.callbacks,ue===null?v.callbacks=[ce]:ue.push(ce))}else ue={lane:ce,tag:U.tag,payload:U.payload,callback:U.callback,next:null},de===null?(oe=de=ue,ee=me):de=de.next=ue,N|=ce;if(U=U.next,U===null){if(U=v.shared.pending,U===null)break;ue=U,U=ue.next,ue.next=null,v.lastBaseUpdate=ue,v.shared.pending=null}}while(!0);de===null&&(ee=me),v.baseState=ee,v.firstBaseUpdate=oe,v.lastBaseUpdate=de,x===null&&(v.shared.lanes=0),is|=N,t.lanes=N,t.memoizedState=me}}function v_(t,i){if(typeof t!="function")throw Error(a(191,t));t.call(i)}function b_(t,i){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)v_(s[t],i)}var wa=O(null),Sc=O(0);function y_(t,i){t=Tr,W(Sc,t),W(wa,i),Tr=t|i.baseLanes}function td(){W(Sc,Tr),W(wa,wa.current)}function nd(){Tr=Sc.current,z(wa),z(Sc)}var fi=O(null),Ri=null;function Qr(t){var i=t.alternate;W(ln,ln.current&1),W(fi,t),Ri===null&&(i===null||wa.current!==null||i.memoizedState!==null)&&(Ri=t)}function id(t){W(ln,ln.current),W(fi,t),Ri===null&&(Ri=t)}function S_(t){t.tag===22?(W(ln,ln.current),W(fi,t),Ri===null&&(Ri=t)):es()}function es(){W(ln,ln.current),W(fi,fi.current)}function pi(t){z(fi),Ri===t&&(Ri=null),z(ln)}var ln=O(0);function wc(t){for(var i=t;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||uf(s)||hf(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,qe=null,Ct=null,fn=null,xc=!1,xa=!1,zs=!1,Cc=0,Io=0,Ca=null,I2=0;function en(){throw Error(a(321))}function rd(t,i){if(i===null)return!1;for(var s=0;s<i.length&&s<t.length;s++)if(!hi(t[s],i[s]))return!1;return!0}function sd(t,i,s,l,v,x){return yr=x,qe=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,H.H=t===null||t.memoizedState===null?rv:yd,zs=!1,x=s(l,v),zs=!1,xa&&(x=x_(i,s,l,v)),w_(t),x}function w_(t){H.H=Ho;var i=Ct!==null&&Ct.next!==null;if(yr=0,fn=Ct=qe=null,xc=!1,Io=0,Ca=null,i)throw Error(a(300));t===null||pn||(t=t.dependencies,t!==null&&pc(t)&&(pn=!0))}function x_(t,i,s,l){qe=t;var v=0;do{if(xa&&(Ca=null),Io=0,xa=!1,25<=v)throw Error(a(301));if(v+=1,fn=Ct=null,t.updateQueue!=null){var x=t.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}H.H=sv,x=i(s,l)}while(xa);return x}function P2(){var t=H.H,i=t.useState()[0];return i=typeof i.then=="function"?Po(i):i,t=t.useState()[0],(Ct!==null?Ct.memoizedState:null)!==t&&(qe.flags|=1024),i}function ad(){var t=Cc!==0;return Cc=0,t}function od(t,i,s){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~s}function ld(t){if(xc){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}xc=!1}yr=0,fn=Ct=qe=null,xa=!1,Io=Cc=0,Ca=null}function Fn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return fn===null?qe.memoizedState=fn=t:fn=fn.next=t,fn}function cn(){if(Ct===null){var t=qe.alternate;t=t!==null?t.memoizedState:null}else t=Ct.next;var i=fn===null?qe.memoizedState:fn.next;if(i!==null)fn=i,Ct=t;else{if(t===null)throw qe.alternate===null?Error(a(467)):Error(a(310));Ct=t,t={memoizedState:Ct.memoizedState,baseState:Ct.baseState,baseQueue:Ct.baseQueue,queue:Ct.queue,next:null},fn===null?qe.memoizedState=fn=t:fn=fn.next=t}return fn}function Ec(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Po(t){var i=Io;return Io+=1,Ca===null&&(Ca=[]),t=f_(Ca,t,i),i=qe,(fn===null?i.memoizedState:fn.next)===null&&(i=i.alternate,H.H=i===null||i.memoizedState===null?rv:yd),t}function kc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Po(t);if(t.$$typeof===S)return Nn(t)}throw Error(a(438,String(t)))}function cd(t){var i=null,s=qe.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var l=qe.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(i={data:l.data.map(function(v){return v.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=Ec(),qe.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]=K;return i.index++,s}function Sr(t,i){return typeof i=="function"?i(t):i}function Ac(t){var i=cn();return ud(i,Ct,t)}function ud(t,i,s){var l=t.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=s;var v=t.baseQueue,x=l.pending;if(x!==null){if(v!==null){var N=v.next;v.next=x.next,x.next=N}i.baseQueue=v=x,l.pending=null}if(x=t.baseState,v===null)t.memoizedState=x;else{i=v.next;var U=N=null,ee=null,oe=i,de=!1;do{var me=oe.lane&-536870913;if(me!==oe.lane?(rt&me)===me:(yr&me)===me){var ce=oe.revertLane;if(ce===0)ee!==null&&(ee=ee.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),me===va&&(de=!0);else if((yr&ce)===ce){oe=oe.next,ce===va&&(de=!0);continue}else me={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},ee===null?(U=ee=me,N=x):ee=ee.next=me,qe.lanes|=ce,is|=ce;me=oe.action,zs&&s(x,me),x=oe.hasEagerState?oe.eagerState:s(x,me)}else ce={lane:me,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},ee===null?(U=ee=ce,N=x):ee=ee.next=ce,qe.lanes|=me,is|=me;oe=oe.next}while(oe!==null&&oe!==i);if(ee===null?N=x:ee.next=U,!hi(x,t.memoizedState)&&(pn=!0,de&&(s=ba,s!==null)))throw s;t.memoizedState=x,t.baseState=N,t.baseQueue=ee,l.lastRenderedState=x}return v===null&&(l.lanes=0),[t.memoizedState,l.dispatch]}function hd(t){var i=cn(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=t;var l=s.dispatch,v=s.pending,x=i.memoizedState;if(v!==null){s.pending=null;var N=v=v.next;do x=t(x,N.action),N=N.next;while(N!==v);hi(x,i.memoizedState)||(pn=!0),i.memoizedState=x,i.baseQueue===null&&(i.baseState=x),s.lastRenderedState=x}return[x,l]}function C_(t,i,s){var l=qe,v=cn(),x=lt;if(x){if(s===void 0)throw Error(a(407));s=s()}else s=i();var N=!hi((Ct||v).memoizedState,s);if(N&&(v.memoizedState=s,pn=!0),v=v.queue,pd(A_.bind(null,l,v,t),[t]),v.getSnapshot!==i||N||fn!==null&&fn.memoizedState.tag&1){if(l.flags|=2048,Ea(9,{destroy:void 0},k_.bind(null,l,v,s,i),null),Lt===null)throw Error(a(349));x||(yr&127)!==0||E_(l,i,s)}return s}function E_(t,i,s){t.flags|=16384,t={getSnapshot:i,value:s},i=qe.updateQueue,i===null?(i=Ec(),qe.updateQueue=i,i.stores=[t]):(s=i.stores,s===null?i.stores=[t]:s.push(t))}function k_(t,i,s,l){i.value=s,i.getSnapshot=l,T_(i)&&R_(t)}function A_(t,i,s){return s(function(){T_(i)&&R_(t)})}function T_(t){var i=t.getSnapshot;t=t.value;try{var s=i();return!hi(t,s)}catch{return!0}}function R_(t){var i=Ls(t,2);i!==null&&si(i,t,2)}function dd(t){var i=Fn();if(typeof t=="function"){var s=t;if(t=s(),zs){$e(!0);try{s()}finally{$e(!1)}}}return i.memoizedState=i.baseState=t,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sr,lastRenderedState:t},i}function L_(t,i,s,l){return t.baseState=s,ud(t,Ct,typeof l=="function"?l:Sr)}function z2(t,i,s,l,v){if(Lc(t))throw Error(a(485));if(t=i.action,t!==null){var x={payload:v,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){x.listeners.push(N)}};H.T!==null?s(!0):x.isTransition=!1,l(x),s=i.pending,s===null?(x.next=i.pending=x,M_(i,x)):(x.next=s.next,i.pending=s.next=x)}}function M_(t,i){var s=i.action,l=i.payload,v=t.state;if(i.isTransition){var x=H.T,N={};H.T=N;try{var U=s(v,l),ee=H.S;ee!==null&&ee(N,U),N_(t,i,U)}catch(oe){fd(t,i,oe)}finally{x!==null&&N.types!==null&&(x.types=N.types),H.T=x}}else try{x=s(v,l),N_(t,i,x)}catch(oe){fd(t,i,oe)}}function N_(t,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(l){O_(t,i,l)},function(l){return fd(t,i,l)}):O_(t,i,s)}function O_(t,i,s){i.status="fulfilled",i.value=s,D_(i),t.state=s,i=t.pending,i!==null&&(s=i.next,s===i?t.pending=null:(s=s.next,i.next=s,M_(t,s)))}function fd(t,i,s){var l=t.pending;if(t.pending=null,l!==null){l=l.next;do i.status="rejected",i.reason=s,D_(i),i=i.next;while(i!==l)}t.action=null}function D_(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function B_(t,i){return i}function j_(t,i){if(lt){var s=Lt.formState;if(s!==null){e:{var l=qe;if(lt){if(It){t:{for(var v=It,x=Ti;v.nodeType!==8;){if(!x){v=null;break t}if(v=Li(v.nextSibling),v===null){v=null;break t}}x=v.data,v=x==="F!"||x==="F"?v:null}if(v){It=Li(v.nextSibling),l=v.data==="F!";break e}}Vr(l)}l=!1}l&&(i=s[0])}}return s=Fn(),s.memoizedState=s.baseState=i,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:B_,lastRenderedState:i},s.queue=l,s=tv.bind(null,qe,l),l.dispatch=s,l=dd(!1),x=bd.bind(null,qe,!1,l.queue),l=Fn(),v={state:i,dispatch:null,action:t,pending:null},l.queue=v,s=z2.bind(null,qe,v,x,s),v.dispatch=s,l.memoizedState=t,[i,s,!1]}function I_(t){var i=cn();return P_(i,Ct,t)}function P_(t,i,s){if(i=ud(t,i,B_)[0],t=Ac(Sr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var l=Po(i)}catch(N){throw N===ya?_c:N}else l=i;i=cn();var v=i.queue,x=v.dispatch;return s!==i.memoizedState&&(qe.flags|=2048,Ea(9,{destroy:void 0},H2.bind(null,v,s),null)),[l,x,t]}function H2(t,i){t.action=i}function z_(t){var i=cn(),s=Ct;if(s!==null)return P_(i,s,t);cn(),i=i.memoizedState,s=cn();var l=s.queue.dispatch;return s.memoizedState=t,[i,l,!1]}function Ea(t,i,s,l){return t={tag:t,create:s,deps:l,inst:i,next:null},i=qe.updateQueue,i===null&&(i=Ec(),qe.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 H_(){return cn().memoizedState}function Tc(t,i,s,l){var v=Fn();qe.flags|=t,v.memoizedState=Ea(1|i,{destroy:void 0},s,l===void 0?null:l)}function Rc(t,i,s,l){var v=cn();l=l===void 0?null:l;var x=v.memoizedState.inst;Ct!==null&&l!==null&&rd(l,Ct.memoizedState.deps)?v.memoizedState=Ea(i,x,s,l):(qe.flags|=t,v.memoizedState=Ea(1|i,x,s,l))}function $_(t,i){Tc(8390656,8,t,i)}function pd(t,i){Rc(2048,8,t,i)}function $2(t){qe.flags|=4;var i=qe.updateQueue;if(i===null)i=Ec(),qe.updateQueue=i,i.events=[t];else{var s=i.events;s===null?i.events=[t]:s.push(t)}}function U_(t){var i=cn().memoizedState;return $2({ref:i,nextImpl:t}),function(){if((_t&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function F_(t,i){return Rc(4,2,t,i)}function W_(t,i){return Rc(4,4,t,i)}function G_(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 q_(t,i,s){s=s!=null?s.concat([t]):null,Rc(4,4,G_.bind(null,i,t),s)}function gd(){}function K_(t,i){var s=cn();i=i===void 0?null:i;var l=s.memoizedState;return i!==null&&rd(i,l[1])?l[0]:(s.memoizedState=[t,i],t)}function V_(t,i){var s=cn();i=i===void 0?null:i;var l=s.memoizedState;if(i!==null&&rd(i,l[1]))return l[0];if(l=t(),zs){$e(!0);try{t()}finally{$e(!1)}}return s.memoizedState=[l,i],l}function md(t,i,s){return s===void 0||(yr&1073741824)!==0&&(rt&261930)===0?t.memoizedState=i:(t.memoizedState=s,t=Yv(),qe.lanes|=t,is|=t,s)}function Y_(t,i,s,l){return hi(s,i)?s:wa.current!==null?(t=md(t,s,l),hi(t,i)||(pn=!0),t):(yr&42)===0||(yr&1073741824)!==0&&(rt&261930)===0?(pn=!0,t.memoizedState=s):(t=Yv(),qe.lanes|=t,is|=t,i)}function X_(t,i,s,l,v){var x=q.p;q.p=x!==0&&8>x?x:8;var N=H.T,U={};H.T=U,bd(t,!1,i,s);try{var ee=v(),oe=H.S;if(oe!==null&&oe(U,ee),ee!==null&&typeof ee=="object"&&typeof ee.then=="function"){var de=j2(ee,l);zo(t,i,de,_i(t))}else zo(t,i,l,_i(t))}catch(me){zo(t,i,{then:function(){},status:"rejected",reason:me},_i())}finally{q.p=x,N!==null&&U.types!==null&&(N.types=U.types),H.T=N}}function U2(){}function _d(t,i,s,l){if(t.tag!==5)throw Error(a(476));var v=Z_(t).queue;X_(t,v,i,V,s===null?U2:function(){return J_(t),s(l)})}function Z_(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sr,lastRenderedState:V},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sr,lastRenderedState:s},next:null},t.memoizedState=i,t=t.alternate,t!==null&&(t.memoizedState=i),i}function J_(t){var i=Z_(t);i.next===null&&(i=t.alternate.memoizedState),zo(t,i.next.queue,{},_i())}function vd(){return Nn(nl)}function Q_(){return cn().memoizedState}function ev(){return cn().memoizedState}function F2(t){for(var i=t.return;i!==null;){switch(i.tag){case 24:case 3:var s=_i();t=Zr(s);var l=Jr(i,t,s);l!==null&&(si(l,i,s),Do(l,i,s)),i={cache:Kh()},t.payload=i;return}i=i.return}}function W2(t,i,s){var l=_i();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Lc(t)?nv(i,s):(s=jh(t,i,s,l),s!==null&&(si(s,t,l),iv(s,i,l)))}function tv(t,i,s){var l=_i();zo(t,i,s,l)}function zo(t,i,s,l){var v={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Lc(t))nv(i,v);else{var x=t.alternate;if(t.lanes===0&&(x===null||x.lanes===0)&&(x=i.lastRenderedReducer,x!==null))try{var N=i.lastRenderedState,U=x(N,s);if(v.hasEagerState=!0,v.eagerState=U,hi(U,N))return uc(t,i,v,0),Lt===null&&cc(),!1}catch{}if(s=jh(t,i,v,l),s!==null)return si(s,t,l),iv(s,i,l),!0}return!1}function bd(t,i,s,l){if(l={lane:2,revertLane:Zd(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Lc(t)){if(i)throw Error(a(479))}else i=jh(t,s,l,2),i!==null&&si(i,t,2)}function Lc(t){var i=t.alternate;return t===qe||i!==null&&i===qe}function nv(t,i){xa=xc=!0;var s=t.pending;s===null?i.next=i:(i.next=s.next,s.next=i),t.pending=i}function iv(t,i,s){if((s&4194048)!==0){var l=i.lanes;l&=t.pendingLanes,s|=l,i.lanes=s,Pe(t,s)}}var Ho={readContext:Nn,use:kc,useCallback:en,useContext:en,useEffect:en,useImperativeHandle:en,useLayoutEffect:en,useInsertionEffect:en,useMemo:en,useReducer:en,useRef:en,useState:en,useDebugValue:en,useDeferredValue:en,useTransition:en,useSyncExternalStore:en,useId:en,useHostTransitionStatus:en,useFormState:en,useActionState:en,useOptimistic:en,useMemoCache:en,useCacheRefresh:en};Ho.useEffectEvent=en;var rv={readContext:Nn,use:kc,useCallback:function(t,i){return Fn().memoizedState=[t,i===void 0?null:i],t},useContext:Nn,useEffect:$_,useImperativeHandle:function(t,i,s){s=s!=null?s.concat([t]):null,Tc(4194308,4,G_.bind(null,i,t),s)},useLayoutEffect:function(t,i){return Tc(4194308,4,t,i)},useInsertionEffect:function(t,i){Tc(4,2,t,i)},useMemo:function(t,i){var s=Fn();i=i===void 0?null:i;var l=t();if(zs){$e(!0);try{t()}finally{$e(!1)}}return s.memoizedState=[l,i],l},useReducer:function(t,i,s){var l=Fn();if(s!==void 0){var v=s(i);if(zs){$e(!0);try{s(i)}finally{$e(!1)}}}else v=i;return l.memoizedState=l.baseState=v,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:v},l.queue=t,t=t.dispatch=W2.bind(null,qe,t),[l.memoizedState,t]},useRef:function(t){var i=Fn();return t={current:t},i.memoizedState=t},useState:function(t){t=dd(t);var i=t.queue,s=tv.bind(null,qe,i);return i.dispatch=s,[t.memoizedState,s]},useDebugValue:gd,useDeferredValue:function(t,i){var s=Fn();return md(s,t,i)},useTransition:function(){var t=dd(!1);return t=X_.bind(null,qe,t.queue,!0,!1),Fn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,s){var l=qe,v=Fn();if(lt){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),Lt===null)throw Error(a(349));(rt&127)!==0||E_(l,i,s)}v.memoizedState=s;var x={value:s,getSnapshot:i};return v.queue=x,$_(A_.bind(null,l,x,t),[t]),l.flags|=2048,Ea(9,{destroy:void 0},k_.bind(null,l,x,s,i),null),s},useId:function(){var t=Fn(),i=Lt.identifierPrefix;if(lt){var s=tr,l=er;s=(l&~(1<<32-Ze(l)-1)).toString(32)+s,i="_"+i+"R_"+s,s=Cc++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=I2++,i="_"+i+"r_"+s.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:vd,useFormState:j_,useActionState:j_,useOptimistic:function(t){var i=Fn();i.memoizedState=i.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=bd.bind(null,qe,!0,s),s.dispatch=i,[t,i]},useMemoCache:cd,useCacheRefresh:function(){return Fn().memoizedState=F2.bind(null,qe)},useEffectEvent:function(t){var i=Fn(),s={impl:t};return i.memoizedState=s,function(){if((_t&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},yd={readContext:Nn,use:kc,useCallback:K_,useContext:Nn,useEffect:pd,useImperativeHandle:q_,useInsertionEffect:F_,useLayoutEffect:W_,useMemo:V_,useReducer:Ac,useRef:H_,useState:function(){return Ac(Sr)},useDebugValue:gd,useDeferredValue:function(t,i){var s=cn();return Y_(s,Ct.memoizedState,t,i)},useTransition:function(){var t=Ac(Sr)[0],i=cn().memoizedState;return[typeof t=="boolean"?t:Po(t),i]},useSyncExternalStore:C_,useId:Q_,useHostTransitionStatus:vd,useFormState:I_,useActionState:I_,useOptimistic:function(t,i){var s=cn();return L_(s,Ct,t,i)},useMemoCache:cd,useCacheRefresh:ev};yd.useEffectEvent=U_;var sv={readContext:Nn,use:kc,useCallback:K_,useContext:Nn,useEffect:pd,useImperativeHandle:q_,useInsertionEffect:F_,useLayoutEffect:W_,useMemo:V_,useReducer:hd,useRef:H_,useState:function(){return hd(Sr)},useDebugValue:gd,useDeferredValue:function(t,i){var s=cn();return Ct===null?md(s,t,i):Y_(s,Ct.memoizedState,t,i)},useTransition:function(){var t=hd(Sr)[0],i=cn().memoizedState;return[typeof t=="boolean"?t:Po(t),i]},useSyncExternalStore:C_,useId:Q_,useHostTransitionStatus:vd,useFormState:z_,useActionState:z_,useOptimistic:function(t,i){var s=cn();return Ct!==null?L_(s,Ct,t,i):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:cd,useCacheRefresh:ev};sv.useEffectEvent=U_;function Sd(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 wd={enqueueSetState:function(t,i,s){t=t._reactInternals;var l=_i(),v=Zr(l);v.payload=i,s!=null&&(v.callback=s),i=Jr(t,v,l),i!==null&&(si(i,t,l),Do(i,t,l))},enqueueReplaceState:function(t,i,s){t=t._reactInternals;var l=_i(),v=Zr(l);v.tag=1,v.payload=i,s!=null&&(v.callback=s),i=Jr(t,v,l),i!==null&&(si(i,t,l),Do(i,t,l))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var s=_i(),l=Zr(s);l.tag=2,i!=null&&(l.callback=i),i=Jr(t,l,s),i!==null&&(si(i,t,s),Do(i,t,s))}};function av(t,i,s,l,v,x,N){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(l,x,N):i.prototype&&i.prototype.isPureReactComponent?!ko(s,l)||!ko(v,x):!0}function ov(t,i,s,l){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,l),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,l),i.state!==t&&wd.enqueueReplaceState(i,i.state,null)}function Hs(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 v in t)s[v]===void 0&&(s[v]=t[v])}return s}function lv(t){lc(t)}function cv(t){console.error(t)}function uv(t){lc(t)}function Mc(t,i){try{var s=t.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(l){setTimeout(function(){throw l})}}function hv(t,i,s){try{var l=t.onCaughtError;l(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function xd(t,i,s){return s=Zr(s),s.tag=3,s.payload={element:null},s.callback=function(){Mc(t,i)},s}function dv(t){return t=Zr(t),t.tag=3,t}function fv(t,i,s,l){var v=s.type.getDerivedStateFromError;if(typeof v=="function"){var x=l.value;t.payload=function(){return v(x)},t.callback=function(){hv(i,s,l)}}var N=s.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(t.callback=function(){hv(i,s,l),typeof v!="function"&&(rs===null?rs=new Set([this]):rs.add(this));var U=l.stack;this.componentDidCatch(l.value,{componentStack:U!==null?U:""})})}function G2(t,i,s,l,v){if(s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(i=s.alternate,i!==null&&_a(i,s,v,!0),s=fi.current,s!==null){switch(s.tag){case 31:case 13:return Ri===null?Fc():s.alternate===null&&tn===0&&(tn=3),s.flags&=-257,s.flags|=65536,s.lanes=v,l===vc?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([l]):i.add(l),Vd(t,l,v)),!1;case 22:return s.flags|=65536,l===vc?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)),Vd(t,l,v)),!1}throw Error(a(435,s.tag))}return Vd(t,l,v),Fc(),!1}if(lt)return i=fi.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=v,l!==Uh&&(t=Error(a(422),{cause:l}),Ro(Ei(t,s)))):(l!==Uh&&(i=Error(a(423),{cause:l}),Ro(Ei(i,s))),t=t.current.alternate,t.flags|=65536,v&=-v,t.lanes|=v,l=Ei(l,s),v=xd(t.stateNode,l,v),Qh(t,v),tn!==4&&(tn=2)),!1;var x=Error(a(520),{cause:l});if(x=Ei(x,s),Vo===null?Vo=[x]:Vo.push(x),tn!==4&&(tn=2),i===null)return!0;l=Ei(l,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,t=v&-v,s.lanes|=t,t=xd(s.stateNode,l,t),Qh(s,t),!1;case 1:if(i=s.type,x=s.stateNode,(s.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(rs===null||!rs.has(x))))return s.flags|=65536,v&=-v,s.lanes|=v,v=dv(v),fv(v,t,s,l),Qh(s,v),!1}s=s.return}while(s!==null);return!1}var Cd=Error(a(461)),pn=!1;function On(t,i,s,l){i.child=t===null?__(i,null,s,l):Ps(i,t.child,s,l)}function pv(t,i,s,l,v){s=s.render;var x=i.ref;if("ref"in l){var N={};for(var U in l)U!=="ref"&&(N[U]=l[U])}else N=l;return Ds(i),l=sd(t,i,s,N,x,v),U=ad(),t!==null&&!pn?(od(t,i,v),wr(t,i,v)):(lt&&U&&Hh(i),i.flags|=1,On(t,i,l,v),i.child)}function gv(t,i,s,l,v){if(t===null){var x=s.type;return typeof x=="function"&&!Ih(x)&&x.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=x,mv(t,i,x,l,v)):(t=dc(s.type,null,l,i,i.mode,v),t.ref=i.ref,t.return=i,i.child=t)}if(x=t.child,!Nd(t,v)){var N=x.memoizedProps;if(s=s.compare,s=s!==null?s:ko,s(N,l)&&t.ref===i.ref)return wr(t,i,v)}return i.flags|=1,t=mr(x,l),t.ref=i.ref,t.return=i,i.child=t}function mv(t,i,s,l,v){if(t!==null){var x=t.memoizedProps;if(ko(x,l)&&t.ref===i.ref)if(pn=!1,i.pendingProps=l=x,Nd(t,v))(t.flags&131072)!==0&&(pn=!0);else return i.lanes=t.lanes,wr(t,i,v)}return Ed(t,i,s,l,v)}function _v(t,i,s,l){var v=l.children,x=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(x=x!==null?x.baseLanes|s:s,t!==null){for(l=i.child=t.child,v=0;l!==null;)v=v|l.lanes|l.childLanes,l=l.sibling;l=v&~x}else l=0,i.child=null;return vv(t,i,x,s,l)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&mc(i,x!==null?x.cachePool:null),x!==null?y_(i,x):td(),S_(i);else return l=i.lanes=536870912,vv(t,i,x!==null?x.baseLanes|s:s,s,l)}else x!==null?(mc(i,x.cachePool),y_(i,x),es(),i.memoizedState=null):(t!==null&&mc(i,null),td(),es());return On(t,i,v,s),i.child}function $o(t,i){return t!==null&&t.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function vv(t,i,s,l,v){var x=Yh();return x=x===null?null:{parent:dn._currentValue,pool:x},i.memoizedState={baseLanes:s,cachePool:x},t!==null&&mc(i,null),td(),S_(i),t!==null&&_a(t,i,l,!0),i.childLanes=v,null}function Nc(t,i){return i=Dc({mode:i.mode,children:i.children},t.mode),i.ref=t.ref,t.child=i,i.return=t,i}function bv(t,i,s){return Ps(i,t.child,null,s),t=Nc(i,i.pendingProps),t.flags|=2,pi(i),i.memoizedState=null,t}function q2(t,i,s){var l=i.pendingProps,v=(i.flags&128)!==0;if(i.flags&=-129,t===null){if(lt){if(l.mode==="hidden")return t=Nc(i,l),i.lanes=536870912,$o(null,t);if(id(i),(t=It)?(t=M0(t,Ti),t=t!==null&&t.data==="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:qr!==null?{id:er,overflow:tr}:null,retryLane:536870912,hydrationErrors:null},s=n_(t),s.return=i,i.child=s,Mn=i,It=null)):t=null,t===null)throw Vr(i);return i.lanes=536870912,null}return Nc(i,l)}var x=t.memoizedState;if(x!==null){var N=x.dehydrated;if(id(i),v)if(i.flags&256)i.flags&=-257,i=bv(t,i,s);else if(i.memoizedState!==null)i.child=t.child,i.flags|=128,i=null;else throw Error(a(558));else if(pn||_a(t,i,s,!1),v=(s&t.childLanes)!==0,pn||v){if(l=Lt,l!==null&&(N=Vt(l,s),N!==0&&N!==x.retryLane))throw x.retryLane=N,Ls(t,N),si(l,t,N),Cd;Fc(),i=bv(t,i,s)}else t=x.treeContext,It=Li(N.nextSibling),Mn=i,lt=!0,Kr=null,Ti=!1,t!==null&&s_(i,t),i=Nc(i,l),i.flags|=4096;return i}return t=mr(t.child,{mode:l.mode,children:l.children}),t.ref=i.ref,i.child=t,t.return=i,t}function Oc(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 Ed(t,i,s,l,v){return Ds(i),s=sd(t,i,s,l,void 0,v),l=ad(),t!==null&&!pn?(od(t,i,v),wr(t,i,v)):(lt&&l&&Hh(i),i.flags|=1,On(t,i,s,v),i.child)}function yv(t,i,s,l,v,x){return Ds(i),i.updateQueue=null,s=x_(i,l,s,v),w_(t),l=ad(),t!==null&&!pn?(od(t,i,x),wr(t,i,x)):(lt&&l&&Hh(i),i.flags|=1,On(t,i,s,x),i.child)}function Sv(t,i,s,l,v){if(Ds(i),i.stateNode===null){var x=fa,N=s.contextType;typeof N=="object"&&N!==null&&(x=Nn(N)),x=new s(l,x),i.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=wd,i.stateNode=x,x._reactInternals=i,x=i.stateNode,x.props=l,x.state=i.memoizedState,x.refs={},Zh(i),N=s.contextType,x.context=typeof N=="object"&&N!==null?Nn(N):fa,x.state=i.memoizedState,N=s.getDerivedStateFromProps,typeof N=="function"&&(Sd(i,s,N,l),x.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(N=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),N!==x.state&&wd.enqueueReplaceState(x,x.state,null),jo(i,l,x,v),Bo(),x.state=i.memoizedState),typeof x.componentDidMount=="function"&&(i.flags|=4194308),l=!0}else if(t===null){x=i.stateNode;var U=i.memoizedProps,ee=Hs(s,U);x.props=ee;var oe=x.context,de=s.contextType;N=fa,typeof de=="object"&&de!==null&&(N=Nn(de));var me=s.getDerivedStateFromProps;de=typeof me=="function"||typeof x.getSnapshotBeforeUpdate=="function",U=i.pendingProps!==U,de||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(U||oe!==N)&&ov(i,x,l,N),Xr=!1;var ce=i.memoizedState;x.state=ce,jo(i,l,x,v),Bo(),oe=i.memoizedState,U||ce!==oe||Xr?(typeof me=="function"&&(Sd(i,s,me,l),oe=i.memoizedState),(ee=Xr||av(i,s,ee,l,ce,oe,N))?(de||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(i.flags|=4194308)):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=l,i.memoizedState=oe),x.props=l,x.state=oe,x.context=N,l=ee):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),l=!1)}else{x=i.stateNode,Jh(t,i),N=i.memoizedProps,de=Hs(s,N),x.props=de,me=i.pendingProps,ce=x.context,oe=s.contextType,ee=fa,typeof oe=="object"&&oe!==null&&(ee=Nn(oe)),U=s.getDerivedStateFromProps,(oe=typeof U=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(N!==me||ce!==ee)&&ov(i,x,l,ee),Xr=!1,ce=i.memoizedState,x.state=ce,jo(i,l,x,v),Bo();var ue=i.memoizedState;N!==me||ce!==ue||Xr||t!==null&&t.dependencies!==null&&pc(t.dependencies)?(typeof U=="function"&&(Sd(i,s,U,l),ue=i.memoizedState),(de=Xr||av(i,s,de,l,ce,ue,ee)||t!==null&&t.dependencies!==null&&pc(t.dependencies))?(oe||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(l,ue,ee),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(l,ue,ee)),typeof x.componentDidUpdate=="function"&&(i.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof x.componentDidUpdate!="function"||N===t.memoizedProps&&ce===t.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||N===t.memoizedProps&&ce===t.memoizedState||(i.flags|=1024),i.memoizedProps=l,i.memoizedState=ue),x.props=l,x.state=ue,x.context=ee,l=de):(typeof x.componentDidUpdate!="function"||N===t.memoizedProps&&ce===t.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||N===t.memoizedProps&&ce===t.memoizedState||(i.flags|=1024),l=!1)}return x=l,Oc(t,i),l=(i.flags&128)!==0,x||l?(x=i.stateNode,s=l&&typeof s.getDerivedStateFromError!="function"?null:x.render(),i.flags|=1,t!==null&&l?(i.child=Ps(i,t.child,null,v),i.child=Ps(i,null,s,v)):On(t,i,s,v),i.memoizedState=x.state,t=i.child):t=wr(t,i,v),t}function wv(t,i,s,l){return Ns(),i.flags|=256,On(t,i,s,l),i.child}var kd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ad(t){return{baseLanes:t,cachePool:h_()}}function Td(t,i,s){return t=t!==null?t.childLanes&~s:0,i&&(t|=mi),t}function xv(t,i,s){var l=i.pendingProps,v=!1,x=(i.flags&128)!==0,N;if((N=x)||(N=t!==null&&t.memoizedState===null?!1:(ln.current&2)!==0),N&&(v=!0,i.flags&=-129),N=(i.flags&32)!==0,i.flags&=-33,t===null){if(lt){if(v?Qr(i):es(),(t=It)?(t=M0(t,Ti),t=t!==null&&t.data!=="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:qr!==null?{id:er,overflow:tr}:null,retryLane:536870912,hydrationErrors:null},s=n_(t),s.return=i,i.child=s,Mn=i,It=null)):t=null,t===null)throw Vr(i);return hf(t)?i.lanes=32:i.lanes=536870912,null}var U=l.children;return l=l.fallback,v?(es(),v=i.mode,U=Dc({mode:"hidden",children:U},v),l=Ms(l,v,s,null),U.return=i,l.return=i,U.sibling=l,i.child=U,l=i.child,l.memoizedState=Ad(s),l.childLanes=Td(t,N,s),i.memoizedState=kd,$o(null,l)):(Qr(i),Rd(i,U))}var ee=t.memoizedState;if(ee!==null&&(U=ee.dehydrated,U!==null)){if(x)i.flags&256?(Qr(i),i.flags&=-257,i=Ld(t,i,s)):i.memoizedState!==null?(es(),i.child=t.child,i.flags|=128,i=null):(es(),U=l.fallback,v=i.mode,l=Dc({mode:"visible",children:l.children},v),U=Ms(U,v,s,null),U.flags|=2,l.return=i,U.return=i,l.sibling=U,i.child=l,Ps(i,t.child,null,s),l=i.child,l.memoizedState=Ad(s),l.childLanes=Td(t,N,s),i.memoizedState=kd,i=$o(null,l));else if(Qr(i),hf(U)){if(N=U.nextSibling&&U.nextSibling.dataset,N)var oe=N.dgst;N=oe,l=Error(a(419)),l.stack="",l.digest=N,Ro({value:l,source:null,stack:null}),i=Ld(t,i,s)}else if(pn||_a(t,i,s,!1),N=(s&t.childLanes)!==0,pn||N){if(N=Lt,N!==null&&(l=Vt(N,s),l!==0&&l!==ee.retryLane))throw ee.retryLane=l,Ls(t,l),si(N,t,l),Cd;uf(U)||Fc(),i=Ld(t,i,s)}else uf(U)?(i.flags|=192,i.child=t.child,i=null):(t=ee.treeContext,It=Li(U.nextSibling),Mn=i,lt=!0,Kr=null,Ti=!1,t!==null&&s_(i,t),i=Rd(i,l.children),i.flags|=4096);return i}return v?(es(),U=l.fallback,v=i.mode,ee=t.child,oe=ee.sibling,l=mr(ee,{mode:"hidden",children:l.children}),l.subtreeFlags=ee.subtreeFlags&65011712,oe!==null?U=mr(oe,U):(U=Ms(U,v,s,null),U.flags|=2),U.return=i,l.return=i,l.sibling=U,i.child=l,$o(null,l),l=i.child,U=t.child.memoizedState,U===null?U=Ad(s):(v=U.cachePool,v!==null?(ee=dn._currentValue,v=v.parent!==ee?{parent:ee,pool:ee}:v):v=h_(),U={baseLanes:U.baseLanes|s,cachePool:v}),l.memoizedState=U,l.childLanes=Td(t,N,s),i.memoizedState=kd,$o(t.child,l)):(Qr(i),s=t.child,t=s.sibling,s=mr(s,{mode:"visible",children:l.children}),s.return=i,s.sibling=null,t!==null&&(N=i.deletions,N===null?(i.deletions=[t],i.flags|=16):N.push(t)),i.child=s,i.memoizedState=null,s)}function Rd(t,i){return i=Dc({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function Dc(t,i){return t=di(22,t,null,i),t.lanes=0,t}function Ld(t,i,s){return Ps(i,t.child,null,s),t=Rd(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function Cv(t,i,s){t.lanes|=i;var l=t.alternate;l!==null&&(l.lanes|=i),Gh(t.return,i,s)}function Md(t,i,s,l,v,x){var N=t.memoizedState;N===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:l,tail:s,tailMode:v,treeForkCount:x}:(N.isBackwards=i,N.rendering=null,N.renderingStartTime=0,N.last=l,N.tail=s,N.tailMode=v,N.treeForkCount=x)}function Ev(t,i,s){var l=i.pendingProps,v=l.revealOrder,x=l.tail;l=l.children;var N=ln.current,U=(N&2)!==0;if(U?(N=N&1|2,i.flags|=128):N&=1,W(ln,N),On(t,i,l,s),l=lt?To:0,!U&&t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Cv(t,s,i);else if(t.tag===19)Cv(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(v){case"forwards":for(s=i.child,v=null;s!==null;)t=s.alternate,t!==null&&wc(t)===null&&(v=s),s=s.sibling;s=v,s===null?(v=i.child,i.child=null):(v=s.sibling,s.sibling=null),Md(i,!1,v,s,x,l);break;case"backwards":case"unstable_legacy-backwards":for(s=null,v=i.child,i.child=null;v!==null;){if(t=v.alternate,t!==null&&wc(t)===null){i.child=v;break}t=v.sibling,v.sibling=s,s=v,v=t}Md(i,!0,s,null,x,l);break;case"together":Md(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),is|=i.lanes,(s&i.childLanes)===0)if(t!==null){if(_a(t,i,s,!1),(s&i.childLanes)===0)return null}else return null;if(t!==null&&i.child!==t.child)throw Error(a(153));if(i.child!==null){for(t=i.child,s=mr(t,t.pendingProps),i.child=s,s.return=i;t.sibling!==null;)t=t.sibling,s=s.sibling=mr(t,t.pendingProps),s.return=i;s.sibling=null}return i.child}function Nd(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&pc(t)))}function K2(t,i,s){switch(i.tag){case 3:$(i,i.stateNode.containerInfo),Yr(i,dn,t.memoizedState.cache),Ns();break;case 27:case 5:ge(i);break;case 4:$(i,i.stateNode.containerInfo);break;case 10:Yr(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,id(i),null;break;case 13:var l=i.memoizedState;if(l!==null)return l.dehydrated!==null?(Qr(i),i.flags|=128,null):(s&i.child.childLanes)!==0?xv(t,i,s):(Qr(i),t=wr(t,i,s),t!==null?t.sibling:null);Qr(i);break;case 19:var v=(t.flags&128)!==0;if(l=(s&i.childLanes)!==0,l||(_a(t,i,s,!1),l=(s&i.childLanes)!==0),v){if(l)return Ev(t,i,s);i.flags|=128}if(v=i.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),W(ln,ln.current),l)break;return null;case 22:return i.lanes=0,_v(t,i,s,i.pendingProps);case 24:Yr(i,dn,t.memoizedState.cache)}return wr(t,i,s)}function kv(t,i,s){if(t!==null)if(t.memoizedProps!==i.pendingProps)pn=!0;else{if(!Nd(t,s)&&(i.flags&128)===0)return pn=!1,K2(t,i,s);pn=(t.flags&131072)!==0}else pn=!1,lt&&(i.flags&1048576)!==0&&r_(i,To,i.index);switch(i.lanes=0,i.tag){case 16:e:{var l=i.pendingProps;if(t=js(i.elementType),i.type=t,typeof t=="function")Ih(t)?(l=Hs(t,l),i.tag=1,i=Sv(null,i,t,l,s)):(i.tag=0,i=Ed(null,i,t,l,s));else{if(t!=null){var v=t.$$typeof;if(v===k){i.tag=11,i=pv(null,i,t,l,s);break e}else if(v===M){i.tag=14,i=gv(null,i,t,l,s);break e}}throw i=Y(t)||t,Error(a(306,i,""))}}return i;case 0:return Ed(t,i,i.type,i.pendingProps,s);case 1:return l=i.type,v=Hs(l,i.pendingProps),Sv(t,i,l,v,s);case 3:e:{if($(i,i.stateNode.containerInfo),t===null)throw Error(a(387));l=i.pendingProps;var x=i.memoizedState;v=x.element,Jh(t,i),jo(i,l,null,s);var N=i.memoizedState;if(l=N.cache,Yr(i,dn,l),l!==x.cache&&qh(i,[dn],s,!0),Bo(),l=N.element,x.isDehydrated)if(x={element:l,isDehydrated:!1,cache:N.cache},i.updateQueue.baseState=x,i.memoizedState=x,i.flags&256){i=wv(t,i,l,s);break e}else if(l!==v){v=Ei(Error(a(424)),i),Ro(v),i=wv(t,i,l,s);break e}else for(t=i.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,It=Li(t.firstChild),Mn=i,lt=!0,Kr=null,Ti=!0,s=__(i,null,l,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Ns(),l===v){i=wr(t,i,s);break e}On(t,i,l,s)}i=i.child}return i;case 26:return Oc(t,i),t===null?(s=I0(i.type,null,i.pendingProps,null))?i.memoizedState=s:lt||(s=i.type,t=i.pendingProps,l=Xc(he.current).createElement(s),l[Bt]=i,l[Mt]=t,Dn(l,s,t),Je(l),i.stateNode=l):i.memoizedState=I0(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return ge(i),t===null&&lt&&(l=i.stateNode=D0(i.type,i.pendingProps,he.current),Mn=i,Ti=!0,v=It,ls(i.type)?(df=v,It=Li(l.firstChild)):It=v),On(t,i,i.pendingProps.children,s),Oc(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&&lt&&((v=l=It)&&(l=xE(l,i.type,i.pendingProps,Ti),l!==null?(i.stateNode=l,Mn=i,It=Li(l.firstChild),Ti=!1,v=!0):v=!1),v||Vr(i)),ge(i),v=i.type,x=i.pendingProps,N=t!==null?t.memoizedProps:null,l=x.children,of(v,x)?l=null:N!==null&&of(v,N)&&(i.flags|=32),i.memoizedState!==null&&(v=sd(t,i,P2,null,null,s),nl._currentValue=v),Oc(t,i),On(t,i,l,s),i.child;case 6:return t===null&&lt&&((t=s=It)&&(s=CE(s,i.pendingProps,Ti),s!==null?(i.stateNode=s,Mn=i,It=null,t=!0):t=!1),t||Vr(i)),null;case 13:return xv(t,i,s);case 4:return $(i,i.stateNode.containerInfo),l=i.pendingProps,t===null?i.child=Ps(i,null,l,s):On(t,i,l,s),i.child;case 11:return pv(t,i,i.type,i.pendingProps,s);case 7:return On(t,i,i.pendingProps,s),i.child;case 8:return On(t,i,i.pendingProps.children,s),i.child;case 12:return On(t,i,i.pendingProps.children,s),i.child;case 10:return l=i.pendingProps,Yr(i,i.type,l.value),On(t,i,l.children,s),i.child;case 9:return v=i.type._context,l=i.pendingProps.children,Ds(i),v=Nn(v),l=l(v),i.flags|=1,On(t,i,l,s),i.child;case 14:return gv(t,i,i.type,i.pendingProps,s);case 15:return mv(t,i,i.type,i.pendingProps,s);case 19:return Ev(t,i,s);case 31:return q2(t,i,s);case 22:return _v(t,i,s,i.pendingProps);case 24:return Ds(i),l=Nn(dn),t===null?(v=Yh(),v===null&&(v=Lt,x=Kh(),v.pooledCache=x,x.refCount++,x!==null&&(v.pooledCacheLanes|=s),v=x),i.memoizedState={parent:l,cache:v},Zh(i),Yr(i,dn,v)):((t.lanes&s)!==0&&(Jh(t,i),jo(i,null,null,s),Bo()),v=t.memoizedState,x=i.memoizedState,v.parent!==l?(v={parent:l,cache:l},i.memoizedState=v,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=v),Yr(i,dn,l)):(l=x.cache,Yr(i,dn,l),l!==v.cache&&qh(i,[dn],s,!0))),On(t,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function xr(t){t.flags|=4}function Od(t,i,s,l,v){if((i=(t.mode&32)!==0)&&(i=!1),i){if(t.flags|=16777216,(v&335544128)===v)if(t.stateNode.complete)t.flags|=8192;else if(Qv())t.flags|=8192;else throw Is=vc,Xh}else t.flags&=-16777217}function Av(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!U0(i))if(Qv())t.flags|=8192;else throw Is=vc,Xh}function Bc(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?Oe():536870912,t.lanes|=i,Ra|=i)}function Uo(t,i){if(!lt)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 Pt(t){var i=t.alternate!==null&&t.alternate.child===t.child,s=0,l=0;if(i)for(var v=t.child;v!==null;)s|=v.lanes|v.childLanes,l|=v.subtreeFlags&65011712,l|=v.flags&65011712,v.return=t,v=v.sibling;else for(v=t.child;v!==null;)s|=v.lanes|v.childLanes,l|=v.subtreeFlags,l|=v.flags,v.return=t,v=v.sibling;return t.subtreeFlags|=l,t.childLanes=s,i}function V2(t,i,s){var l=i.pendingProps;switch($h(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pt(i),null;case 1:return Pt(i),null;case 3:return s=i.stateNode,l=null,t!==null&&(l=t.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),br(dn),le(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(ma(i)?xr(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Fh())),Pt(i),null;case 26:var v=i.type,x=i.memoizedState;return t===null?(xr(i),x!==null?(Pt(i),Av(i,x)):(Pt(i),Od(i,v,null,l,s))):x?x!==t.memoizedState?(xr(i),Pt(i),Av(i,x)):(Pt(i),i.flags&=-16777217):(t=t.memoizedProps,t!==l&&xr(i),Pt(i),Od(i,v,t,l,s)),null;case 27:if(we(i),s=he.current,v=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==l&&xr(i);else{if(!l){if(i.stateNode===null)throw Error(a(166));return Pt(i),null}t=Z.current,ma(i)?a_(i):(t=D0(v,l,s),i.stateNode=t,xr(i))}return Pt(i),null;case 5:if(we(i),v=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==l&&xr(i);else{if(!l){if(i.stateNode===null)throw Error(a(166));return Pt(i),null}if(x=Z.current,ma(i))a_(i);else{var N=Xc(he.current);switch(x){case 1:x=N.createElementNS("http://www.w3.org/2000/svg",v);break;case 2:x=N.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;default:switch(v){case"svg":x=N.createElementNS("http://www.w3.org/2000/svg",v);break;case"math":x=N.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;case"script":x=N.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof l.is=="string"?N.createElement("select",{is:l.is}):N.createElement("select"),l.multiple?x.multiple=!0:l.size&&(x.size=l.size);break;default:x=typeof l.is=="string"?N.createElement(v,{is:l.is}):N.createElement(v)}}x[Bt]=i,x[Mt]=l;e:for(N=i.child;N!==null;){if(N.tag===5||N.tag===6)x.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===i)break e;for(;N.sibling===null;){if(N.return===null||N.return===i)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}i.stateNode=x;e:switch(Dn(x,v,l),v){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&xr(i)}}return Pt(i),Od(i,i.type,t===null?null:t.memoizedProps,i.pendingProps,s),null;case 6:if(t&&i.stateNode!=null)t.memoizedProps!==l&&xr(i);else{if(typeof l!="string"&&i.stateNode===null)throw Error(a(166));if(t=he.current,ma(i)){if(t=i.stateNode,s=i.memoizedProps,l=null,v=Mn,v!==null)switch(v.tag){case 27:case 5:l=v.memoizedProps}t[Bt]=i,t=!!(t.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||x0(t.nodeValue,s)),t||Vr(i,!0)}else t=Xc(t).createTextNode(l),t[Bt]=i,i.stateNode=t}return Pt(i),null;case 31:if(s=i.memoizedState,t===null||t.memoizedState!==null){if(l=ma(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[Bt]=i}else Ns(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Pt(i),t=!1}else s=Fh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return i.flags&256?(pi(i),i):(pi(i),null);if((i.flags&128)!==0)throw Error(a(558))}return Pt(i),null;case 13:if(l=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(v=ma(i),l!==null&&l.dehydrated!==null){if(t===null){if(!v)throw Error(a(318));if(v=i.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(a(317));v[Bt]=i}else Ns(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Pt(i),v=!1}else v=Fh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=v),v=!0;if(!v)return i.flags&256?(pi(i),i):(pi(i),null)}return pi(i),(i.flags&128)!==0?(i.lanes=s,i):(s=l!==null,t=t!==null&&t.memoizedState!==null,s&&(l=i.child,v=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(v=l.alternate.memoizedState.cachePool.pool),x=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(x=l.memoizedState.cachePool.pool),x!==v&&(l.flags|=2048)),s!==t&&s&&(i.child.flags|=8192),Bc(i,i.updateQueue),Pt(i),null);case 4:return le(),t===null&&tf(i.stateNode.containerInfo),Pt(i),null;case 10:return br(i.type),Pt(i),null;case 19:if(z(ln),l=i.memoizedState,l===null)return Pt(i),null;if(v=(i.flags&128)!==0,x=l.rendering,x===null)if(v)Uo(l,!1);else{if(tn!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(x=wc(t),x!==null){for(i.flags|=128,Uo(l,!1),t=x.updateQueue,i.updateQueue=t,Bc(i,t),i.subtreeFlags=0,t=s,s=i.child;s!==null;)t_(s,t),s=s.sibling;return W(ln,ln.current&1|2),lt&&_r(i,l.treeForkCount),i.child}t=t.sibling}l.tail!==null&&ut()>Hc&&(i.flags|=128,v=!0,Uo(l,!1),i.lanes=4194304)}else{if(!v)if(t=wc(x),t!==null){if(i.flags|=128,v=!0,t=t.updateQueue,i.updateQueue=t,Bc(i,t),Uo(l,!0),l.tail===null&&l.tailMode==="hidden"&&!x.alternate&&!lt)return Pt(i),null}else 2*ut()-l.renderingStartTime>Hc&&s!==536870912&&(i.flags|=128,v=!0,Uo(l,!1),i.lanes=4194304);l.isBackwards?(x.sibling=i.child,i.child=x):(t=l.last,t!==null?t.sibling=x:i.child=x,l.last=x)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=ut(),t.sibling=null,s=ln.current,W(ln,v?s&1|2:s&1),lt&&_r(i,l.treeForkCount),t):(Pt(i),null);case 22:case 23:return pi(i),nd(),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&&(Pt(i),i.subtreeFlags&6&&(i.flags|=8192)):Pt(i),s=i.updateQueue,s!==null&&Bc(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&&z(Bs),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),br(dn),Pt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function Y2(t,i){switch($h(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return br(dn),le(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 26:case 27:case 5:return we(i),null;case 31:if(i.memoizedState!==null){if(pi(i),i.alternate===null)throw Error(a(340));Ns()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 13:if(pi(i),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Ns()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return z(ln),null;case 4:return le(),null;case 10:return br(i.type),null;case 22:case 23:return pi(i),nd(),t!==null&&z(Bs),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 24:return br(dn),null;case 25:return null;default:return null}}function Tv(t,i){switch($h(i),i.tag){case 3:br(dn),le();break;case 26:case 27:case 5:we(i);break;case 4:le();break;case 31:i.memoizedState!==null&&pi(i);break;case 13:pi(i);break;case 19:z(ln);break;case 10:br(i.type);break;case 22:case 23:pi(i),nd(),t!==null&&z(Bs);break;case 24:br(dn)}}function Fo(t,i){try{var s=i.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var v=l.next;s=v;do{if((s.tag&t)===t){l=void 0;var x=s.create,N=s.inst;l=x(),N.destroy=l}s=s.next}while(s!==v)}}catch(U){wt(i,i.return,U)}}function ts(t,i,s){try{var l=i.updateQueue,v=l!==null?l.lastEffect:null;if(v!==null){var x=v.next;l=x;do{if((l.tag&t)===t){var N=l.inst,U=N.destroy;if(U!==void 0){N.destroy=void 0,v=i;var ee=s,oe=U;try{oe()}catch(de){wt(v,ee,de)}}}l=l.next}while(l!==x)}}catch(de){wt(i,i.return,de)}}function Rv(t){var i=t.updateQueue;if(i!==null){var s=t.stateNode;try{b_(i,s)}catch(l){wt(t,t.return,l)}}}function Lv(t,i,s){s.props=Hs(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(l){wt(t,i,l)}}function Wo(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(v){wt(t,i,v)}}function nr(t,i){var s=t.ref,l=t.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(v){wt(t,i,v)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(v){wt(t,i,v)}else s.current=null}function Mv(t){var i=t.type,s=t.memoizedProps,l=t.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&l.focus();break e;case"img":s.src?l.src=s.src:s.srcSet&&(l.srcset=s.srcSet)}}catch(v){wt(t,t.return,v)}}function Dd(t,i,s){try{var l=t.stateNode;_E(l,t.type,s,i),l[Mt]=i}catch(v){wt(t,t.return,v)}}function Nv(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ls(t.type)||t.tag===4}function Bd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Nv(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&&ls(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 jd(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=xe));else if(l!==4&&(l===27&&ls(t.type)&&(s=t.stateNode,i=null),t=t.child,t!==null))for(jd(t,i,s),t=t.sibling;t!==null;)jd(t,i,s),t=t.sibling}function jc(t,i,s){var l=t.tag;if(l===5||l===6)t=t.stateNode,i?s.insertBefore(t,i):s.appendChild(t);else if(l!==4&&(l===27&&ls(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(jc(t,i,s),t=t.sibling;t!==null;)jc(t,i,s),t=t.sibling}function Ov(t){var i=t.stateNode,s=t.memoizedProps;try{for(var l=t.type,v=i.attributes;v.length;)i.removeAttributeNode(v[0]);Dn(i,l,s),i[Bt]=t,i[Mt]=s}catch(x){wt(t,t.return,x)}}var Cr=!1,gn=!1,Id=!1,Dv=typeof WeakSet=="function"?WeakSet:Set,Sn=null;function X2(t,i){if(t=t.containerInfo,sf=iu,t=qm(t),Lh(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 v=l.anchorOffset,x=l.focusNode;l=l.focusOffset;try{s.nodeType,x.nodeType}catch{s=null;break e}var N=0,U=-1,ee=-1,oe=0,de=0,me=t,ce=null;t:for(;;){for(var ue;me!==s||v!==0&&me.nodeType!==3||(U=N+v),me!==x||l!==0&&me.nodeType!==3||(ee=N+l),me.nodeType===3&&(N+=me.nodeValue.length),(ue=me.firstChild)!==null;)ce=me,me=ue;for(;;){if(me===t)break t;if(ce===s&&++oe===v&&(U=N),ce===x&&++de===l&&(ee=N),(ue=me.nextSibling)!==null)break;me=ce,ce=me.parentNode}me=ue}s=U===-1||ee===-1?null:{start:U,end:ee}}else s=null}s=s||{start:0,end:0}}else s=null;for(af={focusedElem:t,selectionRange:s},iu=!1,Sn=i;Sn!==null;)if(i=Sn,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,Sn=t;else for(;Sn!==null;){switch(i=Sn,x=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++)v=t[s],v.ref.impl=v.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&x!==null){t=void 0,s=i,v=x.memoizedProps,x=x.memoizedState,l=s.stateNode;try{var Ae=Hs(s.type,v);t=l.getSnapshotBeforeUpdate(Ae,x),l.__reactInternalSnapshotBeforeUpdate=t}catch(ze){wt(s,s.return,ze)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,s=t.nodeType,s===9)cf(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":cf(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,Sn=t;break}Sn=i.return}}function Bv(t,i,s){var l=s.flags;switch(s.tag){case 0:case 11:case 15:kr(t,s),l&4&&Fo(5,s);break;case 1:if(kr(t,s),l&4)if(t=s.stateNode,i===null)try{t.componentDidMount()}catch(N){wt(s,s.return,N)}else{var v=Hs(s.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(v,i,t.__reactInternalSnapshotBeforeUpdate)}catch(N){wt(s,s.return,N)}}l&64&&Rv(s),l&512&&Wo(s,s.return);break;case 3:if(kr(t,s),l&64&&(t=s.updateQueue,t!==null)){if(i=null,s.child!==null)switch(s.child.tag){case 27:case 5:i=s.child.stateNode;break;case 1:i=s.child.stateNode}try{b_(t,i)}catch(N){wt(s,s.return,N)}}break;case 27:i===null&&l&4&&Ov(s);case 26:case 5:kr(t,s),i===null&&l&4&&Mv(s),l&512&&Wo(s,s.return);break;case 12:kr(t,s);break;case 31:kr(t,s),l&4&&Pv(t,s);break;case 13:kr(t,s),l&4&&zv(t,s),l&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=sE.bind(null,s),EE(t,s))));break;case 22:if(l=s.memoizedState!==null||Cr,!l){i=i!==null&&i.memoizedState!==null||gn,v=Cr;var x=gn;Cr=l,(gn=i)&&!x?Ar(t,s,(s.subtreeFlags&8772)!==0):kr(t,s),Cr=v,gn=x}break;case 30:break;default:kr(t,s)}}function jv(t){var i=t.alternate;i!==null&&(t.alternate=null,jv(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&Ne(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 Wt=null,ti=!1;function Er(t,i,s){for(s=s.child;s!==null;)Iv(t,i,s),s=s.sibling}function Iv(t,i,s){if(ve&&typeof ve.onCommitFiberUnmount=="function")try{ve.onCommitFiberUnmount(An,s)}catch{}switch(s.tag){case 26:gn||nr(s,i),Er(t,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:gn||nr(s,i);var l=Wt,v=ti;ls(s.type)&&(Wt=s.stateNode,ti=!1),Er(t,i,s),Qo(s.stateNode),Wt=l,ti=v;break;case 5:gn||nr(s,i);case 6:if(l=Wt,v=ti,Wt=null,Er(t,i,s),Wt=l,ti=v,Wt!==null)if(ti)try{(Wt.nodeType===9?Wt.body:Wt.nodeName==="HTML"?Wt.ownerDocument.body:Wt).removeChild(s.stateNode)}catch(x){wt(s,i,x)}else try{Wt.removeChild(s.stateNode)}catch(x){wt(s,i,x)}break;case 18:Wt!==null&&(ti?(t=Wt,R0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),Ia(t)):R0(Wt,s.stateNode));break;case 4:l=Wt,v=ti,Wt=s.stateNode.containerInfo,ti=!0,Er(t,i,s),Wt=l,ti=v;break;case 0:case 11:case 14:case 15:ts(2,s,i),gn||ts(4,s,i),Er(t,i,s);break;case 1:gn||(nr(s,i),l=s.stateNode,typeof l.componentWillUnmount=="function"&&Lv(s,i,l)),Er(t,i,s);break;case 21:Er(t,i,s);break;case 22:gn=(l=gn)||s.memoizedState!==null,Er(t,i,s),gn=l;break;default:Er(t,i,s)}}function Pv(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Ia(t)}catch(s){wt(i,i.return,s)}}}function zv(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ia(t)}catch(s){wt(i,i.return,s)}}function Z2(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new Dv),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new Dv),i;default:throw Error(a(435,t.tag))}}function Ic(t,i){var s=Z2(t);i.forEach(function(l){if(!s.has(l)){s.add(l);var v=aE.bind(null,t,l);l.then(v,v)}})}function ni(t,i){var s=i.deletions;if(s!==null)for(var l=0;l<s.length;l++){var v=s[l],x=t,N=i,U=N;e:for(;U!==null;){switch(U.tag){case 27:if(ls(U.type)){Wt=U.stateNode,ti=!1;break e}break;case 5:Wt=U.stateNode,ti=!1;break e;case 3:case 4:Wt=U.stateNode.containerInfo,ti=!0;break e}U=U.return}if(Wt===null)throw Error(a(160));Iv(x,N,v),Wt=null,ti=!1,x=v.alternate,x!==null&&(x.return=null),v.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Hv(i,t),i=i.sibling}var Wi=null;function Hv(t,i){var s=t.alternate,l=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:ni(i,t),ii(t),l&4&&(ts(3,t,t.return),Fo(3,t),ts(5,t,t.return));break;case 1:ni(i,t),ii(t),l&512&&(gn||s===null||nr(s,s.return)),l&64&&Cr&&(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 v=Wi;if(ni(i,t),ii(t),l&512&&(gn||s===null||nr(s,s.return)),l&4){var x=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,v=v.ownerDocument||v;t:switch(l){case"title":x=v.getElementsByTagName("title")[0],(!x||x[Qi]||x[Bt]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=v.createElement(l),v.head.insertBefore(x,v.querySelector("head > title"))),Dn(x,l,s),x[Bt]=t,Je(x),l=x;break e;case"link":var N=H0("link","href",v).get(l+(s.href||""));if(N){for(var U=0;U<N.length;U++)if(x=N[U],x.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&x.getAttribute("rel")===(s.rel==null?null:s.rel)&&x.getAttribute("title")===(s.title==null?null:s.title)&&x.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){N.splice(U,1);break t}}x=v.createElement(l),Dn(x,l,s),v.head.appendChild(x);break;case"meta":if(N=H0("meta","content",v).get(l+(s.content||""))){for(U=0;U<N.length;U++)if(x=N[U],x.getAttribute("content")===(s.content==null?null:""+s.content)&&x.getAttribute("name")===(s.name==null?null:s.name)&&x.getAttribute("property")===(s.property==null?null:s.property)&&x.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&x.getAttribute("charset")===(s.charSet==null?null:s.charSet)){N.splice(U,1);break t}}x=v.createElement(l),Dn(x,l,s),v.head.appendChild(x);break;default:throw Error(a(468,l))}x[Bt]=t,Je(x),l=x}t.stateNode=l}else $0(v,t.type,t.stateNode);else t.stateNode=z0(v,l,t.memoizedProps);else x!==l?(x===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):x.count--,l===null?$0(v,t.type,t.stateNode):z0(v,l,t.memoizedProps)):l===null&&t.stateNode!==null&&Dd(t,t.memoizedProps,s.memoizedProps)}break;case 27:ni(i,t),ii(t),l&512&&(gn||s===null||nr(s,s.return)),s!==null&&l&4&&Dd(t,t.memoizedProps,s.memoizedProps);break;case 5:if(ni(i,t),ii(t),l&512&&(gn||s===null||nr(s,s.return)),t.flags&32){v=t.stateNode;try{Ue(v,"")}catch(Ae){wt(t,t.return,Ae)}}l&4&&t.stateNode!=null&&(v=t.memoizedProps,Dd(t,v,s!==null?s.memoizedProps:v)),l&1024&&(Id=!0);break;case 6:if(ni(i,t),ii(t),l&4){if(t.stateNode===null)throw Error(a(162));l=t.memoizedProps,s=t.stateNode;try{s.nodeValue=l}catch(Ae){wt(t,t.return,Ae)}}break;case 3:if(Qc=null,v=Wi,Wi=Zc(i.containerInfo),ni(i,t),Wi=v,ii(t),l&4&&s!==null&&s.memoizedState.isDehydrated)try{Ia(i.containerInfo)}catch(Ae){wt(t,t.return,Ae)}Id&&(Id=!1,$v(t));break;case 4:l=Wi,Wi=Zc(t.stateNode.containerInfo),ni(i,t),ii(t),Wi=l;break;case 12:ni(i,t),ii(t);break;case 31:ni(i,t),ii(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,Ic(t,l)));break;case 13:ni(i,t),ii(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(zc=ut()),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,Ic(t,l)));break;case 22:v=t.memoizedState!==null;var ee=s!==null&&s.memoizedState!==null,oe=Cr,de=gn;if(Cr=oe||v,gn=de||ee,ni(i,t),gn=de,Cr=oe,ii(t),l&8192)e:for(i=t.stateNode,i._visibility=v?i._visibility&-2:i._visibility|1,v&&(s===null||ee||Cr||gn||$s(t)),s=null,i=t;;){if(i.tag===5||i.tag===26){if(s===null){ee=s=i;try{if(x=ee.stateNode,v)N=x.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{U=ee.stateNode;var me=ee.memoizedProps.style,ce=me!=null&&me.hasOwnProperty("display")?me.display:null;U.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch(Ae){wt(ee,ee.return,Ae)}}}else if(i.tag===6){if(s===null){ee=i;try{ee.stateNode.nodeValue=v?"":ee.memoizedProps}catch(Ae){wt(ee,ee.return,Ae)}}}else if(i.tag===18){if(s===null){ee=i;try{var ue=ee.stateNode;v?L0(ue,!0):L0(ee.stateNode,!1)}catch(Ae){wt(ee,ee.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,Ic(t,s))));break;case 19:ni(i,t),ii(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,Ic(t,l)));break;case 30:break;case 21:break;default:ni(i,t),ii(t)}}function ii(t){var i=t.flags;if(i&2){try{for(var s,l=t.return;l!==null;){if(Nv(l)){s=l;break}l=l.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var v=s.stateNode,x=Bd(t);jc(t,x,v);break;case 5:var N=s.stateNode;s.flags&32&&(Ue(N,""),s.flags&=-33);var U=Bd(t);jc(t,U,N);break;case 3:case 4:var ee=s.stateNode.containerInfo,oe=Bd(t);jd(t,oe,ee);break;default:throw Error(a(161))}}catch(de){wt(t,t.return,de)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function $v(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;$v(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),t=t.sibling}}function kr(t,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Bv(t,i.alternate,i),i=i.sibling}function $s(t){for(t=t.child;t!==null;){var i=t;switch(i.tag){case 0:case 11:case 14:case 15:ts(4,i,i.return),$s(i);break;case 1:nr(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&Lv(i,i.return,s),$s(i);break;case 27:Qo(i.stateNode);case 26:case 5:nr(i,i.return),$s(i);break;case 22:i.memoizedState===null&&$s(i);break;case 30:$s(i);break;default:$s(i)}t=t.sibling}}function Ar(t,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var l=i.alternate,v=t,x=i,N=x.flags;switch(x.tag){case 0:case 11:case 15:Ar(v,x,s),Fo(4,x);break;case 1:if(Ar(v,x,s),l=x,v=l.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(oe){wt(l,l.return,oe)}if(l=x,v=l.updateQueue,v!==null){var U=l.stateNode;try{var ee=v.shared.hiddenCallbacks;if(ee!==null)for(v.shared.hiddenCallbacks=null,v=0;v<ee.length;v++)v_(ee[v],U)}catch(oe){wt(l,l.return,oe)}}s&&N&64&&Rv(x),Wo(x,x.return);break;case 27:Ov(x);case 26:case 5:Ar(v,x,s),s&&l===null&&N&4&&Mv(x),Wo(x,x.return);break;case 12:Ar(v,x,s);break;case 31:Ar(v,x,s),s&&N&4&&Pv(v,x);break;case 13:Ar(v,x,s),s&&N&4&&zv(v,x);break;case 22:x.memoizedState===null&&Ar(v,x,s),Wo(x,x.return);break;case 30:break;default:Ar(v,x,s)}i=i.sibling}}function Pd(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&&Lo(s))}function zd(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Lo(t))}function Gi(t,i,s,l){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Uv(t,i,s,l),i=i.sibling}function Uv(t,i,s,l){var v=i.flags;switch(i.tag){case 0:case 11:case 15:Gi(t,i,s,l),v&2048&&Fo(9,i);break;case 1:Gi(t,i,s,l);break;case 3:Gi(t,i,s,l),v&2048&&(t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Lo(t)));break;case 12:if(v&2048){Gi(t,i,s,l),t=i.stateNode;try{var x=i.memoizedProps,N=x.id,U=x.onPostCommit;typeof U=="function"&&U(N,i.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(ee){wt(i,i.return,ee)}}else Gi(t,i,s,l);break;case 31:Gi(t,i,s,l);break;case 13:Gi(t,i,s,l);break;case 23:break;case 22:x=i.stateNode,N=i.alternate,i.memoizedState!==null?x._visibility&2?Gi(t,i,s,l):Go(t,i):x._visibility&2?Gi(t,i,s,l):(x._visibility|=2,ka(t,i,s,l,(i.subtreeFlags&10256)!==0||!1)),v&2048&&Pd(N,i);break;case 24:Gi(t,i,s,l),v&2048&&zd(i.alternate,i);break;default:Gi(t,i,s,l)}}function ka(t,i,s,l,v){for(v=v&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var x=t,N=i,U=s,ee=l,oe=N.flags;switch(N.tag){case 0:case 11:case 15:ka(x,N,U,ee,v),Fo(8,N);break;case 23:break;case 22:var de=N.stateNode;N.memoizedState!==null?de._visibility&2?ka(x,N,U,ee,v):Go(x,N):(de._visibility|=2,ka(x,N,U,ee,v)),v&&oe&2048&&Pd(N.alternate,N);break;case 24:ka(x,N,U,ee,v),v&&oe&2048&&zd(N.alternate,N);break;default:ka(x,N,U,ee,v)}i=i.sibling}}function Go(t,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=t,l=i,v=l.flags;switch(l.tag){case 22:Go(s,l),v&2048&&Pd(l.alternate,l);break;case 24:Go(s,l),v&2048&&zd(l.alternate,l);break;default:Go(s,l)}i=i.sibling}}var qo=8192;function Aa(t,i,s){if(t.subtreeFlags&qo)for(t=t.child;t!==null;)Fv(t,i,s),t=t.sibling}function Fv(t,i,s){switch(t.tag){case 26:Aa(t,i,s),t.flags&qo&&t.memoizedState!==null&&IE(s,Wi,t.memoizedState,t.memoizedProps);break;case 5:Aa(t,i,s);break;case 3:case 4:var l=Wi;Wi=Zc(t.stateNode.containerInfo),Aa(t,i,s),Wi=l;break;case 22:t.memoizedState===null&&(l=t.alternate,l!==null&&l.memoizedState!==null?(l=qo,qo=16777216,Aa(t,i,s),qo=l):Aa(t,i,s));break;default:Aa(t,i,s)}}function Wv(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 Ko(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];Sn=l,qv(l,t)}Wv(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Gv(t),t=t.sibling}function Gv(t){switch(t.tag){case 0:case 11:case 15:Ko(t),t.flags&2048&&ts(9,t,t.return);break;case 3:Ko(t);break;case 12:Ko(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,Pc(t)):Ko(t);break;default:Ko(t)}}function Pc(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];Sn=l,qv(l,t)}Wv(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:ts(8,i,i.return),Pc(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,Pc(i));break;default:Pc(i)}t=t.sibling}}function qv(t,i){for(;Sn!==null;){var s=Sn;switch(s.tag){case 0:case 11:case 15:ts(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:Lo(s.memoizedState.cache)}if(l=s.child,l!==null)l.return=s,Sn=l;else e:for(s=t;Sn!==null;){l=Sn;var v=l.sibling,x=l.return;if(jv(l),l===s){Sn=null;break e}if(v!==null){v.return=x,Sn=v;break e}Sn=x}}}var J2={getCacheForType:function(t){var i=Nn(dn),s=i.data.get(t);return s===void 0&&(s=t(),i.data.set(t,s)),s},cacheSignal:function(){return Nn(dn).controller.signal}},Q2=typeof WeakMap=="function"?WeakMap:Map,_t=0,Lt=null,Qe=null,rt=0,St=0,gi=null,ns=!1,Ta=!1,Hd=!1,Tr=0,tn=0,is=0,Us=0,$d=0,mi=0,Ra=0,Vo=null,ri=null,Ud=!1,zc=0,Kv=0,Hc=1/0,$c=null,rs=null,yn=0,ss=null,La=null,Rr=0,Fd=0,Wd=null,Vv=null,Yo=0,Gd=null;function _i(){return(_t&2)!==0&&rt!==0?rt&-rt:H.T!==null?Zd():hr()}function Yv(){if(mi===0)if((rt&536870912)===0||lt){var t=Tn;Tn<<=1,(Tn&3932160)===0&&(Tn=262144),mi=t}else mi=536870912;return t=fi.current,t!==null&&(t.flags|=32),mi}function si(t,i,s){(t===Lt&&(St===2||St===9)||t.cancelPendingCommit!==null)&&(Ma(t,0),as(t,rt,mi,!1)),ht(t,s),((_t&2)===0||t!==Lt)&&(t===Lt&&((_t&2)===0&&(Us|=s),tn===4&&as(t,rt,mi,!1)),ir(t))}function Xv(t,i,s){if((_t&6)!==0)throw Error(a(327));var l=!s&&(i&127)===0&&(i&t.expiredLanes)===0||fe(t,i),v=l?nE(t,i):Kd(t,i,!0),x=l;do{if(v===0){Ta&&!l&&as(t,i,0,!1);break}else{if(s=t.current.alternate,x&&!eE(s)){v=Kd(t,i,!1),x=!1;continue}if(v===2){if(x=i,t.errorRecoveryDisabledLanes&x)var N=0;else N=t.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){i=N;e:{var U=t;v=Vo;var ee=U.current.memoizedState.isDehydrated;if(ee&&(Ma(U,N).flags|=256),N=Kd(U,N,!1),N!==2){if(Hd&&!ee){U.errorRecoveryDisabledLanes|=x,Us|=x,v=4;break e}x=ri,ri=v,x!==null&&(ri===null?ri=x:ri.push.apply(ri,x))}v=N}if(x=!1,v!==2)continue}}if(v===1){Ma(t,0),as(t,i,0,!0);break}e:{switch(l=t,x=v,x){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:as(l,i,mi,!ns);break e;case 2:ri=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(v=zc+300-ut(),10<v)){if(as(l,i,mi,!ns),Q(l,0,!0)!==0)break e;Rr=i,l.timeoutHandle=A0(Zv.bind(null,l,s,ri,$c,Ud,i,mi,Us,Ra,ns,x,"Throttled",-0,0),v);break e}Zv(l,s,ri,$c,Ud,i,mi,Us,Ra,ns,x,null,-0,0)}}break}while(!0);ir(t)}function Zv(t,i,s,l,v,x,N,U,ee,oe,de,me,ce,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:xe},Fv(i,x,me);var Ae=(x&62914560)===x?zc-ut():(x&4194048)===x?Kv-ut():0;if(Ae=PE(me,Ae),Ae!==null){Rr=x,t.cancelPendingCommit=Ae(s0.bind(null,t,i,x,s,l,v,N,U,ee,de,me,null,ce,ue)),as(t,x,N,!oe);return}}s0(t,i,x,s,l,v,N,U,ee)}function eE(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 v=s[l],x=v.getSnapshot;v=v.value;try{if(!hi(x(),v))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 as(t,i,s,l){i&=~$d,i&=~Us,t.suspendedLanes|=i,t.pingedLanes&=~i,l&&(t.warmLanes|=i),l=t.expirationTimes;for(var v=i;0<v;){var x=31-Ze(v),N=1<<x;l[x]=-1,v&=~N}s!==0&&Ce(t,s,i)}function Uc(){return(_t&6)===0?(Xo(0),!1):!0}function qd(){if(Qe!==null){if(St===0)var t=Qe.return;else t=Qe,vr=Os=null,ld(t),Sa=null,No=0,t=Qe;for(;t!==null;)Tv(t.alternate,t),t=t.return;Qe=null}}function Ma(t,i){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,yE(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),Rr=0,qd(),Lt=t,Qe=s=mr(t.current,null),rt=i,St=0,gi=null,ns=!1,Ta=fe(t,i),Hd=!1,Ra=mi=$d=Us=is=tn=0,ri=Vo=null,Ud=!1,(i&8)!==0&&(i|=i&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=i;0<l;){var v=31-Ze(l),x=1<<v;i|=t[v],l&=~x}return Tr=i,cc(),s}function Jv(t,i){qe=null,H.H=Ho,i===ya||i===_c?(i=p_(),St=3):i===Xh?(i=p_(),St=4):St=i===Cd?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,gi=i,Qe===null&&(tn=1,Mc(t,Ei(i,t.current)))}function Qv(){var t=fi.current;return t===null?!0:(rt&4194048)===rt?Ri===null:(rt&62914560)===rt||(rt&536870912)!==0?t===Ri:!1}function e0(){var t=H.H;return H.H=Ho,t===null?Ho:t}function t0(){var t=H.A;return H.A=J2,t}function Fc(){tn=4,ns||(rt&4194048)!==rt&&fi.current!==null||(Ta=!0),(is&134217727)===0&&(Us&134217727)===0||Lt===null||as(Lt,rt,mi,!1)}function Kd(t,i,s){var l=_t;_t|=2;var v=e0(),x=t0();(Lt!==t||rt!==i)&&($c=null,Ma(t,i)),i=!1;var N=tn;e:do try{if(St!==0&&Qe!==null){var U=Qe,ee=gi;switch(St){case 8:qd(),N=6;break e;case 3:case 2:case 9:case 6:fi.current===null&&(i=!0);var oe=St;if(St=0,gi=null,Na(t,U,ee,oe),s&&Ta){N=0;break e}break;default:oe=St,St=0,gi=null,Na(t,U,ee,oe)}}tE(),N=tn;break}catch(de){Jv(t,de)}while(!0);return i&&t.shellSuspendCounter++,vr=Os=null,_t=l,H.H=v,H.A=x,Qe===null&&(Lt=null,rt=0,cc()),N}function tE(){for(;Qe!==null;)n0(Qe)}function nE(t,i){var s=_t;_t|=2;var l=e0(),v=t0();Lt!==t||rt!==i?($c=null,Hc=ut()+500,Ma(t,i)):Ta=fe(t,i);e:do try{if(St!==0&&Qe!==null){i=Qe;var x=gi;t:switch(St){case 1:St=0,gi=null,Na(t,i,x,1);break;case 2:case 9:if(d_(x)){St=0,gi=null,i0(i);break}i=function(){St!==2&&St!==9||Lt!==t||(St=7),ir(t)},x.then(i,i);break e;case 3:St=7;break e;case 4:St=5;break e;case 7:d_(x)?(St=0,gi=null,i0(i)):(St=0,gi=null,Na(t,i,x,7));break;case 5:var N=null;switch(Qe.tag){case 26:N=Qe.memoizedState;case 5:case 27:var U=Qe;if(N?U0(N):U.stateNode.complete){St=0,gi=null;var ee=U.sibling;if(ee!==null)Qe=ee;else{var oe=U.return;oe!==null?(Qe=oe,Wc(oe)):Qe=null}break t}}St=0,gi=null,Na(t,i,x,5);break;case 6:St=0,gi=null,Na(t,i,x,6);break;case 8:qd(),tn=6;break e;default:throw Error(a(462))}}iE();break}catch(de){Jv(t,de)}while(!0);return vr=Os=null,H.H=l,H.A=v,_t=s,Qe!==null?0:(Lt=null,rt=0,cc(),tn)}function iE(){for(;Qe!==null&&!kn();)n0(Qe)}function n0(t){var i=kv(t.alternate,t,Tr);t.memoizedProps=t.pendingProps,i===null?Wc(t):Qe=i}function i0(t){var i=t,s=i.alternate;switch(i.tag){case 15:case 0:i=yv(s,i,i.pendingProps,i.type,void 0,rt);break;case 11:i=yv(s,i,i.pendingProps,i.type.render,i.ref,rt);break;case 5:ld(i);default:Tv(s,i),i=Qe=t_(i,Tr),i=kv(s,i,Tr)}t.memoizedProps=t.pendingProps,i===null?Wc(t):Qe=i}function Na(t,i,s,l){vr=Os=null,ld(i),Sa=null,No=0;var v=i.return;try{if(G2(t,v,i,s,rt)){tn=1,Mc(t,Ei(s,t.current)),Qe=null;return}}catch(x){if(v!==null)throw Qe=v,x;tn=1,Mc(t,Ei(s,t.current)),Qe=null;return}i.flags&32768?(lt||l===1?t=!0:Ta||(rt&536870912)!==0?t=!1:(ns=t=!0,(l===2||l===9||l===3||l===6)&&(l=fi.current,l!==null&&l.tag===13&&(l.flags|=16384))),r0(i,t)):Wc(i)}function Wc(t){var i=t;do{if((i.flags&32768)!==0){r0(i,ns);return}t=i.return;var s=V2(i.alternate,i,Tr);if(s!==null){Qe=s;return}if(i=i.sibling,i!==null){Qe=i;return}Qe=i=t}while(i!==null);tn===0&&(tn=5)}function r0(t,i){do{var s=Y2(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);tn=6,Qe=null}function s0(t,i,s,l,v,x,N,U,ee){t.cancelPendingCommit=null;do Gc();while(yn!==0);if((_t&6)!==0)throw Error(a(327));if(i!==null){if(i===t.current)throw Error(a(177));if(x=i.lanes|i.childLanes,x|=Bh,ke(t,s,x,N,U,ee),t===Lt&&(Qe=Lt=null,rt=0),La=i,ss=t,Rr=s,Fd=x,Wd=v,Vv=l,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,oE(Kt,function(){return u0(),null})):(t.callbackNode=null,t.callbackPriority=0),l=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||l){l=H.T,H.T=null,v=q.p,q.p=2,N=_t,_t|=4;try{X2(t,i,s)}finally{_t=N,q.p=v,H.T=l}}yn=1,a0(),o0(),l0()}}function a0(){if(yn===1){yn=0;var t=ss,i=La,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=H.T,H.T=null;var l=q.p;q.p=2;var v=_t;_t|=4;try{Hv(i,t);var x=af,N=qm(t.containerInfo),U=x.focusedElem,ee=x.selectionRange;if(N!==U&&U&&U.ownerDocument&&Gm(U.ownerDocument.documentElement,U)){if(ee!==null&&Lh(U)){var oe=ee.start,de=ee.end;if(de===void 0&&(de=oe),"selectionStart"in U)U.selectionStart=oe,U.selectionEnd=Math.min(de,U.value.length);else{var me=U.ownerDocument||document,ce=me&&me.defaultView||window;if(ce.getSelection){var ue=ce.getSelection(),Ae=U.textContent.length,ze=Math.min(ee.start,Ae),kt=ee.end===void 0?ze:Math.min(ee.end,Ae);!ue.extend&&ze>kt&&(N=kt,kt=ze,ze=N);var re=Wm(U,ze),ne=Wm(U,kt);if(re&&ne&&(ue.rangeCount!==1||ue.anchorNode!==re.node||ue.anchorOffset!==re.offset||ue.focusNode!==ne.node||ue.focusOffset!==ne.offset)){var ae=me.createRange();ae.setStart(re.node,re.offset),ue.removeAllRanges(),ze>kt?(ue.addRange(ae),ue.extend(ne.node,ne.offset)):(ae.setEnd(ne.node,ne.offset),ue.addRange(ae))}}}}for(me=[],ue=U;ue=ue.parentNode;)ue.nodeType===1&&me.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof U.focus=="function"&&U.focus(),U=0;U<me.length;U++){var pe=me[U];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}iu=!!sf,af=sf=null}finally{_t=v,q.p=l,H.T=s}}t.current=i,yn=2}}function o0(){if(yn===2){yn=0;var t=ss,i=La,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=H.T,H.T=null;var l=q.p;q.p=2;var v=_t;_t|=4;try{Bv(t,i.alternate,i)}finally{_t=v,q.p=l,H.T=s}}yn=3}}function l0(){if(yn===4||yn===3){yn=0,Zt();var t=ss,i=La,s=Rr,l=Vv;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?yn=5:(yn=0,La=ss=null,c0(t,t.pendingLanes));var v=t.pendingLanes;if(v===0&&(rs=null),Rn(s),i=i.stateNode,ve&&typeof ve.onCommitFiberRoot=="function")try{ve.onCommitFiberRoot(An,i,void 0,(i.current.flags&128)===128)}catch{}if(l!==null){i=H.T,v=q.p,q.p=2,H.T=null;try{for(var x=t.onRecoverableError,N=0;N<l.length;N++){var U=l[N];x(U.value,{componentStack:U.stack})}}finally{H.T=i,q.p=v}}(Rr&3)!==0&&Gc(),ir(t),v=t.pendingLanes,(s&261930)!==0&&(v&42)!==0?t===Gd?Yo++:(Yo=0,Gd=t):Yo=0,Xo(0)}}function c0(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,Lo(i)))}function Gc(){return a0(),o0(),l0(),u0()}function u0(){if(yn!==5)return!1;var t=ss,i=Fd;Fd=0;var s=Rn(Rr),l=H.T,v=q.p;try{q.p=32>s?32:s,H.T=null,s=Wd,Wd=null;var x=ss,N=Rr;if(yn=0,La=ss=null,Rr=0,(_t&6)!==0)throw Error(a(331));var U=_t;if(_t|=4,Gv(x.current),Uv(x,x.current,N,s),_t=U,Xo(0,!1),ve&&typeof ve.onPostCommitFiberRoot=="function")try{ve.onPostCommitFiberRoot(An,x)}catch{}return!0}finally{q.p=v,H.T=l,c0(t,i)}}function h0(t,i,s){i=Ei(s,i),i=xd(t.stateNode,i,2),t=Jr(t,i,2),t!==null&&(ht(t,2),ir(t))}function wt(t,i,s){if(t.tag===3)h0(t,t,s);else for(;i!==null;){if(i.tag===3){h0(i,t,s);break}else if(i.tag===1){var l=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(rs===null||!rs.has(l))){t=Ei(s,t),s=dv(2),l=Jr(i,s,2),l!==null&&(fv(s,l,i,t),ht(l,2),ir(l));break}}i=i.return}}function Vd(t,i,s){var l=t.pingCache;if(l===null){l=t.pingCache=new Q2;var v=new Set;l.set(i,v)}else v=l.get(i),v===void 0&&(v=new Set,l.set(i,v));v.has(s)||(Hd=!0,v.add(s),t=rE.bind(null,t,i,s),i.then(t,t))}function rE(t,i,s){var l=t.pingCache;l!==null&&l.delete(i),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,Lt===t&&(rt&s)===s&&(tn===4||tn===3&&(rt&62914560)===rt&&300>ut()-zc?(_t&2)===0&&Ma(t,0):$d|=s,Ra===rt&&(Ra=0)),ir(t)}function d0(t,i){i===0&&(i=Oe()),t=Ls(t,i),t!==null&&(ht(t,i),ir(t))}function sE(t){var i=t.memoizedState,s=0;i!==null&&(s=i.retryLane),d0(t,s)}function aE(t,i){var s=0;switch(t.tag){case 31:case 13:var l=t.stateNode,v=t.memoizedState;v!==null&&(s=v.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(a(314))}l!==null&&l.delete(i),d0(t,s)}function oE(t,i){return vn(t,i)}var qc=null,Oa=null,Yd=!1,Kc=!1,Xd=!1,os=0;function ir(t){t!==Oa&&t.next===null&&(Oa===null?qc=Oa=t:Oa=Oa.next=t),Kc=!0,Yd||(Yd=!0,cE())}function Xo(t,i){if(!Xd&&Kc){Xd=!0;do for(var s=!1,l=qc;l!==null;){if(t!==0){var v=l.pendingLanes;if(v===0)var x=0;else{var N=l.suspendedLanes,U=l.pingedLanes;x=(1<<31-Ze(42|t)+1)-1,x&=v&~(N&~U),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(s=!0,m0(l,x))}else x=rt,x=Q(l,l===Lt?x:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(x&3)===0||fe(l,x)||(s=!0,m0(l,x));l=l.next}while(s);Xd=!1}}function lE(){f0()}function f0(){Kc=Yd=!1;var t=0;os!==0&&bE()&&(t=os);for(var i=ut(),s=null,l=qc;l!==null;){var v=l.next,x=p0(l,i);x===0?(l.next=null,s===null?qc=v:s.next=v,v===null&&(Oa=s)):(s=l,(t!==0||(x&3)!==0)&&(Kc=!0)),l=v}yn!==0&&yn!==5||Xo(t),os!==0&&(os=0)}function p0(t,i){for(var s=t.suspendedLanes,l=t.pingedLanes,v=t.expirationTimes,x=t.pendingLanes&-62914561;0<x;){var N=31-Ze(x),U=1<<N,ee=v[N];ee===-1?((U&s)===0||(U&l)!==0)&&(v[N]=ye(U,i)):ee<=i&&(t.expiredLanes|=U),x&=~U}if(i=Lt,s=rt,s=Q(t,t===i?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l=t.callbackNode,s===0||t===i&&(St===2||St===9)||t.cancelPendingCommit!==null)return l!==null&&l!==null&&an(l),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||fe(t,s)){if(i=s&-s,i===t.callbackPriority)return i;switch(l!==null&&an(l),Rn(s)){case 2:case 8:s=Ut;break;case 32:s=Kt;break;case 268435456:s=bn;break;default:s=Kt}return l=g0.bind(null,t),s=vn(s,l),t.callbackPriority=i,t.callbackNode=s,i}return l!==null&&l!==null&&an(l),t.callbackPriority=2,t.callbackNode=null,2}function g0(t,i){if(yn!==0&&yn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(Gc()&&t.callbackNode!==s)return null;var l=rt;return l=Q(t,t===Lt?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l===0?null:(Xv(t,l,i),p0(t,ut()),t.callbackNode!=null&&t.callbackNode===s?g0.bind(null,t):null)}function m0(t,i){if(Gc())return null;Xv(t,i,!0)}function cE(){SE(function(){(_t&6)!==0?vn(xt,lE):f0()})}function Zd(){if(os===0){var t=va;t===0&&(t=Ot,Ot<<=1,(Ot&261888)===0&&(Ot=256)),os=t}return os}function _0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Wr(""+t)}function v0(t,i){var s=i.ownerDocument.createElement("input");return s.name=i.name,s.value=i.value,t.id&&s.setAttribute("form",t.id),i.parentNode.insertBefore(s,i),t=new FormData(t),s.parentNode.removeChild(s),t}function uE(t,i,s,l,v){if(i==="submit"&&s&&s.stateNode===v){var x=_0((v[Mt]||null).action),N=l.submitter;N&&(i=(i=N[Mt]||null)?_0(i.formAction):N.getAttribute("formAction"),i!==null&&(x=i,N=null));var U=new sc("action","action",null,l,v);t.push({event:U,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(os!==0){var ee=N?v0(v,N):new FormData(v);_d(s,{pending:!0,data:ee,method:v.method,action:x},null,ee)}}else typeof x=="function"&&(U.preventDefault(),ee=N?v0(v,N):new FormData(v),_d(s,{pending:!0,data:ee,method:v.method,action:x},x,ee))},currentTarget:v}]})}}for(var Jd=0;Jd<Dh.length;Jd++){var Qd=Dh[Jd],hE=Qd.toLowerCase(),dE=Qd[0].toUpperCase()+Qd.slice(1);Fi(hE,"on"+dE)}Fi(Ym,"onAnimationEnd"),Fi(Xm,"onAnimationIteration"),Fi(Zm,"onAnimationStart"),Fi("dblclick","onDoubleClick"),Fi("focusin","onFocus"),Fi("focusout","onBlur"),Fi(T2,"onTransitionRun"),Fi(R2,"onTransitionStart"),Fi(L2,"onTransitionCancel"),Fi(Jm,"onTransitionEnd"),be("onMouseEnter",["mouseout","mouseover"]),be("onMouseLeave",["mouseout","mouseover"]),be("onPointerEnter",["pointerout","pointerover"]),be("onPointerLeave",["pointerout","pointerover"]),Qt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Qt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Qt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Qt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Qt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Qt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zo="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(" "),fE=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Zo));function b0(t,i){i=(i&4)!==0;for(var s=0;s<t.length;s++){var l=t[s],v=l.event;l=l.listeners;e:{var x=void 0;if(i)for(var N=l.length-1;0<=N;N--){var U=l[N],ee=U.instance,oe=U.currentTarget;if(U=U.listener,ee!==x&&v.isPropagationStopped())break e;x=U,v.currentTarget=oe;try{x(v)}catch(de){lc(de)}v.currentTarget=null,x=ee}else for(N=0;N<l.length;N++){if(U=l[N],ee=U.instance,oe=U.currentTarget,U=U.listener,ee!==x&&v.isPropagationStopped())break e;x=U,v.currentTarget=oe;try{x(v)}catch(de){lc(de)}v.currentTarget=null,x=ee}}}}function et(t,i){var s=i[Ur];s===void 0&&(s=i[Ur]=new Set);var l=t+"__bubble";s.has(l)||(y0(i,t,2,!1),s.add(l))}function ef(t,i,s){var l=0;i&&(l|=4),y0(s,t,l,i)}var Vc="_reactListening"+Math.random().toString(36).slice(2);function tf(t){if(!t[Vc]){t[Vc]=!0,jt.forEach(function(s){s!=="selectionchange"&&(fE.has(s)||ef(s,!1,t),ef(s,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[Vc]||(i[Vc]=!0,ef("selectionchange",!1,i))}}function y0(t,i,s,l){switch(Y0(i)){case 2:var v=$E;break;case 8:v=UE;break;default:v=_f}s=v.bind(null,i,s,t),v=void 0,!Sh||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(v=!0),l?v!==void 0?t.addEventListener(i,s,{capture:!0,passive:v}):t.addEventListener(i,s,!0):v!==void 0?t.addEventListener(i,s,{passive:v}):t.addEventListener(i,s,!1)}function nf(t,i,s,l,v){var x=l;if((i&1)===0&&(i&2)===0&&l!==null)e:for(;;){if(l===null)return;var N=l.tag;if(N===3||N===4){var U=l.stateNode.containerInfo;if(U===v)break;if(N===4)for(N=l.return;N!==null;){var ee=N.tag;if((ee===3||ee===4)&&N.stateNode.containerInfo===v)return;N=N.return}for(;U!==null;){if(N=J(U),N===null)return;if(ee=N.tag,ee===5||ee===6||ee===26||ee===27){l=x=N;continue e}U=U.parentNode}}l=l.return}tc(function(){var oe=x,de=We(s),me=[];e:{var ce=Qm.get(t);if(ce!==void 0){var ue=sc,Ae=t;switch(t){case"keypress":if(ic(s)===0)break e;case"keydown":case"keyup":ue=a2;break;case"focusin":Ae="focus",ue=Eh;break;case"focusout":Ae="blur",ue=Eh;break;case"beforeblur":case"afterblur":ue=Eh;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=Tm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=VC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=c2;break;case Ym:case Xm:case Zm:ue=ZC;break;case Jm:ue=h2;break;case"scroll":case"scrollend":ue=qC;break;case"wheel":ue=f2;break;case"copy":case"cut":case"paste":ue=QC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=Lm;break;case"toggle":case"beforetoggle":ue=g2}var ze=(i&4)!==0,kt=!ze&&(t==="scroll"||t==="scrollend"),re=ze?ce!==null?ce+"Capture":null:ce;ze=[];for(var ne=oe,ae;ne!==null;){var pe=ne;if(ae=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||ae===null||re===null||(pe=bo(ne,re),pe!=null&&ze.push(Jo(ne,pe,ae))),kt)break;ne=ne.return}0<ze.length&&(ce=new ue(ce,Ae,null,s,de),me.push({event:ce,listeners:ze}))}}if((i&7)===0){e:{if(ce=t==="mouseover"||t==="pointerover",ue=t==="mouseout"||t==="pointerout",ce&&s!==Te&&(Ae=s.relatedTarget||s.fromElement)&&(J(Ae)||Ae[Ui]))break e;if((ue||ce)&&(ce=de.window===de?de:(ce=de.ownerDocument)?ce.defaultView||ce.parentWindow:window,ue?(Ae=s.relatedTarget||s.toElement,ue=oe,Ae=Ae?J(Ae):null,Ae!==null&&(kt=g(Ae),ze=Ae.tag,Ae!==kt||ze!==5&&ze!==27&&ze!==6)&&(Ae=null)):(ue=null,Ae=oe),ue!==Ae)){if(ze=Tm,pe="onMouseLeave",re="onMouseEnter",ne="mouse",(t==="pointerout"||t==="pointerover")&&(ze=Lm,pe="onPointerLeave",re="onPointerEnter",ne="pointer"),kt=ue==null?ce:Ee(ue),ae=Ae==null?ce:Ee(Ae),ce=new ze(pe,ne+"leave",ue,s,de),ce.target=kt,ce.relatedTarget=ae,pe=null,J(de)===oe&&(ze=new ze(re,ne+"enter",Ae,s,de),ze.target=ae,ze.relatedTarget=kt,pe=ze),kt=pe,ue&&Ae)t:{for(ze=pE,re=ue,ne=Ae,ae=0,pe=re;pe;pe=ze(pe))ae++;pe=0;for(var Be=ne;Be;Be=ze(Be))pe++;for(;0<ae-pe;)re=ze(re),ae--;for(;0<pe-ae;)ne=ze(ne),pe--;for(;ae--;){if(re===ne||ne!==null&&re===ne.alternate){ze=re;break t}re=ze(re),ne=ze(ne)}ze=null}else ze=null;ue!==null&&S0(me,ce,ue,ze,!1),Ae!==null&&kt!==null&&S0(me,kt,Ae,ze,!0)}}e:{if(ce=oe?Ee(oe):window,ue=ce.nodeName&&ce.nodeName.toLowerCase(),ue==="select"||ue==="input"&&ce.type==="file")var pt=Pm;else if(jm(ce))if(zm)pt=E2;else{pt=x2;var Re=w2}else ue=ce.nodeName,!ue||ue.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?oe&&Fr(oe.elementType)&&(pt=Pm):pt=C2;if(pt&&(pt=pt(t,oe))){Im(me,pt,s,de);break e}Re&&Re(t,ce,oe),t==="focusout"&&oe&&ce.type==="number"&&oe.memoizedProps.value!=null&&oa(ce,"number",ce.value)}switch(Re=oe?Ee(oe):window,t){case"focusin":(jm(Re)||Re.contentEditable==="true")&&(ua=Re,Mh=oe,Ao=null);break;case"focusout":Ao=Mh=ua=null;break;case"mousedown":Nh=!0;break;case"contextmenu":case"mouseup":case"dragend":Nh=!1,Km(me,s,de);break;case"selectionchange":if(A2)break;case"keydown":case"keyup":Km(me,s,de)}var Ye;if(Ah)e:{switch(t){case"compositionstart":var st="onCompositionStart";break e;case"compositionend":st="onCompositionEnd";break e;case"compositionupdate":st="onCompositionUpdate";break e}st=void 0}else ca?Dm(t,s)&&(st="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(st="onCompositionStart");st&&(Mm&&s.locale!=="ko"&&(ca||st!=="onCompositionStart"?st==="onCompositionEnd"&&ca&&(Ye=km()):(Gr=de,wh="value"in Gr?Gr.value:Gr.textContent,ca=!0)),Re=Yc(oe,st),0<Re.length&&(st=new Rm(st,t,null,s,de),me.push({event:st,listeners:Re}),Ye?st.data=Ye:(Ye=Bm(s),Ye!==null&&(st.data=Ye)))),(Ye=_2?v2(t,s):b2(t,s))&&(st=Yc(oe,"onBeforeInput"),0<st.length&&(Re=new Rm("onBeforeInput","beforeinput",null,s,de),me.push({event:Re,listeners:st}),Re.data=Ye)),uE(me,t,oe,s,de)}b0(me,i)})}function Jo(t,i,s){return{instance:t,listener:i,currentTarget:s}}function Yc(t,i){for(var s=i+"Capture",l=[];t!==null;){var v=t,x=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||x===null||(v=bo(t,s),v!=null&&l.unshift(Jo(t,v,x)),v=bo(t,i),v!=null&&l.push(Jo(t,v,x))),t.tag===3)return l;t=t.return}return[]}function pE(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function S0(t,i,s,l,v){for(var x=i._reactName,N=[];s!==null&&s!==l;){var U=s,ee=U.alternate,oe=U.stateNode;if(U=U.tag,ee!==null&&ee===l)break;U!==5&&U!==26&&U!==27||oe===null||(ee=oe,v?(oe=bo(s,x),oe!=null&&N.unshift(Jo(s,oe,ee))):v||(oe=bo(s,x),oe!=null&&N.push(Jo(s,oe,ee)))),s=s.return}N.length!==0&&t.push({event:i,listeners:N})}var gE=/\r\n?/g,mE=/\u0000|\uFFFD/g;function w0(t){return(typeof t=="string"?t:""+t).replace(gE,`
9
+ `).replace(mE,"")}function x0(t,i){return i=w0(i),w0(t)===i}function Et(t,i,s,l,v,x){switch(s){case"children":typeof l=="string"?i==="body"||i==="textarea"&&l===""||Ue(t,l):(typeof l=="number"||typeof l=="bigint")&&i!=="body"&&Ue(t,""+l);break;case"className":ci(t,"class",l);break;case"tabIndex":ci(t,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ci(t,s,l);break;case"style":yt(t,l,x);break;case"data":if(i!=="object"){ci(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 x=="function"&&(s==="formAction"?(i!=="input"&&Et(t,i,"name",v.name,v,null),Et(t,i,"formEncType",v.formEncType,v,null),Et(t,i,"formMethod",v.formMethod,v,null),Et(t,i,"formTarget",v.formTarget,v,null)):(Et(t,i,"encType",v.encType,v,null),Et(t,i,"method",v.method,v,null),Et(t,i,"target",v.target,v,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=xe);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(v.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),zn(t,"popover",l);break;case"xlinkActuate":Jn(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Jn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Jn(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Jn(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Jn(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Jn(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Jn(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Jn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Jn(t,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":zn(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,zn(t,s,l))}}function rf(t,i,s,l,v,x){switch(s){case"style":yt(t,l,x);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(a(61));if(s=l.__html,s!=null){if(v.children!=null)throw Error(a(60));t.innerHTML=s}}break;case"children":typeof l=="string"?Ue(t,l):(typeof l=="number"||typeof l=="bigint")&&Ue(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=xe);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Jt.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(v=s.endsWith("Capture"),i=s.slice(2,v?s.length-7:void 0),x=t[Mt]||null,x=x!=null?x[s]:null,typeof x=="function"&&t.removeEventListener(i,x,v),typeof l=="function")){typeof x!="function"&&x!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(i,l,v);break e}s in t?t[s]=l:l===!0?t.setAttribute(s,""):zn(t,s,l)}}}function Dn(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,v=!1,x;for(x in s)if(s.hasOwnProperty(x)){var N=s[x];if(N!=null)switch(x){case"src":l=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Et(t,i,x,N,s,null)}}v&&Et(t,i,"srcSet",s.srcSet,s,null),l&&Et(t,i,"src",s.src,s,null);return;case"input":et("invalid",t);var U=x=N=v=null,ee=null,oe=null;for(l in s)if(s.hasOwnProperty(l)){var de=s[l];if(de!=null)switch(l){case"name":v=de;break;case"type":N=de;break;case"checked":ee=de;break;case"defaultChecked":oe=de;break;case"value":x=de;break;case"defaultValue":U=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(a(137,i));break;default:Et(t,i,l,de,s,null)}}ks(t,x,U,ee,oe,N,v,!1);return;case"select":et("invalid",t),l=N=x=null;for(v in s)if(s.hasOwnProperty(v)&&(U=s[v],U!=null))switch(v){case"value":x=U;break;case"defaultValue":N=U;break;case"multiple":l=U;default:Et(t,i,v,U,s,null)}i=x,s=N,t.multiple=!!l,i!=null?Ln(t,!!l,i,!1):s!=null&&Ln(t,!!l,s,!0);return;case"textarea":et("invalid",t),x=v=l=null;for(N in s)if(s.hasOwnProperty(N)&&(U=s[N],U!=null))switch(N){case"value":l=U;break;case"defaultValue":v=U;break;case"children":x=U;break;case"dangerouslySetInnerHTML":if(U!=null)throw Error(a(91));break;default:Et(t,i,N,U,s,null)}la(t,l,v,x);return;case"option":for(ee in s)s.hasOwnProperty(ee)&&(l=s[ee],l!=null)&&(ee==="selected"?t.selected=l&&typeof l!="function"&&typeof l!="symbol":Et(t,i,ee,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<Zo.length;l++)et(Zo[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(oe in s)if(s.hasOwnProperty(oe)&&(l=s[oe],l!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Et(t,i,oe,l,s,null)}return;default:if(Fr(i)){for(de in s)s.hasOwnProperty(de)&&(l=s[de],l!==void 0&&rf(t,i,de,l,s,void 0));return}}for(U in s)s.hasOwnProperty(U)&&(l=s[U],l!=null&&Et(t,i,U,l,s,null))}function _E(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 v=null,x=null,N=null,U=null,ee=null,oe=null,de=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":ee=me;default:l.hasOwnProperty(ue)||Et(t,i,ue,null,l,me)}}for(var ce in l){var ue=l[ce];if(me=s[ce],l.hasOwnProperty(ce)&&(ue!=null||me!=null))switch(ce){case"type":x=ue;break;case"name":v=ue;break;case"checked":oe=ue;break;case"defaultChecked":de=ue;break;case"value":N=ue;break;case"defaultValue":U=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(a(137,i));break;default:ue!==me&&Et(t,i,ce,ue,l,me)}}mo(t,N,U,ee,oe,de,x,v);return;case"select":ue=N=U=ce=null;for(x in s)if(ee=s[x],s.hasOwnProperty(x)&&ee!=null)switch(x){case"value":break;case"multiple":ue=ee;default:l.hasOwnProperty(x)||Et(t,i,x,null,l,ee)}for(v in l)if(x=l[v],ee=s[v],l.hasOwnProperty(v)&&(x!=null||ee!=null))switch(v){case"value":ce=x;break;case"defaultValue":U=x;break;case"multiple":N=x;default:x!==ee&&Et(t,i,v,x,l,ee)}i=U,s=N,l=ue,ce!=null?Ln(t,!!s,ce,!1):!!l!=!!s&&(i!=null?Ln(t,!!s,i,!0):Ln(t,!!s,s?[]:"",!1));return;case"textarea":ue=ce=null;for(U in s)if(v=s[U],s.hasOwnProperty(U)&&v!=null&&!l.hasOwnProperty(U))switch(U){case"value":break;case"children":break;default:Et(t,i,U,null,l,v)}for(N in l)if(v=l[N],x=s[N],l.hasOwnProperty(N)&&(v!=null||x!=null))switch(N){case"value":ce=v;break;case"defaultValue":ue=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(a(91));break;default:v!==x&&Et(t,i,N,v,l,x)}Ql(t,ce,ue);return;case"option":for(var Ae in s)ce=s[Ae],s.hasOwnProperty(Ae)&&ce!=null&&!l.hasOwnProperty(Ae)&&(Ae==="selected"?t.selected=!1:Et(t,i,Ae,null,l,ce));for(ee in l)ce=l[ee],ue=s[ee],l.hasOwnProperty(ee)&&ce!==ue&&(ce!=null||ue!=null)&&(ee==="selected"?t.selected=ce&&typeof ce!="function"&&typeof ce!="symbol":Et(t,i,ee,ce,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 ze in s)ce=s[ze],s.hasOwnProperty(ze)&&ce!=null&&!l.hasOwnProperty(ze)&&Et(t,i,ze,null,l,ce);for(oe in l)if(ce=l[oe],ue=s[oe],l.hasOwnProperty(oe)&&ce!==ue&&(ce!=null||ue!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(a(137,i));break;default:Et(t,i,oe,ce,l,ue)}return;default:if(Fr(i)){for(var kt in s)ce=s[kt],s.hasOwnProperty(kt)&&ce!==void 0&&!l.hasOwnProperty(kt)&&rf(t,i,kt,void 0,l,ce);for(de in l)ce=l[de],ue=s[de],!l.hasOwnProperty(de)||ce===ue||ce===void 0&&ue===void 0||rf(t,i,de,ce,l,ue);return}}for(var re in s)ce=s[re],s.hasOwnProperty(re)&&ce!=null&&!l.hasOwnProperty(re)&&Et(t,i,re,null,l,ce);for(me in l)ce=l[me],ue=s[me],!l.hasOwnProperty(me)||ce===ue||ce==null&&ue==null||Et(t,i,me,ce,l,ue)}function C0(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function vE(){if(typeof performance.getEntriesByType=="function"){for(var t=0,i=0,s=performance.getEntriesByType("resource"),l=0;l<s.length;l++){var v=s[l],x=v.transferSize,N=v.initiatorType,U=v.duration;if(x&&U&&C0(N)){for(N=0,U=v.responseEnd,l+=1;l<s.length;l++){var ee=s[l],oe=ee.startTime;if(oe>U)break;var de=ee.transferSize,me=ee.initiatorType;de&&C0(me)&&(ee=ee.responseEnd,N+=de*(ee<U?1:(U-oe)/(ee-oe)))}if(--l,i+=8*(x+N)/(v.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 sf=null,af=null;function Xc(t){return t.nodeType===9?t:t.ownerDocument}function E0(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function k0(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 of(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 lf=null;function bE(){var t=window.event;return t&&t.type==="popstate"?t===lf?!1:(lf=t,!0):(lf=null,!1)}var A0=typeof setTimeout=="function"?setTimeout:void 0,yE=typeof clearTimeout=="function"?clearTimeout:void 0,T0=typeof Promise=="function"?Promise:void 0,SE=typeof queueMicrotask=="function"?queueMicrotask:typeof T0<"u"?function(t){return T0.resolve(null).then(t).catch(wE)}:A0;function wE(t){setTimeout(function(){throw t})}function ls(t){return t==="head"}function R0(t,i){var s=i,l=0;do{var v=s.nextSibling;if(t.removeChild(s),v&&v.nodeType===8)if(s=v.data,s==="/$"||s==="/&"){if(l===0){t.removeChild(v),Ia(i);return}l--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")l++;else if(s==="html")Qo(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,Qo(s);for(var x=s.firstChild;x;){var N=x.nextSibling,U=x.nodeName;x[Qi]||U==="SCRIPT"||U==="STYLE"||U==="LINK"&&x.rel.toLowerCase()==="stylesheet"||s.removeChild(x),x=N}}else s==="body"&&Qo(t.ownerDocument.body);s=v}while(s);Ia(i)}function L0(t,i){var s=t;t=0;do{var l=s.nextSibling;if(s.nodeType===1?i?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(i?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),l&&l.nodeType===8)if(s=l.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=l}while(s)}function cf(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":cf(s),Ne(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function xE(t,i,s,l){for(;t.nodeType===1;){var v=s;if(t.nodeName.toLowerCase()!==i.toLowerCase()){if(!l&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(l){if(!t[Qi])switch(i){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(x=t.getAttribute("rel"),x==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(x!==v.rel||t.getAttribute("href")!==(v.href==null||v.href===""?null:v.href)||t.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin)||t.getAttribute("title")!==(v.title==null?null:v.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(x=t.getAttribute("src"),(x!==(v.src==null?null:v.src)||t.getAttribute("type")!==(v.type==null?null:v.type)||t.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&x&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(i==="input"&&t.type==="hidden"){var x=v.name==null?null:""+v.name;if(v.type==="hidden"&&t.getAttribute("name")===x)return t}else return t;if(t=Li(t.nextSibling),t===null)break}return null}function CE(t,i,s){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=Li(t.nextSibling),t===null))return null;return t}function M0(t,i){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=Li(t.nextSibling),t===null))return null;return t}function uf(t){return t.data==="$?"||t.data==="$~"}function hf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function EE(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 Li(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 df=null;function N0(t){t=t.nextSibling;for(var i=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(i===0)return Li(t.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}t=t.nextSibling}return null}function O0(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(i===0)return t;i--}else s!=="/$"&&s!=="/&"||i++}t=t.previousSibling}return null}function D0(t,i,s){switch(i=Xc(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 Qo(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Ne(t)}var Mi=new Map,B0=new Set;function Zc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Lr=q.d;q.d={f:kE,r:AE,D:TE,C:RE,L:LE,m:ME,X:OE,S:NE,M:DE};function kE(){var t=Lr.f(),i=Uc();return t||i}function AE(t){var i=_e(t);i!==null&&i.tag===5&&i.type==="form"?J_(i):Lr.r(t)}var Da=typeof document>"u"?null:document;function j0(t,i,s){var l=Da;if(l&&typeof i=="string"&&i){var v=Qn(i);v='link[rel="'+t+'"][href="'+v+'"]',typeof s=="string"&&(v+='[crossorigin="'+s+'"]'),B0.has(v)||(B0.add(v),t={rel:t,crossOrigin:s,href:i},l.querySelector(v)===null&&(i=l.createElement("link"),Dn(i,"link",t),Je(i),l.head.appendChild(i)))}}function TE(t){Lr.D(t),j0("dns-prefetch",t,null)}function RE(t,i){Lr.C(t,i),j0("preconnect",t,i)}function LE(t,i,s){Lr.L(t,i,s);var l=Da;if(l&&t&&i){var v='link[rel="preload"][as="'+Qn(i)+'"]';i==="image"&&s&&s.imageSrcSet?(v+='[imagesrcset="'+Qn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(v+='[imagesizes="'+Qn(s.imageSizes)+'"]')):v+='[href="'+Qn(t)+'"]';var x=v;switch(i){case"style":x=Ba(t);break;case"script":x=ja(t)}Mi.has(x)||(t=p({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:t,as:i},s),Mi.set(x,t),l.querySelector(v)!==null||i==="style"&&l.querySelector(el(x))||i==="script"&&l.querySelector(tl(x))||(i=l.createElement("link"),Dn(i,"link",t),Je(i),l.head.appendChild(i)))}}function ME(t,i){Lr.m(t,i);var s=Da;if(s&&t){var l=i&&typeof i.as=="string"?i.as:"script",v='link[rel="modulepreload"][as="'+Qn(l)+'"][href="'+Qn(t)+'"]',x=v;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=ja(t)}if(!Mi.has(x)&&(t=p({rel:"modulepreload",href:t},i),Mi.set(x,t),s.querySelector(v)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(tl(x)))return}l=s.createElement("link"),Dn(l,"link",t),Je(l),s.head.appendChild(l)}}}function NE(t,i,s){Lr.S(t,i,s);var l=Da;if(l&&t){var v=ot(l).hoistableStyles,x=Ba(t);i=i||"default";var N=v.get(x);if(!N){var U={loading:0,preload:null};if(N=l.querySelector(el(x)))U.loading=5;else{t=p({rel:"stylesheet",href:t,"data-precedence":i},s),(s=Mi.get(x))&&ff(t,s);var ee=N=l.createElement("link");Je(ee),Dn(ee,"link",t),ee._p=new Promise(function(oe,de){ee.onload=oe,ee.onerror=de}),ee.addEventListener("load",function(){U.loading|=1}),ee.addEventListener("error",function(){U.loading|=2}),U.loading|=4,Jc(N,i,l)}N={type:"stylesheet",instance:N,count:1,state:U},v.set(x,N)}}}function OE(t,i){Lr.X(t,i);var s=Da;if(s&&t){var l=ot(s).hoistableScripts,v=ja(t),x=l.get(v);x||(x=s.querySelector(tl(v)),x||(t=p({src:t,async:!0},i),(i=Mi.get(v))&&pf(t,i),x=s.createElement("script"),Je(x),Dn(x,"link",t),s.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},l.set(v,x))}}function DE(t,i){Lr.M(t,i);var s=Da;if(s&&t){var l=ot(s).hoistableScripts,v=ja(t),x=l.get(v);x||(x=s.querySelector(tl(v)),x||(t=p({src:t,async:!0,type:"module"},i),(i=Mi.get(v))&&pf(t,i),x=s.createElement("script"),Je(x),Dn(x,"link",t),s.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},l.set(v,x))}}function I0(t,i,s,l){var v=(v=he.current)?Zc(v):null;if(!v)throw Error(a(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=Ba(s.href),s=ot(v).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=Ba(s.href);var x=ot(v).hoistableStyles,N=x.get(t);if(N||(v=v.ownerDocument||v,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(t,N),(x=v.querySelector(el(t)))&&!x._p&&(N.instance=x,N.state.loading=5),Mi.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},Mi.set(t,s),x||BE(v,t,s,N.state))),i&&l===null)throw Error(a(528,""));return N}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=ja(s),s=ot(v).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 Ba(t){return'href="'+Qn(t)+'"'}function el(t){return'link[rel="stylesheet"]['+t+"]"}function P0(t){return p({},t,{"data-precedence":t.precedence,precedence:null})}function BE(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}),Dn(i,"link",s),Je(i),t.head.appendChild(i))}function ja(t){return'[src="'+Qn(t)+'"]'}function tl(t){return"script[async]"+t}function z0(t,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var l=t.querySelector('style[data-href~="'+Qn(s.href)+'"]');if(l)return i.instance=l,Je(l),l;var v=p({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),Je(l),Dn(l,"style",v),Jc(l,s.precedence,t),i.instance=l;case"stylesheet":v=Ba(s.href);var x=t.querySelector(el(v));if(x)return i.state.loading|=4,i.instance=x,Je(x),x;l=P0(s),(v=Mi.get(v))&&ff(l,v),x=(t.ownerDocument||t).createElement("link"),Je(x);var N=x;return N._p=new Promise(function(U,ee){N.onload=U,N.onerror=ee}),Dn(x,"link",l),i.state.loading|=4,Jc(x,s.precedence,t),i.instance=x;case"script":return x=ja(s.src),(v=t.querySelector(tl(x)))?(i.instance=v,Je(v),v):(l=s,(v=Mi.get(x))&&(l=p({},s),pf(l,v)),t=t.ownerDocument||t,v=t.createElement("script"),Je(v),Dn(v,"link",l),t.head.appendChild(v),i.instance=v);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,Jc(l,s.precedence,t));return i.instance}function Jc(t,i,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=l.length?l[l.length-1]:null,x=v,N=0;N<l.length;N++){var U=l[N];if(U.dataset.precedence===i)x=U;else if(x!==v)break}x?x.parentNode.insertBefore(t,x.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(t,i.firstChild))}function ff(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function pf(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var Qc=null;function H0(t,i,s){if(Qc===null){var l=new Map,v=Qc=new Map;v.set(s,l)}else v=Qc,l=v.get(s),l||(l=new Map,v.set(s,l));if(l.has(t))return l;for(l.set(t,null),s=s.getElementsByTagName(t),v=0;v<s.length;v++){var x=s[v];if(!(x[Qi]||x[Bt]||t==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var N=x.getAttribute(i)||"";N=t+N;var U=l.get(N);U?U.push(x):l.set(N,[x])}}return l}function $0(t,i,s){t=t.ownerDocument||t,t.head.insertBefore(s,i==="title"?t.querySelector("head > title"):null)}function jE(t,i,s){if(s===1||i.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(t=i.disabled,typeof i.precedence=="string"&&t==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function U0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function IE(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 v=Ba(l.href),x=i.querySelector(el(v));if(x){i=x._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(t.count++,t=eu.bind(t),i.then(t,t)),s.state.loading|=4,s.instance=x,Je(x);return}x=i.ownerDocument||i,l=P0(l),(v=Mi.get(v))&&ff(l,v),x=x.createElement("link"),Je(x);var N=x;N._p=new Promise(function(U,ee){N.onload=U,N.onerror=ee}),Dn(x,"link",l),s.instance=x}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=eu.bind(t),i.addEventListener("load",s),i.addEventListener("error",s))}}var gf=0;function PE(t,i){return t.stylesheets&&t.count===0&&nu(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var l=setTimeout(function(){if(t.stylesheets&&nu(t,t.stylesheets),t.unsuspend){var x=t.unsuspend;t.unsuspend=null,x()}},6e4+i);0<t.imgBytes&&gf===0&&(gf=62500*vE());var v=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&nu(t,t.stylesheets),t.unsuspend)){var x=t.unsuspend;t.unsuspend=null,x()}},(t.imgBytes>gf?50:800)+i);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(v)}}:null}function eu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)nu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var tu=null;function nu(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,tu=new Map,i.forEach(zE,t),tu=null,eu.call(t))}function zE(t,i){if(!(i.state.loading&4)){var s=tu.get(t);if(s)var l=s.get(null);else{s=new Map,tu.set(t,s);for(var v=t.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<v.length;x++){var N=v[x];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(s.set(N.dataset.precedence,N),l=N)}l&&s.set(null,l)}v=i.instance,N=v.getAttribute("data-precedence"),x=s.get(N)||l,x===l&&s.set(null,v),s.set(N,v),this.count++,l=eu.bind(this),v.addEventListener("load",l),v.addEventListener("error",l),x?x.parentNode.insertBefore(v,x.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(v,t.firstChild)),i.state.loading|=4}}var nl={$$typeof:S,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function HE(t,i,s,l,v,x,N,U,ee){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=bt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bt(0),this.hiddenUpdates=bt(null),this.identifierPrefix=l,this.onUncaughtError=v,this.onCaughtError=x,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ee,this.incompleteTransitions=new Map}function F0(t,i,s,l,v,x,N,U,ee,oe,de,me){return t=new HE(t,i,s,N,ee,oe,de,me,U),i=1,x===!0&&(i|=24),x=di(3,null,null,i),t.current=x,x.stateNode=t,i=Kh(),i.refCount++,t.pooledCache=i,i.refCount++,x.memoizedState={element:l,isDehydrated:s,cache:i},Zh(x),t}function W0(t){return t?(t=fa,t):fa}function G0(t,i,s,l,v,x){v=W0(v),l.context===null?l.context=v:l.pendingContext=v,l=Zr(i),l.payload={element:s},x=x===void 0?null:x,x!==null&&(l.callback=x),s=Jr(t,l,i),s!==null&&(si(s,t,i),Do(s,t,i))}function q0(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){q0(t,i),(t=t.alternate)&&q0(t,i)}function K0(t){if(t.tag===13||t.tag===31){var i=Ls(t,67108864);i!==null&&si(i,t,67108864),mf(t,67108864)}}function V0(t){if(t.tag===13||t.tag===31){var i=_i();i=nt(i);var s=Ls(t,i);s!==null&&si(s,t,i),mf(t,i)}}var iu=!0;function $E(t,i,s,l){var v=H.T;H.T=null;var x=q.p;try{q.p=2,_f(t,i,s,l)}finally{q.p=x,H.T=v}}function UE(t,i,s,l){var v=H.T;H.T=null;var x=q.p;try{q.p=8,_f(t,i,s,l)}finally{q.p=x,H.T=v}}function _f(t,i,s,l){if(iu){var v=vf(l);if(v===null)nf(t,i,l,ru,s),X0(t,l);else if(WE(v,t,i,s,l))l.stopPropagation();else if(X0(t,l),i&4&&-1<FE.indexOf(t)){for(;v!==null;){var x=_e(v);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var N=Dt(x.pendingLanes);if(N!==0){var U=x;for(U.pendingLanes|=2,U.entangledLanes|=2;N;){var ee=1<<31-Ze(N);U.entanglements[1]|=ee,N&=~ee}ir(x),(_t&6)===0&&(Hc=ut()+500,Xo(0))}}break;case 31:case 13:U=Ls(x,2),U!==null&&si(U,x,2),Uc(),mf(x,2)}if(x=vf(l),x===null&&nf(t,i,l,ru,s),x===v)break;v=x}v!==null&&l.stopPropagation()}else nf(t,i,l,null,s)}}function vf(t){return t=We(t),bf(t)}var ru=null;function bf(t){if(ru=null,t=J(t),t!==null){var i=g(t);if(i===null)t=null;else{var s=i.tag;if(s===13){if(t=_(i),t!==null)return t;t=null}else if(s===31){if(t=c(i),t!==null)return t;t=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null)}}return ru=t,null}function Y0(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Rt()){case xt:return 2;case Ut:return 8;case Kt:case Xn:return 32;case bn:return 268435456;default:return 32}default:return 32}}var yf=!1,cs=null,us=null,hs=null,il=new Map,rl=new Map,ds=[],FE="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function X0(t,i){switch(t){case"focusin":case"focusout":cs=null;break;case"dragenter":case"dragleave":us=null;break;case"mouseover":case"mouseout":hs=null;break;case"pointerover":case"pointerout":il.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":rl.delete(i.pointerId)}}function sl(t,i,s,l,v,x){return t===null||t.nativeEvent!==x?(t={blockedOn:i,domEventName:s,eventSystemFlags:l,nativeEvent:x,targetContainers:[v]},i!==null&&(i=_e(i),i!==null&&K0(i)),t):(t.eventSystemFlags|=l,i=t.targetContainers,v!==null&&i.indexOf(v)===-1&&i.push(v),t)}function WE(t,i,s,l,v){switch(i){case"focusin":return cs=sl(cs,t,i,s,l,v),!0;case"dragenter":return us=sl(us,t,i,s,l,v),!0;case"mouseover":return hs=sl(hs,t,i,s,l,v),!0;case"pointerover":var x=v.pointerId;return il.set(x,sl(il.get(x)||null,t,i,s,l,v)),!0;case"gotpointercapture":return x=v.pointerId,rl.set(x,sl(rl.get(x)||null,t,i,s,l,v)),!0}return!1}function Z0(t){var i=J(t.target);if(i!==null){var s=g(i);if(s!==null){if(i=s.tag,i===13){if(i=_(s),i!==null){t.blockedOn=i,dr(t.priority,function(){V0(s)});return}}else if(i===31){if(i=c(s),i!==null){t.blockedOn=i,dr(t.priority,function(){V0(s)});return}}else if(i===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function su(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var s=vf(t.nativeEvent);if(s===null){s=t.nativeEvent;var l=new s.constructor(s.type,s);Te=l,s.target.dispatchEvent(l),Te=null}else return i=_e(s),i!==null&&K0(i),t.blockedOn=s,!1;i.shift()}return!0}function J0(t,i,s){su(t)&&s.delete(i)}function GE(){yf=!1,cs!==null&&su(cs)&&(cs=null),us!==null&&su(us)&&(us=null),hs!==null&&su(hs)&&(hs=null),il.forEach(J0),rl.forEach(J0)}function au(t,i){t.blockedOn===i&&(t.blockedOn=null,yf||(yf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,GE)))}var ou=null;function Q0(t){ou!==t&&(ou=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ou===t&&(ou=null);for(var i=0;i<t.length;i+=3){var s=t[i],l=t[i+1],v=t[i+2];if(typeof l!="function"){if(bf(l||s)===null)continue;break}var x=_e(s);x!==null&&(t.splice(i,3),i-=3,_d(x,{pending:!0,data:v,method:s.method,action:l},l,v))}}))}function Ia(t){function i(ee){return au(ee,t)}cs!==null&&au(cs,t),us!==null&&au(us,t),hs!==null&&au(hs,t),il.forEach(i),rl.forEach(i);for(var s=0;s<ds.length;s++){var l=ds[s];l.blockedOn===t&&(l.blockedOn=null)}for(;0<ds.length&&(s=ds[0],s.blockedOn===null);)Z0(s),s.blockedOn===null&&ds.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(l=0;l<s.length;l+=3){var v=s[l],x=s[l+1],N=v[Mt]||null;if(typeof x=="function")N||Q0(s);else if(N){var U=null;if(x&&x.hasAttribute("formAction")){if(v=x,N=x[Mt]||null)U=N.formAction;else if(bf(v)!==null)continue}else U=N.action;typeof U=="function"?s[l+1]=U:(s.splice(l,3),l-=3),Q0(s)}}}function e1(){function t(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(N){return v=N})},focusReset:"manual",scroll:"manual"})}function i(){v!==null&&(v(),v=null),l||setTimeout(s,20)}function s(){if(!l&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,v=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),v!==null&&(v(),v=null)}}}function Sf(t){this._internalRoot=t}lu.prototype.render=Sf.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,l=_i();G0(s,l,t,i,null,null)},lu.prototype.unmount=Sf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;G0(t.current,2,null,t,null,null),Uc(),i[Ui]=null}};function lu(t){this._internalRoot=t}lu.prototype.unstable_scheduleHydration=function(t){if(t){var i=hr();t={blockedOn:null,target:t,priority:i};for(var s=0;s<ds.length&&i!==0&&i<ds[s].priority;s++);ds.splice(s,0,t),s===0&&Z0(t)}};var t1=n.version;if(t1!=="19.2.7")throw Error(a(527,t1,"19.2.7"));q.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?b(t):null,t=t===null?null:t.stateNode,t};var qE={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var cu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!cu.isDisabled&&cu.supportsFiber)try{An=cu.inject(qE),ve=cu}catch{}}return ol.createRoot=function(t,i){if(!o(t))throw Error(a(299));var s=!1,l="",v=lv,x=cv,N=uv;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(l=i.identifierPrefix),i.onUncaughtError!==void 0&&(v=i.onUncaughtError),i.onCaughtError!==void 0&&(x=i.onCaughtError),i.onRecoverableError!==void 0&&(N=i.onRecoverableError)),i=F0(t,1,!1,null,null,s,l,null,v,x,N,e1),t[Ui]=i.current,tf(t),new Sf(i)},ol.hydrateRoot=function(t,i,s){if(!o(t))throw Error(a(299));var l=!1,v="",x=lv,N=cv,U=uv,ee=null;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(v=s.identifierPrefix),s.onUncaughtError!==void 0&&(x=s.onUncaughtError),s.onCaughtError!==void 0&&(N=s.onCaughtError),s.onRecoverableError!==void 0&&(U=s.onRecoverableError),s.formState!==void 0&&(ee=s.formState)),i=F0(t,1,!0,i,s??null,l,v,ee,x,N,U,e1),i.context=W0(null),s=i.current,l=_i(),l=nt(l),v=Zr(l),v.callback=null,Jr(s,v,l),s=l,i.current.lanes=s,ht(i,s),ir(i),t[Ui]=i.current,tf(t),new lu(i)},ol.version="19.2.7",ol}var h1;function M5(){if(h1)return Ef.exports;h1=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(),Ef.exports=L5(),Ef.exports}var N5=M5();var d1="popstate";function f1(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function O5(e={}){function n(a,o){let g=o.state?.masked,{pathname:_,search:c,hash:u}=g||a.location;return Cp("",{pathname:_,search:c,hash:u},o.state&&o.state.usr||null,o.state&&o.state.key||"default",g?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,o){return typeof o=="string"?o:jl(o)}return B5(n,r,null,e)}function qt(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Xi(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function D5(){return Math.random().toString(36).substring(2,10)}function p1(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 Cp(e,n,r=null,a,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?lo(n):n,state:r,key:n&&n.key||a||D5(),mask:o}}function jl({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 lo(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 B5(e,n,r,a={}){let{window:o=document.defaultView,v5Compat:g=!1}=a,_=o.history,c="POP",u=null,d=b();d==null&&(d=0,_.replaceState({..._.state,idx:d},""));function b(){return(_.state||{idx:null}).idx}function p(){c="POP";let f=b(),y=f==null?null:f-d;d=f,u&&u({action:c,location:E.location,delta:y})}function w(f,y){c="PUSH";let m=f1(f)?f:Cp(E.location,f,y);d=b()+1;let S=p1(m,d),k=E.createHref(m.mask||m);try{_.pushState(S,"",k)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;o.location.assign(k)}g&&u&&u({action:c,location:E.location,delta:1})}function C(f,y){c="REPLACE";let m=f1(f)?f:Cp(E.location,f,y);d=b();let S=p1(m,d),k=E.createHref(m.mask||m);_.replaceState(S,"",k),g&&u&&u({action:c,location:E.location,delta:0})}function A(f){return j5(o,f)}let E={get action(){return c},get location(){return e(o,_)},listen(f){if(u)throw new Error("A history only accepts one active listener");return o.addEventListener(d1,p),u=f,()=>{o.removeEventListener(d1,p),u=null}},createHref(f){return n(o,f)},createURL:A,encodeLocation(f){let y=A(f);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:w,replace:C,go(f){return _.go(f)}};return E}function j5(e,n,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),qt(a,"No window.location.(origin|href) available to create URL");let o=typeof n=="string"?n:jl(n);return o=o.replace(/ $/,"%20"),!r&&o.startsWith("//")&&(o=a+o),new URL(o,a)}function fS(e,n,r="/"){return I5(e,n,r,!1)}function I5(e,n,r,a,o){let g=typeof n=="string"?lo(n):n,_=zr(g.pathname||"/",r);if(_==null)return null;let c=P5(e),u=null,d=X5(_);for(let b=0;u==null&&b<c.length;++b)u=V5(c[b],d,a);return u}function P5(e){let n=pS(e);return z5(n),n}function pS(e,n=[],r=[],a="",o=!1){let g=(_,c,u=o,d)=>{let b={relativePath:d===void 0?_.path||"":d,caseSensitive:_.caseSensitive===!0,childrenIndex:c,route:_};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(a)&&u)return;qt(b.relativePath.startsWith(a),`Absolute route path "${b.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(a.length)}let p=Yi([a,b.relativePath]),w=r.concat(b);_.children&&_.children.length>0&&(qt(_.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),pS(_.children,n,w,p,u)),!(_.path==null&&!_.index)&&n.push({path:p,score:q5(p,_.index),routesMeta:w})};return e.forEach((_,c)=>{if(_.path===""||!_.path?.includes("?"))g(_,c);else for(let u of gS(_.path))g(_,c,!0,u)}),n}function gS(e){let n=e.split("/");if(n.length===0)return[];let[r,...a]=n,o=r.endsWith("?"),g=r.replace(/\?$/,"");if(a.length===0)return o?[g,""]:[g];let _=gS(a.join("/")),c=[];return c.push(..._.map(u=>u===""?g:[g,u].join("/"))),o&&c.push(..._),c.map(u=>e.startsWith("/")&&u===""?"/":u)}function z5(e){e.sort((n,r)=>n.score!==r.score?r.score-n.score:K5(n.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var H5=/^:[\w-]+$/,$5=3,U5=2,F5=1,W5=10,G5=-2,g1=e=>e==="*";function q5(e,n){let r=e.split("/"),a=r.length;return r.some(g1)&&(a+=G5),n&&(a+=U5),r.filter(o=>!g1(o)).reduce((o,g)=>o+(H5.test(g)?$5:g===""?F5:W5),a)}function K5(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 V5(e,n,r=!1){let{routesMeta:a}=e,o={},g="/",_=[];for(let c=0;c<a.length;++c){let u=a[c],d=c===a.length-1,b=g==="/"?n:n.slice(g.length)||"/",p=$u({path:u.relativePath,caseSensitive:u.caseSensitive,end:d},b),w=u.route;if(!p&&d&&r&&!a[a.length-1].route.index&&(p=$u({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},b)),!p)return null;Object.assign(o,p.params),_.push({params:o,pathname:Yi([g,p.pathname]),pathnameBase:ek(Yi([g,p.pathnameBase])),route:w}),p.pathnameBase!=="/"&&(g=Yi([g,p.pathnameBase]))}return _}function $u(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=Y5(e.path,e.caseSensitive,e.end),o=n.match(r);if(!o)return null;let g=o[0],_=g.replace(/(.)\/+$/,"$1"),c=o.slice(1);return{params:a.reduce((d,{paramName:b,isOptional:p},w)=>{if(b==="*"){let A=c[w]||"";_=g.slice(0,g.length-A.length).replace(/(.)\/+$/,"$1")}const C=c[w];return p&&!C?d[b]=void 0:d[b]=(C||"").replace(/%2F/g,"/"),d},{}),pathname:g,pathnameBase:_,pattern:e}}function Y5(e,n=!1,r=!0){Xi(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(_,c,u,d,b)=>{if(a.push({paramName:c,isOptional:u!=null}),u){let p=b.charAt(d+_.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 X5(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Xi(!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 zr(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 Z5=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function J5(e,n="/"){let{pathname:r,search:a="",hash:o=""}=typeof e=="string"?lo(e):e,g;return r?(r=mS(r),r.startsWith("/")?g=m1(r.substring(1),"/"):g=m1(r,n)):g=n,{pathname:g,search:tk(a),hash:nk(o)}}function m1(e,n){let r=Uu(n).split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function Rf(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 Q5(e){return e.filter((n,r)=>r===0||n.route.path&&n.route.path.length>0)}function Dg(e){let n=Q5(e);return n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase)}function sh(e,n,r,a=!1){let o;typeof e=="string"?o=lo(e):(o={...e},qt(!o.pathname||!o.pathname.includes("?"),Rf("?","pathname","search",o)),qt(!o.pathname||!o.pathname.includes("#"),Rf("#","pathname","hash",o)),qt(!o.search||!o.search.includes("#"),Rf("#","search","hash",o)));let g=e===""||o.pathname==="",_=g?"/":o.pathname,c;if(_==null)c=r;else{let p=n.length-1;if(!a&&_.startsWith("..")){let w=_.split("/");for(;w[0]==="..";)w.shift(),p-=1;o.pathname=w.join("/")}c=p>=0?n[p]:"/"}let u=J5(o,c),d=_&&_!=="/"&&_.endsWith("/"),b=(g||_===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(d||b)&&(u.pathname+="/"),u}var mS=e=>e.replace(/\/\/+/g,"/"),Yi=e=>mS(e.join("/")),Uu=e=>e.replace(/\/+$/,""),ek=e=>Uu(e).replace(/^\/*/,"/"),tk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,nk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,ik=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 rk(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function sk(e){let n=e.map(r=>r.route.path).filter(Boolean);return Yi(n)||"/"}var _S=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function vS(e,n){let r=e;if(typeof r!="string"||!Z5.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,o=!1;if(_S)try{let g=new URL(window.location.href),_=r.startsWith("//")?new URL(g.protocol+r):new URL(r),c=zr(_.pathname,n);_.origin===g.origin&&c!=null?r=c+_.search+_.hash:o=!0}catch{Xi(!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 bS=["POST","PUT","PATCH","DELETE"];new Set(bS);var ak=["GET",...bS];new Set(ak);var co=j.createContext(null);co.displayName="DataRouter";var ah=j.createContext(null);ah.displayName="DataRouterState";var yS=j.createContext(!1);function ok(){return j.useContext(yS)}var SS=j.createContext({isTransitioning:!1});SS.displayName="ViewTransition";var lk=j.createContext(new Map);lk.displayName="Fetchers";var ck=j.createContext(null);ck.displayName="Await";var wi=j.createContext(null);wi.displayName="Navigation";var Vl=j.createContext(null);Vl.displayName="Location";var cr=j.createContext({outlet:null,matches:[],isDataRoute:!1});cr.displayName="Route";var Bg=j.createContext(null);Bg.displayName="RouteError";var wS="REACT_ROUTER_ERROR",uk="REDIRECT",hk="ROUTE_ERROR_RESPONSE";function dk(e){if(e.startsWith(`${wS}:${uk}:{`))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 fk(e){if(e.startsWith(`${wS}:${hk}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new ik(n.status,n.statusText,n.data)}catch{}}function pk(e,{relative:n}={}){qt(uo(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=j.useContext(wi),{hash:o,pathname:g,search:_}=Yl(e,{relative:n}),c=g;return r!=="/"&&(c=g==="/"?r:Yi([r,g])),a.createHref({pathname:c,search:_,hash:o})}function uo(){return j.useContext(Vl)!=null}function $i(){return qt(uo(),"useLocation() may be used only in the context of a <Router> component."),j.useContext(Vl).location}var xS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function CS(e){j.useContext(wi).static||j.useLayoutEffect(e)}function oh(){let{isDataRoute:e}=j.useContext(cr);return e?Ak():gk()}function gk(){qt(uo(),"useNavigate() may be used only in the context of a <Router> component.");let e=j.useContext(co),{basename:n,navigator:r}=j.useContext(wi),{matches:a}=j.useContext(cr),{pathname:o}=$i(),g=JSON.stringify(Dg(a)),_=j.useRef(!1);return CS(()=>{_.current=!0}),j.useCallback((u,d={})=>{if(Xi(_.current,xS),!_.current)return;if(typeof u=="number"){r.go(u);return}let b=sh(u,JSON.parse(g),o,d.relative==="path");e==null&&n!=="/"&&(b.pathname=b.pathname==="/"?n:Yi([n,b.pathname])),(d.replace?r.replace:r.push)(b,d.state,d)},[n,r,g,o,e])}j.createContext(null);function Yl(e,{relative:n}={}){let{matches:r}=j.useContext(cr),{pathname:a}=$i(),o=JSON.stringify(Dg(r));return j.useMemo(()=>sh(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function mk(e,n){return ES(e,n)}function ES(e,n,r){qt(uo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=j.useContext(wi),{matches:o}=j.useContext(cr),g=o[o.length-1],_=g?g.params:{},c=g?g.pathname:"/",u=g?g.pathnameBase:"/",d=g&&g.route;{let f=d&&d.path||"";AS(c,!d||f.endsWith("*")||f.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${f}">) 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="${f}"> to <Route path="${f==="/"?"*":`${f}/*`}">.`)}let b=$i(),p;if(n){let f=typeof n=="string"?lo(n):n;qt(u==="/"||f.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 "${f.pathname}" was given in the \`location\` prop.`),p=f}else p=b;let w=p.pathname||"/",C=w;if(u!=="/"){let f=u.replace(/^\//,"").split("/");C="/"+w.replace(/^\//,"").split("/").slice(f.length).join("/")}let A=r&&r.state.matches.length?r.state.matches.map(f=>Object.assign(f,{route:r.manifest[f.route.id]||f.route})):fS(e,{pathname:C});Xi(d||A!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),Xi(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=Sk(A&&A.map(f=>Object.assign({},f,{params:Object.assign({},_,f.params),pathname:Yi([u,a.encodeLocation?a.encodeLocation(f.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:f.pathname]),pathnameBase:f.pathnameBase==="/"?u:Yi([u,a.encodeLocation?a.encodeLocation(f.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:f.pathnameBase])})),o,r);return n&&E?j.createElement(Vl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...p},navigationType:"POP"}},E):E}function _k(){let e=kk(),n=rk(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},g={padding:"2px 4px",backgroundColor:a},_=null;return console.error("Error handled by React Router default ErrorBoundary:",e),_=j.createElement(j.Fragment,null,j.createElement("p",null,"💿 Hey developer 👋"),j.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",j.createElement("code",{style:g},"ErrorBoundary")," or"," ",j.createElement("code",{style:g},"errorElement")," prop on your route.")),j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},n),r?j.createElement("pre",{style:o},r):null,_)}var vk=j.createElement(_k,null),kS=class extends j.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=fk(e.digest);r&&(e=r)}let n=e!==void 0?j.createElement(cr.Provider,{value:this.props.routeContext},j.createElement(Bg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?j.createElement(bk,{error:e},n):n}};kS.contextType=yS;var Lf=new WeakMap;function bk({children:e,error:n}){let{basename:r}=j.useContext(wi);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let a=dk(n.digest);if(a){let o=Lf.get(n);if(o)throw o;let g=vS(a.location,r);if(_S&&!Lf.get(n))if(g.isExternal||a.reloadDocument)window.location.href=g.absoluteURL||g.to;else{const _=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(g.to,{replace:a.replace}));throw Lf.set(n,_),_}return j.createElement("meta",{httpEquiv:"refresh",content:`0;url=${g.absoluteURL||g.to}`})}}return e}function yk({routeContext:e,match:n,children:r}){let a=j.useContext(co);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),j.createElement(cr.Provider,{value:e},r)}function Sk(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,g=a?.errors;if(g!=null){let b=o.findIndex(p=>p.route.id&&g?.[p.route.id]!==void 0);qt(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(g).join(",")}`),o=o.slice(0,Math.min(o.length,b+1))}let _=!1,c=-1;if(r&&a){_=a.renderFallback;for(let b=0;b<o.length;b++){let p=o[b];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(c=b),p.route.id){let{loaderData:w,errors:C}=a,A=p.route.loader&&!w.hasOwnProperty(p.route.id)&&(!C||C[p.route.id]===void 0);if(p.route.lazy||A){r.isStatic&&(_=!0),c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}}let u=r?.onError,d=a&&u?(b,p)=>{u(b,{location:a.location,params:a.matches?.[0]?.params??{},pattern:sk(a.matches),errorInfo:p})}:void 0;return o.reduceRight((b,p,w)=>{let C,A=!1,E=null,f=null;a&&(C=g&&p.route.id?g[p.route.id]:void 0,E=p.route.errorElement||vk,_&&(c<0&&w===0?(AS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),A=!0,f=null):c===w&&(A=!0,f=p.route.hydrateFallbackElement||null)));let y=n.concat(o.slice(0,w+1)),m=()=>{let S;return C?S=E:A?S=f:p.route.Component?S=j.createElement(p.route.Component,null):p.route.element?S=p.route.element:S=b,j.createElement(yk,{match:p,routeContext:{outlet:b,matches:y,isDataRoute:a!=null},children:S})};return a&&(p.route.ErrorBoundary||p.route.errorElement||w===0)?j.createElement(kS,{location:a.location,revalidation:a.revalidation,component:E,error:C,children:m(),routeContext:{outlet:null,matches:y,isDataRoute:!0},onError:d}):m()},null)}function jg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function wk(e){let n=j.useContext(co);return qt(n,jg(e)),n}function xk(e){let n=j.useContext(ah);return qt(n,jg(e)),n}function Ck(e){let n=j.useContext(cr);return qt(n,jg(e)),n}function Ig(e){let n=Ck(e),r=n.matches[n.matches.length-1];return qt(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Ek(){return Ig("useRouteId")}function kk(){let e=j.useContext(Bg),n=xk("useRouteError"),r=Ig("useRouteError");return e!==void 0?e:n.errors?.[r]}function Ak(){let{router:e}=wk("useNavigate"),n=Ig("useNavigate"),r=j.useRef(!1);return CS(()=>{r.current=!0}),j.useCallback(async(o,g={})=>{Xi(r.current,xS),r.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:n,...g}))},[e,n])}var _1={};function AS(e,n,r){!n&&!_1[e]&&(_1[e]=!0,Xi(!1,r))}j.memo(Tk);function Tk({routes:e,manifest:n,future:r,state:a,isStatic:o,onError:g}){return ES(e,void 0,{manifest:n,state:a,isStatic:o,onError:g})}function v1({to:e,replace:n,state:r,relative:a}){qt(uo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=j.useContext(wi);Xi(!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:g}=j.useContext(cr),{pathname:_}=$i(),c=oh(),u=sh(e,Dg(g),_,a==="path"),d=JSON.stringify(u);return j.useEffect(()=>{c(JSON.parse(d),{replace:n,state:r,relative:a})},[c,d,a,n,r]),null}function Fa(e){qt(!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 Rk({basename:e="/",children:n=null,location:r,navigationType:a="POP",navigator:o,static:g=!1,useTransitions:_}){qt(!uo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),u=j.useMemo(()=>({basename:c,navigator:o,static:g,useTransitions:_,future:{}}),[c,o,g,_]);typeof r=="string"&&(r=lo(r));let{pathname:d="/",search:b="",hash:p="",state:w=null,key:C="default",mask:A}=r,E=j.useMemo(()=>{let f=zr(d,c);return f==null?null:{location:{pathname:f,search:b,hash:p,state:w,key:C,mask:A},navigationType:a}},[c,d,b,p,w,C,a,A]);return Xi(E!=null,`<Router basename="${c}"> is not able to match the URL "${d}${b}${p}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:j.createElement(wi.Provider,{value:u},j.createElement(Vl.Provider,{children:n,value:E}))}function Lk({children:e,location:n}){return mk(Ep(e),n)}function Ep(e,n=[]){let r=[];return j.Children.forEach(e,(a,o)=>{if(!j.isValidElement(a))return;let g=[...n,o];if(a.type===j.Fragment){r.push.apply(r,Ep(a.props.children,g));return}qt(a.type===Fa,`[${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>`),qt(!a.props.index||!a.props.children,"An index route cannot have child routes.");let _={id:a.props.id||g.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(_.children=Ep(a.props.children,g)),r.push(_)}),r}var Au="get",Tu="application/x-www-form-urlencoded";function lh(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Mk(e){return lh(e)&&e.tagName.toLowerCase()==="button"}function Nk(e){return lh(e)&&e.tagName.toLowerCase()==="form"}function Ok(e){return lh(e)&&e.tagName.toLowerCase()==="input"}function Dk(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Bk(e,n){return e.button===0&&(!n||n==="_self")&&!Dk(e)}var uu=null;function jk(){if(uu===null)try{new FormData(document.createElement("form"),0),uu=!1}catch{uu=!0}return uu}var Ik=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Mf(e){return e!=null&&!Ik.has(e)?(Xi(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Tu}"`),null):e}function Pk(e,n){let r,a,o,g,_;if(Nk(e)){let c=e.getAttribute("action");a=c?zr(c,n):null,r=e.getAttribute("method")||Au,o=Mf(e.getAttribute("enctype"))||Tu,g=new FormData(e)}else if(Mk(e)||Ok(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?zr(u,n):null,r=e.getAttribute("formmethod")||c.getAttribute("method")||Au,o=Mf(e.getAttribute("formenctype"))||Mf(c.getAttribute("enctype"))||Tu,g=new FormData(c,e),!jk()){let{name:d,type:b,value:p}=e;if(b==="image"){let w=d?`${d}.`:"";g.append(`${w}x`,"0"),g.append(`${w}y`,"0")}else d&&g.append(d,p)}}else{if(lh(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Au,a=null,o=Tu,_=e}return g&&o==="text/plain"&&(_=g,g=void 0),{action:a,method:r.toLowerCase(),encType:o,formData:g,body:_}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Pg(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function TS(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&&zr(o.pathname,n)==="/"?o.pathname=`${Uu(n)}/_root.${a}`:o.pathname=`${Uu(o.pathname)}.${a}`,o}async function zk(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 Hk(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 $k(e,n,r){let a=await Promise.all(e.map(async o=>{let g=n.routes[o.route.id];if(g){let _=await zk(g,r);return _.links?_.links():[]}return[]}));return Gk(a.flat(1).filter(Hk).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function b1(e,n,r,a,o,g){let _=(u,d)=>r[d]?u.route.id!==r[d].route.id:!0,c=(u,d)=>r[d].pathname!==u.pathname||r[d].route.path?.endsWith("*")&&r[d].params["*"]!==u.params["*"];return g==="assets"?n.filter((u,d)=>_(u,d)||c(u,d)):g==="data"?n.filter((u,d)=>{let b=a.routes[u.route.id];if(!b||!b.hasLoader)return!1;if(_(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 Uk(e,n,{includeHydrateFallback:r}={}){return Fk(e.map(a=>{let o=n.routes[a.route.id];if(!o)return[];let g=[o.module];return o.clientActionModule&&(g=g.concat(o.clientActionModule)),o.clientLoaderModule&&(g=g.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(g=g.concat(o.hydrateFallbackModule)),o.imports&&(g=g.concat(o.imports)),g}).flat(1))}function Fk(e){return[...new Set(e)]}function Wk(e){let n={},r=Object.keys(e).sort();for(let a of r)n[a]=e[a];return n}function Gk(e,n){let r=new Set;return new Set(n),e.reduce((a,o)=>{let g=JSON.stringify(Wk(o));return r.has(g)||(r.add(g),a.push({key:g,link:o})),a},[])}function zg(){let e=j.useContext(co);return Pg(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function qk(){let e=j.useContext(ah);return Pg(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Hg=j.createContext(void 0);Hg.displayName="FrameworkContext";function $g(){let e=j.useContext(Hg);return Pg(e,"You must render this element inside a <HydratedRouter> element"),e}function Kk(e,n){let r=j.useContext(Hg),[a,o]=j.useState(!1),[g,_]=j.useState(!1),{onFocus:c,onBlur:u,onMouseEnter:d,onMouseLeave:b,onTouchStart:p}=n,w=j.useRef(null);j.useEffect(()=>{if(e==="render"&&_(!0),e==="viewport"){let E=y=>{y.forEach(m=>{_(m.isIntersecting)})},f=new IntersectionObserver(E,{threshold:.5});return w.current&&f.observe(w.current),()=>{f.disconnect()}}},[e]),j.useEffect(()=>{if(a){let E=setTimeout(()=>{_(!0)},100);return()=>{clearTimeout(E)}}},[a]);let C=()=>{o(!0)},A=()=>{o(!1),_(!1)};return r?e!=="intent"?[g,w,{}]:[g,w,{onFocus:ll(c,C),onBlur:ll(u,A),onMouseEnter:ll(d,C),onMouseLeave:ll(b,A),onTouchStart:ll(p,C)}]:[!1,w,{}]}function ll(e,n){return r=>{e&&e(r),r.defaultPrevented||n(r)}}function Vk({page:e,...n}){let r=ok(),{router:a}=zg(),o=j.useMemo(()=>fS(a.routes,e,a.basename),[a.routes,e,a.basename]);return o?r?j.createElement(Xk,{page:e,matches:o,...n}):j.createElement(Zk,{page:e,matches:o,...n}):null}function Yk(e){let{manifest:n,routeModules:r}=$g(),[a,o]=j.useState([]);return j.useEffect(()=>{let g=!1;return $k(e,n,r).then(_=>{g||o(_)}),()=>{g=!0}},[e,n,r]),a}function Xk({page:e,matches:n,...r}){let a=$i(),{future:o}=$g(),{basename:g}=zg(),_=j.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let c=TS(e,g,o.v8_trailingSlashAwareDataRequests,"rsc"),u=!1,d=[];for(let b of n)typeof b.route.shouldRevalidate=="function"?u=!0:d.push(b.route.id);return u&&d.length>0&&c.searchParams.set("_routes",d.join(",")),[c.pathname+c.search]},[g,o.v8_trailingSlashAwareDataRequests,e,a,n]);return j.createElement(j.Fragment,null,_.map(c=>j.createElement("link",{key:c,rel:"prefetch",as:"fetch",href:c,...r})))}function Zk({page:e,matches:n,...r}){let a=$i(),{future:o,manifest:g,routeModules:_}=$g(),{basename:c}=zg(),{loaderData:u,matches:d}=qk(),b=j.useMemo(()=>b1(e,n,d,g,a,"data"),[e,n,d,g,a]),p=j.useMemo(()=>b1(e,n,d,g,a,"assets"),[e,n,d,g,a]),w=j.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let E=new Set,f=!1;if(n.forEach(m=>{let S=g.routes[m.route.id];!S||!S.hasLoader||(!b.some(k=>k.route.id===m.route.id)&&m.route.id in u&&_[m.route.id]?.shouldRevalidate||S.hasClientLoader?f=!0:E.add(m.route.id))}),E.size===0)return[];let y=TS(e,c,o.v8_trailingSlashAwareDataRequests,"data");return f&&E.size>0&&y.searchParams.set("_routes",n.filter(m=>E.has(m.route.id)).map(m=>m.route.id).join(",")),[y.pathname+y.search]},[c,o.v8_trailingSlashAwareDataRequests,u,a,g,b,n,e,_]),C=j.useMemo(()=>Uk(p,g),[p,g]),A=Yk(p);return j.createElement(j.Fragment,null,w.map(E=>j.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...r})),C.map(E=>j.createElement("link",{key:E,rel:"modulepreload",href:E,...r})),A.map(({key:E,link:f})=>j.createElement("link",{key:E,nonce:r.nonce,...f,crossOrigin:f.crossOrigin??r.crossOrigin})))}function Jk(...e){return n=>{e.forEach(r=>{typeof r=="function"?r(n):r!=null&&(r.current=n)})}}var Qk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Qk&&(window.__reactRouterVersion="7.17.0")}catch{}function eA({basename:e,children:n,useTransitions:r,window:a}){let o=j.useRef();o.current==null&&(o.current=O5({window:a,v5Compat:!0}));let g=o.current,[_,c]=j.useState({action:g.action,location:g.location}),u=j.useCallback(d=>{r===!1?c(d):j.startTransition(()=>c(d))},[r]);return j.useLayoutEffect(()=>g.listen(u),[g,u]),j.createElement(Rk,{basename:e,children:n,location:_.location,navigationType:_.action,navigator:g,useTransitions:r})}var RS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Il=j.forwardRef(function({onClick:n,discover:r="render",prefetch:a="none",relative:o,reloadDocument:g,replace:_,mask:c,state:u,target:d,to:b,preventScrollReset:p,viewTransition:w,defaultShouldRevalidate:C,...A},E){let{basename:f,navigator:y,useTransitions:m}=j.useContext(wi),S=typeof b=="string"&&RS.test(b),k=vS(b,f);b=k.to;let L=pk(b,{relative:o}),R=$i(),M=null;if(c){let X=sh(c,[],R.mask?R.mask.pathname:"/",!0);f!=="/"&&(X.pathname=X.pathname==="/"?f:Yi([f,X.pathname])),M=y.createHref(X)}let[T,I,K]=Kk(a,A),F=iA(b,{replace:_,mask:c,state:u,target:d,preventScrollReset:p,relative:o,viewTransition:w,defaultShouldRevalidate:C,useTransitions:m});function G(X){n&&n(X),X.defaultPrevented||F(X)}let B=!(k.isExternal||g),Y=j.createElement("a",{...A,...K,href:(B?M:void 0)||k.absoluteURL||L,onClick:B?G:n,ref:Jk(E,I),target:d,"data-discover":!S&&r==="render"?"true":void 0});return T&&!S?j.createElement(j.Fragment,null,Y,j.createElement(Vk,{page:L})):Y});Il.displayName="Link";var kp=j.forwardRef(function({"aria-current":n="page",caseSensitive:r=!1,className:a="",end:o=!1,style:g,to:_,viewTransition:c,children:u,...d},b){let p=Yl(_,{relative:d.relative}),w=$i(),C=j.useContext(ah),{navigator:A,basename:E}=j.useContext(wi),f=C!=null&&lA(p)&&c===!0,y=A.encodeLocation?A.encodeLocation(p).pathname:p.pathname,m=w.pathname,S=C&&C.navigation&&C.navigation.location?C.navigation.location.pathname:null;r||(m=m.toLowerCase(),S=S?S.toLowerCase():null,y=y.toLowerCase()),S&&E&&(S=zr(S,E)||S);const k=y!=="/"&&y.endsWith("/")?y.length-1:y.length;let L=m===y||!o&&m.startsWith(y)&&m.charAt(k)==="/",R=S!=null&&(S===y||!o&&S.startsWith(y)&&S.charAt(y.length)==="/"),M={isActive:L,isPending:R,isTransitioning:f},T=L?n:void 0,I;typeof a=="function"?I=a(M):I=[a,L?"active":null,R?"pending":null,f?"transitioning":null].filter(Boolean).join(" ");let K=typeof g=="function"?g(M):g;return j.createElement(Il,{...d,"aria-current":T,className:I,ref:b,style:K,to:_,viewTransition:c},typeof u=="function"?u(M):u)});kp.displayName="NavLink";var tA=j.forwardRef(({discover:e="render",fetcherKey:n,navigate:r,reloadDocument:a,replace:o,state:g,method:_=Au,action:c,onSubmit:u,relative:d,preventScrollReset:b,viewTransition:p,defaultShouldRevalidate:w,...C},A)=>{let{useTransitions:E}=j.useContext(wi),f=aA(),y=oA(c,{relative:d}),m=_.toLowerCase()==="get"?"get":"post",S=typeof c=="string"&&RS.test(c),k=L=>{if(u&&u(L),L.defaultPrevented)return;L.preventDefault();let R=L.nativeEvent.submitter,M=R?.getAttribute("formmethod")||_,T=()=>f(R||L.currentTarget,{fetcherKey:n,method:M,navigate:r,replace:o,state:g,relative:d,preventScrollReset:b,viewTransition:p,defaultShouldRevalidate:w});E&&r!==!1?j.startTransition(()=>T()):T()};return j.createElement("form",{ref:A,method:m,action:y,onSubmit:a?u:k,...C,"data-discover":!S&&e==="render"?"true":void 0})});tA.displayName="Form";function nA(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function LS(e){let n=j.useContext(co);return qt(n,nA(e)),n}function iA(e,{target:n,replace:r,mask:a,state:o,preventScrollReset:g,relative:_,viewTransition:c,defaultShouldRevalidate:u,useTransitions:d}={}){let b=oh(),p=$i(),w=Yl(e,{relative:_});return j.useCallback(C=>{if(Bk(C,n)){C.preventDefault();let A=r!==void 0?r:jl(p)===jl(w),E=()=>b(e,{replace:A,mask:a,state:o,preventScrollReset:g,relative:_,viewTransition:c,defaultShouldRevalidate:u});d?j.startTransition(()=>E()):E()}},[p,b,w,r,a,o,n,e,g,_,c,u,d])}var rA=0,sA=()=>`__${String(++rA)}__`;function aA(){let{router:e}=LS("useSubmit"),{basename:n}=j.useContext(wi),r=Ek(),a=e.fetch,o=e.navigate;return j.useCallback(async(g,_={})=>{let{action:c,method:u,encType:d,formData:b,body:p}=Pk(g,n);if(_.navigate===!1){let w=_.fetcherKey||sA();await a(w,r,_.action||c,{defaultShouldRevalidate:_.defaultShouldRevalidate,preventScrollReset:_.preventScrollReset,formData:b,body:p,formMethod:_.method||u,formEncType:_.encType||d,flushSync:_.flushSync})}else await o(_.action||c,{defaultShouldRevalidate:_.defaultShouldRevalidate,preventScrollReset:_.preventScrollReset,formData:b,body:p,formMethod:_.method||u,formEncType:_.encType||d,replace:_.replace,state:_.state,fromRouteId:r,flushSync:_.flushSync,viewTransition:_.viewTransition})},[a,o,n,r])}function oA(e,{relative:n}={}){let{basename:r}=j.useContext(wi),a=j.useContext(cr);qt(a,"useFormAction must be used inside a RouteContext");let[o]=a.matches.slice(-1),g={...Yl(e||".",{relative:n})},_=$i();if(e==null){g.search=_.search;let c=new URLSearchParams(g.search),u=c.getAll("index");if(u.some(b=>b==="")){c.delete("index"),u.filter(p=>p).forEach(p=>c.append("index",p));let b=c.toString();g.search=b?`?${b}`:""}}return(!e||e===".")&&o.route.index&&(g.search=g.search?g.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(g.pathname=g.pathname==="/"?r:Yi([r,g.pathname])),jl(g)}function lA(e,{relative:n}={}){let r=j.useContext(SS);qt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=LS("useViewTransitionState"),o=Yl(e,{relative:n});if(!r.isTransitioning)return!1;let g=zr(r.currentLocation.pathname,a)||r.currentLocation.pathname,_=zr(r.nextLocation.pathname,a)||r.nextLocation.pathname;return $u(o.pathname,_)!=null||$u(o.pathname,g)!=null}var Xs=dS();const cA="fleet-console.canvas.",Ug="fleet-console.canvas.backgroundAnimation",Fg="fleet-console.canvas.perimeterAnimation",MS="fleet-console.canvas.maximized",uA=400,Ap=640,Tp=400,y1=40,S1=96,hA=.25,dA=1,Nf=.2,w1=.5,fA=.001,Ka={x:0,y:0,zoom:1},Qa={viewport:Ka,operations:{},operationOrder:[],operationAccent:{},minimized:[],collapsedGroups:[]},Rp=new Set,Lp=new Set,Mp=new Set,Np=new Set,Op=new Set,Pl=new Map;let yi=null,ws=null,Ke=Qa,eo=UA(),to=GA(),Ml=VA(),Vn=null,ys=Ka,Zs=null,Fu=0;function Wg(e){return Rp.add(e),()=>{Rp.delete(e)}}function so(){return Ke}function Dp(){return Vn}function pA(){return yi}function NS(){return j.useSyncExternalStore(Wg,so,so)}function gA(){return j.useSyncExternalStore(RA,C1,C1)}function mA(){return j.useSyncExternalStore(LA,E1,E1)}function OS(){return j.useSyncExternalStore(MA,k1,k1)}function DS(){return j.useSyncExternalStore(NA,A1,A1)}function BS(){return j.useSyncExternalStore(Wg,T1,T1)}function Si(e){Ke={viewport:e.viewport??Ke.viewport,operations:e.operations??Ke.operations,operationOrder:e.operationOrder??Ke.operationOrder,operationAccent:e.operationAccent??Ke.operationAccent,minimized:e.minimized??Ke.minimized,collapsedGroups:e.collapsedGroups??Ke.collapsedGroups},PA(),IS()}function _A(e){const n=Ke.collapsedGroups.includes(e)?Ke.collapsedGroups.filter(r=>r!==e):[...Ke.collapsedGroups,e];Si({collapsedGroups:n})}function vA(){return j.useSyncExternalStore(Wg,R1,R1)}function Bp(e){qg();const n=Kg(e);ys=n,Si({viewport:n})}function jS(e){const n=Kg(e);if(typeof window>"u"||typeof window.requestAnimationFrame!="function"||IA()){Bp(n);return}ys=n,Zs===null&&(Zs=window.requestAnimationFrame(HS))}function jp(e,n){const r=ta();Si({operations:{...Ke.operations,[e]:{...Vg(n,r),zIndex:r}}})}function bA(e){Ke.minimized.includes(e)||(Vn===e&&ao(),Si({minimized:[...Ke.minimized,e]}))}function yA(e){if(!Ke.minimized.includes(e))return;Vn===e&&ao();const n=Ke.minimized.filter(o=>o!==e),r=Ke.operations[e];if(!r){Si({minimized:n});return}const a=ta();Si({minimized:n,operations:{...Ke.operations,[e]:{...r,zIndex:a}}})}function Of(e){Si({operationOrder:FS(e)})}function ta(){return Fu+=1,Fu}function SA(e){const n=Ke.operations[e];if(n)return n;const r=Object.keys(Ke.operations).length,a={x:r*y1,y:r*y1,width:Ap,height:Tp,zIndex:ta()};return Si({operations:{...Ke.operations,[e]:a}}),a}function wA(e){const n=new Set(e),r={};let a=!1;for(const[b,p]of Object.entries(Ke.operations))n.has(b)?r[b]=p:a=!0;const o=Ke.minimized.filter(b=>n.has(b)),g=o.length!==Ke.minimized.length,_=Ke.operationOrder.filter(b=>n.has(b)),c=_.length!==Ke.operationOrder.length,u=Object.fromEntries(Object.entries(Ke.operationAccent).filter(([b])=>n.has(b))),d=Object.keys(u).length!==Object.keys(Ke.operationAccent).length;Vn&&(!n.has(Vn)||o.includes(Vn))&&ao(),(a||g||c||d)&&Si({operations:r,minimized:o,operationOrder:_,operationAccent:u})}function xA(e){zA(),qg(),DA(),yi=e,Ke=e?$A(e):Qa;const n=e?Pl.get(e)??null:null,r=Vn!==n;Vn=n,ys=Ke.viewport,Fu=Math.max(Fu,WS(Ke.operations)),IS(),r&&Gg()}function x1(e,n){const r=Ke.operations[e];if(!r)return;const a=Math.max(hA,Math.min(dA,Math.min((n.width-S1)/r.width,(n.height-S1)/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};qg(),ys=o;const g=ta(),_=Ke.minimized.includes(e);Si({viewport:o,operations:{...Ke.operations,[e]:{...Vg(r,g),zIndex:g}},..._?{minimized:Ke.minimized.filter(c=>c!==e)}:{}})}function CA(){eo=!eo,WA(eo),PS()}function EA(){to=!to,KA(to),zS()}function kA(e){e==="local"&&(eo&&!FA()&&(eo=!1,PS()),to&&!qA()&&(to=!1,zS()))}function AA(){TA(!Ml)}function TA(e){Ml!==e&&(Ml=e,YA(Ml),OA())}function Nl(e){yi&&Pl.set(yi,e);const n=BA(e),r=!jA(Ke.minimized,n),a=Vn!==e;a&&(Vn=e),r&&Si({minimized:n}),a&&Gg()}function ao(){yi&&Pl.delete(yi),Vn!==null&&(Vn=null,Gg())}function RA(e){return Lp.add(e),()=>{Lp.delete(e)}}function C1(){return eo}function LA(e){return Mp.add(e),()=>{Mp.delete(e)}}function E1(){return to}function IS(){for(const e of Rp)e()}function PS(){for(const e of Lp)e()}function zS(){for(const e of Mp)e()}function MA(e){return Np.add(e),()=>{Np.delete(e)}}function k1(){return Ml}function NA(e){return Op.add(e),()=>{Op.delete(e)}}function A1(){return Vn}function T1(){return Ke.minimized}function R1(){return Ke.collapsedGroups}function OA(){for(const e of Np)e()}function Gg(){for(const e of Op)e()}function DA(){yi&&(Vn?Pl.set(yi,Vn):Pl.delete(yi))}function BA(e){return Object.keys(Ke.operations).filter(n=>n!==e)}function jA(e,n){return e.length===n.length&&e.every((r,a)=>r===n[a])}function HS(){const e=Ke.viewport,n=ys.x-e.x,r=ys.y-e.y,a=ys.zoom-e.zoom;if(Math.abs(n)<w1&&Math.abs(r)<w1&&Math.abs(a)<fA){Zs=null,Si({viewport:ys});return}Si({viewport:{x:e.x+n*Nf,y:e.y+r*Nf,zoom:e.zoom+a*Nf}}),Zs=typeof window<"u"?window.requestAnimationFrame(HS):null}function qg(){Zs===null||typeof window>"u"||(window.cancelAnimationFrame(Zs),Zs=null)}function IA(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function PA(){!yi||typeof window>"u"||(HA(),ws=window.setTimeout(()=>{ws=null,$S(yi,Ke)},uA))}function zA(){!ws||!yi||typeof window>"u"||(window.clearTimeout(ws),ws=null,$S(yi,Ke))}function HA(){!ws||typeof window>"u"||(window.clearTimeout(ws),ws=null)}function $A(e){if(typeof window>"u")return Qa;try{const n=window.localStorage.getItem(US(e));if(!n)return Qa;const r=JSON.parse(n);return XA(r)}catch{return Qa}}function $S(e,n){if(!(!e||typeof window>"u"))try{window.localStorage.setItem(US(e),JSON.stringify(n))}catch{}}function UA(){if(typeof window>"u")return!0;try{const e=window.localStorage.getItem(Ug);return e===null?!0:e==="true"}catch{return!0}}function FA(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Ug)!==null}catch{return!1}}function WA(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Ug,String(e))}catch{}}function GA(){if(typeof window>"u")return!0;try{const e=window.localStorage.getItem(Fg);return e===null?!0:e==="true"}catch{return!0}}function qA(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Fg)!==null}catch{return!1}}function KA(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Fg,String(e))}catch{}}function VA(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(MS)==="true"}catch{return!1}}function YA(e){if(!(typeof window>"u"))try{window.localStorage.setItem(MS,String(e))}catch{}}function US(e){return`${cA}${e}`}function XA(e){if(!oo(e))return Qa;const n=QA(e.operations);return{viewport:Kg(e.viewport),operations:n,operationOrder:FS(e.operationOrder),operationAccent:ZA(e.operationAccent),minimized:JA(e.minimized,n),collapsedGroups:tT(e.collapsedGroups)}}function FS(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 ZA(e){if(!oo(e))return{};const n={};for(const[r,a]of Object.entries(e))typeof a=="string"&&(n[r]=a);return n}function JA(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 Kg(e){if(!oo(e))return Ka;const n=Ol(e.x,Ka.x),r=Ol(e.y,Ka.y),a=Ip(e.zoom,Ka.zoom);return{x:n,y:r,zoom:a}}function QA(e){if(!oo(e))return{};const n={};for(const[r,a]of Object.entries(e))oo(a)&&(n[r]=Vg(a,eT(n)));return n}function Vg(e,n){return oo(e)?{x:Ol(e.x,0),y:Ol(e.y,0),width:Ip(e.width,Ap),height:Ip(e.height,Tp),zIndex:Ol(e.zIndex,n)}:{x:0,y:0,width:Ap,height:Tp,zIndex:n}}function eT(e){return WS(e)+1}function WS(e){return Math.max(0,...Object.values(e).map(n=>n.zIndex))}function Ol(e,n){return typeof e=="number"&&Number.isFinite(e)?e:n}function Ip(e,n){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:n}function oo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function tT(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}const nT=["canonicalCwd","cwd","providerSession","ticket","token","transcriptPath"];class ct extends Error{status;constructor(n,r){super(r),this.name="ApiError",this.status=n}}async function iT(e){const n=await fetch("/api/v1/theaters",{signal:e});await li(n);const r=await n.json();if(!Array.isArray(r.theaters))throw new ct(n.status,"Invalid Theater response");return{theaters:r.theaters.map(a=>XS(a,n.status))}}async function rT(e,n){const r=e?`?theaterId=${encodeURIComponent(e)}`:"",a=await fetch(`/api/v1/status${r}`,{signal:n});return await li(a),uT(await a.json(),a.status)}async function GS(e={}){const n=e.force?"?force=true":"",r=await fetch(`/api/v1/updates/release-notes${n}`,{signal:e.signal});return await li(r),dT(await r.json(),r.status)}async function sT(e){const n=await fetch("/api/v1/updates/apply",{method:"POST",signal:e});return await li(n),hT(await n.json(),n.status)}async function qS(e,n){const r=await fetch("/api/v1/theaters",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folderGrantId:e}),signal:n});await li(r);const a=await r.json();return XS(a,r.status)}async function aT(e,n){const r=await fetch("/api/v1/theaters/folder-listings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:n});return await li(r),mT(await r.json(),r.status)}async function KS(e,n){const r=await fetch("/api/v1/theaters/folder-grants",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:n});await li(r);const a=await r.json();if(typeof a.folderGrantId!="string")throw new ct(r.status,"Invalid folder grant response");return a.folderGrantId}async function oT(e,n){const r=await fetch(`/api/v1/theaters/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});await li(r)}async function Pi(e,n){const r=e?`?theaterId=${encodeURIComponent(e)}`:"",a=await fetch(`/api/v1/operations${r}`,{signal:n});await li(a);const o=await a.json();if(!Array.isArray(o.operations))throw new ct(a.status,"Invalid operations response");return o.operations.map(g=>YS(g,a.status))}async function xl(e,n){const a=await fetch("/api/v1/operations/groups",{signal:n});await li(a);const o=await a.json();if(!Array.isArray(o.groups))throw new ct(a.status,"Invalid groups response");return o.groups.map(g=>Yg(g,a.status))}async function lT(e,n){const r=await fetch("/api/v1/operations/groups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:n});await li(r);const a=await r.json();return Yg(a.group,r.status)}async function L1(e,n,r){const a=await fetch(`/api/v1/operations/groups/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:r});await li(a);const o=await a.json();return Yg(o.group,a.status)}async function cT(e,n){const r=await fetch(`/api/v1/operations/groups/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});await li(r)}async function VS(e,n,r){return Ru(e,{title:n},r)}async function Ru(e,n,r){const a=await fetch(`/api/v1/operations/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:r});await li(a);const o=await a.json();return YS(o.operation,a.status)}function YS(e,n){const r=e;if(!r||typeof r.id!="string"||typeof r.theaterId!="string"||typeof r.type!="string"||typeof r.pluginId!="string"||typeof r.title!="string"||!r.payload||typeof r.payload!="object"||Array.isArray(r.payload)||!r.ts||typeof r.ts.createdAt!="number"||typeof r.ts.updatedAt!="number"||zl(r)||zl(r.payload))throw new ct(n,"Invalid operation response");return{id:r.id,theaterId:r.theaterId,type:r.type,pluginId:r.pluginId,title:r.title,payload:r.payload,geometry:r.geometry??null,accent:typeof r.accent=="string"?r.accent:null,groupId:r.groupId===null?null:typeof r.groupId=="string"?r.groupId:void 0,ts:r.ts}}function Yg(e,n){const r=e;if(!r||typeof r.id!="string"||typeof r.theaterId!="string"||typeof r.name!="string"||typeof r.color!="string"||typeof r.order!="number"||typeof r.createdAt!="number")throw new ct(n,"Invalid group response");return{id:r.id,theaterId:r.theaterId,name:r.name,color:r.color,order:r.order,createdAt:r.createdAt}}function XS(e,n){const r=e;if(!r||typeof r.id!="string"||typeof r.label!="string"||typeof r.createdAt!="string"||typeof r.lastOpenedAt!="string"||typeof r.hasWiki!="boolean"||typeof r.activeAdmiralCount!="number"||zl(r))throw new ct(n,"Invalid Theater response");return r}function uT(e,n){const r=e;if(!r||typeof r.workspaces!="number"||typeof r.version!="string"||r.channel!=="stable"&&r.channel!=="local"&&r.channel!=="unknown"||typeof r.updateAvailable!="boolean"||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")throw new ct(n,"Invalid status response");return{workspaces:r.workspaces,version:r.version,channel:r.channel,updateAvailable:r.updateAvailable,latestVersion:typeof r.latestVersion=="string"?r.latestVersion:void 0,port:r.port,portMode:r.portMode,requestedPort:r.requestedPort,effectivePort:r.effectivePort,portHonored:r.portHonored,wikiServerStatus:r.wikiServerStatus}}function hT(e,n){const r=e;if(!r||r.status!=="accepted")throw new ct(n,"Invalid update response");return{status:"accepted"}}function dT(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 ct(n,"Invalid release notes response");return{notes:r.notes.map(a=>fT(a,n)),sourceRef:"main",fetchedAt:r.fetchedAt,stale:r.stale}}function fT(e,n){const r=e;if(!r||typeof r.version!="string"||r.date!==null&&typeof r.date!="string"||!Array.isArray(r.sections))throw new ct(n,"Invalid release notes response");return{version:r.version,date:r.date,sections:r.sections.map(a=>pT(a,n))}}function pT(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 ct(n,"Invalid release notes response");return{heading:r.heading,items:r.items.map(a=>gT(a,n))}}function gT(e,n){const r=e;if(!r||!Array.isArray(r.packageTags)||!r.packageTags.every(a=>typeof a=="string")||typeof r.text!="string")throw new ct(n,"Invalid release notes response");return{packageTags:r.packageTags,text:r.text}}function mT(e,n){const r=e;if(!r||typeof r.path!="string"||r.parentPath!==null&&typeof r.parentPath!="string"||!Array.isArray(r.roots)||!Array.isArray(r.entries)||zl(r))throw new ct(n,"Invalid folder list response");return{path:r.path,parentPath:r.parentPath??null,roots:r.roots.filter(a=>typeof a=="string"),entries:r.entries.map(a=>_T(a,n)),truncated:r.truncated===!0?!0:void 0}}function _T(e,n){const r=e;if(!r||typeof r.name!="string"||typeof r.path!="string"||r.kind!=="dir"||typeof r.accessible!="boolean"||zl(r))throw new ct(n,"Invalid folder entry response");return{name:r.name,path:r.path,kind:"dir",accessible:r.accessible}}function zl(e){if(!e||typeof e!="object")return!1;const n=e;return nT.some(r=>r in n)}async function li(e){if(e.ok)return;let n=`${e.status} ${e.statusText}`;try{const r=await e.json();typeof r.error=="string"?n=r.error:typeof r.message=="string"&&(n=r.message)}catch{}throw new ct(e.status,n)}const vT="__unassigned__";function bT(e){const n=new Map(e.theaters.map(a=>[a.id,a])),r=[];for(const a of e.operations)a.theaterId&&r.push(wT(a,n.get(a.theaterId)));return r}function yT(e,n){const r=ZS(n);return r.length===0?e:e.filter(a=>{const o=xT(a);return r.every(g=>o.includes(g))})}function ST(e){const n=[],r=new Map;for(const a of e){const o=a.theaterId??vT,g=r.get(o);if(g!==void 0){const _=n[g];_&&(n[g]={..._,entries:[..._.entries,a]});continue}r.set(o,n.length),n.push({theaterId:a.theaterId,theaterLabel:a.theaterLabel,entries:[a]})}return n}function ZS(e){return e.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean)}function wT(e,n){return{operationId:e.id,theaterId:e.theaterId,theaterLabel:n?.label??e.theaterId,operationName:e.title,pluginId:e.pluginId,status:"operation"}}function xT(e){return[e.operationName,e.theaterLabel,e.pluginId].join(" ").toLocaleLowerCase()}const Pp="fleet-console.activeTheaterId",JS="fleet-console.commissioningSeen",QS="fleet-console.whatsNewSeenVersion",ew="fleet-console.notificationPreferences",tw=1,CT="maritime",hu={globalMute:!1,dnd:!1,mutedTheaterIds:{}},zp=new Set;let M1=0,Hp=null,He={connection:"connecting",connectionError:null,activeTheme:CT,version:"",updateAvailable:!1,latestVersion:null,portMode:"dynamic",requestedPort:null,effectivePort:0,portHonored:!0,theaters:[],operations:[],operationsHydrated:!1,groups:[],activeTheaterId:null,activeOperationId:null,operationStatus:{},addingTheater:!1,theaterError:null,operationsViewActive:!1,operationSearchOpen:!1,whatsNewOpen:!1,releaseNotes:[],releaseNotesLoading:!1,releaseNotesError:null,releaseNotesSourceRef:null,releaseNotesFetchedAt:null,releaseNotesStale:!1,automaticWhatsNewVersion:null,selectedReleaseNoteKey:null,onboardingOpen:!1,bootstrapped:!1,pendingOperationFocus:null,operationNotifications:{},notificationPreferences:YT(),codexReader:null,codexReaderExpanded:!1};function $p(){return He}function ET(e){return zp.add(e),()=>{zp.delete(e)}}function tt(e){He={...He,...e},GT()}function kT(e){He.operationsViewActive!==e&&tt({operationsViewActive:e})}function nw(e){TT(e),tt({activeTheme:e})}function AT(e){kA(e.channel),tt({version:e.version,updateAvailable:e.updateAvailable,latestVersion:e.latestVersion??null,portMode:e.portMode,requestedPort:e.requestedPort,effectivePort:e.effectivePort,portHonored:e.portHonored,...fw({...He,version:e.version})})}function iw(){tt({releaseNotesLoading:!0,releaseNotesError:null})}function rw(e){const n={...He,releaseNotes:e.notes,releaseNotesLoading:!1,releaseNotesError:null,releaseNotesSourceRef:e.sourceRef,releaseNotesFetchedAt:e.fetchedAt,releaseNotesStale:e.stale,selectedReleaseNoteKey:He.selectedReleaseNoteKey&&gw(e.notes,He.selectedReleaseNoteKey)?He.selectedReleaseNoteKey:pw(e.notes)};tt({releaseNotes:n.releaseNotes,releaseNotesLoading:n.releaseNotesLoading,releaseNotesError:n.releaseNotesError,releaseNotesSourceRef:n.releaseNotesSourceRef,releaseNotesFetchedAt:n.releaseNotesFetchedAt,releaseNotesStale:n.releaseNotesStale,...fw(n)})}function sw(e){tt({releaseNotesLoading:!1,releaseNotesError:e})}function TT(e){if(!(typeof document>"u")){if(e==="maritime"){document.documentElement.removeAttribute("data-theme");return}document.documentElement.setAttribute("data-theme",e)}}function RT(e){const n=dw(e,He.activeTheaterId);tt({theaters:e,activeTheaterId:n})}function LT(e){RT(e.theaters)}function zi(e){tt({operations:e,operationsHydrated:!0})}function Cl(e){tt({groups:e})}function MT(e){uh(e),tt({activeTheaterId:e})}function ar(e){He.activeOperationId!==e&&tt({activeOperationId:e})}function NT(e,n){if(n==="idle"){aw(e);return}He.operationStatus[e]!==n&&tt({operationStatus:{...He.operationStatus,[e]:n}})}function aw(e){if(!(e in He.operationStatus))return;const n={...He.operationStatus};delete n[e],tt({operationStatus:n})}function OT(e){if(!e.operationId)return;const n=He.operations.find(u=>u.id===e.operationId);if(!n)return;const r=n.theaterId??null,a=He.theaters.find(u=>u.id===r)?.label??r??"Unknown",o=n.title,g=KT(e.kind);M1+=1;const _=He.operationNotifications[e.operationId],c=_?_.count+1:1;tt({operationNotifications:{...He.operationNotifications,[e.operationId]:{kind:g,operationId:e.operationId,theaterId:r,theaterLabel:a,operationLabel:o,count:c,lastRaisedSeq:M1}}})}function ow(){tt({addingTheater:!0,theaterError:null})}function lw(e){const n=[e,...He.theaters.filter(r=>r.id!==e.id)];uh(e.id),tt({theaters:n,activeTheaterId:e.id,addingTheater:!1,theaterError:null})}function DT(){tt({addingTheater:!1,theaterError:null})}function Up(e){tt({addingTheater:!1,theaterError:e})}function ch(e){const n=He.operations.find(r=>r.id===e);n&&(uh(n.theaterId),tt({activeTheaterId:n.theaterId,activeOperationId:e,pendingOperationFocus:e,operationNotifications:hw(He.operationNotifications,e)}),window.dispatchEvent(new CustomEvent("fleet-console:focus-operation",{detail:{operationId:e}})))}function N1(){He.pendingOperationFocus!==null&&tt({pendingOperationFocus:null})}function BT(e,n,r){if(e.length===0)return null;const a=n?e.indexOf(n):-1,o=a===-1?r>0?0:e.length-1:(a+r+e.length)%e.length;return e[o]??null}function cw(e,n){if(n.length===0)return[...e].sort(Fp);const r=new Map(n.map((a,o)=>[a,o]));return[...e].sort((a,o)=>{const g=r.get(a.id),_=r.get(o.id);return g!==void 0&&_!==void 0?g-_:g!==void 0?-1:_!==void 0?1:Fp(a,o)})}function jT(e,n,r,a=[]){const o=cw(e,r),g=new Set(a),_=[...n].sort((u,d)=>u.order-d.order||u.createdAt-d.createdAt),c=new Map;for(const u of _)c.set(u.id,[]);c.set(null,[]);for(const u of o){const d=u.groupId??null;d!==null&&c.has(d)?c.get(d).push(u):c.get(null).push(u)}return[..._.filter(u=>!g.has(u.id)).flatMap(u=>c.get(u.id)??[]),...c.get(null)??[]]}function Fp(e,n){return e.ts.createdAt-n.ts.createdAt||e.id.localeCompare(n.id)}function Df(){tt({operationSearchOpen:!1})}function IT(){tt({operationSearchOpen:!He.operationSearchOpen})}function PT(){He.releaseNotes.length===0||He.whatsNewOpen||tt({whatsNewOpen:!0,selectedReleaseNoteKey:He.selectedReleaseNoteKey??pw(He.releaseNotes)})}function du(){He.whatsNewOpen&&(He.automaticWhatsNewVersion&&QT(He.automaticWhatsNewVersion),tt({whatsNewOpen:!1,automaticWhatsNewVersion:null}))}function O1(e){gw(He.releaseNotes,e)&&tt({selectedReleaseNoteKey:e})}function cl(){ZT(!0),He.onboardingOpen&&tt({onboardingOpen:!1})}function El(e){tt({codexReader:e,codexReaderExpanded:!1})}function uw(){He.codexReader!==null&&tt({codexReaderExpanded:!0})}function zT(){tt({codexReaderExpanded:!1})}function D1(){tt({codexReader:null,codexReaderExpanded:!1})}function B1(){if(He.bootstrapped)return;const e=He.theaters.length===0&&!XT();tt({bootstrapped:!0,onboardingOpen:e?!0:He.onboardingOpen})}function j1(e){const n=He.theaters.filter(_=>_.id!==e),r=dw(n,He.activeTheaterId===e?null:He.activeTheaterId),a=qT(He.operationNotifications,e),o=new Set(He.operations.filter(_=>_.theaterId===e).map(_=>_.id)),g=He.activeOperationId&&o.has(He.activeOperationId)?null:He.activeOperationId;uh(r),tt({theaters:n,activeTheaterId:r,activeOperationId:g,operationNotifications:a})}function HT(e){const n=hw(He.operationNotifications,e);n!==He.operationNotifications&&tt({operationNotifications:n})}function $T(e){const n={...He.notificationPreferences,globalMute:e};Zg(n),tt({notificationPreferences:n})}function UT(e){const n={...He.notificationPreferences,dnd:e};Zg(n),tt({notificationPreferences:n})}function FT(e){const n={...He.notificationPreferences.mutedTheaterIds};n[e]?delete n[e]:n[e]=!0;const r={...He.notificationPreferences,mutedTheaterIds:n};Zg(r),tt({notificationPreferences:r})}function WT(e){return bT(e)}function GT(){for(const e of zp)e()}function hw(e,n){if(!e[n])return e;const r={...e};return delete r[n],r}function qT(e,n){let r=!1;const a={};for(const[o,g]of Object.entries(e)){if(g.theaterId===n){r=!0;continue}a[o]=g}return r?a:e}function dw(e,n){const r=new Set(e.map(o=>o.id)),a=VT();return a&&r.has(a)?a:n&&r.has(n)?n:e[0]?.id??null}function KT(e){const n=e.toLowerCase();return n==="ended"||n.includes(".end")||n.includes("done")?"ended":"input-waiting"}function fw(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||JT()===r.version?{whatsNewOpen:e.whatsNewOpen,automaticWhatsNewVersion:e.automaticWhatsNewVersion,selectedReleaseNoteKey:e.selectedReleaseNoteKey}:{whatsNewOpen:!0,automaticWhatsNewVersion:r.version,selectedReleaseNoteKey:Xg(r.version,n)}}function pw(e){return e[0]?Xg(e[0].version,0):null}function gw(e,n){return e.some((r,a)=>Xg(r.version,a)===n)}function Xg(e,n){return`${e}:${n}`}function VT(){if(typeof window>"u")return null;try{return window.localStorage.getItem(Pp)}catch{return null}}function uh(e){if(!(typeof window>"u"))try{e?window.localStorage.setItem(Pp,e):window.localStorage.removeItem(Pp)}catch{}}function YT(){if(typeof window>"u")return hu;try{const e=window.localStorage.getItem(ew);if(!e)return hu;const n=JSON.parse(e);return eR(n)?{globalMute:n.preferences.globalMute,dnd:n.preferences.dnd,mutedTheaterIds:n.preferences.mutedTheaterIds}:hu}catch{return hu}}function XT(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(JS)==="1"}catch{return!1}}function ZT(e){if(!(typeof window>"u"))try{e&&window.localStorage.setItem(JS,"1")}catch{}}function JT(){if(Hp!==null)return Hp;if(typeof window>"u")return null;try{return window.localStorage.getItem(QS)}catch{return null}}function QT(e){if(Hp=e,!(typeof window>"u"))try{window.localStorage.setItem(QS,e)}catch{}}function Zg(e){if(!(typeof window>"u"))try{window.localStorage.setItem(ew,JSON.stringify({version:tw,preferences:e}))}catch{}}function eR(e){if(!e||typeof e!="object")return!1;const n=e;if(n.version!==tw||!n.preferences||typeof n.preferences!="object")return!1;const r=n.preferences;return typeof r.globalMute=="boolean"&&typeof r.dnd=="boolean"&&!!r.mutedTheaterIds&&typeof r.mutedTheaterIds=="object"}const fu="directory-browser-sectors";function mw({open:e,onCancel:n,onConfirm:r}){const[a,o]=j.useState(null),[g,_]=j.useState(null),[c,u]=j.useState(null),[d,b]=j.useState(""),[p,w]=j.useState(""),[C,A]=j.useState(0),E=j.useRef(null),f=j.useRef(null),y=async(X,H)=>{_(X),u(null),b(""),A(0);try{const q=await aT(X,H);o(q)}catch(q){if(q instanceof DOMException&&q.name==="AbortError")return;u(q instanceof ct?q.message:String(q))}finally{_(null)}};j.useEffect(()=>{if(!e)return;const X=new AbortController;return y(null,X.signal),()=>X.abort()},[e]),j.useEffect(()=>{e&&E.current?.focus()},[e,a?.path]);const m=a?.entries??[],S=j.useMemo(()=>{const X=d.trim().toLowerCase();return X===""?m:m.filter(H=>H.name.toLowerCase().includes(X))},[m,d]),k=j.useMemo(()=>a?tR(a):[],[a]),L=a?I1(a.path):null,R=a?.roots??[],M=R.length>1,T=S.length===0?-1:Math.min(C,S.length-1);if(j.useEffect(()=>{if(T<0)return;f.current?.querySelector(`[data-index="${T}"]`)?.scrollIntoView({block:"nearest"})},[T,a?.path]),!e)return null;const I=X=>{X.accessible&&g===null&&y(X.path)},K=()=>{a?.parentPath!=null&&g===null&&y(a.parentPath)},F=()=>{const X=p.trim();X!==""&&g===null&&y(X)},G=a?.path??null,B=T>=0?`${fu}-${T}`:void 0,Y=X=>{switch(X.key){case"Escape":d!==""?b(""):n();return;case"ArrowDown":X.preventDefault(),A(H=>Math.min(H+1,Math.max(S.length-1,0)));return;case"ArrowUp":X.preventDefault(),A(H=>Math.max(H-1,0));return;case"Enter":{X.preventDefault();const H=S[T];H&&I(H);return}case"Backspace":d===""&&(X.preventDefault(),K());return;default:return}};return Xs.createPortal(h.jsxs("div",{className:"directory-browser-overlay",role:"presentation",children:[h.jsx("button",{type:"button",className:"directory-browser-scrim","aria-label":"Close",onClick:n}),h.jsxs("section",{className:"directory-browser-card",role:"dialog","aria-modal":"true","aria-label":"Establish Theater of Operations",onKeyDown:Y,children:[h.jsxs("header",{className:"directory-browser-header",children:[h.jsx("span",{className:"directory-browser-sigil","aria-hidden":"true",children:h.jsx(rR,{})}),h.jsxs("div",{className:"directory-browser-heading",children:[h.jsx("span",{className:"directory-browser-kicker",children:"Theater of Operations"}),h.jsx("h2",{children:"Establish Theater"})]}),h.jsx("button",{type:"button",className:"directory-browser-close",onClick:n,"aria-label":"Close",children:"×"})]}),M?h.jsxs("div",{className:"directory-browser-roots",role:"group","aria-label":"Drives",children:[h.jsx("span",{className:"directory-browser-kicker",children:"Stations"}),h.jsx("div",{className:"directory-browser-root-chips",children:R.map(X=>{const H=L!=null&&I1(X)===L;return h.jsx("button",{type:"button",className:`directory-browser-root-chip ${H?"is-active":""}`,"aria-current":H?"location":void 0,disabled:g!==null,title:X,onClick:()=>{g===null&&y(X)},onKeyDown:q=>q.stopPropagation(),children:iR(X)},X)})})]}):null,h.jsx("nav",{className:"directory-browser-course","aria-label":"Path",children:k.map((X,H)=>{const q=H===k.length-1;return h.jsxs("span",{className:"directory-browser-course-seg",children:[H>0?h.jsx("span",{className:"directory-browser-course-sep","aria-hidden":"true",children:"›"}):null,h.jsx("button",{type:"button",className:`directory-browser-crumb ${q?"is-current":""}`,"aria-current":q?"location":void 0,disabled:q||g!==null,title:X.path,onClick:()=>{y(X.path)},children:X.label})]},X.path)})}),h.jsxs("div",{className:"directory-browser-toolbar",children:[h.jsxs("div",{className:"directory-browser-filter",children:[h.jsx("span",{className:"directory-browser-filter-glyph","aria-hidden":"true",children:h.jsx(aR,{})}),h.jsx("input",{ref:E,type:"text",className:"directory-browser-filter-input",placeholder:"Filter sectors…","aria-label":"Filter folders","aria-controls":fu,value:d,spellCheck:!1,autoComplete:"off",onChange:X=>{b(X.target.value),A(0)}})]}),h.jsxs("button",{type:"button",className:"directory-browser-up",disabled:a?.parentPath==null||g!==null,title:"Up one sector (Backspace)",onClick:K,children:[h.jsx(oR,{}),h.jsx("span",{children:"Up"})]})]}),h.jsxs("div",{className:"directory-browser-jump",children:[h.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:X=>w(X.target.value),onKeyDown:X=>{X.stopPropagation(),X.key==="Enter"&&(X.preventDefault(),F())}}),h.jsx("button",{type:"button",className:"directory-browser-jump-button",disabled:p.trim()===""||g!==null,onClick:F,onKeyDown:X=>X.stopPropagation(),children:"Go"})]}),c?h.jsx("p",{className:"directory-browser-error",role:"alert",children:c}):null,h.jsx("div",{className:"directory-browser-list",id:fu,role:"listbox","aria-label":"Folders","aria-busy":g!==null,"aria-activedescendant":B,ref:f,children:g!==null?h.jsxs("p",{className:"directory-browser-state is-live",children:[h.jsx("span",{className:"directory-browser-scan-dot","aria-hidden":"true"}),"Scouting…"]}):S.length===0?h.jsx("p",{className:"directory-browser-state",children:d!==""?"No sectors match the filter.":"No sectors to advance into."}):S.map((X,H)=>h.jsxs("div",{id:`${fu}-${H}`,"data-index":H,role:"option","aria-selected":H===T,"aria-disabled":!X.accessible,className:`directory-browser-sector ${H===T?"is-active":""} ${X.accessible?"":"is-locked"}`,title:X.path,onClick:()=>{A(H),I(X)},children:[h.jsx("span",{className:"directory-browser-sector-glyph","aria-hidden":"true",children:h.jsx(sR,{})}),h.jsx("span",{className:"directory-browser-sector-name",children:X.name}),X.accessible?h.jsx("span",{className:"directory-browser-sector-advance","aria-hidden":"true",children:"›"}):h.jsxs("span",{className:"directory-browser-sector-lock",children:[h.jsx(lR,{})," Locked"]})]},X.path))}),a?.truncated?h.jsx("p",{className:"directory-browser-note",children:"Charting first 500 sectors only."}):null,h.jsxs("footer",{className:"directory-browser-actions",children:[h.jsxs("div",{className:"directory-browser-target",children:[h.jsx("span",{className:"directory-browser-target-label",children:"Theater Root"}),h.jsx("span",{className:"directory-browser-target-path",title:G??"",children:G??"Scouting…"})]}),h.jsxs("div",{className:"directory-browser-buttons",children:[h.jsx("button",{type:"button",className:"directory-browser-button",onClick:n,children:"Cancel"}),h.jsx("button",{type:"button",className:"directory-browser-button is-primary",disabled:G===null||g!==null,onClick:()=>G&&r(G),children:"Establish Theater"})]})]})]})]}),document.body)}function tR(e){if(nR(e)==="/"){const _=[{label:"/",path:"/"}];let c="";for(const u of e.path.split("/").filter(Boolean))c+=`/${u}`,_.push({label:u,path:c});return _}const r=/^([A-Za-z]:)\\?/.exec(e.path),a=r?`${r[1]}\\`:e.roots[0]??"C:\\",o=[{label:a,path:a}];let g=a.replace(/\\$/,"");for(const _ of e.path.slice(a.length).split("\\").filter(Boolean))g+=`\\${_}`,o.push({label:_,path:g});return o}function nR(e){return e.roots.some(n=>/^[A-Za-z]:\\$/.test(n))||/^[A-Za-z]:\\/.test(e.path)?"\\":"/"}function I1(e){return/^([A-Za-z]:)\\?/.exec(e)?.[1]?.toLowerCase()??null}function iR(e){return e.replace(/[\\/]+$/,"")||e}function rR(){return h.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[h.jsx("circle",{cx:"10",cy:"10",r:"6.6",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),h.jsx("circle",{cx:"10",cy:"10",r:"2.1",fill:"currentColor"}),h.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 sR(){return h.jsx("svg",{viewBox:"0 0 18 18","aria-hidden":"true",children:h.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 aR(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.jsx("circle",{cx:"7",cy:"7",r:"4.2",fill:"none",stroke:"currentColor",strokeWidth:"1.3"}),h.jsx("path",{d:"M10.2 10.2 13.5 13.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})}function oR(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.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 lR(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.jsx("rect",{x:"3.6",y:"7",width:"8.8",height:"6.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),h.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 cR=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function uR({state:e}){const[n,r]=j.useState(!1),a=j.useRef(null),o=j.useRef(null),g=j.useRef(null),_=e.theaters.length>0;if(j.useEffect(()=>{if(e.onboardingOpen)return a.current=document.activeElement,o.current?.focus(),()=>{const b=a.current;a.current=null,b?.focus?.()}},[e.onboardingOpen]),j.useEffect(()=>{if(!e.onboardingOpen)return;const b=p=>{n||(p.key==="Escape"?(p.preventDefault(),cl()):p.key==="Tab"&&hR(p,g.current),p.stopImmediatePropagation())};return window.addEventListener("keydown",b,!0),()=>window.removeEventListener("keydown",b,!0)},[n,e.onboardingOpen]),!e.onboardingOpen)return null;const c=()=>{r(!0)},u=()=>{r(!1)},d=async b=>{r(!1),ow();try{const p=await KS(b),w=await qS(p);lw(w)}catch(p){Up(p instanceof Error?p.message:String(p))}};return h.jsxs("div",{className:"commissioning-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"commissioning-title",children:[h.jsx("button",{type:"button",className:"commissioning-scrim",onClick:cl,"aria-label":"Close Commissioning guide"}),h.jsxs("section",{className:"commissioning-card",ref:g,children:[h.jsxs("header",{className:"commissioning-header",children:[h.jsx("span",{className:"commissioning-eyebrow",children:"COMMISSIONING · FLEET CONSOLE"}),h.jsx("h2",{id:"commissioning-title",children:"Bring your fleet online"}),h.jsx("p",{children:"Three steps to go from an empty bridge to live carrier operations."})]}),h.jsxs("ol",{className:"commissioning-steps",children:[h.jsxs("li",{className:`commissioning-step commissioning-step--primary ${_?"is-complete":"is-current"}`,children:[h.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:_?"✓":"01"}),h.jsxs("div",{className:"commissioning-step-body",children:[h.jsx("h3",{children:"Register a Theater"}),h.jsx("p",{children:"A Theater is a project directory the fleet operates in. Choose the folder you want to work from."}),_?h.jsx(Il,{ref:b=>{o.current=b},className:"commissioning-primary-action",to:"/operations",onClick:cl,children:"Go to Operations →"}):h.jsx("button",{ref:b=>{o.current=b},type:"button",className:"commissioning-primary-action is-live",disabled:e.addingTheater,onClick:c,children:e.addingTheater?"Adding Theater…":"Choose a folder…"}),e.theaterError?h.jsx("p",{className:"commissioning-error",role:"alert",children:e.theaterError}):null]})]}),h.jsxs("li",{className:"commissioning-step",children:[h.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:"02"}),h.jsxs("div",{className:"commissioning-step-body",children:[h.jsx("h3",{children:"Open an Operation"}),h.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."}),h.jsx(Il,{className:"commissioning-secondary-link",to:"/operations",onClick:cl,children:"Go to Operations"})]})]}),h.jsxs("li",{className:"commissioning-step",children:[h.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:"03"}),h.jsxs("div",{className:"commissioning-step-body",children:[h.jsx("h3",{children:"Observe carriers"}),h.jsx("p",{children:"Carriers are specialist agents your Admiral dispatches. Their sorties stream here in real time as they run."})]})]})]}),h.jsxs("footer",{className:"commissioning-footer",children:[h.jsx("p",{children:"Theaters with a Fleet Wiki knowledge root also unlock Codex — your decision log and reference library."}),h.jsx("button",{type:"button",className:"commissioning-skip",onClick:cl,children:"Skip for now"})]})]}),h.jsx(mw,{open:n,onCancel:u,onConfirm:d})]})}function hR(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(cR)),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 dR="a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1'])",P1="operation-search-listbox",_w="__unassigned__";function fR({state:e}){const n=oh(),[r,a]=j.useState(""),[o,g]=j.useState(0),_=j.useRef(null),c=j.useRef(null),u=j.useRef(null),d=j.useRef(new Map),b=j.useMemo(()=>WT(e),[e]),p=j.useMemo(()=>yT(b,r),[b,r]),w=j.useMemo(()=>ST(p),[p]),C=j.useMemo(()=>ZS(r),[r]),A=z1(o,p.length),E=p[A]?H1(p[A].operationId):void 0;if(j.useEffect(()=>{if(!e.operationSearchOpen)return;u.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const m=document.body.style.overflow;return document.body.style.overflow="hidden",window.setTimeout(()=>_.current?.focus(),0),()=>{document.body.style.overflow=m,u.current?.focus()}},[e.operationSearchOpen]),j.useEffect(()=>{if(!e.operationSearchOpen){a(""),g(0);return}g(0)},[e.operationSearchOpen,r]),j.useEffect(()=>{if(!e.operationSearchOpen)return;const m=p[A];m&&d.current.get(m.operationId)?.scrollIntoView({block:"nearest"})},[A,p,e.operationSearchOpen]),!e.operationSearchOpen)return null;const f=m=>{ch(m),n("/operations"),Df()},y=m=>{if(m.key==="Escape"){m.preventDefault(),Df();return}if(m.key==="ArrowDown"||m.key==="ArrowUp"){m.preventDefault(),g(S=>z1(S+(m.key==="ArrowDown"?1:-1),p.length));return}if(m.key==="Enter"){const S=p[A];if(!S)return;m.preventDefault(),f(S.operationId);return}m.key==="Tab"&&_R(m,c.current)};return h.jsx("div",{className:"operation-search-overlay",onMouseDown:m=>{m.target===m.currentTarget&&Df()},children:h.jsxs("section",{ref:c,className:"operation-search-card",role:"dialog","aria-modal":"true","aria-label":"Operation quick search",tabIndex:-1,onKeyDown:y,children:[h.jsxs("div",{className:"operation-search-field",children:[h.jsx(vR,{}),h.jsx("input",{ref:_,id:"operation-search-input",type:"search",value:r,onChange:m=>a(m.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}),h.jsx("kbd",{children:"esc"})]}),h.jsx("div",{id:P1,className:"operation-search-results",role:"listbox","aria-label":"Operation results",children:w.length>0?w.map(m=>{const S=gR(m.theaterId);return h.jsxs("section",{className:"operation-search-section",role:"group","aria-labelledby":S,children:[h.jsx("h2",{id:S,className:"operation-search-section-heading",children:Bf(m.theaterLabel,C)}),m.entries.map(k=>{const L=p.indexOf(k),R=L===A;return h.jsxs("button",{id:H1(k.operationId),ref:M=>{M?d.current.set(k.operationId,M):d.current.delete(k.operationId)},type:"button",className:`operation-search-result ${R?"is-active":""}`,role:"option","aria-selected":R,onMouseEnter:()=>g(L),onClick:()=>f(k.operationId),children:[h.jsxs("span",{className:"operation-search-result-text",children:[h.jsx("strong",{children:Bf(k.operationName,C)}),h.jsx("small",{children:pR(k)})]}),h.jsx("span",{className:"operation-search-theater",children:Bf(k.theaterLabel,C)})]},k.operationId)})]},m.theaterId??_w)}):h.jsx("p",{className:"operation-search-empty",children:"No matching Operations."})})]})})}function z1(e,n){return n<=0?0:Math.max(0,Math.min(e,n-1))}function pR(e){return[e.pluginId,e.status].filter(Boolean).join(" · ")}function gR(e){return`operation-search-heading-${vw(e??_w)}`}function H1(e){return`operation-search-option-${vw(e)}`}function vw(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}function Bf(e,n){if(n.length===0)return e;const r=[];let a=0;for(;a<e.length;){const o=mR(e,n,a);if(!o){r.push(e.slice(a));break}o.start>a&&r.push(e.slice(a,o.start)),r.push(h.jsx("mark",{children:e.slice(o.start,o.end)},`${o.start}-${o.end}`)),a=o.end}return r}function mR(e,n,r){const a=e.toLocaleLowerCase();let o=null;for(const g of n){const _=a.indexOf(g,r);_!==-1&&(!o||_<o.start)&&(o={start:_,end:_+g.length})}return o}function _R(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(dR)).filter(g=>g.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 vR(){return h.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:h.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 bR({open:e,title:n,message:r,tone:a="info",onDismiss:o}){return e?h.jsx("div",{className:"app-toast-host",children:h.jsxs("div",{className:`app-toast app-toast--${a}`,role:"status","aria-live":"polite",children:[h.jsx("span",{className:"app-toast-dot","aria-hidden":"true"}),h.jsxs("div",{className:"app-toast-body",children:[h.jsx("p",{className:"app-toast-title",children:n}),r?h.jsx("p",{className:"app-toast-message",children:r}):null]}),o?h.jsx("button",{type:"button",className:"app-toast-close",onClick:o,"aria-label":"Dismiss notification",children:"×"}):null]})}):null}function yR({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 h.jsx("button",{type:"button",className:"topbar-whatsnew-button",onMouseDown:a=>a.preventDefault(),onClick:PT,"aria-label":`What's new${r}`,title:`What's new${r}`,children:h.jsx("span",{children:"What's new"})})}const SR=1400,wR="https://github.com/sbluemin/fleet-harness",xR="https://github.com/sbluemin/fleet-harness/stargazers",CR="https://api.github.com/repos/sbluemin/fleet-harness",Jg="fleet-console.github-stars",ER=360*60*1e3;function kR({state:e}){const n=e.connectionError!==null,r=$i().pathname,a=r.startsWith("/carrier-settings")?h.jsx(U1,{}):r.startsWith("/settings")?h.jsx($1,{}):r.startsWith("/operations")?h.jsx(FR,{}):h.jsx(UR,{});return h.jsxs("header",{className:"topbar",children:[h.jsxs("div",{className:"topbar-lead",children:[h.jsxs(Il,{className:"topbar-brand",to:"/operations","aria-label":"Operations로 이동",children:[h.jsx("span",{className:`topbar-sigil ${n?"is-alert":""}`,"aria-hidden":"true",title:e.connectionError??void 0,children:a}),h.jsxs("h1",{className:"topbar-title",children:["Fleet",h.jsx("span",{className:"topbar-title-thin",children:"Console"})]})]}),h.jsxs("span",{className:"topbar-preview-badge",children:[h.jsx("span",{className:"topbar-preview-label",children:"Research Preview"}),e.version?h.jsxs("span",{className:"topbar-preview-version",children:["v",e.version]}):null]}),h.jsx(NR,{}),h.jsx(yR,{state:e})]}),h.jsx(MR,{state:e}),h.jsxs("div",{className:"topbar-meta",children:[e.updateAvailable?h.jsx(AR,{latestVersion:e.latestVersion}):null,h.jsxs(kp,{to:"/carrier-settings",className:({isActive:o})=>`topbar-nav-link ${o?"is-active":""}`,title:"Carrier settings",children:[h.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:h.jsx(U1,{})}),h.jsx("span",{children:"Carriers"})]}),h.jsxs(kp,{to:"/settings",className:({isActive:o})=>`topbar-nav-link ${o?"is-active":""}`,title:"Settings",children:[h.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:h.jsx($1,{})}),h.jsx("span",{children:"Settings"})]})]})]})}function AR({latestVersion:e}){const[n,r]=j.useState("idle"),[a,o]=j.useState(null),g=j.useRef(null),_=TR(n,a,e);j.useEffect(()=>()=>{g.current!==null&&window.clearTimeout(g.current)},[]);const c=async()=>{if(!_.disabled){g.current!==null&&(window.clearTimeout(g.current),g.current=null),r("applying"),o(null);try{if((await sT()).status!=="accepted"){r("error"),o("invalid_response");return}r("accepted"),g.current=window.setTimeout(()=>{g.current=null,r("completed")},SR)}catch(u){const d=u instanceof ct?u.message:"network_error";o(d),r(LR(d)?"blocked":"error")}}};return h.jsx("button",{type:"button",className:`topbar-update-badge topbar-update-badge--${_.tone}`,onClick:c,disabled:_.disabled,title:_.title,"aria-live":"polite",children:_.label})}function TR(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"?RR(n):e==="error"?{label:"재시도",title:"업데이트 요청에 실패했습니다. 다시 시도할 수 있습니다.",tone:"error",disabled:!1}:{label:"Update available",title:a,tone:"warn",disabled:!1}}function RR(e){return e==="local_channel"?{label:"로컬 빌드",title:"로컬 개발 빌드는 콘솔에서 업데이트하지 않습니다.",tone:"blocked",disabled:!0}: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 LR(e){return e==="local_channel"||e==="update_already_in_progress"||e==="update_not_available"}function MR({state:e}){const[n,r]=j.useState(!1),[a,o]=j.useState(!1),g=j.useRef(null),_=j.useRef(null),c=j.useRef(null),u=e.theaters.find(f=>f.id===e.activeTheaterId)??null,d=u?.label??(e.theaters.length===0?"No Theaters":"Theater");j.useEffect(()=>{if(!n)return;const f=m=>{g.current?.contains(m.target)||r(!1)},y=m=>{m.key==="Escape"&&(r(!1),_.current?.focus())};return document.addEventListener("mousedown",f),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",y)}},[n]),j.useEffect(()=>{if(!n)return;const f=c.current;if(!f)return;(f.querySelector('[data-active="true"]')??f.querySelector("[role^='menuitem']"))?.focus()},[n]);const b=f=>{MT(f),r(!1),_.current?.focus()},p=async()=>{r(!1),o(!0)},w=()=>{o(!1),DT()},C=async f=>{o(!1),ow();try{const y=await KS(f),m=await qS(y);lw(m)}catch(y){Up(y instanceof Error?y.message:String(y))}},A=async()=>{if(u){r(!1);try{await oT(u.id),j1(u.id)}catch(f){if(f instanceof ct&&f.status===404){j1(u.id);return}Up(f instanceof Error?f.message:String(f))}}},E=f=>{if(f.key!=="ArrowDown"&&f.key!=="ArrowUp")return;f.preventDefault();const y=Array.from(c.current?.querySelectorAll("[role^='menuitem']")??[]);if(y.length===0)return;const m=y.indexOf(document.activeElement),S=f.key==="ArrowDown"?1:-1,k=(m+S+y.length)%y.length;y[k]?.focus()};return h.jsxs("div",{className:"theater-control",ref:g,children:[h.jsx("span",{className:"theater-eyebrow","aria-hidden":"true",children:"Theater"}),h.jsxs("button",{type:"button",ref:_,className:`theater-trigger ${n?"is-open":""}`,"aria-haspopup":"menu","aria-expanded":n,"aria-label":"Theater",title:u?.label??e.theaterError??void 0,onClick:()=>r(f=>!f),children:[h.jsx("span",{className:"theater-trigger-sigil","aria-hidden":"true",children:h.jsx(PR,{})}),h.jsx("span",{className:"theater-trigger-label",children:d}),h.jsx("span",{className:"theater-trigger-caret","aria-hidden":"true",children:h.jsx(zR,{})})]}),n?h.jsxs("div",{className:"theater-menu",role:"menu","aria-label":"Theater",ref:c,onKeyDown:E,children:[e.theaters.length>0?h.jsx("ul",{className:"theater-menu-list",children:e.theaters.map(f=>{const y=f.id===e.activeTheaterId;return h.jsx("li",{children:h.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":y,"data-active":y?"true":void 0,className:`theater-menu-item ${y?"is-active":""}`,title:f.label,onClick:()=>b(f.id),children:[h.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:y?h.jsx(HR,{}):null}),h.jsx("span",{className:"theater-menu-label",children:f.label})]})},f.id)})}):h.jsx("p",{className:"theater-menu-empty",children:"No Theaters yet."}),h.jsx("div",{className:"theater-menu-divider",role:"separator"}),u?h.jsxs(h.Fragment,{children:[h.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item theater-menu-forget",onClick:A,children:[h.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:h.jsx($R,{})}),h.jsx("span",{className:"theater-menu-label",children:"Forget Theater"})]}),h.jsx("div",{className:"theater-menu-divider",role:"separator"})]}):null,h.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item theater-menu-add",disabled:e.addingTheater,onClick:p,children:[h.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:h.jsx(WR,{})}),h.jsx("span",{className:"theater-menu-label",children:e.addingTheater?"Adding Theater…":"Add Theater…"})]}),e.theaterError?h.jsx("p",{className:"theater-menu-error",children:e.theaterError}):null]}):null,h.jsx(mw,{open:a,onCancel:w,onConfirm:C})]})}function NR(){const e=OR(),n=e.count!==null;return h.jsxs("div",{className:"topbar-github",role:"group","aria-label":"GitHub",children:[h.jsx("a",{className:"topbar-github-link",href:wR,target:"_blank",rel:"noopener noreferrer","aria-label":"GitHub 저장소 열기",title:"GitHub 저장소",children:h.jsx(GR,{})}),h.jsxs("a",{className:"topbar-github-stars",href:xR,target:"_blank",rel:"noopener noreferrer","aria-label":n?`GitHub 스타 ${e.count.toLocaleString()}개 — 스타 누르기`:"GitHub에서 스타 누르기",title:"GitHub에서 스타 누르기",children:[h.jsx(qR,{}),n?h.jsx("span",{className:"topbar-github-stars-count",children:IR(e.count)}):null]})]})}function OR(){const[e,n]=j.useState(()=>{const r=DR();return r===null?{count:null,status:"idle"}:{count:r,status:"ready"}});return j.useEffect(()=>{if(BR())return;let r=!1;return n(a=>a.status==="ready"?a:{...a,status:"loading"}),fetch(CR,{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(g=>({count:g.count,status:g.count===null?"error":"ready"}));return}jR(o),n({count:o,status:"ready"})}).catch(()=>{r||n(a=>({count:a.count,status:a.count===null?"error":"ready"}))}),()=>{r=!0}},[]),e}function DR(){try{const e=window.localStorage.getItem(Jg);if(!e)return null;const n=JSON.parse(e);return typeof n.count=="number"?n.count:null}catch{return null}}function BR(){try{const e=window.localStorage.getItem(Jg);if(!e)return!1;const n=JSON.parse(e);return typeof n.at=="number"&&Date.now()-n.at<ER}catch{return!1}}function jR(e){try{window.localStorage.setItem(Jg,JSON.stringify({count:e,at:Date.now()}))}catch{}}function IR(e){if(e<1e3)return String(e);const n=e/1e3;return n<10?`${n.toFixed(1)}k`:`${Math.round(n)}k`}function PR(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.jsx("circle",{cx:"8",cy:"3.2",r:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),h.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 zR(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.jsx("path",{d:"M4.5 6.5 8 10l3.5-3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}function HR(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.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 $R(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.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 UR(){return h.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16",children:[h.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"}),h.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 FR(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.jsx("circle",{cx:"8",cy:"8",r:"5.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),h.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"}),h.jsx("circle",{cx:"8",cy:"8",r:"1.1",fill:"currentColor"})]})}function $1(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.jsx("path",{d:"M3 4.4h10M3 8h10M3 11.6h10",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),h.jsx("circle",{cx:"6.2",cy:"4.4",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"}),h.jsx("circle",{cx:"10",cy:"8",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"}),h.jsx("circle",{cx:"7.4",cy:"11.6",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"})]})}function U1(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.jsx("circle",{cx:"4",cy:"4.2",r:"1.15",fill:"currentColor"}),h.jsx("circle",{cx:"4",cy:"8",r:"1.15",fill:"currentColor"}),h.jsx("circle",{cx:"4",cy:"11.8",r:"1.15",fill:"currentColor"}),h.jsx("path",{d:"M7.2 4.2h6M7.2 8h6M7.2 11.8h6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function WR(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function GR(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.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 qR(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.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"})})}const KR=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),ul=10;function VR({state:e}){const n=j.useRef(null),r=j.useRef(null),a=j.useRef(null),o=!e.bootstrapped||e.onboardingOpen||e.operationSearchOpen;if(e.whatsNewOpen&&!o&&n.current===null&&(n.current=document.activeElement),j.useEffect(()=>{if(!e.whatsNewOpen||o)return;const E=f=>{f.key==="Escape"?(f.preventDefault(),du()):f.key==="Tab"&&ZR(f,a.current),f.stopImmediatePropagation()};return r.current?.focus(),window.addEventListener("keydown",E,!0),()=>{window.removeEventListener("keydown",E,!0);const f=n.current;n.current=null,f?.focus?.()}},[e.whatsNewOpen,o]),!e.whatsNewOpen||o||e.releaseNotes.length===0)return null;const g=e.selectedReleaseNoteKey??Pa(e.releaseNotes[0]?.version??"",0),_=e.releaseNotes.findIndex((E,f)=>Pa(E.version,f)===g),c=e.releaseNotes[_]??e.releaseNotes[0],u=Pa(c.version,_>=0?_:0),d=()=>{iw(),GS({force:!0}).then(rw).catch(E=>sw(E instanceof Error?E.message:String(E)))},b=Math.max(1,Math.ceil(e.releaseNotes.length/ul)),p=Math.min(b-1,Math.floor((_>=0?_:0)/ul)),w=p*ul,C=e.releaseNotes.slice(w,w+ul),A=E=>{const f=p+E;if(f<0||f>=b)return;const y=f*ul,m=e.releaseNotes[y];m&&O1(Pa(m.version,y))};return h.jsxs("div",{className:"whatsnew-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"whatsnew-title",children:[h.jsx("button",{type:"button",className:"whatsnew-scrim",onClick:du,"aria-label":"Close What's new"}),h.jsxs("section",{className:"whatsnew-card",ref:a,children:[h.jsxs("header",{className:"whatsnew-header",children:[h.jsxs("div",{className:"whatsnew-heading-row",children:[h.jsx("h2",{id:"whatsnew-title",children:"What's new"}),h.jsxs("span",{className:"whatsnew-version-badge",children:["v",c.version]})]}),h.jsxs("div",{className:"whatsnew-meta-row",children:[c.date?h.jsxs("time",{className:"whatsnew-date",dateTime:c.date,children:["Released ",c.date]}):h.jsx("span",{className:"whatsnew-date",children:"Unreleased"}),e.releaseNotesStale?h.jsx("span",{className:"whatsnew-stale",children:"Stale"}):null]})]}),h.jsx("button",{ref:r,type:"button",className:"whatsnew-close",onClick:du,"aria-label":"Close What's new",children:"x"}),h.jsxs("div",{className:"whatsnew-body",children:[h.jsxs("div",{className:"whatsnew-version-selector",children:[h.jsx("select",{"aria-label":"Release version",value:u,onChange:E=>O1(E.currentTarget.value),children:C.map((E,f)=>{const y=w+f;return h.jsxs("option",{value:Pa(E.version,y),children:[E.version==="Unreleased"?"Unreleased":`v${E.version}`,E.date?` · ${E.date}`:""]},Pa(E.version,y))})}),b>1?h.jsxs("div",{className:"whatsnew-pagination",children:[h.jsx("button",{type:"button",className:"whatsnew-page-button",onClick:()=>A(-1),disabled:p===0,"aria-label":"Newer versions",children:"‹"}),h.jsxs("span",{className:"whatsnew-page-status",children:[p+1," / ",b]}),h.jsx("button",{type:"button",className:"whatsnew-page-button",onClick:()=>A(1),disabled:p>=b-1,"aria-label":"Older versions",children:"›"})]}):null,h.jsx("button",{type:"button",className:"whatsnew-refresh",onClick:d,disabled:e.releaseNotesLoading,children:e.releaseNotesLoading?"Refreshing":"Refresh"})]}),e.releaseNotesError?h.jsx("p",{className:"whatsnew-error",children:"Release notes could not be refreshed."}):null,c.sections.map((E,f)=>h.jsx(YR,{section:E,index:f},E.heading))]}),h.jsx("footer",{className:"whatsnew-footer",children:h.jsx("button",{type:"button",className:"whatsnew-done",onClick:du,children:"Close"})})]})]})}function YR({section:e,index:n}){const r=e.heading.toLowerCase().replaceAll(" ","-"),a={"--whatsnew-delay":`${n*55}ms`};return h.jsxs("section",{className:`whatsnew-section whatsnew-section--${r}`,style:a,children:[h.jsx("h3",{children:h.jsx("span",{className:"whatsnew-section-chip",children:e.heading})}),h.jsx("ul",{children:e.items.map((o,g)=>h.jsx("li",{children:h.jsx(XR,{item:o})},`${o.text}:${g}`))})]})}function XR({item:e}){return h.jsxs(h.Fragment,{children:[e.packageTags.map((n,r)=>h.jsx("span",{className:`whatsnew-package-chip whatsnew-package-chip--${r%2===0?"brass":"aurora"}`,children:n},`${n}:${r}`)),h.jsx("span",{children:e.text})]})}function Pa(e,n){return`${e}:${n}`}function ZR(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(KR)),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 Hr(){return j.useSyncExternalStore(ET,$p,$p)}function hh(e=()=>{}){return{...uS(e),notifications:{emit:r=>OT(r),dismiss:r=>HT(r)},status:{set:(r,a)=>NT(r,a),clear:r=>aw(r)}}}const F1=250,JR=5e3,W1=1,QR=1013,e3=4e3,t3=4001;function n3(e){const n=new AbortController,r=new TextEncoder;let a=F1,o=null,g=null,_=null,c=!1;const u=()=>{g?.dispose(),g=null},d=(w,C)=>{_={cols:w,rows:C},o?.readyState===W1&&o.send(JSON.stringify({type:"resize",cols:w,rows:C}))},b=async()=>{for(;!n.signal.aborted;){e.onStatus?.("connecting");try{const{ticket:w}=await r3(e.ticketPath,e.operationId,n.signal);if(n.signal.aborted)return;await p(i3(w,e.location,e.wsPath),e),a=F1}catch(w){if(n.signal.aborted)return;e.onStatus?.("connecting",w instanceof Error?w.message:String(w))}await a3(a,n.signal),a=Math.min(a*2,JR)}},p=async(w,C)=>{await new Promise((A,E)=>{const f=(C.webSocketFactory??s3)(w);o=f,f.binaryType="arraybuffer",f.onopen=()=>{C.onStatus?.("live"),u(),g=C.terminal.onData(y=>{f.readyState===W1&&f.send(r.encode(y))}),_&&d(_.cols,_.rows)},f.onmessage=y=>{y.data instanceof ArrayBuffer&&C.terminal.write(new Uint8Array(y.data))},f.onerror=()=>{E(new Error("Terminal WebSocket error"))},f.onclose=y=>{u(),o===f&&(o=null);const m=y?.code;m===e3?(n.abort(),C.onStatus?.("closed","terminal_replaced")):m===t3?(n.abort(),C.onStatus?.("closed","terminal_closed"),C.onExit?.()):m===QR&&(n.abort(),C.onStatus?.("closed","terminal_unavailable")),A()}})};return{start:()=>{c||(c=!0,b())},resize:d,dispose:()=>{n.abort(),u(),e.onStatus?.("closed"),o?.close(),o=null}}}function i3(e,n=window.location,r){return`${n.protocol==="https:"?"wss":"ws"}://${n.host}${r}?ticket=${encodeURIComponent(e)}`}async function r3(e,n,r){const a=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operationId:n}),signal:r});if(!a.ok)throw new Error(`Terminal ticket request failed: ${a.status}`);const o=await a.json();if(typeof o.ticket!="string"||typeof o.ttlMs!="number")throw new Error("Invalid terminal ticket response");return{ticket:o.ticket,ttlMs:o.ttlMs}}function s3(e){return new WebSocket(e)}async function a3(e,n){await new Promise(r=>{const a=()=>{clearTimeout(o),n.removeEventListener("abort",a),r()},o=setTimeout(a,e);n.addEventListener("abort",a)})}var jf={exports:{}},G1;function o3(){return G1||(G1=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 g=this._terminal._core;this._terminal.rows===o.rows&&this._terminal.cols===o.cols||(g._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,g=o._renderService.dimensions;if(g.css.cell.width===0||g.css.cell.height===0)return;const _=this._terminal.options.scrollback===0?0:o.viewport.scrollBarWidth,c=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(c.getPropertyValue("height")),d=Math.max(0,parseInt(c.getPropertyValue("width"))),b=window.getComputedStyle(this._terminal.element),p=u-(parseInt(b.getPropertyValue("padding-top"))+parseInt(b.getPropertyValue("padding-bottom"))),w=d-(parseInt(b.getPropertyValue("padding-right"))+parseInt(b.getPropertyValue("padding-left")))-_;return{cols:Math.max(2,Math.floor(w/g.css.cell.width)),rows:Math.max(1,Math.floor(p/g.css.cell.height))}}}})(),r})()))})(jf)),jf.exports}var l3=o3(),Lu={exports:{}},c3=Lu.exports,q1;function u3(){return q1||(q1=1,(function(e,n){(function(r,a){e.exports=a()})(c3,(()=>(()=>{var r={433:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV11=void 0;const d=u(938),b=[[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]],w=[[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]],C=[[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(f,y){let m,S=0,k=y.length-1;if(f<y[0][0]||f>y[k][1])return!1;for(;k>=S;)if(m=S+k>>1,f>y[m][1])S=m+1;else{if(!(f<y[m][0]))return!0;k=m-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 f=0;f<b.length;++f)A.fill(0,b[f][0],b[f][1]+1);for(let f=0;f<w.length;++f)A.fill(2,w[f][0],w[f][1]+1)}}wcwidth(f){return f<32?0:f<127?1:f<65536?A[f]:E(f,p)?0:E(f,C)?2:1}charProperties(f,y){let m=this.wcwidth(f),S=m===0&&y!==0;if(S){const k=d.UnicodeService.extractWidth(y);k===0?S=!1:k>m&&(m=k)}return d.UnicodeService.createPropertyValue(0,m,S)}}},345:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.runAndSubscribe=c.forwardEvent=c.EventEmitter=void 0,c.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const b=[];for(let p=0;p<this._listeners.length;p++)b.push(this._listeners[p]);for(let p=0;p<b.length;p++)b[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((b=>d.fire(b)))},c.runAndSubscribe=function(u,d){return d(void 0),u((b=>d(b)))}},490:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const d=u(938),b=[[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 w;c.UnicodeV6=class{constructor(){if(this.version="6",!w){w=new Uint8Array(65536),w.fill(1),w[0]=0,w.fill(0,1,32),w.fill(0,127,160),w.fill(2,4352,4448),w[9001]=2,w[9002]=2,w.fill(2,11904,42192),w[12351]=1,w.fill(2,44032,55204),w.fill(2,63744,64256),w.fill(2,65040,65050),w.fill(2,65072,65136),w.fill(2,65280,65377),w.fill(2,65504,65511);for(let C=0;C<b.length;++C)w.fill(0,b[C][0],b[C][1]+1)}}wcwidth(C){return C<32?0:C<127?1:C<65536?w[C]:(function(A,E){let f,y=0,m=E.length-1;if(A<E[0][0]||A>E[m][1])return!1;for(;m>=y;)if(f=y+m>>1,A>E[f][1])y=f+1;else{if(!(A<E[f][0]))return!0;m=f-1}return!1})(C,p)?0:C>=131072&&C<=196605||C>=196608&&C<=262141?2:1}charProperties(C,A){let E=this.wcwidth(C),f=E===0&&A!==0;if(f){const y=d.UnicodeService.extractWidth(A);y===0?f=!1:y>E&&(E=y)}return d.UnicodeService.createPropertyValue(0,E,f)}}},938:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const d=u(345),b=u(490);class p{static extractShouldJoin(C){return(1&C)!=0}static extractWidth(C){return C>>1&3}static extractCharKind(C){return C>>3}static createPropertyValue(C,A,E=!1){return(16777215&C)<<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 C=new b.UnicodeV6;this.register(C),this._active=C.version,this._activeProvider=C}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(C){if(!this._providers[C])throw new Error(`unknown Unicode version "${C}"`);this._active=C,this._activeProvider=this._providers[C],this._onChange.fire(C)}register(C){this._providers[C.version]=C}wcwidth(C){return this._activeProvider.wcwidth(C)}getStringCellWidth(C){let A=0,E=0;const f=C.length;for(let y=0;y<f;++y){let m=C.charCodeAt(y);if(55296<=m&&m<=56319){if(++y>=f)return A+this.wcwidth(m);const L=C.charCodeAt(y);56320<=L&&L<=57343?m=1024*(m-55296)+L-56320+65536:A+=this.wcwidth(L)}const S=this.charProperties(m,E);let k=p.extractWidth(S);p.extractShouldJoin(S)&&(k-=p.extractWidth(E)),A+=k,E=S}return A}charProperties(C,A){return this._activeProvider.charProperties(C,A)}}c.UnicodeService=p}},a={};function o(_){var c=a[_];if(c!==void 0)return c.exports;var u=a[_]={exports:{}};return r[_](u,u.exports,o),u.exports}var g={};return(()=>{var _=g;Object.defineProperty(_,"__esModule",{value:!0}),_.Unicode11Addon=void 0;const c=o(433);_.Unicode11Addon=class{activate(u){u.unicode.register(new c.UnicodeV11)}dispose(){}}})(),g})()))})(Lu)),Lu.exports}var h3=u3();var d3=(e,n,r,a)=>{for(var o=n,g=e.length-1,_;g>=0;g--)(_=e[g])&&(o=_(o)||o);return o},f3=(e,n)=>(r,a)=>n(r,a,e),p3=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?K1.isErrorNoTelemetry(e)?new K1(e.message+`
12
+
13
+ `+e.stack):new Error(e.message+`
14
+
15
+ `+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)}},g3=new p3;function If(e){m3(e)||g3.onUnexpectedError(e)}var Wp="Canceled";function m3(e){return e instanceof _3?!0:e instanceof Error&&e.name===Wp&&e.message===Wp}var _3=class extends Error{constructor(){super(Wp),this.name=this.message}},K1=class Gp extends Error{constructor(n){super(n),this.name="CodeExpectedError"}static fromError(n){if(n instanceof Gp)return n;let r=new Gp;return r.message=n.message,r.stack=n.stack,r}static isErrorNoTelemetry(n){return n.name==="CodeExpectedError"}},v3;(e=>{function n(g){return g<0}e.isLessThan=n;function r(g){return g<=0}e.isLessThanOrEqual=r;function a(g){return g>0}e.isGreaterThan=a;function o(g){return g===0}e.isNeitherLessOrGreaterThan=o,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(v3||={});function b3(e,n){let r=this,a=!1,o;return function(){return a||(a=!0,n||(o=e.apply(r,arguments))),o}}var bw;(e=>{function n(k){return k&&typeof k=="object"&&typeof k[Symbol.iterator]=="function"}e.is=n;let r=Object.freeze([]);function a(){return r}e.empty=a;function*o(k){yield k}e.single=o;function g(k){return n(k)?k:o(k)}e.wrap=g;function _(k){return k||r}e.from=_;function*c(k){for(let L=k.length-1;L>=0;L--)yield k[L]}e.reverse=c;function u(k){return!k||k[Symbol.iterator]().next().done===!0}e.isEmpty=u;function d(k){return k[Symbol.iterator]().next().value}e.first=d;function b(k,L){let R=0;for(let M of k)if(L(M,R++))return!0;return!1}e.some=b;function p(k,L){for(let R of k)if(L(R))return R}e.find=p;function*w(k,L){for(let R of k)L(R)&&(yield R)}e.filter=w;function*C(k,L){let R=0;for(let M of k)yield L(M,R++)}e.map=C;function*A(k,L){let R=0;for(let M of k)yield*L(M,R++)}e.flatMap=A;function*E(...k){for(let L of k)yield*L}e.concat=E;function f(k,L,R){let M=R;for(let T of k)M=L(M,T);return M}e.reduce=f;function*y(k,L,R=k.length){for(L<0&&(L+=k.length),R<0?R+=k.length:R>k.length&&(R=k.length);L<R;L++)yield k[L]}e.slice=y;function m(k,L=Number.POSITIVE_INFINITY){let R=[];if(L===0)return[R,k];let M=k[Symbol.iterator]();for(let T=0;T<L;T++){let I=M.next();if(I.done)return[R,e.empty()];R.push(I.value)}return[R,{[Symbol.iterator](){return M}}]}e.consume=m;async function S(k){let L=[];for await(let R of k)L.push(R);return Promise.resolve(L)}e.asyncToArray=S})(bw||={});function yw(e){if(bw.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 Sw(...e){return $n(()=>yw(e))}function $n(e){return{dispose:b3(()=>{e()})}}var ww=class xw{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{yw(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?xw.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)}};ww.DISABLE_DISPOSED_WARNING=!1;var no=ww,Zi=class{constructor(){this._store=new no,this._store}dispose(){this._store.dispose()}_register(n){if(n===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(n)}};Zi.None=Object.freeze({dispose(){}});var hl=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(n){this._isDisposed||n===this._value||(this._value?.dispose(),this._value=n)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let n=this._value;return this._value=void 0,n}},Qg=typeof process<"u"&&"title"in process,dh=Qg?"node":navigator.userAgent,y3=Qg?"node":navigator.platform,S3=dh.includes("Firefox"),w3=dh.includes("Edge"),Cw=/^((?!chrome|android).)*safari/i.test(dh);function x3(){if(!Cw)return 0;let e=dh.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}y3.indexOf("Linux")>=0;var C3="",xn=0,Cn=0,En=0,sn=0,Oi={css:"#00000000",rgba:0},qn;(e=>{function n(o,g,_,c){return c!==void 0?`#${Fs(o)}${Fs(g)}${Fs(_)}${Fs(c)}`:`#${Fs(o)}${Fs(g)}${Fs(_)}`}e.toCss=n;function r(o,g,_,c=255){return(o<<24|g<<16|_<<8|c)>>>0}e.toRgba=r;function a(o,g,_,c){return{css:e.toCss(o,g,_,c),rgba:e.toRgba(o,g,_,c)}}e.toColor=a})(qn||={});var kl;(e=>{function n(u,d){if(sn=(d.rgba&255)/255,sn===1)return{css:d.css,rgba:d.rgba};let b=d.rgba>>24&255,p=d.rgba>>16&255,w=d.rgba>>8&255,C=u.rgba>>24&255,A=u.rgba>>16&255,E=u.rgba>>8&255;xn=C+Math.round((b-C)*sn),Cn=A+Math.round((p-A)*sn),En=E+Math.round((w-E)*sn);let f=qn.toCss(xn,Cn,En),y=qn.toRgba(xn,Cn,En);return{css:f,rgba:y}}e.blend=n;function r(u){return(u.rgba&255)===255}e.isOpaque=r;function a(u,d,b){let p=Js.ensureContrastRatio(u.rgba,d.rgba,b);if(p)return qn.toColor(p>>24&255,p>>16&255,p>>8&255)}e.ensureContrastRatio=a;function o(u){let d=(u.rgba|255)>>>0;return[xn,Cn,En]=Js.toChannels(d),{css:qn.toCss(xn,Cn,En),rgba:d}}e.opaque=o;function g(u,d){return sn=Math.round(d*255),[xn,Cn,En]=Js.toChannels(u.rgba),{css:qn.toCss(xn,Cn,En,sn),rgba:qn.toRgba(xn,Cn,En,sn)}}e.opacity=g;function _(u,d){return sn=u.rgba&255,g(u,sn*d/255)}e.multiplyOpacity=_;function c(u){return[u.rgba>>24&255,u.rgba>>16&255,u.rgba>>8&255]}e.toColorRGB=c})(kl||={});var E3;(e=>{let n,r;try{let o=document.createElement("canvas");o.width=1,o.height=1;let g=o.getContext("2d",{willReadFrequently:!0});g&&(n=g,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 xn=parseInt(o.slice(1,2).repeat(2),16),Cn=parseInt(o.slice(2,3).repeat(2),16),En=parseInt(o.slice(3,4).repeat(2),16),qn.toColor(xn,Cn,En);case 5:return xn=parseInt(o.slice(1,2).repeat(2),16),Cn=parseInt(o.slice(2,3).repeat(2),16),En=parseInt(o.slice(3,4).repeat(2),16),sn=parseInt(o.slice(4,5).repeat(2),16),qn.toColor(xn,Cn,En,sn);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 g=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(g)return xn=parseInt(g[1]),Cn=parseInt(g[2]),En=parseInt(g[3]),sn=Math.round((g[5]===void 0?1:parseFloat(g[5]))*255),qn.toColor(xn,Cn,En,sn);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),[xn,Cn,En,sn]=n.getImageData(0,0,1,1).data,sn!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:qn.toRgba(xn,Cn,En,sn),css:o}}e.toColor=a})(E3||={});var Wn;(e=>{function n(a){return r(a>>16&255,a>>8&255,a&255)}e.relativeLuminance=n;function r(a,o,g){let _=a/255,c=o/255,u=g/255,d=_<=.03928?_/12.92:Math.pow((_+.055)/1.055,2.4),b=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+b*.7152+p*.0722}e.relativeLuminance2=r})(Wn||={});var Js;(e=>{function n(_,c){if(sn=(c&255)/255,sn===1)return c;let u=c>>24&255,d=c>>16&255,b=c>>8&255,p=_>>24&255,w=_>>16&255,C=_>>8&255;return xn=p+Math.round((u-p)*sn),Cn=w+Math.round((d-w)*sn),En=C+Math.round((b-C)*sn),qn.toRgba(xn,Cn,En)}e.blend=n;function r(_,c,u){let d=Wn.relativeLuminance(_>>8),b=Wn.relativeLuminance(c>>8);if(Mr(d,b)<u){if(b<d){let C=a(_,c,u),A=Mr(d,Wn.relativeLuminance(C>>8));if(A<u){let E=o(_,c,u),f=Mr(d,Wn.relativeLuminance(E>>8));return A>f?C:E}return C}let p=o(_,c,u),w=Mr(d,Wn.relativeLuminance(p>>8));if(w<u){let C=a(_,c,u),A=Mr(d,Wn.relativeLuminance(C>>8));return w>A?p:C}return p}}e.ensureContrastRatio=r;function a(_,c,u){let d=_>>24&255,b=_>>16&255,p=_>>8&255,w=c>>24&255,C=c>>16&255,A=c>>8&255,E=Mr(Wn.relativeLuminance2(w,C,A),Wn.relativeLuminance2(d,b,p));for(;E<u&&(w>0||C>0||A>0);)w-=Math.max(0,Math.ceil(w*.1)),C-=Math.max(0,Math.ceil(C*.1)),A-=Math.max(0,Math.ceil(A*.1)),E=Mr(Wn.relativeLuminance2(w,C,A),Wn.relativeLuminance2(d,b,p));return(w<<24|C<<16|A<<8|255)>>>0}e.reduceLuminance=a;function o(_,c,u){let d=_>>24&255,b=_>>16&255,p=_>>8&255,w=c>>24&255,C=c>>16&255,A=c>>8&255,E=Mr(Wn.relativeLuminance2(w,C,A),Wn.relativeLuminance2(d,b,p));for(;E<u&&(w<255||C<255||A<255);)w=Math.min(255,w+Math.ceil((255-w)*.1)),C=Math.min(255,C+Math.ceil((255-C)*.1)),A=Math.min(255,A+Math.ceil((255-A)*.1)),E=Mr(Wn.relativeLuminance2(w,C,A),Wn.relativeLuminance2(d,b,p));return(w<<24|C<<16|A<<8|255)>>>0}e.increaseLuminance=o;function g(_){return[_>>24&255,_>>16&255,_>>8&255,_&255]}e.toChannels=g})(Js||={});function Fs(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 mn(e){if(!e)throw new Error("value must not be falsy");return e}function em(e){return 57508<=e&&e<=57558}function k3(e){return 57520<=e&&e<=57527}function A3(e){return 57344<=e&&e<=63743}function T3(e){return 9472<=e&&e<=9631}function R3(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 L3(e,n,r,a){return n===1&&r>Math.ceil(a*1.5)&&e!==void 0&&e>255&&!R3(e)&&!em(e)&&!A3(e)}function Ew(e){return em(e)||T3(e)}function M3(){return{css:{canvas:pu(),cell:pu()},device:{canvas:pu(),cell:pu(),char:{width:0,height:0,left:0,top:0}}}}function pu(){return{width:0,height:0}}function N3(e,n,r=0){return(e-(Math.round(n)*2-r))%(Math.round(n)*2)}var Bn=0,wn=0,rr=!1,Nr=!1,gu=!1,ai,Pf=0,O3=class{constructor(e,n,r,a,o,g){this._terminal=e,this._optionService=n,this._selectionRenderModel=r,this._decorationService=a,this._coreBrowserService=o,this._themeService=g,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,wn=0,Bn=0,Nr=!1,rr=!1,gu=!1,ai=this._themeService.colors,Pf=0,e.getCode()!==0&&e.extended.underlineStyle===4){let o=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));Pf=n*a%(Math.round(o)*2)}if(this._decorationService.forEachDecorationAtCell(n,r,"bottom",o=>{o.backgroundColorRGB&&(wn=o.backgroundColorRGB.rgba>>8&16777215,Nr=!0),o.foregroundColorRGB&&(Bn=o.foregroundColorRGB.rgba>>8&16777215,rr=!0)}),gu=this._selectionRenderModel.isCellSelected(this._terminal,n,r),gu){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:wn=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:wn=(this.result.fg&16777215)<<8|255;break;default:wn=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:wn=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:wn=(this.result.bg&16777215)<<8|255;break}wn=Js.blend(wn,(this._coreBrowserService.isFocused?ai.selectionBackgroundOpaque:ai.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else wn=(this._coreBrowserService.isFocused?ai.selectionBackgroundOpaque:ai.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(Nr=!0,ai.selectionForeground&&(Bn=ai.selectionForeground.rgba>>8&16777215,rr=!0),Ew(e.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)Bn=(this._coreBrowserService.isFocused?ai.selectionBackgroundOpaque:ai.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:Bn=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Bn=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:Bn=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Bn=(this.result.fg&16777215)<<8|255;break;default:Bn=this._themeService.colors.foreground.rgba}Bn=Js.blend(Bn,(this._coreBrowserService.isFocused?ai.selectionBackgroundOpaque:ai.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}rr=!0}}this._decorationService.forEachDecorationAtCell(n,r,"top",o=>{o.backgroundColorRGB&&(wn=o.backgroundColorRGB.rgba>>8&16777215,Nr=!0),o.foregroundColorRGB&&(Bn=o.foregroundColorRGB.rgba>>8&16777215,rr=!0)}),Nr&&(gu?wn=e.bg&-16777216&-134217729|wn|50331648:wn=e.bg&-16777216|wn|50331648),rr&&(Bn=e.fg&-16777216&-67108865|Bn|50331648),this.result.fg&67108864&&(Nr&&!rr&&((this.result.bg&50331648)===0?Bn=this.result.fg&-134217728|ai.background.rgba>>8&16777215&16777215|50331648:Bn=this.result.fg&-134217728|this.result.bg&67108863,rr=!0),!Nr&&rr&&((this.result.fg&50331648)===0?wn=this.result.bg&-67108864|ai.foreground.rgba>>8&16777215&16777215|50331648:wn=this.result.bg&-67108864|this.result.fg&67108863,Nr=!0)),ai=void 0,this.result.bg=Nr?wn:this.result.bg,this.result.fg=rr?Bn:this.result.fg,this.result.ext&=536870911,this.result.ext|=Pf<<29&3758096384}},D3=.5,kw=S3||w3?"bottom":"ideographic",B3={"▀":[{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}]},j3={"░":[[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]]},I3={"─":{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`}},Hl={"":{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}};Hl[""]=Hl[""];Hl[""]=Hl[""];function P3(e,n,r,a,o,g,_,c){let u=B3[n];if(u)return z3(e,u,r,a,o,g),!0;let d=j3[n];if(d)return H3(e,d,r,a,o,g),!0;let b=I3[n];if(b)return $3(e,b,r,a,o,g,c),!0;let p=Hl[n];return p?(U3(e,p,r,a,o,g,_,c),!0):!1}function z3(e,n,r,a,o,g){for(let _=0;_<n.length;_++){let c=n[_],u=o/8,d=g/8;e.fillRect(r+c.x*u,a+c.y*d,c.w*u,c.h*d)}}var V1=new Map;function H3(e,n,r,a,o,g){let _=V1.get(n);_||(_=new Map,V1.set(n,_));let c=e.fillStyle;if(typeof c!="string")throw new Error(`Unexpected fillStyle type "${c}"`);let u=_.get(c);if(!u){let d=n[0].length,b=n.length,p=e.canvas.ownerDocument.createElement("canvas");p.width=d,p.height=b;let w=mn(p.getContext("2d")),C=new ImageData(d,b),A,E,f,y;if(c.startsWith("#"))A=parseInt(c.slice(1,3),16),E=parseInt(c.slice(3,5),16),f=parseInt(c.slice(5,7),16),y=c.length>7&&parseInt(c.slice(7,9),16)||1;else if(c.startsWith("rgba"))[A,E,f,y]=c.substring(5,c.length-1).split(",").map(m=>parseFloat(m));else throw new Error(`Unexpected fillStyle color format "${c}" when drawing pattern glyph`);for(let m=0;m<b;m++)for(let S=0;S<d;S++)C.data[(m*d+S)*4]=A,C.data[(m*d+S)*4+1]=E,C.data[(m*d+S)*4+2]=f,C.data[(m*d+S)*4+3]=n[m][S]*(y*255);w.putImageData(C,0,0),u=mn(e.createPattern(p,null)),_.set(c,u)}e.fillStyle=u,e.fillRect(r,a,o,g)}function $3(e,n,r,a,o,g,_){e.strokeStyle=e.fillStyle;for(let[c,u]of Object.entries(n)){e.beginPath(),e.lineWidth=_*Number.parseInt(c);let d;if(typeof u=="function"){let b=.15/g*o;d=u(.15,b)}else d=u;for(let b of d.split(" ")){let p=b[0],w=Aw[p];if(!w){console.error(`Could not find drawing instructions for "${p}"`);continue}let C=b.substring(1).split(",");!C[0]||!C[1]||w(e,Tw(C,o,g,r,a,!0,_))}e.stroke(),e.closePath()}}function U3(e,n,r,a,o,g,_,c){let u=new Path2D;u.rect(r,a,o,g),e.clip(u),e.beginPath();let d=_/12;e.lineWidth=c*d;for(let b of n.d.split(" ")){let p=b[0],w=Aw[p];if(!w){console.error(`Could not find drawing instructions for "${p}"`);continue}let C=b.substring(1).split(",");!C[0]||!C[1]||w(e,Tw(C,o,g,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 Y1(e,n,r=0){return Math.max(Math.min(e,n),r)}var Aw={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 Tw(e,n,r,a,o,g,_,c=0,u=0){let d=e.map(b=>parseFloat(b)||parseInt(b));if(d.length<2)throw new Error("Too few arguments for instruction");for(let b=0;b<d.length;b+=2)d[b]*=n-c*_-u*_,g&&d[b]!==0&&(d[b]=Y1(Math.round(d[b]+.5)-.5,n,0)),d[b]+=a+c*_;for(let b=1;b<d.length;b+=2)d[b]*=r,g&&d[b]!==0&&(d[b]=Y1(Math.round(d[b]+.5)-.5,r,0)),d[b]+=o;return d}var X1=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={}}},Z1=class{constructor(){this._data=new X1}set(e,n,r,a,o){this._data.get(e,n)||this._data.set(e,n,new X1),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()}},Rw=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()}},F3=class extends Rw{_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())}}},W3=class extends Rw{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},G3=!Qg&&"requestIdleCallback"in window?W3:F3,Va=class Lw{constructor(){this.fg=0,this.bg=0,this.extended=new Mw}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 Lw;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}},Mw=class Nw{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 Nw(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},q3=globalThis.performance&&typeof globalThis.performance.now=="function",K3=class Ow{static create(n){return new Ow(n)}constructor(n){this._now=q3&&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=()=>Zi.None;function n(G,B){return p(G,()=>{},0,void 0,!0,void 0,B)}e.defer=n;function r(G){return(B,Y=null,X)=>{let H=!1,q;return q=G(V=>{if(!H)return q?q.dispose():H=!0,B.call(Y,V)},null,X),H&&q.dispose(),q}}e.once=r;function a(G,B,Y){return d((X,H=null,q)=>G(V=>X.call(H,B(V)),null,q),Y)}e.map=a;function o(G,B,Y){return d((X,H=null,q)=>G(V=>{B(V),X.call(H,V)},null,q),Y)}e.forEach=o;function g(G,B,Y){return d((X,H=null,q)=>G(V=>B(V)&&X.call(H,V),null,q),Y)}e.filter=g;function _(G){return G}e.signal=_;function c(...G){return(B,Y=null,X)=>{let H=Sw(...G.map(q=>q(V=>B.call(Y,V))));return b(H,X)}}e.any=c;function u(G,B,Y,X){let H=Y;return a(G,q=>(H=B(H,q),H),X)}e.reduce=u;function d(G,B){let Y,X={onWillAddFirstListener(){Y=G(H.fire,H)},onDidRemoveLastListener(){Y?.dispose()}},H=new Ht(X);return B?.add(H),H.event}function b(G,B){return B instanceof Array?B.push(G):B&&B.add(G),G}function p(G,B,Y=100,X=!1,H=!1,q,V){let D,P,O,z=0,W,Z={leakWarningThreshold:q,onWillAddFirstListener(){D=G(he=>{z++,P=B(P,he),X&&!O&&(ie.fire(P),P=void 0),W=()=>{let te=P;P=void 0,O=void 0,(!X||z>1)&&ie.fire(te),z=0},typeof Y=="number"?(clearTimeout(O),O=setTimeout(W,Y)):O===void 0&&(O=0,queueMicrotask(W))})},onWillRemoveListener(){H&&z>0&&W?.()},onDidRemoveLastListener(){W=void 0,D.dispose()}},ie=new Ht(Z);return V?.add(ie),ie.event}e.debounce=p;function w(G,B=0,Y){return e.debounce(G,(X,H)=>X?(X.push(H),X):[H],B,void 0,!0,void 0,Y)}e.accumulate=w;function C(G,B=(X,H)=>X===H,Y){let X=!0,H;return g(G,q=>{let V=X||!B(q,H);return X=!1,H=q,V},Y)}e.latch=C;function A(G,B,Y){return[e.filter(G,B,Y),e.filter(G,X=>!B(X),Y)]}e.split=A;function E(G,B=!1,Y=[],X){let H=Y.slice(),q=G(P=>{H?H.push(P):D.fire(P)});X&&X.add(q);let V=()=>{H?.forEach(P=>D.fire(P)),H=null},D=new Ht({onWillAddFirstListener(){q||(q=G(P=>D.fire(P)),X&&X.add(q))},onDidAddFirstListener(){H&&(B?setTimeout(V):V())},onDidRemoveLastListener(){q&&q.dispose(),q=null}});return X&&X.add(D),D.event}e.buffer=E;function f(G,B){return(Y,X,H)=>{let q=B(new m);return G(function(V){let D=q.evaluate(V);D!==y&&Y.call(X,D)},void 0,H)}}e.chain=f;let y=Symbol("HaltChainable");class m{constructor(){this.steps=[]}map(B){return this.steps.push(B),this}forEach(B){return this.steps.push(Y=>(B(Y),Y)),this}filter(B){return this.steps.push(Y=>B(Y)?Y:y),this}reduce(B,Y){let X=Y;return this.steps.push(H=>(X=B(X,H),X)),this}latch(B=(Y,X)=>Y===X){let Y=!0,X;return this.steps.push(H=>{let q=Y||!B(H,X);return Y=!1,X=H,q?H:y}),this}evaluate(B){for(let Y of this.steps)if(B=Y(B),B===y)break;return B}}function S(G,B,Y=X=>X){let X=(...D)=>V.fire(Y(...D)),H=()=>G.on(B,X),q=()=>G.removeListener(B,X),V=new Ht({onWillAddFirstListener:H,onDidRemoveLastListener:q});return V.event}e.fromNodeEventEmitter=S;function k(G,B,Y=X=>X){let X=(...D)=>V.fire(Y(...D)),H=()=>G.addEventListener(B,X),q=()=>G.removeEventListener(B,X),V=new Ht({onWillAddFirstListener:H,onDidRemoveLastListener:q});return V.event}e.fromDOMEventEmitter=k;function L(G){return new Promise(B=>r(G)(B))}e.toPromise=L;function R(G){let B=new Ht;return G.then(Y=>{B.fire(Y)},()=>{B.fire(void 0)}).finally(()=>{B.dispose()}),B.event}e.fromPromise=R;function M(G,B){return G(Y=>B.fire(Y))}e.forward=M;function T(G,B,Y){return B(Y),G(X=>B(X))}e.runAndSubscribe=T;class I{constructor(B,Y){this._observable=B,this._counter=0,this._hasChanged=!1;let X={onWillAddFirstListener:()=>{B.addObserver(this)},onDidRemoveLastListener:()=>{B.removeObserver(this)}};this.emitter=new Ht(X),Y&&Y.add(this.emitter)}beginUpdate(B){this._counter++}handlePossibleChange(B){}handleChange(B,Y){this._hasChanged=!0}endUpdate(B){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function K(G,B){return new I(G,B).emitter.event}e.fromObservable=K;function F(G){return(B,Y,X)=>{let H=0,q=!1,V={beginUpdate(){H++},endUpdate(){H--,H===0&&(G.reportChanges(),q&&(q=!1,B.call(Y)))},handlePossibleChange(){},handleChange(){q=!0}};G.addObserver(V),G.reportChanges();let D={dispose(){G.removeObserver(V)}};return X instanceof no?X.add(D):Array.isArray(X)&&X.push(D),D}}e.fromObservableLight=F})(jr||={});var qp=class Kp{constructor(n){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${n}_${Kp._idPool++}`,Kp.all.add(this)}start(n){this._stopWatch=new K3,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}}};qp.all=new Set,qp._idPool=0;var V3=qp,Y3=-1,Dw=class Bw{constructor(n,r,a=(Bw._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[g,_]=this.getMostFrequentStack(),c=`[${this.name}] potential listener LEAK detected, having ${r} listeners already. MOST frequent listener (${_}):`;console.warn(c),console.warn(g);let u=new J3(c,g);this._errorHandler(u)}return()=>{let g=this._stacks.get(n.value)||0;this._stacks.set(n.value,g-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}};Dw._idPool=1;var X3=Dw,Z3=class jw{constructor(n){this.value=n}static create(){let n=new Error;return new jw(n.stack??"")}print(){console.warn(this.value.split(`
16
+ `).slice(2).join(`
17
+ `))}},J3=class extends Error{constructor(e,n){super(e),this.name="ListenerLeakError",this.stack=n}},Q3=class extends Error{constructor(e,n){super(e),this.name="ListenerRefusalError",this.stack=n}},eL=0,zf=class{constructor(n){this.value=n,this.id=eL++}},tL=2,nL,Ht=class{constructor(n){this._size=0,this._options=n,this._leakageMon=this._options?.leakWarningThreshold?new X3(n?.onListenerError??If,this._options?.leakWarningThreshold??Y3):void 0,this._perfMon=this._options?._profName?new V3(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??=(n,r,a)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let c=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(c);let u=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],d=new Q3(`${c}. HINT: Stack shows most frequent listener (${u[1]}-times)`,u[0]);return(this._options?.onListenerError||If)(d),Zi.None}if(this._disposed)return Zi.None;r&&(n=n.bind(r));let o=new zf(n),g;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=Z3.create(),g=this._leakageMon.check(o.stack,this._size+1)),this._listeners?this._listeners instanceof zf?(this._deliveryQueue??=new iL,this._listeners=[this._listeners,o]):this._listeners.push(o):(this._options?.onWillAddFirstListener?.(this),this._listeners=o,this._options?.onDidAddFirstListener?.(this)),this._size++;let _=$n(()=>{g?.(),this._removeListener(o)});return a instanceof no?a.add(_):Array.isArray(a)&&a.push(_),_},this._event}_removeListener(n){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 r=this._listeners,a=r.indexOf(n);if(a===-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--,r[a]=void 0;let o=this._deliveryQueue.current===this;if(this._size*tL<=r.length){let g=0;for(let _=0;_<r.length;_++)r[_]?r[g++]=r[_]:o&&(this._deliveryQueue.end--,g<this._deliveryQueue.i&&this._deliveryQueue.i--);r.length=g}}_deliver(n,r){if(!n)return;let a=this._options?.onListenerError||If;if(!a){n.value(r);return}try{n.value(r)}catch(o){a(o)}}_deliverQueue(n){let r=n.current._listeners;for(;n.i<n.end;)this._deliver(r[n.i++],n.value);n.reset()}fire(n){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof zf)this._deliver(this._listeners,n);else{let r=this._deliveryQueue;r.enqueue(this,n,this._listeners.length),this._deliverQueue(r)}this._perfMon?.stop()}hasListeners(){return this._size>0}},iL=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}},J1={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}},dl=2,fl,ms=class Wa{constructor(n,r,a){this._document=n,this._config=r,this._unicodeService=a,this._didWarmUp=!1,this._cacheMap=new Z1,this._cacheMapCombined=new Z1,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new Va,this._textureSize=512,this._onAddTextureAtlasCanvas=new Ht,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new Ht,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=Iw(n,this._config.deviceCellWidth*4+dl*2,this._config.deviceCellHeight+dl*2),this._tmpCtx=mn(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 G3;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(Wa.maxAtlasPages&&this._pages.length>=Math.max(4,Wa.maxAtlasPages)){let r=this._pages.filter(d=>d.canvas.width*2<=(Wa.maxTextureSize||4096)).sort((d,b)=>b.canvas.width!==d.canvas.width?b.canvas.width-d.canvas.width:b.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 g=r.slice(a,a+4),_=g.map(d=>d.glyphs[0].texturePage).sort((d,b)=>d>b?1:-1),c=this.pages.length-g.length,u=this._mergePages(g,c);u.version++;for(let d=_.length-1;d>=0;d--)this._deletePage(_[d]);this.pages.push(u),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(u.canvas)}let n=new Hf(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 Hf(this._document,a,n);for(let[g,_]of n.entries()){let c=g*_.canvas.width%a,u=Math.floor(g/2)*_.canvas.height;o.ctx.drawImage(_.canvas,c,u);for(let b of _.glyphs)b.texturePage=r,b.sizeClipSpace.x=b.size.x/a,b.sizeClipSpace.y=b.size.y/a,b.texturePosition.x+=c,b.texturePosition.y+=u,b.texturePositionClipSpace.x=b.texturePosition.x/a,b.texturePositionClipSpace.y=b.texturePosition.y/a;this._onRemoveTextureAtlasCanvas.fire(_.canvas);let d=this._activePages.indexOf(_);d!==-1&&this._activePages.splice(d,1)}return o}_deletePage(n){this._pages.splice(n,1);for(let r=n;r<this._pages.length;r++){let a=this._pages[r];for(let o of a.glyphs)o.texturePage--;a.version++}}getRasterizedGlyphCombinedChar(n,r,a,o,g,_){return this._getFromCacheMap(this._cacheMapCombined,n,r,a,o,g,_)}getRasterizedGlyph(n,r,a,o,g,_){return this._getFromCacheMap(this._cacheMap,n,r,a,o,g,_)}_getFromCacheMap(n,r,a,o,g,_,c){return fl=n.get(r,a,o,g),fl||(fl=this._drawToCache(r,a,o,g,_,c),n.set(r,a,o,g,fl)),fl}_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 Oi;let g;switch(n){case 16777216:case 33554432:g=this._getColorFromAnsiIndex(r);break;case 50331648:let _=Va.toColorRGB(r);g=qn.toColor(_[0],_[1],_[2]);break;default:a?g=kl.opaque(this._config.colors.foreground):g=this._config.colors.background;break}return this._config.allowTransparency||(g=kl.opaque(g)),g}_getForegroundColor(n,r,a,o,g,_,c,u,d,b){let p=this._getMinimumContrastColor(n,r,a,o,g,_,c,d,u,b);if(p)return p;let w;switch(g){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&d&&_<8&&(_+=8),w=this._getColorFromAnsiIndex(_);break;case 50331648:let C=Va.toColorRGB(_);w=qn.toColor(C[0],C[1],C[2]);break;default:c?w=this._config.colors.background:w=this._config.colors.foreground}return this._config.allowTransparency&&(w=kl.opaque(w)),u&&(w=kl.multiplyOpacity(w,D3)),w}_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,g,_,c,u,d,b){if(this._config.minimumContrastRatio===1||b)return;let p=this._getContrastCache(d),w=p.getColor(n,o);if(w!==void 0)return w||void 0;let C=this._resolveBackgroundRgba(r,a,c),A=this._resolveForegroundRgba(g,_,c,u),E=Js.ensureContrastRatio(C,A,this._config.minimumContrastRatio/(d?2:1));if(!E){p.setColor(n,o,null);return}let f=qn.toColor(E>>24&255,E>>16&255,E>>8&255);return p.setColor(n,o,f),f}_getContrastCache(n){return n?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(n,r,a,o,g,_){let c=typeof n=="number"?String.fromCharCode(n):n;_&&this._tmpCanvas.parentElement!==_&&(this._tmpCanvas.style.display="none",_.append(this._tmpCanvas));let u=Math.min(this._config.deviceCellWidth*Math.max(c.length,2)+dl*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width<u&&(this._tmpCanvas.width=u);let d=Math.min(this._config.deviceCellHeight+dl*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 J1;let b=!!this._workAttributeData.isBold(),p=!!this._workAttributeData.isInverse(),w=!!this._workAttributeData.isDim(),C=!!this._workAttributeData.isItalic(),A=!!this._workAttributeData.isUnderline(),E=!!this._workAttributeData.isStrikethrough(),f=!!this._workAttributeData.isOverline(),y=this._workAttributeData.getFgColor(),m=this._workAttributeData.getFgColorMode(),S=this._workAttributeData.getBgColor(),k=this._workAttributeData.getBgColorMode();if(p){let P=y;y=S,S=P;let O=m;m=k,k=O}let L=this._getBackgroundColor(k,S,p,w);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=b?this._config.fontWeightBold:this._config.fontWeight,M=C?"italic":"";this._tmpCtx.font=`${M} ${R} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=kw;let T=c.length===1&&em(c.charCodeAt(0)),I=c.length===1&&k3(c.charCodeAt(0)),K=this._getForegroundColor(r,k,S,a,m,y,p,w,b,Ew(c.charCodeAt(0)));this._tmpCtx.fillStyle=K.css;let F=I?0:dl*2,G=!1;this._config.customGlyphs!==!1&&(G=P3(this._tmpCtx,c,F,F,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let B=!T,Y;if(typeof n=="number"?Y=this._unicodeService.wcwidth(n):Y=this._unicodeService.getStringCellWidth(n),A){this._tmpCtx.save();let P=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),O=P%2===1?.5:0;if(this._tmpCtx.lineWidth=P,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())B=!1,this._tmpCtx.strokeStyle=`rgb(${Va.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{B=!1;let te=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&te<8&&(te+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(te).css}this._tmpCtx.beginPath();let z=F,W=Math.ceil(F+this._config.deviceCharHeight)-O-(g?P*2:0),Z=W+P,ie=W+P*2,he=this._workAttributeData.getUnderlineVariantOffset();for(let te=0;te<Y;te++){this._tmpCtx.save();let $=z+te*this._config.deviceCellWidth,le=z+(te+1)*this._config.deviceCellWidth,ge=$+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo($,W),this._tmpCtx.lineTo(le,W),this._tmpCtx.moveTo($,ie),this._tmpCtx.lineTo(le,ie);break;case 3:let we=P<=1?ie:Math.ceil(F+this._config.deviceCharHeight-P/2)-O,Se=P<=1?W:Math.ceil(F+this._config.deviceCharHeight+P/2)-O,je=new Path2D;je.rect($,W,this._config.deviceCellWidth,ie-W),this._tmpCtx.clip(je),this._tmpCtx.moveTo($-this._config.deviceCellWidth/2,Z),this._tmpCtx.bezierCurveTo($-this._config.deviceCellWidth/2,Se,$,Se,$,Z),this._tmpCtx.bezierCurveTo($,we,ge,we,ge,Z),this._tmpCtx.bezierCurveTo(ge,Se,le,Se,le,Z),this._tmpCtx.bezierCurveTo(le,we,le+this._config.deviceCellWidth/2,we,le+this._config.deviceCellWidth/2,Z);break;case 4:let Ie=he===0?0:he>=P?P*2-he:P-he;he>=P||Ie===0?(this._tmpCtx.setLineDash([Math.round(P),Math.round(P)]),this._tmpCtx.moveTo($+Ie,W),this._tmpCtx.lineTo(le,W)):(this._tmpCtx.setLineDash([Math.round(P),Math.round(P)]),this._tmpCtx.moveTo($,W),this._tmpCtx.lineTo($+Ie,W),this._tmpCtx.moveTo($+Ie+P,W),this._tmpCtx.lineTo(le,W)),he=N3(le-$,P,he);break;case 5:let Ge=.6,vt=.3,Le=le-$,Tt=Math.floor(Ge*Le),Xt=Math.floor(vt*Le),vn=Le-Tt-Xt;this._tmpCtx.setLineDash([Tt,Xt,vn]),this._tmpCtx.moveTo($,W),this._tmpCtx.lineTo(le,W);break;default:this._tmpCtx.moveTo($,W),this._tmpCtx.lineTo(le,W);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!G&&this._config.fontSize>=12&&!this._config.allowTransparency&&c!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let te=this._tmpCtx.measureText(c);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in te&&te.actualBoundingBoxDescent>0){this._tmpCtx.save();let $=new Path2D;$.rect(z,W-Math.ceil(P/2),this._config.deviceCellWidth*Y,ie-W+Math.ceil(P/2)),this._tmpCtx.clip($),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=L.css,this._tmpCtx.strokeText(c,F,F+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(f){let P=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),O=P%2===1?.5:0;this._tmpCtx.lineWidth=P,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(F,F+O),this._tmpCtx.lineTo(F+this._config.deviceCharWidth*Y,F+O),this._tmpCtx.stroke()}if(G||this._tmpCtx.fillText(c,F,F+this._config.deviceCharHeight),c==="_"&&!this._config.allowTransparency){let P=$f(this._tmpCtx.getImageData(F,F,this._config.deviceCellWidth,this._config.deviceCellHeight),L,K,B);if(P)for(let O=1;O<=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,F,F+this._config.deviceCharHeight-O),P=$f(this._tmpCtx.getImageData(F,F,this._config.deviceCellWidth,this._config.deviceCellHeight),L,K,B),!!P);O++);}if(E){let P=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),O=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=P,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(F,F+Math.floor(this._config.deviceCharHeight/2)-O),this._tmpCtx.lineTo(F+this._config.deviceCharWidth*Y,F+Math.floor(this._config.deviceCharHeight/2)-O),this._tmpCtx.stroke()}this._tmpCtx.restore();let X=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),H;if(this._config.allowTransparency?H=rL(X):H=$f(X,L,K,B),H)return J1;let q=this._findGlyphBoundingBox(X,this._workBoundingBox,u,I,G,F),V,D;for(;;){if(this._activePages.length===0){let P=this._createNewPage();V=P,D=P.currentRow,D.height=q.size.y;break}V=this._activePages[this._activePages.length-1],D=V.currentRow;for(let P of this._activePages)q.size.y<=P.currentRow.height&&(V=P,D=P.currentRow);for(let P=this._activePages.length-1;P>=0;P--)for(let O of this._activePages[P].fixedRows)O.height<=D.height&&q.size.y<=O.height&&(V=this._activePages[P],D=O);if(q.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new Hf(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),V=this._overflowSizePage,D=this._overflowSizePage.currentRow,D.x+q.size.x>=V.canvas.width&&(D.x=0,D.y+=D.height,D.height=0);break}if(D.y+q.size.y>=V.canvas.height||D.height>q.size.y+2){let P=!1;if(V.currentRow.y+V.currentRow.height+q.size.y>=V.canvas.height){let O;for(let z of this._activePages)if(z.currentRow.y+z.currentRow.height+q.size.y<z.canvas.height){O=z;break}if(O)V=O;else if(Wa.maxAtlasPages&&this._pages.length>=Wa.maxAtlasPages&&D.y+q.size.y<=V.canvas.height&&D.height>=q.size.y&&D.x+q.size.x<=V.canvas.width)P=!0;else{let z=this._createNewPage();V=z,D=z.currentRow,D.height=q.size.y,P=!0}}P||(V.currentRow.height>0&&V.fixedRows.push(V.currentRow),D={x:0,y:V.currentRow.y+V.currentRow.height,height:q.size.y},V.fixedRows.push(D),V.currentRow={x:0,y:D.y+D.height,height:0})}if(D.x+q.size.x<=V.canvas.width)break;D===V.currentRow?(D.x=0,D.y+=D.height,D.height=0):V.fixedRows.splice(V.fixedRows.indexOf(D),1)}return q.texturePage=this._pages.indexOf(V),q.texturePosition.x=D.x,q.texturePosition.y=D.y,q.texturePositionClipSpace.x=D.x/V.canvas.width,q.texturePositionClipSpace.y=D.y/V.canvas.height,q.sizeClipSpace.x/=V.canvas.width,q.sizeClipSpace.y/=V.canvas.height,D.height=Math.max(D.height,q.size.y),D.x+=q.size.x,V.ctx.putImageData(X,q.texturePosition.x-this._workBoundingBox.left,q.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,q.size.x,q.size.y),V.addGlyph(q),V.version++,q}_findGlyphBoundingBox(n,r,a,o,g,_){r.top=0;let c=o?this._config.deviceCellHeight:this._tmpCanvas.height,u=o?this._config.deviceCellWidth:a,d=!1;for(let b=0;b<c;b++){for(let p=0;p<u;p++){let w=b*this._tmpCanvas.width*4+p*4+3;if(n.data[w]!==0){r.top=b,d=!0;break}}if(d)break}r.left=0,d=!1;for(let b=0;b<_+u;b++){for(let p=0;p<c;p++){let w=p*this._tmpCanvas.width*4+b*4+3;if(n.data[w]!==0){r.left=b,d=!0;break}}if(d)break}r.right=u,d=!1;for(let b=_+u-1;b>=_;b--){for(let p=0;p<c;p++){let w=p*this._tmpCanvas.width*4+b*4+3;if(n.data[w]!==0){r.right=b,d=!0;break}}if(d)break}r.bottom=c,d=!1;for(let b=c-1;b>=0;b--){for(let p=0;p<u;p++){let w=b*this._tmpCanvas.width*4+p*4+3;if(n.data[w]!==0){r.bottom=b,d=!0;break}}if(d)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:r.right-r.left+1,y:r.bottom-r.top+1},sizeClipSpace:{x:r.right-r.left+1,y:r.bottom-r.top+1},offset:{x:-r.left+_+(o||g?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-r.top+_+(o||g?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}},Hf=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=Iw(e,n,n),this.ctx=mn(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 $f(e,n,r,a){let o=n.rgba>>>24,g=n.rgba>>>16&255,_=n.rgba>>>8&255,c=r.rgba>>>24,u=r.rgba>>>16&255,d=r.rgba>>>8&255,b=Math.floor((Math.abs(o-c)+Math.abs(g-u)+Math.abs(_-d))/12),p=!0;for(let w=0;w<e.data.length;w+=4)e.data[w]===o&&e.data[w+1]===g&&e.data[w+2]===_||a&&Math.abs(e.data[w]-o)+Math.abs(e.data[w+1]-g)+Math.abs(e.data[w+2]-_)<b?e.data[w+3]=0:p=!1;return p}function rL(e){for(let n=0;n<e.data.length;n+=4)if(e.data[n+3]>0)return!1;return!0}function Iw(e,n,r){let a=e.createElement("canvas");return a.width=n,a.height=r,a}function sL(e,n,r,a,o,g,_,c){let u={foreground:g.foreground,background:g.background,cursor:Oi,cursorAccent:Oi,selectionForeground:Oi,selectionBackgroundTransparent:Oi,selectionBackgroundOpaque:Oi,selectionInactiveBackgroundTransparent:Oi,selectionInactiveBackgroundOpaque:Oi,overviewRulerBorder:Oi,scrollbarSliderBackground:Oi,scrollbarSliderHoverBackground:Oi,scrollbarSliderActiveBackground:Oi,ansi:g.ansi.slice(),contrastCache:g.contrastCache,halfContrastCache:g.halfContrastCache};return{customGlyphs:o.customGlyphs,devicePixelRatio:_,deviceMaxTextureSize:c,letterSpacing:o.letterSpacing,lineHeight:o.lineHeight,deviceCellWidth:e,deviceCellHeight:n,deviceCharWidth:r,deviceCharHeight:a,fontFamily:o.fontFamily,fontSize:o.fontSize,fontWeight:o.fontWeight,fontWeightBold:o.fontWeightBold,allowTransparency:o.allowTransparency,drawBoldTextInBrightColors:o.drawBoldTextInBrightColors,minimumContrastRatio:o.minimumContrastRatio,colors:u}}function Q1(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 aL(e){return(e&50331648)===16777216||(e&50331648)===33554432}var ji=[];function Pw(e,n,r,a,o,g,_,c,u){let d=sL(a,o,g,_,n,r,c,u);for(let w=0;w<ji.length;w++){let C=ji[w],A=C.ownedBy.indexOf(e);if(A>=0){if(Q1(C.config,d))return C.atlas;C.ownedBy.length===1?(C.atlas.dispose(),ji.splice(w,1)):C.ownedBy.splice(A,1);break}}for(let w=0;w<ji.length;w++){let C=ji[w];if(Q1(C.config,d))return C.ownedBy.push(e),C.atlas}let b=e._core,p={atlas:new ms(document,d,b.unicodeService),config:d,ownedBy:[e]};return ji.push(p),p.atlas}function eb(e){for(let n=0;n<ji.length;n++){let r=ji[n].ownedBy.indexOf(e);if(r!==-1){ji[n].ownedBy.length===1?(ji[n].atlas.dispose(),ji.splice(n,1)):ji[n].ownedBy.splice(r,1);break}}}var mu=600,oL=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=mu){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let n=mu-(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=mu-(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})},mu)},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 tb(e,n,r){let a=new n.ResizeObserver(o=>{let g=o.find(u=>u.target===e);if(!g)return;if(!("devicePixelContentBoxSize"in g)){a?.disconnect(),a=void 0;return}let _=g.devicePixelContentBoxSize[0].inlineSize,c=g.devicePixelContentBoxSize[0].blockSize;_>0&&c>0&&r(_,c)});try{a.observe(e,{box:["device-pixel-content-box"]})}catch{a.disconnect(),a=void 0}return $n(()=>a?.disconnect())}function lL(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}var nb=class zw extends Va{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Mw,this.combinedData=""}static fromCharData(n){let r=new zw;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?lL(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()]}},Hw=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function $w(e,n,r){let a=mn(e.createProgram());if(e.attachShader(a,mn(ib(e,e.VERTEX_SHADER,n))),e.attachShader(a,mn(ib(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 ib(e,n,r){let a=mn(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 cL(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 uL=class{constructor(e){this.texture=e,this.version=-1}},hL=`#version 300 es
18
+ layout (location = 0) in vec2 a_unitquad;
19
+ layout (location = 1) in vec2 a_cellpos;
20
+ layout (location = 2) in vec2 a_offset;
21
+ layout (location = 3) in vec2 a_size;
22
+ layout (location = 4) in float a_texpage;
23
+ layout (location = 5) in vec2 a_texcoord;
24
+ layout (location = 6) in vec2 a_texsize;
25
+
26
+ uniform mat4 u_projection;
27
+ uniform vec2 u_resolution;
28
+
29
+ out vec2 v_texcoord;
30
+ flat out int v_texpage;
31
+
32
+ void main() {
33
+ vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
34
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
35
+ v_texpage = int(a_texpage);
36
+ v_texcoord = a_texcoord + a_unitquad * a_texsize;
37
+ }`;function dL(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
38
+ precision lowp float;
39
+
40
+ in vec2 v_texcoord;
41
+ flat in int v_texpage;
42
+
43
+ uniform sampler2D u_texture[${e}];
44
+
45
+ out vec4 outColor;
46
+
47
+ void main() {
48
+ if (v_texpage == 0) {
49
+ outColor = texture(u_texture[0], v_texcoord);
50
+ } ${n}
51
+ }`}var _s=11,za=_s*Float32Array.BYTES_PER_ELEMENT,fL=2,nn=0,zt,Uf=0,pl=0,pL=class extends Zi{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;ms.maxAtlasPages===void 0&&(ms.maxAtlasPages=Math.min(32,mn(o.getParameter(o.MAX_TEXTURE_IMAGE_UNITS))),ms.maxTextureSize=mn(o.getParameter(o.MAX_TEXTURE_SIZE))),this._program=mn($w(o,hL,dL(ms.maxAtlasPages))),this._register($n(()=>o.deleteProgram(this._program))),this._projectionLocation=mn(o.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=mn(o.getUniformLocation(this._program,"u_resolution")),this._textureLocation=mn(o.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=o.createVertexArray(),o.bindVertexArray(this._vertexArrayObject);let g=new Float32Array([0,0,1,0,0,1,1,1]),_=o.createBuffer();this._register($n(()=>o.deleteBuffer(_))),o.bindBuffer(o.ARRAY_BUFFER,_),o.bufferData(o.ARRAY_BUFFER,g,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($n(()=>o.deleteBuffer(u))),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,u),o.bufferData(o.ELEMENT_ARRAY_BUFFER,c,o.STATIC_DRAW),this._attributesBuffer=mn(o.createBuffer()),this._register($n(()=>o.deleteBuffer(this._attributesBuffer))),o.bindBuffer(o.ARRAY_BUFFER,this._attributesBuffer),o.enableVertexAttribArray(2),o.vertexAttribPointer(2,2,o.FLOAT,!1,za,0),o.vertexAttribDivisor(2,1),o.enableVertexAttribArray(3),o.vertexAttribPointer(3,2,o.FLOAT,!1,za,2*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(3,1),o.enableVertexAttribArray(4),o.vertexAttribPointer(4,1,o.FLOAT,!1,za,4*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(4,1),o.enableVertexAttribArray(5),o.vertexAttribPointer(5,2,o.FLOAT,!1,za,5*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(5,1),o.enableVertexAttribArray(6),o.vertexAttribPointer(6,2,o.FLOAT,!1,za,7*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(6,1),o.enableVertexAttribArray(1),o.vertexAttribPointer(1,2,o.FLOAT,!1,za,9*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(1,1),o.useProgram(this._program);let d=new Int32Array(ms.maxAtlasPages);for(let b=0;b<ms.maxAtlasPages;b++)d[b]=b;o.uniform1iv(this._textureLocation,d),o.uniformMatrix4fv(this._projectionLocation,!1,Hw),this._atlasTextures=[];for(let b=0;b<ms.maxAtlasPages;b++){let p=new uL(mn(o.createTexture()));this._register($n(()=>o.deleteTexture(p.texture))),o.activeTexture(o.TEXTURE0+b),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[b]=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,g,_,c,u){this._updateCell(this._vertices.attributes,e,n,r,a,o,g,_,c,u)}_updateCell(e,n,r,a,o,g,_,c,u,d){if(nn=(r*this._terminal.cols+n)*_s,a===0||a===void 0){e.fill(0,nn,nn+_s-1-fL);return}this._atlas&&(c&&c.length>1?zt=this._atlas.getRasterizedGlyphCombinedChar(c,o,g,_,!1,this._terminal.element):zt=this._atlas.getRasterizedGlyph(a,o,g,_,!1,this._terminal.element),Uf=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),o!==d&&zt.offset.x>Uf?(pl=zt.offset.x-Uf,e[nn]=-(zt.offset.x-pl)+this._dimensions.device.char.left,e[nn+1]=-zt.offset.y+this._dimensions.device.char.top,e[nn+2]=(zt.size.x-pl)/this._dimensions.device.canvas.width,e[nn+3]=zt.size.y/this._dimensions.device.canvas.height,e[nn+4]=zt.texturePage,e[nn+5]=zt.texturePositionClipSpace.x+pl/this._atlas.pages[zt.texturePage].canvas.width,e[nn+6]=zt.texturePositionClipSpace.y,e[nn+7]=zt.sizeClipSpace.x-pl/this._atlas.pages[zt.texturePage].canvas.width,e[nn+8]=zt.sizeClipSpace.y):(e[nn]=-zt.offset.x+this._dimensions.device.char.left,e[nn+1]=-zt.offset.y+this._dimensions.device.char.top,e[nn+2]=zt.size.x/this._dimensions.device.canvas.width,e[nn+3]=zt.size.y/this._dimensions.device.canvas.height,e[nn+4]=zt.texturePage,e[nn+5]=zt.texturePositionClipSpace.x,e[nn+6]=zt.texturePositionClipSpace.y,e[nn+7]=zt.sizeClipSpace.x,e[nn+8]=zt.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&L3(a,u,zt.size.x,this._dimensions.device.cell.width)&&(e[nn+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let e=this._terminal,n=e.cols*e.rows*_s;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+=_s}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 g=o*this._terminal.cols*_s,_=this._vertices.attributes.subarray(g,g+e.lineLengths[o]*_s);r.set(_,a),a+=_.length}n.bindBuffer(n.ARRAY_BUFFER,this._attributesBuffer),n.bufferData(n.ARRAY_BUFFER,r.subarray(0,a),n.STREAM_DRAW);for(let o=0;o<this._atlas.pages.length;o++)this._atlas.pages[o].version!==this._atlasTextures[o].version&&this._bindAtlasPageTexture(n,this._atlas,o);n.drawElementsInstanced(n.TRIANGLE_STRIP,4,n.UNSIGNED_BYTE,0,a/_s)}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}},gL=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,g=n[1]-o,_=r[1]-o,c=Math.max(g,0),u=Math.min(_,e.rows-1);if(c>=e.rows||u<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=a,this.viewportStartRow=g,this.viewportEndRow=_,this.viewportCappedStartRow=c,this.viewportCappedEndRow=u,this.startCol=n[0],this.endCol=r[0]}isCellSelected(e,n,r){return this.hasSelection?(r-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&r>=this.viewportCappedStartRow&&n<this.endCol&&r<=this.viewportCappedEndRow:n<this.startCol&&r>=this.viewportCappedStartRow&&n>=this.endCol&&r<=this.viewportCappedEndRow:r>this.viewportStartRow&&r<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&r===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportStartRow&&n>=this.startCol):!1}};function mL(){return new gL}var Wu=4,Mu=1,Nu=2,Ff=3,_L=2147483648,vL=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=mL()}resize(e,n){let r=e*n*Wu;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)}},bL=`#version 300 es
52
+ layout (location = 0) in vec2 a_position;
53
+ layout (location = 1) in vec2 a_size;
54
+ layout (location = 2) in vec4 a_color;
55
+ layout (location = 3) in vec2 a_unitquad;
56
+
57
+ uniform mat4 u_projection;
58
+
59
+ out vec4 v_color;
60
+
61
+ void main() {
62
+ vec2 zeroToOne = a_position + (a_unitquad * a_size);
63
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
64
+ v_color = a_color;
65
+ }`,yL=`#version 300 es
66
+ precision lowp float;
67
+
68
+ in vec4 v_color;
69
+
70
+ out vec4 outColor;
71
+
72
+ void main() {
73
+ outColor = v_color;
74
+ }`,Br=8,Wf=Br*Float32Array.BYTES_PER_ELEMENT,SL=20*Br,rb=class{constructor(){this.attributes=new Float32Array(SL),this.count=0}},Or=0,sb=0,ab=0,ob=0,lb=0,cb=0,ub=0,wL=class extends Zi{constructor(e,n,r,a){super(),this._terminal=e,this._gl=n,this._dimensions=r,this._themeService=a,this._vertices=new rb,this._verticesCursor=new rb;let o=this._gl;this._program=mn($w(o,bL,yL)),this._register($n(()=>o.deleteProgram(this._program))),this._projectionLocation=mn(o.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=o.createVertexArray(),o.bindVertexArray(this._vertexArrayObject);let g=new Float32Array([0,0,1,0,0,1,1,1]),_=o.createBuffer();this._register($n(()=>o.deleteBuffer(_))),o.bindBuffer(o.ARRAY_BUFFER,_),o.bufferData(o.ARRAY_BUFFER,g,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($n(()=>o.deleteBuffer(u))),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,u),o.bufferData(o.ELEMENT_ARRAY_BUFFER,c,o.STATIC_DRAW),this._attributesBuffer=mn(o.createBuffer()),this._register($n(()=>o.deleteBuffer(this._attributesBuffer))),o.bindBuffer(o.ARRAY_BUFFER,this._attributesBuffer),o.enableVertexAttribArray(0),o.vertexAttribPointer(0,2,o.FLOAT,!1,Wf,0),o.vertexAttribDivisor(0,1),o.enableVertexAttribArray(1),o.vertexAttribPointer(1,2,o.FLOAT,!1,Wf,2*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(1,1),o.enableVertexAttribArray(2),o.vertexAttribPointer(2,4,o.FLOAT,!1,Wf,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,Hw),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,g,_,c,u,d,b,p,w,C,A;for(o=0;o<n.rows;o++){for(_=-1,c=0,u=0,d=!1,g=0;g<n.cols;g++)b=(o*n.cols+g)*Wu,p=e.cells[b+Mu],w=e.cells[b+Nu],C=!!(w&67108864),(p!==c||w!==u&&(d||C))&&((c!==0||d&&u!==0)&&(A=a++*Br,this._updateRectangle(r,A,u,c,_,g,o)),_=g,c=p,u=w,d=C);(c!==0||d&&u!==0)&&(A=a++*Br,this._updateRectangle(r,A,u,c,_,n.cols,o))}r.count=a}updateCursor(e){let n=this._verticesCursor,r=e.cursor;if(!r||r.style==="block"){n.count=0;return}let a,o=0;(r.style==="bar"||r.style==="outline")&&(a=o++*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,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=cL(e.attributes,this._terminal.rows*this._terminal.cols*Br)),sb=o*this._dimensions.device.cell.width,ab=_*this._dimensions.device.cell.height,ob=(Or>>24&255)/255,lb=(Or>>16&255)/255,cb=(Or>>8&255)/255,ub=1,this._addRectangle(e.attributes,n,sb,ab,(g-o)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,ob,lb,cb,ub)}_addRectangle(e,n,r,a,o,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]=g/this._dimensions.device.canvas.height,e[n+4]=_,e[n+5]=c,e[n+6]=u,e[n+7]=d}_addRectangleFloat(e,n,r,a,o,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]=g/this._dimensions.device.canvas.height,e[n+4]=_[0],e[n+5]=_[1],e[n+6]=_[2],e[n+7]=_[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(e.rgba&255)/255])}},xL=class extends Zi{constructor(e,n,r,a,o,g,_,c){super(),this._container=n,this._alpha=o,this._coreBrowserService=g,this._optionsService=_,this._themeService=c,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${r}-layer`),this._canvas.style.zIndex=a.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(u=>{this._refreshCharAtlas(e,u),this.reset(e)})),this._register($n(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=mn(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=Pw(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=kw,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}`}},CL=class extends xL{constructor(e,n,r,a,o,g,_){super(r,e,"link",n,!0,o,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&&aL(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()}},Ks=typeof window=="object"?window:globalThis,Vp=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Ht,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Ht,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}};Vp.INSTANCE=new Vp;var Uw=Vp;function EL(e,n,r){typeof n=="string"&&(n=e.matchMedia(n)),n.addEventListener("change",r)}Uw.INSTANCE.onDidChangeZoomLevel;Uw.INSTANCE.onDidChangeFullscreen;var ho=typeof navigator=="object"?navigator.userAgent:"";ho.indexOf("Firefox")>=0;ho.indexOf("AppleWebKit")>=0;var kL=ho.indexOf("Chrome")>=0;!kL&&ho.indexOf("Safari")>=0;ho.indexOf("Electron/")>=0;ho.indexOf("Android")>=0;var Gf=!1;if(typeof Ks.matchMedia=="function"){let e=Ks.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),n=Ks.matchMedia("(display-mode: fullscreen)");Gf=e.matches,EL(Ks,e,({matches:r})=>{Gf&&n.matches||(Gf=r)})}var Ya="en",qf=!1,Fw=!1,_u,Ou=Ya,hb=Ya,AL,Dr,Qs=globalThis,vi;typeof Qs.vscode<"u"&&typeof Qs.vscode.process<"u"?vi=Qs.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(vi=process);var TL=typeof vi?.versions?.electron=="string",RL=TL&&vi?.type==="renderer";if(typeof vi=="object"){vi.platform,vi.platform,qf=vi.platform==="linux",qf&&vi.env.SNAP&&vi.env.SNAP_REVISION,vi.env.CI||vi.env.BUILD_ARTIFACTSTAGINGDIRECTORY,_u=Ya,Ou=Ya;let e=vi.env.VSCODE_NLS_CONFIG;if(e)try{let n=JSON.parse(e);_u=n.userLocale,hb=n.osLocale,Ou=n.resolvedLanguage||Ya,AL=n.languagePack?.translationsConfigFile}catch{}Fw=!0}else typeof navigator=="object"&&!RL?(Dr=navigator.userAgent,Dr.indexOf("Windows")>=0,Dr.indexOf("Macintosh")>=0,(Dr.indexOf("Macintosh")>=0||Dr.indexOf("iPad")>=0||Dr.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,qf=Dr.indexOf("Linux")>=0,Dr?.indexOf("Mobi")>=0,Ou=globalThis._VSCODE_NLS_LANGUAGE||Ya,_u=navigator.language.toLowerCase(),hb=_u):console.error("Unable to resolve platform.");var db=Fw,lr=Dr,ps=Ou,LL;(e=>{function n(){return ps}e.value=n;function r(){return ps.length===2?ps==="en":ps.length>=3?ps[0]==="e"&&ps[1]==="n"&&ps[2]==="-":!1}e.isDefaultVariant=r;function a(){return ps==="en"}e.isDefault=a})(LL||={});var ML=typeof Qs.postMessage=="function"&&!Qs.importScripts;(()=>{if(ML){let e=[];Qs.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let a=0,o=e.length;a<o;a++){let g=e[a];if(g.id===r.data.vscodeScheduleAsyncWork){e.splice(a,1),g.callback();return}}});let n=0;return r=>{let a=++n;e.push({id:a,callback:r}),Qs.postMessage({vscodeScheduleAsyncWork:a},"*")}}return e=>setTimeout(e)})();var NL=!!(lr&&lr.indexOf("Chrome")>=0);lr&&lr.indexOf("Firefox")>=0;!NL&&lr&&lr.indexOf("Safari")>=0;lr&&lr.indexOf("Edg/")>=0;lr&&lr.indexOf("Android")>=0;var Ha=typeof navigator=="object"?navigator:{};db||document.queryCommandSupported&&document.queryCommandSupported("copy")||Ha&&Ha.clipboard&&Ha.clipboard.writeText,db||Ha&&Ha.clipboard&&Ha.clipboard.readText;var tm=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}},Kf=new tm,fb=new tm,pb=new tm;new Array(230);var OL;(e=>{function n(c){return Kf.keyCodeToStr(c)}e.toString=n;function r(c){return Kf.strToKeyCode(c)}e.fromString=r;function a(c){return fb.keyCodeToStr(c)}e.toUserSettingsUS=a;function o(c){return pb.keyCodeToStr(c)}e.toUserSettingsGeneral=o;function g(c){return fb.strToKeyCode(c)||pb.strToKeyCode(c)}e.fromUserSettings=g;function _(c){if(c>=98&&c<=113)return null;switch(c){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Kf.keyCodeToStr(c)}e.toElectronAccelerator=_})(OL||={});var Ww=Object.freeze(function(e,n){let r=setTimeout(e.bind(n),0);return{dispose(){clearTimeout(r)}}}),DL;(e=>{function n(r){return r===e.None||r===e.Cancelled||r instanceof BL?!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:Ww})})(DL||={});var BL=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?Ww:(this._emitter||(this._emitter=new Ht),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},jL;(e=>{async function n(a){let o,g=await Promise.all(a.map(_=>_.then(c=>c,c=>{o||(o=c)})));if(typeof o<"u")throw o;return g}e.settled=n;function r(a){return new Promise(async(o,g)=>{try{await a(o,g)}catch(_){g(_)}})}e.withAsyncBody=r})(jL||={});var gb=class Di{static fromArray(n){return new Di(r=>{r.emitMany(n)})}static fromPromise(n){return new Di(async r=>{r.emitMany(await n)})}static fromPromises(n){return new Di(async r=>{await Promise.all(n.map(async a=>r.emitOne(await a)))})}static merge(n){return new Di(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 Ht,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 Di(async a=>{for await(let o of n)a.emitOne(r(o))})}map(n){return Di.map(this,n)}static filter(n,r){return new Di(async a=>{for await(let o of n)r(o)&&a.emitOne(o)})}filter(n){return Di.filter(this,n)}static coalesce(n){return Di.filter(n,r=>!!r)}coalesce(){return Di.coalesce(this)}static async toPromise(n){let r=[];for await(let a of n)r.push(a);return r}toPromise(){return Di.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())}};gb.EMPTY=gb.fromArray([]);var{getWindow:IL}=(function(){let e=new Map,n={window:Ks,disposables:new no};e.set(Ks.vscodeWindowId,n);let r=new Ht,a=new Ht,o=new Ht;function g(_,c){return(typeof _=="number"?e.get(_):void 0)??(c?n:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:o.event,onDidUnregisterWindow:a.event,registerWindow(_){if(e.has(_.vscodeWindowId))return Zi.None;let c=new no,u={window:_,disposables:c.add(new no)};return e.set(_.vscodeWindowId,u),c.add($n(()=>{e.delete(_.vscodeWindowId),a.fire(_)})),c.add(Yp(_,zL.BEFORE_UNLOAD,()=>{o.fire(_)})),r.fire(u),c},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(_){return _.vscodeWindowId},hasWindow(_){return e.has(_)},getWindowById:g,getWindow(_){let c=_;if(c?.ownerDocument?.defaultView)return c.ownerDocument.defaultView.window;let u=_;return u?.view?u.view.window:Ks},getDocument(_){return IL(_).document}}})(),PL=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 Yp(e,n,r,a){return new PL(e,n,r,a)}var zL={BEFORE_UNLOAD:"beforeunload"},HL=class extends Zi{constructor(e,n,r,a,o,g,_,c,u){super(),this._terminal=e,this._characterJoinerService=n,this._charSizeService=r,this._coreBrowserService=a,this._coreService=o,this._decorationService=g,this._optionsService=_,this._themeService=c,this._cursorBlinkStateManager=new hl,this._charAtlasDisposable=this._register(new hl),this._observerDisposable=this._register(new hl),this._model=new vL,this._workCell=new nb,this._workCell2=new nb,this._rectangleRenderer=this._register(new hl),this._glyphRenderer=this._register(new hl),this._onChangeTextureAtlas=this._register(new Ht),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Ht),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Ht),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Ht),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Ht),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 O3(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new CL(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,_,this._themeService)],this.dimensions=M3(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(_.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(Yp(this._canvas,"webglcontextlost",b=>{console.log("webglcontextlost event received"),b.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(b)},3e3)})),this._register(Yp(this._canvas,"webglcontextrestored",b=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,eb(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=tb(this._canvas,this._coreBrowserService.window,(b,p)=>this._setCanvasDevicePixelDimensions(b,p)),this._register(this._coreBrowserService.onWindowChange(b=>{this._observerDisposable.value=tb(this._canvas,b,(p,w)=>this._setCanvasDevicePixelDimensions(p,w))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register($n(()=>{for(let b of this._renderLayers)b.dispose();this._canvas.parentElement?.removeChild(this._canvas),eb(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 wL(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new pL(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=Pw(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=Sw(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 oL(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,n){let r=this._core,a=this._workCell,o,g,_,c,u,d,b=0,p=!0,w,C,A,E,f,y,m,S,k;e=mb(e,r.rows-1,0),n=mb(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,T=Math.min(this._terminal.buffer.active.cursorX,r.cols-1),I=-1,K=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let F=!1;for(g=e;g<=n;g++)for(_=g+r.buffer.ydisp,c=r.buffer.lines.get(_),this._model.lineLengths[g]=0,A=R===_,b=0,u=this._characterJoinerService.getJoinedCharacters(_),S=0;S<r.cols;S++){if(o=this._cellColorResolver.result.bg,c.loadCell(S,a),S===0&&(o=this._cellColorResolver.result.bg),d=!1,p=S>=b,w=S,u.length>0&&S===u[0][0]&&p){C=u.shift();let G=this._model.selection.isCellSelected(this._terminal,C[0],_);for(m=C[0]+1;m<C[1];m++)p&&=G===this._model.selection.isCellSelected(this._terminal,m,_);p&&=!A||T<C[0]||T>=C[1],p?(d=!0,a=new $L(a,c.translateToString(!0,C[0],C[1]),C[1]-C[0]),w=C[1]-1):b=C[1]}if(E=a.getChars(),f=a.getCode(),m=(g*r.cols+S)*Wu,this._cellColorResolver.resolve(a,S,_,this.dimensions.device.cell.width),K&&_===R&&(S===T&&(this._model.cursor={x:T,y:M,width:a.getWidth(),style:this._coreBrowserService.isFocused?L:r.options.cursorInactiveStyle,cursorWidth:r.options.cursorWidth,dpr:this._devicePixelRatio},I=T+a.getWidth()-1),S>=T&&S<=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)),f!==0&&(this._model.lineLengths[g]=S+1),!(this._model.cells[m]===f&&this._model.cells[m+Mu]===this._cellColorResolver.result.bg&&this._model.cells[m+Nu]===this._cellColorResolver.result.fg&&this._model.cells[m+Ff]===this._cellColorResolver.result.ext)&&(F=!0,E.length>1&&(f|=_L),this._model.cells[m]=f,this._model.cells[m+Mu]=this._cellColorResolver.result.bg,this._model.cells[m+Nu]=this._cellColorResolver.result.fg,this._model.cells[m+Ff]=this._cellColorResolver.result.ext,y=a.getWidth(),this._glyphRenderer.value.updateCell(S,g,f,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,E,y,o),d)){for(a=this._workCell,S++;S<=w;S++)k=(g*r.cols+S)*Wu,this._glyphRenderer.value.updateCell(S,g,0,0,0,0,C3,0,0),this._model.cells[k]=0,this._model.cells[k+Mu]=this._cellColorResolver.result.bg,this._model.cells[k+Nu]=this._cellColorResolver.result.fg,this._model.cells[k+Ff]=this._cellColorResolver.result.ext;S--}}F&&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})}},$L=class extends Va{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 mb(e,n,r=0){return Math.max(Math.min(e,n),r)}var _b="di$target",vb="di$dependencies",Vf=new Map;function ur(e){if(Vf.has(e))return Vf.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");UL(n,r,o)};return n._id=e,Vf.set(e,n),n}function UL(e,n,r){n[_b]===n?n[vb].push({id:e,index:r}):(n[vb]=[{id:e,index:r}],n[_b]=n)}ur("BufferService");ur("CoreMouseService");ur("CoreService");ur("CharsetService");ur("InstantiationService");ur("LogService");var FL=ur("OptionsService");ur("OscLinkService");ur("UnicodeService");ur("DecorationService");var WL={trace:0,debug:1,info:2,warn:3,error:4,off:5},GL="xterm.js: ",bb=class extends Zi{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=WL[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?"":GL)+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)}};bb=d3([f3(0,FL)],bb);var qL=class extends Zi{constructor(e){if(Cw&&x3()<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 Ht),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Ht),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Ht),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new Ht),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,g=o._renderService,_=o._characterJoinerService,c=o._charSizeService,u=o._coreBrowserService,d=o._decorationService;o._logService;let b=o._themeService;this._renderer=this._register(new HL(e,_,c,u,r,d,a,b,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)),g.setRenderer(this._renderer),this._register($n(()=>{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()}},Yf={exports:{}},yb;function KL(){return yb||(yb=1,(function(e,n){(function(r,a){e.exports=a()})(globalThis,(()=>(()=>{var r={4567:function(_,c,u){var d=this&&this.__decorate||function(m,S,k,L){var R,M=arguments.length,T=M<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,k):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(m,S,k,L);else for(var I=m.length-1;I>=0;I--)(R=m[I])&&(T=(M<3?R(T):M>3?R(S,k,T):R(S,k))||T);return M>3&&T&&Object.defineProperty(S,k,T),T},b=this&&this.__param||function(m,S){return function(k,L){S(k,L,m)}};Object.defineProperty(c,"__esModule",{value:!0}),c.AccessibilityManager=void 0;const p=u(9042),w=u(9924),C=u(844),A=u(4725),E=u(2585),f=u(3656);let y=c.AccessibilityManager=class extends C.Disposable{constructor(m,S,k,L){super(),this._terminal=m,this._coreBrowserService=k,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 w.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(`
75
+ `)))),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,f.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,C.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(m){for(let S=0;S<m;S++)this._handleChar(" ")}_handleChar(m){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==m&&(this._charsToAnnounce+=m):this._charsToAnnounce+=m,m===`
76
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=p.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(m){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(m)||this._charsToConsume.push(m)}_refreshRows(m,S){this._liveRegionDebouncer.refresh(m,S,this._terminal.rows)}_renderRows(m,S){const k=this._terminal.buffer,L=k.lines.length.toString();for(let R=m;R<=S;R++){const M=k.lines.get(k.ydisp+R),T=[],I=M?.translateToString(!0,void 0,void 0,T)||"",K=(k.ydisp+R+1).toString(),F=this._rowElements[R];F&&(I.length===0?(F.innerText=" ",this._rowColumns.set(F,[0,1])):(F.textContent=I,this._rowColumns.set(F,T)),F.setAttribute("aria-posinset",K),F.setAttribute("aria-setsize",L))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(m,S){const k=m.target,L=this._rowElements[S===0?1:this._rowElements.length-2];if(k.getAttribute("aria-posinset")===(S===0?"1":`${this._terminal.buffer.lines.length}`)||m.relatedTarget!==L)return;let R,M;if(S===0?(R=k,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(R=this._rowElements.shift(),M=k,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),M.removeEventListener("focus",this._bottomBoundaryFocusListener),S===0){const T=this._createAccessibilityTreeNode();this._rowElements.unshift(T),this._rowContainer.insertAdjacentElement("afterbegin",T)}else{const T=this._createAccessibilityTreeNode();this._rowElements.push(T),this._rowContainer.appendChild(T)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(S===0?-1:1),this._rowElements[S===0?1:this._rowElements.length-2].focus(),m.preventDefault(),m.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const m=document.getSelection();if(!m)return;if(m.isCollapsed)return void(this._rowContainer.contains(m.anchorNode)&&this._terminal.clearSelection());if(!m.anchorNode||!m.focusNode)return void console.error("anchorNode and/or focusNode are null");let S={node:m.anchorNode,offset:m.anchorOffset},k={node:m.focusNode,offset:m.focusOffset};if((S.node.compareDocumentPosition(k.node)&Node.DOCUMENT_POSITION_PRECEDING||S.node===k.node&&S.offset>k.offset)&&([S,k]=[k,S]),S.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(S={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(S.node))return;const L=this._rowElements.slice(-1)[0];if(k.node.compareDocumentPosition(L)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(k={node:L,offset:L.textContent?.length??0}),!this._rowContainer.contains(k.node))return;const R=({node:I,offset:K})=>{const F=I instanceof Text?I.parentNode:I;let G=parseInt(F?.getAttribute("aria-posinset"),10)-1;if(isNaN(G))return console.warn("row is invalid. Race condition?"),null;const B=this._rowColumns.get(F);if(!B)return console.warn("columns is null. Race condition?"),null;let Y=K<B.length?B[K]:B.slice(-1)[0]+1;return Y>=this._terminal.cols&&(++G,Y=0),{row:G,column:Y}},M=R(S),T=R(k);if(M&&T){if(M.row>T.row||M.row===T.row&&M.column>=T.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(T.row-M.row)*this._terminal.cols-M.column+T.column)}}_handleResize(m){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let S=this._rowContainer.children.length;S<this._terminal.rows;S++)this._rowElements[S]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[S]);for(;this._rowElements.length>m;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const m=this._coreBrowserService.mainDocument.createElement("div");return m.setAttribute("role","listitem"),m.tabIndex=-1,this._refreshRowDimensions(m),m}_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 m=0;m<this._terminal.rows;m++)this._refreshRowDimensions(this._rowElements[m])}}_refreshRowDimensions(m){m.style.height=`${this._renderService.dimensions.css.cell.height}px`}};c.AccessibilityManager=y=d([b(1,E.IInstantiationService),b(2,A.ICoreBrowserService),b(3,A.IRenderService)],y)},3614:(_,c)=>{function u(w){return w.replace(/\r?\n/g,"\r")}function d(w,C){return C?"\x1B[200~"+w+"\x1B[201~":w}function b(w,C,A,E){w=d(w=u(w),A.decPrivateModes.bracketedPasteMode&&E.rawOptions.ignoreBracketedPasteMode!==!0),A.triggerDataEvent(w,!0),C.value=""}function p(w,C,A){const E=A.getBoundingClientRect(),f=w.clientX-E.left-10,y=w.clientY-E.top-10;C.style.width="20px",C.style.height="20px",C.style.left=`${f}px`,C.style.top=`${y}px`,C.style.zIndex="1000",C.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(w,C){w.clipboardData&&w.clipboardData.setData("text/plain",C.selectionText),w.preventDefault()},c.handlePasteEvent=function(w,C,A,E){w.stopPropagation(),w.clipboardData&&b(w.clipboardData.getData("text/plain"),C,A,E)},c.paste=b,c.moveTextAreaUnderMouseCursor=p,c.rightClickHandler=function(w,C,A,E,f){p(w,C,A),f&&E.rightClickSelect(w),C.value=E.selectionText,C.select()}},7239:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ColorContrastCache=void 0;const d=u(1505);c.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(b,p,w){this._css.set(b,p,w)}getCss(b,p){return this._css.get(b,p)}setColor(b,p,w){this._color.set(b,p,w)}getColor(b,p){return this._color.get(b,p)}clear(){this._color.clear(),this._css.clear()}}},3656:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.addDisposableDomListener=void 0,c.addDisposableDomListener=function(u,d,b,p){u.addEventListener(d,b,p);let w=!1;return{dispose:()=>{w||(w=!0,u.removeEventListener(d,b,p))}}}},3551:function(_,c,u){var d=this&&this.__decorate||function(y,m,S,k){var L,R=arguments.length,M=R<3?m:k===null?k=Object.getOwnPropertyDescriptor(m,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,m,S,k);else for(var T=y.length-1;T>=0;T--)(L=y[T])&&(M=(R<3?L(M):R>3?L(m,S,M):L(m,S))||M);return R>3&&M&&Object.defineProperty(m,S,M),M},b=this&&this.__param||function(y,m){return function(S,k){m(S,k,y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Linkifier=void 0;const p=u(3656),w=u(8460),C=u(844),A=u(2585),E=u(4725);let f=c.Linkifier=class extends C.Disposable{get currentLink(){return this._currentLink}constructor(y,m,S,k,L){super(),this._element=y,this._mouseService=m,this._renderService=S,this._bufferService=k,this._linkProviderService=L,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new w.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new w.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,C.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,C.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 m=this._positionFromMouseEvent(y,this._element,this._mouseService);if(!m)return;this._isMouseOut=!1;const S=y.composedPath();for(let k=0;k<S.length;k++){const L=S[k];if(L.classList.contains("xterm"))break;if(L.classList.contains("xterm-hover"))return}this._lastBufferCell&&m.x===this._lastBufferCell.x&&m.y===this._lastBufferCell.y||(this._handleHover(m),this._lastBufferCell=m)}_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,m){this._activeProviderReplies&&m||(this._activeProviderReplies?.forEach((k=>{k?.forEach((L=>{L.link.dispose&&L.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=y.y);let S=!1;for(const[k,L]of this._linkProviderService.linkProviders.entries())m?this._activeProviderReplies?.get(k)&&(S=this._checkLinkProviderResult(k,y,S)):L.provideLinks(y.y,(R=>{if(this._isMouseOut)return;const M=R?.map((T=>({link:T})));this._activeProviderReplies?.set(k,M),S=this._checkLinkProviderResult(k,y,S),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(y.y,this._activeProviderReplies)}))}_removeIntersectingLinks(y,m){const S=new Set;for(let k=0;k<m.size;k++){const L=m.get(k);if(L)for(let R=0;R<L.length;R++){const M=L[R],T=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 K=T;K<=I;K++){if(S.has(K)){L.splice(R--,1);break}S.add(K)}}}}_checkLinkProviderResult(y,m,S){if(!this._activeProviderReplies)return S;const k=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&&k){const R=k.find((M=>this._linkAtPosition(M.link,m)));R&&(S=!0,this._handleNewLink(R))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!S)for(let R=0;R<this._activeProviderReplies.size;R++){const M=this._activeProviderReplies.get(R)?.find((T=>this._linkAtPosition(T.link,m)));if(M){S=!0,this._handleNewLink(M);break}}return S}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(y){if(!this._currentLink)return;const m=this._positionFromMouseEvent(y,this._element,this._mouseService);m&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,m)&&this._currentLink.link.activate(y,this._currentLink.link.text)}_clearCurrentLink(y,m){this._currentLink&&this._lastMouseEvent&&(!y||!m||this._currentLink.link.range.start.y>=y&&this._currentLink.link.range.end.y<=m)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,C.disposeArray)(this._linkCacheDisposables))}_handleNewLink(y){if(!this._lastMouseEvent)return;const m=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);m&&this._linkAtPosition(y.link,m)&&(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:S=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==S&&(this._currentLink.state.decorations.pointerCursor=S,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",S))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:S=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==S&&(this._currentLink.state.decorations.underline=S,this._currentLink.state.isHovered&&this._fireUnderlineEvent(y.link,S))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((S=>{if(!this._currentLink)return;const k=S.start===0?0:S.start+1+this._bufferService.buffer.ydisp,L=this._bufferService.buffer.ydisp+1+S.end;if(this._currentLink.link.range.start.y>=k&&this._currentLink.link.range.end.y<=L&&(this._clearCurrentLink(k,L),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(y,m,S){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(m,!0),this._currentLink.state.decorations.pointerCursor&&y.classList.add("xterm-cursor-pointer")),m.hover&&m.hover(S,m.text)}_fireUnderlineEvent(y,m){const S=y.range,k=this._bufferService.buffer.ydisp,L=this._createLinkUnderlineEvent(S.start.x-1,S.start.y-k-1,S.end.x,S.end.y-k-1,void 0);(m?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(L)}_linkLeave(y,m,S){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(m,!1),this._currentLink.state.decorations.pointerCursor&&y.classList.remove("xterm-cursor-pointer")),m.leave&&m.leave(S,m.text)}_linkAtPosition(y,m){const S=y.range.start.y*this._bufferService.cols+y.range.start.x,k=y.range.end.y*this._bufferService.cols+y.range.end.x,L=m.y*this._bufferService.cols+m.x;return S<=L&&L<=k}_positionFromMouseEvent(y,m,S){const k=S.getCoords(y,m,this._bufferService.cols,this._bufferService.rows);if(k)return{x:k[0],y:k[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(y,m,S,k,L){return{x1:y,y1:m,x2:S,y2:k,cols:this._bufferService.cols,fg:L}}};c.Linkifier=f=d([b(1,E.IMouseService),b(2,E.IRenderService),b(3,A.IBufferService),b(4,E.ILinkProviderService)],f)},9042:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.tooMuchOutput=c.promptLabel=void 0,c.promptLabel="Terminal input",c.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(_,c,u){var d=this&&this.__decorate||function(E,f,y,m){var S,k=arguments.length,L=k<3?f:m===null?m=Object.getOwnPropertyDescriptor(f,y):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,f,y,m);else for(var R=E.length-1;R>=0;R--)(S=E[R])&&(L=(k<3?S(L):k>3?S(f,y,L):S(f,y))||L);return k>3&&L&&Object.defineProperty(f,y,L),L},b=this&&this.__param||function(E,f){return function(y,m){f(y,m,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkProvider=void 0;const p=u(511),w=u(2585);let C=c.OscLinkProvider=class{constructor(E,f,y){this._bufferService=E,this._optionsService=f,this._oscLinkService=y}provideLinks(E,f){const y=this._bufferService.buffer.lines.get(E-1);if(!y)return void f(void 0);const m=[],S=this._optionsService.rawOptions.linkHandler,k=new p.CellData,L=y.getTrimmedLength();let R=-1,M=-1,T=!1;for(let I=0;I<L;I++)if(M!==-1||y.hasContent(I)){if(y.loadCell(I,k),k.hasExtendedAttrs()&&k.extended.urlId){if(M===-1){M=I,R=k.extended.urlId;continue}T=k.extended.urlId!==R}else M!==-1&&(T=!0);if(T||M!==-1&&I===L-1){const K=this._oscLinkService.getLinkData(R)?.uri;if(K){const F={start:{x:M+1,y:E},end:{x:I+(T||I!==L-1?0:1),y:E}};let G=!1;if(!S?.allowNonHttpProtocols)try{const B=new URL(K);["http:","https:"].includes(B.protocol)||(G=!0)}catch{G=!0}G||m.push({text:K,range:F,activate:(B,Y)=>S?S.activate(B,Y,F):A(0,Y),hover:(B,Y)=>S?.hover?.(B,Y,F),leave:(B,Y)=>S?.leave?.(B,Y,F)})}T=!1,k.hasExtendedAttrs()&&k.extended.urlId?(M=I,R=k.extended.urlId):(M=-1,R=-1)}}f(m)}};function A(E,f){if(confirm(`Do you want to navigate to ${f}?
77
+
78
+ WARNING: This link could potentially be dangerous`)){const y=window.open();if(y){try{y.opener=null}catch{}y.location.href=f}else console.warn("Opening link blocked as opener could not be cleared")}}c.OscLinkProvider=C=d([b(0,w.IBufferService),b(1,w.IOptionsService),b(2,w.IOscLinkService)],C)},6193:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.RenderDebouncer=void 0,c.RenderDebouncer=class{constructor(u,d){this._renderCallback=u,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,d,b){this._rowCount=b,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;const d=u(3614),b=u(3656),p=u(3551),w=u(9042),C=u(3730),A=u(1680),E=u(3107),f=u(5744),y=u(2950),m=u(1296),S=u(428),k=u(4269),L=u(5114),R=u(8934),M=u(3230),T=u(9312),I=u(4725),K=u(6731),F=u(8055),G=u(8969),B=u(8460),Y=u(844),X=u(6114),H=u(8437),q=u(2584),V=u(7399),D=u(5941),P=u(9074),O=u(2585),z=u(5435),W=u(4567),Z=u(779);class ie extends G.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(te={}){super(te),this.browser=X,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new Y.MutableDisposable),this._onCursorMove=this.register(new B.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new B.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new B.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new B.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new B.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new B.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new B.EventEmitter),this._onBlur=this.register(new B.EventEmitter),this._onA11yCharEmitter=this.register(new B.EventEmitter),this._onA11yTabEmitter=this.register(new B.EventEmitter),this._onWillOpen=this.register(new B.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(P.DecorationService),this._instantiationService.setService(O.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Z.LinkProviderService),this._instantiationService.setService(I.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(C.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows((($,le)=>this.refresh($,le)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport(($=>this._reportWindowsOptions($)))),this.register(this._inputHandler.onColor(($=>this._handleColorEvent($)))),this.register((0,B.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,B.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,B.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,B.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(($=>this._afterResize($.cols,$.rows)))),this.register((0,Y.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(te){if(this._themeService)for(const $ of te){let le,ge="";switch($.index){case 256:le="foreground",ge="10";break;case 257:le="background",ge="11";break;case 258:le="cursor",ge="12";break;default:le="ansi",ge="4;"+$.index}switch($.type){case 0:const we=F.color.toColorRGB(le==="ansi"?this._themeService.colors.ansi[$.index]:this._themeService.colors[le]);this.coreService.triggerDataEvent(`${q.C0.ESC}]${ge};${(0,D.toRgbString)(we)}${q.C1_ESCAPED.ST}`);break;case 1:if(le==="ansi")this._themeService.modifyColors((Se=>Se.ansi[$.index]=F.channels.toColor(...$.color)));else{const Se=le;this._themeService.modifyColors((je=>je[Se]=F.channels.toColor(...$.color)))}break;case 2:this._themeService.restoreColor($.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(te){te?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(te){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(q.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(q.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 te=this.buffer.ybase+this.buffer.y,$=this.buffer.lines.get(te);if(!$)return;const le=Math.min(this.buffer.x,this.cols-1),ge=this._renderService.dimensions.css.cell.height,we=$.getWidth(le),Se=this._renderService.dimensions.css.cell.width*we,je=this.buffer.y*this._renderService.dimensions.css.cell.height,Ie=le*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ie+"px",this.textarea.style.top=je+"px",this.textarea.style.width=Se+"px",this.textarea.style.height=ge+"px",this.textarea.style.lineHeight=ge+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,b.addDisposableDomListener)(this.element,"copy",($=>{this.hasSelection()&&(0,d.copyHandler)($,this._selectionService)})));const te=$=>(0,d.handlePasteEvent)($,this.textarea,this.coreService,this.optionsService);this.register((0,b.addDisposableDomListener)(this.textarea,"paste",te)),this.register((0,b.addDisposableDomListener)(this.element,"paste",te)),X.isFirefox?this.register((0,b.addDisposableDomListener)(this.element,"mousedown",($=>{$.button===2&&(0,d.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,b.addDisposableDomListener)(this.element,"contextmenu",($=>{(0,d.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),X.isLinux&&this.register((0,b.addDisposableDomListener)(this.element,"auxclick",($=>{$.button===1&&(0,d.moveTextAreaUnderMouseCursor)($,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,b.addDisposableDomListener)(this.textarea,"keyup",(te=>this._keyUp(te)),!0)),this.register((0,b.addDisposableDomListener)(this.textarea,"keydown",(te=>this._keyDown(te)),!0)),this.register((0,b.addDisposableDomListener)(this.textarea,"keypress",(te=>this._keyPress(te)),!0)),this.register((0,b.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,b.addDisposableDomListener)(this.textarea,"compositionupdate",(te=>this._compositionHelper.compositionupdate(te)))),this.register((0,b.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,b.addDisposableDomListener)(this.textarea,"input",(te=>this._inputEvent(te)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(te){if(!te)throw new Error("Terminal requires a parent element.");if(te.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=te.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"),te.appendChild(this.element);const $=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),$.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,b.addDisposableDomListener)(this.screenElement,"mousemove",(le=>this.updateCursorStyle(le)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),$.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",w.promptLabel),X.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,te.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(I.ICoreBrowserService,this._coreBrowserService),this.register((0,b.addDisposableDomListener)(this.textarea,"focus",(le=>this._handleTextAreaFocus(le)))),this.register((0,b.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(S.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(I.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(K.ThemeService),this._instantiationService.setService(I.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(k.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((le=>this._onRender.fire(le)))),this.onResize((le=>this._renderService.resize(le.cols,le.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($);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((le=>this.scrollLines(le.amount,le.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(T.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(I.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((le=>this.scrollLines(le.amount,le.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((le=>this._renderService.handleSelectionChanged(le.start,le.end,le.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((le=>{this.textarea.value=le,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((le=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,b.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(E.BufferDecorationRenderer,this.screenElement)),this.register((0,b.addDisposableDomListener)(this.element,"mousedown",(le=>this._selectionService.handleMouseDown(le)))),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(W.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(le=>this._handleScreenReaderModeOptionChange(le)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(f.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(le=>{!this._overviewRulerRenderer&&le&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(f.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(m.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const te=this,$=this.element;function le(Se){const je=te._mouseService.getMouseReportCoords(Se,te.screenElement);if(!je)return!1;let Ie,Ge;switch(Se.overrideType||Se.type){case"mousemove":Ge=32,Se.buttons===void 0?(Ie=3,Se.button!==void 0&&(Ie=Se.button<3?Se.button:3)):Ie=1&Se.buttons?0:4&Se.buttons?1:2&Se.buttons?2:3;break;case"mouseup":Ge=0,Ie=Se.button<3?Se.button:3;break;case"mousedown":Ge=1,Ie=Se.button<3?Se.button:3;break;case"wheel":if(te._customWheelEventHandler&&te._customWheelEventHandler(Se)===!1||te.viewport.getLinesScrolled(Se)===0)return!1;Ge=Se.deltaY<0?0:1,Ie=4;break;default:return!1}return!(Ge===void 0||Ie===void 0||Ie>4)&&te.coreMouseService.triggerMouseEvent({col:je.col,row:je.row,x:je.x,y:je.y,button:Ie,action:Ge,ctrl:Se.ctrlKey,alt:Se.altKey,shift:Se.shiftKey})}const ge={mouseup:null,wheel:null,mousedrag:null,mousemove:null},we={mouseup:Se=>(le(Se),Se.buttons||(this._document.removeEventListener("mouseup",ge.mouseup),ge.mousedrag&&this._document.removeEventListener("mousemove",ge.mousedrag)),this.cancel(Se)),wheel:Se=>(le(Se),this.cancel(Se,!0)),mousedrag:Se=>{Se.buttons&&le(Se)},mousemove:Se=>{Se.buttons||le(Se)}};this.register(this.coreMouseService.onProtocolChange((Se=>{Se?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Se)),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&Se?ge.mousemove||($.addEventListener("mousemove",we.mousemove),ge.mousemove=we.mousemove):($.removeEventListener("mousemove",ge.mousemove),ge.mousemove=null),16&Se?ge.wheel||($.addEventListener("wheel",we.wheel,{passive:!1}),ge.wheel=we.wheel):($.removeEventListener("wheel",ge.wheel),ge.wheel=null),2&Se?ge.mouseup||(ge.mouseup=we.mouseup):(this._document.removeEventListener("mouseup",ge.mouseup),ge.mouseup=null),4&Se?ge.mousedrag||(ge.mousedrag=we.mousedrag):(this._document.removeEventListener("mousemove",ge.mousedrag),ge.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,b.addDisposableDomListener)($,"mousedown",(Se=>{if(Se.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Se))return le(Se),ge.mouseup&&this._document.addEventListener("mouseup",ge.mouseup),ge.mousedrag&&this._document.addEventListener("mousemove",ge.mousedrag),this.cancel(Se)}))),this.register((0,b.addDisposableDomListener)($,"wheel",(Se=>{if(!ge.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(Se)===!1)return!1;if(!this.buffer.hasScrollback){const je=this.viewport.getLinesScrolled(Se);if(je===0)return;const Ie=q.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Se.deltaY<0?"A":"B");let Ge="";for(let vt=0;vt<Math.abs(je);vt++)Ge+=Ie;return this.coreService.triggerDataEvent(Ge,!0),this.cancel(Se,!0)}return this.viewport.handleWheel(Se)?this.cancel(Se):void 0}}),{passive:!1})),this.register((0,b.addDisposableDomListener)($,"touchstart",(Se=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Se),this.cancel(Se)}),{passive:!0})),this.register((0,b.addDisposableDomListener)($,"touchmove",(Se=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Se)?void 0:this.cancel(Se)}),{passive:!1}))}refresh(te,$){this._renderService?.refreshRows(te,$)}updateCursorStyle(te){this._selectionService?.shouldColumnSelect(te)?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(te,$,le=0){le===1?(super.scrollLines(te,$,le),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(te)}paste(te){(0,d.paste)(te,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(te){this._customKeyEventHandler=te}attachCustomWheelEventHandler(te){this._customWheelEventHandler=te}registerLinkProvider(te){return this._linkProviderService.registerLinkProvider(te)}registerCharacterJoiner(te){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const $=this._characterJoinerService.register(te);return this.refresh(0,this.rows-1),$}deregisterCharacterJoiner(te){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(te)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(te){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+te)}registerDecoration(te){return this._decorationService.registerDecoration(te)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(te,$,le){this._selectionService.setSelection(te,$,le)}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(te,$){this._selectionService?.selectLines(te,$)}_keyDown(te){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(te)===!1)return!1;const $=this.browser.isMac&&this.options.macOptionIsMeta&&te.altKey;if(!$&&!this._compositionHelper.keydown(te))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;$||te.key!=="Dead"&&te.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const le=(0,V.evaluateKeyboardEvent)(te,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(te),le.type===3||le.type===2){const ge=this.rows-1;return this.scrollLines(le.type===2?-ge:ge),this.cancel(te,!0)}return le.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,te)||(le.cancel&&this.cancel(te,!0),!le.key||!!(te.key&&!te.ctrlKey&&!te.altKey&&!te.metaKey&&te.key.length===1&&te.key.charCodeAt(0)>=65&&te.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(le.key!==q.C0.ETX&&le.key!==q.C0.CR||(this.textarea.value=""),this._onKey.fire({key:le.key,domEvent:te}),this._showCursor(),this.coreService.triggerDataEvent(le.key,!0),!this.optionsService.rawOptions.screenReaderMode||te.altKey||te.ctrlKey?this.cancel(te,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(te,$){const le=te.isMac&&!this.options.macOptionIsMeta&&$.altKey&&!$.ctrlKey&&!$.metaKey||te.isWindows&&$.altKey&&$.ctrlKey&&!$.metaKey||te.isWindows&&$.getModifierState("AltGraph");return $.type==="keypress"?le:le&&(!$.keyCode||$.keyCode>47)}_keyUp(te){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(te)===!1||((function($){return $.keyCode===16||$.keyCode===17||$.keyCode===18})(te)||this.focus(),this.updateCursorStyle(te),this._keyPressHandled=!1)}_keyPress(te){let $;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(te)===!1)return!1;if(this.cancel(te),te.charCode)$=te.charCode;else if(te.which===null||te.which===void 0)$=te.keyCode;else{if(te.which===0||te.charCode===0)return!1;$=te.which}return!(!$||(te.altKey||te.ctrlKey||te.metaKey)&&!this._isThirdLevelShift(this.browser,te)||($=String.fromCharCode($),this._onKey.fire({key:$,domEvent:te}),this._showCursor(),this.coreService.triggerDataEvent($,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(te){if(te.data&&te.inputType==="insertText"&&(!te.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const $=te.data;return this.coreService.triggerDataEvent($,!0),this.cancel(te),!0}return!1}resize(te,$){te!==this.cols||$!==this.rows?super.resize(te,$):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(te,$){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 te=1;te<this.rows;te++)this.buffer.lines.push(this.buffer.getBlankLine(H.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 te=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=te,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(q.C0.ESC+"[I"):this.coreService.triggerDataEvent(q.C0.ESC+"[O")}_reportWindowsOptions(te){if(this._renderService)switch(te){case z.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const $=this._renderService.dimensions.css.canvas.width.toFixed(0),le=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${q.C0.ESC}[4;${le};${$}t`);break;case z.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ge=this._renderService.dimensions.css.cell.width.toFixed(0),we=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${q.C0.ESC}[6;${we};${ge}t`)}}cancel(te,$){if(this.options.cancelEvents||$)return te.preventDefault(),te.stopPropagation(),!1}}c.Terminal=ie},9924:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TimeBasedDebouncer=void 0,c.TimeBasedDebouncer=class{constructor(u,d=1e3){this._renderCallback=u,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,d,b){this._rowCount=b,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 w=p-this._lastRefreshMs,C=this._debounceThresholdMS-w;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),C)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d)}}},1680:function(_,c,u){var d=this&&this.__decorate||function(y,m,S,k){var L,R=arguments.length,M=R<3?m:k===null?k=Object.getOwnPropertyDescriptor(m,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,m,S,k);else for(var T=y.length-1;T>=0;T--)(L=y[T])&&(M=(R<3?L(M):R>3?L(m,S,M):L(m,S))||M);return R>3&&M&&Object.defineProperty(m,S,M),M},b=this&&this.__param||function(y,m){return function(S,k){m(S,k,y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Viewport=void 0;const p=u(3656),w=u(4725),C=u(8460),A=u(844),E=u(2585);let f=c.Viewport=class extends A.Disposable{constructor(y,m,S,k,L,R,M,T){super(),this._viewportElement=y,this._scrollArea=m,this._bufferService=S,this._optionsService=k,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 C.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(T.colors),this.register(T.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 m=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==m&&(this._lastRecordedBufferHeight=m,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 m=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:m,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,m){const S=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(m<0&&this._viewportElement.scrollTop!==0||m>0&&S<this._lastRecordedBufferHeight)||(y.cancelable&&y.preventDefault(),!1)}handleWheel(y){const m=this._getPixelsScrolled(y);return m!==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+m:this._smoothScrollState.target+=m,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=m,this._bubbleScroll(y,m))}scrollLines(y){if(y!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const m=y*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+m,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 m=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_LINE?m*=this._currentRowHeight:y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(m*=this._currentRowHeight*this._bufferService.rows),m}getBufferElements(y,m){let S,k="";const L=[],R=m??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let T=y;T<R;T++){const I=M.get(T);if(!I)continue;const K=M.get(T+1)?.isWrapped;if(k+=I.translateToString(!K),!K||T===M.length-1){const F=document.createElement("div");F.textContent=k,L.push(F),k.length>0&&(S=F),k=""}}return{bufferElements:L,cursorElement:S}}getLinesScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let m=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(m/=this._currentRowHeight+0,this._wheelPartialScroll+=m,m=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(m*=this._bufferService.rows),m}_applyScrollModifier(y,m){const S=this._optionsService.rawOptions.fastScrollModifier;return S==="alt"&&m.altKey||S==="ctrl"&&m.ctrlKey||S==="shift"&&m.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 m=this._lastTouchY-y.touches[0].pageY;return this._lastTouchY=y.touches[0].pageY,m!==0&&(this._viewportElement.scrollTop+=m,this._bubbleScroll(y,m))}};c.Viewport=f=d([b(2,E.IBufferService),b(3,E.IOptionsService),b(4,w.ICharSizeService),b(5,w.IRenderService),b(6,w.ICoreBrowserService),b(7,w.IThemeService)],f)},3107:function(_,c,u){var d=this&&this.__decorate||function(E,f,y,m){var S,k=arguments.length,L=k<3?f:m===null?m=Object.getOwnPropertyDescriptor(f,y):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,f,y,m);else for(var R=E.length-1;R>=0;R--)(S=E[R])&&(L=(k<3?S(L):k>3?S(f,y,L):S(f,y))||L);return k>3&&L&&Object.defineProperty(f,y,L),L},b=this&&this.__param||function(E,f){return function(y,m){f(y,m,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferDecorationRenderer=void 0;const p=u(4725),w=u(844),C=u(2585);let A=c.BufferDecorationRenderer=class extends w.Disposable{constructor(E,f,y,m,S){super(),this._screenElement=E,this._bufferService=f,this._coreBrowserService=y,this._decorationService=m,this._renderService=S,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((k=>this._removeDecoration(k)))),this.register((0,w.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 f=this._coreBrowserService.mainDocument.createElement("div");f.classList.add("xterm-decoration"),f.classList.toggle("xterm-decoration-top-layer",E?.options?.layer==="top"),f.style.width=`${Math.round((E.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,f.style.height=(E.options.height||1)*this._renderService.dimensions.css.cell.height+"px",f.style.top=(E.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",f.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const y=E.options.x??0;return y&&y>this._bufferService.cols&&(f.style.display="none"),this._refreshXPosition(E,f),f}_refreshStyle(E){const f=E.marker.line-this._bufferService.buffers.active.ydisp;if(f<0||f>=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=f*this._renderService.dimensions.css.cell.height+"px",y.style.display=this._altBufferIsActive?"none":"block",E.onRenderEmitter.fire(y)}}_refreshXPosition(E,f=E.element){if(!f)return;const y=E.options.x??0;(E.options.anchor||"left")==="right"?f.style.right=y?y*this._renderService.dimensions.css.cell.width+"px":"":f.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([b(1,C.IBufferService),b(2,p.ICoreBrowserService),b(3,C.IDecorationService),b(4,p.IRenderService)],A)},5871:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ColorZoneStore=void 0,c.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(u){if(u.options.overviewRulerOptions){for(const d of this._zones)if(d.color===u.options.overviewRulerOptions.color&&d.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,u.marker.line))return;if(this._lineAdjacentToZone(d,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(d,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,d){return d>=u.startBufferLine&&d<=u.endBufferLine}_lineAdjacentToZone(u,d,b){return d>=u.startBufferLine-this._linePadding[b||"full"]&&d<=u.endBufferLine+this._linePadding[b||"full"]}_addLineToZone(u,d){u.startBufferLine=Math.min(u.startBufferLine,d),u.endBufferLine=Math.max(u.endBufferLine,d)}}},5744:function(_,c,u){var d=this&&this.__decorate||function(S,k,L,R){var M,T=arguments.length,I=T<3?k:R===null?R=Object.getOwnPropertyDescriptor(k,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(S,k,L,R);else for(var K=S.length-1;K>=0;K--)(M=S[K])&&(I=(T<3?M(I):T>3?M(k,L,I):M(k,L))||I);return T>3&&I&&Object.defineProperty(k,L,I),I},b=this&&this.__param||function(S,k){return function(L,R){k(L,R,S)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OverviewRulerRenderer=void 0;const p=u(5871),w=u(4725),C=u(844),A=u(2585),E={full:0,left:0,center:0,right:0},f={full:0,left:0,center:0,right:0},y={full:0,left:0,center:0,right:0};let m=c.OverviewRulerRenderer=class extends C.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(S,k,L,R,M,T,I){super(),this._viewportElement=S,this._screenElement=k,this._bufferService=L,this._decorationService=R,this._renderService=M,this._optionsService=T,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 K=this._canvas.getContext("2d");if(!K)throw new Error("Ctx cannot be null");this._ctx=K,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,C.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 S=Math.floor(this._canvas.width/3),k=Math.ceil(this._canvas.width/3);f.full=this._canvas.width,f.left=S,f.center=k,f.right=S,this._refreshDrawHeightConstants(),y.full=0,y.left=0,y.center=f.left,y.right=f.left+f.center}_refreshDrawHeightConstants(){E.full=Math.round(2*this._coreBrowserService.dpr);const S=this._canvas.height/this._bufferService.buffer.lines.length,k=Math.round(Math.max(Math.min(S,12),6)*this._coreBrowserService.dpr);E.left=k,E.center=k,E.right=k}_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 k of this._decorationService.decorations)this._colorZoneStore.addDecoration(k);this._ctx.lineWidth=1;const S=this._colorZoneStore.zones;for(const k of S)k.position!=="full"&&this._renderColorZone(k);for(const k of S)k.position==="full"&&this._renderColorZone(k);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(S){this._ctx.fillStyle=S.color,this._ctx.fillRect(y[S.position||"full"],Math.round((this._canvas.height-1)*(S.startBufferLine/this._bufferService.buffers.active.lines.length)-E[S.position||"full"]/2),f[S.position||"full"],Math.round((this._canvas.height-1)*((S.endBufferLine-S.startBufferLine)/this._bufferService.buffers.active.lines.length)+E[S.position||"full"]))}_queueRefresh(S,k){this._shouldUpdateDimensions=S||this._shouldUpdateDimensions,this._shouldUpdateAnchor=k||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};c.OverviewRulerRenderer=m=d([b(2,A.IBufferService),b(3,A.IDecorationService),b(4,w.IRenderService),b(5,A.IOptionsService),b(6,w.ICoreBrowserService)],m)},2950:function(_,c,u){var d=this&&this.__decorate||function(E,f,y,m){var S,k=arguments.length,L=k<3?f:m===null?m=Object.getOwnPropertyDescriptor(f,y):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,f,y,m);else for(var R=E.length-1;R>=0;R--)(S=E[R])&&(L=(k<3?S(L):k>3?S(f,y,L):S(f,y))||L);return k>3&&L&&Object.defineProperty(f,y,L),L},b=this&&this.__param||function(E,f){return function(y,m){f(y,m,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CompositionHelper=void 0;const p=u(4725),w=u(2585),C=u(2584);let A=c.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(E,f,y,m,S,k){this._textarea=E,this._compositionView=f,this._bufferService=y,this._optionsService=m,this._coreService=S,this._renderService=k,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 f={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let y;this._isSendingComposition=!1,f.start+=this._dataAlreadySent.length,y=this._isComposing?this._textarea.value.substring(f.start,f.end):this._textarea.value.substring(f.start),y.length>0&&this._coreService.triggerDataEvent(y,!0)}}),0)}else{this._isSendingComposition=!1;const f=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(f,!0)}}_handleAnyTextareaChanges(){const E=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const f=this._textarea.value,y=f.replace(E,"");this._dataAlreadySent=y,f.length>E.length?this._coreService.triggerDataEvent(y,!0):f.length<E.length?this._coreService.triggerDataEvent(`${C.C0.DEL}`,!0):f.length===E.length&&f!==E&&this._coreService.triggerDataEvent(f,!0)}}),0)}updateCompositionElements(E){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const f=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),y=this._renderService.dimensions.css.cell.height,m=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,S=f*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=S+"px",this._compositionView.style.top=m+"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 k=this._compositionView.getBoundingClientRect();this._textarea.style.left=S+"px",this._textarea.style.top=m+"px",this._textarea.style.width=Math.max(k.width,1)+"px",this._textarea.style.height=Math.max(k.height,1)+"px",this._textarea.style.lineHeight=k.height+"px"}E||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};c.CompositionHelper=A=d([b(2,w.IBufferService),b(3,w.IOptionsService),b(4,w.ICoreService),b(5,p.IRenderService)],A)},9806:(_,c)=>{function u(d,b,p){const w=p.getBoundingClientRect(),C=d.getComputedStyle(p),A=parseInt(C.getPropertyValue("padding-left")),E=parseInt(C.getPropertyValue("padding-top"));return[b.clientX-w.left-A,b.clientY-w.top-E]}Object.defineProperty(c,"__esModule",{value:!0}),c.getCoords=c.getCoordsRelativeToElement=void 0,c.getCoordsRelativeToElement=u,c.getCoords=function(d,b,p,w,C,A,E,f,y){if(!A)return;const m=u(d,b,p);return m?(m[0]=Math.ceil((m[0]+(y?E/2:0))/E),m[1]=Math.ceil(m[1]/f),m[0]=Math.min(Math.max(m[0],1),w+(y?1:0)),m[1]=Math.min(Math.max(m[1],1),C),m):void 0}},9504:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.moveToCellSequence=void 0;const d=u(2584);function b(f,y,m,S){const k=f-p(f,m),L=y-p(y,m),R=Math.abs(k-L)-(function(M,T,I){let K=0;const F=M-p(M,I),G=T-p(T,I);for(let B=0;B<Math.abs(F-G);B++){const Y=w(M,T)==="A"?-1:1;I.buffer.lines.get(F+Y*B)?.isWrapped&&K++}return K})(f,y,m);return E(R,A(w(f,y),S))}function p(f,y){let m=0,S=y.buffer.lines.get(f),k=S?.isWrapped;for(;k&&f>=0&&f<y.rows;)m++,S=y.buffer.lines.get(--f),k=S?.isWrapped;return m}function w(f,y){return f>y?"A":"B"}function C(f,y,m,S,k,L){let R=f,M=y,T="";for(;R!==m||M!==S;)R+=k?1:-1,k&&R>L.cols-1?(T+=L.buffer.translateBufferLineToString(M,!1,f,R),R=0,f=0,M++):!k&&R<0&&(T+=L.buffer.translateBufferLineToString(M,!1,0,f+1),R=L.cols-1,f=R,M--);return T+L.buffer.translateBufferLineToString(M,!1,f,R)}function A(f,y){const m=y?"O":"[";return d.C0.ESC+m+f}function E(f,y){f=Math.floor(f);let m="";for(let S=0;S<f;S++)m+=y;return m}c.moveToCellSequence=function(f,y,m,S){const k=m.buffer.x,L=m.buffer.y;if(!m.buffer.hasScrollback)return(function(T,I,K,F,G,B){return b(I,F,G,B).length===0?"":E(C(T,I,T,I-p(I,G),!1,G).length,A("D",B))})(k,L,0,y,m,S)+b(L,y,m,S)+(function(T,I,K,F,G,B){let Y;Y=b(I,F,G,B).length>0?F-p(F,G):I;const X=F,H=(function(q,V,D,P,O,z){let W;return W=b(D,P,O,z).length>0?P-p(P,O):V,q<D&&W<=P||q>=D&&W<P?"C":"D"})(T,I,K,F,G,B);return E(C(T,Y,K,X,H==="C",G).length,A(H,B))})(k,L,f,y,m,S);let R;if(L===y)return R=k>f?"D":"C",E(Math.abs(k-f),A(R,S));R=L>y?"D":"C";const M=Math.abs(L-y);return E((function(T,I){return I.cols-T})(L>y?f:k,m)+(M-1)*m.cols+1+((L>y?k:f)-1),A(R,S))}},1296:function(_,c,u){var d=this&&this.__decorate||function(B,Y,X,H){var q,V=arguments.length,D=V<3?Y:H===null?H=Object.getOwnPropertyDescriptor(Y,X):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(B,Y,X,H);else for(var P=B.length-1;P>=0;P--)(q=B[P])&&(D=(V<3?q(D):V>3?q(Y,X,D):q(Y,X))||D);return V>3&&D&&Object.defineProperty(Y,X,D),D},b=this&&this.__param||function(B,Y){return function(X,H){Y(X,H,B)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRenderer=void 0;const p=u(3787),w=u(2550),C=u(2223),A=u(6171),E=u(6052),f=u(4725),y=u(8055),m=u(8460),S=u(844),k=u(2585),L="xterm-dom-renderer-owner-",R="xterm-rows",M="xterm-fg-",T="xterm-bg-",I="xterm-focus",K="xterm-selection";let F=1,G=c.DomRenderer=class extends S.Disposable{constructor(B,Y,X,H,q,V,D,P,O,z,W,Z,ie){super(),this._terminal=B,this._document=Y,this._element=X,this._screenElement=H,this._viewportElement=q,this._helperContainer=V,this._linkifier2=D,this._charSizeService=O,this._optionsService=z,this._bufferService=W,this._coreBrowserService=Z,this._themeService=ie,this._terminalClass=F++,this._rowElements=[],this._selectionRenderModel=(0,E.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new m.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(K),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,A.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((he=>this._injectCss(he)))),this._injectCss(this._themeService.colors),this._rowFactory=P.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((he=>this._handleLinkHover(he)))),this.register(this._linkifier2.onHideLinkUnderline((he=>this._handleLinkLeave(he)))),this.register((0,S.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 w.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 B=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*B,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*B),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/B),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/B),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 X of this._rowElements)X.style.width=`${this.dimensions.css.canvas.width}px`,X.style.height=`${this.dimensions.css.cell.height}px`,X.style.lineHeight=`${this.dimensions.css.cell.height}px`,X.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const Y=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=Y,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(B){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let Y=`${this._terminalSelector} .${R} { color: ${B.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;Y+=`${this._terminalSelector} .${R} .xterm-dim { color: ${y.color.multiplyOpacity(B.foreground,.5).css};}`,Y+=`${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 X=`blink_underline_${this._terminalClass}`,H=`blink_bar_${this._terminalClass}`,q=`blink_block_${this._terminalClass}`;Y+=`@keyframes ${X} { 50% { border-bottom-style: hidden; }}`,Y+=`@keyframes ${H} { 50% { box-shadow: none; }}`,Y+=`@keyframes ${q} { 0% { background-color: ${B.cursor.css}; color: ${B.cursorAccent.css}; } 50% { background-color: inherit; color: ${B.cursor.css}; }}`,Y+=`${this._terminalSelector} .${R}.${I} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${R}.${I} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${H} 1s step-end infinite;}${this._terminalSelector} .${R}.${I} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block { background-color: ${B.cursor.css}; color: ${B.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${B.cursor.css} !important; color: ${B.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${B.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${B.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${B.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,Y+=`${this._terminalSelector} .${K} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${K} div { position: absolute; background-color: ${B.selectionBackgroundOpaque.css};}${this._terminalSelector} .${K} div { position: absolute; background-color: ${B.selectionInactiveBackgroundOpaque.css};}`;for(const[V,D]of B.ansi.entries())Y+=`${this._terminalSelector} .${M}${V} { color: ${D.css}; }${this._terminalSelector} .${M}${V}.xterm-dim { color: ${y.color.multiplyOpacity(D,.5).css}; }${this._terminalSelector} .${T}${V} { background-color: ${D.css}; }`;Y+=`${this._terminalSelector} .${M}${C.INVERTED_DEFAULT_COLOR} { color: ${y.color.opaque(B.background).css}; }${this._terminalSelector} .${M}${C.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${y.color.multiplyOpacity(y.color.opaque(B.background),.5).css}; }${this._terminalSelector} .${T}${C.INVERTED_DEFAULT_COLOR} { background-color: ${B.foreground.css}; }`,this._themeStyleElement.textContent=Y}_setDefaultSpacing(){const B=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${B}px`,this._rowFactory.defaultSpacing=B}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(B,Y){for(let X=this._rowElements.length;X<=Y;X++){const H=this._document.createElement("div");this._rowContainer.appendChild(H),this._rowElements.push(H)}for(;this._rowElements.length>Y;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(B,Y){this._refreshRowElements(B,Y),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(B,Y,X){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(B,Y,X),this.renderRows(0,this._bufferService.rows-1),!B||!Y)return;this._selectionRenderModel.update(this._terminal,B,Y,X);const H=this._selectionRenderModel.viewportStartRow,q=this._selectionRenderModel.viewportEndRow,V=this._selectionRenderModel.viewportCappedStartRow,D=this._selectionRenderModel.viewportCappedEndRow;if(V>=this._bufferService.rows||D<0)return;const P=this._document.createDocumentFragment();if(X){const O=B[0]>Y[0];P.appendChild(this._createSelectionElement(V,O?Y[0]:B[0],O?B[0]:Y[0],D-V+1))}else{const O=H===V?B[0]:0,z=V===q?Y[0]:this._bufferService.cols;P.appendChild(this._createSelectionElement(V,O,z));const W=D-V-1;if(P.appendChild(this._createSelectionElement(V+1,0,this._bufferService.cols,W)),V!==D){const Z=q===D?Y[0]:this._bufferService.cols;P.appendChild(this._createSelectionElement(D,0,Z))}}this._selectionContainer.appendChild(P)}_createSelectionElement(B,Y,X,H=1){const q=this._document.createElement("div"),V=Y*this.dimensions.css.cell.width;let D=this.dimensions.css.cell.width*(X-Y);return V+D>this.dimensions.css.canvas.width&&(D=this.dimensions.css.canvas.width-V),q.style.height=H*this.dimensions.css.cell.height+"px",q.style.top=B*this.dimensions.css.cell.height+"px",q.style.left=`${V}px`,q.style.width=`${D}px`,q}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 B of this._rowElements)B.replaceChildren()}renderRows(B,Y){const X=this._bufferService.buffer,H=X.ybase+X.y,q=Math.min(X.x,this._bufferService.cols-1),V=this._optionsService.rawOptions.cursorBlink,D=this._optionsService.rawOptions.cursorStyle,P=this._optionsService.rawOptions.cursorInactiveStyle;for(let O=B;O<=Y;O++){const z=O+X.ydisp,W=this._rowElements[O],Z=X.lines.get(z);if(!W||!Z)break;W.replaceChildren(...this._rowFactory.createRow(Z,z,z===H,D,P,q,V,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${L}${this._terminalClass}`}_handleLinkHover(B){this._setCellUnderline(B.x1,B.x2,B.y1,B.y2,B.cols,!0)}_handleLinkLeave(B){this._setCellUnderline(B.x1,B.x2,B.y1,B.y2,B.cols,!1)}_setCellUnderline(B,Y,X,H,q,V){X<0&&(B=0),H<0&&(Y=0);const D=this._bufferService.rows-1;X=Math.max(Math.min(X,D),0),H=Math.max(Math.min(H,D),0),q=Math.min(q,this._bufferService.cols);const P=this._bufferService.buffer,O=P.ybase+P.y,z=Math.min(P.x,q-1),W=this._optionsService.rawOptions.cursorBlink,Z=this._optionsService.rawOptions.cursorStyle,ie=this._optionsService.rawOptions.cursorInactiveStyle;for(let he=X;he<=H;++he){const te=he+P.ydisp,$=this._rowElements[he],le=P.lines.get(te);if(!$||!le)break;$.replaceChildren(...this._rowFactory.createRow(le,te,te===O,Z,ie,z,W,this.dimensions.css.cell.width,this._widthCache,V?he===X?B:0:-1,V?(he===H?Y:q)-1:-1))}}};c.DomRenderer=G=d([b(7,k.IInstantiationService),b(8,f.ICharSizeService),b(9,k.IOptionsService),b(10,k.IBufferService),b(11,f.ICoreBrowserService),b(12,f.IThemeService)],G)},3787:function(_,c,u){var d=this&&this.__decorate||function(R,M,T,I){var K,F=arguments.length,G=F<3?M:I===null?I=Object.getOwnPropertyDescriptor(M,T):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(R,M,T,I);else for(var B=R.length-1;B>=0;B--)(K=R[B])&&(G=(F<3?K(G):F>3?K(M,T,G):K(M,T))||G);return F>3&&G&&Object.defineProperty(M,T,G),G},b=this&&this.__param||function(R,M){return function(T,I){M(T,I,R)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRendererRowFactory=void 0;const p=u(2223),w=u(643),C=u(511),A=u(2585),E=u(8055),f=u(4725),y=u(4269),m=u(6171),S=u(3734);let k=c.DomRendererRowFactory=class{constructor(R,M,T,I,K,F,G){this._document=R,this._characterJoinerService=M,this._optionsService=T,this._coreBrowserService=I,this._coreService=K,this._decorationService=F,this._themeService=G,this._workCell=new C.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,M,T){this._selectionStart=R,this._selectionEnd=M,this._columnSelectMode=T}createRow(R,M,T,I,K,F,G,B,Y,X,H){const q=[],V=this._characterJoinerService.getJoinedCharacters(M),D=this._themeService.colors;let P,O=R.getNoBgTrimmedLength();T&&O<F+1&&(O=F+1);let z=0,W="",Z=0,ie=0,he=0,te=!1,$=0,le=!1,ge=0;const we=[],Se=X!==-1&&H!==-1;for(let je=0;je<O;je++){R.loadCell(je,this._workCell);let Ie=this._workCell.getWidth();if(Ie===0)continue;let Ge=!1,vt=je,Le=this._workCell;if(V.length>0&&je===V[0][0]){Ge=!0;const dt=V.shift();Le=new y.JoinedCellData(this._workCell,R.translateToString(!0,dt[0],dt[1]),dt[1]-dt[0]),vt=dt[1]-1,Ie=Le.getWidth()}const Tt=this._isCellInSelection(je,M),Xt=T&&je===F,vn=Se&&je>=X&&je<=H;let an=!1;this._decorationService.forEachDecorationAtCell(je,M,void 0,(dt=>{an=!0}));let kn=Le.getChars()||w.WHITESPACE_CELL_CHAR;if(kn===" "&&(Le.isUnderline()||Le.isOverline())&&(kn=" "),ge=Ie*B-Y.get(kn,Le.isBold(),Le.isItalic()),P){if(z&&(Tt&&le||!Tt&&!le&&Le.bg===Z)&&(Tt&&le&&D.selectionForeground||Le.fg===ie)&&Le.extended.ext===he&&vn===te&&ge===$&&!Xt&&!Ge&&!an){Le.isInvisible()?W+=w.WHITESPACE_CELL_CHAR:W+=kn,z++;continue}z&&(P.textContent=W),P=this._document.createElement("span"),z=0,W=""}else P=this._document.createElement("span");if(Z=Le.bg,ie=Le.fg,he=Le.extended.ext,te=vn,$=ge,le=Tt,Ge&&F>=je&&F<=vt&&(F=je),!this._coreService.isCursorHidden&&Xt&&this._coreService.isCursorInitialized){if(we.push("xterm-cursor"),this._coreBrowserService.isFocused)G&&we.push("xterm-cursor-blink"),we.push(I==="bar"?"xterm-cursor-bar":I==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(K)switch(K){case"outline":we.push("xterm-cursor-outline");break;case"block":we.push("xterm-cursor-block");break;case"bar":we.push("xterm-cursor-bar");break;case"underline":we.push("xterm-cursor-underline")}}if(Le.isBold()&&we.push("xterm-bold"),Le.isItalic()&&we.push("xterm-italic"),Le.isDim()&&we.push("xterm-dim"),W=Le.isInvisible()?w.WHITESPACE_CELL_CHAR:Le.getChars()||w.WHITESPACE_CELL_CHAR,Le.isUnderline()&&(we.push(`xterm-underline-${Le.extended.underlineStyle}`),W===" "&&(W=" "),!Le.isUnderlineColorDefault()))if(Le.isUnderlineColorRGB())P.style.textDecorationColor=`rgb(${S.AttributeData.toColorRGB(Le.getUnderlineColor()).join(",")})`;else{let dt=Le.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Le.isBold()&&dt<8&&(dt+=8),P.style.textDecorationColor=D.ansi[dt].css}Le.isOverline()&&(we.push("xterm-overline"),W===" "&&(W=" ")),Le.isStrikethrough()&&we.push("xterm-strikethrough"),vn&&(P.style.textDecoration="underline");let Zt=Le.getFgColor(),ut=Le.getFgColorMode(),Rt=Le.getBgColor(),xt=Le.getBgColorMode();const Ut=!!Le.isInverse();if(Ut){const dt=Zt;Zt=Rt,Rt=dt;const An=ut;ut=xt,xt=An}let Kt,Xn,bn,Pn=!1;switch(this._decorationService.forEachDecorationAtCell(je,M,void 0,(dt=>{dt.options.layer!=="top"&&Pn||(dt.backgroundColorRGB&&(xt=50331648,Rt=dt.backgroundColorRGB.rgba>>8&16777215,Kt=dt.backgroundColorRGB),dt.foregroundColorRGB&&(ut=50331648,Zt=dt.foregroundColorRGB.rgba>>8&16777215,Xn=dt.foregroundColorRGB),Pn=dt.options.layer==="top")})),!Pn&&Tt&&(Kt=this._coreBrowserService.isFocused?D.selectionBackgroundOpaque:D.selectionInactiveBackgroundOpaque,Rt=Kt.rgba>>8&16777215,xt=50331648,Pn=!0,D.selectionForeground&&(ut=50331648,Zt=D.selectionForeground.rgba>>8&16777215,Xn=D.selectionForeground)),Pn&&we.push("xterm-decoration-top"),xt){case 16777216:case 33554432:bn=D.ansi[Rt],we.push(`xterm-bg-${Rt}`);break;case 50331648:bn=E.channels.toColor(Rt>>16,Rt>>8&255,255&Rt),this._addStyle(P,`background-color:#${L((Rt>>>0).toString(16),"0",6)}`);break;default:Ut?(bn=D.foreground,we.push(`xterm-bg-${p.INVERTED_DEFAULT_COLOR}`)):bn=D.background}switch(Kt||Le.isDim()&&(Kt=E.color.multiplyOpacity(bn,.5)),ut){case 16777216:case 33554432:Le.isBold()&&Zt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Zt+=8),this._applyMinimumContrast(P,bn,D.ansi[Zt],Le,Kt,void 0)||we.push(`xterm-fg-${Zt}`);break;case 50331648:const dt=E.channels.toColor(Zt>>16&255,Zt>>8&255,255&Zt);this._applyMinimumContrast(P,bn,dt,Le,Kt,Xn)||this._addStyle(P,`color:#${L(Zt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(P,bn,D.foreground,Le,Kt,Xn)||Ut&&we.push(`xterm-fg-${p.INVERTED_DEFAULT_COLOR}`)}we.length&&(P.className=we.join(" "),we.length=0),Xt||Ge||an?P.textContent=W:z++,ge!==this.defaultSpacing&&(P.style.letterSpacing=`${ge}px`),q.push(P),je=vt}return P&&z&&(P.textContent=W),q}_applyMinimumContrast(R,M,T,I,K,F){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,m.treatGlyphAsBackgroundColor)(I.getCode()))return!1;const G=this._getContrastCache(I);let B;if(K||F||(B=G.getColor(M.rgba,T.rgba)),B===void 0){const Y=this._optionsService.rawOptions.minimumContrastRatio/(I.isDim()?2:1);B=E.color.ensureContrastRatio(K||M,F||T,Y),G.setColor((K||M).rgba,(F||T).rgba,B??null)}return!!B&&(this._addStyle(R,`color:${B.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 T=this._selectionStart,I=this._selectionEnd;return!(!T||!I)&&(this._columnSelectMode?T[0]<=I[0]?R>=T[0]&&M>=T[1]&&R<I[0]&&M<=I[1]:R<T[0]&&M>=T[1]&&R>=I[0]&&M<=I[1]:M>T[1]&&M<I[1]||T[1]===I[1]&&M===T[1]&&R>=T[0]&&R<I[0]||T[1]<I[1]&&M===I[1]&&R<I[0]||T[1]<I[1]&&M===T[1]&&R>=T[0])}};function L(R,M,T){for(;R.length<T;)R=M+R;return R}c.DomRendererRowFactory=k=d([b(1,f.ICharacterJoinerService),b(2,A.IOptionsService),b(3,f.ICoreBrowserService),b(4,A.ICoreService),b(5,A.IDecorationService),b(6,f.IThemeService)],k)},2550:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WidthCache=void 0,c.WidthCache=class{constructor(u,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const b=u.createElement("span");b.classList.add("xterm-char-measure-element");const p=u.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontWeight="bold";const w=u.createElement("span");w.classList.add("xterm-char-measure-element"),w.style.fontStyle="italic";const C=u.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontWeight="bold",C.style.fontStyle="italic",this._measureElements=[b,p,w,C],this._container.appendChild(b),this._container.appendChild(p),this._container.appendChild(w),this._container.appendChild(C),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,b,p){u===this._font&&d===this._fontSize&&b===this._weight&&p===this._weightBold||(this._font=u,this._fontSize=d,this._weight=b,this._weightBold=p,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${b}`,this._measureElements[1].style.fontWeight=`${p}`,this._measureElements[2].style.fontWeight=`${b}`,this._measureElements[3].style.fontWeight=`${p}`,this.clear())}get(u,d,b){let p=0;if(!d&&!b&&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 w=u;d&&(w+="B"),b&&(w+="I");let C=this._holey.get(w);if(C===void 0){let A=0;d&&(A|=1),b&&(A|=2),C=this._measure(u,A),C>0&&this._holey.set(w,C)}return C}_measure(u,d){const b=this._measureElements[d];return b.textContent=u.repeat(32),b.offsetWidth/32}}},2223:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TEXT_BASELINE=c.DIM_OPACITY=c.INVERTED_DEFAULT_COLOR=void 0;const d=u(6114);c.INVERTED_DEFAULT_COLOR=257,c.DIM_OPACITY=.5,c.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(_,c)=>{function u(b){return 57508<=b&&b<=57558}function d(b){return b>=128512&&b<=128591||b>=127744&&b<=128511||b>=128640&&b<=128767||b>=9728&&b<=9983||b>=9984&&b<=10175||b>=65024&&b<=65039||b>=129280&&b<=129535||b>=127462&&b<=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(b){if(!b)throw new Error("value must not be falsy");return b},c.isPowerlineGlyph=u,c.isRestrictedPowerlineGlyph=function(b){return 57520<=b&&b<=57527},c.isEmoji=d,c.allowRescaling=function(b,p,w,C){return p===1&&w>Math.ceil(1.5*C)&&b!==void 0&&b>255&&!d(b)&&!u(b)&&!(function(A){return 57344<=A&&A<=63743})(b)},c.treatGlyphAsBackgroundColor=function(b){return u(b)||(function(p){return 9472<=p&&p<=9631})(b)},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(b,p,w=0){return(b-(2*Math.round(p)-w))%(2*Math.round(p))}},6052:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createSelectionRenderModel=void 0;class u{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(b,p,w,C=!1){if(this.selectionStart=p,this.selectionEnd=w,!p||!w||p[0]===w[0]&&p[1]===w[1])return void this.clear();const A=b.buffers.active.ydisp,E=p[1]-A,f=w[1]-A,y=Math.max(E,0),m=Math.min(f,b.rows-1);y>=b.rows||m<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=C,this.viewportStartRow=E,this.viewportEndRow=f,this.viewportCappedStartRow=y,this.viewportCappedEndRow=m,this.startCol=p[0],this.endCol=w[0])}isCellSelected(b,p,w){return!!this.hasSelection&&(w-=b.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?p>=this.startCol&&w>=this.viewportCappedStartRow&&p<this.endCol&&w<=this.viewportCappedEndRow:p<this.startCol&&w>=this.viewportCappedStartRow&&p>=this.endCol&&w<=this.viewportCappedEndRow:w>this.viewportStartRow&&w<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&w===this.viewportStartRow&&p>=this.startCol&&p<this.endCol||this.viewportStartRow<this.viewportEndRow&&w===this.viewportEndRow&&p<this.endCol||this.viewportStartRow<this.viewportEndRow&&w===this.viewportStartRow&&p>=this.startCol)}}c.createSelectionRenderModel=function(){return new u}},456:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionModel=void 0,c.SelectionModel=class{constructor(u){this._bufferService=u,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,d=this.selectionEnd;return!(!u||!d)&&(u[1]>d[1]||u[1]===d[1]&&u[0]>d[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(_,c,u){var d=this&&this.__decorate||function(m,S,k,L){var R,M=arguments.length,T=M<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,k):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(m,S,k,L);else for(var I=m.length-1;I>=0;I--)(R=m[I])&&(T=(M<3?R(T):M>3?R(S,k,T):R(S,k))||T);return M>3&&T&&Object.defineProperty(S,k,T),T},b=this&&this.__param||function(m,S){return function(k,L){S(k,L,m)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharSizeService=void 0;const p=u(2585),w=u(8460),C=u(844);let A=c.CharSizeService=class extends C.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(m,S,k){super(),this._optionsService=k,this.width=0,this.height=0,this._onCharSizeChange=this.register(new w.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new y(this._optionsService))}catch{this._measureStrategy=this.register(new f(m,S,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const m=this._measureStrategy.measure();m.width===this.width&&m.height===this.height||(this.width=m.width,this.height=m.height,this._onCharSizeChange.fire())}};c.CharSizeService=A=d([b(2,p.IOptionsService)],A);class E extends C.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(S,k){S!==void 0&&S>0&&k!==void 0&&k>0&&(this._result.width=S,this._result.height=k)}}class f extends E{constructor(S,k,L){super(),this._document=S,this._parentElement=k,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(S){super(),this._optionsService=S,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const k=this._ctx.measureText("W");if(!("width"in k&&"fontBoundingBoxAscent"in k&&"fontBoundingBoxDescent"in k))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const S=this._ctx.measureText("W");return this._validateAndSet(S.width,S.fontBoundingBoxAscent+S.fontBoundingBoxDescent),this._result}}},4269:function(_,c,u){var d=this&&this.__decorate||function(y,m,S,k){var L,R=arguments.length,M=R<3?m:k===null?k=Object.getOwnPropertyDescriptor(m,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,m,S,k);else for(var T=y.length-1;T>=0;T--)(L=y[T])&&(M=(R<3?L(M):R>3?L(m,S,M):L(m,S))||M);return R>3&&M&&Object.defineProperty(m,S,M),M},b=this&&this.__param||function(y,m){return function(S,k){m(S,k,y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharacterJoinerService=c.JoinedCellData=void 0;const p=u(3734),w=u(643),C=u(511),A=u(2585);class E extends p.AttributeData{constructor(m,S,k){super(),this.content=0,this.combinedData="",this.fg=m.fg,this.bg=m.bg,this.combinedData=S,this._width=k}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(m){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.JoinedCellData=E;let f=c.CharacterJoinerService=class Gw{constructor(m){this._bufferService=m,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new C.CellData}register(m){const S={id:this._nextCharacterJoinerId++,handler:m};return this._characterJoiners.push(S),S.id}deregister(m){for(let S=0;S<this._characterJoiners.length;S++)if(this._characterJoiners[S].id===m)return this._characterJoiners.splice(S,1),!0;return!1}getJoinedCharacters(m){if(this._characterJoiners.length===0)return[];const S=this._bufferService.buffer.lines.get(m);if(!S||S.length===0)return[];const k=[],L=S.translateToString(!0);let R=0,M=0,T=0,I=S.getFg(0),K=S.getBg(0);for(let F=0;F<S.getTrimmedLength();F++)if(S.loadCell(F,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==I||this._workCell.bg!==K){if(F-R>1){const G=this._getJoinedRanges(L,T,M,S,R);for(let B=0;B<G.length;B++)k.push(G[B])}R=F,T=M,I=this._workCell.fg,K=this._workCell.bg}M+=this._workCell.getChars().length||w.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-R>1){const F=this._getJoinedRanges(L,T,M,S,R);for(let G=0;G<F.length;G++)k.push(F[G])}return k}_getJoinedRanges(m,S,k,L,R){const M=m.substring(S,k);let T=[];try{T=this._characterJoiners[0].handler(M)}catch(I){console.error(I)}for(let I=1;I<this._characterJoiners.length;I++)try{const K=this._characterJoiners[I].handler(M);for(let F=0;F<K.length;F++)Gw._mergeRanges(T,K[F])}catch(K){console.error(K)}return this._stringRangesToCellRanges(T,L,R),T}_stringRangesToCellRanges(m,S,k){let L=0,R=!1,M=0,T=m[L];if(T){for(let I=k;I<this._bufferService.cols;I++){const K=S.getWidth(I),F=S.getString(I).length||w.WHITESPACE_CELL_CHAR.length;if(K!==0){if(!R&&T[0]<=M&&(T[0]=I,R=!0),T[1]<=M){if(T[1]=I,T=m[++L],!T)break;T[0]<=M?(T[0]=I,R=!0):R=!1}M+=F}}T&&(T[1]=this._bufferService.cols)}}static _mergeRanges(m,S){let k=!1;for(let L=0;L<m.length;L++){const R=m[L];if(k){if(S[1]<=R[0])return m[L-1][1]=S[1],m;if(S[1]<=R[1])return m[L-1][1]=Math.max(S[1],R[1]),m.splice(L,1),m;m.splice(L,1),L--}else{if(S[1]<=R[0])return m.splice(L,0,S),m;if(S[1]<=R[1])return R[0]=Math.min(S[0],R[0]),m;S[0]<R[1]&&(R[0]=Math.min(S[0],R[0]),k=!0)}}return k?m[m.length-1][1]=S[1]:m.push(S),m}};c.CharacterJoinerService=f=d([b(0,A.IBufferService)],f)},5114:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreBrowserService=void 0;const d=u(844),b=u(8460),p=u(3656);class w extends d.Disposable{constructor(E,f,y){super(),this._textarea=E,this._window=f,this.mainDocument=y,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new C(this._window),this._onDprChange=this.register(new b.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new b.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((m=>this._screenDprMonitor.setWindow(m)))),this.register((0,b.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=w;class C extends d.Disposable{constructor(E){super(),this._parentWindow=E,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new b.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:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.LinkProviderService=void 0;const d=u(844);class b extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(w){return this.linkProviders.push(w),{dispose:()=>{const C=this.linkProviders.indexOf(w);C!==-1&&this.linkProviders.splice(C,1)}}}}c.LinkProviderService=b},8934:function(_,c,u){var d=this&&this.__decorate||function(A,E,f,y){var m,S=arguments.length,k=S<3?E:y===null?y=Object.getOwnPropertyDescriptor(E,f):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(A,E,f,y);else for(var L=A.length-1;L>=0;L--)(m=A[L])&&(k=(S<3?m(k):S>3?m(E,f,k):m(E,f))||k);return S>3&&k&&Object.defineProperty(E,f,k),k},b=this&&this.__param||function(A,E){return function(f,y){E(f,y,A)}};Object.defineProperty(c,"__esModule",{value:!0}),c.MouseService=void 0;const p=u(4725),w=u(9806);let C=c.MouseService=class{constructor(A,E){this._renderService=A,this._charSizeService=E}getCoords(A,E,f,y,m){return(0,w.getCoords)(window,A,E,f,y,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,m)}getMouseReportCoords(A,E){const f=(0,w.getCoordsRelativeToElement)(window,A,E);if(this._charSizeService.hasValidSize)return f[0]=Math.min(Math.max(f[0],0),this._renderService.dimensions.css.canvas.width-1),f[1]=Math.min(Math.max(f[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(f[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(f[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(f[0]),y:Math.floor(f[1])}}};c.MouseService=C=d([b(0,p.IRenderService),b(1,p.ICharSizeService)],C)},3230:function(_,c,u){var d=this&&this.__decorate||function(m,S,k,L){var R,M=arguments.length,T=M<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,k):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(m,S,k,L);else for(var I=m.length-1;I>=0;I--)(R=m[I])&&(T=(M<3?R(T):M>3?R(S,k,T):R(S,k))||T);return M>3&&T&&Object.defineProperty(S,k,T),T},b=this&&this.__param||function(m,S){return function(k,L){S(k,L,m)}};Object.defineProperty(c,"__esModule",{value:!0}),c.RenderService=void 0;const p=u(6193),w=u(4725),C=u(8460),A=u(844),E=u(7226),f=u(2585);let y=c.RenderService=class extends A.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(m,S,k,L,R,M,T,I){super(),this._rowCount=m,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 C.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new C.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new C.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new C.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new p.RenderDebouncer(((K,F)=>this._renderRows(K,F)),T),this.register(this._renderDebouncer),this.register(T.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(M.onResize((()=>this._fullRefresh()))),this.register(M.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(k.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(R.onDecorationRegistered((()=>this._fullRefresh()))),this.register(R.onDecorationRemoved((()=>this._fullRefresh()))),this.register(k.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(M.cols,M.rows),this._fullRefresh()}))),this.register(k.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(M.buffer.y,M.buffer.y,!0)))),this.register(I.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(T.window,S),this.register(T.onWindowChange((K=>this._registerIntersectionObserver(K,S))))}_registerIntersectionObserver(m,S){if("IntersectionObserver"in m){const k=new m.IntersectionObserver((L=>this._handleIntersectionChange(L[L.length-1])),{threshold:0});k.observe(S),this._observerDisposable.value=(0,A.toDisposable)((()=>k.disconnect()))}}_handleIntersectionChange(m){this._isPaused=m.isIntersecting===void 0?m.intersectionRatio===0:!m.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(m,S,k=!1){this._isPaused?this._needsFullRefresh=!0:(k||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(m,S,this._rowCount))}_renderRows(m,S){this._renderer.value&&(m=Math.min(m,this._rowCount-1),S=Math.min(S,this._rowCount-1),this._renderer.value.renderRows(m,S),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:m,end:S}),this._onRender.fire({start:m,end:S}),this._isNextRenderRedrawOnly=!0)}resize(m,S){this._rowCount=S,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(m){this._renderer.value=m,this._renderer.value&&(this._renderer.value.onRequestRedraw((S=>this.refreshRows(S.start,S.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(m){return this._renderDebouncer.addRefreshCallback(m)}_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(m,S){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(m,S))):this._renderer.value.handleResize(m,S),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(m,S,k){this._selectionState.start=m,this._selectionState.end=S,this._selectionState.columnSelectMode=k,this._renderer.value?.handleSelectionChanged(m,S,k)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};c.RenderService=y=d([b(2,f.IOptionsService),b(3,w.ICharSizeService),b(4,f.IDecorationService),b(5,f.IBufferService),b(6,w.ICoreBrowserService),b(7,w.IThemeService)],y)},9312:function(_,c,u){var d=this&&this.__decorate||function(T,I,K,F){var G,B=arguments.length,Y=B<3?I:F===null?F=Object.getOwnPropertyDescriptor(I,K):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(T,I,K,F);else for(var X=T.length-1;X>=0;X--)(G=T[X])&&(Y=(B<3?G(Y):B>3?G(I,K,Y):G(I,K))||Y);return B>3&&Y&&Object.defineProperty(I,K,Y),Y},b=this&&this.__param||function(T,I){return function(K,F){I(K,F,T)}};Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionService=void 0;const p=u(9806),w=u(9504),C=u(456),A=u(4725),E=u(8460),f=u(844),y=u(6114),m=u(4841),S=u(511),k=u(2585),L=" ",R=new RegExp(L,"g");let M=c.SelectionService=class extends f.Disposable{constructor(T,I,K,F,G,B,Y,X,H){super(),this._element=T,this._screenElement=I,this._linkifier=K,this._bufferService=F,this._coreService=G,this._mouseService=B,this._optionsService=Y,this._renderService=X,this._coreBrowserService=H,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new S.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=q=>this._handleMouseMove(q),this._mouseUpListener=q=>this._handleMouseUp(q),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((q=>this._handleTrim(q))),this.register(this._bufferService.buffers.onBufferActivate((q=>this._handleBufferActivate(q)))),this.enable(),this._model=new C.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,f.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 T=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!(!T||!I||T[0]===I[0]&&T[1]===I[1])}get selectionText(){const T=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;if(!T||!I)return"";const K=this._bufferService.buffer,F=[];if(this._activeSelectionMode===3){if(T[0]===I[0])return"";const G=T[0]<I[0]?T[0]:I[0],B=T[0]<I[0]?I[0]:T[0];for(let Y=T[1];Y<=I[1];Y++){const X=K.translateBufferLineToString(Y,!0,G,B);F.push(X)}}else{const G=T[1]===I[1]?I[0]:void 0;F.push(K.translateBufferLineToString(T[1],!0,T[0],G));for(let B=T[1]+1;B<=I[1]-1;B++){const Y=K.lines.get(B),X=K.translateBufferLineToString(B,!0);Y?.isWrapped?F[F.length-1]+=X:F.push(X)}if(T[1]!==I[1]){const B=K.lines.get(I[1]),Y=K.translateBufferLineToString(I[1],!0,0,I[0]);B&&B.isWrapped?F[F.length-1]+=Y:F.push(Y)}}return F.map((G=>G.replace(R," "))).join(y.isWindows?`\r
79
+ `:`
80
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(T){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),y.isLinux&&T&&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(T){const I=this._getMouseBufferCoords(T),K=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!!(K&&F&&I)&&this._areCoordsInSelection(I,K,F)}isCellInSelection(T,I){const K=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!(!K||!F)&&this._areCoordsInSelection([T,I],K,F)}_areCoordsInSelection(T,I,K){return T[1]>I[1]&&T[1]<K[1]||I[1]===K[1]&&T[1]===I[1]&&T[0]>=I[0]&&T[0]<K[0]||I[1]<K[1]&&T[1]===K[1]&&T[0]<K[0]||I[1]<K[1]&&T[1]===I[1]&&T[0]>=I[0]}_selectWordAtCursor(T,I){const K=this._linkifier.currentLink?.link?.range;if(K)return this._model.selectionStart=[K.start.x-1,K.start.y-1],this._model.selectionStartLength=(0,m.getRangeLength)(K,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const F=this._getMouseBufferCoords(T);return!!F&&(this._selectWordAt(F,I),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(T,I){this._model.clearSelection(),T=Math.max(T,0),I=Math.min(I,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,T],this._model.selectionEnd=[this._bufferService.cols,I],this.refresh(),this._onSelectionChange.fire()}_handleTrim(T){this._model.handleTrim(T)&&this.refresh()}_getMouseBufferCoords(T){const I=this._mouseService.getCoords(T,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(I)return I[0]--,I[1]--,I[1]+=this._bufferService.buffer.ydisp,I}_getMouseEventScrollAmount(T){let I=(0,p.getCoordsRelativeToElement)(this._coreBrowserService.window,T,this._screenElement)[1];const K=this._renderService.dimensions.css.canvas.height;return I>=0&&I<=K?0:(I>K&&(I-=K),I=Math.min(Math.max(I,-50),50),I/=50,I/Math.abs(I)+Math.round(14*I))}shouldForceSelection(T){return y.isMac?T.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:T.shiftKey}handleMouseDown(T){if(this._mouseDownTimeStamp=T.timeStamp,(T.button!==2||!this.hasSelection)&&T.button===0){if(!this._enabled){if(!this.shouldForceSelection(T))return;T.stopPropagation()}T.preventDefault(),this._dragScrollAmount=0,this._enabled&&T.shiftKey?this._handleIncrementalClick(T):T.detail===1?this._handleSingleClick(T):T.detail===2?this._handleDoubleClick(T):T.detail===3&&this._handleTripleClick(T),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(T){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(T))}_handleSingleClick(T){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(T)?3:0,this._model.selectionStart=this._getMouseBufferCoords(T),!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(T){this._selectWordAtCursor(T,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(T){const I=this._getMouseBufferCoords(T);I&&(this._activeSelectionMode=2,this._selectLineAt(I[1]))}shouldColumnSelect(T){return T.altKey&&!(y.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(T){if(T.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(T),!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(T),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const K=this._bufferService.buffer;if(this._model.selectionEnd[1]<K.lines.length){const F=K.lines.get(this._model.selectionEnd[1]);F&&F.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 T=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(T.ydisp+this._bufferService.rows,T.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=T.ydisp),this.refresh()}}_handleMouseUp(T){const I=T.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&I<500&&T.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const K=this._mouseService.getCoords(T,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(K&&K[0]!==void 0&&K[1]!==void 0){const F=(0,w.moveToCellSequence)(K[0]-1,K[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(F,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const T=this._model.finalSelectionStart,I=this._model.finalSelectionEnd,K=!(!T||!I||T[0]===I[0]&&T[1]===I[1]);K?T&&I&&(this._oldSelectionStart&&this._oldSelectionEnd&&T[0]===this._oldSelectionStart[0]&&T[1]===this._oldSelectionStart[1]&&I[0]===this._oldSelectionEnd[0]&&I[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(T,I,K)):this._oldHasSelection&&this._fireOnSelectionChange(T,I,K)}_fireOnSelectionChange(T,I,K){this._oldSelectionStart=T,this._oldSelectionEnd=I,this._oldHasSelection=K,this._onSelectionChange.fire()}_handleBufferActivate(T){this.clearSelection(),this._trimListener.dispose(),this._trimListener=T.activeBuffer.lines.onTrim((I=>this._handleTrim(I)))}_convertViewportColToCharacterIndex(T,I){let K=I;for(let F=0;I>=F;F++){const G=T.loadCell(F,this._workCell).getChars().length;this._workCell.getWidth()===0?K--:G>1&&I!==F&&(K+=G-1)}return K}setSelection(T,I,K){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[T,I],this._model.selectionStartLength=K,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(T){this._isClickInSelection(T)||(this._selectWordAtCursor(T,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(T,I,K=!0,F=!0){if(T[0]>=this._bufferService.cols)return;const G=this._bufferService.buffer,B=G.lines.get(T[1]);if(!B)return;const Y=G.translateBufferLineToString(T[1],!1);let X=this._convertViewportColToCharacterIndex(B,T[0]),H=X;const q=T[0]-X;let V=0,D=0,P=0,O=0;if(Y.charAt(X)===" "){for(;X>0&&Y.charAt(X-1)===" ";)X--;for(;H<Y.length&&Y.charAt(H+1)===" ";)H++}else{let Z=T[0],ie=T[0];B.getWidth(Z)===0&&(V++,Z--),B.getWidth(ie)===2&&(D++,ie++);const he=B.getString(ie).length;for(he>1&&(O+=he-1,H+=he-1);Z>0&&X>0&&!this._isCharWordSeparator(B.loadCell(Z-1,this._workCell));){B.loadCell(Z-1,this._workCell);const te=this._workCell.getChars().length;this._workCell.getWidth()===0?(V++,Z--):te>1&&(P+=te-1,X-=te-1),X--,Z--}for(;ie<B.length&&H+1<Y.length&&!this._isCharWordSeparator(B.loadCell(ie+1,this._workCell));){B.loadCell(ie+1,this._workCell);const te=this._workCell.getChars().length;this._workCell.getWidth()===2?(D++,ie++):te>1&&(O+=te-1,H+=te-1),H++,ie++}}H++;let z=X+q-V+P,W=Math.min(this._bufferService.cols,H-X+V+D-P-O);if(I||Y.slice(X,H).trim()!==""){if(K&&z===0&&B.getCodePoint(0)!==32){const Z=G.lines.get(T[1]-1);if(Z&&B.isWrapped&&Z.getCodePoint(this._bufferService.cols-1)!==32){const ie=this._getWordAt([this._bufferService.cols-1,T[1]-1],!1,!0,!1);if(ie){const he=this._bufferService.cols-ie.start;z-=he,W+=he}}}if(F&&z+W===this._bufferService.cols&&B.getCodePoint(this._bufferService.cols-1)!==32){const Z=G.lines.get(T[1]+1);if(Z?.isWrapped&&Z.getCodePoint(0)!==32){const ie=this._getWordAt([0,T[1]+1],!1,!1,!0);ie&&(W+=ie.length)}}return{start:z,length:W}}}_selectWordAt(T,I){const K=this._getWordAt(T,I);if(K){for(;K.start<0;)K.start+=this._bufferService.cols,T[1]--;this._model.selectionStart=[K.start,T[1]],this._model.selectionStartLength=K.length}}_selectToWordAt(T){const I=this._getWordAt(T,!0);if(I){let K=T[1];for(;I.start<0;)I.start+=this._bufferService.cols,K--;if(!this._model.areSelectionValuesReversed())for(;I.start+I.length>this._bufferService.cols;)I.length-=this._bufferService.cols,K++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?I.start:I.start+I.length,K]}}_isCharWordSeparator(T){return T.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(T.getChars())>=0}_selectLineAt(T){const I=this._bufferService.buffer.getWrappedRangeForLine(T),K={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,m.getRangeLength)(K,this._bufferService.cols)}};c.SelectionService=M=d([b(3,k.IBufferService),b(4,k.ICoreService),b(5,A.IMouseService),b(6,k.IOptionsService),b(7,A.IRenderService),b(8,A.ICoreBrowserService)],M)},4725:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ILinkProviderService=c.IThemeService=c.ICharacterJoinerService=c.ISelectionService=c.IRenderService=c.IMouseService=c.ICoreBrowserService=c.ICharSizeService=void 0;const d=u(8343);c.ICharSizeService=(0,d.createDecorator)("CharSizeService"),c.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),c.IMouseService=(0,d.createDecorator)("MouseService"),c.IRenderService=(0,d.createDecorator)("RenderService"),c.ISelectionService=(0,d.createDecorator)("SelectionService"),c.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),c.IThemeService=(0,d.createDecorator)("ThemeService"),c.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(_,c,u){var d=this&&this.__decorate||function(M,T,I,K){var F,G=arguments.length,B=G<3?T:K===null?K=Object.getOwnPropertyDescriptor(T,I):K;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(M,T,I,K);else for(var Y=M.length-1;Y>=0;Y--)(F=M[Y])&&(B=(G<3?F(B):G>3?F(T,I,B):F(T,I))||B);return G>3&&B&&Object.defineProperty(T,I,B),B},b=this&&this.__param||function(M,T){return function(I,K){T(I,K,M)}};Object.defineProperty(c,"__esModule",{value:!0}),c.ThemeService=c.DEFAULT_ANSI_COLORS=void 0;const p=u(7239),w=u(8055),C=u(8460),A=u(844),E=u(2585),f=w.css.toColor("#ffffff"),y=w.css.toColor("#000000"),m=w.css.toColor("#ffffff"),S=w.css.toColor("#000000"),k={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};c.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[w.css.toColor("#2e3436"),w.css.toColor("#cc0000"),w.css.toColor("#4e9a06"),w.css.toColor("#c4a000"),w.css.toColor("#3465a4"),w.css.toColor("#75507b"),w.css.toColor("#06989a"),w.css.toColor("#d3d7cf"),w.css.toColor("#555753"),w.css.toColor("#ef2929"),w.css.toColor("#8ae234"),w.css.toColor("#fce94f"),w.css.toColor("#729fcf"),w.css.toColor("#ad7fa8"),w.css.toColor("#34e2e2"),w.css.toColor("#eeeeec")],T=[0,95,135,175,215,255];for(let I=0;I<216;I++){const K=T[I/36%6|0],F=T[I/6%6|0],G=T[I%6];M.push({css:w.channels.toCss(K,F,G),rgba:w.channels.toRgba(K,F,G)})}for(let I=0;I<24;I++){const K=8+10*I;M.push({css:w.channels.toCss(K,K,K),rgba:w.channels.toRgba(K,K,K)})}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 C.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:f,background:y,cursor:m,cursorAccent:S,selectionForeground:void 0,selectionBackgroundTransparent:k,selectionBackgroundOpaque:w.color.blend(y,k),selectionInactiveBackgroundTransparent:k,selectionInactiveBackgroundOpaque:w.color.blend(y,k),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 T=this._colors;if(T.foreground=R(M.foreground,f),T.background=R(M.background,y),T.cursor=R(M.cursor,m),T.cursorAccent=R(M.cursorAccent,S),T.selectionBackgroundTransparent=R(M.selectionBackground,k),T.selectionBackgroundOpaque=w.color.blend(T.background,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundTransparent=R(M.selectionInactiveBackground,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundOpaque=w.color.blend(T.background,T.selectionInactiveBackgroundTransparent),T.selectionForeground=M.selectionForeground?R(M.selectionForeground,w.NULL_COLOR):void 0,T.selectionForeground===w.NULL_COLOR&&(T.selectionForeground=void 0),w.color.isOpaque(T.selectionBackgroundTransparent)&&(T.selectionBackgroundTransparent=w.color.opacity(T.selectionBackgroundTransparent,.3)),w.color.isOpaque(T.selectionInactiveBackgroundTransparent)&&(T.selectionInactiveBackgroundTransparent=w.color.opacity(T.selectionInactiveBackgroundTransparent,.3)),T.ansi=c.DEFAULT_ANSI_COLORS.slice(),T.ansi[0]=R(M.black,c.DEFAULT_ANSI_COLORS[0]),T.ansi[1]=R(M.red,c.DEFAULT_ANSI_COLORS[1]),T.ansi[2]=R(M.green,c.DEFAULT_ANSI_COLORS[2]),T.ansi[3]=R(M.yellow,c.DEFAULT_ANSI_COLORS[3]),T.ansi[4]=R(M.blue,c.DEFAULT_ANSI_COLORS[4]),T.ansi[5]=R(M.magenta,c.DEFAULT_ANSI_COLORS[5]),T.ansi[6]=R(M.cyan,c.DEFAULT_ANSI_COLORS[6]),T.ansi[7]=R(M.white,c.DEFAULT_ANSI_COLORS[7]),T.ansi[8]=R(M.brightBlack,c.DEFAULT_ANSI_COLORS[8]),T.ansi[9]=R(M.brightRed,c.DEFAULT_ANSI_COLORS[9]),T.ansi[10]=R(M.brightGreen,c.DEFAULT_ANSI_COLORS[10]),T.ansi[11]=R(M.brightYellow,c.DEFAULT_ANSI_COLORS[11]),T.ansi[12]=R(M.brightBlue,c.DEFAULT_ANSI_COLORS[12]),T.ansi[13]=R(M.brightMagenta,c.DEFAULT_ANSI_COLORS[13]),T.ansi[14]=R(M.brightCyan,c.DEFAULT_ANSI_COLORS[14]),T.ansi[15]=R(M.brightWhite,c.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const I=Math.min(T.ansi.length-16,M.extendedAnsi.length);for(let K=0;K<I;K++)T.ansi[K+16]=R(M.extendedAnsi[K],c.DEFAULT_ANSI_COLORS[K+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 T=0;T<this._restoreColors.ansi.length;++T)this._colors.ansi[T]=this._restoreColors.ansi[T]}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,T){if(M!==void 0)try{return w.css.toColor(M)}catch{}return T}c.ThemeService=L=d([b(0,E.IOptionsService)],L)},6349:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CircularList=void 0;const d=u(8460),b=u(844);class p extends b.Disposable{constructor(C){super(),this._maxLength=C,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(C){if(this._maxLength===C)return;const A=new Array(C);for(let E=0;E<Math.min(C,this.length);E++)A[E]=this._array[this._getCyclicIndex(E)];this._array=A,this._maxLength=C,this._startIndex=0}get length(){return this._length}set length(C){if(C>this._length)for(let A=this._length;A<C;A++)this._array[A]=void 0;this._length=C}get(C){return this._array[this._getCyclicIndex(C)]}set(C,A){this._array[this._getCyclicIndex(C)]=A}push(C){this._array[this._getCyclicIndex(this._length)]=C,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(C,A,...E){if(A){for(let f=C;f<this._length-A;f++)this._array[this._getCyclicIndex(f)]=this._array[this._getCyclicIndex(f+A)];this._length-=A,this.onDeleteEmitter.fire({index:C,amount:A})}for(let f=this._length-1;f>=C;f--)this._array[this._getCyclicIndex(f+E.length)]=this._array[this._getCyclicIndex(f)];for(let f=0;f<E.length;f++)this._array[this._getCyclicIndex(C+f)]=E[f];if(E.length&&this.onInsertEmitter.fire({index:C,amount:E.length}),this._length+E.length>this._maxLength){const f=this._length+E.length-this._maxLength;this._startIndex+=f,this._length=this._maxLength,this.onTrimEmitter.fire(f)}else this._length+=E.length}trimStart(C){C>this._length&&(C=this._length),this._startIndex+=C,this._length-=C,this.onTrimEmitter.fire(C)}shiftElements(C,A,E){if(!(A<=0)){if(C<0||C>=this._length)throw new Error("start argument out of range");if(C+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(C+y+E,this.get(C+y));const f=C+A+E-this._length;if(f>0)for(this._length+=f;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let f=0;f<A;f++)this.set(C+f+E,this.get(C+f))}}_getCyclicIndex(C){return(this._startIndex+C)%this._maxLength}}c.CircularList=p},1439:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.clone=void 0,c.clone=function u(d,b=5){if(typeof d!="object")return d;const p=Array.isArray(d)?[]:{};for(const w in d)p[w]=b<=1?d[w]:d[w]&&u(d[w],b-1);return p}},8055:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.contrastRatio=c.toPaddedHex=c.rgba=c.rgb=c.css=c.color=c.channels=c.NULL_COLOR=void 0;let u=0,d=0,b=0,p=0;var w,C,A,E,f;function y(S){const k=S.toString(16);return k.length<2?"0"+k:k}function m(S,k){return S<k?(k+.05)/(S+.05):(S+.05)/(k+.05)}c.NULL_COLOR={css:"#00000000",rgba:0},(function(S){S.toCss=function(k,L,R,M){return M!==void 0?`#${y(k)}${y(L)}${y(R)}${y(M)}`:`#${y(k)}${y(L)}${y(R)}`},S.toRgba=function(k,L,R,M=255){return(k<<24|L<<16|R<<8|M)>>>0},S.toColor=function(k,L,R,M){return{css:S.toCss(k,L,R,M),rgba:S.toRgba(k,L,R,M)}}})(w||(c.channels=w={})),(function(S){function k(L,R){return p=Math.round(255*R),[u,d,b]=f.toChannels(L.rgba),{css:w.toCss(u,d,b,p),rgba:w.toRgba(u,d,b,p)}}S.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,T=R.rgba>>16&255,I=R.rgba>>8&255,K=L.rgba>>24&255,F=L.rgba>>16&255,G=L.rgba>>8&255;return u=K+Math.round((M-K)*p),d=F+Math.round((T-F)*p),b=G+Math.round((I-G)*p),{css:w.toCss(u,d,b),rgba:w.toRgba(u,d,b)}},S.isOpaque=function(L){return(255&L.rgba)==255},S.ensureContrastRatio=function(L,R,M){const T=f.ensureContrastRatio(L.rgba,R.rgba,M);if(T)return w.toColor(T>>24&255,T>>16&255,T>>8&255)},S.opaque=function(L){const R=(255|L.rgba)>>>0;return[u,d,b]=f.toChannels(R),{css:w.toCss(u,d,b),rgba:R}},S.opacity=k,S.multiplyOpacity=function(L,R){return p=255&L.rgba,k(L,p*R/255)},S.toColorRGB=function(L){return[L.rgba>>24&255,L.rgba>>16&255,L.rgba>>8&255]}})(C||(c.color=C={})),(function(S){let k,L;try{const R=document.createElement("canvas");R.width=1,R.height=1;const M=R.getContext("2d",{willReadFrequently:!0});M&&(k=M,k.globalCompositeOperation="copy",L=k.createLinearGradient(0,0,1,1))}catch{}S.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),b=parseInt(R.slice(3,4).repeat(2),16),w.toColor(u,d,b);case 5:return u=parseInt(R.slice(1,2).repeat(2),16),d=parseInt(R.slice(2,3).repeat(2),16),b=parseInt(R.slice(3,4).repeat(2),16),p=parseInt(R.slice(4,5).repeat(2),16),w.toColor(u,d,b,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]),b=parseInt(M[3]),p=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),w.toColor(u,d,b,p);if(!k||!L)throw new Error("css.toColor: Unsupported css format");if(k.fillStyle=L,k.fillStyle=R,typeof k.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(k.fillRect(0,0,1,1),[u,d,b,p]=k.getImageData(0,0,1,1).data,p!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:w.toRgba(u,d,b,p),css:R}}})(A||(c.css=A={})),(function(S){function k(L,R,M){const T=L/255,I=R/255,K=M/255;return .2126*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.7152*(I<=.03928?I/12.92:Math.pow((I+.055)/1.055,2.4))+.0722*(K<=.03928?K/12.92:Math.pow((K+.055)/1.055,2.4))}S.relativeLuminance=function(L){return k(L>>16&255,L>>8&255,255&L)},S.relativeLuminance2=k})(E||(c.rgb=E={})),(function(S){function k(R,M,T){const I=R>>24&255,K=R>>16&255,F=R>>8&255;let G=M>>24&255,B=M>>16&255,Y=M>>8&255,X=m(E.relativeLuminance2(G,B,Y),E.relativeLuminance2(I,K,F));for(;X<T&&(G>0||B>0||Y>0);)G-=Math.max(0,Math.ceil(.1*G)),B-=Math.max(0,Math.ceil(.1*B)),Y-=Math.max(0,Math.ceil(.1*Y)),X=m(E.relativeLuminance2(G,B,Y),E.relativeLuminance2(I,K,F));return(G<<24|B<<16|Y<<8|255)>>>0}function L(R,M,T){const I=R>>24&255,K=R>>16&255,F=R>>8&255;let G=M>>24&255,B=M>>16&255,Y=M>>8&255,X=m(E.relativeLuminance2(G,B,Y),E.relativeLuminance2(I,K,F));for(;X<T&&(G<255||B<255||Y<255);)G=Math.min(255,G+Math.ceil(.1*(255-G))),B=Math.min(255,B+Math.ceil(.1*(255-B))),Y=Math.min(255,Y+Math.ceil(.1*(255-Y))),X=m(E.relativeLuminance2(G,B,Y),E.relativeLuminance2(I,K,F));return(G<<24|B<<16|Y<<8|255)>>>0}S.blend=function(R,M){if(p=(255&M)/255,p===1)return M;const T=M>>24&255,I=M>>16&255,K=M>>8&255,F=R>>24&255,G=R>>16&255,B=R>>8&255;return u=F+Math.round((T-F)*p),d=G+Math.round((I-G)*p),b=B+Math.round((K-B)*p),w.toRgba(u,d,b)},S.ensureContrastRatio=function(R,M,T){const I=E.relativeLuminance(R>>8),K=E.relativeLuminance(M>>8);if(m(I,K)<T){if(K<I){const B=k(R,M,T),Y=m(I,E.relativeLuminance(B>>8));if(Y<T){const X=L(R,M,T);return Y>m(I,E.relativeLuminance(X>>8))?B:X}return B}const F=L(R,M,T),G=m(I,E.relativeLuminance(F>>8));if(G<T){const B=k(R,M,T);return G>m(I,E.relativeLuminance(B>>8))?F:B}return F}},S.reduceLuminance=k,S.increaseLuminance=L,S.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(f||(c.rgba=f={})),c.toPaddedHex=y,c.contrastRatio=m},8969:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreTerminal=void 0;const d=u(844),b=u(2585),p=u(4348),w=u(7866),C=u(744),A=u(7302),E=u(6975),f=u(8460),y=u(1753),m=u(1480),S=u(7994),k=u(9282),L=u(5435),R=u(5981),M=u(2660);let T=!1;class I extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new f.EventEmitter),this._onScroll.event((F=>{this._onScrollApi?.fire(F.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(F){for(const G in F)this.optionsService.options[G]=F[G]}constructor(F){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new f.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new f.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new f.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new f.EventEmitter),this._instantiationService=new p.InstantiationService,this.optionsService=this.register(new A.OptionsService(F)),this._instantiationService.setService(b.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(C.BufferService)),this._instantiationService.setService(b.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(w.LogService)),this._instantiationService.setService(b.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(E.CoreService)),this._instantiationService.setService(b.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(y.CoreMouseService)),this._instantiationService.setService(b.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(m.UnicodeService)),this._instantiationService.setService(b.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(S.CharsetService),this._instantiationService.setService(b.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(M.OscLinkService),this._instantiationService.setService(b.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,f.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,f.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,f.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,f.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((G=>{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((G=>{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(((G,B)=>this._inputHandler.parse(G,B)))),this.register((0,f.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(F,G){this._writeBuffer.write(F,G)}writeSync(F,G){this._logService.logLevel<=b.LogLevelEnum.WARN&&!T&&(this._logService.warn("writeSync is unreliable and will be removed soon."),T=!0),this._writeBuffer.writeSync(F,G)}input(F,G=!0){this.coreService.triggerDataEvent(F,G)}resize(F,G){isNaN(F)||isNaN(G)||(F=Math.max(F,C.MINIMUM_COLS),G=Math.max(G,C.MINIMUM_ROWS),this._bufferService.resize(F,G))}scroll(F,G=!1){this._bufferService.scroll(F,G)}scrollLines(F,G,B){this._bufferService.scrollLines(F,G,B)}scrollPages(F){this.scrollLines(F*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(F){const G=F-this._bufferService.buffer.ydisp;G!==0&&this.scrollLines(G)}registerEscHandler(F,G){return this._inputHandler.registerEscHandler(F,G)}registerDcsHandler(F,G){return this._inputHandler.registerDcsHandler(F,G)}registerCsiHandler(F,G){return this._inputHandler.registerCsiHandler(F,G)}registerOscHandler(F,G){return this._inputHandler.registerOscHandler(F,G)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let F=!1;const G=this.optionsService.rawOptions.windowsPty;G&&G.buildNumber!==void 0&&G.buildNumber!==void 0?F=G.backend==="conpty"&&G.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(F=!0),F?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const F=[];F.push(this.onLineFeed(k.updateWindowsModeWrappedState.bind(null,this._bufferService))),F.push(this.registerCsiHandler({final:"H"},(()=>((0,k.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const G of F)G.dispose()}))}}}c.CoreTerminal=I},8460:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.runAndSubscribe=c.forwardEvent=c.EventEmitter=void 0,c.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const b=[];for(let p=0;p<this._listeners.length;p++)b.push(this._listeners[p]);for(let p=0;p<b.length;p++)b[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((b=>d.fire(b)))},c.runAndSubscribe=function(u,d){return d(void 0),u((b=>d(b)))}},5435:function(_,c,u){var d=this&&this.__decorate||function(V,D,P,O){var z,W=arguments.length,Z=W<3?D:O===null?O=Object.getOwnPropertyDescriptor(D,P):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(V,D,P,O);else for(var ie=V.length-1;ie>=0;ie--)(z=V[ie])&&(Z=(W<3?z(Z):W>3?z(D,P,Z):z(D,P))||Z);return W>3&&Z&&Object.defineProperty(D,P,Z),Z},b=this&&this.__param||function(V,D){return function(P,O){D(P,O,V)}};Object.defineProperty(c,"__esModule",{value:!0}),c.InputHandler=c.WindowsOptionsReportType=void 0;const p=u(2584),w=u(7116),C=u(2015),A=u(844),E=u(482),f=u(8437),y=u(8460),m=u(643),S=u(511),k=u(3734),L=u(2585),R=u(1480),M=u(6242),T=u(6351),I=u(5941),K={"(":0,")":1,"*":2,"+":3,"-":1,".":2},F=131072;function G(V,D){if(V>24)return D.setWinLines||!1;switch(V){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 B;(function(V){V[V.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",V[V.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(B||(c.WindowsOptionsReportType=B={}));let Y=0;class X extends A.Disposable{getAttrData(){return this._curAttrData}constructor(D,P,O,z,W,Z,ie,he,te=new C.EscapeSequenceParser){super(),this._bufferService=D,this._charsetService=P,this._coreService=O,this._logService=z,this._optionsService=W,this._oscLinkService=Z,this._coreMouseService=ie,this._unicodeService=he,this._parser=te,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new E.StringToUtf32,this._utf8Decoder=new E.Utf8ToUtf32,this._workCell=new S.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=f.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=f.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 H(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(($=>this._activeBuffer=$.activeBuffer))),this._parser.setCsiHandlerFallback((($,le)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString($),params:le.toArray()})})),this._parser.setEscHandlerFallback(($=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString($)})})),this._parser.setExecuteHandlerFallback(($=>{this._logService.debug("Unknown EXECUTE code: ",{code:$})})),this._parser.setOscHandlerFallback((($,le,ge)=>{this._logService.debug("Unknown OSC code: ",{identifier:$,action:le,data:ge})})),this._parser.setDcsHandlerFallback((($,le,ge)=>{le==="HOOK"&&(ge=ge.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString($),action:le,payload:ge})})),this._parser.setPrintHandler((($,le,ge)=>this.print($,le,ge))),this._parser.registerCsiHandler({final:"@"},($=>this.insertChars($))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},($=>this.scrollLeft($))),this._parser.registerCsiHandler({final:"A"},($=>this.cursorUp($))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},($=>this.scrollRight($))),this._parser.registerCsiHandler({final:"B"},($=>this.cursorDown($))),this._parser.registerCsiHandler({final:"C"},($=>this.cursorForward($))),this._parser.registerCsiHandler({final:"D"},($=>this.cursorBackward($))),this._parser.registerCsiHandler({final:"E"},($=>this.cursorNextLine($))),this._parser.registerCsiHandler({final:"F"},($=>this.cursorPrecedingLine($))),this._parser.registerCsiHandler({final:"G"},($=>this.cursorCharAbsolute($))),this._parser.registerCsiHandler({final:"H"},($=>this.cursorPosition($))),this._parser.registerCsiHandler({final:"I"},($=>this.cursorForwardTab($))),this._parser.registerCsiHandler({final:"J"},($=>this.eraseInDisplay($,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},($=>this.eraseInDisplay($,!0))),this._parser.registerCsiHandler({final:"K"},($=>this.eraseInLine($,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},($=>this.eraseInLine($,!0))),this._parser.registerCsiHandler({final:"L"},($=>this.insertLines($))),this._parser.registerCsiHandler({final:"M"},($=>this.deleteLines($))),this._parser.registerCsiHandler({final:"P"},($=>this.deleteChars($))),this._parser.registerCsiHandler({final:"S"},($=>this.scrollUp($))),this._parser.registerCsiHandler({final:"T"},($=>this.scrollDown($))),this._parser.registerCsiHandler({final:"X"},($=>this.eraseChars($))),this._parser.registerCsiHandler({final:"Z"},($=>this.cursorBackwardTab($))),this._parser.registerCsiHandler({final:"`"},($=>this.charPosAbsolute($))),this._parser.registerCsiHandler({final:"a"},($=>this.hPositionRelative($))),this._parser.registerCsiHandler({final:"b"},($=>this.repeatPrecedingCharacter($))),this._parser.registerCsiHandler({final:"c"},($=>this.sendDeviceAttributesPrimary($))),this._parser.registerCsiHandler({prefix:">",final:"c"},($=>this.sendDeviceAttributesSecondary($))),this._parser.registerCsiHandler({final:"d"},($=>this.linePosAbsolute($))),this._parser.registerCsiHandler({final:"e"},($=>this.vPositionRelative($))),this._parser.registerCsiHandler({final:"f"},($=>this.hVPosition($))),this._parser.registerCsiHandler({final:"g"},($=>this.tabClear($))),this._parser.registerCsiHandler({final:"h"},($=>this.setMode($))),this._parser.registerCsiHandler({prefix:"?",final:"h"},($=>this.setModePrivate($))),this._parser.registerCsiHandler({final:"l"},($=>this.resetMode($))),this._parser.registerCsiHandler({prefix:"?",final:"l"},($=>this.resetModePrivate($))),this._parser.registerCsiHandler({final:"m"},($=>this.charAttributes($))),this._parser.registerCsiHandler({final:"n"},($=>this.deviceStatus($))),this._parser.registerCsiHandler({prefix:"?",final:"n"},($=>this.deviceStatusPrivate($))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},($=>this.softReset($))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},($=>this.setCursorStyle($))),this._parser.registerCsiHandler({final:"r"},($=>this.setScrollRegion($))),this._parser.registerCsiHandler({final:"s"},($=>this.saveCursor($))),this._parser.registerCsiHandler({final:"t"},($=>this.windowOptions($))),this._parser.registerCsiHandler({final:"u"},($=>this.restoreCursor($))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},($=>this.insertColumns($))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},($=>this.deleteColumns($))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},($=>this.selectProtected($))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},($=>this.requestMode($,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},($=>this.requestMode($,!1))),this._parser.setExecuteHandler(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(($=>(this.setTitle($),this.setIconName($),!0)))),this._parser.registerOscHandler(1,new M.OscHandler(($=>this.setIconName($)))),this._parser.registerOscHandler(2,new M.OscHandler(($=>this.setTitle($)))),this._parser.registerOscHandler(4,new M.OscHandler(($=>this.setOrReportIndexedColor($)))),this._parser.registerOscHandler(8,new M.OscHandler(($=>this.setHyperlink($)))),this._parser.registerOscHandler(10,new M.OscHandler(($=>this.setOrReportFgColor($)))),this._parser.registerOscHandler(11,new M.OscHandler(($=>this.setOrReportBgColor($)))),this._parser.registerOscHandler(12,new M.OscHandler(($=>this.setOrReportCursorColor($)))),this._parser.registerOscHandler(104,new M.OscHandler(($=>this.restoreIndexedColor($)))),this._parser.registerOscHandler(110,new M.OscHandler(($=>this.restoreFgColor($)))),this._parser.registerOscHandler(111,new M.OscHandler(($=>this.restoreBgColor($)))),this._parser.registerOscHandler(112,new M.OscHandler(($=>this.restoreCursorColor($)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const $ in w.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:$},(()=>this.selectCharset("("+$))),this._parser.registerEscHandler({intermediates:")",final:$},(()=>this.selectCharset(")"+$))),this._parser.registerEscHandler({intermediates:"*",final:$},(()=>this.selectCharset("*"+$))),this._parser.registerEscHandler({intermediates:"+",final:$},(()=>this.selectCharset("+"+$))),this._parser.registerEscHandler({intermediates:"-",final:$},(()=>this.selectCharset("-"+$))),this._parser.registerEscHandler({intermediates:".",final:$},(()=>this.selectCharset("."+$))),this._parser.registerEscHandler({intermediates:"/",final:$},(()=>this.selectCharset("/"+$)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler(($=>(this._logService.error("Parsing error: ",$),$))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new T.DcsHandler((($,le)=>this.requestStatusString($,le))))}_preserveStack(D,P,O,z){this._parseStack.paused=!0,this._parseStack.cursorStartX=D,this._parseStack.cursorStartY=P,this._parseStack.decodedLength=O,this._parseStack.position=z}_logSlowResolvingAsync(D){this._logService.logLevel<=L.LogLevelEnum.WARN&&Promise.race([D,new Promise(((P,O)=>setTimeout((()=>O("#SLOW_TIMEOUT")),5e3)))]).catch((P=>{if(P!=="#SLOW_TIMEOUT")throw P;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(D,P){let O,z=this._activeBuffer.x,W=this._activeBuffer.y,Z=0;const ie=this._parseStack.paused;if(ie){if(O=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,P))return this._logSlowResolvingAsync(O),O;z=this._parseStack.cursorStartX,W=this._parseStack.cursorStartY,this._parseStack.paused=!1,D.length>F&&(Z=this._parseStack.position+F)}if(this._logService.logLevel<=L.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof D=="string"?` "${D}"`:` "${Array.prototype.map.call(D,($=>String.fromCharCode($))).join("")}"`),typeof D=="string"?D.split("").map(($=>$.charCodeAt(0))):D),this._parseBuffer.length<D.length&&this._parseBuffer.length<F&&(this._parseBuffer=new Uint32Array(Math.min(D.length,F))),ie||this._dirtyRowTracker.clearRange(),D.length>F)for(let $=Z;$<D.length;$+=F){const le=$+F<D.length?$+F:D.length,ge=typeof D=="string"?this._stringDecoder.decode(D.substring($,le),this._parseBuffer):this._utf8Decoder.decode(D.subarray($,le),this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,ge))return this._preserveStack(z,W,ge,$),this._logSlowResolvingAsync(O),O}else if(!ie){const $=typeof D=="string"?this._stringDecoder.decode(D,this._parseBuffer):this._utf8Decoder.decode(D,this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,$))return this._preserveStack(z,W,$,0),this._logSlowResolvingAsync(O),O}this._activeBuffer.x===z&&this._activeBuffer.y===W||this._onCursorMove.fire();const he=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),te=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);te<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(te,this._bufferService.rows-1),Math.min(he,this._bufferService.rows-1))}print(D,P,O){let z,W;const Z=this._charsetService.charset,ie=this._optionsService.rawOptions.screenReaderMode,he=this._bufferService.cols,te=this._coreService.decPrivateModes.wraparound,$=this._coreService.modes.insertMode,le=this._curAttrData;let ge=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&O-P>0&&ge.getWidth(this._activeBuffer.x-1)===2&&ge.setCellFromCodepoint(this._activeBuffer.x-1,0,1,le);let we=this._parser.precedingJoinState;for(let Se=P;Se<O;++Se){if(z=D[Se],z<127&&Z){const vt=Z[String.fromCharCode(z)];vt&&(z=vt.charCodeAt(0))}const je=this._unicodeService.charProperties(z,we);W=R.UnicodeService.extractWidth(je);const Ie=R.UnicodeService.extractShouldJoin(je),Ge=Ie?R.UnicodeService.extractWidth(we):0;if(we=je,ie&&this._onA11yChar.fire((0,E.stringFromCodePoint)(z)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+W-Ge>he){if(te){const vt=ge;let Le=this._activeBuffer.x-Ge;for(this._activeBuffer.x=Ge,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),ge=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ge>0&&ge instanceof f.BufferLine&&ge.copyCellsFrom(vt,Le,0,Ge,!1);Le<he;)vt.setCellFromCodepoint(Le++,0,1,le)}else if(this._activeBuffer.x=he-1,W===2)continue}if(Ie&&this._activeBuffer.x){const vt=ge.getWidth(this._activeBuffer.x-1)?1:2;ge.addCodepointToCell(this._activeBuffer.x-vt,z,W);for(let Le=W-Ge;--Le>=0;)ge.setCellFromCodepoint(this._activeBuffer.x++,0,0,le)}else if($&&(ge.insertCells(this._activeBuffer.x,W-Ge,this._activeBuffer.getNullCell(le)),ge.getWidth(he-1)===2&&ge.setCellFromCodepoint(he-1,m.NULL_CELL_CODE,m.NULL_CELL_WIDTH,le)),ge.setCellFromCodepoint(this._activeBuffer.x++,z,W,le),W>0)for(;--W;)ge.setCellFromCodepoint(this._activeBuffer.x++,0,0,le)}this._parser.precedingJoinState=we,this._activeBuffer.x<he&&O-P>0&&ge.getWidth(this._activeBuffer.x)===0&&!ge.hasContent(this._activeBuffer.x)&&ge.setCellFromCodepoint(this._activeBuffer.x,0,1,le),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(D,P){return D.final!=="t"||D.prefix||D.intermediates?this._parser.registerCsiHandler(D,P):this._parser.registerCsiHandler(D,(O=>!G(O.params[0],this._optionsService.rawOptions.windowOptions)||P(O)))}registerDcsHandler(D,P){return this._parser.registerDcsHandler(D,new T.DcsHandler(P))}registerEscHandler(D,P){return this._parser.registerEscHandler(D,P)}registerOscHandler(D,P){return this._parser.registerOscHandler(D,new M.OscHandler(P))}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,P){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=D,this._activeBuffer.y=this._activeBuffer.scrollTop+P):(this._activeBuffer.x=D,this._activeBuffer.y=P),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(D,P){this._restrictCursor(),this._setCursor(this._activeBuffer.x+D,this._activeBuffer.y+P)}cursorUp(D){const P=this._activeBuffer.y-this._activeBuffer.scrollTop;return P>=0?this._moveCursor(0,-Math.min(P,D.params[0]||1)):this._moveCursor(0,-(D.params[0]||1)),!0}cursorDown(D){const P=this._activeBuffer.scrollBottom-this._activeBuffer.y;return P>=0?this._moveCursor(0,Math.min(P,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 P=D.params[0];return P===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:P===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(D){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let P=D.params[0]||1;for(;P--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(D){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let P=D.params[0]||1;for(;P--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(D){const P=D.params[0];return P===1&&(this._curAttrData.bg|=536870912),P!==2&&P!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(D,P,O,z=!1,W=!1){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);Z.replaceCells(P,O,this._activeBuffer.getNullCell(this._eraseAttrData()),W),z&&(Z.isWrapped=!1)}_resetBufferLine(D,P=!1){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);O&&(O.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),P),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+D),O.isWrapped=!1)}eraseInDisplay(D,P=!1){let O;switch(this._restrictCursor(this._bufferService.cols),D.params[0]){case 0:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,P);O<this._bufferService.rows;O++)this._resetBufferLine(O,P);this._dirtyRowTracker.markDirty(O);break;case 1:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O,0,this._activeBuffer.x+1,!0,P),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(O+1).isWrapped=!1);O--;)this._resetBufferLine(O,P);this._dirtyRowTracker.markDirty(0);break;case 2:for(O=this._bufferService.rows,this._dirtyRowTracker.markDirty(O-1);O--;)this._resetBufferLine(O,P);this._dirtyRowTracker.markDirty(0);break;case 3:const z=this._activeBuffer.lines.length-this._bufferService.rows;z>0&&(this._activeBuffer.lines.trimStart(z),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-z,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-z,0),this._onScroll.fire(0))}return!0}eraseInLine(D,P=!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,P);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,P);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,P)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(D){this._restrictCursor();let P=D.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y,z=this._bufferService.rows-1-this._activeBuffer.scrollBottom,W=this._bufferService.rows-1+this._activeBuffer.ybase-z+1;for(;P--;)this._activeBuffer.lines.splice(W-1,1),this._activeBuffer.lines.splice(O,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 P=D.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y;let z;for(z=this._bufferService.rows-1-this._activeBuffer.scrollBottom,z=this._bufferService.rows-1+this._activeBuffer.ybase-z;P--;)this._activeBuffer.lines.splice(O,1),this._activeBuffer.lines.splice(z,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 P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return P&&(P.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 P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return P&&(P.deleteCells(this._activeBuffer.x,D.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(D){let P=D.params[0]||1;for(;P--;)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 P=D.params[0]||1;for(;P--;)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(f.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 P=D.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);z.deleteCells(0,P,this._activeBuffer.getNullCell(this._eraseAttrData())),z.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 P=D.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);z.insertCells(0,P,this._activeBuffer.getNullCell(this._eraseAttrData())),z.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 P=D.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);z.insertCells(this._activeBuffer.x,P,this._activeBuffer.getNullCell(this._eraseAttrData())),z.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 P=D.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);z.deleteCells(this._activeBuffer.x,P,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(D){this._restrictCursor();const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return P&&(P.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 P=this._parser.precedingJoinState;if(!P)return!0;const O=D.params[0]||1,z=R.UnicodeService.extractWidth(P),W=this._activeBuffer.x-z,Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(W),ie=new Uint32Array(Z.length*O);let he=0;for(let $=0;$<Z.length;){const le=Z.codePointAt($)||0;ie[he++]=le,$+=le>65535?2:1}let te=he;for(let $=1;$<O;++$)ie.copyWithin(te,0,he),te+=he;return this.print(ie,0,te),!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 P=0;P<D.length;P++)switch(D.params[P]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(D){for(let P=0;P<D.length;P++)switch(D.params[P]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,w.DEFAULT_CHARSET),this._charsetService.setgCharset(1,w.DEFAULT_CHARSET),this._charsetService.setgCharset(2,w.DEFAULT_CHARSET),this._charsetService.setgCharset(3,w.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 P=0;P<D.length;P++)switch(D.params[P]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(D){for(let P=0;P<D.length;P++)switch(D.params[P]){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[P]===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,P){const O=this._coreService.decPrivateModes,{activeProtocol:z,activeEncoding:W}=this._coreMouseService,Z=this._coreService,{buffers:ie,cols:he}=this._bufferService,{active:te,alt:$}=ie,le=this._optionsService.rawOptions,ge=Ie=>Ie?1:2,we=D.params[0];return Se=we,je=P?we===2?4:we===4?ge(Z.modes.insertMode):we===12?3:we===20?ge(le.convertEol):0:we===1?ge(O.applicationCursorKeys):we===3?le.windowOptions.setWinLines?he===80?2:he===132?1:0:0:we===6?ge(O.origin):we===7?ge(O.wraparound):we===8?3:we===9?ge(z==="X10"):we===12?ge(le.cursorBlink):we===25?ge(!Z.isCursorHidden):we===45?ge(O.reverseWraparound):we===66?ge(O.applicationKeypad):we===67?4:we===1e3?ge(z==="VT200"):we===1002?ge(z==="DRAG"):we===1003?ge(z==="ANY"):we===1004?ge(O.sendFocus):we===1005?4:we===1006?ge(W==="SGR"):we===1015?4:we===1016?ge(W==="SGR_PIXELS"):we===1048?1:we===47||we===1047||we===1049?ge(te===$):we===2004?ge(O.bracketedPasteMode):0,Z.triggerDataEvent(`${p.C0.ESC}[${P?"":"?"}${Se};${je}$y`),!0;var Se,je}_updateAttrColor(D,P,O,z,W){return P===2?(D|=50331648,D&=-16777216,D|=k.AttributeData.fromColorRGB([O,z,W])):P===5&&(D&=-50331904,D|=33554432|255&O),D}_extractColor(D,P,O){const z=[0,0,-1,0,0,0];let W=0,Z=0;do{if(z[Z+W]=D.params[P+Z],D.hasSubParams(P+Z)){const ie=D.getSubParams(P+Z);let he=0;do z[1]===5&&(W=1),z[Z+he+1+W]=ie[he];while(++he<ie.length&&he+Z+1+W<z.length);break}if(z[1]===5&&Z+W>=2||z[1]===2&&Z+W>=5)break;z[1]&&(W=1)}while(++Z+P<D.length&&Z+W<z.length);for(let ie=2;ie<z.length;++ie)z[ie]===-1&&(z[ie]=0);switch(z[0]){case 38:O.fg=this._updateAttrColor(O.fg,z[1],z[3],z[4],z[5]);break;case 48:O.bg=this._updateAttrColor(O.bg,z[1],z[3],z[4],z[5]);break;case 58:O.extended=O.extended.clone(),O.extended.underlineColor=this._updateAttrColor(O.extended.underlineColor,z[1],z[3],z[4],z[5])}return Z}_processUnderline(D,P){P.extended=P.extended.clone(),(!~D||D>5)&&(D=1),P.extended.underlineStyle=D,P.fg|=268435456,D===0&&(P.fg&=-268435457),P.updateExtended()}_processSGR0(D){D.fg=f.DEFAULT_ATTR_DATA.fg,D.bg=f.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 P=D.length;let O;const z=this._curAttrData;for(let W=0;W<P;W++)O=D.params[W],O>=30&&O<=37?(z.fg&=-50331904,z.fg|=16777216|O-30):O>=40&&O<=47?(z.bg&=-50331904,z.bg|=16777216|O-40):O>=90&&O<=97?(z.fg&=-50331904,z.fg|=16777224|O-90):O>=100&&O<=107?(z.bg&=-50331904,z.bg|=16777224|O-100):O===0?this._processSGR0(z):O===1?z.fg|=134217728:O===3?z.bg|=67108864:O===4?(z.fg|=268435456,this._processUnderline(D.hasSubParams(W)?D.getSubParams(W)[0]:1,z)):O===5?z.fg|=536870912:O===7?z.fg|=67108864:O===8?z.fg|=1073741824:O===9?z.fg|=2147483648:O===2?z.bg|=134217728:O===21?this._processUnderline(2,z):O===22?(z.fg&=-134217729,z.bg&=-134217729):O===23?z.bg&=-67108865:O===24?(z.fg&=-268435457,this._processUnderline(0,z)):O===25?z.fg&=-536870913:O===27?z.fg&=-67108865:O===28?z.fg&=-1073741825:O===29?z.fg&=2147483647:O===39?(z.fg&=-67108864,z.fg|=16777215&f.DEFAULT_ATTR_DATA.fg):O===49?(z.bg&=-67108864,z.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):O===38||O===48||O===58?W+=this._extractColor(D,W,z):O===53?z.bg|=1073741824:O===55?z.bg&=-1073741825:O===59?(z.extended=z.extended.clone(),z.extended.underlineColor=-1,z.updateExtended()):O===100?(z.fg&=-67108864,z.fg|=16777215&f.DEFAULT_ATTR_DATA.fg,z.bg&=-67108864,z.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",O);return!0}deviceStatus(D){switch(D.params[0]){case 5:this._coreService.triggerDataEvent(`${p.C0.ESC}[0n`);break;case 6:const P=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[${P};${O}R`)}return!0}deviceStatusPrivate(D){if(D.params[0]===6){const P=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[?${P};${O}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=f.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 P=D.params[0]||1;switch(P){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 O=P%2==1;return this._optionsService.options.cursorBlink=O,!0}setScrollRegion(D){const P=D.params[0]||1;let O;return(D.length<2||(O=D.params[1])>this._bufferService.rows||O===0)&&(O=this._bufferService.rows),O>P&&(this._activeBuffer.scrollTop=P-1,this._activeBuffer.scrollBottom=O-1,this._setCursor(0,0)),!0}windowOptions(D){if(!G(D.params[0],this._optionsService.rawOptions.windowOptions))return!0;const P=D.length>1?D.params[1]:0;switch(D.params[0]){case 14:P!==2&&this._onRequestWindowsOptionsReport.fire(B.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(B.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:P!==0&&P!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),P!==0&&P!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:P!==0&&P!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),P!==0&&P!==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 P=[],O=D.split(";");for(;O.length>1;){const z=O.shift(),W=O.shift();if(/^\d+$/.exec(z)){const Z=parseInt(z);if(q(Z))if(W==="?")P.push({type:0,index:Z});else{const ie=(0,I.parseColor)(W);ie&&P.push({type:1,index:Z,color:ie})}}}return P.length&&this._onColor.fire(P),!0}setHyperlink(D){const P=D.split(";");return!(P.length<2)&&(P[1]?this._createHyperlink(P[0],P[1]):!P[0]&&this._finishHyperlink())}_createHyperlink(D,P){this._getCurrentLinkId()&&this._finishHyperlink();const O=D.split(":");let z;const W=O.findIndex((Z=>Z.startsWith("id=")));return W!==-1&&(z=O[W].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:z,uri:P}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(D,P){const O=D.split(";");for(let z=0;z<O.length&&!(P>=this._specialColors.length);++z,++P)if(O[z]==="?")this._onColor.fire([{type:0,index:this._specialColors[P]}]);else{const W=(0,I.parseColor)(O[z]);W&&this._onColor.fire([{type:1,index:this._specialColors[P],color:W}])}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 P=[],O=D.split(";");for(let z=0;z<O.length;++z)if(/^\d+$/.exec(O[z])){const W=parseInt(O[z]);q(W)&&P.push({type:2,index:W})}return P.length&&this._onColor.fire(P),!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,w.DEFAULT_CHARSET),!0}selectCharset(D){return D.length!==2?(this.selectDefaultCharset(),!0):(D[0]==="/"||this._charsetService.setgCharset(K[D[0]],w.CHARSETS[D[1]]||w.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=f.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=f.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 S.CellData;D.content=4194373,D.fg=this._curAttrData.fg,D.bg=this._curAttrData.bg,this._setCursor(0,0);for(let P=0;P<this._bufferService.rows;++P){const O=this._activeBuffer.ybase+this._activeBuffer.y+P,z=this._activeBuffer.lines.get(O);z&&(z.fill(D),z.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(D,P){const O=this._bufferService.buffer,z=this._optionsService.rawOptions;return(W=>(this._coreService.triggerDataEvent(`${p.C0.ESC}${W}${p.C0.ESC}\\`),!0))(D==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:D==='"p'?'P1$r61;1"p':D==="r"?`P1$r${O.scrollTop+1};${O.scrollBottom+1}r`:D==="m"?"P1$r0m":D===" q"?`P1$r${{block:2,underline:4,bar:6}[z.cursorStyle]-(z.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(D,P){this._dirtyRowTracker.markRangeDirty(D,P)}}c.InputHandler=X;let H=class{constructor(V){this._bufferService=V,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(V){V<this.start?this.start=V:V>this.end&&(this.end=V)}markRangeDirty(V,D){V>D&&(Y=V,V=D,D=Y),V<this.start&&(this.start=V),D>this.end&&(this.end=D)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function q(V){return 0<=V&&V<256}H=d([b(0,L.IBufferService)],H)},844:(_,c)=>{function u(d){for(const b of d)b.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 b=this._disposables.indexOf(d);b!==-1&&this._disposables.splice(b,1)}},c.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){this._isDisposed||d===this._value||(this._value?.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},c.toDisposable=function(d){return{dispose:d}},c.disposeArray=u,c.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},1505:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.FourKeyMap=c.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(b,p,w){this._data[b]||(this._data[b]={}),this._data[b][p]=w}get(b,p){return this._data[b]?this._data[b][p]:void 0}clear(){this._data={}}}c.TwoKeyMap=u,c.FourKeyMap=class{constructor(){this._data=new u}set(d,b,p,w,C){this._data.get(d,b)||this._data.set(d,b,new u),this._data.get(d,b).set(p,w,C)}get(d,b,p,w){return this._data.get(d,b)?.get(p,w)}clear(){this._data.clear()}}},6114:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.isChromeOS=c.isLinux=c.isWindows=c.isIphone=c.isIpad=c.isMac=c.getSafariVersion=c.isSafari=c.isLegacyEdge=c.isFirefox=c.isNode=void 0,c.isNode=typeof process<"u"&&"title"in process;const u=c.isNode?"node":navigator.userAgent,d=c.isNode?"node":navigator.platform;c.isFirefox=u.includes("Firefox"),c.isLegacyEdge=u.includes("Edge"),c.isSafari=/^((?!chrome|android).)*safari/i.test(u),c.getSafariVersion=function(){if(!c.isSafari)return 0;const b=u.match(/Version\/(\d+)/);return b===null||b.length<2?0:parseInt(b[1])},c.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),c.isIpad=d==="iPad",c.isIphone=d==="iPhone",c.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),c.isLinux=d.indexOf("Linux")>=0,c.isChromeOS=/\bCrOS\b/.test(u)},6106:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SortedList=void 0;let u=0;c.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(u=this._search(this._getKey(d)),this._array.splice(u,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const b=this._getKey(d);if(b===void 0||(u=this._search(b),u===-1)||this._getKey(this._array[u])!==b)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])===b);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,b){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do b(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===d)}values(){return[...this._array].values()}_search(d){let b=0,p=this._array.length-1;for(;p>=b;){let w=b+p>>1;const C=this._getKey(this._array[w]);if(C>d)p=w-1;else{if(!(C<d)){for(;w>0&&this._getKey(this._array[w-1])===d;)w--;return w}b=w+1}}return b}}},7226:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DebouncedIdleTask=c.IdleTaskQueue=c.PriorityTaskQueue=void 0;const d=u(6114);class b{constructor(){this._tasks=[],this._i=0}enqueue(C){this._tasks.push(C),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(C){this._idleCallback=void 0;let A=0,E=0,f=C.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=C.timeRemaining(),1.5*E>y)return f-A<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(f-A))}ms`),void this._start();f=y}this.clear()}}class p extends b{_requestCallback(C){return setTimeout((()=>C(this._createDeadline(16))))}_cancelCallback(C){clearTimeout(C)}_createDeadline(C){const A=Date.now()+C;return{timeRemaining:()=>Math.max(0,A-Date.now())}}}c.PriorityTaskQueue=p,c.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends b{_requestCallback(w){return requestIdleCallback(w)}_cancelCallback(w){cancelIdleCallback(w)}}:p,c.DebouncedIdleTask=class{constructor(){this._queue=new c.IdleTaskQueue}set(w){this._queue.clear(),this._queue.enqueue(w)}flush(){this._queue.flush()}}},9282:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.updateWindowsModeWrappedState=void 0;const d=u(643);c.updateWindowsModeWrappedState=function(b){const p=b.buffer.lines.get(b.buffer.ybase+b.buffer.y-1),w=p?.get(b.cols-1),C=b.buffer.lines.get(b.buffer.ybase+b.buffer.y);C&&w&&(C.isWrapped=w[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&w[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ExtendedAttrs=c.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(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,w=0){this._ext=0,this._urlId=0,this._ext=p,this._urlId=w}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}c.ExtendedAttrs=d},9092:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Buffer=c.MAX_BUFFER_SIZE=void 0;const d=u(6349),b=u(7226),p=u(3734),w=u(8437),C=u(4634),A=u(511),E=u(643),f=u(4863),y=u(7116);c.MAX_BUFFER_SIZE=4294967295,c.Buffer=class{constructor(m,S,k){this._hasScrollback=m,this._optionsService=S,this._bufferService=k,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=w.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 b.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(m){return m?(this._nullCell.fg=m.fg,this._nullCell.bg=m.bg,this._nullCell.extended=m.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new p.ExtendedAttrs),this._nullCell}getWhitespaceCell(m){return m?(this._whitespaceCell.fg=m.fg,this._whitespaceCell.bg=m.bg,this._whitespaceCell.extended=m.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new p.ExtendedAttrs),this._whitespaceCell}getBlankLine(m,S){return new w.BufferLine(this._bufferService.cols,this.getNullCell(m),S)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const m=this.ybase+this.y-this.ydisp;return m>=0&&m<this._rows}_getCorrectBufferLength(m){if(!this._hasScrollback)return m;const S=m+this._optionsService.rawOptions.scrollback;return S>c.MAX_BUFFER_SIZE?c.MAX_BUFFER_SIZE:S}fillViewportRows(m){if(this.lines.length===0){m===void 0&&(m=w.DEFAULT_ATTR_DATA);let S=this._rows;for(;S--;)this.lines.push(this.getBlankLine(m))}}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(m,S){const k=this.getNullCell(w.DEFAULT_ATTR_DATA);let L=0;const R=this._getCorrectBufferLength(S);if(R>this.lines.maxLength&&(this.lines.maxLength=R),this.lines.length>0){if(this._cols<m)for(let T=0;T<this.lines.length;T++)L+=+this.lines.get(T).resize(m,k);let M=0;if(this._rows<S)for(let T=this._rows;T<S;T++)this.lines.length<S+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new w.BufferLine(m,k)):this.ybase>0&&this.lines.length<=this.ybase+this.y+M+1?(this.ybase--,M++,this.ydisp>0&&this.ydisp--):this.lines.push(new w.BufferLine(m,k)));else for(let T=this._rows;T>S;T--)this.lines.length>S+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(R<this.lines.maxLength){const T=this.lines.length-R;T>0&&(this.lines.trimStart(T),this.ybase=Math.max(this.ybase-T,0),this.ydisp=Math.max(this.ydisp-T,0),this.savedY=Math.max(this.savedY-T,0)),this.lines.maxLength=R}this.x=Math.min(this.x,m-1),this.y=Math.min(this.y,S-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,m-1),this.scrollTop=0}if(this.scrollBottom=S-1,this._isReflowEnabled&&(this._reflow(m,S),this._cols>m))for(let M=0;M<this.lines.length;M++)L+=+this.lines.get(M).resize(m,k);this._cols=m,this._rows=S,this._memoryCleanupQueue.clear(),L>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let m=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,m=!1);let S=0;for(;this._memoryCleanupPosition<this.lines.length;)if(S+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),S>100)return!0;return m}get _isReflowEnabled(){const m=this._optionsService.rawOptions.windowsPty;return m&&m.buildNumber?this._hasScrollback&&m.backend==="conpty"&&m.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(m,S){this._cols!==m&&(m>this._cols?this._reflowLarger(m,S):this._reflowSmaller(m,S))}_reflowLarger(m,S){const k=(0,C.reflowLargerGetLinesToRemove)(this.lines,this._cols,m,this.ybase+this.y,this.getNullCell(w.DEFAULT_ATTR_DATA));if(k.length>0){const L=(0,C.reflowLargerCreateNewLayout)(this.lines,k);(0,C.reflowLargerApplyNewLayout)(this.lines,L.layout),this._reflowLargerAdjustViewport(m,S,L.countRemoved)}}_reflowLargerAdjustViewport(m,S,k){const L=this.getNullCell(w.DEFAULT_ATTR_DATA);let R=k;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<S&&this.lines.push(new w.BufferLine(m,L))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-k,0)}_reflowSmaller(m,S){const k=this.getNullCell(w.DEFAULT_ATTR_DATA),L=[];let R=0;for(let M=this.lines.length-1;M>=0;M--){let T=this.lines.get(M);if(!T||!T.isWrapped&&T.getTrimmedLength()<=m)continue;const I=[T];for(;T.isWrapped&&M>0;)T=this.lines.get(--M),I.unshift(T);const K=this.ybase+this.y;if(K>=M&&K<M+I.length)continue;const F=I[I.length-1].getTrimmedLength(),G=(0,C.reflowSmallerGetNewLineLengths)(I,this._cols,m),B=G.length-I.length;let Y;Y=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+B):Math.max(0,this.lines.length-this.lines.maxLength+B);const X=[];for(let O=0;O<B;O++){const z=this.getBlankLine(w.DEFAULT_ATTR_DATA,!0);X.push(z)}X.length>0&&(L.push({start:M+I.length+R,newLines:X}),R+=X.length),I.push(...X);let H=G.length-1,q=G[H];q===0&&(H--,q=G[H]);let V=I.length-B-1,D=F;for(;V>=0;){const O=Math.min(D,q);if(I[H]===void 0)break;if(I[H].copyCellsFrom(I[V],D-O,q-O,O,!0),q-=O,q===0&&(H--,q=G[H]),D-=O,D===0){V--;const z=Math.max(V,0);D=(0,C.getWrappedLineTrimmedLength)(I,z,this._cols)}}for(let O=0;O<I.length;O++)G[O]<m&&I[O].setCell(G[O],k);let P=B-Y;for(;P-- >0;)this.ybase===0?this.y<S-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+R)-S&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+B,this.ybase+S-1)}if(L.length>0){const M=[],T=[];for(let H=0;H<this.lines.length;H++)T.push(this.lines.get(H));const I=this.lines.length;let K=I-1,F=0,G=L[F];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let B=0;for(let H=Math.min(this.lines.maxLength-1,I+R-1);H>=0;H--)if(G&&G.start>K+B){for(let q=G.newLines.length-1;q>=0;q--)this.lines.set(H--,G.newLines[q]);H++,M.push({index:K+1,amount:G.newLines.length}),B+=G.newLines.length,G=L[++F]}else this.lines.set(H,T[K--]);let Y=0;for(let H=M.length-1;H>=0;H--)M[H].index+=Y,this.lines.onInsertEmitter.fire(M[H]),Y+=M[H].amount;const X=Math.max(0,I+R-this.lines.maxLength);X>0&&this.lines.onTrimEmitter.fire(X)}}translateBufferLineToString(m,S,k=0,L){const R=this.lines.get(m);return R?R.translateToString(S,k,L):""}getWrappedRangeForLine(m){let S=m,k=m;for(;S>0&&this.lines.get(S).isWrapped;)S--;for(;k+1<this.lines.length&&this.lines.get(k+1).isWrapped;)k++;return{first:S,last:k}}setupTabStops(m){for(m!=null?this.tabs[m]||(m=this.prevStop(m)):(this.tabs={},m=0);m<this._cols;m+=this._optionsService.rawOptions.tabStopWidth)this.tabs[m]=!0}prevStop(m){for(m==null&&(m=this.x);!this.tabs[--m]&&m>0;);return m>=this._cols?this._cols-1:m<0?0:m}nextStop(m){for(m==null&&(m=this.x);!this.tabs[++m]&&m<this._cols;);return m>=this._cols?this._cols-1:m<0?0:m}clearMarkers(m){this._isClearing=!0;for(let S=0;S<this.markers.length;S++)this.markers[S].line===m&&(this.markers[S].dispose(),this.markers.splice(S--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let m=0;m<this.markers.length;m++)this.markers[m].dispose(),this.markers.splice(m--,1);this._isClearing=!1}addMarker(m){const S=new f.Marker(m);return this.markers.push(S),S.register(this.lines.onTrim((k=>{S.line-=k,S.line<0&&S.dispose()}))),S.register(this.lines.onInsert((k=>{S.line>=k.index&&(S.line+=k.amount)}))),S.register(this.lines.onDelete((k=>{S.line>=k.index&&S.line<k.index+k.amount&&S.dispose(),S.line>k.index&&(S.line-=k.amount)}))),S.register(S.onDispose((()=>this._removeMarker(S)))),S}_removeMarker(m){this._isClearing||this.markers.splice(this.markers.indexOf(m),1)}}},8437:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLine=c.DEFAULT_ATTR_DATA=void 0;const d=u(3734),b=u(511),p=u(643),w=u(482);c.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let C=0;class A{constructor(f,y,m=!1){this.isWrapped=m,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*f);const S=y||b.CellData.fromCharData([0,p.NULL_CELL_CHAR,p.NULL_CELL_WIDTH,p.NULL_CELL_CODE]);for(let k=0;k<f;++k)this.setCell(k,S);this.length=f}get(f){const y=this._data[3*f+0],m=2097151&y;return[this._data[3*f+1],2097152&y?this._combined[f]:m?(0,w.stringFromCodePoint)(m):"",y>>22,2097152&y?this._combined[f].charCodeAt(this._combined[f].length-1):m]}set(f,y){this._data[3*f+1]=y[p.CHAR_DATA_ATTR_INDEX],y[p.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[f]=y[1],this._data[3*f+0]=2097152|f|y[p.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*f+0]=y[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[p.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(f){return this._data[3*f+0]>>22}hasWidth(f){return 12582912&this._data[3*f+0]}getFg(f){return this._data[3*f+1]}getBg(f){return this._data[3*f+2]}hasContent(f){return 4194303&this._data[3*f+0]}getCodePoint(f){const y=this._data[3*f+0];return 2097152&y?this._combined[f].charCodeAt(this._combined[f].length-1):2097151&y}isCombined(f){return 2097152&this._data[3*f+0]}getString(f){const y=this._data[3*f+0];return 2097152&y?this._combined[f]:2097151&y?(0,w.stringFromCodePoint)(2097151&y):""}isProtected(f){return 536870912&this._data[3*f+2]}loadCell(f,y){return C=3*f,y.content=this._data[C+0],y.fg=this._data[C+1],y.bg=this._data[C+2],2097152&y.content&&(y.combinedData=this._combined[f]),268435456&y.bg&&(y.extended=this._extendedAttrs[f]),y}setCell(f,y){2097152&y.content&&(this._combined[f]=y.combinedData),268435456&y.bg&&(this._extendedAttrs[f]=y.extended),this._data[3*f+0]=y.content,this._data[3*f+1]=y.fg,this._data[3*f+2]=y.bg}setCellFromCodepoint(f,y,m,S){268435456&S.bg&&(this._extendedAttrs[f]=S.extended),this._data[3*f+0]=y|m<<22,this._data[3*f+1]=S.fg,this._data[3*f+2]=S.bg}addCodepointToCell(f,y,m){let S=this._data[3*f+0];2097152&S?this._combined[f]+=(0,w.stringFromCodePoint)(y):2097151&S?(this._combined[f]=(0,w.stringFromCodePoint)(2097151&S)+(0,w.stringFromCodePoint)(y),S&=-2097152,S|=2097152):S=y|4194304,m&&(S&=-12582913,S|=m<<22),this._data[3*f+0]=S}insertCells(f,y,m){if((f%=this.length)&&this.getWidth(f-1)===2&&this.setCellFromCodepoint(f-1,0,1,m),y<this.length-f){const S=new b.CellData;for(let k=this.length-f-y-1;k>=0;--k)this.setCell(f+y+k,this.loadCell(f+k,S));for(let k=0;k<y;++k)this.setCell(f+k,m)}else for(let S=f;S<this.length;++S)this.setCell(S,m);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,m)}deleteCells(f,y,m){if(f%=this.length,y<this.length-f){const S=new b.CellData;for(let k=0;k<this.length-f-y;++k)this.setCell(f+k,this.loadCell(f+y+k,S));for(let k=this.length-y;k<this.length;++k)this.setCell(k,m)}else for(let S=f;S<this.length;++S)this.setCell(S,m);f&&this.getWidth(f-1)===2&&this.setCellFromCodepoint(f-1,0,1,m),this.getWidth(f)!==0||this.hasContent(f)||this.setCellFromCodepoint(f,0,1,m)}replaceCells(f,y,m,S=!1){if(S)for(f&&this.getWidth(f-1)===2&&!this.isProtected(f-1)&&this.setCellFromCodepoint(f-1,0,1,m),y<this.length&&this.getWidth(y-1)===2&&!this.isProtected(y)&&this.setCellFromCodepoint(y,0,1,m);f<y&&f<this.length;)this.isProtected(f)||this.setCell(f,m),f++;else for(f&&this.getWidth(f-1)===2&&this.setCellFromCodepoint(f-1,0,1,m),y<this.length&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y,0,1,m);f<y&&f<this.length;)this.setCell(f++,m)}resize(f,y){if(f===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const m=3*f;if(f>this.length){if(this._data.buffer.byteLength>=4*m)this._data=new Uint32Array(this._data.buffer,0,m);else{const S=new Uint32Array(m);S.set(this._data),this._data=S}for(let S=this.length;S<f;++S)this.setCell(S,y)}else{this._data=this._data.subarray(0,m);const S=Object.keys(this._combined);for(let L=0;L<S.length;L++){const R=parseInt(S[L],10);R>=f&&delete this._combined[R]}const k=Object.keys(this._extendedAttrs);for(let L=0;L<k.length;L++){const R=parseInt(k[L],10);R>=f&&delete this._extendedAttrs[R]}}return this.length=f,4*m*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const f=new Uint32Array(this._data.length);return f.set(this._data),this._data=f,1}return 0}fill(f,y=!1){if(y)for(let m=0;m<this.length;++m)this.isProtected(m)||this.setCell(m,f);else{this._combined={},this._extendedAttrs={};for(let m=0;m<this.length;++m)this.setCell(m,f)}}copyFrom(f){this.length!==f.length?this._data=new Uint32Array(f._data):this._data.set(f._data),this.length=f.length,this._combined={};for(const y in f._combined)this._combined[y]=f._combined[y];this._extendedAttrs={};for(const y in f._extendedAttrs)this._extendedAttrs[y]=f._extendedAttrs[y];this.isWrapped=f.isWrapped}clone(){const f=new A(0);f._data=new Uint32Array(this._data),f.length=this.length;for(const y in this._combined)f._combined[y]=this._combined[y];for(const y in this._extendedAttrs)f._extendedAttrs[y]=this._extendedAttrs[y];return f.isWrapped=this.isWrapped,f}getTrimmedLength(){for(let f=this.length-1;f>=0;--f)if(4194303&this._data[3*f+0])return f+(this._data[3*f+0]>>22);return 0}getNoBgTrimmedLength(){for(let f=this.length-1;f>=0;--f)if(4194303&this._data[3*f+0]||50331648&this._data[3*f+2])return f+(this._data[3*f+0]>>22);return 0}copyCellsFrom(f,y,m,S,k){const L=f._data;if(k)for(let M=S-1;M>=0;M--){for(let T=0;T<3;T++)this._data[3*(m+M)+T]=L[3*(y+M)+T];268435456&L[3*(y+M)+2]&&(this._extendedAttrs[m+M]=f._extendedAttrs[y+M])}else for(let M=0;M<S;M++){for(let T=0;T<3;T++)this._data[3*(m+M)+T]=L[3*(y+M)+T];268435456&L[3*(y+M)+2]&&(this._extendedAttrs[m+M]=f._extendedAttrs[y+M])}const R=Object.keys(f._combined);for(let M=0;M<R.length;M++){const T=parseInt(R[M],10);T>=y&&(this._combined[T-y+m]=f._combined[T])}}translateToString(f,y,m,S){y=y??0,m=m??this.length,f&&(m=Math.min(m,this.getTrimmedLength())),S&&(S.length=0);let k="";for(;y<m;){const L=this._data[3*y+0],R=2097151&L,M=2097152&L?this._combined[y]:R?(0,w.stringFromCodePoint)(R):p.WHITESPACE_CELL_CHAR;if(k+=M,S)for(let T=0;T<M.length;++T)S.push(y);y+=L>>22||1}return S&&S.push(y),k}}c.BufferLine=A},4841:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.getRangeLength=void 0,c.getRangeLength=function(u,d){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return d*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(_,c)=>{function u(d,b,p){if(b===d.length-1)return d[b].getTrimmedLength();const w=!d[b].hasContent(p-1)&&d[b].getWidth(p-1)===1,C=d[b+1].getWidth(0)===2;return w&&C?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,b,p,w,C){const A=[];for(let E=0;E<d.length-1;E++){let f=E,y=d.get(++f);if(!y.isWrapped)continue;const m=[d.get(E)];for(;f<d.length&&y.isWrapped;)m.push(y),y=d.get(++f);if(w>=E&&w<f){E+=m.length-1;continue}let S=0,k=u(m,S,b),L=1,R=0;for(;L<m.length;){const T=u(m,L,b),I=T-R,K=p-k,F=Math.min(I,K);m[S].copyCellsFrom(m[L],R,k,F,!1),k+=F,k===p&&(S++,k=0),R+=F,R===T&&(L++,R=0),k===0&&S!==0&&m[S-1].getWidth(p-1)===2&&(m[S].copyCellsFrom(m[S-1],p-1,k++,1,!1),m[S-1].setCell(p-1,C))}m[S].replaceCells(k,p,C);let M=0;for(let T=m.length-1;T>0&&(T>S||m[T].getTrimmedLength()===0);T--)M++;M>0&&(A.push(E+m.length-M),A.push(M)),E+=m.length-1}return A},c.reflowLargerCreateNewLayout=function(d,b){const p=[];let w=0,C=b[w],A=0;for(let E=0;E<d.length;E++)if(C===E){const f=b[++w];d.onDeleteEmitter.fire({index:E-A,amount:f}),E+=f-1,A+=f,C=b[++w]}else p.push(E);return{layout:p,countRemoved:A}},c.reflowLargerApplyNewLayout=function(d,b){const p=[];for(let w=0;w<b.length;w++)p.push(d.get(b[w]));for(let w=0;w<p.length;w++)d.set(w,p[w]);d.length=b.length},c.reflowSmallerGetNewLineLengths=function(d,b,p){const w=[],C=d.map(((y,m)=>u(d,m,b))).reduce(((y,m)=>y+m));let A=0,E=0,f=0;for(;f<C;){if(C-f<p){w.push(C-f);break}A+=p;const y=u(d,E,b);A>y&&(A-=y,E++);const m=d[E].getWidth(A-1)===2;m&&A--;const S=m?p-1:p;w.push(S),f+=S}return w},c.getWrappedLineTrimmedLength=u},5295:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferSet=void 0;const d=u(8460),b=u(844),p=u(9092);class w extends b.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=w},511:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CellData=void 0;const d=u(482),b=u(643),p=u(3734);class w 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 w;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[b.CHAR_DATA_ATTR_INDEX],this.bg=0;let E=!1;if(A[b.CHAR_DATA_CHAR_INDEX].length>2)E=!0;else if(A[b.CHAR_DATA_CHAR_INDEX].length===2){const f=A[b.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=f&&f<=56319){const y=A[b.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=y&&y<=57343?this.content=1024*(f-55296)+y-56320+65536|A[b.CHAR_DATA_WIDTH_INDEX]<<22:E=!0}else E=!0}else this.content=A[b.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|A[b.CHAR_DATA_WIDTH_INDEX]<<22;E&&(this.combinedData=A[b.CHAR_DATA_CHAR_INDEX],this.content=2097152|A[b.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.CellData=w},643:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WHITESPACE_CELL_CODE=c.WHITESPACE_CELL_WIDTH=c.WHITESPACE_CELL_CHAR=c.NULL_CELL_CODE=c.NULL_CELL_WIDTH=c.NULL_CELL_CHAR=c.CHAR_DATA_CODE_INDEX=c.CHAR_DATA_WIDTH_INDEX=c.CHAR_DATA_CHAR_INDEX=c.CHAR_DATA_ATTR_INDEX=c.DEFAULT_EXT=c.DEFAULT_ATTR=c.DEFAULT_COLOR=void 0,c.DEFAULT_COLOR=0,c.DEFAULT_ATTR=256|c.DEFAULT_COLOR<<9,c.DEFAULT_EXT=0,c.CHAR_DATA_ATTR_INDEX=0,c.CHAR_DATA_CHAR_INDEX=1,c.CHAR_DATA_WIDTH_INDEX=2,c.CHAR_DATA_CODE_INDEX=3,c.NULL_CELL_CHAR="",c.NULL_CELL_WIDTH=1,c.NULL_CELL_CODE=0,c.WHITESPACE_CELL_CHAR=" ",c.WHITESPACE_CELL_WIDTH=1,c.WHITESPACE_CELL_CODE=32},4863:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Marker=void 0;const d=u(8460),b=u(844);class p{get id(){return this._id}constructor(C){this.line=C,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,b.disposeArray)(this._disposables),this._disposables.length=0)}register(C){return this._disposables.push(C),C}}c.Marker=p,p._nextId=1},7116:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DEFAULT_CHARSET=c.CHARSETS=void 0,c.CHARSETS={},c.DEFAULT_CHARSET=c.CHARSETS.B,c.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},c.CHARSETS.A={"#":"£"},c.CHARSETS.B=void 0,c.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},c.CHARSETS.C=c.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},c.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},c.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},c.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},c.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},c.CHARSETS.E=c.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},c.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},c.CHARSETS.H=c.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},c.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(_,c)=>{var u,d,b;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=`
81
+ `,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}\\`})(b||(c.C1_ESCAPED=b={}))},7399:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.evaluateKeyboardEvent=void 0;const d=u(2584),b={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,w,C,A){const E={type:0,cancel:!1,key:void 0},f=(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=w?d.C0.ESC+"OA":d.C0.ESC+"[A":p.key==="UIKeyInputLeftArrow"?E.key=w?d.C0.ESC+"OD":d.C0.ESC+"[D":p.key==="UIKeyInputRightArrow"?E.key=w?d.C0.ESC+"OC":d.C0.ESC+"[C":p.key==="UIKeyInputDownArrow"&&(E.key=w?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;f?(E.key=d.C0.ESC+"[1;"+(f+1)+"D",E.key===d.C0.ESC+"[1;3D"&&(E.key=d.C0.ESC+(C?"b":"[1;5D"))):E.key=w?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(p.metaKey)break;f?(E.key=d.C0.ESC+"[1;"+(f+1)+"C",E.key===d.C0.ESC+"[1;3C"&&(E.key=d.C0.ESC+(C?"f":"[1;5C"))):E.key=w?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(p.metaKey)break;f?(E.key=d.C0.ESC+"[1;"+(f+1)+"A",C||E.key!==d.C0.ESC+"[1;3A"||(E.key=d.C0.ESC+"[1;5A")):E.key=w?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(p.metaKey)break;f?(E.key=d.C0.ESC+"[1;"+(f+1)+"B",C||E.key!==d.C0.ESC+"[1;3B"||(E.key=d.C0.ESC+"[1;5B")):E.key=w?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=f?d.C0.ESC+"[3;"+(f+1)+"~":d.C0.ESC+"[3~";break;case 36:E.key=f?d.C0.ESC+"[1;"+(f+1)+"H":w?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:E.key=f?d.C0.ESC+"[1;"+(f+1)+"F":w?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:p.shiftKey?E.type=2:p.ctrlKey?E.key=d.C0.ESC+"[5;"+(f+1)+"~":E.key=d.C0.ESC+"[5~";break;case 34:p.shiftKey?E.type=3:p.ctrlKey?E.key=d.C0.ESC+"[6;"+(f+1)+"~":E.key=d.C0.ESC+"[6~";break;case 112:E.key=f?d.C0.ESC+"[1;"+(f+1)+"P":d.C0.ESC+"OP";break;case 113:E.key=f?d.C0.ESC+"[1;"+(f+1)+"Q":d.C0.ESC+"OQ";break;case 114:E.key=f?d.C0.ESC+"[1;"+(f+1)+"R":d.C0.ESC+"OR";break;case 115:E.key=f?d.C0.ESC+"[1;"+(f+1)+"S":d.C0.ESC+"OS";break;case 116:E.key=f?d.C0.ESC+"[15;"+(f+1)+"~":d.C0.ESC+"[15~";break;case 117:E.key=f?d.C0.ESC+"[17;"+(f+1)+"~":d.C0.ESC+"[17~";break;case 118:E.key=f?d.C0.ESC+"[18;"+(f+1)+"~":d.C0.ESC+"[18~";break;case 119:E.key=f?d.C0.ESC+"[19;"+(f+1)+"~":d.C0.ESC+"[19~";break;case 120:E.key=f?d.C0.ESC+"[20;"+(f+1)+"~":d.C0.ESC+"[20~";break;case 121:E.key=f?d.C0.ESC+"[21;"+(f+1)+"~":d.C0.ESC+"[21~";break;case 122:E.key=f?d.C0.ESC+"[23;"+(f+1)+"~":d.C0.ESC+"[23~";break;case 123:E.key=f?d.C0.ESC+"[24;"+(f+1)+"~":d.C0.ESC+"[24~";break;default:if(!p.ctrlKey||p.shiftKey||p.altKey||p.metaKey)if(C&&!A||!p.altKey||p.metaKey)!C||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=b[p.keyCode],m=y?.[p.shiftKey?1:0];if(m)E.key=d.C0.ESC+m;else if(p.keyCode>=65&&p.keyCode<=90){const S=p.ctrlKey?p.keyCode-64:p.keyCode+32;let k=String.fromCharCode(S);p.shiftKey&&(k=k.toUpperCase()),E.key=d.C0.ESC+k}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 S=p.code.slice(3,4);p.shiftKey||(S=S.toLowerCase()),E.key=d.C0.ESC+S,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:(_,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,b=u.length){let p="";for(let w=d;w<b;++w){let C=u[w];C>65535?(C-=65536,p+=String.fromCharCode(55296+(C>>10))+String.fromCharCode(C%1024+56320)):p+=String.fromCharCode(C)}return p},c.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const b=u.length;if(!b)return 0;let p=0,w=0;if(this._interim){const C=u.charCodeAt(w++);56320<=C&&C<=57343?d[p++]=1024*(this._interim-55296)+C-56320+65536:(d[p++]=this._interim,d[p++]=C),this._interim=0}for(let C=w;C<b;++C){const A=u.charCodeAt(C);if(55296<=A&&A<=56319){if(++C>=b)return this._interim=A,p;const E=u.charCodeAt(C);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 b=u.length;if(!b)return 0;let p,w,C,A,E=0,f=0,y=0;if(this.interim[0]){let k=!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 T=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,I=T-M;for(;y<I;){if(y>=b)return 0;if(R=u[y++],(192&R)!=128){y--,k=!0;break}this.interim[M++]=R,L<<=6,L|=63&R}k||(T===2?L<128?y--:d[E++]=L:T===3?L<2048||L>=55296&&L<=57343||L===65279||(d[E++]=L):L<65536||L>1114111||(d[E++]=L)),this.interim.fill(0)}const m=b-4;let S=y;for(;S<b;){for(;!(!(S<m)||128&(p=u[S])||128&(w=u[S+1])||128&(C=u[S+2])||128&(A=u[S+3]));)d[E++]=p,d[E++]=w,d[E++]=C,d[E++]=A,S+=4;if(p=u[S++],p<128)d[E++]=p;else if((224&p)==192){if(S>=b)return this.interim[0]=p,E;if(w=u[S++],(192&w)!=128){S--;continue}if(f=(31&p)<<6|63&w,f<128){S--;continue}d[E++]=f}else if((240&p)==224){if(S>=b)return this.interim[0]=p,E;if(w=u[S++],(192&w)!=128){S--;continue}if(S>=b)return this.interim[0]=p,this.interim[1]=w,E;if(C=u[S++],(192&C)!=128){S--;continue}if(f=(15&p)<<12|(63&w)<<6|63&C,f<2048||f>=55296&&f<=57343||f===65279)continue;d[E++]=f}else if((248&p)==240){if(S>=b)return this.interim[0]=p,E;if(w=u[S++],(192&w)!=128){S--;continue}if(S>=b)return this.interim[0]=p,this.interim[1]=w,E;if(C=u[S++],(192&C)!=128){S--;continue}if(S>=b)return this.interim[0]=p,this.interim[1]=w,this.interim[2]=C,E;if(A=u[S++],(192&A)!=128){S--;continue}if(f=(7&p)<<18|(63&w)<<12|(63&C)<<6|63&A,f<65536||f>1114111)continue;d[E++]=f}}return E}}},225:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const d=u(1480),b=[[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 w;c.UnicodeV6=class{constructor(){if(this.version="6",!w){w=new Uint8Array(65536),w.fill(1),w[0]=0,w.fill(0,1,32),w.fill(0,127,160),w.fill(2,4352,4448),w[9001]=2,w[9002]=2,w.fill(2,11904,42192),w[12351]=1,w.fill(2,44032,55204),w.fill(2,63744,64256),w.fill(2,65040,65050),w.fill(2,65072,65136),w.fill(2,65280,65377),w.fill(2,65504,65511);for(let C=0;C<b.length;++C)w.fill(0,b[C][0],b[C][1]+1)}}wcwidth(C){return C<32?0:C<127?1:C<65536?w[C]:(function(A,E){let f,y=0,m=E.length-1;if(A<E[0][0]||A>E[m][1])return!1;for(;m>=y;)if(f=y+m>>1,A>E[f][1])y=f+1;else{if(!(A<E[f][0]))return!0;m=f-1}return!1})(C,p)?0:C>=131072&&C<=196605||C>=196608&&C<=262141?2:1}charProperties(C,A){let E=this.wcwidth(C),f=E===0&&A!==0;if(f){const y=d.UnicodeService.extractWidth(A);y===0?f=!1:y>E&&(E=y)}return d.UnicodeService.createPropertyValue(0,E,f)}}},5981:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WriteBuffer=void 0;const d=u(8460),b=u(844);class p extends b.Disposable{constructor(C){super(),this._action=C,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(C,A){if(A!==void 0&&this._syncCalls>A)return void(this._syncCalls=0);if(this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let E;for(this._isSyncWriting=!0;E=this._writeBuffer.shift();){this._action(E);const f=this._callbacks.shift();f&&f()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(C,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+=C.length,this._writeBuffer.push(C),this._callbacks.push(A),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(A)}_innerWrite(C=0,A=!0){const E=C||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const f=this._writeBuffer[this._bufferOffset],y=this._action(f,A);if(y){const S=k=>Date.now()-E>=12?setTimeout((()=>this._innerWrite(0,k))):this._innerWrite(E,k);return void y.catch((k=>(queueMicrotask((()=>{throw k})),Promise.resolve(!1)))).then(S)}const m=this._callbacks[this._bufferOffset];if(m&&m(),this._bufferOffset++,this._pendingData-=f.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:(_,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 b(p,w){const C=p.toString(16),A=C.length<2?"0"+C:C;switch(w){case 4:return C[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 w=p.toLowerCase();if(w.indexOf("rgb:")===0){w=w.slice(4);const C=u.exec(w);if(C){const A=C[1]?15:C[4]?255:C[7]?4095:65535;return[Math.round(parseInt(C[1]||C[4]||C[7]||C[10],16)/A*255),Math.round(parseInt(C[2]||C[5]||C[8]||C[11],16)/A*255),Math.round(parseInt(C[3]||C[6]||C[9]||C[12],16)/A*255)]}}else if(w.indexOf("#")===0&&(w=w.slice(1),d.exec(w)&&[3,6,9,12].includes(w.length))){const C=w.length/3,A=[0,0,0];for(let E=0;E<3;++E){const f=parseInt(w.slice(C*E,C*E+C),16);A[E]=C===1?f<<4:C===2?f:C===3?f>>4:f>>8}return A}},c.toRgbString=function(p,w=16){const[C,A,E]=p;return`rgb:${b(C,w)}/${b(A,w)}/${b(E,w)}`}},5770:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.PAYLOAD_LIMIT=void 0,c.PAYLOAD_LIMIT=1e7},6351:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DcsHandler=c.DcsParser=void 0;const d=u(482),b=u(8742),p=u(5770),w=[];c.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=w,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=w}registerHandler(A,E){this._handlers[A]===void 0&&(this._handlers[A]=[]);const f=this._handlers[A];return f.push(E),{dispose:()=>{const y=f.indexOf(E);y!==-1&&f.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=w,this._ident=0}hook(A,E){if(this.reset(),this._ident=A,this._active=this._handlers[A]||w,this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].hook(E);else this._handlerFb(this._ident,"HOOK",E)}put(A,E,f){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(A,E,f);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(A,E,f))}unhook(A,E=!0){if(this._active.length){let f=!1,y=this._active.length-1,m=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,f=E,m=this._stack.fallThrough,this._stack.paused=!1),!m&&f===!1){for(;y>=0&&(f=this._active[y].unhook(A),f!==!0);y--)if(f instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,f;y--}for(;y>=0;y--)if(f=this._active[y].unhook(!1),f instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,f}else this._handlerFb(this._ident,"UNHOOK",A);this._active=w,this._ident=0}};const C=new b.Params;C.addParam(0),c.DcsHandler=class{constructor(A){this._handler=A,this._data="",this._params=C,this._hitLimit=!1}hook(A){this._params=A.length>1||A.params[0]?A.clone():C,this._data="",this._hitLimit=!1}put(A,E,f){this._hitLimit||(this._data+=(0,d.utf32ToString)(A,E,f),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((f=>(this._params=C,this._data="",this._hitLimit=!1,f)));return this._params=C,this._data="",this._hitLimit=!1,E}}},2015:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.EscapeSequenceParser=c.VT500_TRANSITION_TABLE=c.TransitionTable=void 0;const d=u(844),b=u(8742),p=u(6242),w=u(6351);class C{constructor(y){this.table=new Uint8Array(y)}setDefault(y,m){this.table.fill(y<<4|m)}add(y,m,S,k){this.table[m<<8|y]=S<<4|k}addMany(y,m,S,k){for(let L=0;L<y.length;L++)this.table[m<<8|y[L]]=S<<4|k}}c.TransitionTable=C;const A=160;c.VT500_TRANSITION_TABLE=(function(){const f=new C(4095),y=Array.apply(null,Array(256)).map(((M,T)=>T)),m=(M,T)=>y.slice(M,T),S=m(32,127),k=m(0,24);k.push(25),k.push.apply(k,m(28,32));const L=m(0,14);let R;for(R in f.setDefault(1,0),f.addMany(S,0,2,0),L)f.addMany([24,26,153,154],R,3,0),f.addMany(m(128,144),R,3,0),f.addMany(m(144,152),R,3,0),f.add(156,R,0,0),f.add(27,R,11,1),f.add(157,R,4,8),f.addMany([152,158,159],R,0,7),f.add(155,R,11,3),f.add(144,R,11,9);return f.addMany(k,0,3,0),f.addMany(k,1,3,1),f.add(127,1,0,1),f.addMany(k,8,0,8),f.addMany(k,3,3,3),f.add(127,3,0,3),f.addMany(k,4,3,4),f.add(127,4,0,4),f.addMany(k,6,3,6),f.addMany(k,5,3,5),f.add(127,5,0,5),f.addMany(k,2,3,2),f.add(127,2,0,2),f.add(93,1,4,8),f.addMany(S,8,5,8),f.add(127,8,5,8),f.addMany([156,27,24,26,7],8,6,0),f.addMany(m(28,32),8,0,8),f.addMany([88,94,95],1,0,7),f.addMany(S,7,0,7),f.addMany(k,7,0,7),f.add(156,7,0,0),f.add(127,7,0,7),f.add(91,1,11,3),f.addMany(m(64,127),3,7,0),f.addMany(m(48,60),3,8,4),f.addMany([60,61,62,63],3,9,4),f.addMany(m(48,60),4,8,4),f.addMany(m(64,127),4,7,0),f.addMany([60,61,62,63],4,0,6),f.addMany(m(32,64),6,0,6),f.add(127,6,0,6),f.addMany(m(64,127),6,0,0),f.addMany(m(32,48),3,9,5),f.addMany(m(32,48),5,9,5),f.addMany(m(48,64),5,0,6),f.addMany(m(64,127),5,7,0),f.addMany(m(32,48),4,9,5),f.addMany(m(32,48),1,9,2),f.addMany(m(32,48),2,9,2),f.addMany(m(48,127),2,10,0),f.addMany(m(48,80),1,10,0),f.addMany(m(81,88),1,10,0),f.addMany([89,90,92],1,10,0),f.addMany(m(96,127),1,10,0),f.add(80,1,11,9),f.addMany(k,9,0,9),f.add(127,9,0,9),f.addMany(m(28,32),9,0,9),f.addMany(m(32,48),9,9,12),f.addMany(m(48,60),9,8,10),f.addMany([60,61,62,63],9,9,10),f.addMany(k,11,0,11),f.addMany(m(32,128),11,0,11),f.addMany(m(28,32),11,0,11),f.addMany(k,10,0,10),f.add(127,10,0,10),f.addMany(m(28,32),10,0,10),f.addMany(m(48,60),10,8,10),f.addMany([60,61,62,63],10,0,11),f.addMany(m(32,48),10,9,12),f.addMany(k,12,0,12),f.add(127,12,0,12),f.addMany(m(28,32),12,0,12),f.addMany(m(32,48),12,9,12),f.addMany(m(48,64),12,0,11),f.addMany(m(64,127),12,12,13),f.addMany(m(64,127),10,12,13),f.addMany(m(64,127),9,12,13),f.addMany(k,13,13,13),f.addMany(S,13,13,13),f.add(127,13,0,13),f.addMany([27,156,24,26],13,14,0),f.add(A,0,2,0),f.add(A,8,5,8),f.add(A,6,0,6),f.add(A,11,0,11),f.add(A,13,13,13),f})();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 b.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(m,S,k)=>{},this._executeHandlerFb=m=>{},this._csiHandlerFb=(m,S)=>{},this._escHandlerFb=m=>{},this._errorHandlerFb=m=>m,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 w.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(y,m=[64,126]){let S=0;if(y.prefix){if(y.prefix.length>1)throw new Error("only one byte as prefix supported");if(S=y.prefix.charCodeAt(0),S&&60>S||S>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");S<<=8,S|=R}}if(y.final.length!==1)throw new Error("final must be a single byte");const k=y.final.charCodeAt(0);if(m[0]>k||k>m[1])throw new Error(`final must be in range ${m[0]} .. ${m[1]}`);return S<<=8,S|=k,S}identToString(y){const m=[];for(;y;)m.push(String.fromCharCode(255&y)),y>>=8;return m.reverse().join("")}setPrintHandler(y){this._printHandler=y}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(y,m){const S=this._identifier(y,[48,126]);this._escHandlers[S]===void 0&&(this._escHandlers[S]=[]);const k=this._escHandlers[S];return k.push(m),{dispose:()=>{const L=k.indexOf(m);L!==-1&&k.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,m){this._executeHandlers[y.charCodeAt(0)]=m}clearExecuteHandler(y){this._executeHandlers[y.charCodeAt(0)]&&delete this._executeHandlers[y.charCodeAt(0)]}setExecuteHandlerFallback(y){this._executeHandlerFb=y}registerCsiHandler(y,m){const S=this._identifier(y);this._csiHandlers[S]===void 0&&(this._csiHandlers[S]=[]);const k=this._csiHandlers[S];return k.push(m),{dispose:()=>{const L=k.indexOf(m);L!==-1&&k.splice(L,1)}}}clearCsiHandler(y){this._csiHandlers[this._identifier(y)]&&delete this._csiHandlers[this._identifier(y)]}setCsiHandlerFallback(y){this._csiHandlerFb=y}registerDcsHandler(y,m){return this._dcsParser.registerHandler(this._identifier(y),m)}clearDcsHandler(y){this._dcsParser.clearHandler(this._identifier(y))}setDcsHandlerFallback(y){this._dcsParser.setHandlerFallback(y)}registerOscHandler(y,m){return this._oscParser.registerHandler(y,m)}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,m,S,k,L){this._parseStack.state=y,this._parseStack.handlers=m,this._parseStack.handlerPos=S,this._parseStack.transition=k,this._parseStack.chunkPos=L}parse(y,m,S){let k,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(S===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const T=this._parseStack.handlers;let I=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(S===!1&&I>-1){for(;I>=0&&(k=T[I](this._params),k!==!0);I--)if(k instanceof Promise)return this._parseStack.handlerPos=I,k}this._parseStack.handlers=[];break;case 4:if(S===!1&&I>-1){for(;I>=0&&(k=T[I](),k!==!0);I--)if(k instanceof Promise)return this._parseStack.handlerPos=I,k}this._parseStack.handlers=[];break;case 6:if(L=y[this._parseStack.chunkPos],k=this._dcsParser.unhook(L!==24&&L!==26,S),k)return k;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],k=this._oscParser.end(L!==24&&L!==26,S),k)return k;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 T=M;T<m;++T){switch(L=y[T],R=this._transitions.table[this.currentState<<8|(L<160?L:A)],R>>4){case 2:for(let B=T+1;;++B){if(B>=m||(L=y[B])<32||L>126&&L<A){this._printHandler(y,T,B),T=B-1;break}if(++B>=m||(L=y[B])<32||L>126&&L<A){this._printHandler(y,T,B),T=B-1;break}if(++B>=m||(L=y[B])<32||L>126&&L<A){this._printHandler(y,T,B),T=B-1;break}if(++B>=m||(L=y[B])<32||L>126&&L<A){this._printHandler(y,T,B),T=B-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:T,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 K=I?I.length-1:-1;for(;K>=0&&(k=I[K](this._params),k!==!0);K--)if(k instanceof Promise)return this._preserveStack(3,I,K,R,T),k;K<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(++T<m&&(L=y[T])>47&&L<60);T--;break;case 9:this._collect<<=8,this._collect|=L;break;case 10:const F=this._escHandlers[this._collect<<8|L];let G=F?F.length-1:-1;for(;G>=0&&(k=F[G](),k!==!0);G--)if(k instanceof Promise)return this._preserveStack(4,F,G,R,T),k;G<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 B=T+1;;++B)if(B>=m||(L=y[B])===24||L===26||L===27||L>127&&L<A){this._dcsParser.put(y,T,B),T=B-1;break}break;case 14:if(k=this._dcsParser.unhook(L!==24&&L!==26),k)return this._preserveStack(6,[],0,R,T),k;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 B=T+1;;B++)if(B>=m||(L=y[B])<32||L>127&&L<A){this._oscParser.put(y,T,B),T=B-1;break}break;case 6:if(k=this._oscParser.end(L!==24&&L!==26),k)return this._preserveStack(5,[],0,R,T),k;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:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OscHandler=c.OscParser=void 0;const d=u(5770),b=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(w,C){this._handlers[w]===void 0&&(this._handlers[w]=[]);const A=this._handlers[w];return A.push(C),{dispose:()=>{const E=A.indexOf(C);E!==-1&&A.splice(E,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}reset(){if(this._state===2)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].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 w=this._active.length-1;w>=0;w--)this._active[w].start();else this._handlerFb(this._id,"START")}_put(w,C,A){if(this._active.length)for(let E=this._active.length-1;E>=0;E--)this._active[E].put(w,C,A);else this._handlerFb(this._id,"PUT",(0,b.utf32ToString)(w,C,A))}start(){this.reset(),this._state=1}put(w,C,A){if(this._state!==3){if(this._state===1)for(;C<A;){const E=w[C++];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-C>0&&this._put(w,C,A)}}end(w,C=!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,f=!1;if(this._stack.paused&&(E=this._stack.loopPosition-1,A=C,f=this._stack.fallThrough,this._stack.paused=!1),!f&&A===!1){for(;E>=0&&(A=this._active[E].end(w),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",w);this._active=p,this._id=-1,this._state=0}}},c.OscHandler=class{constructor(w){this._handler=w,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(w,C,A){this._hitLimit||(this._data+=(0,b.utf32ToString)(w,C,A),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(w){let C=!1;if(this._hitLimit)C=!1;else if(w&&(C=this._handler(this._data),C instanceof Promise))return C.then((A=>(this._data="",this._hitLimit=!1,A)));return this._data="",this._hitLimit=!1,C}}},8742:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Params=void 0;const u=2147483647;class d{static fromArray(p){const w=new d;if(!p.length)return w;for(let C=Array.isArray(p[0])?1:0;C<p.length;++C){const A=p[C];if(Array.isArray(A))for(let E=0;E<A.length;++E)w.addSubParam(A[E]);else w.addParam(A)}return w}constructor(p=32,w=32){if(this.maxLength=p,this.maxSubParamsLength=w,w>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(p),this.length=0,this._subParams=new Int32Array(w),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 w=0;w<this.length;++w){p.push(this.params[w]);const C=this._subParamsIdx[w]>>8,A=255&this._subParamsIdx[w];A-C>0&&p.push(Array.prototype.slice.call(this._subParams,C,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 w=this._subParamsIdx[p]>>8,C=255&this._subParamsIdx[p];return C-w>0?this._subParams.subarray(w,C):null}getSubParamsAll(){const p={};for(let w=0;w<this.length;++w){const C=this._subParamsIdx[w]>>8,A=255&this._subParamsIdx[w];A-C>0&&(p[w]=this._subParams.slice(C,A))}return p}addDigit(p){let w;if(this._rejectDigits||!(w=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const C=this._digitIsSub?this._subParams:this.params,A=C[w-1];C[w-1]=~A?Math.min(10*A+p,u):p}}c.Params=d},5741:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.AddonManager=void 0,c.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,d){const b={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(b),d.dispose=()=>this._wrappedAddonDispose(b),d.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let d=-1;for(let b=0;b<this._addons.length;b++)if(this._addons[b]===u){d=b;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(d,1)}}},8771:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferApiView=void 0;const d=u(3785),b=u(511);c.BufferApiView=class{constructor(p,w){this._buffer=p,this.type=w}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 w=this._buffer.lines.get(p);if(w)return new d.BufferLineApiView(w)}getNullCell(){return new b.CellData}}},3785:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLineApiView=void 0;const d=u(511);c.BufferLineApiView=class{constructor(b){this._line=b}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(b,p){if(!(b<0||b>=this._line.length))return p?(this._line.loadCell(b,p),p):this._line.loadCell(b,new d.CellData)}translateToString(b,p,w){return this._line.translateToString(b,p,w)}}},8285:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferNamespaceApi=void 0;const d=u(8771),b=u(8460),p=u(844);class w extends p.Disposable{constructor(A){super(),this._core=A,this._onBufferChange=this.register(new b.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=w},7975:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ParserApi=void 0,c.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,d){return this._core.registerCsiHandler(u,(b=>d(b.toArray())))}addCsiHandler(u,d){return this.registerCsiHandler(u,d)}registerDcsHandler(u,d){return this._core.registerDcsHandler(u,((b,p)=>d(b,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:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeApi=void 0,c.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(_,c,u){var d=this&&this.__decorate||function(f,y,m,S){var k,L=arguments.length,R=L<3?y:S===null?S=Object.getOwnPropertyDescriptor(y,m):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(f,y,m,S);else for(var M=f.length-1;M>=0;M--)(k=f[M])&&(R=(L<3?k(R):L>3?k(y,m,R):k(y,m))||R);return L>3&&R&&Object.defineProperty(y,m,R),R},b=this&&this.__param||function(f,y){return function(m,S){y(m,S,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferService=c.MINIMUM_ROWS=c.MINIMUM_COLS=void 0;const p=u(8460),w=u(844),C=u(5295),A=u(2585);c.MINIMUM_COLS=2,c.MINIMUM_ROWS=1;let E=c.BufferService=class extends w.Disposable{get buffer(){return this.buffers.active}constructor(f){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(f.rawOptions.cols||0,c.MINIMUM_COLS),this.rows=Math.max(f.rawOptions.rows||0,c.MINIMUM_ROWS),this.buffers=this.register(new C.BufferSet(f,this))}resize(f,y){this.cols=f,this.rows=y,this.buffers.resize(f,y),this._onResize.fire({cols:f,rows:y})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(f,y=!1){const m=this.buffer;let S;S=this._cachedBlankLine,S&&S.length===this.cols&&S.getFg(0)===f.fg&&S.getBg(0)===f.bg||(S=m.getBlankLine(f,y),this._cachedBlankLine=S),S.isWrapped=y;const k=m.ybase+m.scrollTop,L=m.ybase+m.scrollBottom;if(m.scrollTop===0){const R=m.lines.isFull;L===m.lines.length-1?R?m.lines.recycle().copyFrom(S):m.lines.push(S.clone()):m.lines.splice(L+1,0,S.clone()),R?this.isUserScrolling&&(m.ydisp=Math.max(m.ydisp-1,0)):(m.ybase++,this.isUserScrolling||m.ydisp++)}else{const R=L-k+1;m.lines.shiftElements(k+1,R-1,-1),m.lines.set(L,S.clone())}this.isUserScrolling||(m.ydisp=m.ybase),this._onScroll.fire(m.ydisp)}scrollLines(f,y,m){const S=this.buffer;if(f<0){if(S.ydisp===0)return;this.isUserScrolling=!0}else f+S.ydisp>=S.ybase&&(this.isUserScrolling=!1);const k=S.ydisp;S.ydisp=Math.max(Math.min(S.ydisp+f,S.ybase),0),k!==S.ydisp&&(y||this._onScroll.fire(S.ydisp))}};c.BufferService=E=d([b(0,A.IOptionsService)],E)},7994:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CharsetService=void 0,c.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,d){this._charsets[u]=d,this.glevel===u&&(this.charset=d)}}},1753:function(_,c,u){var d=this&&this.__decorate||function(S,k,L,R){var M,T=arguments.length,I=T<3?k:R===null?R=Object.getOwnPropertyDescriptor(k,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(S,k,L,R);else for(var K=S.length-1;K>=0;K--)(M=S[K])&&(I=(T<3?M(I):T>3?M(k,L,I):M(k,L))||I);return T>3&&I&&Object.defineProperty(k,L,I),I},b=this&&this.__param||function(S,k){return function(L,R){k(L,R,S)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreMouseService=void 0;const p=u(2585),w=u(8460),C=u(844),A={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:S=>S.button!==4&&S.action===1&&(S.ctrl=!1,S.alt=!1,S.shift=!1,!0)},VT200:{events:19,restrict:S=>S.action!==32},DRAG:{events:23,restrict:S=>S.action!==32||S.button!==3},ANY:{events:31,restrict:S=>!0}};function E(S,k){let L=(S.ctrl?16:0)|(S.shift?4:0)|(S.alt?8:0);return S.button===4?(L|=64,L|=S.action):(L|=3&S.button,4&S.button&&(L|=64),8&S.button&&(L|=128),S.action===32?L|=32:S.action!==0||k||(L|=3)),L}const f=String.fromCharCode,y={DEFAULT:S=>{const k=[E(S,!1)+32,S.col+32,S.row+32];return k[0]>255||k[1]>255||k[2]>255?"":`\x1B[M${f(k[0])}${f(k[1])}${f(k[2])}`},SGR:S=>{const k=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${E(S,!0)};${S.col};${S.row}${k}`},SGR_PIXELS:S=>{const k=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${E(S,!0)};${S.x};${S.y}${k}`}};let m=c.CoreMouseService=class extends C.Disposable{constructor(S,k){super(),this._bufferService=S,this._coreService=k,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new w.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(S,k){this._protocols[S]=k}addEncoding(S,k){this._encodings[S]=k}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(S){if(!this._protocols[S])throw new Error(`unknown protocol "${S}"`);this._activeProtocol=S,this._onProtocolChange.fire(this._protocols[S].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(S){if(!this._encodings[S])throw new Error(`unknown encoding "${S}"`);this._activeEncoding=S}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(S){if(S.col<0||S.col>=this._bufferService.cols||S.row<0||S.row>=this._bufferService.rows||S.button===4&&S.action===32||S.button===3&&S.action!==32||S.button!==4&&(S.action===2||S.action===3)||(S.col++,S.row++,S.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,S,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(S))return!1;const k=this._encodings[this._activeEncoding](S);return k&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(k):this._coreService.triggerDataEvent(k,!0)),this._lastEvent=S,!0}explainEvents(S){return{down:!!(1&S),up:!!(2&S),drag:!!(4&S),move:!!(8&S),wheel:!!(16&S)}}_equalEvents(S,k,L){if(L){if(S.x!==k.x||S.y!==k.y)return!1}else if(S.col!==k.col||S.row!==k.row)return!1;return S.button===k.button&&S.action===k.action&&S.ctrl===k.ctrl&&S.alt===k.alt&&S.shift===k.shift}};c.CoreMouseService=m=d([b(0,p.IBufferService),b(1,p.ICoreService)],m)},6975:function(_,c,u){var d=this&&this.__decorate||function(m,S,k,L){var R,M=arguments.length,T=M<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,k):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(m,S,k,L);else for(var I=m.length-1;I>=0;I--)(R=m[I])&&(T=(M<3?R(T):M>3?R(S,k,T):R(S,k))||T);return M>3&&T&&Object.defineProperty(S,k,T),T},b=this&&this.__param||function(m,S){return function(k,L){S(k,L,m)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreService=void 0;const p=u(1439),w=u(8460),C=u(844),A=u(2585),E=Object.freeze({insertMode:!1}),f=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let y=c.CoreService=class extends C.Disposable{constructor(m,S,k){super(),this._bufferService=m,this._logService=S,this._optionsService=k,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new w.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new w.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new w.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new w.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,p.clone)(E),this.decPrivateModes=(0,p.clone)(f)}reset(){this.modes=(0,p.clone)(E),this.decPrivateModes=(0,p.clone)(f)}triggerDataEvent(m,S=!1){if(this._optionsService.rawOptions.disableStdin)return;const k=this._bufferService.buffer;S&&this._optionsService.rawOptions.scrollOnUserInput&&k.ybase!==k.ydisp&&this._onRequestScrollToBottom.fire(),S&&this._onUserInput.fire(),this._logService.debug(`sending data "${m}"`,(()=>m.split("").map((L=>L.charCodeAt(0))))),this._onData.fire(m)}triggerBinaryEvent(m){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${m}"`,(()=>m.split("").map((S=>S.charCodeAt(0))))),this._onBinary.fire(m))}};c.CoreService=y=d([b(0,A.IBufferService),b(1,A.ILogService),b(2,A.IOptionsService)],y)},9074:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DecorationService=void 0;const d=u(8055),b=u(8460),p=u(844),w=u(6106);let C=0,A=0;class E extends p.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new w.SortedList((m=>m?.marker.line)),this._onDecorationRegistered=this.register(new b.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new b.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,p.toDisposable)((()=>this.reset())))}registerDecoration(m){if(m.marker.isDisposed)return;const S=new f(m);if(S){const k=S.marker.onDispose((()=>S.dispose()));S.onDispose((()=>{S&&(this._decorations.delete(S)&&this._onDecorationRemoved.fire(S),k.dispose())})),this._decorations.insert(S),this._onDecorationRegistered.fire(S)}return S}reset(){for(const m of this._decorations.values())m.dispose();this._decorations.clear()}*getDecorationsAtCell(m,S,k){let L=0,R=0;for(const M of this._decorations.getKeyIterator(S))L=M.options.x??0,R=L+(M.options.width??1),m>=L&&m<R&&(!k||(M.options.layer??"bottom")===k)&&(yield M)}forEachDecorationAtCell(m,S,k,L){this._decorations.forEachByKey(S,(R=>{C=R.options.x??0,A=C+(R.options.width??1),m>=C&&m<A&&(!k||(R.options.layer??"bottom")===k)&&L(R)}))}}c.DecorationService=E;class f 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(m){super(),this.options=m,this.onRenderEmitter=this.register(new b.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new b.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=m.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.InstantiationService=c.ServiceCollection=void 0;const d=u(2585),b=u(8343);class p{constructor(...C){this._entries=new Map;for(const[A,E]of C)this.set(A,E)}set(C,A){const E=this._entries.get(C);return this._entries.set(C,A),E}forEach(C){for(const[A,E]of this._entries.entries())C(A,E)}has(C){return this._entries.has(C)}get(C){return this._entries.get(C)}}c.ServiceCollection=p,c.InstantiationService=class{constructor(){this._services=new p,this._services.set(d.IInstantiationService,this)}setService(w,C){this._services.set(w,C)}getService(w){return this._services.get(w)}createInstance(w,...C){const A=(0,b.getServiceDependencies)(w).sort(((y,m)=>y.index-m.index)),E=[];for(const y of A){const m=this._services.get(y.id);if(!m)throw new Error(`[createInstance] ${w.name} depends on UNKNOWN service ${y.id}.`);E.push(m)}const f=A.length>0?A[0].index:C.length;if(C.length!==f)throw new Error(`[createInstance] First service dependency of ${w.name} at position ${f+1} conflicts with ${C.length} static arguments`);return new w(...C,...E)}}},7866:function(_,c,u){var d=this&&this.__decorate||function(f,y,m,S){var k,L=arguments.length,R=L<3?y:S===null?S=Object.getOwnPropertyDescriptor(y,m):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(f,y,m,S);else for(var M=f.length-1;M>=0;M--)(k=f[M])&&(R=(L<3?k(R):L>3?k(y,m,R):k(y,m))||R);return L>3&&R&&Object.defineProperty(y,m,R),R},b=this&&this.__param||function(f,y){return function(m,S){y(m,S,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.traceCall=c.setTraceLogger=c.LogService=void 0;const p=u(844),w=u(2585),C={trace:w.LogLevelEnum.TRACE,debug:w.LogLevelEnum.DEBUG,info:w.LogLevelEnum.INFO,warn:w.LogLevelEnum.WARN,error:w.LogLevelEnum.ERROR,off:w.LogLevelEnum.OFF};let A,E=c.LogService=class extends p.Disposable{get logLevel(){return this._logLevel}constructor(f){super(),this._optionsService=f,this._logLevel=w.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),A=this}_updateLogLevel(){this._logLevel=C[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(f){for(let y=0;y<f.length;y++)typeof f[y]=="function"&&(f[y]=f[y]())}_log(f,y,m){this._evalLazyOptionalParams(m),f.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+y,...m)}trace(f,...y){this._logLevel<=w.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,f,y)}debug(f,...y){this._logLevel<=w.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,f,y)}info(f,...y){this._logLevel<=w.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,f,y)}warn(f,...y){this._logLevel<=w.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,f,y)}error(f,...y){this._logLevel<=w.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,f,y)}};c.LogService=E=d([b(0,w.IOptionsService)],E),c.setTraceLogger=function(f){A=f},c.traceCall=function(f,y,m){if(typeof m.value!="function")throw new Error("not supported");const S=m.value;m.value=function(...k){if(A.logLevel!==w.LogLevelEnum.TRACE)return S.apply(this,k);A.trace(`GlyphRenderer#${S.name}(${k.map((R=>JSON.stringify(R))).join(", ")})`);const L=S.apply(this,k);return A.trace(`GlyphRenderer#${S.name} return`,L),L}}},7302:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OptionsService=c.DEFAULT_OPTIONS=void 0;const d=u(8460),b=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 w=["normal","bold","100","200","300","400","500","600","700","800","900"];class C extends b.Disposable{constructor(E){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const f={...c.DEFAULT_OPTIONS};for(const y in E)if(y in f)try{const m=E[y];f[y]=this._sanitizeAndValidateOption(y,m)}catch(m){console.error(m)}this.rawOptions=f,this.options={...f},this._setupOptions(),this.register((0,b.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(E,f){return this.onOptionChange((y=>{y===E&&f(this.rawOptions[E])}))}onMultipleOptionChange(E,f){return this.onOptionChange((y=>{E.indexOf(y)!==-1&&f()}))}_setupOptions(){const E=y=>{if(!(y in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);return this.rawOptions[y]},f=(y,m)=>{if(!(y in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);m=this._sanitizeAndValidateOption(y,m),this.rawOptions[y]!==m&&(this.rawOptions[y]=m,this._onOptionChange.fire(y))};for(const y in this.rawOptions){const m={get:E.bind(this,y),set:f.bind(this,y)};Object.defineProperty(this.options,y,m)}}_sanitizeAndValidateOption(E,f){switch(E){case"cursorStyle":if(f||(f=c.DEFAULT_OPTIONS[E]),!(function(y){return y==="block"||y==="underline"||y==="bar"})(f))throw new Error(`"${f}" is not a valid value for ${E}`);break;case"wordSeparator":f||(f=c.DEFAULT_OPTIONS[E]);break;case"fontWeight":case"fontWeightBold":if(typeof f=="number"&&1<=f&&f<=1e3)break;f=w.includes(f)?f:c.DEFAULT_OPTIONS[E];break;case"cursorWidth":f=Math.floor(f);case"lineHeight":case"tabStopWidth":if(f<1)throw new Error(`${E} cannot be less than 1, value: ${f}`);break;case"minimumContrastRatio":f=Math.max(1,Math.min(21,Math.round(10*f)/10));break;case"scrollback":if((f=Math.min(f,4294967295))<0)throw new Error(`${E} cannot be less than 0, value: ${f}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(f<=0)throw new Error(`${E} cannot be less than or equal to 0, value: ${f}`);break;case"rows":case"cols":if(!f&&f!==0)throw new Error(`${E} must be numeric, value: ${f}`);break;case"windowsPty":f=f??{}}return f}}c.OptionsService=C},2660:function(_,c,u){var d=this&&this.__decorate||function(C,A,E,f){var y,m=arguments.length,S=m<3?A:f===null?f=Object.getOwnPropertyDescriptor(A,E):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(C,A,E,f);else for(var k=C.length-1;k>=0;k--)(y=C[k])&&(S=(m<3?y(S):m>3?y(A,E,S):y(A,E))||S);return m>3&&S&&Object.defineProperty(A,E,S),S},b=this&&this.__param||function(C,A){return function(E,f){A(E,f,C)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkService=void 0;const p=u(2585);let w=c.OscLinkService=class{constructor(C){this._bufferService=C,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(C){const A=this._bufferService.buffer;if(C.id===void 0){const k=A.addMarker(A.ybase+A.y),L={data:C,id:this._nextId++,lines:[k]};return k.onDispose((()=>this._removeMarkerFromLink(L,k))),this._dataByLinkId.set(L.id,L),L.id}const E=C,f=this._getEntryIdKey(E),y=this._entriesWithId.get(f);if(y)return this.addLineToLink(y.id,A.ybase+A.y),y.id;const m=A.addMarker(A.ybase+A.y),S={id:this._nextId++,key:this._getEntryIdKey(E),data:E,lines:[m]};return m.onDispose((()=>this._removeMarkerFromLink(S,m))),this._entriesWithId.set(S.key,S),this._dataByLinkId.set(S.id,S),S.id}addLineToLink(C,A){const E=this._dataByLinkId.get(C);if(E&&E.lines.every((f=>f.line!==A))){const f=this._bufferService.buffer.addMarker(A);E.lines.push(f),f.onDispose((()=>this._removeMarkerFromLink(E,f)))}}getLinkData(C){return this._dataByLinkId.get(C)?.data}_getEntryIdKey(C){return`${C.id};;${C.uri}`}_removeMarkerFromLink(C,A){const E=C.lines.indexOf(A);E!==-1&&(C.lines.splice(E,1),C.lines.length===0&&(C.data.id!==void 0&&this._entriesWithId.delete(C.key),this._dataByLinkId.delete(C.id)))}};c.OscLinkService=w=d([b(0,p.IBufferService)],w)},8343:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createDecorator=c.getServiceDependencies=c.serviceRegistry=void 0;const u="di$target",d="di$dependencies";c.serviceRegistry=new Map,c.getServiceDependencies=function(b){return b[d]||[]},c.createDecorator=function(b){if(c.serviceRegistry.has(b))return c.serviceRegistry.get(b);const p=function(w,C,A){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(E,f,y){f[u]===f?f[d].push({id:E,index:y}):(f[d]=[{id:E,index:y}],f[u]=f)})(p,w,A)};return p.toString=()=>b,c.serviceRegistry.set(b,p),p}},2585:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.IDecorationService=c.IUnicodeService=c.IOscLinkService=c.IOptionsService=c.ILogService=c.LogLevelEnum=c.IInstantiationService=c.ICharsetService=c.ICoreService=c.ICoreMouseService=c.IBufferService=void 0;const d=u(8343);var b;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"})(b||(c.LogLevelEnum=b={})),c.ILogService=(0,d.createDecorator)("LogService"),c.IOptionsService=(0,d.createDecorator)("OptionsService"),c.IOscLinkService=(0,d.createDecorator)("OscLinkService"),c.IUnicodeService=(0,d.createDecorator)("UnicodeService"),c.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const d=u(8460),b=u(225);class p{static extractShouldJoin(C){return(1&C)!=0}static extractWidth(C){return C>>1&3}static extractCharKind(C){return C>>3}static createPropertyValue(C,A,E=!1){return(16777215&C)<<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 C=new b.UnicodeV6;this.register(C),this._active=C.version,this._activeProvider=C}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(C){if(!this._providers[C])throw new Error(`unknown Unicode version "${C}"`);this._active=C,this._activeProvider=this._providers[C],this._onChange.fire(C)}register(C){this._providers[C.version]=C}wcwidth(C){return this._activeProvider.wcwidth(C)}getStringCellWidth(C){let A=0,E=0;const f=C.length;for(let y=0;y<f;++y){let m=C.charCodeAt(y);if(55296<=m&&m<=56319){if(++y>=f)return A+this.wcwidth(m);const L=C.charCodeAt(y);56320<=L&&L<=57343?m=1024*(m-55296)+L-56320+65536:A+=this.wcwidth(L)}const S=this.charProperties(m,E);let k=p.extractWidth(S);p.extractShouldJoin(S)&&(k-=p.extractWidth(E)),A+=k,E=S}return A}charProperties(C,A){return this._activeProvider.charProperties(C,A)}}c.UnicodeService=p}},a={};function o(_){var c=a[_];if(c!==void 0)return c.exports;var u=a[_]={exports:{}};return r[_].call(u.exports,u,u.exports,o),u.exports}var g={};return(()=>{var _=g;Object.defineProperty(_,"__esModule",{value:!0}),_.Terminal=void 0;const c=o(9042),u=o(3236),d=o(844),b=o(5741),p=o(8285),w=o(7975),C=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 b.AddonManager),this._publicOptions={...this._core.options};const m=k=>this._core.options[k],S=(k,L)=>{this._checkReadonlyOptions(k),this._core.options[k]=L};for(const k in this._core.options){const L={get:m.bind(this,k),set:S.bind(this,k)};Object.defineProperty(this._publicOptions,k,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 w.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new C.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 m="none";switch(this._core.coreMouseService.activeProtocol){case"X10":m="x10";break;case"VT200":m="vt200";break;case"DRAG":m="drag";break;case"ANY":m="any"}return{applicationCursorKeysMode:y.applicationCursorKeys,applicationKeypadMode:y.applicationKeypad,bracketedPasteMode:y.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:m,originMode:y.origin,reverseWraparoundMode:y.reverseWraparound,sendFocusMode:y.sendFocus,wraparoundMode:y.wraparound}}get options(){return this._publicOptions}set options(y){for(const m in y)this._publicOptions[m]=y[m]}blur(){this._core.blur()}focus(){this._core.focus()}input(y,m=!0){this._core.input(y,m)}resize(y,m){this._verifyIntegers(y,m),this._core.resize(y,m)}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,m,S){this._verifyIntegers(y,m,S),this._core.select(y,m,S)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(y,m){this._verifyIntegers(y,m),this._core.selectLines(y,m)}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,m){this._core.write(y,m)}writeln(y,m){this._core.write(y),this._core.write(`\r
82
+ `,m)}paste(y){this._core.paste(y)}refresh(y,m){this._verifyIntegers(y,m),this._core.refresh(y,m)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(y){this._addonManager.loadAddon(this,y)}static get strings(){return c}_verifyIntegers(...y){for(const m of y)if(m===1/0||isNaN(m)||m%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...y){for(const m of y)if(m&&(m===1/0||isNaN(m)||m%1!=0||m<0))throw new Error("This API only accepts positive integers")}}_.Terminal=E})(),g})()))})(Yf)),Yf.exports}var VL=KL();const nm=14,qw=10,Kw=22,YL=128,XL=.5,ZL="mmmmmmmmmmwwwwiIl1 0O-_|┌ABCxyz",JL=/[\x00-\x1F\x7F]/g,Sb={min:qw,max:Kw},QL="cascadia",fh=[{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"}],ea=fh[0];function Gu(e){return fh.find(n=>n.id===e)??ea}function $l(){return{source:"curated",id:QL,customName:"",family:ea.family,size:nm}}function im(e,n){const r=Gu(e);return{source:"curated",id:r.id,customName:"",family:r.family,size:sm(n)}}function rm(e,n){const r=nM(e);return{source:"custom",id:null,customName:r,family:r?`"${Zw(r)}", ${ea.family}`:ea.family,size:sm(n)}}function Vw(e){if(!e)return $l();try{const n=JSON.parse(e),r=sm(typeof n.size=="number"?n.size:nm);if(n.source==="custom"&&typeof n.customName=="string")return rm(n.customName,r);if(typeof n.id=="string"&&tM(n.id))return im(n.id,r)}catch{}return $l()}function Yw(e){return JSON.stringify({source:e.source,id:e.id,customName:e.customName,size:e.size})}function sm(e){return Number.isFinite(e)?Math.min(Kw,Math.max(qw,Math.round(e))):nm}function Xw(e){return e.source==="curated"?{status:"self-hosted",fallbackName:ea.name}:e.customName?{status:eM(e.customName)?"resolved":"fallback",fallbackName:ea.name}:{status:"fallback",fallbackName:ea.name}}function eM(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=wb(n,`"${Zw(e)}", ${r}`),o=wb(n,r);if(Math.abs(a-o)>XL)return!0}return!1}function wb(e,n){return e.font=`28px ${n}`,e.measureText(ZL).width}function tM(e){return fh.some(n=>n.id===e)}function nM(e){return e.replace(JL,"").trim().slice(0,YL)}function Zw(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}const qu="fleet-plugin.terminal.renderer",Ku="fleet-plugin.terminal.font",xb="fleet-console.terminalRenderer",Cb="fleet-console.terminalFont",Xp=new Set;let xs=iM();function iM(){return typeof window>"u"?{renderer:"webgl",font:$l()}:(rM(),{renderer:sM(),font:aM()})}function rM(){if(!(typeof window>"u"))try{if(window.localStorage.getItem(qu)!==null||window.localStorage.getItem(Ku)!==null)return;const e=window.localStorage.getItem(xb),n=window.localStorage.getItem(Cb),r=e==="webgl"||e==="dom"?e:"webgl",a=Vw(n);window.localStorage.setItem(qu,r),window.localStorage.setItem(Ku,Yw(a)),window.localStorage.removeItem(xb),window.localStorage.removeItem(Cb)}catch{}}function sM(){if(typeof window>"u")return"webgl";try{const e=window.localStorage.getItem(qu);return e==="webgl"||e==="dom"?e:"webgl"}catch{return"webgl"}}function aM(){if(typeof window>"u")return $l();try{return Vw(window.localStorage.getItem(Ku))}catch{return $l()}}function oM(e){if(!(typeof window>"u"))try{window.localStorage.setItem(qu,e)}catch{}}function am(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Ku,Yw(e))}catch{}}function lM(){for(const e of Xp)e()}function ph(e){xs={...xs,...e},lM()}function cM(e){return Xp.add(e),()=>{Xp.delete(e)}}function Eb(){return xs}function Jw(){return j.useSyncExternalStore(cM,Eb,Eb)}function uM(e){oM(e),ph({renderer:e})}function hM(e){const n=im(e,xs.font.size);am(n),ph({font:n})}function kb(e){const n=rm(e,xs.font.size);am(n),ph({font:n})}function Ab(e){const n=xs.font.source==="custom"?rm(xs.font.customName,e):im(xs.font.id,e);am(n),ph({font:n})}const dM={allowProposedApi:!0,convertEol:!0,cursorBlink:!0,cursorStyle:"block",lineHeight:1.2},fM=80,pM=16,gM=250,mM=1024*1024,_M=120,vM={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)"},bM={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 Qw({operationId:e,ticketPath:n,wsPath:r,theme:a="maritime",onExit:o,active:g,zoom:_=1}){const c=a,{renderer:u,font:d}=Jw(),b=j.useRef(null),p=j.useRef(null),w=j.useRef(null),C=j.useRef(null),A=j.useRef(null),E=j.useRef(null),[f,y]=j.useState(_),m=j.useRef(o);m.current=o;const S=j.useRef(g);S.current=g;const[k,L]=j.useState("connecting");j.useEffect(()=>{const T=b.current;if(!T)return;let I=!1;const K=new VL.Terminal({...dM,fontFamily:d.family,fontSize:d.size*f,theme:Tb(c)});p.current=K;const F=new l3.FitAddon;E.current=F,K.loadAddon(F),K.open(T),K.loadAddon(new h3.Unicode11Addon),K.unicode.activeVersion="11",K.attachCustomKeyEventHandler(P=>P.key==="Enter"&&P.shiftKey?(P.type==="keydown"&&K.input(`
83
+ `),!1):!0);const G=SM(K,S.current!==!1);A.current=G;const B=n3({operationId:e,ticketPath:n,wsPath:r,terminal:{onData:P=>K.onData(P),write:G.write},onExit:()=>m.current?.(),onStatus:(P,O)=>{L(O?`${P}: ${O}`:P)}});w.current=B;let Y=null;const X=()=>{F.fit(),B.resize(K.cols,K.rows)},H=()=>{X(),K.refresh(0,K.rows-1)},q=()=>{Y&&clearTimeout(Y),Y=setTimeout(()=>{Y=null,I||H()},fM)},V=async()=>{await document.fonts?.ready,!I&&(X(),B.start(),S.current!==!1&&K.focus())},D=new ResizeObserver(q);return D.observe(T),V(),()=>{I=!0,D.disconnect(),Y&&clearTimeout(Y),B.dispose(),G.dispose(),p.current=null,w.current=null,A.current=null,E.current=null;try{K.dispose()}catch{}}},[e,n,r]),j.useEffect(()=>{if(A.current?.setActive(g!==!1),!g)return;yM(p.current);const T=window.requestAnimationFrame(()=>{S.current===!0&&ex(p.current)});return()=>window.cancelAnimationFrame(T)},[g]),j.useEffect(()=>{const T=p.current;if(!T)return;let I=!1;if(u==="webgl")try{const K=new qL;C.current=K,K.onContextLoss(()=>{if(!I){try{K.dispose()}catch{}C.current===K&&(C.current=null)}}),T.loadAddon(K)}catch{try{C.current?.dispose()}catch{}C.current=null}return()=>{I=!0;const K=C.current;if(K){C.current=null;try{K.dispose()}catch{}}}},[u,e]),j.useEffect(()=>{const T=p.current;T&&(T.options.theme=Tb(c))},[c]),j.useEffect(()=>{const T=p.current;T&&(T.options.fontFamily=d.family,Rb(T,E.current,w.current))},[d.family]),j.useEffect(()=>{if(_===f)return;const T=setTimeout(()=>y(_),_M);return()=>clearTimeout(T)},[_,f]),j.useEffect(()=>{const T=p.current;T&&(T.options.fontSize=d.size*f,Rb(T,E.current,w.current))},[f,d.size]);const R=k.startsWith("live"),M=f===1?void 0:{width:`${f*100}%`,height:`${f*100}%`,transform:`scale(${1/f})`,transformOrigin:"0 0"};return h.jsx("section",{className:"terminal-stage","aria-label":"Terminal",children:h.jsxs("div",{className:"terminal-shell",children:[R?null:h.jsxs("div",{className:"terminal-status","aria-live":"polite",children:[h.jsx("span",{className:"terminal-status-dot","aria-hidden":"true"}),k]}),h.jsx("div",{className:"terminal-viewport",children:h.jsx("div",{className:"terminal-canvas",ref:b,style:M})})]})})}function Tb(e){return e==="carbon"?bM:vM}function yM(e){e&&(e.focus(),ex(e))}function ex(e){e&&(e.scrollToBottom(),e.rows>0&&e.refresh(0,e.rows-1))}function SM(e,n){let r=n,a=!1,o=null,g=0,_=[];const c=()=>{o&&(clearTimeout(o),o=null)},u=()=>{if(c(),a||g===0)return;const b=wM(_,g);_=[],g=0,e.write(b)},d=()=>{a||o||g===0||(o=setTimeout(u,r?pM:gM))};return{write:b=>{if(!(a||b.byteLength===0)){if(_.push(b),g+=b.byteLength,g>=mM){u();return}d()}},setActive:b=>{if(r!==b){if(r=b,c(),r){u();return}d()}},dispose:()=>{u(),a=!0,_=[],g=0,c()}}}function wM(e,n){if(e.length===1)return e[0]??new Uint8Array;const r=new Uint8Array(n);let a=0;for(const o of e)r.set(o,a),a+=o.byteLength;return r}function Rb(e,n,r){n?.fit(),r?.resize(e.cols,e.rows),e.refresh(0,e.rows-1)}const xM=["canonicalCwd","cwd","providerSession","ticket","token","transcriptPath","prompt","persona","toolAllowlist"];class Ji extends Error{status;constructor(n,r){super(r),this.name="AgentApiError",this.status=n}}async function tx(e){const n=await fetch("/plugins/terminal/agent/state",{signal:e});await $r(n);const r=await n.json();if(!Array.isArray(r.agentClis))throw new Ji(n.status,"Invalid agent state response");return r.agentClis.map(a=>NM(a,n.status))}async function CM(e){const n=await fetch("/plugins/terminal/agent/agent-cli/state",{signal:e});await $r(n);const r=await n.json();if(!Array.isArray(r.clis))throw new Ji(n.status,"Invalid Agent CLI state response");return r}async function EM(e){const n=await fetch("/plugins/terminal/agent/tenants",{signal:e});await $r(n);const r=await n.json();if(!Array.isArray(r.tenants))throw new Ji(n.status,"Invalid tenants response");return r.tenants.map(a=>OM(a,n.status))}async function kM(e){const n=await fetch("/plugins/terminal/agent/jobs",{signal:e});await $r(n);const r=await n.json();if(!Array.isArray(r.tenants))throw new Ji(n.status,"Invalid jobs response");return r.tenants}async function AM(e){const n=await fetch("/plugins/terminal/agent/sessions",{signal:e});await $r(n);const r=await n.json();if(!Array.isArray(r.sessions))throw new Ji(n.status,"Invalid agent sessions response");return r.sessions.map(a=>gh(a,n.status))}async function TM(e){const n=await fetch("/api/v1/operations",{signal:e});await $r(n);const r=await n.json();if(!Array.isArray(r.operations))throw new Ji(n.status,"Invalid operations response");return{operations:r.operations.map(a=>DM(a,n.status))}}async function RM(e,n,r){const a=await fetch("/plugins/terminal/agent/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({theaterId:e,cliId:n}),signal:r});return await $r(a),gh(await a.json(),a.status)}async function LM(e,n){const r=await fetch(`/plugins/terminal/agent/sessions/${encodeURIComponent(e)}/resume`,{method:"POST",signal:n});return await $r(r),gh(await r.json(),r.status)}async function MM(e,n){const r=await fetch(`/plugins/terminal/agent/sessions/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});await $r(r)}function gh(e,n){const r=e;if(!r||typeof r.sessionId!="string"||typeof r.cwdLabel!="string"||typeof r.status!="string"||typeof r.createdAt!="number"||Zp(r))throw new Ji(n,"Invalid agent session response");return{sessionId:r.sessionId,terminalSessionId:typeof r.terminalSessionId=="string"?r.terminalSessionId:r.sessionId,cwdLabel:r.cwdLabel,label:typeof r.label=="string"?r.label:void 0,cliId:typeof r.cliId=="string"?r.cliId:void 0,cliLabel:typeof r.cliLabel=="string"?r.cliLabel:void 0,status:r.status,turnState:r.turnState==="running"||r.turnState==="ended"?r.turnState:"none",createdAt:r.createdAt,theaterId:typeof r.theaterId=="string"?r.theaterId:void 0,tenantId:typeof r.tenantId=="string"?r.tenantId:void 0,registrationId:typeof r.registrationId=="string"?r.registrationId:void 0,resumeAvailable:r.resumeAvailable===!0}}async function $r(e){if(!e.ok)throw new Ji(e.status,`Agent plugin request failed: ${e.status}`)}function NM(e,n){const r=e;if(!r||typeof r.id!="string"||typeof r.label!="string")throw new Ji(n,"Invalid Agent CLI metadata response");return{id:r.id,label:r.label,available:r.available===!0,signedIn:r.signedIn!==!1}}function OM(e,n){const r=e;if(!r||typeof r.tenantId!="string"||typeof r.tenantLabel!="string"||typeof r.createdAt!="number"||typeof r.sessions!="number")throw new Ji(n,"Invalid tenant response");return r}function DM(e,n){const r=e;if(!r||typeof r.id!="string"||typeof r.theaterId!="string"||typeof r.type!="string"||typeof r.pluginId!="string"||typeof r.title!="string"||!r.payload||typeof r.payload!="object"||Array.isArray(r.payload)||!r.ts||typeof r.ts.createdAt!="number"||typeof r.ts.updatedAt!="number"||Zp(r)||Zp(r.payload))throw new Ji(n,"Invalid operation response");return{id:r.id,theaterId:r.theaterId,type:r.type,pluginId:r.pluginId,title:r.title,payload:r.payload,geometry:r.geometry??null,ts:r.ts}}function Zp(e){return Jp(e,new Set(xM))}function Jp(e,n){return!e||typeof e!="object"?!1:Array.isArray(e)?e.some(r=>Jp(r,n)):Object.entries(e).some(([r,a])=>n.has(r)||Jp(a,n))}const BM="active",Qp=new Set(["done","error","aborted"]);function jM(e,n){let r=eg(e,n.jobId,n.updatedAt);for(const a of n.events)r=nx(r,a);return Qp.has(n.status)&&!Qp.has(r.status)&&(r={...r,status:n.status}),r}function nx(e,n){if(n.id<=e.lastEventId)return e;const r=n.event,a={...e,updatedAt:n.at,lastEventId:n.id,recentEvents:zM(e.recentEvents,n)};switch(n.type){case"job:registered":return IM(a,r);case"job:finalized":return{...a,status:un(r.status)??"done",finishedAt:vs(r.finishedAt)??n.at,summary:un(r.summary),error:un(r.error)};case"track:begin":return $a(a,r,o=>({...o,startedAt:vs(r.startedAt)??n.at,requestPreview:un(r.requestPreview)}));case"track:status":return $a(a,r,o=>({...o,status:un(r.status)??o.status}));case"track:text":return $a(a,r,o=>({...o,status:"stream",text:o.text+(un(r.text)??""),sentTextLength:o.sentTextLength+(vs(r.textLength)??un(r.text)?.length??0)}));case"track:thought":return $a(a,r,o=>({...o,thought:o.thought+(un(r.text)??""),sentThoughtLength:o.sentThoughtLength+(vs(r.textLength)??un(r.text)?.length??0)}));case"track:tool":return $a(a,r,o=>({...o,status:"stream",tools:PM(o.tools,r)}));case"track:finalized":return $a(a,r,o=>{const g=Lb(o.text,o.sentTextLength,un(r.fallbackText),vs(r.fallbackTextLength)),_=Lb(o.thought,o.sentThoughtLength,un(r.fallbackThought),vs(r.fallbackThoughtLength));return{...o,status:un(r.status)??"done",finishedAt:vs(r.finishedAt)??n.at,error:un(r.error),text:g.text,sentTextLength:g.sentLength,thought:_.text,sentThoughtLength:_.sentLength}});default:return a}}function eg(e,n,r){return{jobId:n,tenantId:e,status:BM,updatedAt:r,trackOrder:[],tracks:{},lastEventId:0,recentEvents:[]}}function ix(e){return Qp.has(e)}function IM(e,n){const r=Array.isArray(n.tracks)?n.tracks:[];let a=e.trackOrder,o=e.tracks;for(const g of r){if(!g.trackId)continue;const _=o[g.trackId],c={..._??rx(g.trackId),displayName:g.displayName??_?.displayName??g.trackId,displayCli:g.displayCli??_?.displayCli,model:g.model??_?.model,effort:g.effort??_?.effort,subtitle:g.subtitle??_?.subtitle,kind:g.kind??_?.kind,startedAt:g.startedAt??_?.startedAt};_||(a=[...a,g.trackId]),o={...o,[g.trackId]:c}}return{...e,label:un(n.label)??e.label,ownerCarrierId:un(n.ownerCarrierId)??e.ownerCarrierId,kind:un(n.kind)??e.kind,startedAt:vs(n.startedAt)??e.startedAt,trackOrder:a,tracks:o}}function $a(e,n,r){const a=un(n.trackId);if(!a)return e;const o=e.tracks[a],g=r(o??rx(a));return{...e,trackOrder:o?e.trackOrder:[...e.trackOrder,a],tracks:{...e.tracks,[a]:g}}}function rx(e){return{trackId:e,displayName:e,status:"active",text:"",thought:"",sentTextLength:0,sentThoughtLength:0,tools:[]}}function PM(e,n){const r=un(n.toolId)??un(n.id);if(!r)return e;const a={id:r,name:un(n.name),input:n.input,output:n.output,status:un(n.status)},o=e.findIndex(g=>g.id===r);return o>=0?[...e.slice(0,o),{...e[o],...a},...e.slice(o+1)]:[...e,a]}function Lb(e,n,r,a){return r?n>=(a??r.length)?{text:e,sentLength:n}:{text:r,sentLength:a??r.length}:{text:e,sentLength:n}}function zM(e,n){return[...e,n].slice(-120)}function un(e){return typeof e=="string"?e:void 0}function vs(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}const HM=new Set(["idle_prompt","permission_prompt","auth_success","elicitation_dialog","elicitation_complete","elicitation_response"]);function $M(){let e="";return n=>{e+=n;const r=[];let a=e.indexOf(`
84
+
85
+ `);for(;a>=0;){const o=e.slice(0,a);e=e.slice(a+2);const g=FM(o);g&&r.push(g),a=e.indexOf(`
86
+
87
+ `)}return r}}function UM(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=Nb(n.session);return a?{kind:"session",tenantId:a.tenantId??a.sessionId,session:a}:null}if(e.event==="session:attention"){const a=Nb(n.session);return a?{kind:"attention",tenantId:a.tenantId??a.sessionId,session:a,reason:WM(n.reason)}:null}const r=Mb(n.event)??Mb(n);return r?{kind:"event",tenantId:r.tenantId,tenantLabel:n.tenant?.tenantLabel,event:r}:null}function FM(e){const n=e.split(`
88
+ `),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(`
89
+ `);return!a&&r==="message"?null:{event:r,data:a}}function Mb(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:{...n,event:typeof n.event=="object"&&n.event!==null?n.event:{}}}function Nb(e){try{return gh(e,200)}catch{return null}}function WM(e){return typeof e=="string"&&HM.has(e)?e:void 0}const om={droppedCount:0},tg=new Set;let $t={connection:"connecting",connectionError:null,agentClis:[],sessions:{},sessionOrder:[],tenants:[],tenantJobs:{},tenantOrder:[],activeTerminalSessionId:null,turnState:{}};function GM(){return hS(qM,sx)}function sx(){return $t}function qM(e){return tg.add(e),()=>{tg.delete(e)}}function bi(e){$t={...$t,...e},JM()}function ax(e){bi({agentClis:e})}function KM(e){const n={};for(const r of e)n[r.sessionId]=r;bi({sessions:n,sessionOrder:[...e].sort((r,a)=>a.createdAt-r.createdAt).map(r=>r.sessionId)})}function Vu(e){const n=!!$t.sessions[e.sessionId];bi({sessions:{...$t.sessions,[e.sessionId]:e},sessionOrder:n?$t.sessionOrder:[e.sessionId,...$t.sessionOrder],turnState:{...$t.turnState,[e.sessionId]:e.turnState}})}function ox(e){const{[e]:n,...r}=$t.sessions,{[e]:a,...o}=$t.turnState;bi({sessions:r,sessionOrder:$t.sessionOrder.filter(g=>g!==e),activeTerminalSessionId:$t.activeTerminalSessionId===e?null:$t.activeTerminalSessionId,turnState:o})}function lx(e){bi({activeTerminalSessionId:e})}function VM(e){bi({tenants:e,tenantOrder:[...e.map(n=>n.tenantId),...$t.tenantOrder.filter(n=>!e.some(r=>r.tenantId===n)&&$t.tenantJobs[n])]})}function YM(e){const n={};for(const r of e){const a={};for(const o of r.jobs)a[o.jobId]=jM(r.tenantId,o);n[r.tenantId]={tenantId:r.tenantId,tenantLabel:r.tenantLabel,jobOrder:r.jobs.map(o=>o.jobId),jobs:a,truncation:r.truncation??om}}bi({tenantJobs:n,tenantOrder:[...e.map(r=>r.tenantId),...$t.tenantOrder.filter(r=>n[r])]})}function XM(e,n){const r=e.tenantId,a=e.jobId??QM(e),o=$t.tenantJobs[r]??{tenantId:r,tenantLabel:n,jobOrder:[],jobs:{},truncation:om},g=a?o.jobs[a]??eg(r,a,e.at):eg(r,"__unknown__",e.at),_=nx(g,e),c=a&&o.jobOrder.includes(a)?o.jobOrder:a?[a,...o.jobOrder]:o.jobOrder,u={...o,tenantLabel:n??o.tenantLabel,jobOrder:c,jobs:a?{...o.jobs,[a]:_}:o.jobs};return bi({tenantJobs:{...$t.tenantJobs,[r]:u},tenantOrder:$t.tenantOrder.includes(r)?$t.tenantOrder:[r,...$t.tenantOrder]}),{job:_,unknownTenant:!$t.tenantJobs[r]}}function ZM(e,n,r){const a=$t.tenantJobs[e]??{tenantId:e,tenantLabel:n,jobOrder:[],jobs:{},truncation:om};bi({tenantJobs:{...$t.tenantJobs,[e]:{...a,tenantLabel:n??a.tenantLabel,truncation:r}}})}function cx(e){const n=e.tenantId;if(!n)return[];const r=$t.tenantJobs[n];return r?r.jobOrder.map(a=>r.jobs[a]).filter(a=>!!a):[]}function JM(){for(const e of tg)e()}function QM(e){const n=e.event;return typeof n.jobId=="string"?n.jobId:null}const Ob=250,e6=5e3,ng=new Map;function t6(e){const n=new AbortController;return n6(n.signal,e),()=>n.abort()}async function n6(e,n){let r=Ob;for(;!e.aborted;){bi({connection:"connecting"});try{await a6(e,n);const a=await fetch("/plugins/terminal/agent/events",{signal:e});if(!a.ok||!a.body)throw new Error(`Agent stream failed: ${a.status}`);bi({connection:"live",connectionError:null}),r=Ob,await i6(a.body.getReader(),e,n),e.aborted||bi({connection:"connecting",connectionError:null})}catch(a){if(e.aborted)return;bi({connection:"connecting",connectionError:a instanceof Error?a.message:String(a)})}if(e.aborted)return;await l6(r,e),r=Math.min(r*2,e6)}}async function i6(e,n,r){const a=new TextDecoder,o=$M();for(;!n.aborted;){const g=await e.read();if(g.done)return;for(const _ of o(a.decode(g.value,{stream:!0}))){const c=UM(_);if(c){if(c.kind==="truncation"&&c.truncation){ZM(c.tenantId,c.tenantLabel,c.truncation);continue}if(c.kind==="session"&&c.session){Vu(c.session),Yu(r,c.session.sessionId,lm(c.session));continue}if(c.kind==="attention"&&c.session){Vu(c.session),c.reason!=="idle_prompt"&&Yu(r,c.session.sessionId,"awaiting");continue}c.event&&(XM(c.event,c.tenantLabel),s6(r,c.event.tenantId))}}}}function lm(e){return e.status==="dormant"?"dormant":e.turnState==="running"||e.turnState==="ended"&&r6(e)?"running":"idle"}function r6(e){return cx(e).some(n=>!ix(n.status))}function Yu(e,n,r){const a=ng.get(n);e.status.set(n,r),ng.set(n,r),a!==r&&(r==="awaiting"?e.notifications.emit({kind:"agent.attention",operationId:n,message:"Agent is waiting for input"}):r==="idle"&&(a==="running"||a==="awaiting")&&e.notifications.emit({kind:"agent.ended",operationId:n,message:"Agent turn ended"}))}function s6(e,n){const{sessions:r}=sx();for(const a of Object.values(r))a.tenantId===n&&ng.get(a.sessionId)!=="awaiting"&&Yu(e,a.sessionId,lm(a))}async function a6(e,n){const[r,a,o,g,_]=await Promise.all([tx(e),AM(e),EM(e),kM(e),TM(e)]);ax(r),KM(a),VM(o),YM(g);for(const c of a)Yu(n,c.sessionId,lm(c));o6(_.operations,n)}function o6(e,n){for(const r of e)r.pluginId==="terminal"&&r.type==="agent.streaming"&&n.operations.remove(r.id).catch(()=>{})}async function l6(e,n){await new Promise(r=>{const a=()=>{clearTimeout(o),n.removeEventListener("abort",a),r()},o=setTimeout(a,e);n.addEventListener("abort",a)})}class mh extends Error{status;constructor(n,r){super(r),this.name="TerminalModelAuthApiError",this.status=n}}async function c6(e){const n=await fetch("/plugins/terminal/model-auth/state",{signal:e});return await cm(n),hx(await n.json(),n.status)}async function u6(e,n,r){const a=await fetch(`/plugins/terminal/model-auth/providers/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:n}),signal:r});return await cm(a),ux(await a.json(),a.status)}async function h6(e,n){const r=await fetch(`/plugins/terminal/model-auth/providers/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});return await cm(r),ux(await r.json(),r.status)}async function cm(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 mh(e.status,n)}function ux(e,n){const r=e;if(!r||typeof r!="object"||!("state"in r))throw new mh(n,"Invalid model auth mutation response");return{state:hx(r.state,n)}}function hx(e,n){const r=e;if(!r||typeof r!="object"||!Array.isArray(r.providers))throw new mh(n,"Invalid model auth state response");return{providers:r.providers.map(a=>d6(a,n))}}function d6(e,n){const r=e;if(typeof r.cli!="string"||typeof r.displayName!="string"||typeof r.signedIn!="boolean")throw new mh(n,"Invalid model auth provider response");return{cli:r.cli,displayName:r.displayName,signedIn:r.signedIn}}const ig=new Set;let rg={loading:!1,state:null,busyCli:null,error:null},Ir=0;function f6(){return j.useSyncExternalStore(p6,Db,Db)}function Db(){return rg}function p6(e){return ig.add(e),()=>{ig.delete(e)}}async function g6(e){const n=++Ir;Pr({loading:!0,error:null});try{const r=await c6(e);if(n!==Ir)return;Pr({loading:!1,state:r,error:null})}catch(r){if(e?.aborted||n!==Ir)return;Pr({loading:!1,error:um(r)})}}async function m6(e,n){const r=++Ir;Pr({busyCli:e,error:null});try{const a=await u6(e,n);return r!==Ir||(Pr({state:a.state,busyCli:null,error:null}),await dx()),!0}catch(a){return r!==Ir||Pr({busyCli:null,error:um(a)}),!1}}async function _6(e){const n=++Ir;Pr({busyCli:e,error:null});try{const r=await h6(e);return n!==Ir||(Pr({state:r.state,busyCli:null,error:null}),await dx()),!0}catch(r){return n!==Ir||Pr({busyCli:null,error:um(r)}),!1}}async function dx(){try{ax(await tx())}catch{}}function Pr(e){rg={...rg,...e};for(const n of ig)n()}function um(e){return e instanceof Error?e.message:String(e)}class fx extends Error{status;constructor(n,r){super(r),this.name="TerminalSettingsApiError",this.status=n}}async function v6(e){const n=await fetch("/plugins/terminal/settings",{signal:e});return await px(n),gx(await n.json(),n.status)}async function b6(e,n){const r=await fetch("/plugins/terminal/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:n});return await px(r),gx(await r.json(),r.status)}async function px(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 fx(e.status,n)}function gx(e,n){const r=e;if(!r||typeof r.replaceSystemPrompt!="boolean"||typeof r.enableMetaphor!="boolean")throw new fx(n,"Invalid Terminal settings response");return{replaceSystemPrompt:r.replaceSystemPrompt,enableMetaphor:r.enableMetaphor}}const sg=new Set;let Xu={loading:!1,state:null,savingField:null,error:null},Du=0;function y6(){return j.useSyncExternalStore(S6,Bb,Bb)}function Bb(){return Xu}function S6(e){return sg.add(e),()=>{sg.delete(e)}}async function w6(e){const n=++Du;io({loading:!0,error:null});try{const r=await v6(e);if(n!==Du)return;io({loading:!1,state:r,error:null})}catch(r){if(e?.aborted||n!==Du)return;io({loading:!1,error:mx(r)})}}async function jb(e,n){const r=Xu.state;if(!r)return!1;Du+=1;const a={...r,[e]:n};io({state:a,savingField:e,error:null});try{const o=await b6(a);return io({state:o,savingField:null,error:null}),!0}catch(o){return io({state:r,savingField:null,error:mx(o)}),!1}}function io(e){Xu={...Xu,...e};for(const n of sg)n()}function mx(e){return e instanceof Error?e.message:String(e)}const x6=[{id:"webgl",label:"WebGL"},{id:"dom",label:"DOM"}],C6="/plugins/terminal/agent/ticket",E6="/plugins/terminal/ws",_x={pluginId:"terminal",type:"agent",title:"Agent",subtitle:e=>Al(e.payload,"cliLabel")??void 0,render:e=>h.jsx(T6,{context:e})},vx={id:"agent-cli",title:"Agent CLI",render:()=>h.jsx(R6,{})},bx={id:"agent.attention",title:"Agent input waiting"},k6={id:"agent.ended",title:"Agent turn ended"},vu={id:"terminal",operationKinds:[_x],settingsSections:[vx],notificationKinds:[bx,k6],install:e=>A6(e),closeOperation:async e=>{try{await MM(e)}finally{ox(e)}},launch:async({theaterId:e,kind:n})=>{const r=await RM(e,n.id);return Vu(r),lx(r.sessionId),{id:r.sessionId}},renderLaunchIcon:()=>h.jsx(W6,{})};function A6(e){return t6({operations:e.operations,notifications:e.notifications,status:e.status,refreshOperations:e.api.resync})}function T6({context:e}){const r=GM().sessions[e.operationId]??I6(e),[a,o]=j.useState(!1),g=j.useRef(null),_=j.useRef(null),c=j.useRef(null),d=cx(r).filter(C=>!ix(C.status)),b=d[0]??null,p=d.reduce((C,A)=>C+A.trackOrder.length,0),w=j.useCallback(()=>{o(!1),g.current?.focus()},[]);return j.useLayoutEffect(()=>{a&&_.current?.focus()},[a]),j.useEffect(()=>{if(!a)return;const C=A=>{if(A.key==="Escape"){A.stopPropagation(),w();return}if(A.key==="Tab"){const E=c.current;if(!E)return;const f=Array.from(E.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(S=>!S.hasAttribute("disabled")),y=f[0],m=f[f.length-1];A.shiftKey&&document.activeElement===y?(A.preventDefault(),m?.focus()):!A.shiftKey&&document.activeElement===m&&(A.preventDefault(),y?.focus())}};return document.addEventListener("keydown",C,!0),()=>document.removeEventListener("keydown",C,!0)},[a,w]),r.status==="dormant"?h.jsxs("button",{type:"button",className:"canvas-operation-dormant",onClick:()=>{j6(r.sessionId)},children:[h.jsx("span",{className:"canvas-operation-dormant-status",children:"Dormant"}),h.jsx("span",{className:"canvas-operation-dormant-action",children:"Resume"})]}):h.jsxs("div",{className:"agent-stream-host",children:[b?h.jsxs("button",{ref:g,type:"button",className:"job-summary job-summary--banner job-summary--live","aria-label":d.length>1?`${d.length} carriers streaming${p>0?`, ${p} tracks`:""} — click to expand`:`${b.label??b.jobId}${p>0?`, ${p} tracks`:""} — click to expand`,onClick:()=>o(!0),children:[h.jsxs("span",{className:"job-summary-row",children:[h.jsx("span",{className:"job-summary-dot","aria-hidden":"true"}),h.jsx("span",{className:"job-summary-eyebrow",children:d.length>1?`${d.length} carriers`:b.ownerCarrierId??"Carrier"}),p>0?h.jsx("span",{className:"job-summary-count","aria-hidden":"true",children:p}):null,h.jsx("span",{className:"job-summary-chev","aria-hidden":"true",children:"›"})]}),h.jsx("p",{className:"job-summary-text",children:b.label??b.jobId})]}):null,h.jsx(Qw,{operationId:r.sessionId,ticketPath:C6,wsPath:E6,active:e.active,zoom:e.zoom,theme:e.theme,onExit:()=>ox(r.sessionId)}),a?h.jsxs("div",{ref:c,className:"job-overlay",role:"dialog","aria-modal":"true","aria-label":"Carrier stream details",children:[h.jsx("button",{type:"button",className:"job-overlay-scrim","aria-label":"Close",tabIndex:-1,onClick:w}),h.jsxs("div",{className:"job-overlay-card",children:[h.jsx("button",{ref:_,type:"button",className:"job-overlay-close","aria-label":"Close",onClick:w,children:"×"}),h.jsx("div",{className:"job-overlay-body",children:d.length===0?h.jsx("p",{className:"job-overlay-empty",children:"No active streams."}):d.map(C=>h.jsx(D6,{job:C},C.jobId))})]})]}):null]})}function R6(){const[e,n]=j.useState([]),[r,a]=j.useState(null),{renderer:o,font:g}=Jw();return j.useEffect(()=>{const _=new AbortController;return CM(_.signal).then(c=>n(c.clis)).catch(c=>{_.signal.aborted||a(c instanceof Error?c.message:String(c))}),()=>_.abort()},[]),h.jsxs(h.Fragment,{children:[h.jsx(L6,{}),h.jsx(M6,{}),h.jsxs("section",{className:"global-settings-card","aria-label":"Agent CLI Available",children:[h.jsx("div",{className:"agent-cli-head",children:h.jsx("p",{className:"global-settings-resp-title",children:"Agent CLI Available"})}),h.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."}),r?h.jsx("p",{className:"settings-error",children:r}):null,h.jsx("div",{className:"agent-cli-list",children:e.map(_=>h.jsx(O6,{cli:_},_.id))}),h.jsx("p",{className:"global-settings-foot",children:"Install or update a CLI, then reopen this page to re-check availability."})]}),h.jsx(P6,{terminalFont:g}),h.jsx(z6,{terminalRenderer:o})]})}function L6(){const e=y6(),n=e.state,r=e.savingField!==null;return j.useEffect(()=>{const a=new AbortController;return w6(a.signal),()=>a.abort()},[]),h.jsxs("section",{className:"global-settings-card","aria-label":"System Prompt",children:[e.error?h.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,n?h.jsxs(h.Fragment,{children:[h.jsx(Ib,{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:n.replaceSystemPrompt,disabled:r,onToggle:()=>{jb("replaceSystemPrompt",!n.replaceSystemPrompt)}}),h.jsx(Ib,{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:n.enableMetaphor,disabled:r,onToggle:()=>{jb("enableMetaphor",!n.enableMetaphor)}})]}):h.jsx("p",{className:"global-settings-help",children:e.loading?"Loading settings.":"Settings unavailable."}),h.jsx("p",{className:"global-settings-foot",children:"Changes apply to newly launched sessions. Running sessions keep their current configuration until relaunched."})]})}function Ib({title:e,help:n,onLabel:r,offLabel:a,value:o,disabled:g,onToggle:_}){return h.jsxs("div",{className:"global-settings-row",children:[h.jsxs("div",{className:"global-settings-row-text",children:[h.jsx("p",{className:"global-settings-resp-title",children:e}),h.jsx("p",{className:"global-settings-help",children:n})]}),h.jsx("button",{type:"button",className:`global-settings-toggle ${o?"is-on":""}`,disabled:g,"aria-pressed":o,onClick:_,children:h.jsx("span",{children:o?r:a})})]})}function M6(){const e=f6();return j.useEffect(()=>{const n=new AbortController;return g6(n.signal),()=>n.abort()},[]),h.jsxs("section",{className:"global-settings-card","aria-label":"Model sign-in",children:[h.jsxs("div",{className:"model-auth-head",children:[h.jsx("p",{className:"global-settings-resp-title",children:"Model Sign-in"}),h.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?h.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,e.loading&&!e.state?h.jsx("p",{className:"global-settings-help",children:"Loading sign-in state."}):null,e.state?.providers.map(n=>h.jsx(N6,{provider:n,busy:e.busyCli===n.cli},n.cli)),h.jsx("p",{className:"global-settings-foot",children:"Sign-in changes apply to newly launched sessions. Running sessions keep their current credentials until relaunched."})]})}function N6({provider:e,busy:n}){const[r,a]=j.useState(""),o=async()=>{await m6(e.cli,r)&&a("")},g=async()=>{await _6(e.cli)};return h.jsxs("div",{className:"model-auth-row",children:[h.jsxs("div",{className:"model-auth-row-head",children:[h.jsx("span",{className:"model-auth-name",children:e.displayName}),h.jsx("span",{className:`model-auth-status ${e.signedIn?"is-on":""}`,children:e.signedIn?"Signed in":"Not signed in"})]}),e.signedIn?h.jsx("div",{className:"model-auth-actions",children:h.jsx("button",{type:"button",className:"model-auth-button",disabled:n,onClick:()=>{g()},children:n?"Working…":"Sign out"})}):h.jsxs("form",{className:"model-auth-form",onSubmit:_=>{_.preventDefault(),o()},children:[h.jsx("input",{type:"password",className:"model-auth-input",placeholder:"API key",value:r,autoComplete:"off",spellCheck:!1,disabled:n,"aria-label":`${e.displayName} API key`,onChange:_=>a(_.target.value)}),h.jsx("button",{type:"submit",className:"model-auth-button is-primary",disabled:n||r.trim().length===0,children:n?"Verifying…":"Sign in"})]})]})}function O6({cli:e}){return h.jsxs("div",{className:"agent-cli-row",children:[h.jsx("span",{className:"agent-cli-name",children:e.displayName}),h.jsxs("span",{className:"agent-cli-meta",children:[e.available&&e.version?h.jsx("span",{className:"agent-cli-version",children:e.version}):null,h.jsx("span",{className:`agent-cli-status ${e.available?"is-on":""}`,children:e.available?"Available":"Missing"})]})]})}function D6({job:e}){return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"job-overlay-head",children:[h.jsx("span",{className:"job-overlay-kicker",children:e.status}),h.jsx("strong",{children:e.label??e.jobId})]}),h.jsx("div",{className:"job-overlay-tracks",children:e.trackOrder.map(n=>{const r=e.tracks[n];return r?h.jsx(B6,{track:r},r.trackId):null})})]})}function B6({track:e}){const n=F6(e.status),r=n==="track-card--live";return h.jsxs("article",{className:n?`track-card ${n}`:"track-card",children:[h.jsxs("header",{className:"track-card-head",children:[h.jsx("span",{className:"track-card-title",children:e.displayName}),h.jsx("span",{className:"track-card-status",children:e.status})]}),e.thought?h.jsxs("div",{className:"track-card-thought",role:"group","aria-label":"Thinking",children:[h.jsx("span",{className:"track-card-section-label","aria-hidden":"true",children:"thinking"}),h.jsx("pre",{children:e.thought})]}):null,e.text?h.jsxs("div",{className:"track-card-text",role:"group","aria-label":"Output",children:[h.jsx("span",{className:"track-card-section-label track-card-section-label--output","aria-hidden":"true",children:"output"}),h.jsxs("pre",{children:[e.text,r?h.jsx("span",{className:"track-card-caret","aria-hidden":"true"}):null]})]}):null,e.error?h.jsx("div",{className:"track-card-error",role:"group","aria-label":"Error",children:e.error}):null,e.tools.length>0?h.jsx("ul",{className:"track-card-tools",children:e.tools.map(a=>h.jsx("li",{children:a.name??a.id},a.id))}):null]})}async function j6(e){Vu(await LM(e)),lx(e)}function I6(e){return{sessionId:e.operation.id,terminalSessionId:e.operation.id,cwdLabel:e.operation.title||"Workspace",label:e.operation.title,cliId:Al(e.operation.payload,"cliId")??void 0,cliLabel:Al(e.operation.payload,"cliLabel")??void 0,status:"dormant",turnState:"none",createdAt:e.operation.ts.createdAt,theaterId:e.theaterId,tenantId:Al(e.operation.payload,"tenantId")??void 0,registrationId:Al(e.operation.payload,"registrationId")??void 0,resumeAvailable:!0}}function Al(e,n){const r=e[n];return typeof r=="string"?r:null}function P6({terminalFont:e}){const n=Xw(e),r=$6(e);return h.jsxs("section",{className:"global-settings-card","aria-label":"Terminal Font",children:[h.jsxs("div",{className:"global-settings-row is-stack",children:[h.jsxs("div",{className:"global-settings-row-text",children:[h.jsxs("p",{className:"global-settings-resp-title",children:["Terminal Font ",h.jsx("span",{className:"new-badge",children:"New"})]}),h.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."})]}),h.jsxs("div",{className:"font-control","aria-describedby":"terminal-font-help",children:[h.jsxs("div",{className:"current-readout","aria-live":"polite",children:[h.jsx("span",{className:"cr-label",children:"Currently"}),h.jsx("span",{className:"cr-value",children:r}),h.jsx("span",{className:"cr-sep",children:"·"}),h.jsxs("span",{className:"cr-value",children:[e.size,"px"]}),h.jsx("span",{className:"cr-sep",children:"·"}),h.jsx("span",{className:`cr-value ${n.status==="fallback"?"is-fallback":"is-ok"}`,children:n.status})]}),h.jsxs("div",{className:"font-cards",role:"group","aria-label":"Terminal font family",children:[fh.map(a=>h.jsx(H6,{font:a,active:e.source==="curated"&&e.id===a.id,onSelect:()=>hM(a.id)},a.id)),h.jsxs("button",{type:"button","aria-pressed":e.source==="custom",className:`font-card ${e.source==="custom"?"is-active":""}`,onClick:()=>{e.source!=="custom"&&kb("")},children:[h.jsxs("span",{className:"fc-name",children:["Custom…",h.jsx("span",{className:"fc-check","aria-hidden":"true",children:"✓"})]}),h.jsx("span",{className:"fc-sample is-custom","aria-hidden":"true",children:"type a font"}),h.jsx("span",{className:"fc-meta",children:"your installed face"}),h.jsx("span",{className:"fc-bundled fc-addon",children:"local OS font"})]})]}),h.jsx("div",{className:`custom-reveal ${e.source==="custom"?"is-open":""}`,children:h.jsxs("div",{className:"font-field-wrap",children:[h.jsxs("label",{className:"font-field",children:[h.jsx("span",{className:"field-icon","aria-hidden":"true",children:"Aa"}),h.jsx("input",{type:"text",spellCheck:!1,value:e.customName,placeholder:"e.g. MesloLGS NF, Fira Code, IBM Plex Mono","aria-label":"Custom terminal font family",onChange:a=>kb(a.currentTarget.value)})]}),h.jsxs("div",{className:`resolve-chip ${n.status==="fallback"?"is-fallback":"is-ok"}`,"aria-live":"polite",children:[h.jsx("span",{className:"rc-dot","aria-hidden":"true"}),h.jsx("span",{children:U6(e)})]})]})}),h.jsxs("div",{className:"size-row",children:[h.jsxs("div",{className:"size-stepper",role:"group","aria-label":"Font size",children:[h.jsx("button",{type:"button","aria-label":"Decrease terminal font size",disabled:e.size<=Sb.min,onClick:()=>Ab(e.size-1),children:"−"}),h.jsxs("span",{className:"size-val",children:[e.size,h.jsx("span",{children:" px"})]}),h.jsx("button",{type:"button","aria-label":"Increase terminal font size",disabled:e.size>=Sb.max,onClick:()=>Ab(e.size+1),children:"+"})]}),h.jsx("span",{className:"size-label",children:"Cell size — rescales every panel; zoom stays relative"})]})]})]}),h.jsx("p",{className:"global-settings-foot",children:"Appearance preferences apply immediately and are stored per browser, separate from session settings."})]})}function z6({terminalRenderer:e}){return h.jsx("section",{className:"global-settings-card","aria-label":"Terminal Renderer",children:h.jsxs("div",{className:"global-settings-row",children:[h.jsxs("div",{className:"global-settings-row-text",children:[h.jsx("p",{className:"global-settings-resp-title",children:"Terminal Renderer"}),h.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."})]}),h.jsx("div",{className:"segmented",role:"group","aria-label":"Terminal renderer",children:x6.map(n=>{const r=n.id===e;return h.jsx("button",{type:"button","aria-pressed":r,className:`segmented-option ${r?"is-active":""}`,onClick:()=>uM(n.id),children:n.label},n.id)})})]})})}function H6({active:e,font:n,onSelect:r}){return h.jsxs("button",{type:"button","aria-pressed":e,className:`font-card ${e?"is-active":""}`,onClick:r,children:[h.jsxs("span",{className:"fc-name",children:[n.name,h.jsx("span",{className:"fc-check","aria-hidden":"true",children:"✓"})]}),h.jsx("span",{className:"fc-sample",style:{fontFamily:n.family},"aria-hidden":"true",children:"Ag 0O ─┼ =>"}),h.jsx("span",{className:"fc-meta",children:n.meta}),h.jsx("span",{className:"fc-bundled",children:"self-hosted"})]})}function $6(e){return e.source==="custom"?e.customName||`${Gu(null).name} (default)`:Gu(e.id).name}function U6(e){if(!e.customName)return`Empty — using default ${Gu(null).name}`;const n=Xw(e);return n.status==="resolved"?`"${e.customName}" resolves on this machine`:`"${e.customName}" not found — falls back to ${n.fallbackName}`}function F6(e){return e==="stream"||e==="live"||e==="running"||e==="active"?"track-card--live":e==="error"?"track-card--bad":e==="done"||e==="aborted"?"track-card--idle":""}function W6(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.jsx("path",{d:"M8 2.6 12.6 5.2v5.6L8 13.4 3.4 10.8V5.2Z",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinejoin:"round"}),h.jsx("path",{d:"M6.2 7.9h3.6M8 6.1v3.6",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinecap:"round"})]})}const G6="/plugins/terminal/shell/ticket",q6="/plugins/terminal/ws",yx={pluginId:"terminal",type:"shell",title:"Shell",subtitle:()=>"shell",render:e=>j.createElement(K6,{context:e})},Xf={id:"terminal",operationKinds:[yx],install:()=>{},closeOperation:async e=>{await fetch(`/plugins/terminal/shell/sessions/${encodeURIComponent(e)}`,{method:"DELETE"})},launch:async({theaterId:e,operations:n})=>({id:(await n.create({theaterId:e,type:"shell",pluginId:"terminal",title:"Shell",payload:{theaterId:e}})).id}),renderLaunchIcon:()=>h.jsx(V6,{})};function K6({context:e}){return h.jsx(Qw,{operationId:e.operationId,active:e.active,zoom:e.zoom,ticketPath:G6,wsPath:q6,theme:e.theme,onExit:e.onClose})}function V6(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.jsx("rect",{x:"2.8",y:"3.4",width:"10.4",height:"9.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.15"}),h.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"})]})}const Y6=new Set(["agent"]),X6={id:"terminal",operationKinds:[yx,_x],settingsSections:[vx],notificationKinds:[bx],install:e=>vu.install?.(e),closeOperation:async e=>{const n=await J6(e);if(n?.type==="shell"){await Xf.closeOperation?.(e);return}n&&Y6.has(n.type)&&await vu.closeOperation?.(e)},launch:async e=>e.kind.type==="shell"?Xf.launch?.(e)??{id:""}:vu.launch?.(e)??{id:""},renderLaunchIcon:e=>e.type==="shell"?Xf.renderLaunchIcon?.(e):vu.renderLaunchIcon?.(e)},Z6=[X6];async function J6(e){const n=await fetch(`/api/v1/operations/${encodeURIComponent(e)}`);if(!n.ok)return null;const r=await n.json();return typeof r.operation?.type=="string"?{type:r.operation.type}:null}const se={ts:"ts",js:"js",json:"json",css:"css",html:"html",md:"md",py:"py",go:"go",rust:"rust",shell:"shell",config:"config",image:"image",data:"data",archive:"archive",binary:"binary",ruby:"ruby",folder:"folder",default:"default"},Q6={src:se.ts,lib:se.ts,app:se.ts,test:se.shell,tests:se.shell,__tests__:se.shell,spec:se.shell,specs:se.shell,node_modules:se.binary,vendor:se.binary,dist:se.config,build:se.config,out:se.config,target:se.config,docs:se.md,doc:se.md,public:se.data,assets:se.data,static:se.data,components:se.image,scripts:se.js,styles:se.css,".git":se.html,".github":se.config,".vscode":se.css},Pb={ts:{shape:"angle",tone:se.ts},tsx:{shape:"angle",tone:se.ts},mts:{shape:"angle",tone:se.ts},cts:{shape:"angle",tone:se.ts},"d.ts":{shape:"angle",tone:se.ts},js:{shape:"angle",tone:se.js},jsx:{shape:"angle",tone:se.js},mjs:{shape:"angle",tone:se.js},cjs:{shape:"angle",tone:se.js},json:{shape:"braces",tone:se.json},jsonc:{shape:"braces",tone:se.json},json5:{shape:"braces",tone:se.json},jsonl:{shape:"braces",tone:se.json},graphql:{shape:"braces",tone:se.image},gql:{shape:"braces",tone:se.image},proto:{shape:"braces",tone:se.go},css:{shape:"hash",tone:se.css},scss:{shape:"hash",tone:se.css},sass:{shape:"hash",tone:se.css},less:{shape:"hash",tone:se.css},styl:{shape:"hash",tone:se.css},html:{shape:"markup",tone:se.html},htm:{shape:"markup",tone:se.html},xml:{shape:"markup",tone:se.html},xhtml:{shape:"markup",tone:se.html},vue:{shape:"markup",tone:se.shell},svelte:{shape:"markup",tone:se.rust},astro:{shape:"markup",tone:se.image},md:{shape:"doc",tone:se.md},mdx:{shape:"doc",tone:se.md},markdown:{shape:"doc",tone:se.md},rst:{shape:"doc",tone:se.md},txt:{shape:"doc",tone:se.default},text:{shape:"doc",tone:se.default},log:{shape:"doc",tone:se.default},adoc:{shape:"doc",tone:se.md},pdf:{shape:"doc",tone:se.ruby},py:{shape:"angle",tone:se.py},pyi:{shape:"angle",tone:se.py},pyw:{shape:"angle",tone:se.py},go:{shape:"angle",tone:se.go},rs:{shape:"angle",tone:se.rust},rb:{shape:"angle",tone:se.ruby},rake:{shape:"angle",tone:se.ruby},gemspec:{shape:"angle",tone:se.ruby},java:{shape:"angle",tone:se.html},kt:{shape:"angle",tone:se.config},kts:{shape:"angle",tone:se.config},scala:{shape:"angle",tone:se.ruby},c:{shape:"angle",tone:se.ts},h:{shape:"angle",tone:se.ts},cpp:{shape:"angle",tone:se.css},cc:{shape:"angle",tone:se.css},cxx:{shape:"angle",tone:se.css},hpp:{shape:"angle",tone:se.css},cs:{shape:"angle",tone:se.config},php:{shape:"angle",tone:se.config},swift:{shape:"angle",tone:se.html},lua:{shape:"angle",tone:se.ts},dart:{shape:"angle",tone:se.go},sh:{shape:"terminal",tone:se.shell},bash:{shape:"terminal",tone:se.shell},zsh:{shape:"terminal",tone:se.shell},fish:{shape:"terminal",tone:se.shell},ps1:{shape:"terminal",tone:se.css},bat:{shape:"terminal",tone:se.shell},cmd:{shape:"terminal",tone:se.shell},yaml:{shape:"gear",tone:se.config},yml:{shape:"gear",tone:se.config},toml:{shape:"gear",tone:se.config},ini:{shape:"gear",tone:se.config},conf:{shape:"gear",tone:se.config},cfg:{shape:"gear",tone:se.config},properties:{shape:"gear",tone:se.config},env:{shape:"gear",tone:se.config},editorconfig:{shape:"gear",tone:se.config},png:{shape:"image",tone:se.image},jpg:{shape:"image",tone:se.image},jpeg:{shape:"image",tone:se.image},gif:{shape:"image",tone:se.image},webp:{shape:"image",tone:se.image},svg:{shape:"image",tone:se.image},ico:{shape:"image",tone:se.image},bmp:{shape:"image",tone:se.image},avif:{shape:"image",tone:se.image},tiff:{shape:"image",tone:se.image},heic:{shape:"image",tone:se.image},mp4:{shape:"image",tone:se.data},mov:{shape:"image",tone:se.data},webm:{shape:"image",tone:se.data},mkv:{shape:"image",tone:se.data},mp3:{shape:"chip",tone:se.shell},wav:{shape:"chip",tone:se.shell},flac:{shape:"chip",tone:se.shell},ogg:{shape:"chip",tone:se.shell},sql:{shape:"database",tone:se.data},csv:{shape:"database",tone:se.data},tsv:{shape:"database",tone:se.data},db:{shape:"database",tone:se.data},sqlite:{shape:"database",tone:se.data},sqlite3:{shape:"database",tone:se.data},parquet:{shape:"database",tone:se.data},zip:{shape:"archive",tone:se.archive},tar:{shape:"archive",tone:se.archive},gz:{shape:"archive",tone:se.archive},tgz:{shape:"archive",tone:se.archive},bz2:{shape:"archive",tone:se.archive},xz:{shape:"archive",tone:se.archive},rar:{shape:"archive",tone:se.archive},"7z":{shape:"archive",tone:se.archive},zst:{shape:"archive",tone:se.archive},bin:{shape:"chip",tone:se.binary},exe:{shape:"chip",tone:se.binary},dll:{shape:"chip",tone:se.binary},so:{shape:"chip",tone:se.binary},dylib:{shape:"chip",tone:se.binary},wasm:{shape:"chip",tone:se.config},class:{shape:"chip",tone:se.binary},lock:{shape:"chip",tone:se.binary},woff:{shape:"chip",tone:se.config},woff2:{shape:"chip",tone:se.config},ttf:{shape:"chip",tone:se.config},otf:{shape:"chip",tone:se.config}},e4={dockerfile:{shape:"chip",tone:se.css},"docker-compose.yml":{shape:"gear",tone:se.css},"docker-compose.yaml":{shape:"gear",tone:se.css},makefile:{shape:"gear",tone:se.html},"cmakelists.txt":{shape:"gear",tone:se.html},".gitignore":{shape:"gear",tone:se.html},".gitattributes":{shape:"gear",tone:se.html},".dockerignore":{shape:"gear",tone:se.html},".npmignore":{shape:"gear",tone:se.html},".npmrc":{shape:"gear",tone:se.ruby},"package.json":{shape:"braces",tone:se.shell},"tsconfig.json":{shape:"braces",tone:se.ts},license:{shape:"doc",tone:se.json},"license.md":{shape:"doc",tone:se.json},licence:{shape:"doc",tone:se.json}},t4={shape:"default",tone:se.default},ag={angle:h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M5.6 4.5 2.4 8l3.2 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M10.4 4.5 13.6 8l-3.2 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M9.1 3.4 6.9 12.6",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",opacity:"0.55"})]}),braces:h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M6.4 3.4c-1.1 0-1.5.5-1.5 1.5v1.2c0 .9-.4 1.4-1.1 1.6v.6c.7.2 1.1.7 1.1 1.6v1.2c0 1 .4 1.5 1.5 1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M9.6 3.4c1.1 0 1.5.5 1.5 1.5v1.2c0 .9.4 1.4 1.1 1.6v.6c-.7.2-1.1.7-1.1 1.6v1.2c0 1-.4 1.5-1.5 1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("circle",{cx:"8",cy:"8",r:"0.85",fill:"currentColor",opacity:"0.6"})]}),hash:h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M6.6 3 5.2 13M10.8 3 9.4 13",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round"}),h.jsx("path",{d:"M3.6 6.4h9M3.4 9.6h9",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round"})]}),doc:h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M4 2.5h5l3 3v8a.6.6 0 0 1-.6.6H4a.6.6 0 0 1-.6-.6V3.1a.6.6 0 0 1 .6-.6Z",fill:"currentColor",opacity:"0.16"}),h.jsx("path",{d:"M4 2.5h5l3 3v8a.6.6 0 0 1-.6.6H4a.6.6 0 0 1-.6-.6V3.1a.6.6 0 0 1 .6-.6Z",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"}),h.jsx("path",{d:"M9 2.7V5.5h2.8",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"}),h.jsx("path",{d:"M5.7 8.6h4.6M5.7 10.5h4.6M5.7 12.1h3",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",opacity:"0.7"})]}),image:h.jsxs(h.Fragment,{children:[h.jsx("rect",{x:"2.5",y:"3.6",width:"11",height:"8.8",rx:"1.4",fill:"currentColor",opacity:"0.16"}),h.jsx("rect",{x:"2.5",y:"3.6",width:"11",height:"8.8",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.1"}),h.jsx("circle",{cx:"5.9",cy:"6.6",r:"1.1",fill:"currentColor"}),h.jsx("path",{d:"M3 11.4 6.6 7.9l2 2 1.9-1.7 2.5 2.3",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"})]}),terminal:h.jsxs(h.Fragment,{children:[h.jsx("rect",{x:"2.3",y:"3.3",width:"11.4",height:"9.4",rx:"1.5",fill:"currentColor",opacity:"0.16"}),h.jsx("rect",{x:"2.3",y:"3.3",width:"11.4",height:"9.4",rx:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.1"}),h.jsx("path",{d:"M5 6.4 7.3 8 5 9.6",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M8.4 9.8h3",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})]}),gear:h.jsxs(h.Fragment,{children:[h.jsx("circle",{cx:"8",cy:"8",r:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.25"}),h.jsx("circle",{cx:"8",cy:"8",r:"2",fill:"currentColor",opacity:"0.18"}),h.jsx("path",{d:"M8 2.4v2.1M8 11.5v2.1M13.6 8h-2.1M4.5 8H2.4M11.96 4.04l-1.49 1.49M5.53 10.47l-1.49 1.49M11.96 11.96l-1.49-1.49M5.53 5.53 4.04 4.04",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})]}),markup:h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M5.6 4.2 2.4 8l3.2 3.8",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M10.4 4.2 13.6 8l-3.2 3.8",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("circle",{cx:"8",cy:"8",r:"1.15",fill:"currentColor"})]}),database:h.jsxs(h.Fragment,{children:[h.jsx("ellipse",{cx:"8",cy:"4.6",rx:"4.4",ry:"1.8",fill:"currentColor",opacity:"0.18"}),h.jsx("path",{d:"M3.6 4.6v6.8c0 1 2 1.8 4.4 1.8s4.4-.8 4.4-1.8V4.6",fill:"none",stroke:"currentColor",strokeWidth:"1.1"}),h.jsx("ellipse",{cx:"8",cy:"4.6",rx:"4.4",ry:"1.8",fill:"none",stroke:"currentColor",strokeWidth:"1.1"}),h.jsx("path",{d:"M3.6 8c0 1 2 1.8 4.4 1.8s4.4-.8 4.4-1.8",fill:"none",stroke:"currentColor",strokeWidth:"1.1",opacity:"0.65"})]}),archive:h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M3 5.2 8 3.1l5 2.1v5.6L8 12.9 3 10.8V5.2Z",fill:"currentColor",opacity:"0.16"}),h.jsx("path",{d:"M3 5.2 8 3.1l5 2.1v5.6L8 12.9 3 10.8V5.2Z",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"}),h.jsx("path",{d:"M3 5.2 8 7.3l5-2.1M8 7.3v5.6",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"}),h.jsx("path",{d:"M5.5 4.15 10.5 6.25",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",opacity:"0.6"})]}),chip:h.jsxs(h.Fragment,{children:[h.jsx("rect",{x:"4.2",y:"4.2",width:"7.6",height:"7.6",rx:"1.1",fill:"currentColor",opacity:"0.16"}),h.jsx("rect",{x:"4.2",y:"4.2",width:"7.6",height:"7.6",rx:"1.1",fill:"none",stroke:"currentColor",strokeWidth:"1.1"}),h.jsx("rect",{x:"6.6",y:"6.6",width:"2.8",height:"2.8",rx:"0.5",fill:"currentColor",opacity:"0.5"}),h.jsx("path",{d:"M6.5 2.6v1.6M9.5 2.6v1.6M6.5 11.8v1.6M9.5 11.8v1.6M2.6 6.5h1.6M2.6 9.5h1.6M11.8 6.5h1.6M11.8 9.5h1.6",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round"})]}),default:h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M4 2.5h5l3 3v8a.6.6 0 0 1-.6.6H4a.6.6 0 0 1-.6-.6V3.1a.6.6 0 0 1 .6-.6Z",fill:"currentColor",opacity:"0.14"}),h.jsx("path",{d:"M4 2.5h5l3 3v8a.6.6 0 0 1-.6.6H4a.6.6 0 0 1-.6-.6V3.1a.6.6 0 0 1 .6-.6Z",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"}),h.jsx("path",{d:"M9 2.7V5.5h2.8",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"})]}),folderClosed:h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M2.4 5.4c0-.69.56-1.25 1.25-1.25h2.7c.33 0 .65.13.88.37l.72.72c.23.23.55.37.88.37h3.15c.69 0 1.25.56 1.25 1.25v4.05c0 .69-.56 1.25-1.25 1.25H3.65c-.69 0-1.25-.56-1.25-1.25V5.4Z",fill:"currentColor",opacity:"0.2"}),h.jsx("path",{d:"M2.4 5.4c0-.69.56-1.25 1.25-1.25h2.7c.33 0 .65.13.88.37l.72.72c.23.23.55.37.88.37h3.15c.69 0 1.25.56 1.25 1.25v4.05c0 .69-.56 1.25-1.25 1.25H3.65c-.69 0-1.25-.56-1.25-1.25V5.4Z",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"})]}),folderOpen:h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M2.4 5.2c0-.69.56-1.25 1.25-1.25h2.7c.33 0 .65.13.88.37l.72.72c.23.23.55.37.88.37h3.15c.69 0 1.25.56 1.25 1.25v1.1H2.4V5.2Z",fill:"currentColor",opacity:"0.18"}),h.jsx("path",{d:"M1.45 7.55h12.1l-1.16 3.88c-.17.56-.69.97-1.28.97H3.89c-.59 0-1.11-.41-1.28-.97L1.45 7.55Z",fill:"currentColor",opacity:"0.26"}),h.jsx("path",{d:"M2.4 5.2c0-.69.56-1.25 1.25-1.25h2.7c.33 0 .65.13.88.37l.72.72c.23.23.55.37.88.37h3.15c.69 0 1.25.56 1.25 1.25v.8",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"}),h.jsx("path",{d:"M1.45 7.55h12.1l-1.16 3.88c-.17.56-.69.97-1.28.97H3.89c-.59 0-1.11-.41-1.28-.97L1.45 7.55Z",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"})]})};function n4({name:e}){const n=r4(e);return h.jsx("svg",{className:"fexp-file-svg",width:"15",height:"15",viewBox:"0 0 16 16","aria-hidden":"true",style:{color:`var(--fexp-ic-${n.tone})`},children:ag[n.shape]})}function i4({name:e,open:n}){const r=Q6[e.toLowerCase()]??se.folder;return h.jsx("svg",{className:"fexp-file-svg",width:"15",height:"15",viewBox:"0 0 16 16","aria-hidden":"true",style:{color:`var(--fexp-ic-${r})`},children:n?ag.folderOpen:ag.folderClosed})}function r4(e){const n=e.toLowerCase(),r=e4[n];if(r)return r;if(n.startsWith(".env"))return{shape:"gear",tone:se.config};if(n.startsWith("readme"))return{shape:"doc",tone:se.md};if(n.endsWith(".d.ts"))return Pb["d.ts"];const a=n.lastIndexOf(".");if(a>0&&a<n.length-1){const o=n.slice(a+1),g=Pb[o];if(g)return g}return t4}const s4=200,bu=30,zb=5,Sx="fleet-console.fileExplorer.showHidden";function wx(e,n,r,a){for(const o of e)if(!(!a&&o.name.startsWith("."))){if(o.name.toLowerCase().includes(r))return!0;if(o.kind==="dir"){const g=n.get(o.relativePath)?.entries;if(g&&wx(g,n,r,a))return!0}}return!1}function xx(e,n,r,a,o,g,_,c){const u=[];for(const d of e)if(!(!c&&d.name.startsWith("."))){if(_){const b=d.name.toLowerCase().includes(_),p=d.kind==="dir"&&wx(g.get(d.relativePath)?.entries??[],g,_,c);if(!b&&!p)continue}if(u.push({entry:d,depth:n,isSelected:r===d.relativePath,isExpanded:a.has(d.relativePath),isLoading:o.has(d.relativePath)}),d.kind==="dir"&&a.has(d.relativePath)){const b=g.get(d.relativePath)?.entries;b&&u.push(...xx(b,n+1,r,a,o,g,_,c))}}return u}function a4({files:e,theaterId:n,selectedPath:r,onSelect:a}){const[o,g]=j.useState(null),[_,c]=j.useState(null),[u,d]=j.useState(""),[b,p]=j.useState(new Set),[w,C]=j.useState(new Set),[A,E]=j.useState(new Map),[f,y]=j.useState(""),[m,S]=j.useState(0),[k,L]=j.useState(600),[R,M]=j.useState(()=>o4()),T=j.useRef(null);j.useEffect(()=>{n&&(g(null),c(null),d(""),p(new Set),E(new Map),y(""))},[n]),j.useEffect(()=>{n&&e.listFolder(u||void 0).then(g).catch(z=>{c(z instanceof Error?z.message:"Unable to load folder")})},[n,u,e]),j.useEffect(()=>{const z=T.current;if(!z)return;const W=new ResizeObserver(()=>L(z.clientHeight));return W.observe(z),L(z.clientHeight),()=>W.disconnect()},[]);const I=j.useCallback(z=>{const W=z.relativePath;p(Z=>{const ie=new Set(Z);return ie.has(W)?(ie.delete(W),ie):(ie.add(W),ie)}),A.has(W)||(C(Z=>new Set(Z).add(W)),e.listFolder(W).then(Z=>{E(ie=>new Map(ie).set(W,Z)),C(ie=>{const he=new Set(ie);return he.delete(W),he})}).catch(()=>{C(Z=>{const ie=new Set(Z);return ie.delete(W),ie})}))},[e,A]),K=j.useCallback(z=>{z.kind==="dir"?I(z):a(z)},[I,a]),F=j.useCallback(z=>{S(z.currentTarget.scrollTop)},[]),G=j.useCallback(()=>{M(z=>{const W=!z;try{localStorage.setItem(Sx,W?"1":"0")}catch{}return W})},[]),B=f.toLowerCase(),Y=j.useMemo(()=>o?xx(o.entries,0,r,b,w,A,B,R):[],[o,r,b,w,A,B,R]),X=!R&&o!==null&&o.entries.length>0&&Y.length===0&&!f,H=Y.length>s4,q=H?Math.max(0,Math.floor(m/bu)-zb):0,V=H?Math.min(Y.length,Math.ceil((m+k)/bu)+zb):Y.length,D=Y.slice(q,V),P=Y.length*bu,O=q*bu;return n?_?h.jsx("div",{className:"fexp-tree-error",children:_}):o?h.jsxs("div",{className:"fexp-tree-container",children:[h.jsxs("div",{className:"fexp-filter",children:[h.jsx("input",{type:"text",className:"fexp-filter-input",placeholder:"Filter…",value:f,onChange:z=>y(z.target.value),"aria-label":"Filter files"}),f&&h.jsx("button",{type:"button",className:"fexp-filter-clear",onClick:()=>y(""),"aria-label":"Clear filter",children:"✕"}),h.jsx("button",{type:"button",className:`fexp-hidden-toggle${R?" is-active":""}`,onClick:G,"aria-pressed":R,"aria-label":R?"Hide hidden files":"Show hidden files",title:R?"Hide hidden files":"Show hidden files",children:R?h.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[h.jsx("ellipse",{cx:"8",cy:"8",rx:"5.5",ry:"3.5",stroke:"currentColor",strokeWidth:"1.4"}),h.jsx("circle",{cx:"8",cy:"8",r:"1.8",fill:"currentColor"})]}):h.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[h.jsx("ellipse",{cx:"8",cy:"8",rx:"5.5",ry:"3.5",stroke:"currentColor",strokeWidth:"1.4"}),h.jsx("circle",{cx:"8",cy:"8",r:"1.8",fill:"currentColor"}),h.jsx("line",{x1:"3",y1:"13",x2:"13",y2:"3",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})})]}),h.jsxs("div",{ref:T,className:"fexp-tree",role:"tree","aria-label":"File tree",onScroll:H?F:void 0,children:[o.parentRelativePath!==null&&!f&&h.jsx("button",{className:"fexp-tree-up",type:"button",onClick:()=>d(o.parentRelativePath??""),"aria-label":"Parent folder",children:"↑ .."}),H?h.jsx("div",{style:{height:P,position:"relative"},children:h.jsx("div",{style:{transform:`translateY(${O}px)`},children:D.map(z=>h.jsx(Hb,{row:z,onEntryClick:K},z.entry.relativePath))})}):D.map(z=>h.jsx(Hb,{row:z,onEntryClick:K},z.entry.relativePath)),Y.length===0&&f&&h.jsx("div",{className:"fexp-tree-empty",children:"No matching items"}),Y.length===0&&!f&&o.entries.length===0&&h.jsx("div",{className:"fexp-tree-empty",children:"This folder is empty"}),X&&h.jsx("div",{className:"fexp-tree-empty",children:"Only hidden items — use the eye icon to show them"})]})]}):h.jsx("div",{className:"fexp-tree-loading",children:"Loading…"}):h.jsx("div",{className:"fexp-tree-empty",children:"Select a Theater"})}function Hb({row:e,onEntryClick:n}){const{entry:r,depth:a,isSelected:o,isExpanded:g,isLoading:_}=e,c=r.kind==="dir",u=a*16,d=j.useCallback(()=>n(r),[r,n]);return h.jsxs("button",{className:`fexp-tree-row${o?" is-cur":""}${c?" is-dir":" is-file"}`,style:{paddingLeft:`${u+12}px`},type:"button",role:"treeitem","aria-selected":o,"aria-expanded":c?g:void 0,onClick:d,children:[h.jsx("span",{className:"fexp-tree-icon","aria-hidden":"true",children:c?h.jsx(i4,{name:r.name,open:g}):h.jsx(n4,{name:r.name})}),h.jsx("span",{className:"fexp-tree-name",children:r.name}),_&&h.jsx("span",{className:"fexp-tree-spin","aria-hidden":"true",children:"⋯"})]})}function o4(){try{return localStorage.getItem(Sx)==="1"}catch{return!1}}function l4({name:e,sizeHint:n}){return h.jsxs("div",{className:"fexp-bin-wrap v-bin",children:[h.jsx("span",{className:"fexp-bin-glyph","aria-hidden":"true",children:"⊘"}),h.jsx("p",{className:"fexp-bin-name",children:e}),n&&h.jsx("p",{className:"fexp-bin-meta",children:n}),h.jsx("p",{className:"fexp-bin-hint",children:"Binary files can't be previewed"})]})}function c4(e,n){switch(n){case"typescript":case"javascript":return h4(e);case"json":return d4(e);case"python":return p4(e);case"css":case"scss":case"sass":case"less":return g4(e);case"html":case"xml":return m4(e);case"bash":case"shell":return _4(e);case"yaml":return v4(e);default:return[{kind:"text",value:e}]}}const u4=new Set(["abstract","as","async","await","break","case","catch","class","const","continue","debugger","declare","default","delete","do","else","enum","export","extends","false","finally","for","from","function","if","implements","import","in","instanceof","interface","is","keyof","let","namespace","new","null","of","override","package","private","protected","public","readonly","return","satisfies","static","super","switch","this","throw","true","try","type","typeof","undefined","var","void","while","with","yield"]);function h4(e){const n=[];let r=0;for(;r<e.length;){if(e.startsWith("/*",r)){const a=e.indexOf("*/",r+2),o=a===-1?e.slice(r):e.slice(r,a+2);n.push({kind:"com",value:o}),r+=o.length;continue}if(e.startsWith("//",r)){const a=e.indexOf(`
90
+ `,r),o=a===-1?e.slice(r):e.slice(r,a);n.push({kind:"com",value:o}),r+=o.length;continue}if(e[r]==="`"){const{slice:a,length:o}=Cs(e,r,"`","`");n.push({kind:"str",value:a}),r+=o;continue}if(e[r]==='"'||e[r]==="'"){const{slice:a,length:o}=Cs(e,r,e[r],e[r]);n.push({kind:"str",value:a}),r+=o;continue}if(/[0-9]/.test(e[r])||e[r]==="."&&/[0-9]/.test(e[r+1]??"")){const a=e.slice(r).match(/^(0x[\da-fA-F]+|0o[0-7]+|0b[01]+|[\d]*\.?[\d]+(?:[eE][+-]?\d+)?[nN]?)/);if(a){n.push({kind:"num",value:a[0]}),r+=a[0].length;continue}}if(/[a-zA-Z_$]/.test(e[r])){const a=e.slice(r).match(/^[a-zA-Z_$][\w$]*/);if(a){const o=a[0],g=e.slice(r+o.length).match(/^\s*\(/);u4.has(o)?n.push({kind:"key",value:o}):g?n.push({kind:"fn",value:o}):n.push({kind:"text",value:o}),r+=o.length;continue}}if(/[{}()[\];,.<>!?:|&^~%*+\-=/\\@#]/.test(e[r])){n.push({kind:"punct",value:e[r]}),r++;continue}n.push({kind:"text",value:e[r]}),r++}return n}function d4(e){const n=[];let r=0;for(;r<e.length;){if(e[r]==='"'){const{slice:a,length:o}=Cs(e,r,'"','"'),_=e.slice(r+o).trimStart().startsWith(":");n.push({kind:_?"attr":"str",value:a}),r+=o;continue}if(/[0-9\-]/.test(e[r])){const a=e.slice(r).match(/^-?[\d]*\.?[\d]+(?:[eE][+-]?\d+)?/);if(a){n.push({kind:"num",value:a[0]}),r+=a[0].length;continue}}if(e.startsWith("true",r)||e.startsWith("false",r)||e.startsWith("null",r)){const a=e.slice(r).match(/^(true|false|null)/);if(a){n.push({kind:"key",value:a[0]}),r+=a[0].length;continue}}if(/[{}[\]:,]/.test(e[r])){n.push({kind:"punct",value:e[r]}),r++;continue}n.push({kind:"text",value:e[r]}),r++}return n}const f4=new Set(["False","None","True","and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"]);function p4(e){const n=[];let r=0;for(;r<e.length;){if(e[r]==="#"){const a=e.indexOf(`
91
+ `,r),o=a===-1?e.slice(r):e.slice(r,a);n.push({kind:"com",value:o}),r+=o.length;continue}if(e.startsWith('"""',r)||e.startsWith("'''",r)){const a=e.slice(r,r+3),o=e.indexOf(a,r+3),g=o===-1?e.slice(r):e.slice(r,o+3);n.push({kind:"str",value:g}),r+=g.length;continue}if(e[r]==='"'||e[r]==="'"){const{slice:a,length:o}=Cs(e,r,e[r],e[r]);n.push({kind:"str",value:a}),r+=o;continue}if(/[0-9]/.test(e[r])){const a=e.slice(r).match(/^(0x[\da-fA-F]+|0o[0-7]+|0b[01]+|[\d]*\.?[\d]+(?:[eE][+-]?\d+)?)/);if(a){n.push({kind:"num",value:a[0]}),r+=a[0].length;continue}}if(/[a-zA-Z_]/.test(e[r])){const a=e.slice(r).match(/^[a-zA-Z_]\w*/);if(a){const o=a[0],g=e.slice(r+o.length).match(/^\s*\(/);f4.has(o)?n.push({kind:"key",value:o}):g?n.push({kind:"fn",value:o}):n.push({kind:"text",value:o}),r+=o.length;continue}}n.push({kind:"text",value:e[r]}),r++}return n}function g4(e){const n=[];let r=0;for(;r<e.length;){if(e.startsWith("/*",r)){const a=e.indexOf("*/",r+2),o=a===-1?e.slice(r):e.slice(r,a+2);n.push({kind:"com",value:o}),r+=o.length;continue}if(e.startsWith("//",r)){const a=e.indexOf(`
92
+ `,r),o=a===-1?e.slice(r):e.slice(r,a);n.push({kind:"com",value:o}),r+=o.length;continue}if(e[r]==='"'||e[r]==="'"){const{slice:a,length:o}=Cs(e,r,e[r],e[r]);n.push({kind:"str",value:a}),r+=o;continue}if(e[r]==="."||e[r]==="#"||e[r]===":"){const a=e.slice(r).match(/^[.#:][:a-zA-Z_-][\w-]*/);if(a){n.push({kind:"tag",value:a[0]}),r+=a[0].length;continue}}if(/[a-zA-Z-]/.test(e[r])){const a=e.slice(r).match(/^[a-zA-Z-][\w-]*/);if(a){const o=a[0];e.slice(r+o.length).trimStart().startsWith(":")?n.push({kind:"attr",value:o}):n.push({kind:"text",value:o}),r+=o.length;continue}}if(/[0-9]/.test(e[r])){const a=e.slice(r).match(/^[\d]*\.?[\d]+(?:[a-zA-Z%]*)/);if(a){n.push({kind:"num",value:a[0]}),r+=a[0].length;continue}}n.push({kind:"text",value:e[r]}),r++}return n}function m4(e){const n=[];let r=0;for(;r<e.length;){if(e.startsWith("<!--",r)){const a=e.indexOf("-->",r+4),o=a===-1?e.slice(r):e.slice(r,a+3);n.push({kind:"com",value:o}),r+=o.length;continue}if(e[r]==="<"){n.push({kind:"punct",value:"<"}),r++,e[r]==="/"&&(n.push({kind:"punct",value:"/"}),r++);const a=e.slice(r).match(/^[a-zA-Z][\w:-]*/);a&&(n.push({kind:"tag",value:a[0]}),r+=a[0].length);continue}if(e[r]==='"'||e[r]==="'"){const{slice:a,length:o}=Cs(e,r,e[r],e[r]);n.push({kind:"str",value:a}),r+=o;continue}if(/[a-zA-Z]/.test(e[r])){const a=e.slice(r).match(/^[a-zA-Z][\w:-]*/);if(a){const o=e.slice(r+a[0].length).trimStart();n.push({kind:o.startsWith("=")?"attr":"text",value:a[0]}),r+=a[0].length;continue}}n.push({kind:"text",value:e[r]}),r++}return n}function _4(e){const n=[];let r=0;const a=new Set(["if","then","else","elif","fi","for","in","do","done","while","until","case","esac","function","return","local","export","readonly","declare","unset","echo","exit","shift","source","."]);for(;r<e.length;){if(e[r]==="#"){const o=e.indexOf(`
93
+ `,r),g=o===-1?e.slice(r):e.slice(r,o);n.push({kind:"com",value:g}),r+=g.length;continue}if(e[r]==='"'||e[r]==="'"){const{slice:o,length:g}=Cs(e,r,e[r],e[r]);n.push({kind:"str",value:o}),r+=g;continue}if(/[a-zA-Z_]/.test(e[r])){const o=e.slice(r).match(/^[a-zA-Z_][\w]*/);if(o){n.push({kind:a.has(o[0])?"key":"text",value:o[0]}),r+=o[0].length;continue}}n.push({kind:"text",value:e[r]}),r++}return n}function v4(e){const n=[];let r=0;for(;r<e.length;){if(e[r]==="#"){const a=e.indexOf(`
94
+ `,r),o=a===-1?e.slice(r):e.slice(r,a);n.push({kind:"com",value:o}),r+=o.length;continue}if(e[r]==='"'||e[r]==="'"){const{slice:a,length:o}=Cs(e,r,e[r],e[r]);n.push({kind:"str",value:a}),r+=o;continue}if(/[a-zA-Z_]/.test(e[r])){const a=e.slice(r).match(/^[a-zA-Z_][\w-]*/);if(a){e.slice(r+a[0].length).trimStart().startsWith(":")?n.push({kind:"attr",value:a[0]}):["true","false","null","yes","no","on","off"].includes(a[0])?n.push({kind:"key",value:a[0]}):n.push({kind:"text",value:a[0]}),r+=a[0].length;continue}}if(/[0-9\-]/.test(e[r])){const a=e.slice(r).match(/^-?[\d]*\.?[\d]+/);if(a){n.push({kind:"num",value:a[0]}),r+=a[0].length;continue}}n.push({kind:"text",value:e[r]}),r++}return n}function Cs(e,n,r,a){let o=n+r.length;for(;o<e.length;){if(e[o]==="\\"){o+=2;continue}if(e.startsWith(a,o)){o+=a.length;break}if(a!=="`"&&e[o]===`
95
+ `)break;o++}return{slice:e.slice(n,o),length:o-n}}function b4({content:e,lang:n,truncated:r}){const a=j.useMemo(()=>y4(e,n),[e,n]);return h.jsxs("div",{className:"fexp-code-wrap",children:[r&&h.jsx("div",{className:"fexp-truncated-badge",children:"File is too large — showing a partial preview"}),h.jsx("div",{className:"fexp-code-scroll",children:h.jsx("table",{className:"fexp-code-table","aria-label":"File contents",children:h.jsx("tbody",{children:a.map((o,g)=>h.jsxs("tr",{className:"fexp-code-row",children:[h.jsx("td",{className:"fexp-line-num","aria-hidden":"true",children:g+1}),h.jsx("td",{className:"fexp-line-code",dangerouslySetInnerHTML:{__html:o}})]},g))})})})]})}function y4(e,n){return e.split(`
96
+ `).map(a=>S4(a,n))}function S4(e,n){return n==="plaintext"||n==="markdown"?$b(e)||" ":c4(e,n).map(a=>{const o=$b(a.value);return a.kind==="text"?o:`<span class="syn-${a.kind}">${o}</span>`}).join("")||" "}function $b(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function w4({src:e,name:n}){return h.jsxs("div",{className:"fexp-img-wrap",children:[h.jsx("div",{className:"fexp-img-stage",children:h.jsx("img",{src:e,alt:n,className:"fexp-img",draggable:!1})}),h.jsx("figcaption",{className:"fexp-img-caption",children:n})]})}function hm(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ia=hm();function Cx(e){ia=e}var Dl={exec:()=>null};function mt(e,n=""){let r=typeof e=="string"?e:e.source,a={replace:(o,g)=>{let _=typeof g=="string"?g:g.source;return _=_.replace(Kn.caret,"$1"),r=r.replace(o,_),a},getRegex:()=>new RegExp(r,n)};return a}var x4=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Kn={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")},C4=/^(?:[ \t]*(?:\n|$))+/,E4=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,k4=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Xl=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,A4=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,dm=/(?:[*+-]|\d{1,9}[.)])/,Ex=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,kx=mt(Ex).replace(/bull/g,dm).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(),T4=mt(Ex).replace(/bull/g,dm).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(),fm=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,R4=/^[^\n]+/,pm=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,L4=mt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",pm).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),M4=mt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,dm).getRegex(),_h="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",gm=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,N4=mt("^ {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",gm).replace("tag",_h).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ax=mt(fm).replace("hr",Xl).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",_h).getRegex(),O4=mt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ax).getRegex(),mm={blockquote:O4,code:E4,def:L4,fences:k4,heading:A4,hr:Xl,html:N4,lheading:kx,list:M4,newline:C4,paragraph:Ax,table:Dl,text:R4},Ub=mt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Xl).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",_h).getRegex(),D4={...mm,lheading:T4,table:Ub,paragraph:mt(fm).replace("hr",Xl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ub).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",_h).getRegex()},B4={...mm,html:mt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",gm).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:Dl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:mt(fm).replace("hr",Xl).replace("heading",` *#{1,6} *[^
97
+ ]`).replace("lheading",kx).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},j4=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,I4=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Tx=/^( {2,}|\\)\n(?!\s*$)/,P4=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,vh=/[\p{P}\p{S}]/u,_m=/[\s\p{P}\p{S}]/u,Rx=/[^\s\p{P}\p{S}]/u,z4=mt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,_m).getRegex(),Lx=/(?!~)[\p{P}\p{S}]/u,H4=/(?!~)[\s\p{P}\p{S}]/u,$4=/(?:[^\s\p{P}\p{S}]|~)/u,U4=mt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",x4?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Mx=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,F4=mt(Mx,"u").replace(/punct/g,vh).getRegex(),W4=mt(Mx,"u").replace(/punct/g,Lx).getRegex(),Nx="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",G4=mt(Nx,"gu").replace(/notPunctSpace/g,Rx).replace(/punctSpace/g,_m).replace(/punct/g,vh).getRegex(),q4=mt(Nx,"gu").replace(/notPunctSpace/g,$4).replace(/punctSpace/g,H4).replace(/punct/g,Lx).getRegex(),K4=mt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Rx).replace(/punctSpace/g,_m).replace(/punct/g,vh).getRegex(),V4=mt(/\\(punct)/,"gu").replace(/punct/g,vh).getRegex(),Y4=mt(/^<(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(),X4=mt(gm).replace("(?:-->|$)","-->").getRegex(),Z4=mt("^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",X4).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Zu=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,J4=mt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Zu).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ox=mt(/^!?\[(label)\]\[(ref)\]/).replace("label",Zu).replace("ref",pm).getRegex(),Dx=mt(/^!?\[(ref)\](?:\[\])?/).replace("ref",pm).getRegex(),Q4=mt("reflink|nolink(?!\\()","g").replace("reflink",Ox).replace("nolink",Dx).getRegex(),Fb=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,vm={_backpedal:Dl,anyPunctuation:V4,autolink:Y4,blockSkip:U4,br:Tx,code:I4,del:Dl,emStrongLDelim:F4,emStrongRDelimAst:G4,emStrongRDelimUnd:K4,escape:j4,link:J4,nolink:Dx,punctuation:z4,reflink:Ox,reflinkSearch:Q4,tag:Z4,text:P4,url:Dl},eN={...vm,link:mt(/^!?\[(label)\]\((.*?)\)/).replace("label",Zu).getRegex(),reflink:mt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Zu).getRegex()},og={...vm,emStrongRDelimAst:q4,emStrongLDelim:W4,url:mt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Fb).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:mt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Fb).getRegex()},tN={...og,br:mt(Tx).replace("{2,}","*").getRegex(),text:mt(og.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},yu={normal:mm,gfm:D4,pedantic:B4},gl={normal:vm,gfm:og,breaks:tN,pedantic:eN},nN={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Wb=e=>nN[e];function sr(e,n){if(n){if(Kn.escapeTest.test(e))return e.replace(Kn.escapeReplace,Wb)}else if(Kn.escapeTestNoEncode.test(e))return e.replace(Kn.escapeReplaceNoEncode,Wb);return e}function Gb(e){try{e=encodeURI(e).replace(Kn.percentDecode,"%")}catch{return null}return e}function qb(e,n){let r=e.replace(Kn.findPipe,(g,_,c)=>{let u=!1,d=_;for(;--d>=0&&c[d]==="\\";)u=!u;return u?"|":" |"}),a=r.split(Kn.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(Kn.slashPipe,"|");return a}function ml(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 iN(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 Kb(e,n,r,a,o){let g=n.href,_=n.title||null,c=e[1].replace(o.other.outputLinkReplace,"$1");a.state.inLink=!0;let u={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:g,title:_,text:c,tokens:a.inlineTokens(c)};return a.state.inLink=!1,u}function rN(e,n,r){let a=e.match(r.other.indentCodeCompensation);if(a===null)return n;let o=a[1];return n.split(`
98
+ `).map(g=>{let _=g.match(r.other.beginningSpace);if(_===null)return g;let[c]=_;return c.length>=o.length?g.slice(o.length):g}).join(`
99
+ `)}var Ju=class{options;rules;lexer;constructor(e){this.options=e||ia}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:ml(r,`
100
+ `)}}}fences(e){let n=this.rules.block.fences.exec(e);if(n){let r=n[0],a=rN(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=ml(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:ml(n[0],`
101
+ `)}}blockquote(e){let n=this.rules.block.blockquote.exec(e);if(n){let r=ml(n[0],`
102
+ `).split(`
103
+ `),a="",o="",g=[];for(;r.length>0;){let _=!1,c=[],u;for(u=0;u<r.length;u++)if(this.rules.other.blockquoteStart.test(r[u]))c.push(r[u]),_=!0;else if(!_)c.push(r[u]);else break;r=r.slice(u);let d=c.join(`
104
+ `),b=d.replace(this.rules.other.blockquoteSetextReplace,`
105
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");a=a?`${a}
106
+ ${d}`:d,o=o?`${o}
107
+ ${b}`:b;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(b,g,!0),this.lexer.state.top=p,r.length===0)break;let w=g.at(-1);if(w?.type==="code")break;if(w?.type==="blockquote"){let C=w,A=C.raw+`
108
+ `+r.join(`
109
+ `),E=this.blockquote(A);g[g.length-1]=E,a=a.substring(0,a.length-C.raw.length)+E.raw,o=o.substring(0,o.length-C.text.length)+E.text;break}else if(w?.type==="list"){let C=w,A=C.raw+`
110
+ `+r.join(`
111
+ `),E=this.list(A);g[g.length-1]=E,a=a.substring(0,a.length-w.raw.length)+E.raw,o=o.substring(0,o.length-C.raw.length)+E.raw,r=A.substring(g.at(-1).raw.length).split(`
112
+ `);continue}}return{type:"blockquote",raw:a,tokens:g,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 g=this.rules.other.listItemRegex(r),_=!1;for(;e;){let u=!1,d="",b="";if(!(n=g.exec(e))||this.rules.block.hr.test(e))break;d=n[0],e=e.substring(d.length);let p=n[2].split(`
113
+ `,1)[0].replace(this.rules.other.listReplaceTabs,y=>" ".repeat(3*y.length)),w=e.split(`
114
+ `,1)[0],C=!p.trim(),A=0;if(this.options.pedantic?(A=2,b=p.trimStart()):C?A=n[1].length+1:(A=n[2].search(this.rules.other.nonSpaceChar),A=A>4?1:A,b=p.slice(A),A+=n[1].length),C&&this.rules.other.blankLine.test(w)&&(d+=w+`
115
+ `,e=e.substring(w.length+1),u=!0),!u){let y=this.rules.other.nextBulletRegex(A),m=this.rules.other.hrRegex(A),S=this.rules.other.fencesBeginRegex(A),k=this.rules.other.headingBeginRegex(A),L=this.rules.other.htmlBeginRegex(A);for(;e;){let R=e.split(`
116
+ `,1)[0],M;if(w=R,this.options.pedantic?(w=w.replace(this.rules.other.listReplaceNesting," "),M=w):M=w.replace(this.rules.other.tabCharGlobal," "),S.test(w)||k.test(w)||L.test(w)||y.test(w)||m.test(w))break;if(M.search(this.rules.other.nonSpaceChar)>=A||!w.trim())b+=`
117
+ `+M.slice(A);else{if(C||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(p)||k.test(p)||m.test(p))break;b+=`
118
+ `+w}!C&&!w.trim()&&(C=!0),d+=R+`
119
+ `,e=e.substring(R.length+1),p=M.slice(A)}}o.loose||(_?o.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(_=!0));let E=null,f;this.options.gfm&&(E=this.rules.other.listIsTask.exec(b),E&&(f=E[0]!=="[ ] ",b=b.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:d,task:!!E,checked:f,loose:!1,text:b,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"),b=d.length>0&&d.some(p=>this.rules.other.anyLine.test(p.raw));o.loose=b}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=qb(n[1]),a=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=n[3]?.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(`
120
+ `):[],g={type:"table",raw:n[0],header:[],align:[],rows:[]};if(r.length===a.length){for(let _ of a)this.rules.other.tableAlignRight.test(_)?g.align.push("right"):this.rules.other.tableAlignCenter.test(_)?g.align.push("center"):this.rules.other.tableAlignLeft.test(_)?g.align.push("left"):g.align.push(null);for(let _=0;_<r.length;_++)g.header.push({text:r[_],tokens:this.lexer.inline(r[_]),header:!0,align:g.align[_]});for(let _ of o)g.rows.push(qb(_,g.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:g.align[u]})));return g}}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)===`
121
+ `?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 g=ml(r.slice(0,-1),"\\");if((r.length-g.length)%2===0)return}else{let g=iN(n[2],"()");if(g===-2)return;if(g>-1){let _=(n[0].indexOf("!")===0?5:4)+n[1].length+g;n[2]=n[2].substring(0,g),n[0]=n[0].substring(0,_).trim(),n[3]=""}}let a=n[2],o="";if(this.options.pedantic){let g=this.rules.other.pedanticHrefTitle.exec(a);g&&(a=g[1],o=g[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)),Kb(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 g=r[0].charAt(0);return{type:"text",raw:g,text:g}}return Kb(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,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(g=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!g)continue;if(_=[...g].length,a[3]||a[4]){c+=_;continue}else if((a[5]||a[6])&&o%3&&!((o+_)%3)){u+=_;continue}if(c-=_,c>0)continue;_=Math.min(_,_+c+u);let b=[...a[0]][0].length,p=e.slice(0,o+a.index+b+_);if(Math.min(o,_)%2){let C=p.slice(1,-1);return{type:"em",raw:p,text:C,tokens:this.lexer.inlineTokens(C)}}let w=p.slice(2,-2);return{type:"strong",raw:p,text:w,tokens:this.lexer.inlineTokens(w)}}}}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}}}},qi=class lg{tokens;options;state;tokenizer;inlineQueue;constructor(n){this.tokens=[],this.tokens.links=Object.create(null),this.options=n||ia,this.options.tokenizer=this.options.tokenizer||new Ju,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:Kn,block:yu.normal,inline:gl.normal};this.options.pedantic?(r.block=yu.pedantic,r.inline=gl.pedantic):this.options.gfm&&(r.block=yu.gfm,this.options.breaks?r.inline=gl.breaks:r.inline=gl.gfm),this.tokenizer.rules=r}static get rules(){return{block:yu,inline:gl}}static lex(n,r){return new lg(r).lex(n)}static lexInline(n,r){return new lg(r).inlineTokens(n)}lex(n){n=n.replace(Kn.carriageReturn,`
122
+ `),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(Kn.tabCharGlobal," ").replace(Kn.spaceLine,""));n;){let o;if(this.options.extensions?.block?.some(_=>(o=_.call({lexer:this},n,r))?(n=n.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(n)){n=n.substring(o.raw.length);let _=r.at(-1);o.raw.length===1&&_!==void 0?_.raw+=`
123
+ `:r.push(o);continue}if(o=this.tokenizer.code(n)){n=n.substring(o.raw.length);let _=r.at(-1);_?.type==="paragraph"||_?.type==="text"?(_.raw+=(_.raw.endsWith(`
124
+ `)?"":`
125
+ `)+o.raw,_.text+=`
126
+ `+o.text,this.inlineQueue.at(-1).src=_.text):r.push(o);continue}if(o=this.tokenizer.fences(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.heading(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.hr(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.blockquote(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.list(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.html(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.def(n)){n=n.substring(o.raw.length);let _=r.at(-1);_?.type==="paragraph"||_?.type==="text"?(_.raw+=(_.raw.endsWith(`
127
+ `)?"":`
128
+ `)+o.raw,_.text+=`
129
+ `+o.raw,this.inlineQueue.at(-1).src=_.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},r.push(o));continue}if(o=this.tokenizer.table(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.lheading(n)){n=n.substring(o.raw.length),r.push(o);continue}let g=n;if(this.options.extensions?.startBlock){let _=1/0,c=n.slice(1),u;this.options.extensions.startBlock.forEach(d=>{u=d.call({lexer:this},c),typeof u=="number"&&u>=0&&(_=Math.min(_,u))}),_<1/0&&_>=0&&(g=n.substring(0,_+1))}if(this.state.top&&(o=this.tokenizer.paragraph(g))){let _=r.at(-1);a&&_?.type==="paragraph"?(_.raw+=(_.raw.endsWith(`
130
+ `)?"":`
131
+ `)+o.raw,_.text+=`
132
+ `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=_.text):r.push(o),a=g.length!==n.length,n=n.substring(o.raw.length);continue}if(o=this.tokenizer.text(n)){n=n.substring(o.raw.length);let _=r.at(-1);_?.type==="text"?(_.raw+=(_.raw.endsWith(`
133
+ `)?"":`
134
+ `)+o.raw,_.text+=`
135
+ `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=_.text):r.push(o);continue}if(n){let _="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(_);break}else throw new Error(_)}}return this.state.top=!0,r}inline(n,r=[]){return this.inlineQueue.push({src:n,tokens:r}),r}inlineTokens(n,r=[]){let a=n,o=null;if(this.tokens.links){let u=Object.keys(this.tokens.links);if(u.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)u.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,o.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let g;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)g=o[2]?o[2].length:0,a=a.slice(0,o.index+g)+"["+"a".repeat(o[0].length-g-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);a=this.options.hooks?.emStrongMask?.call({lexer:this},a)??a;let _=!1,c="";for(;n;){_||(c=""),_=!1;let u;if(this.options.extensions?.inline?.some(b=>(u=b.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 b=r.at(-1);u.type==="text"&&b?.type==="text"?(b.raw+=u.raw,b.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 b=1/0,p=n.slice(1),w;this.options.extensions.startInline.forEach(C=>{w=C.call({lexer:this},p),typeof w=="number"&&w>=0&&(b=Math.min(b,w))}),b<1/0&&b>=0&&(d=n.substring(0,b+1))}if(u=this.tokenizer.inlineText(d)){n=n.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(c=u.raw.slice(-1)),_=!0;let b=r.at(-1);b?.type==="text"?(b.raw+=u.raw,b.text+=u.text):r.push(u);continue}if(n){let b="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(b);break}else throw new Error(b)}}return r}},Qu=class{options;parser;constructor(e){this.options=e||ia}space(e){return""}code({text:e,lang:n,escaped:r}){let a=(n||"").match(Kn.notSpaceStart)?.[0],o=e.replace(Kn.endingNewline,"")+`
136
+ `;return a?'<pre><code class="language-'+sr(a)+'">'+(r?o:sr(o,!0))+`</code></pre>
137
+ `:"<pre><code>"+(r?o:sr(o,!0))+`</code></pre>
138
+ `}blockquote({tokens:e}){return`<blockquote>
139
+ ${this.parser.parse(e)}</blockquote>
140
+ `}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:n}){return`<h${n}>${this.parser.parseInline(e)}</h${n}>
141
+ `}hr(e){return`<hr>
142
+ `}list(e){let n=e.ordered,r=e.start,a="";for(let _=0;_<e.items.length;_++){let c=e.items[_];a+=this.listitem(c)}let o=n?"ol":"ul",g=n&&r!==1?' start="'+r+'"':"";return"<"+o+g+`>
143
+ `+a+"</"+o+`>
144
+ `}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+" "+sr(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>
145
+ `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
146
+ `}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 g=e.rows[o];r="";for(let _=0;_<g.length;_++)r+=this.tablecell(g[_]);a+=this.tablerow({text:r})}return a&&(a=`<tbody>${a}</tbody>`),`<table>
147
+ <thead>
148
+ `+n+`</thead>
149
+ `+a+`</table>
150
+ `}tablerow({text:e}){return`<tr>
151
+ ${e}</tr>
152
+ `}tablecell(e){let n=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+n+`</${r}>
153
+ `}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>${sr(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=Gb(e);if(o===null)return a;e=o;let g='<a href="'+e+'"';return n&&(g+=' title="'+sr(n)+'"'),g+=">"+a+"</a>",g}image({href:e,title:n,text:r,tokens:a}){a&&(r=this.parser.parseInline(a,this.parser.textRenderer));let o=Gb(e);if(o===null)return sr(r);e=o;let g=`<img src="${e}" alt="${r}"`;return n&&(g+=` title="${sr(n)}"`),g+=">",g}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:sr(e.text)}},bm=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""}},Ki=class cg{options;renderer;textRenderer;constructor(n){this.options=n||ia,this.options.renderer=this.options.renderer||new Qu,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new bm}static parse(n,r){return new cg(r).parse(n)}static parseInline(n,r){return new cg(r).parseInline(n)}parse(n,r=!0){let a="";for(let o=0;o<n.length;o++){let g=n[o];if(this.options.extensions?.renderers?.[g.type]){let c=g,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;switch(_.type){case"space":{a+=this.renderer.space(_);continue}case"hr":{a+=this.renderer.hr(_);continue}case"heading":{a+=this.renderer.heading(_);continue}case"code":{a+=this.renderer.code(_);continue}case"table":{a+=this.renderer.table(_);continue}case"blockquote":{a+=this.renderer.blockquote(_);continue}case"list":{a+=this.renderer.list(_);continue}case"html":{a+=this.renderer.html(_);continue}case"def":{a+=this.renderer.def(_);continue}case"paragraph":{a+=this.renderer.paragraph(_);continue}case"text":{let c=_,u=this.renderer.text(c);for(;o+1<n.length&&n[o+1].type==="text";)c=n[++o],u+=`
154
+ `+this.renderer.text(c);r?a+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):a+=u;continue}default:{let c='Token with "'+_.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return a}parseInline(n,r=this.renderer){let a="";for(let o=0;o<n.length;o++){let g=n[o];if(this.options.extensions?.renderers?.[g.type]){let c=this.options.extensions.renderers[g.type].call({parser:this},g);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(g.type)){a+=c||"";continue}}let _=g;switch(_.type){case"escape":{a+=r.text(_);break}case"html":{a+=r.html(_);break}case"link":{a+=r.link(_);break}case"image":{a+=r.image(_);break}case"strong":{a+=r.strong(_);break}case"em":{a+=r.em(_);break}case"codespan":{a+=r.codespan(_);break}case"br":{a+=r.br(_);break}case"del":{a+=r.del(_);break}case"text":{a+=r.text(_);break}default:{let c='Token with "'+_.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return a}},Tl=class{options;block;constructor(e){this.options=e||ia}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?qi.lex:qi.lexInline}provideParser(){return this.block?Ki.parse:Ki.parseInline}},Bx=class{defaults=hm();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Ki;Renderer=Qu;TextRenderer=bm;Lexer=qi;Tokenizer=Ju;Hooks=Tl;constructor(...e){this.use(...e)}walkTokens(e,n){let r=[];for(let a of e)switch(r=r.concat(n.call(this,a)),a.type){case"table":{let o=a;for(let g of o.header)r=r.concat(this.walkTokens(g.tokens,n));for(let g of o.rows)for(let _ of g)r=r.concat(this.walkTokens(_.tokens,n));break}case"list":{let o=a;r=r.concat(this.walkTokens(o.items,n));break}default:{let o=a;this.defaults.extensions?.childTokens?.[o.type]?this.defaults.extensions.childTokens[o.type].forEach(g=>{let _=o[g].flat(1/0);r=r.concat(this.walkTokens(_,n))}):o.tokens&&(r=r.concat(this.walkTokens(o.tokens,n)))}}return r}use(...e){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{let a={...r};if(a.async=this.defaults.async||a.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let g=n.renderers[o.name];g?n.renderers[o.name]=function(..._){let c=o.renderer.apply(this,_);return c===!1&&(c=g.apply(this,_)),c}:n.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let g=n[o.level];g?g.unshift(o.tokenizer):n[o.level]=[o.tokenizer],o.start&&(o.level==="block"?n.startBlock?n.startBlock.push(o.start):n.startBlock=[o.start]:o.level==="inline"&&(n.startInline?n.startInline.push(o.start):n.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(n.childTokens[o.name]=o.childTokens)}),a.extensions=n),r.renderer){let o=this.defaults.renderer||new Qu(this.defaults);for(let g in r.renderer){if(!(g in o))throw new Error(`renderer '${g}' does not exist`);if(["options","parser"].includes(g))continue;let _=g,c=r.renderer[_],u=o[_];o[_]=(...d)=>{let b=c.apply(o,d);return b===!1&&(b=u.apply(o,d)),b||""}}a.renderer=o}if(r.tokenizer){let o=this.defaults.tokenizer||new Ju(this.defaults);for(let g in r.tokenizer){if(!(g in o))throw new Error(`tokenizer '${g}' does not exist`);if(["options","rules","lexer"].includes(g))continue;let _=g,c=r.tokenizer[_],u=o[_];o[_]=(...d)=>{let b=c.apply(o,d);return b===!1&&(b=u.apply(o,d)),b}}a.tokenizer=o}if(r.hooks){let o=this.defaults.hooks||new Tl;for(let g in r.hooks){if(!(g in o))throw new Error(`hook '${g}' does not exist`);if(["options","block"].includes(g))continue;let _=g,c=r.hooks[_],u=o[_];Tl.passThroughHooks.has(g)?o[_]=d=>{if(this.defaults.async&&Tl.passThroughHooksRespectAsync.has(g))return(async()=>{let p=await c.call(o,d);return u.call(o,p)})();let b=c.call(o,d);return u.call(o,b)}:o[_]=(...d)=>{if(this.defaults.async)return(async()=>{let p=await c.apply(o,d);return p===!1&&(p=await u.apply(o,d)),p})();let b=c.apply(o,d);return b===!1&&(b=u.apply(o,d)),b}}a.hooks=o}if(r.walkTokens){let o=this.defaults.walkTokens,g=r.walkTokens;a.walkTokens=function(_){let c=[];return c.push(g.call(this,_)),o&&(c=c.concat(o.call(this,_))),c}}this.defaults={...this.defaults,...a}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,n){return qi.lex(e,n??this.defaults)}parser(e,n){return Ki.parse(e,n??this.defaults)}parseMarkdown(e){return(n,r)=>{let a={...r},o={...this.defaults,...a},g=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&a.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 n>"u"||n===null)return g(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return g(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=e),o.async)return(async()=>{let _=o.hooks?await o.hooks.preprocess(n):n,c=await(o.hooks?await o.hooks.provideLexer():e?qi.lex:qi.lexInline)(_,o),u=o.hooks?await o.hooks.processAllTokens(c):c;o.walkTokens&&await Promise.all(this.walkTokens(u,o.walkTokens));let d=await(o.hooks?await o.hooks.provideParser():e?Ki.parse:Ki.parseInline)(u,o);return o.hooks?await o.hooks.postprocess(d):d})().catch(g);try{o.hooks&&(n=o.hooks.preprocess(n));let _=(o.hooks?o.hooks.provideLexer():e?qi.lex:qi.lexInline)(n,o);o.hooks&&(_=o.hooks.processAllTokens(_)),o.walkTokens&&this.walkTokens(_,o.walkTokens);let c=(o.hooks?o.hooks.provideParser():e?Ki.parse:Ki.parseInline)(_,o);return o.hooks&&(c=o.hooks.postprocess(c)),c}catch(_){return g(_)}}}onError(e,n){return r=>{if(r.message+=`
155
+ Please report this to https://github.com/markedjs/marked.`,e){let a="<p>An error occurred:</p><pre>"+sr(r.message+"",!0)+"</pre>";return n?Promise.resolve(a):a}if(n)return Promise.reject(r);throw r}}},na=new Bx;function At(e,n){return na.parse(e,n)}At.options=At.setOptions=function(e){return na.setOptions(e),At.defaults=na.defaults,Cx(At.defaults),At};At.getDefaults=hm;At.defaults=ia;At.use=function(...e){return na.use(...e),At.defaults=na.defaults,Cx(At.defaults),At};At.walkTokens=function(e,n){return na.walkTokens(e,n)};At.parseInline=na.parseInline;At.Parser=Ki;At.parser=Ki.parse;At.Renderer=Qu;At.TextRenderer=bm;At.Lexer=qi;At.lexer=qi.lex;At.Tokenizer=Ju;At.Hooks=Tl;At.parse=At;At.options;At.setOptions;At.use;At.walkTokens;At.parseInline;Ki.parse;qi.lex;const{entries:jx,setPrototypeOf:Vb,isFrozen:sN,getPrototypeOf:aN,getOwnPropertyDescriptor:oN}=Object;let{freeze:Yn,seal:Hi,create:Ga}=Object,{apply:ug,construct:hg}=typeof Reflect<"u"&&Reflect;Yn||(Yn=function(n){return n});Hi||(Hi=function(n){return n});ug||(ug=function(n,r){for(var a=arguments.length,o=new Array(a>2?a-2:0),g=2;g<a;g++)o[g-2]=arguments[g];return n.apply(r,o)});hg||(hg=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 _l=_n(Array.prototype.forEach),lN=_n(Array.prototype.lastIndexOf),Yb=_n(Array.prototype.pop),vl=_n(Array.prototype.push),cN=_n(Array.prototype.splice),Gn=Array.isArray,Rl=_n(String.prototype.toLowerCase),Zf=_n(String.prototype.toString),Xb=_n(String.prototype.match),Ua=_n(String.prototype.replace),Zb=_n(String.prototype.indexOf),uN=_n(String.prototype.trim),hN=_n(Number.prototype.toString),dN=_n(Boolean.prototype.toString),Jb=typeof BigInt>"u"?null:_n(BigInt.prototype.toString),Qb=typeof Symbol>"u"?null:_n(Symbol.prototype.toString),rn=_n(Object.prototype.hasOwnProperty),bl=_n(Object.prototype.toString),jn=_n(RegExp.prototype.test),Su=fN(TypeError);function _n(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 ug(e,n,a)}}function fN(e){return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return hg(e,r)}}function Xe(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Rl;if(Vb&&Vb(e,null),!Gn(n))return e;let a=n.length;for(;a--;){let o=n[a];if(typeof o=="string"){const g=r(o);g!==o&&(sN(n)||(n[a]=g),o=g)}e[o]=!0}return e}function pN(e){for(let n=0;n<e.length;n++)rn(e,n)||(e[n]=null);return e}function oi(e){const n=Ga(null);for(const[r,a]of jx(e))rn(e,r)&&(Gn(a)?n[r]=pN(a):a&&typeof a=="object"&&a.constructor===Object?n[r]=oi(a):n[r]=a);return n}function gN(e){switch(typeof e){case"string":return e;case"number":return hN(e);case"boolean":return dN(e);case"bigint":return Jb?Jb(e):"0";case"symbol":return Qb?Qb(e):"Symbol()";case"undefined":return bl(e);case"function":case"object":{if(e===null)return bl(e);const n=e,r=qa(n,"toString");if(typeof r=="function"){const a=r(n);return typeof a=="string"?a:bl(a)}return bl(e)}default:return bl(e)}}function qa(e,n){for(;e!==null;){const a=oN(e,n);if(a){if(a.get)return _n(a.get);if(typeof a.value=="function")return _n(a.value)}e=aN(e)}function r(){return null}return r}function mN(e){try{return jn(e,""),!0}catch{return!1}}const ey=Yn(["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"]),Jf=Yn(["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"]),Qf=Yn(["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"]),_N=Yn(["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"]),ep=Yn(["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"]),vN=Yn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ty=Yn(["#text"]),ny=Yn(["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"]),tp=Yn(["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"]),iy=Yn(["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"]),wu=Yn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),bN=Hi(/\{\{[\w\W]*|[\w\W]*\}\}/gm),yN=Hi(/<%[\w\W]*|[\w\W]*%>/gm),SN=Hi(/\$\{[\w\W]*/gm),wN=Hi(/^data-[\-\w.\u00B7-\uFFFF]+$/),xN=Hi(/^aria-[\-\w]+$/),Ix=Hi(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),CN=Hi(/^(?:\w+script|data):/i),EN=Hi(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Px=Hi(/^html$/i),kN=Hi(/^[a-z][.\w]*(-[.\w]+)+$/i);var ry=Object.freeze({__proto__:null,ARIA_ATTR:xN,ATTR_WHITESPACE:EN,CUSTOM_ELEMENT:kN,DATA_ATTR:wN,DOCTYPE_NAME:Px,ERB_EXPR:yN,IS_ALLOWED_URI:Ix,IS_SCRIPT_OR_DATA:CN,MUSTACHE_EXPR:bN,TMPLIT_EXPR:SN});const yl={element:1,text:3,progressingInstruction:7,comment:8,document:9},AN=function(){return typeof window>"u"?null:window},TN=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 g="dompurify"+(a?"#"+a:"");try{return n.createPolicy(g,{createHTML(_){return _},createScriptURL(_){return _}})}catch{return console.warn("TrustedTypes policy "+g+" could not be created."),null}},sy=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function zx(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:AN();const n=Ne=>zx(Ne);if(n.version="3.4.2",n.removed=[],!e||!e.document||e.document.nodeType!==yl.document||!e.Element)return n.isSupported=!1,n;let{document:r}=e;const a=r,o=a.currentScript,{DocumentFragment:g,HTMLTemplateElement:_,Node:c,Element:u,NodeFilter:d,NamedNodeMap:b=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:p,DOMParser:w,trustedTypes:C}=e,A=u.prototype,E=qa(A,"cloneNode"),f=qa(A,"remove"),y=qa(A,"nextSibling"),m=qa(A,"childNodes"),S=qa(A,"parentNode");if(typeof _=="function"){const Ne=r.createElement("template");Ne.content&&Ne.content.ownerDocument&&(r=Ne.content.ownerDocument)}let k,L="";const{implementation:R,createNodeIterator:M,createDocumentFragment:T,getElementsByTagName:I}=r,{importNode:K}=a;let F=sy();n.isSupported=typeof jx=="function"&&typeof S=="function"&&R&&R.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:G,ERB_EXPR:B,TMPLIT_EXPR:Y,DATA_ATTR:X,ARIA_ATTR:H,IS_SCRIPT_OR_DATA:q,ATTR_WHITESPACE:V,CUSTOM_ELEMENT:D}=ry;let{IS_ALLOWED_URI:P}=ry,O=null;const z=Xe({},[...ey,...Jf,...Qf,...ep,...ty]);let W=null;const Z=Xe({},[...ny,...tp,...iy,...wu]);let ie=Object.seal(Ga(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}})),he=null,te=null;const $=Object.seal(Ga(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let le=!0,ge=!0,we=!1,Se=!0,je=!1,Ie=!0,Ge=!1,vt=!1,Le=!1,Tt=!1,Xt=!1,vn=!1,an=!0,kn=!1;const Zt="user-content-";let ut=!0,Rt=!1,xt={},Ut=null;const Kt=Xe({},["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 Xn=null;const bn=Xe({},["audio","video","img","source","image","track"]);let Pn=null;const dt=Xe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),An="http://www.w3.org/1998/Math/MathML",ve="http://www.w3.org/2000/svg",$e="http://www.w3.org/1999/xhtml";let Ze=$e,at=!1,Ve=null;const on=Xe({},[An,ve,$e],Zf);let Ot=Xe({},["mi","mo","mn","ms","mtext"]),Tn=Xe({},["annotation-xml"]);const Un=Xe({},["title","style","font","a","script"]);let Dt=null;const Q=["application/xhtml+xml","text/html"],fe="text/html";let ye=null,Oe=null;const bt=r.createElement("form"),ht=function(J){return J instanceof RegExp||J instanceof Function},ke=function(){let J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Oe&&Oe===J)return;(!J||typeof J!="object")&&(J={}),J=oi(J),Dt=Q.indexOf(J.PARSER_MEDIA_TYPE)===-1?fe:J.PARSER_MEDIA_TYPE,ye=Dt==="application/xhtml+xml"?Zf:Rl,O=rn(J,"ALLOWED_TAGS")&&Gn(J.ALLOWED_TAGS)?Xe({},J.ALLOWED_TAGS,ye):z,W=rn(J,"ALLOWED_ATTR")&&Gn(J.ALLOWED_ATTR)?Xe({},J.ALLOWED_ATTR,ye):Z,Ve=rn(J,"ALLOWED_NAMESPACES")&&Gn(J.ALLOWED_NAMESPACES)?Xe({},J.ALLOWED_NAMESPACES,Zf):on,Pn=rn(J,"ADD_URI_SAFE_ATTR")&&Gn(J.ADD_URI_SAFE_ATTR)?Xe(oi(dt),J.ADD_URI_SAFE_ATTR,ye):dt,Xn=rn(J,"ADD_DATA_URI_TAGS")&&Gn(J.ADD_DATA_URI_TAGS)?Xe(oi(bn),J.ADD_DATA_URI_TAGS,ye):bn,Ut=rn(J,"FORBID_CONTENTS")&&Gn(J.FORBID_CONTENTS)?Xe({},J.FORBID_CONTENTS,ye):Kt,he=rn(J,"FORBID_TAGS")&&Gn(J.FORBID_TAGS)?Xe({},J.FORBID_TAGS,ye):oi({}),te=rn(J,"FORBID_ATTR")&&Gn(J.FORBID_ATTR)?Xe({},J.FORBID_ATTR,ye):oi({}),xt=rn(J,"USE_PROFILES")?J.USE_PROFILES&&typeof J.USE_PROFILES=="object"?oi(J.USE_PROFILES):J.USE_PROFILES:!1,le=J.ALLOW_ARIA_ATTR!==!1,ge=J.ALLOW_DATA_ATTR!==!1,we=J.ALLOW_UNKNOWN_PROTOCOLS||!1,Se=J.ALLOW_SELF_CLOSE_IN_ATTR!==!1,je=J.SAFE_FOR_TEMPLATES||!1,Ie=J.SAFE_FOR_XML!==!1,Ge=J.WHOLE_DOCUMENT||!1,Tt=J.RETURN_DOM||!1,Xt=J.RETURN_DOM_FRAGMENT||!1,vn=J.RETURN_TRUSTED_TYPE||!1,Le=J.FORCE_BODY||!1,an=J.SANITIZE_DOM!==!1,kn=J.SANITIZE_NAMED_PROPS||!1,ut=J.KEEP_CONTENT!==!1,Rt=J.IN_PLACE||!1,P=mN(J.ALLOWED_URI_REGEXP)?J.ALLOWED_URI_REGEXP:Ix,Ze=typeof J.NAMESPACE=="string"?J.NAMESPACE:$e,Ot=rn(J,"MATHML_TEXT_INTEGRATION_POINTS")&&J.MATHML_TEXT_INTEGRATION_POINTS&&typeof J.MATHML_TEXT_INTEGRATION_POINTS=="object"?oi(J.MATHML_TEXT_INTEGRATION_POINTS):Xe({},["mi","mo","mn","ms","mtext"]),Tn=rn(J,"HTML_INTEGRATION_POINTS")&&J.HTML_INTEGRATION_POINTS&&typeof J.HTML_INTEGRATION_POINTS=="object"?oi(J.HTML_INTEGRATION_POINTS):Xe({},["annotation-xml"]);const _e=rn(J,"CUSTOM_ELEMENT_HANDLING")&&J.CUSTOM_ELEMENT_HANDLING&&typeof J.CUSTOM_ELEMENT_HANDLING=="object"?oi(J.CUSTOM_ELEMENT_HANDLING):Ga(null);if(ie=Ga(null),rn(_e,"tagNameCheck")&&ht(_e.tagNameCheck)&&(ie.tagNameCheck=_e.tagNameCheck),rn(_e,"attributeNameCheck")&&ht(_e.attributeNameCheck)&&(ie.attributeNameCheck=_e.attributeNameCheck),rn(_e,"allowCustomizedBuiltInElements")&&typeof _e.allowCustomizedBuiltInElements=="boolean"&&(ie.allowCustomizedBuiltInElements=_e.allowCustomizedBuiltInElements),je&&(ge=!1),Xt&&(Tt=!0),xt&&(O=Xe({},ty),W=Ga(null),xt.html===!0&&(Xe(O,ey),Xe(W,ny)),xt.svg===!0&&(Xe(O,Jf),Xe(W,tp),Xe(W,wu)),xt.svgFilters===!0&&(Xe(O,Qf),Xe(W,tp),Xe(W,wu)),xt.mathMl===!0&&(Xe(O,ep),Xe(W,iy),Xe(W,wu))),$.tagCheck=null,$.attributeCheck=null,rn(J,"ADD_TAGS")&&(typeof J.ADD_TAGS=="function"?$.tagCheck=J.ADD_TAGS:Gn(J.ADD_TAGS)&&(O===z&&(O=oi(O)),Xe(O,J.ADD_TAGS,ye))),rn(J,"ADD_ATTR")&&(typeof J.ADD_ATTR=="function"?$.attributeCheck=J.ADD_ATTR:Gn(J.ADD_ATTR)&&(W===Z&&(W=oi(W)),Xe(W,J.ADD_ATTR,ye))),rn(J,"ADD_URI_SAFE_ATTR")&&Gn(J.ADD_URI_SAFE_ATTR)&&Xe(Pn,J.ADD_URI_SAFE_ATTR,ye),rn(J,"FORBID_CONTENTS")&&Gn(J.FORBID_CONTENTS)&&(Ut===Kt&&(Ut=oi(Ut)),Xe(Ut,J.FORBID_CONTENTS,ye)),rn(J,"ADD_FORBID_CONTENTS")&&Gn(J.ADD_FORBID_CONTENTS)&&(Ut===Kt&&(Ut=oi(Ut)),Xe(Ut,J.ADD_FORBID_CONTENTS,ye)),ut&&(O["#text"]=!0),Ge&&Xe(O,["html","head","body"]),O.table&&(Xe(O,["tbody"]),delete he.tbody),J.TRUSTED_TYPES_POLICY){if(typeof J.TRUSTED_TYPES_POLICY.createHTML!="function")throw Su('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof J.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Su('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');k=J.TRUSTED_TYPES_POLICY,L=k.createHTML("")}else k===void 0&&(k=TN(C,o)),k!==null&&typeof L=="string"&&(L=k.createHTML(""));Yn&&Yn(J),Oe=J},Ce=Xe({},[...Jf,...Qf,..._N]),Pe=Xe({},[...ep,...vN]),Vt=function(J){let _e=S(J);(!_e||!_e.tagName)&&(_e={namespaceURI:Ze,tagName:"template"});const Ee=Rl(J.tagName),ot=Rl(_e.tagName);return Ve[J.namespaceURI]?J.namespaceURI===ve?_e.namespaceURI===$e?Ee==="svg":_e.namespaceURI===An?Ee==="svg"&&(ot==="annotation-xml"||Ot[ot]):!!Ce[Ee]:J.namespaceURI===An?_e.namespaceURI===$e?Ee==="math":_e.namespaceURI===ve?Ee==="math"&&Tn[ot]:!!Pe[Ee]:J.namespaceURI===$e?_e.namespaceURI===ve&&!Tn[ot]||_e.namespaceURI===An&&!Ot[ot]?!1:!Pe[Ee]&&(Un[Ee]||!Ce[Ee]):!!(Dt==="application/xhtml+xml"&&Ve[J.namespaceURI]):!1},nt=function(J){vl(n.removed,{element:J});try{S(J).removeChild(J)}catch{f(J)}},Rn=function(J,_e){try{vl(n.removed,{attribute:_e.getAttributeNode(J),from:_e})}catch{vl(n.removed,{attribute:null,from:_e})}if(_e.removeAttribute(J),J==="is")if(Tt||Xt)try{nt(_e)}catch{}else try{_e.setAttribute(J,"")}catch{}},hr=function(J){let _e=null,Ee=null;if(Le)J="<remove></remove>"+J;else{const jt=Xb(J,/^[\r\n\t ]+/);Ee=jt&&jt[0]}Dt==="application/xhtml+xml"&&Ze===$e&&(J='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+J+"</body></html>");const ot=k?k.createHTML(J):J;if(Ze===$e)try{_e=new w().parseFromString(ot,Dt)}catch{}if(!_e||!_e.documentElement){_e=R.createDocument(Ze,"template",null);try{_e.documentElement.innerHTML=at?L:ot}catch{}}const Je=_e.body||_e.documentElement;return J&&Ee&&Je.insertBefore(r.createTextNode(Ee),Je.childNodes[0]||null),Ze===$e?I.call(_e,Ge?"html":"body")[0]:Ge?_e.documentElement:Je},dr=function(J){return M.call(J.ownerDocument||J,J,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Zn=function(J){return J instanceof p&&(typeof J.nodeName!="string"||typeof J.textContent!="string"||typeof J.removeChild!="function"||!(J.attributes instanceof b)||typeof J.removeAttribute!="function"||typeof J.setAttribute!="function"||typeof J.namespaceURI!="string"||typeof J.insertBefore!="function"||typeof J.hasChildNodes!="function")},Bt=function(J){return typeof c=="function"&&J instanceof c};function Mt(Ne,J,_e){_l(Ne,Ee=>{Ee.call(n,J,_e,Oe)})}const Ui=function(J){let _e=null;if(Mt(F.beforeSanitizeElements,J,null),Zn(J))return nt(J),!0;const Ee=ye(J.nodeName);if(Mt(F.uponSanitizeElement,J,{tagName:Ee,allowedTags:O}),Ie&&J.hasChildNodes()&&!Bt(J.firstElementChild)&&jn(/<[/\w!]/g,J.innerHTML)&&jn(/<[/\w!]/g,J.textContent)||Ie&&J.namespaceURI===$e&&Ee==="style"&&Bt(J.firstElementChild)||J.nodeType===yl.progressingInstruction||Ie&&J.nodeType===yl.comment&&jn(/<[/\w]/g,J.data))return nt(J),!0;if(he[Ee]||!($.tagCheck instanceof Function&&$.tagCheck(Ee))&&!O[Ee]){if(!he[Ee]&&fr(Ee)&&(ie.tagNameCheck instanceof RegExp&&jn(ie.tagNameCheck,Ee)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(Ee)))return!1;if(ut&&!Ut[Ee]){const ot=S(J)||J.parentNode,Je=m(J)||J.childNodes;if(Je&&ot){const jt=Je.length;for(let Jt=jt-1;Jt>=0;--Jt){const Qt=E(Je[Jt],!0);ot.insertBefore(Qt,y(J))}}}return nt(J),!0}return J instanceof u&&!Vt(J)||(Ee==="noscript"||Ee==="noembed"||Ee==="noframes")&&jn(/<\/no(script|embed|frames)/i,J.innerHTML)?(nt(J),!0):(je&&J.nodeType===yl.text&&(_e=J.textContent,_l([G,B,Y],ot=>{_e=Ua(_e,ot," ")}),J.textContent!==_e&&(vl(n.removed,{element:J.cloneNode()}),J.textContent=_e)),Mt(F.afterSanitizeElements,J,null),!1)},Ur=function(J,_e,Ee){if(te[_e]||an&&(_e==="id"||_e==="name")&&(Ee in r||Ee in bt))return!1;const ot=W[_e]||$.attributeCheck instanceof Function&&$.attributeCheck(_e,J);if(!(ge&&!te[_e]&&jn(X,_e))){if(!(le&&jn(H,_e))){if(!ot||te[_e]){if(!(fr(J)&&(ie.tagNameCheck instanceof RegExp&&jn(ie.tagNameCheck,J)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(J))&&(ie.attributeNameCheck instanceof RegExp&&jn(ie.attributeNameCheck,_e)||ie.attributeNameCheck instanceof Function&&ie.attributeNameCheck(_e,J))||_e==="is"&&ie.allowCustomizedBuiltInElements&&(ie.tagNameCheck instanceof RegExp&&jn(ie.tagNameCheck,Ee)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(Ee))))return!1}else if(!Pn[_e]){if(!jn(P,Ua(Ee,V,""))){if(!((_e==="src"||_e==="xlink:href"||_e==="href")&&J!=="script"&&Zb(Ee,"data:")===0&&Xn[J])){if(!(we&&!jn(q,Ua(Ee,V,"")))){if(Ee)return!1}}}}}}return!0},ra=Xe({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),fr=function(J){return!ra[Rl(J)]&&jn(D,J)},Es=function(J){Mt(F.beforeSanitizeAttributes,J,null);const{attributes:_e}=J;if(!_e||Zn(J))return;const Ee={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:W,forceKeepAttr:void 0};let ot=_e.length;for(;ot--;){const Je=_e[ot],{name:jt,namespaceURI:Jt,value:Qt}=Je,be=ye(jt),Me=Qt;let De=jt==="value"?Me:uN(Me);if(Ee.attrName=be,Ee.attrValue=De,Ee.keepAttr=!0,Ee.forceKeepAttr=void 0,Mt(F.uponSanitizeAttribute,J,Ee),De=Ee.attrValue,kn&&(be==="id"||be==="name")&&Zb(De,Zt)!==0&&(Rn(jt,J),De=Zt+De),Ie&&jn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,De)){Rn(jt,J);continue}if(be==="attributename"&&Xb(De,"href")){Rn(jt,J);continue}if(Ee.forceKeepAttr)continue;if(!Ee.keepAttr){Rn(jt,J);continue}if(!Se&&jn(/\/>/i,De)){Rn(jt,J);continue}je&&_l([G,B,Y],Ft=>{De=Ua(De,Ft," ")});const ft=ye(J.nodeName);if(!Ur(ft,be,De)){Rn(jt,J);continue}if(k&&typeof C=="object"&&typeof C.getAttributeType=="function"&&!Jt)switch(C.getAttributeType(ft,be)){case"TrustedHTML":{De=k.createHTML(De);break}case"TrustedScriptURL":{De=k.createScriptURL(De);break}}if(De!==Me)try{Jt?J.setAttributeNS(Jt,jt,De):J.setAttribute(jt,De),Zn(J)?nt(J):Yb(n.removed)}catch{Rn(jt,J)}}Mt(F.afterSanitizeAttributes,J,null)},Qi=function(J){let _e=null;const Ee=dr(J);for(Mt(F.beforeSanitizeShadowDOM,J,null);_e=Ee.nextNode();)Mt(F.uponSanitizeShadowNode,_e,null),Ui(_e),Es(_e),_e.content instanceof g&&Qi(_e.content);Mt(F.afterSanitizeShadowDOM,J,null)};return n.sanitize=function(Ne){let J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_e=null,Ee=null,ot=null,Je=null;if(at=!Ne,at&&(Ne="<!-->"),typeof Ne!="string"&&!Bt(Ne)&&(Ne=gN(Ne),typeof Ne!="string"))throw Su("dirty is not a string, aborting");if(!n.isSupported)return Ne;if(vt||ke(J),n.removed=[],typeof Ne=="string"&&(Rt=!1),Rt){const Qt=Ne.nodeName;if(typeof Qt=="string"){const be=ye(Qt);if(!O[be]||he[be])throw Su("root node is forbidden and cannot be sanitized in-place")}}else if(Ne instanceof c)_e=hr("<!---->"),Ee=_e.ownerDocument.importNode(Ne,!0),Ee.nodeType===yl.element&&Ee.nodeName==="BODY"||Ee.nodeName==="HTML"?_e=Ee:_e.appendChild(Ee);else{if(!Tt&&!je&&!Ge&&Ne.indexOf("<")===-1)return k&&vn?k.createHTML(Ne):Ne;if(_e=hr(Ne),!_e)return Tt?null:vn?L:""}_e&&Le&&nt(_e.firstChild);const jt=dr(Rt?Ne:_e);for(;ot=jt.nextNode();)Ui(ot),Es(ot),ot.content instanceof g&&Qi(ot.content);if(Rt)return Ne;if(Tt){if(je){_e.normalize();let Qt=_e.innerHTML;_l([G,B,Y],be=>{Qt=Ua(Qt,be," ")}),_e.innerHTML=Qt}if(Xt)for(Je=T.call(_e.ownerDocument);_e.firstChild;)Je.appendChild(_e.firstChild);else Je=_e;return(W.shadowroot||W.shadowrootmode)&&(Je=K.call(a,Je,!0)),Je}let Jt=Ge?_e.outerHTML:_e.innerHTML;return Ge&&O["!doctype"]&&_e.ownerDocument&&_e.ownerDocument.doctype&&_e.ownerDocument.doctype.name&&jn(Px,_e.ownerDocument.doctype.name)&&(Jt="<!DOCTYPE "+_e.ownerDocument.doctype.name+`>
156
+ `+Jt),je&&_l([G,B,Y],Qt=>{Jt=Ua(Jt,Qt," ")}),k&&vn?k.createHTML(Jt):Jt},n.setConfig=function(){let Ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ke(Ne),vt=!0},n.clearConfig=function(){Oe=null,vt=!1},n.isValidAttribute=function(Ne,J,_e){Oe||ke({});const Ee=ye(Ne),ot=ye(J);return Ur(Ee,ot,_e)},n.addHook=function(Ne,J){typeof J=="function"&&vl(F[Ne],J)},n.removeHook=function(Ne,J){if(J!==void 0){const _e=lN(F[Ne],J);return _e===-1?void 0:cN(F[Ne],_e,1)[0]}return Yb(F[Ne])},n.removeHooks=function(Ne){F[Ne]=[]},n.removeAllHooks=function(){F=sy()},n}var Bl=zx(),np,ay;function RN(){if(ay)return np;ay=1;function e(Q){return Q instanceof Map?Q.clear=Q.delete=Q.set=function(){throw new Error("map is read-only")}:Q instanceof Set&&(Q.add=Q.clear=Q.delete=function(){throw new Error("set is read-only")}),Object.freeze(Q),Object.getOwnPropertyNames(Q).forEach(fe=>{const ye=Q[fe],Oe=typeof ye;(Oe==="object"||Oe==="function")&&!Object.isFrozen(ye)&&e(ye)}),Q}class n{constructor(fe){fe.data===void 0&&(fe.data={}),this.data=fe.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(Q){return Q.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function a(Q,...fe){const ye=Object.create(null);for(const Oe in Q)ye[Oe]=Q[Oe];return fe.forEach(function(Oe){for(const bt in Oe)ye[bt]=Oe[bt]}),ye}const o="</span>",g=Q=>!!Q.scope,_=(Q,{prefix:fe})=>{if(Q.startsWith("language:"))return Q.replace("language:","language-");if(Q.includes(".")){const ye=Q.split(".");return[`${fe}${ye.shift()}`,...ye.map((Oe,bt)=>`${Oe}${"_".repeat(bt+1)}`)].join(" ")}return`${fe}${Q}`};class c{constructor(fe,ye){this.buffer="",this.classPrefix=ye.classPrefix,fe.walk(this)}addText(fe){this.buffer+=r(fe)}openNode(fe){if(!g(fe))return;const ye=_(fe.scope,{prefix:this.classPrefix});this.span(ye)}closeNode(fe){g(fe)&&(this.buffer+=o)}value(){return this.buffer}span(fe){this.buffer+=`<span class="${fe}">`}}const u=(Q={})=>{const fe={children:[]};return Object.assign(fe,Q),fe};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(fe){this.top.children.push(fe)}openNode(fe){const ye=u({scope:fe});this.add(ye),this.stack.push(ye)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(fe){return this.constructor._walk(fe,this.rootNode)}static _walk(fe,ye){return typeof ye=="string"?fe.addText(ye):ye.children&&(fe.openNode(ye),ye.children.forEach(Oe=>this._walk(fe,Oe)),fe.closeNode(ye)),fe}static _collapse(fe){typeof fe!="string"&&fe.children&&(fe.children.every(ye=>typeof ye=="string")?fe.children=[fe.children.join("")]:fe.children.forEach(ye=>{d._collapse(ye)}))}}class b extends d{constructor(fe){super(),this.options=fe}addText(fe){fe!==""&&this.add(fe)}startScope(fe){this.openNode(fe)}endScope(){this.closeNode()}__addSublanguage(fe,ye){const Oe=fe.root;ye&&(Oe.scope=`language:${ye}`),this.add(Oe)}toHTML(){return new c(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p(Q){return Q?typeof Q=="string"?Q:Q.source:null}function w(Q){return E("(?=",Q,")")}function C(Q){return E("(?:",Q,")*")}function A(Q){return E("(?:",Q,")?")}function E(...Q){return Q.map(ye=>p(ye)).join("")}function f(Q){const fe=Q[Q.length-1];return typeof fe=="object"&&fe.constructor===Object?(Q.splice(Q.length-1,1),fe):{}}function y(...Q){return"("+(f(Q).capture?"":"?:")+Q.map(Oe=>p(Oe)).join("|")+")"}function m(Q){return new RegExp(Q.toString()+"|").exec("").length-1}function S(Q,fe){const ye=Q&&Q.exec(fe);return ye&&ye.index===0}const k=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function L(Q,{joinWith:fe}){let ye=0;return Q.map(Oe=>{ye+=1;const bt=ye;let ht=p(Oe),ke="";for(;ht.length>0;){const Ce=k.exec(ht);if(!Ce){ke+=ht;break}ke+=ht.substring(0,Ce.index),ht=ht.substring(Ce.index+Ce[0].length),Ce[0][0]==="\\"&&Ce[1]?ke+="\\"+String(Number(Ce[1])+bt):(ke+=Ce[0],Ce[0]==="("&&ye++)}return ke}).map(Oe=>`(${Oe})`).join(fe)}const R=/\b\B/,M="[a-zA-Z]\\w*",T="[a-zA-Z_]\\w*",I="\\b\\d+(\\.\\d+)?",K="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",F="\\b(0b[01]+)",G="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",B=(Q={})=>{const fe=/^#![ ]*\//;return Q.binary&&(Q.begin=E(fe,/.*\b/,Q.binary,/\b.*/)),a({scope:"meta",begin:fe,end:/$/,relevance:0,"on:begin":(ye,Oe)=>{ye.index!==0&&Oe.ignoreMatch()}},Q)},Y={begin:"\\\\[\\s\\S]",relevance:0},X={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Y]},H={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Y]},q={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/},V=function(Q,fe,ye={}){const Oe=a({scope:"comment",begin:Q,end:fe,contains:[]},ye);Oe.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 bt=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 Oe.contains.push({begin:E(/[ ]+/,"(",bt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Oe},D=V("//","$"),P=V("/\\*","\\*/"),O=V("#","$"),z={scope:"number",begin:I,relevance:0},W={scope:"number",begin:K,relevance:0},Z={scope:"number",begin:F,relevance:0},ie={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Y,{begin:/\[/,end:/\]/,relevance:0,contains:[Y]}]},he={scope:"title",begin:M,relevance:0},te={scope:"title",begin:T,relevance:0},$={begin:"\\.\\s*"+T,relevance:0};var ge=Object.freeze({__proto__:null,APOS_STRING_MODE:X,BACKSLASH_ESCAPE:Y,BINARY_NUMBER_MODE:Z,BINARY_NUMBER_RE:F,COMMENT:V,C_BLOCK_COMMENT_MODE:P,C_LINE_COMMENT_MODE:D,C_NUMBER_MODE:W,C_NUMBER_RE:K,END_SAME_AS_BEGIN:function(Q){return Object.assign(Q,{"on:begin":(fe,ye)=>{ye.data._beginMatch=fe[1]},"on:end":(fe,ye)=>{ye.data._beginMatch!==fe[1]&&ye.ignoreMatch()}})},HASH_COMMENT_MODE:O,IDENT_RE:M,MATCH_NOTHING_RE:R,METHOD_GUARD:$,NUMBER_MODE:z,NUMBER_RE:I,PHRASAL_WORDS_MODE:q,QUOTE_STRING_MODE:H,REGEXP_MODE:ie,RE_STARTERS_RE:G,SHEBANG:B,TITLE_MODE:he,UNDERSCORE_IDENT_RE:T,UNDERSCORE_TITLE_MODE:te});function we(Q,fe){Q.input[Q.index-1]==="."&&fe.ignoreMatch()}function Se(Q,fe){Q.className!==void 0&&(Q.scope=Q.className,delete Q.className)}function je(Q,fe){fe&&Q.beginKeywords&&(Q.begin="\\b("+Q.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",Q.__beforeBegin=we,Q.keywords=Q.keywords||Q.beginKeywords,delete Q.beginKeywords,Q.relevance===void 0&&(Q.relevance=0))}function Ie(Q,fe){Array.isArray(Q.illegal)&&(Q.illegal=y(...Q.illegal))}function Ge(Q,fe){if(Q.match){if(Q.begin||Q.end)throw new Error("begin & end are not supported with match");Q.begin=Q.match,delete Q.match}}function vt(Q,fe){Q.relevance===void 0&&(Q.relevance=1)}const Le=(Q,fe)=>{if(!Q.beforeMatch)return;if(Q.starts)throw new Error("beforeMatch cannot be used with starts");const ye=Object.assign({},Q);Object.keys(Q).forEach(Oe=>{delete Q[Oe]}),Q.keywords=ye.keywords,Q.begin=E(ye.beforeMatch,w(ye.begin)),Q.starts={relevance:0,contains:[Object.assign(ye,{endsParent:!0})]},Q.relevance=0,delete ye.beforeMatch},Tt=["of","and","for","in","not","or","if","then","parent","list","value"],Xt="keyword";function vn(Q,fe,ye=Xt){const Oe=Object.create(null);return typeof Q=="string"?bt(ye,Q.split(" ")):Array.isArray(Q)?bt(ye,Q):Object.keys(Q).forEach(function(ht){Object.assign(Oe,vn(Q[ht],fe,ht))}),Oe;function bt(ht,ke){fe&&(ke=ke.map(Ce=>Ce.toLowerCase())),ke.forEach(function(Ce){const Pe=Ce.split("|");Oe[Pe[0]]=[ht,an(Pe[0],Pe[1])]})}}function an(Q,fe){return fe?Number(fe):kn(Q)?0:1}function kn(Q){return Tt.includes(Q.toLowerCase())}const Zt={},ut=Q=>{console.error(Q)},Rt=(Q,...fe)=>{console.log(`WARN: ${Q}`,...fe)},xt=(Q,fe)=>{Zt[`${Q}/${fe}`]||(console.log(`Deprecated as of ${Q}. ${fe}`),Zt[`${Q}/${fe}`]=!0)},Ut=new Error;function Kt(Q,fe,{key:ye}){let Oe=0;const bt=Q[ye],ht={},ke={};for(let Ce=1;Ce<=fe.length;Ce++)ke[Ce+Oe]=bt[Ce],ht[Ce+Oe]=!0,Oe+=m(fe[Ce-1]);Q[ye]=ke,Q[ye]._emit=ht,Q[ye]._multi=!0}function Xn(Q){if(Array.isArray(Q.begin)){if(Q.skip||Q.excludeBegin||Q.returnBegin)throw ut("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ut;if(typeof Q.beginScope!="object"||Q.beginScope===null)throw ut("beginScope must be object"),Ut;Kt(Q,Q.begin,{key:"beginScope"}),Q.begin=L(Q.begin,{joinWith:""})}}function bn(Q){if(Array.isArray(Q.end)){if(Q.skip||Q.excludeEnd||Q.returnEnd)throw ut("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ut;if(typeof Q.endScope!="object"||Q.endScope===null)throw ut("endScope must be object"),Ut;Kt(Q,Q.end,{key:"endScope"}),Q.end=L(Q.end,{joinWith:""})}}function Pn(Q){Q.scope&&typeof Q.scope=="object"&&Q.scope!==null&&(Q.beginScope=Q.scope,delete Q.scope)}function dt(Q){Pn(Q),typeof Q.beginScope=="string"&&(Q.beginScope={_wrap:Q.beginScope}),typeof Q.endScope=="string"&&(Q.endScope={_wrap:Q.endScope}),Xn(Q),bn(Q)}function An(Q){function fe(ke,Ce){return new RegExp(p(ke),"m"+(Q.case_insensitive?"i":"")+(Q.unicodeRegex?"u":"")+(Ce?"g":""))}class ye{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Ce,Pe){Pe.position=this.position++,this.matchIndexes[this.matchAt]=Pe,this.regexes.push([Pe,Ce]),this.matchAt+=m(Ce)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Ce=this.regexes.map(Pe=>Pe[1]);this.matcherRe=fe(L(Ce,{joinWith:"|"}),!0),this.lastIndex=0}exec(Ce){this.matcherRe.lastIndex=this.lastIndex;const Pe=this.matcherRe.exec(Ce);if(!Pe)return null;const Vt=Pe.findIndex((Rn,hr)=>hr>0&&Rn!==void 0),nt=this.matchIndexes[Vt];return Pe.splice(0,Vt),Object.assign(Pe,nt)}}class Oe{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 Pe=new ye;return this.rules.slice(Ce).forEach(([Vt,nt])=>Pe.addRule(Vt,nt)),Pe.compile(),this.multiRegexes[Ce]=Pe,Pe}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Ce,Pe){this.rules.push([Ce,Pe]),Pe.type==="begin"&&this.count++}exec(Ce){const Pe=this.getMatcher(this.regexIndex);Pe.lastIndex=this.lastIndex;let Vt=Pe.exec(Ce);if(this.resumingScanAtSamePosition()&&!(Vt&&Vt.index===this.lastIndex)){const nt=this.getMatcher(0);nt.lastIndex=this.lastIndex+1,Vt=nt.exec(Ce)}return Vt&&(this.regexIndex+=Vt.position+1,this.regexIndex===this.count&&this.considerAll()),Vt}}function bt(ke){const Ce=new Oe;return ke.contains.forEach(Pe=>Ce.addRule(Pe.begin,{rule:Pe,type:"begin"})),ke.terminatorEnd&&Ce.addRule(ke.terminatorEnd,{type:"end"}),ke.illegal&&Ce.addRule(ke.illegal,{type:"illegal"}),Ce}function ht(ke,Ce){const Pe=ke;if(ke.isCompiled)return Pe;[Se,Ge,dt,Le].forEach(nt=>nt(ke,Ce)),Q.compilerExtensions.forEach(nt=>nt(ke,Ce)),ke.__beforeBegin=null,[je,Ie,vt].forEach(nt=>nt(ke,Ce)),ke.isCompiled=!0;let Vt=null;return typeof ke.keywords=="object"&&ke.keywords.$pattern&&(ke.keywords=Object.assign({},ke.keywords),Vt=ke.keywords.$pattern,delete ke.keywords.$pattern),Vt=Vt||/\w+/,ke.keywords&&(ke.keywords=vn(ke.keywords,Q.case_insensitive)),Pe.keywordPatternRe=fe(Vt,!0),Ce&&(ke.begin||(ke.begin=/\B|\b/),Pe.beginRe=fe(Pe.begin),!ke.end&&!ke.endsWithParent&&(ke.end=/\B|\b/),ke.end&&(Pe.endRe=fe(Pe.end)),Pe.terminatorEnd=p(Pe.end)||"",ke.endsWithParent&&Ce.terminatorEnd&&(Pe.terminatorEnd+=(ke.end?"|":"")+Ce.terminatorEnd)),ke.illegal&&(Pe.illegalRe=fe(ke.illegal)),ke.contains||(ke.contains=[]),ke.contains=[].concat(...ke.contains.map(function(nt){return $e(nt==="self"?ke:nt)})),ke.contains.forEach(function(nt){ht(nt,Pe)}),ke.starts&&ht(ke.starts,Ce),Pe.matcher=bt(Pe),Pe}if(Q.compilerExtensions||(Q.compilerExtensions=[]),Q.contains&&Q.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return Q.classNameAliases=a(Q.classNameAliases||{}),ht(Q)}function ve(Q){return Q?Q.endsWithParent||ve(Q.starts):!1}function $e(Q){return Q.variants&&!Q.cachedVariants&&(Q.cachedVariants=Q.variants.map(function(fe){return a(Q,{variants:null},fe)})),Q.cachedVariants?Q.cachedVariants:ve(Q)?a(Q,{starts:Q.starts?a(Q.starts):null}):Object.isFrozen(Q)?a(Q):Q}var Ze="11.11.1";class at extends Error{constructor(fe,ye){super(fe),this.name="HTMLInjectionError",this.html=ye}}const Ve=r,on=a,Ot=Symbol("nomatch"),Tn=7,Un=function(Q){const fe=Object.create(null),ye=Object.create(null),Oe=[];let bt=!0;const ht="Could not find the language '{}', did you forget to load/include a language module?",ke={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:b};function Pe(be){return Ce.noHighlightRe.test(be)}function Vt(be){let Me=be.className+" ";Me+=be.parentNode?be.parentNode.className:"";const De=Ce.languageDetectRe.exec(Me);if(De){const ft=J(De[1]);return ft||(Rt(ht.replace("{}",De[1])),Rt("Falling back to no-highlight mode for this block.",be)),ft?De[1]:"no-highlight"}return Me.split(/\s+/).find(ft=>Pe(ft)||J(ft))}function nt(be,Me,De){let ft="",Ft="";typeof Me=="object"?(ft=be,De=Me.ignoreIllegals,Ft=Me.language):(xt("10.7.0","highlight(lang, code, ...args) has been deprecated."),xt("10.7.0",`Please use highlight(code, options) instead.
157
+ https://github.com/highlightjs/highlight.js/issues/2277`),Ft=be,ft=Me),De===void 0&&(De=!0);const zn={code:ft,language:Ft};Jt("before:highlight",zn);const ci=zn.result?zn.result:Rn(zn.language,zn.code,De);return ci.code=zn.code,Jt("after:highlight",ci),ci}function Rn(be,Me,De,ft){const Ft=Object.create(null);function zn(xe,Te){return xe.keywords[Te]}function ci(){if(!Ue.keywords){hn.addText(yt);return}let xe=0;Ue.keywordPatternRe.lastIndex=0;let Te=Ue.keywordPatternRe.exec(yt),We="";for(;Te;){We+=yt.substring(xe,Te.index);const it=Ln.case_insensitive?Te[0].toLowerCase():Te[0],Yt=zn(Ue,it);if(Yt){const[xi,vo]=Yt;if(hn.addText(We),We="",Ft[it]=(Ft[it]||0)+1,Ft[it]<=Tn&&(Fr+=vo),xi.startsWith("_"))We+=Te[0];else{const tc=Ln.classNameAliases[xi]||xi;ui(Te[0],tc)}}else We+=Te[0];xe=Ue.keywordPatternRe.lastIndex,Te=Ue.keywordPatternRe.exec(yt)}We+=yt.substring(xe),hn.addText(We)}function Jn(){if(yt==="")return;let xe=null;if(typeof Ue.subLanguage=="string"){if(!fe[Ue.subLanguage]){hn.addText(yt);return}xe=Rn(Ue.subLanguage,yt,!0,ec[Ue.subLanguage]),ec[Ue.subLanguage]=xe._top}else xe=dr(yt,Ue.subLanguage.length?Ue.subLanguage:null);Ue.relevance>0&&(Fr+=xe.relevance),hn.__addSublanguage(xe._emitter,xe.language)}function Nt(){Ue.subLanguage!=null?Jn():ci(),yt=""}function ui(xe,Te){xe!==""&&(hn.startScope(Te),hn.addText(xe),hn.endScope())}function Jl(xe,Te){let We=1;const it=Te.length-1;for(;We<=it;){if(!xe._emit[We]){We++;continue}const Yt=Ln.classNameAliases[xe[We]]||xe[We],xi=Te[We];Yt?ui(xi,Yt):(yt=xi,ci(),yt=""),We++}}function sa(xe,Te){return xe.scope&&typeof xe.scope=="string"&&hn.openNode(Ln.classNameAliases[xe.scope]||xe.scope),xe.beginScope&&(xe.beginScope._wrap?(ui(yt,Ln.classNameAliases[xe.beginScope._wrap]||xe.beginScope._wrap),yt=""):xe.beginScope._multi&&(Jl(xe.beginScope,Te),yt="")),Ue=Object.create(xe,{parent:{value:Ue}}),Ue}function go(xe,Te,We){let it=S(xe.endRe,We);if(it){if(xe["on:end"]){const Yt=new n(xe);xe["on:end"](Te,Yt),Yt.isMatchIgnored&&(it=!1)}if(it){for(;xe.endsParent&&xe.parent;)xe=xe.parent;return xe}}if(xe.endsWithParent)return go(xe.parent,Te,We)}function aa(xe){return Ue.matcher.regexIndex===0?(yt+=xe[0],1):(Wr=!0,0)}function yh(xe){const Te=xe[0],We=xe.rule,it=new n(We),Yt=[We.__beforeBegin,We["on:begin"]];for(const xi of Yt)if(xi&&(xi(xe,it),it.isMatchIgnored))return aa(Te);return We.skip?yt+=Te:(We.excludeBegin&&(yt+=Te),Nt(),!We.returnBegin&&!We.excludeBegin&&(yt=Te)),sa(We,xe),We.returnBegin?0:Te.length}function Qn(xe){const Te=xe[0],We=Me.substring(xe.index),it=go(Ue,xe,We);if(!it)return Ot;const Yt=Ue;Ue.endScope&&Ue.endScope._wrap?(Nt(),ui(Te,Ue.endScope._wrap)):Ue.endScope&&Ue.endScope._multi?(Nt(),Jl(Ue.endScope,xe)):Yt.skip?yt+=Te:(Yt.returnEnd||Yt.excludeEnd||(yt+=Te),Nt(),Yt.excludeEnd&&(yt=Te));do Ue.scope&&hn.closeNode(),!Ue.skip&&!Ue.subLanguage&&(Fr+=Ue.relevance),Ue=Ue.parent;while(Ue!==it.parent);return it.starts&&sa(it.starts,xe),Yt.returnEnd?0:Te.length}function mo(){const xe=[];for(let Te=Ue;Te!==Ln;Te=Te.parent)Te.scope&&xe.unshift(Te.scope);xe.forEach(Te=>hn.openNode(Te))}let ks={};function oa(xe,Te){const We=Te&&Te[0];if(yt+=xe,We==null)return Nt(),0;if(ks.type==="begin"&&Te.type==="end"&&ks.index===Te.index&&We===""){if(yt+=Me.slice(Te.index,Te.index+1),!bt){const it=new Error(`0 width match regex (${be})`);throw it.languageName=be,it.badRule=ks.rule,it}return 1}if(ks=Te,Te.type==="begin")return yh(Te);if(Te.type==="illegal"&&!De){const it=new Error('Illegal lexeme "'+We+'" for mode "'+(Ue.scope||"<unnamed>")+'"');throw it.mode=Ue,it}else if(Te.type==="end"){const it=Qn(Te);if(it!==Ot)return it}if(Te.type==="illegal"&&We==="")return yt+=`
158
+ `,1;if(_o>1e5&&_o>Te.index*3)throw new Error("potential infinite loop, way more iterations than matches");return yt+=We,We.length}const Ln=J(be);if(!Ln)throw ut(ht.replace("{}",be)),new Error('Unknown language: "'+be+'"');const Ql=An(Ln);let la="",Ue=ft||Ql;const ec={},hn=new Ce.__emitter(Ce);mo();let yt="",Fr=0,pr=0,_o=0,Wr=!1;try{if(Ln.__emitTokens)Ln.__emitTokens(Me,hn);else{for(Ue.matcher.considerAll();;){_o++,Wr?Wr=!1:Ue.matcher.considerAll(),Ue.matcher.lastIndex=pr;const xe=Ue.matcher.exec(Me);if(!xe)break;const Te=Me.substring(pr,xe.index),We=oa(Te,xe);pr=xe.index+We}oa(Me.substring(pr))}return hn.finalize(),la=hn.toHTML(),{language:be,value:la,relevance:Fr,illegal:!1,_emitter:hn,_top:Ue}}catch(xe){if(xe.message&&xe.message.includes("Illegal"))return{language:be,value:Ve(Me),illegal:!0,relevance:0,_illegalBy:{message:xe.message,index:pr,context:Me.slice(pr-100,pr+100),mode:xe.mode,resultSoFar:la},_emitter:hn};if(bt)return{language:be,value:Ve(Me),illegal:!1,relevance:0,errorRaised:xe,_emitter:hn,_top:Ue};throw xe}}function hr(be){const Me={value:Ve(be),illegal:!1,relevance:0,_top:ke,_emitter:new Ce.__emitter(Ce)};return Me._emitter.addText(be),Me}function dr(be,Me){Me=Me||Ce.languages||Object.keys(fe);const De=hr(be),ft=Me.filter(J).filter(Ee).map(Nt=>Rn(Nt,be,!1));ft.unshift(De);const Ft=ft.sort((Nt,ui)=>{if(Nt.relevance!==ui.relevance)return ui.relevance-Nt.relevance;if(Nt.language&&ui.language){if(J(Nt.language).supersetOf===ui.language)return 1;if(J(ui.language).supersetOf===Nt.language)return-1}return 0}),[zn,ci]=Ft,Jn=zn;return Jn.secondBest=ci,Jn}function Zn(be,Me,De){const ft=Me&&ye[Me]||De;be.classList.add("hljs"),be.classList.add(`language-${ft}`)}function Bt(be){let Me=null;const De=Vt(be);if(Pe(De))return;if(Jt("before:highlightElement",{el:be,language:De}),be.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",be);return}if(be.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(be)),Ce.throwUnescapedHTML))throw new at("One of your code blocks includes unescaped HTML.",be.innerHTML);Me=be;const ft=Me.textContent,Ft=De?nt(ft,{language:De,ignoreIllegals:!0}):dr(ft);be.innerHTML=Ft.value,be.dataset.highlighted="yes",Zn(be,De,Ft.language),be.result={language:Ft.language,re:Ft.relevance,relevance:Ft.relevance},Ft.secondBest&&(be.secondBest={language:Ft.secondBest.language,relevance:Ft.secondBest.relevance}),Jt("after:highlightElement",{el:be,result:Ft,text:ft})}function Mt(be){Ce=on(Ce,be)}const Ui=()=>{fr(),xt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Ur(){fr(),xt("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let ra=!1;function fr(){function be(){fr()}if(document.readyState==="loading"){ra||window.addEventListener("DOMContentLoaded",be,!1),ra=!0;return}document.querySelectorAll(Ce.cssSelector).forEach(Bt)}function Es(be,Me){let De=null;try{De=Me(Q)}catch(ft){if(ut("Language definition for '{}' could not be registered.".replace("{}",be)),bt)ut(ft);else throw ft;De=ke}De.name||(De.name=be),fe[be]=De,De.rawDefinition=Me.bind(null,Q),De.aliases&&_e(De.aliases,{languageName:be})}function Qi(be){delete fe[be];for(const Me of Object.keys(ye))ye[Me]===be&&delete ye[Me]}function Ne(){return Object.keys(fe)}function J(be){return be=(be||"").toLowerCase(),fe[be]||fe[ye[be]]}function _e(be,{languageName:Me}){typeof be=="string"&&(be=[be]),be.forEach(De=>{ye[De.toLowerCase()]=Me})}function Ee(be){const Me=J(be);return Me&&!Me.disableAutodetect}function ot(be){be["before:highlightBlock"]&&!be["before:highlightElement"]&&(be["before:highlightElement"]=Me=>{be["before:highlightBlock"](Object.assign({block:Me.el},Me))}),be["after:highlightBlock"]&&!be["after:highlightElement"]&&(be["after:highlightElement"]=Me=>{be["after:highlightBlock"](Object.assign({block:Me.el},Me))})}function Je(be){ot(be),Oe.push(be)}function jt(be){const Me=Oe.indexOf(be);Me!==-1&&Oe.splice(Me,1)}function Jt(be,Me){const De=be;Oe.forEach(function(ft){ft[De]&&ft[De](Me)})}function Qt(be){return xt("10.7.0","highlightBlock will be removed entirely in v12.0"),xt("10.7.0","Please use highlightElement now."),Bt(be)}Object.assign(Q,{highlight:nt,highlightAuto:dr,highlightAll:fr,highlightElement:Bt,highlightBlock:Qt,configure:Mt,initHighlighting:Ui,initHighlightingOnLoad:Ur,registerLanguage:Es,unregisterLanguage:Qi,listLanguages:Ne,getLanguage:J,registerAliases:_e,autoDetection:Ee,inherit:on,addPlugin:Je,removePlugin:jt}),Q.debugMode=function(){bt=!1},Q.safeMode=function(){bt=!0},Q.versionString=Ze,Q.regex={concat:E,lookahead:w,either:y,optional:A,anyNumberOfTimes:C};for(const be in ge)typeof ge[be]=="object"&&e(ge[be]);return Object.assign(Q,ge),Q},Dt=Un({});return Dt.newInstance=()=>Un({}),np=Dt,Dt.HighlightJS=Dt,Dt.default=Dt,np}var LN=RN();const Ni=Mg(LN);function oy(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]},g=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),_={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,r,o]};o.contains.push(c);const u={match:/\\"/},d={className:"string",begin:/'/,end:/'/},b={match:/\\'/},p={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,r]},w=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],C=e.SHEBANG({binary:`(${w.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"],f=["true","false"],y={match:/(\/[a-z._-]+)+/},m=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],S=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],k=["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:f,built_in:[...m,...S,"set","shopt",...k,...L]},contains:[C,e.SHEBANG(),A,p,g,_,y,c,u,d,b,r]}}const ly="[A-Za-z$_][0-9A-Za-z$_]*",MN=["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"],NN=["true","false","null","undefined","NaN","Infinity"],Hx=["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"],$x=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ux=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ON=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],DN=[].concat(Ux,Hx,$x);function cy(e){const n=e.regex,r=(V,{after:D})=>{const P="</"+V[0].slice(1);return V.input.indexOf(P,D)!==-1},a=ly,o={begin:"<>",end:"</>"},g=/<[A-Za-z0-9\\._:-]+\s*\/>/,_={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(V,D)=>{const P=V[0].length+V.index,O=V.input[P];if(O==="<"||O===","){D.ignoreMatch();return}O===">"&&(r(V,{after:P})||D.ignoreMatch());let z;const W=V.input.substring(P);if(z=W.match(/^\s*=/)){D.ignoreMatch();return}if((z=W.match(/^\s+extends\s+/))&&z.index===0){D.ignoreMatch();return}}},c={$pattern:ly,keyword:MN,literal:NN,built_in:DN,"variable.language":ON},u="[0-9](_?[0-9])*",d=`\\.(${u})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${b})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${b})\\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},w={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},C={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,w],subLanguage:"xml"}},A={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,w],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,w],subLanguage:"graphql"}},f={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,w]},m={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]},S=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,C,A,E,f,{match:/\$\d+/},p];w.contains=S.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(S)});const k=[].concat(m,w.contains),L=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(k)}]),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"}}]},T={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:{_:[...Hx,...$x]}},I={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},K={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function G(V){return n.concat("(?!",V.join("|"),")")}const B={match:n.concat(/\b/,G([...Ux,"super","import"].map(V=>`${V}\\s*\\(`)),a,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},Y={begin:n.concat(/\./,n.lookahead(n.concat(a,/(?![0-9A-Za-z$_(])/))),end:a,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},X={match:[/get|set/,/\s+/,a,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},H="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",q={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(H)],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:T},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),I,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,C,A,E,f,m,{match:/\$\d+/},p,T,{scope:"attr",match:a+n.lookahead(":"),relevance:0},q,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[m,e.REGEXP_MODE,{className:"function",begin:H,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:g},{begin:_.begin,"on:begin":_.isTrulyOpeningTag,end:_.end}],subLanguage:"xml",contains:[{begin:_.begin,end:_.end,skip:!0,contains:["self"]}]}]},K,{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},Y,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},B,F,M,X,{match:/\$[(.]/}]}}function BN(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 uy(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}]},g={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},_={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},c=/[A-Za-z][A-Za-z0-9+.-]*/,u={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:n.concat(/\[.+?\]\(/,c,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},d={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},b={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},p=e.inherit(d,{contains:[]}),w=e.inherit(b,{contains:[]});d.contains.push(w),b.contains.push(p);let C=[r,u];return[d,b,p,w].forEach(y=>{y.contains=y.contains.concat(C)}),C=C.concat(d,b),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:C},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:C}]}]},r,g,d,b,{className:"quote",begin:"^>\\s+",contains:C,end:"$"},o,a,u,_,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function hy(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:/#/},b={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,b,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u,b,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,b,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,b,d]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},w="[0-9](_?[0-9])*",C=`(\\b(${w}))?\\.(${w})|\\b(${w})\\.`,A=`\\b|${a.join("|")}`,E={className:"number",relevance:0,variants:[{begin:`(\\b(${w})|(${C}))[eE][+-]?(${w})[jJ]?(?=${A})`},{begin:`(${C})[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(${w})[jJ](?=${A})`}]},f={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,f,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 eh="[A-Za-z$_][0-9A-Za-z$_]*",Fx=["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"],Wx=["true","false","null","undefined","NaN","Infinity"],Gx=["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"],qx=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Kx=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Vx=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Yx=[].concat(Kx,Gx,qx);function jN(e){const n=e.regex,r=(V,{after:D})=>{const P="</"+V[0].slice(1);return V.input.indexOf(P,D)!==-1},a=eh,o={begin:"<>",end:"</>"},g=/<[A-Za-z0-9\\._:-]+\s*\/>/,_={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(V,D)=>{const P=V[0].length+V.index,O=V.input[P];if(O==="<"||O===","){D.ignoreMatch();return}O===">"&&(r(V,{after:P})||D.ignoreMatch());let z;const W=V.input.substring(P);if(z=W.match(/^\s*=/)){D.ignoreMatch();return}if((z=W.match(/^\s+extends\s+/))&&z.index===0){D.ignoreMatch();return}}},c={$pattern:eh,keyword:Fx,literal:Wx,built_in:Yx,"variable.language":Vx},u="[0-9](_?[0-9])*",d=`\\.(${u})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${b})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${b})\\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},w={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},C={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,w],subLanguage:"xml"}},A={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,w],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,w],subLanguage:"graphql"}},f={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,w]},m={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]},S=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,C,A,E,f,{match:/\$\d+/},p];w.contains=S.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(S)});const k=[].concat(m,w.contains),L=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(k)}]),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"}}]},T={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:{_:[...Gx,...qx]}},I={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},K={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function G(V){return n.concat("(?!",V.join("|"),")")}const B={match:n.concat(/\b/,G([...Kx,"super","import"].map(V=>`${V}\\s*\\(`)),a,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},Y={begin:n.concat(/\./,n.lookahead(n.concat(a,/(?![0-9A-Za-z$_(])/))),end:a,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},X={match:[/get|set/,/\s+/,a,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},H="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",q={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(H)],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:T},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),I,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,C,A,E,f,m,{match:/\$\d+/},p,T,{scope:"attr",match:a+n.lookahead(":"),relevance:0},q,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[m,e.REGEXP_MODE,{className:"function",begin:H,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:g},{begin:_.begin,"on:begin":_.isTrulyOpeningTag,end:_.end}],subLanguage:"xml",contains:[{begin:_.begin,end:_.end,skip:!0,contains:["self"]}]}]},K,{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},Y,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},B,F,M,X,{match:/\$[(.]/}]}}function dy(e){const n=e.regex,r=jN(e),a=eh,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],g={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},_={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:o},contains:[r.exports.CLASS_REFERENCE]},c={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},u=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],d={$pattern:eh,keyword:Fx.concat(u),literal:Wx,built_in:Yx.concat(o),"variable.language":Vx},b={className:"meta",begin:"@"+a},p=(E,f,y)=>{const m=E.contains.findIndex(S=>S.label===f);if(m===-1)throw new Error("can not find mode to replace");E.contains.splice(m,1,y)};Object.assign(r.keywords,d),r.exports.PARAMS_CONTAINS.push(b);const w=r.contains.find(E=>E.scope==="attr"),C=Object.assign({},w,{match:n.concat(a,n.lookahead(/\s*\?:/))});r.exports.PARAMS_CONTAINS.push([r.exports.CLASS_REFERENCE,w,C]),r.contains=r.contains.concat([b,g,_,C]),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 IN=/\[\[wiki:([^\]]+)\]\]/g,PN=new Bx({gfm:!0,breaks:!1}),fy={ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto):|[#/]|\.{0,2}\/|[^:]+$)/i,ADD_ATTR:["target","rel","data-entry-id"]},ip=YN();function Xx(e,n={}){const r=$N(e,n.resolveWikiLink),a=PN.parse(r,{async:!1}),o=Bl.sanitize(a,fy),g=new DOMParser().parseFromString(o,"text/html");return FN(g,n.omitDuplicateTitle),UN(g),WN(g),qN(g),{html:Bl.sanitize(g.body.innerHTML,fy),toc:KN(g)}}function zN(e){const n=new TextEncoder().encode(e);let r="";for(const a of n)r+=String.fromCharCode(a);return btoa(r)}function HN(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 $N(e,n){return e.replace(IN,(r,a)=>{const o=a.trim();if(!o)return"";if(!n)return rp(`[[wiki:${o}]]`);const g=n(o);if(g===null)return rp(`[[wiki:${o}]]`);const _=rp(o),c=encodeURIComponent(o);return`<a href="${g}" data-entry-id="${c}">${_}</a>`})}function UN(e){const n=new Map;for(const r of e.querySelectorAll("h2, h3")){const a=r.textContent?.trim()??"",o=JN(a||"section"),g=n.get(o)??0;n.set(o,g+1),r.id=g===0?o:`${o}-${g+1}`}}function FN(e,n){if(!n)return;const r=e.body.querySelector("h1, h2, h3, h4, h5, h6");!r||r.tagName.toLowerCase()!=="h1"||py(r.textContent??"")===py(n)&&r.remove()}function WN(e){for(const n of e.querySelectorAll("pre > code")){const r=XN(n.className),a=n.textContent??"",o=n.parentElement;if(!o)continue;if(r==="mermaid"){const _=e.createElement("div");_.className="diagram-block",_.setAttribute("data-mermaid-source",zN(a)),_.setAttribute("data-diagram-state","pending"),o.replaceWith(_);continue}const g=VN(a,r);n.innerHTML=g,n.classList.add("hljs"),o.classList.add("code-block"),o.dataset.code=a,o.insertBefore(GN(e,r||"text"),o.firstChild)}}function GN(e,n){const r=e.createElement("div");r.className="code-block-toolbar";const a=e.createElement("span");a.className="code-block-dots",a.setAttribute("aria-hidden","true");for(let _=0;_<3;_++)a.append(e.createElement("span"));const o=e.createElement("span");o.className="code-block-language",o.textContent=n;const g=e.createElement("button");return g.className="copy-code",g.type="button",g.dataset.action="copy-code",g.setAttribute("aria-label",`Copy ${n} code`),g.textContent="Copy",r.append(a,o,g),r}function qN(e){for(const n of e.querySelectorAll("a")){const r=n.getAttribute("href")??"";ZN(r)&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"))}}function KN(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 VN(e,n){return n&&ip.getLanguage(n)?ip.highlight(e,{language:n}).value:ip.highlightAuto(e).value}function YN(){return Ni.registerLanguage("bash",oy),Ni.registerLanguage("sh",oy),Ni.registerLanguage("javascript",cy),Ni.registerLanguage("js",cy),Ni.registerLanguage("json",BN),Ni.registerLanguage("markdown",uy),Ni.registerLanguage("md",uy),Ni.registerLanguage("python",hy),Ni.registerLanguage("py",hy),Ni.registerLanguage("typescript",dy),Ni.registerLanguage("ts",dy),Ni}function XN(e){return e.match(/language-([a-z0-9_-]+)/i)?.[1]?.toLowerCase()??null}function ZN(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)&&!e.startsWith(window.location.origin)}function JN(e){return e.trim().toLowerCase().replace(/[^\p{Letter}\p{Number}]+/gu,"-").replace(/^-+|-+$/g,"")||"section"}function py(e){return e.trim().replace(/\s+/g," ").toLocaleLowerCase("en-US")}function rp(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}const QN="modulepreload",eO=function(e){return"/console/"+e},gy={},tO=function(n,r,a){let o=Promise.resolve();if(r&&r.length>0){let u=function(d){return Promise.all(d.map(b=>Promise.resolve(b).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const _=document.querySelector("meta[property=csp-nonce]"),c=_?.nonce||_?.getAttribute("nonce");o=u(r.map(d=>{if(d=eO(d),d in gy)return;gy[d]=!0;const b=d.endsWith(".css"),p=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const w=document.createElement("link");if(w.rel=b?"stylesheet":QN,b||(w.as="script"),w.crossOrigin="",w.href=d,c&&w.setAttribute("nonce",c),document.head.appendChild(w),b)return new Promise((C,A)=>{w.addEventListener("load",C),w.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${d}`)))})}))}function g(_){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=_,window.dispatchEvent(c),!c.defaultPrevented)throw _}return o.then(_=>{for(const c of _||[])c.status==="rejected"&&g(c.reason);return n().catch(g)})},nO=".diagram-block[data-mermaid-source]:not([data-diagram-state='rendered']):not([data-diagram-state='error'])",iO=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),rO=/^on/i,sO={USE_PROFILES:{svg:!0,svgFilters:!1},FORBID_TAGS:["foreignObject","script"],FORBID_ATTR:["href","xlink:href"]},my="diagramInteractionBound",aO=/^oklch\s*\(\s*([^)]+)\s*\)$/i,oO=/^(-?\d+(?:\.\d+)?)(deg)?$/i,Bi=[25,50,75,100,125,150,200],lO=["pie1","pie2","pie3","pie4","pie5","pie6","pie7","pie8","pie9","pie10","pie11","pie12"];let sp=null;const _y=new WeakSet;let cO=0,uO=0,Ul=null;function bs(e){const n=e.trim();if(!n)return n;const r=NO(n);return r?OO(r):n}function Zx(e){if(_y.has(e))return;_y.add(e),vy(e);const n=e instanceof Node?e:document.body;new MutationObserver(a=>{let o=!1;for(const g of a)if(g.type==="childList"){Ul&&!Ul.trigger.isConnected&&Ll(!1);for(const _ of g.addedNodes)if(_ instanceof Element&&(_.matches?.(".diagram-block[data-mermaid-source]")||_.querySelector?.(".diagram-block[data-mermaid-source]"))){o=!0;break}if(o)break}o&&vy(e)}).observe(n,{childList:!0,subtree:!0})}function vy(e){const n=e.querySelectorAll(nO);for(const r of n)r.dataset.diagramHydrating!=="true"&&(r.dataset.diagramHydrating="true",r.dataset.diagramState="pending",hO(r))}async function hO(e){const n=e.getAttribute("data-mermaid-source")??"";let r="";try{r=HN(n)}catch{ap(e,"Invalid diagram source");return}if(!r.trim()){ap(e,"Empty diagram source");return}try{const a=await fO(),o=`mermaid-diagram-${++cO}`,{svg:g}=await a.render(o,r);e.innerHTML=dO(g),mO(e,g),_O(e),vO(e),e.dataset.diagramState="rendered"}catch(a){const o=a instanceof Error?a.message:String(a);ap(e,o)}}function ap(e,n){e.dataset.diagramState="error",e.textContent=`Diagram render failed: ${n}`}function dO(e){const n=(r,a)=>{rO.test(a.attrName)&&(a.keepAttr=!1)};Bl.addHook("uponSanitizeAttribute",n);try{return Bl.sanitize(e,sO)}finally{Bl.removeHook("uponSanitizeAttribute",n)}}async function fO(){return sp||(sp=(async()=>{const e=await tO(()=>import("./mermaid.core-CFCyolqU.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:pO(),themeCSS:gO(),flowchart:{htmlLabels:!1,useMaxWidth:!1}}),n})()),sp}function pO(){const e=getComputedStyle(document.documentElement),n=(E,f)=>{const y=e.getPropertyValue(E).trim();return bs(y||f)},r=(E,f)=>e.getPropertyValue(E).trim()||f,a=n("--brass","#c69a4a"),o=n("--brass-bright","#e6b86a"),g=n("--brass-deep","#a0782a"),_=n("--aurora","#8bd7e6"),c=n("--aurora-deep","#1f8aa8"),u=n("--coral","#ef7c63"),d=n("--ink-deep","#1d2734"),b=n("--ink-fog","#a6afbb"),p=n("--ink-pearl","#e6e9ef"),w=n("--ink-spectral","#bcc4d0"),C=[o,a,_,u,bs("oklch(70% 0.11 68)"),c,bs("oklch(76% 0.09 205)"),g,bs("oklch(68% 0.14 30)"),b,bs("oklch(62% 0.08 228)"),bs("oklch(52% 0.05 248)")],A=Object.fromEntries(lO.map((E,f)=>[E,C[f]??d]));return{background:"transparent",primaryColor:"transparent",primaryTextColor:p,primaryBorderColor:a,secondaryColor:"transparent",secondaryTextColor:p,secondaryBorderColor:o,tertiaryColor:"transparent",tertiaryTextColor:w,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:g,pieStrokeWidth:"1.35px",pieOuterStrokeColor:o,pieOuterStrokeWidth:"2.5px",pieOpacity:"0.96",...A}}function gO(){const e=getComputedStyle(document.documentElement),n=(d,b)=>{const p=e.getPropertyValue(d).trim();return bs(p||b)},r=n("--brass-deep","#a0782a"),a=n("--brass-bright","#e6b86a"),o=n("--aurora-deep","#1f8aa8"),g=n("--ink-abyss","#131920"),_=bs("oklch(15% 0.04 250 / 34%)"),c=n("--surface-glass","#1d2734"),u=n("--ink-pearl","#e6e9ef");return`
159
+ .node rect, .node polygon, .node circle, .node ellipse, .actor, .classGroup rect {
160
+ stroke: ${r};
161
+ fill: ${c};
162
+ }
163
+ .edgePath path, .messageLine0, .messageLine1, .relation {
164
+ stroke: ${o};
165
+ }
166
+ .nodeLabel, .edgeLabel, .actor text, .messageText {
167
+ fill: ${u};
168
+ font-family: "Manrope Variable", "Manrope", ui-sans-serif, sans-serif;
169
+ }
170
+ .pieCircle {
171
+ stroke: ${r};
172
+ stroke-width: 1.35px;
173
+ opacity: 0.96;
174
+ filter: drop-shadow(0 0 1.5px ${_});
175
+ }
176
+ .pieOuterCircle {
177
+ stroke: ${a};
178
+ opacity: 0.7;
179
+ }
180
+ .slice, .legend text, .pieTitleText {
181
+ fill: ${u};
182
+ paint-order: stroke;
183
+ stroke: ${g};
184
+ stroke-width: 3px;
185
+ stroke-linejoin: round;
186
+ font-family: "Manrope Variable", "Manrope", ui-sans-serif, sans-serif;
187
+ }
188
+ .slice {
189
+ font-weight: 600;
190
+ letter-spacing: 0.04em;
191
+ font-style: italic;
192
+ }
193
+ .pieTitleText {
194
+ font-weight: 600;
195
+ letter-spacing: 0.12em;
196
+ font-style: italic;
197
+ }
198
+ .legend text {
199
+ font-weight: 500;
200
+ letter-spacing: 0.03em;
201
+ }
202
+ .legend rect {
203
+ rx: 999px;
204
+ ry: 999px;
205
+ opacity: 0.9;
206
+ stroke: ${g};
207
+ stroke-width: 1.5px;
208
+ paint-order: stroke;
209
+ filter: saturate(0.78) brightness(0.92) drop-shadow(0 0 0.55px ${a});
210
+ }
211
+ `}function mO(e,n){const r=new DOMParser().parseFromString(n,"image/svg+xml"),a=Array.from(r.querySelectorAll("a")),o=Array.from(e.querySelectorAll("a")),g=Math.min(a.length,o.length);for(let _=0;_<g;_++){const c=a[_],u=o[_];if(!c||!u)continue;const d=c.getAttribute("href")??c.getAttribute("xlink:href")??"",b=Qx(d);b&&u.setAttribute("href",b)}}function _O(e){const n=e.querySelector("svg");if(!n)return;let r;try{r=n.getBBox()}catch{return}const{x:a,y:o,width:g,height:_}=r;!Number.isFinite(a)||!Number.isFinite(o)||!Number.isFinite(g)||!Number.isFinite(_)||a<0||o<0||g<=0||_<=0||n.setAttribute("viewBox",`${Xa(a)} ${Xa(o)} ${Xa(g)} ${Xa(_)}`)}function vO(e){e.tabIndex=0,e.setAttribute("aria-label","Open diagram in expanded view"),RO(e),e.dataset[my]!=="true"&&(e.dataset[my]="true",e.addEventListener("click",bO),e.addEventListener("keydown",yO))}function bO(e){if(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0||th(e.target))return;const n=e.currentTarget;n instanceof HTMLElement&&(e.preventDefault(),Jx(n))}function yO(e){if(e.key!=="Enter"&&e.key!==" "||th(e.target))return;const n=e.currentTarget;n instanceof HTMLElement&&(e.preventDefault(),Jx(n))}function Jx(e){const n=e.querySelector("svg");if(!n)return;Ll(!1);const r=typeof HTMLDialogElement<"u"&&typeof HTMLDialogElement.prototype.showModal=="function",a=document.createElement(r?"dialog":"div"),o=++uO,g=`diagram-lightbox-title-${o}`;a.className="diagram-lightbox",a.setAttribute("aria-labelledby",g),r||(a.setAttribute("role","dialog"),a.setAttribute("aria-modal","true"),a.tabIndex=-1);const _=document.createElement("div");_.className="diagram-lightbox__frame";const c=document.createElement("div");c.className="diagram-lightbox__header";const u=document.createElement("h2");u.id=g,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 b=document.createElement("div");b.className="diagram-lightbox__controls",b.setAttribute("aria-label","Diagram zoom controls");const p=xu("−","Zoom out","out"),w=document.createElement("span");w.className="diagram-lightbox__zoom-readout",w.setAttribute("aria-live","polite");const C=xu("+","Zoom in","in"),A=xu("Fit","Fit diagram to viewport","fit"),E=xu("Reset","Reset diagram zoom","reset");b.append(p,w,C,A,E);const f=document.createElement("div");f.className="diagram-lightbox__viewport";const y=xO(n),m=n.cloneNode(!0);m.removeAttribute("style"),EO(m,`diagram-lightbox-svg-${o}`),f.append(m),c.append(u,b,d),_.append(c,f),a.append(_),document.body.append(a);const S=new SO(f,m,w,y);p.addEventListener("click",()=>S.zoomOut()),C.addEventListener("click",()=>S.zoomIn()),A.addEventListener("click",()=>S.fit()),E.addEventListener("click",()=>S.reset());const k=kO(a),L=T=>{(T.target===a||T.target===d)&&Ll(!0)},R=T=>{if(T.key==="Escape"){T.preventDefault(),Ll(!0);return}S.handleKeyboard(T)||T.key==="Tab"&&TO(T,a)},M={dialog:a,trigger:e,inertStates:k,onClick:L,onKeyDown:R,cleanupPanZoom:()=>S.destroy()};r&&(M.onCancel=T=>{T.preventDefault(),Ll(!0)},a.addEventListener("cancel",M.onCancel),a.showModal()),a.addEventListener("click",L),document.addEventListener("keydown",R,!0),Ul=M,S.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 SO{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=Bi.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,Bi.length-1))}zoomOut(){this.zoomAroundViewportCenter(Math.max(this.zoomIndex-1,0))}reset(){this.zoomAroundViewportCenter(Bi.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),g=Bi.findIndex(c=>c>o),_=g===-1?Bi.length-1:Math.max(0,g-1);this.applyZoom(_),this.viewport.scrollLeft=Math.max(0,(this.svgWidth-n)/2),this.viewport.scrollTop=Math.max(0,(this.svgHeight-r)/2)}handleKeyboard(n){return n.key==="+"||n.key==="="?(n.preventDefault(),this.zoomIn(),!0):n.key==="-"||n.key==="_"?(n.preventDefault(),this.zoomOut(),!0):n.key==="0"?(n.preventDefault(),this.reset(),!0):n.key.toLowerCase()==="f"?(n.preventDefault(),this.fit(),!0):!1}get svgWidth(){return this.baseSize.width*(Cu(this.zoomIndex)/100)}get svgHeight(){return this.baseSize.height*(Cu(this.zoomIndex)/100)}applyZoom(n){this.zoomIndex=n;const r=Cu(this.zoomIndex),a=r/100;this.svg.setAttribute("width",Xa(this.baseSize.width*a)),this.svg.setAttribute("height",Xa(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,g=this.svgHeight,_=this.viewport.getBoundingClientRect(),c=this.viewport.scrollLeft+r-_.left,u=this.viewport.scrollTop+a-_.top;this.applyZoom(n),this.viewport.scrollLeft=c/o*this.svgWidth-(r-_.left),this.viewport.scrollTop=u/g*this.svgHeight-(a-_.top)}onPointerDown=n=>{if(n.button!==0||th(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=Cu(this.pinchStart.zoomIndex)*a;this.applyZoom(CO(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,Bi.length-1):Math.max(this.zoomIndex-1,0);this.zoomAroundPoint(r,n.clientX,n.clientY)};onDoubleClick=n=>{th(n.target)||(n.preventDefault(),this.zoomAroundPoint(this.zoomIndex===Bi.indexOf(200)?Bi.indexOf(100):Bi.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 wO(e){const n=by(e.getAttribute("width")),r=by(e.getAttribute("height"));if(n&&r)return{width:n,height:r};const a=e.getAttribute("viewBox")?.trim().split(/[\s,]+/).map(Number)??[],o=a[2],g=a[3],_=o!==void 0&&Number.isFinite(o)&&o>0?o:null,c=g!==void 0&&Number.isFinite(g)&&g>0?g:null;return{width:n??_??800,height:r??c??600}}function xO(e){const n=e.getBoundingClientRect();return n.width>0&&n.height>0?{width:n.width,height:n.height}:wO(e)}function by(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 Xa(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/\.?0+$/,"")}function CO(e){let n=0,r=Number.POSITIVE_INFINITY;return Bi.forEach((a,o)=>{const g=Math.abs(a-e);g<r&&(r=g,n=o)}),n}function Cu(e){return Bi[e]??Bi[0]}function EO(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 Ll(e){const n=Ul;n&&(n.dialog.removeEventListener("click",n.onClick),document.removeEventListener("keydown",n.onKeyDown,!0),n.onCancel&&n.dialog.removeEventListener("cancel",n.onCancel),n.cleanupPanZoom(),AO(n.inertStates),n.dialog instanceof HTMLDialogElement&&n.dialog.open&&typeof n.dialog.close=="function"&&n.dialog.close(),n.dialog.remove(),Ul=null,e&&n.trigger.isConnected&&n.trigger.focus())}function kO(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 AO(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 TO(e,n){const r=Array.from(n.querySelectorAll(iO)).filter(MO);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 RO(e){e.querySelector("a[href]")?e.removeAttribute("role"):e.setAttribute("role","button")}function th(e){if(!(e instanceof Element))return!1;const n=e.closest("a[href]");return!n||!(n.getAttribute("href")?.trim()??"")?!1:!LO(n)}function LO(e){return Array.from(e.children).some(n=>n.tagName.toLowerCase()==="svg")}function MO(e){return!(e.inert||e.hidden||e.getAttribute("aria-hidden")==="true"||"disabled"in e&&e.disabled)}function Qx(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:Qx(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 NO(e){const n=aO.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,g=a>=0?r.slice(a+1).trim():"",_=o.trim().split(/[\s,]+/).filter(Boolean);if(_.length!==3)return null;const[c,u,d]=_;if(!c||!u||!d)return null;const b=op(c,1),p=op(u,.4),w=DO(d);if(b===null||p===null||w===null)return null;let C=1;if(a>=0){const A=op(g,1);if(A===null)return null;C=A}return{L:b,C:p,h:w,alpha:C}}function OO(e){const n=e.h*Math.PI/180,r=e.C*Math.cos(n),a=e.C*Math.sin(n),o=e.L,g=o+.3963377774*r+.2158037573*a,_=o-.1055613458*r-.0638541728*a,c=o-.0894841775*r-1.291485548*a,u=g**3,d=_**3,b=c**3,p=4.0767416621*u-3.3077115913*d+.2309699292*b,w=-1.2684380046*u+2.6097574011*d-.3413193965*b,C=-.0041960863*u-.7034186147*d+1.707614701*b,A=Eu(lp(p)),E=Eu(lp(w)),f=Eu(lp(C));if(e.alpha<1){const y=Eu(e.alpha);return`#${Ws(A)}${Ws(E)}${Ws(f)}${Ws(y)}`}return`#${Ws(A)}${Ws(E)}${Ws(f)}`}function op(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 DO(e){const n=oO.exec(e);if(!n)return null;const r=Number(n[1]);return Number.isFinite(r)?r:null}function lp(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 Eu(e){return Math.round(Math.max(0,Math.min(1,e))*255)}function Ws(e){return e.toString(16).padStart(2,"0")}function BO({content:e,truncated:n}){const r=j.useMemo(()=>{const g=Xx(e).html,_=new DOMParser().parseFromString(g,"text/html");return cp(_.body),_.body.innerHTML},[e]),a=j.useRef(null);j.useEffect(()=>{const g=a.current;if(!g)return;Zx(g),cp(g);const _=new MutationObserver(()=>cp(g));return _.observe(g,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["href","src","srcset"]}),()=>_.disconnect()},[r]);const o=j.useCallback(g=>{const _=g.target.closest('[data-action="copy-code"]');if(!_)return;const c=_.closest("pre")?.getAttribute("data-code");if(!c)return;navigator.clipboard?.writeText(c);const u=_.textContent;_.textContent="Copied",window.setTimeout(()=>{_.textContent=u},1200)},[]);return h.jsxs("div",{className:"fexp-md-wrap",children:[n&&h.jsx("div",{className:"fexp-truncated-badge",children:"File is too large — showing a partial preview"}),h.jsx("div",{ref:a,className:"markdown-body",onClick:o,dangerouslySetInnerHTML:{__html:r}})]})}function cp(e){for(const n of e.querySelectorAll("a[href]")){const r=n.getAttribute("href")??"";r&&!/^(https?:|mailto:|#)/i.test(r)&&(n.removeAttribute("href"),n.setAttribute("role","link"),n.setAttribute("aria-disabled","true"))}for(const n of e.querySelectorAll("img[src], img[srcset], source[src], source[srcset]"))n.removeAttribute("src"),n.removeAttribute("srcset"),n.tagName==="IMG"&&n.setAttribute("aria-hidden","true")}const jO=.55,dg={selectedPath:null,viewState:{kind:"none"},splitRatio:jO},eC=new Map,fg=new Set;function IO(){for(const e of fg)e()}function tC(e){return eC.get(e)??dg}function ym(e,n){eC.set(e,{...tC(e),...n}),IO()}function PO(e){return fg.add(e),()=>{fg.delete(e)}}function zO(e){return j.useSyncExternalStore(PO,()=>e!=null?tC(e):dg,()=>dg)}function yy(e,n){e&&ym(e,{selectedPath:n})}function Gs(e,n){e&&ym(e,{viewState:n})}function HO(e,n){e&&ym(e,{splitRatio:n})}const $O=new Set([".png",".jpg",".jpeg",".webp",".gif"]),Sy=200,wy=160,UO=360;function FO(e){return{listFolder:async n=>{if(!e)throw new Error("no_theater");const r=await fetch("/plugins/file-explorer/files/list",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({theaterId:e,relativePath:n??""})});if(!r.ok){const a=await r.json();throw new Error(a.error??"list_failed")}return r.json()}}}function WO({theaterId:e}){const{selectedPath:n,viewState:r,splitRatio:a}=zO(e),o=j.useRef(a);o.current=a;const g=j.useRef(null),[_,c]=j.useState(!1),u=j.useMemo(()=>FO(e),[e]),d=j.useCallback(async C=>{if(C.kind!=="file")return;yy(e,C.relativePath);const A=C.name,E=A.slice(A.lastIndexOf(".")).toLowerCase();if($O.has(E)){const f=e?`/plugins/file-explorer/files/image?theaterId=${encodeURIComponent(e)}&path=${encodeURIComponent(C.relativePath)}`:"";Gs(e,{kind:"image",relativePath:C.relativePath,name:A,src:f});return}Gs(e,{kind:"loading"});try{const f=await fetch("/plugins/file-explorer/files/read",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({theaterId:e,relativePath:C.relativePath})});if(!f.ok){const m=await f.json();throw new Error(m.error??"read_failed")}const y=await f.json();if(y.binary){Gs(e,{kind:"binary",name:A});return}Gs(e,{kind:"code",relativePath:y.relativePath,content:y.content,lang:y.lang,truncated:y.truncated})}catch(f){const y=f instanceof Error?f.message:"Unable to load file";y==="binary_file"?Gs(e,{kind:"binary",name:A}):Gs(e,{kind:"error",message:y})}},[e]),b=j.useCallback(()=>{Gs(e,{kind:"none"}),yy(e,null)},[e]),p=j.useCallback(C=>{C.preventDefault();const A=g.current;if(!A)return;const E=A.getBoundingClientRect().width,f=C.clientX,y=o.current;c(!0);const m=k=>{const L=k.clientX-f,R=Math.max(Sy/E,Math.min(1-wy/E,y+L/E));o.current=R,HO(e,R)},S=()=>{document.removeEventListener("pointermove",m),document.removeEventListener("pointerup",S),c(!1)};document.addEventListener("pointermove",m),document.addEventListener("pointerup",S)},[e]),w=r.kind!=="none";return h.jsxs("div",{ref:g,className:`fexp-root${_?" is-dragging":""}`,style:{gridTemplateColumns:`minmax(${Sy}px, ${a}fr) 4px minmax(${wy}px, ${1-a}fr)`},children:[h.jsxs("div",{className:"fexp-viewer-pane",children:[h.jsxs("div",{className:"fexp-viewer-head",children:[h.jsx("span",{className:"fexp-viewer-filename",children:w&&r.kind!=="loading"&&r.kind!=="error"?"relativePath"in r?r.relativePath:r.name:""}),w&&h.jsx("button",{className:"fexp-viewer-close",type:"button",onClick:b,"aria-label":"Close viewer",children:"✕"})]}),h.jsxs("div",{className:"fexp-viewer-body",children:[r.kind==="none"&&h.jsx("div",{className:"fexp-viewer-empty",children:"Select an item in the file tree to preview its contents here."}),r.kind==="loading"&&h.jsx("div",{className:"fexp-viewer-loading",children:"Loading…"}),r.kind==="error"&&h.jsx("div",{className:"fexp-viewer-error",children:r.message}),r.kind==="code"&&r.lang==="markdown"&&h.jsx(BO,{content:r.content,truncated:r.truncated}),r.kind==="code"&&r.lang!=="markdown"&&h.jsx(b4,{content:r.content,lang:r.lang,truncated:r.truncated}),r.kind==="image"&&h.jsx(w4,{src:r.src,name:r.name}),r.kind==="binary"&&h.jsx(l4,{name:r.name})]})]}),h.jsx("div",{className:"fexp-divider",onPointerDown:p,"aria-hidden":"true"}),h.jsx("div",{className:"fexp-tree-pane",children:h.jsx(a4,{files:u,theaterId:e,selectedPath:n,onSelect:d})})]})}function GO(){return h.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M3 5a2 2 0 012-2h3.586a1 1 0 01.707.293L10.707 4.7A1 1 0 0011.414 5H15a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2V5z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})})}const qO={id:"file-explorer",title:"Files",icon:GO,render:e=>h.jsx(WO,{...e}),preferredExtraWidth:UO},KO={id:"file-explorer",railPanels:[qO]},VO=[KO],YO={M:"M",A:"A",D:"D",R:"R",U:"U"};function XO(e){const n={dirs:{},files:[]};for(const r of e){const a=r.path.split("/");a.pop();let o=n;for(const g of a)o.dirs[g]||(o.dirs[g]={dirs:{},files:[]}),o=o.dirs[g];o.files.push(r)}return n}function ZO({files:e,section:n,selectedPath:r,selectedSection:a,onSelect:o}){const g=XO(e);return h.jsx(nC,{node:g,depth:0,section:n,selectedPath:r,selectedSection:a,onSelect:o})}function nC({node:e,depth:n,section:r,selectedPath:a,selectedSection:o,onSelect:g}){return h.jsxs(h.Fragment,{children:[Object.entries(e.dirs).map(([_,c])=>h.jsx(JO,{dirKey:_,node:c,depth:n,section:r,selectedPath:a,selectedSection:o,onSelect:g},_)),e.files.map(_=>h.jsx(QO,{entry:_,depth:n,section:r,selectedPath:a,selectedSection:o,onSelect:g},_.path))]})}function JO({dirKey:e,node:n,depth:r,section:a,selectedPath:o,selectedSection:g,onSelect:_}){const[c,u]=j.useState(!1),d=j.useCallback(()=>u(C=>!C),[]);let b=e,p=n;for(;Object.keys(p.dirs).length===1&&p.files.length===0;){const C=Object.keys(p.dirs)[0];b+="/"+C,p=p.dirs[C]}const w=r*16+12;return h.jsxs("div",{className:`diff-folder${c?" is-collapsed":""}`,children:[h.jsxs("button",{type:"button",className:"diff-folder-row",style:{paddingLeft:`${w}px`},onClick:d,"aria-expanded":!c,children:[h.jsx("svg",{className:"diff-folder-chevron",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})}),h.jsx("svg",{className:"diff-folder-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M2 4a1 1 0 011-1h3l1.2 1.2H13a1 1 0 011 1V12a1 1 0 01-1 1H3a1 1 0 01-1-1V4z",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})}),h.jsx("span",{className:"diff-folder-name",children:b})]}),!c&&h.jsx(nC,{node:p,depth:r+1,section:a,selectedPath:o,selectedSection:g,onSelect:_})]})}function QO({entry:e,depth:n,section:r,selectedPath:a,selectedSection:o,onSelect:g}){const _=e.path===a&&r===o,c=j.useCallback(()=>g(e,r),[e,r,g]),u=n*16+12,d=e.path.split("/").pop()??e.path;return h.jsxs("button",{type:"button",className:`diff-file-row${_?" is-cur":""}`,style:{paddingLeft:`${u}px`},title:e.path,onClick:c,children:[h.jsx("span",{className:`diff-status-glyph diff-status-${e.status.toLowerCase()}`,"aria-label":e.status,children:YO[e.status]??e.status}),h.jsx("span",{className:"diff-file-name",children:d}),h.jsxs("span",{className:"diff-nums",children:[e.additions>0&&h.jsxs("span",{className:"diff-additions",children:["+",e.additions]}),e.deletions>0&&h.jsxs("span",{className:"diff-deletions",children:["−",e.deletions]})]})]})}const xy="fleet-console.diff.stagedCollapsed",Cy="fleet-console.diff.changesCollapsed",eD={M:"modified",A:"added",D:"deleted",R:"renamed",U:"untracked"};function Ey(e){try{return localStorage.getItem(e)==="1"}catch{return!1}}function tD({ctx:e,viewMode:n,selectedPath:r,selectedSection:a,onSelect:o}){const[g,_]=j.useState({kind:"loading"}),[c,u]=j.useState(0),[d,b]=j.useState(()=>Ey(xy)),[p,w]=j.useState(()=>Ey(Cy));j.useEffect(()=>{if(!e.theaterId){_({kind:"error",message:"no_theater"});return}let f=!1;_({kind:"loading"});const y=async m=>{const S=await fetch("/plugins/diff/changed",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({theaterId:e.theaterId,mode:m})});if(!S.ok){const k=await S.json();throw new Error(k.error??"git_failed")}return S.json()};return Promise.allSettled([y("workdir"),y("staged")]).then(([m,S])=>{if(f)return;if(m.status==="fulfilled"&&S.status==="fulfilled"){_({kind:"ok",staged:S.value.files,changes:m.value.files});return}const k=[m,S].map(R=>R.status==="rejected"?R.reason instanceof Error?R.reason.message:"unknown":null),L=k.find(R=>R==="no_git_repo"||R==="git_unavailable");if(L==="no_git_repo"||L==="git_unavailable"){_({kind:"notice",reason:L});return}_({kind:"error",message:k.find(R=>R!==null)??"unknown"})}),()=>{f=!0}},[e.theaterId,c]);const C=j.useCallback(()=>u(f=>f+1),[]),A=j.useCallback(()=>{b(f=>{const y=!f;try{localStorage.setItem(xy,y?"1":"0")}catch{}return y})},[]),E=j.useCallback(()=>{w(f=>{const y=!f;try{localStorage.setItem(Cy,y?"1":"0")}catch{}return y})},[]);if(g.kind==="loading")return h.jsx("div",{className:"diff-sections-loading",children:"Loading…"});if(g.kind==="notice"){const f=g.reason==="no_git_repo"?"Not a Git repository":"Git isn't available",y=g.reason==="no_git_repo"?"This folder isn't a Git repository, so there are no changes to show.":"Git was not found on this system. Install Git and make sure it's on your PATH.";return h.jsxs("div",{className:"diff-sections-notice",children:[h.jsx("strong",{className:"diff-notice-title",children:f}),h.jsx("span",{className:"diff-notice-body",children:y}),h.jsx("button",{type:"button",className:"diff-refresh-btn",onClick:C,children:"Retry"})]})}return g.kind==="error"?h.jsxs("div",{className:"diff-sections-error",children:[h.jsx("span",{children:g.message}),h.jsx("button",{type:"button",className:"diff-refresh-btn",onClick:C,children:"Retry"})]}):h.jsxs("div",{className:"diff-sections",children:[h.jsx(ky,{name:"Staged Changes",files:g.staged,isCollapsed:d,onToggle:A,viewMode:n,section:"staged",selectedPath:r,selectedSection:a,onSelect:o}),h.jsx(ky,{name:"Changes",files:g.changes,isCollapsed:p,onToggle:E,viewMode:n,section:"workdir",selectedPath:r,selectedSection:a,onSelect:o})]})}function ky({name:e,files:n,isCollapsed:r,onToggle:a,viewMode:o,section:g,selectedPath:_,selectedSection:c,onSelect:u}){return h.jsxs("div",{className:`diff-section${r?" is-collapsed":""}`,children:[h.jsxs("button",{type:"button",className:"diff-section-head",onClick:a,children:[h.jsx("svg",{className:"diff-section-chevron",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})}),h.jsx("span",{className:"diff-section-name",children:e}),h.jsx("span",{className:"diff-count-badge",children:n.length})]}),!r&&h.jsx("div",{className:"diff-section-rows",children:n.length===0?h.jsx("div",{className:"diff-empty-row",children:"No changes"}):o==="tree"?h.jsx(ZO,{files:n,section:g,selectedPath:_,selectedSection:c,onSelect:u}):n.map(d=>h.jsx(nD,{entry:d,section:g,isSelected:d.path===_&&g===c,onSelect:u},d.path))})]})}function nD({entry:e,section:n,isSelected:r,onSelect:a}){const o=j.useCallback(()=>a(e,n),[e,n,a]),g=e.path.lastIndexOf("/"),_=g>=0?e.path.slice(0,g+1):"",c=g>=0?e.path.slice(g+1):e.path;return h.jsxs("button",{type:"button",className:`diff-file-row${r?" is-cur":""}`,title:e.path,onClick:o,children:[h.jsx("span",{className:`diff-status-glyph diff-status-${e.status.toLowerCase()}`,"aria-label":eD[e.status]??e.status,children:e.status}),h.jsxs("span",{className:"diff-file-name",children:[_&&h.jsx("span",{className:"diff-file-dir",children:_}),c]}),h.jsxs("span",{className:"diff-nums",children:[e.additions>0&&h.jsxs("span",{className:"diff-additions",children:["+",e.additions]}),e.deletions>0&&h.jsxs("span",{className:"diff-deletions",children:["−",e.deletions]})]})]})}const pg=new Set;let Sm={file:null};function iC(){for(const e of pg)e()}function iD(e){return pg.add(e),()=>{pg.delete(e)}}function Ay(){return Sm}function rD(e){const n=j.useSyncExternalStore(iD,Ay,Ay);return!n.file||n.file.theaterId!==e?null:n.file}function sD(e,n,r){Sm={file:{entry:e,section:n,theaterId:r}},iC()}function aD(){Sm={file:null},iC()}function oD(e){return e.split(`
212
+ `).map(n=>n.startsWith("@@")?{kind:"header",text:n}:n.startsWith("+")?{kind:"add",text:n}:n.startsWith("-")?{kind:"del",text:n}:{kind:"ctx",text:n})}function lD(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function cD({ctx:e,file:n,mode:r,ref:a}){const[o,g]=j.useState({kind:"loading"});if(j.useEffect(()=>{if(!e.theaterId){g({kind:"error",message:"no_theater"});return}let u=!1;return g({kind:"loading"}),e.api.fetch("diff","file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({theaterId:e.theaterId,filePath:n.path,mode:r,ref:a})}).then(async d=>{const b=await d.json();u||g({kind:"ok",result:b})}).catch(d=>{u||g({kind:"error",message:d instanceof Error?d.message:"unknown"})}),()=>{u=!0}},[e.api,n.path,r,a,e.theaterId]),o.kind==="loading")return h.jsx("div",{className:"diff-hunk-loading",children:"Loading…"});if(o.kind==="error")return h.jsx("div",{className:"diff-hunk-error",children:o.message});const{result:_}=o,c=oD(_.content);return h.jsxs("div",{className:"diff-hunk-wrap",children:[_.truncated&&h.jsx("div",{className:"diff-truncated-badge",children:"Diff truncated"}),h.jsx("div",{className:"diff-hunk-scroll",children:h.jsx("table",{className:"diff-hunk-table",cellSpacing:0,cellPadding:0,children:h.jsx("tbody",{children:c.map((u,d)=>h.jsx("tr",{className:`diff-line diff-line-${u.kind}`,children:h.jsx("td",{className:"diff-line-code",dangerouslySetInnerHTML:{__html:lD(u.text)}})},d))})})})]})}const rC="fleet-console.diff.viewMode",sC="fleet-console.diff.splitRatio",Ty=130,Ry=100,uD=.55;function hD(){try{const e=localStorage.getItem(rC);if(e==="list"||e==="tree")return e}catch{}return"list"}function dD(){try{const e=localStorage.getItem(sC);if(e!==null){const n=parseFloat(e);if(!isNaN(n)&&n>0&&n<1)return n}}catch{}return uD}function fD(e){return e.section==="staged"?"staged":e.entry.status==="U"?"untracked":"workdir"}function pD({ctx:e}){const[n,r]=j.useState(hD),a=rD(e.theaterId??null),[o,g]=j.useState(dD),_=j.useRef(o),c=j.useRef(null),[u,d]=j.useState(!1),b=j.useCallback((E,f)=>{e.theaterId&&sD(E,f,e.theaterId)},[e.theaterId]),p=j.useCallback(()=>{aD()},[]),w=j.useCallback(E=>{r(E);try{localStorage.setItem(rC,E)}catch{}},[]),C=j.useCallback(E=>{E.preventDefault();const f=c.current;if(!f)return;const y=f.getBoundingClientRect().width,m=E.clientX,S=_.current;d(!0);const k=R=>{const M=R.clientX-m,T=Ty/y,I=1-Ry/y,K=S+M/y,F=T<=I?Math.max(T,Math.min(I,K)):S;_.current=F,g(F)},L=()=>{document.removeEventListener("pointermove",k),document.removeEventListener("pointerup",L),d(!1);try{localStorage.setItem(sC,String(_.current))}catch{}};document.addEventListener("pointermove",k),document.addEventListener("pointerup",L)},[]),A=a?fD(a):"workdir";return h.jsxs("div",{ref:c,className:`diff-root${a?" has-hunk":""}${u?" is-dragging":""}`,style:a?{gridTemplateColumns:`minmax(${Ty}px, ${o}fr) 4px minmax(${Ry}px, ${1-o}fr)`}:void 0,children:[a&&h.jsxs("div",{className:"diff-hunk-pane",children:[h.jsxs("div",{className:"diff-hunk-head",children:[h.jsx("span",{className:"diff-hunk-filename",children:a.entry.path}),h.jsx("button",{type:"button",className:"diff-hunk-close","aria-label":"Close diff",onClick:p,children:"✕"})]}),h.jsx("div",{className:"diff-hunk-body",children:h.jsx(cD,{ctx:e,file:a.entry,mode:A})})]}),a&&h.jsx("div",{className:"diff-divider",onPointerDown:C,"aria-hidden":"true"}),h.jsxs("div",{className:"diff-tree-pane",children:[h.jsxs("div",{className:"diff-plugin-toolbar",children:[h.jsx("span",{className:"diff-toolbar-label",children:"Working tree"}),h.jsxs("div",{className:"diff-view-toggle",children:[h.jsx("button",{type:"button",className:`diff-toggle-btn${n==="list"?" is-active":""}`,title:"List view","aria-pressed":n==="list",onClick:()=>w("list"),children:h.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[h.jsx("line",{x1:"2",y1:"3.5",x2:"12",y2:"3.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),h.jsx("line",{x1:"2",y1:"7",x2:"12",y2:"7",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),h.jsx("line",{x1:"2",y1:"10.5",x2:"12",y2:"10.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}),h.jsx("button",{type:"button",className:`diff-toggle-btn${n==="tree"?" is-active":""}`,title:"Tree view","aria-pressed":n==="tree",onClick:()=>w("tree"),children:h.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[h.jsx("rect",{x:"1",y:"1",width:"4",height:"4",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),h.jsx("rect",{x:"9",y:"1",width:"4",height:"4",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),h.jsx("rect",{x:"1",y:"9",width:"4",height:"4",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),h.jsx("rect",{x:"9",y:"9",width:"4",height:"4",rx:"1",stroke:"currentColor",strokeWidth:"1.3"})]})})]})]}),h.jsx(tD,{ctx:e,viewMode:n,selectedPath:a?.entry.path??null,selectedSection:a?.section??null,onSelect:b})]})]})}function gD(){return h.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:[h.jsx("rect",{x:"2",y:"4",width:"6",height:"1.5",rx:"0.5",fill:"currentColor",opacity:"0.5"}),h.jsx("rect",{x:"2",y:"7",width:"10",height:"1.5",rx:"0.5",fill:"currentColor"}),h.jsx("rect",{x:"2",y:"10",width:"8",height:"1.5",rx:"0.5",fill:"currentColor",opacity:"0.5"}),h.jsx("rect",{x:"2",y:"13",width:"12",height:"1.5",rx:"0.5",fill:"currentColor"}),h.jsx("line",{x1:"14",y1:"2",x2:"14",y2:"16",stroke:"currentColor",strokeWidth:"1.2"}),h.jsx("polyline",{points:"12,4 14,2 16,4",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),h.jsx("polyline",{points:"12,14 14,16 16,14",stroke:"currentColor",strokeWidth:"1.2",fill:"none"})]})}const mD={id:"diff",title:"Diff",icon:()=>h.jsx(gD,{}),render:e=>h.jsx(pD,{ctx:e})},_D={id:"diff",railPanels:[mD]},vD=[_D],aC=[...Z6,...VO,...vD],bD=lC(aC),oC=j.createContext(bD),yD=oC.Provider;async function SD(){const e=[...aC],n=new Set(e.map(a=>a.id)),r=await wD();for(const a of r){if(n.has(a.id)){console.warn(`Skipping external plugin with duplicate id: ${a.id}`);continue}const o=await xD(a);if(o){if(n.has(o.id)){console.warn(`Skipping external plugin with duplicate id: ${o.id}`);continue}n.add(o.id),e.push(o)}}return lC(e)}function Zl(){return j.useContext(oC)}async function wD(){try{const e=await fetch("/plugin-runtime/manifest");if(!e.ok)return console.warn(`Plugin runtime manifest unavailable: ${e.status}`),[];const n=await e.json();return Array.isArray(n.plugins)?n.plugins.filter(ED):[]}catch(e){return console.warn("Plugin runtime manifest failed to load.",e),[]}}async function xD(e){try{const n=await import(e.clientUrl),r=n.default??n.plugin;return CD(r)?r:(console.warn(`Skipping external plugin with invalid client module: ${e.id}`),null)}catch(n){return console.warn(`Skipping external plugin after client load failure: ${e.id}`,n),null}}function lC(e){const n=new Set,r=[];for(const a of e)for(const o of a.railPanels??[]){if(n.has(o.id)){console.warn(`Skipping rail panel with duplicate id: ${o.id}`);continue}n.add(o.id),r.push(o)}return{plugins:e,operationKinds:e.flatMap(a=>a.operationKinds??[]),settingsSections:e.flatMap(a=>a.settingsSections??[]),notificationKinds:e.flatMap(a=>a.notificationKinds??[]),railPanels:r}}function CD(e){return typeof e=="object"&&e!==null&&typeof e.id=="string"}function ED(e){if(typeof e!="object"||e===null)return!1;const n=e;return typeof n.id=="string"&&typeof n.clientUrl=="string"&&Number.isInteger(n.apiVersion)}const kD=new Set(["token","credential","cwd","path","persona","prompt","toolAllowlist","allowedExecutorTools"]);async function cC(e){const n=await fetch("/api/v1/settings/carriers",{signal:e});return await xm(n),uC(await n.json(),n.status)}async function AD(e){const n=await fetch("/api/v1/settings/carriers/options",{signal:e});return await xm(n),LD(await n.json(),n.status)}async function Sl(e,n,r){return wm(`/api/v1/settings/carriers/${encodeURIComponent(e)}`,"PATCH",n,r)}async function TD(e,n,r,a){return wm(`/api/v1/settings/carriers/${encodeURIComponent(e)}/taskforce/${encodeURIComponent(n)}`,"PUT",r,a)}async function RD(e,n,r){return wm(`/api/v1/settings/carriers/${encodeURIComponent(e)}/taskforce/${encodeURIComponent(n)}`,"DELETE",{},r)}async function wm(e,n,r,a){const o=await fetch(e,{method:n,headers:{"Content-Type":"application/json"},body:JSON.stringify(r),signal:a});await xm(o);const g=await o.json();if(!g||typeof g!="object"||!("state"in g))throw new ct(o.status,"Invalid carrier settings mutation response");return{state:uC(g.state,o.status)}}async function xm(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 ct(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 ct(n,"Invalid carrier settings state response");return{generation:r.generation,carriers:r.carriers.map(a=>MD(a,n))}}function LD(e,n){hC(e,n);const r=e;if(!r||!Array.isArray(r.cliTypes)||!r.taskForceConstraints||typeof r.taskForceConstraints.minBackends!="number")throw new ct(n,"Invalid carrier settings options response");return{cliTypes:r.cliTypes.map(a=>ND(a,n)),taskForceConstraints:{minBackends:r.taskForceConstraints.minBackends}}}function MD(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 ct(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=>DD(a,n))}}}function ND(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 ct(n,"Invalid carrier settings CLI option");return{id:r.id,displayName:r.displayName,supportsSubagent:r.supportsSubagent,models:r.models.map(a=>OD(a,n)),defaultModel:r.defaultModel}}function OD(e,n){const r=e;if(!r||typeof r.modelId!="string"||typeof r.name!="string")throw new ct(n,"Invalid carrier settings model option");if(r.effort!==void 0&&(!Array.isArray(r.effort.levels)||typeof r.effort.default!="string"))throw new ct(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 DD(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 ct(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,g]of Object.entries(a)){if(kD.has(o))throw new ct(n,"Carrier settings response leaked a restricted field");g&&typeof g=="object"&&r.push(g)}}}const BD={cliType:"",model:"",effort:"",displayName:"",agentMode:"cli",taskforce:{}},gg=new Set;let In={loading:!1,state:null,options:null,activeCarrierId:null,draft:BD,savingActionId:null,error:null};function dC(){return j.useSyncExternalStore(jD,Ly,Ly)}function Ly(){return In}function jD(e){return gg.add(e),()=>{gg.delete(e)}}async function My(e){or({loading:!0,error:null});try{const[n,r]=await Promise.all([cC(e),AD(e)]);fC(n,r)}catch(n){if(e?.aborted)return;or({loading:!1,error:gC(n)})}}function ID(e){const n=In.state?.carriers.find(r=>r.carrierId===e);or({activeCarrierId:e,draft:n?Cm(n,In.options):In.draft,error:null})}function qs(e){or({draft:{...In.draft,...e},error:null})}function mg(e,n){const r=In.draft.taskforce[e]??{model:"",effort:""};or({draft:{...In.draft,taskforce:{...In.draft.taskforce,[e]:{...r,...n}}},error:null})}function PD(){const e=pC();e&&or({draft:Cm(e,In.options),error:null})}async function zD(e){const n=pC();return n?HD("save-all",async()=>{const r=In.draft;let a=null;r.displayName!==n.displayName&&(a=(await Sl(n.carrierId,{displayName:r.displayName})).state);const o=r.cliType!==n.cliType;return o&&(a=(await Sl(n.carrierId,{cli:r.cliType})).state),(o||r.model!==n.model||(r.effort||"")!==(n.effort||""))&&(a=(await Sl(n.carrierId,{model:UD(r)})).state),r.agentMode==="subagent"?(n.agentMode!=="subagent"||n.taskForceBackendCount>0)&&(a=(await Sl(n.carrierId,{agentMode:"subagent"})).state):(n.agentMode!=="cli"&&(a=(await Sl(n.carrierId,{agentMode:"cli"})).state),a=await FD(n,e,a)),{state:a??await cC()}}):!1}function fC(e,n){const r=WD(e,In.activeCarrierId),a=e.carriers.find(o=>o.carrierId===r)??null;or({loading:!1,state:e,options:n,activeCarrierId:r,draft:a?Cm(a,n):In.draft,error:null})}async function HD(e,n){or({savingActionId:e,error:null});try{const r=await n();return fC(r.state,In.options??{cliTypes:[],taskForceConstraints:{minBackends:2}}),or({savingActionId:null}),!0}catch(r){return or({savingActionId:null,error:gC(r)}),!1}}function Cm(e,n){const r=Object.fromEntries((n?.cliTypes??[]).map(a=>{const o=e.taskforce.backends.find(g=>g.cliType===a.id);return[a.id,{model:o?.model??a.defaultModel,effort:o?.effort??$D(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 $D(e,n,r){return r?.cliTypes.find(g=>g.id===e)?.models.find(g=>g.modelId===n)?.effort?.default??null}function UD(e){return{model:e.model,...e.effort?{effort:e.effort}:{}}}function pC(){return In.state?.carriers.find(e=>e.carrierId===In.activeCarrierId)??null}async function FD(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 RD(e.carrierId,o.cliType)).state);for(const o of n){const g=e.taskforce.backends.find(_=>_.cliType===o.cliType);g&&g.model===o.model&&(g.effort||"")===(o.effort||"")||(r=(await TD(e.carrierId,o.cliType,{model:o.model,...o.effort?{effort:o.effort}:{}})).state)}return r}function WD(e,n){return n&&e.carriers.some(r=>r.carrierId===n)?n:e.carriers[0]?.carrierId??null}function or(e){In={...In,...e};for(const n of gg)n()}function gC(e){return e instanceof Error?e.message:String(e)}const GD=50,qD=2400,KD={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 VD(){const e=dC(),n=e.state?.carriers.find(m=>m.carrierId===e.activeCarrierId)??null,r=e.options?.cliTypes.find(m=>m.id===e.draft.cliType)??null,a=r?.models.find(m=>m.modelId===e.draft.model)??null,[o,g]=j.useState(!1),[_,c]=j.useState([]),[u,d]=j.useState("idle"),b=_.length>0,p=e.draft.agentMode==="subagent",w=e.draft.agentMode==="subagent",C=e.savingActionId==="save-all",A=n?e8(n,e.draft,_):!1,E=n?.taskforce.backends.map(m=>`${m.cliType}:${m.model}:${m.effort??""}`).join("|")??"";j.useEffect(()=>{const m=new AbortController;return My(m.signal),()=>m.abort()},[]),j.useEffect(()=>{g(!1),c(n?.taskforce.backends.map(m=>m.cliType)??[]),d("idle")},[n?.carrierId,E]),j.useEffect(()=>{if(u!=="saved")return;const m=window.setTimeout(()=>d("idle"),qD);return()=>window.clearTimeout(m)},[u]);function f(){n&&(PD(),c(n.taskforce.backends.map(m=>m.cliType)),g(!1),d("idle"))}async function y(){if(!n)return;if(d("saving"),!await zD(n8(_,e.draft.taskforce))){d("idle");return}g(!1),d("saved")}return h.jsxs("main",{className:"carrier-settings-page",children:[h.jsxs("section",{className:"carrier-settings-hero","aria-labelledby":"carrier-settings-title",children:[h.jsxs("div",{children:[h.jsx("p",{className:"bridge-kicker",children:"Carrier Control Surface"}),h.jsx("h2",{id:"carrier-settings-title",children:"Carrier Settings"})]}),h.jsxs("div",{className:"carrier-settings-hero-actions",children:[h.jsx("div",{className:`carrier-settings-save-status ${u==="saved"?"is-positive":""}`,role:"status","aria-live":"polite",children:u==="saving"||C?"Saving…":u==="saved"?"Saved ✓":""}),n?h.jsxs("div",{className:"carrier-settings-save-actions",children:[h.jsx("button",{type:"button",className:`carrier-settings-action-button ${A?"is-dirty":""}`,disabled:!A||C,onClick:()=>{y()},children:"Save"}),h.jsx("button",{type:"button",className:`carrier-settings-action-button ${A?"is-dirty":""}`,disabled:!A||C,onClick:f,children:"Discard"})]}):null,h.jsx("button",{type:"button",className:"carrier-settings-action-button carrier-settings-hero-refresh",disabled:e.loading,onClick:()=>{My()},children:"Refresh"})]})]}),e.error?h.jsx("p",{className:"carrier-settings-error",role:"alert",children:e.error}):null,h.jsxs("section",{className:"carrier-settings-grid",children:[h.jsxs("div",{className:"carrier-settings-list","aria-label":"Carrier list",children:[e.loading&&!e.state?h.jsx("p",{className:"carrier-settings-empty",children:"Loading carrier settings."}):null,e.state&&e.state.carriers.length===0?h.jsx("p",{className:"carrier-settings-empty",children:"No carriers registered."}):null,e.state?.carriers.map(m=>h.jsx(YD,{carrier:m,active:m.carrierId===e.activeCarrierId,minBackends:e.options?.taskForceConstraints.minBackends??2,onSelect:()=>ID(m.carrierId)},m.carrierId))]}),n&&e.options&&r?h.jsxs("div",{className:"carrier-settings-detail",style:vC(n.carrierId),children:[h.jsxs("div",{className:"carrier-settings-detail-head",children:[h.jsxs("div",{className:"carrier-settings-detail-title-block",children:[h.jsxs("div",{className:"carrier-settings-captain-id",children:[h.jsx("span",{children:"Captain"})," · ",n.carrierId.toUpperCase()]}),h.jsx("div",{className:`carrier-settings-name-line ${o?"is-editing":""}`,children:o?h.jsxs(h.Fragment,{children:[h.jsx("input",{id:"carrier-display-name",className:"carrier-settings-input carrier-settings-name-input",value:e.draft.displayName,maxLength:GD,onChange:m=>qs({displayName:m.target.value})}),h.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Save display name",disabled:C,onClick:()=>{g(!1)},children:h.jsx(r8,{})}),h.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Cancel display name edit",onClick:()=>{qs({displayName:n.displayName}),g(!1)},children:h.jsx(s8,{})})]}):h.jsxs(h.Fragment,{children:[h.jsx("h3",{className:"carrier-settings-captain-name",children:n.displayName}),h.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Edit display name",onClick:()=>{qs({displayName:n.displayName}),g(!0)},children:h.jsx(i8,{})})]})}),h.jsx("div",{className:"carrier-settings-captain-role",children:n.role})]}),h.jsxs("div",{className:"carrier-settings-cli-badge",children:[h.jsx("span",{className:"ind","aria-hidden":"true"}),n.cliType]})]}),h.jsxs("div",{className:"carrier-settings-body",children:[h.jsxs("div",{className:"carrier-settings-control-group",children:[h.jsx("div",{className:"carrier-settings-resp-title",children:"Identity"}),h.jsxs("div",{className:"carrier-settings-mission",children:['"',n.roleDescription,'"']})]}),h.jsxs("div",{className:"carrier-settings-control-group",children:[h.jsx("div",{className:"carrier-settings-resp-title",children:"Runtime"}),h.jsxs("div",{className:"carrier-settings-runtime",children:[h.jsx("div",{className:"carrier-settings-runtime-row carrier-settings-runtime-row--cli",children:h.jsxs("div",{className:"carrier-settings-field carrier-settings-field--wide",children:[h.jsx("label",{className:"carrier-settings-label",htmlFor:"carrier-cli",children:"CLI"}),h.jsx("select",{id:"carrier-cli",className:"carrier-settings-select",value:e.draft.cliType,onChange:m=>ZD(m.target.value,e.options?.cliTypes??[]),children:e.options.cliTypes.map(m=>h.jsx("option",{value:m.id,children:m.displayName},m.id))})]})}),h.jsxs("div",{className:"carrier-settings-runtime-row carrier-settings-runtime-row--model",children:[h.jsx(mC,{id:"carrier-model",label:"Model",models:r.models,value:e.draft.model,onChange:m=>JD(r,m)}),h.jsx(_C,{id:"carrier-effort",model:a,value:e.draft.effort,onChange:m=>qs({effort:m})})]})]})]}),h.jsx("div",{className:"carrier-settings-control-group",children:h.jsxs("div",{className:"carrier-settings-toggle-row",children:[h.jsxs("div",{children:[h.jsx("p",{className:"carrier-settings-resp-title",children:"SubAgent"}),h.jsx("p",{className:"carrier-settings-help",children:b?"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."})]}),h.jsx("button",{type:"button",className:`carrier-settings-toggle ${p?"is-on":""}`,disabled:C||!p&&(!r.supportsSubagent||b),"aria-pressed":p,onClick:()=>qs({agentMode:p?"cli":"subagent"}),children:h.jsx("span",{children:p?"On":"Off"})})]})}),h.jsx(XD,{carrier:n,cliOptions:e.options.cliTypes,minBackends:e.options.taskForceConstraints.minBackends,savingActionId:e.savingActionId,rows:_,disabled:w,onRowsChange:c})]})]},n.carrierId):h.jsx("div",{className:"carrier-settings-detail",children:h.jsx("p",{className:"carrier-settings-empty",children:"Select a carrier."})})]})]})}function YD({carrier:e,active:n,minBackends:r,onSelect:a}){const o=e.taskForceBackendCount>=r;return h.jsxs("button",{type:"button",className:`carrier-settings-row ${n?"is-active":""}`,style:vC(e.carrierId),onClick:a,children:[h.jsx("span",{className:"carrier-settings-captain-dot","aria-hidden":"true"}),h.jsxs("span",{className:"carrier-settings-row-text",children:[h.jsx("span",{className:"carrier-settings-row-name",children:e.displayName}),h.jsx("span",{className:"carrier-settings-row-role",children:e.role})]}),h.jsxs("span",{className:"carrier-settings-row-live","aria-hidden":"true",children:[h.jsx("span",{className:`carrier-settings-live-dot ${e.subagentMode?"is-live":""}`}),h.jsx("span",{className:`carrier-settings-live-dot ${o?"is-live":""}`})]})]})}function mC({id:e,label:n,models:r,value:a,disabled:o=!1,onChange:g}){return h.jsxs("div",{className:"carrier-settings-field",children:[h.jsx("label",{className:"carrier-settings-label",htmlFor:e,children:n}),h.jsx("select",{id:e,className:"carrier-settings-select",value:a,disabled:o,onChange:_=>g(_.target.value),children:r.map(_=>h.jsx("option",{value:_.modelId,children:_.name},_.modelId))})]})}function _C({id:e,model:n,value:r,disabled:a=!1,onChange:o}){return n?.effort?h.jsxs("div",{className:"carrier-settings-field",children:[h.jsx("label",{className:"carrier-settings-label",htmlFor:e,children:"Effort"}),h.jsx("select",{id:e,className:"carrier-settings-select",value:r||n.effort.default,disabled:a,onChange:g=>o(g.target.value),children:n.effort.levels.map(g=>h.jsx("option",{value:g,children:g},g))})]}):h.jsxs("div",{className:"carrier-settings-field",children:[h.jsx("span",{className:"carrier-settings-label",children:"Effort"}),h.jsx("p",{className:"carrier-settings-help",children:"Not supported for this model."})]})}function XD({carrier:e,cliOptions:n,minBackends:r,savingActionId:a,rows:o,disabled:g,onRowsChange:_}){const c=dC(),u=e.taskforce.backends.length,[d,b]=j.useState(u>0),[p,w]=j.useState(!1),[C,A]=j.useState(""),E=e.taskForceBackendCount>=r,f=n.filter(m=>!o.includes(m.id)),y=C||f[0]?.id||"";return h.jsxs("div",{className:`carrier-settings-control-group carrier-settings-control-group--taskforce ${d?"is-expanded":""} ${g?"is-disabled":""}`,children:[h.jsxs("div",{className:"carrier-settings-section-head",children:[h.jsxs("div",{children:[h.jsx("p",{className:"carrier-settings-resp-title",children:"Task Force"}),h.jsx("p",{className:"carrier-settings-help",children:g?"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.`})]}),h.jsx("div",{className:"carrier-settings-tf-head-actions",children:h.jsx("button",{type:"button",className:"carrier-settings-tf-toggle","aria-expanded":d,onClick:()=>b(m=>!m),children:d?"Hide":"Configure"})})]}),d?h.jsxs("div",{className:"carrier-settings-tf-list",children:[o.length===0?h.jsx("p",{className:"carrier-settings-tf-empty",children:"No Task Force backend drafted."}):null,o.map(m=>{const S=n.find(M=>M.id===m);if(!S)return null;const k=c.draft.taskforce[S.id]??{model:S.defaultModel,effort:""},L=S.models.find(M=>M.modelId===k.model)??S.models[0]??null,R=e.taskforce.backends.some(M=>M.cliType===S.id);return h.jsxs("div",{className:`carrier-settings-tf-item ${R?"is-active":""}`,children:[h.jsxs("div",{className:"carrier-settings-tf-title",children:[h.jsx("span",{className:`carrier-settings-live-dot ${R?"is-live":""}`,"aria-hidden":"true"}),h.jsx("strong",{children:S.displayName})]}),h.jsx(mC,{id:`tf-${S.id}-model`,label:"Model",models:S.models,value:k.model,disabled:g,onChange:M=>QD(S,M)}),h.jsx(_C,{id:`tf-${S.id}-effort`,model:L,value:k.effort,disabled:g,onChange:M=>mg(S.id,{effort:M})}),h.jsx("div",{className:"carrier-settings-tf-actions",children:h.jsx("button",{type:"button",className:"carrier-settings-ghost-button",disabled:g||a==="save-all",onClick:()=>_(o.filter(M=>M!==S.id)),children:"Remove"})})]},S.id)}),h.jsxs("div",{className:"carrier-settings-tf-add-row",children:[p&&f.length>0?h.jsx("select",{className:"carrier-settings-select carrier-settings-tf-add-select",value:y,onChange:m=>A(m.target.value),"aria-label":"Task Force CLI to add",children:f.map(m=>h.jsx("option",{value:m.id,children:m.displayName},m.id))}):null,h.jsx("button",{type:"button",className:"carrier-settings-ghost-button",disabled:g||f.length===0||a==="save-all",onClick:()=>{if(!p){w(!0);return}const m=y,S=n.find(L=>L.id===m),k=S?.models.find(L=>L.modelId===S.defaultModel)??S?.models[0]??null;!S||!k||(mg(S.id,{model:k.modelId,effort:k.effort?.default??""}),_(o.includes(S.id)?o:[...o,S.id]),A(""),w(!1))},children:"Add"})]})]}):null]})}function ZD(e,n){const r=n.find(g=>g.id===e),a=r?.models.find(g=>g.modelId===r.defaultModel)??r?.models[0]??null,o={cliType:e,model:a?.modelId??"",effort:a?.effort?.default??""};r?.supportsSubagent||(o.agentMode="cli"),qs(o)}function JD(e,n){const r=e.models.find(a=>a.modelId===n);qs({model:n,effort:r?.effort?.default??""})}function QD(e,n){const r=e.models.find(a=>a.modelId===n);mg(e.id,{model:n,effort:r?.effort?.default??""})}function e8(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:t8(e,r,n.taskforce)}function t8(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 g=r[o.cliType];if(!g||g.model!==o.model||(g.effort||"")!==(o.effort||""))return!0}return!1}function n8(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":KD[e]??"var(--brass)"}}function i8(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[h.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"}),h.jsx("path",{d:"M9.7 3.4 12.6 6.3"})]})}function r8(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:h.jsx("path",{d:"M3 8.3 6.4 11.7 13.2 4.5"})})}function s8(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[h.jsx("path",{d:"M4.2 4.2 11.8 11.8"}),h.jsx("path",{d:"M11.8 4.2 4.2 11.8"})]})}async function a8(e){const n=await fetch("/api/v1/settings/api-catalog",{signal:e});return await o8(n),l8(await n.json(),n.status).routes}async function o8(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 ct(e.status,n)}function l8(e,n){const r=e;if(!r||typeof r!="object"||!("version"in r)||!Array.isArray(r.routes))throw new ct(n,"Invalid backend API catalog response");return{routes:r.routes.map(a=>c8(a,n))}}function c8(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 ct(n,"Invalid backend API catalog entry");return{method:r.method,path:r.path,summary:r.summary,category:r.category,gate:r.gate}}const _g=new Set;let vg={loading:!1,state:null,error:null};function u8(){return j.useSyncExternalStore(h8,Ny,Ny)}function Ny(){return vg}function h8(e){return _g.add(e),()=>{_g.delete(e)}}async function d8(e){up({loading:!0,error:null});try{const n=await a8(e);up({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;up({loading:!1,error:f8(n)})}}function up(e){vg={...vg,...e};for(const n of _g)n()}function f8(e){return e instanceof Error?e.message:String(e)}function p8(){const e=u8(),[n,r]=j.useState(!0),a=j.useMemo(()=>_8(e.state??[]),[e.state]),o=e.state?.length??0,g=a.length;return j.useEffect(()=>{const _=new AbortController;return d8(_.signal),()=>_.abort()},[]),h.jsxs("section",{className:"global-settings-card backend-api-section","aria-label":"Backend API catalog",children:[h.jsx("div",{className:`backend-api-control carrier-settings-control-group--taskforce ${n?"is-expanded":""}`,children:h.jsxs("div",{className:"carrier-settings-section-head",children:[h.jsxs("div",{className:"backend-api-head",children:[h.jsx("p",{className:"global-settings-resp-title",children:"Backend API"}),h.jsx("p",{className:"global-settings-help",children:o>0?`${o} loopback route${o===1?"":"s"} across ${g} categor${g===1?"y":"ies"} reported by backend introspection.`:"Backend introspection route list for this console."})]}),h.jsx("div",{className:"carrier-settings-tf-head-actions",children:h.jsx("button",{type:"button",className:"carrier-settings-tf-toggle","aria-expanded":n,onClick:()=>r(_=>!_),children:n?"Hide":"Show"})})]})}),e.error?h.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,e.loading&&!e.state?h.jsx("p",{className:"global-settings-help",children:"Loading backend API catalog."}):null,n?h.jsxs("div",{className:"backend-api-groups",children:[a.length>0?a.map(_=>h.jsx(g8,{group:_},_.category)):null,e.state&&a.length===0?h.jsx("p",{className:"global-settings-help",children:"No backend API routes reported."}):null]}):null,h.jsx("p",{className:"global-settings-foot",children:"Console backend routes are fetched from GET /api/v1/settings/api-catalog, so newly registered routes appear here automatically. The Codex/Fleet Wiki API surface is not included."})]})}function g8({group:e}){return h.jsxs("div",{className:"backend-api-group",children:[h.jsxs("div",{className:"backend-api-group-head",children:[h.jsx("span",{children:e.category}),h.jsx("span",{children:e.entries.length})]}),h.jsx("div",{className:"backend-api-list",children:e.entries.map(n=>h.jsx(m8,{entry:n},`${n.method}:${n.path}`))})]})}function m8({entry:e}){return h.jsxs("div",{className:"backend-api-row",children:[h.jsx("span",{className:"backend-api-method",children:e.method.toUpperCase()}),h.jsx("code",{className:"backend-api-path",children:e.path}),h.jsx("span",{className:"backend-api-summary",children:e.summary}),h.jsx("span",{className:"backend-api-gate",children:e.gate})]})}function _8(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 bC(e){const n=await fetch("/api/v1/settings/global",{signal:e});return await yC(n),SC(await n.json(),n.status)}async function v8(e,n){const r=await fetch("/api/v1/settings/global",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:n});await yC(r);const a=await r.json();if(!a||typeof a!="object"||!("state"in a))throw new ct(r.status,"Invalid global settings mutation response");return{state:SC(a.state,r.status)}}async function yC(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 ct(e.status,n)}function SC(e,n){const r=e;if(!r||r.consolePortMode!=="dynamic"&&r.consolePortMode!=="static"||r.consoleStaticPort!==null&&!b8(r.consoleStaticPort)||r.theme!=="maritime"&&r.theme!=="carbon")throw new ct(n,"Invalid global settings state response");return{consolePortMode:r.consolePortMode,consoleStaticPort:r.consoleStaticPort,theme:r.theme}}function b8(e){return typeof e=="number"&&Number.isInteger(e)&&e>=1024&&e<=65535}const bg=new Set;let yg={loading:!1,state:null,savingField:null,error:null};function y8(){return j.useSyncExternalStore(S8,Oy,Oy)}function Oy(){return yg}function S8(e){return bg.add(e),()=>{bg.delete(e)}}async function w8(e){ro({loading:!0,error:null});try{const n=await bC(e);ro({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;ro({loading:!1,error:wC(n)})}}async function Sg(e,n){ro({savingField:e,error:null});try{const r=await v8({[e]:n});return ro({state:r.state,savingField:null,error:null}),!0}catch(r){return ro({savingField:null,error:wC(r)}),!1}}function ro(e){yg={...yg,...e};for(const n of bg)n()}function wC(e){return e instanceof Error?e.message:String(e)}const x8=[{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)"]}],C8=[{id:"dynamic",label:"Dynamic"},{id:"static",label:"Static"}],E8=1024,k8=65535,A8=[{id:"general",label:"General",eyebrow:"Theme · Port"},{id:"backend-api",label:"Backend API",eyebrow:"Loopback routes"}];function T8(){const e=y8(),n=e.state,r=e.savingField!==null,[a,o]=j.useState("general"),g=Zl(),_=L8(g.plugins),c=M8(_);return j.useEffect(()=>{const u=new AbortController;return w8(u.signal),()=>u.abort()},[]),h.jsxs("main",{className:"global-settings-page",children:[h.jsxs("section",{className:"global-settings-hero","aria-labelledby":"global-settings-title",children:[h.jsxs("div",{children:[h.jsx("p",{className:"bridge-kicker",children:"Fleet Control Surface"}),h.jsx("h2",{id:"global-settings-title",children:"Settings"})]}),h.jsx("div",{className:"global-settings-status",role:"status","aria-live":"polite",children:r?"Saving…":""})]}),e.error?h.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,h.jsxs("section",{className:"global-settings-grid",children:[h.jsxs("div",{className:"global-settings-list","aria-label":"Settings sections",children:[h.jsx("p",{className:"global-settings-nav-group",children:"Console"}),A8.map(u=>h.jsxs("button",{type:"button",className:`global-settings-nav-item ${u.id===a?"is-active":""}`,"aria-pressed":u.id===a,onClick:()=>o(u.id),children:[h.jsx("span",{className:"global-settings-nav-label",children:u.label}),h.jsx("span",{className:"global-settings-nav-eyebrow",children:u.eyebrow})]},u.id)),_.length>0?h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"global-settings-nav-group",children:"Plugins"}),c.map(u=>h.jsxs("div",{className:"global-settings-plugin-group",children:[h.jsx("p",{className:"global-settings-plugin-heading",children:u.pluginLabel}),u.sections.map(d=>h.jsxs("button",{type:"button",className:`global-settings-nav-item ${d.id===a?"is-active":""}`,"aria-pressed":d.id===a,onClick:()=>o(d.id),children:[h.jsx("span",{className:"global-settings-nav-label",children:d.sectionTitle}),h.jsx("span",{className:"global-settings-nav-eyebrow",children:d.pluginLabel})]},d.id))]},u.pluginId))]}):null]}),h.jsx("div",{className:"global-settings-detail",children:R8(a,n,r,_)},a)]})]})}function R8(e,n,r,a){if(e.includes(":")){const o=a.find(g=>g.id===e);return o?.render?h.jsx(Og,{fallback:h.jsx("div",{className:"fc-plugin-error",children:"Plugin settings failed to render."}),children:o.render()}):h.jsx("p",{className:"global-settings-help",children:"Plugin settings unavailable."})}switch(e){case"general":return h.jsxs(h.Fragment,{children:[h.jsx(O8,{}),h.jsx(D8,{state:n,saving:r})]});case"backend-api":return h.jsx(p8,{})}}function L8(e){return e.flatMap(n=>(n.settingsSections??[]).map(r=>({id:`${n.id}:${r.id}`,pluginId:n.id,pluginLabel:N8(n.id),sectionTitle:r.title,render:r.render})))}function M8(e){const n=[];for(const r of e){const a=n.at(-1);if(a?.pluginId===r.pluginId){n[n.length-1]={...a,sections:[...a.sections,r]};continue}n.push({pluginId:r.pluginId,pluginLabel:r.pluginLabel,sections:[r]})}return n}function N8(e){return e==="terminal"?"Terminal":e.split(/[-_]/g).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")||e}function O8(){const{activeTheme:e}=Hr();return h.jsxs("section",{className:"global-settings-card","aria-label":"Theme",children:[h.jsxs("div",{className:"global-settings-row",children:[h.jsxs("div",{className:"global-settings-row-text",children:[h.jsx("p",{className:"global-settings-resp-title",children:"Theme"}),h.jsx("p",{className:"global-settings-help",children:"Console color scheme. Applies immediately and is saved server-side."})]}),h.jsx("div",{className:"theme-picker",role:"group","aria-label":"Theme",children:x8.map(n=>{const r=n.id===e;return h.jsxs("button",{type:"button","aria-pressed":r,className:`theme-card ${r?"is-active":""}`,onClick:()=>{nw(n.id),Sg("theme",n.id)},children:[h.jsx("span",{className:"theme-card-swatch","aria-hidden":"true",children:n.swatch.map(a=>h.jsx("i",{style:{background:a}},a))}),h.jsx("span",{className:"theme-card-label",children:n.label}),h.jsx("span",{className:"theme-card-check","aria-hidden":"true",children:r?h.jsx(j8,{}):null})]},n.id)})})]}),h.jsx("p",{className:"global-settings-foot",children:"Theme applies immediately and is stored server-side."})]})}function D8({state:e,saving:n}){const r=Hr();return h.jsxs("section",{className:"global-settings-card","aria-label":"General",children:[e?h.jsx(h.Fragment,{children:h.jsx(B8,{state:e,saving:n,consoleState:r})}):h.jsx("p",{className:"global-settings-help",children:"Loading settings."}),h.jsx("p",{className:"global-settings-foot",children:"Changes apply to newly launched sessions. Running sessions keep their current configuration until relaunched."})]})}function B8({state:e,saving:n,consoleState:r}){const[a,o]=j.useState(e.consoleStaticPort?.toString()??""),g=r.effectivePort,_=r.portMode==="static"&&!r.portHonored,c=r.requestedPort,u=e.consolePortMode==="static"&&e.consoleStaticPort!==null,d=a.trim(),b=Number(d),p=d.length>0,w=p&&Dy(b),C=e.consolePortMode==="static"&&p&&!w;return j.useEffect(()=>{o(e.consoleStaticPort?.toString()??"")},[e.consoleStaticPort]),h.jsxs("div",{className:"global-settings-row is-stack console-port-row",children:[h.jsxs("div",{className:"global-settings-row-text",children:[h.jsxs("p",{className:"global-settings-resp-title",children:["Console Port ",h.jsx("span",{className:"new-badge",children:"New"})]}),h.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."})]}),h.jsxs("div",{className:"console-port-control",children:[h.jsx("div",{className:"segmented",role:"group","aria-label":"Console port mode",children:C8.map(A=>{const E=e.consolePortMode===A.id;return h.jsx("button",{type:"button","aria-pressed":E,className:`segmented-option ${E?"is-active":""}`,disabled:n,onClick:()=>{Sg("consolePortMode",A.id)},children:A.label},A.id)})}),h.jsx("div",{className:`console-port-reveal ${e.consolePortMode==="static"?"is-open":""}`,children:h.jsxs("div",{className:"console-port-reveal-inner",children:[h.jsx("label",{className:"console-port-input-label",htmlFor:"console-static-port-input",children:"Static port"}),h.jsx("input",{id:"console-static-port-input",className:`console-port-input ${C?"is-invalid":""}`,inputMode:"numeric",placeholder:"8080",value:a,disabled:n,"aria-invalid":C,"aria-describedby":"console-static-port-hint",onChange:A=>{const E=A.target.value;o(E);const f=Number(E.trim());Dy(f)&&Sg("consoleStaticPort",f)}}),h.jsx("span",{id:"console-static-port-hint",className:`console-port-hint ${C?"is-invalid":""}`,children:"1024–65535"})]})}),h.jsxs("div",{className:`console-port-effective ${_?"is-fallback":""}`,"aria-live":"polite",children:[h.jsx("span",{className:"console-port-effective-dot","aria-hidden":"true"}),h.jsxs("div",{children:[h.jsx("p",{className:"console-port-effective-label",children:"Currently reachable on"}),h.jsxs("p",{className:"console-port-effective-value",children:["127.0.0.1:",h.jsx("span",{children:g||"..."}),_?" · Dynamic":""]})]})]}),_&&c?h.jsxs("div",{className:"console-port-warning",role:"status",children:["Port ",h.jsx("strong",{children:c})," was unavailable — the console fell back to a ",h.jsx("strong",{children:"Dynamic"})," port and is running on ",h.jsxs("strong",{children:["127.0.0.1:",g||"..."]}),"."," ",u?h.jsxs(h.Fragment,{children:["Next restart will try ",h.jsx("strong",{children:e.consoleStaticPort}),"."]}):h.jsx(h.Fragment,{children:"Next restart will use a dynamic port."})]}):null,h.jsx("p",{className:"console-port-note",children:"Applies when the console restarts. Console-wide — shared across every browser."})]})]})}function Dy(e){return Number.isInteger(e)&&e>=E8&&e<=k8}function j8(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.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 I8(e,n){return{x:e.x*n.zoom+n.x,y:e.y*n.zoom+n.y}}function Fl(e,n){return{x:(e.x-n.x)/n.zoom,y:(e.y-n.y)/n.zoom}}function P8(e,n){return{...I8(e,n),width:e.width*n.zoom,height:e.height*n.zoom}}const z8=[{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:"Focus the previous / next Operation"},{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 an Operation from its title bar; rename from its name"},{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"}]}],H8=288,$8=520,wl=12,gs=[{id:"operations",label:"Operations"},{id:"map",label:"Map"},{id:"help",label:"Help"}],U8=/mac|iphone|ipad|ipod/i;function Bu({anchor:e,viewportBounds:n,placement:r="cursor",mode:a="full",catalog:o,canLaunch:g,mapFullscreen:_,radarEnabled:c,perimeterEnabled:u,renderKindIcon:d,onLaunchKind:b,onResetView:p,onMaximizeMap:w,onToggleRadar:C,onTogglePerimeter:A,onClose:E}){const f=j.useRef(null),y=j.useRef(null),m=j.useRef({operations:null,map:null,help:null}),[S,k]=j.useState(a==="controls"?"map":"operations"),L=G8(),R=a==="full",M=a==="full"||a==="launch",T=a==="full"||a==="controls";j.useEffect(()=>{const F=B=>{f.current?.contains(B.target)||E()},G=B=>{B.key==="Escape"&&E()};return document.addEventListener("mousedown",F),document.addEventListener("keydown",G),()=>{document.removeEventListener("mousedown",F),document.removeEventListener("keydown",G)}},[E]),j.useEffect(()=>{y.current?.focus()},[]);const I=(F,G=!1)=>{k(F),G&&window.requestAnimationFrame(()=>m.current[F]?.focus())},K=F=>{const G=gs.findIndex(Y=>Y.id===S),B=gs.length-1;if(F.key==="ArrowRight"||F.key==="ArrowLeft"){F.preventDefault();const Y=F.key==="ArrowRight"?1:-1,X=gs[(G+Y+gs.length)%gs.length];I(X.id,!0)}else F.key==="Home"?(F.preventDefault(),I(gs[0].id,!0)):F.key==="End"&&(F.preventDefault(),I(gs[B].id,!0))};return h.jsx("div",{className:`operation-launch-control operation-launch-control--canvas ${r==="above"?"operation-launch-control--up":""}`,ref:f,style:W8(e,n,r),"data-canvas-blocker":!0,children:h.jsxs("div",{className:"operation-launch-menu theater-menu canvas-context-menu",role:"dialog","aria-label":"Operations Control",tabIndex:-1,ref:y,children:[h.jsxs("div",{className:"canvas-context-menu-head",children:[h.jsx("span",{className:"canvas-context-menu-reticle","aria-hidden":"true",children:h.jsx(F8,{})}),h.jsx("span",{className:"canvas-context-menu-head-text",children:h.jsx("strong",{children:"Operations Control"})})]}),R?h.jsx("div",{className:"canvas-context-menu-tabs",role:"tablist","aria-label":"Operations Control sections",children:gs.map(F=>h.jsx("button",{ref:G=>{m.current[F.id]=G},type:"button",id:`canvas-control-tab-${F.id}`,className:"canvas-context-menu-tab",role:"tab","aria-selected":S===F.id,"aria-controls":`canvas-control-panel-${F.id}`,tabIndex:S===F.id?0:-1,onClick:()=>I(F.id),onKeyDown:K,children:F.label},F.id))}):null,M?h.jsxs("div",{id:"canvas-control-panel-operations",role:"tabpanel","aria-labelledby":"canvas-control-tab-operations",className:"canvas-context-menu-panel",hidden:R?S!=="operations":void 0,children:[h.jsx("p",{className:"canvas-context-menu-section",children:"Launch"}),o.length>0?o.map((F,G)=>h.jsxs("div",{children:[G>0?h.jsx("div",{className:"theater-menu-divider",role:"separator"}):null,h.jsx("p",{className:"canvas-context-menu-plugin",children:F.title}),F.kinds.map(B=>{const Y=B.disabled===!0||!g;return h.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item canvas-context-menu-item operation-launch-menu-item",disabled:Y,title:B.disabledReason,onClick:()=>b(F.id,B),children:[h.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:d(F.id,B)??h.jsx(X8,{})}),h.jsx("span",{className:"theater-menu-label",children:B.title}),B.disabledReason?h.jsx("span",{className:"operation-launch-menu-reason",children:B.disabledReason}):null]},`${F.id}:${B.id}`)})]},F.id)):h.jsx("p",{className:"theater-menu-empty",children:"No operations available."})]}):null,T?h.jsxs(h.Fragment,{children:[h.jsxs("div",{id:"canvas-control-panel-map",role:"tabpanel","aria-labelledby":"canvas-control-tab-map",className:"canvas-context-menu-panel",hidden:R?S!=="map":void 0,children:[h.jsx("p",{className:"canvas-context-menu-section",children:"View"}),h.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item canvas-context-menu-item",onClick:p,children:[h.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:h.jsx(q8,{})}),h.jsx("span",{className:"theater-menu-label",children:"Reset view"})]}),h.jsx("div",{className:"theater-menu-divider",role:"separator"}),h.jsx("p",{className:"canvas-context-menu-section",children:"Settings"}),w?h.jsx(hp,{checked:!!_,label:"Maximized map",onClick:w,children:h.jsx(K8,{})}):null,C?h.jsx(hp,{checked:!!c,label:"Radar sweep",onClick:C,children:h.jsx(V8,{})}):null,A?h.jsx(hp,{checked:!!u,label:"Panel pulse",onClick:A,children:h.jsx(Y8,{})}):null]}),h.jsx("div",{id:"canvas-control-panel-help",role:"tabpanel","aria-labelledby":"canvas-control-tab-help",className:"canvas-context-menu-panel canvas-context-menu-help",hidden:R?S!=="help":void 0,children:a==="controls"?h.jsxs("details",{className:"canvas-context-menu-help-details",children:[h.jsx("summary",{className:"canvas-context-menu-section canvas-context-menu-help-summary",children:"Shortcuts"}),h.jsx(By,{modLabel:L})]}):h.jsx(By,{modLabel:L})})]}):null]})})}function F8(){return h.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[h.jsx("circle",{cx:"12",cy:"12",r:"7",fill:"none",stroke:"currentColor",strokeWidth:"1.4"}),h.jsx("path",{d:"M12 2.4v3.4M12 18.2v3.4M2.4 12h3.4M18.2 12h3.4",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),h.jsx("path",{d:"M12 9.2v5.6M9.2 12h5.6",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}function W8(e,n,r){const a=n?Math.max(wl,Math.min(e.x,n.width-H8-wl)):e.x;if(r==="above")return{left:a,bottom:Math.max(wl,e.y)};const o=n?Math.max(wl,Math.min(e.y,n.height-$8-wl)):e.y;return{left:a,top:o}}function By({modLabel:e}){return h.jsx(h.Fragment,{children:z8.map(n=>h.jsxs("section",{className:"canvas-shortcuts-group","aria-labelledby":`canvas-shortcuts-${n.title.toLowerCase()}`,children:[h.jsx("h3",{id:`canvas-shortcuts-${n.title.toLowerCase()}`,children:n.title}),h.jsx("dl",{className:"canvas-shortcuts-list",children:n.entries.map(r=>h.jsxs("div",{className:"canvas-shortcuts-entry",children:[h.jsx("dt",{className:"canvas-shortcuts-combos",children:r.combos.map((a,o)=>h.jsxs("span",{className:"canvas-shortcuts-combo",children:[o>0?h.jsx("span",{className:"canvas-shortcuts-or",children:"or"}):null,h.jsx("span",{className:"canvas-shortcuts-keyset",children:a.map(g=>h.jsx("kbd",{children:g==="Mod"?e:g},g))})]},`${r.description}:${a.join("+")}`))}),h.jsx("dd",{children:r.description})]},`${n.title}:${r.description}`))})]},n.title))})}function hp({checked:e,label:n,onClick:r,children:a}){return h.jsxs("button",{type:"button",role:"switch",className:`canvas-context-menu-switch ${e?"is-on":""}`,"aria-checked":e,onClick:r,children:[h.jsx("span",{className:"canvas-context-menu-switch-icon","aria-hidden":"true",children:a}),h.jsx("span",{className:"canvas-context-menu-switch-label",children:n}),h.jsx("span",{className:"canvas-context-menu-switch-track","aria-hidden":"true"})]})}function G8(){const n=navigator.userAgentData?.platform??navigator.platform;return U8.test(n)?"⌘":"Ctrl"}function q8(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.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"}),h.jsx("path",{d:"M2.4 4.6v2.8h2.8",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})]})}function K8(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.jsx("path",{d:"M9.5 3.5h3v3M12.5 3.5 9 7M6.5 12.5h-3v-3M3.5 12.5 7 9",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function V8(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.jsx("circle",{cx:"8",cy:"8",r:"5.2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),h.jsx("path",{d:"M8 8 12 5.6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),h.jsx("circle",{cx:"8",cy:"8",r:"1.1",fill:"currentColor"})]})}function Y8(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.jsx("rect",{x:"3",y:"3.2",width:"10",height:"9.6",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),h.jsx("path",{d:"M10.9 3.2H13v2.1M5.1 12.8H3v-2.1",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M12.6 5.1c.5 1.4.4 2.9-.3 4.2M3.4 10.9c-.5-1.4-.4-2.9.3-4.2",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),h.jsx("circle",{cx:"11.7",cy:"4.2",r:"0.9",fill:"currentColor"})]})}function X8(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.jsx("circle",{cx:"8",cy:"8",r:"3.2",fill:"currentColor",opacity:"0.86"})})}const jy=256,Iy=176,dp=12,ku=220,xC="fleet-console.map.radarCollapsed";function Z8({operations:e,pluginOperations:n,viewport:r,canvasSize:a,onJump:o}){const g=j.useRef(null),_=j.useRef(!1),[c,u]=j.useState(J8);if(a.width<=0||a.height<=0||r.zoom<=0)return null;const d=[...Object.entries(e).map(([B,Y])=>({id:B,kind:"op",x:Y.x,y:Y.y,width:Y.width,height:Y.height})),...Object.entries(n).map(([B,Y])=>({id:B,kind:"plugin",x:Y.geometry.x,y:Y.geometry.y,width:Y.geometry.width,height:Y.geometry.height}))];if(d.length===0)return null;const b=()=>{u(B=>{const Y=!B;return Q8(Y),Y})};if(c)return h.jsx("button",{type:"button",className:"canvas-minimap-fab","data-canvas-blocker":!0,onClick:b,"aria-label":"Radar 펼치기",title:"Show radar",children:h.jsx(t7,{})});const p=jy-dp*2,w=Iy-dp*2,C={x:-r.x/r.zoom,y:-r.y/r.zoom,width:a.width/r.zoom,height:a.height/r.zoom};let A=Math.min(C.x,...d.map(B=>B.x)),E=Math.min(C.y,...d.map(B=>B.y)),f=Math.max(C.x+C.width,...d.map(B=>B.x+B.width)),y=Math.max(C.y+C.height,...d.map(B=>B.y+B.height));A-=ku,E-=ku,f+=ku,y+=ku;const m=f-A,S=y-E,k=Math.min(p/m,w/S),L=(p-m*k)/2,R=(w-S*k)/2,M=B=>L+(B-A)*k,T=B=>R+(B-E)*k,I=B=>{const Y=g.current?.getBoundingClientRect();if(!Y)return;const X=B.clientX-Y.left,H=B.clientY-Y.top;o({x:A+(X-L)/k,y:E+(H-R)/k})},K=B=>{B.stopPropagation(),_.current=!0,B.currentTarget.setPointerCapture(B.pointerId),I(B)},F=B=>{_.current&&(B.stopPropagation(),I(B))},G=B=>{_.current=!1;try{B.currentTarget.releasePointerCapture(B.pointerId)}catch{}};return h.jsxs("div",{className:"canvas-minimap","data-canvas-blocker":!0,style:{width:jy,height:Iy},children:[h.jsx("span",{className:"canvas-minimap-label","aria-hidden":"true",children:"Radar"}),h.jsx("button",{type:"button",className:"canvas-minimap-toggle",onClick:b,"aria-label":"Radar 접기",title:"Collapse radar",children:h.jsx(e7,{})}),h.jsxs("div",{ref:g,className:"canvas-minimap-inner",style:{inset:dp},onPointerDown:K,onPointerMove:F,onPointerUp:G,onPointerCancel:G,role:"presentation","aria-label":"Canvas minimap — drag to navigate",children:[d.map(B=>h.jsx("div",{className:`canvas-minimap-operation ${B.kind==="plugin"?"is-plugin":""}`,style:{left:M(B.x),top:T(B.y),width:Math.max(2,B.width*k),height:Math.max(2,B.height*k)}},B.id)),h.jsx("div",{className:"canvas-minimap-view",style:{left:M(C.x),top:T(C.y),width:C.width*k,height:C.height*k}})]})]})}function J8(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(xC)==="true"}catch{return!1}}function Q8(e){if(!(typeof window>"u"))try{window.localStorage.setItem(xC,String(e))}catch{}}function e7(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.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 t7(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.jsx("rect",{x:"2",y:"3",width:"12",height:"10",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),h.jsx("rect",{x:"4.2",y:"5",width:"4.2",height:"3.1",rx:"0.6",fill:"none",stroke:"currentColor",strokeWidth:"1"}),h.jsx("circle",{cx:"11",cy:"10.2",r:"0.95",fill:"currentColor"})]})}const n7="is-animation-paused";function i7({viewport:e,backgroundAnimationEnabled:n}){const[r,a]=j.useState(()=>document.hidden);return j.useEffect(()=>{function o(){a(document.hidden)}return document.addEventListener("visibilitychange",o),()=>{document.removeEventListener("visibilitychange",o)}},[]),h.jsxs("div",{className:"operations-canvas-background","aria-hidden":"true",children:[h.jsx("div",{className:"operations-canvas-sea"}),h.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?h.jsxs("div",{className:`operations-radar${r?` ${n7}`:""}`,children:[h.jsx("span",{className:"operations-radar-ring operations-radar-ring--outer"}),h.jsx("span",{className:"operations-radar-ring operations-radar-ring--middle"}),h.jsx("span",{className:"operations-radar-ring operations-radar-ring--inner"}),h.jsx("span",{className:"operations-radar-sweep"})]}):null]})}const bh=[{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 Wl(e){return bh.find(n=>n.key===e)?.color??null}function Py(e){return typeof e.accent=="string"?e.accent:null}const zy=8,r7=120;function s7({anchor:e,accentKey:n,onSelect:r,onClose:a}){const[o,g]=j.useState(void 0);j.useLayoutEffect(()=>{const c=Math.max(8,Math.min(e.left,window.innerWidth-8)),u=e.bottom+zy,d=u+r7>window.innerHeight;g(d?{position:"fixed",left:c,top:"auto",bottom:Math.round(window.innerHeight-e.top+zy)}:{position:"fixed",left:c,top:Math.round(u)})},[e]),j.useEffect(()=>{const c=u=>{u.key==="Escape"&&(u.preventDefault(),a())};return window.addEventListener("keydown",c),window.addEventListener("resize",a),window.addEventListener("scroll",a,!0),()=>{window.removeEventListener("keydown",c),window.removeEventListener("resize",a),window.removeEventListener("scroll",a,!0)}},[a]);const _=c=>{r(c),a()};return Xs.createPortal(h.jsx("div",{className:"accent-popover-overlay",role:"presentation",onPointerDown:a,children:o?h.jsxs("div",{className:"accent-popover-card",role:"menu","aria-label":"Accent",style:o,onPointerDown:c=>c.stopPropagation(),children:[h.jsxs("button",{type:"button",className:"accent-popover-swatch accent-popover-swatch--clear",role:"menuitem","aria-label":"No accent","aria-pressed":n===null,onClick:()=>_(null),children:[h.jsx("span",{}),"None"]}),bh.map(c=>h.jsx("button",{type:"button",className:"accent-popover-swatch",role:"menuitem","aria-label":c.label,"aria-pressed":n===c.key,onClick:()=>_(c.key),children:h.jsx("span",{style:{background:c.color}})},c.key))]}):null}),document.body)}function CC(e){const{currentTitle:n,onCommit:r,onBegin:a}=e,o=j.useRef(null),g=j.useRef(!1),_=j.useRef(!1),[c,u]=j.useState(!1),[d,b]=j.useState("");j.useEffect(()=>{c&&(o.current?.focus(),o.current?.select())},[c]);const p=()=>{a?.(),_.current=!1,b(n),u(!0)},w=()=>{_.current=!0,u(!1),b("")},C=()=>{if(!g.current){g.current=!0;try{r(d)}finally{g.current=!1,_.current=!0,u(!1)}}};return{renaming:c,draftTitle:d,inputRef:o,begin:p,cancel:w,commit:C,setDraftTitle:b,handleKeyDown:f=>{if(f.key==="Enter"){f.preventDefault(),C();return}f.key==="Escape"&&(f.preventDefault(),w())},handleBlur:()=>{if(_.current){_.current=!1;return}C()}}}const a7=["n","ne","e","se","s","sw","w","nw"],fp=320,pp=200;function o7({operation:e,active:n,geometry:r,zoom:a,subtitle:o,status:g,minimized:_=!1,maximized:c=!1,accentKey:u=null,children:d,onActivate:b,onClose:p,onMinimize:w,onMaximize:C,onRename:A,onSetAccent:E,onGeometryChange:f,onGeometryCommit:y}){const m=j.useRef(null),S=j.useRef(null),k=j.useRef(null),[L,R]=j.useState(null),M=e.title,T=CC({currentTitle:M,onCommit:A,onBegin:b}),I=u?Wl(u):null,K=["canvas-operation",n?"is-active":"",_?"is-minimized":"",c?"is-maximized":"",c7(g)].filter(Boolean).join(" "),F=W=>{c||W.button===0&&(W.preventDefault(),W.stopPropagation(),b(),S.current={pointerId:W.pointerId,startX:W.clientX,startY:W.clientY,geometry:r,latest:r},W.currentTarget.setPointerCapture(W.pointerId))},G=W=>{if(c)return;const Z=S.current;if(!Z||Z.pointerId!==W.pointerId)return;W.preventDefault(),W.stopPropagation();const ie={...Z.geometry,x:Z.geometry.x+(W.clientX-Z.startX)/a,y:Z.geometry.y+(W.clientY-Z.startY)/a};Z.latest=ie,f(ie)},B=W=>{if(c){S.current=null;return}const Z=S.current;!Z||Z.pointerId!==W.pointerId||(W.preventDefault(),W.stopPropagation(),S.current=null,W.currentTarget.releasePointerCapture(W.pointerId),y(Z.latest))},Y=(W,Z)=>{c||(Z.preventDefault(),Z.stopPropagation(),b(),k.current={direction:W,pointerId:Z.pointerId,startX:Z.clientX,startY:Z.clientY,geometry:r,latest:r},Z.currentTarget.setPointerCapture(Z.pointerId))},X=W=>{if(c)return;const Z=k.current;if(!Z||Z.pointerId!==W.pointerId)return;W.preventDefault(),W.stopPropagation();const ie=l7(Z.geometry,Z.direction,(W.clientX-Z.startX)/a,(W.clientY-Z.startY)/a);Z.latest=ie,f(ie)},H=W=>{if(c){k.current=null;return}const Z=k.current;!Z||Z.pointerId!==W.pointerId||(W.preventDefault(),W.stopPropagation(),k.current=null,W.currentTarget.releasePointerCapture(W.pointerId),y(Z.latest))},q=W=>{W.stopPropagation()},V=W=>{W.stopPropagation(),b()},D=W=>{W.stopPropagation(),b()},P=W=>{W.stopPropagation()},O=()=>{const W=typeof document<"u"?document.activeElement:null;W instanceof HTMLElement&&m.current?.contains(W)&&W.blur(),w()},z=W=>{b(),R(W)};return h.jsxs("article",{ref:m,className:K,style:{left:r.x,top:r.y,width:r.width,height:r.height,zIndex:r.zIndex,...I?{"--op-accent":I}:{}},onPointerDown:b,"data-canvas-operation":!0,"aria-label":`Operation ${M}`,inert:_?!0:void 0,children:[h.jsxs("div",{className:"canvas-operation-titlebar",onPointerDown:F,onPointerMove:G,onPointerUp:B,onPointerCancel:B,"data-canvas-blocker":!0,children:[E?h.jsx("button",{type:"button",className:"canvas-operation-beacon-button",onPointerDown:q,onClick:W=>z(W.currentTarget.getBoundingClientRect()),"aria-label":`Set accent for operation ${M}`,"aria-haspopup":"menu",title:"Set accent",children:h.jsx("span",{className:Hy(g),"aria-hidden":"true"})}):h.jsx("span",{className:Hy(g),"aria-hidden":"true"}),T.renaming?h.jsx("input",{ref:T.inputRef,className:"canvas-operation-rename-input",value:T.draftTitle,"aria-label":`${M} 이름 변경`,onPointerDown:W=>W.stopPropagation(),onChange:W=>T.setDraftTitle(W.target.value),onKeyDown:T.handleKeyDown,onBlur:T.handleBlur}):h.jsx("span",{className:"canvas-operation-title",onPointerDown:V,onDoubleClick:T.begin,title:"Double-click to rename",children:M}),o?h.jsx("span",{className:"canvas-operation-cli",children:o}):null,h.jsx("button",{type:"button",className:"canvas-operation-icon-button",onPointerDown:q,onClick:O,"aria-label":`Minimize operation ${M}`,title:"Minimize operation",children:h.jsx(u7,{})}),C?h.jsx("button",{type:"button",className:`canvas-operation-icon-button ${c?"is-active":""}`,onPointerDown:q,onClick:C,"aria-label":c?`Restore operation ${M}`:`Maximize operation ${M}`,"aria-pressed":c,title:c?"Restore operation":"Maximize operation",children:c?h.jsx(d7,{}):h.jsx(h7,{})}):null,h.jsx("button",{type:"button",className:"canvas-operation-icon-button",onPointerDown:q,onClick:p,"aria-label":`Close operation ${M}`,title:"Close operation",children:h.jsx(f7,{})})]}),h.jsx("div",{className:"canvas-operation-terminal",onPointerDown:D,onWheel:P,"data-canvas-blocker":!0,children:d}),!c&&a7.map(W=>h.jsx("div",{className:`canvas-operation-resize canvas-operation-resize--${W}`,onPointerDown:Z=>Y(W,Z),onPointerMove:X,onPointerUp:H,onPointerCancel:H,"data-canvas-blocker":!0,"aria-hidden":"true"},W)),L&&E?h.jsx(s7,{anchor:L,accentKey:u,onSelect:E,onClose:()=>R(null)}):null]})}function l7(e,n,r,a){let{x:o,y:g,width:_,height:c}=e;return n.includes("e")&&(_+=r),n.includes("s")&&(c+=a),n.includes("w")&&(o+=r,_-=r),n.includes("n")&&(g+=a,c-=a),_<fp&&(n.includes("w")&&(o-=fp-_),_=fp),c<pp&&(n.includes("n")&&(g-=pp-c),c=pp),{...e,x:o,y:g,width:_,height:c}}function c7(e){return e==="running"?"is-running is-running--turn":e==="awaiting"?"is-running is-running--awaiting":""}function Hy(e){return e==="running"?"tenant-beacon is-turn-running":e==="awaiting"?"tenant-beacon is-awaiting":e==="dormant"?"tenant-beacon is-dormant":"tenant-beacon is-idle"}function u7(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.jsx("path",{d:"M3.5 11.5h9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function h7(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.jsx("path",{d:"M3.5 6V3.5H6M10 3.5h2.5V6M12.5 10v2.5H10M6 12.5H3.5V10",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"})})}function d7(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.jsx("path",{d:"M6.2 3.5v2.7H3.5M9.8 3.5v2.7h2.7M12.5 9.8H9.8v2.7M3.5 9.8h2.7v2.7",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"})})}function f7(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.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 p7({rect:e,viewport:n}){const r=P8(e,n);return h.jsx("div",{className:"canvas-rubber-band",style:{left:r.x,top:r.y,width:r.width,height:r.height},"aria-hidden":"true"})}const g7=.25,m7=2,_7=200,v7=150,$y=5,b7=.0018;function y7({viewport:e,disabled:n=!1,consumePointerDown:r=!1,onViewportChange:a,onZoom:o,onCreate:g,onConsumePointerDown:_,onClick:c}){const u=j.useRef(null),d=j.useRef(e),[b,p]=j.useState(null),[w,C]=j.useState(!1),[A,E]=j.useState(!1);j.useEffect(()=>{d.current=e},[e]),j.useEffect(()=>{const R=T=>{T.key==="Shift"&&E(!0),!S7(T.target)&&T.code==="Space"&&(T.preventDefault(),C(!0))},M=T=>{T.key==="Shift"&&E(!1),T.code==="Space"&&C(!1)};return window.addEventListener("keydown",R),window.addEventListener("keyup",M),()=>{window.removeEventListener("keydown",R),window.removeEventListener("keyup",M)}},[]);const f=R=>{if(n||Uy(R.target)||R.button!==0&&R.button!==1)return;if(R.preventDefault(),r){_?.();return}const M=mp(R),T=R.shiftKey&&R.button===0&&!w?"create":"pan";u.current={pointerId:R.pointerId,mode:T,startScreen:M,currentScreen:M,startViewport:d.current},R.currentTarget.setPointerCapture(R.pointerId),T==="create"&&p(gp(M,M,d.current))},y=R=>{const M=u.current;if(!M||M.pointerId!==R.pointerId)return;R.preventDefault();const T=mp(R);if(u.current={...M,currentScreen:T},M.mode==="pan"){a({...M.startViewport,x:M.startViewport.x+T.x-M.startScreen.x,y:M.startViewport.y+T.y-M.startScreen.y});return}p(gp(M.startScreen,T,d.current))},m=R=>{L(R,!0)},S=R=>{L(R,!1)},k=R=>{if(n||Uy(R.target))return;R.preventDefault();const M=mp(R),T=d.current,I=w7(T.zoom*Math.exp(-R.deltaY*b7),g7,m7),K=Fl(M,T);o({x:M.x-K.x*I,y:M.y-K.y*I,zoom:I})},L=(R,M)=>{const T=u.current;if(!T||T.pointerId!==R.pointerId||(u.current=null,R.currentTarget.releasePointerCapture(R.pointerId),p(null),!M))return;const I=Math.abs(T.currentScreen.x-T.startScreen.x),K=Math.abs(T.currentScreen.y-T.startScreen.y);if(I<$y&&K<$y){c?.();return}if(T.mode!=="create")return;const F=gp(T.startScreen,T.currentScreen,d.current),G={x:F.x,y:F.y,width:Math.max(F.width,_7),height:Math.max(F.height,v7)};g(G,T.currentScreen)};return{rubberBand:b,spaceActive:w,shiftActive:A,onPointerDown:f,onPointerMove:y,onPointerUp:m,onPointerCancel:S,onWheel:k}}function gp(e,n,r){const a=Fl(e,r),o=Fl(n,r),g=Math.min(a.x,o.x),_=Math.min(a.y,o.y);return{x:g,y:_,width:Math.abs(a.x-o.x),height:Math.abs(a.y-o.y)}}function mp(e){const n=e.currentTarget.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function Uy(e){return e instanceof Element&&!!e.closest("[data-canvas-blocker], [data-canvas-operation]")}function S7(e){return e instanceof HTMLElement&&!!e.closest("input, textarea, select, [contenteditable='true']")}function w7(e,n,r){return Math.min(r,Math.max(n,e))}const x7="Shift-drag to create a Shell. Right-click for actions. Drag to pan; scroll to zoom.",C7=560,E7=360;function k7({state:e,catalog:n,canLaunch:r,mapFullscreen:a,radarEnabled:o,perimeterEnabled:g,renderKindIcon:_,onLaunchKind:c,onLaunchAtGeometry:u,onResetView:d,onMaximizeMap:b,onToggleRadar:p,onTogglePerimeter:w,onClose:C,onFocus:A,onSetAccent:E}){const f=j.useRef(null),y=NS(),m=DS(),S=BS(),k=e.activeOperationId,[L,R]=j.useState(null),M=Zl(),[T,I]=j.useState({width:0,height:0}),K=!e.activeTheaterId||e.addingTheater;j.useEffect(()=>{const Z=f.current;if(!Z||typeof ResizeObserver>"u")return;const ie=()=>I({width:Z.clientWidth,height:Z.clientHeight});ie();const he=new ResizeObserver(ie);return he.observe(Z),()=>he.disconnect()},[]);const F=y7({viewport:y.viewport,disabled:K,onViewportChange:Bp,onZoom:jS,onCreate:Z=>{if(R(null),e.activeTheaterId&&r){const ie=N7(n);if(!ie)return;const he={...R7(Z),zIndex:ta()};u(ie.pluginId,ie.kind,he)}},consumePointerDown:L!==null,onConsumePointerDown:()=>{R(null)},onClick:T7}),G=(Z,ie)=>{const he=L?.canvasPoint;R(null),he&&c(Z,ie,he)},B=()=>{R(null),d()},Y=Z=>{if(Z.target instanceof Element&&Z.target.closest("[data-canvas-blocker], [data-canvas-operation]"))return;Z.preventDefault();const ie=f.current?.getBoundingClientRect();if(!ie)return;const he={x:Z.clientX-ie.left,y:Z.clientY-ie.top};R({anchor:he,canvasPoint:Fl(he,y.viewport)})},X=new Set(S);j.useEffect(()=>{e.activeOperationId&&X.has(e.activeOperationId)&&ar(null)},[S,e.activeOperationId]);const H=Object.fromEntries(Object.entries(y.operations).filter(([Z])=>!X.has(Z))),q=(e.operations??[]).filter(Z=>Z.theaterId===e.activeTheaterId),V=q,D=q.length>0,P=M.operationKinds,z=m!==null&&q.some(Z=>Z.id===m&&!X.has(Z.id))?m:null,W=M7(y.operations)+1;return h.jsxs("main",{className:`operations-canvas ${F.spaceActive?"is-panning":""} ${F.shiftActive?"is-creating":""} ${z?"is-panel-maximized":""} ${g?"":"is-perimeter-anim-off"}`,onPointerDown:F.onPointerDown,onPointerMove:F.onPointerMove,onPointerUp:F.onPointerUp,onPointerCancel:F.onPointerCancel,onWheel:F.onWheel,onContextMenu:Y,ref:f,children:[h.jsx(i7,{viewport:y.viewport,backgroundAnimationEnabled:o}),h.jsx("div",{className:"operations-canvas-world",style:{transform:`translate(${y.viewport.x}px, ${y.viewport.y}px) scale(${y.viewport.zoom})`},children:V.map(Z=>{const ie=y.operations[Z.id]??Z.geometry??_p(Z),he=z===Z.id,te=he?L7(y.viewport,T,W):ie;return D7(Z,{active:k===Z.id,geometry:te,operationKindRegistry:P,status:e.operationStatus[Z.id],theme:e.activeTheme,viewportZoom:y.viewport.zoom,minimized:X.has(Z.id),maximized:he,accentKey:y.operationAccent[Z.id]??O7(Z),onActivate:()=>{ar(Z.id),he||jp(Z.id,y.operations[Z.id]??Z.geometry??_p(Z))},onClose:()=>{e.activeOperationId===Z.id&&ar(null),z===Z.id&&ao(),C(Z.id)},onMinimize:()=>{e.activeOperationId===Z.id&&ar(null),bA(Z.id)},onMaximize:()=>{he?ao():(ar(Z.id),Nl(Z.id))},onRename:$=>{I7(Z.id,$)},onSetAccent:$=>{E(Z.id,$)},onGeometryChange:$=>{he||jp(Z.id,$)},onGeometryCommit:$=>{he||j7(Z.id,so().operations[Z.id]??$)}})})}),D?null:h.jsxs("div",{className:"operations-canvas-empty","data-canvas-blocker":!0,children:[h.jsx("span",{className:"operations-canvas-empty-mark","aria-hidden":"true"}),h.jsx("p",{children:e.activeTheaterId?x7:"Add a Theater from the top bar to start operations."})]}),F.rubberBand?h.jsx(p7,{rect:F.rubberBand,viewport:y.viewport}):null,L?h.jsx(Bu,{anchor:L.anchor,viewportBounds:A7(f.current),placement:"cursor",catalog:n,canLaunch:r,mapFullscreen:a,radarEnabled:o,perimeterEnabled:g,renderKindIcon:_,onLaunchKind:G,onResetView:B,onMaximizeMap:b,onToggleRadar:p,onTogglePerimeter:w,onClose:()=>R(null)},`${L.anchor.x}:${L.anchor.y}`):null,h.jsx(Z8,{operations:H,pluginOperations:Object.fromEntries(q.filter(Z=>!X.has(Z.id)).map(Z=>[Z.id,{theaterId:Z.theaterId,geometry:y.operations[Z.id]??Z.geometry??_p(Z)}])),viewport:y.viewport,canvasSize:T,onJump:Z=>Bp({x:T.width/2-Z.x*y.viewport.zoom,y:T.height/2-Z.y*y.viewport.zoom,zoom:y.viewport.zoom})})]})}function A7(e){if(!e)return;const n=e.getBoundingClientRect();return{width:n.width,height:n.height}}function T7(){if(typeof document<"u"){const e=document.activeElement;e instanceof HTMLElement&&e.blur()}ar(null)}function R7(e){return{x:e.x,y:e.y,width:e.width,height:e.height,zIndex:0}}function _p(e){return e.geometry??{x:0,y:0,width:C7,height:E7,zIndex:0}}function L7(e,n,r){return{x:-e.x/e.zoom,y:-e.y/e.zoom,width:Math.max(320,n.width)/e.zoom,height:Math.max(240,n.height)/e.zoom,zIndex:r}}function M7(e){return Object.values(e).reduce((n,r)=>Math.max(n,r.zIndex),0)}function N7(e){const n=e.flatMap(r=>r.kinds.filter(a=>a.disabled!==!0).map(a=>({pluginId:r.id,kind:a})));return n.find(({kind:r})=>r.type==="shell")??n[0]??null}function O7(e){return typeof e.accent=="string"?e.accent:null}function D7(e,n){const r=n.operationKindRegistry.find(g=>g.pluginId===e.pluginId&&g.type===e.type),a=n.geometry;if(!r?.render)return null;const o=hh(()=>{Pi(null).then(zi).catch(()=>{})});return h.jsx(o7,{operation:e,active:n.active,geometry:a,zoom:n.viewportZoom,subtitle:r.subtitle?.(e),status:n.status,minimized:n.minimized,maximized:n.maximized,accentKey:n.accentKey,onActivate:n.onActivate,onClose:n.onClose,onMinimize:n.onMinimize,onMaximize:n.onMaximize,onRename:n.onRename,onSetAccent:n.onSetAccent,onGeometryChange:n.onGeometryChange,onGeometryCommit:n.onGeometryCommit,children:h.jsx(Og,{fallback:h.jsx("div",{className:"fc-plugin-error",children:"Plugin operation failed to render."}),children:h.jsx(B7,{active:n.active,capabilities:o,descriptor:r,geometry:a,operation:e,theme:n.theme,viewportZoom:n.viewportZoom,onActivate:n.onActivate,onClose:n.onClose,onGeometryChange:n.onGeometryChange})})},e.id)}function B7({active:e,capabilities:n,descriptor:r,geometry:a,operation:o,theme:g,viewportZoom:_,onActivate:c,onClose:u,onGeometryChange:d}){return r.render?r.render({operationId:o.id,theaterId:o.theaterId,pluginId:o.pluginId,type:o.type,operation:o,geometry:a,active:e,zoom:_,theme:g,api:n.api,lifecycle:n.lifecycle,terminal:n.terminal,notifications:n.notifications,operations:n.operations,preferences:n.preferences,status:n.status,onActivate:c,onClose:u,onGeometryChange:d}):null}async function j7(e,n){await fetch(`/api/v1/operations/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({geometry:n})})}async function I7(e,n){await VS(e,n),await Pi(null).then(zi)}const wg="fleet-console.rail.activePanelId";function P7(){try{return localStorage.getItem(wg)}catch{return null}}function EC(e){try{e===null?localStorage.removeItem(wg):localStorage.setItem(wg,e)}catch{}}const xg=new Set;let Gl={activeRailPanelId:P7()};function kC(){for(const e of xg)e()}function z7(e){return xg.add(e),()=>{xg.delete(e)}}function H7(){return Gl}function $7(e){const n=Gl.activeRailPanelId===e?null:e;Gl={activeRailPanelId:n},EC(n),kC()}function U7(){Gl.activeRailPanelId!==null&&(Gl={activeRailPanelId:null},EC(null),kC())}function AC(){return j.useSyncExternalStore(z7,H7).activeRailPanelId}function TC(e){if(!e.operationsViewActive||!e.activeOperationId)return new Set;const n=e.operations.find(r=>r.id===e.activeOperationId);return!n||n.theaterId!==e.activeTheaterId?new Set:new Set([n.id])}function RC(e,n){const r=new Set(n.map(a=>a.id));return e.filter(a=>r.has(a.operationId))}function LC(e,n){const r=[],a=[];for(const o of e)n.has(o.operationId)?a.push(o):r.push(o);return{hidden:r,visible:a}}function Cg(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 MC(e,n){return n.globalMute||n.dnd?[]:e.filter(r=>!r.theaterId||n.mutedTheaterIds[r.theaterId]!==!0)}const F7={ended:"Stood down","input-waiting":"Awaiting orders"},W7={id:"alerts",title:"Alerts",icon:()=>h.jsx(q7,{}),render:()=>h.jsx(G7,{})};function G7(){const e=Hr(),n=oh(),[r,a]=j.useState(!1),o=j.useMemo(()=>RC(Object.values(e.operationNotifications),e.operations),[e.operationNotifications,e.operations]),g=TC(e),_=LC(o,g).hidden,c=MC(_,e.notificationPreferences),u=Cg(c),d=Cg(_),b=Eg(u,"input-waiting"),p=Eg(u,"ended"),w=u.length===0,C=j.useCallback(A=>{ch(A.operationId),n("/operations")},[n]);return h.jsxs("div",{className:"alerts-panel-body","aria-live":"polite","aria-label":"Operation alerts",children:[h.jsxs("div",{className:"alerts-panel-toolbar",children:[h.jsxs("div",{className:"alerts-panel-tallies","aria-hidden":"true",children:[b>0?h.jsx("span",{className:"notification-tally is-input-waiting",children:b}):null,p>0?h.jsx("span",{className:"notification-tally is-ended",children:p}):null,w?h.jsx("span",{className:"alerts-panel-tally-empty",children:"—"}):null]}),h.jsx("button",{type:"button",className:`alerts-panel-settings-btn${r?" is-active":""}`,onClick:()=>a(A=>!A),"aria-expanded":r,"aria-label":"Notification settings",title:"Notification settings",children:h.jsx(X7,{})})]}),r?h.jsx(K7,{groups:d}):null,w?h.jsx("p",{className:"notification-dock-empty",children:"No active alerts"}):h.jsx("div",{className:"notification-dock-deck",children:u.map(A=>h.jsxs("section",{className:"notification-cluster-group",children:[h.jsxs("header",{className:"notification-cluster-group-head",children:[h.jsx("span",{className:"notification-cluster-theater",children:A.theaterLabel}),h.jsx("span",{className:"notification-cluster-group-count",children:A.totalCount})]}),h.jsx("ul",{className:"notification-cluster-roster",children:A.notifications.map(E=>h.jsxs("li",{className:`notification-row is-${E.kind}`,children:[h.jsx("span",{className:"notification-row-beacon","aria-hidden":"true"}),h.jsxs("span",{className:"notification-row-body",children:[h.jsx("span",{className:"notification-row-op",children:E.operationLabel}),h.jsx("span",{className:"notification-row-state",children:F7[E.kind]})]}),E.count>1?h.jsx("span",{className:"notification-row-count",children:E.count}):null,h.jsx("button",{type:"button",className:"notification-row-move",onClick:()=>C(E),"aria-label":`Open ${A.theaterLabel} ${E.operationLabel}`,children:"Open"})]},E.operationId))})]},A.theaterId??"__unknown__"))})]})}function q7(){const e=Hr(),r=AC()==="alerts",a=j.useMemo(()=>RC(Object.values(e.operationNotifications),e.operations),[e.operationNotifications,e.operations]),o=TC(e),g=LC(a,o).hidden,_=MC(g,e.notificationPreferences),c=Cg(_),u=c.reduce((E,f)=>E+f.totalCount,0),d=Eg(c,"input-waiting"),b=j.useMemo(()=>_.reduce((E,f)=>Math.max(E,f.lastRaisedSeq),0),[_]),p=j.useRef(b),[w,C]=j.useState(0);j.useEffect(()=>{b>p.current&&!r&&C(E=>E+1),p.current=b},[b,r]);const A=u===0?"muted":d>0?"awaiting":"ended";return h.jsxs("span",{className:`alerts-icon is-${A}`,"aria-hidden":"true",children:[h.jsx(Y7,{}),u>0?h.jsx("span",{className:"alerts-icon-badge",children:u}):null,w>0?h.jsx("span",{className:"alerts-icon-pulse","aria-hidden":"true"},w):null]})}function K7({groups:e}){const n=Hr(),r=V7(e,n.notificationPreferences.mutedTheaterIds,n.theaters);return h.jsxs("div",{className:"notification-cluster-settings",role:"dialog","aria-label":"Notification settings",children:[h.jsx("p",{className:"notification-cluster-settings-eyebrow",children:"Display"}),h.jsxs("label",{className:"notification-cluster-setting",children:[h.jsx("input",{type:"checkbox",checked:n.notificationPreferences.globalMute,onChange:a=>$T(a.currentTarget.checked)}),h.jsx("span",{children:"Mute all"})]}),h.jsxs("label",{className:"notification-cluster-setting",children:[h.jsx("input",{type:"checkbox",checked:n.notificationPreferences.dnd,onChange:a=>UT(a.currentTarget.checked)}),h.jsx("span",{children:"Do not disturb"})]}),r.length>0?h.jsx("p",{className:"notification-cluster-settings-eyebrow",children:"By Theater"}):null,r.map(a=>h.jsxs("label",{className:"notification-cluster-setting",children:[h.jsx("input",{type:"checkbox",checked:a.theaterId?n.notificationPreferences.mutedTheaterIds[a.theaterId]===!0:!1,onChange:()=>{a.theaterId&&FT(a.theaterId)}}),h.jsx("span",{children:a.theaterLabel})]},a.theaterId))]})}function V7(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(g=>g.id===o)?.label??o,notifications:[],totalCount:0});return[...a.values()]}function Eg(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 Y7(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",width:"16",height:"16",children:[h.jsx("path",{d:"M8 2a4.5 4.5 0 0 0-4.5 4.5v2.25L2 10.5v.75h12v-.75l-1.5-1.75V6.5A4.5 4.5 0 0 0 8 2Z",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M6.5 12a1.5 1.5 0 0 0 3 0",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})]})}function X7(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",width:"15",height:"15",children:[h.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"}),h.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"})]})}async function Z7(e,n){const a=new URLSearchParams().toString();return po(fo(e,`/search${a?`?${a}`:""}`))}async function J7(e,n,r){return po(fo(e,`/entry/${encodeURIComponent(n)}`))}async function NC(e,n="pending"){return po(fo(e,`/drydock?status=${encodeURIComponent(n)}`))}async function Q7(e,n){return po(fo(e,`/drydock/${encodeURIComponent(n)}`))}async function eB(e){return po(fo(e,"/conflicts"))}async function tB(e,n){return po(fo(e,`/conflicts/${encodeURIComponent(n)}`))}function fo(e,n){const r=n.startsWith("/")?n:`/${n}`;return e?`/console/codex/w/${encodeURIComponent(e)}/api${r}`:`/console/codex/api${r}`}async function po(e){const n=await fetch(e,{headers:{accept:"application/json"}});if(!n.ok)throw new Error(await nB(e,n));return n.json()}async function nB(e,n){return(await n.json().catch(()=>null))?.error??`${e} request failed: ${n.status}`}const kg=new Set,nh={index:[],conflicts:[],pendingPatchCount:0,currentWorkspaceId:null,loading:!1,error:null};function Za(){return nh}function OC(e){return kg.add(e),()=>kg.delete(e)}function Fy(e){ju({currentWorkspaceId:e})}async function Wy(){ju({loading:!0,error:null});try{const e=nh.currentWorkspaceId,[n,r]=await Promise.all([Z7(e),NC(e,"pending").catch(()=>null)]);ju({index:n.entries,pendingPatchCount:r?.pendingCount??0,loading:!1})}catch(e){ju({loading:!1,error:iB(e)})}}function ju(e){Object.assign(nh,e);for(const n of kg)n(nh)}function iB(e){return e instanceof Error?e.message:String(e)}const rB=120;function Vi(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function sB(e,n){if(!n)return Vi(e);const r=e.toLowerCase().indexOf(n.toLowerCase());return r===-1?Vi(e):Vi(e.slice(0,r))+`<mark>${Vi(e.slice(r,r+n.length))}</mark>`+Vi(e.slice(r+n.length))}function aB(e){return`<span class="codex-nav-tag">${Vi(e)}</span>`}function oB(e,n,r){const a=n?e.tags.some(c=>c.toLowerCase().includes(n.toLowerCase())):!1,o=e.tags.slice(0,3).map(aB).join(""),g=Vi(e.status??"current"),_=Vi(e.updated??"");return`<button
213
+ class="codex-nav-entry${r?" is-current":""}"
214
+ data-entry-id="${Vi(e.id)}"
215
+ type="button"
216
+ ${r?'aria-current="page"':""}
217
+ title="${Vi(e.title)}"
218
+ >
219
+ <span class="t">${sB(e.title,a?"":n)}</span>
220
+ ${o?`<span class="tg">${o}</span>`:""}
221
+ <span class="meta">${g} · ${_}</span>
222
+ </button>`}function lB(e,n){if(!n)return e;const r=n.toLowerCase();return e.filter(a=>a.title.toLowerCase().includes(r)||a.tags.some(o=>o.toLowerCase().includes(r)))}function cB(e,n){let r="",a=null,o=null;e.innerHTML=`
223
+ <div class="codex-navigator">
224
+ <div class="codex-nav-search">
225
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.35-4.35"/></svg>
226
+ <input
227
+ class="codex-nav-search-input"
228
+ type="search"
229
+ placeholder="Search entries"
230
+ autocomplete="off"
231
+ spellcheck="false"
232
+ aria-label="Search Codex entries"
233
+ />
234
+ </div>
235
+ <div class="codex-nav-quick-row">
236
+ <button class="codex-nav-quick" data-action="drydock" type="button">
237
+ ⚓ Drydock <span class="badge" id="codex-nav-drydock-badge">0</span>
238
+ </button>
239
+ <button class="codex-nav-quick" data-action="conflicts" type="button">Conflicts</button>
240
+ </div>
241
+ <div class="codex-nav-list-eyebrow" id="codex-nav-eyebrow">Entries · 0</div>
242
+ <div class="codex-navigator-scroll">
243
+ <div class="codex-nav-list" id="codex-nav-list"></div>
244
+ </div>
245
+ </div>
246
+ `;const g=e.querySelector(".codex-nav-search-input"),_=e.querySelector("#codex-nav-list"),c=e.querySelector("#codex-nav-eyebrow"),u=e.querySelector("#codex-nav-drydock-badge");function d(C){const A=lB(C.index,r);if(c.textContent=`Entries · ${A.length}`,u.textContent=String(C.pendingPatchCount),u.hidden=C.pendingPatchCount===0,C.loading&&C.index.length===0){_.innerHTML='<div class="codex-nav-loading" aria-live="polite">Loading…</div>';return}if(C.error){_.innerHTML=`<div class="codex-nav-error" role="alert">${Vi(C.error)}</div>`;return}if(A.length===0){_.innerHTML=`<div class="codex-nav-empty">${r?"No entries match.":"No entries."}</div>`;return}_.innerHTML=A.map(E=>oB(E,r,E.id===a)).join("")}function b(C){const A=C.target;if(!(A instanceof Element))return;const E=A.closest("[data-entry-id]");if(E?.dataset.entryId){a=E.dataset.entryId,d(Za()),n.onRequest({kind:"entry",id:a});return}const f=A.closest("[data-action]");if(f?.dataset.action==="drydock"){n.onRequest({kind:"drydock"});return}if(f?.dataset.action==="conflicts"){n.onRequest({kind:"conflicts"});return}}function p(){o!==null&&clearTimeout(o),o=setTimeout(()=>{r=g.value,d(Za())},rB)}e.addEventListener("click",b),g.addEventListener("input",p);const w=OC(C=>d(C));return d(Za()),{destroy(){w(),e.removeEventListener("click",b),g.removeEventListener("input",p),o!==null&&clearTimeout(o),e.innerHTML=""},setTheater(C){r="",a=null,g&&(g.value=""),d(Za())}}}function uB(e,n){n.initialTheaterId&&Fy(n.initialTheaterId);const r=cB(e,{initialTheaterId:n.initialTheaterId,onRequest:n.onRequest}),a=OC(()=>{});Wy();const o=r.destroy.bind(r);return{destroy(){a(),o()},setTheater(g){Fy(g),Wy(),r.setTheater(g)}}}function Gt(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ih(e){return Gt(e).replace(/"/g,"&quot;")}const hB="contextual-knowledge-not-instructions";function dB(e,n){const r=e.frontmatter.whyThisMatched,a=jC(e,n);return`
247
+ <div class="context-actions-grid">
248
+ <button class="context-action-btn" type="button" data-action="copy-compact-context">
249
+ <span class="context-action-label">Compact context</span>
250
+ <span class="context-action-meta">${Iu(DC(e))} tok</span>
251
+ </button>
252
+ <button class="context-action-btn" type="button" data-action="copy-provenance-context">
253
+ <span class="context-action-label">Provenance</span>
254
+ <span class="context-action-meta">${Iu(BC(e))} tok</span>
255
+ </button>
256
+ <button class="context-action-btn" type="button" data-action="copy-related-context">
257
+ <span class="context-action-label">Context pack</span>
258
+ <span class="context-action-meta">${Iu(a)} tok</span>
259
+ </button>
260
+ ${r?`
261
+ <button class="context-action-btn context-action-btn--secondary" type="button" data-action="toggle-why-matched">
262
+ <span class="context-action-label">Why this matched</span>
263
+ </button>
264
+ <div class="context-why-matched" hidden>${Gt(r)}</div>
265
+ `:""}
266
+ </div>
267
+ `}function DC(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:Em(e.body)};return JSON.stringify({...n,token_estimate:Iu(JSON.stringify(n))},null,2)}function BC(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",Em(e.body)].join(`
268
+ `)}function jC(e,n){const r=new Set([...e.frontmatter.related??[]]),a=n.filter(o=>r.has(o.id)).sort((o,g)=>o.title.localeCompare(g.title));return[`<fleet-wiki-context boundary="${hB}">`,"# 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",Em(e.body),"","### Related Entries",...a.length>0?a.map(o=>`- [[wiki:${o.id}]] — ${o.title}`):["- (none)"],"","</fleet-wiki-context>"].join(`
269
+ `)}function Iu(e){return Math.max(1,Math.ceil(e.length/4))}function Em(e){return e.replace(/\s+/g," ").trim().slice(0,240)||"(empty)"}function fB(e){const n=e.tags.map(a=>`<span class="chip chip-tag">${Gt(a)}</span>`).join(""),r=mB(e);return`
270
+ <div class="meta-chips">
271
+ ${n}
272
+ ${r}
273
+ <span class="chip">Updated ${Gt(gB(e.updated))}</span>
274
+ </div>
275
+ `}function pB(e){return e.map(n=>`<span class="chip chip-muted">${Gt(n)}</span>`).join("")}function gB(e){const n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function mB(e){const n=_B(e);return n?`<span class="chip ${n.tone==="deprecated"?"chip-coral":n.tone==="stale"?"chip-stale":""}" title="${ih(n.title)}">${Gt(n.label)}</span>`:""}function _B(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}const vB="active";function bB(e){return e.length===0?'<p class="toc-empty">No sections</p>':e.map(n=>`<a class="ti toc-level-${n.level}" href="#${ih(n.id)}" data-toc-id="${ih(n.id)}">${Gt(n.text)}</a>`).join("")}function yB(e,n,r){if(n.length===0||typeof IntersectionObserver>"u")return()=>{};const a=[...r.querySelectorAll("[data-toc-id]")],o=new Set(n.map(d=>d.id)),g=[...e.querySelectorAll("h2[id], h3[id]")].filter(d=>o.has(d.id));if(a.length===0||g.length===0)return()=>{};const _=e.closest(".codex-reading-sheet-read"),c=new Set,u=new IntersectionObserver(d=>{for(const p of d){const w=p.target instanceof HTMLElement?p.target.id:"";w&&(p.isIntersecting?c.add(w):c.delete(w))}const b=SB(g,c)??wB(g,_)??g[0]?.id??null;Gy(a,b)},{root:_,rootMargin:"-20% 0px -65% 0px",threshold:[0,.2,.6,1]});for(const d of g)u.observe(d);return Gy(a,g[0]?.id??null),()=>u.disconnect()}function SB(e,n){for(const r of e)if(n.has(r.id))return r.id;return null}function wB(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 Gy(e,n){for(const r of e){const a=!!(n&&r.dataset.tocId===n);r.classList.toggle(vB,a),a?r.setAttribute("aria-current","location"):r.removeAttribute("aria-current")}}function xB(e){return`/entry/${encodeURIComponent(e)}`}const IC={create_wiki:"+",update_wiki:"↻"};function CB(e,n){let r=!1,a=null;Zx(e);function o(d){const b=d.target;if(!(b instanceof Element))return;const p=b.closest("[data-entry-id]");if(p?.dataset.entryId){d.preventDefault(),n.onRelatedClick(p.dataset.entryId);return}const w=b.closest("[data-action]");if(!w)return;const C=w.dataset.action,A=e._currentEntry;if(A){if(C==="copy-compact-context")navigator.clipboard.writeText(DC(A));else if(C==="copy-provenance-context")navigator.clipboard.writeText(BC(A));else if(C==="copy-related-context")navigator.clipboard.writeText(jC(A,Za().index));else if(C==="toggle-why-matched"){const E=w.nextElementSibling;E?.classList.contains("context-why-matched")&&(E.hidden=!E.hidden)}}}e.addEventListener("click",o);function g(){a?.(),a=null}async function _(d){if(!r){vp(e,n.tocContainer),g();try{const b=await J7(n.theaterId,d);if(r)return;const{index:p}=Za(),{html:w,toc:C}=Xx(b.body,{omitDuplicateTitle:b.frontmatter.title,resolveWikiLink:E=>xB(E)});e._currentEntry=b,e.innerHTML=`
276
+ <article class="document">
277
+ <header class="document-header">
278
+ ${EB(b.frontmatter.title)}
279
+ <h1>${Gt(b.frontmatter.title)}</h1>
280
+ ${fB(b.frontmatter)}
281
+ </header>
282
+ <div class="markdown-body" id="codex-reader-body">
283
+ ${w}
284
+ </div>
285
+ ${kB(b.frontmatter.id,b.frontmatter.tags,p)}
286
+ ${dB(b,p)}
287
+ </article>
288
+ `,n.tocContainer.innerHTML=bB(C);const A=e.querySelector("article");A&&C.length>0&&(a=yB(A,C,n.tocContainer))}catch(b){r||bp(e,n.tocContainer,b)}}}async function c(d){if(!r){vp(e,n.tocContainer),n.tocContainer.innerHTML="";try{if(d){const b=await Q7(n.theaterId,d);if(r)return;e.innerHTML=AB(b)}else{const b=await NC(n.theaterId,"pending");if(r)return;e.innerHTML=TB(b.items,"Drydock — Pending Patches")}}catch(b){r||bp(e,n.tocContainer,b)}}}async function u(d){if(!r){vp(e,n.tocContainer),n.tocContainer.innerHTML="";try{if(d){const b=await tB(n.theaterId,d);if(r)return;e.innerHTML=RB(b)}else{const b=await eB(n.theaterId);if(r)return;e.innerHTML=LB(b)}}catch(b){r||bp(e,n.tocContainer,b)}}}return n.kind==="entry"&&n.initialEntryId?_(n.initialEntryId):n.kind==="drydock"?c(n.subId):n.kind==="conflicts"&&u(n.subId),{destroy(){r=!0,e.removeEventListener("click",o),g()},async setEntry(d){await _(d)}}}function vp(e,n){e.innerHTML='<div class="codex-reader-loading" aria-live="polite" aria-busy="true">Loading…</div>',n.innerHTML=""}function bp(e,n,r){const a=r instanceof Error?r.message:String(r);e.innerHTML=`<div class="codex-reader-error" role="alert">${Gt(a)}</div>`,n.innerHTML=""}function EB(e){return`
289
+ <nav class="breadcrumb" aria-label="Entry location">
290
+ <ol>
291
+ <li><span>Codex</span></li>
292
+ <li><span aria-current="page">${Gt(e)}</span></li>
293
+ </ol>
294
+ </nav>
295
+ `}function kB(e,n,r){const a=new Set(n),o=r.filter(g=>g.id!==e).map(g=>({entry:g,matchingTags:g.tags.filter(_=>a.has(_))})).filter(g=>g.matchingTags.length>0).sort((g,_)=>_.matchingTags.length-g.matchingTags.length||g.entry.title.localeCompare(_.entry.title,"en-US",{sensitivity:"base",numeric:!0})).slice(0,5);return o.length===0?"":`
296
+ <section class="related-list">
297
+ <h2>Related entries</h2>
298
+ <div class="related-items">
299
+ ${o.map(g=>`<button class="related-card" type="button" data-entry-id="${ih(g.entry.id)}">
300
+ <strong>${Gt(g.entry.title)}</strong>
301
+ <span>${pB(g.matchingTags)}</span>
302
+ </button>`).join("")}
303
+ </div>
304
+ </section>
305
+ `}function AB(e){const n=e.patch.frontmatter.op;return`
306
+ <article class="document">
307
+ <header class="document-header">
308
+ <nav class="breadcrumb" aria-label="Entry location">
309
+ <ol><li><span>Codex</span></li><li><span>Drydock</span></li></ol>
310
+ </nav>
311
+ <h1><span class="op-badge">${IC[n]??"?"}</span> ${Gt(e.patch.frontmatter.target)}</h1>
312
+ <p class="eyebrow">${Gt(e.meta.status)}</p>
313
+ </header>
314
+ <div class="markdown-body">
315
+ <pre><code>${Gt(e.patch.body)}</code></pre>
316
+ </div>
317
+ </article>
318
+ `}function TB(e,n){return e.length===0?'<div class="codex-reader-empty"><p>No pending patches.</p></div>':`
319
+ <article class="document">
320
+ <header class="document-header">
321
+ <h1>${Gt(n)}</h1>
322
+ </header>
323
+ <div class="markdown-body">
324
+ <ul class="queue-list">
325
+ ${e.map(r=>`<li class="queue-item">
326
+ <span class="op-badge">${Gt(IC[r.op??""]??"?")}</span>
327
+ <strong>${Gt(r.target??r.id)}</strong>
328
+ ${r.summary?`<span class="queue-summary">${Gt(r.summary)}</span>`:""}
329
+ </li>`).join("")}
330
+ </ul>
331
+ </div>
332
+ </article>
333
+ `}function RB(e){return`
334
+ <article class="document">
335
+ <header class="document-header">
336
+ <nav class="breadcrumb" aria-label="Entry location">
337
+ <ol><li><span>Codex</span></li><li><span>Conflicts</span></li></ol>
338
+ </nav>
339
+ <h1>${Gt(e.id)}</h1>
340
+ <p class="eyebrow">Conflict · ${Gt(e.meta?.status??"open")}</p>
341
+ </header>
342
+ <div class="markdown-body">
343
+ ${e.current?`<h2>Current</h2><pre><code>${Gt(e.current)}</code></pre>`:""}
344
+ ${e.proposed?`<h2>Proposed</h2><pre><code>${Gt(e.proposed)}</code></pre>`:""}
345
+ </div>
346
+ </article>
347
+ `}function LB(e){return e.length===0?'<div class="codex-reader-empty"><p>No conflicts found.</p></div>':`
348
+ <article class="document">
349
+ <header class="document-header">
350
+ <h1>Conflicts</h1>
351
+ </header>
352
+ <div class="markdown-body">
353
+ <ul class="queue-list">
354
+ ${e.map(n=>`<li class="queue-item">
355
+ <strong>${Gt(n.title||n.id)}</strong>
356
+ <span class="eyebrow">${Gt(n.status)}</span>
357
+ </li>`).join("")}
358
+ </ul>
359
+ </div>
360
+ </article>
361
+ `}let Vs=null,ql=null,PC=null,Ss=null,Ys=null,Ja=null,Pu=null,yp=null,Ag=0;function qy(e){PC=e}function MB(e,n){const r=DB();r.parentElement!==e&&e.appendChild(r),ql||(ql=uB(r,{initialTheaterId:n,onRequest:a=>PC?.(a)}))}function NB(e){ql?.setTheater(e)}function zC(e,n,r){const a=BB(),o=jB(),g=a.parentElement,_=r.kind==="entry"&&Pu==="entry"&&r.initialEntryId===yp;g&&g!==e&&(Ag=g.scrollTop),a.parentElement!==e&&e.appendChild(a),o.parentElement!==n&&n.appendChild(o),!Ja||Pu!==r.kind?(Ja?.destroy(),Ja=CB(a,{...r,tocContainer:o}),Pu=r.kind):r.kind==="entry"&&r.initialEntryId&&r.initialEntryId!==yp&&Ja.setEntry(r.initialEntryId),yp=r.kind==="entry"?r.initialEntryId??null:null;const c=_?Ag:0;requestAnimationFrame(()=>{e.scrollTop=c})}function OB(){const e=Ss?.parentElement;e&&(Ag=e.scrollTop)}function HC(){Ja?.destroy(),Ja=null,Pu=null,Ss?.parentElement&&Ss.parentElement.removeChild(Ss),Ys?.parentElement&&Ys.parentElement.removeChild(Ys)}function Ky(){HC(),ql?.destroy(),ql=null,Vs?.parentElement&&Vs.parentElement.removeChild(Vs)}function DB(){return Vs||(Vs=document.createElement("div"),Vs.className="codex-host"),Vs}function BB(){return Ss||(Ss=document.createElement("div"),Ss.className="codex-reader-host"),Ss}function jB(){return Ys||(Ys=document.createElement("div"),Ys.className="codex-toc-host"),Ys}const IB={id:"codex",title:"Codex",icon:()=>h.jsx(HB,{}),render:()=>h.jsx(PB,{})};function PB(){const e=Hr(),n=j.useRef(null),r=j.useRef(null),a=j.useRef(null),o=e.codexReader,g=o!==null,_=e.codexReaderExpanded,c=e.theaters.find(w=>w.id===e.activeTheaterId)??null,u=c?.id??null,d=!!c?.hasWiki,b=e.theaters.length>0,p=o?`${o.kind}:${o.kind==="entry"?o.entryId:o.kind==="drydock"?o.patchId??"":o.id??""}`:null;return j.useEffect(()=>{if(!d){Ky();return}return()=>{Ky()}},[d]),j.useEffect(()=>{if(!d||!u)return;const w=n.current;if(w)return MB(w,u),qy(C=>{C.kind==="entry"?El({kind:"entry",entryId:C.id}):C.kind==="drydock"?El({kind:"drydock",patchId:C.patchId}):C.kind==="conflicts"&&El({kind:"conflicts",id:C.id})}),()=>{qy(null)}},[d,u,g]),j.useEffect(()=>{d&&u&&NB(u)},[u,d]),j.useEffect(()=>{if(!d||!u||!g||_||!r.current||!a.current||!o)return;const w=o.kind,C=w==="drydock"?o.patchId:w==="conflicts"?o.id:void 0;zC(r.current,a.current,{initialEntryId:w==="entry"?o.entryId:"",kind:w,subId:C,theaterId:u,onRelatedClick:A=>El({kind:"entry",entryId:A}),onClose:()=>D1()})},[d,u,g,_,p]),j.useEffect(()=>{g||HC()},[g]),d?g?h.jsxs("div",{className:"codex-rail-host is-split",children:[h.jsxs("div",{className:"codex-doc-pane",children:[h.jsxs("div",{className:"codex-doc-pane-head",children:[h.jsx("button",{className:"codex-doc-expand",type:"button","aria-label":"Expand reading sheet","data-codex-expand":"true",onClick:uw,children:"⤢ Expand"}),h.jsx("button",{className:"codex-reading-sheet-close",type:"button","aria-label":"Close document pane",onClick:D1,children:"✕"})]}),h.jsx("div",{ref:r,className:"codex-doc-scroll"}),h.jsx("div",{ref:a,className:"codex-doc-toc-inline"})]}),h.jsx("div",{ref:n,className:"codex-nav-pane"})]}):h.jsx("div",{ref:n,className:"codex-rail-host"}):h.jsx(zB,{activeTheater:c,hasTheaters:b})}function zB({activeTheater:e,hasTheaters:n}){return n?h.jsxs("section",{className:"codex-empty-state",children:[h.jsx("p",{className:"codex-empty-eyebrow",children:"Codex unavailable"}),h.jsx("h1",{children:e?.label??"This Theater"}),h.jsx("p",{children:"This Theater does not have Fleet Wiki data mounted."})]}):h.jsxs("section",{className:"codex-empty-state",children:[h.jsx("p",{className:"codex-empty-eyebrow",children:"Codex"}),h.jsx("h1",{children:"Add a Theater"}),h.jsx("p",{children:"Use the top bar Theater control to choose a project root before opening Codex."})]})}function HB(){return h.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[h.jsx("circle",{cx:"12",cy:"12",r:"9"}),h.jsx("circle",{cx:"12",cy:"12",r:"3.2",fill:"currentColor",stroke:"none",opacity:"0.16"}),h.jsx("path",{d:"M12 3v3.6M12 17.4V21M3 12h3.6M17.4 12H21"}),h.jsx("path",{d:"M12 8.6 14.2 12 12 15.4 9.8 12Z",fill:"currentColor",stroke:"none"})]})}const $B=[W7,IB];function UB(e="right"){const{railPanels:n}=Zl();return e==="right"?n.filter(r=>(r.side??"right")==="right"):n}const FB=360;function WB(e){const{codexReader:n}=Hr();return e==="codex"&&n!==null?FB:0}const $C=240,GB=312,UC="fleet-console.rail.panelWidth";function qB(){try{const e=localStorage.getItem(UC);if(e!==null){const n=parseInt(e,10);if(!isNaN(n)&&n>=$C)return n}}catch{}return GB}function KB({theaterId:e,api:n}){const r=AC(),a=UB(),o=$B,_=[...o,...a].find(y=>y.id===r)??null,c=_!==null,u=WB(r)+(_?.preferredExtraWidth??0),d=j.useRef(u);d.current=u;const[b,p]=j.useState(qB),w=j.useRef(b),[C,A]=j.useState(!1),E=j.useCallback(y=>{y.preventDefault();const m=y.clientX,S=w.current;A(!0);const k=R=>{const M=m-R.clientX,T=window.innerWidth-148-d.current,I=Math.max($C,Math.min(T,S+M));w.current=I,p(I)},L=()=>{document.removeEventListener("pointermove",k),document.removeEventListener("pointerup",L),A(!1);try{localStorage.setItem(UC,String(w.current))}catch{}};document.addEventListener("pointermove",k),document.addEventListener("pointerup",L)},[]),f=j.useMemo(()=>({theaterId:e,api:n}),[e,n]);return h.jsxs("div",{className:`right-rail${c?" is-open":""}${C?" is-dragging":""}`,role:"complementary","aria-label":"Activity Rail",children:[h.jsxs("div",{className:"right-rail-panel-slot",style:c?{width:b+u}:void 0,children:[c&&h.jsx("div",{className:"right-rail-resize-handle",onPointerDown:E,"aria-hidden":"true"}),_&&h.jsx(VB,{activePanel:_,activeId:r,ctx:f})]}),h.jsxs("nav",{className:"right-rail-icons",role:"tablist","aria-label":"Activity tools",children:[o.map(y=>h.jsx(Vy,{panel:y,isActive:r===y.id},y.id)),o.length>0&&a.length>0?h.jsx("div",{className:"right-rail-divider",role:"separator","aria-hidden":"true"}):null,a.map(y=>h.jsx(Vy,{panel:y,isActive:r===y.id},y.id))]})]})}const VB=j.memo(function({activePanel:n,activeId:r,ctx:a}){return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"right-rail-panel-head",children:[h.jsx("span",{className:"right-rail-panel-title",children:n.title}),h.jsx("button",{className:"right-rail-close-btn",type:"button","aria-label":`Close ${n.title}`,onClick:U7,children:"✕"})]}),h.jsx("div",{className:"right-rail-panel-body",role:"tabpanel","aria-labelledby":`rail-tab-${r}`,children:n.render(a)})]})});function Vy({panel:e,isActive:n}){const r=j.useCallback(()=>$7(e.id),[e.id]),a=typeof e.icon=="function"?e.icon():e.icon;return h.jsx("button",{id:`rail-tab-${e.id}`,className:`right-rail-ico${n?" is-active":""}`,type:"button",role:"tab","aria-selected":n,"aria-label":e.title,title:e.title,onClick:r,children:a})}const Yy=8,YB=260;function Xy(e){const{anchor:n,onClose:r}=e,[a,o]=j.useState(void 0);return j.useLayoutEffect(()=>{const g=Math.max(8,Math.min(n.left,window.innerWidth-208)),_=n.bottom+Yy,c=_+YB>window.innerHeight;o(c?{position:"fixed",left:g,top:"auto",bottom:Math.round(window.innerHeight-n.top+Yy)}:{position:"fixed",left:g,top:Math.round(_)})},[n]),j.useEffect(()=>{const g=_=>{_.key==="Escape"&&(_.preventDefault(),r())};return window.addEventListener("keydown",g),window.addEventListener("resize",r),window.addEventListener("scroll",r,!0),()=>{window.removeEventListener("keydown",g),window.removeEventListener("resize",r),window.removeEventListener("scroll",r,!0)}},[r]),Xs.createPortal(h.jsx("div",{className:"group-context-menu-overlay",role:"presentation",onPointerDown:r,children:a?h.jsx("div",{className:"group-context-menu-card",role:"menu","aria-label":e.kind==="chip"?"Operation options":`${e.group.name} options`,style:a,onPointerDown:g=>g.stopPropagation(),children:e.kind==="chip"?h.jsx(XB,{...e}):h.jsx(ZB,{...e})}):null}),document.body)}function XB({operation:e,groups:n,accentKey:r,actions:a,onClose:o}){const[g,_]=j.useState(!1),[c,u]=j.useState(`Group ${n.length+1}`),d=j.useRef(!1),b=j.useRef(null);j.useEffect(()=>{g&&b.current?.select()},[g]);const p=()=>{const w=c.trim();w&&(a.onCreateGroup(w),o())};return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"group-context-menu-section-label",children:"Group"}),n.map(w=>{const C=Wl(w.color),A=e.groupId===w.id;return h.jsxs("button",{type:"button",className:`group-context-menu-item${A?" is-selected":""}`,role:"menuitemradio","aria-checked":A,onClick:()=>{a.onSetGroupId(A?null:w.id),o()},children:[h.jsx("span",{className:"group-context-menu-item__dot",style:C?{background:C}:void 0,"aria-hidden":"true"}),h.jsx("span",{className:"group-context-menu-item__name",children:w.name}),A?h.jsx(JB,{}):null]},w.id)}),g?h.jsx("input",{ref:b,className:"group-context-menu-new-input",type:"text",value:c,onChange:w=>u(w.target.value),onCompositionStart:()=>{d.current=!0},onCompositionEnd:()=>{d.current=!1},onKeyDown:w=>{w.key==="Enter"&&!d.current&&(w.preventDefault(),p()),w.key==="Escape"&&(w.preventDefault(),_(!1))},onBlur:()=>_(!1),"aria-label":"New group name",placeholder:"Group name"}):h.jsx("button",{type:"button",className:"group-context-menu-item group-context-menu-item--new",role:"menuitem",onClick:()=>_(!0),children:h.jsx("span",{className:"group-context-menu-item__new-label",children:"+ New group"})}),h.jsx("div",{className:"group-context-menu-divider","aria-hidden":"true"}),h.jsx("div",{className:"group-context-menu-section-label",children:"Accent"}),h.jsxs("button",{type:"button",className:"accent-popover-swatch accent-popover-swatch--clear",role:"menuitem","aria-label":"No accent","aria-pressed":r===null,onClick:()=>{a.onSetAccent(null),o()},children:[h.jsx("span",{}),"None"]}),h.jsx("div",{className:"group-context-menu-swatches",children:bh.map(w=>h.jsx("button",{type:"button",className:"accent-popover-swatch",role:"menuitem","aria-label":w.label,"aria-pressed":r===w.key,onClick:()=>{a.onSetAccent(w.key),o()},children:h.jsx("span",{style:{background:w.color}})},w.key))})]})}function ZB({group:e,actions:n,onClose:r}){const[a,o]=j.useState(e.name),[g,_]=j.useState(!1),c=j.useRef(!1),u=()=>{const d=a.trim();if(!d||d===e.name){r();return}n.onRename(d),r()};return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"group-context-menu-section-label",children:"Color"}),h.jsx("div",{className:"group-context-menu-swatches",children:bh.map(d=>h.jsx("button",{type:"button",className:"accent-popover-swatch",role:"menuitem","aria-label":d.label,"aria-pressed":e.color===d.key,onClick:()=>{n.onSetColor(d.key),r()},children:h.jsx("span",{style:{background:d.color}})},d.key))}),h.jsx("div",{className:"group-context-menu-divider","aria-hidden":"true"}),h.jsx("div",{className:"group-context-menu-section-label",children:"Rename"}),h.jsx("input",{className:"group-context-menu-new-input",type:"text",value:a,onChange:d=>o(d.target.value),onCompositionStart:()=>{c.current=!0},onCompositionEnd:()=>{c.current=!1},onKeyDown:d=>{d.key==="Enter"&&!c.current&&(d.preventDefault(),u()),d.key==="Escape"&&(d.preventDefault(),r())},onBlur:u,"aria-label":"Group name"}),h.jsx("div",{className:"group-context-menu-divider","aria-hidden":"true"}),h.jsx("button",{type:"button",className:`group-context-menu-item group-context-menu-item--danger${g?" is-armed":""}`,role:"menuitem",onClick:()=>{if(!g){_(!0);return}n.onUngroupAll(),r()},"aria-label":g?"Confirm: remove all members and delete group":"Ungroup all members and delete group",children:g?"Confirm ungroup all?":"Ungroup all"})]})}function JB(){return h.jsx("svg",{viewBox:"0 0 12 12",className:"group-context-menu-item__check","aria-hidden":"true",children:h.jsx("path",{d:"M2 6l3 3 5-5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function QB(e,n,r,a){if(!r)return{groupId:null,index:0};for(const g of n){const _=g.groupId??"__ungrouped__",c=r.querySelector(`[data-drop-zone-group-id="${_}"]`);if(!c)continue;const u=c.getBoundingClientRect();if(e<u.top||e>u.bottom)continue;const d=c.querySelector(`[data-group-section-id="${_}"]`);if(!d||e<d.getBoundingClientRect().top)return{groupId:g.groupId,index:0};const b=Array.from(d.querySelectorAll("[data-side-bar-chip-id]"));for(const p of b){const w=p.dataset.sideBarChipId;if(!w||w===a)continue;const C=p.getBoundingClientRect();if(e<=C.top+C.height/2)return{groupId:g.groupId,index:Math.max(0,g.entryIds.indexOf(w))}}return{groupId:g.groupId,index:g.entryIds.length}}const o=n[n.length-1];return{groupId:o?.groupId??null,index:o?.entryIds.length??0}}function ej(e,n,r,a){const o=e.filter(b=>b!==n),g=new Set(a),_=o.filter(b=>g.has(b)),c=Math.max(0,Math.min(r,_.length));if(_.length===0)return[...o,n];if(c<_.length){const b=o.indexOf(_[c]),p=[...o];return p.splice(b,0,n),p}const u=o.indexOf(_[_.length-1]),d=[...o];return d.splice(u+1,0,n),d}function tj(e,n,r,a){const o=new Set(a),g=e.filter(p=>o.has(p)),_=g.indexOf(n),c=g.filter(p=>p!==n),u=r>_?r-1:r,d=Math.max(0,Math.min(u,c.length));c.splice(d,0,n);let b=0;return e.map(p=>o.has(p)?c[b++]??p:p)}function nj(e,n,r){if(r.length!==n.length)return[...e];const a=new Set(n);let o=0;return e.map(g=>a.has(g)?r[o++]??g:g)}function ij(e,n,r){if(e.indexOf(n)===-1)return[...e];const o=e.filter(_=>_!==n),g=Math.max(0,Math.min(r,o.length));return o.splice(g,0,n),o}function rj({entry:e,index:n,isCloseArmed:r,accentValue:a,dragging:o,dragOffsetY:g,dropTarget:_,onArmClose:c,onDisarmClose:u,onClose:d,onFocus:b,onKeyboardMove:p,onPointerDragStart:w,onOpenAccent:C,onRename:A}){const E=j.useRef(!1),{operation:f,active:y,minimized:m,notificationCount:S}=e,k=sj(f),L=CC({currentTitle:k,onCommit:B=>A(f.id,B),onBegin:u}),R=["side-bar-chip",y?"side-bar-chip--active":"",m?"side-bar-chip--minimized":"",o?"side-bar-chip--dragging":"",_?"side-bar-chip--drop-target":""].filter(Boolean).join(" "),M=["side-bar-chip-close",r?"is-armed":""].filter(Boolean).join(" "),T={"--i":n,...a?{"--chip-accent":a}:{},...o?{"--drag-dy":`${Math.round(g)}px`}:{}},I=()=>{if(u(),E.current){E.current=!1;return}b(f.id)},K=B=>{B.stopPropagation()},F=B=>{if(B.stopPropagation(),!r){c(f.id);return}u(),d(f.id)},G=B=>{B.preventDefault(),u(),C(f.id,B.currentTarget.getBoundingClientRect())};return h.jsxs("li",{"data-side-bar-chip-id":f.id,className:R,role:"button",tabIndex:0,"aria-label":y?`${k} (focused)`:`Focus operation ${k}`,"aria-current":y?"true":void 0,title:y?"Focused · double-click to rename · right-click to set accent":"Click to focus · double-click to rename · right-click to set accent",style:T,onClick:I,onContextMenu:G,onFocus:()=>{r||u()},onPointerDown:B=>w(B,f.id),onPointerUp:()=>{o&&(E.current=!0)},onKeyDown:B=>{if(B.target===B.currentTarget){if(B.altKey&&B.shiftKey&&(B.key==="ArrowUp"||B.key==="ArrowDown")){B.preventDefault(),p(f.id,B.key==="ArrowUp"?-1:1);return}(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),I())}},children:[h.jsx("span",{className:"side-bar-chip-beacon-button","aria-hidden":"true",children:h.jsx("span",{className:"side-bar-chip-op-icon",children:e.icon??h.jsx(oj,{})})}),L.renaming?h.jsx("input",{className:"side-bar-chip-rename-input",ref:L.inputRef,value:L.draftTitle,"aria-label":`Rename operation ${k}`,onChange:B=>L.setDraftTitle(B.target.value),onKeyDown:L.handleKeyDown,onBlur:L.handleBlur,onPointerDown:B=>B.stopPropagation(),onClick:B=>B.stopPropagation()}):h.jsx("span",{className:"side-bar-chip-name",onDoubleClick:L.begin,children:k}),S>0?h.jsx("span",{className:"side-bar-chip-count",children:S}):null,h.jsx("button",{type:"button",className:M,onPointerDown:K,onClick:F,"aria-label":r?`Confirm close operation ${k}`:`Close operation ${k}`,title:r?"Confirm close":"Close operation",children:r?"Close?":h.jsx(aj,{})})]})}function sj(e){return e.title}function aj(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.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 oj(){return h.jsx("svg",{viewBox:"0 0 14 14","aria-hidden":"true",children:h.jsx("rect",{x:"2",y:"2",width:"10",height:"10",rx:"2.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3"})})}function lj({group:e,count:n,collapsed:r,tier:a,onToggle:o,onContextMenu:g}){const _=Wl(e.color),c=_?{"--grp-color":_}:void 0,u=d=>{d.preventDefault(),g(e.id,d.currentTarget.getBoundingClientRect())};return a==="rail"?h.jsx("div",{className:"side-bar-group-header side-bar-group-header--rail","data-tier":"rail",style:c,onClick:()=>o(e.id),onContextMenu:u,role:"button",tabIndex:0,"aria-label":`Group ${e.name}`,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),o(e.id))},children:h.jsx("span",{className:"side-bar-group-header__dot","aria-hidden":"true"})}):h.jsxs("div",{className:"side-bar-group-header",style:c,onContextMenu:u,role:"group","aria-label":e.name,children:[h.jsx("button",{type:"button",className:"side-bar-group-header__toggle",onClick:()=>o(e.id),"aria-expanded":!r,"aria-label":r?`Expand group ${e.name}`:`Collapse group ${e.name}`,title:r?"Expand":"Collapse",children:h.jsx(cj,{collapsed:r})}),h.jsx("span",{className:"side-bar-group-header__name",children:e.name}),h.jsx("span",{className:"side-bar-group-header__count","aria-label":`${n} operations`,children:n})]})}function cj({collapsed:e}){return h.jsx("svg",{viewBox:"0 0 12 12","aria-hidden":"true",className:`side-bar-group-header__arrow${e?" is-collapsed":""}`,children:h.jsx("path",{d:"M3 5l3 3 3-3",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}const FC="fleet-console.operations.side-width",WC="fleet-console.operations.side-collapsed",rh=56,uj=180,Zy=uj;function hj(){return typeof window<"u"?window.innerWidth-480:800}function dj(){try{if(typeof window>"u")return Zy;const e=localStorage.getItem(FC);if(e!==null){const n=parseInt(e,10);if(!isNaN(n)&&n>=rh)return n}}catch{}return Zy}function fj(){try{return typeof window>"u"?!1:localStorage.getItem(WC)==="1"}catch{}return!1}let Kl={width:dj(),collapsed:fj()};const Tg=new Set;function GC(){for(const e of Tg)e()}function Jy(){return Kl}function pj(e){return Tg.add(e),()=>{Tg.delete(e)}}function gj(){return j.useSyncExternalStore(pj,Jy,Jy)}function Qy(e){const n=Math.max(rh,Math.min(hj(),e));Kl={...Kl,width:n};try{typeof window<"u"&&localStorage.setItem(FC,String(n))}catch{}GC()}function mj(e){Kl={...Kl,collapsed:e};try{typeof window<"u"&&localStorage.setItem(WC,e?"1":"0")}catch{}GC()}function _j(e){return e<120?"rail":e<240?"list":"detail"}const vj=1500,bj=6,eS=34,tS=18;function yj({operations:e,groups:n,minimized:r,activeOperationId:a,operationNotifications:o,catalog:g,canLaunch:_,mapFullscreen:c,radarEnabled:u,perimeterEnabled:d,renderKindIcon:b,onLaunchKind:p,onResetView:w,onMaximizeMap:C,onToggleRadar:A,onTogglePerimeter:E,onClose:f,onFocus:y,onSetAccent:m,onRename:S,onSetGroupId:k,onCreateGroup:L,onSetGroupColor:R,onRenameGroup:M,onUngroupAll:T}){const I=j.useRef(null),K=gj(),{width:F,collapsed:G}=K,B=G?"rail":_j(F),Y=NS(),X=j.useRef(null),[H,q]=j.useState(null),[V,D]=j.useState(null),P=j.useRef(null),O=j.useRef([]),z=j.useRef([]),W=j.useRef([]),Z=j.useRef(k),[ie,he]=j.useState(null),[te,$]=j.useState(null),[le,ge]=j.useState(null),we=vA(),Se=new Set(r),je=new Set(we),Ie=cw(e,Y.operationOrder).map(ve=>{const $e=g.find(at=>at.id===ve.pluginId)?.kinds.find(at=>at.type===ve.type)??null,Ze=$e?b(ve.pluginId,$e):null;return{operation:ve,active:a===ve.id,minimized:Se.has(ve.id),notificationCount:o[ve.id]?.count??0,icon:Ze}}),Ge=Sj(Ie,n,Y.operationOrder),vt=Ge.flatMap(ve=>je.has(ve.groupId??"")?[]:ve.entries),Le=Ie.map(ve=>ve.operation.id),Tt=j.useCallback(()=>{X.current!==null&&(window.clearTimeout(X.current),X.current=null)},[]),Xt=j.useCallback(()=>{Tt(),q(null)},[Tt]),vn=j.useCallback(ve=>{Tt(),q(ve),X.current=window.setTimeout(()=>{X.current=null,q(null)},vj)},[Tt]);j.useEffect(()=>Tt,[Tt]),j.useEffect(()=>{H!==null&&(Ie.some(ve=>ve.operation.id===H)||Xt())},[H,Ie,Xt]);const an=ie?.kind==="chip"?Ie.find(ve=>ve.operation.id===ie.operationId)?.operation??null:null,kn=ie?.kind==="group"?n.find(ve=>ve.id===ie.groupId)??null:null,Zt=(ve,$e)=>{const Ze=vt.findIndex(Ot=>Ot.operation.id===ve);if(Ze===-1)return;const at=Math.max(0,Math.min(vt.length-1,Ze+$e));if(at===Ze)return;const Ve=vt.map(Ot=>Ot.operation.id),on=ij(Ve,ve,at);Of(nj(Le,Ve,on))},ut=Ge.map(ve=>({groupId:ve.groupId,entryIds:ve.entries.map($e=>$e.operation.id)}));j.useEffect(()=>{O.current=Ie,z.current=Le,W.current=ut,Z.current=k});const Rt=ve=>{P.current=ve,D(ve)},xt=V?.pointerId??null;j.useEffect(()=>{if(xt===null)return;const ve=at=>{if(at.pointerId!==xt)return;const Ve=P.current;if(!Ve)return;if(at.buttons===0){Rt(null);return}const on=Math.hypot(at.clientX-Ve.startX,at.clientY-Ve.startY);if(!Ve.dragging&&on<bj)return;Ve.dragging&&at.preventDefault();const Ot=QB(at.clientY,W.current,I.current,Ve.sourceId);wj(at.clientY,I.current),Rt({...Ve,currentY:at.clientY,dragging:!0,dropIndex:Ot.index,dropGroupId:Ot.groupId})},$e=at=>{if(at.pointerId!==xt)return;const Ve=P.current;if(Rt(null),!Ve?.dragging)return;const{sourceId:on,sourceGroupId:Ot,dropIndex:Tn,dropGroupId:Un}=Ve,Dt=W.current,Q=z.current;if(Un!==Ot){const ke=Dt.find(Ce=>Ce.groupId===Un)?.entryIds??[];Of(ej(Q,on,Tn,ke)),Z.current(on,Un);return}const ye=Dt.find(ht=>ht.groupId===Ot)?.entryIds??[],Oe=ye.indexOf(on);if(Oe===-1||Tn===Oe)return;const bt=tj(Q,on,Tn,ye);Of(bt)},Ze=at=>{at.pointerId===xt&&Rt(null)};return window.addEventListener("pointermove",ve),window.addEventListener("pointerup",$e),window.addEventListener("pointercancel",Ze),()=>{window.removeEventListener("pointermove",ve),window.removeEventListener("pointerup",$e),window.removeEventListener("pointercancel",Ze)}},[xt]);const Ut=(ve,$e)=>{if(ve.button!==0||ve.target instanceof Element&&ve.target.closest("button"))return;he(null),Xt();const at=Ie.find(Ve=>Ve.operation.id===$e)?.operation.groupId??null;Rt({sourceId:$e,sourceGroupId:at,pointerId:ve.pointerId,startX:ve.clientX,startY:ve.clientY,currentY:ve.clientY,dragging:!1,dropIndex:Le.indexOf($e),dropGroupId:at})},Kt=j.useCallback(ve=>{ve.preventDefault();const $e=ve.clientX,Ze=K.width,at=on=>{const Ot=on.clientX-$e;Qy(Ze+Ot)},Ve=()=>{document.removeEventListener("pointermove",at),document.removeEventListener("pointerup",Ve)};document.addEventListener("pointermove",at),document.addEventListener("pointerup",Ve)},[K.width]),Xn=()=>{mj(!G),G||Qy(rh)},bn=ve=>{if(te){$(null);return}ge(null);const $e=ve.currentTarget.getBoundingClientRect();$({anchor:{x:$e.right+8,y:$e.top},viewportBounds:{width:window.innerWidth,height:window.innerHeight}})},Pn=ve=>{ve.defaultPrevented||(ve.preventDefault(),ge(null),he(null),$({anchor:{x:ve.clientX,y:ve.clientY},viewportBounds:{width:window.innerWidth,height:window.innerHeight}}))},dt=ve=>{if(le){ge(null);return}$(null);const $e=ve.currentTarget.getBoundingClientRect();ge({anchor:{x:$e.right+8,y:$e.top},viewportBounds:{width:window.innerWidth,height:window.innerHeight}})},An=G?rh:F;return Ie.length===0&&B==="rail"?h.jsxs("aside",{className:"operations-side-bar","data-tier":B,"data-canvas-blocker":!0,style:{"--side-bar-width":`${An}px`},onContextMenu:Pn,children:[h.jsx("header",{className:"operations-side-bar-header",children:h.jsx("button",{type:"button",className:"side-bar-new-btn",onClick:bn,"aria-label":"New Operation",title:"New Operation",children:h.jsx(nS,{})})}),h.jsx("div",{className:"operations-side-bar-resize-handle",onPointerDown:Kt,onDoubleClick:Xn,"aria-hidden":"true"}),te?Xs.createPortal(h.jsx(Bu,{anchor:te.anchor,viewportBounds:te.viewportBounds,placement:"cursor",mode:"launch",catalog:g,canLaunch:_,renderKindIcon:b,onLaunchKind:(ve,$e)=>{$(null),p(ve,$e)},onResetView:w,onClose:()=>$(null)},`${te.anchor.x}:${te.anchor.y}`),document.body):null]}):h.jsxs("aside",{className:"operations-side-bar","data-tier":B,"data-canvas-blocker":!0,style:{"--side-bar-width":`${An}px`},onContextMenu:Pn,children:[h.jsxs("header",{className:"operations-side-bar-header",children:[h.jsxs("button",{type:"button",className:"side-bar-new-btn",onClick:bn,"aria-label":"New Operation","aria-expanded":te!==null,title:"New Operation",children:[h.jsx(nS,{}),B!=="rail"?h.jsx("span",{children:"Operation"}):null]}),B!=="rail"?h.jsx("button",{type:"button",className:"side-bar-settings-btn",onClick:dt,"aria-expanded":le!==null,"aria-label":"Map and display controls",title:"Map and display controls",children:h.jsx(xj,{})}):null]}),h.jsx("ol",{className:"operations-side-bar-chips",ref:I,"aria-label":"Operations",children:Ge.map(ve=>{const $e=ve.groupId!==null&&je.has(ve.groupId),Ze=ve.group?Wl(ve.group.color):null,at=Ze?{"--grp-color":Ze}:void 0;return h.jsxs("li",{"data-drop-zone-group-id":ve.groupId??"__ungrouped__",className:ve.groupId?"side-bar-group-section":"side-bar-ungrouped-section",style:at,children:[ve.group?h.jsx(lj,{group:ve.group,count:ve.entries.length,collapsed:$e,tier:B,onToggle:_A,onContextMenu:(Ve,on)=>he({kind:"group",groupId:Ve,anchor:on})}):ve.entries.length>0?h.jsx("div",{className:"side-bar-ungrouped-label","aria-label":"Ungrouped operations",children:B!=="rail"?h.jsx("span",{children:"Ungrouped"}):null}):null,$e?null:h.jsx("ol",{className:["side-bar-group-chips",V?.dragging&&V.dropGroupId===ve.groupId&&V.dropGroupId!==V.sourceGroupId?"side-bar-section--drop-target":""].filter(Boolean).join(" "),"data-group-section-id":ve.groupId??"__ungrouped__","aria-label":ve.group?ve.group.name:"Ungrouped",children:ve.entries.map(Ve=>{const on=Ie.indexOf(Ve),Ot=ve.entries.indexOf(Ve),Tn=Y.operationAccent[Ve.operation.id]??Py(Ve.operation),Un=Tn?Wl(Tn):null;return h.jsx(rj,{entry:Ve,index:on,isCloseArmed:H===Ve.operation.id,accentValue:Un,dragging:V?.sourceId===Ve.operation.id&&V.dragging,dragOffsetY:V?.sourceId===Ve.operation.id&&V.dragging?V.currentY-V.startY:0,dropTarget:V?.dragging===!0&&V.dropGroupId===ve.groupId&&V.dropGroupId===V.sourceGroupId&&V.dropIndex===Ot&&V.sourceId!==Ve.operation.id,onArmClose:vn,onDisarmClose:Xt,onClose:f,onFocus:y,onKeyboardMove:Zt,onPointerDragStart:Ut,onOpenAccent:(Dt,Q)=>he({kind:"chip",operationId:Dt,anchor:Q}),onRename:S},Ve.operation.id)})})]},ve.groupId??"__ungrouped__")})}),h.jsx("div",{className:"operations-side-bar-resize-handle",onPointerDown:Kt,onDoubleClick:Xn,"aria-hidden":"true"}),te?Xs.createPortal(h.jsx(Bu,{anchor:te.anchor,viewportBounds:te.viewportBounds,placement:"cursor",mode:"launch",catalog:g,canLaunch:_,renderKindIcon:b,onLaunchKind:(ve,$e)=>{$(null),p(ve,$e)},onResetView:w,onClose:()=>$(null)},`${te.anchor.x}:${te.anchor.y}`),document.body):null,le?Xs.createPortal(h.jsx(Bu,{anchor:le.anchor,viewportBounds:le.viewportBounds,placement:"cursor",mode:"controls",catalog:g,canLaunch:_,mapFullscreen:c,radarEnabled:u,perimeterEnabled:d,renderKindIcon:b,onLaunchKind:p,onResetView:()=>{ge(null),w()},onMaximizeMap:C,onToggleRadar:A,onTogglePerimeter:E,onClose:()=>ge(null)},`settings:${le.anchor.x}:${le.anchor.y}`),document.body):null,ie?.kind==="chip"&&an?h.jsx(Xy,{kind:"chip",operation:an,groups:n,accentKey:Y.operationAccent[an.id]??Py(an),anchor:ie.anchor,actions:{onSetAccent:ve=>m(an.id,ve),onSetGroupId:ve=>k(an.id,ve),onCreateGroup:ve=>L(an.theaterId,ve,an.id)},onClose:()=>he(null)}):ie?.kind==="group"&&kn?h.jsx(Xy,{kind:"group-header",group:kn,anchor:ie.anchor,actions:{onSetColor:ve=>R(kn.id,ve),onRename:ve=>M(kn.id,ve),onUngroupAll:()=>T(kn.id)},onClose:()=>he(null)}):null]})}function Sj(e,n,r){const a=[...n].sort((c,u)=>c.order-u.order||c.createdAt-u.createdAt),o=a.map(c=>({groupId:c.id,group:c,entries:[]})),g={groupId:null,group:null,entries:[]},_=new Map(a.map(c=>[c.id,c]));for(const c of e){const u=c.operation.groupId??null;u!==null&&_.has(u)?o.find(b=>b.groupId===u)?.entries.push(c):g.entries.push(c)}return[...o,g]}function wj(e,n){if(!n)return;const r=n.getBoundingClientRect();e<r.top+eS?n.scrollTop-=tS:e>r.bottom-eS&&(n.scrollTop+=tS)}function nS(){return h.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[h.jsx("circle",{cx:"12",cy:"12",r:"7",fill:"none",stroke:"currentColor",strokeWidth:"1.4"}),h.jsx("path",{d:"M12 2.4v3.4M12 18.2v3.4M2.4 12h3.4M18.2 12h3.4",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),h.jsx("path",{d:"M12 9.2v5.6M9.2 12h5.6",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}function xj(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.jsx("circle",{cx:"8",cy:"8",r:"2.2",fill:"none",stroke:"currentColor",strokeWidth:"1.25"}),h.jsx("path",{d:"M8 1.4v1.4M8 13.2v1.4M1.4 8h1.4M13.2 8h1.4M3.3 3.3l1 1M11.7 11.7l1 1M11.7 3.3l-1 1M3.3 11.7l-1 1",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})]})}const Cj='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ej(){const{codexReader:e,codexReaderExpanded:n,activeTheaterId:r}=Hr(),a=j.useRef(null),o=j.useRef(null),g=j.useRef(null),_=e?`${e.kind}:${e.kind==="entry"?e.entryId:e.kind==="drydock"?e.patchId??"":e.id??""}`:null,c=e!==null&&n,u=j.useCallback(()=>{OB(),zT()},[]);return j.useEffect(()=>{if(!c)return;const d=e;document.body.setAttribute("data-codex-reading","true");const b=document.querySelector(".operations-canvas"),p=document.querySelector(".operations-side-bar");b?.setAttribute("inert",""),p?.setAttribute("inert","");const w=C=>{if(C.key==="Escape"){C.preventDefault(),C.stopPropagation(),u();return}C.key==="Tab"&&kj(a.current,C)};return window.addEventListener("keydown",w,!0),()=>{window.removeEventListener("keydown",w,!0),document.body.removeAttribute("data-codex-reading"),b?.removeAttribute("inert"),p?.removeAttribute("inert");const C=d?.kind==="entry"?d.entryId:null;(document.querySelector('[data-codex-expand="true"]')??(C?document.querySelector(`.codex-nav-entry.is-current[data-entry-id="${C}"]`):null)??document.querySelector(".codex-navigator .codex-nav-search-input"))?.focus()}},[c]),j.useEffect(()=>{if(!c||!o.current||!g.current||!e)return;const d=e.kind,b=d==="drydock"?e.patchId:d==="conflicts"?e.id:void 0;zC(o.current,g.current,{initialEntryId:d==="entry"?e.entryId:"",kind:d,subId:b,theaterId:r,onRelatedClick:p=>{El({kind:"entry",entryId:p}),uw()},onClose:u}),requestAnimationFrame(()=>{a.current?.querySelector("[data-sheet-initial-focus]")?.focus()})},[c,_]),c?Xs.createPortal(h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"codex-reading-scrim",onClick:u,"aria-hidden":"true"}),h.jsxs("div",{ref:a,className:"codex-reading-sheet",role:"dialog","aria-modal":"true","aria-label":"Codex reading",children:[h.jsxs("div",{className:"codex-reading-sheet-head",children:[h.jsx("span",{className:"codex-reading-sheet-eyebrow",children:"Codex · Reading"}),h.jsx("button",{"data-sheet-initial-focus":!0,className:"codex-reading-sheet-close",type:"button","aria-label":"Close reading",onClick:u,children:"✕"})]}),h.jsxs("div",{className:"codex-reading-sheet-body",children:[h.jsx("div",{ref:o,className:"codex-reading-sheet-read"}),h.jsx("aside",{ref:g,className:"codex-reading-sheet-toc","aria-label":"On this page"})]})]})]}),document.body):null}function kj(e,n){if(!e)return;const r=[...e.querySelectorAll(Cj)].filter(g=>!g.closest("[inert]"));if(r.length===0)return;const a=r[0],o=r[r.length-1];n.shiftKey?document.activeElement===a&&(n.preventDefault(),o.focus()):document.activeElement===o&&(n.preventDefault(),a.focus())}const Aj=hh().api,Rg=560,Lg=360,Sp=new Set;function Tj({state:e}){const n=j.useRef(null),r=DS(),a=BS(),o=gA(),g=mA(),_=OS(),c=Zl(),[u,d]=j.useState([]),b=j.useMemo(()=>Rj(e).map(H=>H.id),[e.operations,e.activeTheaterId]),p=j.useRef(e);p.current=e,j.useEffect(()=>{xA(e.activeTheaterId)},[e.activeTheaterId]),j.useEffect(()=>{if(!e.activeTheaterId){d([]);return}oS().then(d).catch(()=>{})},[e.activeTheaterId]),j.useEffect(()=>{const H={current:r},q=V=>{if(!V.altKey||V.metaKey||V.ctrlKey||V.shiftKey||V.key!=="ArrowLeft"&&V.key!=="ArrowRight")return;const D=document.activeElement;if(D instanceof HTMLElement&&D.matches("input, textarea, [contenteditable='true']")&&!D.closest(".xterm"))return;const P=p.current,O=so(),z=jT(P.operations.filter(ie=>ie.theaterId===P.activeTheaterId),P.groups.filter(ie=>ie.theaterId===P.activeTheaterId),O.operationOrder,O.collapsedGroups).map(ie=>ie.id);if(z.length===0)return;V.preventDefault(),V.stopImmediatePropagation();const W=H.current??p.current.activeOperationId,Z=BT(z,W,V.key==="ArrowRight"?1:-1);if(Z){if(H.current){ar(Z),Nl(Z);return}ch(Z)}};return window.addEventListener("keydown",q,!0),()=>window.removeEventListener("keydown",q,!0)},[r]),j.useEffect(()=>{for(const H of b)SA(H);e.operationsHydrated&&wA(b)},[b,e.operationsHydrated]),j.useEffect(()=>{const H=e.pendingOperationFocus;if(H===null)return;if(Dp()!==null){Nl(H),N1();return}ao();const q=iS(n.current);q&&x1(H,q),N1()},[e.pendingOperationFocus]);const w=!!e.activeTheaterId&&!e.addingTheater,C=(e.operations??[]).filter(H=>H.theaterId===e.activeTheaterId),A=(e.groups??[]).filter(H=>H.theaterId===e.activeTheaterId),E=j.useCallback((H,q)=>c.plugins.find(D=>D.id===H)?.renderLaunchIcon?.(q)??null,[c.plugins]),f=j.useCallback((H,q,V)=>{if(!p.current.activeTheaterId)return;const D={...rS(V),zIndex:ta()};wp(H,q,D,p.current.activeTheaterId,c.plugins)},[c.plugins]),y=j.useCallback((H,q)=>{if(!p.current.activeTheaterId)return;const V=Mj(n.current),D={...rS(V),zIndex:ta()};wp(H,q,D,p.current.activeTheaterId,c.plugins)},[c.plugins]),m=j.useCallback((H,q,V)=>{p.current.activeTheaterId&&wp(H,q,V,p.current.activeTheaterId,c.plugins)},[c.plugins]),S=j.useCallback(()=>{jS({x:0,y:0,zoom:1})},[]),k=j.useCallback(()=>{AA()},[]),L=j.useCallback(()=>{CA()},[]),R=j.useCallback(()=>{EA()},[]),M=j.useCallback(H=>{const q=p.current.operations.find(z=>z.id===H);if(!q)return;const V=Dp();if(V!==null&&V!==H){ar(H),Nl(H);return}const D=so(),P=D.operations[H]??q.geometry??Lj(q);D.operations[H]||jp(H,P),yA(H),ar(H);const O=iS(n.current);O&&x1(H,O)},[]),T=j.useCallback((H,q)=>{Ru(H,{accent:q}).then(()=>Pi(null)).then(zi).catch(()=>{})},[]),I=j.useCallback((H,q)=>{VS(H,q).then(()=>Pi(null)).then(zi).catch(()=>{})},[]),K=j.useCallback((H,q)=>{Ru(H,{groupId:q}).then(()=>Pi(null)).then(zi).catch(()=>{})},[]),F=j.useCallback((H,q,V)=>{lT({theaterId:H,name:q,color:"blue"}).then(D=>Ru(V,{groupId:D.id})).then(()=>Promise.all([Pi(null).then(zi),xl().then(Cl)])).catch(()=>{})},[]),G=j.useCallback((H,q)=>{q&&L1(H,{color:q}).then(()=>xl()).then(Cl).catch(()=>{})},[]),B=j.useCallback((H,q)=>{L1(H,{name:q}).then(()=>xl()).then(Cl).catch(()=>{})},[]),Y=j.useCallback(H=>{cT(H).then(()=>Promise.all([Pi(null).then(zi),xl().then(Cl)])).catch(()=>{})},[]),X=j.useCallback(H=>{if(Sp.has(H))return;Sp.add(H);const q=p.current.operations.find(D=>D.id===H)?.pluginId,V=(q?c.plugins.find(D=>D.id===q):null)??null;Nj(H,V).finally(()=>Sp.delete(H))},[c.plugins]);return h.jsxs("div",{className:"console-body is-canvas",ref:n,children:[h.jsx(yj,{operations:C,groups:A,minimized:a,activeOperationId:e.activeOperationId,operationNotifications:e.operationNotifications,catalog:u,canLaunch:w,mapFullscreen:_,radarEnabled:o,perimeterEnabled:g,renderKindIcon:E,onLaunchKind:y,onResetView:S,onMaximizeMap:k,onToggleRadar:L,onTogglePerimeter:R,onClose:X,onFocus:M,onSetAccent:T,onRename:I,onSetGroupId:K,onCreateGroup:F,onSetGroupColor:G,onRenameGroup:B,onUngroupAll:Y}),h.jsx(k7,{state:e,catalog:u,canLaunch:w,mapFullscreen:_,radarEnabled:o,perimeterEnabled:g,renderKindIcon:E,onLaunchKind:f,onLaunchAtGeometry:m,onResetView:S,onMaximizeMap:k,onToggleRadar:L,onTogglePerimeter:R,onClose:X,onFocus:M,onSetAccent:T}),h.jsx(KB,{theaterId:e.activeTheaterId,api:Aj}),h.jsx(Ej,{})]})}function Rj(e){return e.operations.filter(n=>n.theaterId===e.activeTheaterId).sort(Fp)}function iS(e){if(!e)return null;const n=e.getBoundingClientRect();return{width:n.width,height:n.height}}function Lj(e){return e.geometry??{x:0,y:0,width:Rg,height:Lg,zIndex:0}}function Mj(e){const n=so(),r=e?.clientWidth??800,a=e?.clientHeight??600;return Fl({x:r/2,y:a/2},n.viewport)}function rS(e){return{x:e.x-Rg/2,y:e.y-Lg/2,width:Rg,height:Lg}}async function wp(e,n,r,a,o){const g=o.find(p=>p.id===e),c=hh(()=>{Pi(null).then(zi).catch(()=>{})});let u=null;if(g?.launch?u=(await g.launch({theaterId:a,kind:n,geometry:r,operations:c.operations})).id:u=(await c.operations.create({theaterId:a,type:n.type,pluginId:e,title:n.title,geometry:r})).id,await Pi(null).then(zi).catch(()=>{}),!u)return;const d=pA()===a,b=$p().operations.some(p=>p.id===u);d&&b&&Dp()!==null?(ar(u),Nl(u)):ch(u)}async function Nj(e,n){try{n?.closeOperation&&await n.closeOperation(e)}catch{}await fetch(`/api/v1/operations/${encodeURIComponent(e)}`,{method:"DELETE"}).catch(()=>{}),await Pi(null).then(zi).catch(()=>{})}const Oj=6e3;function Dj(){const e=Hr(),n=$i(),r=Zl(),a=n.pathname,g=OS()&&a.startsWith("/operations"),_=a.startsWith("/operations");return j.useEffect(()=>{const c=hh(()=>{Pi().then(zi).catch(()=>{})}),u=r.plugins.map(d=>d.install?.(c)).filter(d=>typeof d=="function");return()=>{for(const d of u)d()}},[r.plugins]),j.useEffect(()=>{kT(_)},[_]),j.useEffect(()=>{const c=document.querySelector(".topbar");if(!c)return;const u=()=>{document.documentElement.style.setProperty("--console-topbar-offset",`${Math.round(c.getBoundingClientRect().bottom)}px`)};u();const d=new ResizeObserver(u);return d.observe(c),window.addEventListener("resize",u),()=>{d.disconnect(),window.removeEventListener("resize",u)}},[]),j.useEffect(()=>{const c=new AbortController;iT(c.signal).then(b=>{LT(b),B1()}).catch(b=>{c.signal.aborted||(tt({theaterError:b instanceof Error?b.message:String(b)}),B1())}),Pi(null,c.signal).then(zi).catch(()=>{}),xl(null,c.signal).then(Cl).catch(()=>{}),iw(),GS({signal:c.signal}).then(rw).catch(b=>{c.signal.aborted||sw(b instanceof Error?b.message:String(b))});const u=()=>{rT(e.activeTheaterId,c.signal).then(AT).catch(()=>{})};u();const d=window.setTimeout(u,Oj);return()=>{window.clearTimeout(d),c.abort()}},[]),j.useEffect(()=>{const c=u=>{(u.metaKey||u.ctrlKey)&&u.key.toLowerCase()==="k"&&(u.preventDefault(),u.stopImmediatePropagation(),IT())};return window.addEventListener("keydown",c,!0),()=>window.removeEventListener("keydown",c,!0)},[]),h.jsxs("div",{className:`console-shell ${g?"is-map-fullscreen":""}`,children:[h.jsx(kR,{state:e}),h.jsxs(Lk,{children:[h.jsx(Fa,{path:"/",element:h.jsx(v1,{to:"/operations",replace:!0})}),h.jsx(Fa,{path:"/operations",element:h.jsx(Tj,{state:e})}),h.jsx(Fa,{path:"/carrier-settings",element:h.jsx(VD,{})}),h.jsx(Fa,{path:"/settings",element:h.jsx(T8,{})}),h.jsx(Fa,{path:"*",element:h.jsx(v1,{to:"/operations",replace:!0})})]}),h.jsx(fR,{state:e}),h.jsx(VR,{state:e}),h.jsx(uR,{state:e}),h.jsx(bR,{open:e.connectionError!==null,tone:"error",title:"Console link interrupted",message:e.connectionError??void 0})]})}globalThis.__fleetConsoleRuntime__={react:zu,"react/jsx-runtime":ZE,"@fleet-console/sdk/plugin/browser":g5,"@fleet-console/sdk/settings/browser":w5,"@fleet-console/sdk/operations/browser":s5,"@fleet-console/sdk/notifications/browser":C5,"@fleet-console/sdk/react/browser":k5};try{const e=await bC();nw(e.theme)}catch{}const Bj=await SD(),sS=document.querySelector("#app");sS&&N5.createRoot(sS).render(h.jsx(j.StrictMode,{children:h.jsx(eA,{basename:"/console",children:h.jsx(yD,{value:Bj,children:h.jsx(Dj,{})})})}));export{tO as _,jj as a,Mg as g,At as k,Bl as p};