@runeya/runeya 2.0.146 → 2.0.147
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.
- package/agent/index.js +10 -4
- package/agent/index.js.map +1 -1
- package/{agent-manager-R7BPQO6D.js → agent-manager-46C4NIQ2.js} +4 -2
- package/{chat-LPML22J5.js → chat-CMNDMXIP.js} +9 -5
- package/{chunk-SEPAURTQ.js → chunk-2NE52CL5.js} +156 -923
- package/chunk-2NE52CL5.js.map +1 -0
- package/chunk-4D3GCBPO.js +462 -0
- package/chunk-4D3GCBPO.js.map +1 -0
- package/{chunk-KV4GJKXU.js → chunk-5XG3X2TM.js} +27 -1479
- package/chunk-5XG3X2TM.js.map +1 -0
- package/chunk-7QXP4FXD.js +969 -0
- package/chunk-7QXP4FXD.js.map +1 -0
- package/chunk-DA2DZBTL.js +43 -0
- package/chunk-DA2DZBTL.js.map +1 -0
- package/chunk-DFPZ4MTI.js +1041 -0
- package/chunk-DFPZ4MTI.js.map +1 -0
- package/{chunk-UD42LACH.js → chunk-JNK6H5KH.js} +164 -1007
- package/chunk-JNK6H5KH.js.map +1 -0
- package/chunk-WDHLEO5S.js +809 -0
- package/chunk-WDHLEO5S.js.map +1 -0
- package/{companion-W3UMZWGH.js → companion-XKMNRIJB.js} +8 -3
- package/environment-resolver-ZDTF3MHI.js +18 -0
- package/environment-resolver-ZDTF3MHI.js.map +1 -0
- package/index.js +7 -7
- package/{install-gate-PVMGJDWE.js → install-gate-OJJEUU4E.js} +2 -2
- package/mcp-ready-TAPBAOZY.js +9 -0
- package/mcp-ready-TAPBAOZY.js.map +1 -0
- package/mcp-server/index.js +24 -0
- package/mcp-server/index.js.map +1 -1
- package/mcp-server/launch.d.ts +6 -0
- package/mcp-server/launch.js +2 -1
- package/mcp-server/launch.js.map +1 -1
- package/package.json +1 -1
- package/project-store-FLXTAD3J.js +23 -0
- package/project-store-FLXTAD3J.js.map +1 -0
- package/{src-LEDGW5KP.js → src-KWO3CKZU.js} +139 -59
- package/src-KWO3CKZU.js.map +1 -0
- package/web/assets/{AgentScalarChatInterface.vue-BYszptaB.js → AgentScalarChatInterface.vue-DKBinB_l.js} +2 -2
- package/web/assets/AgentTerminalPage-CixU7x6O.js +1 -0
- package/web/assets/AiChatModals-BvGUd-QD.css +1 -0
- package/web/assets/AiChatModals-C-hXImkO.js +4 -0
- package/web/assets/AppLayout-At9wk0sx.js +1 -0
- package/web/assets/{AppLayout-tsw5Ow0w.css → AppLayout-BlhwflMq.css} +1 -1
- package/web/assets/AuditPage-BkqbHxjY.js +1 -0
- package/web/assets/CloudAccountPage-D5C2SCS9.js +1 -0
- package/web/assets/CloudMessagingPage-Bi57GGHO.js +2 -0
- package/web/assets/DashboardPage-dEQop9ql.js +1 -0
- package/web/assets/DirectoryPickerDialog-DIMSeDhw.js +1 -0
- package/web/assets/{EditorIcon-CypGLV6w.js → EditorIcon-W3Szca4J.js} +1 -1
- package/web/assets/EnvironmentForm-C5emavNh.js +1 -0
- package/web/assets/EnvironmentFormPage-BIoy8fsW.js +1 -0
- package/web/assets/EnvironmentListPage-BDYeh7XF.js +1 -0
- package/web/assets/{FlagChip-R_T5qYpL.js → FlagChip-DPtIBCjQ.js} +1 -1
- package/web/assets/KanbanBoardPage-BlCcjBwV.js +4 -0
- package/web/assets/KanbanListPage-DbXONxfC.js +1 -0
- package/web/assets/LaunchProjectPage-Cg92hHwQ.js +1 -0
- package/web/assets/LaunchServicesPage-CO8gOB9D.js +1 -0
- package/web/assets/LaunchServicesPage-h5o3zLcy.css +1 -0
- package/web/assets/{LaunchShell-DUrSunB4.js → LaunchShell-CDb21ihZ.js} +1 -1
- package/web/assets/LogViewer-DsusKk2b.js +3 -0
- package/web/assets/OrgKeyPrompt-CX9K7r9I.js +1 -0
- package/web/assets/ProcessControls-B7hWVqiR.css +1 -0
- package/web/assets/ProcessControls-TEZutuxq.js +1 -0
- package/web/assets/ProcessDetailPage-Cj23FECq.js +1 -0
- package/web/assets/ProcessMetrics-1P6iE2Il.js +1 -0
- package/web/assets/ProjectCreateDialog-D3aMWKfw.js +1 -0
- package/web/assets/{ProjectLocationGate-DhMVdIjN.js → ProjectLocationGate-DU0Jj8Nw.js} +1 -1
- package/web/assets/ProjectPublishDialog-D7sNKei3.js +1 -0
- package/web/assets/{RandomJobTestPage-BUS2Ty6-.js → RandomJobTestPage-DQUMRHyf.js} +1 -1
- package/web/assets/{ScenarioEditorPage-vMoRt0Qn.css → ScenarioEditorPage-BSjSX4bw.css} +1 -1
- package/web/assets/ScenarioEditorPage-DvCdcY9m.js +14 -0
- package/web/assets/SendToChatDialog-BdWKjYmv.js +1 -0
- package/web/assets/ServiceControlsBar-B_J5m-Kc.js +1 -0
- package/web/assets/ServiceDetailPage-DhJcjFfY.js +2 -0
- package/web/assets/{ServiceDetailPage-COdaCZ6r.css → ServiceDetailPage-DnSf5cm9.css} +1 -1
- package/web/assets/ServiceFormPage-fp8NCHSv.js +1 -0
- package/web/assets/{SettingsPage-4pKUgKPm.css → SettingsPage-NH2fQap4.css} +1 -1
- package/web/assets/SettingsPage-s28BodWe.js +2086 -0
- package/web/assets/UnlockPage-BXXIPHW_.js +1 -0
- package/web/assets/VaultMigrationPage-BfNuKtkJ.js +1 -0
- package/web/assets/{VersionBadge-BmArk24p.js → VersionBadge-CW7czacg.js} +1 -1
- package/web/assets/{WikiPage-DADu8WUA.js → WikiPage-BiwpCM3E.js} +1 -1
- package/web/assets/WikiView-CMch_06Z.js +1 -0
- package/web/assets/{add-scalar-classes-dWEWPlFD.js → add-scalar-classes-Ckanjq1h.js} +14 -14
- package/web/assets/{agent.store-CKLAkF9a.js → agent.store-piokQ9Dt.js} +1 -1
- package/web/assets/{auth-Cg9BWTfK.js → auth-BT_jf-5e.js} +2 -2
- package/web/assets/cloud-chat.store-CDKh4tIy.js +1 -0
- package/web/assets/{cloud-client-D_zCiW0s.js → cloud-client-CzPdZLDq.js} +2 -2
- package/web/assets/{cloud-session-DOaDpZTy.js → cloud-session-BYfn6YM4.js} +2 -2
- package/web/assets/floating-ui.dom-DF3oyfHd.js +1 -0
- package/web/assets/i18n-D0FT7rCj.js +1 -0
- package/web/assets/index-3LTzgeU-.css +1 -0
- package/web/assets/index-Ci2CNnit.js +309 -0
- package/web/assets/modal-iRaP1izE.js +5 -0
- package/web/assets/notification.store-CvvuTBVz.js +1 -0
- package/web/assets/{project-launch.store-y7JBMNiE.js → project-launch.store-CTmbl8UY.js} +1 -1
- package/web/assets/{project.store-DGJr0Qr9.js → project.store-CNC6_4r4.js} +1 -1
- package/web/assets/runtime-dom.esm-bundler-CyEVRK6B.js +1 -0
- package/web/assets/scenario.store-BIFQPXgl.js +7 -0
- package/web/assets/{service.store-5jWsJxPx.js → service.store-B40U4QzI.js} +1 -1
- package/web/assets/settings-scope-CyWMCjRY.js +1 -0
- package/web/assets/settings.store-Dw6bAoWE.js +1 -0
- package/web/assets/{src-Dnwk6NpV.js → src-CrNi4Pjg.js} +3 -3
- package/web/assets/src-DIBHat7I.js +3 -0
- package/web/assets/src-DtCW_XCh.js +1 -0
- package/web/assets/{trpc-Drabzwpd.js → trpc-BAZGRZBD.js} +3 -3
- package/web/assets/{useCloudOrg-BAQEtFPl.js → useCloudOrg-EnXFBwt1.js} +1 -1
- package/web/assets/useEnvVarAutocomplete-BxJh2Lw0.js +1 -0
- package/web/assets/useProjectCatalog-BrvUGv9A.js +1 -0
- package/web/assets/{useProjectCloudOrg-CEN9-_OA.js → useProjectCloudOrg-Czxlg00k.js} +1 -1
- package/web/assets/{useServiceUrlHost-BuoPEXZX.js → useServiceUrlHost-Szz9y3rh.js} +1 -1
- package/web/assets/vue-i18n-o7yraQpR.js +3 -0
- package/web/index.html +21 -21
- package/chunk-KV4GJKXU.js.map +0 -1
- package/chunk-SEPAURTQ.js.map +0 -1
- package/chunk-UD42LACH.js.map +0 -1
- package/src-LEDGW5KP.js.map +0 -1
- package/web/assets/AgentTerminalPage-C3TJ1NL9.js +0 -1
- package/web/assets/AiChatModals-D3scRE3S.js +0 -4
- package/web/assets/AiChatModals-EfRuvId7.css +0 -1
- package/web/assets/AppLayout-BMQUjPKe.js +0 -1
- package/web/assets/AuditPage-CKcExBws.js +0 -1
- package/web/assets/CloudAccountPage-B6oPg0BZ.js +0 -1
- package/web/assets/CloudMessagingPage-C5fwVe-F.js +0 -2
- package/web/assets/DashboardPage-9RV7sx3e.js +0 -1
- package/web/assets/DirectoryPickerDialog-C06BXyfJ.js +0 -1
- package/web/assets/EnvironmentForm-CAvDoira.js +0 -1
- package/web/assets/EnvironmentFormPage-BmAxhN-m.js +0 -1
- package/web/assets/EnvironmentListPage-B8uATPBI.js +0 -1
- package/web/assets/KanbanBoardPage-CQsOkRUf.js +0 -4
- package/web/assets/KanbanListPage-CWZqkjD6.js +0 -1
- package/web/assets/LaunchProjectPage-saSmC7Pr.js +0 -1
- package/web/assets/LaunchServicesPage-BkKyLMEz.js +0 -1
- package/web/assets/LaunchServicesPage-DoLDPqQq.css +0 -1
- package/web/assets/LogViewer-CZBYkH9J.js +0 -3
- package/web/assets/OrgKeyPrompt-DzQ7pwbs.js +0 -1
- package/web/assets/ProcessControls-BEeoNlNV.js +0 -1
- package/web/assets/ProcessControls-BlpnVylq.css +0 -1
- package/web/assets/ProcessDetailPage-CQgu5uKm.js +0 -1
- package/web/assets/ProcessMetrics-Crlfkelj.js +0 -1
- package/web/assets/ProjectCreateDialog-BolrhRD-.js +0 -1
- package/web/assets/ProjectPublishDialog-DsZNWrfz.js +0 -1
- package/web/assets/ScenarioEditorPage-MIAGh2us.js +0 -14
- package/web/assets/SendToChatDialog-BxWsyv29.js +0 -1
- package/web/assets/ServiceControlsBar-DqDPAZt7.js +0 -1
- package/web/assets/ServiceDetailPage-hkSAzZ-l.js +0 -2
- package/web/assets/ServiceFormPage-DXqhqXg8.js +0 -1
- package/web/assets/SettingsPage-DS2YhMIM.js +0 -2086
- package/web/assets/UnlockPage-s8SgVcKk.js +0 -1
- package/web/assets/VaultMigrationPage-s0b44MDM.js +0 -1
- package/web/assets/WikiView-DtGwIt_Q.js +0 -1
- package/web/assets/cloud-chat.store-b-BHGz7I.js +0 -1
- package/web/assets/editor.store-DCAZSeVG.js +0 -1
- package/web/assets/floating-ui.dom-DWhsZyqT.js +0 -1
- package/web/assets/i18n-D0afQEGs.js +0 -1
- package/web/assets/index-D8VRbyoP.js +0 -309
- package/web/assets/index-DsezNbSM.css +0 -1
- package/web/assets/modal-qYgTMkYb.js +0 -5
- package/web/assets/scenario.store-YWHL2_wu.js +0 -7
- package/web/assets/settings-scope-Bv7QGPrt.js +0 -1
- package/web/assets/settings.store-bEsB7oKb.js +0 -1
- package/web/assets/src--GO-VSJ0.js +0 -5
- package/web/assets/src-C-D_y7ou.js +0 -1
- package/web/assets/useEnvVarAutocomplete-BqGTODUv.js +0 -1
- package/web/assets/useProjectCatalog-yocjIKt6.js +0 -1
- package/web/assets/vue-draggable-plus-BHsveB8w.css +0 -1
- package/web/assets/vue-draggable-plus-DX4rTBiu.js +0 -1
- /package/{agent-manager-R7BPQO6D.js.map → agent-manager-46C4NIQ2.js.map} +0 -0
- /package/{chat-LPML22J5.js.map → chat-CMNDMXIP.js.map} +0 -0
- /package/{companion-W3UMZWGH.js.map → companion-XKMNRIJB.js.map} +0 -0
- /package/{install-gate-PVMGJDWE.js.map → install-gate-OJJEUU4E.js.map} +0 -0
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/UnlockPage-BXXIPHW_.js","assets/reactivity.esm-bundler-BQ9SB2vv.js","assets/runtime-core.esm-bundler-DujKY9QV.js","assets/runtime-dom.esm-bundler-CyEVRK6B.js","assets/vue-i18n-o7yraQpR.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/useApi-s_02lHjl-DZYO2tHU.js","assets/src-DIBHat7I.js","assets/floating-ui.dom-DF3oyfHd.js","assets/src-CcvmgMAA.css","assets/trpc-BAZGRZBD.js","assets/preload-helper-BZ1Pz5am.js","assets/auth-BT_jf-5e.js","assets/notification.store-CvvuTBVz.js","assets/project-launch.store-CTmbl8UY.js","assets/settings-scope-CyWMCjRY.js","assets/project.store-CNC6_4r4.js","assets/error-DpF7X5iu.js","assets/VersionBadge-CW7czacg.js","assets/VersionBadge-CtFji3sv.css","assets/UnlockPage-Ce0qsHfn.css","assets/VaultMigrationPage-BfNuKtkJ.js","assets/VaultMigrationPage-DMiPJOSR.css","assets/LaunchProjectPage-Cg92hHwQ.js","assets/useProjectCatalog-BrvUGv9A.js","assets/cloud-auth-D_am4FlK.js","assets/cloud-session-BYfn6YM4.js","assets/cloud-client-CzPdZLDq.js","assets/OrgKeyPrompt-CX9K7r9I.js","assets/OrgKeyPrompt-FmlWgsj4.css","assets/DirectoryPickerDialog-DIMSeDhw.js","assets/DirectoryPickerDialog-3lnhU2DU.css","assets/ProjectCreateDialog-D3aMWKfw.js","assets/ProjectCreateDialog-BfY7qA0G.css","assets/LaunchShell-CDb21ihZ.js","assets/LaunchShell-y_3rrtGa.css","assets/LaunchProjectPage-CyKA9pY5.css","assets/LaunchServicesPage-CO8gOB9D.js","assets/app-mode-BVpTuh0i.js","assets/service.store-B40U4QzI.js","assets/agent.store-piokQ9Dt.js","assets/dist-N4nrnbnA.js","assets/schemas-68I2iCLF.js","assets/process-BWkHpZOM.js","assets/ProjectLocationGate-DU0Jj8Nw.js","assets/LaunchServicesPage-h5o3zLcy.css","assets/AppLayout-At9wk0sx.js","assets/i18n-D0FT7rCj.js","assets/vue-router-fin80h5W.js","assets/composables-DiiOYol8.js","assets/use-polling-CEkhIY_9.js","assets/useAiChatDrawer-D_ofn8Eo.js","assets/cloud-chat.store-CDKh4tIy.js","assets/shared-sse-Dcj_cNvF.js","assets/src-DtCW_XCh.js","assets/src-16-vEwhK.css","assets/page-actions-CSvO7j9F.js","assets/EditorIcon-W3Szca4J.js","assets/EditorIcon-84kLQJ1r.css","assets/useServiceUrlHost-Szz9y3rh.js","assets/ServiceControlsBar-B_J5m-Kc.js","assets/ProcessControls-TEZutuxq.js","assets/ProcessControls-B7hWVqiR.css","assets/ServiceControlsBar-CRwt-Xry.css","assets/ProjectPublishDialog-D7sNKei3.js","assets/ProjectPublishDialog-Cd-9yn6d.css","assets/AppLayout-BlhwflMq.css","assets/DashboardPage-dEQop9ql.js","assets/DashboardPage-FvNuC_e4.css","assets/CloudAccountPage-D5C2SCS9.js","assets/CloudAccountPage-Ctf2gtpm.css","assets/CloudMessagingPage-Bi57GGHO.js","assets/scenario.store-BIFQPXgl.js","assets/scenario-DOeZsRCE.css","assets/AiChatModals-C-hXImkO.js","assets/editor.api-Bef3xeth.js","assets/editor-8AbsNvUX.css","assets/toggleHighContrast-Dqz1Qao1.js","assets/toggleHighContrast--ixms01u.css","assets/register-BLGIM2pN.js","assets/AiChatModals-BvGUd-QD.css","assets/useCloudOrg-EnXFBwt1.js","assets/useProjectCloudOrg-Czxlg00k.js","assets/CloudMessagingPage-Cn3JhJsY.css","assets/KanbanListPage-DbXONxfC.js","assets/src-CrNi4Pjg.js","assets/src-g1DRo8xZ.css","assets/KanbanListPage-BigioApQ.css","assets/KanbanBoardPage-BlCcjBwV.js","assets/SendToChatDialog-BdWKjYmv.js","assets/KanbanBoardPage-eHmsrFGA.css","assets/AgentTerminalPage-CixU7x6O.js","assets/uuid-XipkJWQw.js","assets/AgentTerminalPage-DbPtGy0f.css","assets/AuditPage-BkqbHxjY.js","assets/AuditPage-DRnnuzwq.css","assets/SettingsPage-s28BodWe.js","assets/FlagChip-DPtIBCjQ.js","assets/FlagChip-hKL2frzh.css","assets/LogViewer-DsusKk2b.js","assets/LogViewer-OHdSLleq.css","assets/settings.store-Dw6bAoWE.js","assets/add-scalar-classes-Ckanjq1h.js","assets/interface-content-folder.svg-CnsmgXBU.js","assets/browser-BpWB_ayN.js","assets/SettingsPage-NH2fQap4.css","assets/ScenarioEditorPage-DvCdcY9m.js","assets/ScenarioEditorPage-BSjSX4bw.css","assets/ServiceFormPage-fp8NCHSv.js","assets/ServiceFormPage-CQ6xL0Rr.css","assets/ServiceDetailPage-DhJcjFfY.js","assets/useEnvVarAutocomplete-BxJh2Lw0.js","assets/useEnvVarAutocomplete-Czt8ZZ1E.css","assets/ProcessMetrics-1P6iE2Il.js","assets/ProcessMetrics-kCY31aHV.css","assets/WikiView-CMch_06Z.js","assets/WikiView-CGsHxjvn.css","assets/ServiceDetailPage-DnSf5cm9.css","assets/EnvironmentListPage-BDYeh7XF.js","assets/EnvironmentForm-C5emavNh.js","assets/EnvironmentForm-CkKVSiT7.css","assets/EnvironmentListPage-BKhq_xXN.css","assets/EnvironmentFormPage-BIoy8fsW.js","assets/EnvironmentFormPage-C1gS0BI_.css","assets/ProcessDetailPage-Cj23FECq.js","assets/ProcessDetailPage-CJcIxbLm.css","assets/WikiPage-BiwpCM3E.js","assets/RandomJobTestPage-DQUMRHyf.js","assets/RandomJobTestPage-ES23jzac.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e,n as t,t as n}from"./rolldown-runtime-Dd_uD5pT.js";import{B as r,C as i,F as a,N as o,O as s,P as c,S as l,_ as u,c as d,g as f,l as p,m,o as h,x as g}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{$ as _,B as v,Ct as y,D as b,E as x,Ft as S,Ht as C,J as w,L as T,Lt as E,Nt as D,S as O,St as k,Ut as A,Y as j,Yt as M,_ as N,b as P,bt as F,ct as I,en as L,et as R,ft as ee,g as z,gt as te,it as ne,k as B,mt as V,nn as re,o as H,pt as ie,qt as U,rn as W,rt as ae,st as oe,tn as se,tt as ce,u as le,v as G,wt as ue,xt as de,y as K,z as fe}from"./runtime-core.esm-bundler-DujKY9QV.js";import{C as pe,S as me,i as he,t as ge,w as _e}from"./runtime-dom.esm-bundler-CyEVRK6B.js";import{n as ve}from"./vue-i18n-o7yraQpR.js";import{a as ye,i as be,n as xe,r as Se}from"./project-launch.store-CTmbl8UY.js";import{r as Ce}from"./i18n-D0FT7rCj.js";import{g as we,h as Te}from"./useApi-s_02lHjl-DZYO2tHU.js";import{i as Ee,n as De,r as Oe}from"./vue-router-fin80h5W.js";import{$ as ke,A as Ae,C as je,H as Me,J as Ne,L as Pe,M as Fe,N as Ie,P as Le,Q as Re,S as ze,U as Be,W as Ve,X as He,Y as Ue,at as We,ct as Ge,d as Ke,dt as q,et as qe,ft as Je,it as Ye,lt as Xe,nt as Ze,o as Qe,ot as $e,q as et,rt as tt,st as nt,t as rt,tt as it,u as at,ut as ot}from"./src-DIBHat7I.js";import{a as st,i as ct,n as lt,r as ut,t as dt}from"./scenario.store-BIFQPXgl.js";import{a as ft,i as pt,n as mt,r as ht,t as gt}from"./app-mode-BVpTuh0i.js";import{n as _t,o as vt,r as J,t as yt}from"./trpc-BAZGRZBD.js";import{t as bt}from"./preload-helper-BZ1Pz5am.js";import{c as xt,i as St,n as Ct,r as wt,s as Tt}from"./auth-BT_jf-5e.js";import{n as Et,r as Dt}from"./project.store-CNC6_4r4.js";import{a as Ot}from"./cloud-auth-D_am4FlK.js";import{i as kt,n as At,r as jt,t as Mt}from"./useProjectCatalog-BrvUGv9A.js";import{n as Nt,r as Pt}from"./error-DpF7X5iu.js";import{n as Ft,r as It}from"./cloud-client-CzPdZLDq.js";import{t as Lt}from"./use-polling-CEkhIY_9.js";import{o as Rt}from"./editor.api-Bef3xeth.js";import{i as zt,r as Bt,t as Vt}from"./AiChatModals-C-hXImkO.js";import{t as Ht}from"./useAiChatDrawer-D_ofn8Eo.js";import{g as Ut,n as Wt}from"./schemas-68I2iCLF.js";import{a as Gt,n as Kt,r as qt}from"./dist-N4nrnbnA.js";import{t as Jt}from"./service.store-B40U4QzI.js";import{t as Yt}from"./notification.store-CvvuTBVz.js";import{t as Xt}from"./agent.store-piokQ9Dt.js";import{n as Zt}from"./process-BWkHpZOM.js";import{a as Qt,c as $t,d as en,f as tn,i as nn,l as rn,n as an,o as on,p as sn,r as cn,s as ln,t as un,u as dn}from"./theme-BZCAxfJD.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var fn=n((e=>{e.byteLength=c,e.toByteArray=u,e.fromByteArray=p;for(var t=[],n=[],r=typeof Uint8Array<`u`?Uint8Array:Array,i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,a=0,o=i.length;a<o;++a)t[a]=i[a],n[i.charCodeAt(a)]=a;n[45]=62,n[95]=63;function s(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function c(e){var t=s(e),n=t[0],r=t[1];return(n+r)*3/4-r}function l(e,t,n){return(t+n)*3/4-n}function u(e){for(var t,i=s(e),a=i[0],o=i[1],c=new r(l(e,a,o)),u=0,d=o>0?a-4:a,f=0;f<d;f+=4)t=n[e.charCodeAt(f)]<<18|n[e.charCodeAt(f+1)]<<12|n[e.charCodeAt(f+2)]<<6|n[e.charCodeAt(f+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=t&255;return o===2&&(t=n[e.charCodeAt(f)]<<2|n[e.charCodeAt(f+1)]>>4,c[u++]=t&255),o===1&&(t=n[e.charCodeAt(f)]<<10|n[e.charCodeAt(f+1)]<<4|n[e.charCodeAt(f+2)]>>2,c[u++]=t>>8&255,c[u++]=t&255),c}function d(e){return t[e>>18&63]+t[e>>12&63]+t[e>>6&63]+t[e&63]}function f(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(d(r));return i.join(``)}function p(e){for(var n,r=e.length,i=r%3,a=[],o=16383,s=0,c=r-i;s<c;s+=o)a.push(f(e,s,s+o>c?c:s+o));return i===1?(n=e[r-1],a.push(t[n>>2]+t[n<<4&63]+`==`)):i===2&&(n=(e[r-2]<<8)+e[r-1],a.push(t[n>>10]+t[n>>4&63]+t[n<<2&63]+`=`)),a.join(``)}})),pn=n((e=>{e.read=function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=a*256+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else if(a===c)return o?NaN:(p?-1:1)*(1/0);else o+=2**r,a-=l;return(p?-1:1)*o*2**(a-r)},e.write=function(e,t,n,r,i,a){var o,s,c,l=a*8-i-1,u=(1<<l)-1,d=u>>1,f=i===23?2**-24-2**-77:0,p=r?0:a-1,m=r?1:-1,h=+(t<0||t===0&&1/t<0);for(t=Math.abs(t),isNaN(t)||t===1/0?(s=+!!isNaN(t),o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=2**-o)<1&&(o--,c*=2),o+d>=1?t+=f/c:t+=f*2**(1-d),t*c>=2&&(o++,c/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*c-1)*2**i,o+=d):(s=t*2**(d-1)*2**i,o=0));i>=8;e[n+p]=s&255,p+=m,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+p]=o&255,p+=m,o/=256,l-=8);e[n+p-m]|=h*128}})),mn=n((e=>{var t=fn(),n=pn(),r=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`nodejs.util.inspect.custom`):null;e.Buffer=s,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50;var i=2147483647;e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=a(),!s.TYPED_ARRAY_SUPPORT&&typeof console<`u`&&typeof console.error==`function`&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(e){if(e>i)throw RangeError(`The value "`+e+`" is invalid for option "size"`);let t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,n){if(typeof e==`number`){if(typeof t==`string`)throw TypeError(`The "string" argument must be of type string. Received type number`);return d(e)}return c(e,t,n)}s.poolSize=8192;function c(e,t,n){if(typeof e==`string`)return f(e,t);if(ArrayBuffer.isView(e))return m(e);if(e==null)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e);if(K(e,ArrayBuffer)||e&&K(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<`u`&&(K(e,SharedArrayBuffer)||e&&K(e.buffer,SharedArrayBuffer)))return h(e,t,n);if(typeof e==`number`)throw TypeError(`The "value" argument must not be of type number. Received type number`);let r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return s.from(r,t,n);let i=g(e);if(i)return i;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==`function`)return s.from(e[Symbol.toPrimitive](`string`),t,n);throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e)}s.from=function(e,t,n){return c(e,t,n)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function l(e){if(typeof e!=`number`)throw TypeError(`"size" argument must be of type number`);if(e<0)throw RangeError(`The value "`+e+`" is invalid for option "size"`)}function u(e,t,n){return l(e),e<=0||t===void 0?o(e):typeof n==`string`?o(e).fill(t,n):o(e).fill(t)}s.alloc=function(e,t,n){return u(e,t,n)};function d(e){return l(e),o(e<0?0:_(e)|0)}s.allocUnsafe=function(e){return d(e)},s.allocUnsafeSlow=function(e){return d(e)};function f(e,t){if((typeof t!=`string`||t===``)&&(t=`utf8`),!s.isEncoding(t))throw TypeError(`Unknown encoding: `+t);let n=y(e,t)|0,r=o(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function p(e){let t=e.length<0?0:_(e.length)|0,n=o(t);for(let r=0;r<t;r+=1)n[r]=e[r]&255;return n}function m(e){if(K(e,Uint8Array)){let t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return p(e)}function h(e,t,n){if(t<0||e.byteLength<t)throw RangeError(`"offset" is outside of buffer bounds`);if(e.byteLength<t+(n||0))throw RangeError(`"length" is outside of buffer bounds`);let r;return r=t===void 0&&n===void 0?new Uint8Array(e):n===void 0?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,s.prototype),r}function g(e){if(s.isBuffer(e)){let t=_(e.length)|0,n=o(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!=`number`||fe(e.length)?o(0):p(e);if(e.type===`Buffer`&&Array.isArray(e.data))return p(e.data)}function _(e){if(e>=i)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+i.toString(16)+` bytes`);return e|0}function v(e){return+e!=e&&(e=0),s.alloc(+e)}s.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==s.prototype},s.compare=function(e,t){if(K(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),K(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:+(r<n)},s.isEncoding=function(e){switch(String(e).toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`latin1`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return s.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;let r=s.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){let t=e[n];if(K(t,Uint8Array))i+t.length>r.length?(s.isBuffer(t)||(t=s.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else if(s.isBuffer(t))t.copy(r,i);else throw TypeError(`"list" argument must be an Array of Buffers`);i+=t.length}return r};function y(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if(typeof e!=`string`)throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+typeof e);let n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let i=!1;for(;;)switch(t){case`ascii`:case`latin1`:case`binary`:return n;case`utf8`:case`utf-8`:return ce(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return n*2;case`hex`:return n>>>1;case`base64`:return ue(e).length;default:if(i)return r?-1:ce(e).length;t=(``+t).toLowerCase(),i=!0}}s.byteLength=y;function b(e,t,n){let r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return``;for(e||=`utf8`;;)switch(e){case`hex`:return F(this,t,n);case`utf8`:case`utf-8`:return A(this,t,n);case`ascii`:return N(this,t,n);case`latin1`:case`binary`:return P(this,t,n);case`base64`:return k(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return I(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}s.prototype._isBuffer=!0;function x(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}s.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(let t=0;t<e;t+=2)x(this,t,t+1);return this},s.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(let t=0;t<e;t+=4)x(this,t,t+3),x(this,t+1,t+2);return this},s.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(let t=0;t<e;t+=8)x(this,t,t+7),x(this,t+1,t+6),x(this,t+2,t+5),x(this,t+3,t+4);return this},s.prototype.toString=function(){let e=this.length;return e===0?``:arguments.length===0?A(this,0,e):b.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError(`Argument must be a Buffer`);return this===e||s.compare(this,e)===0},s.prototype.inspect=function(){let t=``,n=e.INSPECT_MAX_BYTES;return t=this.toString(`hex`,0,n).replace(/(.{2})/g,`$1 `).trim(),this.length>n&&(t+=` ... `),`<Buffer `+t+`>`},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(e,t,n,r,i){if(K(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError(`out of range index`);if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;let a=i-r,o=n-t,c=Math.min(a,o),l=this.slice(r,i),u=e.slice(t,n);for(let e=0;e<c;++e)if(l[e]!==u[e]){a=l[e],o=u[e];break}return a<o?-1:+(o<a)};function S(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==`string`?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,fe(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(i)n=0;else return-1}if(typeof t==`string`&&(t=s.from(t,r)),s.isBuffer(t))return t.length===0?-1:C(e,t,n,r,i);if(typeof t==`number`)return t&=255,typeof Uint8Array.prototype.indexOf==`function`?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):C(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function C(e,t,n,r,i){let a=1,o=e.length,s=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,n/=2}function c(e,t){return a===1?e[t]:e.readUInt16BE(t*a)}let l;if(i){let r=-1;for(l=n;l<o;l++)if(c(e,l)===c(t,r===-1?0:l-r)){if(r===-1&&(r=l),l-r+1===s)return r*a}else r!==-1&&(l-=l-r),r=-1}else for(n+s>o&&(n=o-s),l=n;l>=0;l--){let n=!0;for(let r=0;r<s;r++)if(c(e,l+r)!==c(t,r)){n=!1;break}if(n)return l}return-1}s.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},s.prototype.indexOf=function(e,t,n){return S(this,e,t,n,!0)},s.prototype.lastIndexOf=function(e,t,n){return S(this,e,t,n,!1)};function w(e,t,n,r){n=Number(n)||0;let i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;let a=t.length;r>a/2&&(r=a/2);let o=0;for(;o<r;++o){let r=parseInt(t.substr(o*2,2),16);if(fe(r))return o;e[n+o]=r}return o}function T(e,t,n,r){return de(ce(t,e.length-n),e,n,r)}function E(e,t,n,r){return de(le(t),e,n,r)}function D(e,t,n,r){return de(ue(t),e,n,r)}function O(e,t,n,r){return de(G(t,e.length-n),e,n,r)}s.prototype.write=function(e,t,n,r){if(t===void 0)r=`utf8`,n=this.length,t=0;else if(n===void 0&&typeof t==`string`)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0);else throw Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);let i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError(`Attempt to write outside buffer bounds`);r||=`utf8`;let a=!1;for(;;)switch(r){case`hex`:return w(this,e,t,n);case`utf8`:case`utf-8`:return T(this,e,t,n);case`ascii`:case`latin1`:case`binary`:return E(this,e,t,n);case`base64`:return D(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return O(this,e,t,n);default:if(a)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function k(e,n,r){return n===0&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function A(e,t,n){n=Math.min(e.length,n);let r=[],i=t;for(;i<n;){let t=e[i],a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=n){let n,r,s,c;switch(o){case 1:t<128&&(a=t);break;case 2:n=e[i+1],(n&192)==128&&(c=(t&31)<<6|n&63,c>127&&(a=c));break;case 3:n=e[i+1],r=e[i+2],(n&192)==128&&(r&192)==128&&(c=(t&15)<<12|(n&63)<<6|r&63,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],(n&192)==128&&(r&192)==128&&(s&192)==128&&(c=(t&15)<<18|(n&63)<<12|(r&63)<<6|s&63,c>65535&&c<1114112&&(a=c))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),i+=o}return M(r)}var j=4096;function M(e){let t=e.length;if(t<=j)return String.fromCharCode.apply(String,e);let n=``,r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=j));return n}function N(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function P(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function F(e,t,n){let r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i=``;for(let r=t;r<n;++r)i+=pe[e[r]];return i}function I(e,t,n){let r=e.slice(t,n),i=``;for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+r[e+1]*256);return i}s.prototype.slice=function(e,t){let n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);let r=this.subarray(e,t);return Object.setPrototypeOf(r,s.prototype),r};function L(e,t,n){if(e%1!=0||e<0)throw RangeError(`offset is not uint`);if(e+t>n)throw RangeError(`Trying to access beyond buffer length`)}s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return r},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=me(function(e){e>>>=0,W(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ae(e,this.length-8);let r=t+this[++e]*256+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*256+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),s.prototype.readBigUInt64BE=me(function(e){e>>>=0,W(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ae(e,this.length-8);let r=t*2**24+this[++e]*2**16+this[++e]*256+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*256+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=2**(8*t)),r},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=t,i=1,a=this[e+--r];for(;r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=2**(8*t)),a},s.prototype.readInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||L(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},s.prototype.readInt16BE=function(e,t){e>>>=0,t||L(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=me(function(e){e>>>=0,W(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ae(e,this.length-8);let r=this[e+4]+this[e+5]*256+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+this[++e]*256+this[++e]*2**16+this[++e]*2**24)}),s.prototype.readBigInt64BE=me(function(e){e>>>=0,W(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ae(e,this.length-8);let r=(t<<24)+this[++e]*2**16+this[++e]*256+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*256+n)}),s.prototype.readFloatLE=function(e,t){return e>>>=0,t||L(e,4,this.length),n.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||L(e,4,this.length),n.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||L(e,8,this.length),n.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||L(e,8,this.length),n.read(this,e,!1,52,8)};function R(e,t,n,r,i,a){if(!s.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||t<a)throw RangeError(`"value" argument is out of bounds`);if(n+r>e.length)throw RangeError(`Index out of range`)}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;R(this,e,t,n,r,0)}let i=1,a=0;for(this[t]=e&255;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;R(this,e,t,n,r,0)}let i=n-1,a=1;for(this[t+i]=e&255;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,1,255,0),this[t]=e&255,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function ee(e,t,n,r,i){U(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function z(e,t,n,r,i){U(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}s.prototype.writeBigUInt64LE=me(function(e,t=0){return ee(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeBigUInt64BE=me(function(e,t=0){return z(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);R(this,e,t,n,r-1,-r)}let i=0,a=1,o=0;for(this[t]=e&255;++i<n&&(a*=256);)e<0&&o===0&&this[t+i-1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);R(this,e,t,n,r-1,-r)}let i=n-1,a=1,o=0;for(this[t+i]=e&255;--i>=0&&(a*=256);)e<0&&o===0&&this[t+i+1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},s.prototype.writeBigInt64LE=me(function(e,t=0){return ee(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))}),s.prototype.writeBigInt64BE=me(function(e,t=0){return z(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))});function te(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function ne(e,t,r,i,a){return t=+t,r>>>=0,a||te(e,t,r,4,34028234663852886e22,-34028234663852886e22),n.write(e,t,r,i,23,4),r+4}s.prototype.writeFloatLE=function(e,t,n){return ne(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return ne(this,e,t,!1,n)};function B(e,t,r,i,a){return t=+t,r>>>=0,a||te(e,t,r,8,17976931348623157e292,-17976931348623157e292),n.write(e,t,r,i,52,8),r+8}s.prototype.writeDoubleLE=function(e,t,n){return B(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return B(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(!s.isBuffer(e))throw TypeError(`argument should be a Buffer`);if(n||=0,!r&&r!==0&&(r=this.length),t>=e.length&&(t=e.length),t||=0,r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw RangeError(`targetStart out of bounds`);if(n<0||n>=this.length)throw RangeError(`Index out of range`);if(r<0)throw RangeError(`sourceEnd out of bounds`);r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);let i=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin==`function`?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},s.prototype.fill=function(e,t,n,r){if(typeof e==`string`){if(typeof t==`string`?(r=t,t=0,n=this.length):typeof n==`string`&&(r=n,n=this.length),r!==void 0&&typeof r!=`string`)throw TypeError(`encoding must be a string`);if(typeof r==`string`&&!s.isEncoding(r))throw TypeError(`Unknown encoding: `+r);if(e.length===1){let t=e.charCodeAt(0);(r===`utf8`&&t<128||r===`latin1`)&&(e=t)}}else typeof e==`number`?e&=255:typeof e==`boolean`&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError(`Out of range index`);if(n<=t)return this;t>>>=0,n=n===void 0?this.length:n>>>0,e||=0;let i;if(typeof e==`number`)for(i=t;i<n;++i)this[i]=e;else{let a=s.isBuffer(e)?e:s.from(e,r),o=a.length;if(o===0)throw TypeError(`The value "`+e+`" is invalid for argument "value"`);for(i=0;i<n-t;++i)this[i+t]=a[i%o]}return this};var V={};function re(e,t,n){V[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}re(`ERR_BUFFER_OUT_OF_BOUNDS`,function(e){return e?`${e} is outside of buffer bounds`:`Attempt to access memory outside buffer bounds`},RangeError),re(`ERR_INVALID_ARG_TYPE`,function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),re(`ERR_OUT_OF_RANGE`,function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=H(String(n)):typeof n==`bigint`&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=H(i)),i+=`n`),r+=` It must be ${t}. Received ${i}`,r},RangeError);function H(e){let t=``,n=e.length,r=+(e[0]===`-`);for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function ie(e,t,n){W(t,`offset`),(e[t]===void 0||e[t+n]===void 0)&&ae(t,e.length-(n+1))}function U(e,t,n,r,i,a){if(e>n||e<t){let r=typeof t==`bigint`?`n`:``,i;throw i=a>3?t===0||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${(a+1)*8}${r}`:`>= -(2${r} ** ${(a+1)*8-1}${r}) and < 2 ** ${(a+1)*8-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new V.ERR_OUT_OF_RANGE(`value`,i,e)}ie(r,i,a)}function W(e,t){if(typeof e!=`number`)throw new V.ERR_INVALID_ARG_TYPE(t,`number`,e)}function ae(e,t,n){throw Math.floor(e)===e?t<0?new V.ERR_BUFFER_OUT_OF_BOUNDS:new V.ERR_OUT_OF_RANGE(n||`offset`,`>= ${+!!n} and <= ${t}`,e):(W(e,n),new V.ERR_OUT_OF_RANGE(n||`offset`,`an integer`,e))}var oe=/[^+/0-9A-Za-z-_]/g;function se(e){if(e=e.split(`=`)[0],e=e.trim().replace(oe,``),e.length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}function ce(e,t){t||=1/0;let n,r=e.length,i=null,a=[];for(let o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw Error(`Invalid code point`)}return a}function le(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function G(e,t){let n,r,i,a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function ue(e){return t.toByteArray(se(e))}function de(e,t,n,r){let i=0;for(;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function K(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function fe(e){return e!==e}var pe=(function(){let e=`0123456789abcdef`,t=Array(256);for(let n=0;n<16;++n){let r=n*16;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t})();function me(e){return typeof BigInt>`u`?he:e}function he(){throw Error(`BigInt not supported`)}}))(),hn=B({__name:`PopoverTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=tt(),{forwardRef:i,currentElement:a}=ot();return n.triggerId||=Xe(void 0,`reka-popover-trigger`),n.contentId||=Xe(void 0,`reka-popover-content`),I(()=>{n.triggerElement.value=a.value}),(e,a)=>(V(),G(ue(r(n).hasCustomAnchor.value?r(Ge):r(nt)),{"as-child":``},{default:U(()=>[b(r(Ge),{id:r(n).triggerId,ref:r(i),type:e.as===`button`?`button`:void 0,"aria-haspopup":`dialog`,"aria-expanded":r(n).open.value,"aria-controls":r(n).open.value?r(n).contentId:void 0,"data-state":r(n).open.value?`open`:`closed`,as:e.as,"as-child":t.asChild,onClick:r(n).onOpenToggle},{default:U(()=>[de(e.$slots,`default`)]),_:3},8,[`id`,`type`,`aria-expanded`,`aria-controls`,`data-state`,`as`,`as-child`,`onClick`])]),_:3}))}}),gn={key:0,class:`error-boundary`},_n={class:`error-content`},vn={class:`error-message`},yn=Je(B({__name:`ErrorBoundary`,setup(e){let{t}=ve(),n=i(null);oe(e=>(n.value=e instanceof Error?e:Error(String(e)),console.error(`[ErrorBoundary]`,e),!1));function a(){n.value=null}return(e,i)=>n.value?(V(),P(`div`,gn,[N(`div`,_n,[i[0]||=N(`i`,{class:`ti ti-alert-triangle error-icon`},null,-1),N(`h3`,null,W(r(t)(`errorBoundary.title`)),1),N(`p`,vn,W(n.value.message),1),b(r(q),{label:r(t)(`errorBoundary.tryAgain`),icon:`ti ti-refresh`,onClick:a},null,8,[`label`])])])):de(e.$slots,`default`,{key:1},void 0,!0)}}),[[`__scopeId`,`data-v-1e77a5b4`]]),bn=i(null),xn=i(null),Sn=i(`unknown`),Cn=i(!0),wn=null;async function Tn(e){Cn.value=!0;try{let t=await J.health.versionInfo.query(e?{force:!0}:void 0);bn.value=t.current,xn.value=t.latest,Sn.value=t.status}catch{Sn.value=`unknown`}finally{Cn.value=!1}}async function En(e={}){e.force?wn=Tn(!0):wn??=Tn(!1);let t=wn;try{await t}finally{wn===t&&(wn=null)}}function Dn(){return{current:bn,latest:xn,status:Sn,loading:Cn,outdated:z(()=>Sn.value===`outdated`),check:En}}var On={class:`update-dialog__lead`},kn={key:0,class:`update-dialog__row`},An={key:1,class:`update-dialog__prereqs`},jn={class:`update-dialog__prereq`},Mn={class:`update-dialog__prereq`},Nn={key:0},Pn={key:1},Fn={key:0,class:`update-dialog__prereq`},In={key:4,class:`update-dialog__row`},Ln={key:7,class:`update-dialog__output`},Rn=Je(B({__name:`AppUpdateDialog`,props:{visible:{type:Boolean},currentVersion:{},latestVersion:{}},emits:[`update:visible`,`updated`],setup(e,{emit:t}){let{t:n}=ve(),a=e,o=t,s=i(`checking`),c=i(null),l=i(``),u=i(null),d=i(``);async function f(){s.value=`checking`,l.value=``,d.value=``;try{let e=await J.appUpdate.prerequisites.query();c.value=e,s.value=e.ready?`ready`:`blocked`}catch(e){d.value=e.message,s.value=`blocked`}}async function p(){s.value=`installing`;try{let e=await J.appUpdate.install.mutate();l.value=e.output,u.value=e.installedVersion,s.value=e.ok?`installed`:`failed`,e.ok&&o(`updated`)}catch(e){d.value=e.message,s.value=`failed`}}async function m(){s.value=`restarting`;try{await J.appUpdate.restart.mutate()}catch{}}return C(()=>a.visible,e=>{e&&f()}),(t,i)=>(V(),G(r(Ue),{visible:e.visible,header:r(n)(`appUpdate.dialogTitle`),modal:``,closable:s.value!==`installing`&&s.value!==`restarting`,style:{width:`34rem`},"onUpdate:visible":i[1]||=e=>o(`update:visible`,e)},{footer:U(()=>[s.value===`blocked`||s.value===`failed`?(V(),G(r(q),{key:0,label:r(n)(`appUpdate.retry`),severity:`secondary`,onClick:f},null,8,[`label`])):K(``,!0),s.value===`ready`?(V(),G(r(q),{key:1,label:r(n)(`appUpdate.install`),icon:`ti ti-download`,onClick:p},null,8,[`label`])):K(``,!0),s.value===`installed`?(V(),G(r(q),{key:2,label:r(n)(`appUpdate.restartLater`),severity:`secondary`,onClick:i[0]||=e=>o(`update:visible`,!1)},null,8,[`label`])):K(``,!0),s.value===`installed`?(V(),G(r(q),{key:3,label:r(n)(`appUpdate.restartNow`),icon:`ti ti-refresh`,onClick:m},null,8,[`label`])):K(``,!0),s.value===`restarting`?(V(),G(r(q),{key:4,label:r(n)(`appUpdate.restarting`),icon:`ti ti-spin ti-loader-2`,disabled:``},null,8,[`label`])):K(``,!0)]),default:U(()=>[N(`p`,On,W(r(n)(`appUpdate.dialogLead`,{current:e.currentVersion??`—`,latest:e.latestVersion??`—`})),1),s.value===`checking`?(V(),P(`div`,kn,[b(r(Me),{style:{width:`1.5rem`,height:`1.5rem`},strokeWidth:`6`}),N(`span`,null,W(r(n)(`appUpdate.checking`)),1)])):c.value?(V(),P(`div`,An,[N(`div`,jn,[i[2]||=N(`i`,{class:`ti ti-circle-check update-dialog__ok`},null,-1),N(`span`,null,W(r(n)(`appUpdate.nodeFound`,{version:c.value.nodeVersion})),1)]),N(`div`,Mn,[N(`i`,{class:L(c.value.npmVersion?`ti ti-circle-check update-dialog__ok`:`ti ti-circle-x update-dialog__ko`)},null,2),c.value.npmVersion?(V(),P(`span`,Nn,W(r(n)(`appUpdate.npmFound`,{version:c.value.npmVersion,path:c.value.npmPath})),1)):(V(),P(`span`,Pn,W(r(n)(`appUpdate.npmMissing`)),1))]),c.value.globalPrefix?(V(),P(`div`,Fn,[i[3]||=N(`i`,{class:`ti ti-folder update-dialog__info`},null,-1),N(`span`,null,W(r(n)(`appUpdate.installTarget`,{prefix:c.value.globalPrefix})),1)])):K(``,!0)])):K(``,!0),s.value===`blocked`&&!c.value?.npmVersion?(V(),G(r(Ve),{key:2,severity:`warn`},{default:U(()=>[x(W(r(n)(`appUpdate.npmMissingHelp`)),1)]),_:1})):K(``,!0),d.value?(V(),G(r(Ve),{key:3,severity:`error`},{default:U(()=>[x(W(d.value),1)]),_:1})):K(``,!0),s.value===`installing`?(V(),P(`div`,In,[b(r(Me),{style:{width:`1.5rem`,height:`1.5rem`},strokeWidth:`6`}),N(`span`,null,W(r(n)(`appUpdate.installing`)),1)])):K(``,!0),s.value===`installed`?(V(),G(r(Ve),{key:5,severity:`success`},{default:U(()=>[x(W(r(n)(`appUpdate.installed`,{version:u.value??e.latestVersion??``})),1)]),_:1})):K(``,!0),s.value===`failed`?(V(),G(r(Ve),{key:6,severity:`error`},{default:U(()=>[x(W(r(n)(`appUpdate.installFailed`)),1)]),_:1})):K(``,!0),l.value?(V(),P(`pre`,Ln,W(l.value),1)):K(``,!0),s.value===`installed`?(V(),G(r(Ve),{key:8,severity:`info`},{default:U(()=>[x(W(r(n)(`appUpdate.restartNeeded`)),1)]),_:1})):K(``,!0)]),_:1},8,[`visible`,`header`,`closable`]))}}),[[`__scopeId`,`data-v-bcce910d`]]),zn={key:0,class:`update-banner`},Bn=3e5,Vn=Je(B({__name:`AppUpdateBanner`,setup(e){let{t}=ve(),{isDesktop:n}=ft(),{current:a,latest:o,outdated:s,check:c}=Dn(),l=i(!1),u=null;function d(){document.visibilityState===`visible`&&c()}return I(()=>{n.value&&(c(),u=setInterval(()=>void c(),Bn),document.addEventListener(`visibilitychange`,d))}),ee(()=>{u!==null&&clearInterval(u),document.removeEventListener(`visibilitychange`,d)}),(e,i)=>(V(),P(H,null,[r(n)&&r(s)?(V(),P(`div`,zn,[i[3]||=N(`i`,{class:`ti ti-circle-arrow-up update-banner__icon`},null,-1),N(`span`,null,W(r(t)(`appUpdate.bannerText`,{current:r(a),latest:r(o)})),1),b(r(q),{label:r(t)(`appUpdate.bannerAction`),size:`small`,severity:`contrast`,onClick:i[0]||=e=>l.value=!0},null,8,[`label`])])):K(``,!0),b(Rn,{visible:l.value,"onUpdate:visible":i[1]||=e=>l.value=e,"current-version":r(a),"latest-version":r(o),onUpdated:i[2]||=()=>r(c)({force:!0})},null,8,[`visible`,`current-version`,`latest-version`])],64))}}),[[`__scopeId`,`data-v-23af4c89`]]),Hn=`runeya:changelog-seen:`;function Un(e){return`${Hn}${e}`}function Wn(e){try{return localStorage.getItem(Un(e))}catch{return null}}function Gn(e,t){try{localStorage.setItem(Un(e),t)}catch{}}async function Kn(){let e=Wn(`app`);try{if(e===null){let{releases:e}=await J.changelog.index.query({surface:`app`,since:null});return Gn(`app`,e[0]?.version??`0`),[]}let{releases:t}=await J.changelog.releases.query({surface:`app`,since:e});return t}catch{return[]}}function qn(e){let t=i([]),n=i(!1),r=i(!1);async function a(){n.value=!0,r.value=!1;try{let n=await J.changelog.releases.query({surface:e,since:null});t.value=n.releases}catch{r.value=!0,t.value=[]}finally{n.value=!1}}return{releases:t,loading:n,failed:r,load:a}}var Jn={class:`changelog`},Yn={class:`release__head`},Xn={key:0,class:`release__version`},Zn={key:0,class:`release__title`},Qn={class:`release__changes`},$n=Je(B({__name:`ChangelogReleases`,props:{releases:{}},setup(e){let{t,locale:n}=ve(),i={feature:`changelog.kindFeature`,improvement:`changelog.kindImprovement`,fix:`changelog.kindFix`,breaking:`changelog.kindBreaking`};function a(e){return e.version.startsWith(e.date)?null:e.version}function o(e){return n.value===`fr`?e.fr:e.en}return(n,s)=>(V(),P(`ol`,Jn,[(V(!0),P(H,null,F(e.releases,e=>(V(),P(`li`,{key:`${e.surface}-${e.version}`,class:`release`},[N(`header`,Yn,[a(e)?(V(),P(`span`,Xn,W(a(e)),1)):K(``,!0),N(`span`,{class:L([`release__date`,{"release__date--lead":!a(e)}])},W(e.date),3)]),e.title?(V(),P(`h4`,Zn,W(o(e.title)),1)):K(``,!0),N(`ul`,Qn,[(V(!0),P(H,null,F(e.changes,(e,n)=>(V(),P(`li`,{key:n,class:`change`},[N(`span`,{class:L([`change__kind`,`change__kind--${e.kind}`])},W(r(t)(i[e.kind])),3),N(`span`,null,W(o(e.text)),1)]))),128))])]))),128))]))}}),[[`__scopeId`,`data-v-ad6af3bd`]]),er={class:`lead`},tr=Je(B({__name:`AppChangelogDialog`,setup(e){let{t}=ve(),n=i(!1),a=i([]);return I(async()=>{let e=await Kn(),t=e[0];t&&(a.value=e,n.value=!0,Gn(`app`,t.version))}),(e,i)=>(V(),G(r(Ue),{visible:n.value,"onUpdate:visible":i[1]||=e=>n.value=e,modal:``,"dismissable-mask":``,header:r(t)(`changelog.title`),style:{width:`38rem`,maxWidth:`95vw`}},{footer:U(()=>[b(r(q),{label:r(t)(`changelog.close`),onClick:i[0]||=e=>n.value=!1},null,8,[`label`])]),default:U(()=>[N(`p`,er,W(r(t)(`changelog.dialogLead`)),1),b($n,{releases:a.value},null,8,[`releases`])]),_:1},8,[`visible`,`header`]))}}),[[`__scopeId`,`data-v-fd0c0bd5`]]);function nr(e){this.content=e}nr.prototype={constructor:nr,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new nr(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new nr(n)},addToStart:function(e,t){return new nr([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new nr(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new nr(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=nr.from(e),e.size?new nr(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=nr.from(e),e.size?new nr(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=nr.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},nr.from=function(e){if(e instanceof nr)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new nr(t)};function rr(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&or(e.charCodeAt(r-1))&&ar(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=rr(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function ir(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=o.text,t=s.text,i=e.length,a=t.length;for(;i>0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i<e.length&&or(e.charCodeAt(i-1))&&ar(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=ir(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}function ar(e){return e>=56320&&e<57344}function or(e){return e>=55296&&e<56320}var Y=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return rr(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return ir(this,e,t,n)}findIndex(e){if(e==0)return cr(0,e);if(e==this.size)return cr(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?cr(t+1,i):cr(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};Y.empty=new Y([],0);var sr={index:0,offset:0};function cr(e,t){return sr.index=e,sr.offset=t,sr}function lr(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!lr(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!lr(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var ur=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&lr(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};ur.none=[];var dr=class extends Error{},fr=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=mr(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(pr(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(Y.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};fr.empty=new fr(Y.empty,0,0);function pr(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(pr(a.content,t-i-1,n-i-1)))}function mr(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=mr(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function hr(e,t,n){if(n.openStart>e.depth)throw new dr(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new dr(`Inconsistent open depths`);return gr(e,t,n,0)}function gr(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=gr(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return xr(a,Cr(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return xr(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=wr(n,e);return xr(a,Sr(e,i,o,t,r))}}function _r(e,t){if(!t.type.compatibleContent(e.type))throw new dr(`Cannot join `+t.type.name+` onto `+e.type.name)}function vr(e,t,n){let r=e.node(n);return _r(r,t.node(n)),r}function yr(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function br(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(yr(e.nodeAfter,r),a++));for(let e=a;e<o;e++)yr(i.child(e),r);t&&t.depth==n&&t.textOffset&&yr(t.nodeBefore,r)}function xr(e,t){if(!e.type.validContent(t))throw new dr(`Invalid content for node `+e.type.name);return e.copy(t)}function Sr(e,t,n,r,i){let a=e.depth>i&&vr(e,t,i+1),o=r.depth>i&&vr(n,r,i+1),s=[];return br(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(_r(a,o),yr(xr(a,Sr(e,t,n,r,i+1)),s)):(a&&yr(xr(a,Cr(e,t,i+1)),s),br(t,n,i,s),o&&yr(xr(o,Cr(n,r,i+1)),s)),br(r,null,i,s),new Y(s)}function Cr(e,t,n){let r=[];return br(null,e,n,r),e.depth>n&&yr(xr(vr(e,t,n+1),Cr(e,t,n+1)),r),br(t,null,n,r),new Y(r)}function wr(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(Y.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var Tr=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return ur.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new kr(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Or.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else Or.set(t,r=new Er);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%Dr,i}},Er=class{constructor(){this.elts=[],this.i=0}},Dr=12,Or=new WeakMap,kr=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},Ar=Object.create(null),jr=class e{constructor(e,t,n,r=ur.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||Y.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&lr(this.attrs,t||e.defaultAttrs||Ar)&&ur.sameSet(this.marks,n||ur.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return fr.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new fr(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return hr(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Tr.resolveCached(this,e)}resolveNoCache(e){return Tr.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),Nr(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=Y.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=ur.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!ur.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=Y.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};jr.prototype.text=void 0;var Mr=class e extends jr{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Nr(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Nr(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var Pr=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Fr(t,n);if(r.next==null)return e.empty;let i=Ir(r);r.next&&r.err(`Unexpected trailing text`);let a=Kr(Ur(i));return qr(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return Y.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
|
|
3
|
+
`)}};Pr.empty=new Pr(!0);var Fr=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function Ir(e){let t=[];do t.push(Lr(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function Lr(e){let t=[];do t.push(Rr(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Rr(e){let t=Hr(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Br(e,t);else break;return t}function zr(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Br(e,t){let n=zr(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:zr(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function Vr(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function Hr(e){if(e.eat(`(`)){let t=Ir(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=Vr(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function Ur(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function Wr(e,t){return t-e}function Gr(e,t){let n=[];return r(t),n.sort(Wr);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function Kr(e){let t=Object.create(null);return n(Gr(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Gr(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new Pr(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(Wr);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function qr(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function Jr(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Yr(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function Xr(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}function Zr(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new ei(e,r,t[r]);return n}var Qr=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=Zr(e,n.attrs),this.defaultAttrs=Jr(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Pr.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Yr(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new jr(this,this.computeAttrs(e),Y.from(t),ur.setFrom(n))}createChecked(e=null,t,n){return t=Y.from(t),this.checkContent(t),new jr(this,this.computeAttrs(e),t,ur.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=Y.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(Y.empty,!0);return i?new jr(this,e,t.append(i),ur.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Xr(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:ur.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function $r(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var ei=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?$r(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},ti=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Zr(e,r.attrs),this.excluded=null;let i=Jr(this.attrs);this.instance=i?new ur(this,i):null}create(e=null){return!e&&this.instance?this.instance:new ur(this,Yr(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Xr(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},ni=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=nr.from(e.nodes),t.marks=nr.from(e.marks||{}),this.nodes=Qr.compile(this.spec.nodes,this),this.marks=ti.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=Pr.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?ri(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:ri(this,n.split(` `))}this.nodeFromJSON=e=>jr.fromJSON(this,e),this.markFromJSON=e=>ur.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof Qr))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Mr(n,n.defaultAttrs,e,ur.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function ri(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function ii(e){return e.tag!=null}function ai(e){return e.style!=null}var oi=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(ii(e))this.tags.push(e);else if(ai(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new hi(this,t,!1);return n.addAll(e,ur.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new hi(this,t,!0);return n.addAll(e,ur.none,t.from,t.to),fr.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(_i(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=vi(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=vi(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},si={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},ci={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},li={ol:!0,ul:!0},ui=1,di=2,fi=4;function pi(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?ui:0)|(t===`full`?di:0)}var mi=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=ur.none,this.match=i||(a&fi?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(Y.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ui)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=Y.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(Y.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!si.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},hi=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=pi(null,t.preserveWhitespace,0)|(n?fi:0);i=r?new mi(r.type,r.attrs,ur.none,!0,t.topMatch||r.type.contentMatch,a):n?new mi(null,null,ur.none,!0,null,a):new mi(e.schema.topNodeType,null,ur.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&di?`full`:this.localPreserveWS||(r.options&ui)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
|
|
4
|
+
`);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;li.hasOwnProperty(a)&&this.parser.normalizeLists&&gi(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:ci.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(si.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
5
|
+
`),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node){if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=ur.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):yi(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=pi(e,i,a.options);a.options&fi&&a.content.length==0&&(o|=fi);let s=ur.none;return n=n.filter(t=>!(a.type?a.type.allowsMarkType(t.type):yi(t.type,e))||(s=t.addToSet(s),!1)),this.nodes.push(new mi(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=ui);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function gi(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&li.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function _i(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function vi(e){let t={};for(let n in e)t[n]=e[n];return t}function yi(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var bi=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=Si(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){if(e.isText)return Si(t).createTextNode(e.text);let{dom:n,contentDOM:r}=Ei(Si(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&Ei(Si(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return typeof t==`string`?{dom:e.createTextNode(t)}:Ei(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=xi(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return xi(e.marks)}};function xi(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Si(e){return e.document||window.document}var Ci=new WeakMap;function wi(e){let t=Ci.get(e);return t===void 0&&Ci.set(e,t=Ti(e)),t}function Ti(e){let t=null;function n(e){if(e&&typeof e==`object`){if(Array.isArray(e)){if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t])}else for(let t in e)n(e[t])}}return n(e),t}function Ei(e,t,n,r){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=wi(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}if(typeof a==`string`)c.appendChild(e.createTextNode(a));else{let{dom:t,contentDOM:i}=Ei(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var Di=65535,Oi=2**16;function ki(e,t){return e+t*Oi}function Ai(e){return e&Di}function ji(e){return(e-(e&Di))/Oi}var Mi=1,eee=2,Ni=4,Pi=8,Fi=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Pi)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&Ni)>0}},Ii=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=Ai(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+ji(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:ki(o/3,e-s),f=e==s?eee:e==u?Mi:Ni;return(t<0?e!=s:e!=u)&&(f|=Pi),new Fi(a,f,d)}r+=l-c}return n?e+r:new Fi(e+r,0,null)}touches(e,t){let n=0,r=Ai(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};Ii.empty=new Ii([]);var Li=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new Fi(e,r,null)}},Ri=Object.create(null),zi=class{getMap(){return Ii.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=Ri[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Ri)throw RangeError(`Duplicate use of step JSON ID `+e);return Ri[e]=t,t.prototype.jsonID=e,t}},Bi=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof dr)return e.fail(t.message);throw t}}};function Vi(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(Vi(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return Y.fromArray(r)}var Hi=class e extends zi{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new fr(Vi(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return Bi.fromReplace(e,this.from,this.to,i)}invert(){return new Ui(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};zi.jsonID(`addMark`,Hi);var Ui=class e extends zi{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new fr(Vi(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return Bi.fromReplace(e,this.from,this.to,n)}invert(){return new Hi(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};zi.jsonID(`removeMark`,Ui);var Wi=class e extends zi{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Bi.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Bi.fromReplace(e,this.pos,this.pos+1,new fr(Y.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new Gi(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};zi.jsonID(`addNodeMark`,Wi);var Gi=class e extends zi{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Bi.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Bi.fromReplace(e,this.pos,this.pos+1,new fr(Y.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Wi(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};zi.jsonID(`removeNodeMark`,Gi);var Ki=class e extends zi{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Ji(e,this.from,this.to)?Bi.fail(`Structure replace would overwrite content`):Bi.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Ii([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?fr.empty:new fr(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?fr.empty:new fr(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,fr.fromJSON(t,n.slice),!!n.structure)}};Ki.MAP_BIAS=1,zi.jsonID(`replace`,Ki);var qi=class e extends zi{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(Ji(e,this.from,this.gapFrom)||Ji(e,this.gapTo,this.to)))return Bi.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Bi.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?Bi.fromReplace(e,this.from,this.to,n):Bi.fail(`Content does not fit in gap`)}getMap(){return new Ii([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,fr.fromJSON(t,n.slice),n.insert,!!n.structure)}};zi.jsonID(`replaceAround`,qi);function Ji(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function Yi(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new Ui(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new Hi(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function Xi(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof ti){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new Ui(t.from,t.to,t.style)))}function Zi(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new Ki(s,l,fr.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new Ui(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new fr(Y.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new Ki(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(Y.empty,!0);e.replace(s,s,new fr(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function Qi(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function $i(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!Qi(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function ea(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=Y.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=Y.from(r.node(e).copy(u)),d++):c--;let f=Y.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=Y.from(i.node(e).copy(f)),p++):l++;e.step(new qi(c,l,o,s,new fr(u.append(f),d,p),u.size-d,!0))}function ta(e,t,n=null,r=e){let i=ra(e,t),a=i&&ia(r,t);return a?i.map(na).concat({type:t,attrs:n}).concat(a.map(na)):null}function na(e){return{type:e,attrs:null}}function ra(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function ia(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function aa(e,t,n){let r=Y.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=Y.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new qi(i,a,i,a,new fr(r,0,0),n.length,!0))}function oa(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&la(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&ca(e,t,n,a),Zi(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new qi(c,l,c+1,l-1,new fr(Y.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&sa(e,t,n,a),!1}})}function sa(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function ca(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
|
|
6
|
+
`))}})}function la(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function ua(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new qi(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new fr(Y.from(o),0,0),1,!0))}function da(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function fa(e,t,n=1,r){let i=e.doc.resolve(t),a=Y.empty,o=Y.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=Y.from(i.node(e).copy(a));let t=r&&r[s];o=Y.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new Ki(t,t,new fr(a.append(o),n,n),!0))}function pa(e,t){let n=e.resolve(t),r=n.index();return ha(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function ma(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let a=t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function ha(e,t){return!!(e&&t&&!e.isLeaf&&ma(e,t))}function ga(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,a,o=r.index(e);if(e==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i&&!i.isTextblock&&ha(i,a)&&r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n<0?r.before(e):r.after(e)}}function _a(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);ca(e,r.node(),r.before(),s)}o.inlineContent&&Zi(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new Ki(l,c.map(t+n,-1),fr.empty,!0)),r===!0){let t=e.doc.resolve(l);sa(e,t.node(),t.before(),e.steps.length)}return e}function va(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}function ya(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function ba(e,t,n=t,r=fr.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return xa(i,a,r)?new Ki(t,n,r):new Sa(i,a,r).fit()}function xa(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var Sa=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=Y.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=Y.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new fr(i,a,o);return e>-1?new qi(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new Ki(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=Ta(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(Y.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Ta(e,t);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new fr(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Ta(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new fr(Ca(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new fr(Ca(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let a=this.unplaced,o=n?n.content:a.content,s=a.openStart-e,c=0,l=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));u=u.matchFragment(r)}let f=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let e=o.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||s==0||e.content.size)&&(u=t,l.push(Ea(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=wa(this.placed,t,Y.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?e==0?fr.empty:new fr(Ca(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new fr(Ca(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!Da(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=Da(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=Da(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=wa(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=wa(this.placed,this.depth,Y.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(Y.empty,!0);e.childCount&&(this.placed=wa(this.placed,this.frontier.length,e))}};function Ca(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Ca(e.firstChild.content,t-1,n)))}function wa(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(wa(e.lastChild.content,t-1,n)))}function Ta(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Ea(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,Ea(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(Y.empty,!0)))),e.copy(r)}function Da(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!Oa(n,a.content,o)?s:null}function Oa(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function ka(e){return e.spec.defining||e.spec.definingForContent}function Aa(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(xa(i,a,r))return e.step(new Ki(t,n,r));let o=Pa(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=ka(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t<o.length;t++){let l=o[(t+c)%o.length],u=!0;l<0&&(u=!1,l=-l);let f=i.node(l-1),p=i.index(l-1);if(f.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(l),u?a.after(l):n,new fr(ja(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=o.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function ja(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(ja(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(Y.empty,!0))}return e}function Ma(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=va(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new fr(Y.from(r),0,0))}function Na(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let a=r.sharedDepth(n),o=!1;for(let e=r.depth;e>a;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>a;e--)i.node(e).type.spec.isolating&&(o=!0);if(!o){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let a=Pa(r,i);for(let t=0;t<a.length;t++){let n=a[t],o=t==a.length-1;if(o&&n==0||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function Pa(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var Fa=class e extends zi{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Bi.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return Bi.fromReplace(e,this.pos,this.pos+1,new fr(Y.from(r),0,+!t.isLeaf))}getMap(){return Ii.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};zi.jsonID(`attr`,Fa);var Ia=class e extends zi{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Bi.ok(n)}getMap(){return Ii.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};zi.jsonID(`docAttr`,Ia);var La=class extends Error{};La=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},La.prototype=Object.create(Error.prototype),La.prototype.constructor=La,La.prototype.name=`TransformError`;var Ra=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Li}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new La(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,a)=>{e=Math.min(e,i),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=fr.empty){let r=ba(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new fr(Y.from(n),0,0))}delete(e,t){return this.replace(e,t,fr.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return Aa(this,e,t,n),this}replaceRangeWith(e,t,n){return Ma(this,e,t,n),this}deleteRange(e,t){return Na(this,e,t),this}lift(e,t){return ea(this,e,t),this}join(e,t=1){return _a(this,e,t),this}wrap(e,t){return aa(this,e,t),this}setBlockType(e,t=e,n,r=null){return oa(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return ua(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new Fa(e,t,n)),this}setDocAttribute(e,t){return this.step(new Ia(e,t)),this}addNodeMark(e,t){return this.step(new Wi(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof ur)t.isInSet(n.marks)&&this.step(new Gi(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new Gi(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return fa(this,e,t,n),this}addMark(e,t,n){return Yi(this,e,t,n),this}removeMark(e,t,n){return Xi(this,e,t,n),this}clearIncompatible(e,t,n){return Zi(this,e,t,n),this}},za=Object.create(null),Ba=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Va(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=fr.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?fr.empty:t),o==0&&Za(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),Za(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new Wa(e):Xa(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?Xa(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):Xa(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Ja(e.node(0))}static atStart(e){return Xa(e,e,0,0,1)||new Ja(e)}static atEnd(e){return Xa(e,e,e.content.size,e.childCount,-1)||new Ja(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=za[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in za)throw RangeError(`Duplicate use of selection JSON ID `+e);return za[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Wa.between(this.$anchor,this.$head).getBookmark()}};Ba.prototype.visible=!0;var Va=class{constructor(e,t){this.$from=e,this.$to=t}},Ha=!1;function Ua(e){!Ha&&!e.parent.inlineContent&&(Ha=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var Wa=class e extends Ba{constructor(e,t=e){Ua(e),Ua(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return Ba.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=fr.empty){if(super.replace(e,t),t==fr.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Ga(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=Ba.findFrom(n,r,!0)||Ba.findFrom(n,-r,!0);if(e)n=e.$head;else return Ba.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(Ba.findFrom(t,-r,!0)||Ba.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};Ba.jsonID(`text`,Wa);var Ga=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return Wa.between(e.resolve(this.anchor),e.resolve(this.head))}},Ka=class e extends Ba{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?Ba.near(a):new e(a)}content(){return new fr(Y.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new qa(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};Ka.prototype.visible=!1,Ba.jsonID(`node`,Ka);var qa=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Ga(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&Ka.isSelectable(n)?new Ka(t):Ba.near(t)}},Ja=class e extends Ba{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=fr.empty){if(t==fr.empty){e.delete(0,e.doc.content.size);let t=Ba.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return Ya}};Ba.jsonID(`all`,Ja);var Ya={map(){return this},resolve(e){return new Ja(e)}};function Xa(e,t,n,r,i,a=!1){if(t.inlineContent)return Wa.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=Xa(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&Ka.isSelectable(r))return Ka.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function Za(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Ki||i instanceof qi))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(Ba.near(e.doc.resolve(o),n))}var Qa=1,$a=2,eo=4,to=class extends Ra{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError(`Selection passed to setSelection must point at the current document`);return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Qa)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&Qa)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=$a,this}ensureMarks(e){return ur.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&$a)>0}addStep(e,t){super.addStep(e,t),this.updated&=-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||ur.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(Ba.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,this}getMeta(e){return this.meta[typeof e==`string`?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=eo,this}get scrolledIntoView(){return(this.updated&eo)>0}};function no(e,t){return!t||!e?e:e.bind(t)}var ro=class{constructor(e,t,n){this.name=e,this.init=no(t.init,n),this.apply=no(t.apply,n)}},io=[new ro(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new ro(`selection`,{init(e,t){return e.selection||Ba.atStart(t.doc)},apply(e){return e.selection}}),new ro(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new ro(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],ao=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=io.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError(`Adding different instances of a keyed plugin (`+e.key+`)`);this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new ro(e.key,e.spec.state,e))})}},oo=class e{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let s=r?r[a].n:0,c=r?r[a].state:this,l=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,c,n);if(l&&n.filterTransaction(l,a)){if(l.setMeta(`appendedTransaction`,e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<a?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[a]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError(`Applying a mismatched transaction`);let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let i=r[e];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new to(this)}static create(t){let n=new ao(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new ao(this.schema,t.plugins),r=n.fields,i=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;i[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new ao(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=jr.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=Ba.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}};function so(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=so(i,t,{})),n[r]=i}return n}var co=class{constructor(e){this.spec=e,this.props={},e.props&&so(e.props,this,this.props),this.key=e.key?e.key.key:uo(`plugin`)}getState(e){return e[this.key]}},lo=Object.create(null);function uo(e){return e in lo?e+`$`+ ++lo[e]:(lo[e]=0,e+`$`)}var fo=class{constructor(e=`key`){this.key=uo(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},po=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function mo(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var ho=(e,t,n)=>{let r=mo(e,n);if(!r)return!1;let i=xo(r);if(!i){let n=r.blockRange(),i=n&&$i(n);return i!=null&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(zo(e,i,t,-1))return!0;if(r.parent.content.size==0&&(yo(a,`end`)||Ka.isSelectable(a)))for(let n=r.depth;;n--){let o=ba(e.doc,r.before(n),r.after(n),fr.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(yo(a,`end`)?Ba.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):Ka.create(n.doc,i.pos-a.nodeSize)),t(n.scrollIntoView())}return!0}if(n==1||r.node(n-1).childCount>1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},go=(e,t,n)=>{let r=mo(e,n);if(!r)return!1;let i=xo(r);return i?vo(e,i,t):!1},_o=(e,t,n)=>{let r=So(e,n);if(!r)return!1;let i=To(r);return i?vo(e,i,t):!1};function vo(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=ba(e.doc,i,o,fr.empty);if(!s||s.from!=i||s instanceof Ki&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(Wa.create(t.doc,i)),n(t.scrollIntoView())}return!0}function yo(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var bo=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=xo(r)}let o=a&&a.nodeBefore;return!o||!Ka.isSelectable(o)?!1:(t&&t(e.tr.setSelection(Ka.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function xo(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function So(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var Co=(e,t,n)=>{let r=So(e,n);if(!r)return!1;let i=To(r);if(!i)return!1;let a=i.nodeAfter;if(zo(e,i,t,1))return!0;if(r.parent.content.size==0&&(yo(a,`start`)||Ka.isSelectable(a))){let n=ba(e.doc,r.before(),r.after(),fr.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(yo(a,`start`)?Ba.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):Ka.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},wo=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=To(r)}let o=a&&a.nodeAfter;return!o||!Ka.isSelectable(o)?!1:(t&&t(e.tr.setSelection(Ka.create(e.doc,a.pos)).scrollIntoView()),!0)};function To(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var Eo=(e,t)=>{let n=e.selection,r=n instanceof Ka,i;if(r){if(n.node.isTextblock||!pa(e.doc,n.from))return!1;i=n.from}else if(i=ga(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(Ka.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},Do=(e,t)=>{let n=e.selection,r;if(n instanceof Ka){if(n.node.isTextblock||!pa(e.doc,n.to))return!1;r=n.to}else if(r=ga(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},Oo=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&$i(i);return a!=null&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},ko=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
|
|
7
|
+
`).scrollIntoView()),!0)};function Ao(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var jo=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=Ao(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(Ba.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},Mo=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Ja||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=Ao(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(Wa.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},No=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(da(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&$i(r);return i!=null&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function Po(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof Ka&&t.selection.node.isBlock)return!r.parentOffset||!da(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let a=[],o,s,c=!1,l=!1;for(let t=r.depth;;t--)if(r.node(t).isBlock){c=r.end(t)==r.pos+(r.depth-t),l=r.start(t)==r.pos-(r.depth-t),s=Ao(r.node(t-1).contentMatchAt(r.indexAfter(t-1)));let n=e&&e(i.parent,c,r);a.unshift(n||(c&&s?{type:s}:null)),o=t;break}else{if(t==1)return!1;a.unshift(null)}let u=t.tr;(t.selection instanceof Wa||t.selection instanceof Ja)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=da(u.doc,d,a.length,a);if(f||=(a[0]=s?{type:s}:null,da(u.doc,d,a.length,a)),!f)return!1;if(u.split(d,a.length,a),!c&&l&&r.node(o).type!=s){let e=u.mapping.map(r.before(o)),t=u.doc.resolve(e);s&&r.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&u.setNodeMarkup(u.mapping.map(r.before(o)),s)}return n&&n(u.scrollIntoView()),!0}}var Fo=Po(),Io=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a!=0&&(i=n.before(a),t&&t(e.tr.setSelection(Ka.create(e.doc,i))),!0)},Lo=(e,t)=>(t&&t(e.tr.setSelection(new Ja(e.doc))),!0);function Ro(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||pa(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function zo(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&Ro(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=Y.empty;for(let e=o.length-1;e>=0;e--)s=Y.from(o[e].create(null,s));s=Y.from(i.copy(s));let c=e.tr.step(new qi(t.pos-1,r,t.pos,r,new fr(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&pa(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:Ba.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&$i(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&yo(a,`start`,!0)&&yo(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=Y.empty;for(let e=o.length-1;e>=0;e--)r=Y.from(o[e].copy(r));n(e.tr.step(new qi(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new fr(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Bo(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(Wa.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var Vo=Bo(-1),Ho=Bo(1);function tee(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&ta(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function Uo(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)=>{if(i)return!1;if(r.isTextblock&&!r.hasMarkup(e,t)){if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(a,o,e,t)}r(i.scrollIntoView())}return!0}}function Wo(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var Go=Wo(po,ho,bo),Ko=Wo(po,Co,wo),qo={Enter:Wo(ko,Mo,No,Fo),"Mod-Enter":jo,Backspace:Go,"Mod-Backspace":Go,"Shift-Backspace":Go,Delete:Ko,"Mod-Delete":Ko,"Mod-a":Lo},Jo={"Ctrl-h":qo.Backspace,"Alt-Backspace":qo[`Mod-Backspace`],"Ctrl-d":qo.Delete,"Ctrl-Alt-Backspace":qo[`Mod-Delete`],"Alt-Delete":qo[`Mod-Delete`],"Alt-d":qo[`Mod-Delete`],"Ctrl-a":Vo,"Ctrl-e":Ho};for(let e in qo)Jo[e]=qo[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform();function Yo(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a);if(!o)return!1;let s=r?n.tr:null;return Xo(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function Xo(e,t,n,r=null){let i=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let e=o.resolve(t.start-2);a=new kr(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new kr(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=ta(a,n,r,t);return s?(e&&Zo(e,t,s,i,n),!0):!1}function Zo(e,t,n,r,i){let a=Y.empty;for(let e=n.length-1;e>=0;e--)a=Y.from(n[e].type.create(n[e].attrs,a));e.step(new qi(t.start-(r?2:0),t.end,t.start,t.end,new fr(a,0,0),n.length,!0));let o=0;for(let e=0;e<n.length;e++)n[e].type==i&&(o=e+1);let s=n.length-o,c=t.start+n.length-(r?2:0),l=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&da(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function Qo(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?$o(t,n,e,a):es(t,n,a):!0:!1}}function $o(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new qi(a-1,o,a,o,new fr(Y.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new kr(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=$i(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return pa(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function es(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+ +!s,u+1,o.content.append(c?Y.empty:Y.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new qi(d-+!!s,f+ +!!c,d+1,f-1,new fr((s?Y.empty:Y.from(i.copy(Y.empty))).append(c?Y.empty:Y.from(i.copy(Y.empty))),+!s,+!c),+!s)),t(r.scrollIntoView()),!0}function ts(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=Y.from(r?e.create():null),o=new fr(Y.from(e.create(null,Y.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new qi(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var ns=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},rs=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},is=null,as=function(e,t,n){let r=is||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},ss=function(){is=null},cs=function(e,t,n,r){return n&&(us(e,t,n,r,-1)||us(e,t,n,r,1))},ls=/^(img|br|input|textarea|hr)$/i;function us(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:ds(e))){let n=e.parentNode;if(!n||n.nodeType!=1||hs(e)||ls.test(e.nodeName)||e.contentEditable==`false`)return!1;t=ns(e)+(i<0?0:1),e=n}else if(e.nodeType==1){let n=e.childNodes[t+(i<0?-1:0)];if(n.nodeType==1&&n.contentEditable==`false`){if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1}else e=n,t=i<0?ds(e):0}else return!1}}function ds(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function fs(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=ds(e)}else if(e.parentNode&&!hs(e))t=ns(e),e=e.parentNode;else return null}}function ps(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!hs(e))t=ns(e)+1,e=e.parentNode;else return null}}function ms(e,t,n){for(let r=t==0,i=t==ds(e);r||i;){if(e==n)return!0;let t=ns(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==ds(e)}}function hs(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var gs=function(e){return e.focusNode&&cs(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function _s(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function vs(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function ys(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(ds(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(ds(r.startContainer),r.startOffset)}}}var bs=typeof navigator<`u`?navigator:null,xs=typeof document<`u`?document:null,Ss=bs&&bs.userAgent||``,Cs=/Edge\/(\d+)/.exec(Ss),ws=/MSIE \d/.exec(Ss),Ts=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ss),Es=!!(ws||Ts||Cs),Ds=ws?document.documentMode:Ts?+Ts[1]:Cs?+Cs[1]:0,Os=!Es&&/gecko\/(\d+)/i.test(Ss);Os&&+(/Firefox\/(\d+)/.exec(Ss)||[0,0])[1];var ks=!Es&&/Chrome\/(\d+)/.exec(Ss),As=!!ks,js=ks?+ks[1]:0,Ms=!Es&&!!bs&&/Apple Computer/.test(bs.vendor),Ns=Ms&&(/Mobile\/\w+/.test(Ss)||!!bs&&bs.maxTouchPoints>2),Ps=Ns||(bs?/Mac/.test(bs.platform):!1),Fs=bs?/Win/.test(bs.platform):!1,Is=/Android \d/.test(Ss),Ls=!!xs&&`webkitFontSmoothing`in xs.documentElement.style,Rs=Ls?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function zs(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Bs(e,t){return typeof e==`number`?e:e[t]}function Vs(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function Hs(e,t,n){let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(o.nodeType!=1){o=rs(o);continue}let e=o,n=e==a.body,s=n?zs(a):Vs(e),c=0,l=0;if(t.top<s.top+Bs(r,`top`)?l=-(s.top-t.top+Bs(i,`top`)):t.bottom>s.bottom-Bs(r,`bottom`)&&(l=t.bottom-t.top>s.bottom-s.top?t.top+Bs(i,`top`)-s.top:t.bottom-s.bottom+Bs(i,`bottom`)),t.left<s.left+Bs(r,`left`)?c=-(s.left-t.left+Bs(i,`left`)):t.right>s.right-Bs(r,`right`)&&(c=t.right-s.right+Bs(i,`right`)),c||l){if(n)a.defaultView.scrollBy(c,l);else{let n=e.scrollLeft,r=e.scrollTop;l&&(e.scrollTop+=l),c&&(e.scrollLeft+=c);let i=e.scrollLeft-n,a=e.scrollTop-r;t={left:t.left-i,top:t.top-a,right:t.right-i,bottom:t.bottom-a}}}let u=n?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(u))break;o=u==`absolute`?o.offsetParent:rs(o)}}function Us(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let t=e.root.elementFromPoint(a,o);if(!t||t==e.dom||!e.dom.contains(t))continue;let s=t.getBoundingClientRect();if(s.top>=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:Ws(e.dom)}}function Ws(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=rs(r));return t}function Gs({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;Ks(n,r==0?0:r-t)}function Ks(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:a}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=a&&(r.scrollLeft=a)}}var qs=null;function Js(e){if(e.setActive)return e.setActive();if(qs)return e.focus(qs);let t=Ws(e);e.focus(qs==null?{get preventScroll(){return qs={preventScroll:!0},!0}}:void 0),qs||(qs=!1,Ks(t,0))}function Ys(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(u.nodeType==1)e=u.getClientRects();else if(u.nodeType==3)e=as(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&e&&(a=d+ +(t.left>=(p.left+p.right)/2));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&n.nodeType==3?Xs(n,i):!n||r&&n.nodeType==1?{node:e,offset:a}:Ys(n,i)}function Xs(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a<n;a++){r.setEnd(e,a+1),r.setStart(e,a);let n=ic(r,1);if(n.top!=n.bottom&&Zs(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function Zs(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Qs(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function $s(e,t,n){let{node:r,offset:i}=Ys(t,n),a=-1;if(r.nodeType==1&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function ec(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(t.dom.nodeType==1&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function tc(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),a=i;;){let n=e.childNodes[a];if(n.nodeType==1){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(Zs(t,i))return tc(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function nc(e,t){let n=e.dom.ownerDocument,r,i=0,a=ys(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o.nodeType==1?o:o.parentNode)){let n=e.dom.getBoundingClientRect();if(!Zs(t,n)||(o=tc(e.dom,t,n),!o))return null}if(Ms)for(let e=o;r&&e;e=rs(e))e.draggable&&(r=void 0);if(o=Qs(o,t),r){if(Os&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;Ls&&i&&r.nodeType==1&&(n=r.childNodes[i-1]).nodeType==1&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!=`BR`)&&(s=ec(e,r,i,t))}s??=$s(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function rc(e){return e.top<e.bottom||e.left<e.right}function ic(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(rc(e))return e}return Array.prototype.find.call(n,rc)||e.getBoundingClientRect()}var ac=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function oc(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=Ls||Os;if(r.nodeType==3){if(o&&(ac.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=ic(as(r,i,i),n);if(Os&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=ic(as(r,i-1,i-1),-1);if(t.top==e.top){let n=ic(as(r,i,i+1),-1);if(n.top!=e.top)return sc(n,n.left<t.left)}}return e}{let e=i,t=i,a=n<0?1:-1;return n<0&&!i?(t++,a=-1):n>=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,sc(ic(as(r,e,t),a),a<0)}}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==ds(r))){let e=r.childNodes[i-1];if(e.nodeType==1)return cc(e.getBoundingClientRect(),!1)}if(a==null&&i<ds(r)){let e=r.childNodes[i];if(e.nodeType==1)return cc(e.getBoundingClientRect(),!0)}return cc(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==ds(r))){let e=r.childNodes[i-1],t=e.nodeType==3?as(e,ds(e)-+!o):e.nodeType==1&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return sc(ic(t,1),!1)}if(a==null&&i<ds(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?e.nodeType==3?as(e,0,+!o):e.nodeType==1?e:null:null;if(t)return sc(ic(t,-1),!0)}return sc(ic(r.nodeType==3?as(r):r,-n),n>=0)}function sc(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function cc(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function lc(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function uc(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return lc(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=oc(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(e.nodeType==1)t=e.getClientRects();else if(e.nodeType==3)t=as(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}var dc=/[\u0590-\u08ac]/;function fc(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!dc.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:lc(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!l.contains(u.nodeType==1?u:u.parentNode)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}var pc=null,mc=null,hc=!1;function gc(e,t,n){return pc==t&&mc==n?hc:(pc=t,mc=n,hc=n==`up`||n==`down`?uc(e,t,n):fc(e,t,n))}var _c=0,vc=1,yc=2,bc=3,xc=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=_c,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>ns(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node)){if(n&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))n=!1;else return i}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e||i instanceof Oc){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof Sc&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?ns(e.dom)+1:0}}{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,e&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?ns(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let a=n,o=0;;o++){let n=this.children[o],s=a+n.size;if(r==-1&&e<=s){let i=a+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=ns(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=ns(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if((Os||Ms)&&e==t){let{node:e,offset:t}=o;if(e.nodeType==3){if(u=!!(t&&e.nodeValue[t-1]==`
|
|
8
|
+
`),u&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:ns(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&(n.nodeName==`BR`||n.contentEditable==`false`)}}if(Os&&l.focusNode&&l.focusNode!=s.node&&l.focusNode.nodeType==1){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&Ms)&&cs(o.node,o.offset,l.anchorNode,l.anchorOffset)&&cs(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&Os)){c.collapse(o.node,o.offset);try{e!=t&&c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],a=n+i.size;if(n==a?e<=a&&t>=n:e<a&&t>n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?yc:vc,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=bc:i.markDirty(e-r,t-r);return}i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?yc:bc}n=a}this.dirty=yc}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?yc:vc;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},Sc=class extends xc{constructor(e,t,n,r){let i,a=t.type.toDOM;if(typeof a==`function`&&(a=a(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){if(a.nodeType!=1){let e=document.createElement(`span`);e.appendChild(a),a=e}a.contentEditable=`false`,a.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==_c&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!=`selection`||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},Cc=class extends xc{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},wc=class e extends xc{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return(!o||!o.dom)&&(o=bi.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&bc||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=bc&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=_c){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=_c}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=Gc(a,n,o,r)),t>0&&(a=Gc(a,0,t,r));for(let e=0;e<a.length;e++)a[e].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},Tc=class e extends xc{constructor(e,t,n,r,i,a,o,s,c){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(t,n,r,i,a,o){let s=a.nodeViews[n.type.name],c,l=s&&s(n,a,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=bi.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Ic(u,r,n),l?c=new kc(t,n,r,i,u,d||null,f,l,a,o+1):n.isText?new Dc(t,n,r,i,u,f,a):new e(t,n,r,i,u,d||null,f,a,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(e.preserveWhitespace=`full`),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Y.empty)}return e}matchesNode(e,t,n){return this.dirty==_c&&e.eq(this.node)&&Lc(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new zc(this,a&&a.node,e);Hc(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?ur.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,c,l)=>{s.syncToMarks(t.marks,n,e,l);let u;s.findNodeMatch(t,a,c,l)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,c,u,e)||s.updateNextNode(t,a,c,e,l,r)||s.addNode(t,a,c,e,r),r+=t.nodeSize}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==yc)&&(a&&this.protectLocalComposition(e,a),Ac(this.contentDOM,this.children,e),Ns&&Uc(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof Wa)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=Wc(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let a=new Cc(this,i,t,r);e.input.compositionNodes.push(a),this.children=Gc(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==bc||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=_c}updateOuterDeco(e){if(Lc(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=Pc(this.dom,this.nodeDOM,Nc(this.outerDeco,this.node,t),Nc(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}};function Ec(e,t,n,r,i){Ic(r,t,e);let a=new Tc(void 0,e,t,n,r,r,r,i,0);return a.contentDOM&&a.updateChildren(i,0),a}var Dc=class e extends Tc{constructor(e,t,n,r,i,a,o){super(e,t,n,r,i,null,a,o,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return this.dirty==bc||this.dirty!=_c&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=_c||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=_c,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=bc)}get domAtom(){return!1}isText(e){return this.node.text==e}},Oc=class extends xc{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==_c&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},kc=class extends Tc{constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,c,l),this.spec=s}update(e,t,n,r){if(this.dirty==bc)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function Ac(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a<t.length;a++){let o=t[a],s=o.dom;if(s.parentNode==e){for(;s!=r;)r=Rc(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof wc){let t=r?r.previousSibling:e.lastChild;Ac(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Rc(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var jc=function(e){e&&(this.nodeName=e)};jc.prototype=Object.create(null);var Mc=[new jc];function Nc(e,t,n){if(e.length==0)return Mc;let r=n?Mc[0]:new jc,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new jc(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new jc(t.isInline?`span`:`div`)),e==`class`?r.class=(r.class?r.class+` `:``)+a:e==`style`?r.style=(r.style?r.style+`;`:``)+a:e!=`nodeName`&&(r[e]=a))}}}return i}function Pc(e,t,n,r){if(n==Mc&&r==Mc)return t;let i=t;for(let t=0;t<r.length;t++){let a=r[t],o=n[t];if(t){let t;o&&o.nodeName==a.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==a.nodeName?i=t:(t=document.createElement(a.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=Mc[0],i=t)}Fc(i,o||Mc[0],a)}return i}function Fc(e,t,n){for(let r in t)r!=`class`&&r!=`style`&&r!=`nodeName`&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!=`class`&&r!=`style`&&r!=`nodeName`&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(` `).filter(Boolean):[],i=n.class?n.class.split(` `).filter(Boolean):[];for(let t=0;t<r.length;t++)i.indexOf(r[t])==-1&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)r.indexOf(i[t])==-1&&e.classList.add(i[t]);e.classList.length==0&&e.removeAttribute(`class`)}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function Ic(e,t,n){return Pc(e,e,Mc,Nc(t,n,e.nodeType!=1))}function Lc(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Rc(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var zc=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Bc(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,a=this.stack.length>>1,o=Math.min(a,e.length);for(;i<o&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<a;)this.destroyRest(),this.top.dirty=_c,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let i=-1,o=this.top.children.length;r<this.preMatch.index&&(o=Math.min(this.index+3,o));for(let t=this.index;t<o;t++){let n=this.top.children[t];if(n.matchesMark(e[a])&&!this.isLocked(n.dom)){i=t;break}}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=wc.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r<a;r++){let a=this.top.children[r];if(a.matchesNode(e,t,n)&&!this.preMatch.matched.has(a)){i=r;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let a=this.top.children[r];return a.dirty==bc&&a.dom==a.contentDOM&&(a.dirty=yc),a.update(e,t,n,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return-1}e=t}}updateNextNode(e,t,n,r,i,a){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof Tc){let c=this.preMatch.matched.get(s);if(c!=null&&c!=i)return!1;let l=s.dom,u,d=this.isLocked(l)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=bc&&Lc(t,s.outerDeco));if(!d&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(s,e,t,n,r,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=yc,u.updateChildren(r,a+1),u.dirty=_c),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!Lc(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=Tc.create(this.top,t,n,r,i,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let e of o.children)e.parent=o}return e.destroy(),o}addNode(e,t,n,r,i){let a=Tc.create(this.top,e,t,n,r,i);a.contentDOM&&a.updateChildren(r,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new Sc(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof wc;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Dc)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Ms||As)&&e&&e.dom.contentEditable==`false`&&this.addHackNode(`IMG`,t),this.addHackNode(`BR`,this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e==`IMG`&&(n.className=`ProseMirror-separator`,n.alt=``),e==`BR`&&(n.className=`ProseMirror-trailingBreak`);let r=new Oc(this.top,[],n,null);t==this.top?t.children.splice(this.index++,0,r):t.children.push(r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}};function Bc(e,t){let n=t,r=n.children.length,i=e.childCount,a=new Map,o=[];outer:for(;i>0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof wc)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function Vc(e,t){return e.type.side-t.type.side}function Hc(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(a,o),n),a+=o.nodeSize}return}let o=0,s=[],c=null;for(let l=0;;){let u,d;for(;o<i.length&&i[o].to==a;){let e=i[o++];e.widget&&(u?(d||=[u]).push(e):u=e)}if(u){if(d){d.sort(Vc);for(let e=0;e<d.length;e++)n(d[e],l,!!c)}else n(u,l,!!c)}let f,p;if(c)p=-1,f=c,c=null;else if(l<e.childCount)p=l,f=e.child(l++);else break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1);for(;o<i.length&&i[o].from<=a&&i[o].to>a;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<s.length;t++)s[t].to<e&&(e=s[t].to);e<m&&(c=f.cut(e-a),f=f.cut(0,e-a),m=e,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let h=f.isInline&&!f.isLeaf?s.filter(e=>!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function Uc(e){if(e.nodeName==`UL`||e.nodeName==`OL`){let t=e.style.cssText;e.style.cssText=t+`; list-style: square !important`,window.getComputedStyle(e).listStyle,e.style.cssText=t}}function Wc(e,t,n,r){for(let i=0,a=0;i<e.childCount&&a<=r;){let o=e.child(i++),s=a;if(a+=o.nodeSize,!o.isText)continue;let c=o.text;for(;i<e.childCount;){let t=e.child(i++);if(a+=t.nodeSize,!t.isText)break;c+=t.text}if(a>=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s<r?c.lastIndexOf(t,r-s-1):-1;if(e>=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function Gc(e,t,n,r,i){let a=[];for(let o=0,s=0;o<e.length;o++){let c=e[o],l=s,u=s+=c.size;l>=n||u<=t?a.push(c):(l<t&&a.push(c.slice(0,t-l,r)),i&&=(a.push(i),void 0),u>n&&a.push(c.slice(n-l,c.size,r)))}return a}function Kc(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(gs(n)){for(c=o;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&Ka.isSelectable(e)&&i.parent&&!(e.isInline&&ms(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new Ka(o==e?s:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let a=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[c,o]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!l){let n=t==`pointer`||e.state.selection.head<s.pos&&!a?1:-1;l=rl(e,u,s,n)}return l}function qc(e){return e.editable?e.hasFocus():al(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Jc(e,t=!1){let n=e.state.selection;if(tl(e,n),!qc(e))return;let r=e.input.mouseDown;if(!t&&As&&r){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&cs(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)&&r.delaySelUpdate()){e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)el(e);else{let{anchor:r,head:i}=n,a,o;Yc&&!(n instanceof Wa)&&(n.$from.parent.inlineContent||(a=Xc(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=Xc(e,n.to))),e.docView.setSelection(r,i,e,t),Yc&&(a&&Qc(a),o&&Qc(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&$c(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}var Yc=Ms||As&&js<63;function Xc(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,a=r?n.childNodes[r-1]:null;if(Ms&&i&&i.contentEditable==`false`)return Zc(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return Zc(i);if(a)return Zc(a)}}function Zc(e){return e.contentEditable=`true`,Ms&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Qc(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function $c(e){let t=e.dom.ownerDocument;t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener(`selectionchange`,e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard),setTimeout(()=>{(!qc(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function el(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,ns(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&Es&&Ds<=11&&(n.disabled=!0,n.disabled=!1)}function tl(e,t){if(t instanceof Ka){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(nl(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else nl(e)}function nl(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function rl(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||Wa.between(t,n,r)}function il(e){return e.editable&&!e.hasFocus()?!1:al(e)}function al(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function ol(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return cs(t.node,t.offset,n.anchorNode,n.anchorOffset)}function sl(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&Ba.findFrom(a,t)}function cl(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function ll(e,t,n){let r=e.state.selection;if(r instanceof Wa){if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return cl(e,new Wa(r.$anchor,a))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=sl(e.state,t);return n&&n instanceof Ka?cl(e,n):!1}if(!(Ps&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?Ka.isSelectable(i)?cl(e,new Ka(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):Ls?cl(e,new Wa(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1:!1}}else if(r instanceof Ka&&r.node.isInline)return cl(e,new Wa(t>0?r.$to:r.$from));else{let n=sl(e.state,t);return n?cl(e,n):!1}}function ul(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function dl(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`)}function fl(e,t){return t<0?pl(e):ml(e)}function pl(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(Os&&n.nodeType==1&&r<ul(n)&&dl(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let e=n.childNodes[r-1];if(dl(e,-1))i=n,a=--r;else if(e.nodeType==3)n=e,r=n.nodeValue.length;else break}}else if(hl(n))break;else{let t=n.previousSibling;for(;t&&dl(t,-1);)i=n.parentNode,a=ns(t),t=t.previousSibling;if(t)n=t,r=ul(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?vl(e,n,r):i&&vl(e,i,a)}function ml(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=ul(n),a,o;for(;;)if(r<i){if(n.nodeType!=1)break;let e=n.childNodes[r];if(dl(e,1))a=n,o=++r;else break}else if(hl(n))break;else{let t=n.nextSibling;for(;t&&dl(t,1);)a=t.parentNode,o=ns(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=ul(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&vl(e,a,o)}function hl(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function gl(e,t){for(;e&&t==e.childNodes.length&&!hs(e);)t=ns(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=0}}function _l(e,t){for(;e&&!t&&!hs(e);)t=ns(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function vl(e,t,n){if(t.nodeType!=3){let e,r;(r=gl(t,n))?(t=r,n=0):(e=_l(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(gs(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&Jc(e)},50)}function yl(e,t){let n=e.state.doc.resolve(t);if(!(As||Fs)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?`ltr`:`rtl`}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function bl(e,t,n){let r=e.state.selection;if(r instanceof Wa&&!r.empty||n.indexOf(`s`)>-1||Ps&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=sl(e.state,t);if(n&&n instanceof Ka)return cl(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof Ja?Ba.near(n,t):Ba.findFrom(n,t);return o?cl(e,o):!1}return!1}function xl(e,t){if(!(e.state.selection instanceof Wa))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function Sl(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Cl(e){if(!Ms||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable==`false`){let n=t.firstChild;Sl(e,n,`true`),setTimeout(()=>Sl(e,n,`false`),20)}return!1}function wl(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function Tl(e,t){let n=t.keyCode,r=wl(t);if(n==8||Ps&&n==72&&r==`c`)return xl(e,-1)||fl(e,-1);if(n==46&&!t.shiftKey||Ps&&n==68&&r==`c`)return xl(e,1)||fl(e,1);if(n==13||n==27)return!0;if(n==37||Ps&&n==66&&r==`c`){let t=n==37?yl(e,e.state.selection.from)==`ltr`?-1:1:-1;return ll(e,t,r)||fl(e,t)}if(n==39||Ps&&n==70&&r==`c`){let t=n==39?yl(e,e.state.selection.from)==`ltr`?1:-1:1;return ll(e,t,r)||fl(e,t)}return n==38||Ps&&n==80&&r==`c`?bl(e,-1,r)||fl(e,-1):n==40||Ps&&n==78&&r==`c`?Cl(e)||bl(e,1,r)||fl(e,1):!(r!=(Ps?`m`:`c`)||n!=66&&n!=73&&n!=89&&n!=90)}function El(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||bi.fromSchema(e.state.schema),s=Ll(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&l.nodeType==1&&(u=Fl[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&l.nodeType==1&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,`
|
|
9
|
+
|
|
10
|
+
`),slice:t}}function Dl(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return s=new fr(Y.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
|
11
|
+
`))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=bi.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=Bl(n),Ls&&Vl(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&e.nodeType!=1;)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||oi.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!Ol.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=Hl(Pl(s,+u[1],+u[2]),u[4]);else if(s=fr.maxOpen(kl(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=Pl(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}var Ol=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function kl(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&jl(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=Ml(a[a.length-1],i.length));let n=Al(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return Y.from(a)}return e}function Al(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,Y.from(e));return e}function jl(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=jl(e,t,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(Y.from(Al(n,e,i+1))))}}function Ml(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,Ml(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(Y.empty,!0);return e.copy(n.append(r))}function Nl(e,t,n,r,i,a){let o=t<0?e.firstChild:e.lastChild,s=o.content;return e.childCount>1&&(a=0),i<r-1&&(s=Nl(s,t,n,r,i+1,a)),i>=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(Y.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function Pl(e,t,n){return t<e.openStart&&(e=new fr(Nl(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new fr(Nl(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var Fl={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]},Il=null;function Ll(){return Il||=document.implementation.createHTMLDocument(`title`)}var Rl=null;function zl(e){let t=window.trustedTypes;return t?(Rl||=t.defaultPolicy||t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e}),Rl.createHTML(e)):e}function Bl(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=Ll().createElement(`div`),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&Fl[r[1].toLowerCase()])&&(e=i.map(e=>`<`+e+`>`).join(``)+e+i.map(e=>`</`+e+`>`).reverse().join(``)),n.innerHTML=zl(e),i)for(let e=0;e<i.length;e++)n=n.querySelector(i[e])||n;return n}function Vl(e){let t=e.querySelectorAll(As?`span:not([class]):not([style])`:`span.Apple-converted-space`);for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` `),r)}}function Hl(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:a,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=Y.from(t.create(r[e+1],i)),a++,o++}return new fr(i,a,o)}var Ul={},Wl={},Gl={touchstart:!0,touchmove:!0},Kl=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:``,button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function ql(e){for(let t in Ul){let n=Ul[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{Ql(e,t)&&!Zl(e,t)&&(e.editable||!(t.type in Wl))&&n(e,t)},Gl[t]?{passive:!0}:void 0)}Ms&&e.dom.addEventListener(`input`,()=>null),Xl(e)}function Jl(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Yl(e){e.input.mouseDown&&e.input.mouseDown.done(),e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function Xl(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Zl(e,t))})}function Zl(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function Ql(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function $l(e,t){!Zl(e,t)&&Ul[t.type]&&(e.editable||!(t.type in Wl))&&Ul[t.type](e,t)}Wl.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!hu(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Is&&As&&n.keyCode==13))){if(n.keyCode!=229&&e.domObserver.forceFlush(),Ns&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,_s(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||Tl(e,n)?n.preventDefault():Jl(e,`key`)}},Wl.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},Wl.keypress=(e,t)=>{let n=t;if(hu(e)||!n.charCode||n.ctrlKey&&!n.altKey||Ps&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof Wa)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}};function eu(e){return{left:e.clientX,top:e.clientY}}function tu(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function nu(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function ru(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n==`pointer`&&r.setMeta(`pointer`,!0),e.dispatch(r)}function iu(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&Ka.isSelectable(r)?(ru(e,new Ka(n),`pointer`),!0):!1}function au(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof Ka&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(Ka.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i!=null&&(ru(e,Ka.create(e.state.doc,i),`pointer`),!0)}function ou(e,t,n,r,i){return nu(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?au(e,n):iu(e,n))}function su(e,t,n,r){return nu(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function cu(e,t,n,r){return nu(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||lu(e,n,r)}function lu(e,t,n){if(n.button!=0)return!1;let r=uu(e,t,!0),i=e.state.doc;return r?(ru(e,r,`pointer`),r instanceof Wa&&i.eq(e.state.doc)&&(e.input.mouseDown=new nee(e,r)),!0):!1}function uu(e,t,n){let r=e.state.doc;if(t==-1)return r.inlineContent?Wa.create(r,0,r.content.size):null;let i=r.resolve(t);for(let e=i.depth+1;e>0;e--){let t=e>i.depth?i.nodeAfter:i.node(e),a=i.before(e);if(t.inlineContent)return Wa.create(r,a+1,a+1+t.content.size);if(n&&Ka.isSelectable(t))return Ka.create(r,a)}return null}function du(e){return yu(e)}var fu=Ps?`metaKey`:`ctrlKey`;Ul.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=du(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&tu(n,e.input.lastClick)&&!n[fu]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let o=e.posAtCoords(eu(n));o&&(a==`singleClick`?e.input.mouseDown=new mu(e,o,n,!!r):(a==`doubleClick`?su:cu)(e,o.pos,o.inside,n)?n.preventDefault():Jl(e,`pointer`))};var pu=class{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener(`mouseup`,this.up=this.up.bind(this)),e.root.addEventListener(`mousemove`,this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener(`mouseup`,this.up),this.view.root.removeEventListener(`mousemove`,this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}},mu=class extends pu{constructor(e,t,n,r){super(e),this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[fu],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.nodeDOM.nodeType==1?s.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof Ka&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!!(this.target&&Os&&!this.target.hasAttribute(`contentEditable`))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute(`contentEditable`,`false`)},20),this.view.domObserver.start()),Jl(e,`pointer`)}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute(`draggable`),this.mightDrag.setUneditable&&this.target.removeAttribute(`contentEditable`),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||Jc(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(eu(e))),this.updateAllowDefault(e),this.allowDefault||!t?Jl(this.view,`pointer`):ou(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Ms&&this.mightDrag&&!this.mightDrag.node.isAtom||As&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(ru(this.view,Ba.near(this.view.state.doc.resolve(t.pos)),`pointer`),e.preventDefault()):Jl(this.view,`pointer`)}move(e){this.updateAllowDefault(e),Jl(this.view,`pointer`),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}},nee=class extends pu{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),Jl(this.view,`pointer`);let t=this.view.posAtCoords(eu(e)),n=t&&uu(this.view,t.inside,!1);if(!n)return;let{doc:r}=this.view.state,i=this.startSelection,[a,o]=n.from<i.from?[i.to,n.from]:[i.from,n.to];ru(this.view,Wa.create(r,a,o),`pointer`)}};Ul.touchstart=e=>{e.input.lastTouch=Date.now(),du(e),Jl(e,`pointer`)},Ul.touchmove=e=>{e.input.lastTouch=Date.now(),Jl(e,`pointer`)},Ul.contextmenu=e=>du(e);function hu(e,t){return e.composing?!0:Ms&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var ree=Is?5e3:-1;Wl.compositionstart=Wl.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof Wa&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||As&&Fs&&iee(e)))e.markCursor=e.state.storedMarks||n.marks(),yu(e,!0),e.markCursor=null;else if(yu(e,!t.selection.empty),Os&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&n.nodeType==1&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(t.nodeType==3){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}gu(e,ree)};function iee(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable==`false`}Wl.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,gu(e,20))};function gu(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>yu(e),t))}function _u(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function vu(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=fs(t.focusNode,t.focusOffset),r=ps(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(e&&e.isText(n.nodeValue))return r}}return n||r}function yu(e,t=!1){if(!(Is&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),_u(e),t||e.docView&&e.docView.dirty){let n=Kc(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function bu(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement(`div`));n.appendChild(t),n.style.cssText=`position: fixed; left: -10000px; top: 10px`;let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}var xu=Es&&Ds<15||Ns&&Rs<604;Ul.copy=Wl.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=xu?null:n.clipboardData,{dom:o,text:s}=El(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):bu(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function Su(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function Cu(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?`textarea`:`div`));n||(r.contentEditable=`true`),r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?wu(e,r.value,null,i,t):wu(e,r.textContent,r.innerHTML,i,t)},50)}function wu(e,t,n,r,i){let a=Dl(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||fr.empty)))return!0;if(!a)return!1;let o=Su(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function Tu(e){let t=e.getData(`text/plain`)||e.getData(`Text`);if(t)return t;let n=e.getData(`text/uri-list`);return n?n.replace(/\r?\n/g,` `):``}Wl.paste=(e,t)=>{let n=t;if(e.composing&&!Is)return;let r=xu?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&wu(e,Tu(r),r.getData(`text/html`),i,n)?n.preventDefault():Cu(e,n)};var Eu=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},Du=Ps?`altKey`:`ctrlKey`;function Ou(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[Du]:!n}Ul.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(eu(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof Ka?i.to-1:i.to))){if(r&&r.mightDrag)o=Ka.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=Ka.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=El(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!As||js>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(xu?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,xu||n.dataTransfer.setData(`text/plain`,c),e.dragging=new Eu(l,Ou(e,n),o)},Ul.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},Wl.dragover=Wl.dragenter=(e,t)=>t.preventDefault(),Wl.drop=(e,t)=>{try{ku(e,t,e.dragging)}finally{e.dragging=null}};function ku(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(eu(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=Dl(e,Tu(t.dataTransfer),xu?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&Ou(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||fr.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?ya(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&Ka.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new Ka(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(rl(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}Ul.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add(`ProseMirror-focused`),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Jc(e)},20))},Ul.blur=(e,t)=>{let n=t;e.focused&&=(e.domObserver.stop(),e.dom.classList.remove(`ProseMirror-focused`),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),!1)},Ul.beforeinput=(e,t)=>{if(As&&Is&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,_s(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in Wl)Ul[e]=Wl[e];function Au(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var ju=class e{constructor(e,t){this.toDOM=e,this.spec=t||Iu,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new Pu(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Au(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},Mu=class e{constructor(e,t){this.attrs=e,this.spec=t||Iu}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new Pu(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&Au(this.attrs,t.attrs)&&Au(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},Nu=class e{constructor(e,t){this.attrs=e,this.spec=t||Iu}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let a=e.mapResult(t.to+r,-1);return a.deleted||a.pos<=i.pos?null:new Pu(i.pos-n,a.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&Au(this.attrs,t.attrs)&&Au(this.spec,t.spec)}destroy(){}},Pu=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new ju(n,r))}static inline(t,n,r,i){return new e(t,n,new Mu(r,i))}static node(t,n,r,i){return new e(t,n,new Nu(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Mu}get widget(){return this.type instanceof ju}},Fu=[],Iu={},Lu=class e{constructor(e,t){this.local=e.length?e:Fu,this.children=t.length?t:Fu}static create(e,t){return t.length?Gu(t,e,0,Iu):Ru}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==Ru||e.maps.length==0?this:this.mapInner(e,t,0,0,n||Iu)}mapInner(t,n,r,i,a){let o;for(let e=0;e<this.local.length;e++){let s=this.local[e].map(t,r,i);s&&s.type.valid(n,s)?(o||=[]).push(s):a.onRemove&&a.onRemove(this.local[e].spec)}return this.children.length?Bu(this.children,o||[],t,n,r,i,a):o?new e(o.sort(Ku),Fu):Ru}add(t,n){return n.length?this==Ru?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,a=0;t.forEach((e,t)=>{let o=t+r,s;if(s=Uu(n,e,o)){for(i||=this.children.slice();a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,o+1):i.splice(a,0,t,t+e.nodeSize,Gu(s,e,o+1,Iu)),a+=3}});let o=Vu(a?Wu(n):n,-r);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||o.splice(e--,1);return new e(o.length?this.local.concat(o).sort(Ku):this.local,i||this.children)}remove(e){return e.length==0||this==Ru?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,i=this.local;for(let e=0;e<r.length;e+=3){let i,a=r[e]+n,o=r[e+1]+n;for(let e=0,n;e<t.length;e++)(n=t[e])&&n.from>a&&n.to<o&&(t[e]=null,(i||=[]).push(n));if(!i)continue;r==this.children&&(r=this.children.slice());let s=r[e+2].removeInner(i,a+1);s==Ru?(r.splice(e,3),e-=3):r[e+2]=s}if(i.length){for(let e=0,r;e<t.length;e++)if(r=t[e])for(let e=0;e<i.length;e++)i[e].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):Ru}forChild(t,n){if(this==Ru)return this;if(n.isLeaf)return e.empty;let r,i;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>a&&t.type instanceof Mu){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;e<n&&(i||=[]).push(t.copy(e,n))}}if(i){let t=new e(i.sort(Ku),Fu);return r?new zu([t,r]):t}return r||Ru}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(e){return qu(this.localsInner(e))}localsInner(e){if(this==Ru)return Fu;if(e.inlineContent||!this.local.some(Mu.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof Mu||t.push(this.local[e]);return t}forEachSet(e){e(this)}};Lu.empty=new Lu([],[]),Lu.removeOverlap=qu;var Ru=Lu.empty,zu=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,Iu));return e.from(r)}forChild(t,n){if(n.isLeaf)return Lu.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=Ru&&(a instanceof e?r=r.concat(a.members):r.push(a))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length){if(!t)t=i;else{n&&=(t=t.slice(),!1);for(let e=0;e<i.length;e++)t.push(i[e])}}}return t?qu(n?t:t.sort(Ku)):Fu}static from(t){switch(t.length){case 0:return Ru;case 1:return t[0];default:return new e(t.every(e=>e instanceof Lu)?t:t.reduce((e,t)=>e.concat(t instanceof Lu?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function Bu(e,t,n,r,i,a,o){let s=e.slice();for(let e=0,t=a;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,a)=>{let o=a-i-(n-e);for(let i=0;i<s.length;i+=3){let a=s[i+1];if(a<0||e>a+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(s[t+1]==-2){c=!0,s[t+1]=-1;continue}let l=n.map(e[t]+a),u=l-i;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==Ru?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=Gu(Hu(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new Lu(t.sort(Ku),s)}function Vu(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new Pu(i.from+t,i.to+t,i.type))}return n}function Hu(e,t,n,r,i,a,o){function s(e,t){for(let a=0;a<e.local.length;a++){let s=e.local[a].map(r,i,t);s?n.push(s):o.onRemove&&o.onRemove(e.local[a].spec)}for(let n=0;n<e.children.length;n+=3)s(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)e[n+1]==-1&&s(e[n+2],t[n]+a+1);return n}function Uu(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,a;t<e.length;t++)(a=e[t])&&a.from>n&&a.to<r&&((i||=[]).push(a),e[t]=null);return i}function Wu(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Gu(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=Uu(e,t,o+n);if(s){a=!0;let e=Gu(s,t,n+o+1,r);e!=Ru&&i.push(o,o+t.nodeSize,e)}});let o=Vu(a?Wu(e):e,-n).sort(Ku);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new Lu(o,i):Ru}function Ku(e,t){return e.from-t.from||e.to-t.to}function qu(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let a=t[i];if(a.from==r.from){a.to!=r.to&&(t==e&&(t=e.slice()),t[i]=a.copy(a.from,r.to),Ju(t,i+1,a.copy(r.to,a.to)));continue}a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),Ju(t,i,r.copy(a.from,r.to)));break}}return t}function Ju(e,t,n){for(;t<e.length&&Ku(n,e[t])>0;)t++;e.splice(t,0,n)}function Yu(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=Ru&&t.push(r)}),e.cursorWrapper&&t.push(Lu.create(e.state.doc,[e.cursorWrapper.deco])),zu.from(t)}var Xu={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Zu=Es&&Ds<=11,Qu=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},$u=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Qu,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);Es&&Ds<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():Ms&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Zu&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Xu)),this.onCharData&&this.view.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener(`selectionchange`,this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener(`selectionchange`,this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(il(this.view)){if(this.suppressingSelectionUpdates)return Jc(this.view);if(Es&&Ds<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&cs(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=rs(n))t.add(n);for(let r=e.anchorNode;r;r=rs(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&il(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(i=i<0?n.from:Math.min(n.from,i),a=a<0?n.to:Math.max(n.to,a),n.typeOver&&(o=!0))}if(s.some(e=>e.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||As&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some(e=>e.type==`childList`&&e.removedNodes.length))){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&t.nodeType==1;){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(Os&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||ad(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&gs(n)&&(c=Kc(e))&&c.eq(Ba.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Jc(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),nd(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,od(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Jc(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),r.nodeType==3&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(Es&&Ds<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:a}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!a||Array.prototype.indexOf.call(e.addedNodes,a)<0)&&(i=a)}let a=r&&r.parentNode==e.target?ns(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?ns(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}return e.type==`attributes`?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}},ed=new WeakMap,td=!1;function nd(e){if(!ed.has(e)&&(ed.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Os,td)return;console.warn(`ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.`),td=!0}}function rd(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return cs(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function id(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return rd(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener(`beforeinput`,r,!0),document.execCommand(`indent`),e.dom.removeEventListener(`beforeinput`,r,!0),n?rd(e,n):null}function ad(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function od(e,t){let{focusNode:n,focusOffset:r}=e.domSelectionRange();for(let i of t)if(i.parentNode?.nodeName==`TR`){let t=i.nextSibling;for(;t&&t.nodeName!=`TD`&&t.nodeName!=`TH`;)t=t.nextSibling;if(t){let a=t;for(;;){let e=a.firstChild;if(!e||e.nodeType!=1||e.contentEditable==`false`||/^(BR|IMG)$/.test(e.nodeName))break;a=e}a.insertBefore(i,a.firstChild),n==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function sd(e,t,n){let{node:r,fromOffset:i,toOffset:a,from:o,to:s}=e.docView.parseRange(t,n),c=e.domSelectionRange(),l,u=c.anchorNode;if(u&&e.dom.contains(u.nodeType==1?u:u.parentNode)&&(l=[{node:u,offset:c.anchorOffset}],gs(c)||l.push({node:c.focusNode,offset:c.focusOffset})),As&&e.input.lastKeyCode===8)for(let e=a;e>i;e--){let t=r.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){a=e;break}if(!n||n.size)break}let d=e.state.doc,f=e.someProp(`domParser`)||oi.fromSchema(e.state.schema),p=d.resolve(o),m=null,h=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:a,preserveWhitespace:p.parent.type.whitespace!=`pre`||`full`,findPositions:l,ruleFromNode:cd,context:p});if(l&&l[0].pos!=null){let e=l[0].pos,t=l[1]&&l[1].pos;t??=e,m={anchor:e+o,head:t+o}}return{doc:h,sel:m,from:o,to:s}}function cd(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName==`BR`&&e.parentNode){if(Ms&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}if(e.parentNode.lastChild==e||Ms&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName==`IMG`&&e.getAttribute(`mark-placeholder`))return{ignore:!0};return null}var ld=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function ud(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Kc(e,t);if(n&&!e.state.selection.eq(n)){if(As&&Is&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,_s(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=sd(e,t,n),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p=`end`):(f=e.state.selection.from,p=`start`),e.input.lastKeyCode=null;let m=hd(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(Ns&&e.input.lastIOSEnter>Date.now()-225||Is)&&i.some(e=>e.nodeType==1&&!ld.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,_s(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m){if(r&&c instanceof Wa&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=dd(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof Wa&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),Es&&Ds<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),v=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((Ns&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&h.pos<l.doc.content.size&&(!h.sameParent(g)||!h.parent.inlineContent)&&h.pos<g.pos&&!/\S/.test(l.doc.textBetween(h.pos,g.pos,``,``)))&&e.someProp(`handleKeyDown`,t=>t(e,_s(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&pd(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,_s(8,`Backspace`)))){Is&&As&&e.domObserver.suppressSelectionUpdates();return}As&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),Is&&!v&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,_s(13,`Enter`))})},20));let y=m.start,b=m.endA,x=t=>{let n=t||e.state.tr.replace(y,b,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=dd(e,n.doc,l.sel);t&&!(As&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||Es&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v){if(h.pos==g.pos){Es&&Ds<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Jc(e),20));let t=x(e.state.tr.delete(y,b)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(S=fd(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=x(e.state.tr);S.type==`add`?t.addMark(y,b,S.mark):t.removeMark(y,b,S.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-+!g.textOffset){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,y,b));e.someProp(`handleTextInput`,r=>r(e,y,b,t,n))||e.dispatch(n())}else e.dispatch(x())}else e.dispatch(x())}function dd(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:rl(e,t.resolve(n.anchor),t.resolve(n.head))}function fd(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)a=n[e].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o=`add`,c=e=>e.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;e<t.childCount;e++)l.push(c(t.child(e)));if(Y.from(l).eq(e))return{mark:s,type:o}}function pd(e,t,n,r,i){if(n-t<=i.pos-r.pos||md(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.isTextblock){let e=a.nodeAfter;return e!=null&&n==t+e.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=e.resolve(md(a,!0,!0));return!o.parent.isTextblock||o.pos>n||md(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function md(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function hd(e,t,n,r,i){let a=e.findDiffStart(t,n),o=n+e.size,s=n+t.size;if(a==null)return null;let{a:c,b:l}=e.findDiffEnd(t,o,s);if(i==`end`){let e=Math.max(0,a-Math.min(c,l));r-=c+e-a}if(c<a&&o<s){let e=r<=a&&r>=c?a-r:0;a-=e,l=a+(l-c),c=a}else if(l<a){let e=r<=a&&r>=l?a-r:0;a-=e,c=a+(c-l),l=a}return{start:a,endA:c,endB:l}}var gd=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Kl,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Cd),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement(`div`),e&&(e.appendChild?e.appendChild(this.dom):typeof e==`function`?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=yd(this),vd(this),this.nodeViews=xd(this),this.docView=Ec(this.state.doc,_d(this),Yu(this),this.dom,this),this.domObserver=new $u(this,(e,t,n,r)=>ud(this,e,t,n,r)),this.domObserver.start(),ql(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Xl(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Cd),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(_u(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=xd(this);Sd(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&Xl(this),this.editable=yd(this),vd(this);let o=Yu(this),s=_d(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&Us(this);if(i){this.domObserver.stop();let t=l&&(Es||As)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&bd(n.selection,e.selection);if(l){let n=As?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=vu(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=Ec(e.doc,s,o,this.dom,this)),n&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(t=!0)}let i=this.input.mouseDown;t||!(i&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&ol(this)&&i.delaySelUpdate())?Jc(this,t):(tl(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&Gs(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(e.nodeType==1?e:e.parentNode)&&!this.someProp(`handleScrollToSelection`,e=>e(this))){if(this.state.selection instanceof Ka){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Hs(this,t.getBoundingClientRect(),e)}else Hs(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new Eu(e.slice,e.move,r<0?void 0:Ka.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(Es){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable==`false`)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Js(this.dom),Jc(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return nc(this,e)}coordsAtPos(e,t=1){return oc(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return gc(this,t||this.state,e)}pasteHTML(e,t){return wu(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return wu(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return El(this,e)}destroy(){this.docView&&(Yl(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Yu(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,ss())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return $l(this,e)}domSelectionRange(){let e=this.domSelection();return e?Ms&&this.root.nodeType===11&&vs(this.dom.ownerDocument)==this.dom&&id(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};gd.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function _d(e){let t=Object.create(null);return t.class=`ProseMirror`,t.contenteditable=String(e.editable),e.someProp(`attributes`,n=>{if(typeof n==`function`&&(n=n(e.state)),n)for(let e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[Pu.node(0,e.state.doc.content.size,t)]}function vd(e){if(e.markCursor){let t=document.createElement(`img`);t.className=`ProseMirror-separator`,t.setAttribute(`mark-placeholder`,`true`),t.setAttribute(`alt`,``),e.cursorWrapper={dom:t,deco:Pu.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function yd(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function bd(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function xd(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function Sd(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function Cd(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}for(var wd={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},Td={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},Ed=typeof navigator<`u`&&/Mac/.test(navigator.platform),Dd=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Od=0;Od<10;Od++)wd[48+Od]=wd[96+Od]=String(Od);for(var Od=1;Od<=24;Od++)wd[Od+111]=`F`+Od;for(var Od=65;Od<=90;Od++)wd[Od]=String.fromCharCode(Od+32),Td[Od]=String.fromCharCode(Od);for(var kd in wd)Td.hasOwnProperty(kd)||(Td[kd]=wd[kd]);function Ad(e){var t=!(Ed&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Dd&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?Td:wd)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var jd=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Md=typeof navigator<`u`&&/Win/.test(navigator.platform);function Nd(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))jd?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function Pd(e){let t=Object.create(null);for(let n in e)t[Nd(n)]=e[n];return t}function Fd(e,t,n=!0){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n&&t.shiftKey&&(e=`Shift-`+e),e}function Id(e){return new co({props:{handleKeyDown:Ld(e)}})}function Ld(e){let t=Pd(e);return function(e,n){let r=Ad(n),i,a=t[Fd(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[Fd(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(Md&&n.ctrlKey&&n.altKey)&&(i=wd[n.keyCode])&&i!=r){let r=t[Fd(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var Rd=Object.defineProperty,zd=(e,t)=>{for(var n in t)Rd(e,n,{get:t[n],enumerable:!0})};function Bd(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,a=n.storedMarks,n}}}var Vd=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:Bd({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(o)]))}};return o}},Hd={};zd(Hd,{blur:()=>Ud,clearContent:()=>Wd,clearNodes:()=>Gd,command:()=>Kd,createParagraphNear:()=>qd,cut:()=>Jd,deleteCurrentNode:()=>Yd,deleteNode:()=>Zd,deleteRange:()=>Qd,deleteSelection:()=>nf,enter:()=>rf,exitCode:()=>af,extendMarkRange:()=>ff,first:()=>pf,focus:()=>bf,forEach:()=>xf,insertContent:()=>Sf,insertContentAt:()=>Of,joinBackward:()=>jf,joinDown:()=>Af,joinForward:()=>Mf,joinItemBackward:()=>Nf,joinItemForward:()=>Pf,joinTextblockBackward:()=>Ff,joinTextblockForward:()=>If,joinUp:()=>kf,keyboardShortcut:()=>zf,lift:()=>Vf,liftEmptyBlock:()=>Hf,liftListItem:()=>Uf,newlineInCode:()=>Wf,resetAttributes:()=>qf,scrollIntoView:()=>Jf,selectAll:()=>Yf,selectNodeBackward:()=>Xf,selectNodeForward:()=>Zf,selectParentNode:()=>Qf,selectTextblockEnd:()=>$f,selectTextblockStart:()=>ep,setContent:()=>np,setMark:()=>tm,setMeta:()=>nm,setNode:()=>rm,setNodeSelection:()=>im,setTextDirection:()=>am,setTextSelection:()=>om,sinkListItem:()=>sm,splitBlock:()=>lm,splitListItem:()=>um,toggleList:()=>gm,toggleMark:()=>_m,toggleNode:()=>vm,toggleWrap:()=>ym,undoInputRule:()=>bm,unsetAllMarks:()=>xm,unsetMark:()=>Sm,unsetTextDirection:()=>Cm,updateAttributes:()=>wm,wrapIn:()=>Tm,wrapInList:()=>Em});var Ud=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),Wd=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),Gd=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=$i(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},Kd=e=>t=>e(t),qd=()=>({state:e,dispatch:t})=>Mo(e,t),Jd=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new Wa(r.doc.resolve(Math.max(o-1,0)))),!0},Yd=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function Xd(e,t){if(typeof e==`string`){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var Zd=e=>({tr:t,state:n,dispatch:r})=>{let i=Xd(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},Qd=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},$d=e=>e.content?/^text(\*|\+)/.test(e.content):!1,ef=(e,t,n)=>{if(!e.parent.isInline||n===`left`&&e.pos>e.start()||n===`right`&&e.pos<e.end())return e.pos;let r=t.nodes[e.parent.type.name].spec;return $d(r)?n===`left`?e.start()-1:e.end()+1:e.pos},tf=(e,t,n)=>({from:ef(e,n,`left`),to:ef(t,n,`right`)}),nf=()=>({state:e,dispatch:t})=>{let{$from:n,$to:r}=e.selection;if(e.selection.empty)return!1;let{from:i,to:a}=tf(n,r,e.schema);return t&&(e.tr.deleteRange(i,a).scrollIntoView(),t(e.tr)),!0},rf=()=>({commands:e})=>e.keyboardShortcut(`Enter`),af=()=>({state:e,dispatch:t})=>jo(e,t);function of(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function sf(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:of(t[r])?t[r].test(e[r]):t[r]===e[r])}function cf(e,t,n={}){return e.find(e=>e.type===t&&sf(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function lf(e,t,n={}){return!!cf(e,t,n)}function uf(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(e=>e.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!cf([...r.node.marks],t,n))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&lf([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&lf([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function df(e,t){if(typeof e==`string`){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var ff=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=df(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=uf(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=Wa.create(o,e.from,e.to);n.setSelection(t)}}return!0},pf=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function mf(e){return e instanceof Wa}function hf(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function gf(e,t=null){if(!t)return null;let n=Ba.atStart(e),r=Ba.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?Wa.create(e,hf(0,i,a),hf(e.content.size,i,a)):Wa.create(e,hf(t,i,a),hf(t,i,a))}function _f(){return navigator.platform===`Android`||/android/i.test(navigator.userAgent)}function vf(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function yf(){return typeof navigator<`u`&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}var bf=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(vf()||_f())&&r.dom.focus(),yf()&&!vf()&&!_f()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(a&&e===null&&!mf(n.state.selection))return o(),!0;let s=gf(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},xf=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),Sf=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),Cf=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&Cf(r)}return e};function wf(e){if(typeof window>`u`)throw Error(`[tiptap error]: there is no window object available, so this function cannot be used`);let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return Cf(n)}function Tf(e,t,n){if(e instanceof jr||e instanceof Y)return e;n={slice:!0,parseOptions:{},...n};let r=typeof e==`object`&&!!e,i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return Y.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),Tf(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new ni({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:`inline*`,group:`block`,parseDOM:[{tag:`*`,getAttrs:e=>(r=!0,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?oi.fromSchema(a).parseSlice(wf(e),n.parseOptions):oi.fromSchema(a).parse(wf(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=oi.fromSchema(t);return n.slice?r.parseSlice(wf(e),n.parseOptions).content:r.parse(wf(e),n.parseOptions)}return Tf(``,t,n)}function Ef(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Ki||i instanceof qi))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(Ba.near(e.doc.resolve(o),n))}var Df=e=>!(`type`in e),Of=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,o=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{`collaboration`in a.storage&&typeof a.storage.collaboration==`object`&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},s={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{Tf(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=Tf(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0;if((Df(i)?i:[i]).forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let f;if(u){if(Array.isArray(t))f=t.map(e=>e.text||``).join(``);else if(t instanceof Y){let e=``;t.forEach(t=>{t.text&&(e+=t.text)}),f=e}else f=typeof t==`object`&&t&&t.text?t.text:t;r.insertText(f,c,l)}else{f=i;let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,a=t.isText||t.isTextblock,o=t.content.size>0;n&&a&&o&&d&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&Ef(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:f}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:f})}return!0},kf=()=>({state:e,dispatch:t})=>Eo(e,t),Af=()=>({state:e,dispatch:t})=>Do(e,t),jf=()=>({state:e,dispatch:t})=>ho(e,t),Mf=()=>({state:e,dispatch:t})=>Co(e,t),Nf=()=>({state:e,dispatch:t,tr:n})=>{try{let r=ga(e.doc,e.selection.$from.pos,-1);return r!=null&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},Pf=()=>({state:e,dispatch:t,tr:n})=>{try{let r=ga(e.doc,e.selection.$from.pos,1);return r!=null&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},Ff=()=>({state:e,dispatch:t})=>go(e,t),If=()=>({state:e,dispatch:t})=>_o(e,t);function Lf(){return typeof navigator<`u`&&/Mac/.test(navigator.platform)}function Rf(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e+=1){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))vf()||Lf()?o=!0:i=!0;else throw Error(`Unrecognized modifier name: ${n}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}var zf=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=Rf(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0};function Bf(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?Xd(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>!o||o.name===e.node.type.name).filter(e=>sf(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var Vf=(e,t={})=>({state:n,dispatch:r})=>Bf(n,Xd(e,n.schema),t)?Oo(n,r):!1,Hf=()=>({state:e,dispatch:t})=>No(e,t),Uf=e=>({state:t,dispatch:n})=>Qo(Xd(e,t.schema))(t,n),Wf=()=>({state:e,dispatch:t})=>ko(e,t);function Gf(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function Kf(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var qf=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=Gf(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=Xd(e,r.schema)),s===`mark`&&(o=df(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,Kf(e.attrs,t))),o&&e.marks.length&&e.marks.forEach(a=>{o===a.type&&(c=!0,i&&n.addMark(r,r+e.nodeSize,o.create(Kf(a.attrs,t))))})})}),c},Jf=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),Yf=()=>({tr:e,dispatch:t})=>{if(t){let t=new Ja(e.doc);e.setSelection(t)}return!0},Xf=()=>({state:e,dispatch:t})=>bo(e,t),Zf=()=>({state:e,dispatch:t})=>wo(e,t),Qf=()=>({state:e,dispatch:t})=>Io(e,t),$f=()=>({state:e,dispatch:t})=>Ho(e,t),ep=()=>({state:e,dispatch:t})=>Vo(e,t);function tp(e,t,n={},r={}){return Tf(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var np=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(r.preserveWhitespace!==`full`){let s=tp(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return o&&a.replaceWith(0,c.content.size,s).setMeta(`preventUpdate`,!n),!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function rp(e,t){let n=df(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function ip(e,t){let n=new Ra(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function ap(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function op(e,t){let n=[];return e.descendants((e,r)=>{t(e)&&n.push({node:e,pos:r})}),n}function sp(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function cp(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function lp(e){return t=>cp(t.$from,e)}function up(e,t,n){return e.config[t]===void 0&&e.parent?up(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?up(e.parent,t,n):null}):e.config[t]}function dp(e){return e.map(e=>{let t=up(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...dp(t())]:e}).flat(10)}function fp(e,t){let n=bi.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function pp(e){return typeof e==`function`}function mp(e,t=void 0,...n){return pp(e)?t?e.bind(t)(...n):e(...n):e}function hp(e={}){return Object.keys(e).length===0&&e.constructor===Object}function gp(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function _p(e){let t=[],{nodeExtensions:n,markExtensions:r}=gp(e),i=[...n,...r],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(e=>e.name!==`text`).map(e=>e.name),s=r.map(e=>e.name),c=[...o,...s];return e.forEach(e=>{let n=up(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:e.types===`*`?c:e.types===`nodes`?o:e.types===`marks`?s:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}),i.forEach(e=>{let n=up(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function vp(e){let t=[],n=``,r=!1,i=!1,a=0,o=e.length;for(let s=0;s<o;s+=1){let o=e[s];if(o===`'`&&!i){r=!r,n+=o;continue}if(o===`"`&&!r){i=!i,n+=o;continue}if(!r&&!i){if(o===`(`){a+=1,n+=o;continue}if(o===`)`&&a>0){--a,n+=o;continue}if(o===`;`&&a===0){t.push(n),n=``;continue}}n+=o}return n&&t.push(n),t}function yp(e){let t=[],n=vp(e||``),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],i=r.indexOf(`:`);if(i===-1)continue;let a=r.slice(0,i).trim(),o=r.slice(i+1).trim();a&&o&&t.push([a,o])}return t}function bp(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=new Map([...yp(n[e]),...yp(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function xp(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>bp(e,t),{})}function Sp(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`||e!==`false`&&e:e}function Cp(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):Sp(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function wp(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&hp(t)?!1:t!=null))}function Tp(e){let t={};return!e?.attribute?.isRequired&&`default`in(e?.attribute||{})&&(t.default=e.attribute.default),e?.attribute?.validate!==void 0&&(t.validate=e.attribute.validate),[e.name,t]}function Ep(e,t){let n=_p(e),{nodeExtensions:r,markExtensions:i}=gp(e),a=r.find(e=>up(e,`topNode`))?.name;return new ni({topNode:a,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=wp({...e.reduce((e,t)=>{let n=up(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:mp(up(r,`content`,a)),marks:mp(up(r,`marks`,a)),group:mp(up(r,`group`,a)),inline:mp(up(r,`inline`,a)),atom:mp(up(r,`atom`,a)),selectable:mp(up(r,`selectable`,a)),draggable:mp(up(r,`draggable`,a)),code:mp(up(r,`code`,a)),whitespace:mp(up(r,`whitespace`,a)),linebreakReplacement:mp(up(r,`linebreakReplacement`,a)),defining:mp(up(r,`defining`,a)),isolating:mp(up(r,`isolating`,a)),attrs:Object.fromEntries(i.map(Tp))}),s=mp(up(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>Cp(e,i)));let c=up(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:xp(e,i)}));let l=up(r,`renderText`,a);return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=wp({...e.reduce((e,t)=>{let n=up(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:mp(up(r,`inclusive`,a)),excludes:mp(up(r,`excludes`,a)),group:mp(up(r,`group`,a)),spanning:mp(up(r,`spanning`,a)),code:mp(up(r,`code`,a)),attrs:Object.fromEntries(i.map(Tp))}),s=mp(up(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>Cp(e,i)));let c=up(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:xp(e,i)})),[r.name,o]}))})}function Dp(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function Op(e){return e.sort((e,t)=>{let n=up(e,`priority`)||100,r=up(t,`priority`)||100;return n>r?-1:+(n<r)})}function kp(e){let t=Op(dp(e)),n=Dp(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),t}function Ap(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`
|
|
12
|
+
|
|
13
|
+
`,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;e.isText&&(s+=(e?.text)?.slice(Math.max(r,n)-n,i-n))}),s}function jp(e,t){return Ap(e,{from:0,to:e.content.size},t)}function Mp(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function Np(e,t){let n=Xd(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function Pp(e,t){let n=Gf(typeof t==`string`?t:t.name,e.schema);return n===`node`?Np(e,t):n===`mark`?rp(e,t):{}}function Fp(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function Ip(e){let t=Fp(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function Lp(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),Ip(r)}function Rp(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=uf(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{e&&e?.nodeSize!==void 0&&r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var zp=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null;){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]};function Bp(e,t){return t.nodes[e]||t.marks[e]||null}function Vp(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}var Hp=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n};function Up(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?df(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!a||a.name===e.type.name).find(e=>sf(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>!a||a.name===e.mark.type.name).filter(e=>sf(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>!a||e.mark.type!==a&&e.mark.type.excludes(a)).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function Wp(e,t,n={}){if(!t)return Bf(e,null,n)||Up(e,null,n);let r=Gf(t,e.schema);return r===`node`?Bf(e,t,n):r===`mark`&&Up(e,t,n)}var Gp=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=lp(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},Kp=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function qp(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function Jp(e,t){let{nodeExtensions:n}=gp(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=mp(up(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`&&i.split(` `).includes(`list`)}function Yp(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(Yp(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function Xp(e){return e instanceof Ka}var Zp=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function Qp(e,t){let n=t.mapping.mapResult(e.position);return{position:new Zp(n.pos),mapResult:n}}function $p(e){return new Zp(e)}function em(e,t,n){let{selection:r}=t,i=null;if(mf(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}var tm=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=df(e,r.schema);if(i){if(o){let e=rp(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})})}return em(r,n,c)},nm=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),rm=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=Xd(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>Uo(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>Uo(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},im=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=hf(e,0,n.content.size),i=Ka.create(n,r);t.setSelection(i)}return!0},am=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=r,o,s;return typeof t==`number`?(o=t,s=t):t&&`from`in t&&`to`in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},om=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=Wa.atStart(n).from,o=Wa.atEnd(n).to,s=hf(r,a,o),c=hf(i,a,o),l=Wa.create(n,s,c);t.setSelection(l)}return!0},sm=e=>({state:t,dispatch:n})=>ts(Xd(e,t.schema))(t,n);function cm(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}var lm=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=Vp(l,s.node().type.name,s.node().attrs);if(a instanceof Ka&&a.node.isBlock)return!s.parentOffset||!da(o,s.pos)?!1:(r&&(e&&cm(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:ap(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=da(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&da(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(a instanceof Wa&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f)){let e=t.mapping.map(s.before()),n=t.doc.resolve(e);s.node(-1).canReplaceWith(n.index(),n.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&cm(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},um=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=Xd(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=Y.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=Y.from(s.node(t).copy(e));let i=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,a={...Vp(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(Y.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new fr(e,4-r,0));let u=-1;n.doc.nodesBetween(l,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(Wa.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...Vp(d,u.type.name,u.attrs),...t},m={...Vp(d,s.node().type.name,s.node().attrs),...t};n.delete(s.pos,c.pos);let h=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!da(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,h).scrollIntoView(),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0};function dm(e){return!e||e===`1`?null:e}function fm(e,t){return dm(e)===dm(t)}var pm=(e,t)=>{let n=lp(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===i?.type&&pa(e.doc,n.pos))||!fm(n.node.attrs.type,i?.attrs.type)||e.join(n.pos),!0},mm=(e,t)=>{let n=lp(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===i?.type&&pa(e.doc,r))||!fm(n.node.attrs.type,i?.attrs.type)||e.join(r),!0};function hm(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=t.resolve(1),i=t.resolve(n.nodeSize-1);return Wa.between(r,i)}var gm=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=Xd(e,o.schema),m=Xd(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:v}=h,y=_.blockRange(v),b=g||h.$to.parentOffset&&h.$from.marks();if(!y)return!1;let x=lp(e=>Jp(e.type.name,d))(h),S=h.from===0&&h.to===o.doc.content.size,C=o.doc.content.content,w=C.length===1?C[0]:null,T=S&&w&&Jp(w.type.name,d)?{node:w,pos:0,depth:0}:null,E=x??T,D=!!x&&y.depth>=1&&y.depth-x.depth<=1,O=!!T;if((D||O)&&E){if(E.node.type===p)return S&&O?c().command(({tr:e,dispatch:t})=>{let n=hm(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(Jp(E.node.type.name,d)&&p.validContent(E.node.content))return c().command(()=>(a.setNodeMarkup(E.pos,p),!0)).command(()=>pm(a,p)).command(()=>mm(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>pm(a,p)).command(()=>mm(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=b.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>pm(a,p)).command(()=>mm(a,p)).run()},_m=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=df(e,r.schema);return Up(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},vm=(e,t,n={})=>({state:r,commands:i})=>{let a=Xd(e,r.schema),o=Xd(t,r.schema),s=Bf(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},ym=(e,t={})=>({state:n,commands:r})=>{let i=Xd(e,n.schema);return Bf(n,i,t)?r.lift(i):r.wrapIn(i,t)},bm=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let t=e.tr,n=a.transform;for(let e=n.steps.length-1;e>=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},xm=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{ignoreClearable:i=!1}=e,{selection:a}=t,{empty:o,ranges:s}=a;if(o)return!0;let{nonClearableMarks:c}=r.extensionManager;if(n){let e=Object.values(r.schema.marks).filter(e=>i||!c.includes(e.name));s.forEach(n=>{for(let r of e)t.removeMark(n.$from.pos,n.$to.pos,r)})}return!0},Sm=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=df(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=uf(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},Cm=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,a,o;return typeof e==`number`?(a=e,o=e):e&&`from`in e&&`to`in e?(a=e.from,o=e.to):(a=i.from,o=i.to),r&&t.doc.nodesBetween(a,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},wm=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=Gf(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=Xd(e,r.schema)),s===`mark`&&(o=df(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{let s=e.$from.pos,l=e.$to.pos,u,d,f,p;n.selection.empty?r.doc.nodesBetween(s,l,(e,t)=>{a&&a===e.type&&(c=!0,f=Math.max(t,s),p=Math.min(t+e.nodeSize,l),u=t,d=e)}):r.doc.nodesBetween(s,l,(e,r)=>{r<s&&a&&a===e.type&&(c=!0,f=Math.max(r,s),p=Math.min(r+e.nodeSize,l),u=r,d=e),r>=s&&r<=l&&(a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type&&(c=!0,i)){let i=Math.max(r,s),c=Math.min(r+e.nodeSize,l);n.addMark(i,c,o.create({...a.attrs,...t}))}}))}),d&&(u!==void 0&&i&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),o&&d.marks.length&&d.marks.forEach(e=>{o===e.type&&i&&n.addMark(f,p,o.create({...e.attrs,...t}))}))}),c},Tm=(e,t={})=>({state:n,dispatch:r})=>tee(Xd(e,n.schema),t)(n,r),Em=(e,t={})=>({state:n,dispatch:r})=>Yo(Xd(e,n.schema),t)(n,r),Dm=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}};function Om(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof Ka){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;--i}return!1}function km(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:``}]`);if(r!==null)return r;let i=document.createElement(`style`);return t&&i.setAttribute(`nonce`,t),i.setAttribute(`data-tiptap-style${n?`-${n}`:``}`,``),i.innerHTML=e,document.getElementsByTagName(`head`)[0].appendChild(i),i}function Am(e,t){let n=e.getAttribute(`style`);if(!n)return null;let r=n.split(`;`).map(e=>e.trim()).filter(Boolean),i=t.toLowerCase();for(let e=r.length-1;e>=0;--e){let t=r[e],n=t.indexOf(`:`);if(n!==-1&&t.slice(0,n).trim().toLowerCase()===i)return t.slice(n+1).trim()}return null}function jm(e){return typeof e==`number`}function Mm(e){return Object.prototype.toString.call(e).slice(8,-1)}function Nm(e){return Mm(e)===`Object`&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}zd({},{createAtomBlockMarkdownSpec:()=>Im,createBlockMarkdownSpec:()=>Lm,createInlineMarkdownSpec:()=>Bm,parseAttributes:()=>Pm,parseIndentedBlocks:()=>Vm,renderNestedMarkdownContent:()=>Hm,serializeAttributes:()=>Fm});function Pm(e){if(!e?.trim())return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([\w-]+)/g);i&&(t.class=i.map(e=>e.trim().slice(1)).join(` `));let a=r.match(/(?:^|\s)#([\w-]+)/);a&&(t.id=a[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{let i=parseInt(r.match(/__QUOTED_(\d+)__/)?.[1]||`0`,10),a=n[i];a&&(t[e]=a.slice(1,-1))});let o=r.replace(/(?:^|\s)\.([\w-]+)/g,``).replace(/(?:^|\s)#([\w-]+)/g,``).replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,``).trim();return o&&o.split(/\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function Fm(e){if(!e||Object.keys(e).length===0)return``;let t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{e!==`class`&&e!==`id`&&(n===!0?t.push(e):n!==!1&&n!=null&&t.push(`${e}="${String(n)}"`))}),t.join(` `)}function Im(e){let{nodeName:t,name:n,parseAttributes:r=Pm,serializeAttributes:i=Fm,defaultAttributes:a={},requiredAttributes:o=[],allowedAttributes:s}=e,c=n||t,l=e=>{if(!s)return e;let t={};return s.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let r={...a,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${c}(?:\\s|$)`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,i){let a=RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),s=e.match(a);if(!s)return;let l=s[1]||``,u=r(l);if(!o.find(e=>!(e in u)))return{type:t,raw:s[0],attributes:u}}},renderMarkdown:e=>{let t=l(e.attrs||{}),n=i(t),r=n?` {${n}}`:``;return`:::${c}${r} :::`}}}function Lm(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=Pm,serializeAttributes:a=Fm,defaultAttributes:o={},content:s=`block`,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let i;if(r){let t=r(e);i=typeof t==`string`?[{type:`text`,text:t}]:t}else i=s===`block`?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);let a={...o,...e.attributes};return n.createNode(t,a,i)},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${l}`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),o=e.match(a);if(!o)return;let[c,u=``]=o,d=i(u),f=1,p=c.length,m=``,h=/^:::([\w-]*)(\s.*)?/gm,g=e.slice(p);for(h.lastIndex=0;;){let n=h.exec(g);if(n===null)break;let i=n.index,a=n[1];if(!n[2]?.endsWith(`:::`)){if(a)f+=1;else if(--f,f===0){let a=g.slice(0,i);m=a.trim();let o=e.slice(0,p+i+n[0].length),c=[];if(m){if(s===`block`)for(c=r.blockTokens(a),c.forEach(e=>{e.text&&(!e.tokens||e.tokens.length===0)&&(e.tokens=r.inlineTokens(e.text))});c.length>0;){let e=c[c.length-1];if(e.type===`paragraph`&&(!e.text||e.text.trim()===``))c.pop();else break}else c=r.inlineTokens(m)}return{type:t,raw:o,attributes:d,content:m,tokens:c}}}}}},renderMarkdown:(e,t)=>{let n=u(e.attrs||{}),r=a(n),i=r?` {${r}}`:``,o=t.renderChildren(e.content||[],`
|
|
14
|
+
|
|
15
|
+
`);return`:::${l}${i}
|
|
16
|
+
|
|
17
|
+
${o}
|
|
18
|
+
|
|
19
|
+
:::`}}}function Rm(e){if(!e.trim())return{};let t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;r!==null;){let[,i,a,o]=r;t[i]=a||o,r=n.exec(e)}return t}function zm(e){return Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(` `)}function Bm(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=Rm,serializeAttributes:a=zm,defaultAttributes:o={},selfClosing:s=!1,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{let r=typeof n==`string`?n:n.name,i=typeof n==`string`?void 0:n.skipIfDefault;if(r in e){let n=e[r];if(i!==void 0&&n===i)return;t[r]=n}}),t},d=l.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return{parseMarkdown:(e,n)=>{let i={...o,...e.attributes};if(s)return n.createNode(t,i);let a=r?r(e):e.content||``;return a?n.createNode(t,i,[n.createTextNode(a)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:`inline`,start(e){let t=RegExp(s?`\\[${d}\\s*[^\\]]*\\]`:`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(s?`^\\[${d}\\s*([^\\]]*)\\]`:`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),o=e.match(a);if(!o)return;let c=``,l=``;if(s){let[,e]=o;l=e}else{let[,e,t]=o;l=e,c=t||``}let u=i(l.trim());return{type:t,raw:o[0],content:c.trim(),attributes:u}}},renderMarkdown:e=>{let t=``;r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>e.type===`text`).map(e=>e.text).join(``));let n=u(e.attrs||{}),i=a(n),o=i?` ${i}`:``;return s?`[${l}${o}]`:`[${l}${o}]${t}[/${l}]`}}}function Vm(e,t,n){let r=e.split(`
|
|
20
|
+
`),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o<r.length;){let e=r[o],c=e.match(t.itemPattern);if(!c){if(i.length>0)break;if(e.trim()===``){o+=1,a=`${a}${e}
|
|
21
|
+
`;continue}return}let l=t.extractItemData(c),{indentLevel:u,mainContent:d}=l;a=`${a}${e}
|
|
22
|
+
`;let f=[d];for(o+=1;o<r.length;){let e=r[o];if(e.trim()===``){let t=r.slice(o+1).findIndex(e=>e.trim()!==``);if(t===-1)break;if((r[o+1+t].match(/^(\s*)/)?.[1]?.length||0)>u){f.push(e),a=`${a}${e}
|
|
23
|
+
`,o+=1;continue}break}if((e.match(/^(\s*)/)?.[1]?.length||0)>u)f.push(e),a=`${a}${e}
|
|
24
|
+
`,o+=1;else break}let p,m=f.slice(1);if(m.length>0){let e=m.map(e=>e.slice(u+s)).join(`
|
|
25
|
+
`);e.trim()&&(p=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let h=t.createToken(l,p);i.push(h)}if(i.length!==0)return{items:i,raw:a}}function Hm(e,t,n,r){if(!e||!Array.isArray(e.content))return``;let i=typeof n==`function`?n(r):n,[a,...o]=e.content,s=`${i}${t.renderChildren([a])}`;return o&&o.length>0&&o.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=r.split(`
|
|
26
|
+
`).map(e=>e?t.indent(e):t.indent(``)).join(`
|
|
27
|
+
`);s+=e.type===`paragraph`?`
|
|
28
|
+
|
|
29
|
+
${n}`:`
|
|
30
|
+
${n}`}}),s}function Um(e,t){let n={...e};return Nm(e)&&Nm(t)&&Object.keys(t).forEach(r=>{Nm(t[r])&&Nm(e[r])?n[r]=Um(e[r],t[r]):n[r]=t[r]}),n}function Wm(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged&&t.view.dispatch(a)}var Gm=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},Km=(e,t)=>{if(of(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn(`[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".`),r.push(n.replaceWith)),r};function qm(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o}=e,{view:s}=t;if(s.composing)return!1;let c=s.state.doc.resolve(n);if(c.parent.type.spec.code||(c.nodeBefore||c.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let l=!1,u=Hp(c)+i;return a.forEach(e=>{if(l)return;let a=Km(u,e.find);if(!a)return;let c=s.state.tr,d=Bd({state:s.state,transaction:c}),f={from:n-(a[0].length-i.length),to:r},{commands:p,chain:m,can:h}=new Vd({editor:t,state:d});e.handler({state:d,range:f,match:a,commands:p,chain:m,can:h})!==null&&c.steps.length&&(e.undoable&&c.setMeta(o,{transform:c,from:n,to:r,text:i}),s.dispatch(c),l=!0)}),l}function Jm(e){let{editor:t,rules:n}=e,r=new co({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let s=e.getMeta(`applyInputRules`);return s&&setTimeout(()=>{let{text:e}=s;e=typeof e==`string`?e:fp(Y.from(e),a.schema);let{from:i}=s,o=i+e.length;qm({editor:t,from:i,to:o,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return qm({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&qm({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1;let{$cursor:a}=e.state.selection;return a?qm({editor:t,from:a.pos,to:a.pos,text:`
|
|
31
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var Ym=class{constructor(e={}){this.type=`extendable`,this.parent=null,this.child=null,this.name=``,this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...mp(up(this,`addOptions`,{name:this.name}))}}get storage(){return{...mp(up(this,`addStorage`,{name:this.name,options:this.options}))}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>Um(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name=`name`in e?e.name:t.parent.name,t}},Xm=class e extends Ym{constructor(){super(...arguments),this.type=`mark`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},Zm=class{constructor(e){this.find=e.find,this.handler=e.handler}},Qm=(e,t,n)=>{if(of(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]};function $m(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new Vd({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{if(e.type?.spec?.code||!(e.isText||e.isTextblock||e.isInline))return;let f=e.content?.size??e.nodeSize??0,p=Math.max(r,t),m=Math.min(i,t+f);p>=m||Qm(e.isText?e.text||``:e.textBetween(p-t,m-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=p+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(f)})}),d.every(e=>e!==null)}var eh=null,th=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function nh(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,s;try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}let c=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let c=e.tr,l=Bd({state:e,transaction:c});if($m({editor:t,state:l,from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:s})&&c.steps.length){try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}return o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,c}};return n.map(e=>new co({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(eh=t)},i=()=>{eh&&=null};return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,s=t,!a){let e=eh;e?.isEditable&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let s=t[0],l=s.getMeta(`uiEvent`)===`paste`&&!i,u=s.getMeta(`uiEvent`)===`drop`&&!a,d=s.getMeta(`applyPasteRules`),f=!!d;if(!l&&!u&&!f)return;if(f){let{text:t}=d;t=typeof t==`string`?t:fp(Y.from(t),r.schema);let{from:n}=d,i=n+t.length,a=th(t);return c({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let p=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if(jm(p)&&m&&p!==m.b)return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}var rh=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=kp(e),this.schema=Ep(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=up(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Bp(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this;return Op([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Bp(t.name,this.schema)},r=[],i=up(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&up(t,`exitable`,n)&&(a.ArrowRight=()=>Xm.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));a={...a,...t}}let o=Id(a);r.push(o);let s=up(t,`addInputRules`,n);if(qp(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=Jm({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=up(t,`addPasteRules`,n);if(qp(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=nh({editor:e,rules:t});r.push(...n)}}let l=up(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r})}get attributes(){return _p(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=gp(this.extensions);return Object.fromEntries(t.filter(e=>!!up(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=up(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Xd(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>{let l=xp(r,n);return i({node:r,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:l})}]:[]}))}dispatchTransaction(e){let{editor:t}=this;return Op([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Bp(n.name,this.schema)},i=up(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return Op([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Bp(n.name,this.schema)},i=up(n,`transformPastedHTML`,r);return i?(t,n)=>{let a=e(t,n);return i.call(r,a)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=gp(this.extensions);return Object.fromEntries(t.filter(e=>!!up(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=up(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:df(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=xp(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{Wm(i,e,t)}})}]:[]}))}destroy(){this.extensions.forEach(e=>{let t=e;for(;t.parent;){let e=t.parent;e.child===t&&(e.child=null),t=e}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Bp(e.name,this.schema)};e.type===`mark`&&((mp(up(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name),(mp(up(e,`clearable`,t))??!0)||this.nonClearableMarks.push(e.name));let n=up(e,`onBeforeCreate`,t),r=up(e,`onCreate`,t),i=up(e,`onUpdate`,t),a=up(e,`onSelectionUpdate`,t),o=up(e,`onTransaction`,t),s=up(e,`onFocus`,t),c=up(e,`onBlur`,t),l=up(e,`onDestroy`,t);n&&this.editor.on(`beforeCreate`,n),r&&this.editor.on(`create`,r),i&&this.editor.on(`update`,i),a&&this.editor.on(`selectionUpdate`,a),o&&this.editor.on(`transaction`,o),s&&this.editor.on(`focus`,s),c&&this.editor.on(`blur`,c),l&&this.editor.on(`destroy`,l)})}};rh.resolve=kp,rh.sort=Op,rh.flatten=dp;var ih={};zd(ih,{ClipboardTextSerializer:()=>oh,Commands:()=>sh,Delete:()=>ch,Drop:()=>lh,Editable:()=>uh,FocusEvents:()=>fh,Keymap:()=>ph,Paste:()=>mh,Tabindex:()=>hh,TextDirection:()=>gh,focusEventsPluginKey:()=>dh});var ah=class e extends Ym{constructor(){super(...arguments),this.type=`extension`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},oh=ah.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new co({key:new fo(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,a=Mp(n),{blockSeparator:o}=this.options,s={...o===void 0?{}:{blockSeparator:o},textSerializers:a};return[...i.ranges].sort((e,t)=>e.$from.pos-t.$from.pos).map(({$from:e,$to:t})=>Ap(r,{from:e.pos,to:t.pos},s)).join(o??`
|
|
32
|
+
|
|
33
|
+
`)}}})]}}),sh=ah.create({name:`commands`,addCommands(){return{...Hd}}}),ch=ah.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){let n=()=>{var n;if(((n=this.editor.options.coreExtensionOptions?.delete)?.filterTransaction)?.call(n,e)??e.getMeta(`y-sync$`))return;let r=ip(e.before,[e,...t]);Lp(r).forEach(t=>{r.mapping.mapResult(t.oldRange.from).deletedAfter&&r.mapping.mapResult(t.oldRange.to).deletedBefore&&r.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,i)=>{let a=i+n.nodeSize-2,o=t.oldRange.from<=i&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:i,to:a,newFrom:r.mapping.map(i),newTo:r.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:r})})});let i=r.mapping;r.steps.forEach((t,n)=>{if(t instanceof Ui){let a=i.slice(n).map(t.from,-1),o=i.slice(n).map(t.to),s=i.invert().map(a,-1),c=i.invert().map(o),l=a>0&&r.doc.nodeAt(a-1)?.marks.some(e=>e.eq(t.mark)),u=r.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark));this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:a,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:r})}})};this.editor.options.coreExtensionOptions?.delete?.async??!0?setTimeout(n,0):n()}}),lh=ah.create({name:`drop`,addProseMirrorPlugins(){return[new co({key:new fo(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),uh=ah.create({name:`editable`,addProseMirrorPlugins(){return[new co({key:new fo(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),dh=new fo(`focusEvents`),fh=ah.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new co({key:dh,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),ph=ah.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:Ba.atStart(r).from===o;return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return vf()||Lf()?i:r},addProseMirrorPlugins(){return[new co({key:new fo(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`));if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=Ba.atStart(t.doc).from,l=Ba.atEnd(t.doc).to;if(a||o!==c||s!==l||!Yp(n.doc))return;let u=n.tr,d=Bd({state:n,transaction:u}),{commands:f}=new Vd({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),mh=ah.create({name:`paste`,addProseMirrorPlugins(){return[new co({key:new fo(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),hh=ah.create({name:`tabindex`,addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new co({key:new fo(`tabindex`),props:{attributes:()=>!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:this.options.value??`0`}}})]}}),gh=ah.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=gp(this.extensions);return[{types:e.filter(e=>e.name!==`text`).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute(`dir`);return t&&(t===`ltr`||t===`rtl`||t===`auto`)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new co({key:new fo(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),_h=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){return this.actualDepth??this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+ +!this.node.isText}get parent(){if(this.depth===0)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new e(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,o=n.isInline,s=this.pos+r+ +!a;if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let c=this.resolvedPos.doc.resolve(s);if(!i&&!o&&c.depth<=this.depth)return;let l=new e(c,this.editor,i,i||o?n:null);i&&(l.actualDepth=this.depth+1),t.push(l)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e){if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r}r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||this.children.length===0)return r;let i=Object.keys(t);return this.children.forEach(a=>{n&&r.length>0||(a.node.type.name===e&&i.every(e=>t[e]===a.node.attrs[e])&&r.push(a),!(n&&r.length>0)&&(r=r.concat(a.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},vh=`.ProseMirror {
|
|
34
|
+
position: relative;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.ProseMirror {
|
|
38
|
+
word-wrap: break-word;
|
|
39
|
+
white-space: pre-wrap;
|
|
40
|
+
white-space: break-spaces;
|
|
41
|
+
-webkit-font-variant-ligatures: none;
|
|
42
|
+
font-variant-ligatures: none;
|
|
43
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ProseMirror [contenteditable="false"] {
|
|
47
|
+
white-space: normal;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
51
|
+
white-space: pre-wrap;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.ProseMirror pre {
|
|
55
|
+
white-space: pre-wrap;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
img.ProseMirror-separator {
|
|
59
|
+
display: inline !important;
|
|
60
|
+
border: none !important;
|
|
61
|
+
margin: 0 !important;
|
|
62
|
+
width: 0 !important;
|
|
63
|
+
height: 0 !important;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.ProseMirror-gapcursor {
|
|
67
|
+
display: none;
|
|
68
|
+
pointer-events: none;
|
|
69
|
+
position: absolute;
|
|
70
|
+
margin: 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.ProseMirror-gapcursor:after {
|
|
74
|
+
content: "";
|
|
75
|
+
display: block;
|
|
76
|
+
position: absolute;
|
|
77
|
+
top: -2px;
|
|
78
|
+
width: 20px;
|
|
79
|
+
border-top: 1px solid black;
|
|
80
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@keyframes ProseMirror-cursor-blink {
|
|
84
|
+
to {
|
|
85
|
+
visibility: hidden;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.ProseMirror-hideselection *::selection {
|
|
90
|
+
background: transparent;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
94
|
+
background: transparent;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.ProseMirror-hideselection * {
|
|
98
|
+
caret-color: transparent;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
102
|
+
display: block;
|
|
103
|
+
}`,yh=class extends Dm{constructor(e={}){super(),this.css=null,this.className=`tiptap`,this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<`u`?document.createElement(`div`):null,content:``,injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:Qp,createMappablePosition:$p},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on(`beforeCreate`,this.options.onBeforeCreate),this.emit(`beforeCreate`,{editor:this}),this.on(`mount`,this.options.onMount),this.on(`unmount`,this.options.onUnmount),this.on(`contentError`,this.options.onContentError),this.on(`create`,this.options.onCreate),this.on(`update`,this.options.onUpdate),this.on(`selectionUpdate`,this.options.onSelectionUpdate),this.on(`transaction`,this.options.onTransaction),this.on(`focus`,this.options.onFocus),this.on(`blur`,this.options.onBlur),this.on(`destroy`,this.options.onDestroy),this.on(`drop`,({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on(`paste`,({event:e,slice:t})=>this.options.onPaste(e,t)),this.on(`delete`,this.options.onDelete);let t=this.createDoc(),n=gf(t,this.options.autofocus);this.editorState=oo.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>`u`)throw Error(`[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`);this.createView(e),this.emit(`mount`,{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit(`create`,{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove==`function`?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn(`Failed to remove CSS element:`,e)}this.css=null,this.emit(`unmount`,{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<`u`&&(this.css=km(vh,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit(`update`,{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t===`state`)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=pp(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t=typeof e==`string`?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){let e=[...this.options.enableCoreExtensions?[uh,oh.configure({blockSeparator:this.options.coreExtensionOptions?.clipboardTextSerializer?.blockSeparator}),sh,fh,ph,hh.configure({value:this.options.coreExtensionOptions?.tabindex?.value}),lh,mh,ch,gh.configure({direction:this.options.textDirection})].filter(e=>typeof this.options.enableCoreExtensions!=`object`||this.options.enableCoreExtensions[e.name]!==!1):[],...this.options.extensions].filter(e=>[`extension`,`node`,`mark`].includes(e?.type));this.extensionManager=new rh(e,this)}createCommandManager(){this.commandManager=new Vd({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=tp(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||![`[tiptap error]: Invalid JSON content`,`[tiptap error]: Invalid HTML content`].includes(t.message))throw t;this.emit(`contentError`,{editor:this,error:t,disableCollaboration:()=>{`collaboration`in this.storage&&typeof this.storage.collaboration==`object`&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>e.name!==`collaboration`),this.createExtensionManager()}}),e=tp(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,a=t.transformPastedHTML,o=this.extensionManager.transformPastedHTML(a);this.editorView=new gd(e,{...t,attributes:{role:`textbox`,...t?.attributes},dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.prependClass(),this.injectCSS();let c=this.view.dom;c.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>this.capturedTransaction?.step(e));return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),a=this.state;if(this.emit(`beforeTransaction`,{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit(`transaction`,{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit(`selectionUpdate`,{editor:this,transaction:e});let o=n.findLast(e=>e.getMeta(`focus`)||e.getMeta(`blur`)),s=o?.getMeta(`focus`),c=o?.getMeta(`blur`);s&&this.emit(`focus`,{editor:this,event:s.event,transaction:o}),c&&this.emit(`blur`,{editor:this,event:c.event,transaction:o}),!(e.getMeta(`preventUpdate`)||!n.some(e=>e.docChanged)||a.doc.eq(t.doc))&&this.emit(`update`,{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return Pp(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return Wp(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return fp(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`
|
|
104
|
+
|
|
105
|
+
`,textSerializers:n={}}=e||{};return jp(this.state.doc,{blockSeparator:t,textSerializers:{...Mp(this.schema),...n}})}get isEmpty(){return Yp(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit(`destroy`),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){let t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText?t.nodeAfter:null;return new _h(t,this,!1,n)}get $doc(){return this.$pos(0)}};function bh(e){return new Gm({find:e.find,handler:({state:t,range:n,match:r})=>{let i=mp(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(Rp(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;l<n.to&&a.delete(l,n.to),c>n.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function xh(e){return new Gm({find:e.find,handler:({state:t,range:n,match:r})=>{let i=mp(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function Sh(e){return new Gm({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=mp(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)},undoable:e.undoable})}function Ch(e){return new Gm({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=mp(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&ta(s,e.type,a);if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks();if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&pa(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}var wh=e=>`touches`in e,Th=class{constructor(e){this.directions=[`bottom-left`,`bottom-right`,`top-left`,`top-right`],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:``,wrapper:``,handle:``,resizing:``},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.clientX-this.startX,n=e.clientY-this.startY;this.handleResize(t,n)},this.handleTouchMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.touches[0];if(!t)return;let n=t.clientX-this.startX,r=t.clientY-this.startY;this.handleResize(n,r)},this.handleMouseUp=()=>{if(!this.isResizing)return;let e=this.element.offsetWidth,t=this.element.offsetHeight;this.onCommit(e,t),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp)},this.handleKeyDown=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!1)},this.node=e.node,this.editor=e.editor,this.element=e.element,this.element.draggable=!1,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,e.options?.min&&(this.minSize={...this.minSize,...e.options.min}),e.options?.max&&(this.maxSize=e.options.max),e?.options?.directions&&(this.directions=e.options.directions),e.options?.preserveAspectRatio&&(this.preserveAspectRatio=e.options.preserveAspectRatio),e.options?.className&&(this.classNames={container:e.options.className.container||``,wrapper:e.options.className.wrapper||``,handle:e.options.className.handle||``,resizing:e.options.className.resizing||``}),e.options?.createCustomHandle&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on(`update`,this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){return this.contentElement??null}handleEditorUpdate(){let e=this.editor.isEditable;e!==this.lastEditableState&&(this.lastEditableState=e,e?e&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(e,t,n){return e.type===this.node.type&&(this.node=e,!this.onUpdate||this.onUpdate(e,t,n))}destroy(){this.isResizing&&(this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off(`update`,this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){let e=document.createElement(`div`);return e.dataset.resizeContainer=``,e.dataset.node=this.node.type.name,e.style.display=this.node.type.isInline?`inline-flex`:`flex`,this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){let e=document.createElement(`div`);return e.style.position=`relative`,e.style.display=`block`,e.dataset.resizeWrapper=``,this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){let t=document.createElement(`div`);return t.dataset.resizeHandle=e,t.style.position=`absolute`,this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){let n=t.includes(`top`),r=t.includes(`bottom`),i=t.includes(`left`),a=t.includes(`right`);n&&(e.style.top=`0`),r&&(e.style.bottom=`0`),i&&(e.style.left=`0`),a&&(e.style.right=`0`),(t===`top`||t===`bottom`)&&(e.style.left=`0`,e.style.right=`0`),(t===`left`||t===`right`)&&(e.style.top=`0`,e.style.bottom=`0`)}attachHandles(){this.directions.forEach(e=>{let t;t=this.createCustomHandle?this.createCustomHandle(e):this.createHandle(e),t instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(e)),this.createCustomHandle||this.positionHandle(t,e),t.addEventListener(`mousedown`,t=>this.handleResizeStart(t,e)),t.addEventListener(`touchstart`,t=>this.handleResizeStart(t,e)),this.handleMap.set(e,t),this.wrapper.appendChild(t)})}removeHandles(){this.handleMap.forEach(e=>e.remove()),this.handleMap.clear()}applyInitialSize(){let e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,wh(e)?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState=`true`,this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener(`mousemove`,this.handleMouseMove),document.addEventListener(`touchmove`,this.handleTouchMove),document.addEventListener(`mouseup`,this.handleMouseUp),document.addEventListener(`keydown`,this.handleKeyDown),document.addEventListener(`keyup`,this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;let n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,e,t),a=this.applyConstraints(r,i,n);this.element.style.width=`${a.width}px`,this.element.style.height=`${a.height}px`,this.onResize&&this.onResize(a.width,a.height)}calculateNewDimensions(e,t,n){let r=this.startWidth,i=this.startHeight,a=e.includes(`right`),o=e.includes(`left`),s=e.includes(`bottom`),c=e.includes(`top`);return a?r=this.startWidth+t:o&&(r=this.startWidth-t),s?i=this.startHeight+n:c&&(i=this.startHeight-n),(e===`right`||e===`left`)&&(r=this.startWidth+(a?t:-t)),(e===`top`||e===`bottom`)&&(i=this.startHeight+(s?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,i,e):{width:r,height:i}}applyConstraints(e,t,n){if(!n){let n=Math.max(this.minSize.width,e),r=Math.max(this.minSize.height,t);return this.maxSize?.width&&(n=Math.min(this.maxSize.width,n)),this.maxSize?.height&&(r=Math.min(this.maxSize.height,r)),{width:n,height:r}}let r=e,i=t;return r<this.minSize.width&&(r=this.minSize.width,i=r/this.aspectRatio),i<this.minSize.height&&(i=this.minSize.height,r=i*this.aspectRatio),this.maxSize?.width&&r>this.maxSize.width&&(r=this.maxSize.width,i=r/this.aspectRatio),this.maxSize?.height&&i>this.maxSize.height&&(i=this.maxSize.height,r=i*this.aspectRatio),{width:r,height:i}}applyAspectRatio(e,t,n){return n===`left`||n===`right`?{width:e,height:e/this.aspectRatio}:n===`top`||n===`bottom`?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}},Eh=class e extends Ym{constructor(){super(...arguments),this.type=`node`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function Dh(e){return new Zm({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=mp(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let i=c.search(/\S/),u=n.from+c.indexOf(s),d=u+s.length;if(Rp(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>u).length)return null;d<n.to&&o.delete(d,n.to),u>n.from&&o.delete(n.from+i,u),l=n.from+i+s.length,o.addMark(n.from+i,l,e.type.create(a||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}function Oh(e){return h((t,n)=>({get(){return t(),e},set(t){e=t,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}var kh=class extends yh{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=Oh(this.view.state),this.reactiveExtensionStorage=Oh(this.extensionStorage),this.on(`beforeTransaction`,({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage}),f(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){let n=super.registerPlugin(e,t);return this.reactiveState&&(this.reactiveState.value=n),n}unregisterPlugin(e){let t=super.unregisterPlugin(e);return this.reactiveState&&t&&(this.reactiveState.value=t),t}},Ah=B({name:`EditorContent`,props:{editor:{default:null,type:Object}},setup(e){let t=i(),n=T();return A(()=>{let i=e.editor;i&&i.options.element&&t.value&&ce(()=>{if(!t.value||!i.view.dom?.parentNode)return;let e=r(t.value);t.value.append(...i.view.dom.parentNode.childNodes),i.contentComponent=n.ctx._,n&&(i.appContext={...n.appContext,provides:n.provides}),i.setOptions({element:e}),i.createNodeViews()})}),ne(()=>{let t=e.editor;t&&(t.contentComponent=null,t.appContext=null)}),{rootEl:t}},render(){return v(`div`,{ref:e=>{this.rootEl=e}})}});B({name:`NodeViewContent`,props:{as:{type:String,default:`div`}},inject:{nodeViewContentRef:{default:void 0}},mounted(){let e=this.nodeViewContentRef;e&&this.$el&&e(this.$el)},beforeUnmount(){let e=this.nodeViewContentRef;e&&e(null)},render(){return v(this.as,{style:{whiteSpace:`pre-wrap`},"data-node-view-content":``})}}),B({name:`NodeViewWrapper`,props:{as:{type:String,default:`div`}},inject:[`onDragStart`,`decorationClasses`],render(){var e;return v(this.as,{class:this.decorationClasses,style:{whiteSpace:`normal`},"data-node-view-wrapper":``,onDragstart:this.onDragStart},(e=this.$slots).default?.call(e))}});var jh=(e={})=>{let t=s();return I(()=>{t.value=new kh(e)}),ne(()=>{var e;(e=t.value)==null||e.destroy()}),t};B({name:`MarkViewContent`,props:{as:{type:String,default:`span`}},render(){return v(this.as,{style:{whiteSpace:`inherit`},"data-mark-view-content":``})}});var Mh=(e,t)=>{if(e===`slot`)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);return[e,r,n]};function Nh(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=Nh(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function Ph(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=Ph(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var Fh=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return Nh(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Ph(this,e,t,n)}findIndex(e){if(e==0)return Lh(0,e);if(e==this.size)return Lh(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?Lh(t+1,i):Lh(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};Fh.empty=new Fh([],0);var Ih={index:0,offset:0};function Lh(e,t){return Ih.index=e,Ih.offset=t,Ih}function Rh(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!Rh(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Rh(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var zh=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Rh(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};zh.none=[];var Bh=class extends Error{},Vh=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=Uh(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(Hh(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(Fh.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};Vh.empty=new Vh(Fh.empty,0,0);function Hh(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(Hh(a.content,t-i-1,n-i-1)))}function Uh(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=Uh(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function Wh(e,t,n){if(n.openStart>e.depth)throw new Bh(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Bh(`Inconsistent open depths`);return Gh(e,t,n,0)}function Gh(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=Gh(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return Xh(a,Qh(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return Xh(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=$h(n,e);return Xh(a,Zh(e,i,o,t,r))}}function Kh(e,t){if(!t.type.compatibleContent(e.type))throw new Bh(`Cannot join `+t.type.name+` onto `+e.type.name)}function qh(e,t,n){let r=e.node(n);return Kh(r,t.node(n)),r}function Jh(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Yh(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(Jh(e.nodeAfter,r),a++));for(let e=a;e<o;e++)Jh(i.child(e),r);t&&t.depth==n&&t.textOffset&&Jh(t.nodeBefore,r)}function Xh(e,t){return e.type.checkContent(t),e.copy(t)}function Zh(e,t,n,r,i){let a=e.depth>i&&qh(e,t,i+1),o=r.depth>i&&qh(n,r,i+1),s=[];return Yh(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(Kh(a,o),Jh(Xh(a,Zh(e,t,n,r,i+1)),s)):(a&&Jh(Xh(a,Qh(e,t,i+1)),s),Yh(t,n,i,s),o&&Jh(Xh(o,Qh(n,r,i+1)),s)),Yh(r,null,i,s),new Fh(s)}function Qh(e,t,n){let r=[];return Yh(null,e,n,r),e.depth>n&&Jh(Xh(qh(e,t,n+1),Qh(e,t,n+1)),r),Yh(t,null,n,r),new Fh(r)}function $h(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(Fh.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var eg=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return zh.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new ig(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=rg.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else rg.set(t,r=new tg);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%ng,i}},tg=class{constructor(){this.elts=[],this.i=0}},ng=12,rg=new WeakMap,ig=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},ag=Object.create(null),og=class e{constructor(e,t,n,r=zh.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||Fh.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&Rh(this.attrs,t||e.defaultAttrs||ag)&&zh.sameSet(this.marks,n||zh.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return Vh.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new Vh(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return Wh(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return eg.resolveCached(this,e)}resolveNoCache(e){return eg.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),sg(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=Fh.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=zh.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!zh.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=Fh.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};og.prototype.text=void 0;function sg(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var cg=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new lg(t,n);if(r.next==null)return e.empty;let i=ug(r);r.next&&r.err(`Unexpected trailing text`);let a=bg(_g(i));return xg(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return Fh.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
|
|
106
|
+
`)}};cg.empty=new cg(!0);var lg=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function ug(e){let t=[];do t.push(dg(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function dg(e){let t=[];do t.push(fg(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function fg(e){let t=gg(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=mg(e,t);else break;return t}function pg(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function mg(e,t){let n=pg(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:pg(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function hg(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function gg(e){if(e.eat(`(`)){let t=ug(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=hg(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function _g(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function vg(e,t){return t-e}function yg(e,t){let n=[];return r(t),n.sort(vg);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function bg(e){let t=Object.create(null);return n(yg(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);yg(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new cg(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(vg);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function xg(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}var Sg=65535,Cg=2**16;function wg(e,t){return e+t*Cg}function Tg(e){return e&Sg}function Eg(e){return(e-(e&Sg))/Cg}var Dg=1,Og=2,kg=4,Ag=8,jg=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Ag)>0}get deletedBefore(){return(this.delInfo&(Dg|kg))>0}get deletedAfter(){return(this.delInfo&(Og|kg))>0}get deletedAcross(){return(this.delInfo&kg)>0}},Mg=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=Tg(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+Eg(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:wg(o/3,e-s),f=e==s?Og:e==u?Dg:kg;return(t<0?e!=s:e!=u)&&(f|=Ag),new jg(a,f,d)}r+=l-c}return n?e+r:new jg(e+r,0,null)}touches(e,t){let n=0,r=Tg(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};Mg.empty=new Mg([]);var Ng=Object.create(null),Pg=class{getMap(){return Mg.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=Ng[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Ng)throw RangeError(`Duplicate use of step JSON ID `+e);return Ng[e]=t,t.prototype.jsonID=e,t}},Fg=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof Bh)return e.fail(t.message);throw t}}};function Ig(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(Ig(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return Fh.fromArray(r)}var Lg=class e extends Pg{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new Vh(Ig(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return Fg.fromReplace(e,this.from,this.to,i)}invert(){return new Rg(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Pg.jsonID(`addMark`,Lg);var Rg=class e extends Pg{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new Vh(Ig(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return Fg.fromReplace(e,this.from,this.to,n)}invert(){return new Lg(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Pg.jsonID(`removeMark`,Rg);var zg=class e extends Pg{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Fg.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Fg.fromReplace(e,this.pos,this.pos+1,new Vh(Fh.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new Bg(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Pg.jsonID(`addNodeMark`,zg);var Bg=class e extends Pg{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Fg.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Fg.fromReplace(e,this.pos,this.pos+1,new Vh(Fh.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new zg(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Pg.jsonID(`removeNodeMark`,Bg);var Vg=class e extends Pg{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Ug(e,this.from,this.to)?Fg.fail(`Structure replace would overwrite content`):Fg.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Mg([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?Vh.empty:new Vh(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?Vh.empty:new Vh(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,Vh.fromJSON(t,n.slice),!!n.structure)}};Vg.MAP_BIAS=1,Pg.jsonID(`replace`,Vg);var Hg=class e extends Pg{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(Ug(e,this.from,this.gapFrom)||Ug(e,this.gapTo,this.to)))return Fg.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Fg.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?Fg.fromReplace(e,this.from,this.to,n):Fg.fail(`Content does not fit in gap`)}getMap(){return new Mg([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,Vh.fromJSON(t,n.slice),n.insert,!!n.structure)}};Pg.jsonID(`replaceAround`,Hg);function Ug(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}var Wg=class e extends Pg{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Fg.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return Fg.fromReplace(e,this.pos,this.pos+1,new Vh(Fh.from(r),0,+!t.isLeaf))}getMap(){return Mg.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};Pg.jsonID(`attr`,Wg);var Gg=class e extends Pg{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Fg.ok(n)}getMap(){return Mg.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};Pg.jsonID(`docAttr`,Gg);var Kg=class extends Error{};Kg=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},Kg.prototype=Object.create(Error.prototype),Kg.prototype.constructor=Kg,Kg.prototype.name=`TransformError`;var qg=Object.create(null),Jg=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Yg(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=Vh.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?Vh.empty:t),o==0&&a_(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),a_(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new Qg(e):i_(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?i_(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):i_(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new n_(e.node(0))}static atStart(e){return i_(e,e,0,0,1)||new n_(e)}static atEnd(e){return i_(e,e,e.content.size,e.childCount,-1)||new n_(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=qg[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in qg)throw RangeError(`Duplicate use of selection JSON ID `+e);return qg[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Qg.between(this.$anchor,this.$head).getBookmark()}};Jg.prototype.visible=!0;var Yg=class{constructor(e,t){this.$from=e,this.$to=t}},Xg=!1;function Zg(e){!Xg&&!e.parent.inlineContent&&(Xg=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var Qg=class e extends Jg{constructor(e,t=e){Zg(e),Zg(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return Jg.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=Vh.empty){if(super.replace(e,t),t==Vh.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new $g(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=Jg.findFrom(n,r,!0)||Jg.findFrom(n,-r,!0);if(e)n=e.$head;else return Jg.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(Jg.findFrom(t,-r,!0)||Jg.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};Jg.jsonID(`text`,Qg);var $g=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return Qg.between(e.resolve(this.anchor),e.resolve(this.head))}},e_=class e extends Jg{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?Jg.near(a):new e(a)}content(){return new Vh(Fh.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new t_(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};e_.prototype.visible=!1,Jg.jsonID(`node`,e_);var t_=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new $g(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&e_.isSelectable(n)?new e_(t):Jg.near(t)}},n_=class e extends Jg{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=Vh.empty){if(t==Vh.empty){e.delete(0,e.doc.content.size);let t=Jg.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return r_}};Jg.jsonID(`all`,n_);var r_={map(){return this},resolve(e){return new n_(e)}};function i_(e,t,n,r,i,a=!1){if(t.inlineContent)return Qg.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=i_(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&e_.isSelectable(r))return e_.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function a_(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Vg||i instanceof Hg))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(Jg.near(e.doc.resolve(o),n))}function o_(e,t){return!t||!e?e:e.bind(t)}var s_=class{constructor(e,t,n){this.name=e,this.init=o_(t.init,n),this.apply=o_(t.apply,n)}};new s_(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new s_(`selection`,{init(e,t){return e.selection||Jg.atStart(t.doc)},apply(e){return e.selection}}),new s_(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new s_(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}});var c_=(e,t)=>{let{state:n,view:r}=e,{selection:i}=n;if(!i.empty)return!1;let{$from:a}=i;if(a.parentOffset!==0)return!1;let o=a.depth-1,s=a.node(o),c=a.index(o);if(c===0)return!1;if(s.type===t)return e.commands.lift(t.name);let l=s.child(c-1);if(l.type!==t||!l.lastChild?.isTextblock)return!1;let u=a.before(),d=u-1-1,{tr:f}=n;return f.delete(u,a.after()).insert(d,a.parent.content),f.setSelection(Qg.create(f.doc,d)),r.dispatch(f.scrollIntoView()),!0},l_=/^\s*>\s$/,u_=Eh.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return Mh(`blockquote`,{...bp(this.options.HTMLAttributes,e),children:Mh(`slot`,{})})},parseMarkdown:(e,t)=>{let n=t.parseBlockChildren??t.parseChildren;return t.createNode(`blockquote`,void 0,n(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return``;let n=[];return e.content.forEach((e,r)=>{let i=(t.renderChild?.call(t,e,r)??t.renderChildren([e])).split(`
|
|
107
|
+
`).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(`
|
|
108
|
+
`))}),n.join(`
|
|
109
|
+
>
|
|
110
|
+
`)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>c_(this.editor,this.type)}},addInputRules(){return[Ch({find:l_,type:this.type})]}}),d_=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,f_=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,p_=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,m_=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,h_=Xm.create({name:`bold`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!==`normal`&&null},{style:`font-weight=400`,clearMark:e=>e.type.name===this.name},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return Mh(`strong`,{...bp(this.options.HTMLAttributes,e),children:Mh(`slot`,{})})},markdownTokenName:`strong`,parseMarkdown:(e,t)=>t.applyMark(`bold`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<strong>`,close:`</strong>`}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[bh({find:d_,type:this.type}),bh({find:p_,type:this.type})]},addPasteRules(){return[Dh({find:f_,type:this.type}),Dh({find:m_,type:this.type})]}}),g_=e=>{let t=/`([^`]+)`(?!`)$/.exec(e);return!t||t.index>0&&e[t.index-1]==="`"?null:{index:t.index,text:t[0],replaceWith:t[1]}},__=e=>{let t=/`([^`]+)`(?!`)/g,n=[],r;for(;(r=t.exec(e))!==null;)r.index>0&&e[r.index-1]==="`"||n.push({index:r.index,text:r[0],replaceWith:r[1]});return n},v_=Xm.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,bp(this.options.HTMLAttributes,e),0]},markdownTokenName:`codespan`,parseMarkdown:(e,t)=>t.applyMark(`code`,[{type:`text`,text:e.text||``}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:``,addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[bh({find:g_,type:this.type})]},addPasteRules(){return[Dh({find:__,type:this.type})]}}),y_=4,b_=/^```([a-z]+)?[\s\n]$/,x_=/^~~~([a-z]+)?[\s\n]$/,S_=Eh.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:y_,HTMLAttributes:{}}},content:`text*`,marks:``,group:`block`,code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{let{languageClassPrefix:t}=this.options;return t&&[...e.firstElementChild?.classList||[]].filter(e=>e.startsWith(t)).map(e=>e.replace(t,``))[0]||null},rendered:!1}}},parseHTML(){return[{tag:`pre`,preserveWhitespace:`full`}]},renderHTML({node:e,HTMLAttributes:t}){return[`pre`,bp(this.options.HTMLAttributes,t),[`code`,{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:`code`,parseMarkdown:(e,t)=>e.raw?.startsWith("```")===!1&&e.raw?.startsWith(`~~~`)===!1&&e.codeBlockStyle!==`indented`?[]:t.createNode(`codeBlock`,{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[]),renderMarkdown:(e,t)=>{let n=``,r=e.attrs?.language||``;return n=e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join(`
|
|
111
|
+
`):`\`\`\`${r}
|
|
112
|
+
|
|
113
|
+
\`\`\``,n},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,`paragraph`,e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??y_,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;if(i.parent.type!==this.type)return!1;let o=` `.repeat(t);return a?e.commands.insertContent(o):e.commands.command(({tr:e})=>{let{from:t,to:i}=r,a=n.doc.textBetween(t,i,`
|
|
114
|
+
`,`
|
|
115
|
+
`).split(`
|
|
116
|
+
`).map(e=>o+e).join(`
|
|
117
|
+
`);return e.replaceWith(t,i,n.schema.text(a)),!0})},"Shift-Tab":({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??y_,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;return i.parent.type===this.type?a?e.commands.command(({tr:e})=>{let{pos:r}=i,a=i.start(),o=i.end(),s=n.doc.textBetween(a,o,`
|
|
118
|
+
`,`
|
|
119
|
+
`).split(`
|
|
120
|
+
`),c=0,l=0,u=r-a;for(let e=0;e<s.length;e+=1){if(l+s[e].length>=u){c=e;break}l+=s[e].length+1}let d=s[c].match(/^ */)?.[0]||``,f=Math.min(d.length,t);if(f===0)return!0;let p=a;for(let e=0;e<c;e+=1)p+=s[e].length+1;return e.delete(p,p+f),r-p<=f&&e.setSelection(Wa.create(e.doc,p)),!0}):e.commands.command(({tr:e})=>{let{from:i,to:a}=r,o=n.doc.textBetween(i,a,`
|
|
121
|
+
`,`
|
|
122
|
+
`).split(`
|
|
123
|
+
`).map(e=>{let n=e.match(/^ */)?.[0]||``,r=Math.min(n.length,t);return e.slice(r)}).join(`
|
|
124
|
+
`);return e.replaceWith(i,a,n.schema.text(o)),!0}):!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let a=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
|
|
125
|
+
|
|
126
|
+
`);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(Ba.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[Sh({find:b_,type:this.type,getAttributes:e=>({language:e[1]})}),Sh({find:x_,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new co({key:new fo(`codeBlockVSCodeHandler`),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData(`text/plain`),r=t.clipboardData.getData(`vscode-editor-data`),i=(r?JSON.parse(r):void 0)?.mode;if(!n||!i)return!1;let{tr:a,schema:o}=e.state,s=o.text(n.replace(/\r\n?/g,`
|
|
127
|
+
`));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type&&a.setSelection(Wa.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}}),C_=Eh.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
128
|
+
|
|
129
|
+
`):``}),w_=Eh.create({name:`hardBreak`,markdownTokenName:`br`,addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,bp(this.options.HTMLAttributes,e)]},renderText(){return`
|
|
130
|
+
`},renderMarkdown:()=>`
|
|
131
|
+
`,parseMarkdown:()=>({type:`hardBreak`}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&s&&a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),T_=Eh.create({name:`heading`,addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:`inline*`,group:`block`,defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,bp(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode(`heading`,{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{let n=e.attrs?.level?parseInt(e.attrs.level,10):1,r=`#`.repeat(n);return e.content?`${r} ${t.renderChildren(e.content)}`:``},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,`paragraph`,e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>Sh({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),E_=Eh.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,bp(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!Om(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return Xp(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(Wa.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(Ka.create(t.doc,n.pos)):t.setSelection(Wa.create(t.doc,n.pos));else{let i=(e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType)?.create();i&&(t.insert(r,i),t.setSelection(Wa.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[xh({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),D_=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,O_=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,k_=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,A_=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,j_=Xm.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`&&null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,bp(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:`em`,parseMarkdown:(e,t)=>t.applyMark(`italic`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<em>`,close:`</em>`}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[bh({find:D_,type:this.type}),bh({find:k_,type:this.type})]},addPasteRules(){return[Dh({find:O_,type:this.type}),Dh({find:A_,type:this.type})]}}),M_=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,N_=`ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2`,P_=`numeric`,F_=`ascii`,I_=`alpha`,L_=`asciinumeric`,R_=`alphanumeric`,z_=`domain`,B_=`emoji`,V_=`scheme`,H_=`slashscheme`,U_=`whitespace`;function W_(e,t){return e in t||(t[e]=[]),t[e]}function G_(e,t,n){t[P_]&&(t[L_]=!0,t[R_]=!0),t[F_]&&(t[L_]=!0,t[I_]=!0),t[L_]&&(t[R_]=!0),t[I_]&&(t[R_]=!0),t[R_]&&(t[z_]=!0),t[B_]&&(t[z_]=!0);for(let r in t){let t=W_(r,n);t.indexOf(e)<0&&t.push(e)}}function K_(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function q_(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}q_.groups={},q_.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){let r=t.jr[n][0],i=t.jr[n][1];if(i&&r.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r||=q_.groups;let i;return t&&t.j?i=t:(i=new q_(t),n&&r&&G_(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,a=e.length;if(!a)return i;for(let t=0;t<a-1;t++)i=i.tt(e[t]);return i.tt(e[a-1],t,n,r)},tt(e,t,n,r){r||=q_.groups;let i=this;if(t&&t.j)return i.j[e]=t,t;let a=t,o,s=i.go(e);return s?(o=new q_,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new q_,a&&(r&&(o.t&&typeof o.t==`string`?G_(a,Object.assign(K_(o.t,r),n),r):n&&G_(a,n,r)),o.t=a),i.j[e]=o,o}};var J_=(e,t,n,r,i)=>e.ta(t,n,r,i),Y_=(e,t,n,r,i)=>e.tr(t,n,r,i),X_=(e,t,n,r,i)=>e.ts(t,n,r,i),X=(e,t,n,r,i)=>e.tt(t,n,r,i),Z_=`WORD`,Q_=`UWORD`,$_=`ASCIINUMERICAL`,ev=`ALPHANUMERICAL`,tv=`LOCALHOST`,nv=`TLD`,rv=`UTLD`,iv=`SCHEME`,av=`SLASH_SCHEME`,ov=`NUM`,sv=`WS`,cv=`NL`,lv=`OPENBRACE`,uv=`CLOSEBRACE`,dv=`OPENBRACKET`,fv=`CLOSEBRACKET`,pv=`OPENPAREN`,mv=`CLOSEPAREN`,hv=`OPENANGLEBRACKET`,gv=`CLOSEANGLEBRACKET`,_v=`FULLWIDTHLEFTPAREN`,vv=`FULLWIDTHRIGHTPAREN`,yv=`LEFTCORNERBRACKET`,bv=`RIGHTCORNERBRACKET`,xv=`LEFTWHITECORNERBRACKET`,Sv=`RIGHTWHITECORNERBRACKET`,Cv=`FULLWIDTHLESSTHAN`,wv=`FULLWIDTHGREATERTHAN`,Tv=`AMPERSAND`,Ev=`APOSTROPHE`,Dv=`ASTERISK`,Ov=`AT`,kv=`BACKSLASH`,Av=`BACKTICK`,jv=`CARET`,Mv=`COLON`,Nv=`COMMA`,Pv=`DOLLAR`,Fv=`DOT`,Iv=`EQUALS`,Lv=`EXCLAMATION`,Rv=`HYPHEN`,zv=`PERCENT`,Bv=`PIPE`,Vv=`PLUS`,Hv=`POUND`,Uv=`QUERY`,Wv=`QUOTE`,Gv=`FULLWIDTHMIDDLEDOT`,Kv=`SEMI`,qv=`SLASH`,Jv=`TILDE`,Yv=`UNDERSCORE`,Xv=`EMOJI`,Zv=`SYM`,Qv=Object.freeze({__proto__:null,ALPHANUMERICAL:ev,AMPERSAND:Tv,APOSTROPHE:Ev,ASCIINUMERICAL:$_,ASTERISK:Dv,AT:Ov,BACKSLASH:kv,BACKTICK:Av,CARET:jv,CLOSEANGLEBRACKET:gv,CLOSEBRACE:uv,CLOSEBRACKET:fv,CLOSEPAREN:mv,COLON:Mv,COMMA:Nv,DOLLAR:Pv,DOT:Fv,EMOJI:Xv,EQUALS:Iv,EXCLAMATION:Lv,FULLWIDTHGREATERTHAN:wv,FULLWIDTHLEFTPAREN:_v,FULLWIDTHLESSTHAN:Cv,FULLWIDTHMIDDLEDOT:Gv,FULLWIDTHRIGHTPAREN:vv,HYPHEN:Rv,LEFTCORNERBRACKET:yv,LEFTWHITECORNERBRACKET:xv,LOCALHOST:tv,NL:cv,NUM:ov,OPENANGLEBRACKET:hv,OPENBRACE:lv,OPENBRACKET:dv,OPENPAREN:pv,PERCENT:zv,PIPE:Bv,PLUS:Vv,POUND:Hv,QUERY:Uv,QUOTE:Wv,RIGHTCORNERBRACKET:bv,RIGHTWHITECORNERBRACKET:Sv,SCHEME:iv,SEMI:Kv,SLASH:qv,SLASH_SCHEME:av,SYM:Zv,TILDE:Jv,TLD:nv,UNDERSCORE:Yv,UTLD:rv,UWORD:Q_,WORD:Z_,WS:sv}),$v=/[a-z]/,ey=/\p{L}/u,ty=/\p{Emoji}/u,ny=/\d/,ry=/\s/,iy=`\r`,ay=`
|
|
132
|
+
`,oy=`️`,sy=``,cy=``,ly=null,uy=null;function dy(e=[]){let t={};q_.groups=t;let n=new q_;ly??=hy(M_),uy??=hy(N_),X(n,`'`,Ev),X(n,`{`,lv),X(n,`}`,uv),X(n,`[`,dv),X(n,`]`,fv),X(n,`(`,pv),X(n,`)`,mv),X(n,`<`,hv),X(n,`>`,gv),X(n,`(`,_v),X(n,`)`,vv),X(n,`「`,yv),X(n,`」`,bv),X(n,`『`,xv),X(n,`』`,Sv),X(n,`<`,Cv),X(n,`>`,wv),X(n,`&`,Tv),X(n,`*`,Dv),X(n,`@`,Ov),X(n,"`",Av),X(n,`^`,jv),X(n,`:`,Mv),X(n,`,`,Nv),X(n,`$`,Pv),X(n,`.`,Fv),X(n,`=`,Iv),X(n,`!`,Lv),X(n,`-`,Rv),X(n,`%`,zv),X(n,`|`,Bv),X(n,`+`,Vv),X(n,`#`,Hv),X(n,`?`,Uv),X(n,`"`,Wv),X(n,`/`,qv),X(n,`;`,Kv),X(n,`~`,Jv),X(n,`_`,Yv),X(n,`\\`,kv),X(n,`・`,Gv);let r=Y_(n,ny,ov,{[P_]:!0});Y_(r,ny,r);let i=Y_(r,$v,$_,{[L_]:!0}),a=Y_(r,ey,ev,{[R_]:!0}),o=Y_(n,$v,Z_,{[F_]:!0});Y_(o,ny,i),Y_(o,$v,o),Y_(i,ny,i),Y_(i,$v,i);let s=Y_(n,ey,Q_,{[I_]:!0});Y_(s,$v),Y_(s,ny,a),Y_(s,ey,s),Y_(a,ny,a),Y_(a,$v),Y_(a,ey,a);let c=X(n,ay,cv,{[U_]:!0}),l=X(n,iy,sv,{[U_]:!0}),u=Y_(n,ry,sv,{[U_]:!0});X(n,cy,u),X(l,ay,c),X(l,cy,u),Y_(l,ry,u),X(u,iy),X(u,ay),Y_(u,ry,u),X(u,cy,u);let d=Y_(n,ty,Xv,{[B_]:!0});X(d,`#`),Y_(d,ty,d),X(d,oy,d);let f=X(d,sy);X(f,`#`),Y_(f,ty,d);let p=[[$v,o],[ny,i]],m=[[$v,null],[ey,s],[ny,a]];for(let e=0;e<ly.length;e++)my(n,ly[e],nv,Z_,p);for(let e=0;e<uy.length;e++)my(n,uy[e],rv,Q_,m);G_(nv,{tld:!0,ascii:!0},t),G_(rv,{utld:!0,alpha:!0},t),my(n,`file`,iv,Z_,p),my(n,`mailto`,iv,Z_,p),my(n,`http`,av,Z_,p),my(n,`https`,av,Z_,p),my(n,`ftp`,av,Z_,p),my(n,`ftps`,av,Z_,p),G_(iv,{scheme:!0,ascii:!0},t),G_(av,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{[V_]:!0}:{[H_]:!0};r.indexOf(`-`)>=0?i[z_]=!0:$v.test(r)?ny.test(r)?i[L_]=!0:i[F_]=!0:i[P_]=!0,X_(n,r,r,i)}return X_(n,`localhost`,tv,{ascii:!0}),n.jd=new q_(Zv),{start:n,tokens:Object.assign({groups:t},Qv)}}function fy(e,t){let n=py(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o<r;){let s=e,c=null,l=0,u=null,d=-1,f=-1;for(;o<r&&(c=s.go(n[o]));)s=c,s.accepts()?(d=0,f=0,u=s):d>=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function py(e){let t=[],n=e.length,r=0;for(;r<n;){let i=e.charCodeAt(r),a,o=i<55296||i>56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function my(e,t,n,r,i){let a,o=t.length;for(let n=0;n<o-1;n++){let o=t[n];e.j[o]?a=e.j[o]:(a=new q_(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new q_(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function hy(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;`0123456789`.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}var gy={defaultProtocol:`http`,events:null,format:vy,formatHref:vy,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function _y(e,t=null){let n=Object.assign({},gy);e&&(n=Object.assign(n,e instanceof _y?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}_y.prototype={o:gy,ignoreTags:[],defaultRender(e){return e},check(e){return this.get(`validate`,e.toString(),e)},get(e,t,n){let r=t!=null,i=this.o[e];return i&&(typeof i==`object`?(i=n.t in i?i[n.t]:gy[e],typeof i==`function`&&r&&(i=i(t,n))):typeof i==`function`&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r==`function`&&t!=null&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get(`render`,null,e)||this.defaultRender)(t,e.t,e)}};function vy(e){return e}function yy(e,t){this.t=`token`,this.v=e,this.tk=t}yy.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get(`truncate`,t,this),r=e.get(`format`,t,this);return n&&r.length>n?r.substring(0,n)+`…`:r},toFormattedHref(e){return e.get(`formatHref`,this.toHref(e.get(`defaultProtocol`)),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=gy.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get(`validate`,this.toString(),this)},render(e){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}};function by(e,t){class n extends yy{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}var xy=by(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),Sy=by(`text`),Cy=by(`nl`),wy=by(`url`,{isLink:!0,toHref(e=gy.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==tv&&e[1].t===Mv}}),Ty=e=>new q_(e);function Ey({groups:e}){let t=e.domain.concat([Tv,Dv,Ov,kv,Av,jv,Pv,Iv,Rv,ov,zv,Bv,Vv,Hv,qv,Zv,Jv,Yv]),n=[Ev,Mv,Nv,Fv,Lv,zv,Uv,Wv,Kv,hv,gv,lv,uv,fv,dv,pv,mv,_v,vv,yv,bv,xv,Sv,Cv,wv],r=[Tv,Ev,Dv,kv,Av,jv,Pv,Iv,Rv,lv,uv,zv,Bv,Vv,Hv,Uv,qv,Zv,Jv,Yv],i=Ty(),a=X(i,Jv);J_(a,r,a),J_(a,e.domain,a);let o=Ty(),s=Ty(),c=Ty();J_(i,e.domain,o),J_(i,e.scheme,s),J_(i,e.slashscheme,c),J_(o,r,a),J_(o,e.domain,o);let l=X(o,Ov);X(a,Ov,l),X(s,Ov,l),X(c,Ov,l);let u=X(a,Fv);J_(u,r,a),J_(u,e.domain,a);let d=Ty();J_(l,e.domain,d),J_(d,e.domain,d);let f=X(d,Fv);J_(f,e.domain,d);let p=Ty(xy);J_(f,e.tld,p),J_(f,e.utld,p),X(l,tv,p);let m=X(d,Rv);X(m,Rv,m),J_(m,e.domain,d),J_(p,e.domain,d),X(p,Fv,f),X(p,Rv,m);let h=X(o,Rv),g=X(o,Fv);X(h,Rv,h),J_(h,e.domain,o),J_(g,r,a),J_(g,e.domain,o);let _=Ty(wy);J_(g,e.tld,_),J_(g,e.utld,_),J_(_,e.domain,o),J_(_,r,a),X(_,Fv,g),X(_,Rv,h),X(_,Ov,l);let v=X(_,Mv),y=Ty(wy);J_(v,e.numeric,y);let b=Ty(wy),x=Ty();J_(b,t,b),J_(b,n,x),J_(x,t,b),J_(x,n,x),X(_,qv,b),X(y,qv,b);let S=X(s,Mv),C=X(X(X(c,Mv),qv),qv);J_(s,e.domain,o),X(s,Fv,g),X(s,Rv,h),J_(c,e.domain,o),X(c,Fv,g),X(c,Rv,h),J_(S,e.domain,b),X(S,qv,b),X(S,Uv,b),J_(C,e.domain,b),J_(C,t,b),X(C,qv,b);let w=[[lv,uv],[dv,fv],[pv,mv],[hv,gv],[_v,vv],[yv,bv],[xv,Sv],[Cv,wv]];for(let e=0;e<w.length;e++){let[r,i]=w[e],a=X(b,r);X(x,r,a);let o=Ty(wy);J_(a,t,o);let s=Ty();J_(a,n,s),X(a,i,b),J_(o,t,o),J_(o,n,s),J_(s,t,o),J_(s,n,s),X(o,i,b),X(s,i,b)}return X(i,tv,_),X(i,cv,Cy),{start:i,tokens:Qv}}function Dy(e,t,n){let r=n.length,i=0,a=[],o=[];for(;i<r;){let s=e,c=null,l=null,u=0,d=null,f=-1;for(;i<r&&!(c=s.go(n[i].t));)o.push(n[i++]);for(;i<r&&(l=c||s.go(n[i].t));)c=null,s=l,s.accepts()?(f=0,d=s):f>=0&&f++,i++,u++;if(f<0)i-=u,i<r&&(o.push(n[i]),i++);else{o.length>0&&(a.push(Oy(Sy,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(Oy(e,t,r))}}return o.length>0&&a.push(Oy(Sy,t,o)),a}function Oy(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var ky=typeof console<`u`&&console&&console.warn||(()=>{}),Ay=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,jy={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function My(){return q_.groups={},jy.scanner=null,jy.parser=null,jy.tokenQueue=[],jy.pluginQueue=[],jy.customSchemes=[],jy.initialized=!1,jy}function Ny(e,t=!1){if(jy.initialized&&ky(`linkifyjs: already initialized - will not register custom scheme "${e}" ${Ay}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
|
|
133
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
134
|
+
2. Cannot start or end with "-"
|
|
135
|
+
3. "-" cannot repeat`);jy.customSchemes.push([e,t])}function Py(){jy.scanner=dy(jy.customSchemes);for(let e=0;e<jy.tokenQueue.length;e++)jy.tokenQueue[e][1]({scanner:jy.scanner});jy.parser=Ey(jy.scanner.tokens);for(let e=0;e<jy.pluginQueue.length;e++)jy.pluginQueue[e][1]({scanner:jy.scanner,parser:jy.parser});return jy.initialized=!0,jy}function Fy(e){return jy.initialized||Py(),Dy(jy.parser.start,e,fy(jy.scanner.start,e))}Fy.scan=fy;function Iy(e,t=null,n=null){if(t&&typeof t==`object`){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new _y(n),i=Fy(e),a=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a}var Ly=`[\0- \xA0 -\u2029 ]`,Ry=new RegExp(Ly),zy=RegExp(`${Ly}$`),By=new RegExp(Ly,`g`);function Vy(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function Hy(e){return new co({key:new fo(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(Lp(ip(n.doc,[...t])).forEach(({newRange:t})=>{let n=sp(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!zy.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(Ry).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=Fy(n).map(t=>t.toObject(e.defaultProtocol));if(!Vy(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{Rp(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function Uy(e){return new co({key:new fo(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=Pp(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}function Wy(e){return new co({key:new fo(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=Iy(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.value)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function Gy(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(By,``).match(RegExp(`^(?:(?:${n.map(e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)).join(`|`)}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,`i`))}var Ky=Xm.create({name:`link`,priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e==`string`){Ny(e);return}Ny(e.scheme,e.optionalSlashes)})},onDestroy(){My()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!Gy(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:`a[href]`,getAttrs:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!Gy(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!Gy(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,bp(this.options.HTMLAttributes,e),0]:[`a`,bp(this.options.HTMLAttributes,{...e,href:``}),0]},markdownTokenName:`link`,parseMarkdown:(e,t)=>t.applyMark(`link`,t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{let n=e.attrs?.href??``,r=e.attrs?.title??``,i=t.renderChildren(e);return r?`[${i}](${n} "${r}")`:`[${i}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!Gy(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta(`preventAutolink`,!0).run():!1},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!Gy(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()}},addPasteRules(){return[Dh({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=Iy(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!Gy(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(Hy({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!Gy(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(Uy({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(Wy({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),qy=Object.defineProperty,Jy=(e,t)=>{for(var n in t)qy(e,n,{get:t[n],enumerable:!0})},Yy=`listItem`,Xy=`textStyle`,Zy=/^\s*([-+*])\s$/,Qy=Eh.create({name:`bulletList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul`}]},renderHTML({HTMLAttributes:e}){return[`ul`,bp(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>e.type!==`list`||e.ordered?[]:{type:`bulletList`,content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
136
|
+
`):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Yy,this.editor.getAttributes(Xy)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=Ch({find:Zy,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Ch({find:Zy,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Xy),editor:this.editor})),[e]}}),$y=(e,t,n)=>{let{selection:r}=e;if(!r.empty)return null;let{$from:i}=r;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let a=-1;for(let e=i.depth;e>0;--e)if(i.node(e).type.name===t){a=e;break}if(a<0)return null;let o=i.node(a),s=i.index(a);if(s+1>=o.childCount)return null;let c=o.child(s+1);if(!n.includes(c.type.name))return null;let l=e.schema.nodes[t],u=!1;if(c.forEach(e=>{e.type===l&&e.childCount>1&&(u=!0)}),!u)return null;let d=e.doc.resolve(i.after()).nodeAfter;if(!d||!n.includes(d.type.name))return null;let f=[];return d.forEach(e=>{f.push(e)}),f.length===0?null:{listItemDepth:a,nestedList:d,nestedListPos:i.after(),insertPos:i.after(a),items:f}},eb=(e,t,n,r)=>{let i=$y(e,n,r);if(!i)return!1;let{selection:a}=e,{nestedList:o,nestedListPos:s,insertPos:c,items:l}=i,u=e.tr;u.delete(s,s+o.nodeSize);let d=u.mapping.map(c);return u.insert(d,Y.from(l)),u.setSelection(a.map(u.doc,u.mapping)),t&&t(u),!0},tb=(e,t,n)=>eb(e.state,e.view.dispatch,t,n),nb=(e,t)=>ah.create({name:`${e}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){let n=()=>tb(this.editor,e,t);return{Delete:n,"Mod-Delete":n}}}),rb=[[1e3,`m`],[900,`cm`],[500,`d`],[400,`cd`],[100,`c`],[90,`xc`],[50,`l`],[40,`xl`],[10,`x`],[9,`ix`],[5,`v`],[4,`iv`],[1,`i`]],ib=`abcdefghijklmnopqrstuvwxyz`,ab=String.raw`\d+|[ivxlcdmIVXLCDM]+|${`[a-zA-Z]{1,2}`}`;function ob(e){let t=e,n=``;for(let[e,r]of rb)for(;t>=e;)n+=r,t-=e;return n}function sb(e){return ob(e).toUpperCase()}function cb(e){let t=e.toLowerCase(),n=0,r=0;for(;n<t.length;){let e=!1;for(let[i,a]of rb)if(t.startsWith(a,n)){r+=i,n+=a.length,e=!0;break}if(!e)return 0}return r}function lb(e){if(!/^[ivxlcdmIVXLCDM]+$/.test(e))return!1;let t=cb(e);return t<=0?!1:(e===e.toLowerCase()?ob(t):sb(t))===e}function ub(e){let t=e.toLowerCase();if(t.length===1)return t.charCodeAt(0)-97+1;if(t.length===2){let e=t.charCodeAt(0)-97,n=t.charCodeAt(1)-97;return(e+1)*26+n+1}return 0}function db(e){if(e<=26)return ib[e-1];let t=Math.floor((e-1)/26)-1,n=(e-1)%26;return t<0?ib[n]:ib[t]+ib[n]}function fb(e){if(e&&!/^\d+$/.test(e)){if(lb(e))return e===e.toLowerCase()?`i`:`I`;if(/^[a-z]{1,2}$/.test(e))return`a`;if(/^[A-Z]{1,2}$/.test(e))return`A`}}function pb(e){if(/^\d+$/.test(e))return parseInt(e,10);let t=fb(e);if(t===`i`||t===`I`)return cb(e);if(t===`a`||t===`A`){let t=ub(e);return t>0?t:1}let n=parseInt(e,10);return Number.isNaN(n)?1:n}function mb(e,t){if(e===`numeric`)return String(t);switch(e){case`a`:return db(t);case`A`:return db(t).toUpperCase();case`i`:return ob(t);case`I`:return sb(t);default:return String(t)}}function hb(e){if(e.length===0)return!1;let t=fb(e[0])??`numeric`,n=pb(e[0]);if(n<1)return!1;for(let r=0;r<e.length;r++){let i=mb(t,n+r);if(e[r]!==i)return!1}return!0}function gb(e){return{type:fb(e),start:pb(e)}}function _b(e){let{type:t,start:n}=gb(e),r={};return t&&(r.type=t),n!==1&&(r.start=n),r}function vb(e,t,n=`. `){let r=t+1;if(!e||e===`1`)return`${r}${n}`;switch(e){case`a`:return`${db(r)}${n}`;case`A`:return`${db(r).toUpperCase()}${n}`;case`i`:return`${ob(r)}${n}`;case`I`:return`${sb(r)}${n}`;default:return`${r}${n}`}}function yb(e){let t=e.tokens?.[0];return!!(e.text&&e.tokens?.length===1&&t?.type===`list`&&t.ordered&&t.raw===e.text)}function bb(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:`text`,raw:e,text:e}])}var xb=Eh.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,bp(this.options.HTMLAttributes,e),0]},markdownTokenName:`list_item`,parseMarkdown:(e,t)=>{if(e.type!==`list_item`)return[];let n=t.parseBlockChildren??t.parseChildren,r=[];if(e.tokens&&e.tokens.length>0){if(yb(e))return{type:`listItem`,content:[{type:`paragraph`,content:bb(e.text||``,t)}]};if(e.tokens.some(e=>e.type===`paragraph`))r=n(e.tokens);else{let i=e.tokens[0];if(i&&i.type===`text`&&i.tokens&&i.tokens.length>0){if(r=[{type:`paragraph`,content:t.parseInline(i.tokens)}],e.tokens.length>1){let t=n(e.tokens.slice(1));r.push(...t)}}else r=n(e.tokens)}}return r.length===0&&(r=[{type:`paragraph`,content:[]}]),{type:`listItem`,content:r}},renderMarkdown:(e,t,n)=>Hm(e,t,e=>{if(e.parentType===`bulletList`)return`- `;if(e.parentType===`orderedList`){let t=e.meta?.parentAttrs?.start||1;return vb(e.meta?.parentAttrs?.type,t-1+(e.index||0),`. `)}return`- `},n),addExtensions(){return[nb(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});Jy({},{findListItemPos:()=>Sb,getNextListDepth:()=>Cb,handleBackspace:()=>Tb,handleDelete:()=>Ob,hasListBefore:()=>wb,hasListItemAfter:()=>kb,hasListItemBefore:()=>Ab,listItemHasSubList:()=>jb,nextListIsDeeper:()=>Eb,nextListIsHigher:()=>Db});var Sb=(e,t)=>{let{$from:n}=t.selection,r=Xd(e,t.schema),i=null,a=n.depth,o=n.pos,s=null;for(;a>0&&s===null;)i=n.node(a),i.type===r?s=a:(--a,--o);return s===null?null:{$pos:t.doc.resolve(o),depth:s}},Cb=(e,t)=>{let n=Sb(e,t);if(!n)return!1;let[,r]=zp(t,e,n.$pos.pos+4);return r},wb=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),a=e.doc.resolve(i).node();return!(!a||!n.includes(a.type.name))},Tb=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!Bf(e.state,t)&&wb(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let a=i.at(-1);if(!a)return!1;let o=e.state.doc.resolve(r.start()+a.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}return!Bf(e.state,t)||!Kp(e.state)?!1:e.chain().liftListItem(t).run()},Eb=(e,t)=>{let n=Cb(e,t),r=Sb(e,t);return!r||!n?!1:n>r.depth},Db=(e,t)=>{let n=Cb(e,t),r=Sb(e,t);return!r||!n?!1:n<r.depth},Ob=(e,t)=>{if(!Bf(e.state,t)||!Gp(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:Eb(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():Db(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},kb=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-n.parentOffset-2);return r.index()!==r.parent.childCount-1&&r.nodeAfter?.type.name===e},Ab=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-2);return r.index()!==0&&r.nodeBefore?.type.name===e},jb=(e,t,n)=>{if(!n)return!1;let r=Xd(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},Mb=ah.create({name:`listKeymap`,addOptions(){return{listTypes:[{itemName:`listItem`,wrapperNames:[`bulletList`,`orderedList`]},{itemName:`taskItem`,wrapperNames:[`taskList`]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&Ob(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&Ob(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&Tb(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&Tb(e,n,r)&&(t=!0)}),t}}}}),Nb=RegExp(`^(\\s*)(${ab})([.)])\\s+(.*)$`),Pb=RegExp(`^(\\s*)(${ab})([.)])\\s+`),Fb=/^\s/;function Ib(e){return Nb.test(e.trimStart())}function Lb(e){let t=e.trimStart();return/^[-+*]\s+/.test(t)||Ib(t)||/^>\s?/.test(t)||/^```/.test(t)||/^~~~/.test(t)}function Rb(e){let t=[],n=[],r=!1;return e.forEach(e=>{if(r){n.push(e);return}if(e.trim()===``){r=!0,n.push(e);return}if(t.length>0&&Lb(e)){r=!0,n.push(e);return}t.push(e)}),{paragraphLines:t,blockLines:n}}function zb(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(Nb);if(!a)break;let[,o,s,c,l]=a,u=o.length,d=parseInt(s,10),f=isNaN(d)?fb(s):void 0,p=isNaN(d)?pb(s):d,m=[l],h=n+1,g=[i],_=!1;for(;h<e.length;){let t=e[h];if(t.match(Nb))break;if(t.trim()===``)g.push(t),m.push(``),_=!0,h+=1;else if(t.match(Fb)){let e=t.length-t.trimStart().length,n=u+s.length+1;g.push(t),m.push(t.slice(Math.min(e,n))),h+=1}else{if(_)break;g.push(t),m.push(t),h+=1}}t.push({indent:u,number:p,type:f,content:m.join(`
|
|
137
|
+
`).trim(),contentLines:m,raw:g.join(`
|
|
138
|
+
`)}),r=h,n=h}return[t,r]}var Bb=RegExp(`^(${ab})([.)])\\s+(.+)$`);function Vb(e){let t=e.split(`
|
|
139
|
+
`).filter(e=>e.trim().length>0);if(t.length===0)return null;let n=[];for(let e of t){let t=e.trim().match(Bb);if(!t)return null;n.push({marker:t[1],content:t[3]})}return hb(n.map(e=>e.marker))?{type:`orderedList`,attrs:_b(n[0].marker),content:n.map(e=>({type:`listItem`,content:[{type:`paragraph`,content:[{type:`text`,text:e.content}]}]}))}:null}function Hb(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let{paragraphLines:o,blockLines:s}=Rb(a.contentLines),c=o.join(`
|
|
140
|
+
`).trim(),l=[];c&&l.push({type:`paragraph`,raw:c,tokens:n.inlineTokens(c)});let u=s.join(`
|
|
141
|
+
`).trim();if(u){let e=n.blockTokens(u);l.push(...e)}let d=i+1,f=[];for(;d<e.length&&e[d].indent>t;)f.push(e[d]),d+=1;if(f.length>0){let e=Hb(f,Math.min(...f.map(e=>e.indent)),n);l.push({type:`list`,ordered:!0,start:f[0].number,typeMarker:f[0].type,items:e,raw:f.map(e=>e.raw).join(`
|
|
142
|
+
`)})}r.push({type:`list_item`,raw:a.raw,tokens:l}),i=d}else i+=1}return r}function Ub(e,t){return e.map(e=>{if(e.type!==`list_item`)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if(e.type===`paragraph`||e.type===`list`||e.type===`blockquote`||e.type===`code`)n.push(...t.parseChildren([e]));else if(e.type===`text`&&e.tokens){let r=t.parseChildren([e]);n.push({type:`paragraph`,content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:`listItem`,content:n}})}var Wb=`listItem`,Gb=`textStyle`,Kb=/^(\d+)\.\s$/;function qb(e){let t=e.match(/list-style-type\s*:\s*([^;]+)/i);if(!t)return null;switch(t[1].trim().toLowerCase()){case`upper-roman`:return`I`;case`lower-roman`:return`i`;case`upper-alpha`:case`upper-latin`:return`A`;case`lower-alpha`:case`lower-latin`:return`a`;default:return null}}var Jb=Eh.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>{let t=e.getAttribute(`type`);if(t)return t;let n=e.getAttribute(`style`);if(n){let e=qb(n);if(e)return e}let r=e.querySelector(`li`);if(r){let e=r.getAttribute(`style`);if(e){let t=qb(e);if(t)return t}}return null}}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,type:n,...r}=e,i=bp(this.options.HTMLAttributes,r);return t!==1&&(i.start=t),n&&n!==`1`&&(i.type=n),[`ol`,i,0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[];let n=e.start||1,r=e.typeMarker,i=e.items?Ub(e.items,t):[],a={};return n!==1&&(a.start=n),r&&(a.type=r),Object.keys(a).length>0?{type:`orderedList`,attrs:a,content:i}:{type:`orderedList`,content:i}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
143
|
+
`):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:e=>{let t=e.match(Pb)?.index;return t===void 0?-1:t},tokenize:(e,t,n)=>{let r=e.split(`
|
|
144
|
+
`),[i,a]=zb(r);if(i.length===0)return;let o=Hb(i,0,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,typeMarker:i[0]?.type,items:o,raw:r.slice(0,a).join(`
|
|
145
|
+
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Wb,this.editor.getAttributes(Gb)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new co({props:{handlePaste:(e,t)=>{if((t.clipboardData?.getData(`text/html`))?.trim())return!1;let n=t.clipboardData?.getData(`text/plain`);if(!n)return!1;let r=Vb(n);if(!r)return!1;try{let t=e.state.schema.nodeFromJSON(r),n=e.state.tr.replaceSelectionWith(t);return e.dispatch(n),!0}catch{return!1}}}})]},addInputRules(){let e=(e,t)=>(!t.attrs.type||t.attrs.type===`1`)&&t.childCount+t.attrs.start===+e[1],t=Ch({find:Kb,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:e});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Ch({find:Kb,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Gb)}),joinPredicate:e,editor:this.editor})),[t]}}),Yb=/^\s*(\[([( |x])?\])\s$/,Xb=Eh.create({name:`taskItem`,addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:`taskList`,a11y:void 0}},content(){return this.options.nested?`paragraph block*`:`paragraph+`},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,bp(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode(`paragraph`,{},t.parseInline(e.tokens))):e.text?n.push(t.createNode(`paragraph`,{},[t.createNode(`text`,{text:e.text})])):n.push(t.createNode(`paragraph`,{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>Hm(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addExtensions(){return this.options.nested?[nb(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`),l=e=>{var t;s.ariaLabel=((t=this.options.a11y)?.checkboxLabel)?.call(t,e,s.checked)||`Task item checkbox for ${e.textContent||`empty task item`}`};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=xp(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[Ch({find:Yb,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),Zb=Eh.create({name:`taskList`,addOptions(){return{itemTypeName:`taskItem`,HTMLAttributes:{}}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return[`ul`,bp(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode(`taskList`,{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
146
|
+
`):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=Vm(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:`taskList`,raw:t.raw,items:t.items}]:n.blockTokens(e)},i=Vm(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});ah.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(Qy.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(xb.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(Mb.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(Jb.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(Xb.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(Zb.configure(this.options.taskList)),e}});var Qb=` `,$b=`\xA0`,ex=Eh.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,bp(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return n.length===1&&n[0].type===`text`&&(n[0].raw===Qb||n[0].text===Qb||n[0].raw===$b||n[0].text===$b)&&r.length===1&&r[0].type===`text`&&(r[0].text===Qb||r[0].text===$b)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){let e=Array.isArray(n?.previousNode?.content)?n.previousNode.content:[];return n?.previousNode?.type===`paragraph`&&e.length===0?Qb:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),tx=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,nx=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,rx=Xm.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,bp(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[bh({find:tx,type:this.type})]},addPasteRules(){return[Dh({find:nx,type:this.type})]}}),ix=Eh.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),ax=Xm.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,bp(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function ox(e={}){return new co({view(t){return new sx(t,e)}})}var sx=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=ya(this.editorView.state.doc,e,this.editorView.dragging.slice);t!=null&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},cx=class e extends Ba{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):Ba.near(r)}content(){return fr.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new lx(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!dx(e)||!fx(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!Ka.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};cx.prototype.visible=!1,cx.findFrom=cx.findGapCursorFrom,Ba.jsonID(`gapcursor`,cx);var lx=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return cx.valid(t)?new cx(t):Ba.near(t)}};function ux(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function dx(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||ux(e.type))return!0;if(e.inlineContent)return!1}}return!0}function fx(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||ux(e.type))return!0;if(e.inlineContent)return!1}}return!0}function px(){return new co({props:{decorations:vx,createSelectionBetween(e,t,n){return t.pos==n.pos&&cx.valid(n)?new cx(n):null},handleClick:gx,handleKeyDown:mx,handleDOMEvents:{beforeinput:_x}}})}var mx=Ld({ArrowLeft:hx(`horiz`,-1),ArrowRight:hx(`horiz`,1),ArrowUp:hx(`vert`,-1),ArrowDown:hx(`vert`,1)});function hx(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof Wa){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=cx.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new cx(c))),!0):!1}}function gx(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!cx.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&Ka.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new cx(r))),!0)}function _x(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof cx))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=Y.empty;for(let e=r.length-1;e>=0;e--)i=Y.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new fr(i,0,0));return a.setSelection(Wa.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function vx(e){if(!(e.selection instanceof cx))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,Lu.create(e.doc,[Pu.widget(e.selection.head,t,{key:`gapcursor`})])}var yx=200,bx=function(){};bx.prototype.append=function(e){return e.length?(e=bx.from(e),!this.length&&e||e.length<yx&&this.leafAppend(e)||this.length<yx&&e.leafPrepend(this)||this.appendInner(e)):this},bx.prototype.prepend=function(e){return e.length?bx.from(e).append(this):this},bx.prototype.appendInner=function(e){return new Sx(this,e)},bx.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?bx.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},bx.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},bx.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},bx.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},bx.from=function(e){return e instanceof bx?e:e&&e.length?new xx(e):bx.empty};var xx=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=yx)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=yx)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(bx);bx.empty=new xx([]);var Sx=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(bx),Cx=500,wx=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new Ex(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new Ex(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new Ex(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>Ox&&(s=Tx(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Li;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new Ex(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new Ex(i,o,l))}else r.push(new Ex(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new Ex(a.maps[e]));let u=this.items.slice(0,i).append(l).append(r),d=new e(u,s);return d.emptyItemCount()>Cx&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new Ex(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(bx.from(i.reverse()),a)}};wx.empty=new wx(bx.empty,0);function Tx(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var Ex=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},Dx=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},Ox=20;function kx(e,t,n,r){let i=n.getMeta(Lx),a;if(i)return i.historyState;n.getMeta(Rx)&&(e=new Dx(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(Lx))return o.getMeta(Lx).redo?new Dx(e.done.addTransform(n,void 0,r,Ix(t)),e.undone,jx(n.mapping.maps),e.prevTime,e.prevComposition):new Dx(e.done,e.undone.addTransform(n,void 0,r,Ix(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!Ax(n,e.prevRanges)),s=o?Mx(e.prevRanges,n.mapping):jx(n.mapping.maps);return new Dx(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,Ix(t)),wx.empty,s,n.time,i??e.prevComposition)}return(a=n.getMeta(`rebased`))?new Dx(e.done.rebased(n,a),e.undone.rebased(n,a),Mx(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Dx(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Mx(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function Ax(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function jx(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function Mx(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function Nx(e,t,n){let r=Ix(t),i=Lx.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new Dx(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(Lx,{redo:n,historyState:c})}var Px=!1,Fx=null;function Ix(e){let t=e.plugins;if(Fx!=t){Px=!1,Fx=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){Px=!0;break}}return Px}var Lx=new fo(`history`),Rx=new fo(`closeHistory`);function zx(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new co({key:Lx,state:{init(){return new Dx(wx.empty,wx.empty,null,0,-1)},apply(t,n,r){return kx(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?Vx:n==`historyRedo`?Hx:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function Bx(e,t){return(n,r)=>{let i=Lx.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=Nx(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var Vx=Bx(!1,!0),Hx=Bx(!0,!0);ah.create({name:`characterCount`,addOptions(){return{limit:null,autoTrim:!0,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new co({key:new fo(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit,a=this.options.autoTrim;if(i==null||i===0||a===!1){e=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){let t=o-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var Ux=ah.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[ox(this.options)]}});ah.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new co({key:new fo(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return Lu.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(Pu.node(t,t+e.nodeSize,{class:this.options.className}))}),Lu.create(e,a)}}})]}});var Wx=ah.create({name:`gapCursor`,addProseMirrorPlugins(){return[px()]},extendNodeSchema(e){return{allowGapCursor:mp(up(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),Gx=`placeholder`,Kx=new fo(`tiptap__placeholder`),qx=200;function Jx(e){let{editor:t,placeholder:n,dataAttribute:r,pos:i,node:a,isEmptyDoc:o,hasAnchor:s,classes:{emptyNode:c,emptyEditor:l}}=e,u=[c];return o&&u.push(l),Pu.node(i,i+a.nodeSize,{class:u.join(` `),[r]:typeof n==`function`?n({editor:t,node:a,pos:i,hasAnchor:s}):n})}function Yx(e,t){return typeof e==`function`?e(t):e}function Xx({editor:e,options:t,dataAttribute:n,doc:r,selection:i}){if(!e.isEditable&&t.showOnlyWhenEditable)return null;let{anchor:a}=i,o=[],s=e.isEmpty;if(t.showOnlyCurrent&&!t.includeChildren){let i=r.resolve(a),c=i.depth>0?i.node(1):i.nodeAfter,l=i.depth>0?i.before(1):a;if(c&&c.type.isTextblock&&Yp(c)){let r=a>=l&&a<=l+c.nodeSize;o.push(Jx({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:Yx(t.emptyNodeClass,{editor:e,node:c,pos:l,hasAnchor:r})},node:c,pos:l}))}}else{let i=Kx.getState(e.state),c=i?.topPos??0,l=i?.bottomPos??r.content.size;r.nodesBetween(c,l,(r,i)=>{let c=a>=i&&a<=i+r.nodeSize,l=!r.isLeaf&&Yp(r);return r.type.isTextblock&&(c||!t.showOnlyCurrent)&&l&&o.push(Jx({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:c,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:Yx(t.emptyNodeClass,{editor:e,node:r,pos:i,hasAnchor:c})},node:r,pos:i})),t.includeChildren})}return Lu.create(r,o)}function Zx(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}function Qx(e){let t=getComputedStyle(e),n=`${t.overflow} ${t.overflowY} ${t.overflowX}`;return/auto|scroll|overlay/.test(n)}function $x(e){let t=e;for(;t;){if(Qx(t))return t;let e=t.parentElement;if(!e){let e=t.getRootNode();if(e instanceof ShadowRoot){t=e.host;continue}return window}t=e}return window}function eS(e){return e===window?{top:0,bottom:window.innerHeight}:e.getBoundingClientRect()}function tS({view:e,scrollContainer:t}){let n=e.dom.getBoundingClientRect();if(n.width<=0||n.height<=0)return null;let r=t?eS(t):{top:0,bottom:window.innerHeight},i=Math.max(n.top,r.top)-qx,a=Math.min(n.bottom,r.bottom)+qx;if(i>=a)return null;let o=n.left+1,s=n.right-1;if(o>s)return null;let c=getComputedStyle(e.dom).direction===`rtl`?n.right-2:n.left+2,l=Math.min(Math.max(c,o),s),u=Math.max(i+2,n.top+1),d=Math.min(a-2,n.bottom-1);if(u>d)return null;let f=e.posAtCoords({left:l,top:u}),p=e.posAtCoords({left:l,top:d});return!f||!p?null:{top:f.pos,bottom:p.pos}}var nS={init(){return{topPos:null,bottomPos:null}},apply(e,t){let n=e.getMeta(Kx);return n?.positions?{topPos:n.positions.top,bottomPos:n.positions.bottom}:e.docChanged?{topPos:t.topPos===null?null:e.mapping.map(t.topPos),bottomPos:t.bottomPos===null?null:e.mapping.map(t.bottomPos)}:t}};function rS(e){let t=$x(e.dom),n=()=>{let n=tS({view:e,scrollContainer:t});if(n===null)return;let r=Kx.getState(e.state);if(r?.topPos===n.top&&r?.bottomPos===n.bottom)return;let i=e.state.tr.setMeta(Kx,{positions:n});e.dispatch(i)},r=null,i=0,a=()=>{r===null&&(r=requestAnimationFrame(()=>{r=null;let e=performance.now();e-i>=150?(i=e,n()):a()}))};t.addEventListener(`scroll`,a,{passive:!0});let o=typeof ResizeObserver<`u`?new ResizeObserver(a):null;o?.observe(e.dom);let s=typeof IntersectionObserver<`u`?new IntersectionObserver(a):null;return s?.observe(e.dom),e.dom.addEventListener(`focus`,a),n(),{update(t,n){e.state.doc.content.size!==n.doc.content.size&&a()},destroy:()=>{r!==null&&cancelAnimationFrame(r),t.removeEventListener(`scroll`,a),o?.disconnect(),s?.disconnect(),e.dom.removeEventListener(`focus`,a)}}}function iS({editor:e,options:t}){let n=t.dataAttribute?`data-${Zx(t.dataAttribute)}`:`data-${Gx}`;return new co({key:Kx,state:nS,view:rS,props:{decorations:({doc:r,selection:i})=>Xx({editor:e,options:t,dataAttribute:n,doc:r,selection:i})}})}var aS=ah.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:Gx,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[iS({editor:this.editor,options:this.options})]}}),oS=`.ProseMirror:not(.ProseMirror-focused) *::selection {
|
|
147
|
+
background: transparent;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.ProseMirror:not(.ProseMirror-focused) *::-moz-selection {
|
|
151
|
+
background: transparent;
|
|
152
|
+
}`;ah.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return e.options.injectCSS&&typeof document<`u`&&km(oS,e.options.injectNonce,`selection`),[new co({key:new fo(`selection`),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||Xp(n.selection)||e.view.dragging?null:Lu.create(n.doc,[Pu.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function sS({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var cS=ah.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new fo(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new co({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!sS({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!sS({node:r,types:n})}}})]}}),lS=ah.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>Vx(e,t),redo:()=>({state:e,dispatch:t})=>Hx(e,t)}},addProseMirrorPlugins(){return[zx(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),uS=ah.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(h_.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(u_.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(Qy.configure(this.options.bulletList)),this.options.code!==!1&&e.push(v_.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(S_.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(C_.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(Ux.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(Wx.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(w_.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(T_.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(lS.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(E_.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(j_.configure(this.options.italic)),this.options.listItem!==!1&&e.push(xb.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(Mb.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(Ky.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(Jb.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(ex.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(rx.configure(this.options.strike)),this.options.text!==!1&&e.push(ix.configure(this.options.text)),this.options.underline!==!1&&e.push(ax.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(cS.configure(this.options?.trailingNode)),e}}),dS=aS,fS=Zb,pS=Xb,mS=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,hS=Eh.create({name:`image`,addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?`inline`:`block`},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`}]},renderHTML({HTMLAttributes:e}){return[`img`,bp(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode(`image`,{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{let t=e.attrs?.src??``,n=e.attrs?.alt??``,r=e.attrs?.title??``;return r?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>`u`)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:i,getPos:a,HTMLAttributes:o,editor:s})=>{let c=document.createElement(`img`);c.draggable=!1;let l=bp(this.options.HTMLAttributes,o);Object.entries(l).forEach(([e,t])=>{if(t!=null)switch(e){case`width`:case`height`:break;default:c.setAttribute(e,t)}}),l.src!==null&&(c.src=l.src);let u=new Th({element:c,editor:s,node:i,getPos:a,onResize:(e,t)=>{c.style.width=`${e}px`,c.style.height=`${t}px`},onCommit:(e,t)=>{let n=a();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:(e,t,n)=>e.type===i.type,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),d=u.dom;return d.style.visibility=`hidden`,d.style.pointerEvents=`none`,c.onload=()=>{d.style.visibility=``,d.style.pointerEvents=``},u}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[xh({find:mS,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),gS=ah.create({name:`textAlign`,addOptions(){return{types:[],alignments:[`left`,`center`,`right`,`justify`],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{let t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>this.options.alignments.includes(e)?this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).some(e=>e):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,`textAlign`)).some(e=>e),toggleTextAlign:e=>({editor:t,commands:n})=>this.options.alignments.includes(e)?t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign(`left`),"Mod-Shift-e":()=>this.editor.commands.setTextAlign(`center`),"Mod-Shift-r":()=>this.editor.commands.setTextAlign(`right`),"Mod-Shift-j":()=>this.editor.commands.setTextAlign(`justify`)}}}),_S=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,vS=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,yS=Xm.create({name:`highlight`,addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute(`data-color`)||Am(e,`background-color`)||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:`mark`}]},renderHTML({HTMLAttributes:e}){return[`mark`,bp(this.options.HTMLAttributes,e),0]},renderMarkdown:(e,t)=>`==${t.renderChildren(e)}==`,parseMarkdown:(e,t)=>t.applyMark(`highlight`,t.parseInline(e.tokens||[])),markdownTokenizer:{name:`highlight`,level:`inline`,start:e=>e.indexOf(`==`),tokenize(e,t,n){let r=/^(==)([^=]+)(==)/.exec(e);if(r){let e=r[2].trim(),t=n.inlineTokens(e);return{type:`highlight`,raw:r[0],text:e,tokens:t}}}},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[bh({find:_S,type:this.type})]},addPasteRules(){return[Dh({find:vS,type:this.type})]}}),bS=e(n(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=`</span>`,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],e[0]===`(`&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,E=`[a-zA-Z_]\\w*`,D=`\\b\\d+(\\.\\d+)?`,O=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,k=`\\b(0b[01]+)`,A=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,j=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},M={begin:`\\\\[\\s\\S]`,relevance:0},N={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[M]},P={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[M]},F={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},I=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},L=I(`//`,`$`),R=I(`/\\*`,`\\*/`),ee=I(`#`,`$`),z=Object.freeze({__proto__:null,APOS_STRING_MODE:N,BACKSLASH_ESCAPE:M,BINARY_NUMBER_MODE:{scope:`number`,begin:k,relevance:0},BINARY_NUMBER_RE:k,COMMENT:I,C_BLOCK_COMMENT_MODE:R,C_LINE_COMMENT_MODE:L,C_NUMBER_MODE:{scope:`number`,begin:O,relevance:0},C_NUMBER_RE:O,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:ee,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:{begin:`\\.\\s*[a-zA-Z_]\\w*`,relevance:0},NUMBER_MODE:{scope:`number`,begin:D,relevance:0},NUMBER_RE:D,PHRASAL_WORDS_MODE:F,QUOTE_STRING_MODE:P,REGEXP_MODE:{scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[M,{begin:/\[/,end:/\]/,relevance:0,contains:[M]}]},RE_STARTERS_RE:A,SHEBANG:j,TITLE_MODE:{scope:`title`,begin:T,relevance:0},UNDERSCORE_IDENT_RE:E,UNDERSCORE_TITLE_MODE:{scope:`title`,begin:E,relevance:0}});function te(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function ne(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function B(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=te,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function V(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function re(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function H(e,t){e.relevance===void 0&&(e.relevance=1)}var ie=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},U=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],W=`keyword`;function ae(e,t,n=W){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,ae(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,oe(n[0],n[1])]})}}function oe(e,t){return t?Number(t):+!se(e)}function se(e){return U.includes(e.toLowerCase())}var ce={},le=e=>{console.error(e)},G=(e,...t)=>{console.log(`WARN: ${e}`,...t)},ue=(e,t)=>{ce[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),ce[`${e}/${t}`]=!0)},de=Error();function K(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function fe(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw le(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),de;if(typeof e.beginScope!=`object`||e.beginScope===null)throw le(`beginScope must be object`),de;K(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function pe(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw le(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),de;if(typeof e.endScope!=`object`||e.endScope===null)throw le(`endScope must be object`),de;K(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function me(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function he(e){me(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),fe(e),pe(e)}function ge(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(C(e,{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[ne,re,he,ie].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[B,V,H].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=ae(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return ve(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function _e(e){return e?e.endsWithParent||_e(e.starts):!1}function ve(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:_e(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var ye=`11.11.1`,be=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},xe=i,Se=a,Ce=Symbol(`nomatch`),we=7,Te=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=N(n[1]);return t||(G(s.replace(`{}`,n[1])),G(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||N(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(ue(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),ue(`10.7.0`,`Please use highlight(code, options) instead.
|
|
153
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};ee(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,ee(`after:highlight`,o),o}function v(e,n,i,a){let c=Object.create(null);function u(e,t){return e.keywords[t]}function d(){if(!A.keywords){M.addText(P);return}let e=0;A.keywordPatternRe.lastIndex=0;let t=A.keywordPatternRe.exec(P),n=``;for(;t;){n+=P.substring(e,t.index);let r=D.case_insensitive?t[0].toLowerCase():t[0],i=u(A,r);if(i){let[e,a]=i;if(M.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=we&&(F+=a),e.startsWith(`_`))n+=t[0];else{let n=D.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=A.keywordPatternRe.lastIndex,t=A.keywordPatternRe.exec(P)}n+=P.substring(e),M.addText(n)}function f(){if(P===``)return;let e=null;if(typeof A.subLanguage==`string`){if(!t[A.subLanguage]){M.addText(P);return}e=v(A.subLanguage,P,!0,j[A.subLanguage]),j[A.subLanguage]=e._top}else e=S(P,A.subLanguage.length?A.subLanguage:null);A.relevance>0&&(F+=e.relevance),M.__addSublanguage(e._emitter,e.language)}function p(){A.subLanguage==null?d():f(),P=``}function m(e,t){e!==``&&(M.startScope(t),M.addText(e),M.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=D.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(P=i,d(),P=``),n++}}function g(e,t){return e.scope&&typeof e.scope==`string`&&M.openNode(D.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(P,D.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),P=``):e.beginScope._multi&&(h(e.beginScope,t),P=``)),A=Object.create(e,{parent:{value:A}}),A}function _(e,t,n){let i=x(e.endRe,n);if(i){if(e[`on:end`]){let n=new r(e);e[`on:end`](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return _(e.parent,t,n)}function y(e){return A.matcher.regexIndex===0?(P+=e[0],1):(R=!0,0)}function b(e){let t=e[0],n=e.rule,i=new r(n),a=[n.__beforeBegin,n[`on:begin`]];for(let n of a)if(n&&(n(e,i),i.isMatchIgnored))return y(t);return n.skip?P+=t:(n.excludeBegin&&(P+=t),p(),!n.returnBegin&&!n.excludeBegin&&(P=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(A,e,r);if(!i)return Ce;let a=A;A.endScope&&A.endScope._wrap?(p(),m(t,A.endScope._wrap)):A.endScope&&A.endScope._multi?(p(),h(A.endScope,e)):a.skip?P+=t:(a.returnEnd||a.excludeEnd||(P+=t),p(),a.excludeEnd&&(P=t));do A.scope&&M.closeNode(),!A.skip&&!A.subLanguage&&(F+=A.relevance),A=A.parent;while(A!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=A;t!==D;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>M.openNode(e))}let T={};function E(t,r){let a=r&&r[0];if(P+=t,a==null)return p(),0;if(T.type===`begin`&&r.type===`end`&&T.index===r.index&&a===``){if(P+=n.slice(r.index,r.index+1),!o){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=T.rule,t}return 1}if(T=r,r.type===`begin`)return b(r);if(r.type===`illegal`&&!i){let e=Error(`Illegal lexeme "`+a+`" for mode "`+(A.scope||`<unnamed>`)+`"`);throw e.mode=A,e}if(r.type===`end`){let e=C(r);if(e!==Ce)return e}if(r.type===`illegal`&&a===``)return P+=`
|
|
154
|
+
`,1;if(L>1e5&&L>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return P+=a,a.length}let D=N(e);if(!D)throw le(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=ge(D),k=``,A=a||O,j={},M=new l.__emitter(l);w();let P=``,F=0,I=0,L=0,R=!1;try{if(D.__emitTokens)D.__emitTokens(n,M);else{for(A.matcher.considerAll();;){L++,R?R=!1:A.matcher.considerAll(),A.matcher.lastIndex=I;let e=A.matcher.exec(n);if(!e)break;let t=E(n.substring(I,e.index),e);I=e.index+t}E(n.substring(I))}return M.finalize(),k=M.toHTML(),{language:e,value:k,relevance:F,illegal:!1,_emitter:M,_top:A}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:xe(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:I,context:n.slice(I-100,I+100),mode:t.mode,resultSoFar:k},_emitter:M};if(o)return{language:e,value:xe(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:A};throw t}}function b(e){let t={value:xe(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(N).filter(F).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(N(e.language).supersetOf===t.language)return 1;if(N(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(ee(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new be(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),ee(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=Se(l,e)}let E=()=>{k(),ue(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),ue(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let O=!1;function k(){function e(){k()}if(document.readyState===`loading`){O||window.addEventListener(`DOMContentLoaded`,e,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function A(n,r){let i=null;try{i=r(e)}catch(e){if(le(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)le(e);else throw e;i=c}i.name||(i.name=n),t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&P(i.aliases,{languageName:n})}function j(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function M(){return Object.keys(t)}function N(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function P(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function F(e){let t=N(e);return t&&!t.disableAutodetect}function I(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function L(e){I(e),a.push(e)}function R(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function ee(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function te(e){return ue(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),ue(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:te,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:j,listLanguages:M,getLanguage:N,registerAliases:P,autoDetection:F,inherit:Se,addPlugin:L,removePlugin:R}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=ye,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in z)typeof z[e]==`object`&&n(z[e]);return Object.assign(e,z),e},Ee=Te({});Ee.newInstance=()=>Te({}),t.exports=Ee,Ee.HighlightJS=Ee,Ee.default=Ee}))()).default;function xS(e,t=[]){return e.flatMap(e=>{let n=[...t,...e.properties?e.properties.className:[]];return e.children?xS(e.children,n):{text:e.value,classes:n}})}function SS(e){return e.value||e.children||[]}function CS(e){return!!bS.getLanguage(e)}function wS({doc:e,name:t,lowlight:n,defaultLanguage:r}){let i=[];return op(e,e=>e.type.name===t).forEach(e=>{let t=e.pos+1,a=e.node.attrs.language||r,o=n.listLanguages();xS(a&&(o.includes(a)||CS(a)||n.registered?.call(n,a))?SS(n.highlight(a,e.node.textContent)):SS(n.highlightAuto(e.node.textContent))).forEach(e=>{let n=t+e.text.length;if(e.classes.length){let r=Pu.inline(t,n,{class:e.classes.join(` `)});i.push(r)}t=n})}),Lu.create(e,i)}function TS(e){return typeof e==`function`}function ES({name:e,lowlight:t,defaultLanguage:n}){if(![`highlight`,`highlightAuto`,`listLanguages`].every(e=>TS(t[e])))throw Error(`You should provide an instance of lowlight to use the code-block-lowlight extension`);let r=new co({key:new fo(`lowlight`),state:{init:(r,{doc:i})=>wS({doc:i,name:e,lowlight:t,defaultLanguage:n}),apply:(r,i,a,o)=>{let s=a.selection.$head.parent.type.name,c=o.selection.$head.parent.type.name,l=op(a.doc,t=>t.type.name===e),u=op(o.doc,t=>t.type.name===e);return r.docChanged&&([s,c].includes(e)||u.length!==l.length||r.steps.some(e=>e.from!==void 0&&e.to!==void 0&&l.some(t=>t.pos>=e.from&&t.pos+t.node.nodeSize<=e.to)))?wS({doc:r.doc,name:e,lowlight:t,defaultLanguage:n}):i.map(r.mapping,r.doc)}},props:{decorations(e){return r.getState(e)}}});return r}var DS=S_.extend({addOptions(){return{...this.parent?.call(this),lowlight:{},languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}},addProseMirrorPlugins(){return[...this.parent?.call(this)||[],ES({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}}),OS={};function kS(e){let t=OS[e];if(t)return t;t=OS[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);t.push(n)}for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[r]=`%`+(`0`+r.toString(16).toUpperCase()).slice(-2)}return t}function AS(e,t){typeof t!=`string`&&(t=AS.defaultChars);let n=kS(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(e){let t=``;for(let r=0,i=e.length;r<i;r+=3){let a=parseInt(e.slice(r+1,r+3),16);if(a<128){t+=n[a];continue}if((a&224)==192&&r+3<i){let n=parseInt(e.slice(r+4,r+6),16);if((n&192)==128){let e=a<<6&1984|n&63;t+=e<128?`��`:String.fromCharCode(e),r+=3;continue}}if((a&240)==224&&r+6<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16);if((n&192)==128&&(i&192)==128){let e=a<<12&61440|n<<6&4032|i&63;t+=e<2048||e>=55296&&e<=57343?`���`:String.fromCharCode(e),r+=6;continue}}if((a&248)==240&&r+9<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16),o=parseInt(e.slice(r+10,r+12),16);if((n&192)==128&&(i&192)==128&&(o&192)==128){let e=a<<18&1835008|n<<12&258048|i<<6&4032|o&63;e<65536||e>1114111?t+=`����`:(e-=65536,t+=String.fromCharCode(55296+(e>>10),56320+(e&1023))),r+=9;continue}}t+=`�`}return t})}AS.defaultChars=`;/?:@&=+$,#`,AS.componentChars=``;var jS={};function MS(e){let t=jS[e];if(t)return t;t=jS[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);/^[0-9a-z]$/i.test(n)?t.push(n):t.push(`%`+(`0`+e.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function NS(e,t,n){typeof t!=`string`&&(n=t,t=NS.defaultChars),n===void 0&&(n=!0);let r=MS(t),i=``;for(let t=0,a=e.length;t<a;t++){let o=e.charCodeAt(t);if(n&&o===37&&t+2<a&&/^[0-9a-f]{2}$/i.test(e.slice(t+1,t+3))){i+=e.slice(t,t+3),t+=2;continue}if(o<128){i+=r[o];continue}if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&t+1<a){let n=e.charCodeAt(t+1);if(n>=56320&&n<=57343){i+=encodeURIComponent(e[t]+e[t+1]),t++;continue}}i+=`%EF%BF%BD`;continue}i+=encodeURIComponent(e[t])}return i}NS.defaultChars=`;/?:@&=+$,-_.!~*'()#`,NS.componentChars=`-_.!~*'()`;function PS(e){let t=``;return t+=e.protocol||``,t+=e.slashes?`//`:``,t+=e.auth?e.auth+`@`:``,e.hostname&&e.hostname.indexOf(`:`)!==-1?t+=`[`+e.hostname+`]`:t+=e.hostname||``,t+=e.port?`:`+e.port:``,t+=e.pathname||``,t+=e.search||``,t+=e.hash||``,t}function FS(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var IS=/^([a-z0-9.+-]+:)/i,LS=/:[0-9]*$/,RS=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,zS=[`%`,`/`,`?`,`;`,`#`,`'`,`{`,`}`,`|`,`\\`,`^`,"`",`<`,`>`,`"`,"`",` `,`\r`,`
|
|
155
|
+
`,` `],BS=[`/`,`?`,`#`],VS=255,HS=/^[+a-z0-9A-Z_-]{0,63}$/,US=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,WS={javascript:!0,"javascript:":!0},GS={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function KS(e,t){if(e&&e instanceof FS)return e;let n=new FS;return n.parse(e,t),n}FS.prototype.parse=function(e,t){let n,r,i,a=e;if(a=a.trim(),!t&&e.split(`#`).length===1){let e=RS.exec(a);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let o=IS.exec(a);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,a=a.substr(o.length)),(t||o||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=a.substr(0,2)===`//`,i&&!(o&&WS[o])&&(a=a.substr(2),this.slashes=!0)),!WS[o]&&(i||o&&!GS[o])){let e=-1;for(let t=0;t<BS.length;t++)r=a.indexOf(BS[t]),r!==-1&&(e===-1||r<e)&&(e=r);let t,n;n=e===-1?a.lastIndexOf(`@`):a.lastIndexOf(`@`,e),n!==-1&&(t=a.slice(0,n),a=a.slice(n+1),this.auth=t),e=-1;for(let t=0;t<zS.length;t++)r=a.indexOf(zS[t]),r!==-1&&(e===-1||r<e)&&(e=r);e===-1&&(e=a.length),a[e-1]===`:`&&e--;let i=a.slice(0,e);a=a.slice(e),this.parseHost(i),this.hostname=this.hostname||``;let o=this.hostname[0]===`[`&&this.hostname[this.hostname.length-1]===`]`;if(!o){let e=this.hostname.split(/\./);for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n&&!n.match(HS)){let r=``;for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+=`x`:r+=n[e];if(!r.match(HS)){let r=e.slice(0,t),i=e.slice(t+1),o=n.match(US);o&&(r.push(o[1]),i.unshift(o[2])),i.length&&(a=i.join(`.`)+a),this.hostname=r.join(`.`);break}}}}this.hostname.length>VS&&(this.hostname=``),o&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let s=a.indexOf(`#`);s!==-1&&(this.hash=a.substr(s),a=a.slice(0,s));let c=a.indexOf(`?`);return c!==-1&&(this.search=a.substr(c),a=a.slice(0,c)),a&&(this.pathname=a),GS[n]&&this.hostname&&!this.pathname&&(this.pathname=``),this},FS.prototype.parseHost=function(e){let t=LS.exec(e);t&&(t=t[0],t!==`:`&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var qS=t({decode:()=>AS,encode:()=>NS,format:()=>PS,parse:()=>KS}),JS=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,YS=/[\0-\x1F\x7F-\x9F]/,XS=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,ZS=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,QS=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,$S=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,eC=t({Any:()=>JS,Cc:()=>YS,Cf:()=>XS,P:()=>ZS,S:()=>QS,Z:()=>$S}),tC=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0))),nC=new Uint16Array(`Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢`.split(``).map(e=>e.charCodeAt(0))),rC=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),iC=String.fromCodePoint??function(e){let t=``;return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function aC(e){return e>=55296&&e<=57343||e>1114111?65533:rC.get(e)??e}var oC;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(oC||={});var sC=32,cC;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(cC||={});function lC(e){return e>=oC.ZERO&&e<=oC.NINE}function uC(e){return e>=oC.UPPER_A&&e<=oC.UPPER_F||e>=oC.LOWER_A&&e<=oC.LOWER_F}function dC(e){return e>=oC.UPPER_A&&e<=oC.UPPER_Z||e>=oC.LOWER_A&&e<=oC.LOWER_Z||lC(e)}function fC(e){return e===oC.EQUALS||dC(e)}var pC;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(pC||={});var mC;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(mC||={});var hC=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=pC.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=mC.Strict}startEntity(e){this.decodeMode=e,this.state=pC.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case pC.EntityStart:return e.charCodeAt(t)===oC.NUM?(this.state=pC.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=pC.NamedEntity,this.stateNamedEntity(e,t));case pC.NumericStart:return this.stateNumericStart(e,t);case pC.NumericDecimal:return this.stateNumericDecimal(e,t);case pC.NumericHex:return this.stateNumericHex(e,t);case pC.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|sC)===oC.LOWER_X?(this.state=pC.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=pC.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(lC(r)||uC(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(lC(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===oC.SEMI)this.consumed+=1;else if(this.decodeMode===mC.Strict)return 0;return this.emitCodePoint(aC(this.result),this.consumed),this.errors&&(e!==oC.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&cC.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=_C(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===mC.Attribute&&(i===0||fC(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&cC.VALUE_LENGTH)>>14,i!==0){if(a===oC.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==mC.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&cC.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~cC.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case pC.NamedEntity:return this.result!==0&&(this.decodeMode!==mC.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case pC.NumericDecimal:return this.emitNumericEntity(0,2);case pC.NumericHex:return this.emitNumericEntity(0,3);case pC.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case pC.EntityStart:return 0}}};function gC(e){let t=``,n=new hC(e,e=>t+=iC(e));return function(e,r){let i=0,a=0;for(;(a=e.indexOf(`&`,a))>=0;){t+=e.slice(i,a),n.startEntity(r);let o=n.write(e,a+1);if(o<0){i=a+n.end();break}i=a+o,a=o===0?i+1:i}let o=t+e.slice(i);return t=``,o}}function _C(e,t,n,r){let i=(t&cC.BRANCH_LENGTH)>>7,a=t&cC.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var vC=gC(tC);gC(nC);function yC(e,t=mC.Legacy){return vC(e,t)}var bC=t({arrayReplaceAt:()=>EC,assign:()=>TC,escapeHtml:()=>zC,escapeRE:()=>VC,fromCodePoint:()=>OC,has:()=>wC,isMdAsciiPunct:()=>GC,isPunctChar:()=>WC,isSpace:()=>HC,isString:()=>SC,isValidEntityCode:()=>DC,isWhiteSpace:()=>UC,lib:()=>qC,normalizeReference:()=>KC,unescapeAll:()=>PC,unescapeMd:()=>NC});function xC(e){return Object.prototype.toString.call(e)}function SC(e){return xC(e)===`[object String]`}var CC=Object.prototype.hasOwnProperty;function wC(e,t){return CC.call(e,t)}function TC(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){if(t){if(typeof t!=`object`)throw TypeError(t+`must be object`);Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e}function EC(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function DC(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function OC(e){if(e>65535){e-=65536;let t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var kC=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,AC=RegExp(kC.source+`|&([a-z#][a-z0-9]{1,31});`,`gi`),jC=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function MC(e,t){if(t.charCodeAt(0)===35&&jC.test(t)){let n=t[1].toLowerCase()===`x`?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return DC(n)?OC(n):e}let n=yC(e);return n===e?e:n}function NC(e){return e.indexOf(`\\`)<0?e:e.replace(kC,`$1`)}function PC(e){return e.indexOf(`\\`)<0&&e.indexOf(`&`)<0?e:e.replace(AC,function(e,t,n){return t||MC(e,n)})}var FC=/[&<>"]/,IC=/[&<>"]/g,LC={"&":`&`,"<":`<`,">":`>`,'"':`"`};function RC(e){return LC[e]}function zC(e){return FC.test(e)?e.replace(IC,RC):e}var BC=/[.?*+^$[\]\\(){}|-]/g;function VC(e){return e.replace(BC,`\\$&`)}function HC(e){switch(e){case 9:case 32:return!0}return!1}function UC(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function WC(e){return ZS.test(e)||QS.test(e)}function GC(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function KC(e){return e=e.trim().replace(/\s+/g,` `),e.toLowerCase().toUpperCase()}var qC={mdurl:qS,ucmicro:eC};function JC(e,t,n){let r,i,a,o,s=e.posMax,c=e.pos;for(e.pos=t+1,r=1;e.pos<s;){if(a=e.src.charCodeAt(e.pos),a===93&&(r--,r===0)){i=!0;break}if(o=e.pos,e.md.inline.skipToken(e),a===91){if(o===e.pos-1)r++;else if(n)return e.pos=c,-1}}let l=-1;return i&&(l=e.pos),e.pos=c,l}function YC(e,t,n){let r,i=t,a={ok:!1,pos:0,str:``};if(e.charCodeAt(i)===60){for(i++;i<n;){if(r=e.charCodeAt(i),r===10||r===60)return a;if(r===62)return a.pos=i+1,a.str=PC(e.slice(t+1,i)),a.ok=!0,a;if(r===92&&i+1<n){i+=2;continue}i++}return a}let o=0;for(;i<n&&(r=e.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(e.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(o++,o>32))return a;if(r===41){if(o===0)break;o--}i++}return t===i||o!==0?a:(a.str=PC(e.slice(t,i)),a.pos=i,a.ok=!0,a)}function XC(e,t,n,r){let i,a=t,o={ok:!1,can_continue:!1,pos:0,str:``,marker:0};if(r)o.str=r.str,o.marker=r.marker;else{if(a>=n)return o;let r=e.charCodeAt(a);if(r!==34&&r!==39&&r!==40)return o;t++,a++,r===40&&(r=41),o.marker=r}for(;a<n;){if(i=e.charCodeAt(a),i===o.marker)return o.pos=a+1,o.str+=PC(e.slice(t,a)),o.ok=!0,o;if(i===40&&o.marker===41)return o;i===92&&a+1<n&&a++,a++}return o.can_continue=!0,o.str+=PC(e.slice(t,a)),o}var ZC=t({parseLinkDestination:()=>YC,parseLinkLabel:()=>JC,parseLinkTitle:()=>XC}),QC={};QC.code_inline=function(e,t,n,r,i){let a=e[t];return`<code`+i.renderAttrs(a)+`>`+zC(a.content)+`</code>`},QC.code_block=function(e,t,n,r,i){let a=e[t];return`<pre`+i.renderAttrs(a)+`><code>`+zC(e[t].content)+`</code></pre>
|
|
156
|
+
`},QC.fence=function(e,t,n,r,i){let a=e[t],o=a.info?PC(a.info).trim():``,s=``,c=``;if(o){let e=o.split(/(\s+)/g);s=e[0],c=e.slice(2).join(``)}let l;if(l=n.highlight&&n.highlight(a.content,s,c)||zC(a.content),l.indexOf(`<pre`)===0)return l+`
|
|
157
|
+
`;if(o){let e=a.attrIndex(`class`),t=a.attrs?a.attrs.slice():[];e<0?t.push([`class`,n.langPrefix+s]):(t[e]=t[e].slice(),t[e][1]+=` `+n.langPrefix+s);let r={attrs:t};return`<pre><code${i.renderAttrs(r)}>${l}</code></pre>\n`}return`<pre><code${i.renderAttrs(a)}>${l}</code></pre>\n`},QC.image=function(e,t,n,r,i){let a=e[t];return a.attrs[a.attrIndex(`alt`)][1]=i.renderInlineAsText(a.children,n,r),i.renderToken(e,t,n)},QC.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
|
|
158
|
+
`:`<br>
|
|
159
|
+
`},QC.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
160
|
+
`:`<br>
|
|
161
|
+
`:`
|
|
162
|
+
`},QC.text=function(e,t){return zC(e[t].content)},QC.html_block=function(e,t){return e[t].content},QC.html_inline=function(e,t){return e[t].content};function $C(){this.rules=TC({},QC)}$C.prototype.renderAttrs=function(e){let t,n,r;if(!e.attrs)return``;for(r=``,t=0,n=e.attrs.length;t<n;t++)r+=` `+zC(e.attrs[t][0])+`="`+zC(e.attrs[t][1])+`"`;return r},$C.prototype.renderToken=function(e,t,n){let r=e[t],i=``;if(r.hidden)return``;r.block&&r.nesting!==-1&&t&&e[t-1].hidden&&(i+=`
|
|
163
|
+
`),i+=(r.nesting===-1?`</`:`<`)+r.tag,i+=this.renderAttrs(r),r.nesting===0&&n.xhtmlOut&&(i+=` /`);let a=!1;if(r.block&&(a=!0,r.nesting===1&&t+1<e.length)){let n=e[t+1];(n.type===`inline`||n.hidden||n.nesting===-1&&n.tag===r.tag)&&(a=!1)}return i+=a?`>
|
|
164
|
+
`:`>`,i},$C.prototype.renderInline=function(e,t,n){let r=``,i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=e[a].type;i[o]===void 0?r+=this.renderToken(e,a,t):r+=i[o](e,a,t,n,this)}return r},$C.prototype.renderInlineAsText=function(e,t,n){let r=``;for(let i=0,a=e.length;i<a;i++)switch(e[i].type){case`text`:r+=e[i].content;break;case`image`:r+=this.renderInlineAsText(e[i].children,t,n);break;case`html_inline`:case`html_block`:r+=e[i].content;break;case`softbreak`:case`hardbreak`:r+=`
|
|
165
|
+
`}return r},$C.prototype.render=function(e,t,n){let r=``,i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=e[a].type;o===`inline`?r+=this.renderInline(e[a].children,t,n):i[o]===void 0?r+=this.renderToken(e,a,t,n):r+=i[o](e,a,t,n,this)}return r};function ew(){this.__rules__=[],this.__cache__=null}ew.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},ew.prototype.__compile__=function(){let e=this,t=[``];e.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(e){t.indexOf(e)<0&&t.push(e)})}),e.__cache__={},t.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||e.__cache__[t].push(n.fn))})})},ew.prototype.at=function(e,t,n){let r=this.__find__(e),i=n||{};if(r===-1)throw Error(`Parser rule not found: `+e);this.__rules__[r].fn=t,this.__rules__[r].alt=i.alt||[],this.__cache__=null},ew.prototype.before=function(e,t,n,r){let i=this.__find__(e),a=r||{};if(i===-1)throw Error(`Parser rule not found: `+e);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null},ew.prototype.after=function(e,t,n,r){let i=this.__find__(e),a=r||{};if(i===-1)throw Error(`Parser rule not found: `+e);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null},ew.prototype.push=function(e,t,n){let r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},ew.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(function(e){let r=this.__find__(e);if(r<0){if(t)return;throw Error(`Rules manager: invalid rule name `+e)}this.__rules__[r].enabled=!0,n.push(e)},this),this.__cache__=null,n},ew.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(e,t)},ew.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(function(e){let r=this.__find__(e);if(r<0){if(t)return;throw Error(`Rules manager: invalid rule name `+e)}this.__rules__[r].enabled=!1,n.push(e)},this),this.__cache__=null,n},ew.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function tw(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content=``,this.markup=``,this.info=``,this.meta=null,this.block=!1,this.hidden=!1}tw.prototype.attrIndex=function(e){if(!this.attrs)return-1;let t=this.attrs;for(let n=0,r=t.length;n<r;n++)if(t[n][0]===e)return n;return-1},tw.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},tw.prototype.attrSet=function(e,t){let n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r},tw.prototype.attrGet=function(e){let t=this.attrIndex(e),n=null;return t>=0&&(n=this.attrs[t][1]),n},tw.prototype.attrJoin=function(e,t){let n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+` `+t};function nw(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}nw.prototype.Token=tw;var rw=/\r\n?|\n/g,iw=/\0/g;function aw(e){let t;t=e.src.replace(rw,`
|
|
166
|
+
`),t=t.replace(iw,`�`),e.src=t}function ow(e){let t;e.inlineMode?(t=new e.Token(`inline`,``,0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function sw(e){let t=e.tokens;for(let n=0,r=t.length;n<r;n++){let r=t[n];r.type===`inline`&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}function cw(e){return/^<a[>\s]/i.test(e)}function lw(e){return/^<\/a\s*>/i.test(e)}function uw(e){let t=e.tokens;if(e.md.options.linkify)for(let n=0,r=t.length;n<r;n++){if(t[n].type!==`inline`||!e.md.linkify.pretest(t[n].content))continue;let r=t[n].children,i=0;for(let a=r.length-1;a>=0;a--){let o=r[a];if(o.type===`link_close`){for(a--;r[a].level!==o.level&&r[a].type!==`link_open`;)a--;continue}if(o.type===`html_inline`&&(cw(o.content)&&i>0&&i--,lw(o.content)&&i++),!(i>0)&&o.type===`text`&&e.md.linkify.test(o.content)){let i=o.content,s=e.md.linkify.match(i),c=[],l=o.level,u=0;s.length>0&&s[0].index===0&&a>0&&r[a-1].type===`text_special`&&(s=s.slice(1));for(let t=0;t<s.length;t++){let n=s[t].url,r=e.md.normalizeLink(n);if(!e.md.validateLink(r))continue;let a=s[t].text;a=s[t].schema?s[t].schema===`mailto:`&&!/^mailto:/i.test(a)?e.md.normalizeLinkText(`mailto:`+a).replace(/^mailto:/,``):e.md.normalizeLinkText(a):e.md.normalizeLinkText(`http://`+a).replace(/^http:\/\//,``);let o=s[t].index;if(o>u){let t=new e.Token(`text`,``,0);t.content=i.slice(u,o),t.level=l,c.push(t)}let d=new e.Token(`link_open`,`a`,1);d.attrs=[[`href`,r]],d.level=l++,d.markup=`linkify`,d.info=`auto`,c.push(d);let f=new e.Token(`text`,``,0);f.content=a,f.level=l,c.push(f);let p=new e.Token(`link_close`,`a`,-1);p.level=--l,p.markup=`linkify`,p.info=`auto`,c.push(p),u=s[t].lastIndex}if(u<i.length){let t=new e.Token(`text`,``,0);t.content=i.slice(u),t.level=l,c.push(t)}t[n].children=r=EC(r,a,c)}}}}var dw=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,fw=/\((c|tm|r)\)/i,pw=/\((c|tm|r)\)/gi,mw={c:`©`,r:`®`,tm:`™`};function hw(e,t){return mw[t.toLowerCase()]}function gw(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&(r.content=r.content.replace(pw,hw)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function _w(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&dw.test(r.content)&&(r.content=r.content.replace(/\+-/g,`±`).replace(/\.{2,}/g,`…`).replace(/([?!])…/g,`$1..`).replace(/([?!]){4,}/g,`$1$1$1`).replace(/,{2,}/g,`,`).replace(/(^|[^-])---(?=[^-]|$)/gm,`$1—`).replace(/(^|\s)--(?=\s|$)/gm,`$1–`).replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,`$1–`)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function vw(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type===`inline`&&(fw.test(e.tokens[t].content)&&gw(e.tokens[t].children),dw.test(e.tokens[t].content)&&_w(e.tokens[t].children))}var yw=/['"]/,bw=/['"]/g,xw=`’`;function Sw(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function Cw(e,t){let n,r=[];for(let i=0;i<e.length;i++){let a=e[i],o=e[i].level;for(n=r.length-1;n>=0&&!(r[n].level<=o);n--);if(r.length=n+1,a.type!==`text`)continue;let s=a.content,c=0,l=s.length;OUTER:for(;c<l;){bw.lastIndex=c;let u=bw.exec(s);if(!u)break;let d=!0,f=!0;c=u.index+1;let p=u[0]===`'`,m=32;if(u.index-1>=0)m=s.charCodeAt(u.index-1);else for(n=i-1;n>=0&&e[n].type!==`softbreak`&&e[n].type!==`hardbreak`;n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let h=32;if(c<l)h=s.charCodeAt(c);else for(n=i+1;n<e.length&&e[n].type!==`softbreak`&&e[n].type!==`hardbreak`;n++)if(e[n].content){h=e[n].content.charCodeAt(0);break}let g=GC(m)||WC(String.fromCharCode(m)),_=GC(h)||WC(String.fromCharCode(h)),v=UC(m),y=UC(h);if(y?d=!1:_&&(v||g||(d=!1)),v?f=!1:g&&(y||_||(f=!1)),h===34&&u[0]===`"`&&m>=48&&m<=57&&(f=d=!1),d&&f&&(d=g,f=_),!d&&!f){p&&(a.content=Sw(a.content,u.index,xw));continue}if(f)for(n=r.length-1;n>=0;n--){let d=r[n];if(r[n].level<o)break;if(d.single===p&&r[n].level===o){d=r[n];let o,f;p?(o=t.md.options.quotes[2],f=t.md.options.quotes[3]):(o=t.md.options.quotes[0],f=t.md.options.quotes[1]),a.content=Sw(a.content,u.index,f),e[d.token].content=Sw(e[d.token].content,d.pos,o),c+=f.length-1,d.token===i&&(c+=o.length-1),s=a.content,l=s.length,r.length=n;continue OUTER}}d?r.push({token:i,pos:u.index,single:p,level:o}):f&&p&&(a.content=Sw(a.content,u.index,xw))}}}function ww(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type===`inline`&&yw.test(e.tokens[t].content)&&Cw(e.tokens[t].children,e)}function Tw(e){let t,n,r=e.tokens,i=r.length;for(let e=0;e<i;e++){if(r[e].type!==`inline`)continue;let i=r[e].children,a=i.length;for(t=0;t<a;t++)i[t].type===`text_special`&&(i[t].type=`text`);for(t=n=0;t<a;t++)i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}}var Ew=[[`normalize`,aw],[`block`,ow],[`inline`,sw],[`linkify`,uw],[`replacements`,vw],[`smartquotes`,ww],[`text_join`,Tw]];function Dw(){this.ruler=new ew;for(let e=0;e<Ew.length;e++)this.ruler.push(Ew[e][0],Ew[e][1])}Dw.prototype.process=function(e){let t=this.ruler.getRules(``);for(let n=0,r=t.length;n<r;n++)t[n](e)},Dw.prototype.State=nw;function Ow(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType=`root`,this.level=0;let i=this.src;for(let e=0,t=0,n=0,r=0,a=i.length,o=!1;t<a;t++){let s=i.charCodeAt(t);if(!o){if(HC(s)){n++,s===9?r+=4-r%4:r++;continue}o=!0}(s===10||t===a-1)&&(s!==10&&t++,this.bMarks.push(e),this.eMarks.push(t),this.tShift.push(n),this.sCount.push(r),this.bsCount.push(0),o=!1,n=0,r=0,e=t+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}Ow.prototype.push=function(e,t,n){let r=new tw(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r},Ow.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},Ow.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},Ow.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t&&HC(this.src.charCodeAt(e));e++);return e},Ow.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!HC(this.src.charCodeAt(--e)))return e+1;return e},Ow.prototype.skipChars=function(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},Ow.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},Ow.prototype.getLines=function(e,t,n,r){if(e>=t)return``;let i=Array(t-e);for(let a=0,o=e;o<t;o++,a++){let e=0,s=this.bMarks[o],c=s,l;for(l=o+1<t||r?this.eMarks[o]+1:this.eMarks[o];c<l&&e<n;){let t=this.src.charCodeAt(c);if(HC(t))t===9?e+=4-(e+this.bsCount[o])%4:e++;else if(c-s<this.tShift[o])e++;else break;c++}e>n?i[a]=Array(e-n+1).join(` `)+this.src.slice(c,l):i[a]=this.src.slice(c,l)}return i.join(``)},Ow.prototype.Token=tw;var kw=65536;function Aw(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function jw(e){let t=[],n=e.length,r=0,i=e.charCodeAt(r),a=!1,o=0,s=``;for(;r<n;)i===124&&(a?(s+=e.substring(o,r-1),o=r):(t.push(s+e.substring(o,r)),s=``,o=r+1)),a=i===92,r++,i=e.charCodeAt(r);return t.push(s+e.substring(o)),t}function Mw(e,t,n,r){if(t+2>n)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent||e.sCount[i]-e.blkIndent>=4)return!1;let a=e.bMarks[i]+e.tShift[i];if(a>=e.eMarks[i])return!1;let o=e.src.charCodeAt(a++);if(o!==124&&o!==45&&o!==58||a>=e.eMarks[i])return!1;let s=e.src.charCodeAt(a++);if(s!==124&&s!==45&&s!==58&&!HC(s)||o===45&&HC(s))return!1;for(;a<e.eMarks[i];){let t=e.src.charCodeAt(a);if(t!==124&&t!==45&&t!==58&&!HC(t))return!1;a++}let c=Aw(e,t+1),l=c.split(`|`),u=[];for(let e=0;e<l.length;e++){let t=l[e].trim();if(!t){if(e===0||e===l.length-1)continue;return!1}if(!/^:?-+:?$/.test(t))return!1;t.charCodeAt(t.length-1)===58?u.push(t.charCodeAt(0)===58?`center`:`right`):t.charCodeAt(0)===58?u.push(`left`):u.push(``)}if(c=Aw(e,t).trim(),c.indexOf(`|`)===-1||e.sCount[t]-e.blkIndent>=4)return!1;l=jw(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop();let d=l.length;if(d===0||d!==u.length)return!1;if(r)return!0;let f=e.parentType;e.parentType=`table`;let p=e.md.block.ruler.getRules(`blockquote`),m=e.push(`table_open`,`table`,1),h=[t,0];m.map=h;let g=e.push(`thead_open`,`thead`,1);g.map=[t,t+1];let _=e.push(`tr_open`,`tr`,1);_.map=[t,t+1];for(let t=0;t<l.length;t++){let n=e.push(`th_open`,`th`,1);u[t]&&(n.attrs=[[`style`,`text-align:`+u[t]]]);let r=e.push(`inline`,``,0);r.content=l[t].trim(),r.children=[],e.push(`th_close`,`th`,-1)}e.push(`tr_close`,`tr`,-1),e.push(`thead_close`,`thead`,-1);let v,y=0;for(i=t+2;i<n&&!(e.sCount[i]<e.blkIndent);i++){let r=!1;for(let t=0,a=p.length;t<a;t++)if(p[t](e,i,n,!0)){r=!0;break}if(r||(c=Aw(e,i).trim(),!c)||e.sCount[i]-e.blkIndent>=4||(l=jw(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop(),y+=d-l.length,y>kw))break;if(i===t+2){let n=e.push(`tbody_open`,`tbody`,1);n.map=v=[t+2,0]}let a=e.push(`tr_open`,`tr`,1);a.map=[i,i+1];for(let t=0;t<d;t++){let n=e.push(`td_open`,`td`,1);u[t]&&(n.attrs=[[`style`,`text-align:`+u[t]]]);let r=e.push(`inline`,``,0);r.content=l[t]?l[t].trim():``,r.children=[],e.push(`td_close`,`td`,-1)}e.push(`tr_close`,`tr`,-1)}return v&&(e.push(`tbody_close`,`tbody`,-1),v[1]=i),e.push(`table_close`,`table`,-1),h[1]=i,e.parentType=f,e.line=i,!0}function Nw(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,i=r;continue}break}e.line=i;let a=e.push(`code_block`,`code`,0);return a.content=e.getLines(t,i,4+e.blkIndent,!1)+`
|
|
167
|
+
`,a.map=[t,e.line],!0}function Pw(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>a)return!1;let o=e.src.charCodeAt(i);if(o!==126&&o!==96)return!1;let s=i;i=e.skipChars(i,o);let c=i-s;if(c<3)return!1;let l=e.src.slice(s,i),u=e.src.slice(i,a);if(o===96&&u.indexOf(String.fromCharCode(o))>=0)return!1;if(r)return!0;let d=t,f=!1;for(;d++,!(d>=n||(i=s=e.bMarks[d]+e.tShift[d],a=e.eMarks[d],i<a&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(i)===o&&!(e.sCount[d]-e.blkIndent>=4)&&(i=e.skipChars(i,o),!(i-s<c)&&(i=e.skipSpaces(i),!(i<a)))){f=!0;break}c=e.sCount[t],e.line=d+ +!!f;let p=e.push(`fence`,`code`,0);return p.info=u,p.content=e.getLines(t+1,d,c,!0),p.markup=l,p.map=[t,e.line],!0}function Fw(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==62)return!1;if(r)return!0;let s=[],c=[],l=[],u=[],d=e.md.block.ruler.getRules(`blockquote`),f=e.parentType;e.parentType=`blockquote`;let p=!1,m;for(m=t;m<n;m++){let t=e.sCount[m]<e.blkIndent;if(i=e.bMarks[m]+e.tShift[m],a=e.eMarks[m],i>=a)break;if(e.src.charCodeAt(i++)===62&&!t){let t=e.sCount[m]+1,n,r;e.src.charCodeAt(i)===32?(i++,t++,r=!1,n=!0):e.src.charCodeAt(i)===9?(n=!0,(e.bsCount[m]+t)%4==3?(i++,t++,r=!1):r=!0):n=!1;let o=t;for(s.push(e.bMarks[m]),e.bMarks[m]=i;i<a;){let t=e.src.charCodeAt(i);if(HC(t))t===9?o+=4-(o+e.bsCount[m]+ +!!r)%4:o++;else break;i++}p=i>=a,c.push(e.bsCount[m]),e.bsCount[m]=e.sCount[m]+1+ +!!n,l.push(e.sCount[m]),e.sCount[m]=o-t,u.push(e.tShift[m]),e.tShift[m]=i-e.bMarks[m];continue}if(p)break;let r=!1;for(let t=0,i=d.length;t<i;t++)if(d[t](e,m,n,!0)){r=!0;break}if(r){e.lineMax=m,e.blkIndent!==0&&(s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]-=e.blkIndent);break}s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]=-1}let h=e.blkIndent;e.blkIndent=0;let g=e.push(`blockquote_open`,`blockquote`,1);g.markup=`>`;let _=[t,0];g.map=_,e.md.block.tokenize(e,t,m);let v=e.push(`blockquote_close`,`blockquote`,-1);v.markup=`>`,e.lineMax=o,e.parentType=f,_[1]=e.line;for(let n=0;n<u.length;n++)e.bMarks[n+t]=s[n],e.tShift[n+t]=u[n],e.sCount[n+t]=l[n],e.bsCount[n+t]=c[n];return e.blkIndent=h,!0}function Iw(e,t,n,r){let i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.bMarks[t]+e.tShift[t],o=e.src.charCodeAt(a++);if(o!==42&&o!==45&&o!==95)return!1;let s=1;for(;a<i;){let t=e.src.charCodeAt(a++);if(t!==o&&!HC(t))return!1;t===o&&s++}if(s<3)return!1;if(r)return!0;e.line=t+1;let c=e.push(`hr`,`hr`,0);return c.map=[t,e.line],c.markup=Array(s+1).join(String.fromCharCode(o)),!0}function Lw(e,t){let n=e.eMarks[t],r=e.bMarks[t]+e.tShift[t],i=e.src.charCodeAt(r++);return i!==42&&i!==45&&i!==43||r<n&&!HC(e.src.charCodeAt(r))?-1:r}function Rw(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t],i=n;if(i+1>=r)return-1;let a=e.src.charCodeAt(i++);if(a<48||a>57)return-1;for(;;){if(i>=r)return-1;if(a=e.src.charCodeAt(i++),a>=48&&a<=57){if(i-n>=10)return-1;continue}if(a===41||a===46)break;return-1}return i<r&&(a=e.src.charCodeAt(i),!HC(a))?-1:i}function zw(e,t){let n=e.level+2;for(let r=t+2,i=e.tokens.length-2;r<i;r++)e.tokens[r].level===n&&e.tokens[r].type===`paragraph_open`&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function Bw(e,t,n,r){let i,a,o,s,c=t,l=!0;if(e.sCount[c]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[c]-e.listIndent>=4&&e.sCount[c]<e.blkIndent)return!1;let u=!1;r&&e.parentType===`paragraph`&&e.sCount[c]>=e.blkIndent&&(u=!0);let d,f,p;if((p=Rw(e,c))>=0){if(d=!0,o=e.bMarks[c]+e.tShift[c],f=Number(e.src.slice(o,p-1)),u&&f!==1)return!1}else if((p=Lw(e,c))>=0)d=!1;else return!1;if(u&&e.skipSpaces(p)>=e.eMarks[c])return!1;if(r)return!0;let m=e.src.charCodeAt(p-1),h=e.tokens.length;d?(s=e.push(`ordered_list_open`,`ol`,1),f!==1&&(s.attrs=[[`start`,f]])):s=e.push(`bullet_list_open`,`ul`,1);let g=[c,0];s.map=g,s.markup=String.fromCharCode(m);let _=!1,v=e.md.block.ruler.getRules(`list`),y=e.parentType;for(e.parentType=`list`;c<n;){a=p,i=e.eMarks[c];let t=e.sCount[c]+p-(e.bMarks[c]+e.tShift[c]),r=t;for(;a<i;){let t=e.src.charCodeAt(a);if(t===9)r+=4-(r+e.bsCount[c])%4;else if(t===32)r++;else break;a++}let u=a,f;f=u>=i?1:r-t,f>4&&(f=1);let h=t+f;s=e.push(`list_item_open`,`li`,1),s.markup=String.fromCharCode(m);let g=[c,0];s.map=g,d&&(s.info=e.src.slice(o,p-1));let y=e.tight,b=e.tShift[c],x=e.sCount[c],S=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=h,e.tight=!0,e.tShift[c]=u-e.bMarks[c],e.sCount[c]=r,u>=i&&e.isEmpty(c+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,c,n,!0),(!e.tight||_)&&(l=!1),_=e.line-c>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=S,e.tShift[c]=b,e.sCount[c]=x,e.tight=y,s=e.push(`list_item_close`,`li`,-1),s.markup=String.fromCharCode(m),c=e.line,g[1]=c,c>=n||e.sCount[c]<e.blkIndent||e.sCount[c]-e.blkIndent>=4)break;let C=!1;for(let t=0,r=v.length;t<r;t++)if(v[t](e,c,n,!0)){C=!0;break}if(C)break;if(d){if(p=Rw(e,c),p<0)break;o=e.bMarks[c]+e.tShift[c]}else if(p=Lw(e,c),p<0)break;if(m!==e.src.charCodeAt(p-1))break}return s=d?e.push(`ordered_list_close`,`ol`,-1):e.push(`bullet_list_close`,`ul`,-1),s.markup=String.fromCharCode(m),g[1]=c,e.line=c,e.parentType=y,l&&zw(e,h),!0}function Vw(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==91)return!1;function s(t){let n=e.lineMax;if(t>=n||e.isEmpty(t))return null;let r=!1;if(e.sCount[t]-e.blkIndent>3&&(r=!0),e.sCount[t]<0&&(r=!0),!r){let r=e.md.block.ruler.getRules(`reference`),i=e.parentType;e.parentType=`reference`;let a=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,t,n,!0)){a=!0;break}if(e.parentType=i,a)return null}let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];return e.src.slice(i,a+1)}let c=e.src.slice(i,a+1);a=c.length;let l=-1;for(i=1;i<a;i++){let e=c.charCodeAt(i);if(e===91)return!1;if(e===93){l=i;break}if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(e===92&&(i++,i<a&&c.charCodeAt(i)===10)){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}}if(l<0||c.charCodeAt(l+1)!==58)return!1;for(i=l+2;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!HC(e))break}let u=e.md.helpers.parseLinkDestination(c,i,a);if(!u.ok)return!1;let d=e.md.normalizeLink(u.str);if(!e.md.validateLink(d))return!1;i=u.pos;let f=i,p=o,m=i;for(;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!HC(e))break}let h=e.md.helpers.parseLinkTitle(c,i,a);for(;h.can_continue;){let t=s(o);if(t===null)break;c+=t,i=a,a=c.length,o++,h=e.md.helpers.parseLinkTitle(c,i,a,h)}let g;for(i<a&&m!==i&&h.ok?(g=h.str,i=h.pos):(g=``,i=f,o=p);i<a&&HC(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10&&g)for(g=``,i=f,o=p;i<a&&HC(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10)return!1;let _=KC(c.slice(1,l));return _?r?!0:(e.env.references===void 0&&(e.env.references={}),e.env.references[_]===void 0&&(e.env.references[_]={title:g,href:d}),e.line=o,!0):!1}var Hw=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Uw=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,Ww=`<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>`,Gw=RegExp(`^(?:`+Uw+`|`+Ww+`|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),Kw=RegExp(`^(?:`+Uw+`|`+Ww+`)`),qw=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp(`^</?(`+Hw.join(`|`)+`)(?=(\\s|/?>|$))`,`i`),/^$/,!0],[RegExp(Kw.source+`\\s*$`),/^$/,!1]];function Jw(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let o=e.src.slice(i,a),s=0;for(;s<qw.length&&!qw[s][0].test(o);s++);if(s===qw.length)return!1;if(r)return qw[s][2];let c=t+1;if(!qw[s][1].test(o)){for(;c<n&&!(e.sCount[c]<e.blkIndent);c++)if(i=e.bMarks[c]+e.tShift[c],a=e.eMarks[c],o=e.src.slice(i,a),qw[s][1].test(o)){o.length!==0&&c++;break}}e.line=c;let l=e.push(`html_block`,``,0);return l.map=[t,c],l.content=e.getLines(t,c,e.blkIndent,!0),!0}function Yw(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.src.charCodeAt(i);if(o!==35||i>=a)return!1;let s=1;for(o=e.src.charCodeAt(++i);o===35&&i<a&&s<=6;)s++,o=e.src.charCodeAt(++i);if(s>6||i<a&&!HC(o))return!1;if(r)return!0;a=e.skipSpacesBack(a,i);let c=e.skipCharsBack(a,35,i);c>i&&HC(e.src.charCodeAt(c-1))&&(a=c),e.line=t+1;let l=e.push(`heading_open`,`h`+String(s),1);l.markup=`########`.slice(0,s),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=e.src.slice(i,a).trim(),u.map=[t,e.line],u.children=[];let d=e.push(`heading_close`,`h`+String(s),-1);return d.markup=`########`.slice(0,s),!0}function Xw(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`);if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.parentType;e.parentType=`paragraph`;let a=0,o,s=t+1;for(;s<n&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3)continue;if(e.sCount[s]>=e.blkIndent){let t=e.bMarks[s]+e.tShift[s],n=e.eMarks[s];if(t<n&&(o=e.src.charCodeAt(t),(o===45||o===61)&&(t=e.skipChars(t,o),t=e.skipSpaces(t),t>=n))){a=o===61?1:2;break}}if(e.sCount[s]<0)continue;let t=!1;for(let i=0,a=r.length;i<a;i++)if(r[i](e,s,n,!0)){t=!0;break}if(t)break}if(!a)return!1;let c=e.getLines(t,s,e.blkIndent,!1).trim();e.line=s+1;let l=e.push(`heading_open`,`h`+String(a),1);l.markup=String.fromCharCode(o),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=c,u.map=[t,e.line-1],u.children=[];let d=e.push(`heading_close`,`h`+String(a),-1);return d.markup=String.fromCharCode(o),e.parentType=i,!0}function Zw(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`),i=e.parentType,a=t+1;for(e.parentType=`paragraph`;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3||e.sCount[a]<0)continue;let t=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,a,n,!0)){t=!0;break}if(t)break}let o=e.getLines(t,a,e.blkIndent,!1).trim();e.line=a;let s=e.push(`paragraph_open`,`p`,1);s.map=[t,e.line];let c=e.push(`inline`,``,0);return c.content=o,c.map=[t,e.line],c.children=[],e.push(`paragraph_close`,`p`,-1),e.parentType=i,!0}var Qw=[[`table`,Mw,[`paragraph`,`reference`]],[`code`,Nw],[`fence`,Pw,[`paragraph`,`reference`,`blockquote`,`list`]],[`blockquote`,Fw,[`paragraph`,`reference`,`blockquote`,`list`]],[`hr`,Iw,[`paragraph`,`reference`,`blockquote`,`list`]],[`list`,Bw,[`paragraph`,`reference`,`blockquote`]],[`reference`,Vw],[`html_block`,Jw,[`paragraph`,`reference`,`blockquote`]],[`heading`,Yw,[`paragraph`,`reference`,`blockquote`]],[`lheading`,Xw],[`paragraph`,Zw]];function $w(){this.ruler=new ew;for(let e=0;e<Qw.length;e++)this.ruler.push(Qw[e][0],Qw[e][1],{alt:(Qw[e][2]||[]).slice()})}$w.prototype.tokenize=function(e,t,n){let r=this.ruler.getRules(``),i=r.length,a=e.md.options.maxNesting,o=t,s=!1;for(;o<n&&(e.line=o=e.skipEmptyLines(o),!(o>=n||e.sCount[o]<e.blkIndent));){if(e.level>=a){e.line=n;break}let t=e.line,c=!1;for(let a=0;a<i;a++)if(c=r[a](e,o,n,!1),c){if(t>=e.line)throw Error(`block rule didn't increment state.line`);break}if(!c)throw Error(`none of the block rules matched`);e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),o=e.line,o<n&&e.isEmpty(o)&&(s=!0,o++,e.line=o)}},$w.prototype.parse=function(e,t,n,r){if(!e)return;let i=new this.State(e,t,n,r);this.tokenize(i,i.line,i.lineMax)},$w.prototype.State=Ow;function eT(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending=``,this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}eT.prototype.pushPending=function(){let e=new tw(`text`,``,0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending=``,e},eT.prototype.push=function(e,t,n){this.pending&&this.pushPending();let r=new tw(e,t,n),i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r},eT.prototype.scanDelims=function(e,t){let n=this.posMax,r=this.src.charCodeAt(e),i=e>0?this.src.charCodeAt(e-1):32,a=e;for(;a<n&&this.src.charCodeAt(a)===r;)a++;let o=a-e,s=a<n?this.src.charCodeAt(a):32,c=GC(i)||WC(String.fromCharCode(i)),l=GC(s)||WC(String.fromCharCode(s)),u=UC(i),d=UC(s),f=!d&&(!l||u||c),p=!u&&(!c||d||l);return{can_open:f&&(t||!p||c),can_close:p&&(t||!f||l),length:o}},eT.prototype.Token=tw;function tT(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function nT(e,t){let n=e.pos;for(;n<e.posMax&&!tT(e.src.charCodeAt(n));)n++;return n!==e.pos&&(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}var rT=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function iT(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;let n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;let i=e.pending.match(rT);if(!i)return!1;let a=i[1],o=e.md.linkify.matchAtStart(e.src.slice(n-a.length));if(!o)return!1;let s=o.url;if(s.length<=a.length)return!1;let c=s.length;for(;c>0&&s.charCodeAt(c-1)===42;)c--;c!==s.length&&(s=s.slice(0,c));let l=e.md.normalizeLink(s);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-a.length);let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,l]],t.markup=`linkify`,t.info=`auto`;let n=e.push(`text`,``,0);n.content=e.md.normalizeLinkText(s);let r=e.push(`link_close`,`a`,-1);r.markup=`linkify`,r.info=`auto`}return e.pos+=s.length-a.length,!0}function aT(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;let r=e.pending.length-1,i=e.posMax;if(!t){if(r>=0&&e.pending.charCodeAt(r)===32){if(r>=1&&e.pending.charCodeAt(r-1)===32){let t=r-1;for(;t>=1&&e.pending.charCodeAt(t-1)===32;)t--;e.pending=e.pending.slice(0,t),e.push(`hardbreak`,`br`,0)}else e.pending=e.pending.slice(0,-1),e.push(`softbreak`,`br`,0)}else e.push(`softbreak`,`br`,0)}for(n++;n<i&&HC(e.src.charCodeAt(n));)n++;return e.pos=n,!0}var oT=[];for(let e=0;e<256;e++)oT.push(0);`\\!"#$%&'()*+,./:;<=>?@[]^_\`{|}~-`.split(``).forEach(function(e){oT[e.charCodeAt(0)]=1});function sT(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=e.src.charCodeAt(n);if(i===10){for(t||e.push(`hardbreak`,`br`,0),n++;n<r&&(i=e.src.charCodeAt(n),HC(i));)n++;return e.pos=n,!0}let a=e.src[n];if(i>=55296&&i<=56319&&n+1<r){let t=e.src.charCodeAt(n+1);t>=56320&&t<=57343&&(a+=e.src[n+1],n++)}let o=`\\`+a;if(!t){let t=e.push(`text_special`,``,0);t.content=i<256&&oT[i]!==0?a:o,t.markup=o,t.info=`escape`}return e.pos=n+1,!0}function cT(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;let r=n;n++;let i=e.posMax;for(;n<i&&e.src.charCodeAt(n)===96;)n++;let a=e.src.slice(r,n),o=a.length;if(e.backticksScanned&&(e.backticks[o]||0)<=r)return t||(e.pending+=a),e.pos+=o,!0;let s=n,c;for(;(c=e.src.indexOf("`",s))!==-1;){for(s=c+1;s<i&&e.src.charCodeAt(s)===96;)s++;let r=s-c;if(r===o){if(!t){let t=e.push(`code_inline`,`code`,0);t.markup=a,t.content=e.src.slice(n,c).replace(/\n/g,` `).replace(/^ (.+) $/,`$1`)}return e.pos=s,!0}e.backticks[r]=c}return e.backticksScanned=!0,t||(e.pending+=a),e.pos+=o,!0}function lT(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;let i=e.scanDelims(e.pos,!0),a=i.length,o=String.fromCharCode(r);if(a<2)return!1;let s;a%2&&(s=e.push(`text`,``,0),s.content=o,a--);for(let t=0;t<a;t+=2)s=e.push(`text`,``,0),s.content=o+o,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}function uT(e,t){let n,r=[],i=t.length;for(let a=0;a<i;a++){let i=t[a];if(i.marker!==126||i.end===-1)continue;let o=t[i.end];n=e.tokens[i.token],n.type=`s_open`,n.tag=`s`,n.nesting=1,n.markup=`~~`,n.content=``,n=e.tokens[o.token],n.type=`s_close`,n.tag=`s`,n.nesting=-1,n.markup=`~~`,n.content=``,e.tokens[o.token-1].type===`text`&&e.tokens[o.token-1].content===`~`&&r.push(o.token-1)}for(;r.length;){let t=r.pop(),i=t+1;for(;i<e.tokens.length&&e.tokens[i].type===`s_close`;)i++;i--,t!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[t],e.tokens[t]=n)}}function dT(e){let t=e.tokens_meta,n=e.tokens_meta.length;uT(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&uT(e,t[r].delimiters)}var fT={tokenize:lT,postProcess:dT};function pT(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;let i=e.scanDelims(e.pos,r===42);for(let t=0;t<i.length;t++){let t=e.push(`text`,``,0);t.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function mT(e,t){let n=t.length;for(let r=n-1;r>=0;r--){let n=t[r];if(n.marker!==95&&n.marker!==42||n.end===-1)continue;let i=t[n.end],a=r>0&&t[r-1].end===n.end+1&&t[r-1].marker===n.marker&&t[r-1].token===n.token-1&&t[n.end+1].token===i.token+1,o=String.fromCharCode(n.marker),s=e.tokens[n.token];s.type=a?`strong_open`:`em_open`,s.tag=a?`strong`:`em`,s.nesting=1,s.markup=a?o+o:o,s.content=``;let c=e.tokens[i.token];c.type=a?`strong_close`:`em_close`,c.tag=a?`strong`:`em`,c.nesting=-1,c.markup=a?o+o:o,c.content=``,a&&(e.tokens[t[r-1].token].content=``,e.tokens[t[n.end+1].token].content=``,r--)}}function hT(e){let t=e.tokens_meta,n=e.tokens_meta.length;mT(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&mT(e,t[r].delimiters)}var gT={tokenize:pT,postProcess:hT};function _T(e,t){let n,r,i,a,o=``,s=``,c=e.pos,l=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;let u=e.pos,d=e.posMax,f=e.pos+1,p=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(p<0)return!1;let m=p+1;if(m<d&&e.src.charCodeAt(m)===40){for(l=!1,m++;m<d&&(n=e.src.charCodeAt(m),HC(n)||n===10);m++);if(m>=d)return!1;if(c=m,i=e.md.helpers.parseLinkDestination(e.src,m,e.posMax),i.ok){for(o=e.md.normalizeLink(i.str),e.md.validateLink(o)?m=i.pos:o=``,c=m;m<d&&(n=e.src.charCodeAt(m),HC(n)||n===10);m++);if(i=e.md.helpers.parseLinkTitle(e.src,m,e.posMax),m<d&&c!==m&&i.ok)for(s=i.str,m=i.pos;m<d&&(n=e.src.charCodeAt(m),HC(n)||n===10);m++);}(m>=d||e.src.charCodeAt(m)!==41)&&(l=!0),m++}if(l){if(e.env.references===void 0)return!1;if(m<d&&e.src.charCodeAt(m)===91?(c=m+1,m=e.md.helpers.parseLinkLabel(e,m),m>=0?r=e.src.slice(c,m++):m=p+1):m=p+1,r||=e.src.slice(f,p),a=e.env.references[KC(r)],!a)return e.pos=u,!1;o=a.href,s=a.title}if(!t){e.pos=f,e.posMax=p;let t=e.push(`link_open`,`a`,1),n=[[`href`,o]];t.attrs=n,s&&n.push([`title`,s]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push(`link_close`,`a`,-1)}return e.pos=m,e.posMax=d,!0}function vT(e,t){let n,r,i,a,o,s,c,l,u=``,d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;let p=e.pos+2,m=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(m<0)return!1;if(a=m+1,a<f&&e.src.charCodeAt(a)===40){for(a++;a<f&&(n=e.src.charCodeAt(a),HC(n)||n===10);a++);if(a>=f)return!1;for(l=a,s=e.md.helpers.parseLinkDestination(e.src,a,e.posMax),s.ok&&(u=e.md.normalizeLink(s.str),e.md.validateLink(u)?a=s.pos:u=``),l=a;a<f&&(n=e.src.charCodeAt(a),HC(n)||n===10);a++);if(s=e.md.helpers.parseLinkTitle(e.src,a,e.posMax),a<f&&l!==a&&s.ok)for(c=s.str,a=s.pos;a<f&&(n=e.src.charCodeAt(a),HC(n)||n===10);a++);else c=``;if(a>=f||e.src.charCodeAt(a)!==41)return e.pos=d,!1;a++}else{if(e.env.references===void 0)return!1;if(a<f&&e.src.charCodeAt(a)===91?(l=a+1,a=e.md.helpers.parseLinkLabel(e,a),a>=0?i=e.src.slice(l,a++):a=m+1):a=m+1,i||=e.src.slice(p,m),o=e.env.references[KC(i)],!o)return e.pos=d,!1;u=o.href,c=o.title}if(!t){r=e.src.slice(p,m);let t=[];e.md.inline.parse(r,e.md,e.env,t);let n=e.push(`image`,`img`,0),i=[[`src`,u],[`alt`,``]];n.attrs=i,n.children=t,n.content=r,c&&i.push([`title`,c])}return e.pos=a,e.posMax=f,!0}var yT=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,bT=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function xT(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;let r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;let t=e.src.charCodeAt(n);if(t===60)return!1;if(t===62)break}let a=e.src.slice(r+1,n);if(bT.test(a)){let n=e.md.normalizeLink(a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}if(yT.test(a)){let n=e.md.normalizeLink(`mailto:`+a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}return!1}function ST(e){return/^<a[>\s]/i.test(e)}function CT(e){return/^<\/a\s*>/i.test(e)}function wT(e){let t=e|32;return t>=97&&t<=122}function TT(e,t){if(!e.md.options.html)return!1;let n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;let i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!wT(i))return!1;let a=e.src.slice(r).match(Gw);if(!a)return!1;if(!t){let t=e.push(`html_inline`,``,0);t.content=a[0],ST(t.content)&&e.linkLevel++,CT(t.content)&&e.linkLevel--}return e.pos+=a[0].length,!0}var ET=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,DT=/^&([a-z][a-z0-9]{1,31});/i;function OT(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){let r=e.src.slice(n).match(ET);if(r){if(!t){let t=r[1][0].toLowerCase()===`x`?parseInt(r[1].slice(1),16):parseInt(r[1],10),n=e.push(`text_special`,``,0);n.content=DC(t)?OC(t):OC(65533),n.markup=r[0],n.info=`entity`}return e.pos+=r[0].length,!0}}else{let r=e.src.slice(n).match(DT);if(r){let n=yC(r[0]);if(n!==r[0]){if(!t){let t=e.push(`text_special`,``,0);t.content=n,t.markup=r[0],t.info=`entity`}return e.pos+=r[0].length,!0}}}return!1}function kT(e){let t={},n=e.length;if(!n)return;let r=0,i=-2,a=[];for(let o=0;o<n;o++){let n=e[o];if(a.push(0),(e[r].marker!==n.marker||i!==n.token-1)&&(r=o),i=n.token,n.length=n.length||0,!n.close)continue;t.hasOwnProperty(n.marker)||(t[n.marker]=[-1,-1,-1,-1,-1,-1]);let s=t[n.marker][(n.open?3:0)+n.length%3],c=r-a[r]-1,l=c;for(;c>s;c-=a[c]+1){let t=e[c];if(t.marker===n.marker&&t.open&&t.end<0){let r=!1;if((t.close||n.open)&&(t.length+n.length)%3==0&&(t.length%3!=0||n.length%3!=0)&&(r=!0),!r){let r=c>0&&!e[c-1].open?a[c-1]+1:0;a[o]=o-c+r,a[c]=r,n.open=!1,t.end=o,t.close=!1,l=-1,i=-2;break}}}l!==-1&&(t[n.marker][(n.open?3:0)+(n.length||0)%3]=l)}}function AT(e){let t=e.tokens_meta,n=e.tokens_meta.length;kT(e.delimiters);for(let e=0;e<n;e++)t[e]&&t[e].delimiters&&kT(t[e].delimiters)}function jT(e){let t,n,r=0,i=e.tokens,a=e.tokens.length;for(t=n=0;t<a;t++)i[t].nesting<0&&r--,i[t].level=r,i[t].nesting>0&&r++,i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}var MT=[[`text`,nT],[`linkify`,iT],[`newline`,aT],[`escape`,sT],[`backticks`,cT],[`strikethrough`,fT.tokenize],[`emphasis`,gT.tokenize],[`link`,_T],[`image`,vT],[`autolink`,xT],[`html_inline`,TT],[`entity`,OT]],NT=[[`balance_pairs`,AT],[`strikethrough`,fT.postProcess],[`emphasis`,gT.postProcess],[`fragments_join`,jT]];function PT(){this.ruler=new ew;for(let e=0;e<MT.length;e++)this.ruler.push(MT[e][0],MT[e][1]);this.ruler2=new ew;for(let e=0;e<NT.length;e++)this.ruler2.push(NT[e][0],NT[e][1])}PT.prototype.skipToken=function(e){let t=e.pos,n=this.ruler.getRules(``),r=n.length,i=e.md.options.maxNesting,a=e.cache;if(a[t]!==void 0){e.pos=a[t];return}let o=!1;if(e.level<i){for(let i=0;i<r;i++)if(e.level++,o=n[i](e,!0),e.level--,o){if(t>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}else e.pos=e.posMax;o||e.pos++,a[t]=e.pos},PT.prototype.tokenize=function(e){let t=this.ruler.getRules(``),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos<r;){let a=e.pos,o=!1;if(e.level<i){for(let r=0;r<n;r++)if(o=t[r](e,!1),o){if(a>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}if(o){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},PT.prototype.parse=function(e,t,n,r){let i=new this.State(e,t,n,r);this.tokenize(i);let a=this.ruler2.getRules(``),o=a.length;for(let e=0;e<o;e++)a[e](i)},PT.prototype.State=eT;function FT(e){let t={};return e||={},t.src_Any=JS.source,t.src_Cc=YS.source,t.src_Z=$S.source,t.src_P=ZS.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join(`|`),t.src_ZCc=[t.src_Z,t.src_Cc].join(`|`),t.src_pseudo_letter=`(?:(?![><|]|`+t.src_ZPCc+`)`+t.src_Any+`)`,t.src_ip4=`(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)`,t.src_auth=`(?:(?:(?!`+t.src_ZCc+`|[@/\\[\\]()]).)+@)?`,t.src_port=`(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?`,t.src_host_terminator=`(?=$|[><|]|`+t.src_ZPCc+`)(?!`+(e[`---`]?`-(?!--)|`:`-|`)+`_|:\\d|\\.-|\\.(?!$|`+t.src_ZPCc+`))`,t.src_path=`(?:[/?#](?:(?!`+t.src_ZCc+`|[><|]|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+`|\\]).)*\\]|\\((?:(?!`+t.src_ZCc+`|[)]).)*\\)|\\{(?:(?!`+t.src_ZCc+`|[}]).)*\\}|\\"(?:(?!`+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+`|[']).)+\\'|\\'(?=`+t.src_pseudo_letter+`|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!`+t.src_ZCc+`|[.]|$)|`+(e[`---`]?`\\-(?!--(?:[^-]|$))(?:-*)|`:`\\-+|`)+`,(?!`+t.src_ZCc+`|$)|;(?!`+t.src_ZCc+`|$)|\\!+(?!`+t.src_ZCc+`|[!]|$)|\\?(?!`+t.src_ZCc+`|[?]|$))+|\\/)?`,t.src_email_name=`[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*`,t.src_xn=`xn--[a-z0-9\\-]{1,59}`,t.src_domain_root=`(?:`+t.src_xn+`|`+t.src_pseudo_letter+`{1,63})`,t.src_domain=`(?:`+t.src_xn+`|(?:`+t.src_pseudo_letter+`)|(?:`+t.src_pseudo_letter+`(?:-|`+t.src_pseudo_letter+`){0,61}`+t.src_pseudo_letter+`))`,t.src_host=`(?:(?:(?:(?:`+t.src_domain+`)\\.)*`+t.src_domain+`))`,t.tpl_host_fuzzy=`(?:`+t.src_ip4+`|(?:(?:(?:`+t.src_domain+`)\\.)+(?:%TLDS%)))`,t.tpl_host_no_ip_fuzzy=`(?:(?:(?:`+t.src_domain+`)\\.)+(?:%TLDS%))`,t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:`+t.src_ZPCc+`|>|$))`,t.tpl_email_fuzzy=`(^|[><|]|"|\\(|`+t.src_ZCc+`)(`+t.src_email_name+`@`+t.tpl_host_fuzzy_strict+`)`,t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+`)`,t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+`)`,t}function IT(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function LT(e){return Object.prototype.toString.call(e)}function RT(e){return LT(e)===`[object String]`}function zT(e){return LT(e)===`[object Object]`}function BT(e){return LT(e)===`[object RegExp]`}function VT(e){return LT(e)===`[object Function]`}function HT(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,`\\$&`)}var UT={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function WT(e){return Object.keys(e||{}).reduce(function(e,t){return e||UT.hasOwnProperty(t)},!1)}var GT={"http:":{validate:function(e,t,n){let r=e.slice(t);return n.re.http||(n.re.http=RegExp(`^\\/\\/`+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,`i`)),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":`http:`,"ftp:":`http:`,"//":{validate:function(e,t,n){let r=e.slice(t);return n.re.no_http||(n.re.no_http=RegExp(`^`+n.re.src_auth+`(?:localhost|(?:(?:`+n.re.src_domain+`)\\.)+`+n.re.src_domain_root+`)`+n.re.src_port+n.re.src_host_terminator+n.re.src_path,`i`)),n.re.no_http.test(r)?t>=3&&e[t-3]===`:`||t>=3&&e[t-3]===`/`?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){let r=e.slice(t);return n.re.mailto||(n.re.mailto=RegExp(`^`+n.re.src_email_name+`@`+n.re.src_host_strict,`i`)),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},KT=`a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]`,qT=`biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф`.split(`|`);function JT(e){e.__index__=-1,e.__text_cache__=``}function YT(e){return function(t,n){let r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function XT(){return function(e,t){t.normalize(e)}}function ZT(e){let t=e.re=FT(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(KT),n.push(t.src_xn),t.src_tlds=n.join(`|`);function r(e){return e.replace(`%TLDS%`,t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),`i`),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),`i`),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),`i`),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),`i`);let i=[];e.__compiled__={};function a(e,t){throw Error(`(LinkifyIt) Invalid schema "`+e+`": `+t)}Object.keys(e.__schemas__).forEach(function(t){let n=e.__schemas__[t];if(n===null)return;let r={validate:null,link:null};if(e.__compiled__[t]=r,zT(n)){BT(n.validate)?r.validate=YT(n.validate):VT(n.validate)?r.validate=n.validate:a(t,n),VT(n.normalize)?r.normalize=n.normalize:n.normalize?a(t,n):r.normalize=XT();return}if(RT(n)){i.push(t);return}a(t,n)}),i.forEach(function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)}),e.__compiled__[``]={validate:null,normalize:XT()};let o=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map(HT).join(`|`);e.re.schema_test=RegExp(`(^|(?!_)(?:[><|]|`+t.src_ZPCc+`))(`+o+`)`,`i`),e.re.schema_search=RegExp(`(^|(?!_)(?:[><|]|`+t.src_ZPCc+`))(`+o+`)`,`ig`),e.re.schema_at_start=RegExp(`^`+e.re.schema_search.source,`i`),e.re.pretest=RegExp(`(`+e.re.schema_test.source+`)|(`+e.re.host_fuzzy_test.source+`)|@`,`i`),JT(e)}function QT(e,t){let n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function $T(e,t){let n=new QT(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function eE(e,t){if(!(this instanceof eE))return new eE(e,t);t||WT(e)&&(t=e,e={}),this.__opts__=IT({},UT,t),this.__index__=-1,this.__last_index__=-1,this.__schema__=``,this.__text_cache__=``,this.__schemas__=IT({},GT,e),this.__compiled__={},this.__tlds__=qT,this.__tlds_replaced__=!1,this.re={},ZT(this)}eE.prototype.add=function(e,t){return this.__schemas__[e]=t,ZT(this),this},eE.prototype.set=function(e){return this.__opts__=IT(this.__opts__,e),this},eE.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let t,n,r,i,a,o,s,c,l;if(this.re.schema_test.test(e)){for(s=this.re.schema_search,s.lastIndex=0;(t=s.exec(e))!==null;)if(i=this.testSchemaAt(e,t[2],s.lastIndex),i){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__[`http:`]&&(c=e.search(this.re.host_fuzzy_test),c>=0&&(this.__index__<0||c<this.__index__)&&(n=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(a=n.index+n[1].length,(this.__index__<0||a<this.__index__)&&(this.__schema__=``,this.__index__=a,this.__last_index__=n.index+n[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__[`mailto:`]&&(l=e.indexOf(`@`),l>=0&&(r=e.match(this.re.email_fuzzy))!==null&&(a=r.index+r[1].length,o=r.index+r[0].length,(this.__index__<0||a<this.__index__||a===this.__index__&&o>this.__last_index__)&&(this.__schema__=`mailto:`,this.__index__=a,this.__last_index__=o))),this.__index__>=0},eE.prototype.pretest=function(e){return this.re.pretest.test(e)},eE.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},eE.prototype.match=function(e){let t=[],n=0;this.__index__>=0&&this.__text_cache__===e&&(t.push($T(this,n)),n=this.__last_index__);let r=n?e.slice(n):e;for(;this.test(r);)t.push($T(this,n)),r=r.slice(this.__last_index__),n+=this.__last_index__;return t.length?t:null},eE.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;let t=this.re.schema_at_start.exec(e);if(!t)return null;let n=this.testSchemaAt(e,t[2],t[0].length);return n?(this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+n,$T(this,0)):null},eE.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,n){return e!==n[t-1]}).reverse(),ZT(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,ZT(this),this)},eE.prototype.normalize=function(e){e.schema||(e.url=`http://`+e.url),e.schema===`mailto:`&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:`+e.url)},eE.prototype.onCompile=function(){};var tE=2147483647,nE=36,rE=1,iE=26,aE=38,oE=700,sE=72,cE=128,lE=`-`,uE=/^xn--/,dE=/[^\0-\x7F]/,fE=/[\x2E\u3002\uFF0E\uFF61]/g,pE={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},mE=35,hE=Math.floor,gE=String.fromCharCode;function _E(e){throw RangeError(pE[e])}function vE(e,t){let n=[],r=e.length;for(;r--;)n[r]=t(e[r]);return n}function yE(e,t){let n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(fE,`.`);let i=vE(e.split(`.`),t).join(`.`);return r+i}function bE(e){let t=[],n=0,r=e.length;for(;n<r;){let i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){let r=e.charCodeAt(n++);(r&64512)==56320?t.push(((i&1023)<<10)+(r&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}var xE=e=>String.fromCodePoint(...e),SE=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:nE},CE=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},wE=function(e,t,n){let r=0;for(e=n?hE(e/oE):e>>1,e+=hE(e/t);e>455;r+=nE)e=hE(e/mE);return hE(r+36*e/(e+aE))},TE=function(e){let t=[],n=e.length,r=0,i=cE,a=sE,o=e.lastIndexOf(lE);o<0&&(o=0);for(let n=0;n<o;++n)e.charCodeAt(n)>=128&&_E(`not-basic`),t.push(e.charCodeAt(n));for(let s=o>0?o+1:0;s<n;){let o=r;for(let t=1,i=nE;;i+=nE){s>=n&&_E(`invalid-input`);let o=SE(e.charCodeAt(s++));o>=nE&&_E(`invalid-input`),o>hE((tE-r)/t)&&_E(`overflow`),r+=o*t;let c=i<=a?rE:i>=a+iE?iE:i-a;if(o<c)break;let l=nE-c;t>hE(tE/l)&&_E(`overflow`),t*=l}let c=t.length+1;a=wE(r-o,c,o==0),hE(r/c)>tE-i&&_E(`overflow`),i+=hE(r/c),r%=c,t.splice(r++,0,i)}return String.fromCodePoint(...t)},EE=function(e){let t=[];e=bE(e);let n=e.length,r=cE,i=0,a=sE;for(let n of e)n<128&&t.push(gE(n));let o=t.length,s=o;for(o&&t.push(lE);s<n;){let n=tE;for(let t of e)t>=r&&t<n&&(n=t);let c=s+1;n-r>hE((tE-i)/c)&&_E(`overflow`),i+=(n-r)*c,r=n;for(let n of e)if(n<r&&++i>tE&&_E(`overflow`),n===r){let e=i;for(let n=nE;;n+=nE){let r=n<=a?rE:n>=a+iE?iE:n-a;if(e<r)break;let i=e-r,o=nE-r;t.push(gE(CE(r+i%o,0))),e=hE(i/o)}t.push(gE(CE(e,0))),a=wE(i,c,s===o),i=0,++s}++i,++r}return t.join(``)},DE={version:`2.3.1`,ucs2:{decode:bE,encode:xE},decode:TE,encode:EE,toASCII:function(e){return yE(e,function(e){return dE.test(e)?`xn--`+EE(e):e})},toUnicode:function(e){return yE(e,function(e){return uE.test(e)?TE(e.slice(4).toLowerCase()):e})}},OE={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`paragraph`]},inline:{rules:[`text`],rules2:[`balance_pairs`,`fragments_join`]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`blockquote`,`code`,`fence`,`heading`,`hr`,`html_block`,`lheading`,`list`,`reference`,`paragraph`]},inline:{rules:[`autolink`,`backticks`,`emphasis`,`entity`,`escape`,`html_inline`,`image`,`link`,`newline`,`text`],rules2:[`balance_pairs`,`emphasis`,`fragments_join`]}}}},kE=/^(vbscript|javascript|file|data):/,AE=/^data:image\/(gif|png|jpeg|webp);/;function jE(e){let t=e.trim().toLowerCase();return!kE.test(t)||AE.test(t)}var ME=[`http:`,`https:`,`mailto:`];function NE(e){let t=KS(e,!0);if(t.hostname&&(!t.protocol||ME.indexOf(t.protocol)>=0))try{t.hostname=DE.toASCII(t.hostname)}catch{}return NS(PS(t))}function PE(e){let t=KS(e,!0);if(t.hostname&&(!t.protocol||ME.indexOf(t.protocol)>=0))try{t.hostname=DE.toUnicode(t.hostname)}catch{}return AS(PS(t),AS.defaultChars+`%`)}function FE(e,t){if(!(this instanceof FE))return new FE(e,t);t||SC(e)||(t=e||{},e=`default`),this.inline=new PT,this.block=new $w,this.core=new Dw,this.renderer=new $C,this.linkify=new eE,this.validateLink=jE,this.normalizeLink=NE,this.normalizeLinkText=PE,this.utils=bC,this.helpers=TC({},ZC),this.options={},this.configure(e),t&&this.set(t)}FE.prototype.set=function(e){return TC(this.options,e),this},FE.prototype.configure=function(e){let t=this;if(SC(e)){let t=e;if(e=OE[t],!e)throw Error('Wrong `markdown-it` preset "'+t+`", check name`)}if(!e)throw Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this},FE.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),[`core`,`block`,`inline`].forEach(function(t){n=n.concat(this[t].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));let r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw Error(`MarkdownIt. Failed to enable unknown rule(s): `+r);return this},FE.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),[`core`,`block`,`inline`].forEach(function(t){n=n.concat(this[t].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));let r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw Error(`MarkdownIt. Failed to disable unknown rule(s): `+r);return this},FE.prototype.use=function(e){let t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},FE.prototype.parse=function(e,t){if(typeof e!=`string`)throw Error(`Input data should be a String`);let n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},FE.prototype.render=function(e,t){return t||={},this.renderer.render(this.parse(e,t),this.options,t)},FE.prototype.parseInline=function(e,t){let n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},FE.prototype.renderInline=function(e,t){return t||={},this.renderer.render(this.parseInline(e,t),this.options,t)};var IE=new ni({nodes:{doc:{content:`block+`},paragraph:{content:`inline*`,group:`block`,parseDOM:[{tag:`p`}],toDOM(){return[`p`,0]}},blockquote:{content:`block+`,group:`block`,parseDOM:[{tag:`blockquote`}],toDOM(){return[`blockquote`,0]}},horizontal_rule:{group:`block`,parseDOM:[{tag:`hr`}],toDOM(){return[`div`,[`hr`]]}},heading:{attrs:{level:{default:1}},content:`(text | image)*`,group:`block`,defining:!0,parseDOM:[{tag:`h1`,attrs:{level:1}},{tag:`h2`,attrs:{level:2}},{tag:`h3`,attrs:{level:3}},{tag:`h4`,attrs:{level:4}},{tag:`h5`,attrs:{level:5}},{tag:`h6`,attrs:{level:6}}],toDOM(e){return[`h`+e.attrs.level,0]}},code_block:{content:`text*`,group:`block`,code:!0,defining:!0,marks:``,attrs:{params:{default:``}},parseDOM:[{tag:`pre`,preserveWhitespace:`full`,getAttrs:e=>({params:e.getAttribute(`data-params`)||``})}],toDOM(e){return[`pre`,e.attrs.params?{"data-params":e.attrs.params}:{},[`code`,0]]}},ordered_list:{content:`list_item+`,group:`block`,attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:`ol`,getAttrs(e){return{order:e.hasAttribute(`start`)?+e.getAttribute(`start`):1,tight:e.hasAttribute(`data-tight`)}}}],toDOM(e){return[`ol`,{start:e.attrs.order==1?null:e.attrs.order,"data-tight":e.attrs.tight?`true`:null},0]}},bullet_list:{content:`list_item+`,group:`block`,attrs:{tight:{default:!1}},parseDOM:[{tag:`ul`,getAttrs:e=>({tight:e.hasAttribute(`data-tight`)})}],toDOM(e){return[`ul`,{"data-tight":e.attrs.tight?`true`:null},0]}},list_item:{content:`block+`,defining:!0,parseDOM:[{tag:`li`}],toDOM(){return[`li`,0]}},text:{group:`inline`},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:`inline`,draggable:!0,parseDOM:[{tag:`img[src]`,getAttrs(e){return{src:e.getAttribute(`src`),title:e.getAttribute(`title`),alt:e.getAttribute(`alt`)}}}],toDOM(e){return[`img`,e.attrs]}},hard_break:{inline:!0,group:`inline`,selectable:!1,parseDOM:[{tag:`br`}],toDOM(){return[`br`]}}},marks:{em:{parseDOM:[{tag:`i`},{tag:`em`},{style:`font-style=italic`},{style:`font-style=normal`,clearMark:e=>e.type.name==`em`}],toDOM(){return[`em`]}},strong:{parseDOM:[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!=`normal`&&null},{style:`font-weight=400`,clearMark:e=>e.type.name==`strong`},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM(){return[`strong`]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:`a[href]`,getAttrs(e){return{href:e.getAttribute(`href`),title:e.getAttribute(`title`)}}}],toDOM(e){return[`a`,e.attrs]}},code:{code:!0,parseDOM:[{tag:`code`}],toDOM(){return[`code`]}}}});function LE(e,t){if(e.isText&&t.isText&&ur.sameSet(e.marks,t.marks))return e.withText(e.text+t.text)}var RE=class{constructor(e,t){this.schema=e,this.tokenHandlers=t,this.stack=[{type:e.topNodeType,attrs:null,content:[],marks:ur.none}]}top(){return this.stack[this.stack.length-1]}push(e){this.stack.length&&this.top().content.push(e)}addText(e){if(!e)return;let t=this.top(),n=t.content,r=n[n.length-1],i=this.schema.text(e,t.marks),a;r&&(a=LE(r,i))?n[n.length-1]=a:n.push(i)}openMark(e){let t=this.top();t.marks=e.addToSet(t.marks)}closeMark(e){let t=this.top();t.marks=e.removeFromSet(t.marks)}parseTokens(e){for(let t=0;t<e.length;t++){let n=e[t],r=this.tokenHandlers[n.type];if(!r)throw Error("Token type `"+n.type+"` not supported by Markdown parser");r(this,n,e,t)}}addNode(e,t,n){let r=this.top(),i=e.createAndFill(t,n,r?r.marks:[]);return i?(this.push(i),i):null}openNode(e,t){this.stack.push({type:e,attrs:t,content:[],marks:ur.none})}closeNode(){let e=this.stack.pop();return this.addNode(e.type,e.attrs,e.content)}};function zE(e,t,n,r){return e.getAttrs?e.getAttrs(t,n,r):e.attrs instanceof Function?e.attrs(t):e.attrs}function BE(e,t){return e.noCloseToken||t==`code_inline`||t==`code_block`||t==`fence`}function VE(e){return e[e.length-1]==`
|
|
168
|
+
`?e.slice(0,e.length-1):e}function HE(){}function UE(e,t){let n=Object.create(null);for(let r in t){let i=t[r];if(i.block){let t=e.nodeType(i.block);BE(i,r)?n[r]=(e,n,r,a)=>{e.openNode(t,zE(i,n,r,a)),e.addText(VE(n.content)),e.closeNode()}:(n[r+`_open`]=(e,n,r,a)=>e.openNode(t,zE(i,n,r,a)),n[r+`_close`]=e=>e.closeNode())}else if(i.node){let t=e.nodeType(i.node);n[r]=(e,n,r,a)=>e.addNode(t,zE(i,n,r,a))}else if(i.mark){let t=e.marks[i.mark];BE(i,r)?n[r]=(e,n,r,a)=>{e.openMark(t.create(zE(i,n,r,a))),e.addText(VE(n.content)),e.closeMark(t)}:(n[r+`_open`]=(e,n,r,a)=>e.openMark(t.create(zE(i,n,r,a))),n[r+`_close`]=e=>e.closeMark(t))}else if(i.ignore)BE(i,r)?n[r]=HE:(n[r+`_open`]=HE,n[r+`_close`]=HE);else throw RangeError(`Unrecognized parsing spec `+JSON.stringify(i))}return n.text=(e,t)=>e.addText(t.content),n.inline=(e,t)=>e.parseTokens(t.children),n.softbreak=n.softbreak||(e=>e.addText(` `)),n}var WE=class{constructor(e,t,n){this.schema=e,this.tokenizer=t,this.tokens=n,this.tokenHandlers=UE(e,n)}parse(e,t={}){let n=new RE(this.schema,this.tokenHandlers),r;n.parseTokens(this.tokenizer.parse(e,t));do r=n.closeNode();while(n.stack.length);return r||this.schema.topNodeType.createAndFill()}};function GE(e,t){for(;++t<e.length;)if(e[t].type!=`list_item_open`)return e[t].hidden;return!1}new WE(IE,FE(`commonmark`,{html:!1}),{blockquote:{block:`blockquote`},paragraph:{block:`paragraph`},list_item:{block:`list_item`},bullet_list:{block:`bullet_list`,getAttrs:(e,t,n)=>({tight:GE(t,n)})},ordered_list:{block:`ordered_list`,getAttrs:(e,t,n)=>({order:+e.attrGet(`start`)||1,tight:GE(t,n)})},heading:{block:`heading`,getAttrs:e=>({level:+e.tag.slice(1)})},code_block:{block:`code_block`,noCloseToken:!0},fence:{block:`code_block`,getAttrs:e=>({params:e.info||``}),noCloseToken:!0},hr:{node:`horizontal_rule`},image:{node:`image`,getAttrs:e=>({src:e.attrGet(`src`),title:e.attrGet(`title`)||null,alt:e.children[0]&&e.children[0].content||null})},hardbreak:{node:`hard_break`},em:{mark:`em`},strong:{mark:`strong`},link:{mark:`link`,getAttrs:e=>({href:e.attrGet(`href`),title:e.attrGet(`title`)||null})},code_inline:{mark:`code`,noCloseToken:!0}});var KE={open:``,close:``,mixable:!0},qE=new class{constructor(e,t,n={}){this.nodes=e,this.marks=t,this.options=n}serialize(e,t={}){t=Object.assign({},this.options,t);let n=new XE(this.nodes,this.marks,t);return n.renderContent(e),n.out}}({blockquote(e,t){e.wrapBlock(`> `,null,t,()=>e.renderContent(t))},code_block(e,t){let n=t.textContent.match(/`{3,}/gm),r=n?n.sort().slice(-1)[0]+"`":"```";e.write(r+(t.attrs.params||``)+`
|
|
169
|
+
`),e.text(t.textContent,!1),e.write(`
|
|
170
|
+
`),e.write(r),e.closeBlock(t)},heading(e,t){e.write(e.repeat(`#`,t.attrs.level)+` `),e.renderInline(t,!1),e.closeBlock(t)},horizontal_rule(e,t){e.write(t.attrs.markup||`---`),e.closeBlock(t)},bullet_list(e,t){e.renderList(t,` `,()=>(t.attrs.bullet||`*`)+` `)},ordered_list(e,t){let n=t.attrs.order||1,r=String(n+t.childCount-1).length,i=e.repeat(` `,r+2);e.renderList(t,i,t=>{let i=String(n+t);return e.repeat(` `,r-i.length)+i+`. `})},list_item(e,t){e.renderContent(t)},paragraph(e,t){e.renderInline(t),e.closeBlock(t)},image(e,t){e.write(`]/g,`\\$&`)+(t.attrs.title?` "`+t.attrs.title.replace(/"/g,`\\"`)+`"`:``)+`)`)},hard_break(e,t,n,r){for(let i=r+1;i<n.childCount;i++)if(n.child(i).type!=t.type){e.write(`\\
|
|
171
|
+
`);return}},text(e,t){e.text(t.text,!e.inAutolink)}},{em:{open:`*`,close:`*`,mixable:!0,expelEnclosingWhitespace:!0},strong:{open:`**`,close:`**`,mixable:!0,expelEnclosingWhitespace:!0},link:{open(e,t,n,r){return e.inAutolink=YE(t,n,r),e.inAutolink?`<`:`[`},close(e,t,n,r){let{inAutolink:i}=e;return e.inAutolink=void 0,i?`>`:`](`+t.attrs.href.replace(/[\(\)"]/g,`\\$&`)+(t.attrs.title?` "${t.attrs.title.replace(/"/g,`\\"`)}"`:``)+`)`},mixable:!0},code:{open(e,t,n,r){return JE(n.child(r),-1)},close(e,t,n,r){return JE(n.child(r-1),1)},escape:!1}});function JE(e,t){let n=/`+/g,r,i=0;if(e.isText)for(;r=n.exec(e.text);)i=Math.max(i,r[0].length);let a=i>0&&t>0?" `":"`";for(let e=0;e<i;e++)a+="`";return i>0&&t<0&&(a+=` `),a}function YE(e,t,n){if(e.attrs.title||!/^\w+:/.test(e.attrs.href))return!1;let r=t.child(n);return!r.isText||r.text!=e.attrs.href||r.marks[r.marks.length-1]!=e?!1:n==t.childCount-1||!e.isInSet(t.child(n+1).marks)}var XE=class{constructor(e,t,n){this.nodes=e,this.marks=t,this.options=n,this.delim=``,this.out=``,this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,this.options.tightLists===void 0&&(this.options.tightLists=!1),this.options.hardBreakNodeName===void 0&&(this.options.hardBreakNodeName=`hard_break`)}flushClose(e=2){if(this.closed){if(this.atBlank()||(this.out+=`
|
|
172
|
+
`),e>1){let t=this.delim,n=/\s+$/.exec(t);n&&(t=t.slice(0,t.length-n[0].length));for(let n=1;n<e;n++)this.out+=t+`
|
|
173
|
+
`}this.closed=null}}getMark(e){let t=this.marks[e];if(!t){if(this.options.strict!==!1)throw Error(`Mark type \`${e}\` not supported by Markdown renderer`);t=KE}return t}wrapBlock(e,t,n,r){let i=this.delim;this.write(t??e),this.delim+=e,r(),this.delim=i,this.closeBlock(n)}atBlank(){return/(^|\n)$/.test(this.out)}ensureNewLine(){this.atBlank()||(this.out+=`
|
|
174
|
+
`)}write(e){this.flushClose(),this.delim&&this.atBlank()&&(this.out+=this.delim),e&&(this.out+=e)}closeBlock(e){this.closed=e}text(e,t=!0){let n=e.split(`
|
|
175
|
+
`);for(let e=0;e<n.length;e++)this.write(),!t&&n[e][0]==`[`&&/(^|[^\\])\!$/.test(this.out)&&(this.out=this.out.slice(0,this.out.length-1)+`\\!`),this.out+=t?this.esc(n[e],this.atBlockStart):n[e],e!=n.length-1&&(this.out+=`
|
|
176
|
+
`)}render(e,t,n){if(this.nodes[e.type.name])this.nodes[e.type.name](this,e,t,n);else if(this.options.strict!==!1)throw Error("Token type `"+e.type.name+"` not supported by Markdown renderer");else e.type.isLeaf||(e.type.inlineContent?this.renderInline(e):this.renderContent(e),e.isBlock&&this.closeBlock(e))}renderContent(e){e.forEach((t,n,r)=>this.render(t,e,r))}renderInline(e,t=!0){this.atBlockStart=t;let n=[],r=``,i=(t,i,a)=>{let o=t?t.marks:[];t&&t.type.name===this.options.hardBreakNodeName&&(o=o.filter(t=>{if(a+1==e.childCount)return!1;let n=e.child(a+1);return t.isInSet(n.marks)&&(!n.isText||/\S/.test(n.text))}));let s=r;if(r=``,t&&t.isText&&o.some(e=>{let t=this.getMark(e.type.name);return t&&t.expelEnclosingWhitespace&&!e.isInSet(n)})){let[e,r,i]=/^(\s*)(.*)$/m.exec(t.text);r&&(s+=r,t=i?t.withText(i):null,t||(o=n))}if(t&&t.isText&&o.some(t=>{let n=this.getMark(t.type.name);return n&&n.expelEnclosingWhitespace&&!this.isMarkAhead(e,a+1,t)})){let[e,i,a]=/^(.*?)(\s*)$/m.exec(t.text);a&&(r=a,t=i?t.withText(i):null,t||(o=n))}let c=o.length?o[o.length-1]:null,l=c&&this.getMark(c.type.name).escape===!1,u=o.length-+!!l;outer:for(let e=0;e<u;e++){let t=o[e];if(!this.getMark(t.type.name).mixable)break;for(let r=0;r<n.length;r++){let i=n[r];if(!this.getMark(i.type.name).mixable)break;if(t.eq(i)){e>r?o=o.slice(0,r).concat(t).concat(o.slice(r,e)).concat(o.slice(e+1,u)):r>e&&(o=o.slice(0,e).concat(o.slice(e+1,r)).concat(t).concat(o.slice(r,u)));continue outer}}}let d=0;for(;d<Math.min(n.length,u)&&o[d].eq(n[d]);)++d;for(;d<n.length;)this.text(this.markString(n.pop(),!1,e,a),!1);if(s&&this.text(s),t){for(;n.length<u;){let t=o[n.length];n.push(t),this.text(this.markString(t,!0,e,a),!1),this.atBlockStart=!1}l&&t.isText?this.text(this.markString(c,!0,e,a)+t.text+this.markString(c,!1,e,a+1),!1):this.render(t,e,a),this.atBlockStart=!1}t?.isText&&t.nodeSize>0&&(this.atBlockStart=!1)};e.forEach(i),i(null,0,e.childCount),this.atBlockStart=!1}renderList(e,t,n){this.closed&&this.closed.type==e.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let r=e.attrs.tight===void 0?this.options.tightLists:e.attrs.tight,i=this.inTightList;this.inTightList=r,e.forEach((i,a,o)=>{o&&r&&this.flushClose(1),this.wrapBlock(t,n(o),e,()=>this.render(i,e,o))}),this.inTightList=i}esc(e,t=!1){return e=e.replace(/[`*\\~\[\]_]/g,(t,n)=>t==`_`&&n>0&&n+1<e.length&&e[n-1].match(/\w/)&&e[n+1].match(/\w/)?t:`\\`+t),t&&(e=e.replace(/^(\+[ ]|[\-*>])/,`\\$&`).replace(/^(\s*)(#{1,6})(\s|$)/,`$1\\$2$3`).replace(/^(\s*\d+)\.\s/,`$1\\. `)),this.options.escapeExtraCharacters&&(e=e.replace(this.options.escapeExtraCharacters,`\\$&`)),e}quote(e){let t=e.indexOf(`"`)==-1?`""`:e.indexOf(`'`)==-1?`''`:`()`;return t[0]+e+t[1]}repeat(e,t){let n=``;for(let r=0;r<t;r++)n+=e;return n}markString(e,t,n,r){let i=this.getMark(e.type.name),a=t?i.open:i.close;return typeof a==`string`?a:a(this,e,n,r)}getEnclosingWhitespace(e){return{leading:(e.match(/^(\s+)/)||[void 0])[0],trailing:(e.match(/(\s+)$/)||[void 0])[0]}}isMarkAhead(e,t,n){for(;;t++){if(t>=e.childCount)return!1;let r=e.child(t);if(r.type.name!=this.options.hardBreakNodeName)return n.isInSet(r.marks);t++}}},ZE=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0))),QE=new Uint16Array(`Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢`.split(``).map(e=>e.charCodeAt(0))),$E=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),eD=String.fromCodePoint??function(e){let t=``;return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function tD(e){return e>=55296&&e<=57343||e>1114111?65533:$E.get(e)??e}var nD;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(nD||={});var rD=32,iD;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(iD||={});function aD(e){return e>=nD.ZERO&&e<=nD.NINE}function oD(e){return e>=nD.UPPER_A&&e<=nD.UPPER_F||e>=nD.LOWER_A&&e<=nD.LOWER_F}function sD(e){return e>=nD.UPPER_A&&e<=nD.UPPER_Z||e>=nD.LOWER_A&&e<=nD.LOWER_Z||aD(e)}function cD(e){return e===nD.EQUALS||sD(e)}var lD;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(lD||={});var uD;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(uD||={});var dD=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=lD.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=uD.Strict}startEntity(e){this.decodeMode=e,this.state=lD.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case lD.EntityStart:return e.charCodeAt(t)===nD.NUM?(this.state=lD.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=lD.NamedEntity,this.stateNamedEntity(e,t));case lD.NumericStart:return this.stateNumericStart(e,t);case lD.NumericDecimal:return this.stateNumericDecimal(e,t);case lD.NumericHex:return this.stateNumericHex(e,t);case lD.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|rD)===nD.LOWER_X?(this.state=lD.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=lD.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(aD(r)||oD(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(aD(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===nD.SEMI)this.consumed+=1;else if(this.decodeMode===uD.Strict)return 0;return this.emitCodePoint(tD(this.result),this.consumed),this.errors&&(e!==nD.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&iD.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=pD(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===uD.Attribute&&(i===0||cD(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&iD.VALUE_LENGTH)>>14,i!==0){if(a===nD.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==uD.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&iD.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~iD.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case lD.NamedEntity:return this.result!==0&&(this.decodeMode!==uD.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case lD.NumericDecimal:return this.emitNumericEntity(0,2);case lD.NumericHex:return this.emitNumericEntity(0,3);case lD.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case lD.EntityStart:return 0}}};function fD(e){let t=``,n=new dD(e,e=>t+=eD(e));return function(e,r){let i=0,a=0;for(;(a=e.indexOf(`&`,a))>=0;){t+=e.slice(i,a),n.startEntity(r);let o=n.write(e,a+1);if(o<0){i=a+n.end();break}i=a+o,a=o===0?i+1:i}let o=t+e.slice(i);return t=``,o}}function pD(e,t,n,r){let i=(t&iD.BRANCH_LENGTH)>>7,a=t&iD.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var mD=fD(ZE);fD(QE);function hD(e,t=uD.Legacy){return mD(e,t)}function gD(e){return mD(e,uD.Strict)}var _D=t({arrayReplaceAt:()=>CD,asciiTrim:()=>KD,assign:()=>SD,escapeHtml:()=>ID,escapeRE:()=>RD,fromCodePoint:()=>TD,has:()=>xD,isMdAsciiPunct:()=>UD,isPunctChar:()=>VD,isPunctCharCode:()=>HD,isSpace:()=>zD,isString:()=>yD,isValidEntityCode:()=>wD,isWhiteSpace:()=>BD,lib:()=>qD,normalizeReference:()=>WD,unescapeAll:()=>jD,unescapeMd:()=>AD});function vD(e){return Object.prototype.toString.call(e)}function yD(e){return vD(e)===`[object String]`}var bD=Object.prototype.hasOwnProperty;function xD(e,t){return bD.call(e,t)}function SD(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){if(t){if(typeof t!=`object`)throw TypeError(t+`must be object`);Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e}function CD(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function wD(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function TD(e){if(e>65535){e-=65536;let t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var ED=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,DD=RegExp(ED.source+`|&([a-z#][a-z0-9]{1,31});`,`gi`),OD=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function kD(e,t){if(t.charCodeAt(0)===35&&OD.test(t)){let n=t[1].toLowerCase()===`x`?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return wD(n)?TD(n):e}let n=hD(e);return n===e?e:n}function AD(e){return e.indexOf(`\\`)<0?e:e.replace(ED,`$1`)}function jD(e){return e.indexOf(`\\`)<0&&e.indexOf(`&`)<0?e:e.replace(DD,function(e,t,n){return t||kD(e,n)})}var MD=/[&<>"]/,ND=/[&<>"]/g,PD={"&":`&`,"<":`<`,">":`>`,'"':`"`};function FD(e){return PD[e]}function ID(e){return MD.test(e)?e.replace(ND,FD):e}var LD=/[.?*+^$[\]\\(){}|-]/g;function RD(e){return e.replace(LD,`\\$&`)}function zD(e){switch(e){case 9:case 32:return!0}return!1}function BD(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function VD(e){return ZS.test(e)||QS.test(e)}function HD(e){return VD(TD(e))}function UD(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function WD(e){return e=e.trim().replace(/\s+/g,` `),e.toLowerCase().toUpperCase()}function GD(e){return e===32||e===9||e===10||e===13}function KD(e){let t=0;for(;t<e.length&&GD(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&GD(e.charCodeAt(n));n--);return e.slice(t,n+1)}var qD={mdurl:qS,ucmicro:eC};function JD(e,t,n){let r,i,a,o,s=e.posMax,c=e.pos;for(e.pos=t+1,r=1;e.pos<s;){if(a=e.src.charCodeAt(e.pos),a===93&&(r--,r===0)){i=!0;break}if(o=e.pos,e.md.inline.skipToken(e),a===91){if(o===e.pos-1)r++;else if(n)return e.pos=c,-1}}let l=-1;return i&&(l=e.pos),e.pos=c,l}function YD(e,t,n){let r,i=t,a={ok:!1,pos:0,str:``};if(e.charCodeAt(i)===60){for(i++;i<n;){if(r=e.charCodeAt(i),r===10||r===60)return a;if(r===62)return a.pos=i+1,a.str=jD(e.slice(t+1,i)),a.ok=!0,a;if(r===92&&i+1<n){i+=2;continue}i++}return a}let o=0;for(;i<n&&(r=e.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(e.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(o++,o>32))return a;if(r===41){if(o===0)break;o--}i++}return t===i||o!==0?a:(a.str=jD(e.slice(t,i)),a.pos=i,a.ok=!0,a)}function XD(e,t,n,r){let i,a=t,o={ok:!1,can_continue:!1,pos:0,str:``,marker:0};if(r)o.str=r.str,o.marker=r.marker;else{if(a>=n)return o;let r=e.charCodeAt(a);if(r!==34&&r!==39&&r!==40)return o;t++,a++,r===40&&(r=41),o.marker=r}for(;a<n;){if(i=e.charCodeAt(a),i===o.marker)return o.pos=a+1,o.str+=jD(e.slice(t,a)),o.ok=!0,o;if(i===40&&o.marker===41)return o;i===92&&a+1<n&&a++,a++}return o.can_continue=!0,o.str+=jD(e.slice(t,a)),o}var ZD=t({parseLinkDestination:()=>YD,parseLinkLabel:()=>JD,parseLinkTitle:()=>XD}),QD={};QD.code_inline=function(e,t,n,r,i){let a=e[t];return`<code`+i.renderAttrs(a)+`>`+ID(a.content)+`</code>`},QD.code_block=function(e,t,n,r,i){let a=e[t];return`<pre`+i.renderAttrs(a)+`><code>`+ID(e[t].content)+`</code></pre>
|
|
177
|
+
`},QD.fence=function(e,t,n,r,i){let a=e[t],o=a.info?jD(a.info).trim():``,s=``,c=``;if(o){let e=o.split(/(\s+)/g);s=e[0],c=e.slice(2).join(``)}let l;if(l=n.highlight&&n.highlight(a.content,s,c)||ID(a.content),l.indexOf(`<pre`)===0)return l+`
|
|
178
|
+
`;if(o){let e=a.attrIndex(`class`),t=a.attrs?a.attrs.slice():[];e<0?t.push([`class`,n.langPrefix+s]):(t[e]=t[e].slice(),t[e][1]+=` `+n.langPrefix+s);let r={attrs:t};return`<pre><code${i.renderAttrs(r)}>${l}</code></pre>\n`}return`<pre><code${i.renderAttrs(a)}>${l}</code></pre>\n`},QD.image=function(e,t,n,r,i){let a=e[t];return a.attrs[a.attrIndex(`alt`)][1]=i.renderInlineAsText(a.children,n,r),i.renderToken(e,t,n)},QD.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
|
|
179
|
+
`:`<br>
|
|
180
|
+
`},QD.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
181
|
+
`:`<br>
|
|
182
|
+
`:`
|
|
183
|
+
`},QD.text=function(e,t){return ID(e[t].content)},QD.html_block=function(e,t){return e[t].content},QD.html_inline=function(e,t){return e[t].content};function $D(){this.rules=SD({},QD)}$D.prototype.renderAttrs=function(e){let t,n,r;if(!e.attrs)return``;for(r=``,t=0,n=e.attrs.length;t<n;t++)r+=` `+ID(e.attrs[t][0])+`="`+ID(e.attrs[t][1])+`"`;return r},$D.prototype.renderToken=function(e,t,n){let r=e[t],i=``;if(r.hidden)return``;r.block&&r.nesting!==-1&&t&&e[t-1].hidden&&(i+=`
|
|
184
|
+
`),i+=(r.nesting===-1?`</`:`<`)+r.tag,i+=this.renderAttrs(r),r.nesting===0&&n.xhtmlOut&&(i+=` /`);let a=!1;if(r.block&&(a=!0,r.nesting===1&&t+1<e.length)){let n=e[t+1];(n.type===`inline`||n.hidden||n.nesting===-1&&n.tag===r.tag)&&(a=!1)}return i+=a?`>
|
|
185
|
+
`:`>`,i},$D.prototype.renderInline=function(e,t,n){let r=``,i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=e[a].type;i[o]===void 0?r+=this.renderToken(e,a,t):r+=i[o](e,a,t,n,this)}return r},$D.prototype.renderInlineAsText=function(e,t,n){let r=``;for(let i=0,a=e.length;i<a;i++)switch(e[i].type){case`text`:r+=e[i].content;break;case`image`:r+=this.renderInlineAsText(e[i].children,t,n);break;case`html_inline`:case`html_block`:r+=e[i].content;break;case`softbreak`:case`hardbreak`:r+=`
|
|
186
|
+
`}return r},$D.prototype.render=function(e,t,n){let r=``,i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=e[a].type;o===`inline`?r+=this.renderInline(e[a].children,t,n):i[o]===void 0?r+=this.renderToken(e,a,t,n):r+=i[o](e,a,t,n,this)}return r};function eO(){this.__rules__=[],this.__cache__=null}eO.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},eO.prototype.__compile__=function(){let e=this,t=[``];e.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(e){t.indexOf(e)<0&&t.push(e)})}),e.__cache__={},t.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||e.__cache__[t].push(n.fn))})})},eO.prototype.at=function(e,t,n){let r=this.__find__(e),i=n||{};if(r===-1)throw Error(`Parser rule not found: `+e);this.__rules__[r].fn=t,this.__rules__[r].alt=i.alt||[],this.__cache__=null},eO.prototype.before=function(e,t,n,r){let i=this.__find__(e),a=r||{};if(i===-1)throw Error(`Parser rule not found: `+e);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null},eO.prototype.after=function(e,t,n,r){let i=this.__find__(e),a=r||{};if(i===-1)throw Error(`Parser rule not found: `+e);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null},eO.prototype.push=function(e,t,n){let r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},eO.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(function(e){let r=this.__find__(e);if(r<0){if(t)return;throw Error(`Rules manager: invalid rule name `+e)}this.__rules__[r].enabled=!0,n.push(e)},this),this.__cache__=null,n},eO.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(e,t)},eO.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(function(e){let r=this.__find__(e);if(r<0){if(t)return;throw Error(`Rules manager: invalid rule name `+e)}this.__rules__[r].enabled=!1,n.push(e)},this),this.__cache__=null,n},eO.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function tO(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content=``,this.markup=``,this.info=``,this.meta=null,this.block=!1,this.hidden=!1}tO.prototype.attrIndex=function(e){if(!this.attrs)return-1;let t=this.attrs;for(let n=0,r=t.length;n<r;n++)if(t[n][0]===e)return n;return-1},tO.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},tO.prototype.attrSet=function(e,t){let n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r},tO.prototype.attrGet=function(e){let t=this.attrIndex(e),n=null;return t>=0&&(n=this.attrs[t][1]),n},tO.prototype.attrJoin=function(e,t){let n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+` `+t};function nO(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}nO.prototype.Token=tO;var rO=/\r\n?|\n/g,iO=/\0/g;function aO(e){let t;t=e.src.replace(rO,`
|
|
187
|
+
`),t=t.replace(iO,`�`),e.src=t}function oO(e){let t;e.inlineMode?(t=new e.Token(`inline`,``,0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function sO(e){let t=e.tokens;for(let n=0,r=t.length;n<r;n++){let r=t[n];r.type===`inline`&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}function cO(e){return/^<a[>\s]/i.test(e)}function lO(e){return/^<\/a\s*>/i.test(e)}function uO(e){let t=e.tokens;if(e.md.options.linkify)for(let n=0,r=t.length;n<r;n++){if(t[n].type!==`inline`||!e.md.linkify.pretest(t[n].content))continue;let r=t[n].children,i=0;for(let a=r.length-1;a>=0;a--){let o=r[a];if(o.type===`link_close`){for(a--;r[a].level!==o.level&&r[a].type!==`link_open`;)a--;continue}if(o.type===`html_inline`&&(cO(o.content)&&i>0&&i--,lO(o.content)&&i++),!(i>0)&&o.type===`text`&&e.md.linkify.test(o.content)){let i=o.content,s=e.md.linkify.match(i),c=[],l=o.level,u=0;s.length>0&&s[0].index===0&&a>0&&r[a-1].type===`text_special`&&(s=s.slice(1));for(let t=0;t<s.length;t++){let n=s[t].url,r=e.md.normalizeLink(n);if(!e.md.validateLink(r))continue;let a=s[t].text;a=s[t].schema?s[t].schema===`mailto:`&&!/^mailto:/i.test(a)?e.md.normalizeLinkText(`mailto:`+a).replace(/^mailto:/,``):e.md.normalizeLinkText(a):e.md.normalizeLinkText(`http://`+a).replace(/^http:\/\//,``);let o=s[t].index;if(o>u){let t=new e.Token(`text`,``,0);t.content=i.slice(u,o),t.level=l,c.push(t)}let d=new e.Token(`link_open`,`a`,1);d.attrs=[[`href`,r]],d.level=l++,d.markup=`linkify`,d.info=`auto`,c.push(d);let f=new e.Token(`text`,``,0);f.content=a,f.level=l,c.push(f);let p=new e.Token(`link_close`,`a`,-1);p.level=--l,p.markup=`linkify`,p.info=`auto`,c.push(p),u=s[t].lastIndex}if(u<i.length){let t=new e.Token(`text`,``,0);t.content=i.slice(u),t.level=l,c.push(t)}t[n].children=r=CD(r,a,c)}}}}var dO=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,fO=/\((c|tm|r)\)/i,pO=/\((c|tm|r)\)/gi,mO={c:`©`,r:`®`,tm:`™`};function hO(e,t){return mO[t.toLowerCase()]}function gO(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&(r.content=r.content.replace(pO,hO)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function _O(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&dO.test(r.content)&&(r.content=r.content.replace(/\+-/g,`±`).replace(/\.{2,}/g,`…`).replace(/([?!])…/g,`$1..`).replace(/([?!]){4,}/g,`$1$1$1`).replace(/,{2,}/g,`,`).replace(/(^|[^-])---(?=[^-]|$)/gm,`$1—`).replace(/(^|\s)--(?=\s|$)/gm,`$1–`).replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,`$1–`)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function vO(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type===`inline`&&(fO.test(e.tokens[t].content)&&gO(e.tokens[t].children),dO.test(e.tokens[t].content)&&_O(e.tokens[t].children))}var yO=/['"]/,bO=/['"]/g,xO=`’`;function SO(e,t,n,r){e[t]||(e[t]=[]),e[t].push({pos:n,ch:r})}function CO(e,t){let n=``,r=0;t.sort((e,t)=>e.pos-t.pos);for(let i=0;i<t.length;i++){let a=t[i];n+=e.slice(r,a.pos)+a.ch,r=a.pos+1}return n+e.slice(r)}function wO(e,t){let n,r=[],i={};for(let a=0;a<e.length;a++){let o=e[a],s=e[a].level;for(n=r.length-1;n>=0&&!(r[n].level<=s);n--);if(r.length=n+1,o.type!==`text`)continue;let c=o.content,l=0,u=c.length;OUTER:for(;l<u;){bO.lastIndex=l;let o=bO.exec(c);if(!o)break;let d=!0,f=!0;l=o.index+1;let p=o[0]===`'`,m=32;if(o.index-1>=0)m=c.charCodeAt(o.index-1);else for(n=a-1;n>=0&&e[n].type!==`softbreak`&&e[n].type!==`hardbreak`;n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let h=32;if(l<u)h=c.charCodeAt(l);else for(n=a+1;n<e.length&&e[n].type!==`softbreak`&&e[n].type!==`hardbreak`;n++)if(e[n].content){h=e[n].content.charCodeAt(0);break}let g=UD(m)||HD(m),_=UD(h)||HD(h),v=BD(m),y=BD(h);if(y?d=!1:_&&(v||g||(d=!1)),v?f=!1:g&&(y||_||(f=!1)),h===34&&o[0]===`"`&&m>=48&&m<=57&&(f=d=!1),d&&f&&(d=g,f=_),!d&&!f){p&&SO(i,a,o.index,xO);continue}if(f)for(n=r.length-1;n>=0;n--){let e=r[n];if(r[n].level<s)break;if(e.single===p&&r[n].level===s){e=r[n];let s,c;p?(s=t.md.options.quotes[2],c=t.md.options.quotes[3]):(s=t.md.options.quotes[0],c=t.md.options.quotes[1]),SO(i,a,o.index,c),SO(i,e.token,e.pos,s),r.length=n;continue OUTER}}d?r.push({token:a,pos:o.index,single:p,level:s}):f&&p&&SO(i,a,o.index,xO)}}Object.keys(i).forEach(function(t){e[t].content=CO(e[t].content,i[t])})}function TO(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type===`inline`&&yO.test(e.tokens[t].content)&&wO(e.tokens[t].children,e)}function EO(e){let t,n,r=e.tokens,i=r.length;for(let e=0;e<i;e++){if(r[e].type!==`inline`)continue;let i=r[e].children,a=i.length;for(t=0;t<a;t++)i[t].type===`text_special`&&(i[t].type=`text`);for(t=n=0;t<a;t++)i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}}var DO=[[`normalize`,aO],[`block`,oO],[`inline`,sO],[`linkify`,uO],[`replacements`,vO],[`smartquotes`,TO],[`text_join`,EO]];function OO(){this.ruler=new eO;for(let e=0;e<DO.length;e++)this.ruler.push(DO[e][0],DO[e][1])}OO.prototype.process=function(e){let t=this.ruler.getRules(``);for(let n=0,r=t.length;n<r;n++)t[n](e)},OO.prototype.State=nO;function kO(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType=`root`,this.level=0;let i=this.src;for(let e=0,t=0,n=0,r=0,a=i.length,o=!1;t<a;t++){let s=i.charCodeAt(t);if(!o){if(zD(s)){n++,s===9?r+=4-r%4:r++;continue}o=!0}(s===10||t===a-1)&&(s!==10&&t++,this.bMarks.push(e),this.eMarks.push(t),this.tShift.push(n),this.sCount.push(r),this.bsCount.push(0),o=!1,n=0,r=0,e=t+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}kO.prototype.push=function(e,t,n){let r=new tO(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r},kO.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},kO.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},kO.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t&&zD(this.src.charCodeAt(e));e++);return e},kO.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!zD(this.src.charCodeAt(--e)))return e+1;return e},kO.prototype.skipChars=function(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},kO.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},kO.prototype.getLines=function(e,t,n,r){if(e>=t)return``;let i=Array(t-e);for(let a=0,o=e;o<t;o++,a++){let e=0,s=this.bMarks[o],c=s,l;for(l=o+1<t||r?this.eMarks[o]+1:this.eMarks[o];c<l&&e<n;){let t=this.src.charCodeAt(c);if(zD(t))t===9?e+=4-(e+this.bsCount[o])%4:e++;else if(c-s<this.tShift[o])e++;else break;c++}e>n?i[a]=Array(e-n+1).join(` `)+this.src.slice(c,l):i[a]=this.src.slice(c,l)}return i.join(``)},kO.prototype.Token=tO;var AO=65536;function jO(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function MO(e){let t=[],n=e.length,r=0,i=e.charCodeAt(r),a=!1,o=0,s=``;for(;r<n;)i===124&&(a?(s+=e.substring(o,r-1),o=r):(t.push(s+e.substring(o,r)),s=``,o=r+1)),a=i===92,r++,i=e.charCodeAt(r);return t.push(s+e.substring(o)),t}function NO(e,t,n,r){if(t+2>n)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent||e.sCount[i]-e.blkIndent>=4)return!1;let a=e.bMarks[i]+e.tShift[i];if(a>=e.eMarks[i])return!1;let o=e.src.charCodeAt(a++);if(o!==124&&o!==45&&o!==58||a>=e.eMarks[i])return!1;let s=e.src.charCodeAt(a++);if(s!==124&&s!==45&&s!==58&&!zD(s)||o===45&&zD(s))return!1;for(;a<e.eMarks[i];){let t=e.src.charCodeAt(a);if(t!==124&&t!==45&&t!==58&&!zD(t))return!1;a++}let c=jO(e,t+1),l=c.split(`|`),u=[];for(let e=0;e<l.length;e++){let t=l[e].trim();if(!t){if(e===0||e===l.length-1)continue;return!1}if(!/^:?-+:?$/.test(t))return!1;t.charCodeAt(t.length-1)===58?u.push(t.charCodeAt(0)===58?`center`:`right`):t.charCodeAt(0)===58?u.push(`left`):u.push(``)}if(c=jO(e,t).trim(),c.indexOf(`|`)===-1||e.sCount[t]-e.blkIndent>=4)return!1;l=MO(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop();let d=l.length;if(d===0||d!==u.length)return!1;if(r)return!0;let f=e.parentType;e.parentType=`table`;let p=e.md.block.ruler.getRules(`blockquote`),m=e.push(`table_open`,`table`,1),h=[t,0];m.map=h;let g=e.push(`thead_open`,`thead`,1);g.map=[t,t+1];let _=e.push(`tr_open`,`tr`,1);_.map=[t,t+1];for(let t=0;t<l.length;t++){let n=e.push(`th_open`,`th`,1);u[t]&&(n.attrs=[[`style`,`text-align:`+u[t]]]);let r=e.push(`inline`,``,0);r.content=l[t].trim(),r.children=[],e.push(`th_close`,`th`,-1)}e.push(`tr_close`,`tr`,-1),e.push(`thead_close`,`thead`,-1);let v,y=0;for(i=t+2;i<n&&!(e.sCount[i]<e.blkIndent);i++){let r=!1;for(let t=0,a=p.length;t<a;t++)if(p[t](e,i,n,!0)){r=!0;break}if(r||(c=jO(e,i).trim(),!c)||e.sCount[i]-e.blkIndent>=4||(l=MO(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop(),y+=d-l.length,y>AO))break;if(i===t+2){let n=e.push(`tbody_open`,`tbody`,1);n.map=v=[t+2,0]}let a=e.push(`tr_open`,`tr`,1);a.map=[i,i+1];for(let t=0;t<d;t++){let n=e.push(`td_open`,`td`,1);u[t]&&(n.attrs=[[`style`,`text-align:`+u[t]]]);let r=e.push(`inline`,``,0);r.content=l[t]?l[t].trim():``,r.children=[],e.push(`td_close`,`td`,-1)}e.push(`tr_close`,`tr`,-1)}return v&&(e.push(`tbody_close`,`tbody`,-1),v[1]=i),e.push(`table_close`,`table`,-1),h[1]=i,e.parentType=f,e.line=i,!0}function PO(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,i=r;continue}break}e.line=i;let a=e.push(`code_block`,`code`,0);return a.content=e.getLines(t,i,4+e.blkIndent,!1)+`
|
|
188
|
+
`,a.map=[t,e.line],!0}function FO(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>a)return!1;let o=e.src.charCodeAt(i);if(o!==126&&o!==96)return!1;let s=i;i=e.skipChars(i,o);let c=i-s;if(c<3)return!1;let l=e.src.slice(s,i),u=e.src.slice(i,a);if(o===96&&u.indexOf(String.fromCharCode(o))>=0)return!1;if(r)return!0;let d=t,f=!1;for(;d++,!(d>=n||(i=s=e.bMarks[d]+e.tShift[d],a=e.eMarks[d],i<a&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(i)===o&&!(e.sCount[d]-e.blkIndent>=4)&&(i=e.skipChars(i,o),!(i-s<c)&&(i=e.skipSpaces(i),!(i<a)))){f=!0;break}c=e.sCount[t],e.line=d+ +!!f;let p=e.push(`fence`,`code`,0);return p.info=u,p.content=e.getLines(t+1,d,c,!0),p.markup=l,p.map=[t,e.line],!0}function IO(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==62)return!1;if(r)return!0;let s=[],c=[],l=[],u=[],d=e.md.block.ruler.getRules(`blockquote`),f=e.parentType;e.parentType=`blockquote`;let p=!1,m;for(m=t;m<n;m++){let t=e.sCount[m]<e.blkIndent;if(i=e.bMarks[m]+e.tShift[m],a=e.eMarks[m],i>=a)break;if(e.src.charCodeAt(i++)===62&&!t){let t=e.sCount[m]+1,n,r;e.src.charCodeAt(i)===32?(i++,t++,r=!1,n=!0):e.src.charCodeAt(i)===9?(n=!0,(e.bsCount[m]+t)%4==3?(i++,t++,r=!1):r=!0):n=!1;let o=t;for(s.push(e.bMarks[m]),e.bMarks[m]=i;i<a;){let t=e.src.charCodeAt(i);if(zD(t))t===9?o+=4-(o+e.bsCount[m]+ +!!r)%4:o++;else break;i++}p=i>=a,c.push(e.bsCount[m]),e.bsCount[m]=e.sCount[m]+1+ +!!n,l.push(e.sCount[m]),e.sCount[m]=o-t,u.push(e.tShift[m]),e.tShift[m]=i-e.bMarks[m];continue}if(p)break;let r=!1;for(let t=0,i=d.length;t<i;t++)if(d[t](e,m,n,!0)){r=!0;break}if(r){e.lineMax=m,e.blkIndent!==0&&(s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]-=e.blkIndent);break}s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]=-1}let h=e.blkIndent;e.blkIndent=0;let g=e.push(`blockquote_open`,`blockquote`,1);g.markup=`>`;let _=[t,0];g.map=_,e.md.block.tokenize(e,t,m);let v=e.push(`blockquote_close`,`blockquote`,-1);v.markup=`>`,e.lineMax=o,e.parentType=f,_[1]=e.line;for(let n=0;n<u.length;n++)e.bMarks[n+t]=s[n],e.tShift[n+t]=u[n],e.sCount[n+t]=l[n],e.bsCount[n+t]=c[n];return e.blkIndent=h,!0}function LO(e,t,n,r){let i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.bMarks[t]+e.tShift[t],o=e.src.charCodeAt(a++);if(o!==42&&o!==45&&o!==95)return!1;let s=1;for(;a<i;){let t=e.src.charCodeAt(a++);if(t!==o&&!zD(t))return!1;t===o&&s++}if(s<3)return!1;if(r)return!0;e.line=t+1;let c=e.push(`hr`,`hr`,0);return c.map=[t,e.line],c.markup=Array(s+1).join(String.fromCharCode(o)),!0}function RO(e,t){let n=e.eMarks[t],r=e.bMarks[t]+e.tShift[t],i=e.src.charCodeAt(r++);return i!==42&&i!==45&&i!==43||r<n&&!zD(e.src.charCodeAt(r))?-1:r}function zO(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t],i=n;if(i+1>=r)return-1;let a=e.src.charCodeAt(i++);if(a<48||a>57)return-1;for(;;){if(i>=r)return-1;if(a=e.src.charCodeAt(i++),a>=48&&a<=57){if(i-n>=10)return-1;continue}if(a===41||a===46)break;return-1}return i<r&&(a=e.src.charCodeAt(i),!zD(a))?-1:i}function BO(e,t){let n=e.level+2;for(let r=t+2,i=e.tokens.length-2;r<i;r++)e.tokens[r].level===n&&e.tokens[r].type===`paragraph_open`&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function VO(e,t,n,r){let i,a,o,s,c=t,l=!0;if(e.sCount[c]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[c]-e.listIndent>=4&&e.sCount[c]<e.blkIndent)return!1;let u=!1;r&&e.parentType===`paragraph`&&e.sCount[c]>=e.blkIndent&&(u=!0);let d,f,p;if((p=zO(e,c))>=0){if(d=!0,o=e.bMarks[c]+e.tShift[c],f=Number(e.src.slice(o,p-1)),u&&f!==1)return!1}else if((p=RO(e,c))>=0)d=!1;else return!1;if(u&&e.skipSpaces(p)>=e.eMarks[c])return!1;if(r)return!0;let m=e.src.charCodeAt(p-1),h=e.tokens.length;d?(s=e.push(`ordered_list_open`,`ol`,1),f!==1&&(s.attrs=[[`start`,f]])):s=e.push(`bullet_list_open`,`ul`,1);let g=[c,0];s.map=g,s.markup=String.fromCharCode(m);let _=!1,v=e.md.block.ruler.getRules(`list`),y=e.parentType;for(e.parentType=`list`;c<n;){a=p,i=e.eMarks[c];let t=e.sCount[c]+p-(e.bMarks[c]+e.tShift[c]),r=t;for(;a<i;){let t=e.src.charCodeAt(a);if(t===9)r+=4-(r+e.bsCount[c])%4;else if(t===32)r++;else break;a++}let u=a,f;f=u>=i?1:r-t,f>4&&(f=1);let h=t+f;s=e.push(`list_item_open`,`li`,1),s.markup=String.fromCharCode(m);let g=[c,0];s.map=g,d&&(s.info=e.src.slice(o,p-1));let y=e.tight,b=e.tShift[c],x=e.sCount[c],S=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=h,e.tight=!0,e.tShift[c]=u-e.bMarks[c],e.sCount[c]=r,u>=i&&e.isEmpty(c+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,c,n,!0),(!e.tight||_)&&(l=!1),_=e.line-c>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=S,e.tShift[c]=b,e.sCount[c]=x,e.tight=y,s=e.push(`list_item_close`,`li`,-1),s.markup=String.fromCharCode(m),c=e.line,g[1]=c,c>=n||e.sCount[c]<e.blkIndent||e.sCount[c]-e.blkIndent>=4)break;let C=!1;for(let t=0,r=v.length;t<r;t++)if(v[t](e,c,n,!0)){C=!0;break}if(C)break;if(d){if(p=zO(e,c),p<0)break;o=e.bMarks[c]+e.tShift[c]}else if(p=RO(e,c),p<0)break;if(m!==e.src.charCodeAt(p-1))break}return s=d?e.push(`ordered_list_close`,`ol`,-1):e.push(`bullet_list_close`,`ul`,-1),s.markup=String.fromCharCode(m),g[1]=c,e.line=c,e.parentType=y,l&&BO(e,h),!0}function HO(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==91)return!1;function s(t){let n=e.lineMax;if(t>=n||e.isEmpty(t))return null;let r=!1;if(e.sCount[t]-e.blkIndent>3&&(r=!0),e.sCount[t]<0&&(r=!0),!r){let r=e.md.block.ruler.getRules(`reference`),i=e.parentType;e.parentType=`reference`;let a=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,t,n,!0)){a=!0;break}if(e.parentType=i,a)return null}let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];return e.src.slice(i,a+1)}let c=e.src.slice(i,a+1);a=c.length;let l=-1;for(i=1;i<a;i++){let e=c.charCodeAt(i);if(e===91)return!1;if(e===93){l=i;break}if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(e===92&&(i++,i<a&&c.charCodeAt(i)===10)){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}}if(l<0||c.charCodeAt(l+1)!==58)return!1;for(i=l+2;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!zD(e))break}let u=e.md.helpers.parseLinkDestination(c,i,a);if(!u.ok)return!1;let d=e.md.normalizeLink(u.str);if(!e.md.validateLink(d))return!1;i=u.pos;let f=i,p=o,m=i;for(;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!zD(e))break}let h=e.md.helpers.parseLinkTitle(c,i,a);for(;h.can_continue;){let t=s(o);if(t===null)break;c+=t,i=a,a=c.length,o++,h=e.md.helpers.parseLinkTitle(c,i,a,h)}let g;for(i<a&&m!==i&&h.ok?(g=h.str,i=h.pos):(g=``,i=f,o=p);i<a&&zD(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10&&g)for(g=``,i=f,o=p;i<a&&zD(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10)return!1;let _=WD(c.slice(1,l));return _?r?!0:(e.env.references===void 0&&(e.env.references={}),e.env.references[_]===void 0&&(e.env.references[_]={title:g,href:d}),e.line=o,!0):!1}var UO=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),WO=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,GO=`<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>`,KO=RegExp(`^(?:`+WO+`|`+GO+`|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),qO=RegExp(`^(?:`+WO+`|`+GO+`)`),JO=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp(`^</?(`+UO.join(`|`)+`)(?=(\\s|/?>|$))`,`i`),/^$/,!0],[RegExp(qO.source+`\\s*$`),/^$/,!1]];function YO(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let o=e.src.slice(i,a),s=0;for(;s<JO.length&&!JO[s][0].test(o);s++);if(s===JO.length)return!1;if(r)return JO[s][2];let c=t+1,l=JO[s][1].test(``);if(!JO[s][1].test(o)){for(;c<n&&!(e.sCount[c]<e.blkIndent&&(l||!e.isEmpty(c)));c++)if(i=e.bMarks[c]+e.tShift[c],a=e.eMarks[c],o=e.src.slice(i,a),JO[s][1].test(o)){o.length!==0&&c++;break}}e.line=c;let u=e.push(`html_block`,``,0);return u.map=[t,c],u.content=e.getLines(t,c,e.blkIndent,!0),!0}function XO(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.src.charCodeAt(i);if(o!==35||i>=a)return!1;let s=1;for(o=e.src.charCodeAt(++i);o===35&&i<a&&s<=6;)s++,o=e.src.charCodeAt(++i);if(s>6||i<a&&!zD(o))return!1;if(r)return!0;a=e.skipSpacesBack(a,i);let c=e.skipCharsBack(a,35,i);c>i&&zD(e.src.charCodeAt(c-1))&&(a=c),e.line=t+1;let l=e.push(`heading_open`,`h`+String(s),1);l.markup=`########`.slice(0,s),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=KD(e.src.slice(i,a)),u.map=[t,e.line],u.children=[];let d=e.push(`heading_close`,`h`+String(s),-1);return d.markup=`########`.slice(0,s),!0}function ZO(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`);if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.parentType;e.parentType=`paragraph`;let a=0,o,s=t+1;for(;s<n&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3)continue;if(e.sCount[s]>=e.blkIndent){let t=e.bMarks[s]+e.tShift[s],n=e.eMarks[s];if(t<n&&(o=e.src.charCodeAt(t),(o===45||o===61)&&(t=e.skipChars(t,o),t=e.skipSpaces(t),t>=n))){a=o===61?1:2;break}}if(e.sCount[s]<0)continue;let t=!1;for(let i=0,a=r.length;i<a;i++)if(r[i](e,s,n,!0)){t=!0;break}if(t)break}if(!a)return e.parentType=i,!1;let c=KD(e.getLines(t,s,e.blkIndent,!1));e.line=s+1;let l=e.push(`heading_open`,`h`+String(a),1);l.markup=String.fromCharCode(o),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=c,u.map=[t,e.line-1],u.children=[];let d=e.push(`heading_close`,`h`+String(a),-1);return d.markup=String.fromCharCode(o),e.parentType=i,!0}function QO(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`),i=e.parentType,a=t+1;for(e.parentType=`paragraph`;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3||e.sCount[a]<0)continue;let t=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,a,n,!0)){t=!0;break}if(t)break}let o=KD(e.getLines(t,a,e.blkIndent,!1));e.line=a;let s=e.push(`paragraph_open`,`p`,1);s.map=[t,e.line];let c=e.push(`inline`,``,0);return c.content=o,c.map=[t,e.line],c.children=[],e.push(`paragraph_close`,`p`,-1),e.parentType=i,!0}var $O=[[`table`,NO,[`paragraph`,`reference`]],[`code`,PO],[`fence`,FO,[`paragraph`,`reference`,`blockquote`,`list`]],[`blockquote`,IO,[`paragraph`,`reference`,`blockquote`,`list`]],[`hr`,LO,[`paragraph`,`reference`,`blockquote`,`list`]],[`list`,VO,[`paragraph`,`reference`,`blockquote`]],[`reference`,HO],[`html_block`,YO,[`paragraph`,`reference`,`blockquote`]],[`heading`,XO,[`paragraph`,`reference`,`blockquote`]],[`lheading`,ZO],[`paragraph`,QO]];function ek(){this.ruler=new eO;for(let e=0;e<$O.length;e++)this.ruler.push($O[e][0],$O[e][1],{alt:($O[e][2]||[]).slice()})}ek.prototype.tokenize=function(e,t,n){let r=this.ruler.getRules(``),i=r.length,a=e.md.options.maxNesting,o=t,s=!1;for(;o<n&&(e.line=o=e.skipEmptyLines(o),!(o>=n||e.sCount[o]<e.blkIndent));){if(e.level>=a){e.line=n;break}let t=e.line,c=!1;for(let a=0;a<i;a++)if(c=r[a](e,o,n,!1),c){if(t>=e.line)throw Error(`block rule didn't increment state.line`);break}if(!c)throw Error(`none of the block rules matched`);e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),o=e.line,o<n&&e.isEmpty(o)&&(s=!0,o++,e.line=o)}},ek.prototype.parse=function(e,t,n,r){if(!e)return;let i=new this.State(e,t,n,r);this.tokenize(i,i.line,i.lineMax)},ek.prototype.State=kO;function tk(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending=``,this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}tk.prototype.pushPending=function(){let e=new tO(`text`,``,0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending=``,e},tk.prototype.push=function(e,t,n){this.pending&&this.pushPending();let r=new tO(e,t,n),i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r},tk.prototype.scanDelims=function(e,t){let n=this.posMax,r=this.src.charCodeAt(e),i;if(e===0)i=32;else if(e===1)i=this.src.charCodeAt(0),(i&63488)==55296&&(i=65533);else if(i=this.src.charCodeAt(e-1),(i&64512)==56320){let t=this.src.charCodeAt(e-2);i=(t&64512)==55296?65536+(t-55296<<10)+(i-56320):65533}else(i&64512)==55296&&(i=65533);let a=e;for(;a<n&&this.src.charCodeAt(a)===r;)a++;let o=a-e,s=a<n?this.src.charCodeAt(a):32;if((s&64512)==55296){let e=this.src.charCodeAt(a+1);s=(e&64512)==56320?65536+(s-55296<<10)+(e-56320):65533}else(s&64512)==56320&&(s=65533);let c=UD(i)||HD(i),l=UD(s)||HD(s),u=BD(i),d=BD(s),f=!d&&(!l||u||c),p=!u&&(!c||d||l);return{can_open:f&&(t||!p||c),can_close:p&&(t||!f||l),length:o}},tk.prototype.Token=tO;function nk(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function rk(e,t){let n=e.pos;for(;n<e.posMax&&!nk(e.src.charCodeAt(n));)n++;return n!==e.pos&&(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}var ik=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function ak(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;let n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;let i=e.pending.match(ik);if(!i)return!1;let a=i[1],o=e.md.linkify.matchAtStart(e.src.slice(n-a.length));if(!o)return!1;let s=o.url;if(s.length<=a.length)return!1;let c=s.length;for(;c>0&&s.charCodeAt(c-1)===42;)c--;c!==s.length&&(s=s.slice(0,c));let l=e.md.normalizeLink(s);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-a.length);let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,l]],t.markup=`linkify`,t.info=`auto`;let n=e.push(`text`,``,0);n.content=e.md.normalizeLinkText(s);let r=e.push(`link_close`,`a`,-1);r.markup=`linkify`,r.info=`auto`}return e.pos+=s.length-a.length,!0}function ok(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;let r=e.pending.length-1,i=e.posMax;if(!t){if(r>=0&&e.pending.charCodeAt(r)===32){if(r>=1&&e.pending.charCodeAt(r-1)===32){let t=r-1;for(;t>=1&&e.pending.charCodeAt(t-1)===32;)t--;e.pending=e.pending.slice(0,t),e.push(`hardbreak`,`br`,0)}else e.pending=e.pending.slice(0,-1),e.push(`softbreak`,`br`,0)}else e.push(`softbreak`,`br`,0)}for(n++;n<i&&zD(e.src.charCodeAt(n));)n++;return e.pos=n,!0}var sk=[];for(let e=0;e<256;e++)sk.push(0);`\\!"#$%&'()*+,./:;<=>?@[]^_\`{|}~-`.split(``).forEach(function(e){sk[e.charCodeAt(0)]=1});function ck(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=e.src.charCodeAt(n);if(i===10){for(t||e.push(`hardbreak`,`br`,0),n++;n<r&&(i=e.src.charCodeAt(n),zD(i));)n++;return e.pos=n,!0}let a=e.src[n];if(i>=55296&&i<=56319&&n+1<r){let t=e.src.charCodeAt(n+1);t>=56320&&t<=57343&&(a+=e.src[n+1],n++)}let o=`\\`+a;if(!t){let t=e.push(`text_special`,``,0);t.content=i<256&&sk[i]!==0?a:o,t.markup=o,t.info=`escape`}return e.pos=n+1,!0}function lk(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;let r=n;n++;let i=e.posMax;for(;n<i&&e.src.charCodeAt(n)===96;)n++;let a=e.src.slice(r,n),o=a.length;if(e.backticksScanned&&(e.backticks[o]||0)<=r)return t||(e.pending+=a),e.pos+=o,!0;let s=n,c;for(;(c=e.src.indexOf("`",s))!==-1;){for(s=c+1;s<i&&e.src.charCodeAt(s)===96;)s++;let r=s-c;if(r===o){if(!t){let t=e.push(`code_inline`,`code`,0);t.markup=a,t.content=e.src.slice(n,c).replace(/\n/g,` `).replace(/^ (.+) $/,`$1`)}return e.pos=s,!0}e.backticks[r]=c}return e.backticksScanned=!0,t||(e.pending+=a),e.pos+=o,!0}function uk(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;let i=e.scanDelims(e.pos,!0),a=i.length,o=String.fromCharCode(r);if(a<2)return!1;let s;a%2&&(s=e.push(`text`,``,0),s.content=o,a--);for(let t=0;t<a;t+=2)s=e.push(`text`,``,0),s.content=o+o,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}function dk(e,t){let n,r=[],i=t.length;for(let a=0;a<i;a++){let i=t[a];if(i.marker!==126||i.end===-1)continue;let o=t[i.end];n=e.tokens[i.token],n.type=`s_open`,n.tag=`s`,n.nesting=1,n.markup=`~~`,n.content=``,n=e.tokens[o.token],n.type=`s_close`,n.tag=`s`,n.nesting=-1,n.markup=`~~`,n.content=``,e.tokens[o.token-1].type===`text`&&e.tokens[o.token-1].content===`~`&&r.push(o.token-1)}for(;r.length;){let t=r.pop(),i=t+1;for(;i<e.tokens.length&&e.tokens[i].type===`s_close`;)i++;i--,t!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[t],e.tokens[t]=n)}}function fk(e){let t=e.tokens_meta,n=e.tokens_meta.length;dk(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&dk(e,t[r].delimiters)}var pk={tokenize:uk,postProcess:fk};function mk(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;let i=e.scanDelims(e.pos,r===42);for(let t=0;t<i.length;t++){let t=e.push(`text`,``,0);t.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function hk(e,t){let n=t.length;for(let r=n-1;r>=0;r--){let n=t[r];if(n.marker!==95&&n.marker!==42||n.end===-1)continue;let i=t[n.end],a=r>0&&t[r-1].end===n.end+1&&t[r-1].marker===n.marker&&t[r-1].token===n.token-1&&t[n.end+1].token===i.token+1,o=String.fromCharCode(n.marker),s=e.tokens[n.token];s.type=a?`strong_open`:`em_open`,s.tag=a?`strong`:`em`,s.nesting=1,s.markup=a?o+o:o,s.content=``;let c=e.tokens[i.token];c.type=a?`strong_close`:`em_close`,c.tag=a?`strong`:`em`,c.nesting=-1,c.markup=a?o+o:o,c.content=``,a&&(e.tokens[t[r-1].token].content=``,e.tokens[t[n.end+1].token].content=``,r--)}}function gk(e){let t=e.tokens_meta,n=e.tokens_meta.length;hk(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&hk(e,t[r].delimiters)}var _k={tokenize:mk,postProcess:gk};function vk(e,t){let n,r,i,a,o=``,s=``,c=e.pos,l=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;let u=e.pos,d=e.posMax,f=e.pos+1,p=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(p<0)return!1;let m=p+1;if(m<d&&e.src.charCodeAt(m)===40){for(l=!1,m++;m<d&&(n=e.src.charCodeAt(m),zD(n)||n===10);m++);if(m>=d)return!1;if(c=m,i=e.md.helpers.parseLinkDestination(e.src,m,e.posMax),i.ok){for(o=e.md.normalizeLink(i.str),e.md.validateLink(o)?m=i.pos:o=``,c=m;m<d&&(n=e.src.charCodeAt(m),zD(n)||n===10);m++);if(i=e.md.helpers.parseLinkTitle(e.src,m,e.posMax),m<d&&c!==m&&i.ok)for(s=i.str,m=i.pos;m<d&&(n=e.src.charCodeAt(m),zD(n)||n===10);m++);}(m>=d||e.src.charCodeAt(m)!==41)&&(l=!0),m++}if(l){if(e.env.references===void 0)return!1;if(m<d&&e.src.charCodeAt(m)===91?(c=m+1,m=e.md.helpers.parseLinkLabel(e,m),m>=0?r=e.src.slice(c,m++):m=p+1):m=p+1,r||=e.src.slice(f,p),a=e.env.references[WD(r)],!a)return e.pos=u,!1;o=a.href,s=a.title}if(!t){e.pos=f,e.posMax=p;let t=e.push(`link_open`,`a`,1),n=[[`href`,o]];t.attrs=n,s&&n.push([`title`,s]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push(`link_close`,`a`,-1)}return e.pos=m,e.posMax=d,!0}function yk(e,t){let n,r,i,a,o,s,c,l,u=``,d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;let p=e.pos+2,m=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(m<0)return!1;if(a=m+1,a<f&&e.src.charCodeAt(a)===40){for(a++;a<f&&(n=e.src.charCodeAt(a),zD(n)||n===10);a++);if(a>=f)return!1;for(l=a,s=e.md.helpers.parseLinkDestination(e.src,a,e.posMax),s.ok&&(u=e.md.normalizeLink(s.str),e.md.validateLink(u)?a=s.pos:u=``),l=a;a<f&&(n=e.src.charCodeAt(a),zD(n)||n===10);a++);if(s=e.md.helpers.parseLinkTitle(e.src,a,e.posMax),a<f&&l!==a&&s.ok)for(c=s.str,a=s.pos;a<f&&(n=e.src.charCodeAt(a),zD(n)||n===10);a++);else c=``;if(a>=f||e.src.charCodeAt(a)!==41)return e.pos=d,!1;a++}else{if(e.env.references===void 0)return!1;if(a<f&&e.src.charCodeAt(a)===91?(l=a+1,a=e.md.helpers.parseLinkLabel(e,a),a>=0?i=e.src.slice(l,a++):a=m+1):a=m+1,i||=e.src.slice(p,m),o=e.env.references[WD(i)],!o)return e.pos=d,!1;u=o.href,c=o.title}if(!t){r=e.src.slice(p,m);let t=[];e.md.inline.parse(r,e.md,e.env,t);let n=e.push(`image`,`img`,0),i=[[`src`,u],[`alt`,``]];n.attrs=i,n.children=t,n.content=r,c&&i.push([`title`,c])}return e.pos=a,e.posMax=f,!0}var bk=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,xk=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Sk(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;let r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;let t=e.src.charCodeAt(n);if(t===60)return!1;if(t===62)break}let a=e.src.slice(r+1,n);if(xk.test(a)){let n=e.md.normalizeLink(a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}if(bk.test(a)){let n=e.md.normalizeLink(`mailto:`+a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}return!1}function Ck(e){return/^<a[>\s]/i.test(e)}function wk(e){return/^<\/a\s*>/i.test(e)}function Tk(e){let t=e|32;return t>=97&&t<=122}function Ek(e,t){if(!e.md.options.html)return!1;let n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;let i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!Tk(i))return!1;let a=e.src.slice(r).match(KO);if(!a)return!1;if(!t){let t=e.push(`html_inline`,``,0);t.content=a[0],Ck(t.content)&&e.linkLevel++,wk(t.content)&&e.linkLevel--}return e.pos+=a[0].length,!0}var Dk=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Ok=/^&([a-z][a-z0-9]{1,31});/i;function kk(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){let r=e.src.slice(n).match(Dk);if(r){if(!t){let t=r[1][0].toLowerCase()===`x`?parseInt(r[1].slice(1),16):parseInt(r[1],10),n=e.push(`text_special`,``,0);n.content=wD(t)?TD(t):TD(65533),n.markup=r[0],n.info=`entity`}return e.pos+=r[0].length,!0}}else{let r=e.src.slice(n).match(Ok);if(r){let n=gD(r[0]);if(n!==r[0]){if(!t){let t=e.push(`text_special`,``,0);t.content=n,t.markup=r[0],t.info=`entity`}return e.pos+=r[0].length,!0}}}return!1}function Ak(e){let t={},n=e.length;if(!n)return;let r=0,i=-2,a=[];for(let o=0;o<n;o++){let n=e[o];if(a.push(0),(e[r].marker!==n.marker||i!==n.token-1)&&(r=o),i=n.token,n.length=n.length||0,!n.close)continue;t.hasOwnProperty(n.marker)||(t[n.marker]=[-1,-1,-1,-1,-1,-1]);let s=t[n.marker][(n.open?3:0)+n.length%3],c=r-a[r]-1,l=c;for(;c>s;c-=a[c]+1){let t=e[c];if(t.marker===n.marker&&t.open&&t.end<0){let r=!1;if((t.close||n.open)&&(t.length+n.length)%3==0&&(t.length%3!=0||n.length%3!=0)&&(r=!0),!r){let r=c>0&&!e[c-1].open?a[c-1]+1:0;a[o]=o-c+r,a[c]=r,n.open=!1,t.end=o,t.close=!1,l=-1,i=-2;break}}}l!==-1&&(t[n.marker][(n.open?3:0)+(n.length||0)%3]=l)}}function jk(e){let t=e.tokens_meta,n=e.tokens_meta.length;Ak(e.delimiters);for(let e=0;e<n;e++)t[e]&&t[e].delimiters&&Ak(t[e].delimiters)}function Mk(e){let t,n,r=0,i=e.tokens,a=e.tokens.length;for(t=n=0;t<a;t++)i[t].nesting<0&&r--,i[t].level=r,i[t].nesting>0&&r++,i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}var Nk=[[`text`,rk],[`linkify`,ak],[`newline`,ok],[`escape`,ck],[`backticks`,lk],[`strikethrough`,pk.tokenize],[`emphasis`,_k.tokenize],[`link`,vk],[`image`,yk],[`autolink`,Sk],[`html_inline`,Ek],[`entity`,kk]],Pk=[[`balance_pairs`,jk],[`strikethrough`,pk.postProcess],[`emphasis`,_k.postProcess],[`fragments_join`,Mk]];function Fk(){this.ruler=new eO;for(let e=0;e<Nk.length;e++)this.ruler.push(Nk[e][0],Nk[e][1]);this.ruler2=new eO;for(let e=0;e<Pk.length;e++)this.ruler2.push(Pk[e][0],Pk[e][1])}Fk.prototype.skipToken=function(e){let t=e.pos,n=this.ruler.getRules(``),r=n.length,i=e.md.options.maxNesting,a=e.cache;if(a[t]!==void 0){e.pos=a[t];return}let o=!1;if(e.level<i){for(let i=0;i<r;i++)if(e.level++,o=n[i](e,!0),e.level--,o){if(t>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}else e.pos=e.posMax;o||e.pos++,a[t]=e.pos},Fk.prototype.tokenize=function(e){let t=this.ruler.getRules(``),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos<r;){let a=e.pos,o=!1;if(e.level<i){for(let r=0;r<n;r++)if(o=t[r](e,!1),o){if(a>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}if(o){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},Fk.prototype.parse=function(e,t,n,r){let i=new this.State(e,t,n,r);this.tokenize(i);let a=this.ruler2.getRules(``),o=a.length;for(let e=0;e<o;e++)a[e](i)},Fk.prototype.State=tk;function Ik(e){let t={};return e||={},t.src_Any=JS.source,t.src_Cc=YS.source,t.src_Z=$S.source,t.src_P=ZS.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join(`|`),t.src_ZCc=[t.src_Z,t.src_Cc].join(`|`),t.src_pseudo_letter=`(?:(?![><|]|`+t.src_ZPCc+`)`+t.src_Any+`)`,t.src_ip4=`(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)`,t.src_auth=`(?:(?:(?!`+t.src_ZCc+`|[@/\\[\\]()]).)+@)?`,t.src_port=`(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?`,t.src_host_terminator=`(?=$|[><|]|`+t.src_ZPCc+`)(?!`+(e[`---`]?`-(?!--)|`:`-|`)+`_|:\\d|\\.-|\\.(?!$|`+t.src_ZPCc+`))`,t.src_path=`(?:[/?#](?:(?!`+t.src_ZCc+`|[><|]|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+`|\\]).)*\\]|\\((?:(?!`+t.src_ZCc+`|[)]).)*\\)|\\{(?:(?!`+t.src_ZCc+`|[}]).)*\\}|\\"(?:(?!`+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+`|[']).)+\\'|\\'(?=`+t.src_pseudo_letter+`|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!`+t.src_ZCc+`|[.]|$)|`+(e[`---`]?`\\-(?!--(?:[^-]|$))(?:-*)|`:`\\-+|`)+`,(?!`+t.src_ZCc+`|$)|;(?!`+t.src_ZCc+`|$)|\\!+(?!`+t.src_ZCc+`|[!]|$)|\\?(?!`+t.src_ZCc+`|[?]|$))+|\\/)?`,t.src_email_name=`[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*`,t.src_xn=`xn--[a-z0-9\\-]{1,59}`,t.src_domain_root=`(?:`+t.src_xn+`|`+t.src_pseudo_letter+`{1,63})`,t.src_domain=`(?:`+t.src_xn+`|(?:`+t.src_pseudo_letter+`)|(?:`+t.src_pseudo_letter+`(?:-|`+t.src_pseudo_letter+`){0,61}`+t.src_pseudo_letter+`))`,t.src_host=`(?:(?:(?:(?:`+t.src_domain+`)\\.)*`+t.src_domain+`))`,t.tpl_host_fuzzy=`(?:`+t.src_ip4+`|(?:(?:(?:`+t.src_domain+`)\\.)+(?:%TLDS%)))`,t.tpl_host_no_ip_fuzzy=`(?:(?:(?:`+t.src_domain+`)\\.)+(?:%TLDS%))`,t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:`+t.src_ZPCc+`|>|$))`,t.tpl_email_fuzzy=`(^|[><|]|"|\\(|`+t.src_ZCc+`)(`+t.src_email_name+`@`+t.tpl_host_fuzzy_strict+`)`,t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+`)`,t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+`)`,t}function Lk(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function Rk(e){return Object.prototype.toString.call(e)}function zk(e){return Rk(e)===`[object String]`}function Bk(e){return Rk(e)===`[object Object]`}function Vk(e){return Rk(e)===`[object RegExp]`}function Hk(e){return Rk(e)===`[object Function]`}function Uk(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,`\\$&`)}var Wk={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Gk(e){return Object.keys(e||{}).reduce(function(e,t){return e||Wk.hasOwnProperty(t)},!1)}var Kk={"http:":{validate:function(e,t,n){let r=e.slice(t);return n.re.http||(n.re.http=RegExp(`^\\/\\/`+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,`i`)),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":`http:`,"ftp:":`http:`,"//":{validate:function(e,t,n){let r=e.slice(t);return n.re.no_http||(n.re.no_http=RegExp(`^`+n.re.src_auth+`(?:localhost|(?:(?:`+n.re.src_domain+`)\\.)+`+n.re.src_domain_root+`)`+n.re.src_port+n.re.src_host_terminator+n.re.src_path,`i`)),n.re.no_http.test(r)?t>=3&&e[t-3]===`:`||t>=3&&e[t-3]===`/`?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){let r=e.slice(t);return n.re.mailto||(n.re.mailto=RegExp(`^`+n.re.src_email_name+`@`+n.re.src_host_strict,`i`)),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},qk=`a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]`,Jk=`biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф`.split(`|`);function Yk(e){return function(t,n){let r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function Xk(){return function(e,t){t.normalize(e)}}function Zk(e){let t=e.re=Ik(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(qk),n.push(t.src_xn),t.src_tlds=n.join(`|`);function r(e){return e.replace(`%TLDS%`,t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),`i`),t.email_fuzzy_global=RegExp(r(t.tpl_email_fuzzy),`ig`),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),`i`),t.link_fuzzy_global=RegExp(r(t.tpl_link_fuzzy),`ig`),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),`i`),t.link_no_ip_fuzzy_global=RegExp(r(t.tpl_link_no_ip_fuzzy),`ig`),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),`i`);let i=[];e.__compiled__={};function a(e,t){throw Error(`(LinkifyIt) Invalid schema "`+e+`": `+t)}Object.keys(e.__schemas__).forEach(function(t){let n=e.__schemas__[t];if(n===null)return;let r={validate:null,link:null};if(e.__compiled__[t]=r,Bk(n)){Vk(n.validate)?r.validate=Yk(n.validate):Hk(n.validate)?r.validate=n.validate:a(t,n),Hk(n.normalize)?r.normalize=n.normalize:n.normalize?a(t,n):r.normalize=Xk();return}if(zk(n)){i.push(t);return}a(t,n)}),i.forEach(function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)}),e.__compiled__[``]={validate:null,normalize:Xk()};let o=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map(Uk).join(`|`);e.re.schema_test=RegExp(`(^|(?!_)(?:[><|]|`+t.src_ZPCc+`))(`+o+`)`,`i`),e.re.schema_search=RegExp(`(^|(?!_)(?:[><|]|`+t.src_ZPCc+`))(`+o+`)`,`ig`),e.re.schema_at_start=RegExp(`^`+e.re.schema_search.source,`i`),e.re.pretest=RegExp(`(`+e.re.schema_test.source+`)|(`+e.re.host_fuzzy_test.source+`)|@`,`i`)}function Qk(e,t,n,r){let i=e.slice(n,r);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=i,this.text=i,this.url=i}function $k(e,t){if(!(this instanceof $k))return new $k(e,t);t||Gk(e)&&(t=e,e={}),this.__opts__=Lk({},Wk,t),this.__schemas__=Lk({},Kk,e),this.__compiled__={},this.__tlds__=Jk,this.__tlds_replaced__=!1,this.re={},Zk(this)}$k.prototype.add=function(e,t){return this.__schemas__[e]=t,Zk(this),this},$k.prototype.set=function(e){return this.__opts__=Lk(this.__opts__,e),this},$k.prototype.test=function(e){if(!e.length)return!1;let t,n;if(this.re.schema_test.test(e)){for(n=this.re.schema_search,n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__[`http:`]&&e.search(this.re.host_fuzzy_test)>=0&&e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__[`mailto:`]&&e.indexOf(`@`)>=0&&e.match(this.re.email_fuzzy)!==null)},$k.prototype.pretest=function(e){return this.re.pretest.test(e)},$k.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},$k.prototype.match=function(e){let t=[],n=[],r=[],i=[],a,o,s;function c(e,t){return e?t?e.index===t.index?e.lastIndex>=t.lastIndex?e:t:e.index<t.index?e:t:e:t}if(!e.length)return null;if(this.re.schema_test.test(e))for(s=this.re.schema_search,s.lastIndex=0;(a=s.exec(e))!==null;)o=this.testSchemaAt(e,a[2],s.lastIndex),o&&n.push({schema:a[2],index:a.index+a[1].length,lastIndex:a.index+a[0].length+o});if(this.__opts__.fuzzyLink&&this.__compiled__[`http:`])for(s=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,s.lastIndex=0;(a=s.exec(e))!==null;)r.push({schema:``,index:a.index+a[1].length,lastIndex:a.index+a[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__[`mailto:`])for(s=this.re.email_fuzzy_global,s.lastIndex=0;(a=s.exec(e))!==null;)i.push({schema:`mailto:`,index:a.index+a[1].length,lastIndex:a.index+a[0].length});let l=[0,0,0],u=0;for(;;){let a=[n[l[0]],i[l[1]],r[l[2]]],o=c(c(a[0],a[1]),a[2]);if(!o)break;if(o===a[0]?l[0]++:o===a[1]?l[1]++:l[2]++,o.index<u)continue;let s=new Qk(e,o.schema,o.index,o.lastIndex);this.__compiled__[s.schema].normalize(s,this),t.push(s),u=o.lastIndex}return t.length?t:null},$k.prototype.matchAtStart=function(e){if(!e.length)return null;let t=this.re.schema_at_start.exec(e);if(!t)return null;let n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;let r=new Qk(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__compiled__[r.schema].normalize(r,this),r},$k.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,n){return e!==n[t-1]}).reverse(),Zk(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Zk(this),this)},$k.prototype.normalize=function(e){e.schema||(e.url=`http://`+e.url),e.schema===`mailto:`&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:`+e.url)},$k.prototype.onCompile=function(){};var eA={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`paragraph`]},inline:{rules:[`text`],rules2:[`balance_pairs`,`fragments_join`]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`blockquote`,`code`,`fence`,`heading`,`hr`,`html_block`,`lheading`,`list`,`reference`,`paragraph`]},inline:{rules:[`autolink`,`backticks`,`emphasis`,`entity`,`escape`,`html_inline`,`image`,`link`,`newline`,`text`],rules2:[`balance_pairs`,`emphasis`,`fragments_join`]}}}},tA=/^(vbscript|javascript|file|data):/,nA=/^data:image\/(gif|png|jpeg|webp);/;function rA(e){let t=e.trim().toLowerCase();return!tA.test(t)||nA.test(t)}var iA=[`http:`,`https:`,`mailto:`];function aA(e){let t=KS(e,!0);if(t.hostname&&(!t.protocol||iA.indexOf(t.protocol)>=0))try{t.hostname=DE.toASCII(t.hostname)}catch{}return NS(PS(t))}function oA(e){let t=KS(e,!0);if(t.hostname&&(!t.protocol||iA.indexOf(t.protocol)>=0))try{t.hostname=DE.toUnicode(t.hostname)}catch{}return AS(PS(t),AS.defaultChars+`%`)}function sA(e,t){if(!(this instanceof sA))return new sA(e,t);t||yD(e)||(t=e||{},e=`default`),this.inline=new Fk,this.block=new ek,this.core=new OO,this.renderer=new $D,this.linkify=new $k,this.validateLink=rA,this.normalizeLink=aA,this.normalizeLinkText=oA,this.utils=_D,this.helpers=SD({},ZD),this.options={},this.configure(e),t&&this.set(t)}sA.prototype.set=function(e){return SD(this.options,e),this},sA.prototype.configure=function(e){let t=this;if(yD(e)){let t=e;if(e=eA[t],!e)throw Error('Wrong `markdown-it` preset "'+t+`", check name`)}if(!e)throw Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this},sA.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),[`core`,`block`,`inline`].forEach(function(t){n=n.concat(this[t].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));let r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw Error(`MarkdownIt. Failed to enable unknown rule(s): `+r);return this},sA.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),[`core`,`block`,`inline`].forEach(function(t){n=n.concat(this[t].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));let r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw Error(`MarkdownIt. Failed to disable unknown rule(s): `+r);return this},sA.prototype.use=function(e){let t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},sA.prototype.parse=function(e,t){if(typeof e!=`string`)throw Error(`Input data should be a String`);let n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},sA.prototype.render=function(e,t){return t||={},this.renderer.render(this.parse(e,t),this.options,t)},sA.prototype.parseInline=function(e,t){let n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},sA.prototype.renderInline=function(e,t){return t||={},this.renderer.render(this.parseInline(e,t),this.options,t)};var cA=e(n(((e,t)=>{var n=!0,r=!1,i=!1;t.exports=function(e,t){t&&(n=!t.enabled,r=!!t.label,i=!!t.labelAfter),e.core.ruler.after(`inline`,`github-task-lists`,function(e){for(var t=e.tokens,r=2;r<t.length;r++)s(t,r)&&(c(t[r],e.Token),a(t[r-2],`class`,`task-list-item`+(n?``:` enabled`)),a(t[o(t,r-2)],`class`,`contains-task-list`))})};function a(e,t,n){var r=e.attrIndex(t),i=[t,n];r<0?e.attrPush(i):e.attrs[r]=i}function o(e,t){for(var n=e[t].level-1,r=t-1;r>=0;r--)if(e[r].level===n)return r;return-1}function s(e,t){return p(e[t])&&m(e[t-1])&&h(e[t-2])&&g(e[t])}function c(e,t){if(e.children.unshift(l(e,t)),e.children[1].content=e.children[1].content.slice(3),e.content=e.content.slice(3),r){if(i){e.children.pop();var n=`task-item-`+Math.ceil(Math.random()*1e7-1e3);e.children[0].content=e.children[0].content.slice(0,-1)+` id="`+n+`">`,e.children.push(f(e.content,n,t))}else e.children.unshift(u(t)),e.children.push(d(t))}}function l(e,t){var r=new t(`html_inline`,``,0),i=n?` disabled="" `:``;return e.content.indexOf(`[ ] `)===0?r.content=`<input class="task-list-item-checkbox"`+i+`type="checkbox">`:(e.content.indexOf(`[x] `)===0||e.content.indexOf(`[X] `)===0)&&(r.content=`<input class="task-list-item-checkbox" checked=""`+i+`type="checkbox">`),r}function u(e){var t=new e(`html_inline`,``,0);return t.content=`<label>`,t}function d(e){var t=new e(`html_inline`,``,0);return t.content=`</label>`,t}function f(e,t,n){var r=new n(`html_inline`,``,0);return r.content=`<label class="task-list-item-label" for="`+t+`">`+e+`</label>`,r.attrs=[{for:t}],r}function p(e){return e.type===`inline`}function m(e){return e.type===`paragraph_open`}function h(e){return e.type===`list_item_open`}function g(e){return e.content.indexOf(`[ ] `)===0||e.content.indexOf(`[x] `)===0||e.content.indexOf(`[X] `)===0}}))(),1),lA=Object.defineProperty,uA=(e,t,n)=>t in e?lA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dA=(e,t,n)=>(uA(e,typeof t==`symbol`?t:t+``,n),n),fA=ah.create({name:`markdownTightLists`,addOptions:()=>({tight:!0,tightClass:`tight`,listTypes:[`bulletList`,`orderedList`]}),addGlobalAttributes(){return[{types:this.options.listTypes,attributes:{tight:{default:this.options.tight,parseHTML:e=>e.getAttribute(`data-tight`)===`true`||!e.querySelector(`p`),renderHTML:e=>({class:e.tight?this.options.tightClass:null,"data-tight":e.tight?`true`:null})}}}]},addCommands(){var e=this;return{toggleTight:function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return n=>{let{editor:r,commands:i}=n;function a(e){if(!r.isActive(e))return!1;let n=r.getAttributes(e);return i.updateAttributes(e,{tight:t??!(n!=null&&n.tight)})}return e.options.listTypes.some(e=>a(e))}}}}}),pA=sA();function mA(e,t){return pA.inline.State.prototype.scanDelims.call({src:e,posMax:e.length}),new pA.inline.State(e,null,null,[]).scanDelims(t,!0)}function hA(e,t,n,r){let i=e.substring(0,n)+e.substring(n+t.length);return i=i.substring(0,n+r)+t+i.substring(n+r),i}function gA(e,t,n,r){let i=n,a=e;for(;i<r&&!mA(a,i).can_open;)a=hA(a,t,i,1),i++;return{text:a,from:i,to:r}}function _A(e,t,n,r){let i=r,a=e;for(;i>n&&!mA(a,i).can_close;)a=hA(a,t,i,-1),i--;return{text:a,from:n,to:i}}function vA(e,t,n,r){let i={text:e,from:n,to:r};return i=gA(i.text,t,i.from,i.to),i=_A(i.text,t,i.from,i.to),i.to-i.from<t.length+1&&(i.text=i.text.substring(0,i.from)+i.text.substring(i.to+t.length)),i.text}var yA=class extends XE{constructor(e,t,n){super(e,t,n??{}),dA(this,`inTable`,!1),this.inlines=[]}render(e,t,n){super.render(e,t,n);let r=this.inlines[this.inlines.length-1];if(r!=null&&r.start&&r!=null&&r.end){let{delimiter:e,start:t,end:n}=this.normalizeInline(r);this.out=vA(this.out,e,t,n),this.inlines.pop()}}markString(e,t,n,r){let i=this.marks[e.type.name];if(i.expelEnclosingWhitespace){if(t)this.inlines.push({start:this.out.length,delimiter:i.open});else{let e=this.inlines.pop();this.inlines.push({...e,end:this.out.length})}}return super.markString(e,t,n,r)}normalizeInline(e){let{start:t,end:n}=e;for(;this.out.charAt(t).match(/\s/);)t++;return{...e,start:t}}},bA=Xm.create({name:`markdownHTMLMark`,addStorage(){return{markdown:{serialize:{open(e,t){return this.editor.storage.markdown.options.html?xA(t)?.[0]??``:(console.warn(`Tiptap Markdown: "${t.type.name}" mark is only available in html mode`),``)},close(e,t){return this.editor.storage.markdown.options.html?xA(t)?.[1]??``:``}},parse:{}}}}});function xA(e){let t=e.type.schema,n=t.text(` `,[e]),r=fp(Y.from(n),t).match(/^(<.*?>) (<\/.*?>)$/);return r?[r[1],r[2]]:null}function SA(e){let t=`<body>${e}</body>`;return new window.DOMParser().parseFromString(t,`text/html`).body}function CA(e){return e?.replace(/</g,`<`).replace(/>/g,`>`)}function wA(e){let t=e.parentElement,n=t.cloneNode();for(;t.firstChild&&t.firstChild!==e;)n.appendChild(t.firstChild);n.childNodes.length>0&&t.parentElement.insertBefore(n,t),t.parentElement.insertBefore(e,t),t.childNodes.length===0&&t.remove()}function TA(e){let t=e.parentNode;for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}var EA=Eh.create({name:`markdownHTMLNode`,addStorage(){return{markdown:{serialize(e,t,n){this.editor.storage.markdown.options.html?e.write(DA(t,n)):(console.warn(`Tiptap Markdown: "${t.type.name}" node is only available in html mode`),e.write(`[${t.type.name}]`)),t.isBlock&&e.closeBlock(t)},parse:{}}}}});function DA(e,t){let n=e.type.schema,r=fp(Y.from(e),n);return e.isBlock&&(t instanceof Y||t.type.name===n.topNodeType.name)?OA(r):r}function OA(e){let t=SA(e).firstElementChild;return t.innerHTML=t.innerHTML.trim()?`
|
|
189
|
+
${t.innerHTML}
|
|
190
|
+
`:`
|
|
191
|
+
`,t.outerHTML}var kA=Eh.create({name:`blockquote`}).extend({addStorage(){return{markdown:{serialize:qE.nodes.blockquote,parse:{}}}}}),AA=Eh.create({name:`bulletList`}).extend({addStorage(){return{markdown:{serialize(e,t){return e.renderList(t,` `,()=>(this.editor.storage.markdown.options.bulletListMarker||`-`)+` `)},parse:{}}}}}),jA=Eh.create({name:`codeBlock`}).extend({addStorage(){return{markdown:{serialize(e,t){e.write("```"+(t.attrs.language||``)+`
|
|
192
|
+
`),e.text(t.textContent,!1),e.ensureNewLine(),e.write("```"),e.closeBlock(t)},parse:{setup(e){e.set({langPrefix:this.options.languageClassPrefix??`language-`})},updateDOM(e){e.innerHTML=e.innerHTML.replace(/\n<\/code><\/pre>/g,`</code></pre>`)}}}}}}),MA=Eh.create({name:`hardBreak`}).extend({addStorage(){return{markdown:{serialize(e,t,n,r){for(let i=r+1;i<n.childCount;i++)if(n.child(i).type!=t.type){e.write(e.inTable?EA.storage.markdown.serialize.call(this,e,t,n):`\\
|
|
193
|
+
`);return}},parse:{}}}}}),NA=Eh.create({name:`heading`}).extend({addStorage(){return{markdown:{serialize:qE.nodes.heading,parse:{}}}}}),PA=Eh.create({name:`horizontalRule`}).extend({addStorage(){return{markdown:{serialize:qE.nodes.horizontal_rule,parse:{}}}}}),FA=Eh.create({name:`image`}).extend({addStorage(){return{markdown:{serialize:qE.nodes.image,parse:{}}}}}),IA=Eh.create({name:`listItem`}).extend({addStorage(){return{markdown:{serialize:qE.nodes.list_item,parse:{}}}}}),LA=Eh.create({name:`orderedList`});function RA(e,t,n){let r=0;for(;n-r>0&&t.child(n-r-1).type.name===e.type.name;r++);return r}var zA=LA.extend({addStorage(){return{markdown:{serialize(e,t,n,r){let i=t.attrs.start||1,a=String(i+t.childCount-1).length,o=e.repeat(` `,a+2),s=RA(t,n,r)%2?`) `:`. `;e.renderList(t,o,t=>{let n=String(i+t);return e.repeat(` `,a-n.length)+n+s})},parse:{}}}}}),BA=Eh.create({name:`paragraph`}).extend({addStorage(){return{markdown:{serialize:qE.nodes.paragraph,parse:{}}}}});function VA(e){var t;return(e==null||(t=e.content)==null?void 0:t.content)??[]}var HA=Eh.create({name:`table`}).extend({addStorage(){return{markdown:{serialize(e,t,n){if(!WA(t)){EA.storage.markdown.serialize.call(this,e,t,n);return}e.inTable=!0,t.forEach((t,n,r)=>{if(e.write(`| `),t.forEach((t,n,r)=>{r&&e.write(` | `);let i=t.firstChild;i.textContent.trim()&&e.renderInline(i)}),e.write(` |`),e.ensureNewLine(),!r){let n=Array.from({length:t.childCount}).map(()=>`---`).join(` | `);e.write(`| ${n} |`),e.ensureNewLine()}}),e.closeBlock(t),e.inTable=!1},parse:{}}}}});function UA(e){return e.attrs.colspan>1||e.attrs.rowspan>1}function WA(e){let t=VA(e),n=t[0],r=t.slice(1);return!(VA(n).some(e=>e.type.name!==`tableHeader`||UA(e)||e.childCount>1)||r.some(e=>VA(e).some(e=>e.type.name===`tableHeader`||UA(e)||e.childCount>1)))}var GA=[kA,AA,jA,MA,NA,PA,EA,FA,IA,zA,BA,HA,Eh.create({name:`taskItem`}).extend({addStorage(){return{markdown:{serialize(e,t){let n=t.attrs.checked?`[x]`:`[ ]`;e.write(`${n} `),e.renderContent(t)},parse:{updateDOM(e){[...e.querySelectorAll(`.task-list-item`)].forEach(e=>{let t=e.querySelector(`input`);e.setAttribute(`data-type`,`taskItem`),t&&(e.setAttribute(`data-checked`,t.checked),t.remove())})}}}}}}),Eh.create({name:`taskList`}).extend({addStorage(){return{markdown:{serialize:AA.storage.markdown.serialize,parse:{setup(e){e.use(cA.default)},updateDOM(e){[...e.querySelectorAll(`.contains-task-list`)].forEach(e=>{e.setAttribute(`data-type`,`taskList`)})}}}}}}),Eh.create({name:`text`}).extend({addStorage(){return{markdown:{serialize(e,t){e.text(CA(t.text))},parse:{}}}}}),Xm.create({name:`bold`}).extend({addStorage(){return{markdown:{serialize:qE.marks.strong,parse:{}}}}}),Xm.create({name:`code`}).extend({addStorage(){return{markdown:{serialize:qE.marks.code,parse:{}}}}}),bA,Xm.create({name:`italic`}).extend({addStorage(){return{markdown:{serialize:qE.marks.em,parse:{}}}}}),Xm.create({name:`link`}).extend({addStorage(){return{markdown:{serialize:qE.marks.link,parse:{}}}}}),Xm.create({name:`strike`}).extend({addStorage(){return{markdown:{serialize:{open:`~~`,close:`~~`,expelEnclosingWhitespace:!0},parse:{}}}}})];function KA(e){let t=e.storage?.markdown,n=GA.find(t=>t.name===e.name)?.storage.markdown;return t||n?{...n,...t}:null}var qA=class{constructor(e){dA(this,`editor`,null),this.editor=e}serialize(e){let t=new yA(this.nodes,this.marks,{hardBreakNodeName:MA.name});return t.renderContent(e),t.out}get nodes(){return{...Object.fromEntries(Object.keys(this.editor.schema.nodes).map(e=>[e,this.serializeNode(EA)])),...Object.fromEntries(this.editor.extensionManager.extensions.filter(e=>e.type===`node`&&this.serializeNode(e)).map(e=>[e.name,this.serializeNode(e)])??[])}}get marks(){return{...Object.fromEntries(Object.keys(this.editor.schema.marks).map(e=>[e,this.serializeMark(bA)])),...Object.fromEntries(this.editor.extensionManager.extensions.filter(e=>e.type===`mark`&&this.serializeMark(e)).map(e=>[e.name,this.serializeMark(e)])??[])}}serializeNode(e){var t;return(t=KA(e))==null||(t=t.serialize)==null?void 0:t.bind({editor:this.editor,options:e.options})}serializeMark(e){let t=KA(e)?.serialize;return t?{...t,open:typeof t.open==`function`?t.open.bind({editor:this.editor,options:e.options}):t.open,close:typeof t.close==`function`?t.close.bind({editor:this.editor,options:e.options}):t.close}:null}},JA=class{constructor(e,t){dA(this,`editor`,null),dA(this,`md`,null);let{html:n,linkify:r,breaks:i}=t;this.editor=e,this.md=this.withPatchedRenderer(sA({html:n,linkify:r,breaks:i}))}parse(e){let{inline:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof e==`string`){this.editor.extensionManager.extensions.forEach(e=>{var t;return(t=KA(e))==null||(t=t.parse)==null||(t=t.setup)==null?void 0:t.call({editor:this.editor,options:e.options},this.md)});let n=SA(this.md.render(e));return this.editor.extensionManager.extensions.forEach(e=>{var t;return(t=KA(e))==null||(t=t.parse)==null||(t=t.updateDOM)==null?void 0:t.call({editor:this.editor,options:e.options},n)}),this.normalizeDOM(n,{inline:t,content:e}),n.innerHTML}return e}normalizeDOM(e,t){let{inline:n,content:r}=t;return this.normalizeBlocks(e),e.querySelectorAll(`*`).forEach(e=>{e.nextSibling?.nodeType===Node.TEXT_NODE&&!e.closest(`pre`)&&(e.nextSibling.textContent=e.nextSibling.textContent.replace(/^\n/,``))}),n&&this.normalizeInline(e,r),e}normalizeBlocks(e){let t=Object.values(this.editor.schema.nodes).filter(e=>e.isBlock).map(e=>e.spec.parseDOM?.map(e=>e.tag)).flat().filter(Boolean).join(`,`);t&&[...e.querySelectorAll(t)].forEach(e=>{e.parentElement.matches(`p`)&&wA(e)})}normalizeInline(e,t){var n;if((n=e.firstElementChild)!=null&&n.matches(`p`)){let n=e.firstElementChild,{nextElementSibling:r}=n,i=t.match(/^\s+/)?.[0]??``,a=r?``:t.match(/\s+$/)?.[0]??``;if(t.match(/^\n\n/)){n.innerHTML=`${n.innerHTML}${a}`;return}TA(n),e.innerHTML=`${i}${e.innerHTML}${a}`}}withPatchedRenderer(e){let t=e=>function(){let t=e(...arguments);return t===`
|
|
194
|
+
`?t:t[t.length-1]===`
|
|
195
|
+
`?t.slice(0,-1):t};return e.renderer.rules.hardbreak=t(e.renderer.rules.hardbreak),e.renderer.rules.softbreak=t(e.renderer.rules.softbreak),e.renderer.rules.fence=t(e.renderer.rules.fence),e.renderer.rules.code_block=t(e.renderer.rules.code_block),e.renderer.renderToken=t(e.renderer.renderToken.bind(e.renderer)),e}},YA=ah.create({name:`markdownClipboard`,addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new co({key:new fo(`markdownClipboard`),props:{clipboardTextParser:(e,t,n)=>{if(n||!this.options.transformPastedText)return null;let r=this.editor.storage.markdown.parser.parse(e,{inline:!0});return oi.fromSchema(this.editor.schema).parseSlice(SA(r),{preserveWhitespace:!0,context:t})},clipboardTextSerializer:e=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(e.content):null}})]}}),XA=ah.create({name:`markdown`,priority:50,addOptions(){return{html:!0,tightLists:!0,tightListClass:`tight`,bulletListMarker:`-`,linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}},addCommands(){let e=ih.Commands.config.addCommands();return{setContent:(t,n)=>r=>e.setContent(r.editor.storage.markdown.parser.parse(t),n)(r),insertContentAt:(t,n,r)=>i=>e.insertContentAt(t,i.editor.storage.markdown.parser.parse(n,{inline:!0}),r)(i)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new JA(this.editor,this.options),serializer:new qA(this.editor),getMarkdown:()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc)},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage(){return{}},addExtensions(){return[fA.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),YA.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}}),ZA=`attachment:`;function QA(e){if(typeof e!=`string`||!e.startsWith(ZA))return null;let t=e.slice(11).trim();return t.length>0?t:null}function $A(e){let t=e.regex,n=e.COMMENT(`//`,`$`,{contains:[{begin:/\\\n/}]}),r=`[a-zA-Z_]\\w*::`,i=`(?!struct)(decltype\\(auto\\)|`+t.optional(r)+`[a-zA-Z_]\\w*`+t.optional(`<[^<>]+>`)+`)`,a={className:`type`,begin:`\\b[a-z\\d_]*_t\\b`},o={className:`string`,variants:[{begin:`(u8?|U|L)?"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]},{begin:`(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)`,end:`'`,illegal:`.`},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},s={className:`number`,variants:[{begin:`[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)`},{begin:`[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)`}],relevance:0},c={className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(o,{className:`string`}),{className:`string`,begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},l={className:`title`,begin:t.optional(r)+e.IDENT_RE,relevance:0},u=t.optional(r)+e.IDENT_RE+`\\s*\\(`,d=`alignas.alignof.and.and_eq.asm.atomic_cancel.atomic_commit.atomic_noexcept.auto.bitand.bitor.break.case.catch.class.co_await.co_return.co_yield.compl.concept.const_cast|10.consteval.constexpr.constinit.continue.decltype.default.delete.do.dynamic_cast|10.else.enum.explicit.export.extern.false.final.for.friend.goto.if.import.inline.module.mutable.namespace.new.noexcept.not.not_eq.nullptr.operator.or.or_eq.override.private.protected.public.reflexpr.register.reinterpret_cast|10.requires.return.sizeof.static_assert.static_cast|10.struct.switch.synchronized.template.this.thread_local.throw.transaction_safe.transaction_safe_dynamic.true.try.typedef.typeid.typename.union.using.virtual.volatile.while.xor.xor_eq`.split(`.`),f=[`bool`,`char`,`char16_t`,`char32_t`,`char8_t`,`double`,`float`,`int`,`long`,`short`,`void`,`wchar_t`,`unsigned`,`signed`,`const`,`static`],p=`any.auto_ptr.barrier.binary_semaphore.bitset.complex.condition_variable.condition_variable_any.counting_semaphore.deque.false_type.flat_map.flat_set.future.imaginary.initializer_list.istringstream.jthread.latch.lock_guard.multimap.multiset.mutex.optional.ostringstream.packaged_task.pair.promise.priority_queue.queue.recursive_mutex.recursive_timed_mutex.scoped_lock.set.shared_future.shared_lock.shared_mutex.shared_timed_mutex.shared_ptr.stack.string_view.stringstream.timed_mutex.thread.true_type.tuple.unique_lock.unique_ptr.unordered_map.unordered_multimap.unordered_multiset.unordered_set.variant.vector.weak_ptr.wstring.wstring_view`.split(`.`),m=`abort.abs.acos.apply.as_const.asin.atan.atan2.calloc.ceil.cerr.cin.clog.cos.cosh.cout.declval.endl.exchange.exit.exp.fabs.floor.fmod.forward.fprintf.fputs.free.frexp.fscanf.future.invoke.isalnum.isalpha.iscntrl.isdigit.isgraph.islower.isprint.ispunct.isspace.isupper.isxdigit.labs.launder.ldexp.log.log10.make_pair.make_shared.make_shared_for_overwrite.make_tuple.make_unique.malloc.memchr.memcmp.memcpy.memset.modf.move.pow.printf.putchar.puts.realloc.scanf.sin.sinh.snprintf.sprintf.sqrt.sscanf.std.stderr.stdin.stdout.strcat.strchr.strcmp.strcpy.strcspn.strlen.strncat.strncmp.strncpy.strpbrk.strrchr.strspn.strstr.swap.tan.tanh.terminate.to_underlying.tolower.toupper.vfprintf.visit.vprintf.vsprintf`.split(`.`),h={type:f,keyword:d,literal:[`NULL`,`false`,`nullopt`,`nullptr`,`true`],built_in:[`_Pragma`],_type_hints:p},g={className:`function.dispatch`,relevance:0,keywords:{_hint:m},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},_=[g,c,a,n,e.C_BLOCK_COMMENT_MODE,s,o],v={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:`new throw return else`,end:/;/}],keywords:h,contains:_.concat([{begin:/\(/,end:/\)/,keywords:h,contains:_.concat([`self`]),relevance:0}]),relevance:0},y={className:`function`,begin:`(`+i+`[\\*&\\s]+)+`+u,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:`decltype\\(auto\\)`,keywords:h,relevance:0},{begin:u,returnBegin:!0,contains:[l],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[o,s]},{relevance:0,match:/,/},{className:`params`,begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,o,s,a,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[`self`,n,e.C_BLOCK_COMMENT_MODE,o,s,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:`C++`,aliases:[`cc`,`c++`,`h++`,`hpp`,`hh`,`hxx`,`cxx`],keywords:h,illegal:`</`,classNameAliases:{"function.dispatch":`built_in`},contains:[].concat(v,y,g,_,[c,{begin:`\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)`,end:`>`,keywords:h,contains:[`self`,a]},{begin:e.IDENT_RE+`::`,keywords:h},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:`keyword`,3:`title.class`}}])}}function ej(e){let t={type:[`boolean`,`byte`,`word`,`String`],built_in:`KeyboardController.MouseController.SoftwareSerial.EthernetServer.EthernetClient.LiquidCrystal.RobotControl.GSMVoiceCall.EthernetUDP.EsploraTFT.HttpClient.RobotMotor.WiFiClient.GSMScanner.FileSystem.Scheduler.GSMServer.YunClient.YunServer.IPAddress.GSMClient.GSMModem.Keyboard.Ethernet.Console.GSMBand.Esplora.Stepper.Process.WiFiUDP.GSM_SMS.Mailbox.USBHost.Firmata.PImage.Client.Server.GSMPIN.FileIO.Bridge.Serial.EEPROM.Stream.Mouse.Audio.Servo.File.Task.GPRS.WiFi.Wire.TFT.GSM.SPI.SD`.split(`.`),_hints:`setup.loop.runShellCommandAsynchronously.analogWriteResolution.retrieveCallingNumber.printFirmwareVersion.analogReadResolution.sendDigitalPortPair.noListenOnLocalhost.readJoystickButton.setFirmwareVersion.readJoystickSwitch.scrollDisplayRight.getVoiceCallStatus.scrollDisplayLeft.writeMicroseconds.delayMicroseconds.beginTransmission.getSignalStrength.runAsynchronously.getAsynchronously.listenOnLocalhost.getCurrentCarrier.readAccelerometer.messageAvailable.sendDigitalPorts.lineFollowConfig.countryNameWrite.runShellCommand.readStringUntil.rewindDirectory.readTemperature.setClockDivider.readLightSensor.endTransmission.analogReference.detachInterrupt.countryNameRead.attachInterrupt.encryptionType.readBytesUntil.robotNameWrite.readMicrophone.robotNameRead.cityNameWrite.userNameWrite.readJoystickY.readJoystickX.mouseReleased.openNextFile.scanNetworks.noInterrupts.digitalWrite.beginSpeaker.mousePressed.isActionDone.mouseDragged.displayLogos.noAutoscroll.addParameter.remoteNumber.getModifiers.keyboardRead.userNameRead.waitContinue.processInput.parseCommand.printVersion.readNetworks.writeMessage.blinkVersion.cityNameRead.readMessage.setDataMode.parsePacket.isListening.setBitOrder.beginPacket.isDirectory.motorsWrite.drawCompass.digitalRead.clearScreen.serialEvent.rightToLeft.setTextSize.leftToRight.requestFrom.keyReleased.compassRead.analogWrite.interrupts.WiFiServer.disconnect.playMelody.parseFloat.autoscroll.getPINUsed.setPINUsed.setTimeout.sendAnalog.readSlider.analogRead.beginWrite.createChar.motorsStop.keyPressed.tempoWrite.readButton.subnetMask.debugPrint.macAddress.writeGreen.randomSeed.attachGPRS.readString.sendString.remotePort.releaseAll.mouseMoved.background.getXChange.getYChange.answerCall.getResult.voiceCall.endPacket.constrain.getSocket.writeJSON.getButton.available.connected.findUntil.readBytes.exitValue.readGreen.writeBlue.startLoop.IPAddress.isPressed.sendSysex.pauseMode.gatewayIP.setCursor.getOemKey.tuneWrite.noDisplay.loadImage.switchPIN.onRequest.onReceive.changePIN.playFile.noBuffer.parseInt.overflow.checkPIN.knobRead.beginTFT.bitClear.updateIR.bitWrite.position.writeRGB.highByte.writeRed.setSpeed.readBlue.noStroke.remoteIP.transfer.shutdown.hangCall.beginSMS.endWrite.attached.maintain.noCursor.checkReg.checkPUK.shiftOut.isValid.shiftIn.pulseIn.connect.println.localIP.pinMode.getIMEI.display.noBlink.process.getBand.running.beginSD.drawBMP.lowByte.setBand.release.bitRead.prepare.pointTo.readRed.setMode.noFill.remove.listen.stroke.detach.attach.noTone.exists.buffer.height.bitSet.circle.config.cursor.random.IRread.setDNS.endSMS.getKey.micros.millis.begin.print.write.ready.flush.width.isPIN.blink.clear.press.mkdir.rmdir.close.point.yield.image.BSSID.click.delay.read.text.move.peek.beep.rect.line.open.seek.fill.size.turn.stop.home.find.step.tone.sqrt.RSSI.SSID.end.bit.tan.cos.sin.pow.map.abs.max.min.get.run.put`.split(`.`),literal:[`DIGITAL_MESSAGE`,`FIRMATA_STRING`,`ANALOG_MESSAGE`,`REPORT_DIGITAL`,`REPORT_ANALOG`,`INPUT_PULLUP`,`SET_PIN_MODE`,`INTERNAL2V56`,`SYSTEM_RESET`,`LED_BUILTIN`,`INTERNAL1V1`,`SYSEX_START`,`INTERNAL`,`EXTERNAL`,`DEFAULT`,`OUTPUT`,`INPUT`,`HIGH`,`LOW`]},n=$A(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name=`Arduino`,n.aliases=[`ino`],n.supersetOf=`cpp`,n}function tj(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp`.split(`.`),b=`chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}function nj(e){let t=e.regex,n=e.COMMENT(`//`,`$`,{contains:[{begin:/\\\n/}]}),r=`[a-zA-Z_]\\w*::`,i=`(decltype\\(auto\\)|`+t.optional(r)+`[a-zA-Z_]\\w*`+t.optional(`<[^<>]+>`)+`)`,a={className:`type`,variants:[{begin:`\\b[a-z\\d_]*_t\\b`},{match:/\batomic_[a-z]{3,6}\b/}]},o={className:`string`,variants:[{begin:`(u8?|U|L)?"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]},{begin:`(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)`,end:`'`,illegal:`.`},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},s={className:`number`,variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},c={className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(o,{className:`string`}),{className:`string`,begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},l={className:`title`,begin:t.optional(r)+e.IDENT_RE,relevance:0},u=t.optional(r)+e.IDENT_RE+`\\s*\\(`,d={keyword:`asm.auto.break.case.continue.default.do.else.enum.extern.for.fortran.goto.if.inline.register.restrict.return.sizeof.typeof.typeof_unqual.struct.switch.typedef.union.volatile.while._Alignas._Alignof._Atomic._Generic._Noreturn._Static_assert._Thread_local.alignas.alignof.noreturn.static_assert.thread_local._Pragma`.split(`.`),type:`float.double.signed.unsigned.int.short.long.char.void._Bool._BitInt._Complex._Imaginary._Decimal32._Decimal64._Decimal96._Decimal128._Decimal64x._Decimal128x._Float16._Float32._Float64._Float128._Float32x._Float64x._Float128x.const.static.constexpr.complex.bool.imaginary`.split(`.`),literal:`true false NULL`,built_in:`std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr`},f=[c,a,n,e.C_BLOCK_COMMENT_MODE,s,o],p={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:`new throw return else`,end:/;/}],keywords:d,contains:f.concat([{begin:/\(/,end:/\)/,keywords:d,contains:f.concat([`self`]),relevance:0}]),relevance:0},m={begin:`(`+i+`[\\*&\\s]+)+`+u,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:d,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:`decltype\\(auto\\)`,keywords:d,relevance:0},{begin:u,returnBegin:!0,contains:[e.inherit(l,{className:`title.function`})],relevance:0},{relevance:0,match:/,/},{className:`params`,begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,o,s,a,{begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[`self`,n,e.C_BLOCK_COMMENT_MODE,o,s,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:`C`,aliases:[`h`],keywords:d,disableAutodetect:!0,illegal:`</`,contains:[].concat(p,m,f,[c,{begin:e.IDENT_RE+`::`,keywords:d},{className:`class`,beginKeywords:`enum class struct union`,end:/[{;:<>=]/,contains:[{beginKeywords:`final class struct`},e.TITLE_MODE]}]),exports:{preprocessor:c,strings:o,keywords:d}}}function rj(e){let t=e.regex,n=e.COMMENT(`//`,`$`,{contains:[{begin:/\\\n/}]}),r=`[a-zA-Z_]\\w*::`,i=`(?!struct)(decltype\\(auto\\)|`+t.optional(r)+`[a-zA-Z_]\\w*`+t.optional(`<[^<>]+>`)+`)`,a={className:`type`,begin:`\\b[a-z\\d_]*_t\\b`},o={className:`string`,variants:[{begin:`(u8?|U|L)?"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]},{begin:`(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)`,end:`'`,illegal:`.`},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},s={className:`number`,variants:[{begin:`[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)`},{begin:`[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)`}],relevance:0},c={className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(o,{className:`string`}),{className:`string`,begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},l={className:`title`,begin:t.optional(r)+e.IDENT_RE,relevance:0},u=t.optional(r)+e.IDENT_RE+`\\s*\\(`,d=`alignas.alignof.and.and_eq.asm.atomic_cancel.atomic_commit.atomic_noexcept.auto.bitand.bitor.break.case.catch.class.co_await.co_return.co_yield.compl.concept.const_cast|10.consteval.constexpr.constinit.continue.decltype.default.delete.do.dynamic_cast|10.else.enum.explicit.export.extern.false.final.for.friend.goto.if.import.inline.module.mutable.namespace.new.noexcept.not.not_eq.nullptr.operator.or.or_eq.override.private.protected.public.reflexpr.register.reinterpret_cast|10.requires.return.sizeof.static_assert.static_cast|10.struct.switch.synchronized.template.this.thread_local.throw.transaction_safe.transaction_safe_dynamic.true.try.typedef.typeid.typename.union.using.virtual.volatile.while.xor.xor_eq`.split(`.`),f=[`bool`,`char`,`char16_t`,`char32_t`,`char8_t`,`double`,`float`,`int`,`long`,`short`,`void`,`wchar_t`,`unsigned`,`signed`,`const`,`static`],p=`any.auto_ptr.barrier.binary_semaphore.bitset.complex.condition_variable.condition_variable_any.counting_semaphore.deque.false_type.flat_map.flat_set.future.imaginary.initializer_list.istringstream.jthread.latch.lock_guard.multimap.multiset.mutex.optional.ostringstream.packaged_task.pair.promise.priority_queue.queue.recursive_mutex.recursive_timed_mutex.scoped_lock.set.shared_future.shared_lock.shared_mutex.shared_timed_mutex.shared_ptr.stack.string_view.stringstream.timed_mutex.thread.true_type.tuple.unique_lock.unique_ptr.unordered_map.unordered_multimap.unordered_multiset.unordered_set.variant.vector.weak_ptr.wstring.wstring_view`.split(`.`),m=`abort.abs.acos.apply.as_const.asin.atan.atan2.calloc.ceil.cerr.cin.clog.cos.cosh.cout.declval.endl.exchange.exit.exp.fabs.floor.fmod.forward.fprintf.fputs.free.frexp.fscanf.future.invoke.isalnum.isalpha.iscntrl.isdigit.isgraph.islower.isprint.ispunct.isspace.isupper.isxdigit.labs.launder.ldexp.log.log10.make_pair.make_shared.make_shared_for_overwrite.make_tuple.make_unique.malloc.memchr.memcmp.memcpy.memset.modf.move.pow.printf.putchar.puts.realloc.scanf.sin.sinh.snprintf.sprintf.sqrt.sscanf.std.stderr.stdin.stdout.strcat.strchr.strcmp.strcpy.strcspn.strlen.strncat.strncmp.strncpy.strpbrk.strrchr.strspn.strstr.swap.tan.tanh.terminate.to_underlying.tolower.toupper.vfprintf.visit.vprintf.vsprintf`.split(`.`),h={type:f,keyword:d,literal:[`NULL`,`false`,`nullopt`,`nullptr`,`true`],built_in:[`_Pragma`],_type_hints:p},g={className:`function.dispatch`,relevance:0,keywords:{_hint:m},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},_=[g,c,a,n,e.C_BLOCK_COMMENT_MODE,s,o],v={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:`new throw return else`,end:/;/}],keywords:h,contains:_.concat([{begin:/\(/,end:/\)/,keywords:h,contains:_.concat([`self`]),relevance:0}]),relevance:0},y={className:`function`,begin:`(`+i+`[\\*&\\s]+)+`+u,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:`decltype\\(auto\\)`,keywords:h,relevance:0},{begin:u,returnBegin:!0,contains:[l],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[o,s]},{relevance:0,match:/,/},{className:`params`,begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,o,s,a,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[`self`,n,e.C_BLOCK_COMMENT_MODE,o,s,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:`C++`,aliases:[`cc`,`c++`,`h++`,`hpp`,`hh`,`hxx`,`cxx`],keywords:h,illegal:`</`,classNameAliases:{"function.dispatch":`built_in`},contains:[].concat(v,y,g,_,[c,{begin:`\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)`,end:`>`,keywords:h,contains:[`self`,a]},{begin:e.IDENT_RE+`::`,keywords:h},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:`keyword`,3:`title.class`}}])}}function ij(e){let t=[`bool`,`byte`,`char`,`decimal`,`delegate`,`double`,`dynamic`,`enum`,`float`,`int`,`long`,`nint`,`nuint`,`object`,`sbyte`,`short`,`string`,`ulong`,`uint`,`ushort`],n=[`public`,`private`,`protected`,`static`,`internal`,`protected`,`abstract`,`async`,`extern`,`override`,`unsafe`,`virtual`,`new`,`sealed`,`partial`],r={keyword:`abstract.as.base.break.case.catch.class.const.continue.do.else.event.explicit.extern.finally.fixed.for.foreach.goto.if.implicit.in.interface.internal.is.lock.namespace.new.operator.out.override.params.private.protected.public.readonly.record.ref.return.scoped.sealed.sizeof.stackalloc.static.struct.switch.this.throw.try.typeof.unchecked.unsafe.using.virtual.void.volatile.while`.split(`.`).concat(`add.alias.and.ascending.args.async.await.by.descending.dynamic.equals.file.from.get.global.group.init.into.join.let.nameof.not.notnull.on.or.orderby.partial.record.remove.required.scoped.select.set.unmanaged.value|0.var.when.where.with.yield`.split(`.`)),built_in:t,literal:[`default`,`false`,`null`,`true`]},i=e.inherit(e.TITLE_MODE,{begin:`[a-zA-Z](\\.?\\w)*`}),a={className:`number`,variants:[{begin:`\\b(0b[01']+)`},{begin:`(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)`},{begin:`(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)`}],relevance:0},o={className:`string`,begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},s={className:`string`,begin:`@"`,end:`"`,contains:[{begin:`""`}]},c=e.inherit(s,{illegal:/\n/}),l={className:`subst`,begin:/\{/,end:/\}/,keywords:r},u=e.inherit(l,{illegal:/\n/}),d={className:`string`,begin:/\$"/,end:`"`,illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,u]},f={className:`string`,begin:/\$@"/,end:`"`,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:`""`},l]},p=e.inherit(f,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:`""`},u]});l.contains=[f,d,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.C_BLOCK_COMMENT_MODE],u.contains=[p,d,c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let m={variants:[o,f,d,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h={begin:`<`,end:`>`,contains:[{beginKeywords:`in out`},i]},g=e.IDENT_RE+`(<`+e.IDENT_RE+`(\\s*,\\s*`+e.IDENT_RE+`)*>)?(\\[\\])?`,_={begin:`@`+e.IDENT_RE,relevance:0};return{name:`C#`,aliases:[`cs`,`c#`],keywords:r,illegal:/::/,contains:[e.COMMENT(`///`,`$`,{returnBegin:!0,contains:[{className:`doctag`,variants:[{begin:`///`,relevance:0},{begin:`<!--|-->`},{begin:`</?`,end:`>`}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:`meta`,begin:`#`,end:`$`,keywords:{keyword:`if else elif endif define undef warning error line region endregion pragma checksum`}},m,a,{beginKeywords:`class interface`,relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:`where class`},i,h,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:`namespace`,relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[i,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:`record`,relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[i,h,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:`meta`,begin:`^\\s*\\[(?=[\\w])`,excludeBegin:!0,end:`\\]`,excludeEnd:!0,contains:[{className:`string`,begin:/"/,end:/"/}]},{beginKeywords:`new return throw await else`,relevance:0},{className:`function`,begin:`(`+g+`\\s+)+`+e.IDENT_RE+`\\s*(<[^=]+>\\s*)?\\(`,returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:r,contains:[{beginKeywords:n.join(` `),relevance:0},{begin:e.IDENT_RE+`\\s*(<[^=]+>\\s*)?\\(`,returnBegin:!0,contains:[e.TITLE_MODE,h],relevance:0},{match:/\(\)/},{className:`params`,begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,relevance:0,contains:[m,a,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}var aj=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),oj=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),sj=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),cj=[...oj,...sj],lj=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),uj=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),dj=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),fj=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function pj(e){let t=e.regex,n=aj(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i=/@-?\w[\w]*(-\w+)*/,a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:`CSS`,case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:`from to`},classNameAliases:{keyframePosition:`selector-tag`},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:`selector-id`,begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:`selector-class`,begin:`\\.[a-zA-Z-][a-zA-Z0-9_-]*`,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,variants:[{begin:`:(`+uj.join(`|`)+`)`},{begin:`:(:)?(`+dj.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+fj.join(`|`)+`)\\b`},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:`url data-uri`},contains:[...a,{className:`string`,begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:`[{;]`,relevance:0,illegal:/:/,contains:[{className:`keyword`,begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:lj.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+cj.join(`|`)+`)\\b`}]}}function mj(e){let t=e.regex;return{name:`Diff`,aliases:[`patch`],contains:[{className:`meta`,relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:`comment`,variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:`addition`,begin:/^\+/,end:/$/},{className:`deletion`,begin:/^-/,end:/$/},{className:`addition`,begin:/^!/,end:/$/}]}}function hj(e){let t={keyword:[`break`,`case`,`chan`,`const`,`continue`,`default`,`defer`,`else`,`fallthrough`,`for`,`func`,`go`,`goto`,`if`,`import`,`interface`,`map`,`package`,`range`,`return`,`select`,`struct`,`switch`,`type`,`var`],type:[`bool`,`byte`,`complex64`,`complex128`,`error`,`float32`,`float64`,`int8`,`int16`,`int32`,`int64`,`string`,`uint8`,`uint16`,`uint32`,`uint64`,`int`,`uint`,`uintptr`,`rune`],literal:[`true`,`false`,`iota`,`nil`],built_in:[`append`,`cap`,`close`,`complex`,`copy`,`imag`,`len`,`make`,`new`,`panic`,`print`,`println`,`real`,`recover`,`delete`]};return{name:`Go`,aliases:[`golang`],keywords:t,illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:`string`,variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:`number`,variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:`function`,beginKeywords:`func`,end:`\\s*(\\{|$)`,excludeEnd:!0,contains:[e.TITLE_MODE,{className:`params`,begin:/\(/,end:/\)/,endsParent:!0,keywords:t,illegal:/["']/}]}]}}function gj(e){let t=e.regex;return{name:`GraphQL`,aliases:[`gql`],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:[`query`,`mutation`,`subscription`,`type`,`input`,`schema`,`directive`,`interface`,`union`,`scalar`,`fragment`,`enum`,`on`],literal:[`true`,`false`,`null`]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:`punctuation`,match:/[.]{3}/,relevance:0},{scope:`punctuation`,begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:`variable`,begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:`meta`,match:/@\w+/,excludeEnd:!0},{scope:`symbol`,begin:t.concat(/[_A-Za-z][_0-9A-Za-z]*/,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function _j(e){let t=e.regex,n={className:`number`,relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let i={className:`variable`,variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},a={className:`literal`,begin:/\bon|off|true|false|yes|no\b/},o={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:`'''`,end:`'''`,relevance:10},{begin:`"""`,end:`"""`,relevance:10},{begin:`"`,end:`"`},{begin:`'`,end:`'`}]},s={begin:/\[/,end:/\]/,contains:[r,a,i,o,n,`self`],relevance:0},c=t.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:`TOML, also INI`,aliases:[`toml`],case_insensitive:!0,illegal:/\S/,contains:[r,{className:`section`,begin:/\[+/,end:/\]+/},{begin:t.concat(c,`(\\s*\\.\\s*`,c,`)*`,t.lookahead(/\s*=\s*[^#\s]/)),className:`attr`,starts:{end:/$/,contains:[r,s,a,i,o,n]}}]}}var vj=`[0-9](_*[0-9])*`,yj=`\\.(${vj})`,bj=`[0-9a-fA-F](_*[0-9a-fA-F])*`,xj={className:`number`,variants:[{begin:`(\\b(${vj})((${yj})|\\.)?|(${yj}))[eE][+-]?(${vj})[fFdD]?\\b`},{begin:`\\b(${vj})((${yj})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${yj})[fFdD]?\\b`},{begin:`\\b(${vj})[fFdD]\\b`},{begin:`\\b0[xX]((${bj})\\.?|(${bj})?\\.(${bj}))[pP][+-]?(${vj})[fFdD]?\\b`},{begin:`\\b(0|[1-9](_*[0-9])*)[lL]?\\b`},{begin:`\\b0[xX](${bj})[lL]?\\b`},{begin:`\\b0(_*[0-7])*[lL]?\\b`},{begin:`\\b0[bB][01](_*[01])*[lL]?\\b`}],relevance:0};function Sj(e,t,n){return n===-1?``:e.replace(t,r=>Sj(e,t,n-1))}function Cj(e){let t=e.regex,n=`[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*`,r=n+Sj(`(?:<`+n+`~~~(?:\\s*,\\s*`+n+`~~~)*>)?`,/~~~/g,2),i={keyword:`synchronized.abstract.private.var.static.if.const .for.while.strictfp.finally.protected.import.native.final.void.enum.else.break.transient.catch.instanceof.volatile.case.assert.package.default.public.try.switch.continue.throws.protected.public.private.module.requires.exports.do.sealed.yield.permits.goto.when`.split(`.`),literal:[`false`,`true`,`null`],type:[`char`,`boolean`,`long`,`float`,`int`,`byte`,`short`,`double`],built_in:[`super`,`this`]},a={className:`meta`,begin:`@`+n,contains:[{begin:/\(/,end:/\)/,contains:[`self`]}]},o={className:`params`,begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:`Java`,aliases:[`jsp`],keywords:i,illegal:/<\/|#/,contains:[e.COMMENT(`/\\*\\*`,`\\*/`,{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:`doctag`,begin:`@[A-Za-z]+`}]}),{begin:/import java\.[a-z]+\./,keywords:`import`,relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:`string`,contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:`keyword`,3:`title.class`}},{match:/non-sealed/,scope:`keyword`},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:`type`,3:`variable`,5:`operator`}},{begin:[/record/,/\s+/,n],className:{1:`keyword`,3:`title.class`},contains:[o,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:`new throw return else`,relevance:0},{begin:[`(?:`+r+`\\s+)`,e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:`title.function`},keywords:i,contains:[{className:`params`,begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[a,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,xj,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},xj,a]}}var wj=`[A-Za-z$_][0-9A-Za-z$_]*`,Tj=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),Ej=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],Dj=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),Oj=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],kj=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],Aj=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],jj=[].concat(kj,Dj,Oj);function aee(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=wj,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:wj,keyword:Tj,literal:Ej,built_in:jj,"variable.language":Aj},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...Dj,...Oj]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...kj,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function oee(e){let t={className:`attr`,begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}var Mj=`[0-9](_*[0-9])*`,Nj=`\\.(${Mj})`,Pj=`[0-9a-fA-F](_*[0-9a-fA-F])*`,see={className:`number`,variants:[{begin:`(\\b(${Mj})((${Nj})|\\.)?|(${Nj}))[eE][+-]?(${Mj})[fFdD]?\\b`},{begin:`\\b(${Mj})((${Nj})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Nj})[fFdD]?\\b`},{begin:`\\b(${Mj})[fFdD]\\b`},{begin:`\\b0[xX]((${Pj})\\.?|(${Pj})?\\.(${Pj}))[pP][+-]?(${Mj})[fFdD]?\\b`},{begin:`\\b(0|[1-9](_*[0-9])*)[lL]?\\b`},{begin:`\\b0[xX](${Pj})[lL]?\\b`},{begin:`\\b0(_*[0-7])*[lL]?\\b`},{begin:`\\b0[bB][01](_*[01])*[lL]?\\b`}],relevance:0};function cee(e){let t={keyword:`abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual`,built_in:`Byte Short Char Int Long Boolean Float Double Void Unit Nothing`,literal:`true false null`},n={className:`keyword`,begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:`symbol`,begin:/@\w+/}]}},r={className:`symbol`,begin:e.UNDERSCORE_IDENT_RE+`@`},i={className:`subst`,begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},a={className:`variable`,begin:`\\$`+e.UNDERSCORE_IDENT_RE},o={className:`string`,variants:[{begin:`"""`,end:`"""(?=[^"])`,contains:[a,i]},{begin:`'`,end:`'`,illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:`"`,end:`"`,illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,a,i]}]};i.contains.push(o);let s={className:`meta`,begin:`@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*`+e.UNDERSCORE_IDENT_RE+`)?`},c={className:`meta`,begin:`@`+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:`string`}),`self`]}]},l=see,u=e.COMMENT(`/\\*`,`\\*/`,{contains:[e.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:`type`,begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},f=d;return f.variants[1].contains=[d],d.variants[1].contains=[f],{name:`Kotlin`,aliases:[`kt`,`kts`],keywords:t,contains:[e.COMMENT(`/\\*\\*`,`\\*/`,{relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`}]}),e.C_LINE_COMMENT_MODE,u,n,r,s,c,{className:`function`,beginKeywords:`fun`,end:`[(]|$`,returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+`\\s*\\(`,returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:`type`,begin:/</,end:/>/,keywords:`reified`,relevance:0},{className:`params`,begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,e.C_LINE_COMMENT_MODE,u],relevance:0},e.C_LINE_COMMENT_MODE,u,s,c,o,e.C_NUMBER_MODE]},u]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:`title.class`},keywords:`class interface trait`,end:/[:\{(]|$/,excludeEnd:!0,illegal:`extends implements`,contains:[{beginKeywords:`public protected internal private constructor`},e.UNDERSCORE_TITLE_MODE,{className:`type`,begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},s,c]},o,{className:`meta`,begin:`^#!/usr/bin/env`,end:`$`,illegal:`
|
|
196
|
+
`},l]}}var lee=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),uee=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),dee=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),fee=[...uee,...dee],pee=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),Fj=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),Ij=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),mee=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse(),hee=Fj.concat(Ij).sort().reverse();function Lj(e){let t=lee(e),n=hee,r=`([\\w-]+|@\\{[\\w-]+\\})`,i=[],a=[],o=function(e){return{className:`string`,begin:`~?`+e+`.*?`+e}},s=function(e,t,n){return{className:e,begin:t,relevance:n}},c={$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:pee.join(` `)},l={begin:`\\(`,end:`\\)`,contains:a,keywords:c,relevance:0};a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,o(`'`),o(`"`),t.CSS_NUMBER_MODE,{begin:`(url|data-uri)\\(`,starts:{className:`string`,end:`[\\)\\n]`,excludeEnd:!0}},t.HEXCOLOR,l,s(`variable`,`@@?[\\w-]+`,10),s(`variable`,`@\\{[\\w-]+\\}`),s(`built_in`,"~?`[^`]*?`"),{className:`attribute`,begin:`[\\w-]+\\s*:`,end:`:`,returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:`and not`},t.FUNCTION_DISPATCH);let u=a.concat({begin:/\{/,end:/\}/,contains:i}),d={beginKeywords:`when`,endsWithParent:!0,contains:[{beginKeywords:`and not`}].concat(a)},f={begin:r+`\\s*:`,returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+mee.join(`|`)+`)\\b`,end:/(?=:)/,starts:{endsWithParent:!0,illegal:`[<=$]`,relevance:0,contains:a}}]},p={className:`keyword`,begin:`@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b`,starts:{end:`[;{}]`,keywords:c,returnEnd:!0,contains:a,relevance:0}},m={className:`variable`,variants:[{begin:`@[\\w-]+\\s*:`,relevance:15},{begin:`@[\\w-]+`}],starts:{end:`[;}]`,returnEnd:!0,contains:u}},h={variants:[{begin:`[\\.#:&\\[>]`,end:`[;{}]`},{begin:r,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,d,s(`keyword`,`all\\b`),s(`variable`,`@\\{[\\w-]+\\}`),{begin:`\\b(`+fee.join(`|`)+`)\\b`,className:`selector-tag`},t.CSS_NUMBER_MODE,s(`selector-tag`,r,0),s(`selector-id`,`#`+r),s(`selector-class`,`\\.`+r,0),s(`selector-tag`,`&`,0),t.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,begin:`:(`+Fj.join(`|`)+`)`},{className:`selector-pseudo`,begin:`:(:)?(`+Ij.join(`|`)+`)`},{begin:/\(/,end:/\)/,relevance:0,contains:u},{begin:`!important`},t.FUNCTION_DISPATCH]},g={begin:`[\\w-]+:(:)?(${n.join(`|`)})`,returnBegin:!0,contains:[h]};return i.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,m,g,f,h,d,t.FUNCTION_DISPATCH),{name:`Less`,case_insensitive:!0,illegal:`[=>'/<($"]`,contains:i}}function Rj(e){let t=`\\[=*\\[`,n=`\\]=*\\]`,r={begin:t,end:n,contains:[`self`]},i=[e.COMMENT(`--(?!\\[=*\\[)`,`$`),e.COMMENT(`--\\[=*\\[`,n,{contains:[r],relevance:10})];return{name:`Lua`,aliases:[`pluto`],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:`true false nil`,keyword:`and break do else elseif end for goto if in local not or repeat return then until while`,built_in:`_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove`},contains:i.concat([{className:`function`,beginKeywords:`function`,end:`\\)`,contains:[e.inherit(e.TITLE_MODE,{begin:`([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*`}),{className:`params`,begin:`\\(`,endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:`string`,begin:t,end:n,contains:[r],relevance:5}])}}function zj(e){let t={className:`variable`,variants:[{begin:`\\$\\(`+e.UNDERSCORE_IDENT_RE+`\\)`,contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={className:`variable`,begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:`subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value`},contains:[t,n]},i={begin:`^`+e.UNDERSCORE_IDENT_RE+`\\s*(?=[:+?]?=)`},a={className:`meta`,begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:`.PHONY`}},o={className:`section`,begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:`Makefile`,aliases:[`mk`,`mak`,`make`],keywords:{$pattern:/[\w-]+/,keyword:`define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath`},contains:[e.HASH_COMMENT_MODE,t,n,r,i,a,o]}}function Bj(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={begin:`^[-\\*]{3,}`,end:`$`},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:`string`,relevance:0,begin:`\\[`,end:`\\]`,excludeBegin:!0,returnEnd:!0},{className:`link`,relevance:0,begin:`\\]\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0},{className:`symbol`,relevance:0,begin:`\\]\\[`,end:`\\]`,excludeBegin:!0,excludeEnd:!0}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,r,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Vj(e){let t={className:`built_in`,begin:`\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+`},n=/[a-zA-Z@][a-zA-Z0-9_]*/,r={"variable.language":[`this`,`super`],$pattern:n,keyword:`while.export.sizeof.typedef.const.struct.for.union.volatile.static.mutable.if.do.return.goto.enum.else.break.extern.asm.case.default.register.explicit.typename.switch.continue.inline.readonly.assign.readwrite.self.@synchronized.id.typeof.nonatomic.IBOutlet.IBAction.strong.weak.copy.in.out.inout.bycopy.byref.oneway.__strong.__weak.__block.__autoreleasing.@private.@protected.@public.@try.@property.@end.@throw.@catch.@finally.@autoreleasepool.@synthesize.@dynamic.@selector.@optional.@required.@encode.@package.@import.@defs.@compatibility_alias.__bridge.__bridge_transfer.__bridge_retained.__bridge_retain.__covariant.__contravariant.__kindof._Nonnull._Nullable._Null_unspecified.__FUNCTION__.__PRETTY_FUNCTION__.__attribute__.getter.setter.retain.unsafe_unretained.nonnull.nullable.null_unspecified.null_resettable.class.instancetype.NS_DESIGNATED_INITIALIZER.NS_UNAVAILABLE.NS_REQUIRES_SUPER.NS_RETURNS_INNER_POINTER.NS_INLINE.NS_AVAILABLE.NS_DEPRECATED.NS_ENUM.NS_OPTIONS.NS_SWIFT_UNAVAILABLE.NS_ASSUME_NONNULL_BEGIN.NS_ASSUME_NONNULL_END.NS_REFINED_FOR_SWIFT.NS_SWIFT_NAME.NS_SWIFT_NOTHROW.NS_DURING.NS_HANDLER.NS_ENDHANDLER.NS_VALUERETURN.NS_VOIDRETURN`.split(`.`),literal:[`false`,`true`,`FALSE`,`TRUE`,`nil`,`YES`,`NO`,`NULL`],built_in:[`dispatch_once_t`,`dispatch_queue_t`,`dispatch_sync`,`dispatch_async`,`dispatch_once`],type:[`int`,`float`,`char`,`unsigned`,`signed`,`short`,`long`,`double`,`wchar_t`,`unichar`,`void`,`bool`,`BOOL`,`id|0`,`_Bool`]},i={$pattern:n,keyword:[`@interface`,`@class`,`@protocol`,`@implementation`]};return{name:`Objective-C`,aliases:[`mm`,`objc`,`obj-c`,`obj-c++`,`objective-c++`],keywords:r,illegal:`</`,contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:`string`,variants:[{begin:`@"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]}]},{className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma ifdef ifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),{className:`string`,begin:/<.*?>/,end:/$/,illegal:`\\n`},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:`class`,begin:`(`+i.keyword.join(`|`)+`)\\b`,end:/(\{|$)/,excludeEnd:!0,keywords:i,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:`\\.`+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function Hj(e){let t=e.regex,n=`abs.accept.alarm.and.atan2.bind.binmode.bless.break.caller.chdir.chmod.chomp.chop.chown.chr.chroot.class.close.closedir.connect.continue.cos.crypt.dbmclose.dbmopen.defined.delete.die.do.dump.each.else.elsif.endgrent.endhostent.endnetent.endprotoent.endpwent.endservent.eof.eval.exec.exists.exit.exp.fcntl.field.fileno.flock.for.foreach.fork.format.formline.getc.getgrent.getgrgid.getgrnam.gethostbyaddr.gethostbyname.gethostent.getlogin.getnetbyaddr.getnetbyname.getnetent.getpeername.getpgrp.getpriority.getprotobyname.getprotobynumber.getprotoent.getpwent.getpwnam.getpwuid.getservbyname.getservbyport.getservent.getsockname.getsockopt.given.glob.gmtime.goto.grep.gt.hex.if.index.int.ioctl.join.keys.kill.last.lc.lcfirst.length.link.listen.local.localtime.log.lstat.lt.ma.map.method.mkdir.msgctl.msgget.msgrcv.msgsnd.my.ne.next.no.not.oct.open.opendir.or.ord.our.pack.package.pipe.pop.pos.print.printf.prototype.push.q|0.qq.quotemeta.qw.qx.rand.read.readdir.readline.readlink.readpipe.recv.redo.ref.rename.require.reset.return.reverse.rewinddir.rindex.rmdir.say.scalar.seek.seekdir.select.semctl.semget.semop.send.setgrent.sethostent.setnetent.setpgrp.setpriority.setprotoent.setpwent.setservent.setsockopt.shift.shmctl.shmget.shmread.shmwrite.shutdown.sin.sleep.socket.socketpair.sort.splice.split.sprintf.sqrt.srand.stat.state.study.sub.substr.symlink.syscall.sysopen.sysread.sysseek.system.syswrite.tell.telldir.tie.tied.time.times.tr.truncate.uc.ucfirst.umask.undef.unless.unlink.unpack.unshift.untie.until.use.utime.values.vec.wait.waitpid.wantarray.warn.when.while.write.x|0.xor.y|0`.split(`.`),r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(` `)},a={className:`subst`,begin:`[$@]\\{`,end:`\\}`,keywords:i},o={begin:/->\{/,end:/\}/},s={scope:`attr`,match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:`variable`,variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,`(?![A-Za-z])(?![@$%])`)},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[s]},l={className:`number`,variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},u=[e.BACKSLASH_ESCAPE,a,c],d=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(e,n,i=`\\1`)=>{let a=i===`\\1`?i:t.concat(i,n);return t.concat(t.concat(`(?:`,e,`)`),n,/(?:\\.|[^\\\/])*?/,a,/(?:\\.|[^\\\/])*?/,i,r)},p=(e,n,i)=>t.concat(t.concat(`(?:`,e,`)`),n,/(?:\\.|[^\\\/])*?/,i,r),m=[c,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:`string`,contains:u,variants:[{begin:`q[qwxr]?\\s*\\(`,end:`\\)`,relevance:5},{begin:`q[qwxr]?\\s*\\[`,end:`\\]`,relevance:5},{begin:`q[qwxr]?\\s*\\{`,end:`\\}`,relevance:5},{begin:`q[qwxr]?\\s*\\|`,end:`\\|`,relevance:5},{begin:`q[qwxr]?\\s*<`,end:`>`,relevance:5},{begin:`qw\\s+q`,end:`q`,relevance:5},{begin:`'`,end:`'`,contains:[e.BACKSLASH_ESCAPE]},{begin:`"`,end:`"`},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:`-?\\w+\\s*=>`,relevance:0}]},l,{begin:`(\\/\\/|`+e.RE_STARTERS_RE+`|\\b(split|return|print|reverse|grep)\\b)\\s*`,keywords:`split return print reverse grep`,relevance:0,contains:[e.HASH_COMMENT_MODE,{className:`regexp`,variants:[{begin:f(`s|tr|y`,t.either(...d,{capture:!0}))},{begin:f(`s|tr|y`,`\\(`,`\\)`)},{begin:f(`s|tr|y`,`\\[`,`\\]`)},{begin:f(`s|tr|y`,`\\{`,`\\}`)}],relevance:2},{className:`regexp`,variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p(`(?:m|qr)?`,/\//,/\//)},{begin:p(`m|qr`,t.either(...d,{capture:!0}),/\1/)},{begin:p(`m|qr`,/\(/,/\)/)},{begin:p(`m|qr`,/\[/,/\]/)},{begin:p(`m|qr`,/\{/,/\}/)}]}]},{className:`function`,beginKeywords:`sub method`,end:`(\\s*\\(.*?\\))?[;{]`,excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s]},{className:`class`,beginKeywords:`class`,end:`[;{]`,excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s,l]},{begin:`-\\w\\b`,relevance:0},{begin:`^__DATA__$`,end:`^__END__$`,subLanguage:`mojolicious`,contains:[{begin:`^@@.*`,end:`$`,className:`comment`}]}];return a.contains=m,o.contains=m,{name:`Perl`,aliases:[`pl`,`pm`],keywords:i,contains:m}}function Uj(e){let t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),a=t.concat(/[A-Z]+/,n),o={scope:`variable`,match:`\\$+`+r},s={scope:`meta`,variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:`subst`,variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=e.inherit(e.APOS_STRING_MODE,{illegal:null}),u=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),d={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(e,t)=>{t.data._beginMatch=e[1]||e[2]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}},f=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[
|
|
197
|
+
]`,m={scope:`string`,variants:[u,l,d,f]},h={scope:`number`,variants:[{begin:`\\b0[bB][01]+(?:_[01]+)*\\b`},{begin:`\\b0[oO][0-7]+(?:_[0-7]+)*\\b`},{begin:`\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b`},{begin:`(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?`}],relevance:0},g=[`false`,`null`,`true`],_=`__CLASS__.__DIR__.__FILE__.__FUNCTION__.__COMPILER_HALT_OFFSET__.__LINE__.__METHOD__.__NAMESPACE__.__TRAIT__.die.echo.exit.include.include_once.print.require.require_once.array.abstract.and.as.binary.bool.boolean.break.callable.case.catch.class.clone.const.continue.declare.default.do.double.else.elseif.empty.enddeclare.endfor.endforeach.endif.endswitch.endwhile.enum.eval.extends.final.finally.float.for.foreach.from.global.goto.if.implements.instanceof.insteadof.int.integer.interface.isset.iterable.list.match|0.mixed.new.never.object.or.private.protected.public.readonly.real.return.string.switch.throw.trait.try.unset.use.var.void.while.xor.yield`.split(`.`),v=`Error|0.AppendIterator.ArgumentCountError.ArithmeticError.ArrayIterator.ArrayObject.AssertionError.BadFunctionCallException.BadMethodCallException.CachingIterator.CallbackFilterIterator.CompileError.Countable.DirectoryIterator.DivisionByZeroError.DomainException.EmptyIterator.ErrorException.Exception.FilesystemIterator.FilterIterator.GlobIterator.InfiniteIterator.InvalidArgumentException.IteratorIterator.LengthException.LimitIterator.LogicException.MultipleIterator.NoRewindIterator.OutOfBoundsException.OutOfRangeException.OuterIterator.OverflowException.ParentIterator.ParseError.RangeException.RecursiveArrayIterator.RecursiveCachingIterator.RecursiveCallbackFilterIterator.RecursiveDirectoryIterator.RecursiveFilterIterator.RecursiveIterator.RecursiveIteratorIterator.RecursiveRegexIterator.RecursiveTreeIterator.RegexIterator.RuntimeException.SeekableIterator.SplDoublyLinkedList.SplFileInfo.SplFileObject.SplFixedArray.SplHeap.SplMaxHeap.SplMinHeap.SplObjectStorage.SplObserver.SplPriorityQueue.SplQueue.SplStack.SplSubject.SplTempFileObject.TypeError.UnderflowException.UnexpectedValueException.UnhandledMatchError.ArrayAccess.BackedEnum.Closure.Fiber.Generator.Iterator.IteratorAggregate.Serializable.Stringable.Throwable.Traversable.UnitEnum.WeakReference.WeakMap.Directory.__PHP_Incomplete_Class.parent.php_user_filter.self.static.stdClass`.split(`.`),y={keyword:_,literal:(e=>{let t=[];return e.forEach(e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())}),t})(g),built_in:v},b=e=>e.map(e=>e.replace(/\|\d+$/,``)),x={variants:[{match:[/new/,t.concat(p,`+`),t.concat(`(?!`,b(v).join(`\\b|`),`\\b)`),i],scope:{1:`keyword`,4:`title.class`}}]},S=t.concat(r,`\\b(?!\\()`),C={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{2:`variable.constant`}},{match:[/::/,/class/],scope:{2:`variable.language`}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{1:`title.class`,3:`variable.constant`}},{match:[i,t.concat(`::`,t.lookahead(/(?!class\b)/))],scope:{1:`title.class`}},{match:[i,/::/,/class/],scope:{1:`title.class`,3:`variable.language`}}]},w={scope:`attr`,match:t.concat(r,t.lookahead(`:`),t.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:y,contains:[w,o,C,e.C_BLOCK_COMMENT_MODE,m,h,x]},E={relevance:0,match:[/\b/,t.concat(`(?!fn\\b|function\\b|`,b(_).join(`\\b|`),`|`,b(v).join(`\\b|`),`\\b)`),r,t.concat(p,`*`),t.lookahead(/(?=\()/)],scope:{3:`title.function.invoke`},contains:[T]};T.contains.push(E);let D=[w,C,e.C_BLOCK_COMMENT_MODE,m,h,x],O={begin:t.concat(/#\[\s*\\?/,t.either(i,a)),beginScope:`meta`,end:/]/,endScope:`meta`,keywords:{literal:g,keyword:[`new`,`array`]},contains:[{begin:/\[/,end:/]/,keywords:{literal:g,keyword:[`new`,`array`]},contains:[`self`,...D]},...D,{scope:`meta`,variants:[{match:i},{match:a}]}]};return{case_insensitive:!1,keywords:y,contains:[O,e.HASH_COMMENT_MODE,e.COMMENT(`//`,`$`),e.COMMENT(`/\\*`,`\\*/`,{contains:[{scope:`doctag`,match:`@[A-Za-z]+`}]}),{match:/__halt_compiler\(\);/,keywords:`__halt_compiler`,starts:{scope:`comment`,end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:`meta`,endsParent:!0}]}},s,{scope:`variable.language`,match:/\$this\b/},o,E,C,{match:[/const/,/\s/,r],scope:{1:`keyword`,3:`variable.constant`}},x,{scope:`function`,relevance:0,beginKeywords:`fn function`,end:/[;{]/,excludeEnd:!0,illegal:`[$%\\[]`,contains:[{beginKeywords:`use`},e.UNDERSCORE_TITLE_MODE,{begin:`=>`,endsParent:!0},{scope:`params`,begin:`\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0,keywords:y,contains:[`self`,O,o,C,e.C_BLOCK_COMMENT_MODE,m,h]}]},{scope:`class`,variants:[{beginKeywords:`enum`,illegal:/[($"]/},{beginKeywords:`class interface trait`,illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:`extends implements`},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:`namespace`,relevance:0,end:`;`,illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:`title.class`})]},{beginKeywords:`use`,relevance:0,end:`;`,contains:[{match:/\b(as|const|function)\b/,scope:`keyword`},e.UNDERSCORE_TITLE_MODE]},m,h]}}function Wj(e){return{name:`PHP template`,subLanguage:`xml`,contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:`php`,contains:[{begin:`/\\*`,end:`\\*/`,skip:!0},{begin:`b"`,end:`"`,skip:!0},{begin:`b'`,end:`'`,skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function Gj(e){return{name:`Plain text`,aliases:[`text`,`txt`],disableAutodetect:!0}}function Kj(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function qj(e){return{aliases:[`pycon`],contains:[{className:`meta.prompt`,starts:{end:/ |$/,starts:{end:`$`,subLanguage:`python`}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function Jj(e){let t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,a=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:`R`,keywords:{$pattern:n,keyword:`function if in break next repeat else for while`,literal:`NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10`,built_in:`LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm`},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:`doctag`,match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:`doctag`,begin:`@param`,end:/$/,contains:[{scope:`variable`,variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:`doctag`,match:/@[a-zA-Z]+/},{scope:`keyword`,match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:`"`,end:`"`,relevance:0},{begin:`'`,end:`'`,relevance:0}]},{relevance:0,variants:[{scope:{1:`operator`,2:`number`},match:[i,r]},{scope:{1:`operator`,2:`number`},match:[/%[^%]*%/,r]},{scope:{1:`punctuation`,2:`number`},match:[a,r]},{scope:{2:`number`},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:`operator`},match:[n,/\s+/,/<-/,/\s+/]},{scope:`operator`,relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:`punctuation`,relevance:0,match:a},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function Yj(e){let t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),a={"variable.constant":[`__FILE__`,`__LINE__`,`__ENCODING__`],"variable.language":[`self`,`super`],keyword:`alias.and.begin.BEGIN.break.case.class.defined.do.else.elsif.end.END.ensure.for.if.in.module.next.not.or.redo.require.rescue.retry.return.then.undef.unless.until.when.while.yield.include.extend.prepend.public.private.protected.raise.throw`.split(`.`),built_in:[`proc`,`lambda`,`attr_accessor`,`attr_reader`,`attr_writer`,`define_method`,`private_constant`,`module_function`],literal:[`true`,`false`,`nil`]},o={className:`doctag`,begin:`@[A-Za-z]+`},s={begin:`#<`,end:`>`},c=[e.COMMENT(`#`,`$`,{contains:[o]}),e.COMMENT(`^=begin`,`^=end`,{contains:[o],relevance:10}),e.COMMENT(`^__END__`,e.MATCH_NOTHING_RE)],l={className:`subst`,begin:/#\{/,end:/\}/,keywords:a},u={className:`string`,contains:[e.BACKSLASH_ESCAPE,l],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,l]})]}]},d=`[0-9](_?[0-9])*`,f={className:`number`,relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${d}))?([eE][+-]?(${d})|r)?i?\\b`},{begin:`\\b0[dD][0-9](_?[0-9])*r?i?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*r?i?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*r?i?\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b`},{begin:`\\b0(_?[0-7])+r?i?\\b`}]},p={variants:[{match:/\(\)/},{className:`params`,begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},m=[u,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:`title.class`,4:`title.class.inherited`},keywords:a},{match:[/(include|extend)\s+/,i],scope:{2:`title.class`},keywords:a},{relevance:0,match:[i,/\.new[. (]/],scope:{1:`title.class`}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`},{relevance:0,match:r,scope:`title.class`},{match:[/def/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[p]},{begin:e.IDENT_RE+`::`},{className:`symbol`,begin:e.UNDERSCORE_IDENT_RE+`(!|\\?)?:`,relevance:0},{className:`symbol`,begin:`:(?!\\s)`,contains:[u,{begin:n}],relevance:0},f,{className:`variable`,begin:`(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])`},{className:`params`,begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:`(`+e.RE_STARTERS_RE+`|unless)\\s*`,keywords:`unless`,contains:[{className:`regexp`,contains:[e.BACKSLASH_ESCAPE,l],illegal:/\n/,variants:[{begin:`/`,end:`/[a-z]*`},{begin:/%r\{/,end:/\}[a-z]*/},{begin:`%r\\(`,end:`\\)[a-z]*`},{begin:`%r!`,end:`![a-z]*`},{begin:`%r\\[`,end:`\\][a-z]*`}]}].concat(s,c),relevance:0}].concat(s,c);l.contains=m,p.contains=m;let h=[{begin:/^\s*=>/,starts:{end:`$`,contains:m}},{className:`meta.prompt`,begin:`^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])`,starts:{end:`$`,keywords:a,contains:m}}];return c.unshift(s),{name:`Ruby`,aliases:[`rb`,`gemspec`,`podspec`,`thor`,`irb`],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:`ruby`})].concat(h,c,m)}}function Xj(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),a={className:`title.function.invoke`,relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},o=`([ui](8|16|32|64|128|size)|f(32|64))?`,s=`abstract.as.async.await.become.box.break.const.continue.crate.do.dyn.else.enum.extern.false.final.fn.for.if.impl.in.let.loop.macro.match.mod.move.mut.override.priv.pub.ref.return.self.Self.static.struct.super.trait.true.try.type.typeof.union.unsafe.unsized.use.virtual.where.while.yield`.split(`.`),c=[`true`,`false`,`Some`,`None`,`Ok`,`Err`],l=`drop .Copy.Send.Sized.Sync.Drop.Fn.FnMut.FnOnce.ToOwned.Clone.Debug.PartialEq.PartialOrd.Eq.Ord.AsRef.AsMut.Into.From.Default.Iterator.Extend.IntoIterator.DoubleEndedIterator.ExactSizeIterator.SliceConcatExt.ToString.assert!.assert_eq!.bitflags!.bytes!.cfg!.col!.concat!.concat_idents!.debug_assert!.debug_assert_eq!.env!.eprintln!.panic!.file!.format!.format_args!.include_bytes!.include_str!.line!.local_data_key!.module_path!.option_env!.print!.println!.select!.stringify!.try!.unimplemented!.unreachable!.vec!.write!.writeln!.macro_rules!.assert_ne!.debug_assert_ne!`.split(`.`),u=[`i8`,`i16`,`i32`,`i64`,`i128`,`isize`,`u8`,`u16`,`u32`,`u64`,`u128`,`usize`,`f32`,`f64`,`str`,`char`,`bool`,`Box`,`Option`,`Result`,`String`,`Vec`];return{name:`Rust`,aliases:[`rs`],keywords:{$pattern:e.IDENT_RE+`!?`,type:u,keyword:s,literal:c,built_in:l},illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:`symbol`,begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:`string`,variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:`char.escape`,match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:`number`,variants:[{begin:`\\b0b([01_]+)`+o},{begin:`\\b0o([0-7_]+)`+o},{begin:`\\b0x([A-Fa-f0-9_]+)`+o},{begin:`\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)`+o}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:`keyword`,3:`title.function`}},{className:`meta`,begin:`#!?\\[`,end:`\\]`,contains:[{className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:`keyword`,3:`keyword`,4:`variable`}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:`keyword`,3:`variable`,5:`keyword`}},{begin:[/type/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:e.IDENT_RE+`::`,keywords:{keyword:`Self`,built_in:l,type:u}},{className:`punctuation`,begin:`->`},a]}}var Zj=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Qj=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),$j=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),eM=[...Qj,...$j],tM=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),nM=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),rM=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),iM=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function aM(e){let t=Zj(e),n=rM,r=nM,i=`@[a-z-]+`,a={className:`variable`,begin:`(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b`,relevance:0};return{name:`SCSS`,case_insensitive:!0,illegal:`[=/|']`,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:`selector-id`,begin:`#[A-Za-z0-9_-]+`,relevance:0},{className:`selector-class`,begin:`\\.[A-Za-z0-9_-]+`,relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:`selector-tag`,begin:`\\b(`+eM.join(`|`)+`)\\b`,relevance:0},{className:`selector-pseudo`,begin:`:(`+r.join(`|`)+`)`},{className:`selector-pseudo`,begin:`:(:)?(`+n.join(`|`)+`)`},a,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+iM.join(`|`)+`)\\b`},{begin:`\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b`},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,a,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:`@(page|font-face)`,keywords:{$pattern:i,keyword:`@page @font-face`}},{begin:`@`,end:`[{;]`,returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:tM.join(` `)},contains:[{begin:i,className:`keyword`},{begin:/[a-z-]+(?=:)/,className:`attribute`},a,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function oM(e){return{name:`Shell Session`,aliases:[`console`,`shellsession`],contains:[{className:`meta.prompt`,begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:`bash`}}]}}function sM(e){let t=e.regex,n=e.COMMENT(`--`,`$`),r={scope:`string`,variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=[`true`,`false`,`unknown`],o=[`double precision`,`large object`,`with timezone`,`without timezone`],s=`bigint.binary.blob.boolean.char.character.clob.date.dec.decfloat.decimal.float.int.integer.interval.nchar.nclob.national.numeric.real.row.smallint.time.timestamp.varchar.varying.varbinary`.split(`.`),c=[`add`,`asc`,`collation`,`desc`,`final`,`first`,`last`,`view`],l=`abs.acos.all.allocate.alter.and.any.are.array.array_agg.array_max_cardinality.as.asensitive.asin.asymmetric.at.atan.atomic.authorization.avg.begin.begin_frame.begin_partition.between.bigint.binary.blob.boolean.both.by.call.called.cardinality.cascaded.case.cast.ceil.ceiling.char.char_length.character.character_length.check.classifier.clob.close.coalesce.collate.collect.column.commit.condition.connect.constraint.contains.convert.copy.corr.corresponding.cos.cosh.count.covar_pop.covar_samp.create.cross.cube.cume_dist.current.current_catalog.current_date.current_default_transform_group.current_path.current_role.current_row.current_schema.current_time.current_timestamp.current_path.current_role.current_transform_group_for_type.current_user.cursor.cycle.date.day.deallocate.dec.decimal.decfloat.declare.default.define.delete.dense_rank.deref.describe.deterministic.disconnect.distinct.double.drop.dynamic.each.element.else.empty.end.end_frame.end_partition.end-exec.equals.escape.every.except.exec.execute.exists.exp.external.extract.false.fetch.filter.first_value.float.floor.for.foreign.frame_row.free.from.full.function.fusion.get.global.grant.group.grouping.groups.having.hold.hour.identity.in.indicator.initial.inner.inout.insensitive.insert.int.integer.intersect.intersection.interval.into.is.join.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.language.large.last_value.lateral.lead.leading.left.like.like_regex.listagg.ln.local.localtime.localtimestamp.log.log10.lower.match.match_number.match_recognize.matches.max.member.merge.method.min.minute.mod.modifies.module.month.multiset.national.natural.nchar.nclob.new.no.none.normalize.not.nth_value.ntile.null.nullif.numeric.octet_length.occurrences_regex.of.offset.old.omit.on.one.only.open.or.order.out.outer.over.overlaps.overlay.parameter.partition.pattern.per.percent.percent_rank.percentile_cont.percentile_disc.period.portion.position.position_regex.power.precedes.precision.prepare.primary.procedure.ptf.range.rank.reads.real.recursive.ref.references.referencing.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.release.result.return.returns.revoke.right.rollback.rollup.row.row_number.rows.running.savepoint.scope.scroll.search.second.seek.select.sensitive.session_user.set.show.similar.sin.sinh.skip.smallint.some.specific.specifictype.sql.sqlexception.sqlstate.sqlwarning.sqrt.start.static.stddev_pop.stddev_samp.submultiset.subset.substring.substring_regex.succeeds.sum.symmetric.system.system_time.system_user.table.tablesample.tan.tanh.then.time.timestamp.timezone_hour.timezone_minute.to.trailing.translate.translate_regex.translation.treat.trigger.trim.trim_array.true.truncate.uescape.union.unique.unknown.unnest.update.upper.user.using.value.values.value_of.var_pop.var_samp.varbinary.varchar.varying.versioning.when.whenever.where.width_bucket.window.with.within.without.year`.split(`.`),u=`abs.acos.array_agg.asin.atan.avg.cast.ceil.ceiling.coalesce.corr.cos.cosh.count.covar_pop.covar_samp.cume_dist.dense_rank.deref.element.exp.extract.first_value.floor.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.last_value.lead.listagg.ln.log.log10.lower.max.min.mod.nth_value.ntile.nullif.percent_rank.percentile_cont.percentile_disc.position.position_regex.power.rank.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.row_number.sin.sinh.sqrt.stddev_pop.stddev_samp.substring.substring_regex.sum.tan.tanh.translate.translate_regex.treat.trim.trim_array.unnest.upper.value_of.var_pop.var_samp.width_bucket`.split(`.`),d=[`current_catalog`,`current_date`,`current_default_transform_group`,`current_path`,`current_role`,`current_schema`,`current_transform_group_for_type`,`current_user`,`session_user`,`system_time`,`system_user`,`current_time`,`localtime`,`current_timestamp`,`localtimestamp`],f=[`create table`,`insert into`,`primary key`,`foreign key`,`not null`,`alter table`,`add constraint`,`grouping sets`,`on overflow`,`character set`,`respect nulls`,`ignore nulls`,`nulls first`,`nulls last`,`depth first`,`breadth first`],p=u,m=[...l,...c].filter(e=>!u.includes(e)),h={scope:`variable`,match:/@[a-z0-9][a-z0-9_]*/},g={scope:`operator`,match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,`\\s+`))),/\b/)}let y={scope:`keyword`,match:v(f),relevance:0};function b(e,{exceptions:t,when:n}={}){let r=n;return t||=[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}return{name:`SQL`,case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(m,{when:e=>e.length<3}),literal:a,type:s,built_in:d},contains:[{scope:`type`,match:v(o)},y,_,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,g]}}function cM(e){return e?typeof e==`string`?e:e.source:null}function lM(e){return uM(`(?=`,e,`)`)}function uM(...e){return e.map(e=>cM(e)).join(``)}function dM(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function fM(...e){return`(`+(dM(e).capture?``:`?:`)+e.map(e=>cM(e)).join(`|`)+`)`}var pM=e=>uM(/\b/,e,/\w$/.test(e)?/\b/:/\B/),mM=[`Protocol`,`Type`].map(pM),hM=[`init`,`self`].map(pM),gM=[`Any`,`Self`],_M=[`actor`,`any`,`associatedtype`,`async`,`await`,/as\?/,/as!/,`as`,`borrowing`,`break`,`case`,`catch`,`class`,`consume`,`consuming`,`continue`,`convenience`,`copy`,`default`,`defer`,`deinit`,`didSet`,`distributed`,`do`,`dynamic`,`each`,`else`,`enum`,`extension`,`fallthrough`,/fileprivate\(set\)/,`fileprivate`,`final`,`for`,`func`,`get`,`guard`,`if`,`import`,`indirect`,`infix`,/init\?/,/init!/,`inout`,/internal\(set\)/,`internal`,`in`,`is`,`isolated`,`nonisolated`,`lazy`,`let`,`macro`,`mutating`,`nonmutating`,/open\(set\)/,`open`,`operator`,`optional`,`override`,`package`,`postfix`,`precedencegroup`,`prefix`,/private\(set\)/,`private`,`protocol`,/public\(set\)/,`public`,`repeat`,`required`,`rethrows`,`return`,`set`,`some`,`static`,`struct`,`subscript`,`super`,`switch`,`throws`,`throw`,/try\?/,/try!/,`try`,`typealias`,/unowned\(safe\)/,/unowned\(unsafe\)/,`unowned`,`var`,`weak`,`where`,`while`,`willSet`],vM=[`false`,`nil`,`true`],yM=[`assignment`,`associativity`,`higherThan`,`left`,`lowerThan`,`none`,`right`],bM=[`#colorLiteral`,`#column`,`#dsohandle`,`#else`,`#elseif`,`#endif`,`#error`,`#file`,`#fileID`,`#fileLiteral`,`#filePath`,`#function`,`#if`,`#imageLiteral`,`#keyPath`,`#line`,`#selector`,`#sourceLocation`,`#warning`],xM=`abs.all.any.assert.assertionFailure.debugPrint.dump.fatalError.getVaList.isKnownUniquelyReferenced.max.min.numericCast.pointwiseMax.pointwiseMin.precondition.preconditionFailure.print.readLine.repeatElement.sequence.stride.swap.swift_unboxFromSwiftValueWithType.transcode.type.unsafeBitCast.unsafeDowncast.withExtendedLifetime.withUnsafeMutablePointer.withUnsafePointer.withVaList.withoutActuallyEscaping.zip`.split(`.`),SM=fM(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),CM=fM(SM,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),wM=uM(SM,CM,`*`),TM=fM(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),EM=fM(TM,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),DM=uM(TM,EM,`*`),OM=uM(/[A-Z]/,EM,`*`),kM=[`attached`,`autoclosure`,uM(/convention\(/,fM(`swift`,`block`,`c`),/\)/),`discardableResult`,`dynamicCallable`,`dynamicMemberLookup`,`escaping`,`freestanding`,`frozen`,`GKInspectable`,`IBAction`,`IBDesignable`,`IBInspectable`,`IBOutlet`,`IBSegueAction`,`inlinable`,`main`,`nonobjc`,`NSApplicationMain`,`NSCopying`,`NSManaged`,uM(/objc\(/,DM,/\)/),`objc`,`objcMembers`,`propertyWrapper`,`requires_stored_property_inits`,`resultBuilder`,`Sendable`,`testable`,`UIApplicationMain`,`unchecked`,`unknown`,`usableFromInline`,`warn_unqualified_access`],AM=[`iOS`,`iOSApplicationExtension`,`macOS`,`macOSApplicationExtension`,`macCatalyst`,`macCatalystApplicationExtension`,`watchOS`,`watchOSApplicationExtension`,`tvOS`,`tvOSApplicationExtension`,`swift`];function jM(e){let t={match:/\s+/,relevance:0},n=e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,fM(...mM,...hM)],className:{2:`keyword`}},a={match:uM(/\./,fM(..._M)),relevance:0},o=_M.filter(e=>typeof e==`string`).concat([`_|0`]),s={variants:[{className:`keyword`,match:fM(..._M.filter(e=>typeof e!=`string`).concat(gM).map(pM),...hM)}]},c={$pattern:fM(/\b\w+/,/#\w+/),keyword:o.concat(bM),literal:vM},l=[i,a,s],u=[{match:uM(/\./,fM(...xM)),relevance:0},{className:`built_in`,match:uM(/\b/,fM(...xM),/(?=\()/)}],d={match:/->/,relevance:0},f=[d,{className:`operator`,relevance:0,variants:[{match:wM},{match:`\\.(\\.|${CM})+`}]}],p=`([0-9]_*)+`,m=`([0-9a-fA-F]_*)+`,h={className:`number`,relevance:0,variants:[{match:`\\b(${p})(\\.(${p}))?([eE][+-]?(${p}))?\\b`},{match:`\\b0x(${m})(\\.(${m}))?([pP][+-]?(${p}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},g=(e=``)=>({className:`subst`,variants:[{match:uM(/\\/,e,/[0\\tnr"']/)},{match:uM(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),_=(e=``)=>({className:`subst`,match:uM(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),v=(e=``)=>({className:`subst`,label:`interpol`,begin:uM(/\\/,e,/\(/),end:/\)/}),y=(e=``)=>({begin:uM(e,/"""/),end:uM(/"""/,e),contains:[g(e),_(e),v(e)]}),b=(e=``)=>({begin:uM(e,/"/),end:uM(/"/,e),contains:[g(e),v(e)]}),x={className:`string`,variants:[y(),y(`#`),y(`##`),y(`###`),b(),b(`#`),b(`##`),b(`###`)]},S=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],C={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:S},w=e=>{let t=uM(e,/\//),n=uM(/\//,e);return{begin:t,end:n,contains:[...S,{scope:`comment`,begin:`#(?!.*${n})`,end:/$/}]}},T={scope:`regexp`,variants:[w(`###`),w(`##`),w(`#`),C]},E={match:uM(/`/,DM,/`/)},D=[E,{className:`variable`,match:/\$\d+/},{className:`variable`,match:`\\$${EM}+`}],O=[{match:/(@|#(un)?)available/,scope:`keyword`,starts:{contains:[{begin:/\(/,end:/\)/,keywords:AM,contains:[...f,h,x]}]}},{scope:`keyword`,match:uM(/@/,fM(...kM),lM(fM(/\(/,/\s+/)))},{scope:`meta`,match:uM(/@/,DM)}],k={match:lM(/\b[A-Z]/),relevance:0,contains:[{className:`type`,match:uM(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,EM,`+`)},{className:`type`,match:OM,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:uM(/\s+&\s+/,lM(OM)),relevance:0}]},A={begin:/</,end:/>/,keywords:c,contains:[...r,...l,...O,d,k]};k.contains.push(A);let j={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:[`self`,{match:uM(DM,/\s*:/),keywords:`_|0`,relevance:0},...r,T,...l,...u,...f,h,x,...D,...O,k]},M={begin:/</,end:/>/,keywords:`repeat each`,contains:[...r,k]},N={begin:/\(/,end:/\)/,keywords:c,contains:[{begin:fM(lM(uM(DM,/\s*:/)),lM(uM(DM,/\s+/,DM,/\s*:/))),end:/:/,relevance:0,contains:[{className:`keyword`,match:/\b_\b/},{className:`params`,match:DM}]},...r,...l,...f,h,x,...O,k,j],endsParent:!0,illegal:/["']/},P={match:[/(func|macro)/,/\s+/,fM(E.match,DM,wM)],className:{1:`keyword`,3:`title.function`},contains:[M,N,t],illegal:[/\[/,/%/]},F={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:`keyword`},contains:[M,N,t],illegal:/\[|%/},I={match:[/operator/,/\s+/,wM],className:{1:`keyword`,3:`title`}},L={begin:[/precedencegroup/,/\s+/,OM],className:{1:`keyword`,3:`title`},contains:[k],keywords:[...yM,...vM],end:/}/},R={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:`keyword`,3:`keyword`,5:`title.function`}},ee={match:[/class\b/,/\s+/,/var\b/],scope:{1:`keyword`,3:`keyword`}},z={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,DM,/\s*/],beginScope:{1:`keyword`,3:`title.class`},keywords:c,contains:[M,...l,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:`title.class.inherited`,match:OM},...l],relevance:0}]};for(let e of x.variants){let t=e.contains.find(e=>e.label===`interpol`);t.keywords=c;let n=[...l,...u,...f,h,x,...D];t.contains=[...n,{begin:/\(/,end:/\)/,contains:[`self`,...n]}]}return{name:`Swift`,keywords:c,contains:[...r,P,F,R,ee,z,I,L,{beginKeywords:`import`,end:/$/,contains:[...r],relevance:0},T,...l,...u,...f,h,x,...D,...O,k,j]}}var MM=`[A-Za-z$_][0-9A-Za-z$_]*`,NM=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),PM=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],FM=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),IM=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],LM=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],RM=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],zM=[].concat(LM,FM,IM);function BM(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=MM,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:MM,keyword:NM,literal:PM,built_in:zM,"variable.language":RM},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...FM,...IM]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...LM,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function VM(e){let t=e.regex,n=BM(e),r=MM,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:MM,keyword:NM.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:PM,built_in:zM.concat(i),"variable.language":RM},l={className:`meta`,begin:`@`+r},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}function HM(e){let t=e.regex,n={className:`string`,begin:/"(""|[^/n])"C\b/},r={className:`string`,begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,s=/\d{1,2}(:\d{1,2}){1,2}/,c={className:`literal`,variants:[{begin:t.concat(/# */,t.either(a,i),/ *#/)},{begin:t.concat(/# */,s,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(a,i),/ +/,t.either(o,s),/ *#/)}]},l={className:`number`,relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:`label`,begin:/^\w+:/},d=e.COMMENT(/'''/,/$/,{contains:[{className:`doctag`,begin:/<\/?/,end:/>/}]}),f=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:`Visual Basic .NET`,aliases:[`vb`],case_insensitive:!0,classNameAliases:{label:`symbol`},keywords:{keyword:`addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield`,built_in:`addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort`,type:`boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort`,literal:`true false nothing`},illegal:`//|\\{|\\}|endif|gosub|variant|wend|^\\$ `,contains:[n,r,c,l,u,d,f,{className:`meta`,begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:`const disable else elseif enable end externalsource if region then`},contains:[f]}]}}function UM(e){e.regex;let t=e.COMMENT(/\(;/,/;\)/);return t.contains.push(`self`),{name:`WebAssembly`,keywords:{$pattern:/[\w.]+/,keyword:`anyfunc,block,br,br_if,br_table,call,call_indirect,data,drop,elem,else,end,export,func,global.get,global.set,local.get,local.set,local.tee,get_global,get_local,global,if,import,local,loop,memory,memory.grow,memory.size,module,mut,nop,offset,param,result,return,select,set_global,set_local,start,table,tee_local,then,type,unreachable`.split(`,`)},contains:[e.COMMENT(/;;/,/$/),t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:`keyword`,3:`operator`}},{className:`variable`,begin:/\$[\w_]+/},{match:/(\((?!;)|\))+/,className:`punctuation`,relevance:0},{begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:`keyword`,3:`title.function`}},e.QUOTE_STRING_MODE,{match:/(i32|i64|f32|f64)(?!\.)/,className:`type`},{className:`keyword`,match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/},{className:`number`,relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/}]}}function WM(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:`meta`,end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:`tag`,begin:/<style(?=\s|>)/,end:/>/,keywords:{name:`style`},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:[`css`,`xml`]}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:[`javascript`,`handlebars`,`xml`]}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function GM(e){let t=`true false yes no null`,n=`[\\w#;/?:@&=+$,.~*'()[\\]]+`,r={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},o={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},s=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),c={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},l={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},u={begin:/\{/,end:/\}/,contains:[l],illegal:`\\n`,relevance:0},d={begin:`\\[`,end:`\\]`,contains:[l],illegal:`\\n`,relevance:0},f=[r,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+!`+n},{className:`type`,begin:`!<`+n+`>`},{className:`type`,begin:`!`+n},{className:`type`,begin:`!!`+n},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},c,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},u,d,a,o],p=[...f];return p.pop(),p.push(s),l.contains=p,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:f}}var KM={arduino:ej,bash:tj,c:nj,cpp:rj,csharp:ij,css:pj,diff:mj,go:hj,graphql:gj,ini:_j,java:Cj,javascript:aee,json:oee,kotlin:cee,less:Lj,lua:Rj,makefile:zj,markdown:Bj,objectivec:Vj,perl:Hj,php:Uj,"php-template":Wj,plaintext:Gj,python:Kj,"python-repl":qj,r:Jj,ruby:Yj,rust:Xj,scss:aM,shell:oM,sql:sM,swift:jM,typescript:VM,vbnet:HM,wasm:UM,xml:WM,yaml:GM},qM={},JM=`hljs-`;function YM(e){let t=bS.newInstance();return e&&a(e),{highlight:n,highlightAuto:r,listLanguages:i,register:a,registerAlias:o,registered:s};function n(e,n,r){let i=r||qM,a=typeof i.prefix==`string`?i.prefix:JM;if(!t.getLanguage(e))throw Error("Unknown language: `"+e+"` is not registered");t.configure({__emitter:XM,classPrefix:a});let o=t.highlight(n,{ignoreIllegals:!0,language:e});if(o.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:o.errorRaised});let s=o._emitter.root,c=s.data;return c.language=o.language,c.relevance=o.relevance,s}function r(e,r){let a=(r||qM).subset||i(),o=-1,s=0,c;for(;++o<a.length;){let i=a[o];if(!t.getLanguage(i))continue;let l=n(i,e,r);l.data&&l.data.relevance!==void 0&&l.data.relevance>s&&(s=l.data.relevance,c=l)}return c||{type:`root`,children:[],data:{language:void 0,relevance:s}}}function i(){return t.listLanguages()}function a(e,n){if(typeof e==`string`)t.registerLanguage(e,n);else{let n;for(n in e)Object.hasOwn(e,n)&&t.registerLanguage(n,e[n])}}function o(e,n){if(typeof e==`string`)t.registerAliases(typeof n==`string`?n:[...n],{languageName:e});else{let n;for(n in e)if(Object.hasOwn(e,n)){let r=e[n];t.registerAliases(typeof r==`string`?r:[...r],{languageName:n})}}}function s(e){return!!t.getLanguage(e)}}var XM=class{constructor(e){this.options=e,this.root={type:`root`,children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e===``)return;let t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&n.type===`text`?n.value+=e:t.children.push({type:`text`,value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){let n=this.stack[this.stack.length-1],r=e.root.children;t?n.children.push({type:`element`,tagName:`span`,properties:{className:[t]},children:r}):n.children.push(...r)}openNode(e){let t=this,n=e.split(`.`).map(function(e,n){return n?e+`_`.repeat(n):t.options.classPrefix+e}),r=this.stack[this.stack.length-1],i={type:`element`,tagName:`span`,properties:{className:n},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return``}},ZM={key:0,class:`tt-toolbar`},QM={class:`tt-toolbar__group`},$M=[`title`],eN=[`title`],tN=[`title`],nN=[`title`],rN=[`title`],iN={class:`tt-toolbar__group`},aN=[`title`],oN=[`title`],sN=[`title`],cN={class:`tt-toolbar__group`},lN=[`title`],uN=[`title`],dN=[`title`],fN={class:`tt-toolbar__group`},pN=[`title`],mN=[`title`],hN=[`title`],gN=[`title`],_N={class:`tt-toolbar__group`},vN=[`title`,`disabled`],yN=[`title`,`disabled`],bN={class:`tt-content-wrap`},xN=[`onMousedown`,`onMouseenter`],SN=288,CN=6,wN=Je(B({__name:`TiptapEditor`,props:{modelValue:{},placeholder:{default:`Write something...`},editable:{type:Boolean,default:!0},markdown:{type:Boolean,default:!1},minHeight:{default:`200px`},maxHeight:{default:`400px`},mentions:{default:()=>[]},handleFiles:{},attachmentSrc:{}},emits:[`update:modelValue`,`link-click`],setup(e,{expose:t,emit:n}){let a=YM(KM),o=e,s=n;function c(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}let l=ah.create({name:`mentionBadges`,addProseMirrorPlugins(){let e=e=>{let t=o.mentions.map(e=>e.label).filter(Boolean);if(!t.length)return Lu.empty;let n=[...t].sort((e,t)=>t.length-e.length).map(c).join(`|`),r=RegExp(`(^|[\\s([>])@(${n})(?![\\p{L}\\p{N}._'-])`,`gu`),i=[];return e.descendants((e,t)=>{if(!e.isText||!e.text)return;let n=e.text;r.lastIndex=0;let a;for(;(a=r.exec(n))!==null;){let e=t+a.index+(a[1]??``).length,n=e+1+(a[2]??``).length;i.push(Pu.inline(e,n,{class:`tt-mention`}))}}),Lu.create(e,i)};return[new co({props:{decorations(t){return e(t.doc)}}})]}}),u=ah.create({name:`mentionKeymap`,priority:1e3,addKeyboardShortcuts(){let e=e=>()=>w.value?(O(e),!0):!1,t=()=>!w.value||!T.value&&!_.value?!1:(k(),!0);return{Escape:()=>w.value?(E(),!0):!1,ArrowDown:e(1),ArrowUp:e(-1),Enter:t,Tab:t}}});function d(e){return e?Array.from(e.files??[]):[]}let f=new Set,p=hS.extend({addNodeView(){let e=this.options.HTMLAttributes??{};return({node:t,HTMLAttributes:n})=>{let r=document.createElement(`img`);for(let[t,i]of Object.entries({...e,...n}))i!=null&&t!==`src`&&r.setAttribute(t,String(i));r.classList.add(`tt-img`);let i=QA(t.attrs.src);if(!i)return typeof t.attrs.src==`string`&&(r.src=t.attrs.src),{dom:r};r.dataset.attachmentId=i;let a=()=>{let e=o.attachmentSrc?.get(i);if(e){r.src=e,r.classList.remove(`tt-img--pending`);return}r.removeAttribute(`src`),r.classList.add(`tt-img--pending`)};return a(),f.add(a),{dom:r,destroy:()=>{f.delete(a)}}}}});C(()=>o.attachmentSrc,()=>{for(let e of f)e()},{deep:!0});let m=jh({content:o.modelValue,editable:o.editable,extensions:[u,l,uS.configure({codeBlock:!1,link:{openOnClick:!1,autolink:!1,isAllowedUri:e=>{if(typeof e!=`string`)return!1;if(e.startsWith(`#wiki:`)||e.startsWith(`wiki:`)||e.startsWith(`#`))return!0;try{let t=new URL(e,window.location.origin);return[`http:`,`https:`,`mailto:`].includes(t.protocol)}catch{return!1}},HTMLAttributes:{class:`tt-link`,rel:`noopener`,target:null}}}),dS.configure({placeholder:o.placeholder}),fS,pS.configure({nested:!0}),p.configure({inline:!0,allowBase64:!0}),gS.configure({types:[`heading`,`paragraph`]}),yS.configure({multicolor:!0}),DS.configure({lowlight:a}),XA.configure({html:!0,tightLists:!0,linkify:!0,breaks:!0})],onSelectionUpdate({editor:e}){D(e)},onBlur(){E()},onUpdate({editor:e}){D(e);let t=o.markdown?e.storage.markdown.getMarkdown():e.getHTML();s(`update:modelValue`,t)},editorProps:{handlePaste(e,t){let n=d(t.clipboardData);return!n.length||!o.handleFiles?!1:(o.handleFiles(n),!0)},handleDrop(e,t){let n=d(t.dataTransfer);return!n.length||!o.handleFiles?!1:(t.preventDefault(),o.handleFiles(n),!0)},handleDOMEvents:{mousedown(e,t){let n=t.target?.closest(`a`);return!n||!n.getAttribute(`href`)?!1:(t.preventDefault(),!0)},auxclick(e,t){let n=t.target?.closest(`a`);return!n||!n.getAttribute(`href`)?!1:(t.preventDefault(),t.stopPropagation(),!0)},click(e,t){let n=t.target?.closest(`a`);if(!n)return!1;let r=n.getAttribute(`href`)??``;return r?(t.preventDefault(),t.stopPropagation(),s(`link-click`,r,t),!0):!1}}}}),h=i(null),g=i(0),_=i(!1),v=i({top:0,left:0}),y=/(?:^|[\s([>])@([\p{L}\p{N}._'-]*(?: [\p{L}\p{N}._'-]*)?)$/u;function x(e){return e.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).toLowerCase()}let S=z(()=>{if(h.value===null)return[];let e=x(h.value.trim());return o.mentions.filter(t=>!e||x(t.label).includes(e)).slice(0,CN)}),w=z(()=>h.value!==null&&S.value.length>0),T=z(()=>w.value&&(h.value??``).trim().length>0);function E(){h.value=null,g.value=0,_.value=!1}function D(e){if(!o.mentions.length||!o.editable){E();return}try{let t=e.state.selection;if(!t.empty){E();return}let n=t.from-Math.min(t.$from.parentOffset,60),r=e.state.doc.textBetween(n,t.from,`
|
|
198
|
+
`,``),i=y.exec(r);if(!i){E();return}let a=e.view.coordsAtPos(t.from),o=Math.max(8,window.innerWidth-SN-8);v.value={top:a.bottom+4,left:Math.min(Math.max(8,a.left),o)},h.value===null&&(g.value=0),h.value!==(i[1]??``)&&(_.value=!1),h.value=i[1]??``}catch{E()}}function O(e){let t=S.value.length;t&&(_.value=!0,g.value=(g.value+e+t)%t)}function k(e){let t=m.value,n=e??S.value[g.value];if(!t||!n||h.value===null)return;let r=t.state.selection.from,i=r-h.value.length-1;E(),t.chain().focus().insertContentAt({from:i,to:r},`@${n.label} `).run()}C(()=>o.modelValue,e=>{if(!m.value)return;let t=m.value;(o.markdown?t.storage.markdown.getMarkdown():t.getHTML())!==e&&t.commands.setContent(e??``,{emitUpdate:!1})}),C(()=>o.mentions,()=>{let e=m.value;e&&e.view.dispatch(e.state.tr)},{deep:!0}),C(()=>o.editable,e=>{m.value?.setEditable(e)}),ne(()=>m.value?.destroy());function A(e){m.value?.chain().focus().setImage({src:e}).run()}function j(){let e=m.value;if(!e)return;let t=e.getAttributes(`link`).href,n=window.prompt(`URL du lien`,t??`https://`);if(n!==null){if(n===``){e.chain().focus().extendMarkRange(`link`).unsetLink().run();return}e.chain().focus().extendMarkRange(`link`).setLink({href:n}).run()}}function M(e,t){let n=m.value;if(!n)return;let r=`#wiki:${e}`;n.state.selection.empty?n.chain().focus().insertContent({type:`text`,text:t,marks:[{type:`link`,attrs:{href:r}}]}).run():n.chain().focus().extendMarkRange(`link`).setLink({href:r}).run()}function I(){m.value?.commands.focus()}t({insertImage:A,insertWikiLink:M,promptExternalLink:j,focus:I});let{t:R}=ve();return(t,n)=>r(m)?(V(),P(`div`,{key:0,class:L([`tt`,{"tt--readonly":!e.editable}]),style:re({"--tt-min-h":e.minHeight,"--tt-max-h":e.maxHeight})},[e.editable?(V(),P(`div`,ZM,[N(`div`,QM,[N(`button`,{class:L([`tt-btn`,{"tt-btn--active":r(m).isActive(`bold`)}]),title:r(R)(`tiptapEditor.bold`),onClick:n[0]||=e=>r(m).chain().focus().toggleBold().run()},[...n[18]||=[N(`b`,null,`B`,-1)]],10,$M),N(`button`,{class:L([`tt-btn`,{"tt-btn--active":r(m).isActive(`italic`)}]),title:r(R)(`tiptapEditor.italic`),onClick:n[1]||=e=>r(m).chain().focus().toggleItalic().run()},[...n[19]||=[N(`i`,null,`I`,-1)]],10,eN),N(`button`,{class:L([`tt-btn`,{"tt-btn--active":r(m).isActive(`underline`)}]),title:r(R)(`tiptapEditor.underline`),onClick:n[2]||=e=>r(m).chain().focus().toggleUnderline().run()},[...n[20]||=[N(`u`,null,`U`,-1)]],10,tN),N(`button`,{class:L([`tt-btn`,{"tt-btn--active":r(m).isActive(`strike`)}]),title:r(R)(`tiptapEditor.strikethrough`),onClick:n[3]||=e=>r(m).chain().focus().toggleStrike().run()},[...n[21]||=[N(`s`,null,`S`,-1)]],10,nN),N(`button`,{class:L([`tt-btn`,{"tt-btn--active":r(m).isActive(`highlight`)}]),title:r(R)(`tiptapEditor.highlight`),onClick:n[4]||=e=>r(m).chain().focus().toggleHighlight().run()},[...n[22]||=[N(`i`,{class:`ti ti-palette`},null,-1)]],10,rN)]),n[33]||=N(`span`,{class:`tt-toolbar__sep`},null,-1),N(`div`,iN,[N(`button`,{class:L([`tt-btn`,{"tt-btn--active":r(m).isActive(`heading`,{level:1})}]),title:r(R)(`tiptapEditor.heading1`),onClick:n[5]||=e=>r(m).chain().focus().toggleHeading({level:1}).run()},`H1`,10,aN),N(`button`,{class:L([`tt-btn`,{"tt-btn--active":r(m).isActive(`heading`,{level:2})}]),title:r(R)(`tiptapEditor.heading2`),onClick:n[6]||=e=>r(m).chain().focus().toggleHeading({level:2}).run()},`H2`,10,oN),N(`button`,{class:L([`tt-btn`,{"tt-btn--active":r(m).isActive(`heading`,{level:3})}]),title:r(R)(`tiptapEditor.heading3`),onClick:n[7]||=e=>r(m).chain().focus().toggleHeading({level:3}).run()},`H3`,10,sN)]),n[34]||=N(`span`,{class:`tt-toolbar__sep`},null,-1),N(`div`,cN,[N(`button`,{class:L([`tt-btn`,{"tt-btn--active":r(m).isActive(`bulletList`)}]),title:r(R)(`tiptapEditor.bulletList`),onClick:n[8]||=e=>r(m).chain().focus().toggleBulletList().run()},[...n[23]||=[N(`i`,{class:`ti ti-list`},null,-1)]],10,lN),N(`button`,{class:L([`tt-btn`,{"tt-btn--active":r(m).isActive(`orderedList`)}]),title:r(R)(`tiptapEditor.orderedList`),onClick:n[9]||=e=>r(m).chain().focus().toggleOrderedList().run()},[...n[24]||=[N(`i`,{class:`ti ti-list-check`},null,-1)]],10,uN),N(`button`,{class:L([`tt-btn`,{"tt-btn--active":r(m).isActive(`taskList`)}]),title:r(R)(`tiptapEditor.taskList`),onClick:n[10]||=e=>r(m).chain().focus().toggleTaskList().run()},[...n[25]||=[N(`i`,{class:`ti ti-square-check`},null,-1)]],10,dN)]),n[35]||=N(`span`,{class:`tt-toolbar__sep`},null,-1),N(`div`,fN,[N(`button`,{class:L([`tt-btn`,{"tt-btn--active":r(m).isActive(`blockquote`)}]),title:r(R)(`tiptapEditor.quote`),onClick:n[11]||=e=>r(m).chain().focus().toggleBlockquote().run()},[...n[26]||=[N(`i`,{class:`ti ti-message`},null,-1)]],10,pN),N(`button`,{class:L([`tt-btn`,{"tt-btn--active":r(m).isActive(`code`)}]),title:r(R)(`tiptapEditor.inlineCode`),onClick:n[12]||=e=>r(m).chain().focus().toggleCode().run()},[...n[27]||=[N(`i`,{class:`ti ti-code`},null,-1)]],10,mN),N(`button`,{class:L([`tt-btn`,{"tt-btn--active":r(m).isActive(`codeBlock`)}]),title:r(R)(`tiptapEditor.codeBlock`),onClick:n[13]||=e=>r(m).chain().focus().toggleCodeBlock().run()},`</>`,10,hN),N(`button`,{class:`tt-btn`,title:r(R)(`tiptapEditor.horizontalRule`),onClick:n[14]||=e=>r(m).chain().focus().setHorizontalRule().run()},[...n[28]||=[N(`i`,{class:`ti ti-minus`},null,-1)]],8,gN),N(`button`,{class:L([`tt-btn`,{"tt-btn--active":r(m).isActive(`link`)}]),title:`Lien`,onClick:j},[...n[29]||=[N(`i`,{class:`ti ti-link`},null,-1)]],2),r(m).isActive(`link`)?(V(),P(`button`,{key:0,class:`tt-btn`,title:`Supprimer le lien`,onClick:n[15]||=e=>r(m).chain().focus().extendMarkRange(`link`).unsetLink().run()},[...n[30]||=[N(`i`,{class:`ti ti-x`},null,-1)]])):K(``,!0)]),n[36]||=N(`span`,{class:`tt-toolbar__sep`},null,-1),N(`div`,_N,[N(`button`,{class:`tt-btn`,title:r(R)(`tiptapEditor.undo`),disabled:!r(m).can().undo(),onClick:n[16]||=e=>r(m).chain().focus().undo().run()},[...n[31]||=[N(`i`,{class:`ti ti-arrow-back-up`},null,-1)]],8,vN),N(`button`,{class:`tt-btn`,title:r(R)(`tiptapEditor.redo`),disabled:!r(m).can().redo(),onClick:n[17]||=e=>r(m).chain().focus().redo().run()},[...n[32]||=[N(`i`,{class:`ti ti-refresh`},null,-1)]],8,yN)])])):K(``,!0),N(`div`,bN,[b(r(Ah),{editor:r(m),class:`tt-content`},null,8,[`editor`]),(V(),G(le,{to:`body`},[w.value?(V(),P(`ul`,{key:0,class:`tt-mentions`,style:re({top:`${v.value.top}px`,left:`${v.value.left}px`})},[(V(!0),P(H,null,F(S.value,(e,t)=>(V(),P(`li`,{key:e.id,class:L([`tt-mentions__item`,{"tt-mentions__item--active":t===g.value}]),onMousedown:_e(t=>k(e),[`prevent`]),onMouseenter:e=>g.value=t},W(e.label),43,xN))),128))],4)):K(``,!0)]))])],6)):K(``,!0)}}),[[`__scopeId`,`data-v-52e2b22a`]]);function TN(e){return/^(https?:|mailto:)/i.test(e)?(window.open(e,`_blank`,`noopener,noreferrer`),!0):!1}var EN={class:`wizard-intro`},DN={class:`wizard-steps`},ON={class:`wizard-step__head`},kN={class:`wizard-step__index`},AN={class:`wizard-step__key`},jN={class:`wizard-step__origin`},MN={key:0},NN=[`onClick`],PN=Je(B({__name:`MissingVariablesWizard`,props:{visible:{type:Boolean},missing:{}},emits:[`update:visible`],setup(e,{emit:t}){let n=e,a=t,{t:o}=ve(),s=Le(),c=Dt(),l=g({}),u=g({}),d=i(!1);C(()=>n.missing,e=>{for(let e of Object.keys(l))delete l[e];for(let e of Object.keys(u))delete u[e];for(let t of e)l[t.variableId]=``},{immediate:!0});let f=z(()=>n.missing.length>0&&n.missing.every(e=>(l[e.variableId]??``).trim()!==``));function p(e){d.value||a(`update:visible`,e)}async function m(){if(f.value&&!d.value){d.value=!0;try{for(let e of n.missing)await c.fillVariable(e.environmentId,e.variableId,l[e.variableId],e.reason);a(`update:visible`,!1)}catch(e){s.add({severity:`error`,summary:o(`common.error`),detail:e.message??o(`missingVariables.saveError`),life:5e3})}finally{d.value=!1}}}return(t,n)=>(V(),G(r(Ue),{visible:e.visible,modal:``,closable:!d.value,header:r(o)(`missingVariables.title`),style:{width:`38rem`,maxWidth:`95vw`},"onUpdate:visible":p},{footer:U(()=>[b(r(q),{label:r(o)(`actions.cancel`),variant:`text`,disabled:d.value,onClick:n[0]||=e=>p(!1)},null,8,[`label`,`disabled`]),b(r(q),{label:r(o)(`missingVariables.save`),loading:d.value,disabled:!f.value,onClick:m},null,8,[`label`,`loading`,`disabled`])]),default:U(()=>[N(`p`,EN,W(r(o)(`missingVariables.intro`,{count:e.missing.length})),1),N(`div`,DN,[(V(!0),P(H,null,F(e.missing,(t,n)=>(V(),P(`div`,{key:t.variableId,class:`wizard-step`},[N(`div`,ON,[N(`span`,kN,W(n+1)+`/`+W(e.missing.length),1),N(`code`,AN,W(t.key),1),b(r(Be),{value:t.reason===`overrideOnly`?r(o)(`missingVariables.reasonOverrideOnly`):r(o)(`missingVariables.reasonRequired`),severity:t.reason===`overrideOnly`?`info`:`warn`},null,8,[`value`,`severity`])]),t.description?(V(),G(r(wN),{key:0,class:`wizard-step__description`,"model-value":t.description,markdown:``,editable:!1,"min-height":`0`,"max-height":`none`,onLinkClick:r(TN)},null,8,[`model-value`,`onLinkClick`])):K(``,!0),N(`p`,jN,[x(W(r(o)(`missingVariables.definedIn`,{environment:t.environmentName}))+` `,1),t.reason===`overrideOnly`?(V(),P(`span`,MN,` — `+W(r(o)(`missingVariables.machineOnly`)),1)):K(``,!0)]),b(r(Ne),{modelValue:l[t.variableId],"onUpdate:modelValue":e=>l[t.variableId]=e,type:t.isSecret&&!u[t.variableId]?`password`:`text`,class:`wizard-step__input`,disabled:d.value,placeholder:r(o)(`missingVariables.valuePlaceholder`),onKeydown:pe(m,[`enter`])},null,8,[`modelValue`,`onUpdate:modelValue`,`type`,`disabled`,`placeholder`]),t.isSecret?(V(),P(`button`,{key:1,type:`button`,class:`wizard-step__reveal`,onClick:e=>u[t.variableId]=!u[t.variableId]},[N(`i`,{class:L(u[t.variableId]?`ti ti-eye-off`:`ti ti-eye`)},null,2),x(` `+W(u[t.variableId]?r(o)(`missingVariables.hide`):r(o)(`missingVariables.reveal`)),1)],8,NN)):K(``,!0)]))),128))])]),_:1},8,[`visible`,`closable`,`header`]))}}),[[`__scopeId`,`data-v-ada005d3`]]),FN=[`src`],IN=Je(B({__name:`OrgLogo`,props:{orgId:{},name:{default:``},size:{default:20}},setup(e){let t=e,n=i(!1),r=jt(),a=kt(),o=z(()=>a.value[t.orgId]??At(t.orgId,r.value[t.orgId])),s=z(()=>(t.name||`?`).charAt(0).toUpperCase());return C(o,()=>{n.value=!1}),(t,r)=>(V(),P(`span`,{class:`org-logo`,style:re({"--org-logo-size":`${e.size}px`})},[n.value?(V(),P(H,{key:1},[x(W(s.value),1)],64)):(V(),P(`img`,{key:0,src:o.value,alt:``,onError:r[0]||=e=>n.value=!0},null,40,FN))],4))}}),[[`__scopeId`,`data-v-53f6181c`]]);function LN(e){let t=Et(),n=xe(),r=z(()=>{let n=t.projects.filter(e=>!e.orgId).map(e=>({id:e.id,orgId:null,name:e.name}));for(let t of e.orgGroups.value)for(let e of t.projects)n.push({id:e.projectId,orgId:t.orgId,...t.accountId?{accountId:t.accountId}:{},name:e.name,orgName:t.name});return n});return{all:r,recent:z(()=>n.recentProjects.filter(e=>e.id!==n.activeProjectId||e.orgId!==n.activeOrgId).map(e=>r.value.find(t=>t.id===e.id&&t.orgId===e.orgId)).filter(e=>!!e))}}var RN={key:1,class:`palette__section`},zN=[`aria-label`],BN=[`aria-selected`,`onMouseenter`,`onClick`],VN={key:1,class:`ti ti-folder`,"aria-hidden":`true`},HN={class:`palette__name`},UN={class:`palette__org`},WN={key:2,class:`ti ti-spin ti-loader-2`,"aria-hidden":`true`},GN={key:3,class:`palette__empty`},KN=Je(B({__name:`ProjectPalette`,setup(e){let{t}=ve(),n=we(),a=xe(),o=Mt(),{all:s,recent:c}=LN(o),l=i(!1),u=i(``),d=i(0),f=i(!1),p=i(``),m=i(null),h=z(()=>{let e=u.value.trim().toLowerCase();if(!e)return c.value;let t=s.value.filter(t=>t.name.toLowerCase().includes(e)||t.orgName?.toLowerCase().includes(e)),n=e=>{let t=c.value.indexOf(e);return t===-1?c.value.length:t};return t.sort((e,t)=>n(e)-n(t)||e.name.localeCompare(t.name))});C(h,()=>{d.value=0});function g(){u.value=``,p.value=``,d.value=0,l.value=!0,o.refreshCloud()}function _(){(m.value?.$el)?.focus()}async function v(e){if(e&&!f.value){f.value=!0,p.value=``;try{e.orgId&&await o.pullProject(e.orgId,e.id,e.accountId),a.setActiveProject(e.id,e.orgId),l.value=!1;let t=n.currentRoute.value.path.startsWith(`/launch`);n.push(t?{name:`launch-services`}:{name:`dashboard`})}catch(e){p.value=Pt(e,t)}finally{f.value=!1}}}function y(e){let t=h.value.length;e.key===`ArrowDown`&&t?(e.preventDefault(),d.value=(d.value+1)%t):e.key===`ArrowUp`&&t?(e.preventDefault(),d.value=(d.value-1+t)%t):e.key===`Enter`&&(e.preventDefault(),v(h.value[d.value]))}function S(e){!(e.ctrlKey||e.metaKey)||e.shiftKey||e.altKey||e.key.toLowerCase()!==`k`||e.target instanceof Element&&e.target.closest(`.xterm`)||(e.preventDefault(),l.value?l.value=!1:g())}return I(()=>window.addEventListener(`keydown`,S)),ee(()=>window.removeEventListener(`keydown`,S)),(e,n)=>(V(),G(r(Ue),{visible:l.value,"onUpdate:visible":n[1]||=e=>l.value=e,header:r(t)(`projectPalette.title`),"show-header":!1,"dismissable-mask":``,width:`32rem`,onShow:_},{default:U(()=>[b(r(Ne),{ref_key:`input`,ref:m,modelValue:u.value,"onUpdate:modelValue":n[0]||=e=>u.value=e,class:`palette__input`,placeholder:r(t)(`projectPalette.placeholder`),"aria-label":r(t)(`projectPalette.placeholder`),fluid:``,onKeydown:y},null,8,[`modelValue`,`placeholder`,`aria-label`]),p.value?(V(),G(r(Ve),{key:0,severity:`error`,class:`palette__error`},{default:U(()=>[x(W(p.value),1)]),_:1})):K(``,!0),!u.value.trim()&&h.value.length?(V(),P(`p`,RN,W(r(t)(`projectPalette.recent`)),1)):K(``,!0),h.value.length?(V(),P(`ul`,{key:2,class:`palette__list`,role:`listbox`,"aria-label":r(t)(`projectPalette.title`)},[(V(!0),P(H,null,F(h.value,(e,n)=>(V(),P(`li`,{key:`${e.orgId??`local`}:${e.id}`,role:`option`,class:L([`palette__item`,{"is-highlighted":n===d.value}]),"aria-selected":n===d.value,onMouseenter:e=>d.value=n,onClick:t=>v(e)},[e.orgId?(V(),G(IN,{key:0,"org-id":e.orgId,name:e.orgName??``,size:18},null,8,[`org-id`,`name`])):(V(),P(`i`,VN)),N(`span`,HN,W(e.name),1),N(`span`,UN,W(e.orgName??r(t)(`projectSwitcher.local`)),1),f.value&&n===d.value?(V(),P(`i`,WN)):K(``,!0)],42,BN))),128))],8,zN)):(V(),P(`p`,GN,W(u.value.trim()?r(t)(`projectPalette.noMatch`):r(t)(`projectPalette.noRecent`)),1))]),_:1},8,[`visible`,`header`]))}}),[[`__scopeId`,`data-v-0092875a`]]),qN={class:`mcp-pairing__cwd`},JN={class:`mcp-pairing__code`},YN={class:`mcp-pairing__hint`},XN=3e3,ZN=Je(B({__name:`McpPairingPrompt`,setup(e){let{t}=ve(),n=Le(),a=i(null),o=i(!1),s=null,c=z(()=>a.value!==null);async function l(){if(!(document.visibilityState!==`visible`||o.value))try{let[e]=await J.mcpPairing.pending.query();a.value=e??null}catch{}}async function u(e){let r=a.value;if(r){o.value=!0;try{await J.mcpPairing.decide.mutate({requestId:r.id,approve:e}),e&&n.add({severity:`success`,summary:t(`mcpPairing.approved`,{name:r.name}),life:4e3})}catch{n.add({severity:`error`,summary:t(`mcpPairing.failed`),life:5e3})}finally{a.value=null,o.value=!1}}}return I(()=>{l(),s=setInterval(()=>{l()},XN)}),ee(()=>{s&&clearInterval(s)}),(e,n)=>(V(),G(r(Ue),{visible:c.value,modal:``,closable:!1,header:r(t)(`mcpPairing.title`),style:{width:`32rem`,maxWidth:`95vw`}},{footer:U(()=>[b(r(q),{label:r(t)(`mcpPairing.deny`),variant:`text`,disabled:o.value,onClick:n[0]||=e=>u(!1)},null,8,[`label`,`disabled`]),b(r(q),{label:r(t)(`mcpPairing.approve`),loading:o.value,onClick:n[1]||=e=>u(!0)},null,8,[`label`,`loading`])]),default:U(()=>[a.value?(V(),P(H,{key:0},[N(`p`,null,W(r(t)(`mcpPairing.intro`,{name:a.value.name})),1),N(`code`,qN,W(a.value.cwd),1),N(`div`,JN,[N(`span`,null,W(r(t)(`mcpPairing.code`)),1),N(`strong`,null,W(a.value.code),1)]),N(`p`,YN,W(r(t)(`mcpPairing.codeHint`))+` `+W(r(t)(`mcpPairing.unknownHint`)),1)],64)):K(``,!0)]),_:1},8,[`visible`,`header`]))}}),[[`__scopeId`,`data-v-9fb41eab`]]),QN=i([]),$N=i(!1);function eP(e){let t=e,n=t?.data?.cause??t?.cause;return n&&typeof n==`object`?n:null}function tP(){async function e(e){if(!e)return!1;try{let t=await Dt().missingVariables(e);return t.length!==0&&(QN.value=t,$N.value=!0,!0)}catch(t){return console.warn(`[missing-variables] Lecture impossible pour`,e,t),!1}}function t(e){let t=eP(e)?.missingVariables;return!Array.isArray(t)||t.length===0?!1:(QN.value=t,$N.value=!0,!0)}return{missing:QN,visible:$N,checkEnvironment:e,openFromError:t}}function nP(e,t){return e.workflowType===`scenario`?!e.scenarioRunning&&(e.messages?.length??0)===0:!t}var rP=Je(B({__name:`MonacoDiffEditor`,props:{original:{},modified:{},language:{default:`plaintext`},height:{default:`100%`},theme:{default:`monokai`}},setup(e){window.MonacoEnvironment||(window.MonacoEnvironment={getWorker(){return new zt}}),Rt.defineTheme(`monokai`,{base:`vs-dark`,inherit:!0,rules:[{token:`comment`,foreground:`75715E`,fontStyle:`italic`},{token:`string`,foreground:`E6DB74`},{token:`keyword`,foreground:`F92672`},{token:`number`,foreground:`AE81FF`},{token:`regexp`,foreground:`E6DB74`},{token:`type`,foreground:`66D9EF`,fontStyle:`italic`},{token:`type.identifier`,foreground:`A6E22E`},{token:`delimiter`,foreground:`F8F8F2`},{token:`delimiter.bracket`,foreground:`F8F8F2`},{token:`tag`,foreground:`F92672`},{token:`attribute.name`,foreground:`A6E22E`},{token:`attribute.value`,foreground:`E6DB74`},{token:`variable`,foreground:`F8F8F2`},{token:`variable.predefined`,foreground:`66D9EF`},{token:`constant`,foreground:`AE81FF`},{token:`function`,foreground:`A6E22E`},{token:`operator`,foreground:`F92672`},{token:`identifier`,foreground:`F8F8F2`},{token:`meta.tag`,foreground:`F92672`}],colors:{"editor.background":`#272822`,"editor.foreground":`#F8F8F2`,"editor.lineHighlightBackground":`#3E3D32`,"editor.selectionBackground":`#49483E`,"editorCursor.foreground":`#F8F8F0`,"editorWhitespace.foreground":`#464741`,"editorIndentGuide.background":`#464741`,"editorLineNumber.foreground":`#90908A`,"editorLineNumber.activeForeground":`#F8F8F2`,"diffEditor.insertedTextBackground":`#A6E22E26`,"diffEditor.removedTextBackground":`#F9267226`,"diffEditor.insertedLineBackground":`#A6E22E15`,"diffEditor.removedLineBackground":`#F9267215`}});let t=e,n=i(),r=null,a=null,o=null;return I(()=>{n.value&&(a=Rt.createModel(t.original,t.language),o=Rt.createModel(t.modified,t.language),r=Rt.createDiffEditor(n.value,{theme:t.theme,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,automaticLayout:!0,fontSize:13,fontFamily:`'Monaco', 'Menlo', 'Ubuntu Mono', Courier, monospace`,renderSideBySide:!0,overviewRulerLanes:0,scrollbar:{verticalScrollbarSize:8,horizontalScrollbarSize:8},originalEditable:!1,ignoreTrimWhitespace:!1}),r.setModel({original:a,modified:o}))}),ne(()=>{a?.dispose(),o?.dispose(),r?.dispose(),a=null,o=null,r=null}),(t,r)=>(V(),P(`div`,{ref_key:`editorContainer`,ref:n,style:re({height:e.height,width:`100%`}),class:`monaco-diff-container`},null,4))}}),[[`__scopeId`,`data-v-ef18ae8b`]]),iP=be(`editor`,()=>{let e=Le(),t=xe(),n=i([]),r=i({}),a=i(!1),o=z(()=>n.value.filter(e=>e.installed)),s=z(()=>{let e=r.value.default;return e?n.value.find(t=>t.key===e)??null:null});function c(e){let t=r.value[e];return t?n.value.find(e=>e.key===t)??null:null}function l(e){return c(e)??s.value}async function u(){try{n.value=await J.editor.listAvailable.query()}catch(t){e.add({severity:`error`,summary:`Error`,detail:t instanceof Error?t.message:`Failed to detect editors`,life:3e3})}}async function d(){let n=t.activeProjectId,i=t.activeOrgId;if(n)try{r.value=await J.editor.getPreferences.query({projectId:n,orgId:i})}catch(t){e.add({severity:`error`,summary:`Error`,detail:t instanceof Error?t.message:`Failed to load editor preferences`,life:3e3})}}async function f(n){let i=t.activeProjectId,o=t.activeOrgId;if(i){a.value=!0;try{await J.editor.setDefault.mutate({projectId:i,orgId:o,editorKey:n}),r.value={...r.value,default:n},e.add({severity:`success`,summary:`Default editor updated`,life:2e3})}catch(t){e.add({severity:`error`,summary:`Error`,detail:t instanceof Error?t.message:`Failed to set default editor`,life:3e3})}finally{a.value=!1}}}async function p(n,i){let o=t.activeProjectId,s=t.activeOrgId;if(o){a.value=!0;try{await J.editor.setServiceEditor.mutate({projectId:o,orgId:s,serviceId:n,editorKey:i}),r.value={...r.value,[n]:i}}catch(t){e.add({severity:`error`,summary:`Error`,detail:t instanceof Error?t.message:`Failed to set service editor`,life:3e3})}finally{a.value=!1}}}async function m(n){let i=t.activeProjectId,o=t.activeOrgId;if(i){a.value=!0;try{await J.editor.removeServiceEditor.mutate({projectId:i,orgId:o,serviceId:n});let e={...r.value};delete e[n],r.value=e}catch(t){e.add({severity:`error`,summary:`Error`,detail:t instanceof Error?t.message:`Failed to remove service editor override`,life:3e3})}finally{a.value=!1}}}async function h(t,n){try{await J.editor.open.mutate({editorKey:t,path:n})}catch(t){e.add({severity:`error`,summary:`Error`,detail:t instanceof Error?t.message:`Failed to open editor`,life:3e3})}}return{availableEditors:n,preferences:r,loading:a,installedEditors:o,defaultEditor:s,getServiceEditor:c,getEffectiveEditor:l,fetchAvailable:u,fetchPreferences:d,setDefault:f,setServiceEditor:p,removeServiceEditor:m,openEditor:h}}),aP={class:`git-panel`},oP={key:0,class:`git-panel__unavailable`},sP={class:`git-panel__unavailable-title`},cP={class:`git-panel__unavailable-detail`},lP={key:1,class:`git-panel__header`},uP={class:`git-panel__branch`},dP={class:`branch-name`},fP={key:2,class:`upstream-label`},pP={class:`git-panel__actions`},mP={class:`git-actions-menu`,role:`menu`},hP=[`disabled`],gP={class:`git-panel__tabs`},_P={key:0,class:`tab-badge`},vP={key:0,class:`tab-badge`},yP={class:`git-panel__file-list`},bP={class:`git-commit-area`},xP={class:`commit-actions`},SP={class:`generate-popover`},CP={key:0,class:`git-empty`},wP={class:`git-section-header`},TP=[`onClick`],EP={class:`file-name`},DP={class:`git-section-header`},OP=[`onClick`],kP={class:`file-name`},AP={class:`file-actions`},jP={class:`git-section-header`},MP=[`onClick`],NP={class:`file-name`},PP={class:`git-panel__diff-pane`},FP={class:`git-section-header diff-header`},IP={class:`diff-header-actions`},LP={key:1,class:`diff-placeholder`},RP={key:1,class:`git-panel__content`},zP={key:0,class:`git-empty`},BP={class:`commit-hash`},VP={class:`commit-info`},HP={class:`commit-subject`},UP={class:`commit-meta`},WP={key:2,class:`git-panel__content`},GP={class:`git-section-header`},KP={class:`create-branch`},qP={class:`git-section-header`},JP={class:`branch-label`},YP={class:`git-section-header`},XP={class:`branch-label`},ZP={key:3,class:`git-panel__content`},QP={class:`git-section-header`},$P={key:0,class:`git-stash-empty`},eF=[`title`],tF={class:`stash-ref`},nF=Je(B({__name:`ServiceConfigGit`,props:{serviceId:{},agentId:{},projectId:{},orgId:{}},setup(e){let t=e,n=Le(),a=we(),{t:o}=ve(),s=iP(),c=i(),l=i(null),u=i(null),d=i(!1),f=z(()=>t.serviceId?{serviceId:t.serviceId}:{agentId:t.agentId,projectId:t.projectId,orgId:t.orgId}),p=z(()=>t.serviceId?s.getEffectiveEditor(t.serviceId):void 0),{openWithDiffContext:m}=Ht();function h(){if(!D.value||!A.value)return;let e=`\`\`\`diff\n// ${A.value}\n${D.value}\n\`\`\``;m(e)}async function g(){let e=p.value;if(e&&A.value&&t.serviceId)try{await J.editor.openFile.mutate({editorKey:e.key,serviceId:t.serviceId,relativePath:A.value})}catch(e){n.add({severity:`error`,summary:o(`git.errorTitle`),detail:e instanceof Error?e.message:String(e),life:4e3})}}let _=i(!1),v=i(!1),y=i(null),S=i([]),C=i({current:``,branches:[]}),w=i([]),T=i(``),E=i(``),D=i(``),O=i(``),k=i(``),A=i(``),j=i(!1),M=i(`status`),R=i(`origin`),te=i(``),ne=i(null);function B(e){ne.value?.hide(),e()}let re=i([]);function ie(e){let t=e.toLowerCase();return t.includes(`fetch failed`)||t.includes(`http 404`)||t.includes(`agent`)&&(t.includes(`not found`)||t.includes(`not connected`))}let ae=z(()=>w.value.map(e=>({label:e.name,value:e.name}))),oe=z(()=>!!y.value?.upstream),se=z(()=>C.value.branches.filter(e=>!e.remote));async function ce(e,t){te.value=e;try{await t()}catch(e){let t=e instanceof Error?e.message:String(e);n.add({severity:`error`,summary:o(`git.errorTitle`),detail:t,life:6e3})}finally{te.value=``}}async function le(){_.value=!0;try{let[e,t,n]=await Promise.all([J.git.status.query({...f.value}),J.git.branches.query({...f.value}),J.git.remotes.query({...f.value})]);v.value=!1,y.value=e,C.value=t,w.value=n,Fe(),w.value.length&&!w.value.find(e=>e.name===R.value)&&(R.value=w.value[0]?.name??`origin`)}catch(e){let t=e instanceof Error?e.message:String(e);y.value=null,ie(t)?v.value=!0:(v.value=!1,n.add({severity:`error`,summary:o(`git.errorTitle`),detail:t,life:6e3}))}finally{_.value=!1}}async function ue(){try{let e=await J.git.status.query({...f.value});v.value=!1,y.value=e}catch(e){ie(e instanceof Error?e.message:String(e))&&(v.value=!0)}}async function de(){try{let e=await J.git.log.query({...f.value,limit:50});S.value=e}catch(e){let t=e instanceof Error?e.message:String(e);ie(t)||n.add({severity:`error`,summary:o(`git.errorTitle`),detail:t,life:6e3})}}function fe(e){return{ts:`typescript`,tsx:`typescript`,js:`javascript`,jsx:`javascript`,json:`json`,md:`markdown`,css:`css`,scss:`scss`,less:`less`,html:`html`,vue:`html`,xml:`xml`,yaml:`yaml`,yml:`yaml`,py:`python`,rs:`rust`,go:`go`,java:`java`,sh:`shell`,sql:`sql`,toml:`ini`,php:`php`,rb:`ruby`,c:`c`,cpp:`cpp`,h:`c`,hpp:`cpp`,swift:`swift`,kt:`kotlin`,lua:`lua`,r:`r`,pl:`perl`,bat:`bat`,ps1:`powershell`}[e.split(`.`).pop()?.toLowerCase()??``]||`plaintext`}let pe=z(()=>A.value?fe(A.value):`plaintext`);async function me(e,t=!1,n=!1){let r=await J.git.diff.query({...f.value,path:e,staged:t,untracked:n});D.value=r.diff,O.value=r.original,k.value=r.modified,A.value=e??``,j.value=t}async function he(e){await ce(`stage:`+e,async()=>{await J.git.stage.mutate({...f.value,paths:[e]}),await ue()})}async function ge(){await ce(`stageAll`,async()=>{await J.git.stageAll.mutate({...f.value}),await ue()})}async function ye(e){await ce(`unstage:`+e,async()=>{await J.git.unstage.mutate({...f.value,paths:[e]}),await ue()})}async function be(){await ce(`unstageAll`,async()=>{await J.git.unstageAll.mutate({...f.value}),await ue()})}async function xe(e){await ce(`discard:`+e,async()=>{await J.git.discard.mutate({...f.value,paths:[e]}),await ue()})}async function Se(){await ce(`generateCommit`,async()=>{let e=await J.git.generateCommitMessage.mutate({...f.value,providerId:l.value??void 0,model:u.value??void 0});T.value=e.message})}async function Ce(){if(!T.value.trim()){n.add({severity:`warn`,summary:o(`git.errorTitle`),detail:o(`git.commitRequired`),life:3e3});return}await ce(`commit`,async()=>{let e=await J.git.commit.mutate({...f.value,message:T.value});n.add({severity:`success`,summary:o(`git.committed`),detail:e.output,life:4e3}),T.value=``,await ue()})}async function Te(){await ce(`push`,async()=>{let e=await J.git.push.mutate({...f.value,remote:R.value,setUpstream:!oe.value});n.add({severity:`success`,summary:o(`git.pushed`),detail:e.output||o(`git.done`),life:4e3}),await le()})}async function Ee(){await ce(`pull`,async()=>{let e=await J.git.pull.mutate({...f.value,remote:R.value});n.add({severity:`success`,summary:o(`git.pulled`),detail:e.output||o(`git.done`),life:4e3}),await le()})}async function De(){await ce(`fetch`,async()=>{await J.git.fetch.mutate({...f.value,remote:R.value}),n.add({severity:`success`,summary:o(`git.fetched`),detail:o(`git.fetchedDetail`),life:3e3}),await le()})}async function Oe(e){await ce(`checkout`,async()=>{await J.git.checkout.mutate({...f.value,branch:e}),n.add({severity:`success`,summary:o(`git.checkedOut`),detail:e,life:3e3}),await le()})}async function ke(e){await ce(`merge-${e}`,async()=>{let t=await J.git.merge.mutate({...f.value,branch:e});n.add({severity:`success`,summary:o(`git.merged`),detail:t.output||o(`git.done`),life:4e3}),await le()})}async function Ae(e){await ce(`rebase-${e}`,async()=>{let t=await J.git.rebase.mutate({...f.value,branch:e});n.add({severity:`success`,summary:o(`git.rebased`),detail:t.output||o(`git.done`),life:4e3}),await le()})}async function Me(){E.value.trim()&&await ce(`create-branch`,async()=>{await J.git.checkout.mutate({...f.value,branch:E.value,create:!0}),n.add({severity:`success`,summary:o(`git.branchCreated`),detail:E.value,life:3e3}),E.value=``,await le()})}let Pe=z(()=>!!y.value&&y.value.staged.length+y.value.unstaged.length+y.value.untracked.length>0);async function Fe(){try{re.value=await J.git.stashList.query({...f.value})}catch{re.value=[]}}async function Ie(){await ce(`stash`,async()=>{let e=await J.git.stashPush.mutate({...f.value});n.add({severity:`success`,summary:o(`git.stashed`),detail:e.output||o(`git.done`),life:3e3}),await le(),await Fe()})}async function Re(e){await ce(`stash-pop-${e}`,async()=>{let t=await J.git.stashPop.mutate({...f.value,index:e});n.add({severity:`success`,summary:o(`git.stashPopped`),detail:t.output||o(`git.done`),life:3e3}),await le(),await Fe()})}async function Ve(e){await ce(`stash-apply-${e}`,async()=>{let t=await J.git.stashApply.mutate({...f.value,index:e});n.add({severity:`success`,summary:o(`git.stashApplied`),detail:t.output||o(`git.done`),life:3e3}),await le(),await Fe()})}async function He(e){await ce(`stash-drop-${e}`,async()=>{await J.git.stashDrop.mutate({...f.value,index:e}),n.add({severity:`success`,summary:o(`git.stashDropped`),life:3e3}),await Fe()})}let Ue=null,We=Lt(le,1e4,`service-git:refresh`);function Ge(e){d.value=e>0,st()&&console.log(`[git] AI providers:`,e,`→ selected:`,l.value)}return I(()=>{le(),Ue=J.git.onStatusChange.subscribe({...f.value},{onData(e){y.value=e,v.value=!1},onError(e){let t=e?.message??``;t.includes(`PRECONDITION_FAILED`)||t.includes(`Unresolved variables`)}}),We.start()}),ee(()=>{Ue?.unsubscribe(),Ue=null,We.stop()}),(e,t)=>(V(),P(`div`,aP,[v.value?(V(),P(`div`,oP,[t[19]||=N(`i`,{class:`ti ti-server git-panel__unavailable-icon`},null,-1),N(`span`,sP,W(r(o)(`git.agentUnavailable`)),1),N(`span`,cP,W(r(o)(`git.agentUnavailableDetail`)),1),b(r(q),{label:r(o)(`git.retry`),icon:`ti ti-refresh`,size:`small`,onClick:le},null,8,[`label`])])):K(``,!0),v.value?K(``,!0):(V(),P(`div`,lP,[N(`div`,uP,[t[20]||=N(`i`,{class:`ti ti-brand-github`},null,-1),N(`span`,dP,W(y.value?.branch??`…`),1),y.value&&y.value.ahead>0?(V(),G(r(Be),{key:0,value:`↑${y.value.ahead}`,severity:`info`,class:`ahead-tag`},null,8,[`value`])):K(``,!0),y.value&&y.value.behind>0?(V(),G(r(Be),{key:1,value:`↓${y.value.behind}`,severity:`warn`,class:`behind-tag`},null,8,[`value`])):K(``,!0),y.value?.upstream?(V(),P(`span`,fP,`→ `+W(y.value.upstream),1)):K(``,!0)]),N(`div`,pP,[ae.value.length?(V(),G(r(ze),{key:0,modelValue:R.value,"onUpdate:modelValue":t[0]||=e=>R.value=e,options:ae.value,"option-label":`label`,"option-value":`value`,size:`small`,class:`remote-select`},null,8,[`modelValue`,`options`])):K(``,!0),b(r(q),{icon:`ti ti-refresh`,size:`small`,variant:`text`,title:r(o)(`git.refresh`),"aria-label":r(o)(`git.refresh`),loading:_.value,onClick:le},null,8,[`title`,`aria-label`,`loading`]),b(r(q),{icon:`ti ti-chevron-down`,"icon-pos":`right`,label:r(o)(`git.actionsMenu`),size:`small`,variant:`outlined`,loading:!!te.value,"aria-haspopup":`menu`,onClick:t[1]||=e=>ne.value?.toggle(e)},null,8,[`label`,`loading`]),b(r(je),{ref_key:`actionsMenu`,ref:ne},{default:U(()=>[N(`div`,mP,[N(`button`,{type:`button`,role:`menuitem`,class:`git-actions-menu__item`,onClick:t[2]||=e=>B(Ee)},[t[21]||=N(`i`,{class:`ti ti-download`,"aria-hidden":`true`},null,-1),N(`span`,null,W(r(o)(`git.pull`)),1)]),N(`button`,{type:`button`,role:`menuitem`,class:`git-actions-menu__item`,onClick:t[3]||=e=>B(Te)},[t[22]||=N(`i`,{class:`ti ti-cloud-upload`,"aria-hidden":`true`},null,-1),N(`span`,null,W(r(o)(`git.push`)),1)]),N(`button`,{type:`button`,role:`menuitem`,class:`git-actions-menu__item`,onClick:t[4]||=e=>B(De)},[t[23]||=N(`i`,{class:`ti ti-refresh`,"aria-hidden":`true`},null,-1),N(`span`,null,W(r(o)(`git.fetch`)),1)]),N(`button`,{type:`button`,role:`menuitem`,class:`git-actions-menu__item`,disabled:!Pe.value,onClick:t[5]||=e=>B(Ie)},[t[24]||=N(`i`,{class:`ti ti-inbox`,"aria-hidden":`true`},null,-1),N(`span`,null,W(r(o)(`git.stash`)),1)],8,hP)])]),_:1},512)])])),v.value?K(``,!0):(V(),P(H,{key:2},[N(`div`,gP,[N(`button`,{class:L([`git-tab`,{active:M.value===`status`}]),onClick:t[6]||=e=>M.value=`status`},[t[25]||=N(`i`,{class:`ti ti-file-pencil`},null,-1),x(` `+W(r(o)(`git.tabChanges`))+` `,1),y.value?(V(),P(`span`,_P,W(y.value.staged.length+y.value.unstaged.length+y.value.untracked.length),1)):K(``,!0)],2),N(`button`,{class:L([`git-tab`,{active:M.value===`log`}]),onClick:t[7]||=e=>{M.value=`log`,de()}},[t[26]||=N(`i`,{class:`ti ti-history`},null,-1),x(` `+W(r(o)(`git.tabHistory`)),1)],2),N(`button`,{class:L([`git-tab`,{active:M.value===`branches`}]),onClick:t[8]||=e=>M.value=`branches`},[t[27]||=N(`i`,{class:`ti ti-brand-github`},null,-1),x(` `+W(r(o)(`git.tabBranches`)),1)],2),N(`button`,{class:L([`git-tab`,{active:M.value===`stash`}]),onClick:t[9]||=e=>{M.value=`stash`,Fe()}},[t[28]||=N(`i`,{class:`ti ti-inbox`},null,-1),x(` `+W(r(o)(`git.tabStash`))+` `,1),re.value.length?(V(),P(`span`,vP,W(re.value.length),1)):K(``,!0)],2)]),M.value===`status`?(V(),G(r(Ke),{key:0,class:`git-panel__status-split`,"gutter-size":6},{default:U(()=>[b(r(at),{size:30,"min-size":15,class:`git-panel__file-list-panel`},{default:U(()=>[N(`div`,yP,[N(`div`,bP,[b(r(et),{modelValue:T.value,"onUpdate:modelValue":t[10]||=e=>T.value=e,placeholder:r(o)(`git.commitPlaceholder`),rows:`3`,class:`commit-message`,"auto-resize":``},null,8,[`modelValue`,`placeholder`]),N(`div`,xP,[b(ct,{modelValue:l.value,"onUpdate:modelValue":t[11]||=e=>l.value=e,model:u.value,"onUpdate:model":t[12]||=e=>u.value=e,"storage-key":`runeya.git.commitAi`,class:`commit-provider-select`,onLoaded:Ge},null,8,[`modelValue`,`model`]),b(r(q),{icon:`ti ti-sparkles`,label:r(o)(`git.generateMessage`),size:`small`,variant:`outlined`,disabled:!y.value?.staged.length||!d.value,loading:te.value===`generateCommit`,onClick:t[13]||=e=>d.value?Se():void 0,onMouseenter:t[14]||=e=>d.value?void 0:c.value?.show(e),onMouseleave:t[15]||=e=>d.value?void 0:c.value?.hide()},null,8,[`label`,`disabled`,`loading`]),b(r(je),{ref_key:`generatePopover`,ref:c},{default:U(()=>[N(`div`,SP,[N(`p`,null,W(r(o)(`git.noProviderMessage`)),1),b(r(q),{label:r(o)(`git.goToSettings`),icon:`ti ti-settings`,size:`small`,variant:`text`,onClick:t[16]||=e=>{r(a).push({name:`settings`,query:{section:`ai`}}),c.value?.hide()}},null,8,[`label`])])]),_:1},512),b(r(q),{label:r(o)(`git.commit`),icon:`ti ti-check`,size:`small`,disabled:!T.value.trim()||!y.value?.staged.length,loading:te.value===`commit`,onClick:Ce},null,8,[`label`,`disabled`,`loading`])])]),y.value&&y.value.staged.length===0&&y.value.unstaged.length===0&&y.value.untracked.length===0?(V(),P(`div`,CP,[t[29]||=N(`i`,{class:`ti ti-circle-check`},null,-1),N(`span`,null,W(r(o)(`git.workingTreeClean`)),1)])):K(``,!0),y.value&&y.value.staged.length>0?(V(),P(H,{key:1},[N(`div`,wP,[N(`span`,null,W(r(o)(`git.staged`,{count:y.value.staged.length})),1),b(r(q),{size:`small`,variant:`text`,label:r(o)(`git.unstageAll`),onClick:be},null,8,[`label`])]),(V(!0),P(H,null,F(y.value.staged,e=>(V(),P(`div`,{key:`staged-`+e,class:L([`git-file staged`,{selected:A.value===e&&j.value}]),onClick:t=>me(e,!0)},[t[30]||=N(`i`,{class:`ti ti-plus file-icon`},null,-1),N(`span`,EP,W(e),1),b(r(q),{icon:`ti ti-minus`,size:`small`,variant:`text`,severity:`secondary`,class:`file-action`,title:r(o)(`git.unstage`),onClick:_e(t=>ye(e),[`stop`])},null,8,[`title`,`onClick`])],10,TP))),128))],64)):K(``,!0),y.value&&y.value.unstaged.length>0?(V(),P(H,{key:2},[N(`div`,DP,[N(`span`,null,W(r(o)(`git.unstaged`,{count:y.value.unstaged.length})),1),b(r(q),{size:`small`,variant:`text`,label:r(o)(`git.stageAll`),onClick:ge},null,8,[`label`])]),(V(!0),P(H,null,F(y.value.unstaged,e=>(V(),P(`div`,{key:`unstaged-`+e,class:L([`git-file unstaged`,{selected:A.value===e&&!j.value}]),onClick:t=>me(e,!1)},[t[31]||=N(`i`,{class:`ti ti-pencil file-icon`},null,-1),N(`span`,kP,W(e),1),N(`div`,AP,[b(r(q),{icon:`ti ti-plus`,size:`small`,variant:`text`,title:r(o)(`git.stage`),class:`file-action`,onClick:_e(t=>he(e),[`stop`])},null,8,[`title`,`onClick`]),b(r(q),{icon:`ti ti-trash`,size:`small`,variant:`text`,severity:`danger`,title:r(o)(`git.discard`),class:`file-action`,onClick:_e(t=>xe(e),[`stop`])},null,8,[`title`,`onClick`])])],10,OP))),128))],64)):K(``,!0),y.value&&y.value.untracked.length>0?(V(),P(H,{key:3},[N(`div`,jP,[N(`span`,null,W(r(o)(`git.untracked`,{count:y.value.untracked.length})),1)]),(V(!0),P(H,null,F(y.value.untracked,e=>(V(),P(`div`,{key:`untracked-`+e,class:`git-file untracked`,onClick:t=>me(e,!1,!0)},[t[32]||=N(`i`,{class:`ti ti-help-circle file-icon`},null,-1),N(`span`,NP,W(e),1),b(r(q),{icon:`ti ti-plus`,size:`small`,variant:`text`,title:r(o)(`git.stage`),class:`file-action`,onClick:_e(t=>he(e),[`stop`])},null,8,[`title`,`onClick`])],8,MP))),128))],64)):K(``,!0)])]),_:1}),b(r(at),{size:70,"min-size":30,class:`git-panel__diff-pane-panel`},{default:U(()=>[N(`div`,PP,[A.value?(V(),P(H,{key:0},[N(`div`,FP,[N(`span`,null,W(r(o)(`git.diff`,{path:A.value||`all`})),1),N(`div`,IP,[b(r(q),{icon:`ti ti-message`,size:`small`,variant:`text`,title:r(o)(`git.askAiAboutDiff`),onClick:h},null,8,[`title`]),p.value?(V(),G(r(q),{key:0,icon:`ti ti-external-link`,size:`small`,variant:`text`,title:r(o)(`git.openInEditor`,{editor:p.value.name}),onClick:g},null,8,[`title`])):K(``,!0),b(r(q),{icon:`ti ti-x`,size:`small`,variant:`text`,onClick:t[17]||=e=>{A.value=``,D.value=``,O.value=``,k.value=``}})])]),(V(),G(rP,{key:A.value+`:`+j.value,original:O.value,modified:k.value,language:pe.value,height:`100%`},null,8,[`original`,`modified`,`language`]))],64)):(V(),P(`div`,LP,[t[33]||=N(`i`,{class:`ti ti-code`},null,-1),N(`span`,null,W(r(o)(`git.selectFileForDiff`)),1)]))])]),_:1})]),_:1})):M.value===`log`?(V(),P(`div`,RP,[S.value.length===0?(V(),P(`div`,zP,[t[34]||=N(`i`,{class:`ti ti-history`},null,-1),N(`span`,null,W(r(o)(`git.noCommits`)),1)])):K(``,!0),(V(!0),P(H,null,F(S.value,e=>(V(),P(`div`,{key:e.hash,class:`git-commit-entry`},[N(`div`,BP,W(e.shortHash),1),N(`div`,VP,[N(`div`,HP,W(e.subject),1),N(`div`,UP,W(e.author)+` · `+W(new Date(e.date).toLocaleString()),1)])]))),128))])):M.value===`branches`?(V(),P(`div`,WP,[N(`div`,GP,W(r(o)(`git.newBranch`)),1),N(`div`,KP,[b(r(Ne),{modelValue:E.value,"onUpdate:modelValue":t[18]||=e=>E.value=e,placeholder:r(o)(`git.branchNamePlaceholder`),size:`small`,class:`branch-input`},null,8,[`modelValue`,`placeholder`]),b(r(q),{label:r(o)(`git.createAndCheckout`),icon:`ti ti-plus`,size:`small`,disabled:!E.value.trim(),loading:te.value===`create-branch`,onClick:Me},null,8,[`label`,`disabled`,`loading`])]),N(`div`,qP,W(r(o)(`git.localBranches`,{count:se.value.length})),1),(V(!0),P(H,null,F(se.value,e=>(V(),P(`div`,{key:e.name,class:L([`git-branch-entry`,{current:e.current}])},[t[35]||=N(`i`,{class:`ti ti-brand-github branch-icon`},null,-1),N(`span`,JP,W(e.name),1),e.current?(V(),G(r(Be),{key:0,value:r(o)(`git.current`),severity:`success`,class:`current-tag`},null,8,[`value`])):(V(),G(r(q),{key:1,label:r(o)(`git.checkout`),size:`small`,variant:`text`,loading:te.value===`checkout`,class:`checkout-btn`,onClick:t=>Oe(e.name)},null,8,[`label`,`loading`,`onClick`])),e.current?K(``,!0):(V(),G(r(q),{key:2,label:r(o)(`git.merge`),size:`small`,variant:`text`,severity:`secondary`,loading:te.value===`merge-${e.name}`,class:`checkout-btn`,onClick:t=>ke(e.name)},null,8,[`label`,`loading`,`onClick`])),e.current?K(``,!0):(V(),G(r(q),{key:3,label:r(o)(`git.rebase`),size:`small`,variant:`text`,severity:`secondary`,loading:te.value===`rebase-${e.name}`,class:`checkout-btn`,onClick:t=>Ae(e.name)},null,8,[`label`,`loading`,`onClick`]))],2))),128)),C.value.branches.filter(e=>e.remote).length?(V(),P(H,{key:0},[N(`div`,YP,W(r(o)(`git.remoteBranches`)),1),(V(!0),P(H,null,F(C.value.branches.filter(e=>e.remote),e=>(V(),P(`div`,{key:e.name,class:`git-branch-entry remote`},[t[36]||=N(`i`,{class:`ti ti-world branch-icon`},null,-1),N(`span`,XP,W(e.name.replace(/^remotes\//,``)),1)]))),128))],64)):K(``,!0)])):M.value===`stash`?(V(),P(`div`,ZP,[N(`div`,QP,W(r(o)(`git.stashes`,{count:re.value.length})),1),re.value.length?K(``,!0):(V(),P(`div`,$P,W(r(o)(`git.noStashes`)),1)),(V(!0),P(H,null,F(re.value,e=>(V(),P(`div`,{key:e.ref,class:`git-stash-entry`},[t[37]||=N(`i`,{class:`ti ti-inbox stash-icon`},null,-1),N(`span`,{class:`stash-label`,title:e.message},[N(`span`,tF,`stash@`+W(`{`)+W(e.index)+W(`}`),1),x(` `+W(e.message),1)],8,eF),b(r(q),{label:r(o)(`git.stashPop`),size:`small`,variant:`text`,loading:te.value===`stash-pop-${e.index}`,class:`checkout-btn`,onClick:t=>Re(e.index)},null,8,[`label`,`loading`,`onClick`]),b(r(q),{label:r(o)(`git.stashApply`),size:`small`,variant:`text`,severity:`secondary`,loading:te.value===`stash-apply-${e.index}`,class:`checkout-btn`,onClick:t=>Ve(e.index)},null,8,[`label`,`loading`,`onClick`]),b(r(q),{label:r(o)(`git.stashDrop`),size:`small`,variant:`text`,severity:`danger`,loading:te.value===`stash-drop-${e.index}`,class:`checkout-btn`,onClick:t=>He(e.index)},null,8,[`label`,`loading`,`onClick`])]))),128))])):K(``,!0)],64))]))}}),[[`__scopeId`,`data-v-3eb1f17d`]]),rF=Object.defineProperty,iF=Object.getOwnPropertySymbols,aF=Object.prototype.hasOwnProperty,oF=Object.prototype.propertyIsEnumerable,sF=(e,t,n)=>t in e?rF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cF=(e,t)=>{for(var n in t||={})aF.call(t,n)&&sF(e,n,t[n]);if(iF)for(var n of iF(t))oF.call(t,n)&&sF(e,n,t[n]);return e},lF=(e,t)=>{var n={};for(var r in e)aF.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&iF)for(var r of iF(e))t.indexOf(r)<0&&oF.call(e,r)&&(n[r]=e[r]);return n},uF=`[vue-draggable-plus]: `;function dF(e){console.warn(uF+e)}function fF(e){console.error(uF+e)}function pF(e,t,n){return n>=0&&n<e.length&&e.splice(n,0,e.splice(t,1)[0]),e}function mF(e){return e.replace(/-(\w)/g,(e,t)=>t?t.toUpperCase():``)}function hF(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[mF(n)]=e[n]),t),{})}function gF(e,t){return Array.isArray(e)&&e.splice(t,1),e}function _F(e,t,n){return Array.isArray(e)&&e.splice(t,0,n),e}function vF(e){return e===void 0}function yF(e){return typeof e==`string`}function bF(e,t,n){let r=e.children[n];e.insertBefore(t,r)}function xF(e){e.parentNode&&e.parentNode.removeChild(e)}function SF(e,t=document){let n=null;return n=typeof t?.querySelector==`function`?(t?.querySelector)?.call(t,e):document.querySelector(e),n||dF(`Element not found: ${e}`),n}function CF(e,t,n=null){return function(...r){return e.apply(n,r),t.apply(n,r)}}function wF(e,t){let n=cF({},e);return Object.keys(t).forEach(r=>{n[r]?n[r]=CF(e[r],t[r]):n[r]=t[r]}),n}function TF(e){return e instanceof HTMLElement}function EF(e,t){Object.keys(e).forEach(n=>{t(n,e[n])})}function DF(e){return e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97)}var OF=Object.assign;function kF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function AF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?kF(Object(n),!0).forEach(function(t){MF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function jF(e){"@babel/helpers - typeof";return jF=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},jF(e)}function MF(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NF(){return NF=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},NF.apply(this,arguments)}function PF(e,t){if(e==null)return{};for(var n={},r=Object.keys(e),i,a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function FF(e,t){if(e==null)return{};var n=PF(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var IF=`1.15.2`;function LF(e){if(typeof window<`u`&&window.navigator)return!!navigator.userAgent.match(e)}var RF=LF(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),zF=LF(/Edge/i),BF=LF(/firefox/i),VF=LF(/safari/i)&&!LF(/chrome/i)&&!LF(/android/i),HF=LF(/iP(ad|od|hone)/i),UF=LF(/chrome/i)&&LF(/android/i),WF={capture:!1,passive:!1};function GF(e,t,n){e.addEventListener(t,n,!RF&&WF)}function KF(e,t,n){e.removeEventListener(t,n,!RF&&WF)}function qF(e,t){if(t){if(t[0]===`>`&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function JF(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function YF(e,t,n,r){if(e){n||=document;do{if(t!=null&&(t[0]===`>`?e.parentNode===n&&qF(e,t):qF(e,t))||r&&e===n)return e;if(e===n)break}while(e=JF(e))}return null}var XF=/\s+/g;function ZF(e,t,n){e&&t&&(e.classList?e.classList[n?`add`:`remove`](t):e.className=((` `+e.className+` `).replace(XF,` `).replace(` `+t+` `,` `)+(n?` `+t:``)).replace(XF,` `))}function QF(e,t,n){var r=e&&e.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,``):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in r)&&t.indexOf(`webkit`)===-1&&(t=`-webkit-`+t),r[t]=n+(typeof n==`string`?``:`px`)}}function $F(e,t){var n=``;if(typeof e==`string`)n=e;else do{var r=QF(e,`transform`);r&&r!==`none`&&(n=r+` `+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function eI(e,t,n){if(e){var r=e.getElementsByTagName(t),i=0,a=r.length;if(n)for(;i<a;i++)n(r[i],i);return r}return[]}function tI(){return document.scrollingElement||document.documentElement}function nI(e,t,n,r,i){if(e.getBoundingClientRect||e===window){var a,o,s,c,l,u,d;if(e!==window&&e.parentNode&&e!==tI()?(a=e.getBoundingClientRect(),o=a.top,s=a.left,c=a.bottom,l=a.right,u=a.height,d=a.width):(o=0,s=0,c=window.innerHeight,l=window.innerWidth,u=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(i||=e.parentNode,!RF))do if(i&&i.getBoundingClientRect&&(QF(i,`transform`)!==`none`||n&&QF(i,`position`)!==`static`)){var f=i.getBoundingClientRect();o-=f.top+parseInt(QF(i,`border-top-width`)),s-=f.left+parseInt(QF(i,`border-left-width`)),c=o+a.height,l=s+a.width;break}while(i=i.parentNode);if(r&&e!==window){var p=$F(i||e),m=p&&p.a,h=p&&p.d;p&&(o/=h,s/=m,d/=m,u/=h,c=o+u,l=s+d)}return{top:o,left:s,bottom:c,right:l,width:d,height:u}}}function rI(e,t,n){for(var r=lI(e,!0),i=nI(e)[t];r;){var a=nI(r)[n],o=void 0;if(o=i>=a,!o)return r;if(r===tI())break;r=lI(r,!1)}return!1}function iI(e,t,n,r){for(var i=0,a=0,o=e.children;a<o.length;){if(o[a].style.display!==`none`&&o[a]!==bL.ghost&&(r||o[a]!==bL.dragged)&&YF(o[a],n.draggable,e,!1)){if(i===t)return o[a];i++}a++}return null}function aI(e,t){for(var n=e.lastElementChild;n&&(n===bL.ghost||QF(n,`display`)===`none`||t&&!qF(n,t));)n=n.previousElementSibling;return n||null}function oI(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!==`TEMPLATE`&&e!==bL.clone&&(!t||qF(e,t))&&n++;return n}function sI(e){var t=0,n=0,r=tI();if(e)do{var i=$F(e),a=i.a,o=i.d;t+=e.scrollLeft*a,n+=e.scrollTop*o}while(e!==r&&(e=e.parentNode));return[t,n]}function cI(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var r in t)if(t.hasOwnProperty(r)&&t[r]===e[n][r])return Number(n)}return-1}function lI(e,t){if(!e||!e.getBoundingClientRect)return tI();var n=e,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=QF(n);if(n.clientWidth<n.scrollWidth&&(i.overflowX==`auto`||i.overflowX==`scroll`)||n.clientHeight<n.scrollHeight&&(i.overflowY==`auto`||i.overflowY==`scroll`)){if(!n.getBoundingClientRect||n===document.body)return tI();if(r||t)return n;r=!0}}while(n=n.parentNode);return tI()}function uI(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function dI(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var fI;function pI(e,t){return function(){if(!fI){var n=arguments,r=this;n.length===1?e.call(r,n[0]):e.apply(r,n),fI=setTimeout(function(){fI=void 0},t)}}}function mI(){clearTimeout(fI),fI=void 0}function hI(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function gI(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function _I(e,t,n){var r={};return Array.from(e.children).forEach(function(i){if(YF(i,t.draggable,e,!1)&&!i.animated&&i!==n){var a=nI(i);r.left=Math.min(r.left??1/0,a.left),r.top=Math.min(r.top??1/0,a.top),r.right=Math.max(r.right??-1/0,a.right),r.bottom=Math.max(r.bottom??-1/0,a.bottom)}}),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var vI=`Sortable`+new Date().getTime();function yI(){var e=[],t;return{captureAnimationState:function(){e=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(t){if(QF(t,`display`)!==`none`&&t!==bL.ghost){e.push({target:t,rect:nI(t)});var n=AF({},e[e.length-1].rect);if(t.thisAnimationDuration){var r=$F(t,!0);r&&(n.top-=r.f,n.left-=r.e)}t.fromRect=n}})},addAnimationState:function(t){e.push(t)},removeAnimationState:function(t){e.splice(cI(e,{target:t}),1)},animateAll:function(n){var r=this;if(!this.options.animation){clearTimeout(t),typeof n==`function`&&n();return}var i=!1,a=0;e.forEach(function(e){var t=0,n=e.target,o=n.fromRect,s=nI(n),c=n.prevFromRect,l=n.prevToRect,u=e.rect,d=$F(n,!0);d&&(s.top-=d.f,s.left-=d.e),n.toRect=s,n.thisAnimationDuration&&dI(c,s)&&!dI(o,s)&&(u.top-s.top)/(u.left-s.left)===(o.top-s.top)/(o.left-s.left)&&(t=xI(u,c,l,r.options)),dI(s,o)||(n.prevFromRect=o,n.prevToRect=s,t||=r.options.animation,r.animate(n,u,s,t)),t&&(i=!0,a=Math.max(a,t),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout(function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null},t),n.thisAnimationDuration=t)}),clearTimeout(t),i?t=setTimeout(function(){typeof n==`function`&&n()},a):typeof n==`function`&&n(),e=[]},animate:function(e,t,n,r){if(r){QF(e,`transition`,``),QF(e,`transform`,``);var i=$F(this.el),a=i&&i.a,o=i&&i.d,s=(t.left-n.left)/(a||1),c=(t.top-n.top)/(o||1);e.animatingX=!!s,e.animatingY=!!c,QF(e,`transform`,`translate3d(`+s+`px,`+c+`px,0)`),this.forRepaintDummy=bI(e),QF(e,`transition`,`transform `+r+`ms`+(this.options.easing?` `+this.options.easing:``)),QF(e,`transform`,`translate3d(0,0,0)`),typeof e.animated==`number`&&clearTimeout(e.animated),e.animated=setTimeout(function(){QF(e,`transition`,``),QF(e,`transform`,``),e.animated=!1,e.animatingX=!1,e.animatingY=!1},r)}}}}function bI(e){return e.offsetWidth}function xI(e,t,n,r){return Math.sqrt((t.top-e.top)**2+(t.left-e.left)**2)/Math.sqrt((t.top-n.top)**2+(t.left-n.left)**2)*r.animation}var SI=[],CI={initializeByDefault:!0},wI={mount:function(e){for(var t in CI)CI.hasOwnProperty(t)&&!(t in e)&&(e[t]=CI[t]);SI.forEach(function(t){if(t.pluginName===e.pluginName)throw`Sortable: Cannot mount plugin ${e.pluginName} more than once`}),SI.push(e)},pluginEvent:function(e,t,n){var r=this;this.eventCanceled=!1,n.cancel=function(){r.eventCanceled=!0};var i=e+`Global`;SI.forEach(function(r){t[r.pluginName]&&(t[r.pluginName][i]&&t[r.pluginName][i](AF({sortable:t},n)),t.options[r.pluginName]&&t[r.pluginName][e]&&t[r.pluginName][e](AF({sortable:t},n)))})},initializePlugins:function(e,t,n,r){for(var i in SI.forEach(function(r){var i=r.pluginName;if(e.options[i]||r.initializeByDefault){var a=new r(e,t,e.options);a.sortable=e,a.options=e.options,e[i]=a,NF(n,a.defaults)}}),e.options)if(e.options.hasOwnProperty(i)){var a=this.modifyOption(e,i,e.options[i]);a!==void 0&&(e.options[i]=a)}},getEventProperties:function(e,t){var n={};return SI.forEach(function(r){typeof r.eventProperties==`function`&&NF(n,r.eventProperties.call(t[r.pluginName],e))}),n},modifyOption:function(e,t,n){var r;return SI.forEach(function(i){e[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[t]==`function`&&(r=i.optionListeners[t].call(e[i.pluginName],n))}),r}};function TI(e){var t=e.sortable,n=e.rootEl,r=e.name,i=e.targetEl,a=e.cloneEl,o=e.toEl,s=e.fromEl,c=e.oldIndex,l=e.newIndex,u=e.oldDraggableIndex,d=e.newDraggableIndex,f=e.originalEvent,p=e.putSortable,m=e.extraEventProperties;if(t||=n&&n[vI],t){var h,g=t.options,_=`on`+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!RF&&!zF?h=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(h=document.createEvent(`Event`),h.initEvent(r,!0,!0)),h.to=o||n,h.from=s||n,h.item=i||n,h.clone=a,h.oldIndex=c,h.newIndex=l,h.oldDraggableIndex=u,h.newDraggableIndex=d,h.originalEvent=f,h.pullMode=p?p.lastPutMode:void 0;var v=AF(AF({},m),wI.getEventProperties(r,t));for(var y in v)h[y]=v[y];n&&n.dispatchEvent(h),g[_]&&g[_].call(t,h)}}var EI=[`evt`],DI=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.evt,i=FF(n,EI);wI.pluginEvent.bind(bL)(e,t,AF({dragEl:Z,parentEl:kI,ghostEl:AI,rootEl:jI,nextEl:MI,lastDownEl:NI,cloneEl:PI,cloneHidden:FI,dragStarted:ZI,putSortable:VI,activeSortable:bL.active,originalEvent:r,oldIndex:II,oldDraggableIndex:RI,newIndex:LI,newDraggableIndex:zI,hideGhostForTarget:gL,unhideGhostForTarget:_L,cloneNowHidden:function(){FI=!0},cloneNowShown:function(){FI=!1},dispatchSortableEvent:function(e){OI({sortable:t,name:e,originalEvent:r})}},i))};function OI(e){TI(AF({putSortable:VI,cloneEl:PI,targetEl:Z,rootEl:jI,oldIndex:II,oldDraggableIndex:RI,newIndex:LI,newDraggableIndex:zI},e))}var Z,kI,AI,jI,MI,NI,PI,FI,II,LI,RI,zI,BI,VI,HI=!1,UI=!1,WI=[],GI,KI,qI,JI,YI,XI,ZI,QI,$I,eL=!1,tL=!1,nL,rL,iL=[],aL=!1,oL=[],sL=typeof document<`u`,cL=HF,lL=zF||RF?`cssFloat`:`float`,uL=sL&&!UF&&!HF&&`draggable`in document.createElement(`div`),dL=function(){if(sL){if(RF)return!1;var e=document.createElement(`x`);return e.style.cssText=`pointer-events:auto`,e.style.pointerEvents===`auto`}}(),fL=function(e,t){var n=QF(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=iI(e,0,t),a=iI(e,1,t),o=i&&QF(i),s=a&&QF(a),c=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+nI(i).width,l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+nI(a).width;if(n.display===`flex`)return n.flexDirection===`column`||n.flexDirection===`column-reverse`?`vertical`:`horizontal`;if(n.display===`grid`)return n.gridTemplateColumns.split(` `).length<=1?`vertical`:`horizontal`;if(i&&o.float&&o.float!==`none`){var u=o.float===`left`?`left`:`right`;return a&&(s.clear===`both`||s.clear===u)?`vertical`:`horizontal`}return i&&(o.display===`block`||o.display===`flex`||o.display===`table`||o.display===`grid`||c>=r&&n[lL]===`none`||a&&n[lL]===`none`&&c+l>r)?`vertical`:`horizontal`},pL=function(e,t,n){var r=n?e.left:e.top,i=n?e.right:e.bottom,a=n?e.width:e.height,o=n?t.left:t.top,s=n?t.right:t.bottom,c=n?t.width:t.height;return r===o||i===s||r+a/2===o+c/2},mL=function(e,t){var n;return WI.some(function(r){var i=r[vI].options.emptyInsertThreshold;if(i&&!aI(r)){var a=nI(r),o=e>=a.left-i&&e<=a.right+i,s=t>=a.top-i&&t<=a.bottom+i;if(o&&s)return n=r}}),n},hL=function(e){function t(e,n){return function(r,i,a,o){var s=r.options.group.name&&i.options.group.name&&r.options.group.name===i.options.group.name;if(e==null&&(n||s))return!0;if(e==null||e===!1)return!1;if(n&&e===`clone`)return e;if(typeof e==`function`)return t(e(r,i,a,o),n)(r,i,a,o);var c=(n?r:i).options.group.name;return e===!0||typeof e==`string`&&e===c||e.join&&e.indexOf(c)>-1}}var n={},r=e.group;(!r||jF(r)!=`object`)&&(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},gL=function(){!dL&&AI&&QF(AI,`display`,`none`)},_L=function(){!dL&&AI&&QF(AI,`display`,``)};sL&&!UF&&document.addEventListener(`click`,function(e){if(UI)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),UI=!1,!1},!0);var vL=function(e){if(Z){e=e.touches?e.touches[0]:e;var t=mL(e.clientX,e.clientY);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[vI]._onDragOver(n)}}},yL=function(e){Z&&Z.parentNode[vI]._isOutsideThisEl(e.target)};function bL(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw`Sortable: \`el\` must be an HTMLElement, not ${{}.toString.call(e)}`;this.el=e,this.options=t=NF({},t),e[vI]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?`>li`:`>*`,swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return fL(e,this.options)},ghostClass:`sortable-ghost`,chosenClass:`sortable-chosen`,dragClass:`sortable-drag`,ignore:`a, img`,filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData(`Text`,t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:`data-id`,delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:`sortable-fallback`,fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:bL.supportPointer!==!1&&`PointerEvent`in window&&!VF,emptyInsertThreshold:5};for(var r in wI.initializePlugins(this,e,n),n)!(r in t)&&(t[r]=n[r]);for(var i in hL(t),this)i.charAt(0)===`_`&&typeof this[i]==`function`&&(this[i]=this[i].bind(this));this.nativeDraggable=!t.forceFallback&&uL,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?GF(e,`pointerdown`,this._onTapStart):(GF(e,`mousedown`,this._onTapStart),GF(e,`touchstart`,this._onTapStart)),this.nativeDraggable&&(GF(e,`dragover`,this),GF(e,`dragenter`,this)),WI.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),NF(this,yI())}bL.prototype={constructor:bL,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(QI=null)},_getDirection:function(e,t){return typeof this.options.direction==`function`?this.options.direction.call(this,e,t,Z):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,i=r.preventOnFilter,a=e.type,o=e.touches&&e.touches[0]||e.pointerType&&e.pointerType===`touch`&&e,s=(o||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,l=r.filter;if(AL(n),!Z&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||r.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&VF&&s&&s.tagName.toUpperCase()===`SELECT`)&&(s=YF(s,r.draggable,n,!1),!(s&&s.animated)&&NI!==s)){if(II=oI(s),RI=oI(s,r.draggable),typeof l==`function`){if(l.call(this,e,s,this)){OI({sortable:t,rootEl:c,name:`filter`,targetEl:s,toEl:n,fromEl:n}),DI(`filter`,t,{evt:e}),i&&e.cancelable&&e.preventDefault();return}}else if(l&&(l=l.split(`,`).some(function(r){if(r=YF(c,r.trim(),n,!1),r)return OI({sortable:t,rootEl:r,name:`filter`,targetEl:s,fromEl:n,toEl:n}),DI(`filter`,t,{evt:e}),!0}),l)){i&&e.cancelable&&e.preventDefault();return}r.handle&&!YF(c,r.handle,n,!1)||this._prepareDragStart(e,o,s)}}},_prepareDragStart:function(e,t,n){var r=this,i=r.el,a=r.options,o=i.ownerDocument,s;if(n&&!Z&&n.parentNode===i){var c=nI(n);if(jI=i,Z=n,kI=Z.parentNode,MI=Z.nextSibling,NI=n,BI=a.group,bL.dragged=Z,GI={target:Z,clientX:(t||e).clientX,clientY:(t||e).clientY},YI=GI.clientX-c.left,XI=GI.clientY-c.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,Z.style[`will-change`]=`all`,s=function(){if(DI(`delayEnded`,r,{evt:e}),bL.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!BF&&r.nativeDraggable&&(Z.draggable=!0),r._triggerDragStart(e,t),OI({sortable:r,name:`choose`,originalEvent:e}),ZF(Z,a.chosenClass,!0)},a.ignore.split(`,`).forEach(function(e){eI(Z,e.trim(),CL)}),GF(o,`dragover`,vL),GF(o,`mousemove`,vL),GF(o,`touchmove`,vL),GF(o,`mouseup`,r._onDrop),GF(o,`touchend`,r._onDrop),GF(o,`touchcancel`,r._onDrop),BF&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Z.draggable=!0),DI(`delayStart`,this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(zF||RF))){if(bL.eventCanceled){this._onDrop();return}GF(o,`mouseup`,r._disableDelayedDrag),GF(o,`touchend`,r._disableDelayedDrag),GF(o,`touchcancel`,r._disableDelayedDrag),GF(o,`mousemove`,r._delayedDragTouchMoveHandler),GF(o,`touchmove`,r._delayedDragTouchMoveHandler),a.supportPointer&&GF(o,`pointermove`,r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(s,a.delay)}else s()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Z&&CL(Z),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;KF(e,`mouseup`,this._disableDelayedDrag),KF(e,`touchend`,this._disableDelayedDrag),KF(e,`touchcancel`,this._disableDelayedDrag),KF(e,`mousemove`,this._delayedDragTouchMoveHandler),KF(e,`touchmove`,this._delayedDragTouchMoveHandler),KF(e,`pointermove`,this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t||=e.pointerType==`touch`&&e,!this.nativeDraggable||t?this.options.supportPointer?GF(document,`pointermove`,this._onTouchMove):t?GF(document,`touchmove`,this._onTouchMove):GF(document,`mousemove`,this._onTouchMove):(GF(Z,`dragend`,this),GF(jI,`dragstart`,this._onDragStart));try{document.selection?jL(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(HI=!1,jI&&Z){DI(`dragStarted`,this,{evt:t}),this.nativeDraggable&&GF(document,`dragover`,yL);var n=this.options;!e&&ZF(Z,n.dragClass,!1),ZF(Z,n.ghostClass,!0),bL.active=this,e&&this._appendGhost(),OI({sortable:this,name:`start`,originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(KI){this._lastX=KI.clientX,this._lastY=KI.clientY,gL();for(var e=document.elementFromPoint(KI.clientX,KI.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(KI.clientX,KI.clientY),e!==t);)t=e;if(Z.parentNode[vI]._isOutsideThisEl(e),t)do{if(t[vI]){var n=void 0;if(n=t[vI]._onDragOver({clientX:KI.clientX,clientY:KI.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);_L()}},_onTouchMove:function(e){if(GI){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,i=e.touches?e.touches[0]:e,a=AI&&$F(AI,!0),o=AI&&a&&a.a,s=AI&&a&&a.d,c=cL&&rL&&sI(rL),l=(i.clientX-GI.clientX+r.x)/(o||1)+(c?c[0]-iL[0]:0)/(o||1),u=(i.clientY-GI.clientY+r.y)/(s||1)+(c?c[1]-iL[1]:0)/(s||1);if(!bL.active&&!HI){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(AI){a?(a.e+=l-(qI||0),a.f+=u-(JI||0)):a={a:1,b:0,c:0,d:1,e:l,f:u};var d=`matrix(${a.a},${a.b},${a.c},${a.d},${a.e},${a.f})`;QF(AI,`webkitTransform`,d),QF(AI,`mozTransform`,d),QF(AI,`msTransform`,d),QF(AI,`transform`,d),qI=l,JI=u,KI=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!AI){var e=this.options.fallbackOnBody?document.body:jI,t=nI(Z,!0,cL,!0,e),n=this.options;if(cL){for(rL=e;QF(rL,`position`)===`static`&&QF(rL,`transform`)===`none`&&rL!==document;)rL=rL.parentNode;rL!==document.body&&rL!==document.documentElement?(rL===document&&(rL=tI()),t.top+=rL.scrollTop,t.left+=rL.scrollLeft):rL=tI(),iL=sI(rL)}AI=Z.cloneNode(!0),ZF(AI,n.ghostClass,!1),ZF(AI,n.fallbackClass,!0),ZF(AI,n.dragClass,!0),QF(AI,`transition`,``),QF(AI,`transform`,``),QF(AI,`box-sizing`,`border-box`),QF(AI,`margin`,0),QF(AI,`top`,t.top),QF(AI,`left`,t.left),QF(AI,`width`,t.width),QF(AI,`height`,t.height),QF(AI,`opacity`,`0.8`),QF(AI,`position`,cL?`absolute`:`fixed`),QF(AI,`zIndex`,`100000`),QF(AI,`pointerEvents`,`none`),bL.ghost=AI,e.appendChild(AI),QF(AI,`transform-origin`,YI/parseInt(AI.style.width)*100+`% `+XI/parseInt(AI.style.height)*100+`%`)}},_onDragStart:function(e,t){var n=this,r=e.dataTransfer,i=n.options;if(DI(`dragStart`,this,{evt:e}),bL.eventCanceled){this._onDrop();return}DI(`setupClone`,this),bL.eventCanceled||(PI=gI(Z),PI.removeAttribute(`id`),PI.draggable=!1,PI.style[`will-change`]=``,this._hideClone(),ZF(PI,this.options.chosenClass,!1),bL.clone=PI),n.cloneId=jL(function(){DI(`clone`,n),!bL.eventCanceled&&(n.options.removeCloneOnHide||jI.insertBefore(PI,Z),n._hideClone(),OI({sortable:n,name:`clone`}))}),!t&&ZF(Z,i.dragClass,!0),t?(UI=!0,n._loopId=setInterval(n._emulateDragOver,50)):(KF(document,`mouseup`,n._onDrop),KF(document,`touchend`,n._onDrop),KF(document,`touchcancel`,n._onDrop),r&&(r.effectAllowed=`move`,i.setData&&i.setData.call(n,r,Z)),GF(document,`drop`,n),QF(Z,`transform`,`translateZ(0)`)),HI=!0,n._dragStartId=jL(n._dragStarted.bind(n,t,e)),GF(document,`selectstart`,n),ZI=!0,VF&&QF(document.body,`user-select`,`none`)},_onDragOver:function(e){var t=this.el,n=e.target,r,i,a,o=this.options,s=o.group,c=bL.active,l=BI===s,u=o.sort,d=VI||c,f,p=this,m=!1;if(aL)return;function h(o,s){DI(o,p,AF({evt:e,isOwner:l,axis:f?`vertical`:`horizontal`,revert:a,dragRect:r,targetRect:i,canSort:u,fromSortable:d,target:n,completed:_,onMove:function(n,i){return SL(jI,t,Z,r,n,nI(n),e,i)},changed:v},s))}function g(){h(`dragOverAnimationCapture`),p.captureAnimationState(),p!==d&&d.captureAnimationState()}function _(r){return h(`dragOverCompleted`,{insertion:r}),r&&(l?c._hideClone():c._showClone(p),p!==d&&(ZF(Z,VI?VI.options.ghostClass:c.options.ghostClass,!1),ZF(Z,o.ghostClass,!0)),VI!==p&&p!==bL.active?VI=p:p===bL.active&&VI&&(VI=null),d===p&&(p._ignoreWhileAnimating=n),p.animateAll(function(){h(`dragOverAnimationComplete`),p._ignoreWhileAnimating=null}),p!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(n===Z&&!Z.animated||n===t&&!n.animated)&&(QI=null),!o.dragoverBubble&&!e.rootEl&&n!==document&&(Z.parentNode[vI]._isOutsideThisEl(e.target),!r&&vL(e)),!o.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),m=!0}function v(){LI=oI(Z),zI=oI(Z,o.draggable),OI({sortable:p,name:`change`,toEl:t,newIndex:LI,newDraggableIndex:zI,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),n=YF(n,o.draggable,t,!0),h(`dragOver`),bL.eventCanceled)return m;if(Z.contains(e.target)||n.animated&&n.animatingX&&n.animatingY||p._ignoreWhileAnimating===n)return _(!1);if(UI=!1,c&&!o.disabled&&(l?u||(a=kI!==jI):VI===this||(this.lastPutMode=BI.checkPull(this,c,Z,e))&&s.checkPut(this,c,Z,e))){if(f=this._getDirection(e,n)===`vertical`,r=nI(Z),h(`dragOverValid`),bL.eventCanceled)return m;if(a)return kI=jI,g(),this._hideClone(),h(`revert`),bL.eventCanceled||(MI?jI.insertBefore(Z,MI):jI.appendChild(Z)),_(!0);var y=aI(t,o.draggable);if(!y||EL(e,f,this)&&!y.animated){if(y===Z)return _(!1);if(y&&t===e.target&&(n=y),n&&(i=nI(n)),SL(jI,t,Z,r,n,i,e,!!n)!==!1)return g(),y&&y.nextSibling?t.insertBefore(Z,y.nextSibling):t.appendChild(Z),kI=t,v(),_(!0)}else if(y&&TL(e,f,this)){var b=iI(t,0,o,!0);if(b===Z)return _(!1);if(n=b,i=nI(n),SL(jI,t,Z,r,n,i,e,!1)!==!1)return g(),t.insertBefore(Z,b),kI=t,v(),_(!0)}else if(n.parentNode===t){i=nI(n);var x=0,S,C=Z.parentNode!==t,w=!pL(Z.animated&&Z.toRect||r,n.animated&&n.toRect||i,f),T=f?`top`:`left`,E=rI(n,`top`,`top`)||rI(Z,`top`,`top`),D=E?E.scrollTop:void 0;QI!==n&&(S=i[T],eL=!1,tL=!w&&o.invertSwap||C),x=DL(e,n,i,f,w?1:o.swapThreshold,o.invertedSwapThreshold==null?o.swapThreshold:o.invertedSwapThreshold,tL,QI===n);var O;if(x!==0){var k=oI(Z);do k-=x,O=kI.children[k];while(O&&(QF(O,`display`)===`none`||O===AI))}if(x===0||O===n)return _(!1);QI=n,$I=x;var A=n.nextElementSibling,j=!1;j=x===1;var M=SL(jI,t,Z,r,n,i,e,j);if(M!==!1)return(M===1||M===-1)&&(j=M===1),aL=!0,setTimeout(wL,30),g(),j&&!A?t.appendChild(Z):n.parentNode.insertBefore(Z,j?A:n),E&&hI(E,0,D-E.scrollTop),kI=Z.parentNode,S!==void 0&&!tL&&(nL=Math.abs(S-nI(n)[T])),v(),_(!0)}if(t.contains(Z))return _(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){KF(document,`mousemove`,this._onTouchMove),KF(document,`touchmove`,this._onTouchMove),KF(document,`pointermove`,this._onTouchMove),KF(document,`dragover`,vL),KF(document,`mousemove`,vL),KF(document,`touchmove`,vL)},_offUpEvents:function(){var e=this.el.ownerDocument;KF(e,`mouseup`,this._onDrop),KF(e,`touchend`,this._onDrop),KF(e,`pointerup`,this._onDrop),KF(e,`touchcancel`,this._onDrop),KF(document,`selectstart`,this)},_onDrop:function(e){var t=this.el,n=this.options;if(LI=oI(Z),zI=oI(Z,n.draggable),DI(`drop`,this,{evt:e}),kI=Z&&Z.parentNode,LI=oI(Z),zI=oI(Z,n.draggable),bL.eventCanceled){this._nulling();return}HI=!1,tL=!1,eL=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ML(this.cloneId),ML(this._dragStartId),this.nativeDraggable&&(KF(document,`drop`,this),KF(t,`dragstart`,this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),VF&&QF(document.body,`user-select`,``),QF(Z,`transform`,``),e&&(ZI&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),AI&&AI.parentNode&&AI.parentNode.removeChild(AI),(jI===kI||VI&&VI.lastPutMode!==`clone`)&&PI&&PI.parentNode&&PI.parentNode.removeChild(PI),Z&&(this.nativeDraggable&&KF(Z,`dragend`,this),CL(Z),Z.style[`will-change`]=``,ZI&&!HI&&ZF(Z,VI?VI.options.ghostClass:this.options.ghostClass,!1),ZF(Z,this.options.chosenClass,!1),OI({sortable:this,name:`unchoose`,toEl:kI,newIndex:null,newDraggableIndex:null,originalEvent:e}),jI===kI?LI!==II&&LI>=0&&(OI({sortable:this,name:`update`,toEl:kI,originalEvent:e}),OI({sortable:this,name:`sort`,toEl:kI,originalEvent:e})):(LI>=0&&(OI({rootEl:kI,name:`add`,toEl:kI,fromEl:jI,originalEvent:e}),OI({sortable:this,name:`remove`,toEl:kI,originalEvent:e}),OI({rootEl:kI,name:`sort`,toEl:kI,fromEl:jI,originalEvent:e}),OI({sortable:this,name:`sort`,toEl:kI,originalEvent:e})),VI&&VI.save()),bL.active&&((LI==null||LI===-1)&&(LI=II,zI=RI),OI({sortable:this,name:`end`,toEl:kI,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){DI(`nulling`,this),jI=Z=kI=AI=MI=PI=NI=FI=GI=KI=ZI=LI=zI=II=RI=QI=$I=VI=BI=bL.dragged=bL.ghost=bL.clone=bL.active=null,oL.forEach(function(e){e.checked=!0}),oL.length=qI=JI=0},handleEvent:function(e){switch(e.type){case`drop`:case`dragend`:this._onDrop(e);break;case`dragenter`:case`dragover`:Z&&(this._onDragOver(e),xL(e));break;case`selectstart`:e.preventDefault()}},toArray:function(){for(var e=[],t,n=this.el.children,r=0,i=n.length,a=this.options;r<i;r++)t=n[r],YF(t,a.draggable,this.el,!1)&&e.push(t.getAttribute(a.dataIdAttr)||kL(t));return e},sort:function(e,t){var n={},r=this.el;this.toArray().forEach(function(e,t){var i=r.children[t];YF(i,this.options.draggable,r,!1)&&(n[e]=i)},this),t&&this.captureAnimationState(),e.forEach(function(e){n[e]&&(r.removeChild(n[e]),r.appendChild(n[e]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return YF(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(t===void 0)return n[e];var r=wI.modifyOption(this,e,t);n[e]=r===void 0?t:r,e===`group`&&hL(n)},destroy:function(){DI(`destroy`,this);var e=this.el;e[vI]=null,KF(e,`mousedown`,this._onTapStart),KF(e,`touchstart`,this._onTapStart),KF(e,`pointerdown`,this._onTapStart),this.nativeDraggable&&(KF(e,`dragover`,this),KF(e,`dragenter`,this)),Array.prototype.forEach.call(e.querySelectorAll(`[draggable]`),function(e){e.removeAttribute(`draggable`)}),this._onDrop(),this._disableDelayedDragEvents(),WI.splice(WI.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!FI){if(DI(`hideClone`,this),bL.eventCanceled)return;QF(PI,`display`,`none`),this.options.removeCloneOnHide&&PI.parentNode&&PI.parentNode.removeChild(PI),FI=!0}},_showClone:function(e){if(e.lastPutMode!==`clone`){this._hideClone();return}if(FI){if(DI(`showClone`,this),bL.eventCanceled)return;Z.parentNode==jI&&!this.options.group.revertClone?jI.insertBefore(PI,Z):MI?jI.insertBefore(PI,MI):jI.appendChild(PI),this.options.group.revertClone&&this.animate(Z,PI),QF(PI,`display`,``),FI=!1}}};function xL(e){e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),e.cancelable&&e.preventDefault()}function SL(e,t,n,r,i,a,o,s){var c,l=e[vI],u=l.options.onMove,d;return window.CustomEvent&&!RF&&!zF?c=new CustomEvent(`move`,{bubbles:!0,cancelable:!0}):(c=document.createEvent(`Event`),c.initEvent(`move`,!0,!0)),c.to=t,c.from=e,c.dragged=n,c.draggedRect=r,c.related=i||t,c.relatedRect=a||nI(t),c.willInsertAfter=s,c.originalEvent=o,e.dispatchEvent(c),u&&(d=u.call(l,c,o)),d}function CL(e){e.draggable=!1}function wL(){aL=!1}function TL(e,t,n){var r=nI(iI(n.el,0,n.options,!0)),i=_I(n.el,n.options,AI),a=10;return t?e.clientX<i.left-a||e.clientY<r.top&&e.clientX<r.right:e.clientY<i.top-a||e.clientY<r.bottom&&e.clientX<r.left}function EL(e,t,n){var r=nI(aI(n.el,n.options.draggable)),i=_I(n.el,n.options,AI),a=10;return t?e.clientX>i.right+a||e.clientY>r.bottom&&e.clientX>r.left:e.clientY>i.bottom+a||e.clientX>r.right&&e.clientY>r.top}function DL(e,t,n,r,i,a,o,s){var c=r?e.clientY:e.clientX,l=r?n.height:n.width,u=r?n.top:n.left,d=r?n.bottom:n.right,f=!1;if(!o){if(s&&nL<l*i){if(!eL&&($I===1?c>u+l*a/2:c<d-l*a/2)&&(eL=!0),eL)f=!0;else if($I===1?c<u+nL:c>d-nL)return-$I}else if(c>u+l*(1-i)/2&&c<d-l*(1-i)/2)return OL(t)}return f||=o,f&&(c<u+l*a/2||c>d-l*a/2)?c>u+l/2?1:-1:0}function OL(e){return oI(Z)<oI(e)?1:-1}function kL(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,r=0;n--;)r+=t.charCodeAt(n);return r.toString(36)}function AL(e){oL.length=0;for(var t=e.getElementsByTagName(`input`),n=t.length;n--;){var r=t[n];r.checked&&oL.push(r)}}function jL(e){return setTimeout(e,0)}function ML(e){return clearTimeout(e)}sL&&GF(document,`touchmove`,function(e){(bL.active||HI)&&e.cancelable&&e.preventDefault()}),bL.utils={on:GF,off:KF,css:QF,find:eI,is:function(e,t){return!!YF(e,t,e,!1)},extend:uI,throttle:pI,closest:YF,toggleClass:ZF,clone:gI,index:oI,nextTick:jL,cancelNextTick:ML,detectDirection:fL,getChild:iI},bL.get=function(e){return e[vI]},bL.mount=function(){var e=[...arguments];e[0].constructor===Array&&(e=e[0]),e.forEach(function(e){if(!e.prototype||!e.prototype.constructor)throw`Sortable: Mounted plugin must be a constructor function, not ${{}.toString.call(e)}`;e.utils&&(bL.utils=AF(AF({},bL.utils),e.utils)),wI.mount(e)})},bL.create=function(e,t){return new bL(e,t)},bL.version=IF;var NL=[],PL,FL,IL=!1,LL,RL,zL,BL;function VL(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)e.charAt(0)===`_`&&typeof this[e]==`function`&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?GF(document,`dragover`,this._handleAutoScroll):this.options.supportPointer?GF(document,`pointermove`,this._handleFallbackAutoScroll):t.touches?GF(document,`touchmove`,this._handleFallbackAutoScroll):GF(document,`mousemove`,this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;!this.options.dragOverBubble&&!t.rootEl&&this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?KF(document,`dragover`,this._handleAutoScroll):(KF(document,`pointermove`,this._handleFallbackAutoScroll),KF(document,`touchmove`,this._handleFallbackAutoScroll),KF(document,`mousemove`,this._handleFallbackAutoScroll)),UL(),HL(),mI()},nulling:function(){zL=FL=PL=IL=BL=LL=RL=null,NL.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,r=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,a=document.elementFromPoint(r,i);if(zL=e,t||this.options.forceAutoScrollFallback||zF||RF||VF){WL(e,this.options,a,t);var o=lI(a,!0);IL&&(!BL||r!==LL||i!==RL)&&(BL&&UL(),BL=setInterval(function(){var a=lI(document.elementFromPoint(r,i),!0);a!==o&&(o=a,HL()),WL(e,n.options,a,t)},10),LL=r,RL=i)}else{if(!this.options.bubbleScroll||lI(a,!0)===tI()){HL();return}WL(e,this.options,lI(a,!1),!1)}}},NF(e,{pluginName:`scroll`,initializeByDefault:!0})}function HL(){NL.forEach(function(e){clearInterval(e.pid)}),NL=[]}function UL(){clearInterval(BL)}var WL=pI(function(e,t,n,r){if(t.scroll){var i=(e.touches?e.touches[0]:e).clientX,a=(e.touches?e.touches[0]:e).clientY,o=t.scrollSensitivity,s=t.scrollSpeed,c=tI(),l=!1,u;FL!==n&&(FL=n,HL(),PL=t.scroll,u=t.scrollFn,PL===!0&&(PL=lI(n,!0)));var d=0,f=PL;do{var p=f,m=nI(p),h=m.top,g=m.bottom,_=m.left,v=m.right,y=m.width,b=m.height,x=void 0,S=void 0,C=p.scrollWidth,w=p.scrollHeight,T=QF(p),E=p.scrollLeft,D=p.scrollTop;p===c?(x=y<C&&(T.overflowX===`auto`||T.overflowX===`scroll`||T.overflowX===`visible`),S=b<w&&(T.overflowY===`auto`||T.overflowY===`scroll`||T.overflowY===`visible`)):(x=y<C&&(T.overflowX===`auto`||T.overflowX===`scroll`),S=b<w&&(T.overflowY===`auto`||T.overflowY===`scroll`));var O=x&&(Math.abs(v-i)<=o&&E+y<C)-(Math.abs(_-i)<=o&&!!E),k=S&&(Math.abs(g-a)<=o&&D+b<w)-(Math.abs(h-a)<=o&&!!D);if(!NL[d])for(var A=0;A<=d;A++)NL[A]||(NL[A]={});(NL[d].vx!=O||NL[d].vy!=k||NL[d].el!==p)&&(NL[d].el=p,NL[d].vx=O,NL[d].vy=k,clearInterval(NL[d].pid),(O!=0||k!=0)&&(l=!0,NL[d].pid=setInterval(function(){r&&this.layer===0&&bL.active._onTouchMove(zL);var t=NL[this.layer].vy?NL[this.layer].vy*s:0,n=NL[this.layer].vx?NL[this.layer].vx*s:0;typeof u==`function`&&u.call(bL.dragged.parentNode[vI],n,t,e,zL,NL[this.layer].el)!==`continue`||hI(NL[this.layer].el,n,t)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&f!==c&&(f=lI(f,!1)));IL=l}},30),GL=function(e){var t=e.originalEvent,n=e.putSortable,r=e.dragEl,i=e.activeSortable,a=e.dispatchSortableEvent,o=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(t){var c=n||i;o();var l=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,u=document.elementFromPoint(l.clientX,l.clientY);s(),c&&!c.el.contains(u)&&(a(`spill`),this.onSpill({dragEl:r,putSortable:n}))}};function KL(){}KL.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var r=iI(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(t,r):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:GL},NF(KL,{pluginName:`revertOnSpill`});function qL(){}qL.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:GL},NF(qL,{pluginName:`removeOnSpill`}),bL.mount(new VL),bL.mount(qL,KL);function JL(e){return e==null?e:JSON.parse(JSON.stringify(e))}function YL(e){T()&&ee(e)}function XL(e){T()?I(e):ce(e)}var ZL=null,QL=null;function $L(e=null,t=null){ZL=e,QL=t}function eR(){return{data:ZL,clonedData:QL}}var tR=Symbol(`cloneElement`);function nR(...e){let t=T()?.proxy,n=null,i=e[0],[,a,o]=e;Array.isArray(r(a))||(o=a,a=null);let s=null,{immediate:c=!0,clone:l=JL,forceFallback:u,fallbackOnBody:d,customUpdate:f}=r(o)??{};function p(e){let{from:t,oldIndex:i,item:o}=e,s=Array.from(t.childNodes);n=u&&!d?s.slice(0,-1):s;let c=r(r(a)?.[i]),f=l(c);$L(c,f),o[tR]=f}function h(e){let t=e.item[tR];if(!vF(t)){if(xF(e.item),m(a)){let n=[...r(a)];a.value=_F(n,e.newDraggableIndex,t);return}_F(r(a),e.newDraggableIndex,t)}}function g(e){let{from:t,item:n,oldIndex:i,oldDraggableIndex:o,pullMode:s,clone:c}=e;if(bF(t,n,i),s===`clone`){xF(c);return}if(m(a)){let e=[...r(a)];a.value=gF(e,o);return}gF(r(a),o)}function _(e){if(f){f(e);return}let{from:t,item:n,oldIndex:i,oldDraggableIndex:o,newDraggableIndex:s}=e;if(xF(n),bF(t,n,i),m(a)){let e=[...r(a)];a.value=pF(e,o,s);return}pF(r(a),o,s)}function v(e){let{newIndex:t,oldIndex:r,from:i,to:a}=e,o=null,s=t===r&&i===a;try{if(s){let e=null;n?.some((t,r)=>{if(e&&n?.length!==a.childNodes.length)return i.insertBefore(e,t.nextSibling),!0;let o=a.childNodes[r];e=a?.replaceChild(t,o)})}}catch(e){o=e}finally{n=null}ce(()=>{if($L(),o)throw o})}let y={onUpdate:_,onStart:p,onAdd:h,onRemove:g,onEnd:v};function b(e){let n=r(i);return e||=yF(n)?SF(n,t?.$el):n,e&&!TF(e)&&(e=e.$el),e||fF(`Root element not found`),e}function x(){let e=r(o)??{},{immediate:t,clone:n}=e,i=lF(e,[`immediate`,`clone`]);return EF(i,(e,t)=>{DF(e)&&(i[e]=(e,...n)=>(OF(e,eR()),t(e,...n)))}),wF(a===null?{}:y,i)}let S=e=>{e=b(e),s&&w.destroy(),s=new bL(e,x())};C(()=>o,()=>{s&&EF(x(),(e,t)=>{s?.option(e,t)})},{deep:!0});let w={option:(e,t)=>s?.option(e,t),destroy:()=>{s?.destroy(),s=null},save:()=>s?.save(),toArray:()=>s?.toArray(),closest:(...e)=>s?.closest(...e)};return XL(()=>{c&&S()}),YL(w.destroy),cF({start:S,pause:()=>w?.option(`disabled`,!0),resume:()=>w?.option(`disabled`,!1)},w)}var rR=[`update`,`start`,`add`,`remove`,`choose`,`unchoose`,`end`,`sort`,`filter`,`clone`,`move`,`change`],iR=[`clone`,`animation`,`ghostClass`,`group`,`sort`,`disabled`,`store`,`handle`,`draggable`,`swapThreshold`,`invertSwap`,`invertedSwapThreshold`,`removeCloneOnHide`,`direction`,`chosenClass`,`dragClass`,`ignore`,`filter`,`preventOnFilter`,`easing`,`setData`,`dropBubble`,`dragoverBubble`,`dataIdAttr`,`delay`,`delayOnTouchOnly`,`touchStartThreshold`,`forceFallback`,`fallbackClass`,`fallbackOnBody`,`fallbackTolerance`,`fallbackOffset`,`supportPointer`,`emptyInsertThreshold`,`scroll`,`forceAutoScrollFallback`,`scrollSensitivity`,`scrollSpeed`,`bubbleScroll`,`modelValue`,`tag`,`target`,`customUpdate`,...rR.map(e=>`on${e.replace(/^\S/,e=>e.toUpperCase())}`)],aR=B({name:`VueDraggable`,model:{prop:`modelValue`,event:`update:modelValue`},props:iR,emits:[`update:modelValue`,...rR],setup(e,{slots:t,emit:n,expose:a,attrs:o}){let s=rR.reduce((e,t)=>{let r=`on${t.replace(/^\S/,e=>e.toUpperCase())}`;return e[r]=(...e)=>n(t,...e),e},{}),l=z(()=>{let t=c(e),{modelValue:n}=t,i=lF(t,[`modelValue`]),a=Object.entries(i).reduce((e,[t,n])=>{let i=r(n);return i!==void 0&&(e[t]=i),e},{});return cF(cF({},s),hF(cF(cF({},o),a)))}),u=z({get:()=>e.modelValue,set:e=>n(`update:modelValue`,e)}),d=i(),f=g(nR(e.target||d,u,l));return a(f),()=>v(e.tag||`div`,{ref:d},(t?.default)?.call(t,f))}}),oR={mounted:`mounted`,unmounted:`unmounted`};oR.mounted,oR.unmounted;var sR=[`title`],cR=[`title`],lR=[`title`],uR=[`title`],dR=[`title`],fR=[`title`],pR={key:0,class:`ti ti-sitemap`,style:{"font-size":`0.7rem`,opacity:`0.6`,"margin-right":`4px`}},mR={key:1,class:`ti ti-table`,style:{"font-size":`0.7rem`,opacity:`0.6`,"margin-right":`4px`}},hR={class:`ai-chat-conv-item__actions`},gR=[`title`],_R=[`title`],vR=Je(B({__name:`AiChatConvItem`,props:{conv:{},active:{type:Boolean},archived:{type:Boolean},streaming:{type:Boolean},unread:{type:Boolean},companionThinking:{type:Boolean}},emits:[`select`,`rename`,`set-archived`,`delete`],setup(e,{emit:t}){let{t:n}=ve(),a=we(),o=e;function s(e,t){a.push(t?{name:`kanban-card`,params:{id:e,cardId:t}}:{name:`kanban-board`,params:{id:e}})}let c=t,l=i(!1),u=i(``),d=i(null);function f(){u.value=o.conv.title,l.value=!0,ce(()=>d.value?.$el?.select())}function p(){if(!l.value)return;l.value=!1;let e=u.value.trim();e&&e!==o.conv.title&&c(`rename`,o.conv.id,e)}return(t,i)=>(V(),P(`div`,{class:L([`ai-chat-conv-item`,{"ai-chat-conv-item--active":e.active}]),onClick:i[6]||=t=>c(`select`,e.conv.id)},[l.value?(V(),G(r(Ne),{key:0,ref_key:`inputEl`,ref:d,modelValue:u.value,"onUpdate:modelValue":i[0]||=e=>u.value=e,size:`small`,class:`ai-chat-conv-item__rename-input`,autofocus:``,onBlur:p,onKeydown:[pe(_e(p,[`prevent`]),[`enter`]),i[1]||=pe(e=>l.value=!1,[`esc`])],onClick:i[2]||=_e(()=>{},[`stop`])},null,8,[`modelValue`,`onKeydown`])):(V(),P(H,{key:1},[e.archived?K(``,!0):(V(),P(H,{key:0},[e.companionThinking?(V(),P(`span`,{key:0,class:`ai-chat-conv-item__badge ai-chat-conv-item__badge--companion`,title:r(n)(`aiChat.companionReadingNow`)},null,8,sR)):e.streaming?(V(),P(`span`,{key:1,class:`ai-chat-conv-item__badge ai-chat-conv-item__badge--streaming`,title:r(n)(`aiChatPage.generating`)},null,8,cR)):e.conv.workflowType===`scenario`&&e.conv.scenarioWaitingInputs&&Object.keys(e.conv.scenarioWaitingInputs).length>0?(V(),P(`span`,{key:2,class:`ai-chat-conv-item__badge ai-chat-conv-item__badge--scenario-waiting`,title:r(n)(`aiChatPage.waitingForResponse`)},null,8,lR)):e.conv.workflowType===`scenario`&&e.conv.scenarioRunning?(V(),P(`span`,{key:3,class:`ai-chat-conv-item__badge ai-chat-conv-item__badge--scenario-running`,title:r(n)(`aiChatPage.scenarioRunning`)},null,8,uR)):e.unread?(V(),P(`span`,{key:4,class:`ai-chat-conv-item__badge ai-chat-conv-item__badge--unread`,title:r(n)(`aiChatPage.unreadMessages`)},null,8,dR)):K(``,!0)],64)),N(`span`,{class:`ai-chat-conv-item__title`,title:r(n)(`aiChat.rename`),onDblclick:_e(f,[`stop`])},[e.conv.workflowType===`scenario`?(V(),P(`i`,pR)):!e.archived&&e.conv.kanbanBoardId?(V(),P(`i`,mR)):K(``,!0),x(` `+W(e.conv.title),1)],40,fR),N(`div`,hR,[!e.archived&&e.conv.kanbanBoardId?(V(),P(`button`,{key:0,class:`ai-chat-conv-item__icon-btn`,title:`Ouvrir le tableau`,onClick:i[3]||=_e(t=>s(e.conv.kanbanBoardId,e.conv.kanbanCardId),[`stop`])},[...i[7]||=[N(`i`,{class:`ti ti-arrow-up-right`},null,-1)]])):K(``,!0),N(`button`,{class:`ai-chat-conv-item__icon-btn`,title:e.archived?r(n)(`aiChatPage.unarchive`):r(n)(`aiChatPage.archive`),onClick:i[4]||=_e(t=>c(`set-archived`,e.conv.id,!e.archived),[`stop`])},[N(`i`,{class:`ti ti-inbox`,style:re(e.archived?`opacity:0.5`:void 0)},null,4)],8,gR),N(`button`,{class:`ai-chat-conv-item__icon-btn ai-chat-conv-item__icon-btn--danger`,title:r(n)(`actions.delete`),onClick:i[5]||=_e(t=>c(`delete`,e.conv.id),[`stop`])},[...i[8]||=[N(`i`,{class:`ti ti-trash`},null,-1)]],8,_R)])],64))],2))}}),[[`__scopeId`,`data-v-2384a988`]]),yR=`ti ti-sparkles`,bR=`ti ti-messages`,xR={class:`ai-chat-sidebar`},SR={class:`ai-chat-sidebar__header`},CR={class:`ai-chat-sidebar__title`},wR={class:`ai-chat-sidebar__search`},TR={class:`ai-chat-sidebar__api-key-wrap`},ER={key:0,class:`ai-chat-sidebar__no-provider`},DR={class:`ai-chat-sidebar__conv-list`},OR={class:`ai-chat-sidebar__pinned-card-title`},kR={class:`ai-chat-sidebar__drop-wrap`},AR={key:0,class:`ai-chat-sidebar__pinned-hint`},jR=[`data-testid`],MR={class:`ai-chat-sidebar__section-header`},NR=[`title`],PR=[`onDblclick`],FR=[`title`,`aria-label`,`onClick`],IR={class:`ai-chat-sidebar__drop-wrap`},LR={key:0,class:`ai-chat-sidebar__pinned-hint`},RR={key:0,class:`ai-chat-sidebar__menu`},zR={class:`ai-chat-sidebar__drop-wrap ai-chat-sidebar__unpin-zone`},BR={class:`ai-chat-sidebar__pinned-hint`},VR={key:1,class:`ai-chat-sidebar__group-title`},HR={key:2,class:`ai-chat-sidebar__group-title`},UR={key:3,class:`ai-chat-sidebar__empty-list`},WR={key:0,class:`ai-chat-sidebar__archive-section`},GR={key:0,class:`ai-chat-sidebar__archive-matches`},KR={key:0,class:`ai-chat-sidebar__archive-body`},qR={class:`ai-chat-sidebar__conv-list ai-chat-sidebar__conv-list--archive`},JR={key:0,class:`ai-chat-sidebar__empty-list`},YR=Je(B({__name:`AiChatSidebar`,emits:[`start-new`,`select-conversation`,`delete-conversation`],setup(e,{emit:t}){let{t:n}=ve(),a=lt(),{activeId:o,filteredConversations:s,pinnedConversations:c,sections:l,sectionConversations:u,archivedConversations:d,streamingConvIds:f,unreadConvIds:p,claudeCodeAvailable:m,codexAvailable:h,providers:g}=ye(a),_=i(``),v=z(()=>_.value.trim().length>0),y=i(!1),S=0,w=()=>new Date().toISOString();function T(e){let t=_.value.trim().toLowerCase();return!t||e.title.toLowerCase().includes(t)}let E=z(()=>d.value.filter(T));function D(e,t){a.renameConversation(e,t)}let O=z(()=>s.value.filter(T)),A=z(()=>O.value.filter(ut)),j=z(()=>O.value.filter(e=>!ut(e))),te={animation:150,delay:300,delayOnTouchOnly:!0},ne=i([]),B=i([]),re=i([]),ae=i([]),oe=z(()=>c.value.filter(T));C(oe,e=>{ne.value=[...e]},{immediate:!0}),C(A,e=>{B.value=[...e]},{immediate:!0}),C(j,e=>{re.value=[...e]},{immediate:!0});let se=i([]),le=i({});C(l,e=>{se.value=[...e]},{immediate:!0});let ue=z(()=>{let e={};for(let[t,n]of Object.entries(u.value))e[t]=n.filter(T);return e});C(ue,e=>{le.value={...e}},{immediate:!0});let de=i(!1),fe=z(()=>de.value&&A.value.length===0&&j.value.length===0);function he(){if(de.value=!1,ae.value=[],v.value)return;let e={};for(let[t,n]of Object.entries(le.value))e[t]=n.map(e=>e.id);a.applyLayout({pinned:ne.value.map(e=>e.id),sections:e})}function ge(){v.value||a.reorderSections(se.value.map(e=>e.id))}let be=i(null),xe=i(``);function Se(e){be.value=e.id,xe.value=e.name,ce(()=>{let t=document.querySelector(`[data-section-input="${e.id}"]`);t?.focus(),t?.select()})}function Ce(){let e=be.value;if(!e)return;be.value=null;let t=xe.value.trim(),n=l.value.find(t=>t.id===e);t&&n&&t!==n.name&&a.renameSection(e,t)}function we(){be.value=null}async function Te(){let e=await a.createSection(n(`aiChat.newSectionName`));e&&Se(e)}let Ee=i(null),De=i(null);function Oe(e,t){De.value=e,Ee.value?.toggle(t)}function ke(e){let t=De.value;Ee.value?.hide(),t&&e(t)}let Ae=i(!1);C([v,E],([e,t])=>{y.value=e?Ae.value||t.length>0:Ae.value});function Me(){Ae.value=!y.value,y.value=!y.value}let Pe=t;function Fe(){Pe(`start-new`)}function Ie(e){Pe(`select-conversation`,e)}function Le(e){Pe(`delete-conversation`,e)}return I(()=>{st()&&console.log(`[ai-chat][sidebar]`,w(),`mounted`,{activeId:o.value,visible:s.value.length,archived:d.value.length,unread:p.value.size,streaming:f.value.size,visibleOrder:s.value.map(e=>e.id.slice(0,8))})}),ie(()=>{S+=1,st()&&console.log(`[ai-chat][sidebar]`,w(),`updated`,{count:S,activeId:o.value,visible:s.value.length,archived:d.value.length,unread:p.value.size,streaming:f.value.size})}),ee(()=>{st()&&console.log(`[ai-chat][sidebar]`,w(),`unmounted`,{updates:S})}),(e,t)=>{let i=k(`router-link`);return V(),P(`aside`,xR,[N(`div`,SR,[N(`span`,CR,[N(`i`,{class:L(r(yR))},null,2),x(` `+W(r(n)(`aiChat.title`)),1)]),b(r(q),{icon:`ti ti-plus`,variant:`text`,rounded:``,size:`small`,title:r(n)(`aiChat.newConversation`),onClick:Fe},null,8,[`title`])]),N(`div`,wR,[t[20]||=N(`i`,{class:`ti ti-search ai-chat-sidebar__search-icon`},null,-1),b(r(Ne),{modelValue:_.value,"onUpdate:modelValue":t[0]||=e=>_.value=e,type:`search`,placeholder:r(n)(`aiChat.searchPlaceholder`),class:`ai-chat-sidebar__search-input`,"data-testid":`ai-chat-search`},null,8,[`modelValue`,`placeholder`])]),N(`div`,TR,[!r(m)&&!r(h)&&r(g).length===0?(V(),P(`div`,ER,[t[21]||=N(`i`,{class:`ti ti-alert-triangle`},null,-1),N(`span`,null,[x(W(r(n)(`aiChatPage.configureProviderPrefix`))+` `,1),b(i,{to:{name:`settings`,query:{section:`ai`}}},{default:U(()=>[x(W(r(n)(`settings.title`)),1)]),_:1})])])):K(``,!0)]),N(`div`,DR,[N(`section`,{class:L([`ai-chat-sidebar__pinned-card`,{"ai-chat-sidebar__pinned-card--awaiting":ne.value.length===0}])},[N(`div`,OR,[t[22]||=N(`i`,{class:`ti ti-pin`},null,-1),x(` `+W(r(n)(`aiChat.pinnedGroup`)),1)]),N(`div`,kR,[b(r(aR),R({modelValue:ne.value,"onUpdate:modelValue":t[2]||=e=>ne.value=e,group:{name:`ai-chat-conversations`},disabled:v.value},te,{class:`ai-chat-sidebar__pinned-drop`,onStart:t[3]||=e=>de.value=!0,onEnd:he,onAdd:he}),{default:U(()=>[(V(!0),P(H,null,F(ne.value,e=>(V(),G(vR,{key:e.id,conv:e,active:e.id===r(o),streaming:r(f).has(e.id),unread:r(p).has(e.id),"companion-thinking":r(a).isCompanionThinkingFor(e.id),onSelect:Ie,onRename:D,onSetArchived:t[1]||=(e,t)=>r(a).archiveConversation(e,t),onDelete:Le},null,8,[`conv`,`active`,`streaming`,`unread`,`companion-thinking`]))),128))]),_:1},16,[`modelValue`,`disabled`]),ne.value.length===0?(V(),P(`div`,AR,W(r(n)(`aiChat.pinnedDropHint`)),1)):K(``,!0)])],2),b(r(aR),R({modelValue:se.value,"onUpdate:modelValue":t[7]||=e=>se.value=e,disabled:v.value},te,{handle:`.ai-chat-sidebar__section-handle`,class:`ai-chat-sidebar__sections`,onEnd:ge}),{default:U(()=>[(V(!0),P(H,null,F(se.value,e=>(V(),P(`section`,{key:e.id,class:`ai-chat-sidebar__section-card`,"data-testid":`ai-chat-section-${e.id}`},[N(`div`,MR,[N(`i`,{class:`ti ti-menu-2 ai-chat-sidebar__section-handle`,title:r(n)(`aiChat.sectionMove`)},null,8,NR),be.value===e.id?(V(),G(r(Ne),{key:0,modelValue:xe.value,"onUpdate:modelValue":t[4]||=e=>xe.value=e,"data-section-input":e.id,maxlength:`80`,class:`ai-chat-sidebar__section-input`,onKeydown:[pe(_e(Ce,[`prevent`]),[`enter`]),pe(_e(we,[`prevent`]),[`esc`])],onBlur:Ce},null,8,[`modelValue`,`data-section-input`,`onKeydown`])):(V(),P(`span`,{key:1,class:`ai-chat-sidebar__section-name`,onDblclick:t=>Se(e)},W(e.name),41,PR)),N(`button`,{class:`ai-chat-sidebar__section-menu`,title:r(n)(`aiChat.sectionMenu`),"aria-label":r(n)(`aiChat.sectionMenu`),onClick:t=>Oe(e,t)},[...t[23]||=[N(`i`,{class:`ti ti-dots-vertical`},null,-1)]],8,FR)]),N(`div`,IR,[b(r(aR),R({modelValue:le.value[e.id],"onUpdate:modelValue":t=>le.value[e.id]=t,group:{name:`ai-chat-conversations`},disabled:v.value},{ref_for:!0},te,{class:`ai-chat-sidebar__pinned-drop`,onStart:t[6]||=e=>de.value=!0,onEnd:he,onAdd:he}),{default:U(()=>[(V(!0),P(H,null,F(le.value[e.id]??[],e=>(V(),G(vR,{key:e.id,conv:e,active:e.id===r(o),streaming:r(f).has(e.id),unread:r(p).has(e.id),"companion-thinking":r(a).isCompanionThinkingFor(e.id),onSelect:Ie,onRename:D,onSetArchived:t[5]||=(e,t)=>r(a).archiveConversation(e,t),onDelete:Le},null,8,[`conv`,`active`,`streaming`,`unread`,`companion-thinking`]))),128))]),_:2},1040,[`modelValue`,`onUpdate:modelValue`,`disabled`]),(le.value[e.id]??[]).length===0?(V(),P(`div`,LR,W(r(n)(`aiChat.sectionDropHint`)),1)):K(``,!0)])],8,jR))),128))]),_:1},16,[`modelValue`,`disabled`]),v.value?K(``,!0):(V(),P(`button`,{key:0,class:`ai-chat-sidebar__new-section`,"data-testid":`ai-chat-new-section`,onClick:Te},[t[24]||=N(`i`,{class:`ti ti-plus`},null,-1),x(` `+W(r(n)(`aiChat.newSection`)),1)])),b(r(je),{ref_key:`sectionMenu`,ref:Ee},{default:U(()=>[De.value?(V(),P(`div`,RR,[N(`button`,{class:`ai-chat-sidebar__menu-item`,onClick:t[8]||=e=>ke(Se)},[t[25]||=N(`i`,{class:`ti ti-pencil`},null,-1),N(`span`,null,W(r(n)(`aiChat.sectionRename`)),1)]),N(`button`,{class:`ai-chat-sidebar__menu-item ai-chat-sidebar__menu-item--danger`,onClick:t[9]||=e=>ke(e=>r(a).deleteSection(e.id))},[t[26]||=N(`i`,{class:`ti ti-trash`},null,-1),N(`span`,null,W(r(n)(`aiChat.sectionDelete`)),1)])])):K(``,!0)]),_:1},512),M(N(`div`,zR,[b(r(aR),R({modelValue:ae.value,"onUpdate:modelValue":t[10]||=e=>ae.value=e,group:{name:`ai-chat-conversations`},disabled:v.value,sort:!1},te,{class:`ai-chat-sidebar__unpinned-drop ai-chat-sidebar__unpin-drop`,onAdd:he}),null,16,[`modelValue`,`disabled`]),N(`div`,BR,W(r(n)(`aiChat.unpinDropHint`)),1)],512),[[me,fe.value]]),A.value.length>0&&j.value.length>0?(V(),P(`div`,VR,[t[27]||=N(`i`,{class:`ti ti-device-desktop`},null,-1),x(` `+W(r(n)(`scenarioSelector.cliGroup`)),1)])):K(``,!0),M(b(r(aR),R({modelValue:B.value,"onUpdate:modelValue":t[12]||=e=>B.value=e,group:{name:`ai-chat-conversations`},disabled:v.value,sort:!1},te,{class:`ai-chat-sidebar__unpinned-drop`,onStart:t[13]||=e=>de.value=!0,onEnd:t[14]||=e=>de.value=!1,onAdd:he}),{default:U(()=>[(V(!0),P(H,null,F(B.value,e=>(V(),G(vR,{key:e.id,conv:e,active:e.id===r(o),streaming:r(f).has(e.id),unread:r(p).has(e.id),"companion-thinking":r(a).isCompanionThinkingFor(e.id),onSelect:Ie,onRename:D,onSetArchived:t[11]||=(e,t)=>r(a).archiveConversation(e,t),onDelete:Le},null,8,[`conv`,`active`,`streaming`,`unread`,`companion-thinking`]))),128))]),_:1},16,[`modelValue`,`disabled`]),[[me,A.value.length>0]]),j.value.length>0&&A.value.length>0?(V(),P(`div`,HR,[t[28]||=N(`i`,{class:`ti ti-cloud`},null,-1),x(` `+W(r(n)(`scenarioSelector.apiGroup`)),1)])):K(``,!0),M(b(r(aR),R({modelValue:re.value,"onUpdate:modelValue":t[16]||=e=>re.value=e,group:{name:`ai-chat-conversations`},disabled:v.value,sort:!1},te,{class:`ai-chat-sidebar__unpinned-drop`,onStart:t[17]||=e=>de.value=!0,onEnd:t[18]||=e=>de.value=!1,onAdd:he}),{default:U(()=>[(V(!0),P(H,null,F(re.value,e=>(V(),G(vR,{key:e.id,conv:e,active:e.id===r(o),streaming:r(f).has(e.id),unread:r(p).has(e.id),"companion-thinking":r(a).isCompanionThinkingFor(e.id),onSelect:Ie,onRename:D,onSetArchived:t[15]||=(e,t)=>r(a).archiveConversation(e,t),onDelete:Le},null,8,[`conv`,`active`,`streaming`,`unread`,`companion-thinking`]))),128))]),_:1},16,[`modelValue`,`disabled`]),[[me,j.value.length>0]]),O.value.length===0&&ne.value.length===0?(V(),P(`div`,UR,W(v.value?r(n)(`aiChat.searchNoMatch`):r(n)(`aiChat.noConversations`)),1)):K(``,!0)]),r(d).length>0?(V(),P(`div`,WR,[N(`button`,{class:`ai-chat-sidebar__archive-toggle`,onClick:Me},[t[29]||=N(`i`,{class:`ti ti-inbox`},null,-1),N(`span`,null,W(r(n)(`aiChatPage.archives`,{count:r(d).length})),1),v.value?(V(),P(`span`,GR,W(r(n)(`aiChat.searchArchivedCount`,{count:E.value.length})),1)):K(``,!0),N(`i`,{class:L([y.value?`ti ti-chevron-up`:`ti ti-chevron-down`,`ai-chat-sidebar__archive-chevron`])},null,2)]),y.value?(V(),P(`div`,KR,[N(`div`,qR,[(V(!0),P(H,null,F(E.value,e=>(V(),G(vR,{key:e.id,conv:e,archived:``,active:e.id===r(o),onSelect:Ie,onRename:D,onSetArchived:t[19]||=(e,t)=>r(a).archiveConversation(e,t),onDelete:Le},null,8,[`conv`,`active`]))),128)),E.value.length===0?(V(),P(`div`,JR,W(v.value?r(n)(`aiChat.searchNoMatch`):r(n)(`aiChat.noConversations`)),1)):K(``,!0)])])):K(``,!0)])):K(``,!0)])}}}),[[`__scopeId`,`data-v-e60b3dad`]]);function XR(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ZR=XR();function QR(e){ZR=e}var $R={exec:()=>null};function ez(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function tz(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(rz.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var nz=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),rz={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:ez(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:ez(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:ez(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:ez(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:ez(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,`i`)),blockquoteBeginRegex:ez(e=>RegExp(`^ {0,${e}}>`))},iz=/^(?:[ \t]*(?:\n|$))+/,az=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,oz=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,sz=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,cz=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,lz=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,uz=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,dz=tz(uz).replace(/bull/g,lz).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),fz=tz(uz).replace(/bull/g,lz).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),pz=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,mz=/^[^\n]+/,hz=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,gz=tz(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,hz).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),_z=tz(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,lz).getRegex(),vz=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,yz=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,bz=tz(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,yz).replace(`tag`,vz).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),xz=tz(pz).replace(`hr`,sz).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,vz).getRegex(),Sz={blockquote:tz(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,xz).getRegex(),code:az,def:gz,fences:oz,heading:cz,hr:sz,html:bz,lheading:dz,list:_z,newline:iz,paragraph:xz,table:$R,text:mz},Cz=tz(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,sz).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,vz).getRegex(),wz={...Sz,lheading:fz,table:Cz,paragraph:tz(pz).replace(`hr`,sz).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Cz).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,vz).getRegex()},Tz={...Sz,html:tz(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,yz).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:$R,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:tz(pz).replace(`hr`,sz).replace(`heading`,` *#{1,6} *[^
|
|
199
|
+
]`).replace(`lheading`,dz).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Ez=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Dz=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Oz=/^( {2,}|\\)\n(?!\s*$)/,kz=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Az=/[\p{P}\p{S}]/u,jz=/[\s\p{P}\p{S}]/u,Mz=/[^\s\p{P}\p{S}]/u,Nz=tz(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,jz).getRegex(),Pz=/(?!~)[\p{P}\p{S}]/u,Fz=/(?!~)[\s\p{P}\p{S}]/u,Iz=/(?:[^\s\p{P}\p{S}]|~)/u,Lz=tz(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,nz?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),Rz=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,zz=tz(Rz,`u`).replace(/punct/g,Az).getRegex(),Bz=tz(Rz,`u`).replace(/punct/g,Pz).getRegex(),Vz=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Hz=tz(Vz,`gu`).replace(/notPunctSpace/g,Mz).replace(/punctSpace/g,jz).replace(/punct/g,Az).getRegex(),Uz=tz(Vz,`gu`).replace(/notPunctSpace/g,Iz).replace(/punctSpace/g,Fz).replace(/punct/g,Pz).getRegex(),Wz=tz(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,Mz).replace(/punctSpace/g,jz).replace(/punct/g,Az).getRegex(),Gz=tz(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,Az).getRegex(),Kz=tz(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Mz).replace(/punctSpace/g,jz).replace(/punct/g,Az).getRegex(),qz=tz(/\\(punct)/,`gu`).replace(/punct/g,Az).getRegex(),Jz=tz(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Yz=tz(yz).replace(`(?:-->|$)`,`-->`).getRegex(),Xz=tz(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,Yz).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Zz=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Qz=tz(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,Zz).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),$z=tz(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Zz).replace(`ref`,hz).getRegex(),eB=tz(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,hz).getRegex(),tB=tz(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,$z).replace(`nolink`,eB).getRegex(),nB=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,rB={_backpedal:$R,anyPunctuation:qz,autolink:Jz,blockSkip:Lz,br:Oz,code:Dz,del:$R,delLDelim:$R,delRDelim:$R,emStrongLDelim:zz,emStrongRDelimAst:Hz,emStrongRDelimUnd:Wz,escape:Ez,link:Qz,nolink:eB,punctuation:Nz,reflink:$z,reflinkSearch:tB,tag:Xz,text:kz,url:$R},iB={...rB,link:tz(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Zz).getRegex(),reflink:tz(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Zz).getRegex()},aB={...rB,emStrongRDelimAst:Uz,emStrongLDelim:Bz,delLDelim:Gz,delRDelim:Kz,url:tz(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,nB).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:tz(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,nB).getRegex()},oB={...aB,br:tz(Oz).replace(`{2,}`,`*`).getRegex(),text:tz(aB.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},sB={normal:Sz,gfm:wz,pedantic:Tz},cB={normal:rB,gfm:aB,breaks:oB,pedantic:iB},lB={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},uB=e=>lB[e];function dB(e,t){if(t){if(rz.escapeTest.test(e))return e.replace(rz.escapeReplace,uB)}else if(rz.escapeTestNoEncode.test(e))return e.replace(rz.escapeReplaceNoEncode,uB);return e}function fB(e){try{e=encodeURI(e).replace(rz.percentDecode,`%`)}catch{return null}return e}function pB(e,t){let n=e.replace(rz.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(rz.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(rz.slashPipe,`|`);return n}function mB(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function hB(e){let t=e.split(`
|
|
200
|
+
`),n=t.length-1;for(;n>=0&&rz.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
201
|
+
`)}function gB(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function _B(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function vB(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function yB(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
202
|
+
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
|
|
203
|
+
`)}var bB=class{options;rules;lexer;constructor(e){this.options=e||ZR}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:hB(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=yB(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=mB(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:mB(t[0],`
|
|
204
|
+
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:mB(t[0],`
|
|
205
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=mB(t[0],`
|
|
206
|
+
`).split(`
|
|
207
|
+
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
208
|
+
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
209
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
210
|
+
${s}`:s,r=r?`${r}
|
|
211
|
+
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
|
|
212
|
+
`+e.join(`
|
|
213
|
+
`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
|
|
214
|
+
`+e.join(`
|
|
215
|
+
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
216
|
+
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=_B(t[2].split(`
|
|
217
|
+
`,1)[0],t[1].length),l=e.split(`
|
|
218
|
+
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
|
|
219
|
+
`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
|
|
220
|
+
`,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
221
|
+
`+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
222
|
+
`+l}u=!l.trim(),r+=p+`
|
|
223
|
+
`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]);let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1;if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=hB(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:mB(t[0],`
|
|
224
|
+
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=pB(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
225
|
+
`):[],a={type:`table`,raw:mB(t[0],`
|
|
226
|
+
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(pB(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:mB(t[0],`
|
|
227
|
+
`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
228
|
+
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=mB(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=gB(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),vB(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return vB(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},xB=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ZR,this.options.tokenizer=this.options.tokenizer||new bB,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:rz,block:sB.normal,inline:cB.normal};this.options.pedantic?(t.block=sB.pedantic,t.inline=cB.pedantic):this.options.gfm&&(t.block=sB.gfm,t.inline=this.options.breaks?cB.breaks:cB.gfm),this.tokenizer.rules=t}static get rules(){return{block:sB,inline:cB}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(rz.carriageReturn,`
|
|
229
|
+
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(rz.tabCharGlobal,` `).replace(rz.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
|
|
230
|
+
`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
231
|
+
`)?``:`
|
|
232
|
+
`)+i.raw,n.text+=`
|
|
233
|
+
`+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
234
|
+
`)?``:`
|
|
235
|
+
`)+i.raw,n.text+=`
|
|
236
|
+
`+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
|
|
237
|
+
`)?``:`
|
|
238
|
+
`)+i.raw,r.text+=`
|
|
239
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
240
|
+
`)?``:`
|
|
241
|
+
`)+i.raw,n.text+=`
|
|
242
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``,s=1/0;for(;e;){if(e.length<s)s=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},SB=class{options;parser;constructor(e){this.options=e||ZR}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(rz.notSpaceStart)?.[0],i=e.replace(rz.endingNewline,``)+`
|
|
243
|
+
`;return r?`<pre><code class="language-`+dB(r)+`">`+(n?i:dB(i,!0))+`</code></pre>
|
|
244
|
+
`:`<pre><code>`+(n?i:dB(i,!0))+`</code></pre>
|
|
245
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
246
|
+
${this.parser.parse(e)}</blockquote>
|
|
247
|
+
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
248
|
+
`}hr(e){return`<hr>
|
|
249
|
+
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
250
|
+
`+r+`</`+i+`>
|
|
251
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
252
|
+
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
253
|
+
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
254
|
+
<thead>
|
|
255
|
+
`+t+`</thead>
|
|
256
|
+
`+r+`</table>
|
|
257
|
+
`}tablerow({text:e}){return`<tr>
|
|
258
|
+
${e}</tr>
|
|
259
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
260
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${dB(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=fB(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+dB(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=fB(e);if(i===null)return dB(n);e=i;let a=`<img src="${e}" alt="${dB(n)}"`;return t&&(a+=` title="${dB(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:dB(e.text)}},CB=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},wB=class e{options;renderer;textRenderer;constructor(e){this.options=e||ZR,this.options.renderer=this.options.renderer||new SB,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new CB}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},TB=class{options;block;constructor(e){this.options=e||ZR}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?xB.lex:xB.lexInline}provideParser(e=this.block){return e?wB.parse:wB.parseInline}},EB=new class{defaults=XR();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=wB;Renderer=SB;TextRenderer=CB;Lexer=xB;Tokenizer=bB;Hooks=TB;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new SB(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new bB(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new TB;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=TB.passThroughHooks.has(n)?e=>{if(this.defaults.async&&TB.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return xB.lex(e,t??this.defaults)}parser(e,t){return wB.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?xB.lex:xB.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?wB.parse:wB.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?xB.lex:xB.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?wB.parse:wB.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
261
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+dB(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function DB(e,t){return EB.parse(e,t)}DB.options=DB.setOptions=function(e){return EB.setOptions(e),DB.defaults=EB.defaults,QR(DB.defaults),DB},DB.getDefaults=XR,DB.defaults=ZR,DB.use=function(...e){return EB.use(...e),DB.defaults=EB.defaults,QR(DB.defaults),DB},DB.walkTokens=function(e,t){return EB.walkTokens(e,t)},DB.parseInline=EB.parseInline,DB.Parser=wB,DB.parser=wB.parse,DB.Renderer=SB,DB.TextRenderer=CB,DB.Lexer=xB,DB.lexer=xB.lex,DB.Tokenizer=bB,DB.Hooks=TB,DB.parse=DB,DB.options,DB.setOptions,DB.use,DB.walkTokens,DB.parseInline,wB.parse,xB.lex;function OB(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function kB(e){if(Array.isArray(e))return e}function AB(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function jB(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
262
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function MB(e,t){return kB(e)||AB(e,t)||NB(e,t)||jB()}function NB(e,t){if(e){if(typeof e==`string`)return OB(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?OB(e,t):void 0}}var PB=Object.entries,FB=Object.setPrototypeOf,IB=Object.isFrozen,LB=Object.getPrototypeOf,RB=Object.getOwnPropertyDescriptor,zB=Object.freeze,BB=Object.seal,VB=Object.create,HB=typeof Reflect<`u`&&Reflect,UB=HB.apply,WB=HB.construct;zB||=function(e){return e},BB||=function(e){return e},UB||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},WB||=function(e){return new e(...[...arguments].slice(1))};var GB=dV(Array.prototype.forEach),KB=dV(Array.prototype.lastIndexOf),qB=dV(Array.prototype.pop),JB=dV(Array.prototype.push),YB=dV(Array.prototype.splice),XB=Array.isArray,ZB=dV(String.prototype.toLowerCase),QB=dV(String.prototype.toString),$B=dV(String.prototype.match),eV=dV(String.prototype.replace),tV=dV(String.prototype.indexOf),nV=dV(String.prototype.trim),rV=dV(Number.prototype.toString),iV=dV(Boolean.prototype.toString),aV=typeof BigInt>`u`?null:dV(BigInt.prototype.toString),oV=typeof Symbol>`u`?null:dV(Symbol.prototype.toString),sV=dV(Object.prototype.hasOwnProperty),cV=dV(Object.prototype.toString),lV=dV(RegExp.prototype.test),uV=fV(TypeError);function dV(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return UB(e,t,n)}}function fV(e){return function(){return WB(e,[...arguments])}}function pV(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ZB;if(FB&&FB(e,null),!XB(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(IB(t)||(t[r]=e),i=e)}e[i]=!0}return e}function mV(e){for(let t=0;t<e.length;t++)sV(e,t)||(e[t]=null);return e}function hV(e){let t=VB(null);for(let r of PB(e)){var n=MB(r,2);let i=n[0],a=n[1];sV(e,i)&&(t[i]=XB(a)?mV(a):a&&typeof a==`object`&&a.constructor===Object?hV(a):a)}return t}function gV(e){switch(typeof e){case`string`:return e;case`number`:return rV(e);case`boolean`:return iV(e);case`bigint`:return aV?aV(e):`0`;case`symbol`:return oV?oV(e):`Symbol()`;case`undefined`:return cV(e);case`function`:case`object`:{if(e===null)return cV(e);let t=e,n=_V(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:cV(e)}return cV(e)}default:return cV(e)}}function _V(e,t){for(;e!==null;){let n=RB(e,t);if(n){if(n.get)return dV(n.get);if(typeof n.value==`function`)return dV(n.value)}e=LB(e)}function n(){return null}return n}function vV(e){try{return lV(e,``),!0}catch{return!1}}var yV=zB(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),bV=zB(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),xV=zB([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),SV=zB([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),CV=zB(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),wV=zB([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),TV=zB([`#text`]),EV=zB(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),DV=zB(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),OV=zB(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),kV=zB([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),AV=BB(/{{[\w\W]*|^[\w\W]*}}/g),jV=BB(/<%[\w\W]*|^[\w\W]*%>/g),MV=BB(/\${[\w\W]*/g),NV=BB(/^data-[\-\w.\u00B7-\uFFFF]+$/),PV=BB(/^aria-[\-\w]+$/),FV=BB(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),IV=BB(/^(?:\w+script|data):/i),LV=BB(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),RV=BB(/^html$/i),zV=BB(/^[a-z][.\w]*(-[.\w]+)+$/i),BV=BB(/<[/\w!]/g),VV=BB(/<[/\w]/g),HV=BB(/<\/no(script|embed|frames)/i),UV=BB(/\/>/i),WV={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},GV=function(){return typeof window>`u`?null:window},KV=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},qV=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},JV=function(e,t,n,r){return sV(e,t)&&XB(e[t])?pV(r.base?hV(r.base):{},e[t],r.transform):n};function YV(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:GV(),t=e=>YV(e);if(t.version=`3.4.11`,t.removed=[],!e||!e.document||e.document.nodeType!==WV.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=_V(d,`cloneNode`),p=_V(d,`remove`),m=_V(d,`nextSibling`),h=_V(d,`childNodes`),g=_V(d,`parentNode`),_=_V(d,`shadowRoot`),v=_V(d,`attributes`),y=o&&o.prototype?_V(o.prototype,`nodeType`):null,b=o&&o.prototype?_V(o.prototype,`nodeName`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,S=``,C,w=!1,T=0,E=function(){if(T>0)throw uV(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},D=function(e){E(),T++;try{return x.createHTML(e)}finally{T--}},O=function(e){E(),T++;try{return x.createScriptURL(e)}finally{T--}},k=function(){return w||=(C=KV(u,i),!0),C},A=n,j=A.implementation,M=A.createNodeIterator,N=A.createDocumentFragment,P=A.getElementsByTagName,F=r.importNode,I=qV();t.isSupported=typeof PB==`function`&&typeof g==`function`&&j&&j.createHTMLDocument!==void 0;let L=AV,R=jV,ee=MV,z=NV,te=PV,ne=IV,B=LV,V=zV,re=FV,H=null,ie=pV({},[...yV,...bV,...xV,...CV,...TV]),U=null,W=pV({},[...EV,...DV,...OV,...kV]),ae=Object.seal(VB(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),oe=null,se=null,ce=Object.seal(VB(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),le=!0,G=!0,ue=!1,de=!0,K=!1,fe=!0,pe=!1,me=!1,he=null,ge=null,_e=!1,ve=!1,ye=!1,be=!1,xe=!0,Se=!1,Ce=`user-content-`,we=!0,Te=!1,Ee={},De=null,Oe=pV({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),ke=null,Ae=pV({},[`audio`,`video`,`img`,`source`,`image`,`track`]),je=null,Me=pV({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ne=`http://www.w3.org/1998/Math/MathML`,Pe=`http://www.w3.org/2000/svg`,Fe=`http://www.w3.org/1999/xhtml`,Ie=Fe,Le=!1,Re=null,ze=pV({},[Ne,Pe,Fe],QB),Be=zB([`mi`,`mo`,`mn`,`ms`,`mtext`]),Ve=pV({},Be),He=zB([`annotation-xml`]),Ue=pV({},He),We=pV({},[`title`,`style`,`font`,`a`,`script`]),Ge=null,Ke=[`application/xhtml+xml`,`text/html`],q=null,qe=null,Je=n.createElement(`form`),Ye=function(e){return e instanceof RegExp||e instanceof Function},Xe=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(qe&&qe===e)return;(!e||typeof e!=`object`)&&(e={}),e=hV(e),Ge=Ke.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,q=Ge===`application/xhtml+xml`?QB:ZB,H=JV(e,`ALLOWED_TAGS`,ie,{transform:q}),U=JV(e,`ALLOWED_ATTR`,W,{transform:q}),Re=JV(e,`ALLOWED_NAMESPACES`,ze,{transform:QB}),je=JV(e,`ADD_URI_SAFE_ATTR`,Me,{transform:q,base:Me}),ke=JV(e,`ADD_DATA_URI_TAGS`,Ae,{transform:q,base:Ae}),De=JV(e,`FORBID_CONTENTS`,Oe,{transform:q}),oe=JV(e,`FORBID_TAGS`,hV({}),{transform:q}),se=JV(e,`FORBID_ATTR`,hV({}),{transform:q}),Ee=sV(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?hV(e.USE_PROFILES):e.USE_PROFILES:!1,le=e.ALLOW_ARIA_ATTR!==!1,G=e.ALLOW_DATA_ATTR!==!1,ue=e.ALLOW_UNKNOWN_PROTOCOLS||!1,de=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,K=e.SAFE_FOR_TEMPLATES||!1,fe=e.SAFE_FOR_XML!==!1,pe=e.WHOLE_DOCUMENT||!1,ve=e.RETURN_DOM||!1,ye=e.RETURN_DOM_FRAGMENT||!1,be=e.RETURN_TRUSTED_TYPE||!1,_e=e.FORCE_BODY||!1,xe=e.SANITIZE_DOM!==!1,Se=e.SANITIZE_NAMED_PROPS||!1,we=e.KEEP_CONTENT!==!1,Te=e.IN_PLACE||!1,re=vV(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:FV,Ie=typeof e.NAMESPACE==`string`?e.NAMESPACE:Fe,Ve=sV(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?hV(e.MATHML_TEXT_INTEGRATION_POINTS):pV({},Be),Ue=sV(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?hV(e.HTML_INTEGRATION_POINTS):pV({},He);let t=sV(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?hV(e.CUSTOM_ELEMENT_HANDLING):VB(null);if(ae=VB(null),sV(t,`tagNameCheck`)&&Ye(t.tagNameCheck)&&(ae.tagNameCheck=t.tagNameCheck),sV(t,`attributeNameCheck`)&&Ye(t.attributeNameCheck)&&(ae.attributeNameCheck=t.attributeNameCheck),sV(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(ae.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),BB(ae),K&&(G=!1),ye&&(ve=!0),Ee&&(H=pV({},TV),U=VB(null),Ee.html===!0&&(pV(H,yV),pV(U,EV)),Ee.svg===!0&&(pV(H,bV),pV(U,DV),pV(U,kV)),Ee.svgFilters===!0&&(pV(H,xV),pV(U,DV),pV(U,kV)),Ee.mathMl===!0&&(pV(H,CV),pV(U,OV),pV(U,kV))),ce.tagCheck=null,ce.attributeCheck=null,sV(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?ce.tagCheck=e.ADD_TAGS:XB(e.ADD_TAGS)&&(H===ie&&(H=hV(H)),pV(H,e.ADD_TAGS,q))),sV(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?ce.attributeCheck=e.ADD_ATTR:XB(e.ADD_ATTR)&&(U===W&&(U=hV(U)),pV(U,e.ADD_ATTR,q))),sV(e,`ADD_URI_SAFE_ATTR`)&&XB(e.ADD_URI_SAFE_ATTR)&&pV(je,e.ADD_URI_SAFE_ATTR,q),sV(e,`FORBID_CONTENTS`)&&XB(e.FORBID_CONTENTS)&&(De===Oe&&(De=hV(De)),pV(De,e.FORBID_CONTENTS,q)),sV(e,`ADD_FORBID_CONTENTS`)&&XB(e.ADD_FORBID_CONTENTS)&&(De===Oe&&(De=hV(De)),pV(De,e.ADD_FORBID_CONTENTS,q)),we&&(H[`#text`]=!0),pe&&pV(H,[`html`,`head`,`body`]),H.table&&(pV(H,[`tbody`]),delete oe.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw uV(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw uV(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=x;x=e.TRUSTED_TYPES_POLICY;try{S=D(``)}catch(e){throw x=t,e}}else e.TRUSTED_TYPES_POLICY===null?(x=void 0,S=``):(x===void 0&&(x=k()),x&&typeof S==`string`&&(S=D(``)));zB&&zB(e),qe=e},Ze=pV({},[...bV,...xV,...SV]),Qe=pV({},[...CV,...wV]),$e=function(e,t,n){return t.namespaceURI===Fe?e===`svg`:t.namespaceURI===Ne?e===`svg`&&(n===`annotation-xml`||Ve[n]):!!Ze[e]},et=function(e,t,n){return t.namespaceURI===Fe?e===`math`:t.namespaceURI===Pe?e===`math`&&Ue[n]:!!Qe[e]},tt=function(e,t,n){return t.namespaceURI===Pe&&!Ue[n]||t.namespaceURI===Ne&&!Ve[n]?!1:!Qe[e]&&(We[e]||!Ze[e])},nt=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:Ie,tagName:`template`});let n=ZB(e.tagName),r=ZB(t.tagName);return Re[e.namespaceURI]?e.namespaceURI===Pe?$e(n,t,r):e.namespaceURI===Ne?et(n,t,r):e.namespaceURI===Fe?tt(n,t,r):!!(Ge===`application/xhtml+xml`&&Re[e.namespaceURI]):!1},rt=function(e){JB(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw uV(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},it=function(e){let t=h(e);if(t){let e=[];GB(t,t=>{JB(e,t)}),GB(e,e=>{try{p(e)}catch{}})}let n=v(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;if(typeof i==`string`)try{e.removeAttribute(i)}catch{}}},at=function(e,n){try{JB(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{JB(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`){if(ve||ye)try{rt(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},ot=function(e){let t=v(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;if(!(typeof i!=`string`||U[q(i)]))try{e.removeAttribute(i)}catch{}}},st=function(e){let t=[e];for(;t.length>0;){let e=t.pop();(y?y(e):e.nodeType)===WV.element&&ot(e);let n=h(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},ct=function(e){let t=null,r=null;if(_e)e=`<remove></remove>`+e;else{let t=$B(e,/^[\r\n\t ]+/);r=t&&t[0]}Ge===`application/xhtml+xml`&&Ie===Fe&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=x?D(e):e;if(Ie===Fe)try{t=new l().parseFromString(i,Ge)}catch{}if(!t||!t.documentElement){t=j.createDocument(Ie,`template`,null);try{t.documentElement.innerHTML=Le?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Ie===Fe?P.call(t,pe?`html`:`body`)[0]:pe?t.documentElement:a},lt=function(e){return M.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},ut=function(e){return e=eV(e,L,` `),e=eV(e,R,` `),e=eV(e,ee,` `),e},dt=function(e){e.normalize();let t=M.call(e.ownerDocument||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),n=t.nextNode();for(;n;)n.data=ut(n.data),n=t.nextNode();let r=e.querySelectorAll?.call(e,`template`);r&&GB(r,e=>{pt(e.content)&&dt(e.content)})},ft=function(e){let t=b?b(e):null;return typeof t!=`string`||q(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==v(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==h(e)},pt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===WV.documentFragment}catch{return!1}},mt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function ht(e,n,r){e.length!==0&&GB(e,e=>{e.call(t,n,r,qe)})}let gt=function(e,t){return!!(fe&&e.hasChildNodes()&&!mt(e.firstElementChild)&&lV(BV,e.textContent)&&lV(BV,e.innerHTML)||fe&&e.namespaceURI===Fe&&t===`style`&&mt(e.firstElementChild)||e.nodeType===WV.processingInstruction||fe&&e.nodeType===WV.comment&&lV(VV,e.data))},_t=function(e,t){if(!oe[t]&&bt(t)&&(ae.tagNameCheck instanceof RegExp&&lV(ae.tagNameCheck,t)||ae.tagNameCheck instanceof Function&&ae.tagNameCheck(t)))return!1;if(we&&!De[t]){let t=g(e),n=h(e);if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=Te?n[i]:f(n[i],!0);t.insertBefore(r,m(e))}}}return rt(e),!0},vt=function(e){if(ht(I.beforeSanitizeElements,e,null),ft(e))return rt(e),!0;let n=q(b?b(e):e.nodeName);if(ht(I.uponSanitizeElement,e,{tagName:n,allowedTags:H}),gt(e,n))return rt(e),!0;if(oe[n]||!(ce.tagCheck instanceof Function&&ce.tagCheck(n))&&!H[n])return _t(e,n);if((y?y(e):e.nodeType)===WV.element&&!nt(e)||(n===`noscript`||n===`noembed`||n===`noframes`)&&lV(HV,e.innerHTML))return rt(e),!0;if(K&&e.nodeType===WV.text){let n=ut(e.textContent);e.textContent!==n&&(JB(t.removed,{element:e.cloneNode()}),e.textContent=n)}return ht(I.afterSanitizeElements,e,null),!1},J=function(e,t,r){if(se[t]||xe&&(t===`id`||t===`name`)&&(r in n||r in Je))return!1;let i=U[t]||ce.attributeCheck instanceof Function&&ce.attributeCheck(t,e);if(!(G&&lV(z,t))&&!(le&&lV(te,t))){if(!i){if(!(bt(e)&&(ae.tagNameCheck instanceof RegExp&&lV(ae.tagNameCheck,e)||ae.tagNameCheck instanceof Function&&ae.tagNameCheck(e))&&(ae.attributeNameCheck instanceof RegExp&&lV(ae.attributeNameCheck,t)||ae.attributeNameCheck instanceof Function&&ae.attributeNameCheck(t,e))||t===`is`&&ae.allowCustomizedBuiltInElements&&(ae.tagNameCheck instanceof RegExp&&lV(ae.tagNameCheck,r)||ae.tagNameCheck instanceof Function&&ae.tagNameCheck(r))))return!1}else if(!je[t]&&!lV(re,eV(r,B,``))&&(t!==`src`&&t!==`xlink:href`&&t!==`href`||e===`script`||tV(r,`data:`)!==0||!ke[e])&&(!ue||lV(ne,eV(r,B,``)))&&r)return!1}return!0},yt=pV({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),bt=function(e){return!yt[ZB(e)]&&lV(V,e)},xt=function(e,t,n,r){if(x&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return D(r);case`TrustedScriptURL`:return O(r)}return r},St=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),ft(e)?rt(e):qB(t.removed)}catch{at(n,e)}},Ct=function(e){ht(I.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||ft(e))return;let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:U,forceKeepAttr:void 0},r=t.length,i=q(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=q(o),u=c,d=o===`value`?u:nV(u);if(n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,ht(I.uponSanitizeAttribute,e,n),d=n.attrValue,Se&&(l===`id`||l===`name`)&&tV(d,Ce)!==0&&(at(o,e),d=Ce+d),fe&&lV(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){at(o,e);continue}if(l===`attributename`&&$B(d,`href`)){at(o,e);continue}if(!n.forceKeepAttr){if(!n.keepAttr){at(o,e);continue}if(!de&&lV(UV,d)){at(o,e);continue}if(K&&(d=ut(d)),!J(i,l,d)){at(o,e);continue}d=xt(i,l,s,d),d!==u&&St(e,o,s,d)}}ht(I.afterSanitizeAttributes,e,null)},wt=function(e){let t=null,n=lt(e);for(ht(I.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(ht(I.uponSanitizeShadowNode,t,null),vt(t),Ct(t),pt(t.content)&&wt(t.content),(y?y(t):t.nodeType)===WV.element){let e=_(t);pt(e)&&(Tt(e),wt(e))}ht(I.afterSanitizeShadowDOM,e,null)},Tt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){wt(e.shadow);continue}let n=e.node,r=(y?y(n):n.nodeType)===WV.element,i=h(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=b?b(n):null;if(typeof e==`string`&&q(e)===`template`){let e=n.content;pt(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);pt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Le=!e,Le&&(e=`<!-->`),typeof e!=`string`&&!mt(e)&&(e=gV(e),typeof e!=`string`))throw uV(`dirty is not a string, aborting`);if(!t.isSupported)return e;me?(H=he,U=ge):Xe(n),(I.uponSanitizeElement.length>0||I.uponSanitizeAttribute.length>0)&&(H=hV(H)),I.uponSanitizeAttribute.length>0&&(U=hV(U)),t.removed=[];let c=Te&&typeof e!=`string`&&mt(e);if(c){let t=b?b(e):e.nodeName;if(typeof t==`string`){let e=q(t);if(!H[e]||oe[e])throw uV(`root node is forbidden and cannot be sanitized in-place`)}if(ft(e))throw uV(`root node is clobbered and cannot be sanitized in-place`);try{Tt(e)}catch(t){throw it(e),t}}else if(mt(e))i=ct(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===WV.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Tt(a);else{if(!ve&&!K&&!pe&&e.indexOf(`<`)===-1)return x&&be?D(e):e;if(i=ct(e),!i)return ve?null:be?S:``}i&&_e&&rt(i.firstChild);let l=lt(c?e:i);try{for(;o=l.nextNode();)vt(o),Ct(o),pt(o.content)&&wt(o.content)}catch(t){throw c&&it(e),t}if(c)return GB(t.removed,e=>{e.element&&st(e.element)}),K&&dt(e),e;if(ve){if(K&&dt(i),ye)for(s=N.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(U.shadowroot||U.shadowrootmode)&&(s=F.call(r,s,!0)),s}let u=pe?i.outerHTML:i.innerHTML;return pe&&H[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&lV(RV,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
263
|
+
`+u),K&&(u=ut(u)),x&&be?D(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Xe(e),me=!0,he=H,ge=U},t.clearConfig=function(){qe=null,me=!1,he=null,ge=null,x=C,S=``},t.isValidAttribute=function(e,t,n){qe||Xe({});let r=q(e),i=q(t);return J(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&sV(I,e)&&JB(I[e],t)},t.removeHook=function(e,t){if(sV(I,e)){if(t!==void 0){let n=KB(I[e],t);return n===-1?void 0:YB(I[e],n,1)[0]}return qB(I[e])}},t.removeHooks=function(e){sV(I,e)&&(I[e]=[])},t.removeAllHooks=function(){I=qV()},t}var XV=YV(),ZV={class:`kanban-preview-dialog`},QV={class:`kanban-preview-header`},$V={class:`kanban-preview-body`},eH={class:`ai-chat-message-list__msg-role`},tH={key:0,class:`ai-chat-message-list__context-note`},nH=[`onClick`],rH=[`innerHTML`],iH={key:0,class:`ai-chat-message-list__thinking-block`},aH=[`onClick`],oH={key:0,class:`ai-chat-message-list__thinking-content`},sH=[`onClick`],cH={class:`ai-chat-message-list__tool-event-name`},lH={key:0,class:`ai-chat-message-list__tool-event-args ai-chat-message-list__tool-event-args--streaming`},uH={key:1,class:`ai-chat-message-list__tool-event-args`},dH={class:`ai-chat-message-list__tool-param-key`},fH={class:`ai-chat-message-list__tool-param-value`},pH=[`onClick`],mH={key:0,class:`ai-chat-message-list__tool-diff-path`},hH={class:`ai-chat-message-list__tool-diff-body`},gH={class:`ai-chat-message-list__tool-diff-sign`},_H=[`onClick`],vH={key:2,class:`ai-chat-message-list__user-text`},yH=[`innerHTML`],bH={key:4,class:`ai-chat-message-list__image-part`},xH=[`src`,`alt`,`onClick`],SH=[`aria-label`],CH={key:0,class:`ai-chat-message-list__status`},wH={key:1,class:`ai-chat-message-list__cursor`},TH={key:0,class:`ai-chat-message-list__status`},EH=[`innerHTML`],DH={key:2,class:`ai-chat-message-list__user-text`},OH={key:3,class:`ai-chat-message-list__cursor`},kH={key:0,class:`ai-chat-message-list__empty-chat`},AH=524288,jH=Je(B({__name:`AiChatMessageList`,props:{messages:{},isStreaming:{type:Boolean}},emits:[`open-image-preview`],setup(e,{expose:t,emit:n}){let a=e,o=n,{t:s}=ve(),c=i(null);t({messagesEl:c});let l=new Map;function u(e){return e.replaceAll(`&`,`&`).replaceAll(`"`,`"`).replaceAll(`<`,`<`).replaceAll(`>`,`>`)}function d(e){return e.replace(/<pass\s+branch="(\d+)"\s*\/>/g,(e,t)=>`<span class="scenario-flag scenario-flag--pass">PASS ${t}</span>`).replace(/<pass\s*\/>/g,`<span class="scenario-flag scenario-flag--pass">PASS</span>`).replace(/<error>([\s\S]*?)<\/error>/g,(e,t)=>`<span class="scenario-flag scenario-flag--error">ERROR: ${t.trim()}</span>`).replace(/<ask_user>([\s\S]*?)<\/ask_user>/g,(e,t)=>`<span class="scenario-flag scenario-flag--ask">${t.trim()}</span>`).replace(/<kanban_move\s+column="([^"]*?)"\s*\/>/g,(e,t)=>`<span class="scenario-flag scenario-flag--kanban">📋 Move → ${t}</span>`).replace(/<kanban_comment>([\s\S]*?)<\/kanban_comment>/g,(e,t)=>`<span class="scenario-flag scenario-flag--kanban-comment">💬 ${t.trim()}</span>`).replace(/<kanban_add_card\s+column="([^"]*?)"\s+title="([^"]*?)">([\s\S]*?)<\/kanban_add_card>/g,(e,t,n,r)=>`<span class="scenario-flag scenario-flag--kanban" data-kanban-content="${u(r.trim())}" style="cursor:pointer" title="Cliquer pour voir le contenu">➕ Card "${n}" → ${t}</span>`).replace(/<next_person\s+name="([^"]*?)"\s*\/>/g,(e,t)=>`<span class="scenario-flag scenario-flag--delegate">🔀 ${t}</span>`).replace(/<next_person\s+name="([^"]*?)">([\s\S]*?)<\/next_person>/g,(e,t,n)=>`<span class="scenario-flag scenario-flag--delegate">🔀 <strong>${t}</strong> — ${n.trim()}</span>`).replace(/<hire_person\s+label="([^"]*?)"\s+role="([^"]*?)">([\s\S]*?)<\/hire_person>/g,(e,t,n)=>`<span class="scenario-flag scenario-flag--hire">🧑💼 Hire ${t} (${n})</span>`)}function f(e){let t=l.get(e);return t===void 0&&(t=XV.sanitize(DB.parse(d(e),{async:!1}),{ALLOW_DATA_ATTR:!0}),l.set(e,t)),t}let p=i(null);function m(e){let t=e.target.closest(`[data-kanban-content]`);t&&(p.value=t.dataset.kanbanContent??``)}let h=i(new Set),g=i(new Set),_=i(new Set);C(()=>a.messages,e=>{if(e.length===0)return;let t=e[e.length-1];for(let e of t.parts??[])e.type===`tool`&&!e.pending&&O(e)&&(h.value=new Set([...h.value,e.id]))});function v(e){let t=new Set(_.value);t.has(e)?t.delete(e):t.add(e),_.value=t}function y(e){let t=new Set(g.value);t.has(e)?t.delete(e):t.add(e),g.value=t}function b(e){let t=new Set(h.value);t.has(e)?t.delete(e):t.add(e),h.value=t}function S(e,t){let n;if(typeof e==`string`)n=e;else try{n=JSON.stringify(e,null,2)}catch{n=`[unserializable result]`}return n.length>AH&&(n=n.slice(-524288)),n.split(`
|
|
264
|
+
`).slice(-t).join(`
|
|
265
|
+
`)}function w(e){let t=e.target;t.style.display=`none`;let n=t.nextElementSibling;n&&(n.style.display=`flex`)}function T(e,t){let n=e.split(`
|
|
266
|
+
`),r=t.split(`
|
|
267
|
+
`),i=n.length,a=r.length,o=Array.from({length:i+1},()=>Array.from({length:a+1},()=>0));for(let e=i-1;e>=0;e--)for(let t=a-1;t>=0;t--)o[e][t]=n[e]===r[t]?o[e+1][t+1]+1:Math.max(o[e+1][t],o[e][t+1]);let s=[],c=0,l=0;for(;c<i||l<a;)c<i&&l<a&&n[c]===r[l]?(s.push({type:`context`,text:n[c]}),c++,l++):l<a&&(c>=i||o[c][l+1]>=o[c+1][l])?(s.push({type:`add`,text:r[l]}),l++):(s.push({type:`remove`,text:n[c]}),c++);return s}function E(e){return[`Edit`,`str_replace_based_edit_tool`,`str_replace_editor`,`Write`,`create_file`].includes(e)}function D(e){return e.name===`command_execution`&&typeof e.input?.command==`string`}function O(e){return E(e.name)||D(e)}function k(e){return D(e)?`shell`:e.name}function A(e){return!e.input||Object.keys(e.input).length===0?``:D(e)?String(e.input.command??``):Object.entries(e.input).map(([e,t])=>`${e}=${t}`).join(`, `)}function j(e){if(!E(e.name)||!e.input)return null;let t=e.input.old_string??``,n=e.input.new_string??e.input.content??``;return n?T(t,n):null}return(t,n)=>(V(),P(H,null,[(V(),G(le,{to:`body`},[p.value===null?K(``,!0):(V(),P(`div`,{key:0,class:`kanban-preview-overlay`,onClick:n[1]||=_e(e=>p.value=null,[`self`])},[N(`div`,ZV,[N(`div`,QV,[n[3]||=N(`span`,null,`Contenu de la carte`,-1),N(`button`,{class:`kanban-preview-close`,onClick:n[0]||=e=>p.value=null},`✕`)]),N(`pre`,$V,W(p.value||`(vide)`),1)])]))])),N(`div`,{ref_key:`messagesEl`,ref:c,class:`ai-chat-message-list`,onClick:m},[(V(!0),P(H,null,F(e.messages,(t,i)=>(V(),P(`div`,{key:i,class:L([`ai-chat-message-list__msg`,`is-${t.role}`])},[N(`div`,eH,W(t.role===`user`?r(s)(`aiChatPage.you`):r(s)(`aiChatPage.assistant`)),1),t.contextNote?(V(),P(`div`,tH,[N(`div`,{class:`ai-chat-message-list__context-note-header`,onClick:e=>v(i)},[n[4]||=N(`i`,{class:`ti ti-paperclip`},null,-1),N(`span`,null,W(r(s)(`aiChat.attachedContext`)),1),N(`i`,{class:L([`ti`,_.value.has(i)?`ti-chevron-up`:`ti-chevron-down`])},null,2)],8,nH),_.value.has(i)?(V(),P(`div`,{key:0,class:`ai-chat-message-list__context-note-body`,innerHTML:r(XV).sanitize(t.contextNote??``)},null,8,rH)):K(``,!0)])):K(``,!0),t.parts?.length?(V(),P(H,{key:1},[(V(!0),P(H,null,F(t.parts,(a,c)=>(V(),P(H,{key:c},[a.type===`thinking`?(V(),P(`div`,iH,[N(`div`,{class:`ai-chat-message-list__thinking-header`,onClick:e=>y(`${i}-${c}`)},[n[5]||=N(`i`,{class:`ti ti-sparkles`},null,-1),N(`span`,null,W(r(s)(`aiChatPage.thinking`)),1),N(`i`,{class:L([`ti`,g.value.has(`${i}-${c}`)?`ti-chevron-up`:`ti-chevron-down`])},null,2)],8,aH),g.value.has(`${i}-${c}`)||e.isStreaming&&i===e.messages.length-1&&c===t.parts.length-1?(V(),P(`pre`,oH,W(a.text),1)):K(``,!0)])):a.type===`tool`?(V(),P(`div`,{key:1,class:L([`ai-chat-message-list__tool-event`,{"ai-chat-message-list__tool-event--pending":a.pending,"ai-chat-message-list__tool-event--error":!a.pending&&a.isError,"ai-chat-message-list__tool-event--ok":!a.pending&&!a.isError}])},[N(`div`,{class:`ai-chat-message-list__tool-event-header`,onClick:e=>!a.pending&&b(a.id)},[N(`i`,{class:L(a.pending?`ti ti-spin ti-loader-2`:a.isError?`ti ti-circle-x`:`ti ti-circle-check`)},null,2),N(`span`,cH,W(k(a)),1),a.pending&&a.rawInput?(V(),P(`span`,lH,[x(W(a.rawInput),1),n[6]||=N(`span`,{class:`ai-chat-message-list__cursor`},null,-1)])):A(a)?(V(),P(`span`,uH,W(A(a)),1)):K(``,!0),a.pending?K(``,!0):(V(),P(`i`,{key:2,class:L([`ai-chat-message-list__tool-event-chevron ti`,h.value.has(a.id)?`ti-chevron-up`:`ti-chevron-down`])},null,2))],8,sH),!a.pending&&h.value.has(a.id)?(V(),P(H,{key:0},[a.input&&Object.keys(a.input).length>0&&!E(a.name)?(V(),P(`div`,{key:0,class:`ai-chat-message-list__tool-params`,onClick:n[2]||=_e(()=>{},[`stop`])},[(V(!0),P(H,null,F(Object.entries(a.input),([e,t])=>(V(),P(`div`,{key:e,class:`ai-chat-message-list__tool-param-row`},[N(`span`,dH,W(e),1),N(`span`,fH,W(typeof t==`object`?JSON.stringify(t):String(t)),1)]))),128))])):K(``,!0),j(a)?(V(),P(`div`,{key:1,class:`ai-chat-message-list__tool-diff`,onClick:_e(e=>b(a.id),[`stop`])},[a.input?.file_path?(V(),P(`div`,mH,W(a.input.file_path),1)):K(``,!0),N(`div`,hH,[(V(!0),P(H,null,F(j(a),(e,t)=>(V(),P(`div`,{key:t,class:L([`ai-chat-message-list__tool-diff-line`,`ai-chat-message-list__tool-diff-line--${e.type}`])},[N(`span`,gH,W(e.type===`add`?`+`:e.type===`remove`?`-`:` `),1),x(W(e.text),1)],2))),128))])],8,pH)):a.result===void 0?K(``,!0):(V(),P(`pre`,{key:2,class:`ai-chat-message-list__tool-event-result ai-chat-message-list__tool-event-result--expanded`,onClick:_e(e=>b(a.id),[`stop`])},W(S(a.result,20)),9,_H))],64)):K(``,!0)],2)):a.type===`text`&&t.role===`user`?(V(),P(`div`,vH,W(a.text),1)):a.type===`text`?(V(),P(`div`,{key:3,class:`ai-chat-message-list__markdown`,innerHTML:f(a.text)},null,8,yH)):a.type===`image`?(V(),P(`div`,bH,[N(`img`,{src:a.url,alt:a.altText||r(s)(`imageHistory.expired`),class:`ai-chat-message-list__image-thumb`,onClick:e=>o(`open-image-preview`,a.url,a.altText||`image`),onError:w},null,40,xH),N(`div`,{class:`ai-chat-message-list__image-expired`,role:`img`,"aria-label":r(s)(`imageHistory.expired`),style:{display:`none`}},[n[7]||=N(`i`,{class:`ti ti-photo`},null,-1),n[8]||=N(`i`,{class:`ti ti-alert-triangle`},null,-1),N(`span`,null,W(r(s)(`imageHistory.expired`)),1)],8,SH)])):K(``,!0)],64))),128)),t.status&&e.isStreaming&&i===e.messages.length-1?(V(),P(`div`,CH,[n[9]||=N(`i`,{class:`ti ti-spin ti-loader-2`},null,-1),N(`span`,null,W(t.status),1)])):K(``,!0),e.isStreaming&&i===e.messages.length-1&&t.role===`assistant`?(V(),P(`span`,wH)):K(``,!0)],64)):(V(),P(H,{key:2},[t.status&&e.isStreaming&&i===e.messages.length-1?(V(),P(`div`,TH,[n[10]||=N(`i`,{class:`ti ti-spin ti-loader-2`},null,-1),N(`span`,null,W(t.status),1)])):K(``,!0),t.role===`assistant`?(V(),P(`div`,{key:1,class:`ai-chat-message-list__markdown`,innerHTML:f(t.content)},null,8,EH)):(V(),P(`div`,DH,W(t.content),1)),e.isStreaming&&i===e.messages.length-1&&t.role===`assistant`?(V(),P(`span`,OH)):K(``,!0)],64))],2))),128)),e.messages.length===0?(V(),P(`div`,kH,[...n[11]||=[N(`i`,{class:`ti ti-send`,style:{"font-size":`2rem`,opacity:`0.2`}},null,-1)]])):K(``,!0)],512)],64))}}),[[`__scopeId`,`data-v-dc6da04d`]]),MH={class:`image-upload-bar`},NH=[`aria-label`],PH={key:2,class:`image-upload-bar__spinner-slot`},FH=[`onClick`],IH=[`src`,`alt`],LH={key:3,class:`image-upload-bar__limit-msg`},RH=Je(B({__name:`ImageUploadBar`,emits:[`preview`],setup(e,{emit:t}){let{t:n}=ve(),a=lt(),{pendingImages:o,isUploadingImage:s}=ye(a),c=i(null);function l(){c.value?.click()}async function u(e){let t=e.target;if(!t.files)return;let n=Array.from(t.files);for(let e of n)await a.uploadImage(e);t.value=``}let d=t;return(e,t)=>{let i=y(`tooltip`);return V(),P(`div`,MH,[N(`input`,{ref_key:`fileInput`,ref:c,type:`file`,accept:`image/png,image/jpeg,image/webp,image/gif`,multiple:``,"aria-label":r(n)(`imageUpload.selectImages`),style:{display:`none`},onChange:u},null,40,NH),r(o).length>0?(V(),G(r(Pe),{key:0,value:r(o).length,severity:`contrast`},{default:U(()=>[b(r(q),{icon:`ti ti-paperclip`,label:r(n)(`imageUpload.attachButton`),size:`small`,severity:`secondary`,variant:`text`,disabled:r(s)||r(o).length>=5,onClick:l},null,8,[`label`,`disabled`])]),_:1},8,[`value`])):(V(),G(r(q),{key:1,icon:`ti ti-paperclip`,label:r(n)(`imageUpload.attachButton`),size:`small`,severity:`secondary`,variant:`text`,disabled:r(s),onClick:l},null,8,[`label`,`disabled`])),r(s)?(V(),P(`div`,PH,[b(r(Me),{style:{width:`40px`,height:`40px`}})])):K(``,!0),(V(!0),P(H,null,F(r(o),e=>M((V(),P(`div`,{key:e.imageId,class:`image-upload-bar__thumb`,onClick:t=>d(`preview`,e.localPreviewUrl||e.url,e.fileName)},[N(`img`,{src:e.localPreviewUrl||e.url,alt:e.fileName,class:`image-upload-bar__thumb-img`},null,8,IH),b(r(q),{icon:`ti ti-x`,severity:`danger`,variant:`text`,rounded:``,size:`small`,class:`image-upload-bar__thumb-remove`,"aria-label":r(n)(`imageUpload.removeImage`,{name:e.fileName}),onClick:_e(t=>r(a).removePendingImage(e.imageId),[`stop`])},null,8,[`aria-label`,`onClick`])],8,FH)),[[i,e.fileName,void 0,{top:!0}]])),128)),r(o).length>=5?(V(),P(`span`,LH,W(r(n)(`imageUpload.limitReached`)),1)):K(``,!0)])}}}),[[`__scopeId`,`data-v-a23dc663`]]),zH={class:`ai-chat-composer__context-preview`},BH=Je(B({__name:`ContextBadge`,props:{label:{},icon:{},text:{},removable:{type:Boolean},variant:{}},emits:[`remove`],setup(e,{emit:t}){let n=e,a=t,o=i(null);function s(e){n.text&&o.value?.toggle(e)}function c(){o.value?.hide(),a(`remove`)}return(t,n)=>(V(),P(H,null,[N(`div`,{class:L([`ai-chat-composer__context-badge`,{"ai-chat-composer__context-badge--service":e.variant===`service`}]),onClick:s},[N(`i`,{class:L(`ti ${e.icon}`)},null,2),N(`span`,null,W(e.label),1),e.removable?(V(),P(`button`,{key:0,class:`ai-chat-composer__context-remove`,title:`Remove`,onClick:_e(c,[`stop`])},[...n[0]||=[N(`i`,{class:`ti ti-x`},null,-1)]])):K(``,!0)],2),e.text?(V(),G(r(je),{key:0,ref_key:`popover`,ref:o},{default:U(()=>[N(`pre`,zH,W(e.text),1)]),_:1},512)):K(``,!0)],64))}}),[[`__scopeId`,`data-v-b6f5b293`]]),VH={class:`ai-chat-composer`},HH={class:`ai-chat-composer__row`},UH=[`title`],WH={class:`ai-chat-composer__model-picker`},GH=[`onClick`],KH=Je(B({__name:`AiChatComposer`,props:_({isStreaming:{type:Boolean},isStreamingCurrentConv:{type:Boolean},activeConversationId:{}},{input:{default:``},inputModifiers:{}}),emits:_([`submit`,`open-image-preview`],[`update:input`]),setup(e,{emit:t}){let n=t,a=lt(),{t:o}=ve(),{claudeCodeAvailable:s,claudeCodeModel:c,selectedModel:l,availableModels:u,isUploadingImage:d}=ye(a),f=S(e,`input`),p=z(()=>a.activeConversation?.runner===`codex`),m=z(()=>{let e=a.activeConversation;return e?.runner===`claude-code`||e?.isCli===!0&&!e.runner&&!e.providerId}),h=z(()=>p.value?[]:m.value?Kt:u.value),g=z({get:()=>m.value?c.value??`sonnet`:l.value,set:e=>{m.value?c.value=e:l.value=e}}),_=i(null);function v(e){_.value?.toggle(e)}function y(e){g.value=e,_.value?.hide()}let{pendingDiffContext:x,pendingInput:w,pendingContext:T,pendingPopulateContext:E,contextServiceId:D}=Ht(),O=Jt(),k=z(()=>D.value?O.getById(D.value):null);async function A(e){let t=e.clipboardData?.items;if(!t)return;let n=Array.from(t).filter(e=>e.type.startsWith(`image/`));if(n.length!==0){e.preventDefault();for(let e of n){let t=e.getAsFile();t&&await a.uploadImage(t)}}}C(w,e=>{e&&(f.value=e,w.value=null)},{immediate:!0});function j(){x.value=null}function M(){T.value=null}return(t,i)=>(V(),P(`footer`,VH,[b(RH,{class:`ai-chat-composer__image-upload-bar`,onPreview:i[0]||=(e,t)=>n(`open-image-preview`,e,t)}),k.value?(V(),G(BH,{key:0,variant:`service`,icon:`ti-server`,label:k.value.name},null,8,[`label`])):K(``,!0),r(x)?(V(),G(BH,{key:1,icon:`ti-code`,label:r(o)(`aiChatPage.diffContextAttached`),text:r(x),removable:``,onRemove:j},null,8,[`label`,`text`])):K(``,!0),r(T)?(V(),G(BH,{key:2,icon:r(T).icon,label:r(T).label,text:r(T).text,removable:``,onRemove:M},null,8,[`icon`,`label`,`text`])):K(``,!0),N(`div`,HH,[b(r(et),{modelValue:f.value,"onUpdate:modelValue":i[1]||=e=>f.value=e,rows:`1`,"auto-resize":``,disabled:e.isStreamingCurrentConv,placeholder:r(o)(`aiChatPage.messagePlaceholder`),class:`ai-chat-composer__input`,onKeydown:i[2]||=pe(_e(e=>n(`submit`),[`exact`,`prevent`]),[`enter`]),onPaste:A},null,8,[`modelValue`,`disabled`,`placeholder`]),!p.value&&h.value.length>0?(V(),P(H,{key:0},[N(`button`,{class:`ai-chat-composer__model-btn`,title:g.value,onClick:v},[i[5]||=N(`i`,{class:`ti ti-brain`},null,-1),N(`span`,null,W(g.value),1)],8,UH),b(r(je),{ref_key:`modelPopover`,ref:_},{default:U(()=>[N(`div`,WH,[(V(!0),P(H,null,F(h.value,e=>(V(),P(`div`,{key:e,class:L([`ai-chat-composer__model-option`,{"ai-chat-composer__model-option--active":e===g.value}]),onClick:t=>y(e)},W(e),11,GH))),128))])]),_:1},512)],64)):K(``,!0),e.isStreamingCurrentConv?(V(),G(r(q),{key:1,icon:`ti ti-player-stop`,severity:`danger`,onClick:i[3]||=e=>r(a).stopStreaming()})):(V(),G(r(q),{key:2,icon:`ti ti-send`,disabled:r(d),onClick:i[4]||=e=>n(`submit`)},null,8,[`disabled`]))])]))}}),[[`__scopeId`,`data-v-13b0846a`]]),qH=Object.defineProperty,JH=Object.getOwnPropertyDescriptor,YH=(e,t)=>{for(var n in t)qH(e,n,{get:t[n],enumerable:!0})},XH=(e,t,n,r)=>{for(var i=r>1?void 0:r?JH(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&qH(t,n,i),i},ZH=(e,t)=>(n,r)=>t(n,r,e),QH=`Terminal input`,$H={get:()=>QH,set:e=>QH=e},eU=`Too much output to announce, navigate to rows manually to read`,tU={get:()=>eU,set:e=>eU=e};function nU(e){return e.replace(/\r?\n/g,`\r`)}function rU(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function iU(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function aU(e,t,n,r){e.stopPropagation(),e.clipboardData&&oU(e.clipboardData.getData(`text/plain`),t,n,r)}function oU(e,t,n,r){e=nU(e),e=rU(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function sU(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function cU(e,t,n,r,i){sU(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function lU(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function uU(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((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var dU=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++]=(this._interim-55296)*1024+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++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},fU=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=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},pU=``,mU=` `,hU=class e{constructor(){this.fg=0,this.bg=0,this.extended=new gU}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return!(this.fg&50331648)}isBgDefault(){return!(this.bg&50331648)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?!(this.extended.underlineColor&50331648):this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},gU=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},_U=class e extends hU{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new gU,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?lU(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},vU=`di$target`,yU=`di$dependencies`,bU=new Map;function xU(e){return e[yU]||[]}function SU(e){if(bU.has(e))return bU.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);CU(t,e,r)};return t._id=e,bU.set(e,t),t}function CU(e,t,n){t[vU]===t?t[yU].push({id:e,index:n}):(t[yU]=[{id:e,index:n}],t[vU]=t)}var wU=SU(`BufferService`),TU=SU(`CoreMouseService`),EU=SU(`CoreService`),DU=SU(`CharsetService`),OU=SU(`InstantiationService`),kU=SU(`LogService`),AU=SU(`OptionsService`),jU=SU(`OscLinkService`),MU=SU(`UnicodeService`),NU=SU(`DecorationService`),PU=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new _U,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(c!==-1||n.hasContent(t)){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId){if(c===-1){c=t,s=a.extended.urlId;continue}l=a.extended.urlId!==s}else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):FU(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};PU=XH([ZH(0,wU),ZH(1,AU),ZH(2,jU)],PU);function FU(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
268
|
+
|
|
269
|
+
WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}var IU=SU(`CharSizeService`),LU=SU(`CoreBrowserService`),RU=SU(`MouseService`),zU=SU(`RenderService`),BU=SU(`SelectionService`),VU=SU(`CharacterJoinerService`),HU=SU(`ThemeService`),UU=SU(`LinkProviderService`),WU=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?XU.isErrorNoTelemetry(e)?new XU(e.message+`
|
|
270
|
+
|
|
271
|
+
`+e.stack):Error(e.message+`
|
|
272
|
+
|
|
273
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function GU(e){qU(e)||WU.onUnexpectedError(e)}var KU=`Canceled`;function qU(e){return e instanceof JU||e instanceof Error&&e.name===KU&&e.message===KU}var JU=class extends Error{constructor(){super(KU),this.name=this.message}};function YU(e){return Error(e?`Illegal argument: ${e}`:`Illegal argument`)}var XU=class e extends Error{constructor(e){super(e),this.name=`CodeExpectedError`}static fromError(t){if(t instanceof e)return t;let n=new e;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(e){return e.name===`CodeExpectedError`}},ZU=class e extends Error{constructor(t){super(t||`An unexpected bug occurred.`),Object.setPrototypeOf(this,e.prototype)}};function QU(e,t=0){return e[e.length-(1+t)]}var $U;(e=>{function t(e){return e<0}e.isLessThan=t;function n(e){return e<=0}e.isLessThanOrEqual=n;function r(e){return e>0}e.isGreaterThan=r;function i(e){return e===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})($U||={});var eW=class e{constructor(e){this.iterate=e}forEach(e){this.iterate(t=>(e(t),!0))}toArray(){let e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(t){return new e(e=>this.iterate(n=>!t(n)||e(n)))}map(t){return new e(e=>this.iterate(n=>e(t(n))))}some(e){let t=!1;return this.iterate(n=>(t=e(n),!t)),t}findFirst(e){let t;return this.iterate(n=>!e(n)||(t=n,!1)),t}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(r=>((n||$U.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};eW.empty=new eW(e=>{});function tW(e,t){let n=this,r=!1,i;return function(){if(r)return i;if(r=!0,t)try{i=e.apply(n,arguments)}finally{t()}else i=e.apply(n,arguments);return i}}var nW;(e=>{function t(e){return e&&typeof e==`object`&&typeof e[Symbol.iterator]==`function`}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*i(e){yield e}e.single=i;function a(e){return t(e)?e:i(e)}e.wrap=a;function o(e){return e||n}e.from=o;function*s(e){for(let t=e.length-1;t>=0;t--)yield e[t]}e.reverse=s;function c(e){return!e||e[Symbol.iterator]().next().done===!0}e.isEmpty=c;function l(e){return e[Symbol.iterator]().next().value}e.first=l;function u(e,t){let n=0;for(let r of e)if(t(r,n++))return!0;return!1}e.some=u;function d(e,t){for(let n of e)if(t(n))return n}e.find=d;function*f(e,t){for(let n of e)t(n)&&(yield n)}e.filter=f;function*p(e,t){let n=0;for(let r of e)yield t(r,n++)}e.map=p;function*m(e,t){let n=0;for(let r of e)yield*t(r,n++)}e.flatMap=m;function*h(...e){for(let t of e)yield*t}e.concat=h;function g(e,t,n){let r=n;for(let n of e)r=t(r,n);return r}e.reduce=g;function*_(e,t,n=e.length){for(t<0&&(t+=e.length),n<0?n+=e.length:n>e.length&&(n=e.length);t<n;t++)yield e[t]}e.slice=_;function v(t,n=1/0){let r=[];if(n===0)return[r,t];let i=t[Symbol.iterator]();for(let t=0;t<n;t++){let t=i.next();if(t.done)return[r,e.empty()];r.push(t.value)}return[r,{[Symbol.iterator](){return i}}]}e.consume=v;async function y(e){let t=[];for await(let n of e)t.push(n);return Promise.resolve(t)}e.asyncToArray=y})(nW||={});var rW=null;function iW(e){return rW?.trackDisposable(e),e}function aW(e){rW?.markAsDisposed(e)}function oW(e,t){rW?.setParent(e,t)}function sW(e){return rW?.markAsSingleton(e),e}function cW(e){if(nW.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(e){t.push(e)}if(t.length===1)throw t[0];if(t.length>1)throw AggregateError(t,`Encountered errors while disposing of store`);return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function lW(...e){return uW(()=>cW(e))}function uW(e){let t=iW({dispose:tW(()=>{aW(t),e()})});return t}var dW=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,iW(this)}dispose(){this._isDisposed||(aW(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{cW(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return oW(t,this),this._isDisposed?e.DISABLE_DISPOSED_WARNING||console.warn(Error(`Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!`).stack):this._toDispose.add(t),t}delete(e){if(e){if(e===this)throw Error(`Cannot dispose a disposable on itself!`);this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),oW(e,null))}};dW.DISABLE_DISPOSED_WARNING=!1;var fW=dW,pW=class{constructor(){this._store=new fW,iW(this),oW(this._store,this)}dispose(){aW(this),this._store.dispose()}_register(e){if(e===this)throw Error(`Cannot register a disposable on itself!`);return this._store.add(e)}};pW.None=Object.freeze({dispose(){}});var mW=class{constructor(){this._isDisposed=!1,iW(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&oW(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,aW(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&oW(e,null),e}},hW=typeof window==`object`?window:globalThis,gW=class e{constructor(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}};gW.Undefined=new gW(void 0);var _W=gW,vW=class{constructor(){this._first=_W.Undefined,this._last=_W.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===_W.Undefined}clear(){let e=this._first;for(;e!==_W.Undefined;){let t=e.next;e.prev=_W.Undefined,e.next=_W.Undefined,e=t}this._first=_W.Undefined,this._last=_W.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new _W(e);if(this._first===_W.Undefined)this._first=n,this._last=n;else if(t){let e=this._last;this._last=n,n.prev=e,e.next=n}else{let e=this._first;this._first=n,n.next=e,e.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==_W.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==_W.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==_W.Undefined&&e.next!==_W.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===_W.Undefined&&e.next===_W.Undefined?(this._first=_W.Undefined,this._last=_W.Undefined):e.next===_W.Undefined?(this._last=this._last.prev,this._last.next=_W.Undefined):e.prev===_W.Undefined&&(this._first=this._first.next,this._first.prev=_W.Undefined);--this._size}*[Symbol.iterator](){let e=this._first;for(;e!==_W.Undefined;)yield e.element,e=e.next}},yW=globalThis.performance&&typeof globalThis.performance.now==`function`,bW=class e{static create(t){return new e(t)}constructor(e){this._now=yW&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime===-1?this._now()-this._startTime:this._stopTime-this._startTime}},xW;(e=>{e.None=()=>pW.None;function t(e,t){return d(e,()=>{},0,void 0,!0,void 0,t)}e.defer=t;function n(e){return(t,n=null,r)=>{let i=!1,a;return a=e(e=>{if(!i)return a?a.dispose():i=!0,t.call(n,e)},null,r),i&&a.dispose(),a}}e.once=n;function r(e,t,n){return l((n,r=null,i)=>e(e=>n.call(r,t(e)),null,i),n)}e.map=r;function i(e,t,n){return l((n,r=null,i)=>e(e=>{t(e),n.call(r,e)},null,i),n)}e.forEach=i;function a(e,t,n){return l((n,r=null,i)=>e(e=>t(e)&&n.call(r,e),null,i),n)}e.filter=a;function o(e){return e}e.signal=o;function s(...e){return(t,n=null,r)=>u(lW(...e.map(e=>e(e=>t.call(n,e)))),r)}e.any=s;function c(e,t,n,i){let a=n;return r(e,e=>(a=t(a,e),a),i)}e.reduce=c;function l(e,t){let n,r=new Q({onWillAddFirstListener(){n=e(r.fire,r)},onDidRemoveLastListener(){n?.dispose()}});return t?.add(r),r.event}function u(e,t){return t instanceof Array?t.push(e):t&&t.add(e),e}function d(e,t,n=100,r=!1,i=!1,a,o){let s,c,l,u=0,d,f=new Q({leakWarningThreshold:a,onWillAddFirstListener(){s=e(e=>{u++,c=t(c,e),r&&!l&&(f.fire(c),c=void 0),d=()=>{let e=c;c=void 0,l=void 0,(!r||u>1)&&f.fire(e),u=0},typeof n==`number`?(clearTimeout(l),l=setTimeout(d,n)):l===void 0&&(l=0,queueMicrotask(d))})},onWillRemoveListener(){i&&u>0&&d?.()},onDidRemoveLastListener(){d=void 0,s.dispose()}});return o?.add(f),f.event}e.debounce=d;function f(t,n=0,r){return e.debounce(t,(e,t)=>e?(e.push(t),e):[t],n,void 0,!0,void 0,r)}e.accumulate=f;function p(e,t=(e,t)=>e===t,n){let r=!0,i;return a(e,e=>{let n=r||!t(e,i);return r=!1,i=e,n},n)}e.latch=p;function m(t,n,r){return[e.filter(t,n,r),e.filter(t,e=>!n(e),r)]}e.split=m;function h(e,t=!1,n=[],r){let i=n.slice(),a=e(e=>{i?i.push(e):s.fire(e)});r&&r.add(a);let o=()=>{i?.forEach(e=>s.fire(e)),i=null},s=new Q({onWillAddFirstListener(){a||(a=e(e=>s.fire(e)),r&&r.add(a))},onDidAddFirstListener(){i&&(t?setTimeout(o):o())},onDidRemoveLastListener(){a&&a.dispose(),a=null}});return r&&r.add(s),s.event}e.buffer=h;function g(e,t){return(n,r,i)=>{let a=t(new v);return e(function(e){let t=a.evaluate(e);t!==_&&n.call(r,t)},void 0,i)}}e.chain=g;let _=Symbol(`HaltChainable`);class v{constructor(){this.steps=[]}map(e){return this.steps.push(e),this}forEach(e){return this.steps.push(t=>(e(t),t)),this}filter(e){return this.steps.push(t=>e(t)?t:_),this}reduce(e,t){let n=t;return this.steps.push(t=>(n=e(n,t),n)),this}latch(e=(e,t)=>e===t){let t=!0,n;return this.steps.push(r=>{let i=t||!e(r,n);return t=!1,n=r,i?r:_}),this}evaluate(e){for(let t of this.steps)if(e=t(e),e===_)break;return e}}function y(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new Q({onWillAddFirstListener:()=>e.on(t,r),onDidRemoveLastListener:()=>e.removeListener(t,r)});return i.event}e.fromNodeEventEmitter=y;function b(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new Q({onWillAddFirstListener:()=>e.addEventListener(t,r),onDidRemoveLastListener:()=>e.removeEventListener(t,r)});return i.event}e.fromDOMEventEmitter=b;function x(e){return new Promise(t=>n(e)(t))}e.toPromise=x;function S(e){let t=new Q;return e.then(e=>{t.fire(e)},()=>{t.fire(void 0)}).finally(()=>{t.dispose()}),t.event}e.fromPromise=S;function C(e,t){return e(e=>t.fire(e))}e.forward=C;function w(e,t,n){return t(n),e(e=>t(e))}e.runAndSubscribe=w;class T{constructor(e,t){this._observable=e,this._counter=0,this._hasChanged=!1;let n={onWillAddFirstListener:()=>{e.addObserver(this)},onDidRemoveLastListener:()=>{e.removeObserver(this)}};this.emitter=new Q(n),t&&t.add(this.emitter)}beginUpdate(e){this._counter++}handlePossibleChange(e){}handleChange(e,t){this._hasChanged=!0}endUpdate(e){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function E(e,t){return new T(e,t).emitter.event}e.fromObservable=E;function D(e){return(t,n,r)=>{let i=0,a=!1,o={beginUpdate(){i++},endUpdate(){i--,i===0&&(e.reportChanges(),a&&(a=!1,t.call(n)))},handlePossibleChange(){},handleChange(){a=!0}};e.addObserver(o),e.reportChanges();let s={dispose(){e.removeObserver(o)}};return r instanceof fW?r.add(s):Array.isArray(r)&&r.push(s),s}}e.fromObservableLight=D})(xW||={});var SW=class e{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${e._idPool++}`,e.all.add(this)}start(e){this._stopWatch=new bW,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};SW.all=new Set,SW._idPool=0;var CW=SW,wW=-1,TW=class e{constructor(t,n,r=(e._idPool++).toString(16).padStart(3,`0`)){this._errorHandler=t,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,t){let n=this.threshold;if(n<=0||t<n)return;this._stacks||=new Map;let r=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,r+1),--this._warnCountdown,this._warnCountdown<=0){this._warnCountdown=n*.5;let[e,r]=this.getMostFrequentStack(),i=`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${r}):`;console.warn(i),console.warn(e);let a=new OW(i,e);this._errorHandler(a)}return()=>{let t=this._stacks.get(e.value)||0;this._stacks.set(e.value,t-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(let[n,r]of this._stacks)(!e||t<r)&&(e=[n,r],t=r);return e}};TW._idPool=1;var EW=TW,DW=class e{constructor(e){this.value=e}static create(){return new e(Error().stack??``)}print(){console.warn(this.value.split(`
|
|
274
|
+
`).slice(2).join(`
|
|
275
|
+
`))}},OW=class extends Error{constructor(e,t){super(e),this.name=`ListenerLeakError`,this.stack=t}},kW=class extends Error{constructor(e,t){super(e),this.name=`ListenerRefusalError`,this.stack=t}},AW=0,jW=class{constructor(e){this.value=e,this.id=AW++}},MW=2,Q=class{constructor(e){this._size=0,this._options=e,this._leakageMon=wW>0||this._options?.leakWarningThreshold?new EW(e?.onListenerError??GU,this._options?.leakWarningThreshold??wW):void 0,this._perfMon=this._options?._profName?new CW(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??[`UNKNOWN stack`,-1],n=new kW(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||GU)(n),pW.None}if(this._disposed)return pW.None;t&&(e=e.bind(t));let r=new jW(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=DW.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof jW?(this._deliveryQueue??=new NW,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=uW(()=>{i?.(),this._removeListener(r)});return n instanceof fW?n.add(a):Array.isArray(n)&&n.push(a),a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log(`disposed?`,this._disposed),console.log(`size?`,this._size),console.log(`arr?`,JSON.stringify(this._listeners)),Error(`Attempted to dispose unknown listener`);this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*MW<=t.length){let e=0;for(let n=0;n<t.length;n++)t[n]?t[e++]=t[n]:r&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=e}}_deliver(e,t){if(!e)return;let n=this._options?.onListenerError||GU;if(!n){e.value(t);return}try{e.value(t)}catch(e){n(e)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners){if(this._listeners instanceof jW)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}}this._perfMon?.stop()}hasListeners(){return this._size>0}},NW=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},PW=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Q,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Q,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};PW.INSTANCE=new PW;var FW=PW;function IW(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}FW.INSTANCE.onDidChangeZoomLevel;function LW(e){return FW.INSTANCE.getZoomFactor(e)}FW.INSTANCE.onDidChangeFullscreen;var RW=typeof navigator==`object`?navigator.userAgent:``,zW=RW.indexOf(`Firefox`)>=0,BW=RW.indexOf(`AppleWebKit`)>=0,VW=RW.indexOf(`Chrome`)>=0,HW=!VW&&RW.indexOf(`Safari`)>=0;RW.indexOf(`Electron/`),RW.indexOf(`Android`);var UW=!1;if(typeof hW.matchMedia==`function`){let e=hW.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=hW.matchMedia(`(display-mode: fullscreen)`);UW=e.matches,IW(hW,e,({matches:e})=>{UW&&t.matches||(UW=e)})}function WW(){return UW}var GW=`en`,KW=!1,qW=!1,JW=!1,YW=!1,XW=!1,ZW=GW,QW,$W=globalThis,eG;typeof $W.vscode<`u`&&typeof $W.vscode.process<`u`?eG=$W.vscode.process:typeof process<`u`&&typeof process?.versions?.node==`string`&&(eG=process);var tG=typeof eG?.versions?.electron==`string`&&eG?.type===`renderer`;if(typeof eG==`object`){KW=eG.platform===`win32`,qW=eG.platform===`darwin`,JW=eG.platform===`linux`,JW&&eG.env.SNAP&&eG.env.SNAP_REVISION,eG.env.CI||eG.env.BUILD_ARTIFACTSTAGINGDIRECTORY,ZW=GW;let e=eG.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,ZW=t.resolvedLanguage||GW,t.languagePack?.translationsConfigFile}catch{}YW=!0}else typeof navigator==`object`&&!tG?(QW=navigator.userAgent,KW=QW.indexOf(`Windows`)>=0,qW=QW.indexOf(`Macintosh`)>=0,(QW.indexOf(`Macintosh`)>=0||QW.indexOf(`iPad`)>=0||QW.indexOf(`iPhone`)>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,JW=QW.indexOf(`Linux`)>=0,QW?.indexOf(`Mobi`),XW=!0,ZW=globalThis._VSCODE_NLS_LANGUAGE||GW,navigator.language.toLowerCase()):console.error(`Unable to resolve platform.`);var nG=KW,rG=qW,iG=JW,aG=YW;XW&&typeof $W.importScripts==`function`&&$W.origin;var oG=QW,sG=ZW,cG;(e=>{function t(){return sG}e.value=t;function n(){return sG.length===2?sG===`en`:sG.length>=3&&sG[0]===`e`&&sG[1]===`n`&&sG[2]===`-`}e.isDefaultVariant=n;function r(){return sG===`en`}e.isDefault=r})(cG||={});var lG=typeof $W.postMessage==`function`&&!$W.importScripts;(()=>{if(lG){let e=[];$W.addEventListener(`message`,t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=e.length;n<r;n++){let r=e[n];if(r.id===t.data.vscodeScheduleAsyncWork){e.splice(n,1),r.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),$W.postMessage({vscodeScheduleAsyncWork:r},`*`)}}return e=>setTimeout(e)})();var uG=!!(oG&&oG.indexOf(`Chrome`)>=0);oG&&oG.indexOf(`Firefox`),!uG&&oG&&oG.indexOf(`Safari`),oG&&oG.indexOf(`Edg/`),oG&&oG.indexOf(`Android`);var dG=typeof navigator==`object`?navigator:{};aG||document.queryCommandSupported&&document.queryCommandSupported(`copy`)||dG&&dG.clipboard&&dG.clipboard.writeText,aG||dG&&dG.clipboard&&dG.clipboard.readText,aG||WW()||dG.keyboard,`ontouchstart`in hW||dG.maxTouchPoints,hW.PointerEvent&&(`ontouchstart`in hW||navigator.maxTouchPoints);var fG=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},pG=new fG,mG=new fG,hG=new fG,gG=Array(230),_G;(e=>{function t(e){return pG.keyCodeToStr(e)}e.toString=t;function n(e){return pG.strToKeyCode(e)}e.fromString=n;function r(e){return mG.keyCodeToStr(e)}e.toUserSettingsUS=r;function i(e){return hG.keyCodeToStr(e)}e.toUserSettingsGeneral=i;function a(e){return mG.strToKeyCode(e)||hG.strToKeyCode(e)}e.fromUserSettings=a;function o(e){if(e>=98&&e<=113)return null;switch(e){case 16:return`Up`;case 18:return`Down`;case 15:return`Left`;case 17:return`Right`}return pG.keyCodeToStr(e)}e.toElectronAccelerator=o})(_G||={});var vG=class e{constructor(e,t,n,r,i){this.ctrlKey=e,this.shiftKey=t,this.altKey=n,this.metaKey=r,this.keyCode=i}equals(t){return t instanceof e&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){return`K${this.ctrlKey?`1`:`0`}${this.shiftKey?`1`:`0`}${this.altKey?`1`:`0`}${this.metaKey?`1`:`0`}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new yG([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},yG=class{constructor(e){if(e.length===0)throw YU(`chords`);this.chords=e}getHashCode(){let e=``;for(let t=0,n=this.chords.length;t<n;t++)t!==0&&(e+=`;`),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function bG(e){if(e.charCode){let t=String.fromCharCode(e.charCode).toUpperCase();return _G.fromString(t)}let t=e.keyCode;if(t===3)return 7;if(zW)switch(t){case 59:return 85;case 60:if(iG)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(rG)return 57}else if(BW&&(rG&&t===93||!rG&&t===92))return 57;return gG[t]||0}var xG=rG?256:2048,SG=512,CG=1024,wG=rG?2048:256,TG=class{constructor(e){this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState?.(`AltGraph`),this.keyCode=bG(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=xG),this.altKey&&(t|=SG),this.shiftKey&&(t|=CG),this.metaKey&&(t|=wG),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new vG(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},EG=new WeakMap;function DG(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,n=e.parent.location;if(t.origin!==`null`&&n.origin!==`null`&&t.origin!==n.origin)return null}catch{return null}return e.parent}var OG=class{static getSameOriginWindowChain(e){let t=EG.get(e);if(!t){t=[],EG.set(e,t);let n=e,r;do r=DG(n),r?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=r;while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,r=0,i=this.getSameOriginWindowChain(e);for(let e of i){let i=e.window.deref();if(n+=i?.scrollY??0,r+=i?.scrollX??0,i===t||!e.iframeElement)break;let a=e.iframeElement.getBoundingClientRect();n+=a.top,r+=a.left}return{top:n,left:r}}},kG=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type===`dblclick`&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX==`number`?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=OG.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},AG=class{constructor(e,t=0,n=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t;let r=!1;if(VW){let e=navigator.userAgent.match(/Chrome\/(\d+)/);r=(e?parseInt(e[1]):123)<=122}if(e){let t=e,n=e,i=e.view?.devicePixelRatio||1;if(typeof t.wheelDeltaY<`u`)this.deltaY=r?t.wheelDeltaY/(120*i):t.wheelDeltaY/120;else if(typeof n.VERTICAL_AXIS<`u`&&n.axis===n.VERTICAL_AXIS)this.deltaY=-n.detail/3;else if(e.type===`wheel`){let t=e;this.deltaY=t.deltaMode===t.DOM_DELTA_LINE?zW&&!rG?-e.deltaY/3:-e.deltaY:-e.deltaY/40}if(typeof t.wheelDeltaX<`u`)this.deltaX=HW&&nG?-(t.wheelDeltaX/120):r?t.wheelDeltaX/(120*i):t.wheelDeltaX/120;else if(typeof n.HORIZONTAL_AXIS<`u`&&n.axis===n.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type===`wheel`){let t=e;this.deltaX=t.deltaMode===t.DOM_DELTA_LINE?zW&&!rG?-e.deltaX/3:-e.deltaX:-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(this.deltaY=r?e.wheelDelta/(120*i):e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},jG=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),MG;(e=>{function t(t){return t===e.None||t===e.Cancelled||t instanceof NG?!0:!t||typeof t!=`object`?!1:typeof t.isCancellationRequested==`boolean`&&typeof t.onCancellationRequested==`function`}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:xW.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:jG})})(MG||={});var NG=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?jG:(this._emitter||=new Q,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),null)}},PG=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e==`function`&&typeof t==`number`&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new ZU(`Calling 'cancelAndSet' on a disposed TimeoutTimer`);this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new ZU(`Calling 'setIfNotSet' on a disposed TimeoutTimer`);this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},FG=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){if(this.isDisposed)throw new ZU(`Calling 'cancelAndSet' on a disposed IntervalTimer`);this.cancel();let r=n.setInterval(()=>{e()},t);this.disposable=uW(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};(function(){typeof globalThis.requestIdleCallback!=`function`||globalThis.cancelIdleCallback})();var IG;(e=>{async function t(e){let t,n=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||=e})));if(typeof t<`u`)throw t;return n}e.settled=t;function n(e){return new Promise(async(t,n)=>{try{await e(t,n)}catch(e){n(e)}})}e.withAsyncBody=n})(IG||={});var LG=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let n of t)e.emitOne(n)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new Q,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await xW.toPromise(this._onStateChanged.event)}while(1)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,n){return new e(async e=>{for await(let r of t)e.emitOne(n(r))})}map(t){return e.map(this,t)}static filter(t,n){return new e(async e=>{for await(let r of t)n(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let n of e)t.push(n);return t}toPromise(){return e.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};LG.EMPTY=LG.fromArray([]);function RG(e){return zG(e,0)}function zG(e,t){switch(typeof e){case`object`:return e===null?BG(349,t):Array.isArray(e)?UG(e,t):WG(e,t);case`string`:return HG(e,t);case`boolean`:return VG(e,t);case`number`:return BG(e,t);case`undefined`:return BG(937,t);default:return BG(617,t)}}function BG(e,t){return(t<<5)-t+e|0}function VG(e,t){return BG(e?433:863,t)}function HG(e,t){t=BG(149417,t);for(let n=0,r=e.length;n<r;n++)t=BG(e.charCodeAt(n),t);return t}function UG(e,t){return t=BG(104579,t),e.reduce((e,t)=>zG(t,e),t)}function WG(e,t){return t=BG(181387,t),Object.keys(e).sort().reduce((t,n)=>(t=HG(n,t),zG(e[n],t)),t)}var{registerWindow:gee,getWindow:GG,getDocument:_ee,getWindows:vee,getWindowsCount:yee,getWindowId:KG,getWindowById:bee,hasWindow:xee,onDidRegisterWindow:qG,onWillUnregisterWindow:See,onDidUnregisterWindow:Cee}=function(){let e=new Map,t={window:hW,disposables:new fW};e.set(hW.vscodeWindowId,t);let n=new Q,r=new Q,i=new Q;function a(n,r){return(typeof n==`number`?e.get(n):void 0)??(r?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:r.event,registerWindow(t){if(e.has(t.vscodeWindowId))return pW.None;let a=new fW,o={window:t,disposables:a.add(new fW)};return e.set(t.vscodeWindowId,o),a.add(uW(()=>{e.delete(t.vscodeWindowId),r.fire(t)})),a.add(YG(t,iK.BEFORE_UNLOAD,()=>{i.fire(t)})),n.fire(o),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(e){return e.vscodeWindowId},hasWindow(t){return e.has(t)},getWindowById:a,getWindow(e){let t=e;if(t?.ownerDocument?.defaultView)return t.ownerDocument.defaultView.window;let n=e;return n?.view?n.view.window:hW},getDocument(e){return GG(e).document}}}(),JG=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&=(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,null)}};function YG(e,t,n,r){return new JG(e,t,n,r)}function XG(e,t){return function(n){return t(new kG(e,n))}}function ZG(e){return function(t){return e(new TG(t))}}var QG=function(e,t,n,r){let i=n;return t===`click`||t===`mousedown`||t===`contextmenu`?i=XG(GG(e),n):(t===`keydown`||t===`keypress`||t===`keyup`)&&(i=ZG(n)),YG(e,t,i,r)},$G,eK=class extends FG{constructor(e){super(),this.defaultTarget=e&&GG(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},tK=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){GU(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,n=new Map,r=new Map,i=i=>{n.set(i,!1);let a=e.get(i)??[];for(t.set(i,a),e.set(i,[]),r.set(i,!0);a.length>0;)a.sort(tK.sort),a.shift().execute();r.set(i,!1)};$G=(t,r,a=0)=>{let o=KG(t),s=new tK(r,a),c=e.get(o);return c||(c=[],e.set(o,c)),c.push(s),n.get(o)||(n.set(o,!0),t.requestAnimationFrame(()=>i(o))),s}})();var nK=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,n=this.height){return t!==this.width||n!==this.height?new e(t,n):this}static is(e){return typeof e==`object`&&typeof e.height==`number`&&typeof e.width==`number`}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};nK.None=new nK(0,0);function rK(e){let t=e.getBoundingClientRect(),n=GG(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}new class{constructor(){this.mutationObservers=new Map}observe(e,t,n){let r=this.mutationObservers.get(e);r||(r=new Map,this.mutationObservers.set(e,r));let i=RG(n),a=r.get(i);if(a)a.users+=1;else{let o=new Q,s=new MutationObserver(e=>o.fire(e));s.observe(e,n);let c=a={users:1,observer:s,onDidMutate:o.event};t.add(uW(()=>{--c.users,c.users===0&&(o.dispose(),s.disconnect(),r?.delete(i),r?.size===0&&this.mutationObservers.delete(e))})),r.set(i,a)}return a.onDidMutate}};var iK={CLICK:`click`,AUXCLICK:`auxclick`,DBLCLICK:`dblclick`,MOUSE_UP:`mouseup`,MOUSE_DOWN:`mousedown`,MOUSE_OVER:`mouseover`,MOUSE_MOVE:`mousemove`,MOUSE_OUT:`mouseout`,MOUSE_ENTER:`mouseenter`,MOUSE_LEAVE:`mouseleave`,MOUSE_WHEEL:`wheel`,POINTER_UP:`pointerup`,POINTER_DOWN:`pointerdown`,POINTER_MOVE:`pointermove`,POINTER_LEAVE:`pointerleave`,CONTEXT_MENU:`contextmenu`,WHEEL:`wheel`,KEY_DOWN:`keydown`,KEY_PRESS:`keypress`,KEY_UP:`keyup`,LOAD:`load`,BEFORE_UNLOAD:`beforeunload`,UNLOAD:`unload`,PAGE_SHOW:`pageshow`,PAGE_HIDE:`pagehide`,PASTE:`paste`,ABORT:`abort`,ERROR:`error`,RESIZE:`resize`,SCROLL:`scroll`,FULLSCREEN_CHANGE:`fullscreenchange`,WK_FULLSCREEN_CHANGE:`webkitfullscreenchange`,SELECT:`select`,CHANGE:`change`,SUBMIT:`submit`,RESET:`reset`,FOCUS:`focus`,FOCUS_IN:`focusin`,FOCUS_OUT:`focusout`,BLUR:`blur`,INPUT:`input`,STORAGE:`storage`,DRAG_START:`dragstart`,DRAG:`drag`,DRAG_ENTER:`dragenter`,DRAG_LEAVE:`dragleave`,DRAG_OVER:`dragover`,DROP:`drop`,DRAG_END:`dragend`,ANIMATION_START:BW?`webkitAnimationStart`:`animationstart`,ANIMATION_END:BW?`webkitAnimationEnd`:`animationend`,ANIMATION_ITERATION:BW?`webkitAnimationIteration`:`animationiteration`},aK=class{constructor(e){this.domNode=e,this._maxWidth=``,this._width=``,this._height=``,this._top=``,this._left=``,this._bottom=``,this._right=``,this._paddingTop=``,this._paddingLeft=``,this._paddingBottom=``,this._paddingRight=``,this._fontFamily=``,this._fontWeight=``,this._fontSize=``,this._fontStyle=``,this._fontFeatureSettings=``,this._fontVariationSettings=``,this._textDecoration=``,this._lineHeight=``,this._letterSpacing=``,this._className=``,this._display=``,this._position=``,this._visibility=``,this._color=``,this._backgroundColor=``,this._layerHint=!1,this._contain=`none`,this._boxShadow=``}setMaxWidth(e){let t=oK(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=oK(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=oK(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=oK(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=oK(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=oK(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=oK(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=oK(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=oK(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=oK(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=oK(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=oK(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=oK(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=oK(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?`translate3d(0px, 0px, 0px)`:``)}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function oK(e){return typeof e==`number`?`${e}px`:e}function sK(e){return new aK(e)}var cK=class{constructor(){this._hooks=new fW,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,r,i){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=i;let a=e;try{e.setPointerCapture(t),this._hooks.add(uW(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{a=GG(e)}this._hooks.add(YG(a,iK.POINTER_MOVE,e=>{if(e.buttons!==n){this.stopMonitoring(!0);return}e.preventDefault(),this._pointerMoveCallback(e)})),this._hooks.add(YG(a,iK.POINTER_UP,e=>this.stopMonitoring(!0)))}};function lK(e,t,n){let r=null,i=null;if(typeof n.value==`function`?(r=`value`,i=n.value,i.length!==0&&console.warn(`Memoize should only be used in functions with zero parameters`)):typeof n.get==`function`&&(r=`get`,i=n.get),!i)throw Error(`not supported`);let a=`$memoize$${t}`;n[r]=function(...e){return this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:i.apply(this,e)}),this[a]}}var uK;(e=>(e.Tap=`-xterm-gesturetap`,e.Change=`-xterm-gesturechange`,e.Start=`-xterm-gesturestart`,e.End=`-xterm-gesturesend`,e.Contextmenu=`-xterm-gesturecontextmenu`))(uK||={});var dK=class e extends pW{constructor(){super(),this.dispatched=!1,this.targets=new vW,this.ignoreTargets=new vW,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(xW.runAndSubscribe(qG,({window:e,disposables:t})=>{t.add(YG(e.document,`touchstart`,e=>this.onTouchStart(e),{passive:!1})),t.add(YG(e.document,`touchend`,t=>this.onTouchEnd(e,t))),t.add(YG(e.document,`touchmove`,e=>this.onTouchMove(e),{passive:!1}))},{window:hW,disposables:this._store}))}static addTarget(t){return e.isTouchDevice()?(e.INSTANCE||=sW(new e),uW(e.INSTANCE.targets.push(t))):pW.None}static ignoreTarget(t){return e.isTouchDevice()?(e.INSTANCE||=sW(new e),uW(e.INSTANCE.ignoreTargets.push(t))):pW.None}static isTouchDevice(){return`ontouchstart`in hW||navigator.maxTouchPoints>0}dispose(){this.handle&&=(this.handle.dispose(),null),super.dispose()}onTouchStart(e){let t=Date.now();this.handle&&=(this.handle.dispose(),null);for(let n=0,r=e.targetTouches.length;n<r;n++){let r=e.targetTouches.item(n);this.activeTouches[r.identifier]={id:r.identifier,initialTarget:r.target,initialTimeStamp:t,initialPageX:r.pageX,initialPageY:r.pageY,rollingTimestamps:[t],rollingPageX:[r.pageX],rollingPageY:[r.pageY]};let i=this.newGestureEvent(uK.Start,r.target);i.pageX=r.pageX,i.pageY=r.pageY,this.dispatchEvent(i)}this.dispatched&&=(e.preventDefault(),e.stopPropagation(),!1)}onTouchEnd(t,n){let r=Date.now(),i=Object.keys(this.activeTouches).length;for(let a=0,o=n.changedTouches.length;a<o;a++){let o=n.changedTouches.item(a);if(!this.activeTouches.hasOwnProperty(String(o.identifier))){console.warn(`move of an UNKNOWN touch`,o);continue}let s=this.activeTouches[o.identifier],c=Date.now()-s.initialTimeStamp;if(c<e.HOLD_DELAY&&Math.abs(s.initialPageX-QU(s.rollingPageX))<30&&Math.abs(s.initialPageY-QU(s.rollingPageY))<30){let e=this.newGestureEvent(uK.Tap,s.initialTarget);e.pageX=QU(s.rollingPageX),e.pageY=QU(s.rollingPageY),this.dispatchEvent(e)}else if(c>=e.HOLD_DELAY&&Math.abs(s.initialPageX-QU(s.rollingPageX))<30&&Math.abs(s.initialPageY-QU(s.rollingPageY))<30){let e=this.newGestureEvent(uK.Contextmenu,s.initialTarget);e.pageX=QU(s.rollingPageX),e.pageY=QU(s.rollingPageY),this.dispatchEvent(e)}else if(i===1){let e=QU(s.rollingPageX),n=QU(s.rollingPageY),i=QU(s.rollingTimestamps)-s.rollingTimestamps[0],a=e-s.rollingPageX[0],o=n-s.rollingPageY[0],c=[...this.targets].filter(e=>s.initialTarget instanceof Node&&e.contains(s.initialTarget));this.inertia(t,c,r,Math.abs(a)/i,a>0?1:-1,e,Math.abs(o)/i,o>0?1:-1,n)}this.dispatchEvent(this.newGestureEvent(uK.End,s.initialTarget)),delete this.activeTouches[o.identifier]}this.dispatched&&=(n.preventDefault(),n.stopPropagation(),!1)}newGestureEvent(e,t){let n=document.createEvent(`CustomEvent`);return n.initEvent(e,!1,!0),n.initialTarget=t,n.tapCount=0,n}dispatchEvent(t){if(t.type===uK.Tap){let n=new Date().getTime(),r=0;r=n-this._lastSetTapCountTime>e.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=n,t.tapCount=r}else(t.type===uK.Change||t.type===uK.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let e of this.ignoreTargets)if(e.contains(t.initialTarget))return;let e=[];for(let n of this.targets)if(n.contains(t.initialTarget)){let r=0,i=t.initialTarget;for(;i&&i!==n;)r++,i=i.parentElement;e.push([r,n])}e.sort((e,t)=>e[0]-t[0]);for(let[n,r]of e)r.dispatchEvent(t),this.dispatched=!0}}inertia(t,n,r,i,a,o,s,c,l){this.handle=$G(t,()=>{let u=Date.now(),d=u-r,f=0,p=0,m=!0;i+=e.SCROLL_FRICTION*d,s+=e.SCROLL_FRICTION*d,i>0&&(m=!1,f=a*i*d),s>0&&(m=!1,p=c*s*d);let h=this.newGestureEvent(uK.Change);h.translationX=f,h.translationY=p,n.forEach(e=>e.dispatchEvent(h)),m||this.inertia(t,n,u,i,a,o+f,s,c,l+p)})}onTouchMove(e){let t=Date.now();for(let n=0,r=e.changedTouches.length;n<r;n++){let r=e.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(r.identifier))){console.warn(`end of an UNKNOWN touch`,r);continue}let i=this.activeTouches[r.identifier],a=this.newGestureEvent(uK.Change,i.initialTarget);a.translationX=r.pageX-QU(i.rollingPageX),a.translationY=r.pageY-QU(i.rollingPageY),a.pageX=r.pageX,a.pageY=r.pageY,this.dispatchEvent(a),i.rollingPageX.length>3&&(i.rollingPageX.shift(),i.rollingPageY.shift(),i.rollingTimestamps.shift()),i.rollingPageX.push(r.pageX),i.rollingPageY.push(r.pageY),i.rollingTimestamps.push(t)}this.dispatched&&=(e.preventDefault(),e.stopPropagation(),!1)}};dK.SCROLL_FRICTION=-.005,dK.HOLD_DELAY=700,dK.CLEAR_TAP_COUNT_TIME=400,XH([lK],dK,`isTouchDevice`,1);var fK=dK,pK=class extends pW{onclick(e,t){this._register(YG(e,iK.CLICK,n=>t(new kG(GG(e),n))))}onmousedown(e,t){this._register(YG(e,iK.MOUSE_DOWN,n=>t(new kG(GG(e),n))))}onmouseover(e,t){this._register(YG(e,iK.MOUSE_OVER,n=>t(new kG(GG(e),n))))}onmouseleave(e,t){this._register(YG(e,iK.MOUSE_LEAVE,n=>t(new kG(GG(e),n))))}onkeydown(e,t){this._register(YG(e,iK.KEY_DOWN,e=>t(new TG(e))))}onkeyup(e,t){this._register(YG(e,iK.KEY_UP,e=>t(new TG(e))))}oninput(e,t){this._register(YG(e,iK.INPUT,t))}onblur(e,t){this._register(YG(e,iK.BLUR,t))}onfocus(e,t){this._register(YG(e,iK.FOCUS,t))}onchange(e,t){this._register(YG(e,iK.CHANGE,t))}ignoreGesture(e){return fK.ignoreTarget(e)}},mK=11,hK=class extends pK{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement(`div`),this.bgDomNode.className=`arrow-background`,this.bgDomNode.style.position=`absolute`,this.bgDomNode.style.width=e.bgWidth+`px`,this.bgDomNode.style.height=e.bgHeight+`px`,typeof e.top<`u`&&(this.bgDomNode.style.top=`0px`),typeof e.left<`u`&&(this.bgDomNode.style.left=`0px`),typeof e.bottom<`u`&&(this.bgDomNode.style.bottom=`0px`),typeof e.right<`u`&&(this.bgDomNode.style.right=`0px`),this.domNode=document.createElement(`div`),this.domNode.className=e.className,this.domNode.style.position=`absolute`,this.domNode.style.width=mK+`px`,this.domNode.style.height=mK+`px`,typeof e.top<`u`&&(this.domNode.style.top=e.top+`px`),typeof e.left<`u`&&(this.domNode.style.left=e.left+`px`),typeof e.bottom<`u`&&(this.domNode.style.bottom=e.bottom+`px`),typeof e.right<`u`&&(this.domNode.style.right=e.right+`px`),this._pointerMoveMonitor=this._register(new cK),this._register(QG(this.bgDomNode,iK.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register(QG(this.domNode,iK.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new eK),this._pointerdownScheduleRepeatTimer=this._register(new PG)}_arrowPointerDown(e){e.target&&e.target instanceof Element&&(this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,GG(e))},200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault())}},gK=class e{constructor(e,t,n,r,i,a,o){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t|=0,n|=0,r|=0,i|=0,a|=0,o|=0),this.rawScrollLeft=r,this.rawScrollTop=o,t<0&&(t=0),r+t>n&&(r=n-t),r<0&&(r=0),i<0&&(i=0),o+i>a&&(o=a-i),o<0&&(o=0),this.width=t,this.scrollWidth=n,this.scrollLeft=r,this.height=i,this.scrollHeight=a,this.scrollTop=o}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(t,n){return new e(this._forceIntegerValues,typeof t.width<`u`?t.width:this.width,typeof t.scrollWidth<`u`?t.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof t.height<`u`?t.height:this.height,typeof t.scrollHeight<`u`?t.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new e(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<`u`?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<`u`?t.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){let n=this.width!==e.width,r=this.scrollWidth!==e.scrollWidth,i=this.scrollLeft!==e.scrollLeft,a=this.height!==e.height,o=this.scrollHeight!==e.scrollHeight,s=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:r,scrollLeftChanged:i,heightChanged:a,scrollHeightChanged:o,scrollTopChanged:s}}},_K=class extends pW{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new Q),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new gK(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&=(this._smoothScrolling.dispose(),null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let n=this._state.withScrollDimensions(e,t);this._setState(n,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&=(this._smoothScrolling.dispose(),null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>`u`?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>`u`?this._smoothScrolling.to.scrollTop:e.scrollTop};let n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let r;r=t?new xK(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{let t=this._state.withScrollPosition(e);this._smoothScrolling=xK.start(this._state,t,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}},vK=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function yK(e,t){let n=t-e;return function(t){return e+n*CK(t)}}function bK(e,t,n){return function(r){return r<n?e(r/n):t((r-n)/(1-n))}}var xK=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.duration=r,this.startTime=n,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,n){if(Math.abs(e-t)>2.5*n){let r,i;return e<t?(r=e+.75*n,i=t-.75*n):(r=e-.75*n,i=t+.75*n),bK(yK(e,r),yK(i,t),.33)}return yK(e,t)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){let t=(e-this.startTime)/this.duration;return t<1?new vK(this.scrollLeft(t),this.scrollTop(t),!1):new vK(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,n,r){return e.start(t,n,r)}static start(t,n,r){r+=10;let i=Date.now()-10;return new e(t,n,i,r)}};function SK(e){return e**3}function CK(e){return 1-SK(1-e)}var wK=class extends pW{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new PG)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3||this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?` fade`:``)))}},TK=140,EK=class extends pK{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new wK(e.visibility,`visible scrollbar `+e.extraScrollbarClassName,`invisible scrollbar `+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new cK),this._shouldRender=!0,this.domNode=sK(document.createElement(`div`)),this.domNode.setAttribute(`role`,`presentation`),this.domNode.setAttribute(`aria-hidden`,`true`),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition(`absolute`),this._register(YG(this.domNode.domNode,iK.POINTER_DOWN,e=>this._domNodePointerDown(e)))}_createArrow(e){let t=this._register(new hK(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=sK(document.createElement(`div`)),this.slider.setClassName(`slider`),this.slider.setPosition(`absolute`),this.slider.setTop(e),this.slider.setLeft(t),typeof n==`number`&&this.slider.setWidth(n),typeof r==`number`&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain(`strict`),this.domNode.domNode.appendChild(this.slider.domNode),this._register(YG(this.slider.domNode,iK.POINTER_DOWN,e=>{e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))})),this.onclick(this.slider.domNode,e=>{e.leftButton&&e.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),i=this._sliderPointerPosition(e);n<=i&&i<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX==`number`&&typeof e.offsetY==`number`)t=e.offsetX,n=e.offsetY;else{let r=rK(this.domNode.domNode);t=e.pageX-r.left,n=e.pageY-r.top}let r=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName(`active`,!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{let i=this._sliderOrthogonalPointerPosition(e),a=Math.abs(i-n);if(nG&&a>TK){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let o=this._sliderPointerPosition(e)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(o))},()=>{this.slider.toggleClassName(`active`,!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},DK=class e{constructor(e,t,n,r,i,a){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=r,this._scrollSize=i,this._scrollPosition=a,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new e(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){let t=Math.round(e);return this._visibleSize!==t&&(this._visibleSize=t,this._refreshComputedValues(),!0)}setScrollSize(e){let t=Math.round(e);return this._scrollSize!==t&&(this._scrollSize=t,this._refreshComputedValues(),!0)}setScrollPosition(e){let t=Math.round(e);return this._scrollPosition!==t&&(this._scrollPosition=t,this._refreshComputedValues(),!0)}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,n,r,i){let a=Math.max(0,n-e),o=Math.max(0,a-2*t),s=r>0&&r>n;if(!s)return{computedAvailableSize:Math.round(a),computedIsNeeded:s,computedSliderSize:Math.round(o),computedSliderRatio:0,computedSliderPosition:0};let c=Math.round(Math.max(20,Math.floor(n*o/r))),l=(o-c)/(r-n),u=i*l;return{computedAvailableSize:Math.round(a),computedIsNeeded:s,computedSliderSize:Math.round(c),computedSliderRatio:l,computedSliderPosition:Math.round(u)}}_refreshComputedValues(){let t=e._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize,n=this._scrollPosition;return t<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;let t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)}},OK=class extends EK{constructor(e,t,n){let r=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new DK(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,r.width,r.scrollWidth,i.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:`horizontal`,scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw Error(`horizontalHasArrows is not supported in xterm.js`);this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},kK=class extends EK{constructor(e,t,n){let r=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new DK(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,i.scrollTop),visibility:t.vertical,extraScrollbarClassName:`vertical`,scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw Error(`horizontalHasArrows is not supported in xterm.js`);this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},AK=500,jK=50,MK=!0,NK=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},PK=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,t=0,n=1,r=this._rear;do{let i=r===this._front?e:2**-n;if(e-=i,t+=this._memory[r].score*i,r===this._front)break;r=(this._capacity+r-1)%this._capacity,n++}while(1);return t<=.5}acceptStandardWheelEvent(e){if(VW){let t=LW(GG(e.browserEvent));this.accept(Date.now(),e.deltaX*t,e.deltaY*t)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,n){let r=null,i=new NK(e,t,n);this._front===-1&&this._rear===-1?(this._memory[0]=i,this._front=0,this._rear=0):(r=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=i),i.score=this._computeScore(i,r)}_computeScore(e,t){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let n=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(n+=.25),t){let r=Math.abs(e.deltaX),i=Math.abs(e.deltaY),a=Math.abs(t.deltaX),o=Math.abs(t.deltaY),s=Math.max(Math.min(r,a),1),c=Math.max(Math.min(i,o),1),l=Math.max(r,a),u=Math.max(i,o);l%s===0&&u%c===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};PK.INSTANCE=new PK;var FK=PK,IK=class extends pK{constructor(e,t,n){super(),this._onScroll=this._register(new Q),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new Q),this.onWillScroll=this._onWillScroll.event,this._options=RK(t),this._scrollable=n,this._register(this._scrollable.onScroll(e=>{this._onWillScroll.fire(e),this._onDidScroll(e),this._onScroll.fire(e)}));let r={onMouseWheel:e=>this._onMouseWheel(e),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new kK(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new OK(this._scrollable,this._options,r)),this._domNode=document.createElement(`div`),this._domNode.className=`xterm-scrollable-element `+this._options.className,this._domNode.setAttribute(`role`,`presentation`),this._domNode.style.position=`relative`,this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=sK(document.createElement(`div`)),this._leftShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=sK(document.createElement(`div`)),this._topShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=sK(document.createElement(`div`)),this._topLeftShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,e=>this._onMouseOver(e)),this.onmouseleave(this._listenOnDomNode,e=>this._onMouseLeave(e)),this._hideTimeout=this._register(new PG),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=cW(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,rG&&(this._options.className+=` mac`),this._domNode.className=`xterm-scrollable-element `+this._options.className}updateOptions(e){typeof e.handleMouseWheel<`u`&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<`u`&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<`u`&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<`u`&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<`u`&&(this._options.horizontal=e.horizontal),typeof e.vertical<`u`&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<`u`&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<`u`&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<`u`&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new AG(e))}_setListeningToMouseWheel(e){this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=cW(this._mouseWheelToDispose),e)&&this._mouseWheelToDispose.push(YG(this._listenOnDomNode,iK.MOUSE_WHEEL,e=>{this._onMouseWheel(new AG(e))},{passive:!1}))}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=FK.INSTANCE;MK&&t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,i=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&i+r===0?i=r=0:Math.abs(r)>=Math.abs(i)?i=0:r=0),this._options.flipAxes&&([r,i]=[i,r]);let a=!rG&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!i&&(i=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(i*=this._options.fastScrollSensitivity,r*=this._options.fastScrollSensitivity);let o=this._scrollable.getFutureScrollPosition(),s={};if(r){let e=jK*r,t=o.scrollTop-(e<0?Math.floor(e):Math.ceil(e));this._verticalScrollbar.writeScrollPosition(s,t)}if(i){let e=jK*i,t=o.scrollLeft-(e<0?Math.floor(e):Math.ceil(e));this._horizontalScrollbar.writeScrollPosition(s,t)}s=this._scrollable.validateScrollPosition(s),(o.scrollLeft!==s.scrollLeft||o.scrollTop!==s.scrollTop)&&(MK&&this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(s):this._scrollable.setScrollPositionNow(s),n=!0)}let r=n;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0,r=n?` left`:``,i=t?` top`:``,a=n||t?` top-left-corner`:``;this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${i}`),this._topLeftShadowDomNode.setClassName(`shadow${a}${i}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),AK)}},LK=class extends IK{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function RK(e){let t={lazyRender:typeof e.lazyRender<`u`&&e.lazyRender,className:typeof e.className<`u`?e.className:``,useShadows:typeof e.useShadows<`u`?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<`u`?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<`u`&&e.flipAxes,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<`u`&&e.consumeMouseWheelIfScrollbarIsNeeded,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<`u`&&e.alwaysConsumeMouseWheel,scrollYToX:typeof e.scrollYToX<`u`&&e.scrollYToX,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<`u`?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<`u`?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<`u`?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<`u`?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<`u`?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<`u`?e.listenOnDomNode:null,horizontal:typeof e.horizontal<`u`?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<`u`?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<`u`?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<`u`&&e.horizontalHasArrows,vertical:typeof e.vertical<`u`?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<`u`?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<`u`&&e.verticalHasArrows,verticalSliderSize:typeof e.verticalSliderSize<`u`?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<`u`&&e.scrollByPage};return t.horizontalSliderSize=typeof e.horizontalSliderSize<`u`?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<`u`?e.verticalSliderSize:t.verticalScrollbarSize,rG&&(t.className+=` mac`),t}var zK=class extends pW{constructor(e,t,n,r,i,a,o,s){super(),this._bufferService=n,this._optionsService=o,this._renderService=s,this._onRequestScrollLines=this._register(new Q),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let c=this._register(new _K({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:e=>$G(r.window,e)}));this._register(this._optionsService.onSpecificOptionChange(`smoothScrollDuration`,()=>{c.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new LK(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},c)),this._register(this._optionsService.onMultipleOptionChange([`scrollSensitivity`,`fastScrollSensitivity`,`overviewRuler`],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(i.onProtocolChange(e=>{this._scrollableElement.updateOptions({handleMouseWheel:!(e&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(xW.runAndSubscribe(a.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=a.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(uW(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement(`style`),t.appendChild(this._styleElement),this._register(uW(()=>this._styleElement.remove())),this._register(xW.runAndSubscribe(a.onChangeColors,()=>{this._styleElement.textContent=[`.xterm .xterm-scrollable-element > .scrollbar > .slider {`,` background: ${a.colors.scrollbarSliderBackground.css};`,`}`,`.xterm .xterm-scrollable-element > .scrollbar > .slider:hover {`,` background: ${a.colors.scrollbarSliderHoverBackground.css};`,`}`,`.xterm .xterm-scrollable-element > .scrollbar > .slider.active {`,` background: ${a.colors.scrollbarSliderActiveBackground.css};`,`}`].join(`
|
|
276
|
+
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(e=>this._handleScroll(e)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};zK=XH([ZH(2,wU),ZH(3,LU),ZH(4,TU),ZH(5,HU),ZH(6,AU),ZH(7,zU)],zK);var BK=class extends pW{constructor(e,t,n,r,i){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=i,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement(`div`),this._container.classList.add(`xterm-decoration-container`),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(e=>this._removeDecoration(e))),this._register(uW(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement(`div`);t.classList.add(`xterm-decoration`),t.classList.toggle(`xterm-decoration-top-layer`,e?.options?.layer===`top`),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display=`none`),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display=`none`,e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?`none`:`block`,this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,t=e.element){if(!t)return;let n=e.options.x??0;(e.options.anchor||`left`)===`right`?t.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:``:t.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:``}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};BK=XH([ZH(1,wU),ZH(2,LU),ZH(3,NU),ZH(4,zU)],BK);var VK=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,n){return t>=e.startBufferLine-this._linePadding[n||`full`]&&t<=e.endBufferLine+this._linePadding[n||`full`]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},HK={full:0,left:0,center:0,right:0},UK={full:0,left:0,center:0,right:0},WK={full:0,left:0,center:0,right:0},GK=class extends pW{constructor(e,t,n,r,i,a,o,s){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=i,this._optionsService=a,this._themeService=o,this._coreBrowserService=s,this._colorZoneStore=new VK,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`),this._canvas.classList.add(`xterm-decoration-overview-ruler`),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(uW(()=>this._canvas?.remove()));let c=this._canvas.getContext(`2d`);if(c)this._ctx=c;else throw Error(`Ctx cannot be null`);this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?`none`:`block`})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange(`overviewRuler`,()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);UK.full=this._canvas.width,UK.left=e,UK.center=t,UK.right=e,this._refreshDrawHeightConstants(),WK.full=1,WK.left=1,WK.center=1+UK.left,WK.right=1+UK.left+UK.center}_refreshDrawHeightConstants(){HK.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);HK.left=t,HK.center=t,HK.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*HK.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*HK.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*HK.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*HK.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let e of this._decorationService.decorations)this._colorZoneStore.addDecoration(e);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!==`full`&&this._renderColorZone(t);for(let t of e)t.position===`full`&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(WK[e.position||`full`],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-HK[e.position||`full`]/2),UK[e.position||`full`],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+HK[e.position||`full`]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};GK=XH([ZH(2,wU),ZH(3,NU),ZH(4,zU),ZH(5,AU),ZH(6,HU),ZH(7,LU)],GK);var $;(e=>(e.NUL=`\0`,e.SOH=``,e.STX=``,e.ETX=``,e.EOT=``,e.ENQ=``,e.ACK=``,e.BEL=`\x07`,e.BS=`\b`,e.HT=` `,e.LF=`
|
|
277
|
+
`,e.VT=`\v`,e.FF=`\f`,e.CR=`\r`,e.SO=``,e.SI=``,e.DLE=``,e.DC1=``,e.DC2=``,e.DC3=``,e.DC4=``,e.NAK=``,e.SYN=``,e.ETB=``,e.CAN=``,e.EM=``,e.SUB=``,e.ESC=`\x1B`,e.FS=``,e.GS=``,e.RS=``,e.US=``,e.SP=` `,e.DEL=``))($||={});var KK;(e=>(e.PAD=``,e.HOP=``,e.BPH=``,e.NBH=``,e.IND=``,e.NEL=`
`,e.SSA=``,e.ESA=``,e.HTS=``,e.HTJ=``,e.VTS=``,e.PLD=``,e.PLU=``,e.RI=``,e.SS2=``,e.SS3=``,e.DCS=``,e.PU1=``,e.PU2=``,e.STS=``,e.CCH=``,e.MW=``,e.SPA=``,e.EPA=``,e.SOS=``,e.SGCI=``,e.SCI=``,e.CSI=``,e.ST=``,e.OSC=``,e.PM=``,e.APC=``))(KK||={});var qK;(e=>e.ST=`${$.ESC}\\`)(qK||={});var JK=class{constructor(e,t,n,r,i,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=i,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=``}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent=``,this._dataAlreadySent=``,this._compositionView.classList.add(`active`)}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove(`active`),this._isComposing=!1,e){let e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let t;e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,this._compositionPosition.start):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}},0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,``);this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${$.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),t=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+`px`,this._compositionView.style.top=n+`px`,this._compositionView.style.height=t+`px`,this._compositionView.style.lineHeight=t+`px`,this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+`px`;let i=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+`px`,this._textarea.style.top=n+`px`,this._textarea.style.width=Math.max(i.width,1)+`px`,this._textarea.style.height=Math.max(i.height,1)+`px`,this._textarea.style.lineHeight=i.height+`px`}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};JK=XH([ZH(2,wU),ZH(3,AU),ZH(4,EU),ZH(5,zU)],JK);var YK=0,XK=0,ZK=0,QK=0,$K={css:`#00000000`,rgba:0},eq;(e=>{function t(e,t,n,r){return r===void 0?`#${aq(e)}${aq(t)}${aq(n)}`:`#${aq(e)}${aq(t)}${aq(n)}${aq(r)}`}e.toCss=t;function n(e,t,n,r=255){return(e<<24|t<<16|n<<8|r)>>>0}e.toRgba=n;function r(t,n,r,i){return{css:e.toCss(t,n,r,i),rgba:e.toRgba(t,n,r,i)}}e.toColor=r})(eq||={});var tq;(e=>{function t(e,t){if(QK=(t.rgba&255)/255,QK===1)return{css:t.css,rgba:t.rgba};let n=t.rgba>>24&255,r=t.rgba>>16&255,i=t.rgba>>8&255,a=e.rgba>>24&255,o=e.rgba>>16&255,s=e.rgba>>8&255;return YK=a+Math.round((n-a)*QK),XK=o+Math.round((r-o)*QK),ZK=s+Math.round((i-s)*QK),{css:eq.toCss(YK,XK,ZK),rgba:eq.toRgba(YK,XK,ZK)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=iq.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return eq.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[YK,XK,ZK]=iq.toChannels(t),{css:eq.toCss(YK,XK,ZK),rgba:t}}e.opaque=i;function a(e,t){return QK=Math.round(t*255),[YK,XK,ZK]=iq.toChannels(e.rgba),{css:eq.toCss(YK,XK,ZK,QK),rgba:eq.toRgba(YK,XK,ZK,QK)}}e.opacity=a;function o(e,t){return QK=e.rgba&255,a(e,QK*t/255)}e.multiplyOpacity=o;function s(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}e.toColorRGB=s})(tq||={});var nq;(e=>{let t,n;try{let e=document.createElement(`canvas`);e.width=1,e.height=1;let r=e.getContext(`2d`,{willReadFrequently:!0});r&&(t=r,t.globalCompositeOperation=`copy`,n=t.createLinearGradient(0,0,1,1))}catch{}function r(e){if(e.match(/#[\da-f]{3,8}/i))switch(e.length){case 4:return YK=parseInt(e.slice(1,2).repeat(2),16),XK=parseInt(e.slice(2,3).repeat(2),16),ZK=parseInt(e.slice(3,4).repeat(2),16),eq.toColor(YK,XK,ZK);case 5:return YK=parseInt(e.slice(1,2).repeat(2),16),XK=parseInt(e.slice(2,3).repeat(2),16),ZK=parseInt(e.slice(3,4).repeat(2),16),QK=parseInt(e.slice(4,5).repeat(2),16),eq.toColor(YK,XK,ZK,QK);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 r=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(r)return YK=parseInt(r[1]),XK=parseInt(r[2]),ZK=parseInt(r[3]),QK=Math.round((r[5]===void 0?1:parseFloat(r[5]))*255),eq.toColor(YK,XK,ZK,QK);if(!t||!n||(t.fillStyle=n,t.fillStyle=e,typeof t.fillStyle!=`string`)||(t.fillRect(0,0,1,1),[YK,XK,ZK,QK]=t.getImageData(0,0,1,1).data,QK!==255))throw Error(`css.toColor: Unsupported css format`);return{rgba:eq.toRgba(YK,XK,ZK,QK),css:e}}e.toColor=r})(nq||={});var rq;(e=>{function t(e){return n(e>>16&255,e>>8&255,e&255)}e.relativeLuminance=t;function n(e,t,n){let r=e/255,i=t/255,a=n/255,o=r<=.03928?r/12.92:((r+.055)/1.055)**2.4,s=i<=.03928?i/12.92:((i+.055)/1.055)**2.4,c=a<=.03928?a/12.92:((a+.055)/1.055)**2.4;return o*.2126+s*.7152+c*.0722}e.relativeLuminance2=n})(rq||={});var iq;(e=>{function t(e,t){if(QK=(t&255)/255,QK===1)return t;let n=t>>24&255,r=t>>16&255,i=t>>8&255,a=e>>24&255,o=e>>16&255,s=e>>8&255;return YK=a+Math.round((n-a)*QK),XK=o+Math.round((r-o)*QK),ZK=s+Math.round((i-s)*QK),eq.toRgba(YK,XK,ZK)}e.blend=t;function n(e,t,n){let a=rq.relativeLuminance(e>>8),o=rq.relativeLuminance(t>>8);if(oq(a,o)<n){if(o<a){let o=r(e,t,n),s=oq(a,rq.relativeLuminance(o>>8));if(s<n){let r=i(e,t,n);return s>oq(a,rq.relativeLuminance(r>>8))?o:r}return o}let s=i(e,t,n),c=oq(a,rq.relativeLuminance(s>>8));if(c<n){let i=r(e,t,n);return c>oq(a,rq.relativeLuminance(i>>8))?s:i}return s}}e.ensureContrastRatio=n;function r(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,l=oq(rq.relativeLuminance2(o,s,c),rq.relativeLuminance2(r,i,a));for(;l<n&&(o>0||s>0||c>0);)o-=Math.max(0,Math.ceil(o*.1)),s-=Math.max(0,Math.ceil(s*.1)),c-=Math.max(0,Math.ceil(c*.1)),l=oq(rq.relativeLuminance2(o,s,c),rq.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.reduceLuminance=r;function i(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,l=oq(rq.relativeLuminance2(o,s,c),rq.relativeLuminance2(r,i,a));for(;l<n&&(o<255||s<255||c<255);)o=Math.min(255,o+Math.ceil((255-o)*.1)),s=Math.min(255,s+Math.ceil((255-s)*.1)),c=Math.min(255,c+Math.ceil((255-c)*.1)),l=oq(rq.relativeLuminance2(o,s,c),rq.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.increaseLuminance=i;function a(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]}e.toChannels=a})(iq||={});function aq(e){let t=e.toString(16);return t.length<2?`0`+t:t}function oq(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var sq=class extends hU{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()]}},cq=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new _U}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,o=0,s=t.getFg(0),c=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!==s||this._workCell.bg!==c){if(e-i>1){let e=this._getJoinedRanges(r,o,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}i=e,o=a,s=this._workCell.fg,c=this._workCell.bg}a+=this._workCell.getChars().length||mU.length}if(this._bufferService.cols-i>1){let e=this._getJoinedRanges(r,o,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}return n}_getJoinedRanges(e,t,n,r,i){let a=e.substring(t,n),o=[];try{o=this._characterJoiners[0].handler(a)}catch(e){console.error(e)}for(let e=1;e<this._characterJoiners.length;e++)try{let t=this._characterJoiners[e].handler(a);for(let e=0;e<t.length;e++)cq._mergeRanges(o,t[e])}catch(e){console.error(e)}return this._stringRangesToCellRanges(o,r,i),o}_stringRangesToCellRanges(e,t,n){let r=0,i=!1,a=0,o=e[r];if(o){for(let s=n;s<this._bufferService.cols;s++){let n=t.getWidth(s),c=t.getString(s).length||mU.length;if(n!==0){if(!i&&o[0]<=a&&(o[0]=s,i=!0),o[1]<=a){if(o[1]=s,o=e[++r],!o)break;o[0]<=a?(o[0]=s,i=!0):i=!1}a+=c}}o&&(o[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);continue}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};cq=XH([ZH(0,wU)],cq);function lq(e){return 57508<=e&&e<=57558}function uq(e){return 9472<=e&&e<=9631}function dq(e){return lq(e)||uq(e)}function fq(){return{css:{canvas:pq(),cell:pq()},device:{canvas:pq(),cell:pq(),char:{width:0,height:0,left:0,top:0}}}}function pq(){return{width:0,height:0}}var mq=class{constructor(e,t,n,r,i,a,o){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=r,this._coreService=i,this._decorationService=a,this._themeService=o,this._workCell=new _U,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,r,i,a,o,s,c,l,u){let d=[],f=this._characterJoinerService.getJoinedCharacters(t),p=this._themeService.colors,m=e.getNoBgTrimmedLength();n&&m<a+1&&(m=a+1);let h,g=0,_=``,v=0,y=0,b=0,x=0,S=!1,C=0,w=!1,T=0,E=0,D=[],O=l!==-1&&u!==-1;for(let k=0;k<m;k++){e.loadCell(k,this._workCell);let m=this._workCell.getWidth();if(m===0)continue;let A=!1,j=k>=E,M=k,N=this._workCell;if(f.length>0&&k===f[0][0]&&j){let r=f.shift(),i=this._isCellInSelection(r[0],t);for(v=r[0]+1;v<r[1];v++)j&&=i===this._isCellInSelection(v,t);j&&=!n||a<r[0]||a>=r[1],j?(A=!0,N=new sq(this._workCell,e.translateToString(!0,r[0],r[1]),r[1]-r[0]),M=r[1]-1,m=N.getWidth()):E=r[1]}let P=this._isCellInSelection(k,t),F=n&&k===a,I=O&&k>=l&&k<=u,L=!1;this._decorationService.forEachDecorationAtCell(k,t,void 0,e=>{L=!0});let R=N.getChars()||mU;if(R===` `&&(N.isUnderline()||N.isOverline())&&(R=`\xA0`),T=m*s-c.get(R,N.isBold(),N.isItalic()),!h)h=this._document.createElement(`span`);else if(g&&(P&&w||!P&&!w&&N.bg===y)&&(P&&w&&p.selectionForeground||N.fg===b)&&N.extended.ext===x&&I===S&&T===C&&!F&&!A&&!L&&j){N.isInvisible()?_+=mU:_+=R,g++;continue}else g&&(h.textContent=_),h=this._document.createElement(`span`),g=0,_=``;if(y=N.bg,b=N.fg,x=N.extended.ext,S=I,C=T,w=P,A&&a>=k&&a<=M&&(a=k),!this._coreService.isCursorHidden&&F&&this._coreService.isCursorInitialized){if(D.push(`xterm-cursor`),this._coreBrowserService.isFocused)o&&D.push(`xterm-cursor-blink`),D.push(r===`bar`?`xterm-cursor-bar`:r===`underline`?`xterm-cursor-underline`:`xterm-cursor-block`);else if(i)switch(i){case`outline`:D.push(`xterm-cursor-outline`);break;case`block`:D.push(`xterm-cursor-block`);break;case`bar`:D.push(`xterm-cursor-bar`);break;case`underline`:D.push(`xterm-cursor-underline`)}}if(N.isBold()&&D.push(`xterm-bold`),N.isItalic()&&D.push(`xterm-italic`),N.isDim()&&D.push(`xterm-dim`),_=N.isInvisible()?mU:N.getChars()||mU,N.isUnderline()&&(D.push(`xterm-underline-${N.extended.underlineStyle}`),_===` `&&(_=`\xA0`),!N.isUnderlineColorDefault())){if(N.isUnderlineColorRGB())h.style.textDecorationColor=`rgb(${hU.toColorRGB(N.getUnderlineColor()).join(`,`)})`;else{let e=N.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&N.isBold()&&e<8&&(e+=8),h.style.textDecorationColor=p.ansi[e].css}}N.isOverline()&&(D.push(`xterm-overline`),_===` `&&(_=`\xA0`)),N.isStrikethrough()&&D.push(`xterm-strikethrough`),I&&(h.style.textDecoration=`underline`);let ee=N.getFgColor(),z=N.getFgColorMode(),te=N.getBgColor(),ne=N.getBgColorMode(),B=!!N.isInverse();if(B){let e=ee;ee=te,te=e;let t=z;z=ne,ne=t}let V,re,H=!1;this._decorationService.forEachDecorationAtCell(k,t,void 0,e=>{e.options.layer!==`top`&&H||(e.backgroundColorRGB&&(ne=50331648,te=e.backgroundColorRGB.rgba>>8&16777215,V=e.backgroundColorRGB),e.foregroundColorRGB&&(z=50331648,ee=e.foregroundColorRGB.rgba>>8&16777215,re=e.foregroundColorRGB),H=e.options.layer===`top`)}),!H&&P&&(V=this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque,te=V.rgba>>8&16777215,ne=50331648,H=!0,p.selectionForeground&&(z=50331648,ee=p.selectionForeground.rgba>>8&16777215,re=p.selectionForeground)),H&&D.push(`xterm-decoration-top`);let ie;switch(ne){case 16777216:case 33554432:ie=p.ansi[te],D.push(`xterm-bg-${te}`);break;case 50331648:ie=eq.toColor(te>>16,te>>8&255,te&255),this._addStyle(h,`background-color:#${hq((te>>>0).toString(16),`0`,6)}`);break;default:B?(ie=p.foreground,D.push(`xterm-bg-257`)):ie=p.background}switch(V||N.isDim()&&(V=tq.multiplyOpacity(ie,.5)),z){case 16777216:case 33554432:N.isBold()&&ee<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ee+=8),this._applyMinimumContrast(h,ie,p.ansi[ee],N,V,void 0)||D.push(`xterm-fg-${ee}`);break;case 50331648:let e=eq.toColor(ee>>16&255,ee>>8&255,ee&255);this._applyMinimumContrast(h,ie,e,N,V,re)||this._addStyle(h,`color:#${hq(ee.toString(16),`0`,6)}`);break;default:this._applyMinimumContrast(h,ie,p.foreground,N,V,re)||B&&D.push(`xterm-fg-257`)}D.length&&=(h.className=D.join(` `),0),!F&&!A&&!L&&j?g++:h.textContent=_,T!==this.defaultSpacing&&(h.style.letterSpacing=`${T}px`),d.push(h),k=M}return h&&g&&(h.textContent=_),d}_applyMinimumContrast(e,t,n,r,i,a){if(this._optionsService.rawOptions.minimumContrastRatio===1||dq(r.getCode()))return!1;let o=this._getContrastCache(r),s;if(!i&&!a&&(s=o.getColor(t.rgba,n.rgba)),s===void 0){let e=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);s=tq.ensureContrastRatio(i||t,a||n,e),o.setColor((i||t).rgba,(a||n).rgba,s??null)}return s?(this._addStyle(e,`color:${s.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute(`style`,`${e.getAttribute(`style`)||``}${t};`)}_isCellInSelection(e,t){let n=this._selectionStart,r=this._selectionEnd;return!n||!r?!1:this._columnSelectMode?n[0]<=r[0]?e>=n[0]&&t>=n[1]&&e<r[0]&&t<=r[1]:e<n[0]&&t>=n[1]&&e>=r[0]&&t<=r[1]:t>n[1]&&t<r[1]||n[1]===r[1]&&t===n[1]&&e>=n[0]&&e<r[0]||n[1]<r[1]&&t===r[1]&&e<r[0]||n[1]<r[1]&&t===n[1]&&e>=n[0]}};mq=XH([ZH(1,VU),ZH(2,AU),ZH(3,LU),ZH(4,EU),ZH(5,NU),ZH(6,HU)],mq);function hq(e,t,n){for(;e.length<n;)e=t+e;return e}var gq=class{constructor(e,t){this._flat=new Float32Array(256),this._font=``,this._fontSize=0,this._weight=`normal`,this._weightBold=`bold`,this._measureElements=[],this._container=e.createElement(`div`),this._container.classList.add(`xterm-width-cache-measure-container`),this._container.setAttribute(`aria-hidden`,`true`),this._container.style.whiteSpace=`pre`,this._container.style.fontKerning=`none`;let n=e.createElement(`span`);n.classList.add(`xterm-char-measure-element`);let r=e.createElement(`span`);r.classList.add(`xterm-char-measure-element`),r.style.fontWeight=`bold`;let i=e.createElement(`span`);i.classList.add(`xterm-char-measure-element`),i.style.fontStyle=`italic`;let a=e.createElement(`span`);a.classList.add(`xterm-char-measure-element`),a.style.fontWeight=`bold`,a.style.fontStyle=`italic`,this._measureElements=[n,r,i,a],this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(i),this._container.appendChild(a),t.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,n,r){e===this._font&&t===this._fontSize&&n===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,t,n){let r=0;if(!t&&!n&&e.length===1&&(r=e.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];let t=this._measure(e,0);return t>0&&(this._flat[r]=t),t}let i=e;t&&(i+=`B`),n&&(i+=`I`);let a=this._holey.get(i);if(a===void 0){let r=0;t&&(r|=1),n&&(r|=2),a=this._measure(e,r),a>0&&this._holey.set(i,a)}return a}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}},_q=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,n,r=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1]){this.clear();return}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);if(s>=e.rows||c<0){this.clear();return}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):!1}};function vq(){return new _q}var yq=`xterm-dom-renderer-owner-`,bq=`xterm-rows`,xq=`xterm-fg-`,Sq=`xterm-bg-`,Cq=`xterm-focus`,wq=`xterm-selection`,Tq=1,Eq=class extends pW{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=r,this._viewportElement=i,this._helperContainer=a,this._linkifier2=o,this._charSizeService=c,this._optionsService=l,this._bufferService=u,this._coreService=d,this._coreBrowserService=f,this._themeService=p,this._terminalClass=Tq++,this._rowElements=[],this._selectionRenderModel=vq(),this.onRequestRedraw=this._register(new Q).event,this._rowContainer=this._document.createElement(`div`),this._rowContainer.classList.add(bq),this._rowContainer.style.lineHeight=`normal`,this._rowContainer.setAttribute(`aria-hidden`,`true`),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement(`div`),this._selectionContainer.classList.add(wq),this._selectionContainer.setAttribute(`aria-hidden`,`true`),this.dimensions=fq(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(e=>this._injectCss(e))),this._injectCss(this._themeService.colors),this._rowFactory=s.createInstance(mq,document),this._element.classList.add(yq+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(e=>this._handleLinkHover(e))),this._register(this._linkifier2.onHideLinkUnderline(e=>this._handleLinkLeave(e))),this._register(uW(()=>{this._element.classList.remove(yq+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new gq(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let e of this._rowElements)e.style.width=`${this.dimensions.css.canvas.width}px`,e.style.height=`${this.dimensions.css.cell.height}px`,e.style.lineHeight=`${this.dimensions.css.cell.height}px`,e.style.overflow=`hidden`;this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement(`style`),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${bq} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement(`style`),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${bq} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${bq} .xterm-dim { color: ${tq.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let n=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,i=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${i} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${bq}.${Cq} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${bq}.${Cq} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${bq}.${Cq} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${bq} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${bq} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${bq} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${bq} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${bq} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${wq} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${wq} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${wq} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[n,r]of e.ansi.entries())t+=`${this._terminalSelector} .${xq}${n} { color: ${r.css}; }${this._terminalSelector} .${xq}${n}.xterm-dim { color: ${tq.multiplyOpacity(r,.5).css}; }${this._terminalSelector} .${Sq}${n} { background-color: ${r.css}; }`;t+=`${this._terminalSelector} .${xq}257 { color: ${tq.opaque(e.background).css}; }${this._terminalSelector} .${xq}257.xterm-dim { color: ${tq.multiplyOpacity(tq.opaque(e.background),.5).css}; }${this._terminalSelector} .${Sq}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get(`W`,!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let e=this._rowElements.length;e<=t;e++){let e=this._document.createElement(`div`);this._rowContainer.appendChild(e),this._rowElements.push(e)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(Cq),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Cq),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,n),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,n),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,i=this._selectionRenderModel.viewportEndRow,a=this._selectionRenderModel.viewportCappedStartRow,o=this._selectionRenderModel.viewportCappedEndRow,s=this._document.createDocumentFragment();if(n){let n=e[0]>t[0];s.appendChild(this._createSelectionElement(a,n?t[0]:e[0],n?e[0]:t[0],o-a+1))}else{let n=r===a?e[0]:0,c=a===i?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(a,n,c));let l=o-a-1;if(s.appendChild(this._createSelectionElement(a+1,0,this._bufferService.cols,l)),a!==o){let e=i===o?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(o,0,e))}}this._selectionContainer.appendChild(s)}_createSelectionElement(e,t,n,r=1){let i=this._document.createElement(`div`),a=t*this.dimensions.css.cell.width,o=this.dimensions.css.cell.width*(n-t);return a+o>this.dimensions.css.canvas.width&&(o=this.dimensions.css.canvas.width-a),i.style.height=`${r*this.dimensions.css.cell.height}px`,i.style.top=`${e*this.dimensions.css.cell.height}px`,i.style.left=`${a}px`,i.style.width=`${o}px`,i}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let n=this._bufferService.buffer,r=n.ybase+n.y,i=Math.min(n.x,this._bufferService.cols-1),a=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,o=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,s=this._optionsService.rawOptions.cursorInactiveStyle;for(let c=e;c<=t;c++){let e=c+n.ydisp,t=this._rowElements[c],l=n.lines.get(e);if(!t||!l)break;t.replaceChildren(...this._rowFactory.createRow(l,e,e===r,o,s,i,a,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${yq}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,n,r,i,a){n<0&&(e=0),r<0&&(t=0);let o=this._bufferService.rows-1;n=Math.max(Math.min(n,o),0),r=Math.max(Math.min(r,o),0),i=Math.min(i,this._bufferService.cols);let s=this._bufferService.buffer,c=s.ybase+s.y,l=Math.min(s.x,i-1),u=this._optionsService.rawOptions.cursorBlink,d=this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let o=n;o<=r;++o){let p=o+s.ydisp,m=this._rowElements[o],h=s.lines.get(p);if(!m||!h)break;m.replaceChildren(...this._rowFactory.createRow(h,p,p===c,d,f,l,u,this.dimensions.css.cell.width,this._widthCache,a?o===n?e:0:-1,a?(o===r?t:i)-1:-1))}}};Eq=XH([ZH(7,OU),ZH(8,IU),ZH(9,AU),ZH(10,wU),ZH(11,EU),ZH(12,LU),ZH(13,HU)],Eq);var Dq=class extends pW{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new Q),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new Aq(this._optionsService))}catch{this._measureStrategy=this._register(new kq(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange([`fontFamily`,`fontSize`],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};Dq=XH([ZH(2,AU)],Dq);var Oq=class extends pW{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},kq=class extends Oq{constructor(e,t,n){super(),this._document=e,this._parentElement=t,this._optionsService=n,this._measureElement=this._document.createElement(`span`),this._measureElement.classList.add(`xterm-char-measure-element`),this._measureElement.textContent=`W`.repeat(32),this._measureElement.setAttribute(`aria-hidden`,`true`),this._measureElement.style.whiteSpace=`pre`,this._measureElement.style.fontKerning=`none`,this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},Aq=class extends Oq{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext(`2d`);let t=this._ctx.measureText(`W`);if(!(`width`in t&&`fontBoundingBoxAscent`in t&&`fontBoundingBoxDescent`in t))throw Error(`Required font metrics not supported`)}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText(`W`);return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},jq=class extends pW{constructor(e,t,n){super(),this._textarea=e,this._window=t,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new Mq(this._window)),this._onDprChange=this._register(new Q),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new Q),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(e=>this._screenDprMonitor.setWindow(e))),this._register(xW.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(YG(this._textarea,`focus`,()=>this._isFocused=!0)),this._register(YG(this._textarea,`blur`,()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},Mq=class extends pW{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new mW),this._onDprChange=this._register(new Q),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(uW(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=YG(this._parentWindow,`resize`,()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},Nq=class extends pW{constructor(){super(),this.linkProviders=[],this._register(uW(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function Pq(e,t,n){let r=n.getBoundingClientRect(),i=e.getComputedStyle(n),a=parseInt(i.getPropertyValue(`padding-left`)),o=parseInt(i.getPropertyValue(`padding-top`));return[t.clientX-r.left-a,t.clientY-r.top-o]}function Fq(e,t,n,r,i,a,o,s,c){if(!a)return;let l=Pq(e,t,n);if(l)return l[0]=Math.ceil((l[0]+(c?o/2:0))/o),l[1]=Math.ceil(l[1]/s),l[0]=Math.min(Math.max(l[0],1),r+ +!!c),l[1]=Math.min(Math.max(l[1],1),i),l}var Iq=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,i){return Fq(window,e,t,n,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(e,t){let n=Pq(window,e,t);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};Iq=XH([ZH(0,zU),ZH(1,IU)],Iq);var Lq=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&=(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()),this._animationFrame}refresh(e,t,n){this._rowCount=n,e=e===void 0?0:e,t=t===void 0?this._rowCount-1:t,this._rowStart=this._rowStart===void 0?e:Math.min(this._rowStart,e),this._rowEnd=this._rowEnd===void 0?t:Math.max(this._rowEnd,t),!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},Rq={};YH(Rq,{getSafariVersion:()=>Gq,isChromeOS:()=>Zq,isFirefox:()=>Hq,isIpad:()=>qq,isIphone:()=>Jq,isLegacyEdge:()=>Uq,isLinux:()=>Xq,isMac:()=>Kq,isNode:()=>zq,isSafari:()=>Wq,isWindows:()=>Yq});var zq=typeof process<`u`&&`title`in process,Bq=zq?`node`:navigator.userAgent,Vq=zq?`node`:navigator.platform,Hq=Bq.includes(`Firefox`),Uq=Bq.includes(`Edge`),Wq=/^((?!chrome|android).)*safari/i.test(Bq);function Gq(){if(!Wq)return 0;let e=Bq.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var Kq=[`Macintosh`,`MacIntel`,`MacPPC`,`Mac68K`].includes(Vq),qq=Vq===`iPad`,Jq=Vq===`iPhone`,Yq=[`Windows`,`Win16`,`Win32`,`WinCE`].includes(Vq),Xq=Vq.indexOf(`Linux`)>=0,Zq=/\bCrOS\b/.test(Bq),Qq=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&=(this._cancelCallback(this._idleCallback),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=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),n=Math.max(t,n),i=e.timeRemaining(),n*1.5>i){r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),this._start();return}r=i}this.clear()}},$q=class extends Qq{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},eJ=class extends Qq{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},tJ=!zq&&`requestIdleCallback`in window?eJ:$q,nJ=class{constructor(){this._queue=new tJ}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},rJ=class extends pW{constructor(e,t,n,r,i,a,o,s,c){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=r,this._coreService=i,this._coreBrowserService=s,this._renderer=this._register(new mW),this._pausedResizeTask=new nJ,this._observerDisposable=this._register(new mW),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new Q),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new Q),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new Q),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new Q),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new Lq((e,t)=>this._renderRows(e,t),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new iJ(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(uW(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(o.onResize(()=>this._fullRefresh())),this._register(o.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(a.onDecorationRegistered(()=>this._fullRefresh())),this._register(a.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange([`customGlyphs`,`drawBoldTextInBrightColors`,`letterSpacing`,`lineHeight`,`fontFamily`,`fontSize`,`fontWeight`,`fontWeightBold`,`minimumContrastRatio`,`rescaleOverlappingGlyphs`],()=>{this.clear(),this.handleResize(o.cols,o.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange([`cursorBlink`,`cursorStyle`],()=>this.refreshRows(o.buffer.y,o.buffer.y,!0))),this._register(c.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(e=>this._registerIntersectionObserver(e,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if(`IntersectionObserver`in e){let n=new e.IntersectionObserver(e=>this._handleIntersectionChange(e[e.length-1]),{threshold:0});n.observe(t),this._observerDisposable.value=uW(()=>n.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let r=this._syncOutputHandler.flush();r&&(e=Math.min(e,r.start),t=Math.max(t,r.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&=(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(e=>this.refreshRows(e.start,e.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,t)):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,n){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,this._renderer.value?.handleSelectionChanged(e,t,n)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};rJ=XH([ZH(2,AU),ZH(3,IU),ZH(4,EU),ZH(5,NU),ZH(6,wU),ZH(7,LU),ZH(8,HU)],rJ);var iJ=class{constructor(e,t,n){this._coreBrowserService=e,this._coreService=t,this._onTimeout=n,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function aJ(e,t,n,r){let i=n.buffer.x,a=n.buffer.y;if(!n.buffer.hasScrollback)return cJ(i,a,e,t,n,r)+lJ(a,t,n,r)+uJ(i,a,e,t,n,r);let o;if(a===t)return o=i>e?`D`:`C`,_J(Math.abs(i-e),gJ(o,r));o=a>t?`D`:`C`;let s=Math.abs(a-t);return _J(sJ(a>t?e:i,n)+(s-1)*n.cols+1+oJ(a>t?i:e,n),gJ(o,r))}function oJ(e,t){return e-1}function sJ(e,t){return t.cols-e}function cJ(e,t,n,r,i,a){return lJ(t,r,i,a).length===0?``:_J(hJ(e,t,e,t-fJ(t,i),!1,i).length,gJ(`D`,a))}function lJ(e,t,n,r){let i=e-fJ(e,n),a=t-fJ(t,n);return _J(Math.abs(i-a)-dJ(e,t,n),gJ(mJ(e,t),r))}function uJ(e,t,n,r,i,a){let o;o=lJ(t,r,i,a).length>0?r-fJ(r,i):t;let s=r,c=pJ(e,t,n,r,i,a);return _J(hJ(e,o,n,s,c===`C`,i).length,gJ(c,a))}function dJ(e,t,n){let r=0,i=e-fJ(e,n),a=t-fJ(t,n);for(let o=0;o<Math.abs(i-a);o++){let a=mJ(e,t)===`A`?-1:1;n.buffer.lines.get(i+a*o)?.isWrapped&&r++}return r}function fJ(e,t){let n=0,r=t.buffer.lines.get(e),i=r?.isWrapped;for(;i&&e>=0&&e<t.rows;)n++,r=t.buffer.lines.get(--e),i=r?.isWrapped;return n}function pJ(e,t,n,r,i,a){let o;return o=lJ(n,r,i,a).length>0?r-fJ(r,i):t,e<n&&o<=r||e>=n&&o<r?`C`:`D`}function mJ(e,t){return e>t?`A`:`B`}function hJ(e,t,n,r,i,a){let o=e,s=t,c=``;for(;(o!==n||s!==r)&&s>=0&&s<a.buffer.lines.length;)o+=i?1:-1,i&&o>a.cols-1?(c+=a.buffer.translateBufferLineToString(s,!1,e,o),o=0,e=0,s++):!i&&o<0&&(c+=a.buffer.translateBufferLineToString(s,!1,0,e+1),o=a.cols-1,e=o,s--);return c+a.buffer.translateBufferLineToString(s,!1,e,o)}function gJ(e,t){let n=t?`O`:`[`;return $.ESC+n+e}function _J(e,t){e=Math.floor(e);let n=``;for(let r=0;r<e;r++)n+=t;return n}var vJ=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:!this.selectionEnd||!this.selectionStart?this.selectionStart:this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function yJ(e,t){if(e.start.y>e.end.y)throw Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var bJ=50,xJ=15,SJ=50,CJ=500,wJ=RegExp(`\xA0`,`g`),TJ=class extends pW{constructor(e,t,n,r,i,a,o,s,c){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=i,this._mouseService=a,this._optionsService=o,this._renderService=s,this._coreBrowserService=c,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new _U,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new Q),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new Q),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new Q),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new Q),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=e=>this._handleMouseMove(e),this._mouseUpListener=e=>this._handleMouseUp(e),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(e=>this._handleTrim(e)),this._register(this._bufferService.buffers.onBufferActivate(e=>this._handleBufferActivate(e))),this.enable(),this._model=new vJ(this._bufferService),this._activeSelectionMode=0,this._register(uW(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(e=>{e.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return``;let n=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return``;let i=e[0]<t[0]?e[0]:t[0],a=e[0]<t[0]?t[0]:e[0];for(let o=e[1];o<=t[1];o++){let e=n.translateBufferLineToString(o,!0,i,a);r.push(e)}}else{let i=e[1]===t[1]?t[0]:void 0;r.push(n.translateBufferLineToString(e[1],!0,e[0],i));for(let i=e[1]+1;i<=t[1]-1;i++){let e=n.lines.get(i),t=n.translateBufferLineToString(i,!0);e?.isWrapped?r[r.length-1]+=t:r.push(t)}if(e[1]!==t[1]){let e=n.lines.get(t[1]),i=n.translateBufferLineToString(t[1],!0,0,t[0]);e&&e.isWrapped?r[r.length-1]+=i:r.push(i)}}return r.map(e=>e.replace(wJ,` `)).join(Yq?`\r
|
|
278
|
+
`:`
|
|
279
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh()),Xq&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r||!t?!1:this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1:this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=yJ(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=Pq(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-bJ),bJ),t/=bJ,t/Math.abs(t)+Math.round(t*(xJ-1)))}shouldForceSelection(e){return Kq?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener(`mouseup`,this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),SJ)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener(`mouseup`,this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(Kq&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let e=n.lines.get(this._model.selectionEnd[1]);e&&e.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[1]!==this._model.selectionEnd[1])&&this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<CJ&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let t=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(t&&t[0]!==void 0&&t[1]!==void 0){let e=aJ(t[0]-1,t[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(e,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,n=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!n){this._oldHasSelection&&this._fireOnSelectionChange(e,t,n);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,n)}_fireOnSelectionChange(e,t,n){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(e=>this._handleTrim(e))}_convertViewportColToCharacterIndex(e,t){let n=t;for(let r=0;t>=r;r++){let i=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:i>1&&t!==r&&(n+=i-1)}return n}setSelection(e,t,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,n=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let i=this._bufferService.buffer,a=i.lines.get(e[1]);if(!a)return;let o=i.translateBufferLineToString(e[1],!1),s=this._convertViewportColToCharacterIndex(a,e[0]),c=s,l=e[0]-s,u=0,d=0,f=0,p=0;if(o.charAt(s)===` `){for(;s>0&&o.charAt(s-1)===` `;)s--;for(;c<o.length&&o.charAt(c+1)===` `;)c++}else{let t=e[0],n=e[0];a.getWidth(t)===0&&(u++,t--),a.getWidth(n)===2&&(d++,n++);let r=a.getString(n).length;for(r>1&&(p+=r-1,c+=r-1);t>0&&s>0&&!this._isCharWordSeparator(a.loadCell(t-1,this._workCell));){a.loadCell(t-1,this._workCell);let e=this._workCell.getChars().length;this._workCell.getWidth()===0?(u++,t--):e>1&&(f+=e-1,s-=e-1),s--,t--}for(;n<a.length&&c+1<o.length&&!this._isCharWordSeparator(a.loadCell(n+1,this._workCell));){a.loadCell(n+1,this._workCell);let e=this._workCell.getChars().length;this._workCell.getWidth()===2?(d++,n++):e>1&&(p+=e-1,c+=e-1),c++,n++}}c++;let m=s+l-u+f,h=Math.min(this._bufferService.cols,c-s+u+d-f-p);if(t||o.slice(s,c).trim()!==``){if(n&&m===0&&a.getCodePoint(0)!==32){let t=i.lines.get(e[1]-1);if(t&&a.isWrapped&&t.getCodePoint(this._bufferService.cols-1)!==32){let t=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(t){let e=this._bufferService.cols-t.start;m-=e,h+=e}}}if(r&&m+h===this._bufferService.cols&&a.getCodePoint(this._bufferService.cols-1)!==32){let t=i.lines.get(e[1]+1);if(t?.isWrapped&&t.getCodePoint(0)!==32){let t=this._getWordAt([0,e[1]+1],!1,!1,!0);t&&(h+=t.length)}}return{start:m,length:h}}}_selectWordAt(e,t){let n=this._getWordAt(e,t);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let n=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,n]}}_isCharWordSeparator(e){return e.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=yJ(n,this._bufferService.cols)}};TJ=XH([ZH(3,wU),ZH(4,EU),ZH(5,RU),ZH(6,AU),ZH(7,zU),ZH(8,LU)],TJ);var EJ=class{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={}}},DJ=class{constructor(){this._color=new EJ,this._css=new EJ}setCss(e,t,n){this._css.set(e,t,n)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,n){this._color.set(e,t,n)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},OJ=Object.freeze((()=>{let e=[nq.toColor(`#2e3436`),nq.toColor(`#cc0000`),nq.toColor(`#4e9a06`),nq.toColor(`#c4a000`),nq.toColor(`#3465a4`),nq.toColor(`#75507b`),nq.toColor(`#06989a`),nq.toColor(`#d3d7cf`),nq.toColor(`#555753`),nq.toColor(`#ef2929`),nq.toColor(`#8ae234`),nq.toColor(`#fce94f`),nq.toColor(`#729fcf`),nq.toColor(`#ad7fa8`),nq.toColor(`#34e2e2`),nq.toColor(`#eeeeec`)],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],i=t[n/6%6|0],a=t[n%6];e.push({css:eq.toCss(r,i,a),rgba:eq.toRgba(r,i,a)})}for(let t=0;t<24;t++){let n=8+t*10;e.push({css:eq.toCss(n,n,n),rgba:eq.toRgba(n,n,n)})}return e})()),kJ=nq.toColor(`#ffffff`),AJ=nq.toColor(`#000000`),jJ=nq.toColor(`#ffffff`),MJ=AJ,NJ={css:`rgba(255, 255, 255, 0.3)`,rgba:4294967117},PJ=kJ,FJ=class extends pW{constructor(e){super(),this._optionsService=e,this._contrastCache=new DJ,this._halfContrastCache=new DJ,this._onChangeColors=this._register(new Q),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:kJ,background:AJ,cursor:jJ,cursorAccent:MJ,selectionForeground:void 0,selectionBackgroundTransparent:NJ,selectionBackgroundOpaque:tq.blend(AJ,NJ),selectionInactiveBackgroundTransparent:NJ,selectionInactiveBackgroundOpaque:tq.blend(AJ,NJ),scrollbarSliderBackground:tq.opacity(kJ,.2),scrollbarSliderHoverBackground:tq.opacity(kJ,.4),scrollbarSliderActiveBackground:tq.opacity(kJ,.5),overviewRulerBorder:kJ,ansi:OJ.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange(`minimumContrastRatio`,()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange(`theme`,()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=IJ(e.foreground,kJ),t.background=IJ(e.background,AJ),t.cursor=tq.blend(t.background,IJ(e.cursor,jJ)),t.cursorAccent=tq.blend(t.background,IJ(e.cursorAccent,MJ)),t.selectionBackgroundTransparent=IJ(e.selectionBackground,NJ),t.selectionBackgroundOpaque=tq.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=IJ(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=tq.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?IJ(e.selectionForeground,$K):void 0,t.selectionForeground===$K&&(t.selectionForeground=void 0),tq.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=tq.opacity(t.selectionBackgroundTransparent,.3)),tq.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=tq.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=IJ(e.scrollbarSliderBackground,tq.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=IJ(e.scrollbarSliderHoverBackground,tq.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=IJ(e.scrollbarSliderActiveBackground,tq.opacity(t.foreground,.5)),t.overviewRulerBorder=IJ(e.overviewRulerBorder,PJ),t.ansi=OJ.slice(),t.ansi[0]=IJ(e.black,OJ[0]),t.ansi[1]=IJ(e.red,OJ[1]),t.ansi[2]=IJ(e.green,OJ[2]),t.ansi[3]=IJ(e.yellow,OJ[3]),t.ansi[4]=IJ(e.blue,OJ[4]),t.ansi[5]=IJ(e.magenta,OJ[5]),t.ansi[6]=IJ(e.cyan,OJ[6]),t.ansi[7]=IJ(e.white,OJ[7]),t.ansi[8]=IJ(e.brightBlack,OJ[8]),t.ansi[9]=IJ(e.brightRed,OJ[9]),t.ansi[10]=IJ(e.brightGreen,OJ[10]),t.ansi[11]=IJ(e.brightYellow,OJ[11]),t.ansi[12]=IJ(e.brightBlue,OJ[12]),t.ansi[13]=IJ(e.brightMagenta,OJ[13]),t.ansi[14]=IJ(e.brightCyan,OJ[14]),t.ansi[15]=IJ(e.brightWhite,OJ[15]),e.extendedAnsi){let n=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let r=0;r<n;r++)t.ansi[r+16]=IJ(e.extendedAnsi[r],OJ[r+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let e=0;e<this._restoreColors.ansi.length;++e)this._colors.ansi[e]=this._restoreColors.ansi[e];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};FJ=XH([ZH(0,AU)],FJ);function IJ(e,t){if(e!==void 0)try{return nq.toColor(e)}catch{}return t}var LJ=class{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){let n=this._entries.get(e);return this._entries.set(e,t),n}forEach(e){for(let[t,n]of this._entries.entries())e(t,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},RJ=class{constructor(){this._services=new LJ,this._services.set(OU,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=xU(e).sort((e,t)=>e.index-t.index),r=[];for(let t of n){let n=this._services.get(t.id);if(!n)throw Error(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id._id}.`);r.push(n)}let i=n.length>0?n[0].index:t.length;if(t.length!==i)throw Error(`[createInstance] First service dependency of ${e.name} at position ${i+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}},zJ={trace:0,debug:1,info:2,warn:3,error:4,off:5},BJ=`xterm.js: `,VJ=class extends pW{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange(`logLevel`,()=>this._updateLogLevel())),HJ=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=zJ[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?``:BJ)+t,...n)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};VJ=XH([ZH(0,AU)],VJ);var HJ,UJ=class extends pW{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new Q),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new Q),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new Q),this.onTrim=this.onTrimEmitter.event,this._array=Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=Array(e);for(let n=0;n<Math.min(e,this.length);n++)t[n]=this._array[this._getCyclicIndex(n)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw Error(`Can only recycle when the buffer is full`);return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...n){if(t){for(let n=e;n<this._length-t;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let t=this._length-1;t>=e;t--)this._array[this._getCyclicIndex(t+n.length)]=this._array[this._getCyclicIndex(t)];for(let t=0;t<n.length;t++)this._array[this._getCyclicIndex(e+t)]=n[t];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let e=this._length+n.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,n){if(!(t<=0)){if(e<0||e>=this._length)throw Error(`start argument out of range`);if(e+n<0)throw Error(`Cannot shift elements in list beyond index 0`);if(n>0){for(let r=t-1;r>=0;r--)this.set(e+r+n,this.get(e+r));let r=e+t+n-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<t;r++)this.set(e+r+n,this.get(e+r))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},WJ=3,GJ=Object.freeze(new hU),KJ=0,qJ=2,JJ=class e{constructor(e,t,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(e*WJ);let r=t||_U.fromCharData([0,pU,1,0]);for(let t=0;t<e;++t)this.setCell(t,r);this.length=e}get(e){let t=this._data[e*WJ+0],n=t&2097151;return[this._data[e*WJ+1],t&2097152?this._combined[e]:n?lU(n):``,t>>22,t&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):n]}set(e,t){this._data[e*WJ+1]=t[0],t[1].length>1?(this._combined[e]=t[1],this._data[e*WJ+0]=e|2097152|t[2]<<22):this._data[e*WJ+0]=t[1].charCodeAt(0)|t[2]<<22}getWidth(e){return this._data[e*WJ+0]>>22}hasWidth(e){return this._data[e*WJ+0]&12582912}getFg(e){return this._data[e*WJ+1]}getBg(e){return this._data[e*WJ+2]}hasContent(e){return this._data[e*WJ+0]&4194303}getCodePoint(e){let t=this._data[e*WJ+0];return t&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):t&2097151}isCombined(e){return this._data[e*WJ+0]&2097152}getString(e){let t=this._data[e*WJ+0];return t&2097152?this._combined[e]:t&2097151?lU(t&2097151):``}isProtected(e){return this._data[e*WJ+2]&536870912}loadCell(e,t){return KJ=e*WJ,t.content=this._data[KJ+0],t.fg=this._data[KJ+1],t.bg=this._data[KJ+2],t.content&2097152&&(t.combinedData=this._combined[e]),t.bg&268435456&&(t.extended=this._extendedAttrs[e]),t}setCell(e,t){t.content&2097152&&(this._combined[e]=t.combinedData),t.bg&268435456&&(this._extendedAttrs[e]=t.extended),this._data[e*WJ+0]=t.content,this._data[e*WJ+1]=t.fg,this._data[e*WJ+2]=t.bg}setCellFromCodepoint(e,t,n,r){r.bg&268435456&&(this._extendedAttrs[e]=r.extended),this._data[e*WJ+0]=t|n<<22,this._data[e*WJ+1]=r.fg,this._data[e*WJ+2]=r.bg}addCodepointToCell(e,t,n){let r=this._data[e*WJ+0];r&2097152?this._combined[e]+=lU(t):r&2097151?(this._combined[e]=lU(r&2097151)+lU(t),r&=-2097152,r|=2097152):r=t|1<<22,n&&(r&=-12582913,r|=n<<22),this._data[e*WJ+0]=r}insertCells(e,t,n){if(e%=this.length,e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),t<this.length-e){let r=new _U;for(let n=this.length-e-t-1;n>=0;--n)this.setCell(e+t+n,this.loadCell(e+n,r));for(let r=0;r<t;++r)this.setCell(e+r,n)}else for(let t=e;t<this.length;++t)this.setCell(t,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(e,t,n){if(e%=this.length,t<this.length-e){let r=new _U;for(let n=0;n<this.length-e-t;++n)this.setCell(e+n,this.loadCell(e+t+n,r));for(let e=this.length-t;e<this.length;++e)this.setCell(e,n)}else for(let t=e;t<this.length;++t)this.setCell(t,n);e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),this.getWidth(e)===0&&!this.hasContent(e)&&this.setCellFromCodepoint(e,0,1,n)}replaceCells(e,t,n,r=!1){if(r){for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodepoint(e-1,0,1,n),t<this.length&&this.getWidth(t-1)===2&&!this.isProtected(t)&&this.setCellFromCodepoint(t,0,1,n);e<t&&e<this.length;)this.isProtected(e)||this.setCell(e,n),e++;return}for(e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),t<this.length&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t,0,1,n);e<t&&e<this.length;)this.setCell(e++,n)}resize(e,t){if(e===this.length)return this._data.length*4*qJ<this._data.buffer.byteLength;let n=e*WJ;if(e>this.length){if(this._data.buffer.byteLength>=n*4)this._data=new Uint32Array(this._data.buffer,0,n);else{let e=new Uint32Array(n);e.set(this._data),this._data=e}for(let n=this.length;n<e;++n)this.setCell(n,t)}else{this._data=this._data.subarray(0,n);let t=Object.keys(this._combined);for(let n=0;n<t.length;n++){let r=parseInt(t[n],10);r>=e&&delete this._combined[r]}let r=Object.keys(this._extendedAttrs);for(let t=0;t<r.length;t++){let n=parseInt(r[t],10);n>=e&&delete this._extendedAttrs[n]}}return this.length=e,n*4*qJ<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*qJ<this._data.buffer.byteLength){let e=new Uint32Array(this._data.length);return e.set(this._data),this._data=e,1}return 0}fill(e,t=!1){if(t){for(let t=0;t<this.length;++t)this.isProtected(t)||this.setCell(t,e);return}this._combined={},this._extendedAttrs={};for(let t=0;t<this.length;++t)this.setCell(t,e)}copyFrom(e){this.length===e.length?this._data.set(e._data):this._data=new Uint32Array(e._data),this.length=e.length,this._combined={};for(let t in e._combined)this._combined[t]=e._combined[t];this._extendedAttrs={};for(let t in e._extendedAttrs)this._extendedAttrs[t]=e._extendedAttrs[t];this.isWrapped=e.isWrapped}clone(){let t=new e(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let e in this._combined)t._combined[e]=this._combined[e];for(let e in this._extendedAttrs)t._extendedAttrs[e]=this._extendedAttrs[e];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*WJ+0]&4194303)return e+(this._data[e*WJ+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*WJ+0]&4194303||this._data[e*WJ+2]&50331648)return e+(this._data[e*WJ+0]>>22);return 0}copyCellsFrom(e,t,n,r,i){let a=e._data;if(i)for(let i=r-1;i>=0;i--){for(let e=0;e<WJ;e++)this._data[(n+i)*WJ+e]=a[(t+i)*WJ+e];a[(t+i)*WJ+2]&268435456&&(this._extendedAttrs[n+i]=e._extendedAttrs[t+i])}else for(let i=0;i<r;i++){for(let e=0;e<WJ;e++)this._data[(n+i)*WJ+e]=a[(t+i)*WJ+e];a[(t+i)*WJ+2]&268435456&&(this._extendedAttrs[n+i]=e._extendedAttrs[t+i])}let o=Object.keys(e._combined);for(let r=0;r<o.length;r++){let i=parseInt(o[r],10);i>=t&&(this._combined[i-t+n]=e._combined[i])}}translateToString(e,t,n,r){t??=0,n??=this.length,e&&(n=Math.min(n,this.getTrimmedLength())),r&&(r.length=0);let i=``;for(;t<n;){let e=this._data[t*WJ+0],n=e&2097151,a=e&2097152?this._combined[t]:n?lU(n):mU;if(i+=a,r)for(let e=0;e<a.length;++e)r.push(t);t+=e>>22||1}return r&&r.push(t),i}};function YJ(e,t,n,r,i,a){let o=[];for(let s=0;s<e.length-1;s++){let c=s,l=e.get(++c);if(!l.isWrapped)continue;let u=[e.get(s)];for(;c<e.length&&l.isWrapped;)u.push(l),l=e.get(++c);if(!a&&r>=s&&r<c){s+=u.length-1;continue}let d=0,f=$J(u,d,t),p=1,m=0;for(;p<u.length;){let e=$J(u,p,t),r=e-m,a=n-f,o=Math.min(r,a);u[d].copyCellsFrom(u[p],m,f,o,!1),f+=o,f===n&&(d++,f=0),m+=o,m===e&&(p++,m=0),f===0&&d!==0&&u[d-1].getWidth(n-1)===2&&(u[d].copyCellsFrom(u[d-1],n-1,f++,1,!1),u[d-1].setCell(n-1,i))}u[d].replaceCells(f,n,i);let h=0;for(let e=u.length-1;e>0&&(e>d||u[e].getTrimmedLength()===0);e--)h++;h>0&&(o.push(s+u.length-h),o.push(h)),s+=u.length-1}return o}function XJ(e,t){let n=[],r=0,i=t[r],a=0;for(let o=0;o<e.length;o++)if(i===o){let n=t[++r];e.onDeleteEmitter.fire({index:o-a,amount:n}),o+=n-1,a+=n,i=t[++r]}else n.push(o);return{layout:n,countRemoved:a}}function ZJ(e,t){let n=[];for(let r=0;r<t.length;r++)n.push(e.get(t[r]));for(let t=0;t<n.length;t++)e.set(t,n[t]);e.length=t.length}function QJ(e,t,n){let r=[],i=e.map((n,r)=>$J(e,r,t)).reduce((e,t)=>e+t),a=0,o=0,s=0;for(;s<i;){if(i-s<n){r.push(i-s);break}a+=n;let c=$J(e,o,t);a>c&&(a-=c,o++);let l=e[o].getWidth(a-1)===2;l&&a--;let u=l?n-1:n;r.push(u),s+=u}return r}function $J(e,t,n){if(t===e.length-1)return e[t].getTrimmedLength();let r=!e[t].hasContent(n-1)&&e[t].getWidth(n-1)===1,i=e[t+1].getWidth(0)===2;return r&&i?n-1:n}var eY=class e{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=e._nextId++,this._onDispose=this.register(new Q),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),cW(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}};eY._nextId=1;var tY=eY,nY={},rY=nY.B;nY[0]={"`":`◆`,a:`▒`,b:`␉`,c:`␌`,d:`␍`,e:`␊`,f:`°`,g:`±`,h:``,i:`␋`,j:`┘`,k:`┐`,l:`┌`,m:`└`,n:`┼`,o:`⎺`,p:`⎻`,q:`─`,r:`⎼`,s:`⎽`,t:`├`,u:`┤`,v:`┴`,w:`┬`,x:`│`,y:`≤`,z:`≥`,"{":`π`,"|":`≠`,"}":`£`,"~":`·`},nY.A={"#":`£`},nY.B=void 0,nY[4]={"#":`£`,"@":`¾`,"[":`ij`,"\\":`½`,"]":`|`,"{":`¨`,"|":`f`,"}":`¼`,"~":`´`},nY.C=nY[5]={"[":`Ä`,"\\":`Ö`,"]":`Å`,"^":`Ü`,"`":`é`,"{":`ä`,"|":`ö`,"}":`å`,"~":`ü`},nY.R={"#":`£`,"@":`à`,"[":`°`,"\\":`ç`,"]":`§`,"{":`é`,"|":`ù`,"}":`è`,"~":`¨`},nY.Q={"@":`à`,"[":`â`,"\\":`ç`,"]":`ê`,"^":`î`,"`":`ô`,"{":`é`,"|":`ù`,"}":`è`,"~":`û`},nY.K={"@":`§`,"[":`Ä`,"\\":`Ö`,"]":`Ü`,"{":`ä`,"|":`ö`,"}":`ü`,"~":`ß`},nY.Y={"#":`£`,"@":`§`,"[":`°`,"\\":`ç`,"]":`é`,"`":`ù`,"{":`à`,"|":`ò`,"}":`è`,"~":`ì`},nY.E=nY[6]={"@":`Ä`,"[":`Æ`,"\\":`Ø`,"]":`Å`,"^":`Ü`,"`":`ä`,"{":`æ`,"|":`ø`,"}":`å`,"~":`ü`},nY.Z={"#":`£`,"@":`§`,"[":`¡`,"\\":`Ñ`,"]":`¿`,"{":`°`,"|":`ñ`,"}":`ç`},nY.H=nY[7]={"@":`É`,"[":`Ä`,"\\":`Ö`,"]":`Å`,"^":`Ü`,"`":`é`,"{":`ä`,"|":`ö`,"}":`å`,"~":`ü`},nY[`=`]={"#":`ù`,"@":`à`,"[":`é`,"\\":`ç`,"]":`ê`,"^":`î`,_:`è`,"`":`ô`,"{":`ä`,"|":`ö`,"}":`ü`,"~":`û`};var iY=4294967295,aY=class{constructor(e,t,n){this._hasScrollback=e,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=GJ.clone(),this.savedCharset=rY,this.markers=[],this._nullCell=_U.fromCharData([0,pU,1,0]),this._whitespaceCell=_U.fromCharData([0,mU,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new tJ,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new UJ(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new gU),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new gU),this._whitespaceCell}getBlankLine(e,t){return new JJ(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>iY?iY:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=GJ);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new UJ(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(GJ),r=0,i=this._getCorrectBufferLength(t);if(i>this.lines.maxLength&&(this.lines.maxLength=i),this.lines.length>0){if(this._cols<e)for(let t=0;t<this.lines.length;t++)r+=+this.lines.get(t).resize(e,n);let a=0;if(this._rows<t)for(let r=this._rows;r<t;r++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new JJ(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+a+1?(this.ybase--,a++,this.ydisp>0&&this.ydisp--):this.lines.push(new JJ(e,n)));else for(let e=this._rows;e>t;e--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(i<this.lines.maxLength){let e=this.lines.length-i;e>0&&(this.lines.trimStart(e),this.ybase=Math.max(this.ybase-e,0),this.ydisp=Math.max(this.ydisp-e,0),this.savedY=Math.max(this.savedY-e,0)),this.lines.maxLength=i}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),a&&(this.y+=a),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let t=0;t<this.lines.length;t++)r+=+this.lines.get(t).resize(e,n);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),r>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend===`conpty`&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=YJ(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(GJ),n);if(r.length>0){let n=XJ(this.lines,r);ZJ(this.lines,n.layout),this._reflowLargerAdjustViewport(e,t,n.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let r=this.getNullCell(GJ),i=n;for(;i-->0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new JJ(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=this.getNullCell(GJ),i=[],a=0;for(let o=this.lines.length-1;o>=0;o--){let s=this.lines.get(o);if(!s||!s.isWrapped&&s.getTrimmedLength()<=e)continue;let c=[s];for(;s.isWrapped&&o>0;)s=this.lines.get(--o),c.unshift(s);if(!n){let e=this.ybase+this.y;if(e>=o&&e<o+c.length)continue}let l=c[c.length-1].getTrimmedLength(),u=QJ(c,this._cols,e),d=u.length-c.length,f;f=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+d):Math.max(0,this.lines.length-this.lines.maxLength+d);let p=[];for(let e=0;e<d;e++){let e=this.getBlankLine(GJ,!0);p.push(e)}p.length>0&&(i.push({start:o+c.length+a,newLines:p}),a+=p.length),c.push(...p);let m=u.length-1,h=u[m];h===0&&(m--,h=u[m]);let g=c.length-d-1,_=l;for(;g>=0;){let e=Math.min(_,h);if(c[m]===void 0)break;c[m].copyCellsFrom(c[g],_-e,h-e,e,!0),h-=e,h===0&&(m--,h=u[m]),_-=e,_===0&&(g--,_=$J(c,Math.max(g,0),this._cols))}for(let t=0;t<c.length;t++)u[t]<e&&c[t].setCell(u[t],r);let v=d-f;for(;v-->0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+a)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+d,this.ybase+t-1)}if(i.length>0){let e=[],t=[];for(let e=0;e<this.lines.length;e++)t.push(this.lines.get(e));let n=this.lines.length,r=n-1,o=0,s=i[o];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+a);let c=0;for(let l=Math.min(this.lines.maxLength-1,n+a-1);l>=0;l--)if(s&&s.start>r+c){for(let e=s.newLines.length-1;e>=0;e--)this.lines.set(l--,s.newLines[e]);l++,e.push({index:r+1,amount:s.newLines.length}),c+=s.newLines.length,s=i[++o]}else this.lines.set(l,t[r--]);let l=0;for(let t=e.length-1;t>=0;t--)e[t].index+=l,this.lines.onInsertEmitter.fire(e[t]),l+=e[t].amount;let u=Math.max(0,n+a-this.lines.maxLength);u>0&&this.lines.onTrimEmitter.fire(u)}}translateBufferLineToString(e,t,n=0,r){let i=this.lines.get(e);return i?i.translateToString(t,n,r):``}getWrappedRangeForLine(e){let t=e,n=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:t,last:n}}setupTabStops(e){for(e==null?(this.tabs={},e=0):this.tabs[e]||(e=this.prevStop(e));e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e??=this.x;!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e??=this.x;!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new tY(e);return this.markers.push(t),t.register(this.lines.onTrim(e=>{t.line-=e,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(e=>{t.line>=e.index&&(t.line+=e.amount)})),t.register(this.lines.onDelete(e=>{t.line>=e.index&&t.line<e.index+e.amount&&t.dispose(),t.line>e.index&&(t.line-=e.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},oY=class extends pW{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new Q),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange(`scrollback`,()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange(`tabStopWidth`,()=>this.setupTabStops()))}reset(){this._normal=new aY(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new aY(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},sY=2,cY=1,lY=class extends pW{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new Q),this.onResize=this._onResize.event,this._onScroll=this._register(new Q),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,sY),this.rows=Math.max(e.rawOptions.rows||0,cY),this.buffers=this._register(new oY(e,this)),this._register(this.buffers.onBufferActivate(e=>{this._onScroll.fire(e.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let n=this.cols!==e,r=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:n,rowsChanged:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,r;r=this._cachedBlankLine,(!r||r.length!==this.cols||r.getFg(0)!==e.fg||r.getBg(0)!==e.bg)&&(r=n.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;let i=n.ybase+n.scrollTop,a=n.ybase+n.scrollBottom;if(n.scrollTop===0){let e=n.lines.isFull;a===n.lines.length-1?e?n.lines.recycle().copyFrom(r):n.lines.push(r.clone()):n.lines.splice(a+1,0,r.clone()),e?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let e=a-i+1;n.lines.shiftElements(i+1,e-1,-1),n.lines.set(a,r.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,t){let n=this.buffer;if(e<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else e+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let r=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),r!==n.ydisp&&(t||this._onScroll.fire(n.ydisp))}};lY=XH([ZH(0,AU)],lY);var uY={cols:80,rows:24,cursorBlink:!1,cursorStyle:`block`,cursorWidth:1,cursorInactiveStyle:`outline`,customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:`alt`,fastScrollSensitivity:5,fontFamily:`monospace`,fontSize:15,fontWeight:`normal`,fontWeightBold:`bold`,ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:`info`,logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:Kq,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:` ()[]{}',"\``,altClickMovesCursor:!0,convertEol:!1,termName:`xterm`,cancelEvents:!1,overviewRuler:{}},dY=[`normal`,`bold`,`100`,`200`,`300`,`400`,`500`,`600`,`700`,`800`,`900`],fY=class extends pW{constructor(e){super(),this._onOptionChange=this._register(new Q),this.onOptionChange=this._onOptionChange.event;let t={...uY};for(let n in e)if(n in t)try{let r=e[n];t[n]=this._sanitizeAndValidateOption(n,r)}catch(e){console.error(e)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(uW(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(n=>{n===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&t()})}_setupOptions(){let e=e=>{if(!(e in uY))throw Error(`No option with key "${e}"`);return this.rawOptions[e]},t=(e,t)=>{if(!(e in uY))throw Error(`No option with key "${e}"`);t=this._sanitizeAndValidateOption(e,t),this.rawOptions[e]!==t&&(this.rawOptions[e]=t,this._onOptionChange.fire(e))};for(let n in this.rawOptions){let r={get:e.bind(this,n),set:t.bind(this,n)};Object.defineProperty(this.options,n,r)}}_sanitizeAndValidateOption(e,t){switch(e){case`cursorStyle`:if(t||=uY[e],!pY(t))throw Error(`"${t}" is not a valid value for ${e}`);break;case`wordSeparator`:t||=uY[e];break;case`fontWeight`:case`fontWeightBold`:if(typeof t==`number`&&1<=t&&t<=1e3)break;t=dY.includes(t)?t:uY[e];break;case`cursorWidth`:t=Math.floor(t);case`lineHeight`:case`tabStopWidth`:if(t<1)throw Error(`${e} cannot be less than 1, value: ${t}`);break;case`minimumContrastRatio`:t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case`scrollback`:if(t=Math.min(t,4294967295),t<0)throw Error(`${e} cannot be less than 0, value: ${t}`);break;case`fastScrollSensitivity`:case`scrollSensitivity`:if(t<=0)throw Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case`rows`:case`cols`:if(!t&&t!==0)throw Error(`${e} must be numeric, value: ${t}`);break;case`windowsPty`:t??={}}return t}};function pY(e){return e===`block`||e===`underline`||e===`bar`}function mY(e,t=5){if(typeof e!=`object`)return e;let n=Array.isArray(e)?[]:{};for(let r in e)n[r]=t<=1?e[r]:e[r]&&mY(e[r],t-1);return n}var hY=Object.freeze({insertMode:!1}),gY=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),_Y=class extends pW{constructor(e,t,n){super(),this._bufferService=e,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new Q),this.onData=this._onData.event,this._onUserInput=this._register(new Q),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new Q),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new Q),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=mY(hY),this.decPrivateModes=mY(gY)}reset(){this.modes=mY(hY),this.decPrivateModes=mY(gY)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace(`sending data (codes)`,()=>e.split(``).map(e=>e.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace(`sending binary (codes)`,()=>e.split(``).map(e=>e.charCodeAt(0))),this._onBinary.fire(e))}};_Y=XH([ZH(0,wU),ZH(1,kU),ZH(2,AU)],_Y);var vY={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>e.action!==32||e.button!==3},ANY:{events:31,restrict:e=>!0}};function yY(e,t){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=e.button&3,e.button&4&&(n|=64),e.button&8&&(n|=128),e.action===32?n|=32:e.action===0&&!t&&(n|=3)),n}var bY=String.fromCharCode,xY={DEFAULT:e=>{let t=[yY(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?``:`\x1B[M${bY(t[0])}${bY(t[1])}${bY(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`\x1B[<${yY(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`\x1B[<${yY(e,!0)};${e.x};${e.y}${t}`}},SY=class extends pW{constructor(e,t,n){super(),this._bufferService=e,this._coreService=t,this._optionsService=n,this._protocols={},this._encodings={},this._activeProtocol=``,this._activeEncoding=``,this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new Q),this.onProtocolChange=this._onProtocolChange.event;for(let e of Object.keys(vY))this.addProtocol(e,vY[e]);for(let e of Object.keys(xY))this.addEncoding(e,xY[e]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol=`NONE`,this.activeEncoding=`DEFAULT`,this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,n){if(e.deltaY===0||e.shiftKey||t===void 0||n===void 0)return 0;let r=t/n,i=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(i/=r+0,Math.abs(e.deltaY)<50&&(i*=.3),this._wheelPartialScroll+=i,i=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._bufferService.rows),i}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding===`SGR_PIXELS`))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding===`DEFAULT`?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,n){if(n){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return e.button===t.button&&e.action===t.action&&e.ctrl===t.ctrl&&e.alt===t.alt&&e.shift===t.shift}};SY=XH([ZH(0,wU),ZH(1,EU),ZH(2,AU)],SY);var CY=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],wY=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],TY;function EY(e,t){let n=0,r=t.length-1,i;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(i=n+r>>1,e>t[i][1])n=i+1;else if(e<t[i][0])r=i-1;else return!0;return!1}var DY=class{constructor(){if(this.version=`6`,!TY){TY=new Uint8Array(65536),TY.fill(1),TY[0]=0,TY.fill(0,1,32),TY.fill(0,127,160),TY.fill(2,4352,4448),TY[9001]=2,TY[9002]=2,TY.fill(2,11904,42192),TY[12351]=1,TY.fill(2,44032,55204),TY.fill(2,63744,64256),TY.fill(2,65040,65050),TY.fill(2,65072,65136),TY.fill(2,65280,65377),TY.fill(2,65504,65511);for(let e=0;e<CY.length;++e)TY.fill(0,CY[e][0],CY[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?TY[e]:EY(e,wY)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let e=OY.extractWidth(t);e===0?r=!1:e>n&&(n=e)}return OY.createPropertyValue(0,n,r)}},OY=class e{constructor(){this._providers=Object.create(null),this._active=``,this._onChange=new Q,this.onChange=this._onChange.event;let e=new DY;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return!!(e&1)}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,t,n=!1){return(e&16777215)<<3|(t&3)<<1|!!n}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(t){let n=0,r=0,i=t.length;for(let a=0;a<i;++a){let o=t.charCodeAt(a);if(55296<=o&&o<=56319){if(++a>=i)return n+this.wcwidth(o);let e=t.charCodeAt(a);56320<=e&&e<=57343?o=(o-55296)*1024+e-56320+65536:n+=this.wcwidth(e)}let s=this.charProperties(o,r),c=e.extractWidth(s);e.extractShouldJoin(s)&&(c-=e.extractWidth(r)),n+=c,r=s}return n}charProperties(e,t){return this._activeProvider.charProperties(e,t)}},kY=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function AY(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&t&&(n.isWrapped=t[3]!==0&&t[3]!==32)}var jY=2147483647,MY=256,NY=class e{constructor(e=32,t=32){if(this.maxLength=e,this.maxSubParamsLength=t,t>MY)throw Error(`maxSubParamsLength must not be greater than 256`);this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let n=new e;if(!t.length)return n;for(let e=+!!Array.isArray(t[0]);e<t.length;++e){let r=t[e];if(Array.isArray(r))for(let e=0;e<r.length;++e)n.addSubParam(r[e]);else n.addParam(r)}return n}clone(){let t=new e(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let e=[];for(let t=0;t<this.length;++t){e.push(this.params[t]);let n=this._subParamsIdx[t]>>8,r=this._subParamsIdx[t]&255;r-n>0&&e.push(Array.prototype.slice.call(this._subParams,n,r))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(e<-1)throw Error(`values lesser than -1 are not allowed`);this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>jY?jY:e}addSubParam(e){if(this._digitIsSub=!0,this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(e<-1)throw Error(`values lesser than -1 are not allowed`);this._subParams[this._subParamsLength++]=e>jY?jY:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(this._subParamsIdx[e]&255)-(this._subParamsIdx[e]>>8)>0}getSubParams(e){let t=this._subParamsIdx[e]>>8,n=this._subParamsIdx[e]&255;return n-t>0?this._subParams.subarray(t,n):null}getSubParamsAll(){let e={};for(let t=0;t<this.length;++t){let n=this._subParamsIdx[t]>>8,r=this._subParamsIdx[t]&255;r-n>0&&(e[t]=this._subParams.slice(n,r))}return e}addDigit(e){let t;if(this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let n=this._digitIsSub?this._subParams:this.params,r=n[t-1];n[t-1]=~r?Math.min(r*10+e,jY):e}},PY=[],FY=class{constructor(){this._state=0,this._active=PY,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=PY}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=PY,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||PY,!this._active.length)this._handlerFb(this._id,`START`);else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,n){if(!this._active.length)this._handlerFb(this._id,`PUT`,uU(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}start(){this.reset(),this._state=1}put(e,t,n){if(this._state!==3){if(this._state===1)for(;t<n;){let n=e[t++];if(n===59){this._state=2,this._start();break}if(n<48||57<n){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+n-48}this._state===2&&n-t>0&&this._put(e,t,n)}}end(e,t=!0){if(this._state!==0){if(this._state!==3){if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,`END`,e);else{let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&n===!1){for(;r>=0&&(n=this._active[r].end(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}}this._active=PY,this._id=-1,this._state=0}}},IY=class{constructor(e){this._handler=e,this._data=``,this._hitLimit=!1}start(){this._data=``,this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=uU(e,t,n),this._data.length>1e7&&(this._data=``,this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(e=>(this._data=``,this._hitLimit=!1,e));return this._data=``,this._hitLimit=!1,t}},LY=[],RY=class{constructor(){this._handlers=Object.create(null),this._active=LY,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=LY}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=LY,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||LY,!this._active.length)this._handlerFb(this._ident,`HOOK`,t);else for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(t)}put(e,t,n){if(!this._active.length)this._handlerFb(this._ident,`PUT`,uU(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,`UNHOOK`,e);else{let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&n===!1){for(;r>=0&&(n=this._active[r].unhook(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=LY,this._ident=0}},zY=new NY;zY.addParam(0);var BY=class{constructor(e){this._handler=e,this._data=``,this._params=zY,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():zY,this._data=``,this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=uU(e,t,n),this._data.length>1e7&&(this._data=``,this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(e=>(this._params=zY,this._data=``,this._hitLimit=!1,e));return this._params=zY,this._data=``,this._hitLimit=!1,t}},VY=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,n,r){this.table[t<<8|e]=n<<4|r}addMany(e,t,n,r){for(let i=0;i<e.length;i++)this.table[t<<8|e[i]]=n<<4|r}},HY=160,UY=function(){let e=new VY(4095),t=Array.apply(null,Array(256)).map((e,t)=>t),n=(e,n)=>t.slice(e,n),r=n(32,127),i=n(0,24);i.push(25),i.push.apply(i,n(28,32));let a=n(0,14),o;for(o in e.setDefault(1,0),e.addMany(r,0,2,0),a)e.addMany([24,26,153,154],o,3,0),e.addMany(n(128,144),o,3,0),e.addMany(n(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(i,0,3,0),e.addMany(i,1,3,1),e.add(127,1,0,1),e.addMany(i,8,0,8),e.addMany(i,3,3,3),e.add(127,3,0,3),e.addMany(i,4,3,4),e.add(127,4,0,4),e.addMany(i,6,3,6),e.addMany(i,5,3,5),e.add(127,5,0,5),e.addMany(i,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(i,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(i,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(i,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(i,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(i,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(i,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(HY,0,2,0),e.add(HY,8,5,8),e.add(HY,6,0,6),e.add(HY,11,0,11),e.add(HY,13,13,13),e}(),WY=class extends pW{constructor(e=UY){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new NY,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e,t,n)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,t)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(uW(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new FY),this._dcsParser=this._register(new RY),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:`\\`},()=>!0)}_identifier(e,t=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw Error(`only one byte as prefix supported`);if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw Error(`prefix must be in range 0x3c .. 0x3f`)}if(e.intermediates){if(e.intermediates.length>2)throw Error(`only two bytes as intermediates are supported`);for(let t=0;t<e.intermediates.length;++t){let r=e.intermediates.charCodeAt(t);if(32>r||r>47)throw Error(`intermediate must be in range 0x20 .. 0x2f`);n<<=8,n|=r}}if(e.final.length!==1)throw Error(`final must be a single byte`);let r=e.final.charCodeAt(0);if(t[0]>r||r>t[1])throw Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=r,n}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join(``)}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let r=this._escHandlers[n];return r.push(t),{dispose:()=>{let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let r=this._csiHandlers[n];return r.push(t),{dispose:()=>{let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,n,r,i){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=r,this._parseStack.chunkPos=i}parse(e,t,n){let r=0,i=0,a=0,o;if(this._parseStack.state){if(this._parseStack.state===2)this._parseStack.state=0,a=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,Error(`improper continuation due to previous async handler, giving up parsing`);let t=this._parseStack.handlers,i=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&i>-1){for(;i>=0&&(o=t[i](this._params),o!==!0);i--)if(o instanceof Promise)return this._parseStack.handlerPos=i,o}this._parseStack.handlers=[];break;case 4:if(n===!1&&i>-1){for(;i>=0&&(o=t[i](),o!==!0);i--)if(o instanceof Promise)return this._parseStack.handlerPos=i,o}this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],o=this._dcsParser.unhook(r!==24&&r!==26,n),o)return o;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],o=this._oscParser.end(r!==24&&r!==26,n),o)return o;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,a=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}}for(let n=a;n<t;++n){switch(r=e[n],i=this._transitions.table[this.currentState<<8|(r<160?r:HY)],i>>4){case 2:for(let i=n+1;;++i){if(i>=t||(r=e[i])<32||r>126&&r<HY){this._printHandler(e,n,i),n=i-1;break}if(++i>=t||(r=e[i])<32||r>126&&r<HY){this._printHandler(e,n,i),n=i-1;break}if(++i>=t||(r=e[i])<32||r>126&&r<HY){this._printHandler(e,n,i),n=i-1;break}if(++i>=t||(r=e[i])<32||r>126&&r<HY){this._printHandler(e,n,i),n=i-1;break}}break;case 3:this._executeHandlers[r]?this._executeHandlers[r]():this._executeHandlerFb(r),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:n,code:r,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let a=this._csiHandlers[this._collect<<8|r],s=a?a.length-1:-1;for(;s>=0&&(o=a[s](this._params),o!==!0);s--)if(o instanceof Promise)return this._preserveStack(3,a,s,i,n),o;s<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingJoinState=0;break;case 8:do switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}while(++n<t&&(r=e[n])>47&&r<60);n--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:let c=this._escHandlers[this._collect<<8|r],l=c?c.length-1:-1;for(;l>=0&&(o=c[l](),o!==!0);l--)if(o instanceof Promise)return this._preserveStack(4,c,l,i,n),o;l<0&&this._escHandlerFb(this._collect<<8|r),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|r,this._params);break;case 13:for(let i=n+1;;++i)if(i>=t||(r=e[i])===24||r===26||r===27||r>127&&r<HY){this._dcsParser.put(e,n,i),n=i-1;break}break;case 14:if(o=this._dcsParser.unhook(r!==24&&r!==26),o)return this._preserveStack(6,[],0,i,n),o;r===27&&(i|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let i=n+1;;i++)if(i>=t||(r=e[i])<32||r>127&&r<HY){this._oscParser.put(e,n,i),n=i-1;break}break;case 6:if(o=this._oscParser.end(r!==24&&r!==26),o)return this._preserveStack(5,[],0,i,n),o;r===27&&(i|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=i&15}}},GY=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,KY=/^[\da-f]+$/;function qY(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf(`rgb:`)===0){t=t.slice(4);let e=GY.exec(t);if(e){let t=e[1]?15:e[4]?255:e[7]?4095:65535;return[Math.round(parseInt(e[1]||e[4]||e[7]||e[10],16)/t*255),Math.round(parseInt(e[2]||e[5]||e[8]||e[11],16)/t*255),Math.round(parseInt(e[3]||e[6]||e[9]||e[12],16)/t*255)]}}else if(t.indexOf(`#`)===0&&(t=t.slice(1),KY.exec(t)&&[3,6,9,12].includes(t.length))){let e=t.length/3,n=[0,0,0];for(let r=0;r<3;++r){let i=parseInt(t.slice(e*r,e*r+e),16);n[r]=e===1?i<<4:e===2?i:e===3?i>>4:i>>8}return n}}function JY(e,t){let n=e.toString(16),r=n.length<2?`0`+n:n;switch(t){case 4:return n[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}function YY(e,t=16){let[n,r,i]=e;return`rgb:${JY(n,t)}/${JY(r,t)}/${JY(i,t)}`}var XY={"(":0,")":1,"*":2,"+":3,"-":1,".":2},ZY=131072,QY=10;function $Y(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var eX=5e3,tX=0,nX=class extends pW{constructor(e,t,n,r,i,a,o,s,c=new WY){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=r,this._optionsService=i,this._oscLinkService=a,this._coreMouseService=o,this._unicodeService=s,this._parser=c,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new dU,this._utf8Decoder=new fU,this._windowTitle=``,this._iconName=``,this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=GJ.clone(),this._eraseAttrDataInternal=GJ.clone(),this._onRequestBell=this._register(new Q),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new Q),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new Q),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new Q),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new Q),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new Q),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new Q),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new Q),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new Q),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new Q),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new Q),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new Q),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new Q),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new rX(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(e=>this._activeBuffer=e.activeBuffer)),this._parser.setCsiHandlerFallback((e,t)=>{this._logService.debug(`Unknown CSI code: `,{identifier:this._parser.identToString(e),params:t.toArray()})}),this._parser.setEscHandlerFallback(e=>{this._logService.debug(`Unknown ESC code: `,{identifier:this._parser.identToString(e)})}),this._parser.setExecuteHandlerFallback(e=>{this._logService.debug(`Unknown EXECUTE code: `,{code:e})}),this._parser.setOscHandlerFallback((e,t,n)=>{this._logService.debug(`Unknown OSC code: `,{identifier:e,action:t,data:n})}),this._parser.setDcsHandlerFallback((e,t,n)=>{t===`HOOK`&&(n=n.toArray()),this._logService.debug(`Unknown DCS code: `,{identifier:this._parser.identToString(e),action:t,payload:n})}),this._parser.setPrintHandler((e,t,n)=>this.print(e,t,n)),this._parser.registerCsiHandler({final:`@`},e=>this.insertChars(e)),this._parser.registerCsiHandler({intermediates:` `,final:`@`},e=>this.scrollLeft(e)),this._parser.registerCsiHandler({final:`A`},e=>this.cursorUp(e)),this._parser.registerCsiHandler({intermediates:` `,final:`A`},e=>this.scrollRight(e)),this._parser.registerCsiHandler({final:`B`},e=>this.cursorDown(e)),this._parser.registerCsiHandler({final:`C`},e=>this.cursorForward(e)),this._parser.registerCsiHandler({final:`D`},e=>this.cursorBackward(e)),this._parser.registerCsiHandler({final:`E`},e=>this.cursorNextLine(e)),this._parser.registerCsiHandler({final:`F`},e=>this.cursorPrecedingLine(e)),this._parser.registerCsiHandler({final:`G`},e=>this.cursorCharAbsolute(e)),this._parser.registerCsiHandler({final:`H`},e=>this.cursorPosition(e)),this._parser.registerCsiHandler({final:`I`},e=>this.cursorForwardTab(e)),this._parser.registerCsiHandler({final:`J`},e=>this.eraseInDisplay(e,!1)),this._parser.registerCsiHandler({prefix:`?`,final:`J`},e=>this.eraseInDisplay(e,!0)),this._parser.registerCsiHandler({final:`K`},e=>this.eraseInLine(e,!1)),this._parser.registerCsiHandler({prefix:`?`,final:`K`},e=>this.eraseInLine(e,!0)),this._parser.registerCsiHandler({final:`L`},e=>this.insertLines(e)),this._parser.registerCsiHandler({final:`M`},e=>this.deleteLines(e)),this._parser.registerCsiHandler({final:`P`},e=>this.deleteChars(e)),this._parser.registerCsiHandler({final:`S`},e=>this.scrollUp(e)),this._parser.registerCsiHandler({final:`T`},e=>this.scrollDown(e)),this._parser.registerCsiHandler({final:`X`},e=>this.eraseChars(e)),this._parser.registerCsiHandler({final:`Z`},e=>this.cursorBackwardTab(e)),this._parser.registerCsiHandler({final:"`"},e=>this.charPosAbsolute(e)),this._parser.registerCsiHandler({final:`a`},e=>this.hPositionRelative(e)),this._parser.registerCsiHandler({final:`b`},e=>this.repeatPrecedingCharacter(e)),this._parser.registerCsiHandler({final:`c`},e=>this.sendDeviceAttributesPrimary(e)),this._parser.registerCsiHandler({prefix:`>`,final:`c`},e=>this.sendDeviceAttributesSecondary(e)),this._parser.registerCsiHandler({final:`d`},e=>this.linePosAbsolute(e)),this._parser.registerCsiHandler({final:`e`},e=>this.vPositionRelative(e)),this._parser.registerCsiHandler({final:`f`},e=>this.hVPosition(e)),this._parser.registerCsiHandler({final:`g`},e=>this.tabClear(e)),this._parser.registerCsiHandler({final:`h`},e=>this.setMode(e)),this._parser.registerCsiHandler({prefix:`?`,final:`h`},e=>this.setModePrivate(e)),this._parser.registerCsiHandler({final:`l`},e=>this.resetMode(e)),this._parser.registerCsiHandler({prefix:`?`,final:`l`},e=>this.resetModePrivate(e)),this._parser.registerCsiHandler({final:`m`},e=>this.charAttributes(e)),this._parser.registerCsiHandler({final:`n`},e=>this.deviceStatus(e)),this._parser.registerCsiHandler({prefix:`?`,final:`n`},e=>this.deviceStatusPrivate(e)),this._parser.registerCsiHandler({intermediates:`!`,final:`p`},e=>this.softReset(e)),this._parser.registerCsiHandler({intermediates:` `,final:`q`},e=>this.setCursorStyle(e)),this._parser.registerCsiHandler({final:`r`},e=>this.setScrollRegion(e)),this._parser.registerCsiHandler({final:`s`},e=>this.saveCursor(e)),this._parser.registerCsiHandler({final:`t`},e=>this.windowOptions(e)),this._parser.registerCsiHandler({final:`u`},e=>this.restoreCursor(e)),this._parser.registerCsiHandler({intermediates:`'`,final:`}`},e=>this.insertColumns(e)),this._parser.registerCsiHandler({intermediates:`'`,final:`~`},e=>this.deleteColumns(e)),this._parser.registerCsiHandler({intermediates:`"`,final:`q`},e=>this.selectProtected(e)),this._parser.registerCsiHandler({intermediates:`$`,final:`p`},e=>this.requestMode(e,!0)),this._parser.registerCsiHandler({prefix:`?`,intermediates:`$`,final:`p`},e=>this.requestMode(e,!1)),this._parser.setExecuteHandler($.BEL,()=>this.bell()),this._parser.setExecuteHandler($.LF,()=>this.lineFeed()),this._parser.setExecuteHandler($.VT,()=>this.lineFeed()),this._parser.setExecuteHandler($.FF,()=>this.lineFeed()),this._parser.setExecuteHandler($.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler($.BS,()=>this.backspace()),this._parser.setExecuteHandler($.HT,()=>this.tab()),this._parser.setExecuteHandler($.SO,()=>this.shiftOut()),this._parser.setExecuteHandler($.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(KK.IND,()=>this.index()),this._parser.setExecuteHandler(KK.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(KK.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new IY(e=>(this.setTitle(e),this.setIconName(e),!0))),this._parser.registerOscHandler(1,new IY(e=>this.setIconName(e))),this._parser.registerOscHandler(2,new IY(e=>this.setTitle(e))),this._parser.registerOscHandler(4,new IY(e=>this.setOrReportIndexedColor(e))),this._parser.registerOscHandler(8,new IY(e=>this.setHyperlink(e))),this._parser.registerOscHandler(10,new IY(e=>this.setOrReportFgColor(e))),this._parser.registerOscHandler(11,new IY(e=>this.setOrReportBgColor(e))),this._parser.registerOscHandler(12,new IY(e=>this.setOrReportCursorColor(e))),this._parser.registerOscHandler(104,new IY(e=>this.restoreIndexedColor(e))),this._parser.registerOscHandler(110,new IY(e=>this.restoreFgColor(e))),this._parser.registerOscHandler(111,new IY(e=>this.restoreBgColor(e))),this._parser.registerOscHandler(112,new IY(e=>this.restoreCursorColor(e))),this._parser.registerEscHandler({final:`7`},()=>this.saveCursor()),this._parser.registerEscHandler({final:`8`},()=>this.restoreCursor()),this._parser.registerEscHandler({final:`D`},()=>this.index()),this._parser.registerEscHandler({final:`E`},()=>this.nextLine()),this._parser.registerEscHandler({final:`H`},()=>this.tabSet()),this._parser.registerEscHandler({final:`M`},()=>this.reverseIndex()),this._parser.registerEscHandler({final:`=`},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:`>`},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:`c`},()=>this.fullReset()),this._parser.registerEscHandler({final:`n`},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:`o`},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:`|`},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:`}`},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:`~`},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:`%`,final:`@`},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:`%`,final:`G`},()=>this.selectDefaultCharset());for(let e in nY)this._parser.registerEscHandler({intermediates:`(`,final:e},()=>this.selectCharset(`(`+e)),this._parser.registerEscHandler({intermediates:`)`,final:e},()=>this.selectCharset(`)`+e)),this._parser.registerEscHandler({intermediates:`*`,final:e},()=>this.selectCharset(`*`+e)),this._parser.registerEscHandler({intermediates:`+`,final:e},()=>this.selectCharset(`+`+e)),this._parser.registerEscHandler({intermediates:`-`,final:e},()=>this.selectCharset(`-`+e)),this._parser.registerEscHandler({intermediates:`.`,final:e},()=>this.selectCharset(`.`+e)),this._parser.registerEscHandler({intermediates:`/`,final:e},()=>this.selectCharset(`/`+e));this._parser.registerEscHandler({intermediates:`#`,final:`8`},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(e=>(this._logService.error(`Parsing error: `,e),e)),this._parser.registerDcsHandler({intermediates:`$`,final:`q`},new BY((e,t)=>this.requestStatusString(e,t)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,n,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=n,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((e,t)=>setTimeout(()=>t(`#SLOW_TIMEOUT`),eX))]).catch(e=>{if(e!==`#SLOW_TIMEOUT`)throw e;console.warn(`async parser handler taking longer than ${eX} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,r=this._activeBuffer.x,i=this._activeBuffer.y,a=0,o=this._parseStack.paused;if(o){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(n),n;r=this._parseStack.cursorStartX,i=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>ZY&&(a=this._parseStack.position+ZY)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e==`string`?` "${e}"`:` "${Array.prototype.map.call(e,e=>String.fromCharCode(e)).join(``)}"`}`),this._logService.logLevel===0&&this._logService.trace(`parsing data (codes)`,typeof e==`string`?e.split(``).map(e=>e.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<ZY&&(this._parseBuffer=new Uint32Array(Math.min(e.length,ZY))),o||this._dirtyRowTracker.clearRange(),e.length>ZY)for(let t=a;t<e.length;t+=ZY){let a=t+ZY<e.length?t+ZY:e.length,o=typeof e==`string`?this._stringDecoder.decode(e.substring(t,a),this._parseBuffer):this._utf8Decoder.decode(e.subarray(t,a),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,o))return this._preserveStack(r,i,o,t),this._logSlowResolvingAsync(n),n}else if(!o){let t=typeof e==`string`?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,t))return this._preserveStack(r,i,t,0),this._logSlowResolvingAsync(n),n}(this._activeBuffer.x!==r||this._activeBuffer.y!==i)&&this._onCursorMove.fire();let s=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),c=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);c<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(c,this._bufferService.rows-1),end:Math.min(s,this._bufferService.rows-1)})}print(e,t,n){let r,i,a=this._charsetService.charset,o=this._optionsService.rawOptions.screenReaderMode,s=this._bufferService.cols,c=this._coreService.decPrivateModes.wraparound,l=this._coreService.modes.insertMode,u=this._curAttrData,d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-t>0&&d.getWidth(this._activeBuffer.x-1)===2&&d.setCellFromCodepoint(this._activeBuffer.x-1,0,1,u);let f=this._parser.precedingJoinState;for(let p=t;p<n;++p){if(r=e[p],r<127&&a){let e=a[String.fromCharCode(r)];e&&(r=e.charCodeAt(0))}let t=this._unicodeService.charProperties(r,f);i=OY.extractWidth(t);let n=OY.extractShouldJoin(t),m=n?OY.extractWidth(f):0;if(f=t,o&&this._onA11yChar.fire(lU(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+i-m>s){if(c){let e=d,t=this._activeBuffer.x-m;for(this._activeBuffer.x=m,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),m>0&&d instanceof JJ&&d.copyCellsFrom(e,t,0,m,!1);t<s;)e.setCellFromCodepoint(t++,0,1,u)}else if(this._activeBuffer.x=s-1,i===2)continue}if(n&&this._activeBuffer.x){let e=d.getWidth(this._activeBuffer.x-1)?1:2;d.addCodepointToCell(this._activeBuffer.x-e,r,i);for(let e=i-m;--e>=0;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u);continue}if(l&&(d.insertCells(this._activeBuffer.x,i-m,this._activeBuffer.getNullCell(u)),d.getWidth(s-1)===2&&d.setCellFromCodepoint(s-1,0,1,u)),d.setCellFromCodepoint(this._activeBuffer.x++,r,i,u),i>0)for(;--i;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u)}this._parser.precedingJoinState=f,this._activeBuffer.x<s&&n-t>0&&d.getWidth(this._activeBuffer.x)===0&&!d.hasContent(this._activeBuffer.x)&&d.setCellFromCodepoint(this._activeBuffer.x,0,1,u),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final===`t`&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,e=>!$Y(e.params[0],this._optionsService.rawOptions.windowOptions)||t(e)):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new BY(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new IY(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,n,r=!1,i=!1){let a=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);a.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),i),r&&(a.isWrapped=!1)}_resetBufferLine(e,t=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let n;switch(e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);n<this._bufferService.rows;n++)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(n);break;case 1:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(n=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,n-1);n--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+n)?.getTrimmedLength(););for(;n>=0;n--)this._bufferService.scroll(this._eraseAttrData())}else{for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let e=this._activeBuffer.lines.length-this._bufferService.rows;e>0&&(this._activeBuffer.lines.trimStart(e),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-e,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-e,0),this._onScroll.fire(0))}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,i=this._bufferService.rows-1+this._activeBuffer.ybase-r+1;for(;t--;)this._activeBuffer.lines.splice(i-1,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r;for(r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-r;t--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(GJ));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let n=e.params[0]||1,r=OY.extractWidth(t),i=this._activeBuffer.x-r,a=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(i),o=new Uint32Array(a.length*n),s=0;for(let e=0;e<a.length;){let t=a.codePointAt(e)||0;o[s++]=t,e+=t>65535?2:1}let c=s;for(let e=1;e<n;++e)o.copyWithin(c,0,s),c+=s;return this.print(o,0,c),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is(`xterm`)||this._is(`rxvt-unicode`)||this._is(`screen`)?this._coreService.triggerDataEvent($.ESC+`[?1;2c`):this._is(`linux`)&&this._coreService.triggerDataEvent($.ESC+`[?6c`)),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is(`xterm`)?this._coreService.triggerDataEvent($.ESC+`[>0;276;0c`):this._is(`rxvt-unicode`)?this._coreService.triggerDataEvent($.ESC+`[>85;95;0c`):this._is(`linux`)?this._coreService.triggerDataEvent(e.params[0]+`c`):this._is(`screen`)&&this._coreService.triggerDataEvent($.ESC+`[>83;40003;0c`)),!0}_is(e){return(this._optionsService.rawOptions.termName+``).indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,rY),this._charsetService.setgCharset(1,rY),this._charsetService.setgCharset(2,rY),this._charsetService.setgCharset(3,rY);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug(`Serial port requested application keypad.`),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol=`X10`;break;case 1e3:this._coreMouseService.activeProtocol=`VT200`;break;case 1002:this._coreMouseService.activeProtocol=`DRAG`;break;case 1003:this._coreMouseService.activeProtocol=`ANY`;break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug(`DECSET 1005 not supported (see #2507)`);break;case 1006:this._coreMouseService.activeEncoding=`SGR`;break;case 1015:this._logService.debug(`DECSET 1015 not supported (see #2507)`);break;case 1016:this._coreMouseService.activeEncoding=`SGR_PIXELS`;break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug(`Switching back to normal keypad.`),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol=`NONE`;break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug(`DECRST 1005 not supported (see #2507)`);break;case 1006:this._coreMouseService.activeEncoding=`DEFAULT`;break;case 1015:this._logService.debug(`DECRST 1015 not supported (see #2507)`);break;case 1016:this._coreMouseService.activeEncoding=`DEFAULT`;break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0)}return!0}requestMode(e,t){let n;(e=>(e[e.NOT_RECOGNIZED=0]=`NOT_RECOGNIZED`,e[e.SET=1]=`SET`,e[e.RESET=2]=`RESET`,e[e.PERMANENTLY_SET=3]=`PERMANENTLY_SET`,e[e.PERMANENTLY_RESET=4]=`PERMANENTLY_RESET`))(n||={});let r=this._coreService.decPrivateModes,{activeProtocol:i,activeEncoding:a}=this._coreMouseService,o=this._coreService,{buffers:s,cols:c}=this._bufferService,{active:l,alt:u}=s,d=this._optionsService.rawOptions,f=(e,n)=>(o.triggerDataEvent(`${$.ESC}[${t?``:`?`}${e};${n}$y`),!0),p=e=>e?1:2,m=e.params[0];return t?m===2?f(m,4):m===4?f(m,p(o.modes.insertMode)):m===12?f(m,3):m===20?f(m,p(d.convertEol)):f(m,0):m===1?f(m,p(r.applicationCursorKeys)):m===3?f(m,d.windowOptions.setWinLines?c===80?2:+(c===132):0):m===6?f(m,p(r.origin)):m===7?f(m,p(r.wraparound)):m===8?f(m,3):m===9?f(m,p(i===`X10`)):m===12?f(m,p(d.cursorBlink)):m===25?f(m,p(!o.isCursorHidden)):m===45?f(m,p(r.reverseWraparound)):m===66?f(m,p(r.applicationKeypad)):m===67?f(m,4):m===1e3?f(m,p(i===`VT200`)):m===1002?f(m,p(i===`DRAG`)):m===1003?f(m,p(i===`ANY`)):m===1004?f(m,p(r.sendFocus)):m===1005?f(m,4):m===1006?f(m,p(a===`SGR`)):m===1015?f(m,4):m===1016?f(m,p(a===`SGR_PIXELS`)):m===1048?f(m,1):m===47||m===1047||m===1049?f(m,p(l===u)):m===2004?f(m,p(r.bracketedPasteMode)):m===2026?f(m,p(r.synchronizedOutput)):f(m,0)}_updateAttrColor(e,t,n,r,i){return t===2?(e|=50331648,e&=-16777216,e|=hU.fromColorRGB([n,r,i])):t===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,t,n){let r=[0,0,-1,0,0,0],i=0,a=0;do{if(r[a+i]=e.params[t+a],e.hasSubParams(t+a)){let n=e.getSubParams(t+a),o=0;do r[1]===5&&(i=1),r[a+o+1+i]=n[o];while(++o<n.length&&o+a+1+i<r.length);break}if(r[1]===5&&a+i>=2||r[1]===2&&a+i>=5)break;r[1]&&(i=1)}while(++a+t<e.length&&a+i<r.length);for(let e=2;e<r.length;++e)r[e]===-1&&(r[e]=0);switch(r[0]){case 38:n.fg=this._updateAttrColor(n.fg,r[1],r[3],r[4],r[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,r[1],r[3],r[4],r[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,r[1],r[3],r[4],r[5])}return a}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=GJ.fg,e.bg=GJ.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,n,r=this._curAttrData;for(let i=0;i<t;i++)n=e.params[i],n>=30&&n<=37?(r.fg&=-50331904,r.fg|=16777216|n-30):n>=40&&n<=47?(r.bg&=-50331904,r.bg|=16777216|n-40):n>=90&&n<=97?(r.fg&=-50331904,r.fg|=n-90|16777224):n>=100&&n<=107?(r.bg&=-50331904,r.bg|=n-100|16777224):n===0?this._processSGR0(r):n===1?r.fg|=134217728:n===3?r.bg|=67108864:n===4?(r.fg|=268435456,this._processUnderline(e.hasSubParams(i)?e.getSubParams(i)[0]:1,r)):n===5?r.fg|=536870912:n===7?r.fg|=67108864:n===8?r.fg|=1073741824:n===9?r.fg|=2147483648:n===2?r.bg|=134217728:n===21?this._processUnderline(2,r):n===22?(r.fg&=-134217729,r.bg&=-134217729):n===23?r.bg&=-67108865:n===24?(r.fg&=-268435457,this._processUnderline(0,r)):n===25?r.fg&=-536870913:n===27?r.fg&=-67108865:n===28?r.fg&=-1073741825:n===29?r.fg&=2147483647:n===39?(r.fg&=-67108864,r.fg|=GJ.fg&16777215):n===49?(r.bg&=-67108864,r.bg|=GJ.bg&16777215):n===38||n===48||n===58?i+=this._extractColor(e,i,r):n===53?r.bg|=1073741824:n===55?r.bg&=-1073741825:n===59?(r.extended=r.extended.clone(),r.extended.underlineColor=-1,r.updateExtended()):n===100?(r.fg&=-67108864,r.fg|=GJ.fg&16777215,r.bg&=-67108864,r.bg|=GJ.bg&16777215):this._logService.debug(`Unknown SGR attribute: %d.`,n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${$.ESC}[0n`);break;case 6:let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${$.ESC}[${e};${t}R`)}return!0}deviceStatusPrivate(e){if(e.params[0]===6){let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${$.ESC}[?${e};${t}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=GJ.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle=`block`;break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle=`underline`;break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle=`bar`}let e=t%2==1;this._coreService.decPrivateModes.cursorBlink=e}return!0}setScrollRegion(e){let t=e.params[0]||1,n;return(e.length<2||(n=e.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(e){if(!$Y(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${$.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>QY&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>QY&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],n=e.split(`;`);for(;n.length>1;){let e=n.shift(),r=n.shift();if(/^\d+$/.exec(e)){let n=parseInt(e);if(iX(n)){if(r===`?`)t.push({type:0,index:n});else{let e=qY(r);e&&t.push({type:1,index:n,color:e})}}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(`;`);if(t===-1)return!0;let n=e.slice(0,t).trim(),r=e.slice(t+1);return r?this._createHyperlink(n,r):!n.trim()&&this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(`:`),r,i=n.findIndex(e=>e.startsWith(`id=`));return i!==-1&&(r=n[i].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:r,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let n=e.split(`;`);for(let e=0;e<n.length&&!(t>=this._specialColors.length);++e,++t)if(n[e]===`?`)this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let r=qY(n[e]);r&&this._onColor.fire([{type:1,index:this._specialColors[t],color:r}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],n=e.split(`;`);for(let e=0;e<n.length;++e)if(/^\d+$/.exec(n[e])){let r=parseInt(n[e]);iX(r)&&t.push({type:2,index:r})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug(`Serial port requested application keypad.`),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug(`Switching back to normal keypad.`),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,rY),!0}selectCharset(e){return e.length===2?(e[0]===`/`||this._charsetService.setgCharset(XY[e[0]],nY[e[1]]||rY),!0):(this.selectDefaultCharset(),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=GJ.clone(),this._eraseAttrDataInternal=GJ.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new _U;e.content=4194373,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let n=this._activeBuffer.ybase+this._activeBuffer.y+t,r=this._activeBuffer.lines.get(n);r&&(r.fill(e),r.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let n=e=>(this._coreService.triggerDataEvent(`${$.ESC}${e}${$.ESC}\\`),!0),r=this._bufferService.buffer,i=this._optionsService.rawOptions;return n(e===`"q`?`P1$r${+!!this._curAttrData.isProtected()}"q`:e===`"p`?`P1$r61;1"p`:e===`r`?`P1$r${r.scrollTop+1};${r.scrollBottom+1}r`:e===`m`?`P1$r0m`:e===` q`?`P1$r${{block:2,underline:4,bar:6}[i.cursorStyle]-+!!i.cursorBlink} q`:`P0$r`)}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},rX=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(tX=e,e=t,t=tX),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};rX=XH([ZH(0,wU)],rX);function iX(e){return 0<=e&&e<256}var aX=5e7,oX=12,sX=50,cX=class extends pW{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new Q),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;n=this._writeBuffer.shift();){this._action(n);let e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>aX)throw Error(`write data discarded, use flow control to avoid losing data`);if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let e=this._writeBuffer[this._bufferOffset],r=this._action(e,t);if(r){r.catch(e=>(queueMicrotask(()=>{throw e}),Promise.resolve(!1))).then(e=>performance.now()-n>=oX?setTimeout(()=>this._innerWrite(0,e)):this._innerWrite(n,e));return}let i=this._callbacks[this._bufferOffset];if(i&&i(),this._bufferOffset++,this._pendingData-=e.length,performance.now()-n>=oX)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>sX&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},lX=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let n=t.addMarker(t.ybase+t.y),r={data:e,id:this._nextId++,lines:[n]};return n.onDispose(()=>this._removeMarkerFromLink(r,n)),this._dataByLinkId.set(r.id,r),r.id}let n=e,r=this._getEntryIdKey(n),i=this._entriesWithId.get(r);if(i)return this.addLineToLink(i.id,t.ybase+t.y),i.id;let a=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(o,a)),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(e=>e.line!==t)){let e=this._bufferService.buffer.addMarker(t);n.lines.push(e),e.onDispose(()=>this._removeMarkerFromLink(n,e))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let n=e.lines.indexOf(t);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};lX=XH([ZH(0,wU)],lX);var uX=!1,dX=class extends pW{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new mW),this._onBinary=this._register(new Q),this.onBinary=this._onBinary.event,this._onData=this._register(new Q),this.onData=this._onData.event,this._onLineFeed=this._register(new Q),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new Q),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new Q),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new Q),this._instantiationService=new RJ,this.optionsService=this._register(new fY(e)),this._instantiationService.setService(AU,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(lY)),this._instantiationService.setService(wU,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(VJ)),this._instantiationService.setService(kU,this._logService),this.coreService=this._register(this._instantiationService.createInstance(_Y)),this._instantiationService.setService(EU,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(SY)),this._instantiationService.setService(TU,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(OY)),this._instantiationService.setService(MU,this.unicodeService),this._charsetService=this._instantiationService.createInstance(kY),this._instantiationService.setService(DU,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(lX),this._instantiationService.setService(jU,this._oscLinkService),this._inputHandler=this._register(new nX(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(xW.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(xW.forward(this._bufferService.onResize,this._onResize)),this._register(xW.forward(this.coreService.onData,this._onData)),this._register(xW.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange([`windowsMode`,`windowsPty`],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new cX((e,t)=>this._inputHandler.parse(e,t))),this._register(xW.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new Q),this._onScroll.event(e=>{this._onScrollApi?.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!uX&&(this._logService.warn(`writeSync is unreliable and will be removed soon.`),uX=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,sY),t=Math.max(t,cY),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend===`conpty`&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(AY.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:`H`},()=>(AY(this._bufferService),!1))),this._windowsWrappingHeuristics.value=uW(()=>{for(let t of e)t.dispose()})}}},fX={48:[`0`,`)`],49:[`1`,`!`],50:[`2`,`@`],51:[`3`,`#`],52:[`4`,`$`],53:[`5`,`%`],54:[`6`,`^`],55:[`7`,`&`],56:[`8`,`*`],57:[`9`,`(`],186:[`;`,`:`],187:[`=`,`+`],188:[`,`,`<`],189:[`-`,`_`],190:[`.`,`>`],191:[`/`,`?`],192:["`",`~`],219:[`[`,`{`],220:[`\\`,`|`],221:[`]`,`}`],222:[`'`,`"`]};function pX(e,t,n,r){let i={type:0,cancel:!1,key:void 0},a=+!!e.shiftKey|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key===`UIKeyInputUpArrow`?i.key=t?$.ESC+`OA`:$.ESC+`[A`:e.key===`UIKeyInputLeftArrow`?i.key=t?$.ESC+`OD`:$.ESC+`[D`:e.key===`UIKeyInputRightArrow`?i.key=t?$.ESC+`OC`:$.ESC+`[C`:e.key===`UIKeyInputDownArrow`&&(i.key=t?$.ESC+`OB`:$.ESC+`[B`);break;case 8:i.key=e.ctrlKey?`\b`:$.DEL,e.altKey&&(i.key=$.ESC+i.key);break;case 9:if(e.shiftKey){i.key=$.ESC+`[Z`;break}i.key=$.HT,i.cancel=!0;break;case 13:i.key=e.altKey?$.ESC+$.CR:$.CR,i.cancel=!0;break;case 27:i.key=$.ESC,e.altKey&&(i.key=$.ESC+$.ESC),i.cancel=!0;break;case 37:if(e.metaKey)break;i.key=a?$.ESC+`[1;`+(a+1)+`D`:t?$.ESC+`OD`:$.ESC+`[D`;break;case 39:if(e.metaKey)break;i.key=a?$.ESC+`[1;`+(a+1)+`C`:t?$.ESC+`OC`:$.ESC+`[C`;break;case 38:if(e.metaKey)break;i.key=a?$.ESC+`[1;`+(a+1)+`A`:t?$.ESC+`OA`:$.ESC+`[A`;break;case 40:if(e.metaKey)break;i.key=a?$.ESC+`[1;`+(a+1)+`B`:t?$.ESC+`OB`:$.ESC+`[B`;break;case 45:!e.shiftKey&&!e.ctrlKey&&(i.key=$.ESC+`[2~`);break;case 46:i.key=a?$.ESC+`[3;`+(a+1)+`~`:$.ESC+`[3~`;break;case 36:i.key=a?$.ESC+`[1;`+(a+1)+`H`:t?$.ESC+`OH`:$.ESC+`[H`;break;case 35:i.key=a?$.ESC+`[1;`+(a+1)+`F`:t?$.ESC+`OF`:$.ESC+`[F`;break;case 33:e.shiftKey?i.type=2:i.key=e.ctrlKey?$.ESC+`[5;`+(a+1)+`~`:$.ESC+`[5~`;break;case 34:e.shiftKey?i.type=3:i.key=e.ctrlKey?$.ESC+`[6;`+(a+1)+`~`:$.ESC+`[6~`;break;case 112:i.key=a?$.ESC+`[1;`+(a+1)+`P`:$.ESC+`OP`;break;case 113:i.key=a?$.ESC+`[1;`+(a+1)+`Q`:$.ESC+`OQ`;break;case 114:i.key=a?$.ESC+`[1;`+(a+1)+`R`:$.ESC+`OR`;break;case 115:i.key=a?$.ESC+`[1;`+(a+1)+`S`:$.ESC+`OS`;break;case 116:i.key=a?$.ESC+`[15;`+(a+1)+`~`:$.ESC+`[15~`;break;case 117:i.key=a?$.ESC+`[17;`+(a+1)+`~`:$.ESC+`[17~`;break;case 118:i.key=a?$.ESC+`[18;`+(a+1)+`~`:$.ESC+`[18~`;break;case 119:i.key=a?$.ESC+`[19;`+(a+1)+`~`:$.ESC+`[19~`;break;case 120:i.key=a?$.ESC+`[20;`+(a+1)+`~`:$.ESC+`[20~`;break;case 121:i.key=a?$.ESC+`[21;`+(a+1)+`~`:$.ESC+`[21~`;break;case 122:i.key=a?$.ESC+`[23;`+(a+1)+`~`:$.ESC+`[23~`;break;case 123:i.key=a?$.ESC+`[24;`+(a+1)+`~`:$.ESC+`[24~`;break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?i.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?i.key=$.NUL:e.keyCode>=51&&e.keyCode<=55?i.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?i.key=$.DEL:e.keyCode===219?i.key=$.ESC:e.keyCode===220?i.key=$.FS:e.keyCode===221&&(i.key=$.GS);else if((!n||r)&&e.altKey&&!e.metaKey){let t=fX[e.keyCode]?.[+!!e.shiftKey];if(t)i.key=$.ESC+t;else if(e.keyCode>=65&&e.keyCode<=90){let t=e.ctrlKey?e.keyCode-64:e.keyCode+32,n=String.fromCharCode(t);e.shiftKey&&(n=n.toUpperCase()),i.key=$.ESC+n}else if(e.keyCode===32)i.key=$.ESC+(e.ctrlKey?$.NUL:` `);else if(e.key===`Dead`&&e.code.startsWith(`Key`)){let t=e.code.slice(3,4);e.shiftKey||(t=t.toLowerCase()),i.key=$.ESC+t,i.cancel=!0}}else n&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(i.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?i.key=e.key:e.key&&e.ctrlKey&&(e.key===`_`&&(i.key=$.US),e.key===`@`&&(i.key=$.NUL))}return i}var mX=0,hX=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new tJ,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new tJ,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((e,t)=>this._getKey(e)-this._getKey(t)),t=0,n=0,r=Array(this._array.length+this._insertedValues.length);for(let i=0;i<r.length;i++)n>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[n])?(r[i]=e[t],t++):r[i]=this._array[n++];this._array=r,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(mX=this._search(t),mX===-1)||this._getKey(this._array[mX])!==t)return!1;do if(this._array[mX]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(mX),!0;while(++mX<this._array.length&&this._getKey(this._array[mX])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((e,t)=>e-t),t=0,n=Array(this._array.length-e.length),r=0;for(let i=0;i<this._array.length;i++)e[t]===i?t++:n[r++]=this._array[i];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(mX=this._search(e),!(mX<0||mX>=this._array.length)&&this._getKey(this._array[mX])===e))do yield this._array[mX];while(++mX<this._array.length&&this._getKey(this._array[mX])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(mX=this._search(e),!(mX<0||mX>=this._array.length)&&this._getKey(this._array[mX])===e))do t(this._array[mX]);while(++mX<this._array.length&&this._getKey(this._array[mX])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,n=this._array.length-1;for(;n>=t;){let r=t+n>>1,i=this._getKey(this._array[r]);if(i>e)n=r-1;else if(i<e)t=r+1;else{for(;r>0&&this._getKey(this._array[r-1])===e;)r--;return r}}return t}},gX=0,_X=0,vX=class extends pW{constructor(){super(),this._decorations=new hX(e=>e?.marker.line),this._onDecorationRegistered=this._register(new Q),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new Q),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(uW(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new yX(e);if(t){let e=t.marker.onDispose(()=>t.dispose()),n=t.onDispose(()=>{n.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),e.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,n){let r=0,i=0;for(let a of this._decorations.getKeyIterator(t))r=a.options.x??0,i=r+(a.options.width??1),e>=r&&e<i&&(!n||(a.options.layer??`bottom`)===n)&&(yield a)}forEachDecorationAtCell(e,t,n,r){this._decorations.forEachByKey(t,t=>{gX=t.options.x??0,_X=gX+(t.options.width??1),e>=gX&&e<_X&&(!n||(t.options.layer??`bottom`)===n)&&r(t)})}},yX=class extends fW{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new Q),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new Q),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position=`full`)}get backgroundColorRGB(){return this._cachedBg===null&&(this._cachedBg=this.options.backgroundColor?nq.toColor(this.options.backgroundColor):void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this._cachedFg=this.options.foregroundColor?nq.toColor(this.options.foregroundColor):void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},bX=1e3,xX=class{constructor(e,t=bX){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,n){this._rowCount=n,e=e===void 0?0:e,t=t===void 0?this._rowCount-1:t,this._rowStart=this._rowStart===void 0?e:Math.min(this._rowStart,e),this._rowEnd=this._rowEnd===void 0?t:Math.max(this._rowEnd,t);let r=performance.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let e=r-this._lastRefreshMs,t=this._debounceThresholdMS-e;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},t)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},SX=20,CX=class extends pW{constructor(e,t,n,r){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce=``;let i=this._coreBrowserService.mainDocument;this._accessibilityContainer=i.createElement(`div`),this._accessibilityContainer.classList.add(`xterm-accessibility`),this._rowContainer=i.createElement(`div`),this._rowContainer.setAttribute(`role`,`list`),this._rowContainer.classList.add(`xterm-accessibility-tree`),this._rowElements=[];for(let e=0;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);if(this._topBoundaryFocusListener=e=>this._handleBoundaryFocus(e,0),this._bottomBoundaryFocusListener=e=>this._handleBoundaryFocus(e,1),this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=i.createElement(`div`),this._liveRegion.classList.add(`live-region`),this._liveRegion.setAttribute(`aria-live`,`assertive`),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new xX(this._renderRows.bind(this))),!this._terminal.element)throw Error(`Cannot enable accessibility before Terminal.open`);this._terminal.element.insertAdjacentElement(`afterbegin`,this._accessibilityContainer),this._register(this._terminal.onResize(e=>this._handleResize(e.rows))),this._register(this._terminal.onRender(e=>this._refreshRows(e.start,e.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(e=>this._handleChar(e))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
280
|
+
`))),this._register(this._terminal.onA11yTab(e=>this._handleTab(e))),this._register(this._terminal.onKey(e=>this._handleKey(e.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(YG(i,`selectionchange`,()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(uW(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(` `)}_handleChar(e){this._liveRegionLineCount<SX+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
281
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===SX+1&&(this._liveRegion.textContent+=tU.get())))}_clearLiveRegion(){this._liveRegion.textContent=``,this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let i=e;i<=t;i++){let e=n.lines.get(n.ydisp+i),t=[],a=e?.translateToString(!0,void 0,void 0,t)||``,o=(n.ydisp+i+1).toString(),s=this._rowElements[i];s&&(a.length===0?(s.textContent=`\xA0`,this._rowColumns.set(s,[0,1])):(s.textContent=a,this._rowColumns.set(s,t)),s.setAttribute(`aria-posinset`,o),s.setAttribute(`aria-setsize`,r),this._alignRowWidth(s))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce=``)}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2];if(n.getAttribute(`aria-posinset`)===(t===0?`1`:`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==r)return;let i,a;if(t===0?(i=n,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(i=this._rowElements.shift(),a=n,this._rowContainer.removeChild(i)),i.removeEventListener(`focus`,this._topBoundaryFocusListener),a.removeEventListener(`focus`,this._bottomBoundaryFocusListener),t===0){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement(`afterbegin`,e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error(`anchorNode and/or focusNode are null`);return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:r.textContent?.length??0}),!this._rowContainer.contains(n.node))return;let i=({node:e,offset:t})=>{let n=e instanceof Text?e.parentNode:e,r=parseInt(n?.getAttribute(`aria-posinset`),10)-1;if(isNaN(r))return console.warn(`row is invalid. Race condition?`),null;let i=this._rowColumns.get(n);if(!i)return console.warn(`columns is null. Race condition?`),null;let a=t<i.length?i[t]:i.slice(-1)[0]+1;return a>=this._terminal.cols&&(++r,a=0),{row:r,column:a}},a=i(t),o=i(n);if(a&&o){if(a.row>o.row||a.row===o.row&&a.column>=o.column)throw Error(`invalid range`);this._terminal.select(a.column,a.row,(o.row-a.row)*this._terminal.cols-a.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener(`focus`,this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement(`div`);return e.setAttribute(`role`,`listitem`),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform=``;let t=e.getBoundingClientRect().width,n=this._rowColumns.get(e)?.slice(-1)?.[0];if(!n)return;let r=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${r/t})`}};CX=XH([ZH(1,OU),ZH(2,LU),ZH(3,zU)],CX);var wX=class extends pW{constructor(e,t,n,r,i){super(),this._element=e,this._mouseService=t,this._renderService=n,this._bufferService=r,this._linkProviderService=i,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new Q),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new Q),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(uW(()=>{cW(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(YG(this._element,`mouseleave`,()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(YG(this._element,`mousemove`,this._handleMouseMove.bind(this))),this._register(YG(this._element,`mousedown`,this._handleMouseDown.bind(this))),this._register(YG(this._element,`mouseup`,this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let n=e.composedPath();for(let e=0;e<n.length;e++){let t=n[e];if(t.classList.contains(`xterm`))break;if(t.classList.contains(`xterm-hover`))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){(!this._activeProviderReplies||!t)&&(this._activeProviderReplies?.forEach(e=>{e?.forEach(e=>{e.link.dispose&&e.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[r,i]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(r)&&(n=this._checkLinkProviderResult(r,e,n)):i.provideLinks(e.y,t=>{if(this._isMouseOut)return;let i=t?.map(e=>({link:e}));this._activeProviderReplies?.set(r,i),n=this._checkLinkProviderResult(r,e,n),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let n=new Set;for(let r=0;r<t.size;r++){let i=t.get(r);if(i)for(let t=0;t<i.length;t++){let r=i[t],a=r.link.range.start.y<e?0:r.link.range.start.x,o=r.link.range.end.y>e?this._bufferService.cols:r.link.range.end.x;for(let e=a;e<=o;e++){if(n.has(e)){i.splice(t--,1);break}n.add(e)}}}}_checkLinkProviderResult(e,t,n){if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),i=!1;for(let t=0;t<e;t++)(!this._activeProviderReplies.has(t)||this._activeProviderReplies.get(t))&&(i=!0);if(!i&&r){let e=r.find(e=>this._linkAtPosition(e.link,t));e&&(n=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let e=0;e<this._activeProviderReplies.size;e++){let r=this._activeProviderReplies.get(e)?.find(e=>this._linkAtPosition(e.link,t));if(r){n=!0,this._handleNewLink(r);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&TX(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,cW(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0||e.link.decorations.underline,pointerCursor:e.link.decorations===void 0||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:e=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&this._element.classList.toggle(`xterm-cursor-pointer`,e))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:t=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(e=>{if(!this._currentLink)return;let t=e.start===0?0:e.start+1+this._bufferService.buffer.ydisp,n=this._bufferService.buffer.ydisp+1+e.end;if(this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=n&&(this._clearCurrentLink(t,n),this._lastMouseEvent)){let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._askForLink(e,!1)}})))}_linkHover(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add(`xterm-cursor-pointer`)),t.hover&&t.hover(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,r=this._bufferService.buffer.ydisp,i=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-r-1,n.end.x,n.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(i)}_linkLeave(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove(`xterm-cursor-pointer`)),t.leave&&t.leave(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,i=t.y*this._bufferService.cols+t.x;return n<=i&&i<=r}_positionFromMouseEvent(e,t,n){let r=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,r,i){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:i}}};wX=XH([ZH(1,RU),ZH(2,zU),ZH(3,wU),ZH(4,UU)],wX);function TX(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var EX=class extends dX{constructor(e={}){super(e),this._linkifier=this._register(new mW),this.browser=Rq,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new mW),this._onCursorMove=this._register(new Q),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new Q),this.onKey=this._onKey.event,this._onRender=this._register(new Q),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new Q),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new Q),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new Q),this.onBell=this._onBell.event,this._onFocus=this._register(new Q),this._onBlur=this._register(new Q),this._onA11yCharEmitter=this._register(new Q),this._onA11yTabEmitter=this._register(new Q),this._onWillOpen=this._register(new Q),this._setup(),this._decorationService=this._instantiationService.createInstance(vX),this._instantiationService.setService(NU,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Nq),this._instantiationService.setService(UU,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(PU)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(e=>this.refresh(e?.start??0,e?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(e=>this._reportWindowsOptions(e))),this._register(this._inputHandler.onColor(e=>this._handleColorEvent(e))),this._register(xW.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(xW.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(xW.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(xW.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(e=>this._afterResize(e.cols,e.rows))),this._register(uW(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let e,n=``;switch(t.index){case 256:e=`foreground`,n=`10`;break;case 257:e=`background`,n=`11`;break;case 258:e=`cursor`,n=`12`;break;default:e=`ansi`,n=`4;`+t.index}switch(t.type){case 0:let r=tq.toColorRGB(e===`ansi`?this._themeService.colors.ansi[t.index]:this._themeService.colors[e]);this.coreService.triggerDataEvent(`${$.ESC}]${n};${YY(r)}${qK.ST}`);break;case 1:if(e===`ansi`)this._themeService.modifyColors(e=>e.ansi[t.index]=eq.toColor(...t.color));else{let n=e;this._themeService.modifyColors(e=>e[n]=eq.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(CX,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent($.ESC+`[I`),this.element.classList.add(`focus`),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value=``,this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent($.ESC+`[O`),this.element.classList.remove(`focus`),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let n=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,i=t.getWidth(n),a=this._renderService.dimensions.css.cell.width*i,o=this.buffer.y*this._renderService.dimensions.css.cell.height,s=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=s+`px`,this.textarea.style.top=o+`px`,this.textarea.style.width=a+`px`,this.textarea.style.height=r+`px`,this.textarea.style.lineHeight=r+`px`,this.textarea.style.zIndex=`-5`}_initGlobal(){this._bindKeys(),this._register(YG(this.element,`copy`,e=>{this.hasSelection()&&iU(e,this._selectionService)}));let e=e=>aU(e,this.textarea,this.coreService,this.optionsService);this._register(YG(this.textarea,`paste`,e)),this._register(YG(this.element,`paste`,e)),Hq?this._register(YG(this.element,`mousedown`,e=>{e.button===2&&cU(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(YG(this.element,`contextmenu`,e=>{cU(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Xq&&this._register(YG(this.element,`auxclick`,e=>{e.button===1&&sU(e,this.textarea,this.screenElement)}))}_bindKeys(){this._register(YG(this.textarea,`keyup`,e=>this._keyUp(e),!0)),this._register(YG(this.textarea,`keydown`,e=>this._keyDown(e),!0)),this._register(YG(this.textarea,`keypress`,e=>this._keyPress(e),!0)),this._register(YG(this.textarea,`compositionstart`,()=>this._compositionHelper.compositionstart())),this._register(YG(this.textarea,`compositionupdate`,e=>this._compositionHelper.compositionupdate(e))),this._register(YG(this.textarea,`compositionend`,()=>this._compositionHelper.compositionend())),this._register(YG(this.textarea,`input`,e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw Error(`Terminal requires a parent element.`);if(e.isConnected||this._logService.debug(`Terminal.open was called on an element that was not attached to the DOM`),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement(`div`),this.element.dir=`ltr`,this.element.classList.add(`terminal`),this.element.classList.add(`xterm`),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement(`div`),this._viewportElement.classList.add(`xterm-viewport`),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement(`div`),this.screenElement.classList.add(`xterm-screen`),this._register(YG(this.screenElement,`mousemove`,e=>this.updateCursorStyle(e))),this._helperContainer=this._document.createElement(`div`),this._helperContainer.classList.add(`xterm-helpers`),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let n=this.textarea=this._document.createElement(`textarea`);this.textarea.classList.add(`xterm-helper-textarea`),this.textarea.setAttribute(`aria-label`,$H.get()),Zq||this.textarea.setAttribute(`aria-multiline`,`false`),this.textarea.setAttribute(`autocorrect`,`off`),this.textarea.setAttribute(`autocapitalize`,`off`),this.textarea.setAttribute(`spellcheck`,`false`),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange(`disableStdin`,()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(jq,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<`u`?window.document:null)),this._instantiationService.setService(LU,this._coreBrowserService),this._register(YG(this.textarea,`focus`,e=>this._handleTextAreaFocus(e))),this._register(YG(this.textarea,`blur`,()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Dq,this._document,this._helperContainer),this._instantiationService.setService(IU,this._charSizeService),this._themeService=this._instantiationService.createInstance(FJ),this._instantiationService.setService(HU,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(cq),this._instantiationService.setService(VU,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(rJ,this.rows,this.screenElement)),this._instantiationService.setService(zU,this._renderService),this._register(this._renderService.onRenderedViewportChange(e=>this._onRender.fire(e))),this.onResize(e=>this._renderService.resize(e.cols,e.rows)),this._compositionView=this._document.createElement(`div`),this._compositionView.classList.add(`composition-view`),this._compositionHelper=this._instantiationService.createInstance(JK,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Iq),this._instantiationService.setService(RU,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(wX,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(zK,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(e=>{super.scrollLines(e,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(TJ,this.element,this.screenElement,r)),this._instantiationService.setService(BU,this._selectionService),this._register(this._selectionService.onRequestScrollLines(e=>this.scrollLines(e.amount,e.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(e=>this._renderService.handleSelectionChanged(e.start,e.end,e.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()})),this._register(xW.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(BK,this.screenElement)),this._register(YG(this.element,`mousedown`,e=>this._selectionService.handleMouseDown(e))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add(`enable-mouse-events`)):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(CX,this)),this._register(this.optionsService.onSpecificOptionChange(`screenReaderMode`,e=>this._handleScreenReaderModeOptionChange(e))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(GK,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange(`overviewRuler`,e=>{!this._overviewRulerRenderer&&e&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(GK,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(Eq,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(t){let n=e._mouseService.getMouseReportCoords(t,e.screenElement);if(!n)return!1;let r,i;switch(t.overrideType||t.type){case`mousemove`:i=32,t.buttons===void 0?(r=3,t.button!==void 0&&(r=t.button<3?t.button:3)):r=t.buttons&1?0:t.buttons&4?1:t.buttons&2?2:3;break;case`mouseup`:i=0,r=t.button<3?t.button:3;break;case`mousedown`:i=1,r=t.button<3?t.button:3;break;case`wheel`:if(e._customWheelEventHandler&&e._customWheelEventHandler(t)===!1)return!1;let n=t.deltaY;if(n===0||e.coreMouseService.consumeWheelEvent(t,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;i=n<0?0:1,r=4;break;default:return!1}return i===void 0||r===void 0||r>4?!1:e.coreMouseService.triggerMouseEvent({col:n.col,row:n.row,x:n.x,y:n.y,button:r,action:i,ctrl:t.ctrlKey,alt:t.altKey,shift:t.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},i={mouseup:e=>(n(e),e.buttons||(this._document.removeEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.removeEventListener(`mousemove`,r.mousedrag)),this.cancel(e)),wheel:e=>(n(e),this.cancel(e,!0)),mousedrag:e=>{e.buttons&&n(e)},mousemove:e=>{e.buttons||n(e)}};this._register(this.coreMouseService.onProtocolChange(e=>{e?(this.optionsService.rawOptions.logLevel===`debug`&&this._logService.debug(`Binding to mouse events:`,this.coreMouseService.explainEvents(e)),this.element.classList.add(`enable-mouse-events`),this._selectionService.disable()):(this._logService.debug(`Unbinding from mouse events.`),this.element.classList.remove(`enable-mouse-events`),this._selectionService.enable()),e&8?r.mousemove||=(t.addEventListener(`mousemove`,i.mousemove),i.mousemove):(t.removeEventListener(`mousemove`,r.mousemove),r.mousemove=null),e&16?r.wheel||=(t.addEventListener(`wheel`,i.wheel,{passive:!1}),i.wheel):(t.removeEventListener(`wheel`,r.wheel),r.wheel=null),e&2?r.mouseup||=i.mouseup:(this._document.removeEventListener(`mouseup`,r.mouseup),r.mouseup=null),e&4?r.mousedrag||=i.mousedrag:(this._document.removeEventListener(`mousemove`,r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(YG(t,`mousedown`,e=>{if(e.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(e))return n(e),r.mouseup&&this._document.addEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.addEventListener(`mousemove`,r.mousedrag),this.cancel(e)})),this._register(YG(t,`wheel`,t=>{if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(t)===!1)return!1;if(!this.buffer.hasScrollback){if(t.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(t,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(t,!0);let n=$.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?`O`:`[`)+(t.deltaY<0?`A`:`B`);return this.coreService.triggerDataEvent(n,!0),this.cancel(t,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add(`column-select`):this.element.classList.remove(`column-select`)}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){oU(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,n){this._selectionService.setSelection(e,t,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:``}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key===`Dead`||e.key===`AltGraph`)&&(this._unprocessedDeadKey=!0);let n=pX(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let t=this.rows-1;return this.scrollLines(n.type===2?-t:t),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===$.ETX||n.key===$.CR)&&(this.textarea.value=``),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let n=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState(`AltGraph`);return t.type===`keypress`?n:n&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(DX(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType===`insertText`&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){this._charSizeService?.measure()}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(GJ));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains(`focus`)?this.coreService.triggerDataEvent($.ESC+`[I`):this.coreService.triggerDataEvent($.ESC+`[O`)}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let e=this._renderService.dimensions.css.canvas.width.toFixed(0),t=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${$.ESC}[4;${t};${e}t`);break;case 1:let n=this._renderService.dimensions.css.cell.width.toFixed(0),r=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${$.ESC}[6;${r};${n}t`)}}cancel(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1}};function DX(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var wee=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let n={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(n),t.dispose=()=>this._wrappedAddonDispose(n),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){t=n;break}if(t===-1)throw Error(`Could not dispose an addon that has not been loaded`);e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},OX=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new _U)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},kX=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new OX(t)}getNullCell(){return new _U}},AX=class extends pW{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new Q),this.onBufferChange=this._onBufferChange.event,this._normal=new kX(this._core.buffers.normal,`normal`),this._alternate=new kX(this._core.buffers.alt,`alternate`),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw Error(`Active buffer is neither normal nor alternate`)}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},jX=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,e=>t(e.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(e,n)=>t(e,n.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},MX=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},NX=[`cols`,`rows`],PX=0,FX=class extends pW{constructor(e){super(),this._core=this._register(new EX(e)),this._addonManager=this._register(new wee),this._publicOptions={...this._core.options};let t=e=>this._core.options[e],n=(e,t)=>{this._checkReadonlyOptions(e),this._core.options[e]=t};for(let e in this._core.options){let r={get:t.bind(this,e),set:n.bind(this,e)};Object.defineProperty(this._publicOptions,e,r)}}_checkReadonlyOptions(e){if(NX.includes(e))throw Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw Error(`You must set the allowProposedApi option to true to use proposed API`)}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||=new jX(this._core),this._parser}get unicode(){return this._checkProposedApi(),new MX(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||=this._register(new AX(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t=`none`;switch(this._core.coreMouseService.activeProtocol){case`X10`:t=`x10`;break;case`VT200`:t=`vt200`;break;case`DRAG`:t=`drag`;break;case`ANY`:t=`any`}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,n){this._verifyIntegers(e,t,n),this._core.select(e,t,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
282
|
+
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return $H.get()},set promptLabel(e){$H.set(e)},get tooMuchOutput(){return tU.get()},set tooMuchOutput(e){tU.set(e)}}}_verifyIntegers(...e){for(PX of e)if(PX===1/0||isNaN(PX)||PX%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(PX of e)if(PX&&(PX===1/0||isNaN(PX)||PX%1!=0||PX<0))throw Error(`This API only accepts positive integers`)}},IX=2,LX=1,RX=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(IX,Math.floor(u/e.css.cell.width)),rows:Math.max(LX,Math.floor(l/e.css.cell.height))}}},zX={key:0,class:`pty-context-bar`},BX=Je(B({__name:`PtyContextBar`,setup(e){let{attachedContexts:t,removeAttachedContext:n}=Ht();return(e,i)=>r(t).length>0?(V(),P(`div`,zX,[(V(!0),P(H,null,F(r(t),(e,t)=>(V(),G(BH,{key:t,icon:e.icon,label:e.label,text:e.text,removable:``,onRemove:e=>r(n)(t)},null,8,[`icon`,`label`,`text`,`onRemove`]))),128))])):K(``,!0)}}),[[`__scopeId`,`data-v-cfcb3a01`]]);function VX(e,t){let n=e.textarea;if(!n)return()=>{};let r=!1,i=!1,a=e=>{r=e.keyCode===229||e.key===`Process`},o=()=>{i=!0},s=()=>{setTimeout(()=>{i=!1},0)},c=e=>{let a=e;r&&!i&&a.inputType===`insertText`&&a.data&&!a.isComposing?(r=!1,n.value=``,t(a.data)):a.inputType===`insertText`&&(r=!1)};return n.addEventListener(`keydown`,a,!0),n.addEventListener(`compositionstart`,o,!0),n.addEventListener(`compositionend`,s,!0),n.addEventListener(`input`,c,!0),()=>{n.removeEventListener(`keydown`,a,!0),n.removeEventListener(`compositionstart`,o,!0),n.removeEventListener(`compositionend`,s,!0),n.removeEventListener(`input`,c,!0)}}function HX(e,t,n){let[r,i]=t.row>e.row||t.row===e.row&&t.col>=e.col?[e,t]:[t,e];return{column:r.col,row:r.row,length:(i.row-r.row)*n+i.col-r.col+1}}var UX=450;async function WX(e){if(navigator.clipboard&&window.isSecureContext){await navigator.clipboard.writeText(e);return}let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),document.execCommand(`copy`),t.remove()}function GX(e,t){let n=null,r=0,i=0,a=`none`,o=0,s=0,c=0,l=null,u=null,d=!1,f={col:0,row:0},p=document.createElement(`button`);p.type=`button`,p.className=`terminal-touch-copy`,Object.assign(p.style,{position:`absolute`,top:`8px`,right:`8px`,zIndex:`5`,display:`none`,padding:`6px 12px`,border:`0`,borderRadius:`6px`,font:`inherit`,fontSize:`14px`,background:`var(--r-primary)`,color:`var(--r-primary-contrast)`}),getComputedStyle(t).position===`static`&&(t.style.position=`relative`),t.appendChild(p);function m(){p.style.display=`none`}p.addEventListener(`click`,t=>{t.preventDefault(),t.stopPropagation();let n=e.getSelection();m(),e.clearSelection(),n&&WX(n).catch(()=>{})}),p.addEventListener(`touchstart`,e=>e.stopPropagation(),{passive:!0});function h(){u!==null&&(clearTimeout(u),u=null)}function g(t,n){return x(t,n),{col:y-1,row:e.buffer.active.viewportY+b-1}}function _(t){let n=HX(f,t,e.cols);e.select(n.column,n.row,n.length)}let v=()=>{let n=e.rows||24,r=t.querySelector(`.xterm-viewport`)?.clientHeight??t.clientHeight;return r>0?r/n:17},y=1,b=1;function x(n,r){let i=t.querySelector(`.xterm-screen`);if(!i)return;let a=i.getBoundingClientRect();if(a.width<=0||a.height<=0)return;let o=Math.floor((n-a.left)/a.width*e.cols)+1,s=Math.floor((r-a.top)/a.height*e.rows)+1;y=Math.min(Math.max(o,1),e.cols),b=Math.min(Math.max(s,1),e.rows)}function S(t){let n=t>0,r=Math.min(Math.abs(t),12),i=e.modes.mouseTrackingMode===`none`?`\x1b${e.modes.applicationCursorKeysMode?`O`:`[`}${n?`B`:`A`}`:`\x1b[<${n?65:64};${y};${b}M`;for(let t=0;t<r;t+=1)e.input(i,!0)}function C(){l!==null&&(cancelAnimationFrame(l),l=null)}function w(){if(e.buffer.active.type===`alternate`||Math.abs(s)<.004)return;let t=performance.now(),n=r=>{let i=r-t;t=r,o+=s*i;let a=Math.trunc(o);a!==0&&(o-=a,e.scrollLines(a)),s*=Math.exp(-.005*i),l=Math.abs(s)<.002?null:requestAnimationFrame(n)};l=requestAnimationFrame(n)}let T=t=>{if(C(),h(),d=!1,m(),t.touches.length!==1){n=null;return}n=t.touches[0].clientY,r=t.touches[0].clientX,x(r,n),i=n,a=`none`,o=0,s=0,c=performance.now(),e.hasSelection()&&e.clearSelection();let l=r,p=i;u=setTimeout(()=>{u=null,a===`none`&&(d=!0,f=g(l,p),_(f),navigator.vibrate?.(10))},UX)},E=t=>{if(d&&t.touches.length===1){_(g(t.touches[0].clientX,t.touches[0].clientY)),t.preventDefault();return}if(n===null||t.touches.length!==1)return;let l=t.touches[0].clientY;if(a===`none`){let e=Math.abs(t.touches[0].clientX-r),o=Math.abs(l-i);if(Math.max(e,o)<8)return;if(h(),e>o){n=null;return}a=`vertical`}let u=n-l;n=l;let f=u/v(),p=performance.now(),m=p-c;c=p,m>0&&m<100&&(s=s*.7+f/m*.3),o+=f;let y=Math.trunc(o);y!==0&&(o-=y,e.buffer.active.type===`alternate`?S(y):e.scrollLines(y)),t.preventDefault()},D=t=>{if(h(),d){d=!1,t.cancelable&&t.preventDefault(),e.hasSelection()&&(p.textContent=Ce.global.t(`terminal.copySelection`),p.style.display=``),n=null;return}a===`vertical`&&w(),n=null,a=`none`};t.addEventListener(`touchstart`,T,{passive:!0}),t.addEventListener(`touchmove`,E,{passive:!1}),t.addEventListener(`touchend`,D,{passive:!1}),t.addEventListener(`touchcancel`,D,{passive:!0});let O=t=>{(d||e.hasSelection())&&t.preventDefault()};return t.addEventListener(`contextmenu`,O),()=>{C(),h(),p.remove(),t.removeEventListener(`contextmenu`,O),t.removeEventListener(`touchstart`,T),t.removeEventListener(`touchmove`,E),t.removeEventListener(`touchend`,D),t.removeEventListener(`touchcancel`,D)}}function KX(e,t){let n=e+(t>0?-1:1);return Math.min(Math.max(n,8),32)}function qX(e,t){try{let t=Number(localStorage.getItem(e));if(Number.isFinite(t)&&t>=8&&t<=32)return t}catch{}return t}function JX(e){let{terminal:t,container:n,storageKey:r,onResize:i}=e,a=e=>{if(!e.ctrlKey&&!e.metaKey)return;e.preventDefault(),e.stopPropagation();let n=KX(t.options.fontSize??14,e.deltaY);if(n!==t.options.fontSize){t.options.fontSize=n;try{localStorage.setItem(r,String(n))}catch{}i()}};return n.addEventListener(`wheel`,a,{capture:!0,passive:!1}),()=>n.removeEventListener(`wheel`,a,{capture:!0})}function YX(e,t={}){let n=t.schedule??requestAnimationFrame,r=t.cancel??cancelAnimationFrame,i=[],a=null,o=!0;function s(){if(a!==null&&(r(a),a=null),i.length===0)return;let t=i.join(``);i=[],o?(o=!1,e.write(t,()=>e.scrollToBottom())):e.write(t)}return{write(e){i.push(e),a===null&&(a=n(s))},dispose(){a!==null&&(r(a),a=null),i=[]}}}var XX=150,ZX=1.01,QX=i(!1),$X=0,eZ=0;function tZ(){let e=document.activeElement;return e?e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable:!1}var nZ=0,rZ=null;function iZ(){return typeof window>`u`?!1:window.matchMedia?.(`(pointer: coarse)`).matches?!0:(navigator.maxTouchPoints??0)>0}function aZ(e){return!e.editing||e.scale>ZX?{visible:!1}:{visible:Math.max(e.maxHeight-e.innerHeight,e.innerHeight-e.viewportHeight)>=XX}}function oZ(e=!1){let t=window.visualViewport;if(!t){QX.value=!1;return}let n=tZ();(window.innerWidth!==eZ||e&&!n)&&(eZ=window.innerWidth,$X=0),$X=Math.max($X,window.innerHeight),QX.value=aZ({innerHeight:window.innerHeight,viewportHeight:t.height,maxHeight:$X,scale:t.scale,editing:n}).visible}function sZ(){if(!iZ()||(nZ+=1,rZ))return;let e=window.visualViewport;if(!e)return;let t=()=>oZ(!0),n=()=>oZ(!1);e.addEventListener(`resize`,t),e.addEventListener(`scroll`,n),window.addEventListener(`resize`,t),document.addEventListener(`focusin`,n),document.addEventListener(`focusout`,n),rZ=()=>{e.removeEventListener(`resize`,t),e.removeEventListener(`scroll`,n),window.removeEventListener(`resize`,t),document.removeEventListener(`focusin`,n),document.removeEventListener(`focusout`,n)},oZ()}function cZ(){nZ=Math.max(0,nZ-1),!(nZ>0||!rZ)&&(rZ(),rZ=null,QX.value=!1)}function lZ(){return I(sZ),ee(cZ),{keyboardVisible:l(QX)}}var uZ=`\x1B`,dZ={up:`A`,down:`B`,right:`C`,left:`D`};function fZ(e,t){switch(e){case`up`:case`down`:case`left`:case`right`:return`${uZ}${t?`O`:`[`}${dZ[e]}`;case`esc`:return uZ;case`tab`:return` `;case`enter`:return`\r`;case`ctrl-c`:return``}}var pZ=[`aria-label`],mZ=[`title`,`aria-label`,`onPointerdown`],hZ={class:`terminal-key-bar__cap`},gZ=Je(B({__name:`TerminalKeyBar`,props:{terminal:{}},setup(e){let t=e,{t:n}=ve(),{keyboardVisible:a}=lZ(),o=iZ(),s=i(!1);function c(){let e=t.terminal?.element;s.value=e!=null&&e.contains(document.activeElement)}I(()=>{document.addEventListener(`focusin`,c),document.addEventListener(`focusout`,c),c()}),ee(()=>{document.removeEventListener(`focusin`,c),document.removeEventListener(`focusout`,c)});let l=z(()=>o&&a.value&&s.value);function u(e){return fZ(e,t.terminal?.modes.applicationCursorKeysMode===!0)}let d=z(()=>[{id:`up`,label:`↑`,title:n(`terminal.keyBar.up`)},{id:`down`,label:`↓`,title:n(`terminal.keyBar.down`)},{id:`left`,label:`←`,title:n(`terminal.keyBar.left`)},{id:`right`,label:`→`,title:n(`terminal.keyBar.right`)},{id:`esc`,label:`Esc`,title:n(`terminal.keyBar.escape`),wide:!0},{id:`tab`,label:`⇥`,title:n(`terminal.keyBar.tab`)},{id:`enter`,label:`⏎`,title:n(`terminal.keyBar.enter`)},{id:`ctrl-c`,label:`^C`,title:n(`terminal.keyBar.interrupt`),wide:!0}]);function f(e,n){n.preventDefault(),t.terminal?.input(u(e.id),!0),t.terminal?.focus()}return(e,t)=>(V(),G(le,{to:`body`},[l.value?(V(),P(`div`,{key:0,class:`terminal-key-bar`,role:`toolbar`,"aria-label":r(n)(`terminal.keyBar.label`)},[(V(!0),P(H,null,F(d.value,e=>(V(),P(`button`,{key:e.id,type:`button`,class:L([`terminal-key-bar__key`,{"terminal-key-bar__key--wide":e.wide}]),title:e.title,"aria-label":e.title,onPointerdown:t=>f(e,t)},[N(`kbd`,hZ,W(e.label),1)],42,mZ))),128))],8,pZ)):K(``,!0)]))}}),[[`__scopeId`,`data-v-4528940d`]]),_Z={key:0,class:`claude-terminal__error`},vZ=`runeya:ai-terminal-font-size`,yZ=Je(B({__name:`ClaudeTerminal`,props:{sessionId:{},resume:{type:Boolean},model:{},cwd:{},agentId:{},runner:{},attachSpawnId:{}},setup(e){let t=e,n=i(null),r=i(!1),a=i(null),o=null,c=s(null),l=null,u=null,d=null,f=null,p=null,m=null,h=null,g=null,_=null,v=null,y=null,S=-1,w=!1,T=null;function E(e){return new Promise((t,n)=>{let r=new FileReader;r.onerror=()=>n(r.error??Error(`FileReader error`)),r.onload=()=>{let e=r.result,n=e.indexOf(`,`);t(n>=0?e.slice(n+1):e)},r.readAsDataURL(e)})}async function D(e,t){if(p&&f)try{let n=await E(e),r=await J.chat.pty.pasteImage.mutate({agentId:p,sessionId:t,mimeType:e.type||`image/png`,base64:n});r.clipboardMethod?await J.chat.pty.write.mutate({agentId:p,spawnId:f,data:``}):await J.chat.pty.write.mutate({agentId:p,spawnId:f,data:`@${r.tmpPath} `})}catch(e){console.error(`[ClaudeTerminal] image paste failed:`,e)}}let{attachedContexts:O,clearAttachedContexts:k,contextServiceId:A,pendingDiffContext:j,pendingContext:M,pendingPopulateContext:F,autoSendPending:R,setDiffContext:z}=Ht(),te=Jt(),ne=Et(),B=xe();function re(){let e=[];if(A.value){let t=te.getById(A.value);t&&e.push({label:`Service: ${t.name}`,icon:`ti-server`,text:`Service attached: ${t.name}\nID: ${t.id}\nCommand: ${t.command??`(none)`}\nCwd: ${t.cwd??`(none)`}`})}j.value&&e.push({label:`Diff`,icon:`ti-code`,text:j.value}),M.value&&e.push(M.value);for(let t of O.value)e.push(t);return e}function H(){l?.fit(),p&&f&&o&&J.chat.pty.resize.mutate({agentId:p,spawnId:f,cols:o.cols,rows:o.rows}).catch(()=>{})}async function ie(){if(!n.value)return;if(await ae(),a.value=null,o=new FX({cursorBlink:!0,fontFamily:`monospace`,fontSize:qX(vZ,13),theme:{background:`#1a1b1e`,foreground:`#d4d4d4`,cursor:`#d4d4d4`},allowProposedApi:!1}),l=new RX,o.loadAddon(l),o.open(n.value),c.value=o,y=YX(o),_=GX(o,n.value),v=JX({terminal:o,container:n.value,storageKey:vZ,onResize:()=>H()}),o.attachCustomKeyEventHandler(e=>{if(e.type!==`keydown`||e.altKey||!(e.ctrlKey||e.metaKey))return!0;let t=e.key.toLowerCase();if(t===`v`)return!1;if(e.shiftKey&&t===`c`){e.preventDefault();let t=o?.getSelection();return t&&navigator.clipboard.writeText(t).catch(()=>{}),!1}return!0}),await new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(()=>e()))),l.fit(),t.attachSpawnId&&t.agentId)f=t.attachSpawnId,p=t.agentId;else try{let e=re().map(e=>({label:e.label,text:e.text})),n=R.value&&F.value?F.value:void 0,r=await J.chat.pty.start.mutate({agentId:t.agentId,sessionId:t.sessionId,runner:t.runner??`claude-code`,resume:t.resume??!1,model:t.model,cwd:t.cwd,...B.activeProjectId?{projectId:B.activeProjectId,orgId:B.activeOrgId}:{},cols:o.cols,rows:o.rows,enableMcp:!0,environmentId:ne.currentProject?.activeEnvironmentId,attachedContexts:e.length>0?e:void 0,initialPrompt:n});f=r.spawnId,p=r.agentId,!r.reattached&&n&&(R.value=!1,F.value=null),e.length>0&&(k(),z(null),M.value=null)}catch(e){w=!0,a.value=e.message,o.dispose(),o=null,c.value=null;return}d=J.chat.pty.stream.subscribe({agentId:p,spawnId:f,fromOffset:0},{onData(e){if(e.offset<=S)return;S=e.offset;let{chunk:n}=e;n.type===`pty-data`?y?.write(n.data):n.type===`exit`&&y?.write(`\r\n\x1b[90m[${t.runner===`codex`?`codex`:`claude`} exited with code ${n.code??0}]\x1b[0m\r\n`)},onError(e){w=!0,a.value=e.message}});let e=e=>{p&&f&&J.chat.pty.write.mutate({agentId:p,spawnId:f,data:e}).catch(()=>{})};o.onData(e),g=VX(o,e),u=new ResizeObserver(()=>H()),u.observe(n.value),h=o.textarea??null,h&&(m=e=>{let n=e.clipboardData?.items;if(n){for(let r of n)if(r.kind===`file`&&r.type.startsWith(`image/`)){let n=r.getAsFile();if(n){e.preventDefault(),e.stopPropagation(),D(n,t.sessionId);return}}}},h.addEventListener(`paste`,m,!0)),r.value=!0,requestAnimationFrame(()=>{requestAnimationFrame(()=>o?.focus())})}function U(){o?.focus()}async function ae(){u?.disconnect(),u=null,g?.(),g=null,_?.(),_=null,v?.(),v=null,y?.dispose(),y=null,h&&m&&h.removeEventListener(`paste`,m,!0),h=null,m=null,d?.unsubscribe(),d=null,S=-1,w=!1,p=null,f=null,o?.dispose(),o=null,c.value=null,l=null,r.value=!1}return C(()=>[t.sessionId,t.resume,t.model,t.cwd,t.agentId,t.runner],()=>{ie()}),I(()=>{ie(),T=_t(()=>{a.value=null,w&&ie()})}),ee(()=>{T?.(),T=null,ae()}),(e,t)=>(V(),P(`div`,{class:`claude-terminal`,onClick:U},[b(BX),b(gZ,{terminal:c.value},null,8,[`terminal`]),a.value?(V(),P(`div`,_Z,[t[0]||=N(`i`,{class:`ti ti-alert-triangle`},null,-1),x(` `+W(a.value),1)])):K(``,!0),N(`div`,{ref_key:`terminalEl`,ref:n,class:L([`claude-terminal__xterm`,{"claude-terminal__xterm--hidden":!r.value}])},null,2)]))}}),[[`__scopeId`,`data-v-ac25395f`]]);function bZ(e){return p()?(u(e),!0):!1}function xZ(e){return typeof e==`function`?e():r(e)}var SZ=typeof window<`u`&&typeof document<`u`,CZ=e=>e!==void 0,wZ=Object.prototype.toString,TZ=e=>wZ.call(e)===`[object Object]`,EZ=()=>{};function DZ(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return n}var OZ=e=>e();function kZ(e=OZ){let t=i(!0);function n(){t.value=!1}function r(){t.value=!0}return{isActive:l(t),pause:n,resume:r,eventFilter:(...n)=>{t.value&&e(...n)}}}function AZ(e,t=!1,n=`Timeout`){return new Promise((r,i)=>{setTimeout(t?()=>i(n):r,e)})}function jZ(e,t,n={}){let{eventFilter:r=OZ,...i}=n;return C(e,DZ(r,t),i)}function MZ(e,t,n={}){let{eventFilter:r,...i}=n,{eventFilter:a,pause:o,resume:s,isActive:c}=kZ(r);return{stop:jZ(e,t,{...i,eventFilter:a}),pause:o,resume:s,isActive:c}}function NZ(e,t={}){if(!m(e))return c(e);let n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(let r in e.value)n[r]=h(()=>({get(){return e.value[r]},set(n){if(xZ(t.replaceRef)??!0){if(Array.isArray(e.value)){let t=[...e.value];t[r]=n,e.value=t}else{let t={...e.value,[r]:n};Object.setPrototypeOf(t,Object.getPrototypeOf(e.value)),e.value=t}}else e.value[r]=n}}));return n}function PZ(e,t=!1){function n(n,{flush:r=`sync`,deep:i=!1,timeout:a,throwOnTimeout:o}={}){let s=null,c=[new Promise(a=>{s=C(e,e=>{n(e)!==t&&(s?.(),a(e))},{flush:r,deep:i,immediate:!0})})];return a!=null&&c.push(AZ(a,o).then(()=>xZ(e)).finally(()=>s?.())),Promise.race(c)}function r(r,i){if(!m(r))return n(e=>e===r,i);let{flush:a=`sync`,deep:o=!1,timeout:s,throwOnTimeout:c}=i??{},l=null,u=[new Promise(n=>{l=C([e,r],([e,r])=>{t!==(e===r)&&(l?.(),n(e))},{flush:a,deep:o,immediate:!0})})];return s!=null&&u.push(AZ(s,c).then(()=>xZ(e)).finally(()=>(l?.(),xZ(e)))),Promise.race(u)}function i(e){return n(e=>!!e,e)}function a(e){return r(null,e)}function o(e){return r(void 0,e)}function s(e){return n(Number.isNaN,e)}function c(e,t){return n(t=>{let n=Array.from(t);return n.includes(e)||n.includes(xZ(e))},t)}function l(e){return u(1,e)}function u(e=1,t){let r=-1;return n(()=>(r+=1,r>=e),t)}return Array.isArray(xZ(e))?{toMatch:n,toContains:c,changed:l,changedTimes:u,get not(){return PZ(e,!t)}}:{toMatch:n,toBe:r,toBeTruthy:i,toBeNull:a,toBeNaN:s,toBeUndefined:o,changed:l,changedTimes:u,get not(){return PZ(e,!t)}}}function FZ(e){return PZ(e)}function IZ(e){let t=xZ(e);return t?.$el??t}var LZ=SZ?window:void 0;function RZ(...e){let t,n,r,i;if(typeof e[0]==`string`||Array.isArray(e[0])?([n,r,i]=e,t=LZ):[t,n,r,i]=e,!t)return EZ;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);let a=[],o=()=>{a.forEach(e=>e()),a.length=0},s=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),c=C(()=>[IZ(t),xZ(i)],([e,t])=>{if(o(),!e)return;let i=TZ(t)?{...t}:t;a.push(...n.flatMap(t=>r.map(n=>s(e,t,n,i))))},{immediate:!0,flush:`post`}),l=()=>{c(),o()};return bZ(l),l}function zZ(e){return typeof e==`function`?e:typeof e==`string`?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function BZ(...e){let t,n,r={};e.length===3?(t=e[0],n=e[1],r=e[2]):e.length===2?typeof e[1]==`object`?(t=!0,n=e[0],r=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);let{target:i=LZ,eventName:a=`keydown`,passive:o=!1,dedupe:s=!1}=r,c=zZ(t);return RZ(i,a,e=>{e.repeat&&xZ(s)||c(e)&&n(e)},o)}function VZ(e){return JSON.parse(JSON.stringify(e))}function HZ(e,t,n,r={}){let{clone:a=!1,passive:o=!1,eventName:s,deep:c=!1,defaultValue:l,shouldEmit:u}=r,d=T(),f=n||d?.emit||(d?.$emit)?.bind(d)||(d?.proxy?.$emit)?.bind(d?.proxy),p=s;t||=`modelValue`,p||=`update:${t.toString()}`;let m=e=>a?typeof a==`function`?a(e):VZ(e):e,h=()=>CZ(e[t])?m(e[t]):l,g=e=>{u?u(e)&&f(p,e):f(p,e)};if(o){let n=h(),r=i(n),a=!1;return C(()=>e[t],e=>{a||(a=!0,r.value=m(e),ce(()=>a=!1))}),C(r,n=>{!a&&(n!==e[t]||c)&&g(n)},{deep:c}),r}return z({get(){return h()},set(e){g(e)}})}var UZ={value:()=>{}};function WZ(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new GZ(n)}function GZ(e){this._=e}function KZ(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}GZ.prototype=WZ.prototype={constructor:GZ,on:function(e,t){var n=this._,r=KZ(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=qZ(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=JZ(n[i],e.name,t);else if(t==null)for(i in n)n[i]=JZ(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new GZ(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function qZ(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function JZ(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=UZ,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var YZ=`http://www.w3.org/1999/xhtml`,XZ={svg:`http://www.w3.org/2000/svg`,xhtml:YZ,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function ZZ(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),XZ.hasOwnProperty(t)?{space:XZ[t],local:e}:e}function QZ(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===YZ&&t.documentElement.namespaceURI===YZ?t.createElement(e):t.createElementNS(n,e)}}function $Z(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function eQ(e){var t=ZZ(e);return(t.local?$Z:QZ)(t)}function tQ(){}function nQ(e){return e==null?tQ:function(){return this.querySelector(e)}}function rQ(e){typeof e!=`function`&&(e=nQ(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new G$(r,this._parents)}function iQ(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function aQ(){return[]}function oQ(e){return e==null?aQ:function(){return this.querySelectorAll(e)}}function sQ(e){return function(){return iQ(e.apply(this,arguments))}}function cQ(e){e=typeof e==`function`?sQ(e):oQ(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new G$(r,i)}function lQ(e){return function(){return this.matches(e)}}function uQ(e){return function(t){return t.matches(e)}}var dQ=Array.prototype.find;function fQ(e){return function(){return dQ.call(this.children,e)}}function pQ(){return this.firstElementChild}function mQ(e){return this.select(e==null?pQ:fQ(typeof e==`function`?e:uQ(e)))}var hQ=Array.prototype.filter;function gQ(){return Array.from(this.children)}function _Q(e){return function(){return hQ.call(this.children,e)}}function vQ(e){return this.selectAll(e==null?gQ:_Q(typeof e==`function`?e:uQ(e)))}function yQ(e){typeof e!=`function`&&(e=lQ(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new G$(r,this._parents)}function bQ(e){return Array(e.length)}function xQ(){return new G$(this._enter||this._groups.map(bQ),this._parents)}function SQ(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}SQ.prototype={constructor:SQ,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function CQ(e){return function(){return e}}function wQ(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new SQ(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function TQ(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new SQ(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function EQ(e){return e.__data__}function DQ(e,t){if(!arguments.length)return Array.from(this,EQ);var n=t?TQ:wQ,r=this._parents,i=this._groups;typeof e!=`function`&&(e=CQ(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=OQ(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new G$(o,r),o._enter=s,o._exit=c,o}function OQ(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function kQ(){return new G$(this._exit||this._groups.map(bQ),this._parents)}function AQ(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function jQ(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new G$(s,this._parents)}function MQ(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function NQ(e){e||=PQ;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new G$(i,this._parents).order()}function PQ(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function FQ(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function IQ(){return Array.from(this)}function LQ(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function RQ(){let e=0;for(let t of this)++e;return e}function zQ(){return!this.node()}function BQ(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function VQ(e){return function(){this.removeAttribute(e)}}function HQ(e){return function(){this.removeAttributeNS(e.space,e.local)}}function UQ(e,t){return function(){this.setAttribute(e,t)}}function WQ(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function GQ(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function KQ(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function qQ(e,t){var n=ZZ(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?HQ:VQ:typeof t==`function`?n.local?KQ:GQ:n.local?WQ:UQ)(n,t))}function JQ(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function YQ(e){return function(){this.style.removeProperty(e)}}function XQ(e,t,n){return function(){this.style.setProperty(e,t,n)}}function ZQ(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function QQ(e,t,n){return arguments.length>1?this.each((t==null?YQ:typeof t==`function`?ZQ:XQ)(e,t,n??``)):$Q(this.node(),e)}function $Q(e,t){return e.style.getPropertyValue(t)||JQ(e).getComputedStyle(e,null).getPropertyValue(t)}function e$(e){return function(){delete this[e]}}function t$(e,t){return function(){this[e]=t}}function n$(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function r$(e,t){return arguments.length>1?this.each((t==null?e$:typeof t==`function`?n$:t$)(e,t)):this.node()[e]}function i$(e){return e.trim().split(/^|\s+/)}function a$(e){return e.classList||new o$(e)}function o$(e){this._node=e,this._names=i$(e.getAttribute(`class`)||``)}o$.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function s$(e,t){for(var n=a$(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function c$(e,t){for(var n=a$(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function l$(e){return function(){s$(this,e)}}function u$(e){return function(){c$(this,e)}}function d$(e,t){return function(){(t.apply(this,arguments)?s$:c$)(this,e)}}function f$(e,t){var n=i$(e+``);if(arguments.length<2){for(var r=a$(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?d$:t?l$:u$)(n,t))}function p$(){this.textContent=``}function m$(e){return function(){this.textContent=e}}function h$(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function g$(e){return arguments.length?this.each(e==null?p$:(typeof e==`function`?h$:m$)(e)):this.node().textContent}function _$(){this.innerHTML=``}function v$(e){return function(){this.innerHTML=e}}function y$(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function b$(e){return arguments.length?this.each(e==null?_$:(typeof e==`function`?y$:v$)(e)):this.node().innerHTML}function x$(){this.nextSibling&&this.parentNode.appendChild(this)}function S$(){return this.each(x$)}function C$(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function w$(){return this.each(C$)}function T$(e){var t=typeof e==`function`?e:eQ(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function E$(){return null}function D$(e,t){var n=typeof e==`function`?e:eQ(e),r=t==null?E$:typeof t==`function`?t:nQ(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function O$(){var e=this.parentNode;e&&e.removeChild(this)}function k$(){return this.each(O$)}function A$(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function j$(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function M$(e){return this.select(e?j$:A$)}function N$(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function P$(e){return function(t){e.call(this,t,this.__data__)}}function F$(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function I$(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function L$(e,t,n){return function(){var r=this.__on,i,a=P$(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function R$(e,t,n){var r=F$(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?L$:I$,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function z$(e,t,n){var r=JQ(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function B$(e,t){return function(){return z$(this,e,t)}}function V$(e,t){return function(){return z$(this,e,t.apply(this,arguments))}}function H$(e,t){return this.each((typeof t==`function`?V$:B$)(e,t))}function*U$(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var W$=[null];function G$(e,t){this._groups=e,this._parents=t}function K$(){return new G$([[document.documentElement]],W$)}function q$(){return this}G$.prototype=K$.prototype={constructor:G$,select:rQ,selectAll:cQ,selectChild:mQ,selectChildren:vQ,filter:yQ,data:DQ,enter:xQ,exit:kQ,join:AQ,merge:jQ,selection:q$,order:MQ,sort:NQ,call:FQ,nodes:IQ,node:LQ,size:RQ,empty:zQ,each:BQ,attr:qQ,style:QQ,property:r$,classed:f$,text:g$,html:b$,raise:S$,lower:w$,append:T$,insert:D$,remove:k$,clone:M$,datum:N$,on:R$,dispatch:H$,[Symbol.iterator]:U$};function J$(e){return typeof e==`string`?new G$([[document.querySelector(e)]],[document.documentElement]):new G$([[e]],W$)}function Y$(e){let t;for(;t=e.sourceEvent;)e=t;return e}function X$(e,t){if(e=Y$(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var Z$={passive:!1},Q$={capture:!0,passive:!1};function $$(e){e.stopImmediatePropagation()}function e1(e){e.preventDefault(),e.stopImmediatePropagation()}function t1(e){var t=e.document.documentElement,n=J$(e).on(`dragstart.drag`,e1,Q$);`onselectstart`in t?n.on(`selectstart.drag`,e1,Q$):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function n1(e,t){var n=e.document.documentElement,r=J$(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,e1,Q$),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var r1=e=>()=>e;function i1(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}i1.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function a1(e){return!e.ctrlKey&&!e.button}function o1(){return this.parentNode}function s1(e,t){return t??{x:e.x,y:e.y}}function c1(){return navigator.maxTouchPoints||`ontouchstart`in this}function l1(){var e=a1,t=o1,n=s1,r=c1,i={},a=WZ(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,Z$).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(J$(n.view).on(`mousemove.drag`,m,Q$).on(`mouseup.drag`,h,Q$),t1(n.view),$$(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(e1(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){J$(e.view).on(`mousemove.drag mouseup.drag`,null),n1(e.view,l),e1(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&($$(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(e1(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&($$(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=X$(l||r,t),p,m,h;if((h=n.call(e,new i1(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=X$(l||a,t),_=o}u.call(r,e,new i1(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:r1(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:r1(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:r1(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:r1(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function u1(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function d1(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function f1(){}var p1=.7,m1=1/p1,h1=`\\s*([+-]?\\d+)\\s*`,g1=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,_1=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,v1=/^#([0-9a-f]{3,8})$/,y1=RegExp(`^rgb\\(${h1},${h1},${h1}\\)$`),b1=RegExp(`^rgb\\(${_1},${_1},${_1}\\)$`),x1=RegExp(`^rgba\\(${h1},${h1},${h1},${g1}\\)$`),S1=RegExp(`^rgba\\(${_1},${_1},${_1},${g1}\\)$`),C1=RegExp(`^hsl\\(${g1},${_1},${_1}\\)$`),w1=RegExp(`^hsla\\(${g1},${_1},${_1},${g1}\\)$`),T1={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};u1(f1,A1,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:E1,formatHex:E1,formatHex8:D1,formatHsl:O1,formatRgb:k1,toString:k1});function E1(){return this.rgb().formatHex()}function D1(){return this.rgb().formatHex8()}function O1(){return U1(this).formatHsl()}function k1(){return this.rgb().formatRgb()}function A1(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=v1.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?j1(t):n===3?new F1(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?M1(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?M1(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=y1.exec(e))?new F1(t[1],t[2],t[3],1):(t=b1.exec(e))?new F1(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=x1.exec(e))?M1(t[1],t[2],t[3],t[4]):(t=S1.exec(e))?M1(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=C1.exec(e))?H1(t[1],t[2]/100,t[3]/100,1):(t=w1.exec(e))?H1(t[1],t[2]/100,t[3]/100,t[4]):T1.hasOwnProperty(e)?j1(T1[e]):e===`transparent`?new F1(NaN,NaN,NaN,0):null}function j1(e){return new F1(e>>16&255,e>>8&255,e&255,1)}function M1(e,t,n,r){return r<=0&&(e=t=n=NaN),new F1(e,t,n,r)}function N1(e){return e instanceof f1||(e=A1(e)),e?(e=e.rgb(),new F1(e.r,e.g,e.b,e.opacity)):new F1}function P1(e,t,n,r){return arguments.length===1?N1(e):new F1(e,t,n,r??1)}function F1(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}u1(F1,P1,d1(f1,{brighter(e){return e=e==null?m1:m1**+e,new F1(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?p1:p1**+e,new F1(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new F1(B1(this.r),B1(this.g),B1(this.b),z1(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:I1,formatHex:I1,formatHex8:L1,formatRgb:R1,toString:R1}));function I1(){return`#${V1(this.r)}${V1(this.g)}${V1(this.b)}`}function L1(){return`#${V1(this.r)}${V1(this.g)}${V1(this.b)}${V1((isNaN(this.opacity)?1:this.opacity)*255)}`}function R1(){let e=z1(this.opacity);return`${e===1?`rgb(`:`rgba(`}${B1(this.r)}, ${B1(this.g)}, ${B1(this.b)}${e===1?`)`:`, ${e})`}`}function z1(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function B1(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function V1(e){return e=B1(e),(e<16?`0`:``)+e.toString(16)}function H1(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new G1(e,t,n,r)}function U1(e){if(e instanceof G1)return new G1(e.h,e.s,e.l,e.opacity);if(e instanceof f1||(e=A1(e)),!e)return new G1;if(e instanceof G1)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new G1(o,s,c,e.opacity)}function W1(e,t,n,r){return arguments.length===1?U1(e):new G1(e,t,n,r??1)}function G1(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}u1(G1,W1,d1(f1,{brighter(e){return e=e==null?m1:m1**+e,new G1(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?p1:p1**+e,new G1(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new F1(J1(e>=240?e-240:e+120,i,r),J1(e,i,r),J1(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new G1(K1(this.h),q1(this.s),q1(this.l),z1(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=z1(this.opacity);return`${e===1?`hsl(`:`hsla(`}${K1(this.h)}, ${q1(this.s)*100}%, ${q1(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function K1(e){return e=(e||0)%360,e<0?e+360:e}function q1(e){return Math.max(0,Math.min(1,e||0))}function J1(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var Y1=e=>()=>e;function X1(e,t){return function(n){return e+n*t}}function Z1(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Q1(e){return(e=+e)==1?$1:function(t,n){return n-t?Z1(t,n,e):Y1(isNaN(t)?n:t)}}function $1(e,t){var n=t-e;return n?X1(e,n):Y1(isNaN(e)?t:e)}var e0=function e(t){var n=Q1(t);function r(e,t){var r=n((e=P1(e)).r,(t=P1(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=$1(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r}(1);function t0(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function n0(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function r0(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=f0(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function i0(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function a0(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function o0(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=f0(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var s0=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,c0=new RegExp(s0.source,`g`);function l0(e){return function(){return e}}function u0(e){return function(t){return e(t)+``}}function d0(e,t){var n=s0.lastIndex=c0.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=s0.exec(e))&&(i=c0.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:a0(r,i)})),n=c0.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?u0(c[0].x):l0(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function f0(e,t){var n=typeof t,r;return t==null||n===`boolean`?Y1(t):(n===`number`?a0:n===`string`?(r=A1(t))?(t=r,e0):d0:t instanceof A1?e0:t instanceof Date?i0:n0(t)?t0:Array.isArray(t)?r0:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?o0:a0)(e,t)}var p0=180/Math.PI,m0={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function h0(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*p0,skewX:Math.atan(c)*p0,scaleX:o,scaleY:s}}var g0;function _0(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?m0:h0(t.a,t.b,t.c,t.d,t.e,t.f)}function v0(e){return e==null||(g0||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),g0.setAttribute(`transform`,e),!(e=g0.transform.baseVal.consolidate()))?m0:(e=e.matrix,h0(e.a,e.b,e.c,e.d,e.e,e.f))}function y0(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:a0(e,i)},{i:c-2,x:a0(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:a0(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:a0(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:a0(e,n)},{i:s-2,x:a0(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var b0=y0(_0,`px, `,`px)`,`deg)`),x0=y0(v0,`, `,`)`,`)`),S0=1e-12;function C0(e){return((e=Math.exp(e))+1/e)/2}function w0(e){return((e=Math.exp(e))-1/e)/2}function T0(e){return((e=Math.exp(2*e))-1)/(e+1)}var E0=function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<S0)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=C0(y),c=s/(n*g)*(i*T0(t*r+y)-w0(y));return[a+c*d,o+c*f,s*i/C0(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i}(Math.SQRT2,2,4),D0=0,O0=0,k0=0,A0=1e3,j0,M0,N0=0,P0=0,F0=0,I0=typeof performance==`object`&&performance.now?performance:Date,L0=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function R0(){return P0||=(L0(z0),I0.now()+F0)}function z0(){P0=0}function B0(){this._call=this._time=this._next=null}B0.prototype=V0.prototype={constructor:B0,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?R0():+n)+(t==null?0:+t),!this._next&&M0!==this&&(M0?M0._next=this:j0=this,M0=this),this._call=e,this._time=n,K0()},stop:function(){this._call&&(this._call=null,this._time=1/0,K0())}};function V0(e,t,n){var r=new B0;return r.restart(e,t,n),r}function H0(){R0(),++D0;for(var e=j0,t;e;)(t=P0-e._time)>=0&&e._call.call(void 0,t),e=e._next;--D0}function U0(){P0=(N0=I0.now())+F0,D0=O0=0;try{H0()}finally{D0=0,G0(),P0=0}}function W0(){var e=I0.now(),t=e-N0;t>A0&&(F0-=t,N0=e)}function G0(){for(var e,t=j0,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:j0=n);M0=e,K0(r)}function K0(e){D0||(O0&&=clearTimeout(O0),e-P0>24?(e<1/0&&(O0=setTimeout(U0,e-I0.now()-F0)),k0&&=clearInterval(k0)):(k0||=(N0=I0.now(),setInterval(W0,A0)),D0=1,L0(U0)))}function q0(e,t,n){var r=new B0;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var J0=WZ(`start`,`end`,`cancel`,`interrupt`),Y0=[],X0=0,Z0=1,Q0=2,$0=3,e2=4,t2=5,n2=6;function r2(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;s2(e,n,{name:t,index:r,group:i,on:J0,tween:Y0,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:X0})}function i2(e,t){var n=o2(e,t);if(n.state>X0)throw Error(`too late; already scheduled`);return n}function a2(e,t){var n=o2(e,t);if(n.state>$0)throw Error(`too late; already running`);return n}function o2(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function s2(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=V0(a,0,n.time);function a(e){n.state=Z0,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==Z0)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===$0)return q0(o);f.state===e2?(f.state=n2,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=n2,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(q0(function(){n.state===$0&&(n.state=e2,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=Q0,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===Q0){for(n.state=$0,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=t2,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===t2&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=n2,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function c2(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>Q0&&r.state<t2,r.state=n2,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function l2(e){return this.each(function(){c2(this,e)})}function u2(e,t){var n,r;return function(){var i=a2(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function d2(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=a2(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function f2(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=o2(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?u2:d2)(n,e,t))}function p2(e,t,n){var r=e._id;return e.each(function(){var e=a2(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return o2(e,r).value[t]}}function m2(e,t){var n;return(typeof t==`number`?a0:t instanceof A1?e0:(n=A1(t))?(t=n,e0):d0)(e,t)}function h2(e){return function(){this.removeAttribute(e)}}function g2(e){return function(){this.removeAttributeNS(e.space,e.local)}}function _2(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function v2(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function y2(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function b2(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function x2(e,t){var n=ZZ(e),r=n===`transform`?x0:m2;return this.attrTween(e,typeof t==`function`?(n.local?b2:y2)(n,r,p2(this,`attr.`+e,t)):t==null?(n.local?g2:h2)(n):(n.local?v2:_2)(n,r,t))}function S2(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function C2(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function w2(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&C2(e,i)),n}return i._value=t,i}function T2(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&S2(e,i)),n}return i._value=t,i}function E2(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=ZZ(e);return this.tween(n,(r.local?w2:T2)(r,t))}function D2(e,t){return function(){i2(this,e).delay=+t.apply(this,arguments)}}function O2(e,t){return t=+t,function(){i2(this,e).delay=t}}function k2(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?D2:O2)(t,e)):o2(this.node(),t).delay}function A2(e,t){return function(){a2(this,e).duration=+t.apply(this,arguments)}}function j2(e,t){return t=+t,function(){a2(this,e).duration=t}}function M2(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?A2:j2)(t,e)):o2(this.node(),t).duration}function N2(e,t){if(typeof t!=`function`)throw Error();return function(){a2(this,e).ease=t}}function P2(e){var t=this._id;return arguments.length?this.each(N2(t,e)):o2(this.node(),t).ease}function F2(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();a2(this,e).ease=n}}function I2(e){if(typeof e!=`function`)throw Error();return this.each(F2(this._id,e))}function L2(e){typeof e!=`function`&&(e=lQ(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new f4(r,this._parents,this._name,this._id)}function R2(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new f4(o,this._parents,this._name,this._id)}function z2(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function B2(e,t,n){var r,i,a=z2(t)?i2:a2;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function V2(e,t){var n=this._id;return arguments.length<2?o2(this.node(),n).on.on(e):this.each(B2(n,e,t))}function H2(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function U2(){return this.on(`end.remove`,H2(this._id))}function W2(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=nQ(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,r2(l[f],t,n,f,l,o2(u,n)));return new f4(a,this._parents,t,n)}function G2(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=oQ(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=o2(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&r2(p,t,n,h,f,m);a.push(f),o.push(u)}return new f4(a,o,t,n)}var K2=K$.prototype.constructor;function q2(){return new K2(this._groups,this._parents)}function J2(e,t){var n,r,i;return function(){var a=$Q(this,e),o=(this.style.removeProperty(e),$Q(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Y2(e){return function(){this.style.removeProperty(e)}}function X2(e,t,n){var r,i=n+``,a;return function(){var o=$Q(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function Z2(e,t,n){var r,i,a;return function(){var o=$Q(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),$Q(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function Q2(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=a2(this,e),l=c.on,u=c.value[a]==null?s||=Y2(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function $2(e,t,n){var r=(e+=``)==`transform`?b0:m2;return t==null?this.styleTween(e,J2(e,r)).on(`end.style.`+e,Y2(e)):typeof t==`function`?this.styleTween(e,Z2(e,r,p2(this,`style.`+e,t))).each(Q2(this._id,e)):this.styleTween(e,X2(e,r,t),n).on(`end.style.`+e,null)}function e4(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function t4(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&e4(e,a,n)),r}return a._value=t,a}function n4(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,t4(e,t,n??``))}function r4(e){return function(){this.textContent=e}}function i4(e){return function(){var t=e(this);this.textContent=t??``}}function a4(e){return this.tween(`text`,typeof e==`function`?i4(p2(this,`text`,e)):r4(e==null?``:e+``))}function o4(e){return function(t){this.textContent=e.call(this,t)}}function s4(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&o4(r)),t}return r._value=e,r}function c4(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,s4(e))}function l4(){for(var e=this._name,t=this._id,n=p4(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=o2(c,t);r2(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new f4(r,this._parents,e,n)}function u4(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=a2(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var d4=0;function f4(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function p4(){return++d4}var m4=K$.prototype;f4.prototype={constructor:f4,select:W2,selectAll:G2,selectChild:m4.selectChild,selectChildren:m4.selectChildren,filter:L2,merge:R2,selection:q2,transition:l4,call:m4.call,nodes:m4.nodes,node:m4.node,size:m4.size,empty:m4.empty,each:m4.each,on:V2,attr:x2,attrTween:E2,style:$2,styleTween:n4,text:a4,textTween:c4,remove:U2,tween:f2,delay:k2,duration:M2,ease:P2,easeVarying:I2,end:u4,[Symbol.iterator]:m4[Symbol.iterator]};function h4(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var g4={time:null,delay:0,duration:250,ease:h4};function _4(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function v4(e){var t,n;e instanceof f4?(t=e._id,e=e._name):(t=p4(),(n=g4).time=R0(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&r2(c,e,t,l,o,n||_4(c,t));return new f4(r,this._parents,e,t)}K$.prototype.interrupt=l2,K$.prototype.transition=v4;var y4=e=>()=>e;function b4(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function x4(e,t,n){this.k=e,this.x=t,this.y=n}x4.prototype={constructor:x4,scale:function(e){return e===1?this:new x4(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new x4(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var S4=new x4(1,0,0);x4.prototype;function C4(e){e.stopImmediatePropagation()}function w4(e){e.preventDefault(),e.stopImmediatePropagation()}function T4(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function E4(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function D4(){return this.__zoom||S4}function O4(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function k4(){return navigator.maxTouchPoints||`ontouchstart`in this}function A4(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function j4(){var e=T4,t=E4,n=A4,r=O4,i=k4,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=E0,l=WZ(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,D4).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,D4),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(S4.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new x4(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new x4(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new x4(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=J$(this.that).datum();l.call(e,this.that,new b4(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=X$(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],c2(this),s.start();w4(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=J$(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=X$(t,i),l=t.clientX,u=t.clientY;t1(t.view),C4(t),a.mouse=[c,this.__zoom.invert(c)],c2(this),a.start();function d(e){if(w4(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=X$(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),n1(e.view,a.moved),w4(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=X$(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);w4(r),s>0?J$(this).transition().duration(s).call(x,d,c,r):J$(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(C4(t),s=0;s<i;++s)c=r[s],l=X$(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),c2(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(w4(e),s=0;s<a;++s)c=i[s],l=X$(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(C4(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=X$(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=J$(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:y4(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:y4(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:y4(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:y4([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var M4=(e=>(e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`,e))(M4||{}),N4=(e=>(e.Partial=`partial`,e.Full=`full`,e))(N4||{}),P4=(e=>(e.Bezier=`default`,e.SimpleBezier=`simple-bezier`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e))(P4||{}),F4=(e=>(e.Strict=`strict`,e.Loose=`loose`,e))(F4||{}),I4=(e=>(e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`,e))(I4||{}),L4=(e=>(e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`,e))(L4||{}),R4=(e=>(e.TopLeft=`top-left`,e.TopCenter=`top-center`,e.TopRight=`top-right`,e.BottomLeft=`bottom-left`,e.BottomCenter=`bottom-center`,e.BottomRight=`bottom-right`,e))(R4||{}),z4=[`INPUT`,`SELECT`,`TEXTAREA`],B4=typeof document<`u`?document:null;function V4(e){let t=e.composedPath?.call(e)?.[0]||e.target,n=typeof t?.hasAttribute==`function`&&t.hasAttribute(`contenteditable`),r=typeof t?.closest==`function`?t.closest(`.nokey`):null;return z4.includes(t?.nodeName)||n||!!r}function H4(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function U4(e,t,n,r){let i=t.replace(`+`,`
|
|
283
|
+
`).replace(`
|
|
284
|
+
|
|
285
|
+
`,`
|
|
286
|
+
+`).split(`
|
|
287
|
+
`).map(e=>e.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();r||n.add(e.toLowerCase());let a=i.every((e,t)=>n.has(e)&&Array.from(n.values())[t]===i[t]);return r&&n.delete(e.toLowerCase()),a}function W4(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=G4(n.code,e);return Array.isArray(e)?e.some(e=>U4(n[r],e,t,n.type===`keyup`)):U4(n[r],e,t,n.type===`keyup`)}}function G4(e,t){return t.includes(e)?`code`:`key`}function K4(e,t){let n=z(()=>a(t?.target)??B4),r=s(a(e)===!0),i=!1,o=new Set,c=u(a(e));C(()=>a(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&l(),c=u(e)},{immediate:!0}),RZ([`blur`,`contextmenu`],l),BZ((...e)=>c(...e),e=>{let n=a(t?.actInsideInputWithModifier)??!0,o=a(t?.preventDefault)??!1;if(i=H4(e),(!i||i&&!n)&&V4(e))return;let s=e.composedPath?.call(e)?.[0]||e.target,c=s?.nodeName===`BUTTON`||s?.nodeName===`A`;!o&&(i||!c)&&e.preventDefault(),r.value=!0},{eventName:`keydown`,target:n}),BZ((...e)=>c(...e),e=>{let n=a(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&V4(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function l(){i=!1,o.clear(),r.value=a(e)===!0}function u(e){return e===null?(l(),()=>!1):typeof e==`boolean`?(l(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?W4(e,o):e}return r}var q4=`vue-flow__node-desc`,J4=`vue-flow__edge-desc`,Y4=`vue-flow__aria-live`,X4=[`Enter`,` `,`Escape`],Z4={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function Q4(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function $4(e,t){let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)}function e3(e){return{width:e.offsetWidth,height:e.offsetHeight}}function t3(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function n3(e,t){return{x:t3(e.x,t[0][0],t[1][0]),y:t3(e.y,t[0][1],t[1][1])}}function r3(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function i3(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function a3(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!i3(e)}function o3(e){return a3(e)&&`computedPosition`in e}function s3(e){return!Number.isNaN(e)&&Number.isFinite(e)}function c3(e){return s3(e.width)&&s3(e.height)&&s3(e.x)&&s3(e.y)}function l3(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:f({width:0,height:0}),computedPosition:f({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:D6(e.data)?e.data:{},events:f(D6(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function u3(e,t,n){let r={id:e.id.toString(),type:e.type??t?.type??`default`,source:e.source.toString(),target:e.target.toString(),sourceHandle:e.sourceHandle?.toString(),targetHandle:e.targetHandle?.toString(),updatable:e.updatable??n?.updatable,selectable:e.selectable??n?.selectable,focusable:e.focusable??n?.focusable,data:D6(e.data)?e.data:{},events:f(D6(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function d3(e,t,n,r){let i=typeof e==`string`?e:e.id,a=new Set,o=r===`source`?`target`:`source`;for(let e of n)e[o]===i&&a.add(e[r]);return t.filter(e=>a.has(e.id))}function f3(...e){if(e.length===3){let[t,n,r]=e;return d3(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>i3(e)&&e.source===r).map(e=>n.find(t=>a3(t)&&t.id===e.target))}function p3(...e){if(e.length===3){let[t,n,r]=e;return d3(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>i3(e)&&e.target===r).map(e=>n.find(t=>a3(t)&&t.id===e.source))}function m3({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function h3(e,t){return t.some(t=>i3(t)&&t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle))}function g3({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function _3({x:e,y:t},{x:n,y:r,zoom:i},a=!1,o=[1,1]){let s={x:(e-n)/i,y:(t-r)/i};return a?u6(s,o):s}function v3(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function y3({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function b3({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function x3(e,t){return b3(v3(y3(e),y3(t)))}function S3(e){let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0};for(let n=0;n<e.length;n++){let r=e[n];t=v3(t,y3({...r.computedPosition,...r.dimensions}))}return b3(t)}function C3(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={..._3(t,n),width:t.width/n.zoom,height:t.height/n.zoom},o=[];for(let t of e){let{dimensions:e,selectable:n=!0,hidden:s=!1}=t,c=e.width??t.width??null,l=e.height??t.height??null;if(i&&!n||s)continue;let u=$4(a,Q4(t)),d=c===null||l===null,f=r&&u>0,p=(c??0)*(l??0);(d||f||u>=p||t.dragging)&&o.push(t)}return o}function w3(e,t){let n=new Set;if(typeof e==`string`)n.add(e);else if(e.length>=1)for(let t of e)n.add(t.id);return t.filter(e=>n.has(e.source)||n.has(e.target))}function T3(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=Number.parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=Number.parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return C6(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function E3(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=T3(e,n),i=T3(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=T3(e.top??e.y??0,n),i=T3(e.bottom??e.y??0,n),a=T3(e.left??e.x??0,t),o=T3(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function D3(e,t,n,r,i,a){let{x:o,y:s}=g3(e,{x:t,y:n,zoom:r}),{x:c,y:l}=g3({x:e.x+e.width,y:e.y+e.height},{x:t,y:n,zoom:r}),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}function O3(e,t,n,r,i,a=.1){let o=E3(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=t3(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=D3(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}}function k3(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function A3(e,t){if(!e.parentNode)return!1;let n=t.get(e.parentNode);return n?n.selected?!0:A3(n,t):!1}function j3(e,t){return e===void 0?``:typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`}function M3(e){let t=e.ctrlKey&&c6()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t}function N3(e,t,n){return e<t?t3(Math.abs(e-t),1,t)/t:e>n?-t3(Math.abs(e-n),1,t)/t:0}function P3(e,t,n=15,r=40){return[N3(e.x,r,t.width-r)*n,N3(e.y,r,t.height-r)*n]}function F3(e,t){if(t){let n=e.position.x+e.dimensions.width-t.dimensions.width,r=e.position.y+e.dimensions.height-t.dimensions.height;if(n>0||r>0||e.position.x<0||e.position.y<0){let i={};if(typeof t.style==`function`?i={...t.style(t)}:t.style&&(i={...t.style}),i.width=i.width??`${t.dimensions.width}px`,i.height=i.height??`${t.dimensions.height}px`,n>0){if(typeof i.width==`string`){let e=Number(i.width.replace(`px`,``));i.width=`${e+n}px`}else i.width+=n}if(r>0){if(typeof i.height==`string`){let e=Number(i.height.replace(`px`,``));i.height=`${e+r}px`}else i.height+=r}if(e.position.x<0){let n=Math.abs(e.position.x);if(t.position.x=t.position.x-n,typeof i.width==`string`){let e=Number(i.width.replace(`px`,``));i.width=`${e+n}px`}else i.width+=n;e.position.x=0}if(e.position.y<0){let n=Math.abs(e.position.y);if(t.position.y=t.position.y-n,typeof i.height==`string`){let e=Number(i.height.replace(`px`,``));i.height=`${e+n}px`}else i.height+=n;e.position.y=0}t.dimensions.width=Number(i.width.toString().replace(`px`,``)),t.dimensions.height=Number(i.height.toString().replace(`px`,``)),t.style=typeof t.style==`function`?e=>{let n=t.style;return{...n(e),...i}}:{...t.style,...i}}}}function I3(e,t){let n=e.filter(e=>e.type===`add`||e.type===`remove`);for(let e of n)if(e.type===`add`)t.findIndex(t=>t.id===e.item.id)===-1&&t.push(e.item);else if(e.type===`remove`){let n=t.findIndex(t=>t.id===e.id);n!==-1&&t.splice(n,1)}let r=t.map(e=>e.id);for(let n of t)for(let i of e)if(i.id===n.id)switch(i.type){case`select`:n.selected=i.selected;break;case`position`:if(o3(n)&&(i.position!==void 0&&(n.position=i.position),i.dragging!==void 0&&(n.dragging=i.dragging),n.expandParent&&n.parentNode)){let e=t[r.indexOf(n.parentNode)];e&&o3(e)&&F3(n,e)}break;case`dimensions`:if(o3(n)&&(i.dimensions!==void 0&&(n.dimensions=i.dimensions),i.updateStyle!==void 0&&i.updateStyle&&(n.style={...n.style||{},width:`${i.dimensions?.width}px`,height:`${i.dimensions?.height}px`}),i.resizing!==void 0&&(n.resizing=i.resizing),n.expandParent&&n.parentNode)){let e=t[r.indexOf(n.parentNode)];e&&o3(e)&&(e.dimensions.width&&e.dimensions.height?F3(n,e):ce(()=>{F3(n,e)}))}}return t}function L3(e,t){return{id:e,type:`select`,selected:t}}function R3(e){return{item:e,type:`add`}}function z3(e){return{id:e,type:`remove`}}function B3(e,t,n,r,i){return{id:e,source:t,target:n,sourceHandle:r||null,targetHandle:i||null,type:`remove`}}function V3(e,t=new Set,n=!1){let r=[];for(let[i,a]of e){let e=t.has(i);(a.selected!==void 0||e)&&a.selected!==e&&(n&&(a.selected=e),r.push(L3(a.id,e)))}return r}var H3=()=>{};function U3(e){let t=new Set,n=H3,r=()=>!1,i=()=>t.size>0||r(),a=e=>{n=e},o=()=>{n=H3},s=e=>{r=e},c=()=>{r=()=>!1},l=e=>{t.delete(e)};return{on:e=>{t.add(e);let n=()=>l(e);return bZ(n),{off:n}},off:l,trigger:r=>{let a=[n];return i()?a.push(...t):e&&a.push(e),Promise.allSettled(a.map(e=>e(r)))},hasListeners:i,listeners:t,setEmitter:a,removeEmitter:o,setHasEmitListeners:s,removeHasEmitListeners:c}}function W3(e,t,n){let r=e;do{if(r&&r.matches(t))return!0;if(r===n)return!1;r=r.parentElement}while(r);return!1}function G3(e,t,n,r){let i=new Map;for(let[a,o]of e)(o.selected||o.id===r)&&(!o.parentNode||!A3(o,e))&&(o.draggable||t&&o.draggable===void 0)&&e.get(a)&&i.set(a,{id:o.id,position:o.position||{x:0,y:0},distance:{x:n.x-o.computedPosition?.x||0,y:n.y-o.computedPosition?.y||0},from:{x:o.computedPosition.x,y:o.computedPosition.y},extent:o.extent,parentNode:o.parentNode,dimensions:{...o.dimensions},expandParent:o.expandParent});return Array.from(i.values())}function K3({id:e,dragItems:t,findNode:n}){let r=[];for(let e of t){let t=n(e.id);t&&r.push(t)}return[e?r.find(t=>t.id===e):r[0],r]}function q3(e){if(Array.isArray(e))switch(e.length){case 1:return[e[0],e[0],e[0],e[0]];case 2:return[e[0],e[1],e[0],e[1]];case 3:return[e[0],e[1],e[2],e[1]];case 4:return e;default:return[0,0,0,0]}return[e,e,e,e]}function J3(e,t,n){let[r,i,a,o]=typeof e==`string`?[0,0,0,0]:q3(e.padding);return n&&n.computedPosition.x!==void 0&&n.computedPosition.y!==void 0&&n.dimensions.width!==void 0&&n.dimensions.height!==void 0?[[n.computedPosition.x+o,n.computedPosition.y+r],[n.computedPosition.x+n.dimensions.width-i,n.computedPosition.y+n.dimensions.height-a]]:!1}function Y3(e,t,n,r){let i=e.extent||n;if((i===`parent`||!Array.isArray(i)&&i?.range===`parent`)&&!e.expandParent){if(e.parentNode&&r&&e.dimensions.width&&e.dimensions.height){let t=J3(i,e,r);t&&(i=t)}else t(new i6(n6.NODE_EXTENT_INVALID,e.id)),i=n}else if(Array.isArray(i)){let e=r?.computedPosition.x||0,t=r?.computedPosition.y||0;i=[[i[0][0]+e,i[0][1]+t],[i[1][0]+e,i[1][1]+t]]}else if(i!==`parent`&&i?.range&&Array.isArray(i.range)){let[e,t,n,a]=q3(i.padding),o=r?.computedPosition.x||0,s=r?.computedPosition.y||0;i=[[i.range[0][0]+o+a,i.range[0][1]+s+e],[i.range[1][0]+o-t,i.range[1][1]+s-n]]}return i===`parent`?[[-1/0,-1/0],[1/0,1/0]]:i}function X3({width:e,height:t},n){return[n[0],[n[1][0]-(e||0),n[1][1]-(t||0)]]}function Z3(e,t,n,r,i){let a=n3(t,X3(e.dimensions,Y3(e,n,r,i)));return{position:{x:a.x-(i?.computedPosition.x||0),y:a.y-(i?.computedPosition.y||0)},computedPosition:a}}function Q3(e,t,n=M4.Left,r=!1){let i=(t?.x??0)+e.computedPosition.x,a=(t?.y??0)+e.computedPosition.y,{width:o,height:s}=t??l6(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case M4.Top:return{x:i+o/2,y:a};case M4.Right:return{x:i+o,y:a+s/2};case M4.Bottom:return{x:i+o/2,y:a+s};case M4.Left:return{x:i,y:a+s/2}}}function $3(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function e6({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:i,targetHeight:a,width:o,height:s,viewport:c}){let l={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+i),y2:Math.max(e.y+r,t.y+a)};l.x===l.x2&&(l.x2+=1),l.y===l.y2&&(l.y2+=1);let u=y3({x:(0-c.x)/c.zoom,y:(0-c.y)/c.zoom,width:o/c.zoom,height:s/c.zoom}),d=Math.max(0,Math.min(u.x2,l.x2)-Math.max(u.x,l.x)),f=Math.max(0,Math.min(u.y2,l.y2)-Math.max(u.y,l.y));return Math.ceil(d*f)>0}function t6(e,t,n=!1){let r=typeof e.zIndex==`number`,i=r?e.zIndex:0,a=t(e.source),o=t(e.target);return!a||!o?0:(n&&(i=r?e.zIndex:Math.max(a.computedPosition.z||0,o.computedPosition.z||0)),i)}var n6=(e=>(e.MISSING_STYLES=`MISSING_STYLES`,e.MISSING_VIEWPORT_DIMENSIONS=`MISSING_VIEWPORT_DIMENSIONS`,e.NODE_INVALID=`NODE_INVALID`,e.NODE_NOT_FOUND=`NODE_NOT_FOUND`,e.NODE_MISSING_PARENT=`NODE_MISSING_PARENT`,e.NODE_TYPE_MISSING=`NODE_TYPE_MISSING`,e.NODE_EXTENT_INVALID=`NODE_EXTENT_INVALID`,e.EDGE_INVALID=`EDGE_INVALID`,e.EDGE_NOT_FOUND=`EDGE_NOT_FOUND`,e.EDGE_SOURCE_MISSING=`EDGE_SOURCE_MISSING`,e.EDGE_TARGET_MISSING=`EDGE_TARGET_MISSING`,e.EDGE_TYPE_MISSING=`EDGE_TYPE_MISSING`,e.EDGE_SOURCE_TARGET_SAME=`EDGE_SOURCE_TARGET_SAME`,e.EDGE_SOURCE_TARGET_MISSING=`EDGE_SOURCE_TARGET_MISSING`,e.EDGE_ORPHANED=`EDGE_ORPHANED`,e.USEVUEFLOW_OPTIONS=`USEVUEFLOW_OPTIONS`,e))(n6||{}),r6={MISSING_STYLES:()=>`It seems that you haven't loaded the necessary styles. Please import '@vue-flow/core/dist/style.css' to ensure that the graph is rendered correctly`,MISSING_VIEWPORT_DIMENSIONS:()=>`The Vue Flow parent container needs a width and a height to render the graph`,NODE_INVALID:e=>`Node is invalid
|
|
288
|
+
Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
|
|
289
|
+
Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent
|
|
290
|
+
Node: ${e}
|
|
291
|
+
Parent: ${t}`,NODE_TYPE_MISSING:e=>`Node type is missing
|
|
292
|
+
Type: ${e}`,NODE_EXTENT_INVALID:e=>`Only child nodes can use a parent extent
|
|
293
|
+
Node: ${e}`,EDGE_INVALID:e=>`An edge needs a source and a target
|
|
294
|
+
Edge: ${e}`,EDGE_SOURCE_MISSING:(e,t)=>`Edge source is missing
|
|
295
|
+
Edge: ${e}
|
|
296
|
+
Source: ${t}`,EDGE_TARGET_MISSING:(e,t)=>`Edge target is missing
|
|
297
|
+
Edge: ${e}
|
|
298
|
+
Target: ${t}`,EDGE_TYPE_MISSING:e=>`Edge type is missing
|
|
299
|
+
Type: ${e}`,EDGE_SOURCE_TARGET_SAME:(e,t,n)=>`Edge source and target are the same
|
|
300
|
+
Edge: ${e}
|
|
301
|
+
Source: ${t}
|
|
302
|
+
Target: ${n}`,EDGE_SOURCE_TARGET_MISSING:(e,t,n)=>`Edge source or target is missing
|
|
303
|
+
Edge: ${e}
|
|
304
|
+
Source: ${t}
|
|
305
|
+
Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
|
|
306
|
+
Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
|
|
307
|
+
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>`The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead`},i6=class extends Error{constructor(e,...t){super(r6[e]?.call(r6,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function a6(e){return`clientX`in e}function o6(e){return`sourceEvent`in e}function s6(e,t){let n=a6(e),r,i;return n?(r=e.clientX,i=e.clientY):`touches`in e&&e.touches.length>0?(r=e.touches[0].clientX,i=e.touches[0].clientY):`changedTouches`in e&&e.changedTouches.length>0?(r=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(r=0,i=0),{x:r-(t?.left??0),y:i-(t?.top??0)}}var c6=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function l6(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function u6(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var d6=()=>!0;function f6(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function p6(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())$4(i,Q4(e))>0&&r.push(e);return r}var m6=250;function h6(e,t,n,r){let i=[],a=1/0,o=p6(e,n,t+m6);for(let n of o){let o=[...n.handleBounds?.source??[],...n.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=Q3(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function g6(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=d6},u,d,f,p){let m=a===`target`,h=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:g,y:_}=s6(e),v=o.elementFromPoint(g,_),y=v?.classList.contains(`${s}-flow__handle`)?v:h,b={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){let e=_6(void 0,y),t=y.getAttribute(`data-nodeid`),a=y.getAttribute(`data-handleid`),o=y.classList.contains(`connectable`),s=y.classList.contains(`connectableend`);if(!t||!e)return b;let c={source:m?t:r,sourceHandle:m?a:i,target:m?r:t,targetHandle:m?i:a};b.connection=c,b.isValid=o&&s&&(n===F4.Strict?m&&e===`source`||!m&&e===`target`:t!==r||a!==i)&&l(c,{nodes:d,edges:u,sourceNode:f(c.source),targetNode:f(c.target)}),b.toHandle=b6(t,e,a,p,n,!0)}return b}function _6(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function v6(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function y6(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function b6(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===F4.Strict?o.handleBounds?.[t]:[...o.handleBounds?.source??[],...o.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...Q3(o,c,c.position,!0)}:c}var x6={[M4.Left]:M4.Right,[M4.Right]:M4.Left,[M4.Top]:M4.Bottom,[M4.Bottom]:M4.Top},S6=[`production`,`prod`];function C6(e,...t){w6()&&console.warn(`[Vue Flow]: ${e}`,...t)}function w6(){return!S6.includes(`production`)}function T6(e,t,n,r,i){let a=t.querySelectorAll(`.vue-flow__handle.${e}`);return a?.length?Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...e3(t)}}):null}function E6(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),ce(()=>{o.blur()})):n([e])}function D6(e){return r(e)!==void 0}function O6(e,t,n,r){if(!e||!e.source||!e.target)return n(new i6(n6.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=i3(e)?e:{...e,id:m3(e)},i=u3(i,void 0,r),!h3(i,t)&&i}function k6(e,t,n,r,i){if(!t.source||!t.target)return i(new i6(n6.EDGE_INVALID,e.id)),!1;if(!n)return i(new i6(n6.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?m3(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function A6(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!a3(o)){n(new i6(n6.NODE_INVALID,o?.id));continue}let s=l3(o,t(o.id),o.parentNode);o.parentNode&&(r[o.parentNode]=!0),i[a]=s}for(let e of i){let a=t(e.parentNode)||i.find(t=>t.id===e.parentNode);e.parentNode&&!a&&n(new i6(n6.NODE_MISSING_PARENT,e.id,e.parentNode)),(e.parentNode||r[e.id])&&(r[e.id]&&(e.isParent=!0),a&&(a.isParent=!0))}return i}function j6(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function M6(e,t,n){e.clear();for(let t of n){let{source:n,target:r,sourceHandle:i=null,targetHandle:a=null}=t,o={edgeId:t.id,source:n,target:r,sourceHandle:i,targetHandle:a},s=`${n}-${i}--${r}-${a}`;j6(`source`,o,`${r}-${a}--${n}-${i}`,e,n,i),j6(`target`,o,s,e,r,a)}}function N6(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function P6(e,t,n,r,i,a,o,s){let c=[];for(let l of e){let e=i3(l)?l:O6(l,s,i,a);if(!e)continue;let u=n(e.source),d=n(e.target);if(!u||!d){i(new i6(n6.EDGE_SOURCE_TARGET_MISSING,e.id,e.source,e.target));continue}if(!u){i(new i6(n6.EDGE_SOURCE_MISSING,e.id,e.source));continue}if(!d){i(new i6(n6.EDGE_TARGET_MISSING,e.id,e.target));continue}if(t&&!t(e,{edges:s,nodes:o,sourceNode:u,targetNode:d})){i(new i6(n6.EDGE_INVALID,e.id));continue}let f=r(e.id);c.push({...u3(e,f,a),sourceNode:u,targetNode:d})}return c}var F6=Symbol(`vueFlow`),I6=Symbol(`nodeId`),L6=Symbol(`nodeRef`),R6=Symbol(`edgeId`),z6=Symbol(`edgeRef`),B6=Symbol(`slots`);function V6(e){let{vueFlowRef:t,snapToGrid:n,snapGrid:r,noDragClassName:i,nodeLookup:o,nodeExtent:c,nodeDragThreshold:l,viewport:u,autoPanOnNodeDrag:d,autoPanSpeed:f,nodesDraggable:p,panBy:m,findNode:h,multiSelectionActive:g,nodesSelectionActive:_,selectNodesOnDrag:v,removeSelectedElements:y,addSelectedNodes:b,updateNodePositions:x,emits:S}=Y8(),{onStart:w,onDrag:T,onStop:E,onClick:D,el:O,disabled:k,id:A,selectable:j,dragHandle:M}=e,N=s(!1),P=[],F,I=null,L={x:void 0,y:void 0},R={x:0,y:0},ee=null,z=!1,te=!1,ne=0,B=!1,V=W6(),re=({x:e,y:t})=>{L={x:e,y:t};let i=!1;if(P=P.map(a=>{let o={x:e-a.distance.x,y:t-a.distance.y},{computedPosition:s}=Z3(a,n.value?u6(o,r.value):o,S.error,c.value,a.parentNode?h(a.parentNode):void 0);return i=i||a.position.x!==s.x||a.position.y!==s.y,a.position=s,a}),te||=i,i&&(x(P,!0,!0),N.value=!0,ee)){let[e,t]=K3({id:A,dragItems:P,findNode:h});T({event:ee,node:e,nodes:t})}},H=()=>{if(!I)return;let[e,t]=P3(R,I,f.value);if(e!==0||t!==0){let n={x:(L.x??0)-e/u.value.zoom,y:(L.y??0)-t/u.value.zoom};m({x:e,y:t})&&re(n)}ne=requestAnimationFrame(H)},ie=(e,t)=>{z=!0;let n=h(A);!v.value&&!g.value&&n&&(n.selected||y()),n&&a(j)&&v.value&&E6(n,g.value,b,y,_,!1,t);let r=V(e.sourceEvent);if(L=r,P=G3(o.value,p.value,r,A),P.length){let[t,n]=K3({id:A,dragItems:P,findNode:h});w({event:e.sourceEvent,node:t,nodes:n})}},U=(e,n)=>{e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||(te=!1,l.value===0&&ie(e,n),L=V(e.sourceEvent),I=t.value?.getBoundingClientRect()||null,R=s6(e.sourceEvent,I))},W=(e,t)=>{let n=V(e.sourceEvent);if(!B&&z&&d.value&&(B=!0,H()),!z){let r=n.xSnapped-(L.x??0),i=n.ySnapped-(L.y??0);Math.sqrt(r*r+i*i)>l.value&&ie(e,t)}(L.x!==n.xSnapped||L.y!==n.ySnapped)&&P.length&&z&&(ee=e.sourceEvent,R=s6(e.sourceEvent,I),re(n))},ae=e=>{let t=!1;if(!z&&!N.value&&!g.value){let n=e.sourceEvent,r=V(n),i=r.xSnapped-(L.x??0),a=r.ySnapped-(L.y??0),o=Math.sqrt(i*i+a*a);o!==0&&o<=l.value&&(D?.(n),t=!0)}if(P.length&&!t){te&&=(x(P,!1,!1),!1);let[t,n]=K3({id:A,dragItems:P,findNode:h});E({event:e.sourceEvent,node:t,nodes:n})}P=[],N.value=!1,B=!1,z=!1,L={x:void 0,y:void 0},cancelAnimationFrame(ne)};return C([()=>a(k),O],([e,t],n,r)=>{if(t){let n=J$(t);e||(F=l1().on(`start`,e=>U(e,t)).on(`drag`,e=>W(e,t)).on(`end`,e=>ae(e)).filter(e=>{let n=e.target,r=a(M);return!e.button&&(!i.value||!W3(n,`.${i.value}`,t)&&(!r||W3(n,r,t)))}),n.call(F)),r(()=>{n.on(`.drag`,null),F&&(F.on(`start`,null),F.on(`drag`,null),F.on(`end`,null))})}}),N}function H6(){return{doubleClick:U3(),click:U3(),mouseEnter:U3(),mouseMove:U3(),mouseLeave:U3(),contextMenu:U3(),updateStart:U3(),update:U3(),updateEnd:U3()}}function U6(e,t){let n=H6();return n.doubleClick.on(n=>{var r,i;t.edgeDoubleClick(n),(i=(r=e.events)?.doubleClick)==null||i.call(r,n)}),n.click.on(n=>{var r,i;t.edgeClick(n),(i=(r=e.events)?.click)==null||i.call(r,n)}),n.mouseEnter.on(n=>{var r,i;t.edgeMouseEnter(n),(i=(r=e.events)?.mouseEnter)==null||i.call(r,n)}),n.mouseMove.on(n=>{var r,i;t.edgeMouseMove(n),(i=(r=e.events)?.mouseMove)==null||i.call(r,n)}),n.mouseLeave.on(n=>{var r,i;t.edgeMouseLeave(n),(i=(r=e.events)?.mouseLeave)==null||i.call(r,n)}),n.contextMenu.on(n=>{var r,i;t.edgeContextMenu(n),(i=(r=e.events)?.contextMenu)==null||i.call(r,n)}),n.updateStart.on(n=>{var r,i;t.edgeUpdateStart(n),(i=(r=e.events)?.updateStart)==null||i.call(r,n)}),n.update.on(n=>{var r,i;t.edgeUpdate(n),(i=(r=e.events)?.update)==null||i.call(r,n)}),n.updateEnd.on(n=>{var r,i;t.edgeUpdateEnd(n),(i=(r=e.events)?.updateEnd)==null||i.call(r,n)}),Object.entries(n).reduce((e,[t,n])=>(e.emit[t]=n.trigger,e.on[t]=n.on,e),{emit:{},on:{}})}function W6(){let{viewport:e,snapGrid:t,snapToGrid:n,vueFlowRef:r}=Y8();return i=>{let a=r.value?.getBoundingClientRect()??{left:0,top:0},{x:o,y:s}=s6(o6(i)?i.sourceEvent:i,a),c=_3({x:o,y:s},e.value),{x:l,y:u}=n.value?u6(c,t.value):c;return{xSnapped:l,ySnapped:u,...c}}}function G6(){return!0}function K6({handleId:e,nodeId:t,type:n,isValidConnection:r,edgeUpdaterType:i,onEdgeUpdate:o,onEdgeUpdateEnd:s}){let{id:c,vueFlowRef:l,connectionMode:u,connectionRadius:d,connectOnClick:f,connectionClickStartHandle:p,nodesConnectable:m,autoPanOnConnect:h,autoPanSpeed:g,findNode:_,panBy:v,startConnection:y,updateConnection:b,endConnection:x,emits:S,viewport:C,edges:w,nodes:T,isValidConnection:E,nodeLookup:D}=Y8(),O=null,k=!1,A=null;function j(f){let p=a(n)===`target`,m=a6(f),j=r3(f.target),M=f.currentTarget;if(M&&(m&&f.button===0||!m)){let n=function(n){B=s6(n,z),F=h6(_3(B,C.value,!1,[1,1]),d.value,D.value,H),V||=(re(),!0);let r=g6(n,{handle:F,connectionMode:u.value,fromNodeId:a(t),fromHandleId:a(e),fromType:p?`target`:`source`,isValidConnection:P,doc:j,lib:`vue`,flowId:c,nodeLookup:D.value},w.value,T.value,_,D.value);A=r.handleDomNode,O=r.connection,k=y6(!!F,r.isValid);let i={...W,isValid:k,to:r.toHandle&&k?g3({x:r.toHandle.x,y:r.toHandle.y},C.value):B,toHandle:r.toHandle,toPosition:k&&r.toHandle?r.toHandle.position:x6[H.position],toNode:r.toHandle?D.value.get(r.toHandle.nodeId):null};if(k&&F&&W?.toHandle&&i.toHandle&&W.toHandle.type===i.toHandle.type&&W.toHandle.nodeId===i.toHandle.nodeId&&W.toHandle.id===i.toHandle.id&&W.to.x===i.to.x&&W.to.y===i.to.y)return;let o=F??r.toHandle;if(b(o&&k?g3({x:o.x,y:o.y},C.value):B,o,v6(!!o,k)),W=i,!F&&!k&&!A)return f6(ne);O&&O.source!==O.target&&A&&(f6(ne),ne=A,A.classList.add(`connecting`,`vue-flow__handle-connecting`),A.classList.toggle(`valid`,!!k),A.classList.toggle(`vue-flow__handle-valid`,!!k))},m=function(e){`touches`in e&&e.touches.length>0||((F||A)&&O&&k&&(o?o(e,O):S.connect(O)),S.connectEnd(e),i&&s?.(e),f6(ne),cancelAnimationFrame(I),x(e),V=!1,k=!1,O=null,A=null,j.removeEventListener(`mousemove`,n),j.removeEventListener(`mouseup`,m),j.removeEventListener(`touchmove`,n),j.removeEventListener(`touchend`,m))},N=_(a(t)),P=a(r)||E.value||G6;!P&&N&&(P=(p?N.isValidSourcePos:N.isValidTargetPos)||G6);let F,I=0,{x:L,y:R}=s6(f),ee=_6(a(i),M),z=l.value?.getBoundingClientRect();if(!z||!ee)return;let te=b6(a(t),ee,a(e),D.value,u.value);if(!te)return;let ne,B=s6(f,z),V=!1,re=()=>{if(!h.value)return;let[e,t]=P3(B,z,g.value);v({x:e,y:t}),I=requestAnimationFrame(re)},H={...te,nodeId:a(t),type:ee,position:te.position},ie=D.value.get(a(t)),U={inProgress:!0,isValid:null,from:Q3(ie,H,M4.Left,!0),fromHandle:H,fromPosition:H.position,fromNode:ie,to:B,toHandle:null,toPosition:x6[H.position],toNode:null};y({nodeId:a(t),id:a(e),type:ee,position:M?.getAttribute(`data-handlepos`)||M4.Top,...B},{x:L-z.left,y:R-z.top}),S.connectStart({event:f,nodeId:a(t),handleId:a(e),handleType:ee});let W=U;j.addEventListener(`mousemove`,n),j.addEventListener(`mouseup`,m),j.addEventListener(`touchmove`,n),j.addEventListener(`touchend`,m)}}function M(i){if(!f.value)return;let o=a(n)===`target`;if(!p.value){S.clickConnectStart({event:i,nodeId:a(t),handleId:a(e)}),y({nodeId:a(t),type:a(n),id:a(e),position:M4.Top,...s6(i)},void 0,!0);return}let s=a(r)||E.value||G6,l=_(a(t));if(!s&&l&&(s=(o?l.isValidSourcePos:l.isValidTargetPos)||G6),l&&(l.connectable===void 0?m.value:l.connectable)===!1)return;let d=r3(i.target),h=g6(i,{handle:{nodeId:a(t),id:a(e),type:a(n),position:M4.Top,...s6(i)},connectionMode:u.value,fromNodeId:p.value.nodeId,fromHandleId:p.value.id??null,fromType:p.value.type,isValidConnection:s,doc:d,lib:`vue`,flowId:c,nodeLookup:D.value},w.value,T.value,_,D.value),g=h.connection?.source===h.connection?.target;h.isValid&&h.connection&&!g&&S.connect(h.connection),S.clickConnectEnd(i),x(i,!0)}return{handlePointerDown:j,handleClick:M}}function q6(){return w(I6,``)}function J6(e){let t=e??q6()??``,n=w(L6,i(null)),{findNode:r,edges:a,emits:o}=Y8(),s=r(t);return s||o.error(new i6(n6.NODE_NOT_FOUND,t)),{id:t,nodeEl:n,node:s,parentNode:z(()=>r(s.parentNode)),connectedEdges:z(()=>w3([s],a.value))}}function Y6(){return{doubleClick:U3(),click:U3(),mouseEnter:U3(),mouseMove:U3(),mouseLeave:U3(),contextMenu:U3(),dragStart:U3(),drag:U3(),dragStop:U3()}}function X6(e,t){let n=Y6();return n.doubleClick.on(n=>{var r,i;t.nodeDoubleClick(n),(i=(r=e.events)?.doubleClick)==null||i.call(r,n)}),n.click.on(n=>{var r,i;t.nodeClick(n),(i=(r=e.events)?.click)==null||i.call(r,n)}),n.mouseEnter.on(n=>{var r,i;t.nodeMouseEnter(n),(i=(r=e.events)?.mouseEnter)==null||i.call(r,n)}),n.mouseMove.on(n=>{var r,i;t.nodeMouseMove(n),(i=(r=e.events)?.mouseMove)==null||i.call(r,n)}),n.mouseLeave.on(n=>{var r,i;t.nodeMouseLeave(n),(i=(r=e.events)?.mouseLeave)==null||i.call(r,n)}),n.contextMenu.on(n=>{var r,i;t.nodeContextMenu(n),(i=(r=e.events)?.contextMenu)==null||i.call(r,n)}),n.dragStart.on(n=>{var r,i;t.nodeDragStart(n),(i=(r=e.events)?.dragStart)==null||i.call(r,n)}),n.drag.on(n=>{var r,i;t.nodeDrag(n),(i=(r=e.events)?.drag)==null||i.call(r,n)}),n.dragStop.on(n=>{var r,i;t.nodeDragStop(n),(i=(r=e.events)?.dragStop)==null||i.call(r,n)}),Object.entries(n).reduce((e,[t,n])=>(e.emit[t]=n.trigger,e.on[t]=n.on,e),{emit:{},on:{}})}function Z6(){let{getSelectedNodes:e,nodeExtent:t,updateNodePositions:n,findNode:r,snapGrid:i,snapToGrid:a,nodesDraggable:o,emits:s}=Y8();return(c,l=!1)=>{let u=a.value?i.value[0]:5,d=a.value?i.value[1]:5,f=l?4:1,p=c.x*u*f,m=c.y*d*f,h=[];for(let n of e.value)if(n.draggable||o&&n.draggable===void 0){let{position:e}=Z3(n,{x:n.computedPosition.x+p,y:n.computedPosition.y+m},s.error,t.value,n.parentNode?r(n.parentNode):void 0);h.push({id:n.id,position:e,from:n.position,distance:{x:c.x,y:c.y},dimensions:n.dimensions})}n(h,!0,!1)}}var Q6=.1,$6=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2;function e8(){return C6(`Viewport not initialized yet.`),Promise.resolve(!1)}var t8={zoomIn:e8,zoomOut:e8,zoomTo:e8,fitView:e8,setCenter:e8,fitBounds:e8,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:e8,setTransform:e8,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function n8(e){function t(t,n){return new Promise(r=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate(n?.interpolate===`linear`?f0:E0).scaleBy(r8(e.d3Selection,n?.duration,n?.ease,()=>{r(!0)}),t):r(!1)})}function n(t,n,r,i){return new Promise(a=>{var o;let{x:s,y:c}=n3({x:-t,y:-n},e.translateExtent),l=S4.translate(-s,-c).scale(r);e.d3Selection&&e.d3Zoom?(o=e.d3Zoom)==null||o.interpolate(i?.interpolate===`linear`?f0:E0).transform(r8(e.d3Selection,i?.duration,i?.ease,()=>{a(!0)}),l):a(!1)})}return z(()=>e.d3Zoom&&e.d3Selection&&e.dimensions.width&&e.dimensions.height?{viewportInitialized:!0,zoomIn:e=>t(1.2,e),zoomOut:e=>t(1/1.2,e),zoomTo:(t,n)=>new Promise(r=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate(n?.interpolate===`linear`?f0:E0).scaleTo(r8(e.d3Selection,n?.duration,n?.ease,()=>{r(!0)}),t):r(!1)}),setViewport:(e,t)=>n(e.x,e.y,e.zoom,t),setTransform:(e,t)=>n(e.x,e.y,e.zoom,t),getViewport:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),getTransform:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),fitView:(t={padding:Q6,includeHiddenNodes:!1,duration:0})=>{let r=[];for(let n of e.nodes)n.dimensions.width&&n.dimensions.height&&(t?.includeHiddenNodes||!n.hidden)&&(!t.nodes?.length||t.nodes?.length&&t.nodes.includes(n.id))&&r.push(n);if(!r.length)return Promise.resolve(!1);let{x:i,y:a,zoom:o}=O3(S3(r),e.dimensions.width,e.dimensions.height,t.minZoom??e.minZoom,t.maxZoom??e.maxZoom,t.padding??Q6);return n(i,a,o,t)},setCenter:(t,r,i)=>{let a=i?.zoom===void 0?e.maxZoom:i.zoom;return n(e.dimensions.width/2-t*a,e.dimensions.height/2-r*a,a,i)},fitBounds:(t,r={padding:Q6})=>{let{x:i,y:a,zoom:o}=O3(t,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,r.padding??Q6);return n(i,a,o,r)},project:t=>_3(t,e.viewport,e.snapToGrid,e.snapGrid),screenToFlowCoordinate:t=>{if(e.vueFlowRef){let{x:n,y:r}=e.vueFlowRef.getBoundingClientRect();return _3({x:t.x-n,y:t.y-r},e.viewport,e.snapToGrid,e.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:t=>{if(e.vueFlowRef){let{x:n,y:r}=e.vueFlowRef.getBoundingClientRect();return g3({x:t.x+n,y:t.y+r},e.viewport)}return{x:0,y:0}}}:t8)}function r8(e,t=0,n=$6,r=()=>{}){let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e}function i8(e,t,n){let r=d(!0);return r.run(()=>{r.run(()=>{let t,r,i=!!(n.nodes.value.length||n.edges.value.length);t=MZ([e.modelValue,()=>e.modelValue?.value?.length],([e])=>{e&&Array.isArray(e)&&(r?.pause(),n.setElements(e),!r&&!i&&e.length?i=!0:r?.resume())}),r=MZ([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([n,r])=>{e.modelValue?.value&&Array.isArray(e.modelValue.value)&&(t?.pause(),e.modelValue.value=[...n,...r],ce(()=>{t?.resume()}))},{immediate:i}),u(()=>{t?.stop(),r?.stop()})}),r.run(()=>{let t,r,i=!!n.nodes.value.length;t=MZ([e.nodes,()=>e.nodes?.value?.length],([e])=>{e&&Array.isArray(e)&&(r?.pause(),n.setNodes(e),!r&&!i&&e.length?i=!0:r?.resume())}),r=MZ([n.nodes,()=>n.nodes.value.length],([n])=>{e.nodes?.value&&Array.isArray(e.nodes.value)&&(t?.pause(),e.nodes.value=[...n],ce(()=>{t?.resume()}))},{immediate:i}),u(()=>{t?.stop(),r?.stop()})}),r.run(()=>{let t,r,i=!!n.edges.value.length;t=MZ([e.edges,()=>e.edges?.value?.length],([e])=>{e&&Array.isArray(e)&&(r?.pause(),n.setEdges(e),!r&&!i&&e.length?i=!0:r?.resume())}),r=MZ([n.edges,()=>n.edges.value.length],([n])=>{e.edges?.value&&Array.isArray(e.edges.value)&&(t?.pause(),e.edges.value=[...n],ce(()=>{t?.resume()}))},{immediate:i}),u(()=>{t?.stop(),r?.stop()})}),r.run(()=>{C(()=>t.minZoom,()=>{t.minZoom&&D6(t.minZoom)&&n.setMinZoom(t.minZoom)},{immediate:!0})}),r.run(()=>{C(()=>t.maxZoom,()=>{t.maxZoom&&D6(t.maxZoom)&&n.setMaxZoom(t.maxZoom)},{immediate:!0})}),r.run(()=>{C(()=>t.translateExtent,()=>{t.translateExtent&&D6(t.translateExtent)&&n.setTranslateExtent(t.translateExtent)},{immediate:!0})}),r.run(()=>{C(()=>t.nodeExtent,()=>{t.nodeExtent&&D6(t.nodeExtent)&&n.setNodeExtent(t.nodeExtent)},{immediate:!0})}),r.run(()=>{C(()=>t.applyDefault,()=>{D6(t.applyDefault)&&(n.applyDefault.value=t.applyDefault)},{immediate:!0})}),r.run(()=>{let e=async e=>{let r=e;typeof t.autoConnect==`function`&&(r=await t.autoConnect(e)),r!==!1&&n.addEdges([r])};C(()=>t.autoConnect,()=>{D6(t.autoConnect)&&(n.autoConnect.value=t.autoConnect)},{immediate:!0}),C(n.autoConnect,(t,r,i)=>{t?n.onConnect(e):n.hooks.value.connect.off(e),i(()=>{n.hooks.value.connect.off(e)})},{immediate:!0})}),(()=>{let e=[`id`,`modelValue`,`translateExtent`,`nodeExtent`,`edges`,`nodes`,`maxZoom`,`minZoom`,`applyDefault`,`autoConnect`];for(let i of Object.keys(t)){let a=i;if(!e.includes(a)){let e=o(()=>t[a]),i=n[a];m(i)&&r.run(()=>{C(e,e=>{D6(e)&&(i.value=e)},{immediate:!0})})}}})()}),()=>r.stop()}function a8(){return{edgesChange:U3(),nodesChange:U3(),nodeDoubleClick:U3(),nodeClick:U3(),nodeMouseEnter:U3(),nodeMouseMove:U3(),nodeMouseLeave:U3(),nodeContextMenu:U3(),nodeDragStart:U3(),nodeDrag:U3(),nodeDragStop:U3(),nodesInitialized:U3(),miniMapNodeClick:U3(),miniMapNodeDoubleClick:U3(),miniMapNodeMouseEnter:U3(),miniMapNodeMouseMove:U3(),miniMapNodeMouseLeave:U3(),connect:U3(),connectStart:U3(),connectEnd:U3(),clickConnectStart:U3(),clickConnectEnd:U3(),paneReady:U3(),init:U3(),move:U3(),moveStart:U3(),moveEnd:U3(),selectionDragStart:U3(),selectionDrag:U3(),selectionDragStop:U3(),selectionContextMenu:U3(),selectionStart:U3(),selectionEnd:U3(),viewportChangeStart:U3(),viewportChange:U3(),viewportChangeEnd:U3(),paneScroll:U3(),paneClick:U3(),paneContextMenu:U3(),paneMouseEnter:U3(),paneMouseMove:U3(),paneMouseLeave:U3(),edgeContextMenu:U3(),edgeMouseEnter:U3(),edgeMouseMove:U3(),edgeMouseLeave:U3(),edgeDoubleClick:U3(),edgeClick:U3(),edgeUpdateStart:U3(),edgeUpdate:U3(),edgeUpdateEnd:U3(),updateNodeInternals:U3(),error:U3(e=>C6(e.message))}}function o8(e,t){let n=T();ae(()=>{for(let[n,i]of Object.entries(t.value))i.setEmitter(t=>{e(n,t)}),bZ(i.removeEmitter),i.setHasEmitListeners(()=>r(n)),bZ(i.removeHasEmitListeners)});function r(e){let t=s8(e);return!!n?.vnode.props?.[t]}}function s8(e){let[t,...n]=e.split(`:`);return`on${t.replace(/(?:^|-)(\w)/g,(e,t)=>t.toUpperCase())}${n.length?`:${n.join(`:`)}`:``}`}function c8(){return{vueFlowRef:null,viewportRef:null,nodes:[],edges:[],connectionLookup:new Map,nodeTypes:{},edgeTypes:{},initialized:!1,dimensions:{width:0,height:0},viewport:{x:0,y:0,zoom:1},d3Zoom:null,d3Selection:null,d3ZoomHandler:null,minZoom:.5,maxZoom:2,translateExtent:[[-1/0,-1/0],[1/0,1/0]],nodeExtent:[[-1/0,-1/0],[1/0,1/0]],selectionMode:N4.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:L4.Free,paneClickDistance:0,panOnDrag:!0,edgeUpdaterRadius:10,onlyRenderVisibleElements:!1,defaultViewport:{x:0,y:0,zoom:1},nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,defaultMarkerColor:`#b1b1b7`,connectionLineStyle:{},connectionLineType:null,connectionLineOptions:{type:P4.Bezier,style:{}},connectionMode:F4.Loose,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectionPosition:{x:NaN,y:NaN},connectionRadius:20,connectOnClick:!0,connectionStatus:null,isValidConnection:null,snapGrid:[15,15],snapToGrid:!1,edgesUpdatable:!1,edgesFocusable:!0,nodesFocusable:!0,nodesConnectable:!0,nodesDraggable:!0,nodeDragThreshold:1,elementsSelectable:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,selectionKeyCode:`Shift`,multiSelectionKeyCode:c6()?`Meta`:`Control`,zoomActivationKeyCode:c6()?`Meta`:`Control`,deleteKeyCode:`Backspace`,panActivationKeyCode:`Space`,hooks:a8(),applyDefault:!0,autoConnect:!1,fitViewOnInit:!1,fitViewOnInitDone:!1,noDragClassName:`nodrag`,noWheelClassName:`nowheel`,noPanClassName:`nopan`,defaultEdgeOptions:void 0,elevateEdgesOnSelect:!1,elevateNodesOnSelect:!0,autoPanOnNodeDrag:!0,autoPanOnConnect:!0,autoPanSpeed:15,disableKeyboardA11y:!1,ariaLiveMessage:``}}var l8=[`id`,`vueFlowRef`,`viewportRef`,`initialized`,`modelValue`,`nodes`,`edges`,`maxZoom`,`minZoom`,`translateExtent`,`hooks`,`defaultEdgeOptions`];function u8(e,t,n){let r=n8(e),i=t=>{let n=t??[];e.hooks.updateNodeInternals.trigger(n)},a=t=>p3(t,e.nodes,e.edges),o=t=>f3(t,e.nodes,e.edges),s=t=>w3(t,e.edges),c=({id:t,type:n,nodeId:r})=>{let i=t?`-${n}-${t}`:`-${n}`;return Array.from(e.connectionLookup.get(`${r}${i}`)?.values()??[])},l=e=>{if(e)return t.value.get(e)},u=e=>{if(e)return n.value.get(e)},d=(t,n,r)=>{let i=[];for(let e of t){let t={id:e.id,type:`position`,dragging:r,from:e.from};if(n&&(t.position=e.position,e.parentNode)){let n=l(e.parentNode);t.position={x:t.position.x-(n?.computedPosition?.x??0),y:t.position.y-(n?.computedPosition?.y??0)}}i.push(t)}i?.length&&e.hooks.nodesChange.trigger(i)},f=t=>{if(!e.vueFlowRef)return;let n=e.vueFlowRef.querySelector(`.vue-flow__transformationpane`);if(!n)return;let i=window.getComputedStyle(n),{m22:a}=new window.DOMMatrixReadOnly(i.transform),o=[];for(let e of t){let t=e,n=l(t.id);if(n){let e=e3(t.nodeElement);if(e.width&&e.height&&(n.dimensions.width!==e.width||n.dimensions.height!==e.height||t.forceUpdate)){let r=t.nodeElement.getBoundingClientRect();n.dimensions=e,n.handleBounds.source=T6(`source`,t.nodeElement,r,a,n.id),n.handleBounds.target=T6(`target`,t.nodeElement,r,a,n.id),o.push({id:n.id,type:`dimensions`,dimensions:e})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&r.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),o.length&&e.hooks.nodesChange.trigger(o)},p=(r,i)=>{let a=new Set,o=new Set;for(let e of r)a3(e)?a.add(e.id):i3(e)&&o.add(e.id);let s=V3(t.value,a,!0),c=V3(n.value,o);if(e.multiSelectionActive){for(let e of a)s.push(L3(e,i));for(let e of o)c.push(L3(e,i))}s.length&&e.hooks.nodesChange.trigger(s),c.length&&e.hooks.edgesChange.trigger(c)},m=r=>{if(e.multiSelectionActive){let t=r.map(e=>L3(e.id,!0));e.hooks.nodesChange.trigger(t);return}e.hooks.nodesChange.trigger(V3(t.value,new Set(r.map(e=>e.id)),!0)),e.hooks.edgesChange.trigger(V3(n.value))},h=r=>{if(e.multiSelectionActive){let t=r.map(e=>L3(e.id,!0));e.hooks.edgesChange.trigger(t);return}e.hooks.edgesChange.trigger(V3(n.value,new Set(r.map(e=>e.id)))),e.hooks.nodesChange.trigger(V3(t.value,new Set,!0))},g=e=>{p(e,!0)},_=t=>{let n=(t||e.nodes).map(e=>(e.selected=!1,L3(e.id,!1)));e.hooks.nodesChange.trigger(n)},v=t=>{let n=(t||e.edges).map(e=>(e.selected=!1,L3(e.id,!1)));e.hooks.edgesChange.trigger(n)},y=t=>{if(!t||!t.length)return p([],!1);let n=t.reduce((e,t)=>{let n=L3(t.id,!1);return a3(t)?e.nodes.push(n):e.edges.push(n),e},{nodes:[],edges:[]});n.nodes.length&&e.hooks.nodesChange.trigger(n.nodes),n.edges.length&&e.hooks.edgesChange.trigger(n.edges)},b=t=>{var n;(n=e.d3Zoom)==null||n.scaleExtent([t,e.maxZoom]),e.minZoom=t},x=t=>{var n;(n=e.d3Zoom)==null||n.scaleExtent([e.minZoom,t]),e.maxZoom=t},S=t=>{var n;(n=e.d3Zoom)==null||n.translateExtent(t),e.translateExtent=t},C=t=>{e.nodeExtent=t,i()},w=t=>{var n;(n=e.d3Zoom)==null||n.clickDistance(t)},T=t=>{e.nodesDraggable=t,e.nodesConnectable=t,e.elementsSelectable=t},E=t=>{let n=t instanceof Function?t(e.nodes):t;(e.initialized||n.length)&&(e.nodes=A6(n,l,e.hooks.error.trigger))},D=t=>{let r=t instanceof Function?t(e.edges):t;if(!e.initialized&&!r.length)return;let i=P6(r,e.isValidConnection,l,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);M6(e.connectionLookup,n.value,i),e.edges=i},O=t=>{let n=t instanceof Function?t([...e.nodes,...e.edges]):t;(e.initialized||n.length)&&(E(n.filter(a3)),D(n.filter(i3)))},k=t=>{let n=t instanceof Function?t(e.nodes):t;n=Array.isArray(n)?n:[n];let r=A6(n,l,e.hooks.error.trigger),i=[];for(let e of r)i.push(R3(e));i.length&&e.hooks.nodesChange.trigger(i)},A=t=>{let n=t instanceof Function?t(e.edges):t;n=Array.isArray(n)?n:[n];let r=P6(n,e.isValidConnection,l,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),i=[];for(let e of r)i.push(R3(e));i.length&&e.hooks.edgesChange.trigger(i)},j=(t,n=!0,r=!1)=>{let i=t instanceof Function?t(e.nodes):t,a=Array.isArray(i)?i:[i],o=[],c=[];function u(e){let t=s(e);for(let e of t)(!D6(e.deletable)||e.deletable)&&c.push(B3(e.id,e.source,e.target,e.sourceHandle,e.targetHandle))}function d(t){let r=[];for(let n of e.nodes)n.parentNode===t&&r.push(n);if(r.length){for(let e of r)o.push(z3(e.id));n&&u(r);for(let e of r)d(e.id)}}for(let e of a){let t=typeof e==`string`?l(e):e;t&&(!D6(t.deletable)||t.deletable)&&(o.push(z3(t.id)),n&&u([t]),r&&d(t.id))}c.length&&e.hooks.edgesChange.trigger(c),o.length&&e.hooks.nodesChange.trigger(o)},M=t=>{let n=t instanceof Function?t(e.edges):t,r=Array.isArray(n)?n:[n],i=[];for(let e of r){let t=typeof e==`string`?u(e):e;t&&(!D6(t.deletable)||t.deletable)&&i.push(B3(typeof e==`string`?e:e.id,t.source,t.target,t.sourceHandle,t.targetHandle))}e.hooks.edgesChange.trigger(i)},N=(t,r,i=!0)=>{let a=u(t.id);if(!a)return!1;let o=e.edges.indexOf(a),s=k6(t,r,a,i,e.hooks.error.trigger);if(s){let[t]=P6([s],e.isValidConnection,l,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((e,n)=>n===o?t:e),M6(e.connectionLookup,n.value,[t]),t}return!1},P=(e,t,n={replace:!1})=>{let r=u(e);if(!r)return;let i=typeof t==`function`?t(r):t;r.data=n.replace?i:{...r.data,...i}},F=t=>I3(t,e.nodes),I=t=>{let r=I3(t,e.edges);return M6(e.connectionLookup,n.value,r),r},L=(t,n,r={replace:!1})=>{let i=l(t);if(!i)return;let a=typeof n==`function`?n(i):n;r.replace?e.nodes.splice(e.nodes.indexOf(i),1,a):Object.assign(i,a)},R=(e,t,n={replace:!1})=>{let r=l(e);if(!r)return;let i=typeof t==`function`?t(r):t;r.data=n.replace?i:{...r.data,...i}},ee=(t,n,r=!1)=>{r?e.connectionClickStartHandle=t:e.connectionStartHandle=t,e.connectionEndHandle=null,e.connectionStatus=null,n&&(e.connectionPosition=n)},z=(t,n=null,r=null)=>{e.connectionStartHandle&&(e.connectionPosition=t,e.connectionEndHandle=n,e.connectionStatus=r)},te=(t,n)=>{e.connectionPosition={x:NaN,y:NaN},e.connectionEndHandle=null,e.connectionStatus=null,n?e.connectionClickStartHandle=null:e.connectionStartHandle=null},ne=e=>{let t=c3(e),n=t?null:o3(e)?e:l(e.id);return!t&&!n?[null,null,t]:[t?e:Q4(n),n,t]},B=(t,n=!0,r=e.nodes)=>{let[i,a,o]=ne(t);if(!i)return[];let s=[];for(let t of r||e.nodes){if(!o&&(t.id===a.id||!t.computedPosition))continue;let e=Q4(t),r=$4(e,i);(n&&r>0||r>=e.width*e.height||r>=Number(i.width)*Number(i.height))&&s.push(t)}return s},V=(e,t,n=!0)=>{let[r]=ne(e);if(!r)return!1;let i=$4(r,t);return n&&i>0||i>=Number(r.width)*Number(r.height)},re=t=>{let{viewport:n,dimensions:r,d3Zoom:i,d3Selection:a,translateExtent:o}=e;if(!i||!a||!t.x&&!t.y)return!1;let s=S4.translate(n.x+t.x,n.y+t.y).scale(n.zoom),c=[[0,0],[r.width,r.height]],l=i.constrain()(s,c,o),u=e.viewport.x!==l.x||e.viewport.y!==l.y||e.viewport.zoom!==l.k;return i.transform(a,l),u},H=t=>{let n=t instanceof Function?t(e):t,r=[`d3Zoom`,`d3Selection`,`d3ZoomHandler`,`viewportRef`,`vueFlowRef`,`dimensions`,`hooks`];D6(n.defaultEdgeOptions)&&(e.defaultEdgeOptions=n.defaultEdgeOptions);let i=n.modelValue||n.nodes||n.edges?[]:void 0;i&&(n.modelValue&&i.push(...n.modelValue),n.nodes&&i.push(...n.nodes),n.edges&&i.push(...n.edges),O(i));let a=()=>{D6(n.maxZoom)&&x(n.maxZoom),D6(n.minZoom)&&b(n.minZoom),D6(n.translateExtent)&&S(n.translateExtent)};for(let t of Object.keys(n)){let i=t,a=n[i];![...l8,...r].includes(i)&&D6(a)&&(e[i]=a)}FZ(()=>e.d3Zoom).not.toBeNull().then(a),e.initialized||=!0};return{updateNodePositions:d,updateNodeDimensions:f,setElements:O,setNodes:E,setEdges:D,addNodes:k,addEdges:A,removeNodes:j,removeEdges:M,findNode:l,findEdge:u,updateEdge:N,updateEdgeData:P,updateNode:L,updateNodeData:R,applyEdgeChanges:I,applyNodeChanges:F,addSelectedElements:g,addSelectedNodes:m,addSelectedEdges:h,setMinZoom:b,setMaxZoom:x,setTranslateExtent:S,setNodeExtent:C,setPaneClickDistance:w,removeSelectedElements:y,removeSelectedNodes:_,removeSelectedEdges:v,startConnection:ee,updateConnection:z,endConnection:te,setInteractive:T,setState:H,getIntersectingNodes:B,getIncomers:a,getOutgoers:o,getConnectedEdges:s,getHandleConnections:c,isNodeIntersecting:V,panBy:re,fitView:e=>r.value.fitView(e),zoomIn:e=>r.value.zoomIn(e),zoomOut:e=>r.value.zoomOut(e),zoomTo:(e,t)=>r.value.zoomTo(e,t),setViewport:(e,t)=>r.value.setViewport(e,t),setTransform:(e,t)=>r.value.setTransform(e,t),getViewport:()=>r.value.getViewport(),getTransform:()=>r.value.getTransform(),setCenter:(e,t,n)=>r.value.setCenter(e,t,n),fitBounds:(e,t)=>r.value.fitBounds(e,t),project:e=>r.value.project(e),screenToFlowCoordinate:e=>r.value.screenToFlowCoordinate(e),flowToScreenCoordinate:e=>r.value.flowToScreenCoordinate(e),toObject:()=>{let t=[],n=[];for(let n of e.nodes){let{computedPosition:e,handleBounds:r,selected:i,dimensions:a,isParent:o,resizing:s,dragging:c,events:l,...u}=n;t.push(u)}for(let t of e.edges){let{selected:e,sourceNode:r,targetNode:i,events:a,...o}=t;n.push(o)}return JSON.parse(JSON.stringify({nodes:t,edges:n,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:t=>new Promise(n=>{let{nodes:i,edges:a,position:o,zoom:s,viewport:c}=t;i&&E(i),a&&D(a);let[l,u]=c?.x&&c?.y?[c.x,c.y]:o??[null,null];if(l&&u){let t=c?.zoom||s||e.viewport.zoom;return FZ(()=>r.value.viewportInitialized).toBe(!0).then(()=>{r.value.setViewport({x:l,y:u,zoom:t}).then(()=>{n(!0)})})}n(!0)}),updateNodeInternals:i,viewportHelper:r,$reset:()=>{let t=c8();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){let n=S4.translate(t.defaultViewport.x??0,t.defaultViewport.y??0).scale(t3(t.defaultViewport.zoom??1,t.minZoom,t.maxZoom)),r=e.viewportRef.getBoundingClientRect(),i=[[0,0],[r.width,r.height]],a=e.d3Zoom.constrain()(n,i,t.translateExtent);e.d3Zoom.transform(e.d3Selection,a)}H(t)},$destroy:()=>{}}}var d8=[`data-id`,`data-handleid`,`data-nodeid`,`data-handlepos`],f8=B({name:`Handle`,compatConfig:{MODE:3},props:{id:{default:null},type:{},position:{default:()=>M4.Top},isValidConnection:{type:Function},connectable:{type:[Boolean,Number,String,Function],default:void 0},connectableStart:{type:Boolean,default:!0},connectableEnd:{type:Boolean,default:!0}},setup(e,{expose:t}){let n=O(e,[`position`,`connectable`,`connectableStart`,`connectableEnd`,`id`]),a=o(()=>n.type??`source`),s=o(()=>n.isValidConnection??null),{id:c,connectionStartHandle:l,connectionClickStartHandle:u,connectionEndHandle:d,vueFlowRef:f,nodesConnectable:p,noDragClassName:m,noPanClassName:h}=Y8(),{id:g,node:_,nodeEl:v,connectedEdges:y}=J6(),b=i(),x=o(()=>e.connectableStart===void 0||e.connectableStart),S=o(()=>e.connectableEnd===void 0||e.connectableEnd),C=o(()=>l.value?.nodeId===g&&l.value?.id===e.id&&l.value?.type===a.value||d.value?.nodeId===g&&d.value?.id===e.id&&d.value?.type===a.value),w=o(()=>u.value?.nodeId===g&&u.value?.id===e.id&&u.value?.type===a.value),{handlePointerDown:T,handleClick:E}=K6({nodeId:g,handleId:e.id,isValidConnection:s,type:a}),D=z(()=>typeof e.connectable==`string`&&e.connectable===`single`?!y.value.some(t=>{let n=t[`${a.value}Handle`];return t[a.value]===g?!n||n===e.id:!1}):typeof e.connectable==`number`?y.value.filter(t=>{let n=t[`${a.value}Handle`];return t[a.value]===g?!n||n===e.id:!1}).length<e.connectable:typeof e.connectable==`function`?e.connectable(_,y.value):D6(e.connectable)?e.connectable:p.value);I(()=>{if(!_.dimensions.width||!_.dimensions.height)return;let t=_.handleBounds[a.value]?.find(t=>t.id===e.id);if(!f.value||t)return;let n=f.value.querySelector(`.vue-flow__transformationpane`);if(!v.value||!b.value||!n||!e.id)return;let r=v.value.getBoundingClientRect(),i=b.value.getBoundingClientRect(),o=window.getComputedStyle(n),{m22:s}=new window.DOMMatrixReadOnly(o.transform),c={id:e.id,position:e.position,x:(i.left-r.left)/s,y:(i.top-r.top)/s,type:a.value,nodeId:g,...e3(b.value)};_.handleBounds[a.value]=[..._.handleBounds[a.value]??[],c]});function k(e){let t=a6(e);D.value&&x.value&&(t&&e.button===0||!t)&&T(e)}function A(e){g&&(u.value||x.value)&&D.value&&E(e)}return t({handleClick:E,handlePointerDown:T,onClick:A,onPointerDown:k}),(t,n)=>(V(),P(`div`,{ref_key:`handle`,ref:b,"data-id":`${r(c)}-${r(g)}-${e.id}-${a.value}`,"data-handleid":e.id,"data-nodeid":r(g),"data-handlepos":t.position,class:L([`vue-flow__handle`,[`vue-flow__handle-${t.position}`,`vue-flow__handle-${e.id}`,r(m),r(h),a.value,{connectable:D.value,connecting:w.value,connectablestart:x.value,connectableend:S.value,connectionindicator:D.value&&(x.value&&!C.value||S.value&&C.value)}]]),onMousedown:k,onTouchstartPassive:k,onClick:A},[de(t.$slots,`default`,{id:t.id})],42,d8))}}),p8=function({sourcePosition:e=M4.Bottom,targetPosition:t=M4.Top,label:n,connectable:r=!0,isValidTargetPos:i,isValidSourcePos:a,data:o}){let s=o.label??n;return[v(f8,{type:`target`,position:t,connectable:r,isValidConnection:i}),typeof s!=`string`&&s?v(s):v(H,[s]),v(f8,{type:`source`,position:e,connectable:r,isValidConnection:a})]};p8.props=[`sourcePosition`,`targetPosition`,`label`,`isValidTargetPos`,`isValidSourcePos`,`connectable`,`data`],p8.inheritAttrs=!1,p8.compatConfig={MODE:3};var m8=p8,h8=function({targetPosition:e=M4.Top,label:t,connectable:n=!0,isValidTargetPos:r,data:i}){let a=i.label??t;return[v(f8,{type:`target`,position:e,connectable:n,isValidConnection:r}),typeof a!=`string`&&a?v(a):v(H,[a])]};h8.props=[`targetPosition`,`label`,`isValidTargetPos`,`connectable`,`data`],h8.inheritAttrs=!1,h8.compatConfig={MODE:3};var g8=h8,_8=function({sourcePosition:e=M4.Bottom,label:t,connectable:n=!0,isValidSourcePos:r,data:i}){let a=i.label??t;return[typeof a!=`string`&&a?v(a):v(H,[a]),v(f8,{type:`source`,position:e,connectable:n,isValidConnection:r})]};_8.props=[`sourcePosition`,`label`,`isValidSourcePos`,`connectable`,`data`],_8.inheritAttrs=!1,_8.compatConfig={MODE:3};var v8=_8,y8=[`transform`],b8=[`width`,`height`,`x`,`y`,`rx`,`ry`],x8=[`y`],S8=B({name:`EdgeText`,compatConfig:{MODE:3},props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(e){let t=i({x:0,y:0,width:0,height:0}),n=i(null),r=z(()=>`translate(${e.x-t.value.width/2} ${e.y-t.value.height/2})`);I(a),C([()=>e.x,()=>e.y,n,()=>e.label],a);function a(){if(!n.value)return;let e=n.value.getBBox();(e.width!==t.value.width||e.height!==t.value.height)&&(t.value=e)}return(e,i)=>(V(),P(`g`,{transform:r.value,class:`vue-flow__edge-textwrapper`},[e.labelShowBg?(V(),P(`rect`,{key:0,class:`vue-flow__edge-textbg`,width:`${t.value.width+2*e.labelBgPadding[0]}px`,height:`${t.value.height+2*e.labelBgPadding[1]}px`,x:-e.labelBgPadding[0],y:-e.labelBgPadding[1],style:re(e.labelBgStyle),rx:e.labelBgBorderRadius,ry:e.labelBgBorderRadius},null,12,b8)):K(``,!0),N(`text`,R(e.$attrs,{ref_key:`el`,ref:n,class:`vue-flow__edge-text`,y:t.value.height/2,dy:`0.3em`,style:e.labelStyle}),[de(e.$slots,`default`,{},()=>[typeof e.label==`string`?(V(),P(H,{key:1},[x(W(e.label),1)],64)):(V(),G(ue(e.label),{key:0}))])],16,x8)],8,y8))}}),C8=[`id`,`d`,`marker-end`,`marker-start`],w8=[`d`,`stroke-width`],T8=B({name:`BaseEdge`,inheritAttrs:!1,compatConfig:{MODE:3},props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(e,{expose:t}){let n=i(null),a=i(null),o=i(null),s=D();return t({pathEl:n,interactionEl:a,labelEl:o}),(e,t)=>(V(),P(H,null,[N(`path`,R(r(s),{id:e.id,ref_key:`pathEl`,ref:n,d:e.path,class:`vue-flow__edge-path`,"marker-end":e.markerEnd,"marker-start":e.markerStart}),null,16,C8),e.interactionWidth?(V(),P(`path`,{key:0,ref_key:`interactionEl`,ref:a,fill:`none`,d:e.path,"stroke-width":e.interactionWidth,"stroke-opacity":0,class:`vue-flow__edge-interaction`},null,8,w8)):K(``,!0),e.label&&e.labelX&&e.labelY?(V(),G(S8,{key:1,ref_key:`labelEl`,ref:o,x:e.labelX,y:e.labelY,label:e.label,"label-show-bg":e.labelShowBg,"label-bg-style":e.labelBgStyle,"label-bg-padding":e.labelBgPadding,"label-bg-border-radius":e.labelBgBorderRadius,"label-style":e.labelStyle},null,8,[`x`,`y`,`label`,`label-show-bg`,`label-bg-style`,`label-bg-padding`,`label-bg-border-radius`,`label-style`])):K(``,!0)],64))}});function E8({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function D8({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function O8(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function k8({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){let o,s;switch(e){case M4.Left:o=t-O8(t-r,a),s=n;break;case M4.Right:o=t+O8(r-t,a),s=n;break;case M4.Top:o=t,s=n-O8(n-i,a);break;case M4.Bottom:o=t,s=n+O8(i-n,a)}return[o,s]}function A8(e){let{sourceX:t,sourceY:n,sourcePosition:r=M4.Bottom,targetX:i,targetY:a,targetPosition:o=M4.Top,curvature:s=.25}=e,[c,l]=k8({pos:r,x1:t,y1:n,x2:i,y2:a,c:s}),[u,d]=k8({pos:o,x1:i,y1:a,x2:t,y2:n,c:s}),[f,p,m,h]=D8({sourceX:t,sourceY:n,targetX:i,targetY:a,sourceControlX:c,sourceControlY:l,targetControlX:u,targetControlY:d});return[`M${t},${n} C${c},${l} ${u},${d} ${i},${a}`,f,p,m,h]}function j8({pos:e,x1:t,y1:n,x2:r,y2:i}){let a,o;switch(e){case M4.Left:case M4.Right:a=.5*(t+r),o=n;break;case M4.Top:case M4.Bottom:a=t,o=.5*(n+i)}return[a,o]}function M8(e){let{sourceX:t,sourceY:n,sourcePosition:r=M4.Bottom,targetX:i,targetY:a,targetPosition:o=M4.Top}=e,[s,c]=j8({pos:r,x1:t,y1:n,x2:i,y2:a}),[l,u]=j8({pos:o,x1:i,y1:a,x2:t,y2:n}),[d,f,p,m]=D8({sourceX:t,sourceY:n,targetX:i,targetY:a,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${t},${n} C${s},${c} ${l},${u} ${i},${a}`,d,f,p,m]}var N8={[M4.Left]:{x:-1,y:0},[M4.Right]:{x:1,y:0},[M4.Top]:{x:0,y:-1},[M4.Bottom]:{x:0,y:1}};function P8({source:e,sourcePosition:t=M4.Bottom,target:n}){return t===M4.Left||t===M4.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1}}function F8(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function I8({source:e,sourcePosition:t=M4.Bottom,target:n,targetPosition:r=M4.Top,center:i,offset:a}){let o=N8[t],s=N8[r],c={x:e.x+o.x*a,y:e.y+o.y*a},l={x:n.x+s.x*a,y:n.y+s.y*a},u=P8({source:c,sourcePosition:t,target:l}),d=u.x===0?`y`:`x`,f=u[d],p,m,h,g={x:0,y:0},_={x:0,y:0},[v,y,b,x]=E8({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[d]*s[d]===-1){m=i.x??v,h=i.y??y;let e=[{x:m,y:c.y},{x:m,y:l.y}],t=[{x:c.x,y:h},{x:l.x,y:h}];p=o[d]===f?d===`x`?e:t:d===`x`?t:e}else{let i=[{x:c.x,y:l.y}],u=[{x:l.x,y:c.y}];if(p=d===`x`?o.x===f?u:i:o.y===f?i:u,t===r){let t=Math.abs(e[d]-n[d]);if(t<=a){let r=Math.min(a-1,a-t);o[d]===f?g[d]=(c[d]>e[d]?-1:1)*r:_[d]=(l[d]>n[d]?-1:1)*r}}if(t!==r){let e=d===`x`?`y`:`x`,t=o[d]===s[e],n=c[e]>l[e],r=c[e]<l[e];(o[d]===1&&(!t&&n||t&&r)||o[d]!==1&&(!t&&r||t&&n))&&(p=d===`x`?i:u)}let v={x:c.x+g.x,y:c.y+g.y},y={x:l.x+_.x,y:l.y+_.y};Math.max(Math.abs(v.x-p[0].x),Math.abs(y.x-p[0].x))>=Math.max(Math.abs(v.y-p[0].y),Math.abs(y.y-p[0].y))?(m=(v.x+y.x)/2,h=p[0].y):(m=p[0].x,h=(v.y+y.y)/2)}return[[e,{x:c.x+g.x,y:c.y+g.y},...p,{x:l.x+_.x,y:l.y+_.y},n],m,h,b,x]}function L8(e,t,n,r){let i=Math.min(F8(e,t)/2,F8(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function R8(e){let{sourceX:t,sourceY:n,sourcePosition:r=M4.Bottom,targetX:i,targetY:a,targetPosition:o=M4.Top,borderRadius:s=5,centerX:c,centerY:l,offset:u=20}=e,[d,f,p,m,h]=I8({source:{x:t,y:n},sourcePosition:r,target:{x:i,y:a},targetPosition:o,center:{x:c,y:l},offset:u});return[d.reduce((e,t,n)=>{let r;return r=n>0&&n<d.length-1?L8(d[n-1],t,d[n+1],s):`${n===0?`M`:`L`}${t.x} ${t.y}`,e+=r,e},``),f,p,m,h]}function z8(e){let{sourceX:t,sourceY:n,targetX:r,targetY:i}=e,[a,o,s,c]=E8({sourceX:t,sourceY:n,targetX:r,targetY:i});return[`M ${t},${n}L ${r},${i}`,a,o,s,c]}var B8=B({name:`StraightEdge`,props:[`label`,`labelStyle`,`labelShowBg`,`labelBgStyle`,`labelBgPadding`,`labelBgBorderRadius`,`sourceY`,`sourceX`,`targetX`,`targetY`,`markerEnd`,`markerStart`,`interactionWidth`],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{let[n,r,i]=z8(e);return v(T8,{path:n,labelX:r,labelY:i,...t,...e})}}}),V8=B({name:`SmoothStepEdge`,props:[`sourcePosition`,`targetPosition`,`label`,`labelStyle`,`labelShowBg`,`labelBgStyle`,`labelBgPadding`,`labelBgBorderRadius`,`sourceY`,`sourceX`,`targetX`,`targetY`,`borderRadius`,`markerEnd`,`markerStart`,`interactionWidth`,`offset`],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{let[n,r,i]=R8({...e,sourcePosition:e.sourcePosition??M4.Bottom,targetPosition:e.targetPosition??M4.Top});return v(T8,{path:n,labelX:r,labelY:i,...t,...e})}}}),H8=B({name:`StepEdge`,props:[`sourcePosition`,`targetPosition`,`label`,`labelStyle`,`labelShowBg`,`labelBgStyle`,`labelBgPadding`,`labelBgBorderRadius`,`sourceY`,`sourceX`,`targetX`,`targetY`,`markerEnd`,`markerStart`,`interactionWidth`],setup(e,{attrs:t}){return()=>v(V8,{...e,...t,borderRadius:0})}}),U8=B({name:`BezierEdge`,props:[`sourcePosition`,`targetPosition`,`label`,`labelStyle`,`labelShowBg`,`labelBgStyle`,`labelBgPadding`,`labelBgBorderRadius`,`sourceY`,`sourceX`,`targetX`,`targetY`,`curvature`,`markerEnd`,`markerStart`,`interactionWidth`],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{let[n,r,i]=A8({...e,sourcePosition:e.sourcePosition??M4.Bottom,targetPosition:e.targetPosition??M4.Top});return v(T8,{path:n,labelX:r,labelY:i,...t,...e})}}}),W8=B({name:`SimpleBezierEdge`,props:[`sourcePosition`,`targetPosition`,`label`,`labelStyle`,`labelShowBg`,`labelBgStyle`,`labelBgPadding`,`labelBgBorderRadius`,`sourceY`,`sourceX`,`targetX`,`targetY`,`markerEnd`,`markerStart`,`interactionWidth`],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{let[n,r,i]=M8({...e,sourcePosition:e.sourcePosition??M4.Bottom,targetPosition:e.targetPosition??M4.Top});return v(T8,{path:n,labelX:r,labelY:i,...t,...e})}}}),G8={input:v8,default:m8,output:g8},K8={default:U8,straight:B8,step:H8,smoothstep:V8,simplebezier:W8};function q8(e,t,n){let r=z(()=>e=>t.value.get(e)),i=z(()=>e=>n.value.get(e)),a=z(()=>{let t={...K8,...e.edgeTypes},n=Object.keys(t);for(let r of e.edges)r.type&&!n.includes(r.type)&&(t[r.type]=r.type);return t}),o=z(()=>{let t={...G8,...e.nodeTypes},n=Object.keys(t);for(let r of e.nodes)r.type&&!n.includes(r.type)&&(t[r.type]=r.type);return t}),s=z(()=>e.onlyRenderVisibleElements?C3(e.nodes,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):e.nodes),c=z(()=>{if(e.onlyRenderVisibleElements){let n=[];for(let r of e.edges){let i=t.value.get(r.source),a=t.value.get(r.target);e6({sourcePos:i.computedPosition||{x:0,y:0},targetPos:a.computedPosition||{x:0,y:0},sourceWidth:i.dimensions.width,sourceHeight:i.dimensions.height,targetWidth:a.dimensions.width,targetHeight:a.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&n.push(r)}return n}return e.edges}),l=z(()=>[...s.value,...c.value]),u=z(()=>{let t=[];for(let n of e.nodes)n.selected&&t.push(n);return t}),d=z(()=>{let t=[];for(let n of e.edges)n.selected&&t.push(n);return t}),f=z(()=>[...u.value,...d.value]),p=z(()=>{let t=[];for(let n of e.nodes)n.dimensions.width&&n.dimensions.height&&n.handleBounds!==void 0&&t.push(n);return t});return{getNode:r,getEdge:i,getElements:l,getEdgeTypes:a,getNodeTypes:o,getEdges:c,getNodes:s,getSelectedElements:f,getSelectedNodes:u,getSelectedEdges:d,getNodesInitialized:p,areNodesInitialized:z(()=>s.value.length>0&&p.value.length===s.value.length)}}var J8=class e{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){let t=T()?.appContext.app,n=t?.config.globalProperties.$vueFlowStorage??e.instance;return e.instance=n??new e,t&&(t.config.globalProperties.$vueFlowStorage=e.instance),e.instance}set(e,t){return this.flows.set(e,t)}get(e){return this.flows.get(e)}remove(e){return this.flows.delete(e)}create(e,t){let n=c8(),r=g(n),i={};for(let[e,t]of Object.entries(r.hooks)){let n=`on${e.charAt(0).toUpperCase()+e.slice(1)}`;i[n]=t.on}let a={};for(let[e,t]of Object.entries(r.hooks))a[e]=t.trigger;let o=z(()=>{let e=new Map;for(let t of r.nodes)e.set(t.id,t);return e}),s=z(()=>{let e=new Map;for(let t of r.edges)e.set(t.id,t);return e}),c=q8(r,o,s),l=u8(r,o,s);l.setState({...r,...t});let u={...i,...c,...l,...NZ(r),nodeLookup:o,edgeLookup:s,emits:a,id:e,vueFlowVersion:`1.48.2`,$destroy:()=>{this.remove(e)}};return this.set(e,u),u}getId(){return`vue-flow-${this.currentId++}`}};function Y8(e){let t=J8.getInstance(),n=p(),r=typeof e==`object`,i=r?e:{id:e},a=i.id,o=a??n?.vueFlowId,s;if(n){let e=w(F6,null);e!=null&&(!o||e.id===o)&&(s=e)}if(s||o&&(s=t.get(o)),!s||o&&s.id!==o){let e=a??t.getId(),r=t.create(e,i);s=r,(n??d(!0)).run(()=>{C(r.applyDefault,(e,t,n)=>{let i=e=>{r.applyNodeChanges(e)},a=e=>{r.applyEdgeChanges(e)};e?(r.onNodesChange(i),r.onEdgesChange(a)):(r.hooks.value.nodesChange.off(i),r.hooks.value.edgesChange.off(a)),n(()=>{r.hooks.value.nodesChange.off(i),r.hooks.value.edgesChange.off(a)})},{immediate:!0}),bZ(()=>{if(s){let e=t.get(s.id);e?e.$destroy():C6(`No store instance found for id ${s.id} in storage.`)}})})}else r&&s.setState(i);return n&&(te(F6,s),n.vueFlowId=s.id),r&&T()?.type.name!==`VueFlow`&&s.emits.error(new i6(n6.USEVUEFLOW_OPTIONS)),s}function X8(e){let{emits:t,dimensions:n}=Y8(),r;I(()=>{let i=()=>{var r;if(!e.value||!((r=e.value).checkVisibility?.call(r)??!0))return;let i=e3(e.value);(i.width===0||i.height===0)&&t.error(new i6(n6.MISSING_VIEWPORT_DIMENSIONS)),n.value={width:i.width||500,height:i.height||500}};i(),window.addEventListener(`resize`,i),e.value&&(r=new ResizeObserver(()=>i()),r.observe(e.value)),ne(()=>{window.removeEventListener(`resize`,i),r&&e.value&&r.unobserve(e.value)})})}var Z8=B({name:`UserSelection`,compatConfig:{MODE:3},props:{userSelectionRect:{}},setup(e){return(e,t)=>(V(),P(`div`,{class:`vue-flow__selection vue-flow__container`,style:re({width:`${e.userSelectionRect.width}px`,height:`${e.userSelectionRect.height}px`,transform:`translate(${e.userSelectionRect.x}px, ${e.userSelectionRect.y}px)`})},null,4))}}),Q8=[`tabIndex`],$8=B({name:`NodesSelection`,compatConfig:{MODE:3},setup(e){let{emits:t,viewport:n,getSelectedNodes:a,noPanClassName:o,disableKeyboardA11y:s,userSelectionActive:c}=Y8(),l=Z6(),u=i(null),d=V6({el:u,onStart(e){t.selectionDragStart(e),t.nodeDragStart(e)},onDrag(e){t.selectionDrag(e),t.nodeDrag(e)},onStop(e){t.selectionDragStop(e),t.nodeDragStop(e)}});I(()=>{var e;s.value||(e=u.value)==null||e.focus({preventScroll:!0})});let f=z(()=>S3(a.value)),p=z(()=>({width:`${f.value.width}px`,height:`${f.value.height}px`,top:`${f.value.y}px`,left:`${f.value.x}px`}));function m(e){t.selectionContextMenu({event:e,nodes:a.value})}function h(e){s.value||Z4[e.key]&&(e.preventDefault(),l({x:Z4[e.key].x,y:Z4[e.key].y},e.shiftKey))}return(e,t)=>!r(c)&&f.value.width&&f.value.height?(V(),P(`div`,{key:0,class:L([`vue-flow__nodesselection vue-flow__container`,r(o)]),style:re({transform:`translate(${r(n).x}px,${r(n).y}px) scale(${r(n).zoom})`})},[N(`div`,{ref_key:`el`,ref:u,class:L([{dragging:r(d)},`vue-flow__nodesselection-rect`]),style:re(p.value),tabIndex:r(s)?void 0:-1,onContextmenu:m,onKeydown:h},null,46,Q8)],6)):K(``,!0)}});function e5(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}var t5=B({name:`Pane`,compatConfig:{MODE:3},props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(e){let{vueFlowRef:t,nodes:n,viewport:i,emits:a,userSelectionActive:c,removeSelectedElements:l,userSelectionRect:u,elementsSelectable:d,nodesSelectionActive:f,getSelectedEdges:p,getSelectedNodes:m,removeNodes:h,removeEdges:g,selectionMode:_,deleteKeyCode:v,multiSelectionKeyCode:y,multiSelectionActive:b,edgeLookup:x,nodeLookup:S,connectionLookup:w,defaultEdgeOptions:T,connectionStartHandle:E,panOnDrag:D}=Y8(),O=s(null),k=s(new Set),A=s(new Set),j=s(null),M=o(()=>d.value&&(e.isSelecting||c.value)),N=o(()=>E.value!==null),F=!1,I=!1,R=K4(v,{actInsideInputWithModifier:!1}),ee=K4(y);C(R,e=>{e&&(h(m.value),g(p.value),f.value=!1)}),C(ee,e=>{b.value=e});function z(e,t){return n=>{n.target===t&&e?.(n)}}function te(e){if(F||N.value){F=!1;return}a.paneClick(e),l(),f.value=!1}function ne(e){if(Array.isArray(D.value)&&D.value?.includes(2)){e.preventDefault();return}a.paneContextMenu(e)}function B(e){a.paneScroll(e)}function re(n){var r,i;if(j.value=t.value?.getBoundingClientRect()??null,!d.value||!e.isSelecting||n.button!==0||n.target!==O.value||!j.value)return;(i=(r=n.target)?.setPointerCapture)==null||i.call(r,n.pointerId);let{x:o,y:s}=e5(n,j.value);I=!0,F=!1,l(),u.value={width:0,height:0,startX:o,startY:s,x:o,y:s},a.selectionStart(n)}function H(e){if(!j.value||!u.value)return;F=!0;let{x:t,y:r}=s6(e,j.value),{startX:o=0,startY:s=0}=u.value,l={startX:o,startY:s,x:t<o?t:o,y:r<s?r:s,width:Math.abs(t-o),height:Math.abs(r-s)},d=k.value,p=A.value;k.value=new Set(C3(n.value,l,i.value,_.value===N4.Partial,!0).map(e=>e.id)),A.value=new Set;let m=T.value?.selectable??!0;for(let e of k.value){let t=w.value.get(e);if(t)for(let{edgeId:e}of t.values()){let t=x.value.get(e);t&&(t.selectable??m)&&A.value.add(e)}}if(!N6(d,k.value)){let e=V3(S.value,k.value,!0);a.nodesChange(e)}if(!N6(p,A.value)){let e=V3(x.value,A.value);a.edgesChange(e)}u.value=l,c.value=!0,f.value=!1}function ie(t){var n;t.button===0&&I&&((n=t.target)==null||n.releasePointerCapture(t.pointerId),!c.value&&u.value&&t.target===O.value&&te(t),c.value=!1,u.value=null,f.value=k.value.size>0,a.selectionEnd(t),e.selectionKeyPressed&&(F=!1),I=!1)}return(e,t)=>(V(),P(`div`,{ref_key:`container`,ref:O,class:L([`vue-flow__pane vue-flow__container`,{selection:e.isSelecting}]),onClick:t[0]||=e=>M.value?void 0:z(te,O.value)(e),onContextmenu:t[1]||=e=>z(ne,O.value)(e),onWheelPassive:t[2]||=e=>z(B,O.value)(e),onPointerenter:t[3]||=e=>M.value?void 0:r(a).paneMouseEnter(e),onPointerdown:t[4]||=e=>M.value?re(e):r(a).paneMouseMove(e),onPointermove:t[5]||=e=>M.value?H(e):r(a).paneMouseMove(e),onPointerup:t[6]||=e=>M.value?ie(e):void 0,onPointerleave:t[7]||=e=>r(a).paneMouseLeave(e)},[de(e.$slots,`default`),r(c)&&r(u)?(V(),G(Z8,{key:0,"user-selection-rect":r(u)},null,8,[`user-selection-rect`])):K(``,!0),r(f)&&r(m).length?(V(),G($8,{key:1})):K(``,!0)],34))}}),n5=B({name:`Transform`,compatConfig:{MODE:3},setup(e){let{viewport:t,fitViewOnInit:n,fitViewOnInitDone:r}=Y8(),i=z(()=>n.value?!r.value:!1),a=z(()=>`translate(${t.value.x}px,${t.value.y}px) scale(${t.value.zoom})`);return(e,t)=>(V(),P(`div`,{class:`vue-flow__transformationpane vue-flow__container`,style:re({transform:a.value,opacity:i.value?0:void 0})},[de(e.$slots,`default`)],4))}}),r5=B({name:`Viewport`,compatConfig:{MODE:3},setup(e){let{minZoom:t,maxZoom:n,defaultViewport:i,translateExtent:a,zoomActivationKeyCode:c,selectionKeyCode:l,panActivationKeyCode:u,panOnScroll:d,panOnScrollMode:f,panOnScrollSpeed:p,panOnDrag:m,zoomOnDoubleClick:h,zoomOnPinch:g,zoomOnScroll:_,preventScrolling:v,noWheelClassName:y,noPanClassName:x,emits:S,connectionStartHandle:w,userSelectionActive:T,paneDragging:E,d3Zoom:D,d3Selection:O,d3ZoomHandler:k,viewport:A,viewportRef:j,paneClickDistance:M}=Y8();X8(j);let N=s(!1),F=s(!1),R=null,ee=!1,z=0,te={x:0,y:0,zoom:0},ne=K4(u),B=K4(l),re=K4(c),H=o(()=>(!B.value||B.value&&l.value===!0)&&(ne.value||m.value)),ie=o(()=>ne.value||d.value),W=o(()=>l.value===!0&&H.value!==!0),ae=o(()=>B.value&&l.value!==!0||T.value||W.value),oe=o(()=>w.value!==null);I(()=>{if(!j.value){C6(`Viewport element is missing`);return}let e=j.value,r=e.getBoundingClientRect(),o=j4().clickDistance(M.value).scaleExtent([t.value,n.value]).translateExtent(a.value),s=J$(e).call(o),c=s.on(`wheel.zoom`),u=S4.translate(i.value.x??0,i.value.y??0).scale(t3(i.value.zoom??1,t.value,n.value)),b=[[0,0],[r.width,r.height]],w=o.constrain()(u,b,a.value);o.transform(s,w),o.wheelDelta(M3),D.value=o,O.value=s,k.value=c,A.value={x:w.x,y:w.y,zoom:w.k},o.on(`start`,e=>{if(!e.sourceEvent)return null;z=e.sourceEvent.button,N.value=!0;let t=le(e.transform);e.sourceEvent?.type===`mousedown`&&(E.value=!0),te=t,S.viewportChangeStart(t),S.moveStart({event:e,flowTransform:t})}),o.on(`end`,e=>{if(!e.sourceEvent)return null;if(N.value=!1,E.value=!1,se(H.value,z??0)&&!ee&&S.paneContextMenu(e.sourceEvent),ee=!1,ce(te,e.transform)){let t=le(e.transform);te=t,S.viewportChangeEnd(t),S.moveEnd({event:e,flowTransform:t})}}),o.filter(e=>{let t=re.value||_.value,n=g.value&&e.ctrlKey,r=e.button,i=e.type===`wheel`;if(r===1&&e.type===`mousedown`&&(G(e,`vue-flow__node`)||G(e,`vue-flow__edge`)))return!0;if(!H.value&&!t&&!ie.value&&!h.value&&!g.value||T.value||oe.value&&!i||!h.value&&e.type===`dblclick`||G(e,y.value)&&i||G(e,x.value)&&(!i||ie.value&&i&&!re.value)||!g.value&&e.ctrlKey&&i||!t&&!ie.value&&!n&&i)return!1;if(!g&&e.type===`touchstart`&&e.touches?.length>1)return e.preventDefault(),!1;if(!H.value&&(e.type===`mousedown`||e.type===`touchstart`)||W.value&&Array.isArray(m.value)&&m.value.includes(0)&&r===0||Array.isArray(m.value)&&!m.value.includes(r)&&(e.type===`mousedown`||e.type===`touchstart`))return!1;let a=Array.isArray(m.value)&&m.value.includes(r)||l.value===!0&&Array.isArray(m.value)&&!m.value.includes(0)||!r||r<=1;return(!e.ctrlKey||ne.value||i)&&a}),C([T,H],()=>{T.value&&!N.value?o.on(`zoom`,null):T.value||o.on(`zoom`,e=>{A.value={x:e.transform.x,y:e.transform.y,zoom:e.transform.k};let t=le(e.transform);ee=se(H.value,z??0),S.viewportChange(t),S.move({event:e,flowTransform:t})})},{immediate:!0}),C([T,ie,f,re,g,v,y],()=>{ie.value&&!re.value&&!T.value?s.on(`wheel.zoom`,e=>{if(G(e,y.value))return!1;let t=re.value||_.value,n=g.value&&e.ctrlKey;if(!(!v.value||ie.value||t||n))return!1;e.preventDefault(),e.stopImmediatePropagation();let r=s.property(`__zoom`).k||1,i=c6();if(!ne.value&&e.ctrlKey&&g.value&&i){let t=X$(e),n=r*2**M3(e);o.scaleTo(s,n,t,e);return}let a=e.deltaMode===1?20:1,c=f.value===L4.Vertical?0:e.deltaX*a,l=f.value===L4.Horizontal?0:e.deltaY*a;!i&&e.shiftKey&&f.value!==L4.Vertical&&!c&&l&&(c=l,l=0),o.translateBy(s,-(c/r)*p.value,-(l/r)*p.value);let u=le(s.property(`__zoom`));R&&clearTimeout(R),F.value?(S.move({event:e,flowTransform:u}),S.viewportChange(u),R=setTimeout(()=>{S.moveEnd({event:e,flowTransform:u}),S.viewportChangeEnd(u),F.value=!1},150)):(F.value=!0,S.moveStart({event:e,flowTransform:u}),S.viewportChangeStart(u))},{passive:!1}):c!==void 0&&s.on(`wheel.zoom`,function(e,t){let n=!v.value&&e.type===`wheel`&&!e.ctrlKey,r=re.value||_.value,i=g.value&&e.ctrlKey;if(!r&&!d.value&&!i&&e.type===`wheel`||n||G(e,y.value))return null;e.preventDefault(),c.call(this,e,t)},{passive:!1})},{immediate:!0})});function se(e,t){return t===2&&Array.isArray(e)&&e.includes(2)}function ce(e,t){return e.x!==t.x&&!Number.isNaN(t.x)||e.y!==t.y&&!Number.isNaN(t.y)||e.zoom!==t.k&&!Number.isNaN(t.k)}function le(e){return{x:e.x,y:e.y,zoom:e.k}}function G(e,t){return e.target.closest(`.${t}`)}return(e,t)=>(V(),P(`div`,{ref_key:`viewportRef`,ref:j,class:`vue-flow__viewport vue-flow__container`},[b(t5,{"is-selecting":ae.value,"selection-key-pressed":r(B),class:L({connecting:oe.value,dragging:r(E),draggable:r(m)===!0||Array.isArray(r(m))&&r(m).includes(0)})},{default:U(()=>[b(n5,null,{default:U(()=>[de(e.$slots,`default`)]),_:3})]),_:3},8,[`is-selecting`,`selection-key-pressed`,`class`])],512))}}),i5=[`id`],a5=[`id`],o5=[`id`],s5=B({name:`A11yDescriptions`,compatConfig:{MODE:3},setup(e){let{id:t,disableKeyboardA11y:n,ariaLiveMessage:i}=Y8();return(e,a)=>(V(),P(H,null,[N(`div`,{id:`${r(q4)}-${r(t)}`,style:{display:`none`}},` Press enter or space to select a node. `+W(r(n)?``:`You can then use the arrow keys to move the node around.`)+` You can then use the arrow keys to move the node around, press delete to remove it and press escape to cancel. `,9,i5),N(`div`,{id:`${r(J4)}-${r(t)}`,style:{display:`none`}},` Press enter or space to select an edge. You can then press delete to remove it or press escape to cancel. `,8,a5),r(n)?K(``,!0):(V(),P(`div`,{key:0,id:`${r(Y4)}-${r(t)}`,"aria-live":`assertive`,"aria-atomic":`true`,style:{position:`absolute`,width:`1px`,height:`1px`,margin:`-1px`,border:`0`,padding:`0`,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,"clip-path":`inset(100%)`}},W(r(i)),9,o5))],64))}});function c5(){let e=Y8();C(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function l5(e,t,n){return n===M4.Left?e-t:n===M4.Right?e+t:e}function u5(e,t,n){return n===M4.Top?e-t:n===M4.Bottom?e+t:e}var d5=function({radius:e=10,centerX:t=0,centerY:n=0,position:r=M4.Top,type:i}){return v(`circle`,{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${i}`,cx:l5(t,e,r),cy:u5(n,e,r),r:e,stroke:`transparent`,fill:`transparent`})};d5.props=[`radius`,`centerX`,`centerY`,`position`,`type`],d5.compatConfig={MODE:3};var f5=d5,p5=B({name:`Edge`,compatConfig:{MODE:3},props:[`id`],setup(e){let{id:t,addSelectedEdges:n,connectionMode:r,edgeUpdaterRadius:a,emits:s,nodesSelectionActive:c,noPanClassName:l,getEdgeTypes:u,removeSelectedEdges:d,findEdge:f,findNode:p,isValidConnection:m,multiSelectionActive:h,disableKeyboardA11y:g,elementsSelectable:_,edgesUpdatable:y,edgesFocusable:b,hooks:x}=Y8(),S=z(()=>f(e.id)),{emit:C,on:E}=U6(S.value,s),D=w(B6),O=T(),A=i(!1),j=i(!1),M=i(``),N=i(null),P=i(`source`),F=i(null),I=o(()=>S.value.selectable===void 0?_.value:S.value.selectable),L=o(()=>S.value.updatable===void 0?y.value:S.value.updatable),R=o(()=>S.value.focusable===void 0?b.value:S.value.focusable);te(R6,e.id),te(z6,F);let ee=z(()=>S.value.class instanceof Function?S.value.class(S.value):S.value.class),ne=z(()=>S.value.style instanceof Function?S.value.style(S.value):S.value.style),B=z(()=>{let e=S.value.type||`default`,t=D?.[`edge-${e}`];if(t)return t;let n=S.value.template??u.value[e];if(typeof n==`string`&&O){let t=Object.keys(O.appContext.components);t&&t.includes(e)&&(n=k(e,!1))}return n&&typeof n!=`string`?n:(s.error(new i6(n6.EDGE_TYPE_MISSING,n)),!1)}),{handlePointerDown:V}=K6({nodeId:M,handleId:N,type:P,isValidConnection:m,edgeUpdaterType:P,onEdgeUpdate:ie,onEdgeUpdateEnd:U});return()=>{let n=p(S.value.source),i=p(S.value.target),o=`pathOptions`in S.value?S.value.pathOptions:{};if(!n&&!i)return s.error(new i6(n6.EDGE_SOURCE_TARGET_MISSING,S.value.id,S.value.source,S.value.target)),null;if(!n)return s.error(new i6(n6.EDGE_SOURCE_MISSING,S.value.id,S.value.source)),null;if(!i)return s.error(new i6(n6.EDGE_TARGET_MISSING,S.value.id,S.value.target)),null;if(!S.value||S.value.hidden||n.hidden||i.hidden)return null;let c;c=r.value===F4.Strict?n.handleBounds.source:[...n.handleBounds.source||[],...n.handleBounds.target||[]];let d=$3(c,S.value.sourceHandle),f;f=r.value===F4.Strict?i.handleBounds.target:[...i.handleBounds.target||[],...i.handleBounds.source||[]];let m=$3(f,S.value.targetHandle),h=d?.position||M4.Bottom,g=m?.position||M4.Top,{x:_,y}=Q3(n,d,h),{x:b,y:C}=Q3(i,m,g);return S.value.sourceX=_,S.value.sourceY=y,S.value.targetX=b,S.value.targetY=C,v(`g`,{ref:F,key:e.id,"data-id":e.id,class:[`vue-flow__edge`,`vue-flow__edge-${B.value===!1?`default`:S.value.type||`default`}`,l.value,ee.value,{updating:A.value,selected:S.value.selected,animated:S.value.animated,inactive:!I.value&&!x.value.edgeClick.hasListeners()}],tabIndex:R.value?0:void 0,"aria-label":S.value.ariaLabel===null?void 0:S.value.ariaLabel??`Edge from ${S.value.source} to ${S.value.target}`,"aria-describedby":R.value?`${J4}-${t}`:void 0,"aria-roledescription":`edge`,role:R.value?`group`:`img`,...S.value.domAttributes,onClick:ae,onContextmenu:oe,onDblclick:se,onMouseenter:ce,onMousemove:le,onMouseleave:G,onKeyDown:R.value?K:void 0},[j.value?null:v(B.value===!1?u.value.default:B.value,{id:e.id,sourceNode:n,targetNode:i,source:S.value.source,target:S.value.target,type:S.value.type,updatable:L.value,selected:S.value.selected,animated:S.value.animated,label:S.value.label,labelStyle:S.value.labelStyle,labelShowBg:S.value.labelShowBg,labelBgStyle:S.value.labelBgStyle,labelBgPadding:S.value.labelBgPadding,labelBgBorderRadius:S.value.labelBgBorderRadius,data:S.value.data,events:{...S.value.events,...E},style:ne.value,markerStart:`url('#${j3(S.value.markerStart,t)}')`,markerEnd:`url('#${j3(S.value.markerEnd,t)}')`,sourcePosition:h,targetPosition:g,sourceX:_,sourceY:y,targetX:b,targetY:C,sourceHandleId:S.value.sourceHandle,targetHandleId:S.value.targetHandle,interactionWidth:S.value.interactionWidth,...o}),[L.value===`source`||L.value===!0?[v(`g`,{onMousedown:ue,onMouseenter:re,onMouseout:H},v(f5,{position:h,centerX:_,centerY:y,radius:a.value,type:`source`,"data-type":`source`}))]:null,L.value===`target`||L.value===!0?[v(`g`,{onMousedown:de,onMouseenter:re,onMouseout:H},v(f5,{position:g,centerX:b,centerY:C,radius:a.value,type:`target`,"data-type":`target`}))]:null]])};function re(){A.value=!0}function H(){A.value=!1}function ie(e,t){C.update({event:e,edge:S.value,connection:t})}function U(e){C.updateEnd({event:e,edge:S.value}),j.value=!1}function W(e,t){e.button===0&&(j.value=!0,M.value=t?S.value.target:S.value.source,N.value=(t?S.value.targetHandle:S.value.sourceHandle)??null,P.value=t?`target`:`source`,C.updateStart({event:e,edge:S.value}),V(e))}function ae(e){var t;let r={event:e,edge:S.value};I.value&&(c.value=!1,S.value.selected&&h.value?(d([S.value]),(t=F.value)==null||t.blur()):n([S.value])),C.click(r)}function oe(e){C.contextMenu({event:e,edge:S.value})}function se(e){C.doubleClick({event:e,edge:S.value})}function ce(e){C.mouseEnter({event:e,edge:S.value})}function le(e){C.mouseMove({event:e,edge:S.value})}function G(e){C.mouseLeave({event:e,edge:S.value})}function ue(e){W(e,!0)}function de(e){W(e,!1)}function K(t){var r;!g.value&&X4.includes(t.key)&&I.value&&(t.key===`Escape`?((r=F.value)==null||r.blur(),d([f(e.id)])):n([f(e.id)]))}}}),m5=B({name:`ConnectionLine`,compatConfig:{MODE:3},setup(){let{id:e,connectionMode:t,connectionStartHandle:n,connectionEndHandle:r,connectionPosition:i,connectionLineType:a,connectionLineStyle:o,connectionLineOptions:s,connectionStatus:c,viewport:l,findNode:u}=Y8(),d=w(B6)?.[`connection-line`],f=z(()=>u(n.value?.nodeId)),p=z(()=>u(r.value?.nodeId)??null),m=z(()=>({x:(i.value.x-l.value.x)/l.value.zoom,y:(i.value.y-l.value.y)/l.value.zoom})),h=z(()=>s.value.markerStart?`url(#${j3(s.value.markerStart,e)})`:``),g=z(()=>s.value.markerEnd?`url(#${j3(s.value.markerEnd,e)})`:``);return()=>{if(!f.value||!n.value)return null;let e=n.value.id,i=n.value.type,l=f.value.handleBounds,u=l?.[i]??[];if(t.value===F4.Loose){let e=l?.[i===`source`?`target`:`source`]??[];u=[...u,...e]}if(!u)return null;let _=(e?u.find(t=>t.id===e):u[0])??null,y=_?.position??M4.Top,{x:b,y:x}=Q3(f.value,_,y),S=null;p.value&&(S=t.value===F4.Strict?p.value.handleBounds[i===`source`?`target`:`source`]?.find(e=>e.id===r.value?.id)||null:[...p.value.handleBounds.source??[],...p.value.handleBounds.target??[]].find(e=>e.id===r.value?.id)||null);let C=r.value?.position??(y?x6[y]:null);if(!y||!C)return null;let w=a.value??s.value.type??P4.Bezier,T=``,E={sourceX:b,sourceY:x,sourcePosition:y,targetX:m.value.x,targetY:m.value.y,targetPosition:C};return w===P4.Bezier?[T]=A8(E):w===P4.Step?[T]=R8({...E,borderRadius:0}):w===P4.SmoothStep?[T]=R8(E):w===P4.SimpleBezier?[T]=M8(E):T=`M${b},${x} ${m.value.x},${m.value.y}`,v(`svg`,{class:`vue-flow__edges vue-flow__connectionline vue-flow__container`},v(`g`,{class:`vue-flow__connection`},d?v(d,{sourceX:b,sourceY:x,sourcePosition:y,targetX:m.value.x,targetY:m.value.y,targetPosition:C,sourceNode:f.value,sourceHandle:_,targetNode:p.value,targetHandle:S,markerEnd:g.value,markerStart:h.value,connectionStatus:c.value}):v(`path`,{d:T,class:[s.value.class,c.value,`vue-flow__connection-path`],style:{...o.value,...s.value.style},"marker-end":g.value,"marker-start":h.value})))}}}),h5=[`id`,`markerWidth`,`markerHeight`,`markerUnits`,`orient`],g5=B({name:`MarkerType`,compatConfig:{MODE:3},props:{id:{},type:{},color:{default:`none`},width:{default:12.5},height:{default:12.5},markerUnits:{default:`strokeWidth`},orient:{default:`auto-start-reverse`},strokeWidth:{default:1}},setup(e){return(e,t)=>(V(),P(`marker`,{id:e.id,class:`vue-flow__arrowhead`,viewBox:`-10 -10 20 20`,refX:`0`,refY:`0`,markerWidth:`${e.width}`,markerHeight:`${e.height}`,markerUnits:e.markerUnits,orient:e.orient},[e.type===r(I4).ArrowClosed?(V(),P(`polyline`,{key:0,style:re({stroke:e.color,fill:e.color,strokeWidth:e.strokeWidth}),"stroke-linecap":`round`,"stroke-linejoin":`round`,points:`-5,-4 0,0 -5,4 -5,-4`},null,4)):K(``,!0),e.type===r(I4).Arrow?(V(),P(`polyline`,{key:1,style:re({stroke:e.color,strokeWidth:e.strokeWidth}),"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`,points:`-5,-4 0,0 -5,4`},null,4)):K(``,!0)],8,h5))}}),_5={class:`vue-flow__marker vue-flow__container`,"aria-hidden":`true`},v5=B({name:`MarkerDefinitions`,compatConfig:{MODE:3},setup(e){let{id:t,edges:n,connectionLineOptions:r,defaultMarkerColor:i}=Y8(),a=z(()=>{let e=new Set,a=[],o=n=>{if(n){let r=j3(n,t);e.has(r)||(typeof n==`object`?a.push({...n,id:r,color:n.color||i.value}):a.push({id:r,color:i.value,type:n}),e.add(r))}};for(let e of[r.value.markerEnd,r.value.markerStart])o(e);for(let e of n.value)for(let t of[e.markerStart,e.markerEnd])o(t);return a.sort((e,t)=>e.id.localeCompare(t.id))});return(e,t)=>(V(),P(`svg`,_5,[N(`defs`,null,[(V(!0),P(H,null,F(a.value,e=>(V(),G(g5,{id:e.id,key:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,"stroke-width":e.strokeWidth,orient:e.orient},null,8,[`id`,`type`,`color`,`width`,`height`,`markerUnits`,`stroke-width`,`orient`]))),128))])]))}}),y5=B({name:`Edges`,compatConfig:{MODE:3},setup(e){let{findNode:t,getEdges:n,elevateEdgesOnSelect:i}=Y8();return(e,a)=>(V(),P(H,null,[b(v5),(V(!0),P(H,null,F(r(n),e=>(V(),P(`svg`,{key:e.id,class:`vue-flow__edges vue-flow__container`,style:re({zIndex:r(t6)(e,r(t),r(i))})},[b(r(p5),{id:e.id},null,8,[`id`])],4))),128)),b(r(m5))],64))}}),b5=B({name:`Node`,compatConfig:{MODE:3},props:[`id`,`resizeObserver`],setup(e){let{id:t,noPanClassName:n,selectNodesOnDrag:r,nodesSelectionActive:a,multiSelectionActive:s,emits:c,removeSelectedNodes:l,addSelectedNodes:u,updateNodeDimensions:d,onUpdateNodeInternals:f,getNodeTypes:p,nodeExtent:m,elevateNodesOnSelect:h,disableKeyboardA11y:g,ariaLiveMessage:_,snapToGrid:y,snapGrid:b,nodeDragThreshold:x,nodesDraggable:S,elementsSelectable:E,nodesConnectable:D,nodesFocusable:O,hooks:A}=Y8(),j=i(null);te(L6,j),te(I6,e.id);let M=w(B6),N=T(),P=Z6(),{node:F,parentNode:L}=J6(e.id),{emit:R,on:ee}=X6(F,c),ne=o(()=>F.draggable===void 0?S.value:F.draggable),B=o(()=>F.selectable===void 0?E.value:F.selectable),V=o(()=>F.connectable===void 0?D.value:F.connectable),re=o(()=>F.focusable===void 0?O.value:F.focusable),H=z(()=>B.value||ne.value||A.value.nodeClick.hasListeners()||A.value.nodeDoubleClick.hasListeners()||A.value.nodeMouseEnter.hasListeners()||A.value.nodeMouseMove.hasListeners()||A.value.nodeMouseLeave.hasListeners()),ie=o(()=>!!F.dimensions.width&&!!F.dimensions.height),U=z(()=>{let e=F.type||`default`,t=M?.[`node-${e}`];if(t)return t;let n=F.template||p.value[e];if(typeof n==`string`&&N){let t=Object.keys(N.appContext.components);t&&t.includes(e)&&(n=k(e,!1))}return n&&typeof n!=`string`?n:(c.error(new i6(n6.NODE_TYPE_MISSING,n)),!1)}),W=V6({id:e.id,el:j,disabled:()=>!ne.value,selectable:B,dragHandle:()=>F.dragHandle,onStart(e){R.dragStart(e)},onDrag(e){R.drag(e)},onStop(e){R.dragStop(e)},onClick(e){me(e)}}),ae=z(()=>F.class instanceof Function?F.class(F):F.class),oe=z(()=>{let e=(F.style instanceof Function?F.style(F):F.style)||{},t=F.width instanceof Function?F.width(F):F.width,n=F.height instanceof Function?F.height(F):F.height;return!e.width&&t&&(e.width=typeof t==`string`?t:`${t}px`),!e.height&&n&&(e.height=typeof n==`string`?n:`${n}px`),e}),se=o(()=>Number(F.zIndex??oe.value.zIndex??0));return f(t=>{(t.includes(e.id)||!t.length)&&G()}),I(()=>{C(()=>F.hidden,(t=!1,n,r)=>{!t&&j.value&&(e.resizeObserver.observe(j.value),r(()=>{j.value&&e.resizeObserver.unobserve(j.value)}))},{immediate:!0,flush:`post`})}),C([()=>F.type,()=>F.sourcePosition,()=>F.targetPosition],()=>{ce(()=>{d([{id:e.id,nodeElement:j.value,forceUpdate:!0}])})}),C([()=>F.position.x,()=>F.position.y,()=>L.value?.computedPosition.x,()=>L.value?.computedPosition.y,()=>L.value?.computedPosition.z,se,()=>F.selected,()=>F.dimensions.height,()=>F.dimensions.width,()=>L.value?.dimensions.height,()=>L.value?.dimensions.width],([e,t,n,r,i,a])=>{let o={x:e,y:t,z:a+(h.value&&F.selected?1e3:0)};n!==void 0&&r!==void 0?F.computedPosition=k3({x:n,y:r,z:i},o):F.computedPosition=o},{flush:`post`,immediate:!0}),C([()=>F.extent,m],([e,t],[n,r])=>{(e!==n||t!==r)&&le()}),F.extent===`parent`||typeof F.extent==`object`&&`range`in F.extent&&F.extent.range===`parent`?FZ(()=>ie).toBe(!0).then(le):le(),()=>F.hidden?null:v(`div`,{ref:j,"data-id":F.id,class:[`vue-flow__node`,`vue-flow__node-${U.value===!1?`default`:F.type||`default`}`,{[n.value]:ne.value,dragging:W?.value,draggable:ne.value,selected:F.selected,selectable:B.value,parent:F.isParent},ae.value],style:{visibility:ie.value?`visible`:`hidden`,zIndex:F.computedPosition.z??se.value,transform:`translate(${F.computedPosition.x}px,${F.computedPosition.y}px)`,pointerEvents:H.value?`all`:`none`,...oe.value},tabIndex:re.value?0:void 0,role:re.value?`group`:void 0,"aria-describedby":g.value?void 0:`${q4}-${t}`,"aria-label":F.ariaLabel,"aria-roledescription":`node`,...F.domAttributes,onMouseenter:ue,onMousemove:de,onMouseleave:K,onContextmenu:fe,onClick:me,onDblclick:pe,onKeydown:he},[v(U.value===!1?p.value.default:U.value,{id:F.id,type:F.type,data:F.data,events:{...F.events,...ee},selected:F.selected,resizing:F.resizing,dragging:W.value,connectable:V.value,position:F.computedPosition,dimensions:F.dimensions,isValidTargetPos:F.isValidTargetPos,isValidSourcePos:F.isValidSourcePos,parent:F.parentNode,parentNodeId:F.parentNode,zIndex:F.computedPosition.z??se.value,targetPosition:F.targetPosition,sourcePosition:F.sourcePosition,label:F.label,dragHandle:F.dragHandle,onUpdateNodeInternals:G})]);function le(){let e=F.computedPosition,{computedPosition:t,position:n}=Z3(F,y.value?u6(e,b.value):e,c.error,m.value,L.value);(F.computedPosition.x!==t.x||F.computedPosition.y!==t.y)&&(F.computedPosition={...F.computedPosition,...t}),(F.position.x!==n.x||F.position.y!==n.y)&&(F.position=n)}function G(){j.value&&d([{id:e.id,nodeElement:j.value,forceUpdate:!0}])}function ue(e){W?.value||R.mouseEnter({event:e,node:F})}function de(e){W?.value||R.mouseMove({event:e,node:F})}function K(e){W?.value||R.mouseLeave({event:e,node:F})}function fe(e){return R.contextMenu({event:e,node:F})}function pe(e){return R.doubleClick({event:e,node:F})}function me(e){B.value&&(!r.value||!ne.value||x.value>0)&&E6(F,s.value,u,l,a,!1,j.value),R.click({event:e,node:F})}function he(e){if(!(V4(e)||g.value)){if(X4.includes(e.key)&&B.value){let t=e.key===`Escape`;E6(F,s.value,u,l,a,t,j.value)}else ne.value&&F.selected&&Z4[e.key]&&(e.preventDefault(),_.value=`Moved selected node ${e.key.replace(`Arrow`,``).toLowerCase()}. New position, x: ${~~F.position.x}, y: ${~~F.position.y}`,P({x:Z4[e.key].x,y:Z4[e.key].y},e.shiftKey))}}}});function x5(e={includeHiddenNodes:!1}){let{nodes:t}=Y8();return z(()=>{if(t.value.length===0)return!1;for(let n of t.value)if((e.includeHiddenNodes||!n.hidden)&&(n?.handleBounds===void 0||n.dimensions.width===0||n.dimensions.height===0))return!1;return!0})}var S5={class:`vue-flow__nodes vue-flow__container`},C5=B({name:`Nodes`,compatConfig:{MODE:3},setup(e){let{getNodes:t,updateNodeDimensions:n,emits:a}=Y8(),o=x5(),s=i();return C(o,e=>{e&&ce(()=>{a.nodesInitialized(t.value)})},{immediate:!0}),I(()=>{s.value=new ResizeObserver(e=>{let t=e.map(e=>({id:e.target.getAttribute(`data-id`),nodeElement:e.target,forceUpdate:!0}));ce(()=>n(t))})}),ne(()=>s.value?.disconnect()),(e,n)=>(V(),P(`div`,S5,[s.value?(V(!0),P(H,{key:0},F(r(t),(e,t,n,i)=>{let a=[e.id];if(i&&i.key===e.id&&j(i,a))return i;let o=(V(),G(r(b5),{id:e.id,key:e.id,"resize-observer":s.value},null,8,[`id`,`resize-observer`]));return o.memo=a,o},n,0),128)):K(``,!0)]))}});function w5(){let{emits:e}=Y8();I(()=>{if(w6()){let t=document.querySelector(`.vue-flow__pane`);t&&window.getComputedStyle(t).zIndex!==`1`&&e.error(new i6(n6.MISSING_STYLES))}})}var T5=N(`div`,{class:`vue-flow__edge-labels`},null,-1),E5=B({name:`VueFlow`,compatConfig:{MODE:3},props:{id:{},modelValue:{},nodes:{},edges:{},edgeTypes:{},nodeTypes:{},connectionMode:{},connectionLineType:{},connectionLineStyle:{default:void 0},connectionLineOptions:{default:void 0},connectionRadius:{},isValidConnection:{type:[Function,null],default:void 0},deleteKeyCode:{default:void 0},selectionKeyCode:{type:[Boolean,null],default:void 0},multiSelectionKeyCode:{default:void 0},zoomActivationKeyCode:{default:void 0},panActivationKeyCode:{default:void 0},snapToGrid:{type:Boolean,default:void 0},snapGrid:{},onlyRenderVisibleElements:{type:Boolean,default:void 0},edgesUpdatable:{type:[Boolean,String],default:void 0},nodesDraggable:{type:Boolean,default:void 0},nodesConnectable:{type:Boolean,default:void 0},nodeDragThreshold:{},elementsSelectable:{type:Boolean,default:void 0},selectNodesOnDrag:{type:Boolean,default:void 0},panOnDrag:{type:[Boolean,Array],default:void 0},minZoom:{},maxZoom:{},defaultViewport:{},translateExtent:{},nodeExtent:{},defaultMarkerColor:{},zoomOnScroll:{type:Boolean,default:void 0},zoomOnPinch:{type:Boolean,default:void 0},panOnScroll:{type:Boolean,default:void 0},panOnScrollSpeed:{},panOnScrollMode:{},paneClickDistance:{},zoomOnDoubleClick:{type:Boolean,default:void 0},preventScrolling:{type:Boolean,default:void 0},selectionMode:{},edgeUpdaterRadius:{},fitViewOnInit:{type:Boolean,default:void 0},connectOnClick:{type:Boolean,default:void 0},applyDefault:{type:Boolean,default:void 0},autoConnect:{type:[Boolean,Function],default:void 0},noDragClassName:{},noWheelClassName:{},noPanClassName:{},defaultEdgeOptions:{},elevateEdgesOnSelect:{type:Boolean,default:void 0},elevateNodesOnSelect:{type:Boolean,default:void 0},disableKeyboardA11y:{type:Boolean,default:void 0},edgesFocusable:{type:Boolean,default:void 0},nodesFocusable:{type:Boolean,default:void 0},autoPanOnConnect:{type:Boolean,default:void 0},autoPanOnNodeDrag:{type:Boolean,default:void 0},autoPanSpeed:{}},emits:`nodesChange.edgesChange.nodesInitialized.paneReady.init.updateNodeInternals.error.connect.connectStart.connectEnd.clickConnectStart.clickConnectEnd.moveStart.move.moveEnd.selectionDragStart.selectionDrag.selectionDragStop.selectionContextMenu.selectionStart.selectionEnd.viewportChangeStart.viewportChange.viewportChangeEnd.paneScroll.paneClick.paneContextMenu.paneMouseEnter.paneMouseMove.paneMouseLeave.edgeUpdate.edgeContextMenu.edgeMouseEnter.edgeMouseMove.edgeMouseLeave.edgeDoubleClick.edgeClick.edgeUpdateStart.edgeUpdateEnd.nodeContextMenu.nodeMouseEnter.nodeMouseMove.nodeMouseLeave.nodeDoubleClick.nodeClick.nodeDragStart.nodeDrag.nodeDragStop.miniMapNodeClick.miniMapNodeDoubleClick.miniMapNodeMouseEnter.miniMapNodeMouseMove.miniMapNodeMouseLeave.update:modelValue.update:nodes.update:edges`.split(`.`),setup(e,{expose:t,emit:n}){let i=e,a=E(),o=HZ(i,`modelValue`,n),s=HZ(i,`nodes`,n),c=HZ(i,`edges`,n),l=Y8(i),u=i8({modelValue:o,nodes:s,edges:c},i,l);return o8(n,l.hooks),c5(),w5(),te(B6,a),ee(u),t(l),(e,t)=>(V(),P(`div`,{ref:r(l).vueFlowRef,class:`vue-flow`},[b(r5,null,{default:U(()=>[b(y5),T5,b(C5),de(e.$slots,`zoom-pane`)]),_:3}),de(e.$slots,`default`),b(s5)],512))}}),D5=B({name:`Panel`,compatConfig:{MODE:3},props:{position:{}},setup(e){let t=e,{userSelectionActive:n}=Y8(),i=z(()=>`${t.position}`.split(`-`));return(e,t)=>(V(),P(`div`,{class:L([`vue-flow__panel`,i.value]),style:re({pointerEvents:r(n)?`none`:`all`})},[de(e.$slots,`default`)],6))}}),O5=`#818cf8`,k5=Je(B({inheritAttrs:!1,__name:`ScenarioGroupNode`,props:{id:{},data:{},selected:{type:Boolean},readonly:{type:Boolean}},emits:[`updateLabel`,`updateNodeInternals`,`remove`],setup(e,{emit:t}){let n=e,a=t,o=i(!1),s=i(``);function c(e){e.stopPropagation(),s.value=n.data.label,o.value=!0}function l(){o.value=!1,a(`updateLabel`,n.id,s.value)}function u(e){e.key===`Enter`&&l(),e.key===`Escape`&&(o.value=!1)}C(()=>n.data.label,e=>{o.value||(s.value=e)});let d=z(()=>n.data.color??O5),f=z(()=>n.selected?d.value:`${d.value}90`),p=z(()=>n.selected?`color-mix(in srgb, ${d.value} 28%, transparent)`:`color-mix(in srgb, ${d.value} 14%, transparent)`),m=z(()=>n.selected?d.value:`${d.value}cc`),h=z(()=>`${d.value}55`),g=z(()=>({borderColor:f.value,background:p.value,boxShadow:n.selected?`0 0 0 1px ${f.value}, 0 0 28px ${h.value}`:`0 0 0 0 transparent`})),_=z(()=>({color:m.value}));return z(()=>({borderColor:d.value})),(t,n)=>(V(),P(`div`,{class:`group-node`,style:re(g.value)},[N(`div`,{class:`group-node__header`,onDblclick:n[3]||=t=>!e.readonly&&c(t)},[o.value?(V(),G(r(Ne),{key:0,modelValue:s.value,"onUpdate:modelValue":n[0]||=e=>s.value=e,class:`group-node__label-input`,style:re({color:d.value,outlineColor:d.value}),autofocus:``,onBlur:l,onKeydown:u,onClick:n[1]||=_e(()=>{},[`stop`])},null,8,[`modelValue`,`style`])):(V(),P(`span`,{key:1,class:`group-node__label`,style:re(_.value)},W(e.data.label||`Team`),5)),e.selected&&!e.readonly?(V(),G(r(q),{key:2,icon:`ti ti-trash`,variant:`text`,rounded:``,size:`small`,severity:`danger`,class:`group-node__remove`,onClick:n[2]||=_e(t=>a(`remove`,e.id),[`stop`])})):K(``,!0)],32)],4))}}),[[`__scopeId`,`data-v-81199534`]]),A5={class:`efn__inner`},j5={class:`efn__icon-wrap`},M5={class:`efn__content`},N5={class:`efn__label`},P5={class:`efn__meta`},F5={key:1,class:`efn__spinner`},I5={key:2,class:`efn__spinner efn__spinner--waiting-input`},L5={key:3,class:`efn__spinner efn__spinner--waiting`},R5=Je(B({inheritAttrs:!1,__name:`ScenarioFlowNode`,props:{id:{},data:{},selected:{type:Boolean}},emits:[`updateNodeInternals`],setup(e){let t=e,{updateNodeInternals:n}=Y8();I(()=>n(t.id));let a=w(`efn-selected-node-id`,i(void 0)),o=w(`efn-node-states`,i({})),s=z(()=>o.value[t.id]??t.data.state??`idle`),c=z(()=>t.selected||a.value===t.id),l=z(()=>t.data.label||t.id),u=z(()=>t.data.isLeader??!1),d=z(()=>u.value?`ti ti-crown`:t.data.type===`ask`?`ti ti-message`:`ti ti-brain`),f=z(()=>(t.data.aiCli??`claude-code`)===`codex`?`Codex`:`Claude`),p=z(()=>t.data.model?.trim()||``),m=z(()=>{let e=p.value?`${f.value} · ${p.value}`:f.value;return t.data.roleName?`${t.data.roleName} · ${e}`:e}),h=w(`efn-open-pty-debug`,null),g=z(()=>!h||t.data.type===`ask`||(t.data.aiCli??`claude-code`)!==`claude-code`?!1:s.value===`done`||s.value===`synthesized`);function _(e){e.stopPropagation(),h?.(t.id)}return(t,n)=>(V(),P(H,null,[b(r(f8),{type:`target`,position:r(M4).Left,class:`efn-handle efn-handle--target`},null,8,[`position`]),N(`div`,{class:L([`efn`,u.value?`efn--leader`:`efn--node`,c.value&&`efn--selected`,s.value!==`idle`&&`efn--${s.value}`])},[n[6]||=N(`div`,{class:`efn__border`},null,-1),N(`div`,A5,[N(`div`,j5,[N(`i`,{class:L([d.value,`efn__icon`])},null,2)]),N(`div`,M5,[N(`span`,N5,W(l.value),1),N(`span`,P5,W(m.value),1)])]),g.value?(V(),P(`button`,{key:0,class:`efn__badge efn__badge--debug`,title:`Reprendre dans un terminal Claude (--resume)`,onClick:_,onMousedown:n[0]||=_e(()=>{},[`stop`]),onPointerdown:n[1]||=_e(()=>{},[`stop`])},[...n[2]||=[N(`i`,{class:`ti ti-device-desktop`},null,-1)]],32)):K(``,!0),s.value===`running`?(V(),P(`div`,F5,[...n[3]||=[N(`i`,{class:`ti ti-spin ti-loader-2`},null,-1)]])):s.value===`waiting_input`?(V(),P(`div`,I5,[...n[4]||=[N(`i`,{class:`ti ti-help-circle`},null,-1)]])):s.value===`waiting`?(V(),P(`div`,L5,[...n[5]||=[N(`i`,{class:`ti ti-clock`},null,-1)]])):K(``,!0)],2),e.data.showBottomHandle===!1?K(``,!0):(V(),G(r(f8),{key:0,id:`source-bottom`,type:`source`,position:r(M4).Bottom,class:`efn-handle efn-handle--source efn-handle--source-bottom`,style:{left:`10px`}},null,8,[`position`])),e.data.showTopHandle?(V(),G(r(f8),{key:1,id:`source-top`,type:`source`,position:r(M4).Top,class:`efn-handle efn-handle--source efn-handle--source-top`,style:{left:`10px`}},null,8,[`position`])):K(``,!0)],64))}}),[[`__scopeId`,`data-v-feea8c6d`]]),z5={class:`scenario-run-view`},B5={key:0,class:`scenario-run-view__loading`},V5=`scenario-run-view`,H5=Je(B({__name:`ScenarioRunView`,props:{scenario:{},nodeStates:{},selectedNodeId:{},preset:{}},emits:[`node-click`],setup(e,{emit:t}){let n=e,i=t;te(`efn-selected-node-id`,o(n,`selectedNodeId`)),te(`efn-node-states`,o(n,`nodeStates`));let{updateEdge:a,getEdges:s}=Y8(V5),c=z(()=>n.scenario),l=z(()=>{if(!c.value)return[];let e=(c.value.groups??[]).map(e=>({id:e.id,type:`group`,position:{...e.position},style:{width:`${e.width}px`,height:`${e.height}px`},data:{label:e.name,color:e.color??void 0},draggable:!1,selectable:!1})),t=c.value.nodes.map(e=>({id:e.id,position:{...e.position},label:e.label,data:{label:e.label,isLeader:e.id===c.value.leaderId,type:e.type,aiCli:e.aiCli,model:e.model,roleName:n.preset?.roles.find(t=>t.id===e.role)?.name},...e.groupId?{parentNode:e.groupId,extent:`parent`}:{}}));return[...e,...t]}),u=z(()=>{if(!c.value)return[];let e=[];for(let t of c.value.nodes)for(let n of t.parentIds??[])e.push({id:`e-${n}-${t.id}`,source:n,target:t.id,type:`step`,animated:!1,zIndex:1500,style:{stroke:`rgba(99,102,241,0.55)`,strokeWidth:2.5}});return e});return C(()=>n.nodeStates,e=>{let t=Object.values(e).some(e=>e===`running`);for(let e of s.value)a(e.id,{animated:t})},{deep:!0}),(e,t)=>(V(),P(`div`,z5,[c.value?(V(),G(r(E5),{key:1,id:V5,nodes:l.value,edges:u.value,"nodes-draggable":!0,"nodes-connectable":!1,"elements-selectable":!1,"fit-view-on-init":``,class:`scenario-run-view__flow scenario-flow-canvas`,onNodeClick:t[0]||=e=>i(`node-click`,e.node.id)},{"node-default":U(e=>[b(R5,se(fe(e)),null,16)]),"node-group":U(e=>[b(k5,R(e,{readonly:!0}),null,16)]),_:1},8,[`nodes`,`edges`])):(V(),P(`div`,B5,[...t[1]||=[N(`i`,{class:`ti ti-spin ti-loader-2`},null,-1)]]))]))}}),[[`__scopeId`,`data-v-d046446e`]]),U5={class:`ai-chat-scenario-view`},W5={class:`ai-chat-scenario-view__graph`},G5={key:0,class:`ai-chat-scenario-view__synthesis-banner`},K5={class:`ai-chat-scenario-view__detail`},q5={key:0,class:`ai-chat-scenario-view__stop-bar`},J5={key:1,class:`ai-chat-scenario-view__stop-bar`},Y5={style:{"font-size":`0.875rem`}},X5={class:`ai-chat-scenario-view__input-request-header`},Z5={class:`ai-chat-scenario-view__input-request-name`},Q5={class:`ai-chat-scenario-view__input-request-question`},$5={class:`ai-chat-scenario-view__input-request-form`},e7={class:`ai-chat-scenario-view__tabs`},t7={key:0,class:`ai-chat-scenario-view__tab-dot`},n7={key:0,class:L([`ai-chat-scenario-view__tab`,`ai-chat-scenario-view__tab--active`])},r7={key:0,class:`ai-chat-scenario-view__hint`},i7={key:1,class:`ai-chat-scenario-view__accordion`},a7={key:0,class:`ai-chat-scenario-view__accordion-item`},o7=[`innerHTML`],s7={key:1,class:`ai-chat-scenario-view__accordion-item`},c7=[`innerHTML`],l7={key:2,class:`ai-chat-scenario-view__cursor`},u7={key:0,class:`ai-chat-scenario-view__node-meta`},d7={class:`ai-chat-scenario-view__chip`},f7={key:0,class:`ai-chat-scenario-view__chip ai-chat-scenario-view__chip--model`},p7={key:1,class:`ai-chat-scenario-view__node-status`},m7={key:2,class:`ai-chat-scenario-view__thinking-block`},h7={key:0,class:`ai-chat-scenario-view__thinking-content`},g7={key:3,class:`ai-chat-scenario-view__tool-events`},_7={class:`ai-chat-scenario-view__tool-event-name`},v7={key:0,class:`ai-chat-scenario-view__tool-event-args ai-chat-scenario-view__tool-event-args--streaming`},y7={key:1,class:`ai-chat-scenario-view__tool-event-args`},b7={key:2,class:`ai-chat-scenario-view__tool-event-result`},x7=[`innerHTML`],S7={key:5,class:`ai-chat-scenario-view__node-empty`},C7={key:6,class:`ai-chat-scenario-view__node-duration`},w7={key:0,style:{padding:`1rem`,color:`#d4d4d4`}},T7={key:1,style:{padding:`1rem`,color:`#f87171`}},E7=Je(B({__name:`AiChatScenarioView`,props:{availablePresets:{}},emits:[`click-resume`],setup(e,{expose:t,emit:n}){let a=e,o=n,{t:s}=ve(),c=Le(),l=lt(),u=dt(),{activeConversation:d}=ye(l),f=i(null);t({messagesEl:f,resetNodeSelection:we,syncScenarioAccordionState:ue});let p=i(null),m=i(!0),h=i(!1),g=i(null),_=i(null),v=i(!1),y=i(null);te(`efn-open-pty-debug`,e=>{S(e)});async function S(e){let t=d.value;if(t){g.value=e,_.value=null,y.value=null,v.value=!0;try{let n=await J.scenario.getNodeSession.query({conversationId:t.id,nodeId:e});n?_.value=n:y.value=`Ce nœud n'a pas encore de session Claude (jamais exécuté ?).`}catch(e){y.value=e.message}finally{v.value=!1}}}let C=/##\s*(?:✅\s*)?FINAL REPORT/i,w=z(()=>d.value?.scenarioNodeStates??{}),T=z(()=>d.value?.scenarioNodeOutputs??{}),E=z(()=>d.value?.scenarioRunning??!1),D=z(()=>d.value?.scenarioSynthesisRunning??!1),O=z(()=>{let e=d.value;if(!e||e.workflowType!==`scenario`||E.value)return!1;let t=e.scenarioNodeStates??{};return Object.keys(t).length>0&&Object.values(t).some(e=>e!==`done`&&e!==`synthesized`)}),k=z(()=>d.value?.scenarioReadme??``),A=z(()=>{let e=k.value??``,t=C.exec(e);if(!t)return{runLog:e,finalReport:``};let n=t.index??0;return{runLog:e.slice(0,n).trim(),finalReport:e.slice(n).trim()}}),j=z(()=>{let e=d.value;return!e||e.workflowType!==`scenario`?null:e.scenarioSnapshot??u.scenarios.find(t=>t.id===e.workflowId)??null}),M=z(()=>a.availablePresets.find(e=>e.id===j.value?.presetId)),I=z(()=>!p.value||!j.value?null:j.value.nodes.find(e=>e.id===p.value)??null),R=z(()=>(I.value?.aiCli??`claude-code`)===`codex`?`Codex`:`Claude Code`),ee=z(()=>{let e=I.value;return e&&e.model?.trim()||``}),ne=z(()=>d.value?.scenarioWaitingInputs??{}),B=z(()=>d.value?.scenarioNodeStatuses??{}),re=z(()=>d.value?.scenarioNodeThinking??{}),ie=z(()=>d.value?.scenarioNodeToolEvents??{}),ae=z(()=>d.value?.scenarioNodeDurations??{}),oe=i(new Set),se=z(()=>p.value),ce=i({});async function le(e){let t=d.value;if(!t)return;let n=ce.value[e]?.trim();if(n)try{await l.sendNodeInput(t.id,e,n);let{[e]:r,...i}=ce.value;ce.value=i}catch(e){c.add({severity:`error`,summary:s(`common.error`),detail:e.message,life:4e3})}}function ue(){let e=A.value.finalReport.length>0;m.value=!e,h.value=e}function de(e){if(e===`run`){let e=!m.value;m.value=e,e&&(h.value=!1);return}let t=!h.value;h.value=t,t&&(m.value=!1)}let fe=new Map;function me(e){return e.replace(/<pass\s+branch="(\d+)"\s*\/>/g,(e,t)=>`<span class="scenario-flag scenario-flag--pass">PASS ${t}</span>`).replace(/<pass\s*\/>/g,`<span class="scenario-flag scenario-flag--pass">PASS</span>`).replace(/<error>([\s\S]*?)<\/error>/g,(e,t)=>`<span class="scenario-flag scenario-flag--error">ERROR: ${t.trim()}</span>`).replace(/<ask_user>([\s\S]*?)<\/ask_user>/g,(e,t)=>`<span class="scenario-flag scenario-flag--ask">${t.trim()}</span>`).replace(/<kanban_move\s+column="([^"]*?)"\s*\/>/g,(e,t)=>`<span class="scenario-flag scenario-flag--kanban">📋 Move → ${t}</span>`).replace(/<kanban_comment>([\s\S]*?)<\/kanban_comment>/g,(e,t)=>`<span class="scenario-flag scenario-flag--kanban-comment">💬 ${t.trim()}</span>`).replace(/<kanban_add_card\s+column="([^"]*?)"\s+title="([^"]*?)">([\s\S]*?)<\/kanban_add_card>/g,(e,t,n)=>`<span class="scenario-flag scenario-flag--kanban">➕ Card "${n}" → ${t}</span>`).replace(/<next_person\s+name="([^"]*?)"\s*\/>/g,(e,t)=>`<span class="scenario-flag scenario-flag--delegate">🔀 ${t}</span>`).replace(/<next_person\s+name="([^"]*?)">([\s\S]*?)<\/next_person>/g,(e,t,n)=>`<span class="scenario-flag scenario-flag--delegate">🔀 <strong>${t}</strong> — ${n.trim()}</span>`).replace(/<hire_person\s+label="([^"]*?)"\s+role="([^"]*?)">([\s\S]*?)<\/hire_person>/g,(e,t,n)=>`<span class="scenario-flag scenario-flag--hire">🧑💼 Hire ${t} (${n})</span>`)}function he(e){let t=fe.get(e);return t===void 0&&(t=XV.sanitize(DB.parse(me(e),{async:!1})),fe.set(e,t)),t}function ge(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function be(e){return e.name===`command_execution`&&typeof e.input?.command==`string`}function xe(e){return be(e)?`shell`:e.name}function Se(e){return!e.input||Object.keys(e.input).length===0?``:be(e)?String(e.input.command??``):Object.entries(e.input).map(([e,t])=>`${e}=${t}`).join(`, `)}function Ce(e,t){let n;if(typeof e==`string`)n=e;else try{n=JSON.stringify(e,null,2)}catch{n=`[unserializable result]`}return n.split(`
|
|
308
|
+
`).slice(-t).join(`
|
|
309
|
+
`)}function we(){p.value=null,ue()}return(e,t)=>(V(),P(`div`,U5,[b(r(Ke),{layout:`horizontal`,"gutter-size":6,class:`ai-chat-scenario-view__splitter`},{default:U(()=>[b(r(at),{size:45,"min-size":0},{default:U(()=>[N(`div`,W5,[D.value?(V(),P(`div`,G5,[t[8]||=N(`i`,{class:`ti ti-spin ti-loader-2`},null,-1),N(`span`,null,W(r(s)(`aiChatPage.scenario.synthesisInProgress`)),1)])):K(``,!0),(V(),G(H5,{key:`scenario-graph-${r(d)?.id}`,scenario:j.value,"node-states":w.value,"selected-node-id":p.value??void 0,preset:M.value,onNodeClick:t[0]||=e=>p.value=p.value===e?null:e},null,8,[`scenario`,`node-states`,`selected-node-id`,`preset`]))])]),_:1}),b(r(at),{size:55,"min-size":35},{default:U(()=>[N(`div`,K5,[E.value?(V(),P(`div`,q5,[...t[9]||=[N(`i`,{class:`ti ti-spin ti-loader-2`},null,-1),N(`span`,null,`Scenario running...`,-1)]])):O.value?(V(),P(`div`,J5,[t[10]||=N(`i`,{class:`ti ti-alert-triangle`,style:{color:`var(--r-orange-500, #f97316)`}},null,-1),N(`span`,Y5,W(r(s)(`aiChatPage.scenario.interrupted`)),1),b(r(q),{label:r(s)(`aiChatPage.resume`),icon:`ti ti-player-play`,size:`small`,onClick:t[1]||=e=>o(`click-resume`)},null,8,[`label`])])):K(``,!0),(V(!0),P(H,null,F(ne.value,(e,n)=>(V(),P(`div`,{key:n,class:`ai-chat-scenario-view__input-request`},[N(`div`,X5,[t[11]||=N(`i`,{class:`ti ti-help-circle`},null,-1),N(`span`,Z5,W(j.value?.nodes.find(e=>e.id===n)?.label||n)+` asks: `,1)]),N(`p`,Q5,W(e),1),N(`div`,$5,[b(r(et),{modelValue:ce.value[n],"onUpdate:modelValue":e=>ce.value[n]=e,class:`ai-chat-scenario-view__input-request-field`,placeholder:`Your answer...`,disabled:!E.value,rows:3,"auto-resize":``,onKeydown:pe(_e(e=>E.value&&le(n),[`exact`,`prevent`]),[`enter`])},null,8,[`modelValue`,`onUpdate:modelValue`,`disabled`,`onKeydown`]),b(r(q),{icon:`ti ti-send`,size:`small`,disabled:!ce.value[n]?.trim()||!E.value,title:E.value?void 0:r(s)(`aiChatPage.scenario.resumeToAnswer`),onClick:e=>le(n)},null,8,[`disabled`,`title`,`onClick`])])]))),128)),N(`div`,e7,[N(`button`,{class:L([`ai-chat-scenario-view__tab`,{"ai-chat-scenario-view__tab--active":!p.value}]),onClick:t[2]||=e=>p.value=null},[t[12]||=N(`i`,{class:`ti ti-file`},null,-1),x(` `+W(r(s)(`aiChatPage.runLog`))+` `,1),E.value?(V(),P(`span`,t7)):K(``,!0)],2),p.value?(V(),P(`button`,n7,[t[13]||=N(`i`,{class:`ti ti-user`},null,-1),x(` `+W(I.value?.label||I.value?.id)+` `,1),N(`span`,{class:L([`ai-chat-scenario-view__node-state`,`ai-chat-scenario-view__node-state--${w.value[se.value]??`idle`}`])},W(w.value[se.value]??`idle`),3),N(`button`,{class:`ai-chat-scenario-view__tab-close`,onClick:t[3]||=_e(e=>p.value=null,[`stop`])},`x`)])):K(``,!0)]),p.value?(V(),P(`div`,{key:`scenario-node-${r(d)?.id}-${se.value}`,class:`ai-chat-scenario-view__node-output`},[I.value?(V(),P(`div`,u7,[N(`span`,d7,W(R.value),1),ee.value?(V(),P(`span`,f7,W(ee.value),1)):K(``,!0)])):K(``,!0),B.value[se.value]&&w.value[se.value]===`running`?(V(),P(`div`,p7,[t[17]||=N(`i`,{class:`ti ti-spin ti-settings`},null,-1),N(`span`,null,W(B.value[se.value]),1)])):K(``,!0),re.value[se.value]?.length?(V(),P(`div`,m7,[N(`div`,{class:`ai-chat-scenario-view__thinking-header`,onClick:t[6]||=e=>oe.value.has(se.value)?oe.value.delete(se.value):oe.value.add(se.value)},[t[18]||=N(`i`,{class:`ti ti-sparkles`},null,-1),N(`span`,null,W(r(s)(`aiChatPage.thinking`)),1),N(`i`,{class:L([`ti`,oe.value.has(se.value)?`ti-chevron-up`:`ti-chevron-down`])},null,2)]),oe.value.has(se.value)?(V(),P(`pre`,h7,W(re.value[se.value].join(``)),1)):K(``,!0)])):K(``,!0),ie.value[se.value]?.length?(V(),P(`div`,g7,[(V(!0),P(H,null,F(ie.value[se.value],e=>(V(),P(`div`,{key:e.id,class:L([`ai-chat-scenario-view__tool-event`,{"ai-chat-scenario-view__tool-event--pending":e.pending,"ai-chat-scenario-view__tool-event--error":e.isError}])},[N(`i`,{class:L(e.pending?`ti ti-spin ti-loader-2`:e.isError?`ti ti-circle-x`:`ti ti-circle-check`)},null,2),N(`span`,_7,W(xe(e)),1),e.pending&&e.rawInput?(V(),P(`span`,v7,[x(W(e.rawInput),1),t[19]||=N(`span`,{class:`ai-chat-scenario-view__cursor`},null,-1)])):Se(e)?(V(),P(`span`,y7,W(Se(e)),1)):K(``,!0),!e.pending&&e.result?(V(),P(`pre`,b7,W(Ce(e.result,20)),1)):K(``,!0)],2))),128))])):K(``,!0),T.value[se.value]?(V(),P(`div`,{key:4,class:`ai-chat-scenario-view__node-content ai-chat-scenario-view__markdown`,innerHTML:he(T.value[se.value])},null,8,x7)):(V(),P(`div`,S7,[t[20]||=N(`i`,{class:`ti ti-clock`},null,-1),N(`span`,null,W(w.value[se.value]===`running`?`Running...`:`Waiting...`),1)])),ae.value[se.value]===void 0?K(``,!0):(V(),P(`div`,C7,[t[21]||=N(`i`,{class:`ti ti-clock`},null,-1),N(`span`,null,W(ge(ae.value[se.value])),1)]))])):(V(),P(`div`,{key:`scenario-readme-${r(d)?.id}`,ref_key:`messagesEl`,ref:f,class:`ai-chat-scenario-view__readme`},[k.value?(V(),P(`div`,i7,[A.value.runLog?(V(),P(`div`,a7,[N(`button`,{class:`ai-chat-scenario-view__accordion-header`,onClick:t[4]||=e=>de(`run`)},[N(`span`,null,[t[15]||=N(`i`,{class:`ti ti-file`},null,-1),x(` `+W(r(s)(`aiChatPage.runLog`)),1)]),N(`i`,{class:L([`ti`,m.value?`ti-chevron-up`:`ti-chevron-down`])},null,2)]),m.value?(V(),P(`div`,{key:0,class:`ai-chat-scenario-view__accordion-content ai-chat-scenario-view__readme-content ai-chat-scenario-view__markdown`,innerHTML:he(A.value.runLog)},null,8,o7)):K(``,!0)])):K(``,!0),A.value.finalReport?(V(),P(`div`,s7,[N(`button`,{class:`ai-chat-scenario-view__accordion-header`,onClick:t[5]||=e=>de(`final`)},[N(`span`,null,[t[16]||=N(`i`,{class:`ti ti-file-check`},null,-1),x(` `+W(r(s)(`aiChatPage.finalReport`)),1)]),N(`i`,{class:L([`ti`,h.value?`ti-chevron-up`:`ti-chevron-down`])},null,2)]),h.value?(V(),P(`div`,{key:0,class:`ai-chat-scenario-view__accordion-content ai-chat-scenario-view__final-report ai-chat-scenario-view__markdown`,innerHTML:he(A.value.finalReport)},null,8,c7)):K(``,!0)])):K(``,!0)])):(V(),P(`div`,r7,[t[14]||=N(`i`,{class:`ti ti-building`,style:{"font-size":`1.5rem`,opacity:`0.2`}},null,-1),N(`p`,null,W(r(s)(`aiChatPage.typeATask`)),1),N(`p`,null,W(r(s)(`aiChatPage.clickOrgChartHint`)),1)])),E.value?(V(),P(`span`,l7)):K(``,!0)]))])]),_:1})]),_:1}),b(r(Ue),{visible:!!g.value,modal:``,"dismissable-mask":``,header:`Claude · resume ${g.value??``}`,style:{width:`80vw`,height:`70vh`},"content-style":{padding:0,height:`100%`},"onUpdate:visible":t[7]||=e=>{e||(g.value=null,_.value=null,y.value=null)}},{default:U(()=>[v.value?(V(),P(`div`,w7,`Chargement…`)):y.value?(V(),P(`div`,T7,[t[22]||=N(`i`,{class:`ti ti-alert-triangle`},null,-1),x(` `+W(y.value),1)])):_.value?(V(),G(yZ,{key:2,"session-id":_.value.sessionId,"agent-id":_.value.agentId,resume:!0},null,8,[`session-id`,`agent-id`])):K(``,!0)]),_:1},8,[`visible`,`header`])]))}}),[[`__scopeId`,`data-v-531a3e9c`]]),D7={"claude-code":`Claude Code`,codex:`Codex`};function O7(e,t,n){return Object.keys(D7).map(r=>{let i=D7[r],a=!e[r]&&t!==r;return{value:r,disabled:a,label:a?n(i):i}})}function k7(e,t,n){let r=[{value:``,label:e},...t];return n&&!t.some(e=>e.value===n)&&r.push({value:n,label:n}),r}function A7(e,t){return[{value:``,label:e},...qt.map(e=>({value:e,label:t(e)}))]}function j7(e,t,n,r,i=1){return Math.max(n,Math.min(Math.max(n,r),e+t*i))}function M7(e){let{axis:t,min:n,initial:r,storageKey:a,direction:o=1}=e,s=()=>typeof e.max==`function`?e.max():e.max,c=i(p()),l=i(!1),d=0,f=0;function p(){if(!a)return r;try{let e=Number(localStorage.getItem(a));if(Number.isFinite(e)&&e>=n&&e<=s())return e}catch{}return r}function m(){if(a)try{localStorage.setItem(a,String(c.value))}catch{}}let h=e=>{let r=(t===`x`?e.clientX:e.clientY)-d;c.value=j7(f,r,n,s(),o)},g=()=>{l.value=!1,document.removeEventListener(`pointermove`,h),document.removeEventListener(`pointerup`,g),document.removeEventListener(`pointercancel`,g),document.body.style.userSelect=``,document.body.style.cursor=``,m()};function _(e){l.value=!0,d=t===`x`?e.clientX:e.clientY,f=c.value,document.body.style.userSelect=`none`,document.body.style.cursor=t===`x`?`col-resize`:`row-resize`,document.addEventListener(`pointermove`,h),document.addEventListener(`pointerup`,g),document.addEventListener(`pointercancel`,g)}return u(()=>{l.value&&g()}),{size:c,isResizing:l,start:_}}var N7={class:`companion-panel__header`},P7={class:`companion-panel__title`},F7={key:0,class:`companion-panel__state companion-panel__state--reading`},I7=[`title`],L7={key:2,class:`companion-panel__state`},R7={class:`companion-panel__header-actions`},z7={class:`companion-panel__menu`},B7=[`title`],V7=[`title`,`disabled`],H7=[`title`,`disabled`],U7={class:`companion-panel__hint`},W7={key:2,class:`companion-panel__empty`},G7=[`title`],K7=Je(B({__name:`CompanionPanel`,props:{enabled:{type:Boolean},runner:{},model:{},effort:{},companionConversationId:{},mainConversationId:{}},emits:[`enable`,`disable`,`update:runner`,`update:model`,`update:effort`],setup(e,{emit:t}){let n=e,a=t,{t:o}=ve(),s=lt(),{claudeCodeAvailable:c,codexAvailable:l,cliModels:u}=ye(s),d=z(()=>O7({"claude-code":c.value,codex:l.value},n.runner,e=>o(`aiChatPage.runnerNotInstalled`,{runner:e}))),f=z(()=>k7(o(`aiChat.companionModelDefault`),u.value[n.runner],n.model));C(()=>n.runner,e=>{s.loadCliModels(e)},{immediate:!0});let p=z(()=>A7(o(`aiChat.companionEffortDefault`),e=>o(`aiChat.companionEffort_${e}`))),m=z(()=>n.companionConversationId?s.conversations.find(e=>e.id===n.companionConversationId)??null:null);C(()=>m.value?.messagesOmitted?m.value.id:null,e=>{e&&s.ensureConversationLoaded(e)},{immediate:!0});let h=i(!1),g=z(()=>n.enabled&&h.value),_=z(()=>(m.value?.messages??[]).filter(e=>e.role===`assistant`&&e.content.trim()).length),{size:v,isResizing:y,start:S}=M7({axis:`y`,min:180,max:()=>Math.round(window.innerHeight*.75),initial:380,storageKey:`runeya:companion-height`}),w=i();function T(e){w.value?.toggle(e)}let E=z(()=>m.value?.messages??[]),D=z(()=>s.isCompanionThinkingFor(n.mainConversationId)),O=z(()=>s.companionSkipFor(n.mainConversationId)),k=z(()=>D.value||!!n.companionConversationId&&s.isConversationStreaming(n.companionConversationId));function A(e){a(`update:runner`,e===`codex`?`codex`:`claude-code`)}let j=i(!1),M=i(null);async function F(){if(!n.mainConversationId||!g.value){M.value=null;return}try{let e=await J.chat.conversations.companionDelivery.query({id:n.mainConversationId});M.value=e.delivery}catch{M.value=null}}C(D,(e,t)=>{e&&!t&&s.refreshStreamingSessions()});let I=Lt(F,1500,`companion-delivery`);C(()=>[n.mainConversationId,g.value],([,e])=>{M.value=null,e?(I.start(),I.trigger()):I.stop()},{immediate:!0}),ee(()=>I.stop());async function R(){if(n.mainConversationId){j.value=!0;try{await J.chat.conversations.testCompanionBridge.mutate({id:n.mainConversationId})}catch{}finally{j.value=!1,await F()}}}let te=i(!1);async function ne(){if(n.mainConversationId){te.value=!0;try{await J.chat.conversations.runCompanionNow.mutate({id:n.mainConversationId})}catch{}finally{te.value=!1}}}return(t,n)=>(V(),P(`section`,{class:L([`companion-panel`,{"companion-panel--resizing":r(y),"companion-panel--collapsed":!g.value}]),style:re(g.value?{height:r(v)+`px`}:void 0)},[N(`header`,N7,[N(`span`,P7,[N(`i`,{class:L(e.enabled?`ti ti-eye`:`ti ti-eye-off`)},null,2),x(` `+W(r(o)(`aiChat.companionPanelTitle`)),1)]),e.enabled&&k.value?(V(),P(`span`,F7,[n[6]||=N(`i`,{class:`companion-panel__pulse`},null,-1),x(W(r(o)(`aiChat.companionReading`)),1)])):e.enabled&&O.value?(V(),P(`span`,{key:1,class:`companion-panel__state companion-panel__state--skipped`,title:O.value.detail},[n[7]||=N(`i`,{class:`ti ti-info-circle`},null,-1),x(W(r(o)(`aiChat.companionSkip_${O.value.reason}`)),1)],8,I7)):e.enabled?K(``,!0):(V(),P(`span`,L7,W(r(o)(`aiChat.companionPitchLead`)),1)),N(`div`,R7,[b(r(ze),{class:`companion-panel__runner`,"model-value":e.runner,options:d.value,"option-label":`label`,"option-value":`value`,"option-disabled":`disabled`,size:`small`,title:r(o)(`aiChat.companionRunner`),"onUpdate:modelValue":A},null,8,[`model-value`,`options`,`title`]),f.value.length>1?(V(),G(r(ze),{key:0,class:`companion-panel__runner companion-panel__model`,"model-value":e.model,options:f.value,"option-label":`label`,"option-value":`value`,size:`small`,title:r(o)(`aiChat.companionModel`),"aria-label":r(o)(`aiChat.companionModel`),"onUpdate:modelValue":n[0]||=e=>a(`update:model`,String(e??``))},null,8,[`model-value`,`options`,`title`,`aria-label`])):K(``,!0),b(r(ze),{class:`companion-panel__runner companion-panel__effort`,"model-value":e.effort,options:p.value,"option-label":`label`,"option-value":`value`,size:`small`,title:r(o)(`aiChat.companionEffort`),"aria-label":r(o)(`aiChat.companionEffort`),"onUpdate:modelValue":n[1]||=e=>a(`update:effort`,String(e??``))},null,8,[`model-value`,`options`,`title`,`aria-label`]),e.enabled?(V(),P(H,{key:2},[b(r(q),{size:`small`,variant:`text`,severity:`danger`,icon:`ti ti-eye-off`,label:r(o)(`aiChat.companionDisable`),onClick:n[3]||=e=>a(`disable`)},null,8,[`label`]),b(r(q),{class:`companion-panel__menu-btn`,size:`small`,variant:`text`,rounded:``,icon:`ti ti-dots-vertical`,title:r(o)(`aiChat.companionMore`),onClick:T},null,8,[`title`]),b(r(je),{ref_key:`menu`,ref:w},{default:U(()=>[N(`div`,z7,[N(`button`,{type:`button`,class:`companion-panel__menu-item`,title:r(o)(`aiChat.companionRawHint`),onClick:n[4]||=e=>h.value=!h.value},[n[8]||=N(`i`,{class:`ti ti-code`},null,-1),x(` `+W(h.value?r(o)(`aiChat.companionRawOff`):r(o)(`aiChat.companionRaw`)),1)],8,B7),N(`button`,{type:`button`,class:`companion-panel__menu-item`,title:r(o)(`aiChat.companionRunNowHint`),disabled:te.value||k.value,onClick:ne},[N(`i`,{class:L(te.value||k.value?`ti ti-spin ti-loader-2`:`ti ti-player-play`)},null,2),x(` `+W(r(o)(`aiChat.companionRunNow`)),1)],8,V7),N(`button`,{type:`button`,class:`companion-panel__menu-item`,title:r(o)(`aiChat.companionTestBridgeHint`),disabled:j.value,onClick:R},[N(`i`,{class:L(j.value?`ti ti-spin ti-loader-2`:`ti ti-send`)},null,2),x(` `+W(r(o)(`aiChat.companionTestBridge`)),1)],8,H7)])]),_:1},512)],64)):(V(),G(r(q),{key:1,size:`small`,icon:`ti ti-eye`,label:r(o)(`aiChat.companionEnable`),onClick:n[2]||=e=>a(`enable`)},null,8,[`label`]))])]),g.value?(V(),P(H,{key:0},[N(`p`,U7,W(r(o)(`aiChat.companionRawNotice`,{n:_.value})),1),M.value?(V(),P(`p`,{key:0,class:L([`companion-panel__delivery`,`companion-panel__delivery--${M.value.route}`])},W(r(o)(`aiChat.companionDelivery_${M.value.route}`)),3)):K(``,!0),E.value.length?(V(),G(jH,{key:1,class:`companion-panel__messages`,messages:E.value,"is-streaming":k.value},null,8,[`messages`,`is-streaming`])):(V(),P(`p`,W7,W(k.value?r(o)(`aiChat.companionReadingNow`):r(o)(`aiChat.companionNoRunYet`)),1)),N(`div`,{class:`companion-panel__grip`,role:`separator`,title:r(o)(`aiChat.companionResize`),onPointerdown:n[5]||=_e((...e)=>r(S)&&r(S)(...e),[`prevent`])},null,40,G7)],64)):K(``,!0)],6))}}),[[`__scopeId`,`data-v-25278c84`]]),q7=`runeya:terminal-font-size`;function J7(e){let{sessionId:t,agentId:n,replay:r,onError:i}=e,a=document.createElement(`div`);a.style.width=`100%`,a.style.height=`100%`;let o=new FX({cursorBlink:!0,fontFamily:`monospace`,fontSize:qX(q7,14),theme:{background:`#1a1b1e`,foreground:`#d4d4d4`,cursor:`#d4d4d4`},allowProposedApi:!1}),s=new RX;o.loadAddon(s),o.open(a);let c=e=>{J.terminal.write.mutate({agentId:n,sessionId:t,data:e}).catch(()=>{})};o.onData(c);let l=VX(o,c),u=GX(o,a),d=YX(o),f={terminal:o,fitAddon:s,container:a,subscription:J.terminal.onData.subscribe({agentId:n,sessionId:t,replay:r},{onData(e){d.write(e)},onError(e){i?.(e.message)}}),detachDeadKeyFix:l,detachTouchScroll:u,detachZoom:null,writer:d};return f.detachZoom=JX({terminal:o,container:a,storageKey:q7,onResize:()=>Z7(f,n,t)}),f}function Y7(e){e.detachDeadKeyFix?.(),e.detachTouchScroll?.(),e.detachZoom?.(),e.writer.dispose(),e.subscription?.unsubscribe(),e.terminal.dispose(),e.container.remove()}function X7(e,t){e.container.parentElement!==t&&t.appendChild(e.container)}function Z7(e,t,n){if(e.container.isConnected){try{e.fitAddon.fit()}catch{return}J.terminal.resize.mutate({agentId:t,sessionId:n,cols:e.terminal.cols,rows:e.terminal.rows}).catch(()=>{})}}var Q7=`runeya.conversation-terminals`,$7=new Map;function e9(){try{let e=localStorage.getItem(Q7);if(!e)return{};let t=JSON.parse(e);return t?.version!==1||typeof t.sessions!=`object`||!t.sessions?{}:t.sessions}catch{return{}}}function t9(e){try{let t={version:1,sessions:e};localStorage.setItem(Q7,JSON.stringify(t))}catch{}}function n9(e,t){let n=e9();t?n[e]=t:delete n[e],t9(n)}var r9=i(null),i9=i(!1);function a9(){async function e(e,t,n){if(r9.value=null,$7.has(e))return!0;i9.value=!0;try{let r=e9()[e];if(r&&r.agentId===t){let{sessions:n}=await J.terminal.list.query({agentId:t});if(n.some(e=>e.sessionId===r.sessionId))return $7.set(e,J7({sessionId:r.sessionId,agentId:t,replay:!0,onError:e=>{r9.value=e}})),!0}let i=await J.terminal.create.mutate({agentId:t,...n?.projectId?{projectId:n.projectId,orgId:n.orgId??null}:{},cols:80,rows:24,title:`Chat ${e.slice(0,8)}`});return n9(e,{agentId:t,sessionId:i.sessionId}),$7.set(e,J7({sessionId:i.sessionId,agentId:t,replay:!1,onError:e=>{r9.value=e}})),!0}catch(e){return r9.value=e.message,!1}finally{i9.value=!1}}function t(e,t){let n=$7.get(e);n&&(X7(n,t),r(e),n.terminal.focus())}function n(e){return $7.get(e)?.terminal??null}function r(e){let t=$7.get(e),n=e9()[e];t&&n&&Z7(t,n.agentId,n.sessionId)}async function i(e){let t=$7.get(e);t&&(Y7(t),$7.delete(e));let n=e9()[e];n9(e,null),n&&await J.terminal.destroy.mutate({agentId:n.agentId,sessionId:n.sessionId}).catch(()=>{})}return{open:e,attach:t,fit:r,destroy:i,getTerminal:n,errorMsg:r9,loading:i9}}var o9={class:`terminal-icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},s9=Je(B({__name:`TerminalIcon`,setup(e){return(e,t)=>(V(),P(`svg`,o9,[...t[0]||=[N(`polyline`,{points:`4 17 10 11 4 5`},null,-1),N(`line`,{x1:`12`,y1:`19`,x2:`20`,y2:`19`},null,-1)]]))}}),[[`__scopeId`,`data-v-cb1db4b3`]]),c9={class:`conversation-terminal__header`},l9={class:`conversation-terminal__title`},u9={key:0,class:`conversation-terminal__error`},d9={key:1,class:`conversation-terminal__error`},f9=Je(B({__name:`ConversationTerminalDialog`,props:_({conversationId:{},agentId:{}},{visible:{type:Boolean,required:!0},visibleModifiers:{}}),emits:[`update:visible`],setup(e){let t=e,n=S(e,`visible`),{t:a}=ve(),o=xe(),{open:c,attach:l,fit:u,destroy:d,getTerminal:f,errorMsg:p,loading:m}=a9(),h=i(null),g=s(null),_=null;async function v(){await c(t.conversationId,t.agentId,o.activeProjectId?{projectId:o.activeProjectId,orgId:o.activeOrgId}:void 0)&&h.value&&(h.value.replaceChildren(),l(t.conversationId,h.value),g.value=f(t.conversationId),_?.disconnect(),_=new ResizeObserver(()=>u(t.conversationId)),_.observe(h.value))}function y(){_?.disconnect(),_=null,g.value=null}async function w(){y(),await d(t.conversationId),n.value=!1}return C(n,e=>{e||y()}),C(()=>t.conversationId,()=>{n.value&&v()}),ne(y),(e,t)=>(V(),G(r(Ue),{visible:n.value,"onUpdate:visible":t[0]||=e=>n.value=e,modal:``,maximizable:``,"dismissable-mask":``,style:{width:`70vw`,height:`70vh`},"content-class":`conversation-terminal__content`,onShow:v},{header:U(()=>[N(`div`,c9,[N(`span`,l9,[b(s9),x(` `+W(r(a)(`aiChat.terminalTitle`)),1)]),b(r(q),{size:`small`,variant:`text`,severity:`danger`,icon:`ti ti-power`,title:r(a)(`aiChat.terminalKill`),onClick:w},null,8,[`title`])])]),default:U(()=>[r(p)?(V(),P(`div`,u9,[t[1]||=N(`i`,{class:`ti ti-alert-triangle`},null,-1),x(` `+W(r(p)),1)])):r(m)?(V(),P(`div`,d9,[...t[2]||=[N(`i`,{class:`ti ti-spin ti-loader-2`},null,-1)]])):K(``,!0),b(gZ,{terminal:g.value},null,8,[`terminal`]),N(`div`,{ref_key:`hostEl`,ref:h,class:`conversation-terminal__host`},null,512)]),_:1},8,[`visible`]))}}),[[`__scopeId`,`data-v-b1e2454e`]]);function p9(e,t){return`${e}:${t}`}function m9(e){let t=i({}),n=new Map,r=new Set,a=z(()=>{let n={};for(let r of e.value){let e=t.value[r.boardId];if(!e)continue;let i=(e.columns??[]).find(e=>e.cards.some(e=>e.id===r.cardId));i&&(n[p9(r.boardId,r.cardId)]=i.title)}return n}),o=z(()=>{let e={};for(let[n,r]of Object.entries(t.value))e[n]=r.name;return e});async function s(e){if(!r.has(e)){r.add(e);try{let n=(await Ft.$fetch(`/kanban/board/get`,{method:`GET`,query:{id:e}}))?.data?.board??null;if(!n)return;t.value={...t.value,[e]:n},n.organizationId&&c(n.organizationId)}catch{}finally{r.delete(e)}}}function c(e){if(n.has(e)||typeof EventSource>`u`)return;let r=new EventSource(It(e));r.onmessage=e=>{try{let n=JSON.parse(e.data),r=t.value[n.boardId];if(!r||n.type===`board.changed`&&n.updatedAt===r.updatedAt)return;s(n.boardId)}catch{}},n.set(e,r)}return C(e,e=>{for(let n of new Set(e.map(e=>e.boardId)))t.value[n]||s(n)},{immediate:!0,deep:!0}),u(()=>{for(let e of n.values())e.close();n.clear()}),{columnTitles:a,boardNames:o}}function h9(e,t){let{columnTitles:n,boardNames:r}=m9(z(()=>e.value&&t.value?[{boardId:e.value,cardId:t.value}]:[]));return{columnTitle:z(()=>e.value&&t.value?n.value[p9(e.value,t.value)]??``:``),boardName:z(()=>e.value?r.value[e.value]??``:``)}}var g9=i(null),_9=i(null);function v9(){function e(e){g9.value=e,_9.value=null}function t(e){_9.value=e}function n(){g9.value=null}function r(){_9.value=null}return{pendingConvId:g9,generatedCode:_9,setPendingConv:e,setGeneratedCode:t,clear:n,clearResult:r}}var y9={class:`ai-chat-page__main`},b9={key:0,class:`ai-chat-page__empty`},x9={class:`ai-chat-page__header`},S9={class:`ai-chat-page__header-left`},C9={class:`ai-chat-page__header-title`},w9=[`title`],T9={class:`ai-chat-page__title-text`},E9={class:`ai-chat-page__conv-meta`},D9={key:0,class:`ai-chat-page__runner-badge`},O9={key:1,class:`ai-chat-page__claude-thinking`,title:`Claude est en train de générer une réponse`},k9={key:2,class:`ai-chat-page__claude-idle`,title:`Le process Claude est actif (en attente de saisie)`},A9=[`title`],j9={class:`ai-chat-page__context-progress-bar`},M9={class:`ai-chat-page__context-progress-label`},N9={key:0,class:`ai-chat-page__kanban-column`},P9=[`title`],F9={class:`ai-chat-page__header-actions`},I9={class:`ai-chat-page__git-add`},L9={class:`ai-chat-page__git-del`},Tee={key:1,class:`ti ti-code`},Eee={class:`conv-menu`},Dee=[`disabled`],Oee={class:`ai-chat-page__git-notice`},kee={key:0,class:`ai-chat-page__pty-debug`},Aee={class:`ai-chat-page__pty-debug-header`},jee=5e3,Mee=B({__name:`AiChatPage`,setup(e){let{t}=ve(),n=we(),a=Te(),o=Le(),s=lt(),c=dt(),{activeId:l,activeConversation:u,isStreaming:d,streamingConvId:f,activeContextUsage:p,contextPercent:m}=ye(s),h=i(!1);async function g(){let e=u.value;if(e&&!h.value){h.value=!0;try{await J.chat.pty.syncTranscript.mutate({conversationId:e.id})}catch(e){o.add({severity:`warn`,summary:`Sync failed`,detail:e.message,life:4e3})}finally{h.value=!1}}}let _=z(()=>new URLSearchParams(window.location.search).has(`debugPty`)),v=i(!1),y=i(null),S=i(void 0),w=i(0);async function T(){let e=u.value;if(!e)return;let t=window.prompt(`PTY stress: bytes per second?`,`200000`);if(!t)return;let n=Number(t);try{let t=await J.chat.pty.debugStress.mutate({sessionId:e.id,agentId:e.agentId,bytesPerSec:n,chunkSize:512,durationMs:3e4});y.value=t.spawnId,S.value=t.agentId,w.value=n,v.value=!0,o.add({severity:`info`,summary:`PTY stress started`,detail:`${n.toLocaleString()} B/s for 30s`,life:3e3})}catch(e){o.add({severity:`error`,summary:`Stress failed`,detail:e.message,life:4e3})}}function E(){v.value=!1,y.value=null}let D=z(()=>{let e=u.value;return e?e.runner??(e.isCli&&!e.providerId?`claude-code`:null):null}),O=z(()=>D.value===`claude-code`),k=z(()=>D.value===`codex`),A=z(()=>O.value||k.value),j=i(!1),M=i(null),F=i(Date.now()),R=null,te=z(()=>!j.value||!M.value?!1:F.value-M.value<1500);async function ne(){let e=u.value;if(!e||!O.value){j.value=!1,M.value=null;return}try{let t=await J.chat.pty.activity.query({sessionId:e.id,agentId:e.agentId});j.value=t.running,M.value=t.idleMs===null?null:Date.now()-t.idleMs}catch{j.value=!1}}let B=Lt(ne,1e3,`ai-chat-page:activity`);function ae(){B.stop(),R&&=(clearInterval(R),null),j.value=!1,M.value=null}function oe(){ae(),R||=setInterval(()=>{F.value=Date.now()},500),B.start(),B.trigger()}C([()=>u.value?.id,O],([e,t])=>{e&&t?oe():ae()},{immediate:!0}),ee(()=>ae());let se=z(()=>{let e=u.value;if(!e||e.workflowType===`scenario`)return null;let t=e.runner??(e.isCli&&!e.providerId?`claude-code`:null);if(t===`codex`)return`Codex`;if(t===`claude-code`)return`Claude Code`;if(e.providerId){let t=s.providers.find(t=>t.id===e.providerId);if(t)return t.label}return null}),le=i(``),ue=i(!1),de=i(!1),fe=i(!1),me=i(``),he=i(null),ge=z(()=>u.value?.companionRunner??D.value??`claude-code`);function be(){let e=u.value;e&&s.setCompanion(e.id,!0)}function Se(){let e=u.value;e&&s.setCompanion(e.id,!1)}function Ce(e){let t=u.value;if(!t)return;let n=e===`codex`?`codex`:`claude-code`,r=n===ge.value?void 0:``;s.setCompanion(t.id,!!t.companionEnabled,{runner:n,model:r})}function Ee(e){let t=u.value;if(!t)return;let n=e===`low`||e===`normal`||e===`high`?e:``;s.setCompanion(t.id,!!t.companionEnabled,{effort:n})}function De(e){let t=u.value;t&&s.setCompanion(t.id,!!t.companionEnabled,{model:typeof e==`string`?e:``})}function Oe(){u.value&&(me.value=u.value.title,fe.value=!0,ce(()=>he.value?.$el?.select()))}async function ke(){if(!u.value)return;let e=me.value.trim();e&&await s.renameConversation(u.value.id,e),fe.value=!1}function Ae(){fe.value=!1}function Me(e){return e.messagesOmitted?(e.messageCount??0)>0:(e.messages?.length??0)>0}function Pe(e){navigator.clipboard.writeText(e),o.add({severity:`success`,summary:t(`aiChat.conversationIdCopied`),life:2e3})}let Fe=i(null),Ie=i(null),Re=i(null),ze=i([]),Be=0,Ve=()=>new Date().toISOString(),He=Lt(async()=>{let e=s.refreshStreamingSessions;typeof e==`function`?await e():await s.init()},1500,`ai-chat-page:streaming-refresh`),We=z(()=>d.value&&f.value===l.value);function Ge(){return u.value?.workflowType===`scenario`?Ie.value?.messagesEl??null:Fe.value?.messagesEl??null}function Ke(){let e=Ge();if(!e)return!0;let{scrollTop:t,scrollHeight:n,clientHeight:r}=e;return n-t-r<80}async function qe(e=!1){if(!e&&!Ke())return;await ce();let t=Ge();t&&(t.scrollTop=t.scrollHeight),t?.querySelectorAll(`.ai-chat-scenario-view__thinking-content, .ai-chat-message-list__thinking-content`).forEach(e=>{e.scrollTop=e.scrollHeight})}function Je(){l.value=null,ue.value=!0,s.pendingNewConversation=!0,de.value=!1}function Ye(e){s.pendingNewConversation=!1,s.selectConversation(e),de.value=!1,ue.value=!1,Ie.value?.resetNodeSelection()}async function Xe(e){s.deleteConversation(e)}async function Ze(e=`keep`,t,n){ue.value=!1,s.pendingNewConversation=!1,await s.createConversation({runner:e===`keep`?void 0:e,providerId:e===`keep`?t??void 0:void 0,agentId:n}),le.value=``}function Qe(e,t,n,r){ue.value=!1,s.pendingNewConversation=!1,Re.value?.showScenarioDialog(e,void 0,t,n??void 0,r)}async function $e(e,n,r,i,a,c){try{let t=await s.createConversation({scenarioId:e,scenarioInput:n,title:n?`Scenario: ${n}`:`Scenario conversation`,providerId:a,agentId:c});if(await qe(!0),n&&t){let a=r===`codex`?``:i.trim(),o=r!==`keep`||a||c?{...r===`keep`?{}:{runnerOverride:r},...a?{modelOverride:a}:{},...c?{agentId:c}:{}}:void 0;s.startScenarioRun(t.id,e,n,()=>qe(!1),o)}}catch(e){o.add({severity:`error`,summary:t(`common.error`),detail:e.message,life:4e3})}}async function et(){let e=u.value;e&&e.workflowType===`scenario`&&await s.stopScenario(e.id)}function tt(){Re.value?.showResumeScenarioDialog()}async function nt(e,n){let r=u.value;if(!r)return;let i=e===`keep`?void 0:e;try{await s.resumeScenario(r.id,()=>qe(!1),{...i?{runnerOverride:i}:{},...n?{agentId:n}:{}})}catch(e){o.add({severity:`error`,summary:t(`common.error`),detail:e.message,life:4e3})}}async function rt(){let e=le.value,n=le.value.trim(),{pendingContext:r,pendingPopulateContext:i}=Ht();if(!n&&s.pendingImages.length===0&&!r.value&&!i.value||(!n&&r.value&&(n=`Voici le contexte ci-joint, aide-moi à avancer.`),!n&&i.value&&(n=i.value),!u.value&&(await Ze(),!u.value)))return;let a=u.value;try{if(a.workflowType===`scenario`){if(a.scenarioRunning)return;le.value=``,s.startScenarioRun(a.id,a.workflowId,n,()=>qe(!1),a.scenarioRunOverrides),await qe(!0);return}le.value=``,i.value=null,await s.send(n,qe)}catch(n){le.value||=e,o.add({severity:`error`,summary:t(`common.error`),detail:n.message,life:3500})}}function it(e,t){let n=null;C(f,t=>{t&&e(t)&&(n=t)}),C(d,async e=>{if(e||!n)return;let r=n;n=null,await t(r),await s.deleteConversation(r),Ht().close()})}let{columnTitle:at}=h9(z(()=>u.value?.kanbanBoardId),z(()=>u.value?.kanbanCardId));function ot(e,t){n.push(t?{name:`kanban-card`,params:{id:e,cardId:t}}:{name:`kanban-board`,params:{id:e}})}it(e=>{let t=s.conversations.find(t=>t.id===e);return!(!t?.kanbanBoardId||t.kanbanCardId)},async()=>{});let ct=v9();it(e=>e===ct.pendingConvId.value,async e=>{ct.clear();let t=s.conversations.find(t=>t.id===e);if(!t)return;let n=t.messages.filter(e=>e.role===`assistant`),r=n[n.length-1];if(r?.content){let e=r.content.match(/```(?:javascript|js|typescript|ts)?\n([\s\S]+?)```/);e&&ct.setGeneratedCode(e[1].trim())}}),C(()=>u.value?.id,async e=>{if(Ie.value?.resetNodeSelection(),e&&u.value?.workflowType===`scenario`&&await c.fetchScenarios(),e&&O.value)try{await J.chat.pty.syncTranscript.mutate({conversationId:e})}catch{}}),C(l,e=>{e&&(ue.value=!1),ce(()=>qe(!0))},{flush:`sync`});let ut=!0;C(()=>{let e=u.value?.messages;if(!e||e.length===0)return``;let t=e[e.length-1];return`${e.length}|${t?.content?.length??0}|${t?.parts?.length??0}`},()=>{ut=Ke()},{flush:`pre`}),C(()=>{let e=u.value?.messages;if(!e||e.length===0)return``;let t=e[e.length-1];return`${e.length}|${t?.content?.length??0}|${t?.parts?.length??0}`},()=>{if(!ut)return;let e=Ge();e&&(e.scrollTop=e.scrollHeight)},{flush:`post`});let{autoSendPending:ft,hideSidebar:pt}=Ht(),mt=i(!1),ht=Xt(),gt=xe(),_t=i(!1),{size:vt,isResizing:yt,start:bt}=M7({axis:`x`,min:180,max:()=>Math.min(560,window.innerWidth-320),initial:280,storageKey:`runeya.ai-chat.sidebar-width`}),xt=i(null);function St(e){xt.value?.hide(),e()}let Ct=z(()=>u.value?.agentId??ht.connectedAgents[0]?.config.id??null),wt=i(null),Tt=i(!1),Et=z(()=>{let e=u.value;if(!e)return null;let t=e.projectId&&e.projectId===gt.activeProjectId?gt.activeOrgId:void 0;return{agentId:e.agentId,projectId:e.projectId,orgId:t}}),Dt=z(()=>{let e=Et.value?.agentId;return e?ht.getById(e)?.config.name??null:null}),Ot=z(()=>Dt.value?`${t(`aiChat.viewGitChanges`)} — ${Dt.value}`:t(`aiChat.viewGitChanges`));async function kt(){let e=Et.value;if(!e){wt.value=null,Tt.value=!1;return}try{let t=await J.git.status.query(e);wt.value={additions:t.additions??0,deletions:t.deletions??0},Tt.value=!0}catch{wt.value=null,Tt.value=!1}}C(Et,()=>kt(),{immediate:!0}),C(mt,e=>{e||kt()});let At=Lt(async()=>{document.hidden||mt.value||await kt()},jee,`ai-chat-page:git-stats`);function jt(){At.stop()}function Mt(){jt(),At.start()}C(()=>u.value?.messages?.length??0,()=>{mt.value||kt()}),I(()=>Mt()),ee(()=>jt());async function Nt(){ft.value&&u.value&&(A.value||(ft.value=!1,await ce(),rt()))}C([ft,u],()=>Nt());function Pt(){let e=a.query.conversation;typeof e==`string`&&e&&s.conversations.some(t=>t.id===e)&&s.selectConversation(e)}return C(()=>a.query.conversation,()=>Pt()),I(async()=>{st()&&console.time(`[ai-chat][page] mount`),st()&&console.log(`[ai-chat][page]`,Ve(),`mounted`,{drawerHideSidebar:pt.value,activeId:l.value}),s.isChatPageVisible=!0,await s.init(),s.setScrollCallback(qe),c.fetchScenarios(),J.scenario.listPresets.query().then(e=>{ze.value=e}).catch(()=>{}),ce(()=>qe(!0)),Nt(),Pt(),He.start(),st()&&console.timeEnd(`[ai-chat][page] mount`)}),ie(()=>{Be+=1,st()&&console.log(`[ai-chat][page]`,Ve(),`updated`,{count:Be,activeId:l.value,hasConversation:!!u.value,isStreaming:d.value,drawerHideSidebar:pt.value})}),ee(()=>{st()&&console.log(`[ai-chat][page]`,Ve(),`unmounted`,{updates:Be,activeId:l.value}),He.stop(),s.isChatPageVisible=!1,s.setScrollCallback(()=>{})}),(e,n)=>(V(),P(H,null,[N(`div`,{class:L([`ai-chat-page`,{"ai-chat-page--no-sidebar":r(pt)}]),style:re(r(pt)?void 0:{gridTemplateColumns:`${r(vt)}px 0 1fr`})},[r(pt)?K(``,!0):(V(),P(`div`,{key:0,class:L([`ai-chat-page__sidebar-wrap`,{"ai-chat-page__sidebar-wrap--open":de.value}])},[b(YR,{onStartNew:Je,onSelectConversation:Ye,onDeleteConversation:Xe})],2)),r(pt)?K(``,!0):(V(),P(`div`,{key:1,class:L([`ai-chat-page__resizer`,{"ai-chat-page__resizer--active":r(yt)}]),onPointerdown:n[0]||=_e((...e)=>r(bt)&&r(bt)(...e),[`prevent`])},null,34)),de.value&&!r(pt)?(V(),P(`div`,{key:2,class:`ai-chat-page__backdrop`,onClick:n[1]||=e=>de.value=!1})):K(``,!0),N(`section`,y9,[ue.value||!r(u)?(V(),P(`div`,b9,[b(r(q),{class:`ai-chat-page__menu-btn ai-chat-page__menu-btn--empty`,icon:`ti ti-menu-2`,variant:`text`,rounded:``,size:`small`,onClick:n[2]||=e=>de.value=!de.value}),b(Bt,{onSelectScenario:Qe,onSkip:Ze})])):(V(),P(H,{key:1},[N(`header`,x9,[N(`div`,S9,[b(r(q),{class:`ai-chat-page__menu-btn`,icon:`ti ti-menu-2`,variant:`text`,rounded:``,size:`small`,onClick:n[3]||=e=>de.value=!de.value}),N(`div`,C9,[fe.value?(V(),G(r(Ne),{key:0,ref_key:`renameInputEl`,ref:he,modelValue:me.value,"onUpdate:modelValue":n[4]||=e=>me.value=e,class:`ai-chat-page__rename-input`,size:`small`,onKeydown:[pe(ke,[`enter`]),pe(Ae,[`escape`])],onBlur:ke},null,8,[`modelValue`])):(V(),P(`h2`,{key:1,class:`ai-chat-page__title`,role:`button`,tabindex:`0`,title:r(t)(`aiChat.rename`),onClick:Oe,onKeydown:pe(Oe,[`enter`])},[N(`span`,T9,W(r(u).title),1),n[19]||=N(`i`,{class:`ti ti-pencil ai-chat-page__title-pencil`},null,-1)],40,w9)),N(`div`,E9,[se.value?(V(),P(`span`,D9,W(se.value),1)):K(``,!0),O.value&&te.value?(V(),P(`span`,O9,[...n[20]||=[N(`i`,{class:`ti ti-spin ti-circle-filled`},null,-1),x(` Claude réfléchit… `,-1)]])):O.value&&j.value?(V(),P(`span`,k9,[...n[21]||=[N(`i`,{class:`ti ti-circle-filled`},null,-1),x(` Actif `,-1)]])):K(``,!0),r(p)?(V(),P(`div`,{key:3,class:`ai-chat-page__context-progress`,title:`Context: ${r(p).inputTokens.toLocaleString()} / ${r(p).contextWindow.toLocaleString()} tokens`},[N(`div`,j9,[N(`div`,{class:L([`ai-chat-page__context-progress-fill`,{"ai-chat-page__context-progress-fill--warn":r(m)>=70,"ai-chat-page__context-progress-fill--danger":r(m)>=90}]),style:re({width:r(m)+`%`})},null,6)]),N(`span`,M9,W(r(m))+`%`,1)],8,A9)):K(``,!0),r(u).kanbanBoardId?(V(),P(`a`,{key:4,class:`ai-chat-page__kanban-link`,title:`Ouvrir le tableau Kanban`,onClick:n[5]||=e=>ot(r(u).kanbanBoardId,r(u).kanbanCardId)},[n[22]||=N(`i`,{class:`ti ti-table`,style:{"font-size":`0.7rem`}},null,-1),n[23]||=x(` Kanban `,-1),r(at)?(V(),P(`span`,N9,`· `+W(r(at)),1)):K(``,!0)])):K(``,!0),r(u).id?(V(),P(`span`,{key:5,class:`ai-chat-page__conv-id`,title:r(u).id,onClick:n[6]||=e=>Pe(r(u).id)},`ID: `+W(r(u).id.slice(0,8))+`…`,9,P9)):K(``,!0)])])]),N(`div`,F9,[Et.value&&Tt.value?(V(),G(r(q),{key:0,class:`ai-chat-page__git-btn`,size:`small`,variant:`text`,title:Ot.value,onClick:n[7]||=e=>mt.value=!0},{default:U(()=>[wt.value&&(wt.value.additions||wt.value.deletions)?(V(),P(H,{key:0},[N(`span`,I9,`+`+W(wt.value.additions),1),N(`span`,L9,`-`+W(wt.value.deletions),1)],64)):(V(),P(`i`,Tee))]),_:1},8,[`title`])):K(``,!0),r(u).workflowType===`scenario`&&r(u).scenarioRunning?(V(),G(r(q),{key:1,size:`small`,severity:`danger`,icon:`ti ti-player-stop`,label:`Stop`,onClick:et})):K(``,!0),_.value&&O.value?(V(),G(r(q),{key:2,size:`small`,variant:`text`,severity:`warn`,icon:`ti ti-bolt`,title:`Debug: lance un PTY de stress (random data) sur cette session`,onClick:T})):K(``,!0),Ct.value?(V(),G(r(q),{key:3,size:`small`,variant:`text`,title:r(t)(`aiChat.openTerminal`),onClick:n[8]||=e=>_t.value=!0},{default:U(()=>[b(s9)]),_:1},8,[`title`])):K(``,!0),b(r(q),{size:`small`,variant:`text`,icon:`ti ti-dots-vertical`,title:r(t)(`aiChat.menu`),"aria-label":r(t)(`aiChat.menu`),onClick:n[9]||=e=>xt.value?.toggle(e)},null,8,[`title`,`aria-label`]),b(r(je),{ref_key:`convMenu`,ref:xt},{default:U(()=>[N(`div`,Eee,[O.value?(V(),P(`button`,{key:0,class:`conv-menu__item`,disabled:h.value,onClick:n[10]||=e=>St(g)},[N(`i`,{class:L(h.value?`ti ti-spin ti-loader-2`:`ti ti-refresh`)},null,2),N(`span`,null,W(r(t)(`aiChat.syncTranscript`)),1)],8,Dee)):K(``,!0),N(`button`,{class:`conv-menu__item`,onClick:n[11]||=e=>St(()=>r(s).pinConversation(r(u).id,r(u).pinOrder===void 0))},[N(`i`,{class:`ti ti-pin`,style:re(r(u).pinOrder===void 0?void 0:`opacity:0.5`)},null,4),N(`span`,null,W(r(u).pinOrder===void 0?r(t)(`aiChatPage.pin`):r(t)(`aiChatPage.unpin`)),1)]),N(`button`,{class:`conv-menu__item`,onClick:n[12]||=e=>St(()=>r(s).archiveConversation(r(u).id,!r(u).archived))},[N(`i`,{class:`ti ti-inbox`,style:re(r(u).archived?`opacity:0.5`:void 0)},null,4),N(`span`,null,W(r(u).archived?r(t)(`aiChatPage.unarchive`):r(t)(`aiChatPage.archive`)),1)]),N(`button`,{class:`conv-menu__item conv-menu__item--danger`,onClick:n[13]||=e=>St(()=>r(s).deleteConversation(r(u).id))},[n[24]||=N(`i`,{class:`ti ti-trash`},null,-1),N(`span`,null,W(r(t)(`aiChat.deleteConversation`)),1)])])]),_:1},512)])]),Ct.value?(V(),G(f9,{key:0,visible:_t.value,"onUpdate:visible":n[14]||=e=>_t.value=e,"conversation-id":r(u).id,"agent-id":Ct.value},null,8,[`visible`,`conversation-id`,`agent-id`])):K(``,!0),!r(u).isCompanion&&r(u).workflowType!==`scenario`?(V(),G(K7,{key:1,enabled:!!r(u).companionEnabled,runner:ge.value,model:r(u).companionModel??``,effort:r(u).companionEffort??``,"companion-conversation-id":r(u).companionConversationId,"main-conversation-id":r(u).id,onEnable:be,onDisable:Se,"onUpdate:runner":Ce,"onUpdate:model":De,"onUpdate:effort":Ee},null,8,[`enabled`,`runner`,`model`,`effort`,`companion-conversation-id`,`main-conversation-id`])):K(``,!0),r(u).workflowType===`scenario`?(V(),G(E7,{key:2,ref_key:`scenarioViewRef`,ref:Ie,"available-presets":ze.value,onClickResume:tt},null,8,[`available-presets`])):A.value?(V(),G(yZ,{key:3,"session-id":r(u).id,runner:D.value??`claude-code`,resume:Me(r(u)),"agent-id":r(u).agentId},null,8,[`session-id`,`runner`,`resume`,`agent-id`])):(V(),G(jH,{key:4,ref_key:`messageListRef`,ref:Fe,messages:r(u).messages,"is-streaming":r(d),onOpenImagePreview:n[15]||=(e,t)=>Re.value?.openImagePreview(e,t)},null,8,[`messages`,`is-streaming`])),r(nP)(r(u),A.value)?(V(),G(KH,{key:5,input:le.value,"onUpdate:input":n[16]||=e=>le.value=e,"is-streaming":r(d),"is-streaming-current-conv":We.value,"active-conversation-id":r(u).id,onSubmit:rt,onOpenImagePreview:n[17]||=(e,t)=>Re.value?.openImagePreview(e,t)},null,8,[`input`,`is-streaming`,`is-streaming-current-conv`,`active-conversation-id`])):K(``,!0)],64))])],6),b(Vt,{ref_key:`modalsRef`,ref:Re,onConfirmScenarioStart:$e,onConfirmResumeScenario:nt},null,512),b(r(Ue),{visible:mt.value,"onUpdate:visible":n[18]||=e=>mt.value=e,header:Ot.value,modal:``,"dismissable-mask":``,maximizable:``,style:{width:`85vw`,height:`85vh`},"content-style":{padding:0,height:`100%`,display:`flex`,flexDirection:`column`,overflow:`hidden`}},{default:U(()=>[N(`div`,Oee,[n[25]||=N(`i`,{class:`ti ti-info-circle`},null,-1),N(`span`,null,W(r(t)(`aiChat.gitChangesNotice`)),1)]),Et.value&&mt.value?(V(),G(nF,{key:0,"agent-id":Et.value.agentId,"project-id":Et.value.projectId,"org-id":Et.value.orgId},null,8,[`agent-id`,`project-id`,`org-id`])):K(``,!0)]),_:1},8,[`visible`,`header`]),v.value&&y.value?(V(),P(`div`,kee,[N(`div`,Aee,[n[26]||=N(`i`,{class:`ti ti-bolt`},null,-1),N(`span`,null,`PTY stress · `+W(w.value.toLocaleString())+` B/s`,1),N(`button`,{type:`button`,class:`ai-chat-page__pty-debug-close`,onClick:E},`×`)]),(V(),G(yZ,{key:y.value,"attach-spawn-id":y.value,"agent-id":S.value,resume:!1},null,8,[`attach-spawn-id`,`agent-id`]))])):K(``,!0)],64))}}),Nee=t({default:()=>R9}),R9=Je(Mee,[[`__scopeId`,`data-v-3e0585ec`]]),Pee=t({useProcessStore:()=>V9}),z9=5,Fee=Gt,Iee=5e3,Lee=`runeya:ws-debug`;function Ree(){try{return localStorage.getItem(Lee)===`1`}catch{return!1}}function B9(...e){Ree()&&console.log(`[process.store][ws]`,new Date().toISOString(),...e)}var V9=be(`process`,()=>{let e=i([]),t=i(!1),n=i(null),r=i({}),a=null,o=0,s=null,c=null,l=new Map,u=new Map,d=new Map,f=new Map,p=z(()=>e.value.length),m=z(()=>e.value.filter(e=>e.state===`running`)),h=z(()=>(t,n)=>e.value.find(e=>e.agentId===t&&e.id===n)??null),g=z(()=>t=>e.value.filter(e=>e.serviceId===t));function _(e,t){return`${e}::${t}`}function v(e,t){return`/process/${e}/${t}`}function y(e){return Jt().getById(e)?.name??e}function b(e,t){if(e.state===t.state)return;let n=Yt(),r=y(t.serviceId),i=t.state===`errored`;n.add({type:i?`error`:`info`,category:`service_status_changed`,title:i?Ce.global.t(`notifications.serviceErrored`):Ce.global.t(`notifications.serviceStatusChanged`),message:`${r}: ${e.state} -> ${t.state}`,link:v(t.agentId,t.id),linkLabel:Ce.global.t(`notifications.openService`,{name:r}),serviceId:t.serviceId})}function x(e,t){if(e.healthStatus===t.healthStatus)return;let n=Yt(),r=y(t.serviceId),i=t.healthStatus===`unhealthy`?`warn`:t.healthStatus===`healthy`?`success`:`info`;n.add({type:i,category:`service_health_changed`,title:Ce.global.t(`notifications.serviceHealthChanged`),message:`${r}: ${e.healthStatus} -> ${t.healthStatus}`,link:v(t.agentId,t.id),linkLabel:Ce.global.t(`notifications.openService`,{name:r}),serviceId:t.serviceId})}function S(e){let t=f.get(e);if(!t||t.size<=400)return;let n=Array.from(t).slice(-200);f.set(e,new Set(n))}function C(e,t){let n=_(e.agentId,e.id),r=Date.now();if(r-(d.get(n)??0)<Iee)return;let i=f.get(n)??new Set;if(i.has(t.id))return;i.add(t.id),f.set(n,i),S(n),d.set(n,r);let a=Yt(),o=y(e.serviceId),s=t.message.length>180?`${t.message.slice(0,177)}...`:t.message;a.add({type:`error`,category:`service_error_log`,title:Ce.global.t(`notifications.errorLogOn`,{name:o}),message:s,link:v(e.agentId,e.id),linkLabel:Ce.global.t(`notifications.openService`,{name:o}),serviceId:e.serviceId})}function w(e){let t=u.get(e);t&&(t.unsubscribe(),u.delete(e),d.delete(e),f.delete(e))}function T(){let t=new Set(e.value.filter(e=>e.state===`running`||e.state===`starting`).map(e=>_(e.agentId,e.id)));for(let e of Array.from(u.keys()))t.has(e)||w(e);for(let t of e.value){if(t.state!==`running`&&t.state!==`starting`)continue;let n=_(t.agentId,t.id);if(u.has(n))continue;let r=J.process.onLog.subscribe({agentId:t.agentId,processId:t.id},{onData(n){let r=n,i=e.value.find(e=>e.id===t.id&&e.agentId===t.agentId);if(i)for(let e of r)(e.level===`error`||e.level===`fatal`)&&C(i,e)},onError(){w(n)}});u.set(n,r)}}function E(t){let n=e.value.find(e=>e.id===t.id&&e.agentId===t.agentId),i=e.value.findIndex(e=>e.id===t.id&&e.agentId===t.agentId);if(i>=0){let n=[...e.value];n[i]=t,e.value=n}else e.value=[...e.value,t];r.value={...r.value,[_(t.agentId,t.id)]:Date.now()},n&&(b(n,t),x(n,t)),T()}function D(e,t){let n=_(e.agentId,e.id),i=l.get(n);i&&(clearTimeout(i),l.delete(n));let a=setTimeout(()=>{l.delete(n),(r.value[n]??0)<=t&&E(e)},900);l.set(n,a)}function O(){B9(`subscribeStatus()`),a=J.process.onStatus.subscribe({},{onData(e){o=0,B9(`onStatus data`,{id:e.id,agentId:e.agentId,state:e.state}),E(e)},onError(e){a=null,console.error(`[process.store] Status subscription error:`,e.message),B9(`onStatus error`,e.message,{retryCount:o}),k()}})}function k(){if(o>=z9){console.warn(`[process.store] Max retries (${z9}) reached for status subscription`),B9(`scheduleRetry max reached`,{retryCount:o});return}let e=Fee*2**o+Math.random()*300;B9(`scheduleRetry`,{retryCount:o,delay:e}),o++,s=setTimeout(()=>{s=null,B9(`retry timer fired`),O()},e)}function A(e=!1){B9(`startStatusStream()`,{force:e,hasSub:!!a,hasRetryTimer:!!s}),c||=_t(()=>{B9(`onWsReopen — forcing status stream restart`),o=0,A(!0)}),s&&(clearTimeout(s),s=null,B9(`cleared pending retry timer`)),e&&a&&(a.unsubscribe(),a=null,B9(`forced unsubscribe existing statusSub`)),!a&&(o=0,O())}function j(){B9(`stopStatusStream()`),c&&=(c(),null),l.forEach(e=>clearTimeout(e)),l.clear(),s&&=(clearTimeout(s),null),a&&=(a.unsubscribe(),null);for(let e of Array.from(u.keys()))w(e);o=0}async function M(){t.value=!0,n.value=null;try{e.value=await J.process.list.query(),T()}catch(e){n.value=Nt(e)??`Failed to fetch processes`}finally{t.value=!1}}async function N(e,t){n.value=null;try{let n=Date.now(),r=await J.process.start.mutate({agentId:e,processId:t});D(r,n);let i=xe();return i.activeProjectId&&r.serviceId&&i.addServiceToSelection({id:i.activeProjectId,orgId:i.activeOrgId},r.serviceId),r}catch(e){throw tP().openFromError(e)||(n.value=Nt(e)??`Failed to start process`),e}}async function P(e,t){n.value=null;try{let n=Date.now(),r=await J.process.stop.mutate({agentId:e,processId:t});D(r,n);let i=xe();return i.activeProjectId&&r.serviceId&&i.removeServiceFromSelection({id:i.activeProjectId,orgId:i.activeOrgId},r.serviceId),r}catch(e){throw n.value=Nt(e)??`Failed to stop process`,e}}async function F(e,t){n.value=null;try{let n=Date.now(),r=await J.process.restart.mutate({agentId:e,processId:t});return D(r,n),r}catch(e){throw tP().openFromError(e)||(n.value=Nt(e)??`Failed to restart process`),e}}return{processes:e,loading:t,error:n,processCount:p,runningProcesses:m,getById:h,getByService:g,fetchAll:M,start:N,stop:P,restart:F,startStatusStream:A,stopStatusStream:j}});async function H9(e){e.initTrpcWs(),await e.loadPreferences().catch(()=>{}),e.startStatusStream(),e.startDataStream()}var U9=null;function W9(){U9||=J.project.onDataChanged.subscribe(void 0,{onData({collections:e}){if(e.includes(`projects`)&&Et().fetchAll(),e.includes(`services`)&&Jt().fetchAll(),e.includes(`environments`)){let e=Dt(),t=e.currentProjectId;t&&e.fetchAll(t,!0)}},onError(){U9=null}})}function zee(){U9?.unsubscribe(),U9=null}var Bee={class:`app-root`},Vee={class:`app-root__view`},Hee=[`title`],Uee={key:0,class:`disconnected-overlay`},Wee={class:`disconnected-box`},Gee={class:`disconnected-title`},Kee={class:`disconnected-subtitle`},qee=5e3,Jee=Je(B({__name:`App`,setup(e){let{missing:t,visible:n,checkEnvironment:i}=tP(),a={"runeya:locale":Wt([`fr`,`en`]),"runeya-dark-mode":Wt([`0`,`1`]),"runeya-theme-color":Wt([`slate`,`orange`,`amber`,`emerald`,`teal`,`sky`,`blue`,`violet`,`pink`,`custom`]),"runeya-theme-gradient":Wt([`0`,`1`]),"runeya:mode":Wt([`local-simple`,`cloud`]),"runeya:cloudUrl":Ut().url().max(2048),"runeya:ai-chat-model":Ut().max(200),"runeya:ai-chat-effort":Wt([`low`,`medium`,`high`]),[Un(`app`)]:Ut().max(32),[Un(`cloud`)]:Ut().max(32)},o=[`runeya-mode`,`runeya-cloud-url`,`runeya-setup-complete`,`runeya-theme-preset`];function s(){for(let e of o)localStorage.removeItem(e);for(let[e,t]of Object.entries(a)){let n=localStorage.getItem(e);n!==null&&(t.safeParse(n).success||(console.warn(`[localStorage] Invalid value for "${e}", clearing:`,n),localStorage.removeItem(e)))}}s();let{t:c}=ve(),l=Le(),u=we(),d=Dn();async function f(){await d.check();let{status:e,current:t,latest:n}=d;e.value===`outdated`&&n.value&&l.add({severity:`warn`,summary:c(`settingsPage.updateAvailable`),detail:c(`settingsPage.updateAvailableDetail`,{current:t.value,latest:n.value}),life:8e3})}let p=V9(),h=Yt(),{state:g}=vt(),{isOpen:_,isExpanded:v,toggle:y,close:x}=Ht(),S=()=>new Date().toISOString();function w(){st()&&console.log(`[ai-chat][drawer]`,S(),`show`,{expanded:v.value,route:u.currentRoute.value.fullPath})}function T(){st()&&console.log(`[ai-chat][drawer]`,S(),`hide`,{expanded:v.value,route:u.currentRoute.value.fullPath})}function E(e){e.ctrlKey&&e.shiftKey&&e.code===`Space`&&e.preventDefault()}function D(e){e.ctrlKey&&e.shiftKey&&e.code===`Space`&&y()}let O=new Set([`unlock`,`setup`]),k=z(()=>O.has(u.currentRoute.value.name)),{lockedProjectId:A}=ft(),j=z(()=>!A.value&&!k.value&&u.currentRoute.value.name!==`migrate-vault`),M=xe();function F(e){return e===`launch-services`?`launch-services:${M.activeOrgId??`local`}:${M.activeProjectId}`:void 0}let R=!1,te=null;C(g,(e,t)=>{if(e!==`connected`){te===null&&(te=Date.now());return}let n=te===null?0:Date.now()-te;if(te=null,!R){R=!0;return}t!==`connected`&&!k.value&&n>=qee&&window.location.reload()}),I(()=>{window.addEventListener(`keydown`,E),window.addEventListener(`keyup`,D),f(),!k.value&&St()&&H9({loadPreferences:()=>h.loadPreferences(),initTrpcWs:yt,startStatusStream:()=>p.startStatusStream(),startDataStream:()=>W9()})}),ee(()=>{p.stopStatusStream(),zee(),window.removeEventListener(`keydown`,E),window.removeEventListener(`keyup`,D)}),C(()=>u.currentRoute.value.name,(e,t)=>{let n=O.has(t??``),r=O.has(e??``);n&&!r&&St()&&H9({loadPreferences:()=>h.loadPreferences(),initTrpcWs:yt,startStatusStream:()=>p.startStatusStream(),startDataStream:()=>W9()})});let ne=Et();return C(()=>ne.currentProject?.name,e=>{document.title=e?`${e} · Runeya`:`Runeya`},{immediate:!0}),C(()=>`${ne.currentProject?.id??``}::${ne.currentProject?.activeEnvironmentId??``}`,()=>{let e=ne.currentProject?.activeEnvironmentId;e&&i(e)},{immediate:!0}),(e,i)=>(V(),P(H,null,[b(r(Fe)),b(r(Ae)),b(PN,{visible:r(n),"onUpdate:visible":i[0]||=e=>m(n)?n.value=e:null,missing:r(t)},null,8,[`visible`,`missing`]),j.value?(V(),G(KN,{key:0})):K(``,!0),!k.value&&r(St)()?(V(),G(ZN,{key:1})):K(``,!0),N(`div`,Bee,[b(Vn),b(tr),N(`div`,Vee,[b(yn,null,{default:U(()=>[b(r(De),null,{default:U(({Component:e,route:t})=>[(V(),G(ue(e),{key:F(t.name)}))]),_:1})]),_:1})])]),b(r(Qe),{visible:r(_),"onUpdate:visible":i[2]||=e=>m(_)?_.value=e:null,position:`right`,"show-close-icon":!1,onShow:w,onHide:T,header:r(c)(`drawer.aiChatTitle`),"show-header":!1,class:`ai-chat-drawer`,style:re({width:r(v)?`calc(100vw - 70px)`:`560px`})},{default:U(()=>[N(`button`,{class:`ai-drawer-expand-btn`,title:r(v)?r(c)(`drawer.collapse`):r(c)(`drawer.expand`),onClick:i[1]||=e=>v.value=!r(v)},[N(`i`,{class:L([`ti`,r(v)?`ti-chevron-right`:`ti-chevron-left`])},null,2)],8,Hee),b(R9)]),_:1},8,[`visible`,`header`,`style`]),b(ge,{name:`overlay`},{default:U(()=>[r(g)!==`connected`&&!k.value?(V(),P(`div`,Uee,[N(`div`,Wee,[i[3]||=N(`i`,{class:`ti ti-cloud-off disconnected-icon`},null,-1),N(`h1`,Gee,W(r(c)(`connection.unreachable`)),1),N(`p`,Kee,W(r(c)(`connection.reconnecting`)),1),i[4]||=N(`i`,{class:`ti ti-spin ti-loader-2 disconnected-spinner`},null,-1)])])):K(``,!0)]),_:1})],64))}}),[[`__scopeId`,`data-v-52960071`]]),Yee=t({router:()=>G9}),G9=Oe({history:Ee(),routes:[{path:`/unlock`,name:`unlock`,component:()=>bt(()=>import(`./UnlockPage-BXXIPHW_.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))},{path:`/migrate-vault`,name:`migrate-vault`,component:()=>bt(()=>import(`./VaultMigrationPage-BfNuKtkJ.js`),__vite__mapDeps([21,1,2,3,4,5,6,7,8,9,12,11,17,22]))},{path:`/launch/project`,name:`launch-project`,component:()=>bt(()=>import(`./LaunchProjectPage-Cg92hHwQ.js`),__vite__mapDeps([23,1,2,4,5,3,14,10,11,12,6,7,8,9,16,17,24,25,26,27,28,29,30,31,32,33,34,18,19,35,36]))},{path:`/launch/services`,name:`launch-services`,component:()=>bt(()=>import(`./LaunchServicesPage-CO8gOB9D.js`),__vite__mapDeps([37,1,2,4,5,3,14,10,11,12,6,7,8,9,38,16,17,39,40,41,42,43,44,30,31,34,18,19,35,45]))},{path:`/`,component:()=>bt(()=>import(`./AppLayout-At9wk0sx.js`),__vite__mapDeps([46,1,2,3,4,5,14,10,11,12,47,6,48,7,8,9,38,16,17,25,24,26,27,49,50,51,41,42,39,13,15,40,43,52,53,54,55,56,57,58,59,60,61,62,63,28,29,32,30,31,33,64,65,44,66])),children:[{path:``,name:`dashboard`,component:()=>bt(()=>import(`./DashboardPage-dEQop9ql.js`),__vite__mapDeps([67,1,2,3,4,5,14,10,11,12,6,7,8,9,38,16,17,26,39,40,41,42,43,61,62,30,31,32,25,24,27,28,29,33,64,65,68])),meta:{titleKey:`dashboard.title`}},{path:`cloud`,name:`cloud-account`,component:()=>bt(()=>import(`./CloudAccountPage-D5C2SCS9.js`).then(e=>e.n),__vite__mapDeps([69,5,1,2,4,3,7,8,9,10,11,12,16,14,17,25,26,27,50,28,29,70]))},{path:`cloud/messaging`,name:`cloud-messaging`,component:()=>bt(()=>import(`./CloudMessagingPage-Bi57GGHO.js`),__vite__mapDeps([71,1,2,4,5,3,6,7,8,9,72,14,10,11,12,47,16,17,50,51,15,41,42,39,13,73,25,26,27,74,75,76,77,78,79,40,80,54,49,55,52,53,81,82,83])),meta:{titleKey:`cloudMessaging.title`}},{path:`agents`,name:`agents`,redirect:{path:`/settings`,query:{section:`agents`}}},{path:`kanban`,name:`kanban-list`,component:()=>bt(()=>import(`./KanbanListPage-DbXONxfC.js`),__vite__mapDeps([84,1,2,3,4,5,6,7,8,9,16,14,10,11,12,17,25,27,49,53,56,81,82,26,85,86,87])),meta:{titleKey:`kanban.list.title`}},{path:`issues`,name:`issues-list`,component:()=>bt(()=>import(`./KanbanListPage-DbXONxfC.js`),__vite__mapDeps([84,1,2,3,4,5,6,7,8,9,16,14,10,11,12,17,25,27,49,53,56,81,82,26,85,86,87])),props:{mode:`list`},meta:{titleKey:`kanban.issues.title`}},{path:`kanban/:id`,name:`kanban-board`,component:()=>bt(()=>import(`./KanbanBoardPage-BlCcjBwV.js`),__vite__mapDeps([88,1,2,3,4,5,14,10,11,12,6,7,8,9,72,47,16,17,50,51,15,41,42,39,13,73,25,27,49,74,75,76,77,78,79,40,80,53,81,82,26,85,86,89,54,55,90])),props:!0,meta:{pageKey:`kanban-board`}},{path:`kanban/:id/card/:cardId`,name:`kanban-card`,component:()=>bt(()=>import(`./KanbanBoardPage-BlCcjBwV.js`),__vite__mapDeps([88,1,2,3,4,5,14,10,11,12,6,7,8,9,72,47,16,17,50,51,15,41,42,39,13,73,25,27,49,74,75,76,77,78,79,40,80,53,81,82,26,85,86,89,54,55,90])),props:!0,meta:{pageKey:`kanban-board`}},{path:`issues/:id`,name:`issues-board`,component:()=>bt(()=>import(`./KanbanBoardPage-BlCcjBwV.js`),__vite__mapDeps([88,1,2,3,4,5,14,10,11,12,6,7,8,9,72,47,16,17,50,51,15,41,42,39,13,73,25,27,49,74,75,76,77,78,79,40,80,53,81,82,26,85,86,89,54,55,90])),props:!0,meta:{pageKey:`kanban-board`}},{path:`issues/:id/card/:cardId`,name:`issues-card`,component:()=>bt(()=>import(`./KanbanBoardPage-BlCcjBwV.js`),__vite__mapDeps([88,1,2,3,4,5,14,10,11,12,6,7,8,9,72,47,16,17,50,51,15,41,42,39,13,73,25,27,49,74,75,76,77,78,79,40,80,53,81,82,26,85,86,89,54,55,90])),props:!0,meta:{pageKey:`kanban-board`}},{path:`agent-terminal`,name:`agent-terminal`,component:()=>bt(()=>import(`./AgentTerminalPage-CixU7x6O.js`),__vite__mapDeps([91,1,2,3,4,5,14,10,11,12,7,8,9,40,17,41,42,92,93]))},{path:`audit`,name:`audit`,component:()=>bt(()=>import(`./AuditPage-BkqbHxjY.js`),__vite__mapDeps([94,1,2,4,5,3,7,8,9,10,11,12,95]))},{path:`settings`,name:`settings`,component:()=>bt(()=>import(`./SettingsPage-s28BodWe.js`).then(e=>e.t),__vite__mapDeps([96,5,1,2,3,4,14,10,11,12,6,7,8,9,72,47,16,17,50,51,15,41,42,39,13,73,26,27,49,74,75,76,77,78,79,40,80,57,58,28,29,69,25,70,97,98,99,82,89,54,55,100,101,102,103,104,105])),meta:{titleKey:`settingsPage.title`}},{path:`api-keys`,name:`api-keys`,redirect:{path:`/settings`,query:{section:`api-keys`}}},{path:`api-docs`,name:`api-docs`,redirect:{path:`/settings`,query:{section:`api-docs`}}},{path:`ai-chat`,name:`ai-chat`,component:()=>bt(()=>Promise.resolve().then(()=>Nee),void 0)},{path:`scenario/new`,name:`scenario-new`,component:()=>bt(()=>import(`./ScenarioEditorPage-DvCdcY9m.js`),__vite__mapDeps([106,1,2,3,4,5,14,10,11,12,6,7,8,9,72,47,16,17,50,51,15,41,42,39,13,73,92,107]))},{path:`scenario/:id/edit`,name:`scenario-edit`,component:()=>bt(()=>import(`./ScenarioEditorPage-DvCdcY9m.js`),__vite__mapDeps([106,1,2,3,4,5,14,10,11,12,6,7,8,9,72,47,16,17,50,51,15,41,42,39,13,73,92,107])),props:!0},{path:`services/new`,name:`service-create`,component:()=>bt(()=>import(`./ServiceFormPage-fp8NCHSv.js`),__vite__mapDeps([108,1,2,3,4,5,14,10,11,12,6,7,8,9,16,17,39,40,41,42,109]))},{path:`services/:id/edit`,name:`service-edit`,component:()=>bt(()=>import(`./ServiceFormPage-fp8NCHSv.js`),__vite__mapDeps([108,1,2,3,4,5,14,10,11,12,6,7,8,9,16,17,39,40,41,42,109])),props:!0},{path:`services/:id/:tab?`,name:`service-detail`,component:()=>bt(()=>import(`./ServiceDetailPage-DhJcjFfY.js`),__vite__mapDeps([110,1,2,3,4,5,14,10,11,12,6,48,7,8,9,16,17,74,72,47,50,51,15,41,42,39,13,73,75,76,77,78,79,40,80,43,60,61,62,63,92,111,59,97,98,112,113,114,99,82,26,89,27,54,49,55,100,101,115,116,117]))},{path:`projects`,name:`projects`,redirect:{name:`dashboard`}},{path:`projects/:projectId`,name:`project-detail`,beforeEnter:async e=>{let{useProjectLaunchStore:t}=await bt(async()=>{let{useProjectLaunchStore:e}=await import(`./project-launch.store-CTmbl8UY.js`).then(e=>e.t);return{useProjectLaunchStore:e}},__vite__mapDeps([14,5,1,2,10,11,12])),{useProjectStore:n}=await bt(async()=>{let{useProjectStore:e}=await import(`./project.store-CNC6_4r4.js`).then(e=>e.t);return{useProjectStore:e}},__vite__mapDeps([16,5,1,2,14,10,11,12,17])),r=t(),i=n(),a=e.params.projectId,o=i.getById(a);return o?r.setActiveProject(o.id,o.orgId??null):r.setActiveProject(a),{name:`dashboard`}}},{path:`projects/:projectId/environments`,name:`environments`,component:()=>bt(()=>import(`./EnvironmentListPage-BDYeh7XF.js`),__vite__mapDeps([118,1,2,3,4,5,14,10,11,12,6,7,8,9,16,17,56,119,40,41,42,111,39,59,92,97,98,112,120,121])),meta:{titleKey:`environmentList.title`}},{path:`projects/:projectId/environments/:id/edit`,name:`environment-edit`,component:()=>bt(()=>import(`./EnvironmentFormPage-BIoy8fsW.js`),__vite__mapDeps([122,1,2,4,5,3,6,7,8,9,16,14,10,11,12,17,119,40,41,42,111,39,59,92,97,98,112,120,123])),meta:{titleKey:`environmentFormPage.editTitle`,backTo:`environments`}},{path:`process/:agentId/:processId`,name:`process-detail`,component:()=>bt(()=>import(`./ProcessDetailPage-Cj23FECq.js`),__vite__mapDeps([124,1,2,4,5,3,6,7,8,9,10,11,12,40,14,17,41,42,61,62,113,114,99,72,47,16,50,51,15,39,13,73,74,75,76,77,78,79,80,82,26,89,27,54,49,55,100,125])),props:!0},{path:`wiki`,name:`wiki-global`,component:()=>bt(()=>import(`./WikiPage-BiwpCM3E.js`),__vite__mapDeps([126,2,1,115,3,6,7,4,5,8,9,10,11,12,116]))},{path:`dev/random-job-test`,name:`dev-random-job-test`,component:()=>bt(()=>import(`./RandomJobTestPage-DQUMRHyf.js`),__vite__mapDeps([127,1,2,7,3,4,5,8,9,10,11,12,128]))}]}]}),Xee=new Set([`launch-project`,`launch-services`]),K9=!1,q9=!1,J9=!1;async function Zee(){if(J9)return!1;J9=!0;let e=xe();try{let t=await J.process.list.query(),n=Zt(t);if(n.size===0)return!1;let r=await J.project.list.query(),i=null,a=0;for(let e of r){let t=e.serviceIds.filter(e=>n.has(e)).length;t>a&&(a=t,i=e)}return i?(e.setActiveProject(i.id,i.orgId??null),e.completeLaunch(),!0):!1}catch(e){return console.error(`[router] Failed to detect running services:`,e),!1}}var Y9=null;async function Qee(e){if(Y9!==null)return Y9;try{let t=(await J.project.list.query()).find(t=>t.id===e);Y9=t?{id:t.id,orgId:t.orgId??null}:!1,t||console.warn(`[router] Projet ${e} (--project) introuvable : liste des projets affichée.`)}catch(e){return console.error(`[router] Failed to resolve locked project:`,e),!1}return Y9}async function $ee(e){let t=mt();if(!t)return;let n=await Qee(t);if(!n)return;let r=xe();if((r.activeProjectId!==n.id||r.activeOrgId!==n.orgId)&&(r.setActiveProject(n.id,n.orgId),r.launchCompleted=!1,e.name!==`launch-services`)||e.name===`launch-project`)return{name:`launch-services`,replace:!0};let i=e.params.projectId;if(typeof i==`string`&&i!==n.id)return{name:`dashboard`,replace:!0}}G9.beforeEach(async e=>{if(e.name===`unlock`)return;if(!K9){K9=!0;try{let t=await Ct();if(xt(t.ciMode===!0),t.state!==`unlocked`||!t.ciMode&&!wt())return{name:`unlock`,replace:!0};if(t.legacyVault&&e.name!==`migrate-vault`)return{name:`migrate-vault`,replace:!0}}catch{return{name:`unlock`,replace:!0}}}if(!wt())try{let e=await Ct();if(xt(e.ciMode===!0),e.state!==`unlocked`||!e.ciMode)return{name:`unlock`,replace:!0}}catch{return{name:`unlock`,replace:!0}}if(e.name===`migrate-vault`)return;await gt();let t=await $ee(e);if(t)return t;if(Xee.has(e.name))return;let n=xe();if(!n.launchCompleted&&!n.activeProjectId&&!await Zee())return{name:`launch-project`};if(!q9&&n.activeProjectId){q9=!0;try{if(!(await J.project.list.query()).some(e=>e.id===n.activeProjectId&&(e.orgId??null)===n.activeOrgId))return n.resetLaunch(),{name:`launch-project`}}catch(e){return console.error(`[router] Failed to validate current project:`,e),n.resetLaunch(),{name:`launch-project`}}}});var ete={class:`trigger-blob`},tte={class:`theme-layer`},nte={class:`theme-picker`},rte={class:`theme-section theme-section--row`},ite={class:`section-label`},ate={class:`theme-section theme-section--row`},ote={class:`section-label`},ste={class:`theme-section`},cte={class:`section-label`},lte={class:`swatches`},ute=[`title`,`aria-label`,`aria-pressed`,`onClick`],dte={class:`custom-hue-header`},fte={class:`section-label`},pte={class:`custom-hue-track-wrap`},X9=`#18181b`,Z9=`#f8fafc`,mte=Je(B({__name:`ThemePicker`,setup(e){let t=un.map(e=>({id:e,label:e[0].toUpperCase()+e.slice(1)}));function n(e){let t=tn(e);return[t[700],t[500],t[300],t[100]]}function a(e){let t=Number.parseInt(e.slice(1,3),16)/255,n=Number.parseInt(e.slice(3,5),16)/255,r=Number.parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r);if(i===a)return 0;let o=i-a,s=0;return s=i===t?((n-r)/o+(n<r?6:0))/6:i===n?((r-t)/o+2)/6:((t-n)/o+4)/6,Math.round(s*360)}let o=localStorage.getItem(`runeya-theme-color`)??`emerald`,s=localStorage.getItem(`runeya-theme-custom`)??`#10b981`,c=localStorage.getItem(`runeya-dark-mode`)===`1`,l=localStorage.getItem(`runeya-theme-gradient`)===`1`,u=i(o),d=i(s),f=i(a(s)),p=i(c),m=i(l),{t:h}=ve(),g=z(()=>{if(u.value===`custom`)return d.value;let e=t.find(e=>e.id===u.value)??t[3];return en[e.id][500]}),_=z(()=>n(g.value));function v(e){m.value=e,localStorage.setItem(`runeya-theme-gradient`,e?`1`:`0`),cn(e)}function y(e){u.value=e,localStorage.setItem(`runeya-theme-color`,e),nn(e,p.value,d.value)}function S(e){p.value=e,localStorage.setItem(`runeya-dark-mode`,e?`1`:`0`),nn(u.value,e,d.value)}function w(e){let t=e?.[0];t!==void 0&&(f.value=t,d.value=sn(t),localStorage.setItem(`runeya-theme-custom`,d.value),u.value=an,localStorage.setItem(`runeya-theme-color`,an),nn(an,p.value,d.value))}return C(d,e=>{/^#[0-9a-f]{6}$/i.test(e)&&(f.value=a(e))}),(e,i)=>(V(),G(r(Ze),null,{default:U(()=>[b(r(hn),{class:`theme-trigger`,title:r(h)(`themePicker.title`),"aria-label":r(h)(`themePicker.title`)},{default:U(()=>[N(`span`,ete,[(V(!0),P(H,null,F(_.value,(e,t)=>(V(),P(`span`,{key:t,class:`rad`,style:re({backgroundColor:e})},null,4))),128))])]),_:1},8,[`title`,`aria-label`]),(V(),G(le,{to:`body`},[N(`div`,tte,[b(r(it),{class:`theme-popover`,side:`bottom`,align:`end`,"side-offset":6,"collision-padding":8},{default:U(()=>[N(`div`,nte,[N(`div`,rte,[N(`span`,ite,W(r(h)(`themePicker.gradient`)),1),b(r(qe),{class:`gradient-toggle`,"model-value":m.value,"aria-label":m.value?r(h)(`themePicker.disableGradient`):r(h)(`themePicker.enableGradient`),"onUpdate:modelValue":v},{default:U(()=>[b(r(ke),{class:`gradient-toggle__thumb`})]),_:1},8,[`model-value`,`aria-label`])]),i[3]||=N(`div`,{class:`theme-divider`},null,-1),N(`div`,ate,[N(`span`,ote,W(r(h)(`themePicker.mode`)),1),b(r(Re),{type:`single`,class:`mode-toggle`,"model-value":p.value?`dark`:`light`,"aria-label":r(h)(`themePicker.mode`),"onUpdate:modelValue":i[0]||=e=>e&&S(e===`dark`)},{default:U(()=>[b(r(He),{value:`dark`,class:`mode-btn`},{default:U(()=>[i[1]||=N(`i`,{class:`ti ti-moon`,"aria-hidden":`true`},null,-1),x(` `+W(r(h)(`themePicker.dark`)),1)]),_:1}),b(r(He),{value:`light`,class:`mode-btn`},{default:U(()=>[i[2]||=N(`i`,{class:`ti ti-sun`,"aria-hidden":`true`},null,-1),x(` `+W(r(h)(`themePicker.light`)),1)]),_:1})]),_:1},8,[`model-value`,`aria-label`])]),i[4]||=N(`div`,{class:`theme-divider`},null,-1),N(`div`,ste,[N(`span`,cte,W(r(h)(`themePicker.accentColor`)),1),N(`div`,lte,[(V(!0),P(H,null,F(r(t),e=>(V(),P(`button`,{key:e.id,type:`button`,class:L([`swatch`,{active:u.value===e.id}]),title:e.label,"aria-label":e.label,"aria-pressed":u.value===e.id,style:re({"--swatch-bg":p.value?X9:Z9}),onClick:t=>y(e.id)},[N(`span`,{class:`viewwindow`,style:re({backgroundColor:p.value?X9:Z9})},[(V(!0),P(H,null,F(n(r(en)[e.id][500]),(e,t)=>(V(),P(`span`,{key:t,class:`rad`,style:re({backgroundColor:e})},null,4))),128))],4)],14,ute))),128))])]),N(`div`,{class:L([`theme-section custom-hue-section`,{"custom-hue-section--active":u.value===r(an)}])},[N(`div`,dte,[N(`span`,fte,W(r(h)(`themePicker.customColor`)),1),N(`span`,{class:`custom-hue-preview`,style:re({backgroundColor:d.value})},null,4)]),N(`div`,pte,[b(r($e),{class:`custom-hue-slider`,"model-value":[f.value],min:0,max:359,"aria-label":r(h)(`themePicker.customColor`),"onUpdate:modelValue":w},{default:U(()=>[b(r(Ye),{class:`custom-hue-slider__track`}),b(r(We),{class:`custom-hue-slider__thumb`})]),_:1},8,[`model-value`,`aria-label`])])],2)])]),_:1})])]))]),_:1}))}}),[[`__scopeId`,`data-v-53186dc2`]]),hte=[`width`,`height`],gte=[`rx`],_te=[`transform`],vte=[`d`,`stroke-width`],yte=[`cx`,`cy`,`r`],bte=Je(B({__name:`RuneyaLogo`,props:{size:{default:28}},setup(e){return(t,n)=>(V(),P(`svg`,{class:`runeya-logo`,viewBox:`0 0 100 100`,width:e.size,height:e.size,"aria-hidden":`true`},[N(`rect`,{class:`runeya-logo__bg`,width:`100`,height:`100`,rx:r($t).radius},null,8,gte),N(`g`,{transform:`translate(50 50) scale(${r(rn)}) translate(-50 -50)`},[N(`path`,{class:`runeya-logo__stroke`,d:r(dn).path,fill:`none`,"stroke-width":r(dn).stroke,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,vte),(V(!0),P(H,null,F(r(dn).dots,([e,t],n)=>(V(),P(`circle`,{key:n,class:`runeya-logo__fill`,cx:e,cy:t,r:r(dn).dotRadius},null,8,yte))),128))],8,_te)],8,hte))}}),[[`__scopeId`,`data-v-85f26936`]]),xte=t({announceThemeToServer:()=>Q9});async function Q9(){try{await J.desktop.setTrayAccent.mutate({color:ln()})}catch{}}globalThis.Buffer=mn.Buffer;async function Ste(){try{let e=await J.config.cloud.query();Ot(e)}catch(e){console.warn(`[cloud] Failed to fetch cloud config, using defaults:`,e)}}async function Cte(){try{ht(await J.config.app.query())}catch(e){console.warn(`[app] Failed to fetch app mode:`,e)}finally{pt()}}var $9=he(Jee);$9.use(Se()),$9.use(G9),$9.use(Ce),on(()=>{Q9()}),Qt(),_t(()=>{Q9()}),$9.directive(`tooltip`,rt),Ie(e=>{try{let t=Yt(),n={info:`info`,warn:`warn`,error:`error`,success:`success`,secondary:`info`}[e.severity??`info`]??`info`;t.add({type:n,title:String(e.summary??``),message:String(e.detail??``),category:`service_status_changed`})}catch{}}),$9.config.errorHandler=(e,t,n)=>{console.error(`[Vue Error]`,e,n);let r=e instanceof Error?e.message:`An unexpected error occurred`;Le().add({severity:`error`,summary:`Unexpected Error`,detail:r,life:5e3})};async function wte(){if(wt()){Tt(),yt();return}try{let e=await Ct();xt(e.ciMode===!0),e.state===`unlocked`&&e.ciMode&&yt()}catch{}}Promise.all([Ste(),Cte(),wte()]).finally(()=>{$9.mount(`#app`)});export{Y8 as A,LN as B,R4 as C,w3 as D,x3 as E,yR as F,Ad as G,TN as H,bR as I,qn as J,Td as K,aR as L,gZ as M,XV as N,S3 as O,DB as P,nF as R,k5 as S,E5 as T,wN as U,IN as V,wd as W,Dn as Y,M7 as _,W9 as a,O7 as b,V9 as c,m9 as d,s9 as f,Z7 as g,Y7 as h,Yee as i,M3 as j,c6 as k,v9 as l,J7 as m,bte as n,H9 as o,X7 as p,$n as q,mte as r,Pee as s,xte as t,p9 as u,A7 as v,D5 as w,R5 as x,k7 as y,iP as z};
|