@marimo-team/frontend 0.25.3-dev5 → 0.25.3-dev52

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 (304) hide show
  1. package/dist/assets/CellStatus-RQxLjC9P.js +1 -0
  2. package/dist/assets/{ConnectedDataExplorerComponent-t8fH_TNc.js → ConnectedDataExplorerComponent-D9UK8o9A.js} +1 -1
  3. package/dist/assets/{ErrorBoundary-B4n9EnHB.js → ErrorBoundary-DzEMMFh0.js} +2 -2
  4. package/dist/assets/JsonOutput-9IONH7hu.js +11 -0
  5. package/dist/assets/{LazyAnyLanguageCodeMirror-CKcCbG2G.js → LazyAnyLanguageCodeMirror-BPYE76jR.js} +2 -2
  6. package/dist/assets/MarimoErrorOutput-BT8Qy5wh.js +10 -0
  7. package/dist/assets/{RenderHTML-9bMgbYmo.js → RenderHTML-PyMU3fBB.js} +1 -1
  8. package/dist/assets/{RunButton-CFQUNN5c.js → RunButton-2p2uCp9U.js} +1 -1
  9. package/dist/assets/{add-cell-with-ai-C_SruRWS.js → add-cell-with-ai-CEQ8jvcR.js} +7 -7
  10. package/dist/assets/{add-connection-dialog-CoE_PhuD.js → add-connection-dialog-D9fnw-j0.js} +2 -2
  11. package/dist/assets/{agent-panel-0b3k4QzJ.js → agent-panel-DkTYXm6j.js} +3 -3
  12. package/dist/assets/ai-model-dropdown-Cv9fEAp9.js +13 -0
  13. package/dist/assets/{alert-dialog-BaPGzeOK.js → alert-dialog-C-sWmKva.js} +1 -1
  14. package/dist/assets/any-language-editor-DUMe1UCk.js +1 -0
  15. package/dist/assets/{app-config-button-iXdCWvfC.js → app-config-button-BZzwY1BU.js} +1 -1
  16. package/dist/assets/arrays-0R2reF2y.js +1 -0
  17. package/dist/assets/{blob-iOBwGaP9.js → blob-DmUUV8Xf.js} +1 -1
  18. package/dist/assets/{button-COI-NGrx.js → button-D8gVKwe-.js} +1 -1
  19. package/dist/assets/{cache-panel-DTY1dqvi.js → cache-panel-Byolv2ht.js} +1 -1
  20. package/dist/assets/{capabilities-BJvf-MD4.js → capabilities-Pq1YNPlK.js} +1 -1
  21. package/dist/assets/{cell-editor-CR-tZNnc.js → cell-editor-C6xeN3x0.js} +6 -6
  22. package/dist/assets/cell-link-BNDZZ97N.js +1 -0
  23. package/dist/assets/{cells-rA_jsZCj.js → cells-0e2dpq3z.js} +56 -56
  24. package/dist/assets/{chat-display-luF7psRA.js → chat-display-D6TNcsmz.js} +1 -1
  25. package/dist/assets/chat-panel-CN45Q9wF.js +4 -0
  26. package/dist/assets/{chat-ui-nV_m4Btr.js → chat-ui-BGl1jPPe.js} +1 -1
  27. package/dist/assets/{circle-DXf-VWZG.js → circle-B6D_6D8w.js} +1 -1
  28. package/dist/assets/code-visibility-CV3S4xuf.js +1 -0
  29. package/dist/assets/coerce-DWjFeXOY.js +1 -0
  30. package/dist/assets/{column-preview-uosAAL4X.js → column-preview-D7sTOokc.js} +1 -1
  31. package/dist/assets/command-palette-CP5KmR-S.js +1 -0
  32. package/dist/assets/{common-lisZ0l6a.js → common-GvwCMUGF.js} +1 -1
  33. package/dist/assets/{components-CP_UoFtT.js → components-DrU8dOzy.js} +1 -1
  34. package/dist/assets/{components-CXfO-F47.js → components-lDm0qi2t.js} +1 -1
  35. package/dist/assets/{components-S7ZwOrvO.js → components-nnFZuekV.js} +1 -1
  36. package/dist/assets/config-CjQ4WJnJ.js +1 -0
  37. package/dist/assets/config-DGX7JYor.js +1 -0
  38. package/dist/assets/config-DzdxZb17.js +1 -0
  39. package/dist/assets/{copy-D8O_CYCG.js → copy-KlhazlhB.js} +1 -1
  40. package/dist/assets/{copy-icon-BIiRXh_3.js → copy-icon-8-a5vovc.js} +1 -1
  41. package/dist/assets/{createReducer-DgRODTW6.js → createReducer-HKXUbqyz.js} +1 -1
  42. package/dist/assets/{datasource-V0-52XOh.js → datasource-BpMPWJoj.js} +1 -1
  43. package/dist/assets/{dates-CfmdTL6B.js → dates-CQMwFko2.js} +1 -1
  44. package/dist/assets/{dependency-graph-panel-B0uP-_id.js → dependency-graph-panel-lyJ3aygI.js} +1 -1
  45. package/dist/assets/{dist-iaThVDkA.js → dist-jlhMTKo_.js} +1 -1
  46. package/dist/assets/{documentation-panel-DVl_ebWy.js → documentation-panel-CTUWNQQy.js} +1 -1
  47. package/dist/assets/{download-Bx55LMki.js → download-Csw35OD4.js} +1 -1
  48. package/dist/assets/{dropdown-menu-C1rnl-0o.js → dropdown-menu-DS6umAnH.js} +1 -1
  49. package/dist/assets/{edit-page-CGyjT-CQ.js → edit-page-Dwf3-IB6.js} +6 -6
  50. package/dist/assets/{error-banner-Cd69vvyX.js → error-banner-B5kzVf_0.js} +1 -1
  51. package/dist/assets/{error-entries-DOWpdGvI.js → error-entries-D3H6JH3A.js} +1 -1
  52. package/dist/assets/{error-panel-C-uxLOHF.js → error-panel-CgpCPUEO.js} +1 -1
  53. package/dist/assets/{errors-DCrsa1nH.js → errors-CNsgAw6m.js} +1 -1
  54. package/dist/assets/{es-Cqst59WX.js → es-N9SHpmG7.js} +1 -1
  55. package/dist/assets/feedback-button-B8idT199.js +1 -0
  56. package/dist/assets/{feedback-button-B99ThNJW.js → feedback-button-BEBY1q2a.js} +2 -2
  57. package/dist/assets/file-explorer-panel-MnNgzxxE.js +1 -0
  58. package/dist/assets/{file-name-input-ChnBsDE_.js → file-name-input-DrtIQ1VP.js} +1 -1
  59. package/dist/assets/{floating-outline-MYqQW4Vp.js → floating-outline-Dtc8YhnE.js} +1 -1
  60. package/dist/assets/{formats-yZ06h1Pl.js → formats-zylfwejq.js} +1 -1
  61. package/dist/assets/{formatting-BqrP-n49.js → formatting-uom1es4b.js} +1 -1
  62. package/dist/assets/{fullscreen-B9tHcfpV.js → fullscreen-BWTs8pYZ.js} +1 -1
  63. package/dist/assets/{gallery-page-DSL0J4md.js → gallery-page-DL4SSfun.js} +1 -1
  64. package/dist/assets/{ganttDiagram-EL5Y4UJY-2n7Ig5Jm.js → ganttDiagram-EL5Y4UJY-CYqkCfFG.js} +1 -1
  65. package/dist/assets/{glide-data-editor-B1MWlKeM.js → glide-data-editor-BTlU9F_s.js} +2 -2
  66. package/dist/assets/{glide-utils-CIrAxdjv.js → glide-utils-HFqhvWHI.js} +2 -2
  67. package/dist/assets/{home-page-B1M3X9Yf.js → home-page-BOmrrw3X.js} +3 -3
  68. package/dist/assets/{hooks-Bj0C0zrZ.js → hooks-DRNEKPFW.js} +1 -1
  69. package/dist/assets/{html-to-image-DK9Zl1lU.js → html-to-image-D_0rd3_B.js} +1 -1
  70. package/dist/assets/index-BdCbOYjS.js +30 -0
  71. package/dist/assets/index-evFWHKmM.css +2 -0
  72. package/dist/assets/{input-BoBxR50a.js → input-ByHt6aoV.js} +1 -1
  73. package/dist/assets/{kiosk-mode-BZECfg9k.js → kiosk-mode-BGmMSc7A.js} +1 -1
  74. package/dist/assets/{layout-DBuMeWh0.js → layout-DY2TXsTM.js} +5 -5
  75. package/dist/assets/linear-Bma8J3iM.js +1 -0
  76. package/dist/assets/links-CXcpNIM0.js +1 -0
  77. package/dist/assets/{logs-panel-y0XnfulJ.js → logs-panel-9f0amGf0.js} +1 -1
  78. package/dist/assets/{markdown-renderer-Q5AhbRU3.js → markdown-renderer-BRDCZeXA.js} +1 -1
  79. package/dist/assets/{menu-items-BrwnTgyK.js → menu-items-BgUyNUpu.js} +1 -1
  80. package/dist/assets/{mermaid-a3xYymTy.js → mermaid-B6mqMm5_.js} +2 -2
  81. package/dist/assets/{name-cell-input-BNOnF6-0.js → name-cell-input-13mN6CiO.js} +1 -1
  82. package/dist/assets/numbers-CsZVw3Dc.js +1 -0
  83. package/dist/assets/{objects-snlMn4yk.js → objects-rLPlQ3X_.js} +1 -1
  84. package/dist/assets/{once-Haz_uxEL.js → once-6KNTRW0u.js} +1 -1
  85. package/dist/assets/{outline-panel-Be7stWwv.js → outline-panel-DxC82nfD.js} +1 -1
  86. package/dist/assets/{packages-panel-9Qs1npCZ.js → packages-panel-Bi_mcFbl.js} +1 -1
  87. package/dist/assets/{panel-accordion-state-GeMEdCPw.js → panel-accordion-state-D_2i5aDC.js} +1 -1
  88. package/dist/assets/panels-C-ygF1Rv.js +107 -0
  89. package/dist/assets/precisionRound-BxlUs8G4.js +1 -0
  90. package/dist/assets/process-output-DlZH3EId.js +1 -0
  91. package/dist/assets/{quadrantDiagram-AXDQQJYC-yBhCDI7E.js → quadrantDiagram-AXDQQJYC-D9KH5Zge.js} +1 -1
  92. package/dist/assets/react-vega-BTNeboR2.js +189 -0
  93. package/dist/assets/{readonly-code-display-YULOXf4h.js → readonly-code-display-C8kpTYRT.js} +1 -1
  94. package/dist/assets/{readonly-python-code-CadgXgRu.js → readonly-python-code-XeDpkiXX.js} +1 -1
  95. package/dist/assets/{renderShortcut-BkVJQ_Zh.js → renderShortcut-H60uiHBp.js} +1 -1
  96. package/dist/assets/{reveal-component-B9FLjTg_.js → reveal-component-DgYlZOla.js} +37 -37
  97. package/dist/assets/run-page-C_A8W1eR.js +1 -0
  98. package/dist/assets/{runs-BLp5jezv.js → runs-6lJxKV1w.js} +1 -1
  99. package/dist/assets/{runtime-details-state-DuChzsA6.js → runtime-details-state-BeyT-Z-4.js} +1 -1
  100. package/dist/assets/{schemas-Dv42wLFq.js → schemas-ChRqMOTL.js} +1 -1
  101. package/dist/assets/{scratchpad-panel-DtB0A8xj.js → scratchpad-panel-Fb-8g4-S.js} +1 -1
  102. package/dist/assets/{scroll-to-bottom-button-1FyowpWV.js → scroll-to-bottom-button-CIkON2WJ.js} +1 -1
  103. package/dist/assets/{secrets-panel-Bctbtkrp.js → secrets-panel-CmLZsNfp.js} +1 -1
  104. package/dist/assets/{select-DTBn5eTb.js → select-3CVGlYrC.js} +1 -1
  105. package/dist/assets/{session-DqoWmb7X.js → session-B8Y-GJnS.js} +1 -1
  106. package/dist/assets/{session-panel-B6tA28BD.js → session-panel-Cl85FUT5.js} +1 -1
  107. package/dist/assets/{snippets-panel-CQ1dn3lA.js → snippets-panel-1hl_ey1w.js} +1 -1
  108. package/dist/assets/{spec-BfSBcO5B.js → spec-uCpVvaAR.js} +1 -1
  109. package/dist/assets/{state-uwRvJLb8.js → state-BY4_P6ko.js} +1 -1
  110. package/dist/assets/{state-BAJYRhmO.js → state-C0irhlOZ.js} +1 -1
  111. package/dist/assets/{state-BUsmcyaT.js → state-CbjD81T1.js} +3 -3
  112. package/dist/assets/{state-DxQnC_1I.js → state-Ck7FMD5A.js} +1 -1
  113. package/dist/assets/{state-Bfh_2SLl.js → state-ClkxCKxQ.js} +1 -1
  114. package/dist/assets/{state-C3oDoyFe.js → state-DaWgt-rn.js} +1 -1
  115. package/dist/assets/{strings-B2vv-ENv.js → strings-C25fhMR_.js} +1 -1
  116. package/dist/assets/{swiper-component-a07domrZ.js → swiper-component-CRGRy5_O.js} +1 -1
  117. package/dist/assets/{switch-CTaiAjrz.js → switch-1h011wlH.js} +1 -1
  118. package/dist/assets/{tabs-BuQlZFbt.js → tabs-CY8E4r9U.js} +1 -1
  119. package/dist/assets/{terminal-Ck_vK-34.js → terminal-D__Z_QZ0.js} +1 -1
  120. package/dist/assets/{time-MgToa8VM.js → time-DswSXBDk.js} +1 -1
  121. package/dist/assets/{toast-BGzLGnvw.js → toast-Gzxi-le_.js} +1 -1
  122. package/dist/assets/tooltip-Brya4Ghn.js +61 -0
  123. package/dist/assets/{tooltip-C9TuY18o.js → tooltip-CkGm8X7m.js} +1 -1
  124. package/dist/assets/tracing-DcFczEy0.js +1 -0
  125. package/dist/assets/{tracing-panel-dgnr2fIN.js → tracing-panel-EWvfWPFQ.js} +2 -2
  126. package/dist/assets/{tree-actions-DAd80MbP.js → tree-actions-Dof5VISm.js} +1 -1
  127. package/dist/assets/{use-restore-focus-BxEGwIbk.js → use-restore-focus-DdS7Tl0F.js} +1 -1
  128. package/dist/assets/{useAddCell-DGstJK0S.js → useAddCell-CqnFgwhm.js} +1 -1
  129. package/dist/assets/useAsyncData-DhhdOGGd.js +1 -0
  130. package/dist/assets/useBoolean-CMgj9hnq.js +1 -0
  131. package/dist/assets/{useCellActionButton-DY9RlJTb.js → useCellActionButton--Sq8PDBs.js} +1 -1
  132. package/dist/assets/{useDeleteCell-DFBGlSQk.js → useDeleteCell-DNTqIwU8.js} +1 -1
  133. package/dist/assets/{useDependencyPanelTab-DydxsE5d.js → useDependencyPanelTab-C4_EiuVH.js} +1 -1
  134. package/dist/assets/{useEventListener-D9cftcHj.js → useEventListener-CjDeLqFC.js} +1 -1
  135. package/dist/assets/{useIframeCapabilities-CwTkczVN.js → useIframeCapabilities-Czr9e4uG.js} +1 -1
  136. package/dist/assets/{useInstallPackage-iX1eufdl.js → useInstallPackage-DDjpV5RE.js} +1 -1
  137. package/dist/assets/{useInterval--x3s1VpI.js → useInterval-DJdQmXnq.js} +1 -1
  138. package/dist/assets/{useNotebookActions-CupIPSlg.js → useNotebookActions-C00MOhyT.js} +1 -1
  139. package/dist/assets/{useRunCells-BFjFX3hz.js → useRunCells-DqLsZnRn.js} +1 -1
  140. package/dist/assets/{useSplitCell-Tqv5pPtL.js → useSplitCell-Daxc689Z.js} +1 -1
  141. package/dist/assets/{useTheme-COhSHkCj.js → useTheme-DLtPc-39.js} +1 -1
  142. package/dist/assets/{utils-CaQYvazl.js → utils-DfElfBpz.js} +1 -1
  143. package/dist/assets/vega-component-D7JFthDD.js +1 -0
  144. package/dist/assets/{vega-embed-container-DJPNkHPb.js → vega-embed-container-DtArSJz1.js} +1 -1
  145. package/dist/assets/vega-loader.browser-Bu25TKax.js +6 -0
  146. package/dist/assets/{write-secret-modal-DzKAInL2.js → write-secret-modal-usRSi1bb.js} +1 -1
  147. package/dist/assets/{xychartDiagram-S5SC5T6Z-KbGzG6-u.js → xychartDiagram-S5SC5T6Z-CeRnBS5e.js} +1 -1
  148. package/dist/index.html +73 -73
  149. package/package.json +4 -4
  150. package/src/__tests__/fixtures/{pair-preview.ts → pair-config.ts} +3 -2
  151. package/src/__tests__/host-imports.test.ts +1 -0
  152. package/src/__tests__/mount.test.ts +8 -8
  153. package/src/components/app-config/ai-config.tsx +5 -1
  154. package/src/components/chat/__tests__/message-queue.test.tsx +17 -0
  155. package/src/components/chat/chat-panel.tsx +3 -7
  156. package/src/components/chat/chat-utils.ts +4 -8
  157. package/src/components/data-table/__tests__/context-menu-interaction.test.tsx +130 -0
  158. package/src/components/data-table/__tests__/date-popover.test.tsx +72 -0
  159. package/src/components/data-table/__tests__/export-actions.test.tsx +417 -6
  160. package/src/components/data-table/column-visibility-dropdown.tsx +8 -13
  161. package/src/components/data-table/columns.tsx +2 -1
  162. package/src/components/data-table/context-menu.tsx +36 -20
  163. package/src/components/data-table/date-popover.tsx +6 -4
  164. package/src/components/data-table/export-actions.tsx +263 -161
  165. package/src/components/data-table/row-viewer-panel/row-viewer.tsx +2 -2
  166. package/src/components/data-table/schemas.ts +14 -36
  167. package/src/components/editor/Output.tsx +5 -1
  168. package/src/components/editor/__tests__/dynamic-favicon.test.tsx +111 -18
  169. package/src/components/editor/actions/__tests__/pair-with-agent-commands.test.ts +80 -252
  170. package/src/components/editor/actions/__tests__/pair-with-agent-modal.test.tsx +186 -34
  171. package/src/components/editor/actions/pair-with-agent-commands.ts +42 -51
  172. package/src/components/editor/actions/pair-with-agent-modal.tsx +96 -36
  173. package/src/components/editor/ai/add-cell-with-ai.tsx +3 -3
  174. package/src/components/editor/cell/CreateCellButton.tsx +8 -10
  175. package/src/components/editor/cell/code/__tests__/language-toggle.test.tsx +54 -0
  176. package/src/components/editor/cell/code/cell-editor.tsx +1 -1
  177. package/src/components/editor/cell/code/language-toggle.tsx +8 -7
  178. package/src/components/editor/chrome/wrapper/__tests__/attachment-status.test.tsx +277 -78
  179. package/src/components/editor/chrome/wrapper/footer-items/attachment-status.tsx +196 -41
  180. package/src/components/editor/connections/components.tsx +1 -1
  181. package/src/components/editor/controls/__tests__/command-palette.test.tsx +53 -0
  182. package/src/components/editor/controls/command-palette.tsx +22 -10
  183. package/src/components/editor/dynamic-favicon.tsx +21 -40
  184. package/src/components/editor/errors/__tests__/send-error-report-button.test.tsx +139 -36
  185. package/src/components/editor/errors/send-error-report-button.tsx +10 -7
  186. package/src/components/editor/file-tree/file-viewer.tsx +4 -2
  187. package/src/components/editor/output/MarimoTracebackOutput.tsx +28 -22
  188. package/src/components/editor/output/console/ConsoleOutput.tsx +8 -18
  189. package/src/components/pages/home-page.tsx +4 -4
  190. package/src/components/slides/slide-cell-view.tsx +1 -1
  191. package/src/components/tracing/tracing.tsx +2 -2
  192. package/src/core/attachments/__tests__/toast.test.tsx +58 -0
  193. package/src/core/attachments/state.ts +5 -8
  194. package/src/core/attachments/toast.ts +15 -0
  195. package/src/core/cells/__tests__/error-report.test.ts +53 -3
  196. package/src/core/cells/__tests__/notebook-outline.test.ts +113 -0
  197. package/src/core/cells/__tests__/session.test.ts +18 -3
  198. package/src/core/cells/cells.ts +2 -1
  199. package/src/core/cells/error-report.ts +14 -6
  200. package/src/core/cells/pending-delete-service.ts +2 -6
  201. package/src/core/cells/session.ts +19 -1
  202. package/src/core/config/pair.ts +5 -3
  203. package/src/core/datasets/__tests__/data-source-discovery.test.ts +4 -4
  204. package/src/core/datasets/data-source-discovery.ts +4 -6
  205. package/src/core/edit-app.tsx +2 -2
  206. package/src/core/host/AGENTS.md +11 -2
  207. package/src/core/host/__tests__/attachments.test.ts +56 -0
  208. package/src/core/host/__tests__/document.test.ts +126 -0
  209. package/src/core/host/__tests__/events.test.ts +49 -0
  210. package/src/core/host/__tests__/fixtures.ts +41 -0
  211. package/src/core/host/__tests__/notebook-client.test.ts +496 -0
  212. package/src/core/host/connection.ts +81 -0
  213. package/src/core/host/events.ts +68 -0
  214. package/src/core/host/notebook-client.ts +316 -0
  215. package/src/core/host/resources/attachments.ts +19 -0
  216. package/src/core/host/resources/document.ts +101 -0
  217. package/src/core/hotkeys/actions.ts +2 -4
  218. package/src/core/islands/__tests__/bootstrap.test.ts +0 -26
  219. package/src/core/islands/bootstrap.ts +0 -1
  220. package/src/core/network/connection.ts +4 -2
  221. package/src/core/run-app.tsx +2 -2
  222. package/src/core/runtime/__tests__/runtime.test.ts +5 -12
  223. package/src/core/runtime/runtime.ts +5 -5
  224. package/src/core/static/files.ts +2 -0
  225. package/src/core/websocket/__tests__/{useMarimoKernelConnection.test.ts → connection-state.test.ts} +15 -17
  226. package/src/core/websocket/__tests__/{useWebSocket.test.ts → createConnectionTransport.test.ts} +1 -1
  227. package/src/core/websocket/__tests__/useNotebookClient.hook.test.tsx +149 -0
  228. package/src/core/websocket/__tests__/{useMarimoKernelConnection.hook.test.tsx → useNotebookSession.hook.test.tsx} +168 -253
  229. package/src/core/websocket/connection-state.ts +70 -0
  230. package/src/core/websocket/state.ts +7 -0
  231. package/src/core/websocket/transports/__tests__/sse.test.ts +18 -4
  232. package/src/core/websocket/transports/create.ts +31 -0
  233. package/src/core/websocket/transports/sse.ts +14 -2
  234. package/src/core/websocket/transports/transport.ts +12 -23
  235. package/src/core/websocket/types.ts +9 -39
  236. package/src/core/websocket/useNotebookClient.ts +78 -0
  237. package/src/core/websocket/{useMarimoKernelConnection.tsx → useNotebookSession.tsx} +53 -233
  238. package/src/hooks/__tests__/useAsyncData.test.tsx +148 -0
  239. package/src/hooks/useAsyncData.ts +3 -3
  240. package/src/hooks/useDataSourceDiscovery.ts +6 -4
  241. package/src/hooks/useElapsedTime.ts +3 -3
  242. package/src/hooks/useInputHistory.ts +4 -7
  243. package/src/hooks/useResizeObserver.ts +4 -7
  244. package/src/mount.tsx +3 -3
  245. package/src/plugins/core/registerReactComponent.tsx +1 -1
  246. package/src/plugins/impl/DropdownPlugin.tsx +2 -6
  247. package/src/plugins/impl/FormPlugin.tsx +1 -1
  248. package/src/plugins/impl/__tests__/DataTablePlugin.test.tsx +84 -0
  249. package/src/plugins/impl/anywidget/__tests__/registry.test.ts +2 -0
  250. package/src/plugins/impl/anywidget/__tests__/widget-binding.test.ts +241 -2
  251. package/src/plugins/impl/anywidget/runtime.ts +21 -9
  252. package/src/plugins/impl/anywidget/widget-binding.ts +160 -82
  253. package/src/plugins/impl/code/any-language-editor.tsx +2 -2
  254. package/src/plugins/impl/data-editor/glide-data-editor.tsx +8 -5
  255. package/src/plugins/impl/data-editor/glide-utils.ts +3 -1
  256. package/src/plugins/impl/mpl-interactive/MplInteractivePlugin.tsx +5 -3
  257. package/src/plugins/impl/panel/PanelPlugin.tsx +15 -16
  258. package/src/plugins/impl/panel/__tests__/utils.test.ts +39 -1
  259. package/src/plugins/impl/panel/utils.ts +17 -0
  260. package/src/plugins/impl/vega/make-selectable.ts +3 -6
  261. package/src/stories/__tests__/editor-story.test.tsx +33 -0
  262. package/src/stories/editor.stories.tsx +24 -17
  263. package/src/utils/__tests__/arrays.test.ts +35 -0
  264. package/src/utils/__tests__/numbers.test.ts +48 -1
  265. package/src/utils/__tests__/objects.test.ts +21 -0
  266. package/src/utils/arrays.ts +10 -0
  267. package/src/utils/numbers.ts +28 -17
  268. package/src/utils/objects.ts +3 -7
  269. package/src/utils/once.ts +19 -19
  270. package/dist/assets/CellStatus-nZpuDkm7.js +0 -1
  271. package/dist/assets/JsonOutput-d-k8v_17.js +0 -11
  272. package/dist/assets/MarimoErrorOutput-CLYUxiKW.js +0 -10
  273. package/dist/assets/ai-model-dropdown-C6GHHEdR.js +0 -5
  274. package/dist/assets/any-language-editor-BLCAD3yx.js +0 -1
  275. package/dist/assets/arrays-BqUx5USx.js +0 -1
  276. package/dist/assets/cell-link-1CynTVGQ.js +0 -1
  277. package/dist/assets/chat-panel-DDDTnLvB.js +0 -4
  278. package/dist/assets/code-visibility-B-_GvwR5.js +0 -1
  279. package/dist/assets/coerce-CpE6kUdX.js +0 -1
  280. package/dist/assets/command-palette-BZ13RKDJ.js +0 -1
  281. package/dist/assets/config-DX8Y2WbJ.js +0 -1
  282. package/dist/assets/config-FzDtjF1-.js +0 -1
  283. package/dist/assets/config-VPSq73n8.js +0 -1
  284. package/dist/assets/feedback-button-DlqZkJwz.js +0 -1
  285. package/dist/assets/file-explorer-panel-D3CphidS.js +0 -1
  286. package/dist/assets/index-CXIE-QEG.css +0 -2
  287. package/dist/assets/index-DnIgeCyQ.js +0 -29
  288. package/dist/assets/linear-0eij_aAG.js +0 -1
  289. package/dist/assets/links-DkkL9DVa.js +0 -1
  290. package/dist/assets/numbers-Mk3-CcoU.js +0 -1
  291. package/dist/assets/panels-B9x935By.js +0 -4
  292. package/dist/assets/precisionRound-Bq_nmf5u.js +0 -1
  293. package/dist/assets/process-output-DNFKMODr.js +0 -1
  294. package/dist/assets/react-vega-C3rYGtP6.js +0 -189
  295. package/dist/assets/run-page-CjdGaic3.js +0 -1
  296. package/dist/assets/tooltip-mT3CGest.js +0 -61
  297. package/dist/assets/tracing-BARlJ_Dk.js +0 -1
  298. package/dist/assets/useAsyncData-C7aJJz0Y.js +0 -1
  299. package/dist/assets/useBoolean-BDD6_xQQ.js +0 -1
  300. package/dist/assets/vega-component-CnadTgoE.js +0 -1
  301. package/dist/assets/vega-loader.browser-CLRkNgm7.js +0 -6
  302. package/src/core/host/__tests__/protocol.test.ts +0 -214
  303. package/src/core/host/protocol.ts +0 -1943
  304. package/src/core/websocket/useWebSocket.tsx +0 -88
