@runeya/runeya 2.0.151 → 2.0.153
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 +9 -7
- package/agent/index.js.map +1 -1
- package/agent-manager-SF4CAJJC.js +13 -0
- package/chat-Z7SFBEXS.js +28 -0
- package/{chunk-ANZF5NLB.js → chunk-26Q43CB2.js} +2 -2
- package/{chunk-IOPX7MWA.js → chunk-2DIW5EUT.js} +6 -6
- package/{chunk-ZRMLIQZL.js → chunk-3C3R5ZVX.js} +2 -2
- package/{chunk-I2EXJ2GI.js → chunk-3O54EIGT.js} +4 -4
- package/{chunk-KTRL6RDH.js → chunk-DTRZ5ZN7.js} +5 -5
- package/{chunk-3FSQ45SW.js → chunk-EUTW2S4P.js} +87 -16
- package/chunk-EUTW2S4P.js.map +1 -0
- package/{chunk-NVU7QNZO.js → chunk-MGKGIHT4.js} +2 -4
- package/{chunk-NVU7QNZO.js.map → chunk-MGKGIHT4.js.map} +1 -1
- package/{chunk-FYAKLTSY.js → chunk-PU6REPMY.js} +5 -5
- package/{chunk-FYAKLTSY.js.map → chunk-PU6REPMY.js.map} +1 -1
- package/{chunk-NKOG7375.js → chunk-QD2OVLK4.js} +2 -2
- package/{chunk-7O54TV2Y.js → chunk-QJSIN26R.js} +45 -38
- package/chunk-QJSIN26R.js.map +1 -0
- package/{chunk-3JIJSGQW.js → chunk-R4SKU6AO.js} +10 -12
- package/chunk-R4SKU6AO.js.map +1 -0
- package/{chunk-OCIKN4BK.js → chunk-RVZATF7R.js} +8 -8
- package/chunk-RVZATF7R.js.map +1 -0
- package/{chunk-YTO4O3UK.js → chunk-TBNCGMDM.js} +5 -5
- package/{companion-2YZZSKX5.js → companion-ZDEGNZ2G.js} +11 -9
- package/{desktop-installer-page-526XOYLO.js → desktop-installer-page-TBKSXVFD.js} +3 -3
- package/{desktop-launcher-WJPN6SPV.js → desktop-launcher-WBYP3KTF.js} +3 -3
- package/{environment-resolver-I6KF27QP.js → environment-resolver-R2GH6QOX.js} +6 -6
- package/{external-XHTD2IGX.js → external-UJ46WKBL.js} +3 -3
- package/index.js +15 -15
- package/index.js.map +1 -1
- package/{install-gate-VIJIEVF2.js → install-gate-TSCXUCYE.js} +2 -2
- package/mcp-server/external.js +7 -6
- package/mcp-server/external.js.map +1 -1
- package/mcp-server/index.js +7 -6
- package/mcp-server/index.js.map +1 -1
- package/package.json +1 -1
- package/{project-store-GONXVR2N.js → project-store-GBKM34QP.js} +7 -7
- package/settings-manager-VSOC3XGI.js +10 -0
- package/{src-QMPTXT7D.js → src-6WZKSNN7.js} +2 -2
- package/{src-ZDXFSJMJ.js → src-NWPED6TK.js} +33 -39
- package/src-NWPED6TK.js.map +1 -0
- package/{vault-resolver-MX7WFBJ5.js → vault-resolver-GGHULMG6.js} +3 -3
- package/web/assets/{AgentScalarChatInterface.vue-DXbf1TAm.js → AgentScalarChatInterface.vue-CEMnvqfq.js} +1 -1
- package/web/assets/{AgentTerminalPage-CgsW_pEb.js → AgentTerminalPage-qQ96vm5Y.js} +1 -1
- package/web/assets/{AiChatModals-DLTvqUBK.js → AiChatModals-BsfKdbEA.js} +1 -1
- package/web/assets/{AppLayout-BlhwflMq.css → AppLayout-Djk3-XbN.css} +1 -1
- package/web/assets/AppLayout-f0_BsXSc.js +1 -0
- package/web/assets/{AuditPage-HMNBcG9E.js → AuditPage-B-pCRqXH.js} +1 -1
- package/web/assets/CloudAccountPage-C7aV6M8U.js +1 -0
- package/web/assets/{CloudAccountPage-Ctf2gtpm.css → CloudAccountPage-CYcW_3tO.css} +1 -1
- package/web/assets/{CloudMessagingPage-Csbnn-Zm.js → CloudMessagingPage-BTc8xbjF.js} +1 -1
- package/web/assets/{DashboardPage-BeCmdPlp.js → DashboardPage-CF7GLFlx.js} +1 -1
- package/web/assets/{DirectoryPickerDialog-DpUZT_4M.js → DirectoryPickerDialog-bKqIFy8e.js} +1 -1
- package/web/assets/{EditorIcon-CcU8Z46_.js → EditorIcon-DksI79ZN.js} +1 -1
- package/web/assets/EnvironmentForm-BnTLokUw.css +1 -0
- package/web/assets/{EnvironmentForm-ypeBVGl-.js → EnvironmentForm-kOyM5xTa.js} +1 -1
- package/web/assets/{EnvironmentFormPage-B1gVyMWV.js → EnvironmentFormPage-DfNI6meL.js} +1 -1
- package/web/assets/{EnvironmentListPage-CdE-ksue.js → EnvironmentListPage-C1VLgeeP.js} +1 -1
- package/web/assets/{FlagChip-maG1f7pl.js → FlagChip-DjC14z4J.js} +1 -1
- package/web/assets/{KanbanBoardPage-_E6xalsS.js → KanbanBoardPage-Bl6UnQ6P.js} +3 -3
- package/web/assets/KanbanBoardPage-Cmu4Je4N.css +1 -0
- package/web/assets/{KanbanListPage-BigioApQ.css → KanbanListPage-DCK-N3nw.css} +1 -1
- package/web/assets/{KanbanListPage-DkjiefP8.js → KanbanListPage-Dly6XiRC.js} +1 -1
- package/web/assets/{LaunchProjectPage-C4kuqyMZ.js → LaunchProjectPage-DCrKSY8v.js} +1 -1
- package/web/assets/{LaunchServicesPage-s8HZF2aU.js → LaunchServicesPage-Bl1pjfYH.js} +1 -1
- package/web/assets/{LaunchShell-GWtn69Hh.js → LaunchShell-BcbfPDdc.js} +1 -1
- package/web/assets/{LogViewer-B0XUfzs3.js → LogViewer-C_XcH7Oe.js} +1 -1
- package/web/assets/{OrgKeyPrompt-Ch8jziJJ.js → OrgKeyPrompt-BK6gkvaO.js} +1 -1
- package/web/assets/{ProcessControls-bZbJJjkv.js → ProcessControls-BbRdiZsD.js} +1 -1
- package/web/assets/ProcessDetailPage-B7bD2jmj.css +1 -0
- package/web/assets/ProcessDetailPage-W7S7ogas.js +1 -0
- package/web/assets/{ProcessMetrics-D-rQkzqK.js → ProcessMetrics-C_7_boMv.js} +1 -1
- package/web/assets/{ProjectCreateDialog-KjvGUZnr.js → ProjectCreateDialog-q_39qiPd.js} +1 -1
- package/web/assets/{ProjectLocationGate-DFe2hgxM.js → ProjectLocationGate-BFvdSy-B.js} +1 -1
- package/web/assets/{ProjectPublishDialog-BgPH5gGM.js → ProjectPublishDialog-DAJAvDTT.js} +1 -1
- package/web/assets/{RandomJobTestPage-Bv3l2Trh.js → RandomJobTestPage-A-I7cImN.js} +1 -1
- package/web/assets/{ScenarioEditorPage-BtKSjE2X.css → ScenarioEditorPage-BwLBCVeS.css} +1 -1
- package/web/assets/ScenarioEditorPage-DXw4bCxb.js +14 -0
- package/web/assets/{SendToChatDialog-CkWcPSvZ.js → SendToChatDialog-CbhE2WYO.js} +1 -1
- package/web/assets/{ServiceControlsBar-VywLkYdH.js → ServiceControlsBar-CudCeQql.js} +1 -1
- package/web/assets/ServiceDetailPage-DQvL-VOx.js +2 -0
- package/web/assets/{ServiceDetailPage-CM5uzqpI.css → ServiceDetailPage-DuXvqXk4.css} +1 -1
- package/web/assets/{ServiceFormPage-v9c7DVdv.js → ServiceFormPage-0qXPeqrh.js} +1 -1
- package/web/assets/{SettingsPage-CetQ42p1.js → SettingsPage-Bjn4bKPP.js} +7 -7
- package/web/assets/{SettingsPage-B951NEBm.css → SettingsPage-NpFX7FAy.css} +1 -1
- package/web/assets/{UnlockPage-CZMvcAl1.js → UnlockPage-CtvaQt45.js} +1 -1
- package/web/assets/{VaultMigrationPage-CeX0mpxh.js → VaultMigrationPage-DtoAlng4.js} +1 -1
- package/web/assets/{VersionBadge-DDmZ4Dhc.js → VersionBadge-CiBz82BB.js} +1 -1
- package/web/assets/{WikiPage-3puq_dIL.js → WikiPage-cuKigw_5.js} +1 -1
- package/web/assets/{WikiView-J4U7er--.js → WikiView-BW-B83LB.js} +1 -1
- package/web/assets/{add-scalar-classes-B7027Ds2.js → add-scalar-classes-BPTxQDQd.js} +1 -1
- package/web/assets/{agent.store-CAhnz7FI.js → agent.store-DumNiX1X.js} +1 -1
- package/web/assets/{auth-DEwzvqNZ.js → auth-Qa1l14iV.js} +2 -2
- package/web/assets/{cloud-chat.store-Dw5IpDzc.js → cloud-chat.store-TYR1_27Z.js} +1 -1
- package/web/assets/{cloud-client-BmRvC15v.js → cloud-client-CdOqrdP_.js} +2 -2
- package/web/assets/{cloud-session-CxfJk0xr.js → cloud-session-Dd7b9wxV.js} +2 -2
- package/web/assets/dist-C9Qdh18x.js +1 -0
- package/web/assets/i18n-DipCGVKv.js +1 -0
- package/web/assets/{index-DSYMPMcP.js → index-BCU69ZHl.js} +7 -7
- package/web/assets/{index-CnXzQkLZ.css → index-Ck_3m_I9.css} +1 -1
- package/web/assets/{modal-CWJFP30c.js → modal-BgrgFhyC.js} +1 -1
- package/web/assets/notification.store-D2olEA0V.js +1 -0
- package/web/assets/{project-launch.store-_peuBwFo.js → project-launch.store-MX5LzgIm.js} +1 -1
- package/web/assets/{project.store-eANeFYaH.js → project.store-BFwiDQ1X.js} +1 -1
- package/web/assets/{scenario.store-C1Yj7c6l.js → scenario.store-C8kW-yTN.js} +1 -1
- package/web/assets/{service.store-Ck2_TmTB.js → service.store-B0Ass90H.js} +1 -1
- package/web/assets/{settings-scope-GiU9Nkh7.js → settings-scope-D0hzzuyq.js} +1 -1
- package/web/assets/settings.store-B9Kp0l1G.js +1 -0
- package/web/assets/{src-Bfb0PBSC.css → src-CfDz-9Q6.css} +1 -1
- package/web/assets/{src-DOcCcTQv.js → src-Ck_MutzB.js} +1 -1
- package/web/assets/{src-BsRUOIiC.js → src-DITmhvGS.js} +1 -1
- package/web/assets/src-DOziuDw8.css +1 -0
- package/web/assets/src-DnjsM9el.js +1960 -0
- package/web/assets/{trpc-Deb6EPHJ.js → trpc-BvrR5qP9.js} +3 -3
- package/web/assets/{useCloudOrg-7IK98BjW.js → useCloudOrg-2vv5fVV6.js} +1 -1
- package/web/assets/{useEnvVarAutocomplete-lfgStLwz.js → useEnvVarAutocomplete-VVX3MC62.js} +1 -1
- package/web/assets/{useEnvVarAutocomplete-B-LJ9dBm.css → useEnvVarAutocomplete-gV2loQYv.css} +1 -1
- package/web/assets/{useProjectCatalog-J40rgwRP.js → useProjectCatalog-DsVvtBzo.js} +1 -1
- package/web/assets/{useProjectCloudOrg-zePV-ihH.js → useProjectCloudOrg-wv-RfsmO.js} +1 -1
- package/web/assets/{useServiceUrlHost-BWtmwnoK.js → useServiceUrlHost-C4Evrede.js} +1 -1
- package/web/index.html +19 -19
- package/agent-manager-2KTEZXRO.js +0 -13
- package/chat-N2AYGN7I.js +0 -28
- package/chunk-3FSQ45SW.js.map +0 -1
- package/chunk-3JIJSGQW.js.map +0 -1
- package/chunk-7O54TV2Y.js.map +0 -1
- package/chunk-DA2DZBTL.js +0 -43
- package/chunk-DA2DZBTL.js.map +0 -1
- package/chunk-OCIKN4BK.js.map +0 -1
- package/mcp-ready-TAPBAOZY.js +0 -9
- package/settings-manager-QOLMKVP2.js +0 -10
- package/src-ZDXFSJMJ.js.map +0 -1
- package/vault-resolver-MX7WFBJ5.js.map +0 -1
- package/web/assets/AppLayout-BFCPOgV1.js +0 -1
- package/web/assets/CloudAccountPage-DXMDa3Zw.js +0 -1
- package/web/assets/EnvironmentForm-Do3i-fOk.css +0 -1
- package/web/assets/KanbanBoardPage-Bb_8xU-I.css +0 -1
- package/web/assets/ProcessDetailPage-CJcIxbLm.css +0 -1
- package/web/assets/ProcessDetailPage-Cy_9S9z8.js +0 -1
- package/web/assets/ScenarioEditorPage-DMZ_67kP.js +0 -14
- package/web/assets/ServiceDetailPage-C-RIYfjD.js +0 -2
- package/web/assets/dist-B6L3Jwj-.js +0 -1
- package/web/assets/i18n-BNITS3xi.js +0 -1
- package/web/assets/notification.store-C1JOcW8z.js +0 -1
- package/web/assets/settings.store-C6T1P_cU.js +0 -1
- package/web/assets/src-Dbg3CMY2.css +0 -1
- package/web/assets/src-Ip9ugq4e.js +0 -1960
- /package/{agent-manager-2KTEZXRO.js.map → agent-manager-SF4CAJJC.js.map} +0 -0
- /package/{chat-N2AYGN7I.js.map → chat-Z7SFBEXS.js.map} +0 -0
- /package/{chunk-ANZF5NLB.js.map → chunk-26Q43CB2.js.map} +0 -0
- /package/{chunk-IOPX7MWA.js.map → chunk-2DIW5EUT.js.map} +0 -0
- /package/{chunk-ZRMLIQZL.js.map → chunk-3C3R5ZVX.js.map} +0 -0
- /package/{chunk-I2EXJ2GI.js.map → chunk-3O54EIGT.js.map} +0 -0
- /package/{chunk-KTRL6RDH.js.map → chunk-DTRZ5ZN7.js.map} +0 -0
- /package/{chunk-NKOG7375.js.map → chunk-QD2OVLK4.js.map} +0 -0
- /package/{chunk-YTO4O3UK.js.map → chunk-TBNCGMDM.js.map} +0 -0
- /package/{companion-2YZZSKX5.js.map → companion-ZDEGNZ2G.js.map} +0 -0
- /package/{desktop-installer-page-526XOYLO.js.map → desktop-installer-page-TBKSXVFD.js.map} +0 -0
- /package/{desktop-launcher-WJPN6SPV.js.map → desktop-launcher-WBYP3KTF.js.map} +0 -0
- /package/{environment-resolver-I6KF27QP.js.map → environment-resolver-R2GH6QOX.js.map} +0 -0
- /package/{external-XHTD2IGX.js.map → external-UJ46WKBL.js.map} +0 -0
- /package/{install-gate-VIJIEVF2.js.map → install-gate-TSCXUCYE.js.map} +0 -0
- /package/{mcp-ready-TAPBAOZY.js.map → project-store-GBKM34QP.js.map} +0 -0
- /package/{project-store-GONXVR2N.js.map → settings-manager-VSOC3XGI.js.map} +0 -0
- /package/{settings-manager-QOLMKVP2.js.map → src-6WZKSNN7.js.map} +0 -0
- /package/{src-QMPTXT7D.js.map → vault-resolver-GGHULMG6.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/UnlockPage-
|
|
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-_peuBwFo.js";import{r as Ce}from"./i18n-BNITS3xi.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-DOcCcTQv.js";import{a as st,i as ct,o as lt,r as ut,t as dt}from"./scenario.store-C1Yj7c6l.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-Deb6EPHJ.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-DEwzvqNZ.js";import{n as Et,r as Dt}from"./project.store-eANeFYaH.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-J40rgwRP.js";import{n as Nt,r as Pt}from"./error-DpF7X5iu.js";import{n as Ft,r as It}from"./cloud-client-BmRvC15v.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-DLTvqUBK.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-B6L3Jwj-.js";import{t as Jt}from"./service.store-Ck2_TmTB.js";import{t as Yt}from"./notification.store-C1JOcW8z.js";import{t as Xt}from"./agent.store-CAhnz7FI.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(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/UnlockPage-CtvaQt45.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-Ck_MutzB.js","assets/floating-ui.dom-DF3oyfHd.js","assets/src-DOziuDw8.css","assets/trpc-BvrR5qP9.js","assets/preload-helper-BZ1Pz5am.js","assets/auth-Qa1l14iV.js","assets/notification.store-D2olEA0V.js","assets/project-launch.store-MX5LzgIm.js","assets/settings-scope-D0hzzuyq.js","assets/project.store-BFwiDQ1X.js","assets/error-DpF7X5iu.js","assets/VersionBadge-CiBz82BB.js","assets/VersionBadge-CtFji3sv.css","assets/UnlockPage-Ce0qsHfn.css","assets/VaultMigrationPage-DtoAlng4.js","assets/VaultMigrationPage-DMiPJOSR.css","assets/LaunchProjectPage-DCrKSY8v.js","assets/useProjectCatalog-DsVvtBzo.js","assets/cloud-auth-D_am4FlK.js","assets/cloud-session-Dd7b9wxV.js","assets/cloud-client-CdOqrdP_.js","assets/OrgKeyPrompt-BK6gkvaO.js","assets/OrgKeyPrompt-FmlWgsj4.css","assets/DirectoryPickerDialog-bKqIFy8e.js","assets/DirectoryPickerDialog-3lnhU2DU.css","assets/ProjectCreateDialog-q_39qiPd.js","assets/ProjectCreateDialog-BfY7qA0G.css","assets/LaunchShell-BcbfPDdc.js","assets/LaunchShell-y_3rrtGa.css","assets/LaunchProjectPage-CyKA9pY5.css","assets/LaunchServicesPage-Bl1pjfYH.js","assets/app-mode-BVpTuh0i.js","assets/service.store-B0Ass90H.js","assets/agent.store-DumNiX1X.js","assets/dist-C9Qdh18x.js","assets/schemas-68I2iCLF.js","assets/process-BWkHpZOM.js","assets/ProjectLocationGate-BFvdSy-B.js","assets/LaunchServicesPage-h5o3zLcy.css","assets/AppLayout-f0_BsXSc.js","assets/i18n-DipCGVKv.js","assets/vue-router-fin80h5W.js","assets/composables-DguCUR3O.js","assets/use-polling-CEkhIY_9.js","assets/useAiChatDrawer-D_ofn8Eo.js","assets/cloud-chat.store-TYR1_27Z.js","assets/shared-sse-Dcj_cNvF.js","assets/src-DITmhvGS.js","assets/src-16-vEwhK.css","assets/page-actions-CSvO7j9F.js","assets/EditorIcon-DksI79ZN.js","assets/EditorIcon-84kLQJ1r.css","assets/useServiceUrlHost-C4Evrede.js","assets/ServiceControlsBar-CudCeQql.js","assets/ProcessControls-BbRdiZsD.js","assets/ProcessControls-B7hWVqiR.css","assets/ServiceControlsBar-CRwt-Xry.css","assets/ProjectPublishDialog-DAJAvDTT.js","assets/ProjectPublishDialog-Cd-9yn6d.css","assets/AppLayout-Djk3-XbN.css","assets/DashboardPage-CF7GLFlx.js","assets/DashboardPage-FvNuC_e4.css","assets/CloudAccountPage-C7aV6M8U.js","assets/CloudAccountPage-CYcW_3tO.css","assets/CloudMessagingPage-BTc8xbjF.js","assets/scenario.store-C8kW-yTN.js","assets/scenario-DOeZsRCE.css","assets/AiChatModals-BsfKdbEA.js","assets/editor.api-Bef3xeth.js","assets/editor-8AbsNvUX.css","assets/toggleHighContrast-Dqz1Qao1.js","assets/toggleHighContrast--ixms01u.css","assets/register-BLGIM2pN.js","assets/AiChatModals-BmWxg-Sr.css","assets/useCloudOrg-2vv5fVV6.js","assets/useProjectCloudOrg-wv-RfsmO.js","assets/CloudMessagingPage-Cn3JhJsY.css","assets/KanbanListPage-Dly6XiRC.js","assets/src-DnjsM9el.js","assets/src-CfDz-9Q6.css","assets/KanbanListPage-DCK-N3nw.css","assets/KanbanBoardPage-Bl6UnQ6P.js","assets/SendToChatDialog-CbhE2WYO.js","assets/KanbanBoardPage-Cmu4Je4N.css","assets/AgentTerminalPage-qQ96vm5Y.js","assets/uuid-XipkJWQw.js","assets/AgentTerminalPage-DbPtGy0f.css","assets/AuditPage-B-pCRqXH.js","assets/AuditPage-DRnnuzwq.css","assets/SettingsPage-Bjn4bKPP.js","assets/FlagChip-DjC14z4J.js","assets/FlagChip-hKL2frzh.css","assets/LogViewer-C_XcH7Oe.js","assets/LogViewer-OHdSLleq.css","assets/settings.store-B9Kp0l1G.js","assets/add-scalar-classes-BPTxQDQd.js","assets/interface-content-folder.svg-CnsmgXBU.js","assets/browser-BpWB_ayN.js","assets/SettingsPage-NpFX7FAy.css","assets/ScenarioEditorPage-DXw4bCxb.js","assets/ScenarioEditorPage-BwLBCVeS.css","assets/ServiceFormPage-0qXPeqrh.js","assets/ServiceFormPage-CQ6xL0Rr.css","assets/ServiceDetailPage-DQvL-VOx.js","assets/useEnvVarAutocomplete-VVX3MC62.js","assets/useEnvVarAutocomplete-gV2loQYv.css","assets/ProcessMetrics-C_7_boMv.js","assets/ProcessMetrics-kCY31aHV.css","assets/WikiView-BW-B83LB.js","assets/WikiView-CGsHxjvn.css","assets/ServiceDetailPage-DuXvqXk4.css","assets/EnvironmentListPage-C1VLgeeP.js","assets/EnvironmentForm-kOyM5xTa.js","assets/EnvironmentForm-BnTLokUw.css","assets/EnvironmentListPage-BKhq_xXN.css","assets/EnvironmentFormPage-DfNI6meL.js","assets/EnvironmentFormPage-C1gS0BI_.css","assets/ProcessDetailPage-W7S7ogas.js","assets/ProcessDetailPage-B7bD2jmj.css","assets/WikiPage-cuKigw_5.js","assets/RandomJobTestPage-A-I7cImN.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-MX5LzgIm.js";import{r as Ce}from"./i18n-DipCGVKv.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-Ck_MutzB.js";import{a as st,i as ct,o as lt,r as ut,t as dt}from"./scenario.store-C8kW-yTN.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-BvrR5qP9.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-Qa1l14iV.js";import{n as Et,r as Dt}from"./project.store-BFwiDQ1X.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-DsVvtBzo.js";import{n as Nt,r as Pt}from"./error-DpF7X5iu.js";import{n as Ft,r as It}from"./cloud-client-CdOqrdP_.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-BsfKdbEA.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-C9Qdh18x.js";import{t as Jt}from"./service.store-B0Ass90H.js";import{t as Yt}from"./notification.store-D2olEA0V.js";import{t as Xt}from"./agent.store-DumNiX1X.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
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
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
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(`
|
|
@@ -194,8 +194,8 @@ ${t.innerHTML}
|
|
|
194
194
|
`?t:t[t.length-1]===`
|
|
195
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
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,lt()&&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(st,{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=ut(),{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(ct)),j=z(()=>O.value.filter(e=>!ct(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(()=>{lt()&&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,lt()&&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(()=>{lt()&&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} *[^
|
|
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=>()=>O.value?(M(e),!0):!1,t=()=>!O.value||!k.value&&!S.value?!1:(I(),!0);return{Escape:()=>O.value?(A(),!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=o.modelValue??``,h=null,g=null;function _(e){return o.markdown?e.storage.markdown.getMarkdown():e.getHTML()}let v=jh({content:o.modelValue,onCreate({editor:e}){h=_(e)},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}){j(e)},onBlur(){A()},onUpdate({editor:e}){j(e);let t=_(e);g=t===h?m:t,s(`update:modelValue`,g)},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}}}}),y=i(null),x=i(0),S=i(!1),w=i({top:0,left:0}),T=/(?:^|[\s([>])@([\p{L}\p{N}._'-]*(?: [\p{L}\p{N}._'-]*)?)$/u;function E(e){return e.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).toLowerCase()}let D=z(()=>{if(y.value===null)return[];let e=E(y.value.trim());return o.mentions.filter(t=>!e||E(t.label).includes(e)).slice(0,CN)}),O=z(()=>y.value!==null&&D.value.length>0),k=z(()=>O.value&&(y.value??``).trim().length>0);function A(){y.value=null,x.value=0,S.value=!1}function j(e){if(!o.mentions.length||!o.editable){A();return}try{let t=e.state.selection;if(!t.empty){A();return}let n=t.from-Math.min(t.$from.parentOffset,60),r=e.state.doc.textBetween(n,t.from,`
|
|
198
|
+
`,``),i=T.exec(r);if(!i){A();return}let a=e.view.coordsAtPos(t.from),o=Math.max(8,window.innerWidth-SN-8);w.value={top:a.bottom+4,left:Math.min(Math.max(8,a.left),o)},y.value===null&&(x.value=0),y.value!==(i[1]??``)&&(S.value=!1),y.value=i[1]??``}catch{A()}}function M(e){let t=D.value.length;t&&(S.value=!0,x.value=(x.value+e+t)%t)}function I(e){let t=v.value,n=e??D.value[x.value];if(!t||!n||y.value===null)return;let r=t.state.selection.from,i=r-y.value.length-1;A(),t.chain().focus().insertContentAt({from:i,to:r},`@${n.label} `).run()}C(()=>o.modelValue,e=>{if(!v.value)return;let t=v.value;if(e!==g){if(m=e??``,_(t)===e){h=e;return}t.commands.setContent(e??``,{emitUpdate:!1}),h=_(t)}}),C(()=>o.mentions,()=>{let e=v.value;e&&e.view.dispatch(e.state.tr)},{deep:!0}),C(()=>o.editable,e=>{v.value?.setEditable(e)}),ne(()=>v.value?.destroy());function R(e){v.value?.chain().focus().setImage({src:e}).run()}function ee(){let e=v.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 te(e,t){let n=v.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 B(){v.value?.commands.focus()}t({insertImage:R,insertWikiLink:te,promptExternalLink:ee,focus:B});let{t:ie}=ve();return(t,n)=>r(v)?(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(v).isActive(`bold`)}]),title:r(ie)(`tiptapEditor.bold`),onClick:n[0]||=e=>r(v).chain().focus().toggleBold().run()},[...n[18]||=[N(`b`,null,`B`,-1)]],10,$M),N(`button`,{class:L([`tt-btn`,{"tt-btn--active":r(v).isActive(`italic`)}]),title:r(ie)(`tiptapEditor.italic`),onClick:n[1]||=e=>r(v).chain().focus().toggleItalic().run()},[...n[19]||=[N(`i`,null,`I`,-1)]],10,eN),N(`button`,{class:L([`tt-btn`,{"tt-btn--active":r(v).isActive(`underline`)}]),title:r(ie)(`tiptapEditor.underline`),onClick:n[2]||=e=>r(v).chain().focus().toggleUnderline().run()},[...n[20]||=[N(`u`,null,`U`,-1)]],10,tN),N(`button`,{class:L([`tt-btn`,{"tt-btn--active":r(v).isActive(`strike`)}]),title:r(ie)(`tiptapEditor.strikethrough`),onClick:n[3]||=e=>r(v).chain().focus().toggleStrike().run()},[...n[21]||=[N(`s`,null,`S`,-1)]],10,nN),N(`button`,{class:L([`tt-btn`,{"tt-btn--active":r(v).isActive(`highlight`)}]),title:r(ie)(`tiptapEditor.highlight`),onClick:n[4]||=e=>r(v).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(v).isActive(`heading`,{level:1})}]),title:r(ie)(`tiptapEditor.heading1`),onClick:n[5]||=e=>r(v).chain().focus().toggleHeading({level:1}).run()},`H1`,10,aN),N(`button`,{class:L([`tt-btn`,{"tt-btn--active":r(v).isActive(`heading`,{level:2})}]),title:r(ie)(`tiptapEditor.heading2`),onClick:n[6]||=e=>r(v).chain().focus().toggleHeading({level:2}).run()},`H2`,10,oN),N(`button`,{class:L([`tt-btn`,{"tt-btn--active":r(v).isActive(`heading`,{level:3})}]),title:r(ie)(`tiptapEditor.heading3`),onClick:n[7]||=e=>r(v).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(v).isActive(`bulletList`)}]),title:r(ie)(`tiptapEditor.bulletList`),onClick:n[8]||=e=>r(v).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(v).isActive(`orderedList`)}]),title:r(ie)(`tiptapEditor.orderedList`),onClick:n[9]||=e=>r(v).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(v).isActive(`taskList`)}]),title:r(ie)(`tiptapEditor.taskList`),onClick:n[10]||=e=>r(v).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(v).isActive(`blockquote`)}]),title:r(ie)(`tiptapEditor.quote`),onClick:n[11]||=e=>r(v).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(v).isActive(`code`)}]),title:r(ie)(`tiptapEditor.inlineCode`),onClick:n[12]||=e=>r(v).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(v).isActive(`codeBlock`)}]),title:r(ie)(`tiptapEditor.codeBlock`),onClick:n[13]||=e=>r(v).chain().focus().toggleCodeBlock().run()},`</>`,10,hN),N(`button`,{class:`tt-btn`,title:r(ie)(`tiptapEditor.horizontalRule`),onClick:n[14]||=e=>r(v).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(v).isActive(`link`)}]),title:`Lien`,onClick:ee},[...n[29]||=[N(`i`,{class:`ti ti-link`},null,-1)]],2),r(v).isActive(`link`)?(V(),P(`button`,{key:0,class:`tt-btn`,title:`Supprimer le lien`,onClick:n[15]||=e=>r(v).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(ie)(`tiptapEditor.undo`),disabled:!r(v).can().undo(),onClick:n[16]||=e=>r(v).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(ie)(`tiptapEditor.redo`),disabled:!r(v).can().redo(),onClick:n[17]||=e=>r(v).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(v),class:`tt-content`},null,8,[`editor`]),(V(),G(le,{to:`body`},[O.value?(V(),P(`ul`,{key:0,class:`tt-mentions`,style:re({top:`${w.value.top}px`,left:`${w.value.left}px`})},[(V(!0),P(H,null,F(D.value,(e,t)=>(V(),P(`li`,{key:e.id,class:L([`tt-mentions__item`,{"tt-mentions__item--active":t===x.value}]),onMousedown:_e(t=>I(e),[`prevent`]),onMouseenter:e=>x.value=t},W(e.label),43,xN))),128))],4)):K(``,!0)]))])],6)):K(``,!0)}}),[[`__scopeId`,`data-v-4984fb6a`]]);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,lt()&&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(st,{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=ut(),{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(ct)),j=z(()=>O.value.filter(e=>!ct(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(()=>{lt()&&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,lt()&&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(()=>{lt()&&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
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
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
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(`
|
|
@@ -279,7 +279,7 @@ WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){t
|
|
|
279
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
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
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(`+`,`
|
|
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}\nCommands: ${t.commands.map(e=>e.command).join(` ; `)||`(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-f2640e3e`]]);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
283
|
`).replace(`
|
|
284
284
|
|
|
285
285
|
`,`
|
|
@@ -304,6 +304,6 @@ Edge: ${e}
|
|
|
304
304
|
Source: ${t}
|
|
305
305
|
Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
|
|
306
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-a4983f6f`]]),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-fd4557d8`]]),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=ut(),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(`
|
|
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-53195966`]]),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{getEdges:a}=Y8(V5),s=z(()=>n.scenario),c=z(()=>{if(!s.value)return[];let e=(s.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=s.value.nodes.map(e=>({id:e.id,position:{...e.position},label:e.label,data:{label:e.label,isLeader:e.id===s.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]}),l=z(()=>{if(!s.value)return[];let e=[];for(let t of s.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 a.value)e.animated=t},{deep:!0}),(e,t)=>(V(),P(`div`,z5,[s.value?(V(),G(r(E5),{key:1,id:V5,nodes:c.value,edges:l.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-0388d65e`]]),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=ut(),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
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=ut(),{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=ut(),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 st=v9();it(e=>e===st.pendingConvId.value,async e=>{st.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&&st.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 ct=!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}`},()=>{ct=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(!ct)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()=>{lt()&&console.time(`[ai-chat][page] mount`),lt()&&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(),lt()&&console.timeEnd(`[ai-chat][page] mount`)}),ie(()=>{Be+=1,lt()&&console.log(`[ai-chat][page]`,Ve(),`updated`,{count:Be,activeId:l.value,hasConversation:!!u.value,isStreaming:d.value,drawerHideSidebar:pt.value})}),ee(()=>{lt()&&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(){lt()&&console.log(`[ai-chat][drawer]`,S(),`show`,{expanded:v.value,route:u.currentRoute.value.fullPath})}function T(){lt()&&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-CZMvcAl1.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-CeX0mpxh.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-C4kuqyMZ.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-s8HZF2aU.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-BFCPOgV1.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-BeCmdPlp.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-DXMDa3Zw.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-Csbnn-Zm.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-DkjiefP8.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-DkjiefP8.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-_E6xalsS.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-_E6xalsS.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-_E6xalsS.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-_E6xalsS.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-CgsW_pEb.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-HMNBcG9E.js`),__vite__mapDeps([94,1,2,4,5,3,7,8,9,10,11,12,95]))},{path:`settings`,name:`settings`,component:()=>bt(()=>import(`./SettingsPage-CetQ42p1.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-DMZ_67kP.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-DMZ_67kP.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-v9c7DVdv.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-v9c7DVdv.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-C-RIYfjD.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-_peuBwFo.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-eANeFYaH.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-CdE-ksue.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-B1gVyMWV.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-Cy_9S9z8.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-3puq_dIL.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-Bv3l2Trh.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};
|
|
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=ut(),{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=ut(),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 st=v9();it(e=>e===st.pendingConvId.value,async e=>{st.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&&st.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 ct=!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}`},()=>{ct=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(!ct)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()=>{lt()&&console.time(`[ai-chat][page] mount`),lt()&&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(),lt()&&console.timeEnd(`[ai-chat][page] mount`)}),ie(()=>{Be+=1,lt()&&console.log(`[ai-chat][page]`,Ve(),`updated`,{count:Be,activeId:l.value,hasConversation:!!u.value,isStreaming:d.value,drawerHideSidebar:pt.value})}),ee(()=>{lt()&&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)&&r(m)!==null?(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-b924a698`]]),Pee=t({useProcessStore:()=>V9}),z9=5,Fee=Gt,Iee=`runeya:ws-debug`;function Lee(){try{return localStorage.getItem(Iee)===`1`}catch{return!1}}function B9(...e){Lee()&&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=z(()=>e.value.length),d=z(()=>e.value.filter(e=>e.state===`running`)),f=z(()=>(t,n)=>e.value.find(e=>e.agentId===t&&e.id===n)??null),p=z(()=>t=>e.value.filter(e=>e.serviceId===t));function m(e,t){return`${e}::${t}`}function h(e,t){return`/process/${e}/${t}`}function g(e){return Jt().getById(e)?.name??e}function _(e,t){if(e.state===t.state)return;let n=Yt(),r=g(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:h(t.agentId,t.id),linkLabel:Ce.global.t(`notifications.openService`,{name:r}),serviceId:t.serviceId})}function v(e,t){if(e.healthStatus===t.healthStatus)return;let n=Yt(),r=g(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:h(t.agentId,t.id),linkLabel:Ce.global.t(`notifications.openService`,{name:r}),serviceId:t.serviceId})}function y(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,[m(t.agentId,t.id)]:Date.now()},n&&(_(n,t),v(n,t))}function b(e,t){let n=m(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&&y(e)},900);l.set(n,a)}function x(){B9(`subscribeStatus()`),a=J.process.onStatus.subscribe({},{onData(e){o=0,B9(`onStatus data`,{id:e.id,agentId:e.agentId,state:e.state}),y(e)},onError(e){a=null,console.error(`[process.store] Status subscription error:`,e.message),B9(`onStatus error`,e.message,{retryCount:o}),S()}})}function S(){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`),x()},e)}function C(e=!1){B9(`startStatusStream()`,{force:e,hasSub:!!a,hasRetryTimer:!!s}),c||=_t(()=>{B9(`onWsReopen — forcing status stream restart`),o=0,C(!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,x())}function w(){B9(`stopStatusStream()`),c&&=(c(),null),l.forEach(e=>clearTimeout(e)),l.clear(),s&&=(clearTimeout(s),null),a&&=(a.unsubscribe(),null),o=0}async function T(){t.value=!0,n.value=null;try{e.value=await J.process.list.query()}catch(e){n.value=Nt(e)??`Failed to fetch processes`}finally{t.value=!1}}async function E(e,t){n.value=null;try{let n=Date.now(),r=await J.process.start.mutate({agentId:e,processId:t});b(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 D(e,t){n.value=null;try{let n=Date.now(),r=await J.process.stop.mutate({agentId:e,processId:t});b(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 O(e,t){n.value=null;try{let n=Date.now(),r=await J.process.restart.mutate({agentId:e,processId:t});return b(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:u,runningProcesses:d,getById:f,getByService:p,fetchAll:T,start:E,stop:D,restart:O,startStatusStream:C,stopStatusStream:w}});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 Ree(){U9?.unsubscribe(),U9=null}var zee={class:`app-root`},Bee={class:`app-root__view`},Vee=[`title`],Hee={key:0,class:`disconnected-overlay`},Uee={class:`disconnected-box`},Wee={class:`disconnected-title`},Gee={class:`disconnected-subtitle`},Kee=5e3,qee=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(){lt()&&console.log(`[ai-chat][drawer]`,S(),`show`,{expanded:v.value,route:u.currentRoute.value.fullPath})}function T(){lt()&&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>=Kee&&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(),Ree(),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`,zee,[b(Vn),b(tr),N(`div`,Bee,[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,Vee),b(R9)]),_:1},8,[`visible`,`header`,`style`]),b(ge,{name:`overlay`},{default:U(()=>[r(g)!==`connected`&&!k.value?(V(),P(`div`,Hee,[N(`div`,Uee,[i[3]||=N(`i`,{class:`ti ti-cloud-off disconnected-icon`},null,-1),N(`h1`,Wee,W(r(c)(`connection.unreachable`)),1),N(`p`,Gee,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`]]),Jee=t({router:()=>G9}),G9=Oe({history:Ee(),routes:[{path:`/unlock`,name:`unlock`,component:()=>bt(()=>import(`./UnlockPage-CtvaQt45.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-DtoAlng4.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-DCrKSY8v.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-Bl1pjfYH.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-f0_BsXSc.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-CF7GLFlx.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-C7aV6M8U.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-BTc8xbjF.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-Dly6XiRC.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-Dly6XiRC.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-Bl6UnQ6P.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-Bl6UnQ6P.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-Bl6UnQ6P.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-Bl6UnQ6P.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-qQ96vm5Y.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-B-pCRqXH.js`),__vite__mapDeps([94,1,2,4,5,3,7,8,9,10,11,12,95]))},{path:`settings`,name:`settings`,component:()=>bt(()=>import(`./SettingsPage-Bjn4bKPP.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-DXw4bCxb.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-DXw4bCxb.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-0qXPeqrh.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-0qXPeqrh.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-DQvL-VOx.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`,component:()=>bt(()=>import(`./DashboardPage-CF7GLFlx.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])),beforeEnter:async e=>{let{useProjectLaunchStore:t}=await bt(async()=>{let{useProjectLaunchStore:e}=await import(`./project-launch.store-MX5LzgIm.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-BFwiDQ1X.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-C1VLgeeP.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-DfNI6meL.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-W7S7ogas.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-cuKigw_5.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-A-I7cImN.js`),__vite__mapDeps([127,1,2,7,3,4,5,8,9,10,11,12,128]))}]}]}),Yee=new Set([`launch-project`,`launch-services`]),K9=!1,q9=!1,J9=!1;async function Xee(){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 Zee(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 Qee(e){let t=mt();if(!t)return;let n=await Zee(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 Qee(e);if(t)return t;if(Yee.has(e.name))return;let n=xe();if(!n.launchCompleted&&!n.activeProjectId&&!await Xee())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 $ee={class:`trigger-blob`},ete={class:`theme-layer`},tte={class:`theme-picker`},nte={class:`theme-section theme-section--row`},rte={class:`section-label`},ite={class:`theme-section theme-section--row`},ate={class:`section-label`},ote={class:`theme-section`},ste={class:`section-label`},cte={class:`swatches`},lte=[`title`,`aria-label`,`aria-pressed`,`onClick`],ute={class:`custom-hue-header`},dte={class:`section-label`},fte={class:`custom-hue-track-wrap`},X9=`#18181b`,Z9=`#f8fafc`,pte=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`,$ee,[(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`,ete,[b(r(it),{class:`theme-popover`,side:`bottom`,align:`end`,"side-offset":6,"collision-padding":8},{default:U(()=>[N(`div`,tte,[N(`div`,nte,[N(`span`,rte,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`,ite,[N(`span`,ate,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`,ote,[N(`span`,ste,W(r(h)(`themePicker.accentColor`)),1),N(`div`,cte,[(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,lte))),128))])]),N(`div`,{class:L([`theme-section custom-hue-section`,{"custom-hue-section--active":u.value===r(an)}])},[N(`div`,ute,[N(`span`,dte,W(r(h)(`themePicker.customColor`)),1),N(`span`,{class:`custom-hue-preview`,style:re({backgroundColor:d.value})},null,4)]),N(`div`,fte,[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`]]),mte=[`width`,`height`],hte=[`rx`],gte=[`transform`],_te=[`d`,`stroke-width`],vte=[`cx`,`cy`,`r`],yte=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,hte),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,_te),(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,vte))),128))],8,gte)],8,mte))}}),[[`__scopeId`,`data-v-85f26936`]]),bte=t({announceThemeToServer:()=>Q9});async function Q9(){try{await J.desktop.setTrayAccent.mutate({color:ln()})}catch{}}globalThis.Buffer=mn.Buffer;async function xte(){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 Ste(){try{ht(await J.config.app.query())}catch(e){console.warn(`[app] Failed to fetch app mode:`,e)}finally{pt()}}var $9=he(qee);$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 Cte(){if(wt()){Tt(),yt();return}try{let e=await Ct();xt(e.ciMode===!0),e.state===`unlocked`&&e.ciMode&&yt()}catch{}}Promise.all([xte(),Ste(),Cte()]).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,Jee as i,M3 as j,c6 as k,v9 as l,J7 as m,yte as n,H9 as o,X7 as p,$n as q,pte as r,Pee as s,bte as t,p9 as u,A7 as v,D5 as w,R5 as x,k7 as y,iP as z};
|