@@ -1,4 +1,4 @@
1
- import{a as e,t}from"./rolldown-runtime-B0Z9INg1.js";import{t as n}from"./useEvent-Dfcbgjhg.js";import{t as r}from"./react-DVplv7_D.js";import{t as i}from"./compiler-runtime-BrajqUja.js";import{g as a}from"./useEventListener-D9cftcHj.js";import{S as o,o as s}from"./config-DX8Y2WbJ.js";import{t as c}from"./cn-ldLVeaqm.js";import{t as l}from"./jsx-runtime-B74pBk57.js";import{t as u}from"./createLucideIcon-DfJ2oMlA.js";import{t as d}from"./clipboard-paste-HVpozQmt.js";import{t as f}from"./copy-Djr5m5ac.js";import{t as p}from"./trash-2-DcgaW8fn.js";import{n as m}from"./copy-D8O_CYCG.js";import{r as h}from"./useDebounce-B_ccBZTp.js";import{n as g}from"./renderShortcut-BkVJQ_Zh.js";import{n as _,t as v}from"./state-uwRvJLb8.js";var y=u(`text-select`,[[`path`,{d:`M14 21h1`,key:`v9vybs`}],[`path`,{d:`M14 3h1`,key:`1ec4yj`}],[`path`,{d:`M19 3a2 2 0 0 1 2 2`,key:`18rm91`}],[`path`,{d:`M21 14v1`,key:`169vum`}],[`path`,{d:`M21 19a2 2 0 0 1-2 2`,key:`1j7049`}],[`path`,{d:`M21 9v1`,key:`mxsmne`}],[`path`,{d:`M3 14v1`,key:`vnatye`}],[`path`,{d:`M3 9v1`,key:`1r0deq`}],[`path`,{d:`M5 21a2 2 0 0 1-2-2`,key:`sbafld`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2`,key:`y57alp`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}],[`path`,{d:`M7 16h6`,key:`1vyc9m`}],[`path`,{d:`M7 8h8`,key:`1jbsf9`}],[`path`,{d:`M9 21h1`,key:`15o7lz`}],[`path`,{d:`M9 3h1`,key:`1yesri`}]]),b=i(),x=class{constructor(e,t){this._disposables=[],this._socket=e,this._socket.binaryType=`arraybuffer`,this._bidirectional=!(t&&t.bidirectional===!1)}activate(e){this._disposables.push(S(this._socket,`message`,t=>{let n=t.data;e.write(typeof n==`string`?n:new Uint8Array(n))})),this._bidirectional&&(this._disposables.push(e.onData(e=>this._sendData(e))),this._disposables.push(e.onBinary(e=>this._sendBinary(e)))),this._disposables.push(S(this._socket,`close`,()=>this.dispose())),this._disposables.push(S(this._socket,`error`,()=>this.dispose()))}dispose(){for(let e of this._disposables)e.dispose()}_sendData(e){this._checkOpenSocket()&&this._socket.send(e)}_sendBinary(e){if(!this._checkOpenSocket())return;let t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n)&255;this._socket.send(t)}_checkOpenSocket(){switch(this._socket.readyState){case WebSocket.OPEN:return!0;case WebSocket.CONNECTING:throw Error(`Attach addon was loaded before socket was open`);case WebSocket.CLOSING:return console.warn(`Attach addon socket is closing`),!1;case WebSocket.CLOSED:throw Error(`Attach addon socket is closed`);default:throw Error(`Unexpected socket state`)}}};function S(e,t,n){return e.addEventListener(t,n),{dispose:()=>{n&&e.removeEventListener(t,n)}}}var C=t(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.CanvasAddon=r():n.CanvasAddon=r()})(self,(()=>(()=>{var e={903:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRenderLayer=void 0;let r=n(274),i=n(627),a=n(237),o=n(860),s=n(374),c=n(296),l=n(345),u=n(859),d=n(399),f=n(855);class p extends u.Disposable{get canvas(){return this._canvas}get cacheCanvas(){return this._charAtlas?.pages[0].canvas}constructor(e,t,n,i,a,o,s,d,f,p){super(),this._terminal=e,this._container=t,this._alpha=a,this._themeService=o,this._bufferService=s,this._optionsService=d,this._decorationService=f,this._coreBrowserService=p,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._selectionModel=(0,c.createSelectionRenderModel)(),this._bitmapGenerator=[],this._charAtlasDisposable=this.register(new u.MutableDisposable),this._onAddTextureAtlasCanvas=this.register(new l.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._cellColorResolver=new r.CellColorResolver(this._terminal,this._optionsService,this._selectionModel,this._decorationService,this._coreBrowserService,this._themeService),this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`),this._canvas.classList.add(`xterm-${n}-layer`),this._canvas.style.zIndex=i.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._refreshCharAtlas(this._themeService.colors),this.register(this._themeService.onChangeColors((e=>{this._refreshCharAtlas(e),this.reset(),this.handleSelectionChanged(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}))),this.register((0,u.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,s.throwIfFalsy)(this._canvas.getContext(`2d`,{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(){}handleFocus(){}handleCursorMove(){}handleGridChanged(e,t){}handleSelectionChanged(e,t,n=!1){this._selectionModel.update(this._terminal._core,e,t,n)}_setTransparency(e){if(e===this._alpha)return;let t=this._canvas;this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,t),this._refreshCharAtlas(this._themeService.colors),this.handleGridChanged(0,this._bufferService.rows-1)}_refreshCharAtlas(e){if(!(this._deviceCharWidth<=0&&this._deviceCharHeight<=0)){this._charAtlas=(0,i.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,e,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlasDisposable.value=(0,l.forwardEvent)(this._charAtlas.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),this._charAtlas.warmUp();for(let e=0;e<this._charAtlas.pages.length;e++)this._bitmapGenerator[e]=new m(this._charAtlas.pages[e].canvas)}}resize(e){this._deviceCellWidth=e.device.cell.width,this._deviceCellHeight=e.device.cell.height,this._deviceCharWidth=e.device.char.width,this._deviceCharHeight=e.device.char.height,this._deviceCharLeft=e.device.char.left,this._deviceCharTop=e.device.char.top,this._canvas.width=e.device.canvas.width,this._canvas.height=e.device.canvas.height,this._canvas.style.width=`${e.css.canvas.width}px`,this._canvas.style.height=`${e.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(this._themeService.colors)}clearTextureAtlas(){this._charAtlas?.clearTexture()}_fillCells(e,t,n,r){this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight)}_fillMiddleLineAtCells(e,t,n=1){let r=Math.ceil(.5*this._deviceCellHeight);this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-r-this._coreBrowserService.dpr,n*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillBottomLineAtCells(e,t,n=1,r=0){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight+r-this._coreBrowserService.dpr-1,n*this._deviceCellWidth,this._coreBrowserService.dpr)}_curlyUnderlineAtCell(e,t,n=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;let r=this._coreBrowserService.dpr;this._ctx.lineWidth=r;for(let i=0;i<n;i++){let n=(e+i)*this._deviceCellWidth,a=(e+i+.5)*this._deviceCellWidth,o=(e+i+1)*this._deviceCellWidth,s=(t+1)*this._deviceCellHeight-r-1,c=s-r,l=s+r;this._ctx.moveTo(n,s),this._ctx.bezierCurveTo(n,c,a,c,a,s),this._ctx.bezierCurveTo(a,l,o,l,o,s)}this._ctx.stroke(),this._ctx.restore()}_dottedUnderlineAtCell(e,t,n=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;let r=this._coreBrowserService.dpr;this._ctx.lineWidth=r,this._ctx.setLineDash([2*r,r]);let i=e*this._deviceCellWidth,a=(t+1)*this._deviceCellHeight-r-1;this._ctx.moveTo(i,a);for(let t=0;t<n;t++){let r=(e+n+t)*this._deviceCellWidth;this._ctx.lineTo(r,a)}this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_dashedUnderlineAtCell(e,t,n=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;let r=this._coreBrowserService.dpr;this._ctx.lineWidth=r,this._ctx.setLineDash([4*r,3*r]);let i=e*this._deviceCellWidth,a=(e+n)*this._deviceCellWidth,o=(t+1)*this._deviceCellHeight-r-1;this._ctx.moveTo(i,o),this._ctx.lineTo(a,o),this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_fillLeftLineAtCell(e,t,n){this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,this._coreBrowserService.dpr*n,this._deviceCellHeight)}_strokeRectAtCell(e,t,n,r){let i=this._coreBrowserService.dpr;this._ctx.lineWidth=i,this._ctx.strokeRect(e*this._deviceCellWidth+i/2,t*this._deviceCellHeight+i/2,n*this._deviceCellWidth-i,r*this._deviceCellHeight-i)}_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,t,n,r){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight))}_fillCharTrueColor(e,t,n){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=a.TEXT_BASELINE,this._clipRow(n);let r=!1;!1!==this._optionsService.rawOptions.customGlyphs&&(r=(0,o.tryDrawCustomChar)(this._ctx,e.getChars(),t*this._deviceCellWidth,n*this._deviceCellHeight,this._deviceCellWidth,this._deviceCellHeight,this._optionsService.rawOptions.fontSize,this._coreBrowserService.dpr)),r||this._ctx.fillText(e.getChars(),t*this._deviceCellWidth+this._deviceCharLeft,n*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_drawChars(e,t,n){let r=e.getChars(),i=e.getCode(),a=e.getWidth();if(this._cellColorResolver.resolve(e,t,this._bufferService.buffer.ydisp+n,this._deviceCellWidth),!this._charAtlas)return;let o;if(o=r&&r.length>1?this._charAtlas.getRasterizedGlyphCombinedChar(r,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0):this._charAtlas.getRasterizedGlyph(e.getCode()||f.WHITESPACE_CELL_CODE,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0),!o.size.x||!o.size.y)return;this._ctx.save(),this._clipRow(n),this._bitmapGenerator[o.texturePage]&&this._charAtlas.pages[o.texturePage].canvas!==this._bitmapGenerator[o.texturePage].canvas&&(this._bitmapGenerator[o.texturePage]?.bitmap?.close(),delete this._bitmapGenerator[o.texturePage]),this._charAtlas.pages[o.texturePage].version!==this._bitmapGenerator[o.texturePage]?.version&&(this._bitmapGenerator[o.texturePage]||(this._bitmapGenerator[o.texturePage]=new m(this._charAtlas.pages[o.texturePage].canvas)),this._bitmapGenerator[o.texturePage].refresh(),this._bitmapGenerator[o.texturePage].version=this._charAtlas.pages[o.texturePage].version);let c=o.size.x;this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,s.allowRescaling)(i,a,o.size.x,this._deviceCellWidth)&&(c=this._deviceCellWidth-1),this._ctx.drawImage(this._bitmapGenerator[o.texturePage]?.bitmap||this._charAtlas.pages[o.texturePage].canvas,o.texturePosition.x,o.texturePosition.y,o.size.x,o.size.y,t*this._deviceCellWidth+this._deviceCharLeft-o.offset.x,n*this._deviceCellHeight+this._deviceCharTop-o.offset.y,c,o.size.y),this._ctx.restore()}_clipRow(e){this._ctx.beginPath(),this._ctx.rect(0,e*this._deviceCellHeight,this._bufferService.cols*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t){return`${t?`italic`:``} ${e?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize*this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`}}t.BaseRenderLayer=p;class m{get bitmap(){return this._bitmap}constructor(e){this.canvas=e,this._state=0,this._commitTimeout=void 0,this._bitmap=void 0,this.version=-1}refresh(){this._bitmap?.close(),this._bitmap=void 0,d.isSafari||(this._commitTimeout===void 0&&(this._commitTimeout=window.setTimeout((()=>this._generate()),100)),this._state===1&&(this._state=2))}_generate(){this._state===0&&(this._bitmap?.close(),this._bitmap=void 0,this._state=1,window.createImageBitmap(this.canvas).then((e=>{this._state===2?this.refresh():this._bitmap=e,this._state=0})),this._commitTimeout&&=void 0)}}},949:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasRenderer=void 0;let r=n(627),i=n(56),a=n(374),o=n(345),s=n(859),c=n(873),l=n(43),u=n(630),d=n(744);class f extends s.Disposable{constructor(e,t,n,f,p,m,h,g,_,v,y){super(),this._terminal=e,this._screenElement=t,this._bufferService=f,this._charSizeService=p,this._optionsService=m,this._coreBrowserService=_,this._themeService=y,this._observerDisposable=this.register(new s.MutableDisposable),this._onRequestRedraw=this.register(new o.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onChangeTextureAtlas=this.register(new o.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new o.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event;let b=this._optionsService.rawOptions.allowTransparency;this._renderLayers=[new d.TextRenderLayer(this._terminal,this._screenElement,0,b,this._bufferService,this._optionsService,h,v,this._coreBrowserService,y),new u.SelectionRenderLayer(this._terminal,this._screenElement,1,this._bufferService,this._coreBrowserService,v,this._optionsService,y),new l.LinkRenderLayer(this._terminal,this._screenElement,2,n,this._bufferService,this._optionsService,v,this._coreBrowserService,y),new c.CursorRenderLayer(this._terminal,this._screenElement,3,this._onRequestRedraw,this._bufferService,this._optionsService,g,this._coreBrowserService,v,y)];for(let e of this._renderLayers)(0,o.forwardEvent)(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas);this.dimensions=(0,a.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._observerDisposable.value=(0,i.observeDevicePixelDimensions)(this._renderLayers[0].canvas,this._coreBrowserService.window,((e,t)=>this._setCanvasDevicePixelDimensions(e,t))),this.register(this._coreBrowserService.onWindowChange((e=>{this._observerDisposable.value=(0,i.observeDevicePixelDimensions)(this._renderLayers[0].canvas,e,((e,t)=>this._setCanvasDevicePixelDimensions(e,t)))}))),this.register((0,s.toDisposable)((()=>{for(let e of this._renderLayers)e.dispose();(0,r.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){return this._renderLayers[0].cacheCanvas}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._bufferService.cols,this._bufferService.rows))}handleResize(e,t){this._updateDimensions();for(let e of this._renderLayers)e.resize(this.dimensions);this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}handleCharSizeChanged(){this.handleResize(this._bufferService.cols,this._bufferService.rows)}handleBlur(){this._runOperation((e=>e.handleBlur()))}handleFocus(){this._runOperation((e=>e.handleFocus()))}handleSelectionChanged(e,t,n=!1){this._runOperation((r=>r.handleSelectionChanged(e,t,n))),this._themeService.colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}handleCursorMove(){this._runOperation((e=>e.handleCursorMove()))}clear(){this._runOperation((e=>e.reset()))}_runOperation(e){for(let t of this._renderLayers)e(t)}renderRows(e,t){for(let n of this._renderLayers)n.handleGridChanged(e,t)}clearTextureAtlas(){for(let e of this._renderLayers)e.clearTextureAtlas()}_updateDimensions(){if(!this._charSizeService.hasValidSize)return;let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=Math.floor(this._charSizeService.width*e),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),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._bufferService.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._bufferService.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows,this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols}_setCanvasDevicePixelDimensions(e,t){this.dimensions.device.canvas.height=t,this.dimensions.device.canvas.width=e;for(let e of this._renderLayers)e.resize(this.dimensions);this._requestRedrawViewport()}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}}t.CanvasRenderer=f},873:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CursorRenderLayer=void 0;let r=n(457),i=n(859),a=n(399),o=n(782),s=n(903);class c extends s.BaseRenderLayer{constructor(e,t,n,r,a,s,c,l,u,d){super(e,t,`cursor`,n,!0,d,a,s,u,l),this._onRequestRedraw=r,this._coreService=c,this._cursorBlinkStateManager=this.register(new i.MutableDisposable),this._cell=new o.CellData,this._state={x:0,y:0,isFocused:!1,style:``,width:0},this._cursorRenderers={bar:this._renderBarCursor.bind(this),block:this._renderBlockCursor.bind(this),underline:this._renderUnderlineCursor.bind(this),outline:this._renderOutlineCursor.bind(this)},this.register(s.onOptionChange((()=>this._handleOptionsChanged()))),this._handleOptionsChanged()}resize(e){super.resize(e),this._state={x:0,y:0,isFocused:!1,style:``,width:0}}reset(){this._clearCursor(),this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._handleOptionsChanged()}handleBlur(){this._cursorBlinkStateManager.value?.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleFocus(){this._cursorBlinkStateManager.value?.resume(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}_handleOptionsChanged(){this._optionsService.rawOptions.cursorBlink?this._cursorBlinkStateManager.value||(this._cursorBlinkStateManager.value=new r.CursorBlinkStateManager((()=>this._render(!0)),this._coreBrowserService)):this._cursorBlinkStateManager.clear(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleCursorMove(){this._cursorBlinkStateManager.value?.restartBlinkAnimation()}handleGridChanged(e,t){!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isPaused?this._render(!1):this._cursorBlinkStateManager.value.restartBlinkAnimation()}_render(e){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();let t=this._bufferService.buffer.ybase+this._bufferService.buffer.y,n=t-this._bufferService.buffer.ydisp;if(n<0||n>=this._bufferService.rows)return void this._clearCursor();let r=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(t).loadCell(r,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css;let e=this._optionsService.rawOptions.cursorStyle,t=this._optionsService.rawOptions.cursorInactiveStyle;t&&t!==`none`&&this._cursorRenderers[t](r,n,this._cell),this._ctx.restore(),this._state.x=r,this._state.y=n,this._state.isFocused=!1,this._state.style=e,this._state.width=this._cell.getWidth();return}if(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible){if(this._state){if(this._state.x===r&&this._state.y===n&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.rawOptions.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.rawOptions.cursorStyle||`block`](r,n,this._cell),this._ctx.restore(),this._state.x=r,this._state.y=n,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&=(a.isFirefox||this._coreBrowserService.dpr<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),{x:0,y:0,isFocused:!1,style:``,width:0})}_renderBarCursor(e,t,n){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillLeftLineAtCell(e,t,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()}_renderBlockCursor(e,t,n){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(e,t,n.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(n,e,t),this._ctx.restore()}_renderUnderlineCursor(e,t,n){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(e,t),this._ctx.restore()}_renderOutlineCursor(e,t,n){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(e,t,n.getWidth(),1),this._ctx.restore()}}t.CursorRenderLayer=c},574:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GridCache=void 0,t.GridCache=class{constructor(){this.cache=[]}resize(e,t){for(let n=0;n<e;n++){this.cache.length<=n&&this.cache.push([]);for(let e=this.cache[n].length;e<t;e++)this.cache[n].push(void 0);this.cache[n].length=t}this.cache.length=e}clear(){for(let e=0;e<this.cache.length;e++)for(let t=0;t<this.cache[e].length;t++)this.cache[e][t]=void 0}}},43:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkRenderLayer=void 0;let r=n(197),i=n(237),a=n(903);class o extends a.BaseRenderLayer{constructor(e,t,n,r,i,a,o,s,c){super(e,t,`link`,n,!0,c,i,a,o,s),this.register(r.onShowLinkUnderline((e=>this._handleShowLinkUnderline(e)))),this.register(r.onHideLinkUnderline((e=>this._handleHideLinkUnderline(e))))}resize(e){super.resize(e),this._state=void 0}reset(){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===i.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg&&(0,r.is256Color)(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 t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}}t.LinkRenderLayer=o},630:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRenderLayer=void 0;let r=n(903);class i extends r.BaseRenderLayer{constructor(e,t,n,r,i,a,o,s){super(e,t,`selection`,n,!0,s,r,o,a,i),this._clearState()}_clearState(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}}resize(e){super.resize(e),this._selectionModel.selectionStart&&this._selectionModel.selectionEnd&&(this._clearState(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode))}reset(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())}handleBlur(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleFocus(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleSelectionChanged(e,t,n){super.handleSelectionChanged(e,t,n),this._redrawSelection(e,t,n)}_redrawSelection(e,t,n){if(!this._didStateChange(e,t,n,this._bufferService.buffer.ydisp))return;if(this._clearAll(),!e||!t)return void this._clearState();let r=e[1]-this._bufferService.buffer.ydisp,i=t[1]-this._bufferService.buffer.ydisp,a=Math.max(r,0),o=Math.min(i,this._bufferService.rows-1);if(a>=this._bufferService.rows||o<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=(this._coreBrowserService.isFocused?this._themeService.colors.selectionBackgroundTransparent:this._themeService.colors.selectionInactiveBackgroundTransparent).css,n){let n=e[0],r=t[0]-n,i=o-a+1;this._fillCells(n,a,r,i)}else{let n=r===a?e[0]:0,s=a===i?t[0]:this._bufferService.cols;this._fillCells(n,a,s-n,1);let c=Math.max(o-a-1,0);if(this._fillCells(0,a+1,this._bufferService.cols,c),a!==o){let e=i===o?t[0]:this._bufferService.cols;this._fillCells(0,o,e,1)}}this._state.start=[e[0],e[1]],this._state.end=[t[0],t[1]],this._state.columnSelectMode=n,this._state.ydisp=this._bufferService.buffer.ydisp}}_didStateChange(e,t,n,r){return!this._areCoordinatesEqual(e,this._state.start)||!this._areCoordinatesEqual(t,this._state.end)||n!==this._state.columnSelectMode||r!==this._state.ydisp}_areCoordinatesEqual(e,t){return!(!e||!t)&&e[0]===t[0]&&e[1]===t[1]}}t.SelectionRenderLayer=i},744:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextRenderLayer=void 0;let r=n(577),i=n(147),a=n(782),o=n(855),s=n(903),c=n(574);class l extends s.BaseRenderLayer{constructor(e,t,n,r,i,o,s,l,u,d){super(e,t,`text`,n,r,d,i,o,l,u),this._characterJoinerService=s,this._characterWidth=0,this._characterFont=``,this._characterOverlapCache={},this._workCell=new a.CellData,this._state=new c.GridCache,this.register(o.onSpecificOptionChange(`allowTransparency`,(e=>this._setTransparency(e))))}resize(e){super.resize(e);let t=this._getFont(!1,!1);this._characterWidth===e.device.char.width&&this._characterFont===t||(this._characterWidth=e.device.char.width,this._characterFont=t,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)}reset(){this._state.clear(),this._clearAll()}_forEachCell(e,t,n){for(let i=e;i<=t;i++){let e=i+this._bufferService.buffer.ydisp,t=this._bufferService.buffer.lines.get(e),a=this._characterJoinerService.getJoinedCharacters(e);for(let e=0;e<this._bufferService.cols;e++){t.loadCell(e,this._workCell);let s=this._workCell,c=!1,l=e;if(s.getWidth()!==0){if(a.length>0&&e===a[0][0]){c=!0;let e=a.shift();s=new r.JoinedCellData(this._workCell,t.translateToString(!0,e[0],e[1]),e[1]-e[0]),l=e[1]-1}!c&&this._isOverlapping(s)&&l<t.length-1&&t.getCodePoint(l+1)===o.NULL_CELL_CODE&&(s.content&=-12582913,s.content|=2<<22),n(s,e,i),e=l}}}}_drawBackground(e,t){let n=this._ctx,r=this._bufferService.cols,a=0,o=0,s=null;n.save(),this._forEachCell(e,t,((e,t,c)=>{let l=null;e.isInverse()?l=e.isFgDefault()?this._themeService.colors.foreground.css:e.isFgRGB()?`rgb(${i.AttributeData.toColorRGB(e.getFgColor()).join(`,`)})`:this._themeService.colors.ansi[e.getFgColor()].css:e.isBgRGB()?l=`rgb(${i.AttributeData.toColorRGB(e.getBgColor()).join(`,`)})`:e.isBgPalette()&&(l=this._themeService.colors.ansi[e.getBgColor()].css);let u=!1;this._decorationService.forEachDecorationAtCell(t,this._bufferService.buffer.ydisp+c,void 0,(e=>{e.options.layer!==`top`&&u||(e.backgroundColorRGB&&(l=e.backgroundColorRGB.css),u=e.options.layer===`top`)})),s===null&&(a=t,o=c),c===o?s!==l&&(n.fillStyle=s||``,this._fillCells(a,o,t-a,1),a=t,o=c):(n.fillStyle=s||``,this._fillCells(a,o,r-a,1),a=t,o=c),s=l})),s!==null&&(n.fillStyle=s,this._fillCells(a,o,r-a,1)),n.restore()}_drawForeground(e,t){this._forEachCell(e,t,((e,t,n)=>this._drawChars(e,t,n)))}handleGridChanged(e,t){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,e,this._bufferService.cols,t-e+1),this._drawBackground(e,t),this._drawForeground(e,t))}_isOverlapping(e){if(e.getWidth()!==1||e.getCode()<256)return!1;let t=e.getChars();if(this._characterOverlapCache.hasOwnProperty(t))return this._characterOverlapCache[t];this._ctx.save(),this._ctx.font=this._characterFont;let n=Math.floor(this._ctx.measureText(t).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[t]=n,n}}t.TextRenderLayer=l},274:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellColorResolver=void 0;let r=n(855),i=n(160),a=n(374),o,s=0,c=0,l=!1,u=!1,d=!1,f=0;t.CellColorResolver=class{constructor(e,t,n,r,i,a){this._terminal=e,this._optionService=t,this._selectionRenderModel=n,this._decorationService=r,this._coreBrowserService=i,this._themeService=a,this.result={fg:0,bg:0,ext:0}}resolve(e,t,n,p){if(this.result.bg=e.bg,this.result.fg=e.fg,this.result.ext=268435456&e.bg?e.extended.ext:0,c=0,s=0,u=!1,l=!1,d=!1,o=this._themeService.colors,f=0,e.getCode()!==r.NULL_CELL_CODE&&e.extended.underlineStyle===4){let e=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));f=t*p%(2*Math.round(e))}if(this._decorationService.forEachDecorationAtCell(t,n,`bottom`,(e=>{e.backgroundColorRGB&&(c=e.backgroundColorRGB.rgba>>8&16777215,u=!0),e.foregroundColorRGB&&(s=e.foregroundColorRGB.rgba>>8&16777215,l=!0)})),d=this._selectionRenderModel.isCellSelected(this._terminal,t,n),d){if(67108864&this.result.fg||50331648&this.result.bg){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:c=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:c=(16777215&this.result.fg)<<8|255;break;default:c=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:c=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:c=(16777215&this.result.bg)<<8|255}c=i.rgba.blend(c,4294967040&(this._coreBrowserService.isFocused?o.selectionBackgroundOpaque:o.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else c=(this._coreBrowserService.isFocused?o.selectionBackgroundOpaque:o.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(u=!0,o.selectionForeground&&(s=o.selectionForeground.rgba>>8&16777215,l=!0),(0,a.treatGlyphAsBackgroundColor)(e.getCode())){if(67108864&this.result.fg&&!(50331648&this.result.bg))s=(this._coreBrowserService.isFocused?o.selectionBackgroundOpaque:o.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:s=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:s=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:s=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:s=(16777215&this.result.fg)<<8|255;break;default:s=this._themeService.colors.foreground.rgba}s=i.rgba.blend(s,4294967040&(this._coreBrowserService.isFocused?o.selectionBackgroundOpaque:o.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}l=!0}}this._decorationService.forEachDecorationAtCell(t,n,`top`,(e=>{e.backgroundColorRGB&&(c=e.backgroundColorRGB.rgba>>8&16777215,u=!0),e.foregroundColorRGB&&(s=e.foregroundColorRGB.rgba>>8&16777215,l=!0)})),u&&(c=d?e.bg&-150994944|c|50331648:-16777216&e.bg|c|50331648),l&&(s=e.fg&-83886080|s|50331648),67108864&this.result.fg&&(u&&!l&&(s=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&o.background.rgba>>8|50331648,l=!0),!u&&l&&(c=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&o.foreground.rgba>>8|50331648,u=!0)),o=void 0,this.result.bg=u?c:this.result.bg,this.result.fg=l?s:this.result.fg,this.result.ext&=536870911,this.result.ext|=f<<29&3758096384}}},627:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeTerminalFromCache=t.acquireTextureAtlas=void 0;let r=n(509),i=n(197),a=[];t.acquireTextureAtlas=function(e,t,n,o,s,c,l,u){let d=(0,i.generateConfig)(o,s,c,l,t,n,u);for(let t=0;t<a.length;t++){let n=a[t],r=n.ownedBy.indexOf(e);if(r>=0){if((0,i.configEquals)(n.config,d))return n.atlas;n.ownedBy.length===1?(n.atlas.dispose(),a.splice(t,1)):n.ownedBy.splice(r,1);break}}for(let t=0;t<a.length;t++){let n=a[t];if((0,i.configEquals)(n.config,d))return n.ownedBy.push(e),n.atlas}let f=e._core,p={atlas:new r.TextureAtlas(document,d,f.unicodeService),config:d,ownedBy:[e]};return a.push(p),p.atlas},t.removeTerminalFromCache=function(e){for(let t=0;t<a.length;t++){let n=a[t].ownedBy.indexOf(e);if(n!==-1){a[t].ownedBy.length===1?(a[t].atlas.dispose(),a.splice(t,1)):a[t].ownedBy.splice(n,1);break}}}},197:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.is256Color=t.configEquals=t.generateConfig=void 0;let r=n(160);t.generateConfig=function(e,t,n,i,a,o,s){let c={foreground:o.foreground,background:o.background,cursor:r.NULL_COLOR,cursorAccent:r.NULL_COLOR,selectionForeground:r.NULL_COLOR,selectionBackgroundTransparent:r.NULL_COLOR,selectionBackgroundOpaque:r.NULL_COLOR,selectionInactiveBackgroundTransparent:r.NULL_COLOR,selectionInactiveBackgroundOpaque:r.NULL_COLOR,ansi:o.ansi.slice(),contrastCache:o.contrastCache,halfContrastCache:o.halfContrastCache};return{customGlyphs:a.customGlyphs,devicePixelRatio:s,letterSpacing:a.letterSpacing,lineHeight:a.lineHeight,deviceCellWidth:e,deviceCellHeight:t,deviceCharWidth:n,deviceCharHeight:i,fontFamily:a.fontFamily,fontSize:a.fontSize,fontWeight:a.fontWeight,fontWeightBold:a.fontWeightBold,allowTransparency:a.allowTransparency,drawBoldTextInBrightColors:a.drawBoldTextInBrightColors,minimumContrastRatio:a.minimumContrastRatio,colors:c}},t.configEquals=function(e,t){for(let n=0;n<e.colors.ansi.length;n++)if(e.colors.ansi[n].rgba!==t.colors.ansi[n].rgba)return!1;return e.devicePixelRatio===t.devicePixelRatio&&e.customGlyphs===t.customGlyphs&&e.lineHeight===t.lineHeight&&e.letterSpacing===t.letterSpacing&&e.fontFamily===t.fontFamily&&e.fontSize===t.fontSize&&e.fontWeight===t.fontWeight&&e.fontWeightBold===t.fontWeightBold&&e.allowTransparency===t.allowTransparency&&e.deviceCharWidth===t.deviceCharWidth&&e.deviceCharHeight===t.deviceCharHeight&&e.drawBoldTextInBrightColors===t.drawBoldTextInBrightColors&&e.minimumContrastRatio===t.minimumContrastRatio&&e.colors.foreground.rgba===t.colors.foreground.rgba&&e.colors.background.rgba===t.colors.background.rgba},t.is256Color=function(e){return(50331648&e)==16777216||(50331648&e)==33554432}},237:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;let r=n(399);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=r.isFirefox||r.isLegacyEdge?`bottom`:`ideographic`},457:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CursorBlinkStateManager=void 0,t.CursorBlinkStateManager=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&=(this._coreBrowserService.window.clearInterval(this._blinkInterval),void 0),this._blinkStartTimeout&&=(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),void 0),this._animationFrame&&=(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(e=600){this._blinkInterval&&=(this._coreBrowserService.window.clearInterval(this._blinkInterval),void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){let e=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,e>0)return void this._restartInterval(e)}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 e=600-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(e);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),e)}pause(){this.isCursorVisible=!0,this._blinkInterval&&=(this._coreBrowserService.window.clearInterval(this._blinkInterval),void 0),this._blinkStartTimeout&&=(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),void 0),this._animationFrame&&=(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tryDrawCustomChar=t.powerlineDefinitions=t.boxDrawingDefinitions=t.blockElementDefinitions=void 0;let r=n(374);t.blockElementDefinitions={"▀":[{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}]};let i={"░":[[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]]};t.boxDrawingDefinitions={"─":{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,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"║":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╒":{1:(e,t)=>`M.5,1 L.5,${.5-t} L1,${.5-t} M.5,${.5+t} L1,${.5+t}`},"╓":{1:(e,t)=>`M${.5-e},1 L${.5-e},.5 L1,.5 M${.5+e},.5 L${.5+e},1`},"╔":{1:(e,t)=>`M1,${.5-t} L${.5-e},${.5-t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1`},"╕":{1:(e,t)=>`M0,${.5-t} L.5,${.5-t} L.5,1 M0,${.5+t} L.5,${.5+t}`},"╖":{1:(e,t)=>`M${.5+e},1 L${.5+e},.5 L0,.5 M${.5-e},.5 L${.5-e},1`},"╗":{1:(e,t)=>`M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M0,${.5-t} L${.5+e},${.5-t} L${.5+e},1`},"╘":{1:(e,t)=>`M.5,0 L.5,${.5+t} L1,${.5+t} M.5,${.5-t} L1,${.5-t}`},"╙":{1:(e,t)=>`M1,.5 L${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╚":{1:(e,t)=>`M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0 M1,${.5+t} L${.5-e},${.5+t} L${.5-e},0`},"╛":{1:(e,t)=>`M0,${.5+t} L.5,${.5+t} L.5,0 M0,${.5-t} L.5,${.5-t}`},"╜":{1:(e,t)=>`M0,.5 L${.5+e},.5 L${.5+e},0 M${.5-e},.5 L${.5-e},0`},"╝":{1:(e,t)=>`M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M0,${.5+t} L${.5+e},${.5+t} L${.5+e},0`},"╞":{1:(e,t)=>`M.5,0 L.5,1 M.5,${.5-t} L1,${.5-t} M.5,${.5+t} L1,${.5+t}`},"╟":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1 M${.5+e},.5 L1,.5`},"╠":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╡":{1:(e,t)=>`M.5,0 L.5,1 M0,${.5-t} L.5,${.5-t} M0,${.5+t} L.5,${.5+t}`},"╢":{1:(e,t)=>`M0,.5 L${.5-e},.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╣":{1:(e,t)=>`M${.5+e},0 L${.5+e},1 M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0`},"╤":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t} M.5,${.5+t} L.5,1`},"╥":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},1 M${.5+e},.5 L${.5+e},1`},"╦":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1`},"╧":{1:(e,t)=>`M.5,0 L.5,${.5-t} M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"╨":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╩":{1:(e,t)=>`M0,${.5+t} L1,${.5+t} M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╪":{1:(e,t)=>`M.5,0 L.5,1 M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"╫":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╬":{1:(e,t)=>`M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1 M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M1,${.5-t} L${.5+e},${.5-t} 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,t)=>`M.5,1 L.5,${.5+t/.15*.5} C.5,${.5+t/.15*.5},.5,.5,1,.5`},"╮":{1:(e,t)=>`M.5,1 L.5,${.5+t/.15*.5} C.5,${.5+t/.15*.5},.5,.5,0,.5`},"╯":{1:(e,t)=>`M.5,0 L.5,${.5-t/.15*.5} C.5,${.5-t/.15*.5},.5,.5,0,.5`},"╰":{1:(e,t)=>`M.5,0 L.5,${.5-t/.15*.5} C.5,${.5-t/.15*.5},.5,.5,1,.5`}},t.powerlineDefinitions={"":{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}},t.powerlineDefinitions[``]=t.powerlineDefinitions[``],t.powerlineDefinitions[``]=t.powerlineDefinitions[``],t.tryDrawCustomChar=function(e,n,o,l,u,d,f,p){let m=t.blockElementDefinitions[n];if(m)return function(e,t,n,r,i,a){for(let o=0;o<t.length;o++){let s=t[o],c=i/8,l=a/8;e.fillRect(n+s.x*c,r+s.y*l,s.w*c,s.h*l)}}(e,m,o,l,u,d),!0;let h=i[n];if(h)return function(e,t,n,i,o,s){let c=a.get(t);c||(c=new Map,a.set(t,c));let l=e.fillStyle;if(typeof l!=`string`)throw Error(`Unexpected fillStyle type "${l}"`);let u=c.get(l);if(!u){let n=t[0].length,i=t.length,a=e.canvas.ownerDocument.createElement(`canvas`);a.width=n,a.height=i;let o=(0,r.throwIfFalsy)(a.getContext(`2d`)),s=new ImageData(n,i),d,f,p,m;if(l.startsWith(`#`))d=parseInt(l.slice(1,3),16),f=parseInt(l.slice(3,5),16),p=parseInt(l.slice(5,7),16),m=l.length>7&&parseInt(l.slice(7,9),16)||1;else{if(!l.startsWith(`rgba`))throw Error(`Unexpected fillStyle color format "${l}" when drawing pattern glyph`);[d,f,p,m]=l.substring(5,l.length-1).split(`,`).map((e=>parseFloat(e)))}for(let e=0;e<i;e++)for(let r=0;r<n;r++)s.data[4*(e*n+r)]=d,s.data[4*(e*n+r)+1]=f,s.data[4*(e*n+r)+2]=p,s.data[4*(e*n+r)+3]=t[e][r]*(255*m);o.putImageData(s,0,0),u=(0,r.throwIfFalsy)(e.createPattern(a,null)),c.set(l,u)}e.fillStyle=u,e.fillRect(n,i,o,s)}(e,h,o,l,u,d),!0;let g=t.boxDrawingDefinitions[n];if(g)return function(e,t,n,r,i,a,o){e.strokeStyle=e.fillStyle;for(let[l,u]of Object.entries(t)){let t;e.beginPath(),e.lineWidth=o*Number.parseInt(l),t=typeof u==`function`?u(.15,.15/a*i):u;for(let l of t.split(` `)){let t=l[0],u=s[t];if(!u){console.error(`Could not find drawing instructions for "${t}"`);continue}let d=l.substring(1).split(`,`);d[0]&&d[1]&&u(e,c(d,i,a,n,r,!0,o))}e.stroke(),e.closePath()}}(e,g,o,l,u,d,p),!0;let _=t.powerlineDefinitions[n];return!!_&&(function(e,t,n,r,i,a,o,l){let u=new Path2D;u.rect(n,r,i,a),e.clip(u),e.beginPath();let d=o/12;e.lineWidth=l*d;for(let o of t.d.split(` `)){let u=o[0],f=s[u];if(!f){console.error(`Could not find drawing instructions for "${u}"`);continue}let p=o.substring(1).split(`,`);p[0]&&p[1]&&f(e,c(p,i,a,n,r,!1,l,(t.leftPadding??0)*(d/2),(t.rightPadding??0)*(d/2)))}t.type===1?(e.strokeStyle=e.fillStyle,e.stroke()):e.fill(),e.closePath()}(e,_,o,l,u,d,f,p),!0)};let a=new Map;function o(e,t,n=0){return Math.max(Math.min(e,t),n)}let s={C:(e,t)=>e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]),L:(e,t)=>e.lineTo(t[0],t[1]),M:(e,t)=>e.moveTo(t[0],t[1])};function c(e,t,n,r,i,a,s,c=0,l=0){let u=e.map((e=>parseFloat(e)||parseInt(e)));if(u.length<2)throw Error(`Too few arguments for instruction`);for(let e=0;e<u.length;e+=2)u[e]*=t-c*s-l*s,a&&u[e]!==0&&(u[e]=o(Math.round(u[e]+.5)-.5,t,0)),u[e]+=r+c*s;for(let e=1;e<u.length;e+=2)u[e]*=n,a&&u[e]!==0&&(u[e]=o(Math.round(u[e]+.5)-.5,n,0)),u[e]+=i;return u}},56:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.observeDevicePixelDimensions=void 0;let r=n(859);t.observeDevicePixelDimensions=function(e,t,n){let i=new t.ResizeObserver((t=>{let r=t.find((t=>t.target===e));if(!r)return;if(!(`devicePixelContentBoxSize`in r))return i?.disconnect(),void(i=void 0);let a=r.devicePixelContentBoxSize[0].inlineSize,o=r.devicePixelContentBoxSize[0].blockSize;a>0&&o>0&&n(a,o)}));try{i.observe(e,{box:[`device-pixel-content-box`]})}catch{i.disconnect(),i=void 0}return(0,r.toDisposable)((()=>i?.disconnect()))}},374:(e,t)=>{function n(e){return 57508<=e&&e<=57558}function r(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}Object.defineProperty(t,"__esModule",{value:!0}),t.computeNextVariantOffset=t.createRenderDimensions=t.treatGlyphAsBackgroundColor=t.allowRescaling=t.isEmoji=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(e){if(!e)throw Error(`value must not be falsy`);return e},t.isPowerlineGlyph=n,t.isRestrictedPowerlineGlyph=function(e){return 57520<=e&&e<=57527},t.isEmoji=r,t.allowRescaling=function(e,t,i,a){return t===1&&i>Math.ceil(1.5*a)&&e!==void 0&&e>255&&!r(e)&&!n(e)&&!function(e){return 57344<=e&&e<=63743}(e)},t.treatGlyphAsBackgroundColor=function(e){return n(e)||function(e){return 9472<=e&&e<=9631}(e)},t.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}}}},t.computeNextVariantOffset=function(e,t,n=0){return(e-(2*Math.round(t)-n))%(2*Math.round(t))}},296:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSelectionRenderModel=void 0;class n{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,t,n,r=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1])return void this.clear();let i=e.buffers.active.ydisp,a=t[1]-i,o=n[1]-i,s=Math.max(a,0),c=Math.min(o,e.rows-1);s>=e.rows||c<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=a,this.viewportEndRow=o,this.viewportCappedStartRow=s,this.viewportCappedEndRow=c,this.startCol=t[0],this.endCol=n[0])}isCellSelected(e,t,n){return!!this.hasSelection&&(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&n>=this.viewportCappedStartRow&&t<this.endCol&&n<=this.viewportCappedEndRow:t<this.startCol&&n>=this.viewportCappedStartRow&&t>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol)}}t.createSelectionRenderModel=function(){return new n}},509:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextureAtlas=void 0;let r=n(237),i=n(860),a=n(374),o=n(160),s=n(345),c=n(485),l=n(385),u=n(147),d=n(855),f={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}},p;class m{get pages(){return this._pages}constructor(e,t,n){this._document=e,this._config=t,this._unicodeService=n,this._didWarmUp=!1,this._cacheMap=new c.FourKeyMap,this._cacheMapCombined=new c.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new u.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new s.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new s.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=_(e,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,a.throwIfFalsy)(this._tmpCanvas.getContext(`2d`,{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(let e of this.pages)e.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||=(this._doWarmUp(),!0)}_doWarmUp(){let e=new l.IdleTaskQueue;for(let t=33;t<126;t++)e.enqueue((()=>{if(!this._cacheMap.get(t,d.DEFAULT_COLOR,d.DEFAULT_COLOR,d.DEFAULT_EXT)){let e=this._drawToCache(t,d.DEFAULT_COLOR,d.DEFAULT_COLOR,d.DEFAULT_EXT);this._cacheMap.set(t,d.DEFAULT_COLOR,d.DEFAULT_COLOR,d.DEFAULT_EXT,e)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(let e of this._pages)e.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(m.maxAtlasPages&&this._pages.length>=Math.max(4,m.maxAtlasPages)){let e=this._pages.filter((e=>2*e.canvas.width<=(m.maxTextureSize||4096))).sort(((e,t)=>t.canvas.width===e.canvas.width?t.percentageUsed-e.percentageUsed:t.canvas.width-e.canvas.width)),t=-1,n=0;for(let r=0;r<e.length;r++)if(e[r].canvas.width!==n)t=r,n=e[r].canvas.width;else if(r-t==3)break;let r=e.slice(t,t+4),i=r.map((e=>e.glyphs[0].texturePage)).sort(((e,t)=>e>t?1:-1)),a=this.pages.length-r.length,o=this._mergePages(r,a);o.version++;for(let e=i.length-1;e>=0;e--)this._deletePage(i[e]);this.pages.push(o),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(o.canvas)}let e=new h(this._document,this._textureSize);return this._pages.push(e),this._activePages.push(e),this._onAddTextureAtlasCanvas.fire(e.canvas),e}_mergePages(e,t){let n=2*e[0].canvas.width,r=new h(this._document,n,e);for(let[i,a]of e.entries()){let e=i*a.canvas.width%n,o=Math.floor(i/2)*a.canvas.height;r.ctx.drawImage(a.canvas,e,o);for(let r of a.glyphs)r.texturePage=t,r.sizeClipSpace.x=r.size.x/n,r.sizeClipSpace.y=r.size.y/n,r.texturePosition.x+=e,r.texturePosition.y+=o,r.texturePositionClipSpace.x=r.texturePosition.x/n,r.texturePositionClipSpace.y=r.texturePosition.y/n;this._onRemoveTextureAtlasCanvas.fire(a.canvas);let s=this._activePages.indexOf(a);s!==-1&&this._activePages.splice(s,1)}return r}_deletePage(e){this._pages.splice(e,1);for(let t=e;t<this._pages.length;t++){let e=this._pages[t];for(let t of e.glyphs)t.texturePage--;e.version++}}getRasterizedGlyphCombinedChar(e,t,n,r,i){return this._getFromCacheMap(this._cacheMapCombined,e,t,n,r,i)}getRasterizedGlyph(e,t,n,r,i){return this._getFromCacheMap(this._cacheMap,e,t,n,r,i)}_getFromCacheMap(e,t,n,r,i,a=!1){return p=e.get(t,n,r,i),p||(p=this._drawToCache(t,n,r,i,a),e.set(t,n,r,i,p)),p}_getColorFromAnsiIndex(e){if(e>=this._config.colors.ansi.length)throw Error(`No color found for idx `+e);return this._config.colors.ansi[e]}_getBackgroundColor(e,t,n,r){if(this._config.allowTransparency)return o.NULL_COLOR;let i;switch(e){case 16777216:case 33554432:i=this._getColorFromAnsiIndex(t);break;case 50331648:let e=u.AttributeData.toColorRGB(t);i=o.channels.toColor(e[0],e[1],e[2]);break;default:i=n?o.color.opaque(this._config.colors.foreground):this._config.colors.background}return i}_getForegroundColor(e,t,n,i,a,s,c,l,d,f){let p=this._getMinimumContrastColor(e,t,n,i,a,s,c,d,l,f);if(p)return p;let m;switch(a){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&d&&s<8&&(s+=8),m=this._getColorFromAnsiIndex(s);break;case 50331648:let e=u.AttributeData.toColorRGB(s);m=o.channels.toColor(e[0],e[1],e[2]);break;default:m=c?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(m=o.color.opaque(m)),l&&(m=o.color.multiplyOpacity(m,r.DIM_OPACITY)),m}_resolveBackgroundRgba(e,t,n){switch(e){case 16777216:case 33554432:return this._getColorFromAnsiIndex(t).rgba;case 50331648:return t<<8;default:return n?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(e,t,n,r){switch(e){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&r&&t<8&&(t+=8),this._getColorFromAnsiIndex(t).rgba;case 50331648:return t<<8;default:return n?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(e,t,n,r,i,a,s,c,l,u){if(this._config.minimumContrastRatio===1||u)return;let d=this._getContrastCache(l),f=d.getColor(e,r);if(f!==void 0)return f||void 0;let p=this._resolveBackgroundRgba(t,n,s),m=this._resolveForegroundRgba(i,a,s,c),h=o.rgba.ensureContrastRatio(p,m,this._config.minimumContrastRatio/(l?2:1));if(!h)return void d.setColor(e,r,null);let g=o.channels.toColor(h>>24&255,h>>16&255,h>>8&255);return d.setColor(e,r,g),g}_getContrastCache(e){return e?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(e,t,n,o,s=!1){let c=typeof e==`number`?String.fromCharCode(e):e,l=Math.min(this._config.deviceCellWidth*Math.max(c.length,2)+4,this._textureSize);this._tmpCanvas.width<l&&(this._tmpCanvas.width=l);let d=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<d&&(this._tmpCanvas.height=d),this._tmpCtx.save(),this._workAttributeData.fg=n,this._workAttributeData.bg=t,this._workAttributeData.extended.ext=o,this._workAttributeData.isInvisible())return f;let p=!!this._workAttributeData.isBold(),h=!!this._workAttributeData.isInverse(),_=!!this._workAttributeData.isDim(),v=!!this._workAttributeData.isItalic(),y=!!this._workAttributeData.isUnderline(),b=!!this._workAttributeData.isStrikethrough(),x=!!this._workAttributeData.isOverline(),S=this._workAttributeData.getFgColor(),C=this._workAttributeData.getFgColorMode(),w=this._workAttributeData.getBgColor(),T=this._workAttributeData.getBgColorMode();if(h){let e=S;S=w,w=e;let t=C;C=T,T=t}let E=this._getBackgroundColor(T,w,h,_);this._tmpCtx.globalCompositeOperation=`copy`,this._tmpCtx.fillStyle=E.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation=`source-over`;let D=p?this._config.fontWeightBold:this._config.fontWeight,ee=v?`italic`:``;this._tmpCtx.font=`${ee} ${D} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=r.TEXT_BASELINE;let O=c.length===1&&(0,a.isPowerlineGlyph)(c.charCodeAt(0)),k=c.length===1&&(0,a.isRestrictedPowerlineGlyph)(c.charCodeAt(0)),A=this._getForegroundColor(t,T,w,n,C,S,h,_,p,(0,a.treatGlyphAsBackgroundColor)(c.charCodeAt(0)));this._tmpCtx.fillStyle=A.css;let j=k?0:4,M=!1;!1!==this._config.customGlyphs&&(M=(0,i.tryDrawCustomChar)(this._tmpCtx,c,j,j,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let N,P=!O;if(N=typeof e==`number`?this._unicodeService.wcwidth(e):this._unicodeService.getStringCellWidth(e),y){this._tmpCtx.save();let e=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),t=e%2==1?.5:0;if(this._tmpCtx.lineWidth=e,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())P=!1,this._tmpCtx.strokeStyle=`rgb(${u.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(`,`)})`;else{P=!1;let e=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&e<8&&(e+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(e).css}this._tmpCtx.beginPath();let n=j,r=Math.ceil(j+this._config.deviceCharHeight)-t-(s?2*e:0),i=r+e,o=r+2*e,l=this._workAttributeData.getUnderlineVariantOffset();for(let s=0;s<N;s++){this._tmpCtx.save();let c=n+s*this._config.deviceCellWidth,u=n+(s+1)*this._config.deviceCellWidth,d=c+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(c,r),this._tmpCtx.lineTo(u,r),this._tmpCtx.moveTo(c,o),this._tmpCtx.lineTo(u,o);break;case 3:let n=e<=1?o:Math.ceil(j+this._config.deviceCharHeight-e/2)-t,s=e<=1?r:Math.ceil(j+this._config.deviceCharHeight+e/2)-t,f=new Path2D;f.rect(c,r,this._config.deviceCellWidth,o-r),this._tmpCtx.clip(f),this._tmpCtx.moveTo(c-this._config.deviceCellWidth/2,i),this._tmpCtx.bezierCurveTo(c-this._config.deviceCellWidth/2,s,c,s,c,i),this._tmpCtx.bezierCurveTo(c,n,d,n,d,i),this._tmpCtx.bezierCurveTo(d,s,u,s,u,i),this._tmpCtx.bezierCurveTo(u,n,u+this._config.deviceCellWidth/2,n,u+this._config.deviceCellWidth/2,i);break;case 4:let p=l===0?0:l>=e?2*e-l:e-l;!(l>=e)==0||p===0?(this._tmpCtx.setLineDash([Math.round(e),Math.round(e)]),this._tmpCtx.moveTo(c+p,r),this._tmpCtx.lineTo(u,r)):(this._tmpCtx.setLineDash([Math.round(e),Math.round(e)]),this._tmpCtx.moveTo(c,r),this._tmpCtx.lineTo(c+p,r),this._tmpCtx.moveTo(c+p+e,r),this._tmpCtx.lineTo(u,r)),l=(0,a.computeNextVariantOffset)(u-c,e,l);break;case 5:let m=u-c,h=Math.floor(.6*m),g=Math.floor(.3*m),_=m-h-g;this._tmpCtx.setLineDash([h,g,_]),this._tmpCtx.moveTo(c,r),this._tmpCtx.lineTo(u,r);break;default:this._tmpCtx.moveTo(c,r),this._tmpCtx.lineTo(u,r)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!M&&this._config.fontSize>=12&&!this._config.allowTransparency&&c!==` `){this._tmpCtx.save(),this._tmpCtx.textBaseline=`alphabetic`;let t=this._tmpCtx.measureText(c);if(this._tmpCtx.restore(),`actualBoundingBoxDescent`in t&&t.actualBoundingBoxDescent>0){this._tmpCtx.save();let t=new Path2D;t.rect(n,r-Math.ceil(e/2),this._config.deviceCellWidth*N,o-r+Math.ceil(e/2)),this._tmpCtx.clip(t),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=E.css,this._tmpCtx.strokeText(c,j,j+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(x){let e=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),t=e%2==1?.5:0;this._tmpCtx.lineWidth=e,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(j,j+t),this._tmpCtx.lineTo(j+this._config.deviceCharWidth*N,j+t),this._tmpCtx.stroke()}if(M||this._tmpCtx.fillText(c,j,j+this._config.deviceCharHeight),c===`_`&&!this._config.allowTransparency){let e=g(this._tmpCtx.getImageData(j,j,this._config.deviceCellWidth,this._config.deviceCellHeight),E,A,P);if(e)for(let t=1;t<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=E.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(c,j,j+this._config.deviceCharHeight-t),e=g(this._tmpCtx.getImageData(j,j,this._config.deviceCellWidth,this._config.deviceCellHeight),E,A,P),e);t++);}if(b){let e=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),t=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=e,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(j,j+Math.floor(this._config.deviceCharHeight/2)-t),this._tmpCtx.lineTo(j+this._config.deviceCharWidth*N,j+Math.floor(this._config.deviceCharHeight/2)-t),this._tmpCtx.stroke()}this._tmpCtx.restore();let F=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),I;if(I=this._config.allowTransparency?function(e){for(let t=0;t<e.data.length;t+=4)if(e.data[t+3]>0)return!1;return!0}(F):g(F,E,A,P),I)return f;let L=this._findGlyphBoundingBox(F,this._workBoundingBox,l,k,M,j),R,z;for(;;){if(this._activePages.length===0){let e=this._createNewPage();R=e,z=e.currentRow,z.height=L.size.y;break}R=this._activePages[this._activePages.length-1],z=R.currentRow;for(let e of this._activePages)L.size.y<=e.currentRow.height&&(R=e,z=e.currentRow);for(let e=this._activePages.length-1;e>=0;e--)for(let t of this._activePages[e].fixedRows)t.height<=z.height&&L.size.y<=t.height&&(R=this._activePages[e],z=t);if(z.y+L.size.y>=R.canvas.height||z.height>L.size.y+2){let e=!1;if(R.currentRow.y+R.currentRow.height+L.size.y>=R.canvas.height){let t;for(let e of this._activePages)if(e.currentRow.y+e.currentRow.height+L.size.y<e.canvas.height){t=e;break}if(t)R=t;else if(m.maxAtlasPages&&this._pages.length>=m.maxAtlasPages&&z.y+L.size.y<=R.canvas.height&&z.height>=L.size.y&&z.x+L.size.x<=R.canvas.width)e=!0;else{let t=this._createNewPage();R=t,z=t.currentRow,z.height=L.size.y,e=!0}}e||(R.currentRow.height>0&&R.fixedRows.push(R.currentRow),z={x:0,y:R.currentRow.y+R.currentRow.height,height:L.size.y},R.fixedRows.push(z),R.currentRow={x:0,y:z.y+z.height,height:0})}if(z.x+L.size.x<=R.canvas.width)break;z===R.currentRow?(z.x=0,z.y+=z.height,z.height=0):R.fixedRows.splice(R.fixedRows.indexOf(z),1)}return L.texturePage=this._pages.indexOf(R),L.texturePosition.x=z.x,L.texturePosition.y=z.y,L.texturePositionClipSpace.x=z.x/R.canvas.width,L.texturePositionClipSpace.y=z.y/R.canvas.height,L.sizeClipSpace.x/=R.canvas.width,L.sizeClipSpace.y/=R.canvas.height,z.height=Math.max(z.height,L.size.y),z.x+=L.size.x,R.ctx.putImageData(F,L.texturePosition.x-this._workBoundingBox.left,L.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,L.size.x,L.size.y),R.addGlyph(L),R.version++,L}_findGlyphBoundingBox(e,t,n,r,i,a){t.top=0;let o=r?this._config.deviceCellHeight:this._tmpCanvas.height,s=r?this._config.deviceCellWidth:n,c=!1;for(let n=0;n<o;n++){for(let r=0;r<s;r++){let i=n*this._tmpCanvas.width*4+4*r+3;if(e.data[i]!==0){t.top=n,c=!0;break}}if(c)break}t.left=0,c=!1;for(let n=0;n<a+s;n++){for(let r=0;r<o;r++){let i=r*this._tmpCanvas.width*4+4*n+3;if(e.data[i]!==0){t.left=n,c=!0;break}}if(c)break}t.right=s,c=!1;for(let n=a+s-1;n>=a;n--){for(let r=0;r<o;r++){let i=r*this._tmpCanvas.width*4+4*n+3;if(e.data[i]!==0){t.right=n,c=!0;break}}if(c)break}t.bottom=o,c=!1;for(let n=o-1;n>=0;n--){for(let r=0;r<s;r++){let i=n*this._tmpCanvas.width*4+4*r+3;if(e.data[i]!==0){t.bottom=n,c=!0;break}}if(c)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:t.right-t.left+1,y:t.bottom-t.top+1},sizeClipSpace:{x:t.right-t.left+1,y:t.bottom-t.top+1},offset:{x:-t.left+a+(r||i?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-t.top+a+(r||i?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}t.TextureAtlas=m;class h{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}constructor(e,t,n){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],n)for(let e of n)this._glyphs.push(...e.glyphs),this._usedPixels+=e._usedPixels;this.canvas=_(e,t,t),this.ctx=(0,a.throwIfFalsy)(this.canvas.getContext(`2d`,{alpha:!0}))}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 g(e,t,n,r){let i=t.rgba>>>24,a=t.rgba>>>16&255,o=t.rgba>>>8&255,s=n.rgba>>>24,c=n.rgba>>>16&255,l=n.rgba>>>8&255,u=Math.floor((Math.abs(i-s)+Math.abs(a-c)+Math.abs(o-l))/12),d=!0;for(let t=0;t<e.data.length;t+=4)e.data[t]===i&&e.data[t+1]===a&&e.data[t+2]===o||r&&Math.abs(e.data[t]-i)+Math.abs(e.data[t+1]-a)+Math.abs(e.data[t+2]-o)<u?e.data[t+3]=0:d=!1;return d}function _(e,t,n){let r=e.createElement(`canvas`);return r.width=t,r.height=n,r}},577:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterJoinerService=t.JoinedCellData=void 0;let a=n(147),o=n(855),s=n(782),c=n(97);class l extends a.AttributeData{constructor(e,t,n){super(),this.content=0,this.combinedData=``,this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error(`not implemented`)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.JoinedCellData=l;let u=t.CharacterJoinerService=class e{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new s.CellData}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let n=[],r=t.translateToString(!0),i=0,a=0,s=0,c=t.getFg(0),l=t.getBg(0);for(let e=0;e<t.getTrimmedLength();e++)if(t.loadCell(e,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==c||this._workCell.bg!==l){if(e-i>1){let e=this._getJoinedRanges(r,s,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}i=e,s=a,c=this._workCell.fg,l=this._workCell.bg}a+=this._workCell.getChars().length||o.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-i>1){let e=this._getJoinedRanges(r,s,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}return n}_getJoinedRanges(t,n,r,i,a){let o=t.substring(n,r),s=[];try{s=this._characterJoiners[0].handler(o)}catch(e){console.error(e)}for(let t=1;t<this._characterJoiners.length;t++)try{let n=this._characterJoiners[t].handler(o);for(let t=0;t<n.length;t++)e._mergeRanges(s,n[t])}catch(e){console.error(e)}return this._stringRangesToCellRanges(s,i,a),s}_stringRangesToCellRanges(e,t,n){let r=0,i=!1,a=0,s=e[r];if(s){for(let c=n;c<this._bufferService.cols;c++){let n=t.getWidth(c),l=t.getString(c).length||o.WHITESPACE_CELL_CHAR.length;if(n!==0){if(!i&&s[0]<=a&&(s[0]=c,i=!0),s[1]<=a){if(s[1]=c,s=e[++r],!s)break;s[0]<=a?(s[0]=c,i=!0):i=!1}a+=l}}s&&(s[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(n){if(t[1]<=i[0])return e[r-1][1]=t[1],e;if(t[1]<=i[1])return e[r-1][1]=Math.max(t[1],i[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=i[0])return e.splice(r,0,t),e;if(t[1]<=i[1])return i[0]=Math.min(t[0],i[0]),e;t[0]<i[1]&&(i[0]=Math.min(t[0],i[0]),n=!0)}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};t.CharacterJoinerService=u=r([i(0,c.IBufferService)],u)},160:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;let n=0,r=0,i=0,a=0;var o,s,c,l,u;function d(e){let t=e.toString(16);return t.length<2?`0`+t:t}function f(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}t.NULL_COLOR={css:`#00000000`,rgba:0},function(e){e.toCss=function(e,t,n,r){return r===void 0?`#${d(e)}${d(t)}${d(n)}`:`#${d(e)}${d(t)}${d(n)}${d(r)}`},e.toRgba=function(e,t,n,r=255){return(e<<24|t<<16|n<<8|r)>>>0},e.toColor=function(t,n,r,i){return{css:e.toCss(t,n,r,i),rgba:e.toRgba(t,n,r,i)}}}(o||(t.channels=o={})),function(e){function t(e,t){return a=Math.round(255*t),[n,r,i]=u.toChannels(e.rgba),{css:o.toCss(n,r,i,a),rgba:o.toRgba(n,r,i,a)}}e.blend=function(e,t){if(a=(255&t.rgba)/255,a===1)return{css:t.css,rgba:t.rgba};let s=t.rgba>>24&255,c=t.rgba>>16&255,l=t.rgba>>8&255,u=e.rgba>>24&255,d=e.rgba>>16&255,f=e.rgba>>8&255;return n=u+Math.round((s-u)*a),r=d+Math.round((c-d)*a),i=f+Math.round((l-f)*a),{css:o.toCss(n,r,i),rgba:o.toRgba(n,r,i)}},e.isOpaque=function(e){return(255&e.rgba)==255},e.ensureContrastRatio=function(e,t,n){let r=u.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return o.toColor(r>>24&255,r>>16&255,r>>8&255)},e.opaque=function(e){let t=(255|e.rgba)>>>0;return[n,r,i]=u.toChannels(t),{css:o.toCss(n,r,i),rgba:t}},e.opacity=t,e.multiplyOpacity=function(e,n){return a=255&e.rgba,t(e,a*n/255)},e.toColorRGB=function(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}}(s||(t.color=s={})),function(e){let t,s;try{let e=document.createElement(`canvas`);e.width=1,e.height=1;let n=e.getContext(`2d`,{willReadFrequently:!0});n&&(t=n,t.globalCompositeOperation=`copy`,s=t.createLinearGradient(0,0,1,1))}catch{}e.toColor=function(e){if(e.match(/#[\da-f]{3,8}/i))switch(e.length){case 4:return n=parseInt(e.slice(1,2).repeat(2),16),r=parseInt(e.slice(2,3).repeat(2),16),i=parseInt(e.slice(3,4).repeat(2),16),o.toColor(n,r,i);case 5:return n=parseInt(e.slice(1,2).repeat(2),16),r=parseInt(e.slice(2,3).repeat(2),16),i=parseInt(e.slice(3,4).repeat(2),16),a=parseInt(e.slice(4,5).repeat(2),16),o.toColor(n,r,i,a);case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}let c=e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(c)return n=parseInt(c[1]),r=parseInt(c[2]),i=parseInt(c[3]),a=Math.round(255*(c[5]===void 0?1:parseFloat(c[5]))),o.toColor(n,r,i,a);if(!t||!s||(t.fillStyle=s,t.fillStyle=e,typeof t.fillStyle!=`string`)||(t.fillRect(0,0,1,1),[n,r,i,a]=t.getImageData(0,0,1,1).data,a!==255))throw Error(`css.toColor: Unsupported css format`);return{rgba:o.toRgba(n,r,i,a),css:e}}}(c||(t.css=c={})),function(e){function t(e,t,n){let r=e/255,i=t/255,a=n/255;return .2126*(r<=.03928?r/12.92:((r+.055)/1.055)**2.4)+.7152*(i<=.03928?i/12.92:((i+.055)/1.055)**2.4)+.0722*(a<=.03928?a/12.92:((a+.055)/1.055)**2.4)}e.relativeLuminance=function(e){return t(e>>16&255,e>>8&255,255&e)},e.relativeLuminance2=t}(l||(t.rgb=l={})),function(e){function t(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,u=f(l.relativeLuminance2(o,s,c),l.relativeLuminance2(r,i,a));for(;u<n&&(o>0||s>0||c>0);)o-=Math.max(0,Math.ceil(.1*o)),s-=Math.max(0,Math.ceil(.1*s)),c-=Math.max(0,Math.ceil(.1*c)),u=f(l.relativeLuminance2(o,s,c),l.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}function s(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,u=f(l.relativeLuminance2(o,s,c),l.relativeLuminance2(r,i,a));for(;u<n&&(o<255||s<255||c<255);)o=Math.min(255,o+Math.ceil(.1*(255-o))),s=Math.min(255,s+Math.ceil(.1*(255-s))),c=Math.min(255,c+Math.ceil(.1*(255-c))),u=f(l.relativeLuminance2(o,s,c),l.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.blend=function(e,t){if(a=(255&t)/255,a===1)return t;let s=t>>24&255,c=t>>16&255,l=t>>8&255,u=e>>24&255,d=e>>16&255,f=e>>8&255;return n=u+Math.round((s-u)*a),r=d+Math.round((c-d)*a),i=f+Math.round((l-f)*a),o.toRgba(n,r,i)},e.ensureContrastRatio=function(e,n,r){let i=l.relativeLuminance(e>>8),a=l.relativeLuminance(n>>8);if(f(i,a)<r){if(a<i){let a=t(e,n,r),o=f(i,l.relativeLuminance(a>>8));if(o<r){let t=s(e,n,r);return o>f(i,l.relativeLuminance(t>>8))?a:t}return a}let o=s(e,n,r),c=f(i,l.relativeLuminance(o>>8));if(c<r){let a=t(e,n,r);return c>f(i,l.relativeLuminance(a>>8))?o:a}return o}},e.reduceLuminance=t,e.increaseLuminance=s,e.toChannels=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]}}(u||(t.rgba=u={})),t.toPaddedHex=d,t.contrastRatio=f},345:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.runAndSubscribe=t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||=e=>(this._listeners.push(e),{dispose:()=>{if(!this._disposed){for(let t=0;t<this._listeners.length;t++)if(this._listeners[t]===e)return void this._listeners.splice(t,1)}}}),this._event}fire(e,t){let n=[];for(let e=0;e<this._listeners.length;e++)n.push(this._listeners[e]);for(let r=0;r<n.length;r++)n[r].call(void 0,e,t)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},t.forwardEvent=function(e,t){return e((e=>t.fire(e)))},t.runAndSubscribe=function(e,t){return t(void 0),e((e=>t(e)))}},859:(e,t)=>{function n(e){for(let t of e)t.dispose();e.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.MutableDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(let e of this._disposables)e.dispose();this._disposables.length=0}register(e){return this._disposables.push(e),e}unregister(e){let t=this._disposables.indexOf(e);t!==-1&&this._disposables.splice(t,1)}},t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},t.toDisposable=function(e){return{dispose:e}},t.disposeArray=n,t.getDisposeArrayDisposable=function(e){return{dispose:()=>n(e)}}},485:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class n{constructor(){this._data={}}set(e,t,n){this._data[e]||(this._data[e]={}),this._data[e][t]=n}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}}t.TwoKeyMap=n,t.FourKeyMap=class{constructor(){this._data=new n}set(e,t,r,i,a){this._data.get(e,t)||this._data.set(e,t,new n),this._data.get(e,t).set(r,i,a)}get(e,t,n,r){return this._data.get(e,t)?.get(n,r)}clear(){this._data.clear()}}},399:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isChromeOS=t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.getSafariVersion=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode=typeof process<`u`&&`title`in process;let n=t.isNode?`node`:navigator.userAgent,r=t.isNode?`node`:navigator.platform;t.isFirefox=n.includes(`Firefox`),t.isLegacyEdge=n.includes(`Edge`),t.isSafari=/^((?!chrome|android).)*safari/i.test(n),t.getSafariVersion=function(){if(!t.isSafari)return 0;let e=n.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])},t.isMac=[`Macintosh`,`MacIntel`,`MacPPC`,`Mac68K`].includes(r),t.isIpad=r===`iPad`,t.isIphone=r===`iPhone`,t.isWindows=[`Windows`,`Win16`,`Win32`,`WinCE`].includes(r),t.isLinux=r.indexOf(`Linux`)>=0,t.isChromeOS=/\bCrOS\b/.test(n)},385:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;let r=n(399);class i{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),void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||=this._requestCallback(this._process.bind(this))}_process(e){this._idleCallback=void 0;let t=0,n=0,r=e.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(t=Date.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,Date.now()-t),n=Math.max(t,n),i=e.timeRemaining(),1.5*n>i)return r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),void this._start();r=i}this.clear()}}class a extends i{_requestCallback(e){return setTimeout((()=>e(this._createDeadline(16))))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=Date.now()+e;return{timeRemaining:()=>Math.max(0,t-Date.now())}}}t.PriorityTaskQueue=a,t.IdleTaskQueue=!r.isNode&&`requestIdleCallback`in window?class extends i{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}}:a,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}}},147:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class n{constructor(){this.fg=0,this.bg=0,this.extended=new r}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){let e=new n;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}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)}isBgDefault(){return!(50331648&this.bg)}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):this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}t.AttributeData=n;class r{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(3758096384&this._ext)>>29;return e<0?4294967288^e:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}clone(){return new r(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}t.ExtendedAttrs=r},782:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;let r=n(133),i=n(855),a=n(147);class o extends a.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new a.ExtendedAttrs,this.combinedData=``}static fromCharData(e){let t=new o;return t.setFromCharData(e),t}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,r.stringFromCodePoint)(2097151&this.content):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[i.CHAR_DATA_ATTR_INDEX],this.bg=0;let t=!1;if(e[i.CHAR_DATA_CHAR_INDEX].length>2)t=!0;else if(e[i.CHAR_DATA_CHAR_INDEX].length===2){let n=e[i.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[i.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=r&&r<=57343?this.content=1024*(n-55296)+r-56320+65536|e[i.CHAR_DATA_WIDTH_INDEX]<<22:t=!0}else t=!0}else this.content=e[i.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[i.CHAR_DATA_WIDTH_INDEX]<<22;t&&(this.combinedData=e[i.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[i.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=o},855:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=0,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR=``,t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=` `,t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},133:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode(55296+(t>>10))+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=1024*(this._interim-55296)+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=1024*(i-55296)+o-56320+65536:(t[r++]=i,t[r++]=o)}else i!==65279&&(t[r++]=i)}return r}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r,i,a,o,s=0,c=0,l=0;if(this.interim[0]){let r=!1,i=this.interim[0];i&=(224&i)==192?31:(240&i)==224?15:7;let a,o=0;for(;(a=63&this.interim[++o])&&o<4;)i<<=6,i|=a;let c=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(a=e[l++],(192&a)!=128){l--,r=!0;break}this.interim[o++]=a,i<<=6,i|=63&a}r||(c===2?i<128?l--:t[s++]=i:c===3?i<2048||i>=55296&&i<=57343||i===65279||(t[s++]=i):i<65536||i>1114111||(t[s++]=i)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;!(!(d<u)||128&(r=e[d])||128&(i=e[d+1])||128&(a=e[d+2])||128&(o=e[d+3]));)t[s++]=r,t[s++]=i,t[s++]=a,t[s++]=o,d+=4;if(r=e[d++],r<128)t[s++]=r;else if((224&r)==192){if(d>=n)return this.interim[0]=r,s;if(i=e[d++],(192&i)!=128){d--;continue}if(c=(31&r)<<6|63&i,c<128){d--;continue}t[s++]=c}else if((240&r)==224){if(d>=n)return this.interim[0]=r,s;if(i=e[d++],(192&i)!=128){d--;continue}if(d>=n)return this.interim[0]=r,this.interim[1]=i,s;if(a=e[d++],(192&a)!=128){d--;continue}if(c=(15&r)<<12|(63&i)<<6|63&a,c<2048||c>=55296&&c<=57343||c===65279)continue;t[s++]=c}else if((248&r)==240){if(d>=n)return this.interim[0]=r,s;if(i=e[d++],(192&i)!=128){d--;continue}if(d>=n)return this.interim[0]=r,this.interim[1]=i,s;if(a=e[d++],(192&a)!=128){d--;continue}if(d>=n)return this.interim[0]=r,this.interim[1]=i,this.interim[2]=a,s;if(o=e[d++],(192&o)!=128){d--;continue}if(c=(7&r)<<18|(63&i)<<12|(63&a)<<6|63&o,c<65536||c>1114111)continue;t[s++]=c}}return s}}},776:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.traceCall=t.setTraceLogger=t.LogService=void 0;let a=n(859),o=n(97),s={trace:o.LogLevelEnum.TRACE,debug:o.LogLevelEnum.DEBUG,info:o.LogLevelEnum.INFO,warn:o.LogLevelEnum.WARN,error:o.LogLevelEnum.ERROR,off:o.LogLevelEnum.OFF},c,l=t.LogService=class extends a.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=o.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange(`logLevel`,(()=>this._updateLogLevel()))),c=this}_updateLogLevel(){this._logLevel=s[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]==`function`&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?``:`xterm.js: `)+t,...n)}trace(e,...t){this._logLevel<=o.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=o.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=o.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=o.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=o.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};t.LogService=l=r([i(0,o.IOptionsService)],l),t.setTraceLogger=function(e){c=e},t.traceCall=function(e,t,n){if(typeof n.value!=`function`)throw Error(`not supported`);let r=n.value;n.value=function(...e){if(c.logLevel!==o.LogLevelEnum.TRACE)return r.apply(this,e);c.trace(`GlyphRenderer#${r.name}(${e.map((e=>JSON.stringify(e))).join(`, `)})`);let t=r.apply(this,e);return c.trace(`GlyphRenderer#${r.name} return`,t),t}}},726:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0;let n=`di$target`,r=`di$dependencies`;t.serviceRegistry=new Map,t.getServiceDependencies=function(e){return e[r]||[]},t.createDecorator=function(e){if(t.serviceRegistry.has(e))return t.serviceRegistry.get(e);let i=function(e,t,a){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);(function(e,t,i){t[n]===t?t[r].push({id:e,index:i}):(t[r]=[{id:e,index:i}],t[n]=t)})(i,e,a)};return i.toString=()=>e,t.serviceRegistry.set(e,i),i}},97:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;let r=n(726);var i;t.IBufferService=(0,r.createDecorator)(`BufferService`),t.ICoreMouseService=(0,r.createDecorator)(`CoreMouseService`),t.ICoreService=(0,r.createDecorator)(`CoreService`),t.ICharsetService=(0,r.createDecorator)(`CharsetService`),t.IInstantiationService=(0,r.createDecorator)(`InstantiationService`),function(e){e[e.TRACE=0]=`TRACE`,e[e.DEBUG=1]=`DEBUG`,e[e.INFO=2]=`INFO`,e[e.WARN=3]=`WARN`,e[e.ERROR=4]=`ERROR`,e[e.OFF=5]=`OFF`}(i||(t.LogLevelEnum=i={})),t.ILogService=(0,r.createDecorator)(`LogService`),t.IOptionsService=(0,r.createDecorator)(`OptionsService`),t.IOscLinkService=(0,r.createDecorator)(`OscLinkService`),t.IUnicodeService=(0,r.createDecorator)(`UnicodeService`),t.IDecorationService=(0,r.createDecorator)(`DecorationService`)}},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,n),a.exports}var r={};return(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasAddon=void 0;let t=n(345),i=n(859),a=n(776),o=n(949);class s extends i.Disposable{constructor(){super(...arguments),this._onChangeTextureAtlas=this.register(new t.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new t.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event}get textureAtlas(){return this._renderer?.textureAtlas}activate(e){let n=e._core;if(!e.element)return void this.register(n.onWillOpen((()=>this.activate(e))));this._terminal=e;let r=n.coreService,s=n.optionsService,c=n.screenElement,l=n.linkifier,u=n,d=u._bufferService,f=u._renderService,p=u._characterJoinerService,m=u._charSizeService,h=u._coreBrowserService,g=u._decorationService,_=u._logService,v=u._themeService;(0,a.setTraceLogger)(_),this._renderer=new o.CanvasRenderer(e,c,l,d,m,s,p,r,h,g,v),this.register((0,t.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,t.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),f.setRenderer(this._renderer),f.handleResize(d.cols,d.rows),this.register((0,i.toDisposable)((()=>{f.setRenderer(this._terminal._core._createRenderer()),f.handleResize(e.cols,e.rows),this._renderer?.dispose(),this._renderer=void 0})))}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}}e.CanvasAddon=s})(),r})()))}))(),w=2,T=1,E=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(w,Math.floor(u/e.css.cell.width)),rows:Math.max(T,Math.floor(l/e.css.cell.height))}}},D=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?j.isErrorNoTelemetry(e)?new j(e.message+`
1
+ import{a as e,t}from"./rolldown-runtime-B0Z9INg1.js";import{t as n}from"./useEvent-Dfcbgjhg.js";import{t as r}from"./react-DVplv7_D.js";import{t as i}from"./compiler-runtime-BrajqUja.js";import{g as a}from"./useEventListener-CjDeLqFC.js";import{S as o,o as s}from"./config-DzdxZb17.js";import{t as c}from"./cn-ldLVeaqm.js";import{t as l}from"./jsx-runtime-B74pBk57.js";import{t as u}from"./createLucideIcon-DfJ2oMlA.js";import{t as d}from"./clipboard-paste-HVpozQmt.js";import{t as f}from"./copy-Djr5m5ac.js";import{t as p}from"./trash-2-DcgaW8fn.js";import{n as m}from"./copy-KlhazlhB.js";import{r as h}from"./useDebounce-B_ccBZTp.js";import{n as g}from"./renderShortcut-H60uiHBp.js";import{n as _,t as v}from"./state-BY4_P6ko.js";var y=u(`text-select`,[[`path`,{d:`M14 21h1`,key:`v9vybs`}],[`path`,{d:`M14 3h1`,key:`1ec4yj`}],[`path`,{d:`M19 3a2 2 0 0 1 2 2`,key:`18rm91`}],[`path`,{d:`M21 14v1`,key:`169vum`}],[`path`,{d:`M21 19a2 2 0 0 1-2 2`,key:`1j7049`}],[`path`,{d:`M21 9v1`,key:`mxsmne`}],[`path`,{d:`M3 14v1`,key:`vnatye`}],[`path`,{d:`M3 9v1`,key:`1r0deq`}],[`path`,{d:`M5 21a2 2 0 0 1-2-2`,key:`sbafld`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2`,key:`y57alp`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}],[`path`,{d:`M7 16h6`,key:`1vyc9m`}],[`path`,{d:`M7 8h8`,key:`1jbsf9`}],[`path`,{d:`M9 21h1`,key:`15o7lz`}],[`path`,{d:`M9 3h1`,key:`1yesri`}]]),b=i(),x=class{constructor(e,t){this._disposables=[],this._socket=e,this._socket.binaryType=`arraybuffer`,this._bidirectional=!(t&&t.bidirectional===!1)}activate(e){this._disposables.push(S(this._socket,`message`,t=>{let n=t.data;e.write(typeof n==`string`?n:new Uint8Array(n))})),this._bidirectional&&(this._disposables.push(e.onData(e=>this._sendData(e))),this._disposables.push(e.onBinary(e=>this._sendBinary(e)))),this._disposables.push(S(this._socket,`close`,()=>this.dispose())),this._disposables.push(S(this._socket,`error`,()=>this.dispose()))}dispose(){for(let e of this._disposables)e.dispose()}_sendData(e){this._checkOpenSocket()&&this._socket.send(e)}_sendBinary(e){if(!this._checkOpenSocket())return;let t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n)&255;this._socket.send(t)}_checkOpenSocket(){switch(this._socket.readyState){case WebSocket.OPEN:return!0;case WebSocket.CONNECTING:throw Error(`Attach addon was loaded before socket was open`);case WebSocket.CLOSING:return console.warn(`Attach addon socket is closing`),!1;case WebSocket.CLOSED:throw Error(`Attach addon socket is closed`);default:throw Error(`Unexpected socket state`)}}};function S(e,t,n){return e.addEventListener(t,n),{dispose:()=>{n&&e.removeEventListener(t,n)}}}var C=t(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.CanvasAddon=r():n.CanvasAddon=r()})(self,(()=>(()=>{var e={903:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRenderLayer=void 0;let r=n(274),i=n(627),a=n(237),o=n(860),s=n(374),c=n(296),l=n(345),u=n(859),d=n(399),f=n(855);class p extends u.Disposable{get canvas(){return this._canvas}get cacheCanvas(){return this._charAtlas?.pages[0].canvas}constructor(e,t,n,i,a,o,s,d,f,p){super(),this._terminal=e,this._container=t,this._alpha=a,this._themeService=o,this._bufferService=s,this._optionsService=d,this._decorationService=f,this._coreBrowserService=p,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._selectionModel=(0,c.createSelectionRenderModel)(),this._bitmapGenerator=[],this._charAtlasDisposable=this.register(new u.MutableDisposable),this._onAddTextureAtlasCanvas=this.register(new l.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._cellColorResolver=new r.CellColorResolver(this._terminal,this._optionsService,this._selectionModel,this._decorationService,this._coreBrowserService,this._themeService),this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`),this._canvas.classList.add(`xterm-${n}-layer`),this._canvas.style.zIndex=i.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._refreshCharAtlas(this._themeService.colors),this.register(this._themeService.onChangeColors((e=>{this._refreshCharAtlas(e),this.reset(),this.handleSelectionChanged(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}))),this.register((0,u.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,s.throwIfFalsy)(this._canvas.getContext(`2d`,{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(){}handleFocus(){}handleCursorMove(){}handleGridChanged(e,t){}handleSelectionChanged(e,t,n=!1){this._selectionModel.update(this._terminal._core,e,t,n)}_setTransparency(e){if(e===this._alpha)return;let t=this._canvas;this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,t),this._refreshCharAtlas(this._themeService.colors),this.handleGridChanged(0,this._bufferService.rows-1)}_refreshCharAtlas(e){if(!(this._deviceCharWidth<=0&&this._deviceCharHeight<=0)){this._charAtlas=(0,i.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,e,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlasDisposable.value=(0,l.forwardEvent)(this._charAtlas.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),this._charAtlas.warmUp();for(let e=0;e<this._charAtlas.pages.length;e++)this._bitmapGenerator[e]=new m(this._charAtlas.pages[e].canvas)}}resize(e){this._deviceCellWidth=e.device.cell.width,this._deviceCellHeight=e.device.cell.height,this._deviceCharWidth=e.device.char.width,this._deviceCharHeight=e.device.char.height,this._deviceCharLeft=e.device.char.left,this._deviceCharTop=e.device.char.top,this._canvas.width=e.device.canvas.width,this._canvas.height=e.device.canvas.height,this._canvas.style.width=`${e.css.canvas.width}px`,this._canvas.style.height=`${e.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(this._themeService.colors)}clearTextureAtlas(){this._charAtlas?.clearTexture()}_fillCells(e,t,n,r){this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight)}_fillMiddleLineAtCells(e,t,n=1){let r=Math.ceil(.5*this._deviceCellHeight);this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-r-this._coreBrowserService.dpr,n*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillBottomLineAtCells(e,t,n=1,r=0){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight+r-this._coreBrowserService.dpr-1,n*this._deviceCellWidth,this._coreBrowserService.dpr)}_curlyUnderlineAtCell(e,t,n=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;let r=this._coreBrowserService.dpr;this._ctx.lineWidth=r;for(let i=0;i<n;i++){let n=(e+i)*this._deviceCellWidth,a=(e+i+.5)*this._deviceCellWidth,o=(e+i+1)*this._deviceCellWidth,s=(t+1)*this._deviceCellHeight-r-1,c=s-r,l=s+r;this._ctx.moveTo(n,s),this._ctx.bezierCurveTo(n,c,a,c,a,s),this._ctx.bezierCurveTo(a,l,o,l,o,s)}this._ctx.stroke(),this._ctx.restore()}_dottedUnderlineAtCell(e,t,n=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;let r=this._coreBrowserService.dpr;this._ctx.lineWidth=r,this._ctx.setLineDash([2*r,r]);let i=e*this._deviceCellWidth,a=(t+1)*this._deviceCellHeight-r-1;this._ctx.moveTo(i,a);for(let t=0;t<n;t++){let r=(e+n+t)*this._deviceCellWidth;this._ctx.lineTo(r,a)}this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_dashedUnderlineAtCell(e,t,n=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;let r=this._coreBrowserService.dpr;this._ctx.lineWidth=r,this._ctx.setLineDash([4*r,3*r]);let i=e*this._deviceCellWidth,a=(e+n)*this._deviceCellWidth,o=(t+1)*this._deviceCellHeight-r-1;this._ctx.moveTo(i,o),this._ctx.lineTo(a,o),this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_fillLeftLineAtCell(e,t,n){this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,this._coreBrowserService.dpr*n,this._deviceCellHeight)}_strokeRectAtCell(e,t,n,r){let i=this._coreBrowserService.dpr;this._ctx.lineWidth=i,this._ctx.strokeRect(e*this._deviceCellWidth+i/2,t*this._deviceCellHeight+i/2,n*this._deviceCellWidth-i,r*this._deviceCellHeight-i)}_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,t,n,r){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight))}_fillCharTrueColor(e,t,n){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=a.TEXT_BASELINE,this._clipRow(n);let r=!1;!1!==this._optionsService.rawOptions.customGlyphs&&(r=(0,o.tryDrawCustomChar)(this._ctx,e.getChars(),t*this._deviceCellWidth,n*this._deviceCellHeight,this._deviceCellWidth,this._deviceCellHeight,this._optionsService.rawOptions.fontSize,this._coreBrowserService.dpr)),r||this._ctx.fillText(e.getChars(),t*this._deviceCellWidth+this._deviceCharLeft,n*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_drawChars(e,t,n){let r=e.getChars(),i=e.getCode(),a=e.getWidth();if(this._cellColorResolver.resolve(e,t,this._bufferService.buffer.ydisp+n,this._deviceCellWidth),!this._charAtlas)return;let o;if(o=r&&r.length>1?this._charAtlas.getRasterizedGlyphCombinedChar(r,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0):this._charAtlas.getRasterizedGlyph(e.getCode()||f.WHITESPACE_CELL_CODE,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0),!o.size.x||!o.size.y)return;this._ctx.save(),this._clipRow(n),this._bitmapGenerator[o.texturePage]&&this._charAtlas.pages[o.texturePage].canvas!==this._bitmapGenerator[o.texturePage].canvas&&(this._bitmapGenerator[o.texturePage]?.bitmap?.close(),delete this._bitmapGenerator[o.texturePage]),this._charAtlas.pages[o.texturePage].version!==this._bitmapGenerator[o.texturePage]?.version&&(this._bitmapGenerator[o.texturePage]||(this._bitmapGenerator[o.texturePage]=new m(this._charAtlas.pages[o.texturePage].canvas)),this._bitmapGenerator[o.texturePage].refresh(),this._bitmapGenerator[o.texturePage].version=this._charAtlas.pages[o.texturePage].version);let c=o.size.x;this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,s.allowRescaling)(i,a,o.size.x,this._deviceCellWidth)&&(c=this._deviceCellWidth-1),this._ctx.drawImage(this._bitmapGenerator[o.texturePage]?.bitmap||this._charAtlas.pages[o.texturePage].canvas,o.texturePosition.x,o.texturePosition.y,o.size.x,o.size.y,t*this._deviceCellWidth+this._deviceCharLeft-o.offset.x,n*this._deviceCellHeight+this._deviceCharTop-o.offset.y,c,o.size.y),this._ctx.restore()}_clipRow(e){this._ctx.beginPath(),this._ctx.rect(0,e*this._deviceCellHeight,this._bufferService.cols*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t){return`${t?`italic`:``} ${e?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize*this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`}}t.BaseRenderLayer=p;class m{get bitmap(){return this._bitmap}constructor(e){this.canvas=e,this._state=0,this._commitTimeout=void 0,this._bitmap=void 0,this.version=-1}refresh(){this._bitmap?.close(),this._bitmap=void 0,d.isSafari||(this._commitTimeout===void 0&&(this._commitTimeout=window.setTimeout((()=>this._generate()),100)),this._state===1&&(this._state=2))}_generate(){this._state===0&&(this._bitmap?.close(),this._bitmap=void 0,this._state=1,window.createImageBitmap(this.canvas).then((e=>{this._state===2?this.refresh():this._bitmap=e,this._state=0})),this._commitTimeout&&=void 0)}}},949:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasRenderer=void 0;let r=n(627),i=n(56),a=n(374),o=n(345),s=n(859),c=n(873),l=n(43),u=n(630),d=n(744);class f extends s.Disposable{constructor(e,t,n,f,p,m,h,g,_,v,y){super(),this._terminal=e,this._screenElement=t,this._bufferService=f,this._charSizeService=p,this._optionsService=m,this._coreBrowserService=_,this._themeService=y,this._observerDisposable=this.register(new s.MutableDisposable),this._onRequestRedraw=this.register(new o.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onChangeTextureAtlas=this.register(new o.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new o.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event;let b=this._optionsService.rawOptions.allowTransparency;this._renderLayers=[new d.TextRenderLayer(this._terminal,this._screenElement,0,b,this._bufferService,this._optionsService,h,v,this._coreBrowserService,y),new u.SelectionRenderLayer(this._terminal,this._screenElement,1,this._bufferService,this._coreBrowserService,v,this._optionsService,y),new l.LinkRenderLayer(this._terminal,this._screenElement,2,n,this._bufferService,this._optionsService,v,this._coreBrowserService,y),new c.CursorRenderLayer(this._terminal,this._screenElement,3,this._onRequestRedraw,this._bufferService,this._optionsService,g,this._coreBrowserService,v,y)];for(let e of this._renderLayers)(0,o.forwardEvent)(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas);this.dimensions=(0,a.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._observerDisposable.value=(0,i.observeDevicePixelDimensions)(this._renderLayers[0].canvas,this._coreBrowserService.window,((e,t)=>this._setCanvasDevicePixelDimensions(e,t))),this.register(this._coreBrowserService.onWindowChange((e=>{this._observerDisposable.value=(0,i.observeDevicePixelDimensions)(this._renderLayers[0].canvas,e,((e,t)=>this._setCanvasDevicePixelDimensions(e,t)))}))),this.register((0,s.toDisposable)((()=>{for(let e of this._renderLayers)e.dispose();(0,r.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){return this._renderLayers[0].cacheCanvas}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._bufferService.cols,this._bufferService.rows))}handleResize(e,t){this._updateDimensions();for(let e of this._renderLayers)e.resize(this.dimensions);this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}handleCharSizeChanged(){this.handleResize(this._bufferService.cols,this._bufferService.rows)}handleBlur(){this._runOperation((e=>e.handleBlur()))}handleFocus(){this._runOperation((e=>e.handleFocus()))}handleSelectionChanged(e,t,n=!1){this._runOperation((r=>r.handleSelectionChanged(e,t,n))),this._themeService.colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}handleCursorMove(){this._runOperation((e=>e.handleCursorMove()))}clear(){this._runOperation((e=>e.reset()))}_runOperation(e){for(let t of this._renderLayers)e(t)}renderRows(e,t){for(let n of this._renderLayers)n.handleGridChanged(e,t)}clearTextureAtlas(){for(let e of this._renderLayers)e.clearTextureAtlas()}_updateDimensions(){if(!this._charSizeService.hasValidSize)return;let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=Math.floor(this._charSizeService.width*e),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),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._bufferService.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._bufferService.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows,this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols}_setCanvasDevicePixelDimensions(e,t){this.dimensions.device.canvas.height=t,this.dimensions.device.canvas.width=e;for(let e of this._renderLayers)e.resize(this.dimensions);this._requestRedrawViewport()}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}}t.CanvasRenderer=f},873:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CursorRenderLayer=void 0;let r=n(457),i=n(859),a=n(399),o=n(782),s=n(903);class c extends s.BaseRenderLayer{constructor(e,t,n,r,a,s,c,l,u,d){super(e,t,`cursor`,n,!0,d,a,s,u,l),this._onRequestRedraw=r,this._coreService=c,this._cursorBlinkStateManager=this.register(new i.MutableDisposable),this._cell=new o.CellData,this._state={x:0,y:0,isFocused:!1,style:``,width:0},this._cursorRenderers={bar:this._renderBarCursor.bind(this),block:this._renderBlockCursor.bind(this),underline:this._renderUnderlineCursor.bind(this),outline:this._renderOutlineCursor.bind(this)},this.register(s.onOptionChange((()=>this._handleOptionsChanged()))),this._handleOptionsChanged()}resize(e){super.resize(e),this._state={x:0,y:0,isFocused:!1,style:``,width:0}}reset(){this._clearCursor(),this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._handleOptionsChanged()}handleBlur(){this._cursorBlinkStateManager.value?.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleFocus(){this._cursorBlinkStateManager.value?.resume(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}_handleOptionsChanged(){this._optionsService.rawOptions.cursorBlink?this._cursorBlinkStateManager.value||(this._cursorBlinkStateManager.value=new r.CursorBlinkStateManager((()=>this._render(!0)),this._coreBrowserService)):this._cursorBlinkStateManager.clear(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleCursorMove(){this._cursorBlinkStateManager.value?.restartBlinkAnimation()}handleGridChanged(e,t){!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isPaused?this._render(!1):this._cursorBlinkStateManager.value.restartBlinkAnimation()}_render(e){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();let t=this._bufferService.buffer.ybase+this._bufferService.buffer.y,n=t-this._bufferService.buffer.ydisp;if(n<0||n>=this._bufferService.rows)return void this._clearCursor();let r=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(t).loadCell(r,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css;let e=this._optionsService.rawOptions.cursorStyle,t=this._optionsService.rawOptions.cursorInactiveStyle;t&&t!==`none`&&this._cursorRenderers[t](r,n,this._cell),this._ctx.restore(),this._state.x=r,this._state.y=n,this._state.isFocused=!1,this._state.style=e,this._state.width=this._cell.getWidth();return}if(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible){if(this._state){if(this._state.x===r&&this._state.y===n&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.rawOptions.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.rawOptions.cursorStyle||`block`](r,n,this._cell),this._ctx.restore(),this._state.x=r,this._state.y=n,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&=(a.isFirefox||this._coreBrowserService.dpr<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),{x:0,y:0,isFocused:!1,style:``,width:0})}_renderBarCursor(e,t,n){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillLeftLineAtCell(e,t,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()}_renderBlockCursor(e,t,n){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(e,t,n.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(n,e,t),this._ctx.restore()}_renderUnderlineCursor(e,t,n){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(e,t),this._ctx.restore()}_renderOutlineCursor(e,t,n){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(e,t,n.getWidth(),1),this._ctx.restore()}}t.CursorRenderLayer=c},574:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GridCache=void 0,t.GridCache=class{constructor(){this.cache=[]}resize(e,t){for(let n=0;n<e;n++){this.cache.length<=n&&this.cache.push([]);for(let e=this.cache[n].length;e<t;e++)this.cache[n].push(void 0);this.cache[n].length=t}this.cache.length=e}clear(){for(let e=0;e<this.cache.length;e++)for(let t=0;t<this.cache[e].length;t++)this.cache[e][t]=void 0}}},43:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkRenderLayer=void 0;let r=n(197),i=n(237),a=n(903);class o extends a.BaseRenderLayer{constructor(e,t,n,r,i,a,o,s,c){super(e,t,`link`,n,!0,c,i,a,o,s),this.register(r.onShowLinkUnderline((e=>this._handleShowLinkUnderline(e)))),this.register(r.onHideLinkUnderline((e=>this._handleHideLinkUnderline(e))))}resize(e){super.resize(e),this._state=void 0}reset(){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===i.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg&&(0,r.is256Color)(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 t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}}t.LinkRenderLayer=o},630:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRenderLayer=void 0;let r=n(903);class i extends r.BaseRenderLayer{constructor(e,t,n,r,i,a,o,s){super(e,t,`selection`,n,!0,s,r,o,a,i),this._clearState()}_clearState(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}}resize(e){super.resize(e),this._selectionModel.selectionStart&&this._selectionModel.selectionEnd&&(this._clearState(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode))}reset(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())}handleBlur(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleFocus(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleSelectionChanged(e,t,n){super.handleSelectionChanged(e,t,n),this._redrawSelection(e,t,n)}_redrawSelection(e,t,n){if(!this._didStateChange(e,t,n,this._bufferService.buffer.ydisp))return;if(this._clearAll(),!e||!t)return void this._clearState();let r=e[1]-this._bufferService.buffer.ydisp,i=t[1]-this._bufferService.buffer.ydisp,a=Math.max(r,0),o=Math.min(i,this._bufferService.rows-1);if(a>=this._bufferService.rows||o<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=(this._coreBrowserService.isFocused?this._themeService.colors.selectionBackgroundTransparent:this._themeService.colors.selectionInactiveBackgroundTransparent).css,n){let n=e[0],r=t[0]-n,i=o-a+1;this._fillCells(n,a,r,i)}else{let n=r===a?e[0]:0,s=a===i?t[0]:this._bufferService.cols;this._fillCells(n,a,s-n,1);let c=Math.max(o-a-1,0);if(this._fillCells(0,a+1,this._bufferService.cols,c),a!==o){let e=i===o?t[0]:this._bufferService.cols;this._fillCells(0,o,e,1)}}this._state.start=[e[0],e[1]],this._state.end=[t[0],t[1]],this._state.columnSelectMode=n,this._state.ydisp=this._bufferService.buffer.ydisp}}_didStateChange(e,t,n,r){return!this._areCoordinatesEqual(e,this._state.start)||!this._areCoordinatesEqual(t,this._state.end)||n!==this._state.columnSelectMode||r!==this._state.ydisp}_areCoordinatesEqual(e,t){return!(!e||!t)&&e[0]===t[0]&&e[1]===t[1]}}t.SelectionRenderLayer=i},744:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextRenderLayer=void 0;let r=n(577),i=n(147),a=n(782),o=n(855),s=n(903),c=n(574);class l extends s.BaseRenderLayer{constructor(e,t,n,r,i,o,s,l,u,d){super(e,t,`text`,n,r,d,i,o,l,u),this._characterJoinerService=s,this._characterWidth=0,this._characterFont=``,this._characterOverlapCache={},this._workCell=new a.CellData,this._state=new c.GridCache,this.register(o.onSpecificOptionChange(`allowTransparency`,(e=>this._setTransparency(e))))}resize(e){super.resize(e);let t=this._getFont(!1,!1);this._characterWidth===e.device.char.width&&this._characterFont===t||(this._characterWidth=e.device.char.width,this._characterFont=t,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)}reset(){this._state.clear(),this._clearAll()}_forEachCell(e,t,n){for(let i=e;i<=t;i++){let e=i+this._bufferService.buffer.ydisp,t=this._bufferService.buffer.lines.get(e),a=this._characterJoinerService.getJoinedCharacters(e);for(let e=0;e<this._bufferService.cols;e++){t.loadCell(e,this._workCell);let s=this._workCell,c=!1,l=e;if(s.getWidth()!==0){if(a.length>0&&e===a[0][0]){c=!0;let e=a.shift();s=new r.JoinedCellData(this._workCell,t.translateToString(!0,e[0],e[1]),e[1]-e[0]),l=e[1]-1}!c&&this._isOverlapping(s)&&l<t.length-1&&t.getCodePoint(l+1)===o.NULL_CELL_CODE&&(s.content&=-12582913,s.content|=2<<22),n(s,e,i),e=l}}}}_drawBackground(e,t){let n=this._ctx,r=this._bufferService.cols,a=0,o=0,s=null;n.save(),this._forEachCell(e,t,((e,t,c)=>{let l=null;e.isInverse()?l=e.isFgDefault()?this._themeService.colors.foreground.css:e.isFgRGB()?`rgb(${i.AttributeData.toColorRGB(e.getFgColor()).join(`,`)})`:this._themeService.colors.ansi[e.getFgColor()].css:e.isBgRGB()?l=`rgb(${i.AttributeData.toColorRGB(e.getBgColor()).join(`,`)})`:e.isBgPalette()&&(l=this._themeService.colors.ansi[e.getBgColor()].css);let u=!1;this._decorationService.forEachDecorationAtCell(t,this._bufferService.buffer.ydisp+c,void 0,(e=>{e.options.layer!==`top`&&u||(e.backgroundColorRGB&&(l=e.backgroundColorRGB.css),u=e.options.layer===`top`)})),s===null&&(a=t,o=c),c===o?s!==l&&(n.fillStyle=s||``,this._fillCells(a,o,t-a,1),a=t,o=c):(n.fillStyle=s||``,this._fillCells(a,o,r-a,1),a=t,o=c),s=l})),s!==null&&(n.fillStyle=s,this._fillCells(a,o,r-a,1)),n.restore()}_drawForeground(e,t){this._forEachCell(e,t,((e,t,n)=>this._drawChars(e,t,n)))}handleGridChanged(e,t){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,e,this._bufferService.cols,t-e+1),this._drawBackground(e,t),this._drawForeground(e,t))}_isOverlapping(e){if(e.getWidth()!==1||e.getCode()<256)return!1;let t=e.getChars();if(this._characterOverlapCache.hasOwnProperty(t))return this._characterOverlapCache[t];this._ctx.save(),this._ctx.font=this._characterFont;let n=Math.floor(this._ctx.measureText(t).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[t]=n,n}}t.TextRenderLayer=l},274:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellColorResolver=void 0;let r=n(855),i=n(160),a=n(374),o,s=0,c=0,l=!1,u=!1,d=!1,f=0;t.CellColorResolver=class{constructor(e,t,n,r,i,a){this._terminal=e,this._optionService=t,this._selectionRenderModel=n,this._decorationService=r,this._coreBrowserService=i,this._themeService=a,this.result={fg:0,bg:0,ext:0}}resolve(e,t,n,p){if(this.result.bg=e.bg,this.result.fg=e.fg,this.result.ext=268435456&e.bg?e.extended.ext:0,c=0,s=0,u=!1,l=!1,d=!1,o=this._themeService.colors,f=0,e.getCode()!==r.NULL_CELL_CODE&&e.extended.underlineStyle===4){let e=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));f=t*p%(2*Math.round(e))}if(this._decorationService.forEachDecorationAtCell(t,n,`bottom`,(e=>{e.backgroundColorRGB&&(c=e.backgroundColorRGB.rgba>>8&16777215,u=!0),e.foregroundColorRGB&&(s=e.foregroundColorRGB.rgba>>8&16777215,l=!0)})),d=this._selectionRenderModel.isCellSelected(this._terminal,t,n),d){if(67108864&this.result.fg||50331648&this.result.bg){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:c=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:c=(16777215&this.result.fg)<<8|255;break;default:c=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:c=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:c=(16777215&this.result.bg)<<8|255}c=i.rgba.blend(c,4294967040&(this._coreBrowserService.isFocused?o.selectionBackgroundOpaque:o.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else c=(this._coreBrowserService.isFocused?o.selectionBackgroundOpaque:o.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(u=!0,o.selectionForeground&&(s=o.selectionForeground.rgba>>8&16777215,l=!0),(0,a.treatGlyphAsBackgroundColor)(e.getCode())){if(67108864&this.result.fg&&!(50331648&this.result.bg))s=(this._coreBrowserService.isFocused?o.selectionBackgroundOpaque:o.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:s=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:s=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:s=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:s=(16777215&this.result.fg)<<8|255;break;default:s=this._themeService.colors.foreground.rgba}s=i.rgba.blend(s,4294967040&(this._coreBrowserService.isFocused?o.selectionBackgroundOpaque:o.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}l=!0}}this._decorationService.forEachDecorationAtCell(t,n,`top`,(e=>{e.backgroundColorRGB&&(c=e.backgroundColorRGB.rgba>>8&16777215,u=!0),e.foregroundColorRGB&&(s=e.foregroundColorRGB.rgba>>8&16777215,l=!0)})),u&&(c=d?e.bg&-150994944|c|50331648:-16777216&e.bg|c|50331648),l&&(s=e.fg&-83886080|s|50331648),67108864&this.result.fg&&(u&&!l&&(s=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&o.background.rgba>>8|50331648,l=!0),!u&&l&&(c=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&o.foreground.rgba>>8|50331648,u=!0)),o=void 0,this.result.bg=u?c:this.result.bg,this.result.fg=l?s:this.result.fg,this.result.ext&=536870911,this.result.ext|=f<<29&3758096384}}},627:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeTerminalFromCache=t.acquireTextureAtlas=void 0;let r=n(509),i=n(197),a=[];t.acquireTextureAtlas=function(e,t,n,o,s,c,l,u){let d=(0,i.generateConfig)(o,s,c,l,t,n,u);for(let t=0;t<a.length;t++){let n=a[t],r=n.ownedBy.indexOf(e);if(r>=0){if((0,i.configEquals)(n.config,d))return n.atlas;n.ownedBy.length===1?(n.atlas.dispose(),a.splice(t,1)):n.ownedBy.splice(r,1);break}}for(let t=0;t<a.length;t++){let n=a[t];if((0,i.configEquals)(n.config,d))return n.ownedBy.push(e),n.atlas}let f=e._core,p={atlas:new r.TextureAtlas(document,d,f.unicodeService),config:d,ownedBy:[e]};return a.push(p),p.atlas},t.removeTerminalFromCache=function(e){for(let t=0;t<a.length;t++){let n=a[t].ownedBy.indexOf(e);if(n!==-1){a[t].ownedBy.length===1?(a[t].atlas.dispose(),a.splice(t,1)):a[t].ownedBy.splice(n,1);break}}}},197:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.is256Color=t.configEquals=t.generateConfig=void 0;let r=n(160);t.generateConfig=function(e,t,n,i,a,o,s){let c={foreground:o.foreground,background:o.background,cursor:r.NULL_COLOR,cursorAccent:r.NULL_COLOR,selectionForeground:r.NULL_COLOR,selectionBackgroundTransparent:r.NULL_COLOR,selectionBackgroundOpaque:r.NULL_COLOR,selectionInactiveBackgroundTransparent:r.NULL_COLOR,selectionInactiveBackgroundOpaque:r.NULL_COLOR,ansi:o.ansi.slice(),contrastCache:o.contrastCache,halfContrastCache:o.halfContrastCache};return{customGlyphs:a.customGlyphs,devicePixelRatio:s,letterSpacing:a.letterSpacing,lineHeight:a.lineHeight,deviceCellWidth:e,deviceCellHeight:t,deviceCharWidth:n,deviceCharHeight:i,fontFamily:a.fontFamily,fontSize:a.fontSize,fontWeight:a.fontWeight,fontWeightBold:a.fontWeightBold,allowTransparency:a.allowTransparency,drawBoldTextInBrightColors:a.drawBoldTextInBrightColors,minimumContrastRatio:a.minimumContrastRatio,colors:c}},t.configEquals=function(e,t){for(let n=0;n<e.colors.ansi.length;n++)if(e.colors.ansi[n].rgba!==t.colors.ansi[n].rgba)return!1;return e.devicePixelRatio===t.devicePixelRatio&&e.customGlyphs===t.customGlyphs&&e.lineHeight===t.lineHeight&&e.letterSpacing===t.letterSpacing&&e.fontFamily===t.fontFamily&&e.fontSize===t.fontSize&&e.fontWeight===t.fontWeight&&e.fontWeightBold===t.fontWeightBold&&e.allowTransparency===t.allowTransparency&&e.deviceCharWidth===t.deviceCharWidth&&e.deviceCharHeight===t.deviceCharHeight&&e.drawBoldTextInBrightColors===t.drawBoldTextInBrightColors&&e.minimumContrastRatio===t.minimumContrastRatio&&e.colors.foreground.rgba===t.colors.foreground.rgba&&e.colors.background.rgba===t.colors.background.rgba},t.is256Color=function(e){return(50331648&e)==16777216||(50331648&e)==33554432}},237:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;let r=n(399);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=r.isFirefox||r.isLegacyEdge?`bottom`:`ideographic`},457:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CursorBlinkStateManager=void 0,t.CursorBlinkStateManager=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&=(this._coreBrowserService.window.clearInterval(this._blinkInterval),void 0),this._blinkStartTimeout&&=(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),void 0),this._animationFrame&&=(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(e=600){this._blinkInterval&&=(this._coreBrowserService.window.clearInterval(this._blinkInterval),void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){let e=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,e>0)return void this._restartInterval(e)}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 e=600-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(e);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),e)}pause(){this.isCursorVisible=!0,this._blinkInterval&&=(this._coreBrowserService.window.clearInterval(this._blinkInterval),void 0),this._blinkStartTimeout&&=(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),void 0),this._animationFrame&&=(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tryDrawCustomChar=t.powerlineDefinitions=t.boxDrawingDefinitions=t.blockElementDefinitions=void 0;let r=n(374);t.blockElementDefinitions={"▀":[{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}]};let i={"░":[[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]]};t.boxDrawingDefinitions={"─":{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,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"║":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╒":{1:(e,t)=>`M.5,1 L.5,${.5-t} L1,${.5-t} M.5,${.5+t} L1,${.5+t}`},"╓":{1:(e,t)=>`M${.5-e},1 L${.5-e},.5 L1,.5 M${.5+e},.5 L${.5+e},1`},"╔":{1:(e,t)=>`M1,${.5-t} L${.5-e},${.5-t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1`},"╕":{1:(e,t)=>`M0,${.5-t} L.5,${.5-t} L.5,1 M0,${.5+t} L.5,${.5+t}`},"╖":{1:(e,t)=>`M${.5+e},1 L${.5+e},.5 L0,.5 M${.5-e},.5 L${.5-e},1`},"╗":{1:(e,t)=>`M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M0,${.5-t} L${.5+e},${.5-t} L${.5+e},1`},"╘":{1:(e,t)=>`M.5,0 L.5,${.5+t} L1,${.5+t} M.5,${.5-t} L1,${.5-t}`},"╙":{1:(e,t)=>`M1,.5 L${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╚":{1:(e,t)=>`M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0 M1,${.5+t} L${.5-e},${.5+t} L${.5-e},0`},"╛":{1:(e,t)=>`M0,${.5+t} L.5,${.5+t} L.5,0 M0,${.5-t} L.5,${.5-t}`},"╜":{1:(e,t)=>`M0,.5 L${.5+e},.5 L${.5+e},0 M${.5-e},.5 L${.5-e},0`},"╝":{1:(e,t)=>`M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M0,${.5+t} L${.5+e},${.5+t} L${.5+e},0`},"╞":{1:(e,t)=>`M.5,0 L.5,1 M.5,${.5-t} L1,${.5-t} M.5,${.5+t} L1,${.5+t}`},"╟":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1 M${.5+e},.5 L1,.5`},"╠":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╡":{1:(e,t)=>`M.5,0 L.5,1 M0,${.5-t} L.5,${.5-t} M0,${.5+t} L.5,${.5+t}`},"╢":{1:(e,t)=>`M0,.5 L${.5-e},.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╣":{1:(e,t)=>`M${.5+e},0 L${.5+e},1 M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0`},"╤":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t} M.5,${.5+t} L.5,1`},"╥":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},1 M${.5+e},.5 L${.5+e},1`},"╦":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1`},"╧":{1:(e,t)=>`M.5,0 L.5,${.5-t} M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"╨":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╩":{1:(e,t)=>`M0,${.5+t} L1,${.5+t} M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╪":{1:(e,t)=>`M.5,0 L.5,1 M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"╫":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╬":{1:(e,t)=>`M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1 M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M1,${.5-t} L${.5+e},${.5-t} 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,t)=>`M.5,1 L.5,${.5+t/.15*.5} C.5,${.5+t/.15*.5},.5,.5,1,.5`},"╮":{1:(e,t)=>`M.5,1 L.5,${.5+t/.15*.5} C.5,${.5+t/.15*.5},.5,.5,0,.5`},"╯":{1:(e,t)=>`M.5,0 L.5,${.5-t/.15*.5} C.5,${.5-t/.15*.5},.5,.5,0,.5`},"╰":{1:(e,t)=>`M.5,0 L.5,${.5-t/.15*.5} C.5,${.5-t/.15*.5},.5,.5,1,.5`}},t.powerlineDefinitions={"":{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}},t.powerlineDefinitions[``]=t.powerlineDefinitions[``],t.powerlineDefinitions[``]=t.powerlineDefinitions[``],t.tryDrawCustomChar=function(e,n,o,l,u,d,f,p){let m=t.blockElementDefinitions[n];if(m)return function(e,t,n,r,i,a){for(let o=0;o<t.length;o++){let s=t[o],c=i/8,l=a/8;e.fillRect(n+s.x*c,r+s.y*l,s.w*c,s.h*l)}}(e,m,o,l,u,d),!0;let h=i[n];if(h)return function(e,t,n,i,o,s){let c=a.get(t);c||(c=new Map,a.set(t,c));let l=e.fillStyle;if(typeof l!=`string`)throw Error(`Unexpected fillStyle type "${l}"`);let u=c.get(l);if(!u){let n=t[0].length,i=t.length,a=e.canvas.ownerDocument.createElement(`canvas`);a.width=n,a.height=i;let o=(0,r.throwIfFalsy)(a.getContext(`2d`)),s=new ImageData(n,i),d,f,p,m;if(l.startsWith(`#`))d=parseInt(l.slice(1,3),16),f=parseInt(l.slice(3,5),16),p=parseInt(l.slice(5,7),16),m=l.length>7&&parseInt(l.slice(7,9),16)||1;else{if(!l.startsWith(`rgba`))throw Error(`Unexpected fillStyle color format "${l}" when drawing pattern glyph`);[d,f,p,m]=l.substring(5,l.length-1).split(`,`).map((e=>parseFloat(e)))}for(let e=0;e<i;e++)for(let r=0;r<n;r++)s.data[4*(e*n+r)]=d,s.data[4*(e*n+r)+1]=f,s.data[4*(e*n+r)+2]=p,s.data[4*(e*n+r)+3]=t[e][r]*(255*m);o.putImageData(s,0,0),u=(0,r.throwIfFalsy)(e.createPattern(a,null)),c.set(l,u)}e.fillStyle=u,e.fillRect(n,i,o,s)}(e,h,o,l,u,d),!0;let g=t.boxDrawingDefinitions[n];if(g)return function(e,t,n,r,i,a,o){e.strokeStyle=e.fillStyle;for(let[l,u]of Object.entries(t)){let t;e.beginPath(),e.lineWidth=o*Number.parseInt(l),t=typeof u==`function`?u(.15,.15/a*i):u;for(let l of t.split(` `)){let t=l[0],u=s[t];if(!u){console.error(`Could not find drawing instructions for "${t}"`);continue}let d=l.substring(1).split(`,`);d[0]&&d[1]&&u(e,c(d,i,a,n,r,!0,o))}e.stroke(),e.closePath()}}(e,g,o,l,u,d,p),!0;let _=t.powerlineDefinitions[n];return!!_&&(function(e,t,n,r,i,a,o,l){let u=new Path2D;u.rect(n,r,i,a),e.clip(u),e.beginPath();let d=o/12;e.lineWidth=l*d;for(let o of t.d.split(` `)){let u=o[0],f=s[u];if(!f){console.error(`Could not find drawing instructions for "${u}"`);continue}let p=o.substring(1).split(`,`);p[0]&&p[1]&&f(e,c(p,i,a,n,r,!1,l,(t.leftPadding??0)*(d/2),(t.rightPadding??0)*(d/2)))}t.type===1?(e.strokeStyle=e.fillStyle,e.stroke()):e.fill(),e.closePath()}(e,_,o,l,u,d,f,p),!0)};let a=new Map;function o(e,t,n=0){return Math.max(Math.min(e,t),n)}let s={C:(e,t)=>e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]),L:(e,t)=>e.lineTo(t[0],t[1]),M:(e,t)=>e.moveTo(t[0],t[1])};function c(e,t,n,r,i,a,s,c=0,l=0){let u=e.map((e=>parseFloat(e)||parseInt(e)));if(u.length<2)throw Error(`Too few arguments for instruction`);for(let e=0;e<u.length;e+=2)u[e]*=t-c*s-l*s,a&&u[e]!==0&&(u[e]=o(Math.round(u[e]+.5)-.5,t,0)),u[e]+=r+c*s;for(let e=1;e<u.length;e+=2)u[e]*=n,a&&u[e]!==0&&(u[e]=o(Math.round(u[e]+.5)-.5,n,0)),u[e]+=i;return u}},56:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.observeDevicePixelDimensions=void 0;let r=n(859);t.observeDevicePixelDimensions=function(e,t,n){let i=new t.ResizeObserver((t=>{let r=t.find((t=>t.target===e));if(!r)return;if(!(`devicePixelContentBoxSize`in r))return i?.disconnect(),void(i=void 0);let a=r.devicePixelContentBoxSize[0].inlineSize,o=r.devicePixelContentBoxSize[0].blockSize;a>0&&o>0&&n(a,o)}));try{i.observe(e,{box:[`device-pixel-content-box`]})}catch{i.disconnect(),i=void 0}return(0,r.toDisposable)((()=>i?.disconnect()))}},374:(e,t)=>{function n(e){return 57508<=e&&e<=57558}function r(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}Object.defineProperty(t,"__esModule",{value:!0}),t.computeNextVariantOffset=t.createRenderDimensions=t.treatGlyphAsBackgroundColor=t.allowRescaling=t.isEmoji=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(e){if(!e)throw Error(`value must not be falsy`);return e},t.isPowerlineGlyph=n,t.isRestrictedPowerlineGlyph=function(e){return 57520<=e&&e<=57527},t.isEmoji=r,t.allowRescaling=function(e,t,i,a){return t===1&&i>Math.ceil(1.5*a)&&e!==void 0&&e>255&&!r(e)&&!n(e)&&!function(e){return 57344<=e&&e<=63743}(e)},t.treatGlyphAsBackgroundColor=function(e){return n(e)||function(e){return 9472<=e&&e<=9631}(e)},t.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}}}},t.computeNextVariantOffset=function(e,t,n=0){return(e-(2*Math.round(t)-n))%(2*Math.round(t))}},296:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSelectionRenderModel=void 0;class n{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,t,n,r=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1])return void this.clear();let i=e.buffers.active.ydisp,a=t[1]-i,o=n[1]-i,s=Math.max(a,0),c=Math.min(o,e.rows-1);s>=e.rows||c<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=a,this.viewportEndRow=o,this.viewportCappedStartRow=s,this.viewportCappedEndRow=c,this.startCol=t[0],this.endCol=n[0])}isCellSelected(e,t,n){return!!this.hasSelection&&(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&n>=this.viewportCappedStartRow&&t<this.endCol&&n<=this.viewportCappedEndRow:t<this.startCol&&n>=this.viewportCappedStartRow&&t>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol)}}t.createSelectionRenderModel=function(){return new n}},509:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextureAtlas=void 0;let r=n(237),i=n(860),a=n(374),o=n(160),s=n(345),c=n(485),l=n(385),u=n(147),d=n(855),f={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}},p;class m{get pages(){return this._pages}constructor(e,t,n){this._document=e,this._config=t,this._unicodeService=n,this._didWarmUp=!1,this._cacheMap=new c.FourKeyMap,this._cacheMapCombined=new c.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new u.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new s.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new s.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=_(e,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,a.throwIfFalsy)(this._tmpCanvas.getContext(`2d`,{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(let e of this.pages)e.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||=(this._doWarmUp(),!0)}_doWarmUp(){let e=new l.IdleTaskQueue;for(let t=33;t<126;t++)e.enqueue((()=>{if(!this._cacheMap.get(t,d.DEFAULT_COLOR,d.DEFAULT_COLOR,d.DEFAULT_EXT)){let e=this._drawToCache(t,d.DEFAULT_COLOR,d.DEFAULT_COLOR,d.DEFAULT_EXT);this._cacheMap.set(t,d.DEFAULT_COLOR,d.DEFAULT_COLOR,d.DEFAULT_EXT,e)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(let e of this._pages)e.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(m.maxAtlasPages&&this._pages.length>=Math.max(4,m.maxAtlasPages)){let e=this._pages.filter((e=>2*e.canvas.width<=(m.maxTextureSize||4096))).sort(((e,t)=>t.canvas.width===e.canvas.width?t.percentageUsed-e.percentageUsed:t.canvas.width-e.canvas.width)),t=-1,n=0;for(let r=0;r<e.length;r++)if(e[r].canvas.width!==n)t=r,n=e[r].canvas.width;else if(r-t==3)break;let r=e.slice(t,t+4),i=r.map((e=>e.glyphs[0].texturePage)).sort(((e,t)=>e>t?1:-1)),a=this.pages.length-r.length,o=this._mergePages(r,a);o.version++;for(let e=i.length-1;e>=0;e--)this._deletePage(i[e]);this.pages.push(o),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(o.canvas)}let e=new h(this._document,this._textureSize);return this._pages.push(e),this._activePages.push(e),this._onAddTextureAtlasCanvas.fire(e.canvas),e}_mergePages(e,t){let n=2*e[0].canvas.width,r=new h(this._document,n,e);for(let[i,a]of e.entries()){let e=i*a.canvas.width%n,o=Math.floor(i/2)*a.canvas.height;r.ctx.drawImage(a.canvas,e,o);for(let r of a.glyphs)r.texturePage=t,r.sizeClipSpace.x=r.size.x/n,r.sizeClipSpace.y=r.size.y/n,r.texturePosition.x+=e,r.texturePosition.y+=o,r.texturePositionClipSpace.x=r.texturePosition.x/n,r.texturePositionClipSpace.y=r.texturePosition.y/n;this._onRemoveTextureAtlasCanvas.fire(a.canvas);let s=this._activePages.indexOf(a);s!==-1&&this._activePages.splice(s,1)}return r}_deletePage(e){this._pages.splice(e,1);for(let t=e;t<this._pages.length;t++){let e=this._pages[t];for(let t of e.glyphs)t.texturePage--;e.version++}}getRasterizedGlyphCombinedChar(e,t,n,r,i){return this._getFromCacheMap(this._cacheMapCombined,e,t,n,r,i)}getRasterizedGlyph(e,t,n,r,i){return this._getFromCacheMap(this._cacheMap,e,t,n,r,i)}_getFromCacheMap(e,t,n,r,i,a=!1){return p=e.get(t,n,r,i),p||(p=this._drawToCache(t,n,r,i,a),e.set(t,n,r,i,p)),p}_getColorFromAnsiIndex(e){if(e>=this._config.colors.ansi.length)throw Error(`No color found for idx `+e);return this._config.colors.ansi[e]}_getBackgroundColor(e,t,n,r){if(this._config.allowTransparency)return o.NULL_COLOR;let i;switch(e){case 16777216:case 33554432:i=this._getColorFromAnsiIndex(t);break;case 50331648:let e=u.AttributeData.toColorRGB(t);i=o.channels.toColor(e[0],e[1],e[2]);break;default:i=n?o.color.opaque(this._config.colors.foreground):this._config.colors.background}return i}_getForegroundColor(e,t,n,i,a,s,c,l,d,f){let p=this._getMinimumContrastColor(e,t,n,i,a,s,c,d,l,f);if(p)return p;let m;switch(a){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&d&&s<8&&(s+=8),m=this._getColorFromAnsiIndex(s);break;case 50331648:let e=u.AttributeData.toColorRGB(s);m=o.channels.toColor(e[0],e[1],e[2]);break;default:m=c?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(m=o.color.opaque(m)),l&&(m=o.color.multiplyOpacity(m,r.DIM_OPACITY)),m}_resolveBackgroundRgba(e,t,n){switch(e){case 16777216:case 33554432:return this._getColorFromAnsiIndex(t).rgba;case 50331648:return t<<8;default:return n?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(e,t,n,r){switch(e){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&r&&t<8&&(t+=8),this._getColorFromAnsiIndex(t).rgba;case 50331648:return t<<8;default:return n?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(e,t,n,r,i,a,s,c,l,u){if(this._config.minimumContrastRatio===1||u)return;let d=this._getContrastCache(l),f=d.getColor(e,r);if(f!==void 0)return f||void 0;let p=this._resolveBackgroundRgba(t,n,s),m=this._resolveForegroundRgba(i,a,s,c),h=o.rgba.ensureContrastRatio(p,m,this._config.minimumContrastRatio/(l?2:1));if(!h)return void d.setColor(e,r,null);let g=o.channels.toColor(h>>24&255,h>>16&255,h>>8&255);return d.setColor(e,r,g),g}_getContrastCache(e){return e?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(e,t,n,o,s=!1){let c=typeof e==`number`?String.fromCharCode(e):e,l=Math.min(this._config.deviceCellWidth*Math.max(c.length,2)+4,this._textureSize);this._tmpCanvas.width<l&&(this._tmpCanvas.width=l);let d=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<d&&(this._tmpCanvas.height=d),this._tmpCtx.save(),this._workAttributeData.fg=n,this._workAttributeData.bg=t,this._workAttributeData.extended.ext=o,this._workAttributeData.isInvisible())return f;let p=!!this._workAttributeData.isBold(),h=!!this._workAttributeData.isInverse(),_=!!this._workAttributeData.isDim(),v=!!this._workAttributeData.isItalic(),y=!!this._workAttributeData.isUnderline(),b=!!this._workAttributeData.isStrikethrough(),x=!!this._workAttributeData.isOverline(),S=this._workAttributeData.getFgColor(),C=this._workAttributeData.getFgColorMode(),w=this._workAttributeData.getBgColor(),T=this._workAttributeData.getBgColorMode();if(h){let e=S;S=w,w=e;let t=C;C=T,T=t}let E=this._getBackgroundColor(T,w,h,_);this._tmpCtx.globalCompositeOperation=`copy`,this._tmpCtx.fillStyle=E.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation=`source-over`;let D=p?this._config.fontWeightBold:this._config.fontWeight,ee=v?`italic`:``;this._tmpCtx.font=`${ee} ${D} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=r.TEXT_BASELINE;let O=c.length===1&&(0,a.isPowerlineGlyph)(c.charCodeAt(0)),k=c.length===1&&(0,a.isRestrictedPowerlineGlyph)(c.charCodeAt(0)),A=this._getForegroundColor(t,T,w,n,C,S,h,_,p,(0,a.treatGlyphAsBackgroundColor)(c.charCodeAt(0)));this._tmpCtx.fillStyle=A.css;let j=k?0:4,M=!1;!1!==this._config.customGlyphs&&(M=(0,i.tryDrawCustomChar)(this._tmpCtx,c,j,j,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let N,P=!O;if(N=typeof e==`number`?this._unicodeService.wcwidth(e):this._unicodeService.getStringCellWidth(e),y){this._tmpCtx.save();let e=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),t=e%2==1?.5:0;if(this._tmpCtx.lineWidth=e,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())P=!1,this._tmpCtx.strokeStyle=`rgb(${u.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(`,`)})`;else{P=!1;let e=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&e<8&&(e+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(e).css}this._tmpCtx.beginPath();let n=j,r=Math.ceil(j+this._config.deviceCharHeight)-t-(s?2*e:0),i=r+e,o=r+2*e,l=this._workAttributeData.getUnderlineVariantOffset();for(let s=0;s<N;s++){this._tmpCtx.save();let c=n+s*this._config.deviceCellWidth,u=n+(s+1)*this._config.deviceCellWidth,d=c+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(c,r),this._tmpCtx.lineTo(u,r),this._tmpCtx.moveTo(c,o),this._tmpCtx.lineTo(u,o);break;case 3:let n=e<=1?o:Math.ceil(j+this._config.deviceCharHeight-e/2)-t,s=e<=1?r:Math.ceil(j+this._config.deviceCharHeight+e/2)-t,f=new Path2D;f.rect(c,r,this._config.deviceCellWidth,o-r),this._tmpCtx.clip(f),this._tmpCtx.moveTo(c-this._config.deviceCellWidth/2,i),this._tmpCtx.bezierCurveTo(c-this._config.deviceCellWidth/2,s,c,s,c,i),this._tmpCtx.bezierCurveTo(c,n,d,n,d,i),this._tmpCtx.bezierCurveTo(d,s,u,s,u,i),this._tmpCtx.bezierCurveTo(u,n,u+this._config.deviceCellWidth/2,n,u+this._config.deviceCellWidth/2,i);break;case 4:let p=l===0?0:l>=e?2*e-l:e-l;!(l>=e)==0||p===0?(this._tmpCtx.setLineDash([Math.round(e),Math.round(e)]),this._tmpCtx.moveTo(c+p,r),this._tmpCtx.lineTo(u,r)):(this._tmpCtx.setLineDash([Math.round(e),Math.round(e)]),this._tmpCtx.moveTo(c,r),this._tmpCtx.lineTo(c+p,r),this._tmpCtx.moveTo(c+p+e,r),this._tmpCtx.lineTo(u,r)),l=(0,a.computeNextVariantOffset)(u-c,e,l);break;case 5:let m=u-c,h=Math.floor(.6*m),g=Math.floor(.3*m),_=m-h-g;this._tmpCtx.setLineDash([h,g,_]),this._tmpCtx.moveTo(c,r),this._tmpCtx.lineTo(u,r);break;default:this._tmpCtx.moveTo(c,r),this._tmpCtx.lineTo(u,r)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!M&&this._config.fontSize>=12&&!this._config.allowTransparency&&c!==` `){this._tmpCtx.save(),this._tmpCtx.textBaseline=`alphabetic`;let t=this._tmpCtx.measureText(c);if(this._tmpCtx.restore(),`actualBoundingBoxDescent`in t&&t.actualBoundingBoxDescent>0){this._tmpCtx.save();let t=new Path2D;t.rect(n,r-Math.ceil(e/2),this._config.deviceCellWidth*N,o-r+Math.ceil(e/2)),this._tmpCtx.clip(t),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=E.css,this._tmpCtx.strokeText(c,j,j+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(x){let e=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),t=e%2==1?.5:0;this._tmpCtx.lineWidth=e,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(j,j+t),this._tmpCtx.lineTo(j+this._config.deviceCharWidth*N,j+t),this._tmpCtx.stroke()}if(M||this._tmpCtx.fillText(c,j,j+this._config.deviceCharHeight),c===`_`&&!this._config.allowTransparency){let e=g(this._tmpCtx.getImageData(j,j,this._config.deviceCellWidth,this._config.deviceCellHeight),E,A,P);if(e)for(let t=1;t<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=E.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(c,j,j+this._config.deviceCharHeight-t),e=g(this._tmpCtx.getImageData(j,j,this._config.deviceCellWidth,this._config.deviceCellHeight),E,A,P),e);t++);}if(b){let e=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),t=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=e,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(j,j+Math.floor(this._config.deviceCharHeight/2)-t),this._tmpCtx.lineTo(j+this._config.deviceCharWidth*N,j+Math.floor(this._config.deviceCharHeight/2)-t),this._tmpCtx.stroke()}this._tmpCtx.restore();let F=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),I;if(I=this._config.allowTransparency?function(e){for(let t=0;t<e.data.length;t+=4)if(e.data[t+3]>0)return!1;return!0}(F):g(F,E,A,P),I)return f;let L=this._findGlyphBoundingBox(F,this._workBoundingBox,l,k,M,j),R,z;for(;;){if(this._activePages.length===0){let e=this._createNewPage();R=e,z=e.currentRow,z.height=L.size.y;break}R=this._activePages[this._activePages.length-1],z=R.currentRow;for(let e of this._activePages)L.size.y<=e.currentRow.height&&(R=e,z=e.currentRow);for(let e=this._activePages.length-1;e>=0;e--)for(let t of this._activePages[e].fixedRows)t.height<=z.height&&L.size.y<=t.height&&(R=this._activePages[e],z=t);if(z.y+L.size.y>=R.canvas.height||z.height>L.size.y+2){let e=!1;if(R.currentRow.y+R.currentRow.height+L.size.y>=R.canvas.height){let t;for(let e of this._activePages)if(e.currentRow.y+e.currentRow.height+L.size.y<e.canvas.height){t=e;break}if(t)R=t;else if(m.maxAtlasPages&&this._pages.length>=m.maxAtlasPages&&z.y+L.size.y<=R.canvas.height&&z.height>=L.size.y&&z.x+L.size.x<=R.canvas.width)e=!0;else{let t=this._createNewPage();R=t,z=t.currentRow,z.height=L.size.y,e=!0}}e||(R.currentRow.height>0&&R.fixedRows.push(R.currentRow),z={x:0,y:R.currentRow.y+R.currentRow.height,height:L.size.y},R.fixedRows.push(z),R.currentRow={x:0,y:z.y+z.height,height:0})}if(z.x+L.size.x<=R.canvas.width)break;z===R.currentRow?(z.x=0,z.y+=z.height,z.height=0):R.fixedRows.splice(R.fixedRows.indexOf(z),1)}return L.texturePage=this._pages.indexOf(R),L.texturePosition.x=z.x,L.texturePosition.y=z.y,L.texturePositionClipSpace.x=z.x/R.canvas.width,L.texturePositionClipSpace.y=z.y/R.canvas.height,L.sizeClipSpace.x/=R.canvas.width,L.sizeClipSpace.y/=R.canvas.height,z.height=Math.max(z.height,L.size.y),z.x+=L.size.x,R.ctx.putImageData(F,L.texturePosition.x-this._workBoundingBox.left,L.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,L.size.x,L.size.y),R.addGlyph(L),R.version++,L}_findGlyphBoundingBox(e,t,n,r,i,a){t.top=0;let o=r?this._config.deviceCellHeight:this._tmpCanvas.height,s=r?this._config.deviceCellWidth:n,c=!1;for(let n=0;n<o;n++){for(let r=0;r<s;r++){let i=n*this._tmpCanvas.width*4+4*r+3;if(e.data[i]!==0){t.top=n,c=!0;break}}if(c)break}t.left=0,c=!1;for(let n=0;n<a+s;n++){for(let r=0;r<o;r++){let i=r*this._tmpCanvas.width*4+4*n+3;if(e.data[i]!==0){t.left=n,c=!0;break}}if(c)break}t.right=s,c=!1;for(let n=a+s-1;n>=a;n--){for(let r=0;r<o;r++){let i=r*this._tmpCanvas.width*4+4*n+3;if(e.data[i]!==0){t.right=n,c=!0;break}}if(c)break}t.bottom=o,c=!1;for(let n=o-1;n>=0;n--){for(let r=0;r<s;r++){let i=n*this._tmpCanvas.width*4+4*r+3;if(e.data[i]!==0){t.bottom=n,c=!0;break}}if(c)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:t.right-t.left+1,y:t.bottom-t.top+1},sizeClipSpace:{x:t.right-t.left+1,y:t.bottom-t.top+1},offset:{x:-t.left+a+(r||i?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-t.top+a+(r||i?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}t.TextureAtlas=m;class h{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}constructor(e,t,n){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],n)for(let e of n)this._glyphs.push(...e.glyphs),this._usedPixels+=e._usedPixels;this.canvas=_(e,t,t),this.ctx=(0,a.throwIfFalsy)(this.canvas.getContext(`2d`,{alpha:!0}))}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 g(e,t,n,r){let i=t.rgba>>>24,a=t.rgba>>>16&255,o=t.rgba>>>8&255,s=n.rgba>>>24,c=n.rgba>>>16&255,l=n.rgba>>>8&255,u=Math.floor((Math.abs(i-s)+Math.abs(a-c)+Math.abs(o-l))/12),d=!0;for(let t=0;t<e.data.length;t+=4)e.data[t]===i&&e.data[t+1]===a&&e.data[t+2]===o||r&&Math.abs(e.data[t]-i)+Math.abs(e.data[t+1]-a)+Math.abs(e.data[t+2]-o)<u?e.data[t+3]=0:d=!1;return d}function _(e,t,n){let r=e.createElement(`canvas`);return r.width=t,r.height=n,r}},577:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterJoinerService=t.JoinedCellData=void 0;let a=n(147),o=n(855),s=n(782),c=n(97);class l extends a.AttributeData{constructor(e,t,n){super(),this.content=0,this.combinedData=``,this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error(`not implemented`)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.JoinedCellData=l;let u=t.CharacterJoinerService=class e{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new s.CellData}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let n=[],r=t.translateToString(!0),i=0,a=0,s=0,c=t.getFg(0),l=t.getBg(0);for(let e=0;e<t.getTrimmedLength();e++)if(t.loadCell(e,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==c||this._workCell.bg!==l){if(e-i>1){let e=this._getJoinedRanges(r,s,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}i=e,s=a,c=this._workCell.fg,l=this._workCell.bg}a+=this._workCell.getChars().length||o.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-i>1){let e=this._getJoinedRanges(r,s,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}return n}_getJoinedRanges(t,n,r,i,a){let o=t.substring(n,r),s=[];try{s=this._characterJoiners[0].handler(o)}catch(e){console.error(e)}for(let t=1;t<this._characterJoiners.length;t++)try{let n=this._characterJoiners[t].handler(o);for(let t=0;t<n.length;t++)e._mergeRanges(s,n[t])}catch(e){console.error(e)}return this._stringRangesToCellRanges(s,i,a),s}_stringRangesToCellRanges(e,t,n){let r=0,i=!1,a=0,s=e[r];if(s){for(let c=n;c<this._bufferService.cols;c++){let n=t.getWidth(c),l=t.getString(c).length||o.WHITESPACE_CELL_CHAR.length;if(n!==0){if(!i&&s[0]<=a&&(s[0]=c,i=!0),s[1]<=a){if(s[1]=c,s=e[++r],!s)break;s[0]<=a?(s[0]=c,i=!0):i=!1}a+=l}}s&&(s[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(n){if(t[1]<=i[0])return e[r-1][1]=t[1],e;if(t[1]<=i[1])return e[r-1][1]=Math.max(t[1],i[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=i[0])return e.splice(r,0,t),e;if(t[1]<=i[1])return i[0]=Math.min(t[0],i[0]),e;t[0]<i[1]&&(i[0]=Math.min(t[0],i[0]),n=!0)}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};t.CharacterJoinerService=u=r([i(0,c.IBufferService)],u)},160:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;let n=0,r=0,i=0,a=0;var o,s,c,l,u;function d(e){let t=e.toString(16);return t.length<2?`0`+t:t}function f(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}t.NULL_COLOR={css:`#00000000`,rgba:0},function(e){e.toCss=function(e,t,n,r){return r===void 0?`#${d(e)}${d(t)}${d(n)}`:`#${d(e)}${d(t)}${d(n)}${d(r)}`},e.toRgba=function(e,t,n,r=255){return(e<<24|t<<16|n<<8|r)>>>0},e.toColor=function(t,n,r,i){return{css:e.toCss(t,n,r,i),rgba:e.toRgba(t,n,r,i)}}}(o||(t.channels=o={})),function(e){function t(e,t){return a=Math.round(255*t),[n,r,i]=u.toChannels(e.rgba),{css:o.toCss(n,r,i,a),rgba:o.toRgba(n,r,i,a)}}e.blend=function(e,t){if(a=(255&t.rgba)/255,a===1)return{css:t.css,rgba:t.rgba};let s=t.rgba>>24&255,c=t.rgba>>16&255,l=t.rgba>>8&255,u=e.rgba>>24&255,d=e.rgba>>16&255,f=e.rgba>>8&255;return n=u+Math.round((s-u)*a),r=d+Math.round((c-d)*a),i=f+Math.round((l-f)*a),{css:o.toCss(n,r,i),rgba:o.toRgba(n,r,i)}},e.isOpaque=function(e){return(255&e.rgba)==255},e.ensureContrastRatio=function(e,t,n){let r=u.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return o.toColor(r>>24&255,r>>16&255,r>>8&255)},e.opaque=function(e){let t=(255|e.rgba)>>>0;return[n,r,i]=u.toChannels(t),{css:o.toCss(n,r,i),rgba:t}},e.opacity=t,e.multiplyOpacity=function(e,n){return a=255&e.rgba,t(e,a*n/255)},e.toColorRGB=function(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}}(s||(t.color=s={})),function(e){let t,s;try{let e=document.createElement(`canvas`);e.width=1,e.height=1;let n=e.getContext(`2d`,{willReadFrequently:!0});n&&(t=n,t.globalCompositeOperation=`copy`,s=t.createLinearGradient(0,0,1,1))}catch{}e.toColor=function(e){if(e.match(/#[\da-f]{3,8}/i))switch(e.length){case 4:return n=parseInt(e.slice(1,2).repeat(2),16),r=parseInt(e.slice(2,3).repeat(2),16),i=parseInt(e.slice(3,4).repeat(2),16),o.toColor(n,r,i);case 5:return n=parseInt(e.slice(1,2).repeat(2),16),r=parseInt(e.slice(2,3).repeat(2),16),i=parseInt(e.slice(3,4).repeat(2),16),a=parseInt(e.slice(4,5).repeat(2),16),o.toColor(n,r,i,a);case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}let c=e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(c)return n=parseInt(c[1]),r=parseInt(c[2]),i=parseInt(c[3]),a=Math.round(255*(c[5]===void 0?1:parseFloat(c[5]))),o.toColor(n,r,i,a);if(!t||!s||(t.fillStyle=s,t.fillStyle=e,typeof t.fillStyle!=`string`)||(t.fillRect(0,0,1,1),[n,r,i,a]=t.getImageData(0,0,1,1).data,a!==255))throw Error(`css.toColor: Unsupported css format`);return{rgba:o.toRgba(n,r,i,a),css:e}}}(c||(t.css=c={})),function(e){function t(e,t,n){let r=e/255,i=t/255,a=n/255;return .2126*(r<=.03928?r/12.92:((r+.055)/1.055)**2.4)+.7152*(i<=.03928?i/12.92:((i+.055)/1.055)**2.4)+.0722*(a<=.03928?a/12.92:((a+.055)/1.055)**2.4)}e.relativeLuminance=function(e){return t(e>>16&255,e>>8&255,255&e)},e.relativeLuminance2=t}(l||(t.rgb=l={})),function(e){function t(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,u=f(l.relativeLuminance2(o,s,c),l.relativeLuminance2(r,i,a));for(;u<n&&(o>0||s>0||c>0);)o-=Math.max(0,Math.ceil(.1*o)),s-=Math.max(0,Math.ceil(.1*s)),c-=Math.max(0,Math.ceil(.1*c)),u=f(l.relativeLuminance2(o,s,c),l.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}function s(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,u=f(l.relativeLuminance2(o,s,c),l.relativeLuminance2(r,i,a));for(;u<n&&(o<255||s<255||c<255);)o=Math.min(255,o+Math.ceil(.1*(255-o))),s=Math.min(255,s+Math.ceil(.1*(255-s))),c=Math.min(255,c+Math.ceil(.1*(255-c))),u=f(l.relativeLuminance2(o,s,c),l.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.blend=function(e,t){if(a=(255&t)/255,a===1)return t;let s=t>>24&255,c=t>>16&255,l=t>>8&255,u=e>>24&255,d=e>>16&255,f=e>>8&255;return n=u+Math.round((s-u)*a),r=d+Math.round((c-d)*a),i=f+Math.round((l-f)*a),o.toRgba(n,r,i)},e.ensureContrastRatio=function(e,n,r){let i=l.relativeLuminance(e>>8),a=l.relativeLuminance(n>>8);if(f(i,a)<r){if(a<i){let a=t(e,n,r),o=f(i,l.relativeLuminance(a>>8));if(o<r){let t=s(e,n,r);return o>f(i,l.relativeLuminance(t>>8))?a:t}return a}let o=s(e,n,r),c=f(i,l.relativeLuminance(o>>8));if(c<r){let a=t(e,n,r);return c>f(i,l.relativeLuminance(a>>8))?o:a}return o}},e.reduceLuminance=t,e.increaseLuminance=s,e.toChannels=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]}}(u||(t.rgba=u={})),t.toPaddedHex=d,t.contrastRatio=f},345:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.runAndSubscribe=t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||=e=>(this._listeners.push(e),{dispose:()=>{if(!this._disposed){for(let t=0;t<this._listeners.length;t++)if(this._listeners[t]===e)return void this._listeners.splice(t,1)}}}),this._event}fire(e,t){let n=[];for(let e=0;e<this._listeners.length;e++)n.push(this._listeners[e]);for(let r=0;r<n.length;r++)n[r].call(void 0,e,t)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},t.forwardEvent=function(e,t){return e((e=>t.fire(e)))},t.runAndSubscribe=function(e,t){return t(void 0),e((e=>t(e)))}},859:(e,t)=>{function n(e){for(let t of e)t.dispose();e.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.MutableDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(let e of this._disposables)e.dispose();this._disposables.length=0}register(e){return this._disposables.push(e),e}unregister(e){let t=this._disposables.indexOf(e);t!==-1&&this._disposables.splice(t,1)}},t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},t.toDisposable=function(e){return{dispose:e}},t.disposeArray=n,t.getDisposeArrayDisposable=function(e){return{dispose:()=>n(e)}}},485:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class n{constructor(){this._data={}}set(e,t,n){this._data[e]||(this._data[e]={}),this._data[e][t]=n}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}}t.TwoKeyMap=n,t.FourKeyMap=class{constructor(){this._data=new n}set(e,t,r,i,a){this._data.get(e,t)||this._data.set(e,t,new n),this._data.get(e,t).set(r,i,a)}get(e,t,n,r){return this._data.get(e,t)?.get(n,r)}clear(){this._data.clear()}}},399:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isChromeOS=t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.getSafariVersion=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode=typeof process<`u`&&`title`in process;let n=t.isNode?`node`:navigator.userAgent,r=t.isNode?`node`:navigator.platform;t.isFirefox=n.includes(`Firefox`),t.isLegacyEdge=n.includes(`Edge`),t.isSafari=/^((?!chrome|android).)*safari/i.test(n),t.getSafariVersion=function(){if(!t.isSafari)return 0;let e=n.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])},t.isMac=[`Macintosh`,`MacIntel`,`MacPPC`,`Mac68K`].includes(r),t.isIpad=r===`iPad`,t.isIphone=r===`iPhone`,t.isWindows=[`Windows`,`Win16`,`Win32`,`WinCE`].includes(r),t.isLinux=r.indexOf(`Linux`)>=0,t.isChromeOS=/\bCrOS\b/.test(n)},385:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;let r=n(399);class i{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),void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||=this._requestCallback(this._process.bind(this))}_process(e){this._idleCallback=void 0;let t=0,n=0,r=e.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(t=Date.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,Date.now()-t),n=Math.max(t,n),i=e.timeRemaining(),1.5*n>i)return r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),void this._start();r=i}this.clear()}}class a extends i{_requestCallback(e){return setTimeout((()=>e(this._createDeadline(16))))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=Date.now()+e;return{timeRemaining:()=>Math.max(0,t-Date.now())}}}t.PriorityTaskQueue=a,t.IdleTaskQueue=!r.isNode&&`requestIdleCallback`in window?class extends i{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}}:a,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}}},147:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class n{constructor(){this.fg=0,this.bg=0,this.extended=new r}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){let e=new n;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}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)}isBgDefault(){return!(50331648&this.bg)}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):this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}t.AttributeData=n;class r{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(3758096384&this._ext)>>29;return e<0?4294967288^e:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}clone(){return new r(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}t.ExtendedAttrs=r},782:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;let r=n(133),i=n(855),a=n(147);class o extends a.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new a.ExtendedAttrs,this.combinedData=``}static fromCharData(e){let t=new o;return t.setFromCharData(e),t}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,r.stringFromCodePoint)(2097151&this.content):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[i.CHAR_DATA_ATTR_INDEX],this.bg=0;let t=!1;if(e[i.CHAR_DATA_CHAR_INDEX].length>2)t=!0;else if(e[i.CHAR_DATA_CHAR_INDEX].length===2){let n=e[i.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[i.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=r&&r<=57343?this.content=1024*(n-55296)+r-56320+65536|e[i.CHAR_DATA_WIDTH_INDEX]<<22:t=!0}else t=!0}else this.content=e[i.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[i.CHAR_DATA_WIDTH_INDEX]<<22;t&&(this.combinedData=e[i.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[i.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=o},855:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=0,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR=``,t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=` `,t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},133:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode(55296+(t>>10))+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=1024*(this._interim-55296)+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=1024*(i-55296)+o-56320+65536:(t[r++]=i,t[r++]=o)}else i!==65279&&(t[r++]=i)}return r}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r,i,a,o,s=0,c=0,l=0;if(this.interim[0]){let r=!1,i=this.interim[0];i&=(224&i)==192?31:(240&i)==224?15:7;let a,o=0;for(;(a=63&this.interim[++o])&&o<4;)i<<=6,i|=a;let c=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(a=e[l++],(192&a)!=128){l--,r=!0;break}this.interim[o++]=a,i<<=6,i|=63&a}r||(c===2?i<128?l--:t[s++]=i:c===3?i<2048||i>=55296&&i<=57343||i===65279||(t[s++]=i):i<65536||i>1114111||(t[s++]=i)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;!(!(d<u)||128&(r=e[d])||128&(i=e[d+1])||128&(a=e[d+2])||128&(o=e[d+3]));)t[s++]=r,t[s++]=i,t[s++]=a,t[s++]=o,d+=4;if(r=e[d++],r<128)t[s++]=r;else if((224&r)==192){if(d>=n)return this.interim[0]=r,s;if(i=e[d++],(192&i)!=128){d--;continue}if(c=(31&r)<<6|63&i,c<128){d--;continue}t[s++]=c}else if((240&r)==224){if(d>=n)return this.interim[0]=r,s;if(i=e[d++],(192&i)!=128){d--;continue}if(d>=n)return this.interim[0]=r,this.interim[1]=i,s;if(a=e[d++],(192&a)!=128){d--;continue}if(c=(15&r)<<12|(63&i)<<6|63&a,c<2048||c>=55296&&c<=57343||c===65279)continue;t[s++]=c}else if((248&r)==240){if(d>=n)return this.interim[0]=r,s;if(i=e[d++],(192&i)!=128){d--;continue}if(d>=n)return this.interim[0]=r,this.interim[1]=i,s;if(a=e[d++],(192&a)!=128){d--;continue}if(d>=n)return this.interim[0]=r,this.interim[1]=i,this.interim[2]=a,s;if(o=e[d++],(192&o)!=128){d--;continue}if(c=(7&r)<<18|(63&i)<<12|(63&a)<<6|63&o,c<65536||c>1114111)continue;t[s++]=c}}return s}}},776:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.traceCall=t.setTraceLogger=t.LogService=void 0;let a=n(859),o=n(97),s={trace:o.LogLevelEnum.TRACE,debug:o.LogLevelEnum.DEBUG,info:o.LogLevelEnum.INFO,warn:o.LogLevelEnum.WARN,error:o.LogLevelEnum.ERROR,off:o.LogLevelEnum.OFF},c,l=t.LogService=class extends a.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=o.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange(`logLevel`,(()=>this._updateLogLevel()))),c=this}_updateLogLevel(){this._logLevel=s[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]==`function`&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?``:`xterm.js: `)+t,...n)}trace(e,...t){this._logLevel<=o.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=o.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=o.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=o.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=o.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};t.LogService=l=r([i(0,o.IOptionsService)],l),t.setTraceLogger=function(e){c=e},t.traceCall=function(e,t,n){if(typeof n.value!=`function`)throw Error(`not supported`);let r=n.value;n.value=function(...e){if(c.logLevel!==o.LogLevelEnum.TRACE)return r.apply(this,e);c.trace(`GlyphRenderer#${r.name}(${e.map((e=>JSON.stringify(e))).join(`, `)})`);let t=r.apply(this,e);return c.trace(`GlyphRenderer#${r.name} return`,t),t}}},726:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0;let n=`di$target`,r=`di$dependencies`;t.serviceRegistry=new Map,t.getServiceDependencies=function(e){return e[r]||[]},t.createDecorator=function(e){if(t.serviceRegistry.has(e))return t.serviceRegistry.get(e);let i=function(e,t,a){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);(function(e,t,i){t[n]===t?t[r].push({id:e,index:i}):(t[r]=[{id:e,index:i}],t[n]=t)})(i,e,a)};return i.toString=()=>e,t.serviceRegistry.set(e,i),i}},97:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;let r=n(726);var i;t.IBufferService=(0,r.createDecorator)(`BufferService`),t.ICoreMouseService=(0,r.createDecorator)(`CoreMouseService`),t.ICoreService=(0,r.createDecorator)(`CoreService`),t.ICharsetService=(0,r.createDecorator)(`CharsetService`),t.IInstantiationService=(0,r.createDecorator)(`InstantiationService`),function(e){e[e.TRACE=0]=`TRACE`,e[e.DEBUG=1]=`DEBUG`,e[e.INFO=2]=`INFO`,e[e.WARN=3]=`WARN`,e[e.ERROR=4]=`ERROR`,e[e.OFF=5]=`OFF`}(i||(t.LogLevelEnum=i={})),t.ILogService=(0,r.createDecorator)(`LogService`),t.IOptionsService=(0,r.createDecorator)(`OptionsService`),t.IOscLinkService=(0,r.createDecorator)(`OscLinkService`),t.IUnicodeService=(0,r.createDecorator)(`UnicodeService`),t.IDecorationService=(0,r.createDecorator)(`DecorationService`)}},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,n),a.exports}var r={};return(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasAddon=void 0;let t=n(345),i=n(859),a=n(776),o=n(949);class s extends i.Disposable{constructor(){super(...arguments),this._onChangeTextureAtlas=this.register(new t.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new t.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event}get textureAtlas(){return this._renderer?.textureAtlas}activate(e){let n=e._core;if(!e.element)return void this.register(n.onWillOpen((()=>this.activate(e))));this._terminal=e;let r=n.coreService,s=n.optionsService,c=n.screenElement,l=n.linkifier,u=n,d=u._bufferService,f=u._renderService,p=u._characterJoinerService,m=u._charSizeService,h=u._coreBrowserService,g=u._decorationService,_=u._logService,v=u._themeService;(0,a.setTraceLogger)(_),this._renderer=new o.CanvasRenderer(e,c,l,d,m,s,p,r,h,g,v),this.register((0,t.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,t.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),f.setRenderer(this._renderer),f.handleResize(d.cols,d.rows),this.register((0,i.toDisposable)((()=>{f.setRenderer(this._terminal._core._createRenderer()),f.handleResize(e.cols,e.rows),this._renderer?.dispose(),this._renderer=void 0})))}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}}e.CanvasAddon=s})(),r})()))}))(),w=2,T=1,E=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(w,Math.floor(u/e.css.cell.width)),rows:Math.max(T,Math.floor(l/e.css.cell.height))}}},D=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?j.isErrorNoTelemetry(e)?new j(e.message+`
2
2
 
3
3
  `+e.stack):Error(e.message+`
4
4
 
@@ -1 +1 @@
1
- import{a as e,s as t}from"./precisionRound-Bq_nmf5u.js";import{a as n,i as r}from"./linear-0eij_aAG.js";import{A as i,C as a,D as o,E as s,M as c,N as l,O as u,P as d,S as f,T as p,b as m,c as h,j as g,k as _,l as v,o as y,p as b,s as x,t as S,v as C,w,y as T}from"./defaultLocale-D5bOh7g6.js";import{n as ee}from"./init-ZlXS9mIS.js";import{A as E,O as te,S as D,_ as O,g as ne,k,x as A}from"./cubic-DELhj3Tx.js";function re(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function ie(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function j(n,r,a,f,p,m){let h=[[s,1,g],[s,5,5*g],[s,15,15*g],[s,30,30*g],[m,1,_],[m,5,5*_],[m,15,15*_],[m,30,30*_],[p,1,u],[p,3,3*u],[p,6,6*u],[p,12,12*u],[f,1,o],[f,2,2*o],[a,1,c],[r,1,i],[r,3,3*i],[n,1,l]];function v(e,t,n){let r=t<e;r&&([e,t]=[t,e]);let i=n&&typeof n.range==`function`?n:y(e,t,n),a=i?i.range(e,+t+1):[];return r?a.reverse():a}function y(r,i,a){let o=Math.abs(i-r)/a,s=t(([,,e])=>e).right(h,o);if(s===h.length)return n.every(e(r/l,i/l,a));if(s===0)return d.every(Math.max(e(r,i,a),1));let[c,u]=h[o/h[s-1][2]<h[s][2]/o?s-1:s];return c.every(u)}return[v,y]}var[ae,oe]=j(x,v,C,m,a,p),[se,ce]=j(y,h,b,T,f,w),M=Math.PI/180,N=180/Math.PI,P=18,F=.96422,I=1,L=.82521,R=4/29,z=6/29,B=3*z*z,le=z*z*z;function V(e){if(e instanceof U)return new U(e.l,e.a,e.b,e.opacity);if(e instanceof Y)return X(e);e instanceof D||(e=te(e));var t=q(e.r),n=q(e.g),r=q(e.b),i=W((.2225045*t+.7168786*n+.0606169*r)/I),a,o;return t===n&&n===r?a=o=i:(a=W((.4360747*t+.3850649*n+.1430804*r)/F),o=W((.0139322*t+.0971045*n+.7141733*r)/L)),new U(116*i-16,500*(a-i),200*(i-o),e.opacity)}function H(e,t,n,r){return arguments.length===1?V(e):new U(e,t,n,r??1)}function U(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}k(U,H,E(A,{brighter(e){return new U(this.l+P*(e??1),this.a,this.b,this.opacity)},darker(e){return new U(this.l-P*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=F*G(t),e=I*G(e),n=L*G(n),new D(K(3.1338561*t-1.6168667*e-.4906146*n),K(-.9787684*t+1.9161415*e+.033454*n),K(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function W(e){return e>le?e**(1/3):e/B+R}function G(e){return e>z?e*e*e:B*(e-R)}function K(e){return 255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055)}function q(e){return(e/=255)<=.04045?e/12.92:((e+.055)/1.055)**2.4}function ue(e){if(e instanceof Y)return new Y(e.h,e.c,e.l,e.opacity);if(e instanceof U||(e=V(e)),e.a===0&&e.b===0)return new Y(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*N;return new Y(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function J(e,t,n,r){return arguments.length===1?ue(e):new Y(e,t,n,r??1)}function Y(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function X(e){if(isNaN(e.h))return new U(e.l,0,0,e.opacity);var t=e.h*M;return new U(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}k(Y,J,E(A,{brighter(e){return new Y(this.h,this.c,this.l+P*(e??1),this.opacity)},darker(e){return new Y(this.h,this.c,this.l-P*(e??1),this.opacity)},rgb(){return X(this).rgb()}}));function Z(e){return function(t,n){var r=e((t=J(t)).h,(n=J(n)).h),i=O(t.c,n.c),a=O(t.l,n.l),o=O(t.opacity,n.opacity);return function(e){return t.h=r(e),t.c=i(e),t.l=a(e),t.opacity=o(e),t+``}}}var de=Z(ne),fe=Z(O);function Q(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function pe(e){return new Date(e)}function me(e){return e instanceof Date?+e:+new Date(+e)}function $(e,t,i,a,o,s,c,l,u,d){var f=r(),p=f.invert,m=f.domain,h=d(`.%L`),g=d(`:%S`),_=d(`%I:%M`),v=d(`%I %p`),y=d(`%a %d`),b=d(`%b %d`),x=d(`%B`),S=d(`%Y`);function C(e){return(u(e)<e?h:l(e)<e?g:c(e)<e?_:s(e)<e?v:a(e)<e?o(e)<e?y:b:i(e)<e?x:S)(e)}return f.invert=function(e){return new Date(p(e))},f.domain=function(e){return arguments.length?m(Array.from(e,me)):m().map(pe)},f.ticks=function(t){var n=m();return e(n[0],n[n.length-1],t??10)},f.tickFormat=function(e,t){return t==null?C:d(t)},f.nice=function(e){var n=m();return(!e||typeof e.range!=`function`)&&(e=t(n[0],n[n.length-1],e??10)),e?m(Q(n,e)):f},f.copy=function(){return n(f,$(e,t,i,a,o,s,c,l,u,d))},f}function he(){return ee.apply($(se,ce,y,h,b,T,f,w,s,S).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}export{de as a,N as c,ae as d,ie as f,fe as i,M as l,he as n,J as o,re as p,Q as r,H as s,$ as t,oe as u};
1
+ import{a as e,i as t,y as n}from"./linear-Bma8J3iM.js";import{a as r}from"./precisionRound-BxlUs8G4.js";import{A as i,C as a,D as o,E as s,M as c,N as l,O as u,P as d,S as f,T as p,b as m,c as h,j as g,k as _,l as v,o as y,p as b,s as x,t as S,v as C,w,y as T}from"./defaultLocale-D5bOh7g6.js";import{n as ee}from"./init-ZlXS9mIS.js";import{A as E,O as te,S as D,_ as O,g as ne,k,x as A}from"./cubic-DELhj3Tx.js";function re(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function ie(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function j(e,t,a,f,p,m){let h=[[s,1,g],[s,5,5*g],[s,15,15*g],[s,30,30*g],[m,1,_],[m,5,5*_],[m,15,15*_],[m,30,30*_],[p,1,u],[p,3,3*u],[p,6,6*u],[p,12,12*u],[f,1,o],[f,2,2*o],[a,1,c],[t,1,i],[t,3,3*i],[e,1,l]];function v(e,t,n){let r=t<e;r&&([e,t]=[t,e]);let i=n&&typeof n.range==`function`?n:y(e,t,n),a=i?i.range(e,+t+1):[];return r?a.reverse():a}function y(t,i,a){let o=Math.abs(i-t)/a,s=n(([,,e])=>e).right(h,o);if(s===h.length)return e.every(r(t/l,i/l,a));if(s===0)return d.every(Math.max(r(t,i,a),1));let[c,u]=h[o/h[s-1][2]<h[s][2]/o?s-1:s];return c.every(u)}return[v,y]}var[ae,oe]=j(x,v,C,m,a,p),[se,ce]=j(y,h,b,T,f,w),M=Math.PI/180,N=180/Math.PI,P=18,F=.96422,I=1,L=.82521,R=4/29,z=6/29,B=3*z*z,le=z*z*z;function V(e){if(e instanceof U)return new U(e.l,e.a,e.b,e.opacity);if(e instanceof Y)return X(e);e instanceof D||(e=te(e));var t=q(e.r),n=q(e.g),r=q(e.b),i=W((.2225045*t+.7168786*n+.0606169*r)/I),a,o;return t===n&&n===r?a=o=i:(a=W((.4360747*t+.3850649*n+.1430804*r)/F),o=W((.0139322*t+.0971045*n+.7141733*r)/L)),new U(116*i-16,500*(a-i),200*(i-o),e.opacity)}function H(e,t,n,r){return arguments.length===1?V(e):new U(e,t,n,r??1)}function U(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}k(U,H,E(A,{brighter(e){return new U(this.l+P*(e??1),this.a,this.b,this.opacity)},darker(e){return new U(this.l-P*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=F*G(t),e=I*G(e),n=L*G(n),new D(K(3.1338561*t-1.6168667*e-.4906146*n),K(-.9787684*t+1.9161415*e+.033454*n),K(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function W(e){return e>le?e**(1/3):e/B+R}function G(e){return e>z?e*e*e:B*(e-R)}function K(e){return 255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055)}function q(e){return(e/=255)<=.04045?e/12.92:((e+.055)/1.055)**2.4}function ue(e){if(e instanceof Y)return new Y(e.h,e.c,e.l,e.opacity);if(e instanceof U||(e=V(e)),e.a===0&&e.b===0)return new Y(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*N;return new Y(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function J(e,t,n,r){return arguments.length===1?ue(e):new Y(e,t,n,r??1)}function Y(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function X(e){if(isNaN(e.h))return new U(e.l,0,0,e.opacity);var t=e.h*M;return new U(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}k(Y,J,E(A,{brighter(e){return new Y(this.h,this.c,this.l+P*(e??1),this.opacity)},darker(e){return new Y(this.h,this.c,this.l-P*(e??1),this.opacity)},rgb(){return X(this).rgb()}}));function Z(e){return function(t,n){var r=e((t=J(t)).h,(n=J(n)).h),i=O(t.c,n.c),a=O(t.l,n.l),o=O(t.opacity,n.opacity);return function(e){return t.h=r(e),t.c=i(e),t.l=a(e),t.opacity=o(e),t+``}}}var de=Z(ne),fe=Z(O);function Q(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function pe(e){return new Date(e)}function me(e){return e instanceof Date?+e:+new Date(+e)}function $(n,r,i,a,o,s,c,l,u,d){var f=t(),p=f.invert,m=f.domain,h=d(`.%L`),g=d(`:%S`),_=d(`%I:%M`),v=d(`%I %p`),y=d(`%a %d`),b=d(`%b %d`),x=d(`%B`),S=d(`%Y`);function C(e){return(u(e)<e?h:l(e)<e?g:c(e)<e?_:s(e)<e?v:a(e)<e?o(e)<e?y:b:i(e)<e?x:S)(e)}return f.invert=function(e){return new Date(p(e))},f.domain=function(e){return arguments.length?m(Array.from(e,me)):m().map(pe)},f.ticks=function(e){var t=m();return n(t[0],t[t.length-1],e??10)},f.tickFormat=function(e,t){return t==null?C:d(t)},f.nice=function(e){var t=m();return(!e||typeof e.range!=`function`)&&(e=r(t[0],t[t.length-1],e??10)),e?m(Q(t,e)):f},f.copy=function(){return e(f,$(n,r,i,a,o,s,c,l,u,d))},f}function he(){return ee.apply($(se,ce,y,h,b,T,f,w,s,S).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}export{de as a,N as c,ae as d,ie as f,fe as i,M as l,he as n,J as o,re as p,Q as r,H as s,$ as t,oe as u};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-DVplv7_D.js";import{t as n}from"./react-dom-_LrxgvjW.js";import{t as r}from"./compiler-runtime-BrajqUja.js";import{o as i}from"./useEventListener-D9cftcHj.js";import{n as a,t as o}from"./cn-ldLVeaqm.js";import{t as s}from"./jsx-runtime-B74pBk57.js";import{C as c,E as l,S as u,T as d,b as f,f as p,g as m,m as h,v as g,w as _,x as v}from"./fullscreen-B9tHcfpV.js";import{c as y}from"./dist-iaThVDkA.js";import{d as b}from"./menu-items-BrwnTgyK.js";import{r as ee}from"./useNumberFormatter-D7O_26UI.js";var x=e(t(),1),te=e(n(),1),S=s(),C=Object.defineProperty,w=(e,t)=>C(e,`name`,{value:t,configurable:!0}),T=`ToastProvider`,[E,D,ne]=b(`Toast`),[O,k]=_(`Toast`,[ne]),[A,j]=O(T),M=w(e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,announcerContainer:o,children:s}=e,[c,l]=x.useState(null),[u,d]=x.useState(0),f=x.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${T}\`. Expected non-empty \`string\`.`),(0,S.jsx)(E.Provider,{scope:t,children:(0,S.jsx)(A,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:u,viewport:c,onViewportChange:l,onToastAdd:x.useCallback(()=>d(e=>e+1),[]),onToastRemove:x.useCallback(()=>d(e=>e-1),[]),isClosePausedRef:f,announcerContainer:o,children:s})})},`ToastProvider`),N=`ToastViewport`,P=[`F8`],F=`toast.viewportPause`,I=`toast.viewportResume`,L=x.forwardRef(w(function(e,t){let{__scopeToast:n,hotkey:r=P,label:a=`Notifications ({hotkey})`,...o}=e,s=j(N,n),c=D(n),l=x.useRef(null),u=x.useRef(null),f=x.useRef(null),p=x.useRef(null),m=i(t,p,s.onViewportChange),g=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),_=s.toastCount>0;x.useEffect(()=>{let e=w(e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&p.current?.focus()},`handleKeyDown`);return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),x.useEffect(()=>{let e=l.current,t=p.current;if(_&&e&&t){let n=w(()=>{if(!s.isClosePausedRef.current){let e=new CustomEvent(F);t.dispatchEvent(e),s.isClosePausedRef.current=!0}},`handlePause`),r=w(()=>{if(s.isClosePausedRef.current){let e=new CustomEvent(I);t.dispatchEvent(e),s.isClosePausedRef.current=!1}},`handleResume`),i=w(t=>{e.contains(t.relatedTarget)||r()},`handleFocusOutResume`),a=w(()=>{e.contains(document.activeElement)||r()},`handlePointerLeaveResume`);return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[_,s.isClosePausedRef]);let v=x.useCallback(({tabbingDirection:e})=>{let t=c().map(t=>{let n=t.ref.current,r=[n,...he(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[c]);return x.useEffect(()=>{let e=p.current;if(e){let t=w(t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){u.current?.focus();return}let i=v({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);X(i.slice(a+1))?t.preventDefault():r?u.current?.focus():f.current?.focus()}},`handleKeyDown`);return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[c,v]),(0,S.jsxs)(h,{ref:l,role:`region`,"aria-label":a.replace(`{hotkey}`,g),tabIndex:-1,style:{pointerEvents:_?void 0:`none`},children:[_&&(0,S.jsx)(z,{ref:u,onFocusFromOutsideViewport:()=>{X(v({tabbingDirection:`forwards`}))}}),(0,S.jsx)(E.Slot,{scope:n,children:(0,S.jsx)(d.ol,{tabIndex:-1,...o,ref:m})}),_&&(0,S.jsx)(z,{ref:f,onFocusFromOutsideViewport:()=>{X(v({tabbingDirection:`backwards`}))}})]})},`ToastViewport`)),R=`ToastFocusProxy`,z=x.forwardRef(w(function(e,t){let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=j(R,n);return(0,S.jsx)(y,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})},`ToastFocusProxy`)),B=`Toast`,re=`toast.swipeStart`,ie=`toast.swipeMove`,ae=`toast.swipeCancel`,oe=`toast.swipeEnd`,V=x.forwardRef(w(function(e,t){let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,l]=v({prop:r,defaultProp:i??!0,onChange:a,caller:B});return(0,S.jsx)(f,{present:n||s,children:(0,S.jsx)(ce,{open:s,...o,ref:t,onClose:()=>l(!1),onPause:g(e.onPause),onResume:g(e.onResume),onSwipeStart:c(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:c(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:c(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:c(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),l(!1)})})})},`Toast`)),[se,H]=O(B,{onClose(){}}),ce=x.forwardRef(w(function(e,t){let{__scopeToast:n,type:r=`foreground`,duration:a,open:o,onClose:s,onEscapeKeyDown:l,onPause:u,onResume:f,onSwipeStart:p,onSwipeMove:h,onSwipeCancel:_,onSwipeEnd:v,...y}=e,b=j(B,n),ee=D(n),[C,T]=x.useState(null),ne=i(t,T),O=x.useRef(null),k=x.useRef(null),A=a||b.duration,M=x.useRef(0),N=x.useRef(A),P=x.useRef(0),{onToastAdd:L,onToastRemove:R}=b,z=g(()=>{C?.contains(document.activeElement)&&b.viewport?.focus(),s()}),V=x.useCallback(e=>{!e||e===1/0||(window.clearTimeout(P.current),M.current=new Date().getTime(),P.current=window.setTimeout(z,e))},[z]);x.useEffect(()=>{let e=b.viewport;if(e){let t=w(()=>{V(N.current),f?.()},`handleResume`),n=w(()=>{let e=new Date().getTime()-M.current;N.current-=e,window.clearTimeout(P.current),u?.()},`handlePause`);return e.addEventListener(F,n),e.addEventListener(I,t),()=>{e.removeEventListener(F,n),e.removeEventListener(I,t)}}},[b.viewport,A,u,f,V]),x.useEffect(()=>{o&&!b.isClosePausedRef.current&&V(A)},[o,A,b.isClosePausedRef,V]),x.useEffect(()=>()=>{window.clearTimeout(P.current)},[]),x.useEffect(()=>(L(),()=>R()),[L,R]);let H=x.useMemo(()=>C?G(C):null,[C]);return b.viewport?(0,S.jsxs)(S.Fragment,{children:[H&&(0,S.jsx)(le,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:H}),(0,S.jsx)(se,{scope:n,onClose:z,children:te.createPortal((0,S.jsx)(E.ItemSlot,{scope:n,children:(0,S.jsx)(m,{asChild:!0,onEscapeKeyDown:c(l,e=>{ee().some(t=>t.ref.current?.contains(e.target))||z()}),children:(0,S.jsx)(d.li,{tabIndex:0,"data-state":o?`open`:`closed`,"data-swipe-direction":b.swipeDirection,...y,ref:ne,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:c(e.onKeyDown,e=>{e.key===`Escape`&&(l?.(e.nativeEvent),e.nativeEvent.defaultPrevented||z())}),onPointerDown:c(e.onPointerDown,e=>{e.button===0&&(O.current={x:e.clientX,y:e.clientY})}),onPointerMove:c(e.onPointerMove,e=>{if(!O.current)return;let t=e.clientX-O.current.x,n=e.clientY-O.current.y,r=!!k.current,i=[`left`,`right`].includes(b.swipeDirection),a=[`left`,`up`].includes(b.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},u={originalEvent:e,delta:l};r?(k.current=l,K(ie,h,u,{discrete:!1})):q(l,b.swipeDirection,c)?(k.current=l,K(re,p,u,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(O.current=null)}),onPointerUp:c(e.onPointerUp,e=>{let t=k.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),k.current=null,O.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};q(t,b.swipeDirection,b.swipeThreshold)?K(oe,v,r,{discrete:!0}):K(ae,_,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null},`ToastImpl`)),le=w(e=>{let{__scopeToast:t,children:n,...r}=e,i=j(B,t),[a,o]=x.useState(!1),[s,c]=x.useState(!1);return J(()=>o(!0)),x.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,S.jsx)(p,{asChild:!0,container:i.announcerContainer||void 0,children:(0,S.jsx)(y,{...r,children:a&&(0,S.jsxs)(S.Fragment,{children:[i.label,` `,n]})})})},`ToastAnnounce`),ue=x.forwardRef(w(function(e,t){let{__scopeToast:n,...r}=e;return(0,S.jsx)(d.div,{...r,ref:t})},`ToastTitle`)),de=x.forwardRef(w(function(e,t){let{__scopeToast:n,...r}=e;return(0,S.jsx)(d.div,{...r,ref:t})},`ToastDescription`)),fe=`ToastAction`,pe=x.forwardRef(w(function(e,t){let{altText:n,...r}=e;return n.trim()?(0,S.jsx)(W,{altText:n,asChild:!0,children:(0,S.jsx)(U,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${fe}\`. Expected non-empty \`string\`.`),null)},`ToastAction`)),me=`ToastClose`,U=x.forwardRef(w(function(e,t){let{__scopeToast:n,...r}=e,i=H(me,n);return(0,S.jsx)(W,{asChild:!0,children:(0,S.jsx)(d.button,{type:`button`,...r,ref:t,onClick:c(e.onClick,i.onClose)})})},`ToastClose`)),W=x.forwardRef(w(function(e,t){let{__scopeToast:n,altText:r,...i}=e;return(0,S.jsx)(d.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})},`ToastAnnounceExclude`));function G(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),Y(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n){if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...G(e))}}}),t}w(G,`getAnnounceTextContent`);function K(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?l(i,a):i.dispatchEvent(a)}w(K,`handleAndDispatchCustomEvent`);var q=w((e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n},`isDeltaInDirection`);function J(e=()=>{}){let t=g(e);u(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}w(J,`useNextFrame`);function Y(e){return e.nodeType===e.ELEMENT_NODE}w(Y,`isHTMLElement`);function he(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:w(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}w(he,`getTabbableCandidates`);function X(e){let t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}w(X,`focusFirst`);var ge=M,_e=L,ve=V,ye=ue,be=de,xe=pe,Se=U,Z=r(),Ce=ge,we=x.forwardRef((e,t)=>{let n=(0,Z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=o(`fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:w-fit md:max-w-[420px]`,`print:hidden`,r),n[3]=r,n[4]=a);let s;return n[5]!==i||n[6]!==t||n[7]!==a?(s=(0,S.jsx)(_e,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=s):s=n[8],s});we.displayName=_e.displayName;var Q={default:`bg-background border forced-colors:border-[CanvasText] forced-colors:bg-[Canvas] forced-colors:text-[CanvasText]`,danger:`group destructive text-error border-destructive bg-(--red-1) shadow-md-solid shadow-error forced-colors:border-[CanvasText] forced-colors:bg-[Canvas] forced-colors:text-[CanvasText]`},Te=a(`data-[swipe=move]:transition-none group relative pointer-events-auto flex w-full items-start justify-between gap-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=move]:translate-x-(--radix-toast-swipe-move-x) data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-(--radix-toast-swipe-end-x) data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=open]:slide-in-from-top-full sm:data-[state=open]:slide-in-from-bottom-full data-[state=closed]:slide-out-to-right-full forced-color-adjust-none`,{variants:{variant:Q},defaultVariants:{variant:`default`}});function Ee(e){return typeof e==`string`&&e in Q}var De=x.forwardRef((e,t)=>{let n=(0,Z.c)(11),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,variant:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let s=Ee(a)?a:`default`,c;n[4]!==r||n[5]!==s?(c=o(Te({variant:s}),`print:hidden`,r),n[4]=r,n[5]=s,n[6]=c):c=n[6];let l;return n[7]!==i||n[8]!==t||n[9]!==c?(l=(0,S.jsx)(ve,{ref:t,className:c,...i}),n[7]=i,n[8]=t,n[9]=c,n[10]=l):l=n[10],l});De.displayName=ve.displayName;var Oe=x.forwardRef((e,t)=>{let n=(0,Z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=o(`inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-destructive/30 hover:group-[.destructive]:border-destructive/30 hover:group-[.destructive]:bg-destructive hover:group-[.destructive]:text-destructive-foreground focus-visible:group-[.destructive]:ring-destructive`,`forced-color-adjust-none forced-colors:border-[ButtonText] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText] forced-colors:hover:bg-[Highlight] forced-colors:hover:text-[HighlightText] forced-colors:disabled:border-[GrayText] forced-colors:disabled:text-[GrayText]`,r),n[3]=r,n[4]=a);let s;return n[5]!==i||n[6]!==t||n[7]!==a?(s=(0,S.jsx)(xe,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=s):s=n[8],s});Oe.displayName=xe.displayName;var ke=x.forwardRef((e,t)=>{let n=(0,Z.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=o(`absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus-visible:outline-hidden focus-visible:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 hover:group-[.destructive]:text-red-500 focus-visible:group-[.destructive]:ring-red-400 focus-visible:group-[.destructive]:ring-offset-red-600`,`forced-colors:text-[CanvasText] forced-colors:hover:text-[CanvasText] forced-colors:group-[.destructive]:text-[CanvasText] forced-colors:hover:group-[.destructive]:text-[CanvasText]`,r),n[3]=r,n[4]=a);let s;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,S.jsx)(ee,{className:`h-4 w-4`}),n[5]=s):s=n[5];let c;return n[6]!==i||n[7]!==t||n[8]!==a?(c=(0,S.jsx)(Se,{ref:t,className:a,"toast-close":``,...i,children:s}),n[6]=i,n[7]=t,n[8]=a,n[9]=c):c=n[9],c});ke.displayName=Se.displayName;var Ae=x.forwardRef((e,t)=>{let n=(0,Z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=o(`text-sm font-semibold`,r),n[3]=r,n[4]=a);let s;return n[5]!==i||n[6]!==t||n[7]!==a?(s=(0,S.jsx)(ye,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=s):s=n[8],s});Ae.displayName=ye.displayName;var $=x.forwardRef((e,t)=>{let n=(0,Z.c)(13),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,onPointerDown:i,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let s;n[4]===r?s=n[5]:(s=o(`max-h-48 overflow-auto text-sm opacity-90 whitespace-pre-wrap wrap-break-word select-text cursor-text`,r),n[4]=r,n[5]=s);let c;n[6]===i?c=n[7]:(c=e=>{e.stopPropagation(),i?.(e)},n[6]=i,n[7]=c);let l;return n[8]!==a||n[9]!==t||n[10]!==s||n[11]!==c?(l=(0,S.jsx)(be,{ref:t,className:s,onPointerDown:c,...a}),n[8]=a,n[9]=t,n[10]=s,n[11]=c,n[12]=l):l=n[12],l});$.displayName=be.displayName;export{Ce as a,$ as i,Oe as n,Ae as o,ke as r,we as s,De as t};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-DVplv7_D.js";import{t as n}from"./react-dom-_LrxgvjW.js";import{t as r}from"./compiler-runtime-BrajqUja.js";import{o as i}from"./useEventListener-CjDeLqFC.js";import{n as a,t as o}from"./cn-ldLVeaqm.js";import{t as s}from"./jsx-runtime-B74pBk57.js";import{C as c,E as l,S as u,T as d,b as f,f as p,g as m,m as h,v as g,w as _,x as v}from"./fullscreen-BWTs8pYZ.js";import{c as y}from"./dist-jlhMTKo_.js";import{d as b}from"./menu-items-BgUyNUpu.js";import{r as ee}from"./useNumberFormatter-D7O_26UI.js";var x=e(t(),1),te=e(n(),1),S=s(),C=Object.defineProperty,w=(e,t)=>C(e,`name`,{value:t,configurable:!0}),T=`ToastProvider`,[E,D,ne]=b(`Toast`),[O,k]=_(`Toast`,[ne]),[A,j]=O(T),M=w(e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,announcerContainer:o,children:s}=e,[c,l]=x.useState(null),[u,d]=x.useState(0),f=x.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${T}\`. Expected non-empty \`string\`.`),(0,S.jsx)(E.Provider,{scope:t,children:(0,S.jsx)(A,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:u,viewport:c,onViewportChange:l,onToastAdd:x.useCallback(()=>d(e=>e+1),[]),onToastRemove:x.useCallback(()=>d(e=>e-1),[]),isClosePausedRef:f,announcerContainer:o,children:s})})},`ToastProvider`),N=`ToastViewport`,P=[`F8`],F=`toast.viewportPause`,I=`toast.viewportResume`,L=x.forwardRef(w(function(e,t){let{__scopeToast:n,hotkey:r=P,label:a=`Notifications ({hotkey})`,...o}=e,s=j(N,n),c=D(n),l=x.useRef(null),u=x.useRef(null),f=x.useRef(null),p=x.useRef(null),m=i(t,p,s.onViewportChange),g=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),_=s.toastCount>0;x.useEffect(()=>{let e=w(e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&p.current?.focus()},`handleKeyDown`);return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),x.useEffect(()=>{let e=l.current,t=p.current;if(_&&e&&t){let n=w(()=>{if(!s.isClosePausedRef.current){let e=new CustomEvent(F);t.dispatchEvent(e),s.isClosePausedRef.current=!0}},`handlePause`),r=w(()=>{if(s.isClosePausedRef.current){let e=new CustomEvent(I);t.dispatchEvent(e),s.isClosePausedRef.current=!1}},`handleResume`),i=w(t=>{e.contains(t.relatedTarget)||r()},`handleFocusOutResume`),a=w(()=>{e.contains(document.activeElement)||r()},`handlePointerLeaveResume`);return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[_,s.isClosePausedRef]);let v=x.useCallback(({tabbingDirection:e})=>{let t=c().map(t=>{let n=t.ref.current,r=[n,...he(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[c]);return x.useEffect(()=>{let e=p.current;if(e){let t=w(t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){u.current?.focus();return}let i=v({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);X(i.slice(a+1))?t.preventDefault():r?u.current?.focus():f.current?.focus()}},`handleKeyDown`);return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[c,v]),(0,S.jsxs)(h,{ref:l,role:`region`,"aria-label":a.replace(`{hotkey}`,g),tabIndex:-1,style:{pointerEvents:_?void 0:`none`},children:[_&&(0,S.jsx)(z,{ref:u,onFocusFromOutsideViewport:()=>{X(v({tabbingDirection:`forwards`}))}}),(0,S.jsx)(E.Slot,{scope:n,children:(0,S.jsx)(d.ol,{tabIndex:-1,...o,ref:m})}),_&&(0,S.jsx)(z,{ref:f,onFocusFromOutsideViewport:()=>{X(v({tabbingDirection:`backwards`}))}})]})},`ToastViewport`)),R=`ToastFocusProxy`,z=x.forwardRef(w(function(e,t){let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=j(R,n);return(0,S.jsx)(y,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})},`ToastFocusProxy`)),B=`Toast`,re=`toast.swipeStart`,ie=`toast.swipeMove`,ae=`toast.swipeCancel`,oe=`toast.swipeEnd`,V=x.forwardRef(w(function(e,t){let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,l]=v({prop:r,defaultProp:i??!0,onChange:a,caller:B});return(0,S.jsx)(f,{present:n||s,children:(0,S.jsx)(ce,{open:s,...o,ref:t,onClose:()=>l(!1),onPause:g(e.onPause),onResume:g(e.onResume),onSwipeStart:c(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:c(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:c(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:c(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),l(!1)})})})},`Toast`)),[se,H]=O(B,{onClose(){}}),ce=x.forwardRef(w(function(e,t){let{__scopeToast:n,type:r=`foreground`,duration:a,open:o,onClose:s,onEscapeKeyDown:l,onPause:u,onResume:f,onSwipeStart:p,onSwipeMove:h,onSwipeCancel:_,onSwipeEnd:v,...y}=e,b=j(B,n),ee=D(n),[C,T]=x.useState(null),ne=i(t,T),O=x.useRef(null),k=x.useRef(null),A=a||b.duration,M=x.useRef(0),N=x.useRef(A),P=x.useRef(0),{onToastAdd:L,onToastRemove:R}=b,z=g(()=>{C?.contains(document.activeElement)&&b.viewport?.focus(),s()}),V=x.useCallback(e=>{!e||e===1/0||(window.clearTimeout(P.current),M.current=new Date().getTime(),P.current=window.setTimeout(z,e))},[z]);x.useEffect(()=>{let e=b.viewport;if(e){let t=w(()=>{V(N.current),f?.()},`handleResume`),n=w(()=>{let e=new Date().getTime()-M.current;N.current-=e,window.clearTimeout(P.current),u?.()},`handlePause`);return e.addEventListener(F,n),e.addEventListener(I,t),()=>{e.removeEventListener(F,n),e.removeEventListener(I,t)}}},[b.viewport,A,u,f,V]),x.useEffect(()=>{o&&!b.isClosePausedRef.current&&V(A)},[o,A,b.isClosePausedRef,V]),x.useEffect(()=>()=>{window.clearTimeout(P.current)},[]),x.useEffect(()=>(L(),()=>R()),[L,R]);let H=x.useMemo(()=>C?G(C):null,[C]);return b.viewport?(0,S.jsxs)(S.Fragment,{children:[H&&(0,S.jsx)(le,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:H}),(0,S.jsx)(se,{scope:n,onClose:z,children:te.createPortal((0,S.jsx)(E.ItemSlot,{scope:n,children:(0,S.jsx)(m,{asChild:!0,onEscapeKeyDown:c(l,e=>{ee().some(t=>t.ref.current?.contains(e.target))||z()}),children:(0,S.jsx)(d.li,{tabIndex:0,"data-state":o?`open`:`closed`,"data-swipe-direction":b.swipeDirection,...y,ref:ne,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:c(e.onKeyDown,e=>{e.key===`Escape`&&(l?.(e.nativeEvent),e.nativeEvent.defaultPrevented||z())}),onPointerDown:c(e.onPointerDown,e=>{e.button===0&&(O.current={x:e.clientX,y:e.clientY})}),onPointerMove:c(e.onPointerMove,e=>{if(!O.current)return;let t=e.clientX-O.current.x,n=e.clientY-O.current.y,r=!!k.current,i=[`left`,`right`].includes(b.swipeDirection),a=[`left`,`up`].includes(b.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},u={originalEvent:e,delta:l};r?(k.current=l,K(ie,h,u,{discrete:!1})):q(l,b.swipeDirection,c)?(k.current=l,K(re,p,u,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(O.current=null)}),onPointerUp:c(e.onPointerUp,e=>{let t=k.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),k.current=null,O.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};q(t,b.swipeDirection,b.swipeThreshold)?K(oe,v,r,{discrete:!0}):K(ae,_,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null},`ToastImpl`)),le=w(e=>{let{__scopeToast:t,children:n,...r}=e,i=j(B,t),[a,o]=x.useState(!1),[s,c]=x.useState(!1);return J(()=>o(!0)),x.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,S.jsx)(p,{asChild:!0,container:i.announcerContainer||void 0,children:(0,S.jsx)(y,{...r,children:a&&(0,S.jsxs)(S.Fragment,{children:[i.label,` `,n]})})})},`ToastAnnounce`),ue=x.forwardRef(w(function(e,t){let{__scopeToast:n,...r}=e;return(0,S.jsx)(d.div,{...r,ref:t})},`ToastTitle`)),de=x.forwardRef(w(function(e,t){let{__scopeToast:n,...r}=e;return(0,S.jsx)(d.div,{...r,ref:t})},`ToastDescription`)),fe=`ToastAction`,pe=x.forwardRef(w(function(e,t){let{altText:n,...r}=e;return n.trim()?(0,S.jsx)(W,{altText:n,asChild:!0,children:(0,S.jsx)(U,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${fe}\`. Expected non-empty \`string\`.`),null)},`ToastAction`)),me=`ToastClose`,U=x.forwardRef(w(function(e,t){let{__scopeToast:n,...r}=e,i=H(me,n);return(0,S.jsx)(W,{asChild:!0,children:(0,S.jsx)(d.button,{type:`button`,...r,ref:t,onClick:c(e.onClick,i.onClose)})})},`ToastClose`)),W=x.forwardRef(w(function(e,t){let{__scopeToast:n,altText:r,...i}=e;return(0,S.jsx)(d.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})},`ToastAnnounceExclude`));function G(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),Y(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n){if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...G(e))}}}),t}w(G,`getAnnounceTextContent`);function K(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?l(i,a):i.dispatchEvent(a)}w(K,`handleAndDispatchCustomEvent`);var q=w((e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n},`isDeltaInDirection`);function J(e=()=>{}){let t=g(e);u(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}w(J,`useNextFrame`);function Y(e){return e.nodeType===e.ELEMENT_NODE}w(Y,`isHTMLElement`);function he(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:w(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}w(he,`getTabbableCandidates`);function X(e){let t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}w(X,`focusFirst`);var ge=M,_e=L,ve=V,ye=ue,be=de,xe=pe,Se=U,Z=r(),Ce=ge,we=x.forwardRef((e,t)=>{let n=(0,Z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=o(`fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:w-fit md:max-w-[420px]`,`print:hidden`,r),n[3]=r,n[4]=a);let s;return n[5]!==i||n[6]!==t||n[7]!==a?(s=(0,S.jsx)(_e,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=s):s=n[8],s});we.displayName=_e.displayName;var Q={default:`bg-background border forced-colors:border-[CanvasText] forced-colors:bg-[Canvas] forced-colors:text-[CanvasText]`,danger:`group destructive text-error border-destructive bg-(--red-1) shadow-md-solid shadow-error forced-colors:border-[CanvasText] forced-colors:bg-[Canvas] forced-colors:text-[CanvasText]`},Te=a(`data-[swipe=move]:transition-none group relative pointer-events-auto flex w-full items-start justify-between gap-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=move]:translate-x-(--radix-toast-swipe-move-x) data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-(--radix-toast-swipe-end-x) data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=open]:slide-in-from-top-full sm:data-[state=open]:slide-in-from-bottom-full data-[state=closed]:slide-out-to-right-full forced-color-adjust-none`,{variants:{variant:Q},defaultVariants:{variant:`default`}});function Ee(e){return typeof e==`string`&&e in Q}var De=x.forwardRef((e,t)=>{let n=(0,Z.c)(11),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,variant:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let s=Ee(a)?a:`default`,c;n[4]!==r||n[5]!==s?(c=o(Te({variant:s}),`print:hidden`,r),n[4]=r,n[5]=s,n[6]=c):c=n[6];let l;return n[7]!==i||n[8]!==t||n[9]!==c?(l=(0,S.jsx)(ve,{ref:t,className:c,...i}),n[7]=i,n[8]=t,n[9]=c,n[10]=l):l=n[10],l});De.displayName=ve.displayName;var Oe=x.forwardRef((e,t)=>{let n=(0,Z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=o(`inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-destructive/30 hover:group-[.destructive]:border-destructive/30 hover:group-[.destructive]:bg-destructive hover:group-[.destructive]:text-destructive-foreground focus-visible:group-[.destructive]:ring-destructive`,`forced-color-adjust-none forced-colors:border-[ButtonText] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText] forced-colors:hover:bg-[Highlight] forced-colors:hover:text-[HighlightText] forced-colors:disabled:border-[GrayText] forced-colors:disabled:text-[GrayText]`,r),n[3]=r,n[4]=a);let s;return n[5]!==i||n[6]!==t||n[7]!==a?(s=(0,S.jsx)(xe,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=s):s=n[8],s});Oe.displayName=xe.displayName;var ke=x.forwardRef((e,t)=>{let n=(0,Z.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=o(`absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus-visible:outline-hidden focus-visible:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 hover:group-[.destructive]:text-red-500 focus-visible:group-[.destructive]:ring-red-400 focus-visible:group-[.destructive]:ring-offset-red-600`,`forced-colors:text-[CanvasText] forced-colors:hover:text-[CanvasText] forced-colors:group-[.destructive]:text-[CanvasText] forced-colors:hover:group-[.destructive]:text-[CanvasText]`,r),n[3]=r,n[4]=a);let s;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,S.jsx)(ee,{className:`h-4 w-4`}),n[5]=s):s=n[5];let c;return n[6]!==i||n[7]!==t||n[8]!==a?(c=(0,S.jsx)(Se,{ref:t,className:a,"toast-close":``,...i,children:s}),n[6]=i,n[7]=t,n[8]=a,n[9]=c):c=n[9],c});ke.displayName=Se.displayName;var Ae=x.forwardRef((e,t)=>{let n=(0,Z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=o(`text-sm font-semibold`,r),n[3]=r,n[4]=a);let s;return n[5]!==i||n[6]!==t||n[7]!==a?(s=(0,S.jsx)(ye,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=s):s=n[8],s});Ae.displayName=ye.displayName;var $=x.forwardRef((e,t)=>{let n=(0,Z.c)(13),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,onPointerDown:i,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let s;n[4]===r?s=n[5]:(s=o(`max-h-48 overflow-auto text-sm opacity-90 whitespace-pre-wrap wrap-break-word select-text cursor-text`,r),n[4]=r,n[5]=s);let c;n[6]===i?c=n[7]:(c=e=>{e.stopPropagation(),i?.(e)},n[6]=i,n[7]=c);let l;return n[8]!==a||n[9]!==t||n[10]!==s||n[11]!==c?(l=(0,S.jsx)(be,{ref:t,className:s,onPointerDown:c,...a}),n[8]=a,n[9]=t,n[10]=s,n[11]=c,n[12]=l):l=n[12],l});$.displayName=be.displayName;export{Ce as a,$ as i,Oe as n,Ae as o,ke as r,we as s,De as t};