@marimo-team/islands 0.25.3-dev209 → 0.25.3-dev210

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/dist/{ConnectedDataExplorerComponent-ApTYh0V3.js → ConnectedDataExplorerComponent-D6RHJV8D.js} +114 -112
  2. package/dist/{ErrorBoundary-B1QlXN-y.js → ErrorBoundary-VruaQLnK.js} +10 -10
  3. package/dist/{abnfDiagram-VCTEODGH-uo9xhZY0.js → abnfDiagram-VCTEODGH-0q7Lbmii.js} +2 -2
  4. package/dist/{any-language-editor-BVFHDDQ3.js → any-language-editor-jGaR0EAo.js} +5 -5
  5. package/dist/{architectureDiagram-5GKGNRK7-Hz6eyeOD.js → architectureDiagram-5GKGNRK7-1PydKPmE.js} +1 -1
  6. package/dist/{button-BQRdqQi1.js → button-B6RjDKJx.js} +54 -51
  7. package/dist/{capabilities-C2QUNRXi.js → capabilities-CkVzWJEX.js} +1 -1
  8. package/dist/{chat-ui-BTA1I5i1.js → chat-ui-B5pH_aXk.js} +414 -413
  9. package/dist/{check-C9Mp9eCK.js → check-Z_vtI3OL.js} +1 -1
  10. package/dist/{chunk-IMKFNOWR-DBM2i23k.js → chunk-IMKFNOWR-DEzZZ1Zc.js} +1 -1
  11. package/dist/{chunk-SHT3W25Y-L8KQLLBy.js → chunk-SHT3W25Y-CuHj-hnn.js} +1 -1
  12. package/dist/{chunk-SVP7TREG-BOUJKJEP.js → chunk-SVP7TREG-BPiZK2bA.js} +1 -1
  13. package/dist/{chunk-TICWLB2K-DY3CzFjX.js → chunk-TICWLB2K-DF6XcIjM.js} +1 -1
  14. package/dist/{classDiagram-ZZMXUADV-s9iwW-q4.js → classDiagram-ZZMXUADV-CMdR-cP4.js} +2 -2
  15. package/dist/{classDiagram-v2-VYDZK3BY-2GI5CjGB.js → classDiagram-v2-VYDZK3BY-DRvc3_7Y.js} +2 -2
  16. package/dist/{code-visibility-CCGlDSq4.js → code-visibility-BdFhHfIC.js} +28 -28
  17. package/dist/{common-C1PmVtVW.js → common-Ce1SgsX1.js} +8034 -8027
  18. package/dist/{toDate-BZZ64K_m.js → config-DbjzjwxX.js} +98 -164
  19. package/dist/{copy-icon-De584pZ4.js → copy-icon-CG57cxwb.js} +3 -3
  20. package/dist/createReducer-DePYJ0F3.js +63 -0
  21. package/dist/{cynefinDiagram-5FMLGOSQ-DOxnhBK2.js → cynefinDiagram-5FMLGOSQ-BkBjEY9l.js} +1 -1
  22. package/dist/{dagre-GXQ25YYZ-D1AhEfpM.js → dagre-GXQ25YYZ-D-HEaW4I.js} +1 -1
  23. package/dist/{data-grid-overlay-editor-B3KXkZvo.js → data-grid-overlay-editor-Bps1p6jQ.js} +1 -1
  24. package/dist/{diagram-S7CK7UJ4-DV_GebF_.js → diagram-S7CK7UJ4-Bn-oF-rB.js} +1 -1
  25. package/dist/{diagram-UQ7AKVKN-6dNzGFfD.js → diagram-UQ7AKVKN-BpzzXWBj.js} +1 -1
  26. package/dist/{diagram-VX7I27RA-DUh9jsfi.js → diagram-VX7I27RA-COOtvfBP.js} +1 -1
  27. package/dist/{diagram-Z3DM3KII-Cug-qcQ8.js → diagram-Z3DM3KII-K5cXvbrl.js} +1 -1
  28. package/dist/{dialog-DVRfQuhD.js → dialog-DsZ49mmU.js} +26 -26
  29. package/dist/{dist-BJtmSgcE.js → dist-11T5wq3_.js} +41 -40
  30. package/dist/{dist-B1M0bGO3.js → dist-17ugwGZc.js} +59 -58
  31. package/dist/{dist-D7mrh5sO.js → dist-7cRjf--y.js} +135 -134
  32. package/dist/{dist-Ck_C32ye.js → dist-B8pkfkzc.js} +31 -30
  33. package/dist/{dist-Ba2VIn1K.js → dist-B9UoM_wq.js} +54 -53
  34. package/dist/{dist-KN80qWCP.js → dist-BGuMTs1i.js} +118 -117
  35. package/dist/{dist-T5rh6JvL.js → dist-BHW11fni.js} +18 -17
  36. package/dist/dist-BLY4m1Wi.js +850 -0
  37. package/dist/{dist-Bj4bmwUm.js → dist-BNlcVoxs.js} +31 -30
  38. package/dist/{dist-BA13RJj5.js → dist-BQYe5Bju.js} +47 -46
  39. package/dist/{dist-OUle2RT7.js → dist-BX1mn8na.js} +297 -297
  40. package/dist/{dist-CTi5FTiV.js → dist-Bh0PTKUW.js} +108 -107
  41. package/dist/{dist-D9Q3xjiP.js → dist-CKaXK92p.js} +56 -55
  42. package/dist/{dist-DYXM73-k.js → dist-CLhwfhpJ.js} +58 -57
  43. package/dist/{dist-BmS-ZGjl.js → dist-CYeqK4Xw.js} +1854 -2702
  44. package/dist/{dist-D1fnFp1J.js → dist-Cxlp3WH6.js} +16 -15
  45. package/dist/{dist-DVVwOfrD.js → dist-DSJPGj42.js} +64 -63
  46. package/dist/{dist-Bzogh7CW.js → dist-DU9ICsWZ.js} +93 -92
  47. package/dist/{dist-DjeybPOb.js → dist-DWv0ALBi.js} +47 -46
  48. package/dist/{dist-D3x9__Fu.js → dist-DiBpWEsB.js} +39 -38
  49. package/dist/{dist-DtGn9N4h.js → dist-DiLFTlnl.js} +165 -165
  50. package/dist/{dist-DTv9KkpW.js → dist-cVDV5IuI.js} +26 -25
  51. package/dist/{dist-DP60Ubh8.js → dist-fRfaOoq8.js} +44 -43
  52. package/dist/{dist-O0qFpEJh.js → dist-gTTI-9Px.js} +66 -65
  53. package/dist/{dropdown-menu-dlEm41Bt.js → dropdown-menu-CSNdPSnS.js} +2886 -1529
  54. package/dist/{ebnfDiagram-PWID7BFC-d5LKx7Vb.js → ebnfDiagram-PWID7BFC-BI1ZmjVm.js} +2 -2
  55. package/dist/{erDiagram-RLTQ6QDP-BwvlkcID.js → erDiagram-RLTQ6QDP-BtWjj9xy.js} +1 -1
  56. package/dist/{error-banner-DxJ3s8YO.js → error-banner-IsonnvA0.js} +47 -46
  57. package/dist/error-entries-CRPfxMqm.js +2505 -0
  58. package/dist/{esm-Bbw_Njjx.js → esm-BgKjMvWw.js} +389 -388
  59. package/dist/{esm-mDQNEFe_.js → esm-CHjVSexr.js} +305 -306
  60. package/dist/{feedback-button-UsovT9sL.js → feedback-button-2ycmR9GG.js} +112 -112
  61. package/dist/{flowDiagram-HODETNUW-CJcSoFer.js → flowDiagram-HODETNUW-DQvZh96A.js} +2 -2
  62. package/dist/{formats-Ry7c-aIV.js → formats-BK4VefeF.js} +6 -6
  63. package/dist/{glide-data-editor-CRd8kBSp.js → glide-data-editor-Buj2OZjL.js} +99 -99
  64. package/dist/{glide-utils-D98laidb.js → glide-utils-CQddGpa-.js} +3 -3
  65. package/dist/{globals-BDWrOstF.js → globals-B-14fUeb.js} +3 -3
  66. package/dist/{error-entries-CVUHA5r_.js → html-to-image-CgAnxFi8.js} +26314 -25474
  67. package/dist/{infoDiagram-27XIBGKW-Cezgppw3.js → infoDiagram-27XIBGKW-BdAObnc_.js} +1 -1
  68. package/dist/{ishikawaDiagram-5VMMS53U-BahZQwJz.js → ishikawaDiagram-5VMMS53U-DP-jE8dw.js} +1 -1
  69. package/dist/{kanban-definition-UXKFOSKX-Cvfn_Obm.js → kanban-definition-UXKFOSKX-BkMgPjfm.js} +1 -1
  70. package/dist/{loader-DOVB0Syl.js → loader-BisjOLiW.js} +1 -1
  71. package/dist/main.js +2996 -2992
  72. package/dist/{mermaid-BrdwbArF.js → mermaid-B-OFqheA.js} +36 -36
  73. package/dist/{mindmap-definition-YA3MSWOX-uB4B2d-J.js → mindmap-definition-YA3MSWOX-Du7toAZX.js} +1 -1
  74. package/dist/{number-overlay-editor-Bp9a4z5Q.js → number-overlay-editor-ZVFcJ7_u.js} +1 -1
  75. package/dist/{dist-CThPVKaP.js → objectWithoutPropertiesLoose-ai5NUqGa.js} +1139 -1120
  76. package/dist/{pegDiagram-XKGWAZYB-CYaIwAmH.js → pegDiagram-XKGWAZYB-CX_729j0.js} +2 -2
  77. package/dist/{pieDiagram-E7YTZNPT-BJ1oUxVv.js → pieDiagram-E7YTZNPT-dtTFJcVI.js} +1 -1
  78. package/dist/{process-output-SjJxB1wh.js → process-output-Bmev5azU.js} +5 -5
  79. package/dist/{railroadDiagram-O6MQD6OU-BqKSaBux.js → railroadDiagram-O6MQD6OU-Dsc2Cf4c.js} +2 -2
  80. package/dist/{requirementDiagram-BXWQKSXE-DwFhgDhH.js → requirementDiagram-BXWQKSXE-D3g0c60I.js} +1 -1
  81. package/dist/{reveal-component-ov3pS-oO.js → reveal-component-BWz1KjWe.js} +725 -725
  82. package/dist/schemas-CdscWNy_.js +4747 -0
  83. package/dist/select-BSxlITBo.js +1200 -0
  84. package/dist/{sequenceDiagram-WJ2MYXX4-L7ENjfKF.js → sequenceDiagram-WJ2MYXX4-w1pWbIpk.js} +1 -1
  85. package/dist/{spec-BcJ9ncAY.js → spec-Dq8RNplp.js} +4 -4
  86. package/dist/{stateDiagram-D77RDMKH-CVf88u-p.js → stateDiagram-D77RDMKH-BCv7kP4H.js} +2 -2
  87. package/dist/{stateDiagram-v2-MP3YSRHH-DvpkQ1V6.js → stateDiagram-v2-MP3YSRHH-D1cTOt0x.js} +2 -2
  88. package/dist/static-state-BldGd99T.js +72 -0
  89. package/dist/strings-BGW-fXVJ.js +507 -0
  90. package/dist/{swimlanes-42K2YHIH-DIuFHbVE.js → swimlanes-42K2YHIH-DNO6jDnd.js} +1 -1
  91. package/dist/{swimlanesDiagram-VR7AAH4N-CAqHAziW.js → swimlanesDiagram-VR7AAH4N-CkSWsxYJ.js} +2 -2
  92. package/dist/{swiper-component-BVfnhbnt.js → swiper-component-Dir1o8ml.js} +2 -2
  93. package/dist/{timeline-definition-24CTP7MA-xO4EQqBm.js → timeline-definition-24CTP7MA-DQvqGFM9.js} +1 -1
  94. package/dist/toast-BWIPi3aF.js +491 -0
  95. package/dist/{tooltip-s4zZxwKe.js → tooltip-C3UnvsRe.js} +58 -58
  96. package/dist/use-restore-focus-BWO0z1lo.js +1672 -0
  97. package/dist/{useAsyncData-Dqw22wZQ.js → useAsyncData-DsZMvNXn.js} +1 -1
  98. package/dist/{useDateFormatter-D3Tkfzej.js → useDateFormatter-ChB4eyim.js} +2 -2
  99. package/dist/{useDeepCompareMemoize-D3gozcjJ.js → useDeepCompareMemoize-KMBBux8C.js} +1 -1
  100. package/dist/{useIframeCapabilities-6a_yDNXp.js → useIframeCapabilities-cMNQ80CK.js} +1 -1
  101. package/dist/useLifecycle-BquH9ET-.js +112 -0
  102. package/dist/useTheme-B9C1JIy9.js +307 -0
  103. package/dist/utils-DXkj82sK.js +813 -0
  104. package/dist/{vega-component-Blvspl7v.js → vega-component-9NOEITbg.js} +55 -54
  105. package/dist/{vennDiagram-4TSXK5OY-DzCi-lRh.js → vennDiagram-4TSXK5OY-BfzXp4SH.js} +1 -1
  106. package/dist/{wardleyDiagram-VM6X3IG4-CW48xa0n.js → wardleyDiagram-VM6X3IG4-CiqEE8eq.js} +1 -1
  107. package/dist/{xychartDiagram-S5SC5T6Z-UPxGGI2B.js → xychartDiagram-S5SC5T6Z-BTIHCVOI.js} +1 -1
  108. package/package.json +1 -1
  109. package/src/components/editor/cell/__tests__/StagedAICell.test.tsx +1 -1
  110. package/src/components/editor/cell/code/cell-editor.tsx +13 -36
  111. package/src/components/editor/chrome/wrapper/__tests__/pending-ai-cells.test.tsx +1 -1
  112. package/src/components/editor/errors/__tests__/send-error-report-button.test.tsx +11 -5
  113. package/src/components/editor/notebook-cell.tsx +0 -1
  114. package/src/components/scratchpad/scratchpad.test.tsx +3 -11
  115. package/src/components/scratchpad/scratchpad.tsx +24 -22
  116. package/src/components/scratchpad/state.ts +7 -0
  117. package/src/core/ai/__tests__/staged-cells.test.ts +6 -8
  118. package/src/core/ai/staged-cells.ts +4 -2
  119. package/src/core/cells/__tests__/cells.test.ts +44 -60
  120. package/src/core/cells/__tests__/document.test.ts +1 -139
  121. package/src/core/cells/__tests__/notebook-outline.test.ts +8 -6
  122. package/src/core/cells/actions.ts +39 -0
  123. package/src/core/cells/cells.ts +15 -35
  124. package/src/core/cells/document.ts +9 -84
  125. package/src/core/codemirror/__tests__/format.test.ts +0 -34
  126. package/src/core/codemirror/cells/extensions.ts +20 -18
  127. package/src/core/codemirror/cells/state.ts +0 -5
  128. package/src/core/codemirror/format.ts +1 -19
  129. package/src/core/codemirror/misc/__tests__/paste.test.ts +3 -1
  130. package/src/core/codemirror/misc/paste.ts +1 -1
  131. package/src/core/notebook/document/__tests__/codemirror.test.ts +172 -0
  132. package/src/stories/layout/vertical/one-column.stories.tsx +26 -18
  133. package/dist/html-to-image--E3uFbJ9.js +0 -3348
  134. package/dist/label-Qvw1E97W.js +0 -281
  135. package/dist/objectWithoutPropertiesLoose-BRDcTsfB.js +0 -23
  136. package/dist/select-2KOiReNY.js +0 -1423
  137. package/dist/toast-B5t9o6s_.js +0 -1848
  138. package/dist/use-restore-focus-BgDTd2tc.js +0 -6418
  139. package/dist/useLifecycle-CaZi4wTw.js +0 -172
  140. package/dist/useTheme-TzPgWXwB.js +0 -1114
@@ -1,1025 +1,525 @@
1
- import { A as e, At as t, D as n, Dt as r, E as i, G as a, I as o, It as s, J as c, Lt as l, Mt as u, N as d, Nt as f, Ot as p, Rt as m, St as h, U as g, Vt as _, W as ee, Y as te, _t as ne, et as re, gt as v, j as ie, jt as ae, lt as oe, mt as se, o as ce, ot as le, q as ue, vt as de, wt as y, yt as fe } from "./dist-BmS-ZGjl.js";
2
- //#region ../node_modules/.pnpm/@codemirror+lint@6.9.7/node_modules/@codemirror/lint/dist/index.js
3
- var pe = class {
4
- constructor(e, t, n) {
5
- this.from = e, this.to = t, this.diagnostic = n;
1
+ import { B as e, C as t, Ct as n, D as r, Dt as i, E as a, Et as o, G as s, M as c, Mt as l, Nt as u, Ot as d, Pt as f, Rt as p, S as m, U as ee, V as h, W as te, X as ne, at as re, bt as g, ft as _, ht as ie, k as v, kt as ae, mt as oe, n as se, nt as ce, pt as le, ut as ue, vt as y, wt as de, z as b } from "./dist-CYeqK4Xw.js";
2
+ //#region ../node_modules/.pnpm/@codemirror+commands@6.11.1/node_modules/@codemirror/commands/dist/index.js
3
+ var fe = (e) => {
4
+ let { state: t } = e, n = t.doc.lineAt(t.selection.main.from), r = ge(e.state, n.from);
5
+ return r.line ? pe(e) : r.block ? he(e) : !1;
6
+ };
7
+ function x(e, t) {
8
+ return ({ state: n, dispatch: r }) => {
9
+ if (n.readOnly) return !1;
10
+ let i = e(t, n);
11
+ return i ? (r(n.update(i)), !0) : !1;
12
+ };
13
+ }
14
+ var pe = /*@__PURE__*/ x(be, 0), me = /*@__PURE__*/ x(ye, 0), he = /*@__PURE__*/ x((e, t) => ye(e, t, ve(t)), 0);
15
+ function ge(e, t) {
16
+ let n = e.languageDataAt("commentTokens", t, 1);
17
+ return n.length ? n[0] : {};
18
+ }
19
+ var S = 50;
20
+ function _e(e, { open: t, close: n }, r, i) {
21
+ let a = e.sliceDoc(r - S, r), o = e.sliceDoc(i, i + S), s = /\s*$/.exec(a)[0].length, c = /^\s*/.exec(o)[0].length, l = a.length - s;
22
+ if (a.slice(l - t.length, l) == t && o.slice(c, c + n.length) == n) return {
23
+ open: {
24
+ pos: r - s,
25
+ margin: s && 1
26
+ },
27
+ close: {
28
+ pos: i + c,
29
+ margin: c && 1
30
+ }
31
+ };
32
+ let u, d;
33
+ i - r <= 100 ? u = d = e.sliceDoc(r, i) : (u = e.sliceDoc(r, r + S), d = e.sliceDoc(i - S, i));
34
+ let f = /^\s*/.exec(u)[0].length, p = /\s*$/.exec(d)[0].length, m = d.length - p - n.length;
35
+ return u.slice(f, f + t.length) == t && d.slice(m, m + n.length) == n ? {
36
+ open: {
37
+ pos: r + f + t.length,
38
+ margin: +!!/\s/.test(u.charAt(f + t.length))
39
+ },
40
+ close: {
41
+ pos: i - p - n.length,
42
+ margin: +!!/\s/.test(d.charAt(m - 1))
43
+ }
44
+ } : null;
45
+ }
46
+ function ve(e) {
47
+ let t = [];
48
+ for (let n of e.selection.ranges) {
49
+ let r = e.doc.lineAt(n.from), i = n.to <= r.to ? r : e.doc.lineAt(n.to);
50
+ i.from > r.from && i.from == n.to && (i = n.to == r.to + 1 ? r : e.doc.lineAt(n.to - 1));
51
+ let a = t.length - 1;
52
+ a >= 0 && t[a].to > r.from ? t[a].to = i.to : t.push({
53
+ from: r.from + /^\s*/.exec(r.text)[0].length,
54
+ to: i.to
55
+ });
6
56
  }
7
- }, b = class e {
8
- constructor(e, t, n) {
9
- this.diagnostics = e, this.panel = t, this.selected = n;
57
+ return t;
58
+ }
59
+ function ye(e, t, n = t.selection.ranges) {
60
+ let r = n.map((e) => ge(t, e.from).block);
61
+ if (!r.every((e) => e)) return null;
62
+ let i = n.map((e, n) => _e(t, r[n], e.from, e.to));
63
+ if (e != 2 && !i.every((e) => e)) return { changes: t.changes(n.map((e, t) => i[t] ? [] : [{
64
+ from: e.from,
65
+ insert: r[t].open + " "
66
+ }, {
67
+ from: e.to,
68
+ insert: " " + r[t].close
69
+ }])) };
70
+ if (e != 1 && i.some((e) => e)) {
71
+ let e = [];
72
+ for (let t = 0, n; t < i.length; t++) if (n = i[t]) {
73
+ let i = r[t], { open: a, close: o } = n;
74
+ e.push({
75
+ from: a.pos - i.open.length,
76
+ to: a.pos + a.margin
77
+ }, {
78
+ from: o.pos - o.margin,
79
+ to: o.pos + i.close.length
80
+ });
81
+ }
82
+ return { changes: e };
10
83
  }
11
- static init(t, n, r) {
12
- let i = r.facet(T).markerFilter;
13
- i && (t = i(t, r));
14
- let a = t.slice().sort((e, t) => e.from - t.from || e.to - t.to), o = new p(), s = [], c = 0, l = r.doc.iter(), u = 0, d = r.doc.length;
15
- for (let e = 0;;) {
16
- let t = e == a.length ? null : a[e];
17
- if (!t && !s.length) break;
18
- let n, r;
19
- if (s.length) n = c, r = s.reduce((e, t) => Math.min(e, t.to), t && t.from > n ? t.from : 1e8);
20
- else {
21
- if (n = t.from, n > d) break;
22
- r = t.to, s.push(t), e++;
23
- }
24
- for (; e < a.length;) {
25
- let t = a[e];
26
- if (t.from == n && (t.to > t.from || t.to == n)) s.push(t), e++, r = Math.min(t.to, r);
27
- else {
28
- r = Math.min(t.from, r);
29
- break;
30
- }
31
- }
32
- r = Math.min(r, d);
33
- let i = !1;
34
- if (s.some((e) => e.from == n && (e.to == r || r == d)) && (i = n == r, !i && r - n < 10)) {
35
- let e = n - (u + l.value.length);
36
- e > 0 && (l.next(e), u = n);
37
- for (let e = n;;) {
38
- if (e >= r) {
39
- i = !0;
40
- break;
41
- }
42
- if (!l.lineBreak && u + l.value.length > e) break;
43
- e = u + l.value.length, u += l.value.length, l.next();
44
- }
45
- }
46
- let f = Fe(s);
47
- if (i) o.add(n, n, g.widget({
48
- widget: new Ae(f),
49
- diagnostics: s.slice()
50
- }));
51
- else {
52
- let e = s.reduce((e, t) => t.markClass ? e + " " + t.markClass : e, "");
53
- o.add(n, r, g.mark({
54
- class: "cm-lintRange cm-lintRange-" + f + e,
55
- diagnostics: s.slice(),
56
- inclusiveEnd: s.some((e) => e.to > r)
57
- }));
84
+ return null;
85
+ }
86
+ function be(e, t, n = t.selection.ranges) {
87
+ let r = [], i = -1;
88
+ ranges: for (let { from: e, to: a } of n) {
89
+ let n = r.length, o = 1e9, s;
90
+ for (let n = e; n <= a;) {
91
+ let c = t.doc.lineAt(n);
92
+ if (s == null && (s = ge(t, c.from).line, !s)) continue ranges;
93
+ if (c.from > i && (e == a || a > c.from)) {
94
+ i = c.from;
95
+ let e = /^\s*/.exec(c.text)[0].length, t = e == c.length, n = c.text.slice(e, e + s.length) == s ? e : -1;
96
+ e < c.text.length && e < o && (o = e), r.push({
97
+ line: c,
98
+ comment: n,
99
+ token: s,
100
+ indent: e,
101
+ empty: t,
102
+ single: !1
103
+ });
58
104
  }
59
- if (c = r, c == d) break;
60
- for (let e = 0; e < s.length; e++) s[e].to <= c && s.splice(e--, 1);
105
+ n = c.to + 1;
61
106
  }
62
- let f = o.finish();
63
- return new e(f, n, x(f));
107
+ if (o < 1e9) for (let e = n; e < r.length; e++) r[e].indent < r[e].line.text.length && (r[e].indent = o);
108
+ r.length == n + 1 && (r[n].single = !0);
64
109
  }
65
- };
66
- function x(e, t = null, n = 0) {
67
- let r = null;
68
- return e.between(n, 1e9, (e, n, { spec: i }) => {
69
- if (!(t && i.diagnostics.indexOf(t) < 0)) {
70
- if (!r) r = new pe(e, n, t || i.diagnostics[0]);
71
- else if (i.diagnostics.indexOf(r.diagnostic) < 0) return !1;
72
- else r = new pe(r.from, n, r.diagnostic);
110
+ if (e != 2 && r.some((e) => e.comment < 0 && (!e.empty || e.single))) {
111
+ let e = [];
112
+ for (let { line: t, token: n, indent: i, empty: a, single: o } of r) (o || !a) && e.push({
113
+ from: t.from + i,
114
+ insert: n + " "
115
+ });
116
+ let n = t.changes(e);
117
+ return {
118
+ changes: n,
119
+ selection: t.selection.map(n, 1)
120
+ };
121
+ }
122
+ if (e != 1 && r.some((e) => e.comment >= 0)) {
123
+ let e = [];
124
+ for (let { line: t, comment: n, token: i } of r) if (n >= 0) {
125
+ let r = t.from + n, a = r + i.length;
126
+ t.text[a - t.from] == " " && a++, e.push({
127
+ from: r,
128
+ to: a
129
+ });
73
130
  }
74
- }), r;
75
- }
76
- function me(e, t) {
77
- let n = t.pos, r = t.end || n, i = e.state.facet(T).hideOn(e, n, r);
78
- if (i != null) return i;
79
- let a = e.startState.doc.lineAt(t.pos);
80
- return !!(e.effects.some((e) => e.is(S)) || e.changes.touchesRange(a.from, Math.max(a.to, r)));
81
- }
82
- function he(e, n) {
83
- return e.field(w, !1) ? n : n.concat(t.appendConfig.of(Le));
84
- }
85
- function ge(e, t) {
86
- return { effects: he(e, [S.of(t)]) };
131
+ return { changes: e };
132
+ }
133
+ return null;
87
134
  }
88
- var S = /*@__PURE__*/ t.define(), C = /*@__PURE__*/ t.define(), _e = /*@__PURE__*/ t.define(), w = /*@__PURE__*/ ae.define({
135
+ var C = /*@__PURE__*/ le.define(), xe = /*@__PURE__*/ le.define(), Se = /*@__PURE__*/ g.define(), Ce = /*@__PURE__*/ g.define({ combine(e) {
136
+ return l(e, {
137
+ minDepth: 100,
138
+ newGroupDelay: 500,
139
+ joinToEvent: (e, t) => t
140
+ }, {
141
+ minDepth: Math.max,
142
+ newGroupDelay: Math.min,
143
+ joinToEvent: (e, t) => (n, r) => e(n, r) || t(n, r)
144
+ });
145
+ } }), w = /*@__PURE__*/ i.define({
89
146
  create() {
90
- return new b(g.none, null, null);
147
+ return j.empty;
91
148
  },
92
149
  update(e, t) {
93
- if (t.docChanged && e.diagnostics.size) {
94
- let n = e.diagnostics.map(t.changes), r = null, i = e.panel;
95
- if (e.selected) {
96
- let i = t.changes.mapPos(e.selected.from, 1);
97
- r = x(n, e.selected.diagnostic, i) || x(n, null, i);
98
- }
99
- !n.size && i && t.state.facet(T).autoPanel && (i = null), e = new b(n, i, r);
150
+ let n = t.state.facet(Ce), r = t.annotation(C);
151
+ if (r) {
152
+ let i = D.fromTransaction(t, r.selection), a = r.side, o = a == 0 ? e.undone : e.done;
153
+ return o = i ? O(o, o.length, n.minDepth, i) : Ne(o, t.startState.selection), new j(a == 0 ? r.rest : o, a == 0 ? o : r.rest);
100
154
  }
101
- for (let n of t.effects) if (n.is(S)) {
102
- let r = t.state.facet(T).autoPanel ? n.value.length ? E.open : null : e.panel;
103
- e = b.init(n.value, r, t.state);
104
- } else n.is(C) ? e = new b(e.diagnostics, n.value ? E.open : null, e.selected) : n.is(_e) && (e = new b(e.diagnostics, e.panel, n.value));
105
- return e;
155
+ let i = t.annotation(xe);
156
+ if ((i == "full" || i == "before") && (e = e.isolate()), t.annotation(ae.addToHistory) === !1) return t.changes.empty ? e : e.addMapping(t.changes.desc);
157
+ let a = D.fromTransaction(t), o = t.annotation(ae.time), s = t.annotation(ae.userEvent);
158
+ return a ? e = e.addChanges(a, o, s, n, t) : t.selection && (e = e.addSelection(t.startState.selection, o, s, n.newGroupDelay)), (i == "full" || i == "after") && (e = e.isolate()), e;
106
159
  },
107
- provide: (e) => [se.from(e, (e) => e.panel), a.decorations.from(e, (e) => e.diagnostics)]
108
- }), ve = /*@__PURE__*/ g.mark({ class: "cm-lintRange cm-lintRange-active" });
109
- function ye(e, t, n) {
110
- let { diagnostics: r } = e.state.field(w), i, a = -1, o = -1;
111
- r.between(t - +(n < 0), t + +(n > 0), (e, r, { spec: s }) => {
112
- if (t >= e && t <= r && (e == r || (t > e || n > 0) && (t < r || n < 0))) return i = s.diagnostics, a = e, o = r, !1;
113
- });
114
- let s = e.state.facet(T).tooltipFilter;
115
- return i && s && (i = s(i, e.state)), i ? {
116
- pos: a,
117
- end: o,
118
- above: !0,
119
- create() {
120
- return { dom: be(e, i) };
121
- }
122
- } : null;
160
+ toJSON(e) {
161
+ return {
162
+ done: e.done.map((e) => e.toJSON()),
163
+ undone: e.undone.map((e) => e.toJSON())
164
+ };
165
+ },
166
+ fromJSON(e) {
167
+ return new j(e.done.map(D.fromJSON), e.undone.map(D.fromJSON));
168
+ }
169
+ });
170
+ function we(e = {}) {
171
+ return [
172
+ w,
173
+ Ce.of(e),
174
+ h.domEventHandlers({ beforeinput(e, t) {
175
+ let n = e.inputType == "historyUndo" ? Ee : e.inputType == "historyRedo" ? E : null;
176
+ return n ? (e.preventDefault(), n(t)) : !1;
177
+ } })
178
+ ];
123
179
  }
124
- function be(e, t) {
125
- return v("ul", { class: "cm-tooltip-lint" }, t.map((t) => ke(e, t, !1)));
180
+ var Te = w;
181
+ function T(e, t) {
182
+ return function({ state: n, dispatch: r }) {
183
+ if (!t && n.readOnly) return !1;
184
+ let i = n.field(w, !1);
185
+ if (!i) return !1;
186
+ let a = i.pop(e, n, t);
187
+ return a ? (r(a), !0) : !1;
188
+ };
126
189
  }
127
- var xe = (e) => {
128
- let t = e.state.field(w, !1);
129
- (!t || !t.panel) && e.dispatch({ effects: he(e.state, [C.of(!0)]) });
130
- let n = re(e, E.open);
131
- return n && n.dom.querySelector(".cm-panel-lint ul").focus(), !0;
132
- }, Se = (e) => {
133
- let t = e.state.field(w, !1);
134
- return !t || !t.panel ? !1 : (e.dispatch({ effects: C.of(!1) }), !0);
135
- }, Ce = [{
136
- key: "Mod-Shift-m",
137
- run: xe,
138
- preventDefault: !0
139
- }, {
140
- key: "F8",
141
- run: (e) => {
142
- let t = e.state.field(w, !1);
143
- if (!t) return !1;
144
- let n = e.state.selection.main, r = x(t.diagnostics, null, n.to + 1);
145
- return !r && (r = x(t.diagnostics, null, 0), !r || r.from == n.from && r.to == n.to) ? !1 : (e.dispatch({
146
- selection: {
147
- anchor: r.from,
148
- head: r.to
149
- },
150
- scrollIntoView: !0
151
- }), te(e, r.from, 1, {
152
- tooltip: Ie,
153
- until: (e) => e.docChanged || e.newSelection.main.head < r.from || e.newSelection.main.head > r.to
154
- }), !0);
190
+ var Ee = /*@__PURE__*/ T(0, !1), E = /*@__PURE__*/ T(1, !1), De = /*@__PURE__*/ T(0, !0), Oe = /*@__PURE__*/ T(1, !0), D = class e {
191
+ constructor(e, t, n, r, i) {
192
+ this.changes = e, this.effects = t, this.mapped = n, this.startSelection = r, this.selectionsAfter = i;
155
193
  }
156
- }], we = /*@__PURE__*/ ue.fromClass(class {
157
- constructor(e) {
158
- this.view = e, this.timeout = -1, this.set = !0;
159
- let { delay: t } = e.state.facet(T);
160
- this.lintTime = Date.now() + t, this.run = this.run.bind(this), this.timeout = setTimeout(this.run, t);
194
+ setSelAfter(t) {
195
+ return new e(this.changes, this.effects, this.mapped, this.startSelection, t);
161
196
  }
162
- run() {
163
- clearTimeout(this.timeout);
164
- let e = Date.now();
165
- if (e < this.lintTime - 10) this.timeout = setTimeout(this.run, this.lintTime - e);
166
- else {
167
- this.set = !1;
168
- let { state: e } = this.view, { sources: t } = e.facet(T);
169
- t.length && Te(t.map((e) => Promise.resolve(e(this.view))), (t) => {
170
- this.view.state.doc == e.doc && this.view.dispatch(ge(this.view.state, t.reduce((e, t) => e.concat(t))));
171
- }, (e) => {
172
- oe(this.view.state, e);
173
- });
174
- }
197
+ toJSON() {
198
+ return {
199
+ changes: this.changes?.toJSON(),
200
+ mapped: this.mapped?.toJSON(),
201
+ startSelection: this.startSelection?.toJSON(),
202
+ selectionsAfter: this.selectionsAfter.map((e) => e.toJSON())
203
+ };
175
204
  }
176
- update(e) {
177
- let t = e.state.facet(T);
178
- (e.docChanged || t != e.startState.facet(T) || t.needsRefresh && t.needsRefresh(e)) && (this.lintTime = Date.now() + t.delay, this.set || (this.set = !0, this.timeout = setTimeout(this.run, t.delay)));
205
+ static fromJSON(t) {
206
+ return new e(t.changes && ie.fromJSON(t.changes), [], t.mapped && oe.fromJSON(t.mapped), t.startSelection && y.fromJSON(t.startSelection), t.selectionsAfter.map(y.fromJSON));
179
207
  }
180
- force() {
181
- this.set && (this.lintTime = Date.now(), this.run());
208
+ static fromTransaction(t, n) {
209
+ let r = k;
210
+ for (let e of t.startState.facet(Se)) {
211
+ let n = e(t);
212
+ n.length && (r = r.concat(n));
213
+ }
214
+ return !r.length && t.changes.empty ? null : new e(t.changes.invert(t.startState.doc), r, void 0, n || t.startState.selection, k);
182
215
  }
183
- destroy() {
184
- clearTimeout(this.timeout);
216
+ static selection(t) {
217
+ return new e(void 0, k, void 0, void 0, t);
185
218
  }
186
- });
187
- function Te(e, t, n) {
188
- let r = [], i = -1;
189
- for (let a of e) a.then((n) => {
190
- r.push(n), clearTimeout(i), r.length == e.length ? t(r) : i = setTimeout(() => t(r), 200);
191
- }, n);
219
+ };
220
+ function O(e, t, n, r) {
221
+ let i = t + 1 > n + 20 ? t - n - 1 : 0, a = e.slice(i, t);
222
+ return a.push(r), a;
192
223
  }
193
- var T = /*@__PURE__*/ y.define({ combine(e) {
194
- return {
195
- sources: e.map((e) => e.source).filter((e) => e != null),
196
- ...s(e.map((e) => e.config), {
197
- delay: 750,
198
- markerFilter: null,
199
- tooltipFilter: null,
200
- needsRefresh: null,
201
- hideOn: () => null
202
- }, {
203
- delay: Math.max,
204
- markerFilter: Ee,
205
- tooltipFilter: Ee,
206
- needsRefresh: (e, t) => e ? t ? (n) => e(n) || t(n) : e : t,
207
- hideOn: (e, t) => e ? t ? (n, r, i) => e(n, r, i) || t(n, r, i) : e : t,
208
- autoPanel: (e, t) => e || t
209
- })
210
- };
211
- } });
212
- function Ee(e, t) {
213
- return e ? t ? (n, r) => t(e(n, r), r) : e : t;
224
+ function ke(e, t) {
225
+ let n = [], r = !1;
226
+ return e.iterChangedRanges((e, t) => n.push(e, t)), t.iterChangedRanges((e, t, i, a) => {
227
+ for (let e = 0; e < n.length;) {
228
+ let t = n[e++], o = n[e++];
229
+ a >= t && i <= o && (r = !0);
230
+ }
231
+ }), r;
214
232
  }
215
- function De(e, t = {}) {
216
- return [
217
- T.of({
218
- source: e,
219
- config: t
220
- }),
221
- we,
222
- Le
223
- ];
233
+ function Ae(e, t) {
234
+ return e.ranges.length == t.ranges.length && e.ranges.filter((e, n) => e.empty != t.ranges[n].empty).length === 0;
224
235
  }
225
- function Oe(e) {
226
- let t = [];
227
- if (e) actions: for (let { name: n } of e) {
228
- for (let e = 0; e < n.length; e++) {
229
- let r = n[e];
230
- if (/[a-zA-Z]/.test(r) && !t.some((e) => e.toLowerCase() == r.toLowerCase())) {
231
- t.push(r);
232
- continue actions;
233
- }
234
- }
235
- t.push("");
236
+ function je(e, t) {
237
+ return e.length ? t.length ? e.concat(t) : e : t;
238
+ }
239
+ var k = [], Me = 200;
240
+ function Ne(e, t) {
241
+ if (e.length) {
242
+ let n = e[e.length - 1], r = n.selectionsAfter.slice(Math.max(0, n.selectionsAfter.length - Me));
243
+ return r.length && r[r.length - 1].eq(t) ? e : (r.push(t), O(e, e.length - 1, 1e9, n.setSelAfter(r)));
236
244
  }
237
- return t;
245
+ return [D.selection([t])];
238
246
  }
239
- function ke(e, t, n) {
240
- let r = n ? Oe(t.actions) : [];
241
- return v("li", { class: "cm-diagnostic cm-diagnostic-" + t.severity }, v("span", { class: "cm-diagnosticText" }, t.renderMessage ? t.renderMessage(e) : t.message), t.actions?.map((n, i) => {
242
- let a = !1, o = (r) => {
243
- if (r.preventDefault(), a) return;
244
- a = !0;
245
- let i = x(e.state.field(w).diagnostics, t);
246
- i && n.apply(e, i.from, i.to);
247
- }, { name: s } = n, c = r[i] ? s.indexOf(r[i]) : -1, l = c < 0 ? s : [
248
- s.slice(0, c),
249
- v("u", s.slice(c, c + 1)),
250
- s.slice(c + 1)
251
- ], u = n.markClass ? " " + n.markClass : "";
252
- return v("button", {
253
- type: "button",
254
- class: "cm-diagnosticAction" + u,
255
- onclick: o,
256
- onmousedown: o,
257
- "aria-label": ` Action: ${s}${c < 0 ? "" : ` (access key "${r[i]})"`}.`
258
- }, l);
259
- }), t.source && v("div", { class: "cm-diagnosticSource" }, t.source));
247
+ function Pe(e) {
248
+ let t = e[e.length - 1], n = e.slice();
249
+ return n[e.length - 1] = t.setSelAfter(t.selectionsAfter.slice(0, t.selectionsAfter.length - 1)), n;
260
250
  }
261
- var Ae = class extends c {
262
- constructor(e) {
263
- super(), this.sev = e;
251
+ function A(e, t) {
252
+ if (!e.length) return e;
253
+ let n = e.length, r = k;
254
+ for (; n;) {
255
+ let i = Fe(e[n - 1], t, r);
256
+ if (i.changes && !i.changes.empty || i.effects.length) {
257
+ let t = e.slice(0, n);
258
+ return t[n - 1] = i, t;
259
+ }
260
+ t = i.mapped, n--, r = i.selectionsAfter;
264
261
  }
265
- eq(e) {
266
- return e.sev == this.sev;
262
+ return r.length ? [D.selection(r)] : k;
263
+ }
264
+ function Fe(e, t, n) {
265
+ let r = je(e.selectionsAfter.length ? e.selectionsAfter.map((e) => e.map(t)) : k, n);
266
+ if (!e.changes) return D.selection(r);
267
+ let i = e.changes.map(t), a = t.mapDesc(e.changes, !0), s = e.mapped ? e.mapped.composeDesc(a) : a;
268
+ return new D(i, o.mapEffects(e.effects, t), s, e.startSelection.map(a), r);
269
+ }
270
+ var Ie = /^(input\.type|delete)($|\.)/, j = class e {
271
+ constructor(e, t, n = 0, r = void 0) {
272
+ this.done = e, this.undone = t, this.prevTime = n, this.prevUserEvent = r;
267
273
  }
268
- toDOM() {
269
- return v("span", { class: "cm-lintPoint cm-lintPoint-" + this.sev });
274
+ isolate() {
275
+ return this.prevTime ? new e(this.done, this.undone) : this;
270
276
  }
271
- }, je = class {
272
- constructor(e, t) {
273
- this.diagnostic = t, this.id = "item_" + Math.floor(Math.random() * 4294967295).toString(16), this.dom = ke(e, t, !0), this.dom.id = this.id, this.dom.setAttribute("role", "option");
277
+ addChanges(t, n, r, i, a) {
278
+ let s = this.done, c = s[s.length - 1];
279
+ return s = c && c.changes && !c.changes.empty && t.changes && (!r || Ie.test(r)) && (!c.selectionsAfter.length && n - this.prevTime < i.newGroupDelay && i.joinToEvent(a, ke(c.changes, t.changes)) || r == "input.type.compose") ? O(s, s.length - 1, i.minDepth, new D(t.changes.compose(c.changes), je(o.mapEffects(t.effects, c.changes), c.effects), c.mapped, c.startSelection, k)) : O(s, s.length, i.minDepth, t), new e(s, k, n, r);
274
280
  }
275
- }, E = class e {
276
- constructor(e) {
277
- this.view = e, this.items = [];
278
- let t = (t) => {
279
- if (!(t.ctrlKey || t.altKey || t.metaKey)) {
280
- if (t.keyCode == 27) Se(this.view), this.view.focus();
281
- else if (t.keyCode == 38 || t.keyCode == 33) this.moveSelection((this.selectedIndex - 1 + this.items.length) % this.items.length);
282
- else if (t.keyCode == 40 || t.keyCode == 34) this.moveSelection((this.selectedIndex + 1) % this.items.length);
283
- else if (t.keyCode == 36) this.moveSelection(0);
284
- else if (t.keyCode == 35) this.moveSelection(this.items.length - 1);
285
- else if (t.keyCode == 13) this.view.focus();
286
- else if (t.keyCode >= 65 && t.keyCode <= 90 && this.selectedIndex >= 0) {
287
- let { diagnostic: n } = this.items[this.selectedIndex], r = Oe(n.actions);
288
- for (let i = 0; i < r.length; i++) if (r[i].toUpperCase().charCodeAt(0) == t.keyCode) {
289
- let t = x(this.view.state.field(w).diagnostics, n);
290
- t && n.actions[i].apply(e, t.from, t.to);
291
- }
292
- } else return;
293
- t.preventDefault();
294
- }
295
- }, n = (e) => {
296
- for (let t = 0; t < this.items.length; t++) this.items[t].dom.contains(e.target) && this.moveSelection(t);
297
- };
298
- this.list = v("ul", {
299
- tabIndex: 0,
300
- role: "listbox",
301
- "aria-label": this.view.state.phrase("Diagnostics"),
302
- onkeydown: t,
303
- onclick: n
304
- }), this.dom = v("div", { class: "cm-panel-lint" }, this.list, v("button", {
305
- type: "button",
306
- name: "close",
307
- "aria-label": this.view.state.phrase("close"),
308
- onclick: () => Se(this.view)
309
- }, "×")), this.update();
281
+ addSelection(t, n, r, i) {
282
+ let a = this.done.length ? this.done[this.done.length - 1].selectionsAfter : k;
283
+ return a.length > 0 && n - this.prevTime < i && r == this.prevUserEvent && r && /^select($|\.)/.test(r) && Ae(a[a.length - 1], t) ? this : new e(Ne(this.done, t), this.undone, n, r);
310
284
  }
311
- get selectedIndex() {
312
- let e = this.view.state.field(w).selected;
313
- if (!e) return -1;
314
- for (let t = 0; t < this.items.length; t++) if (this.items[t].diagnostic == e.diagnostic) return t;
315
- return -1;
285
+ addMapping(t) {
286
+ return new e(A(this.done, t), A(this.undone, t), this.prevTime, this.prevUserEvent);
316
287
  }
317
- update() {
318
- let { diagnostics: e, selected: t } = this.view.state.field(w), n = 0, r = !1, i = null, a = /* @__PURE__ */ new Set();
319
- for (e.between(0, this.view.state.doc.length, (e, o, { spec: s }) => {
320
- for (let e of s.diagnostics) {
321
- if (a.has(e)) continue;
322
- a.add(e);
323
- let o = -1, s;
324
- for (let t = n; t < this.items.length; t++) if (this.items[t].diagnostic == e) {
325
- o = t;
326
- break;
327
- }
328
- o < 0 ? (s = new je(this.view, e), this.items.splice(n, 0, s), r = !0) : (s = this.items[o], o > n && (this.items.splice(n, o - n), r = !0)), t && s.diagnostic == t.diagnostic ? s.dom.hasAttribute("aria-selected") || (s.dom.setAttribute("aria-selected", "true"), i = s) : s.dom.hasAttribute("aria-selected") && s.dom.removeAttribute("aria-selected"), n++;
329
- }
330
- }); n < this.items.length && !(this.items.length == 1 && this.items[0].diagnostic.from < 0);) r = !0, this.items.pop();
331
- this.items.length == 0 && (this.items.push(new je(this.view, {
332
- from: -1,
333
- to: -1,
334
- severity: "info",
335
- message: this.view.state.phrase("No diagnostics")
336
- })), r = !0), i ? (this.list.setAttribute("aria-activedescendant", i.id), this.view.requestMeasure({
337
- key: this,
338
- read: () => ({
339
- sel: i.dom.getBoundingClientRect(),
340
- panel: this.list.getBoundingClientRect()
288
+ pop(e, t, n) {
289
+ let r = e == 0 ? this.done : this.undone;
290
+ if (r.length == 0) return null;
291
+ let i = r[r.length - 1], a = i.selectionsAfter[0] || (i.startSelection ? i.startSelection.map(i.changes.invertedDesc, 1) : t.selection);
292
+ if (n && i.selectionsAfter.length) return t.update({
293
+ selection: i.selectionsAfter[i.selectionsAfter.length - 1],
294
+ annotations: C.of({
295
+ side: e,
296
+ rest: Pe(r),
297
+ selection: a
341
298
  }),
342
- write: ({ sel: e, panel: t }) => {
343
- let n = t.height / this.list.offsetHeight;
344
- e.top < t.top ? this.list.scrollTop -= (t.top - e.top) / n : e.bottom > t.bottom && (this.list.scrollTop += (e.bottom - t.bottom) / n);
345
- }
346
- })) : this.selectedIndex < 0 && this.list.removeAttribute("aria-activedescendant"), r && this.sync();
347
- }
348
- sync() {
349
- let e = this.list.firstChild;
350
- function t() {
351
- let t = e;
352
- e = t.nextSibling, t.remove();
353
- }
354
- for (let n of this.items) if (n.dom.parentNode == this.list) {
355
- for (; e != n.dom;) t();
356
- e = n.dom.nextSibling;
357
- } else this.list.insertBefore(n.dom, e);
358
- for (; e;) t();
359
- }
360
- moveSelection(e) {
361
- if (this.selectedIndex < 0) return;
362
- let t = x(this.view.state.field(w).diagnostics, this.items[e].diagnostic);
363
- t && this.view.dispatch({
364
- selection: {
365
- anchor: t.from,
366
- head: t.to
367
- },
368
- scrollIntoView: !0,
369
- effects: _e.of(t)
299
+ userEvent: e == 0 ? "select.undo" : "select.redo",
300
+ scrollIntoView: !0
370
301
  });
371
- }
372
- static open(t) {
373
- return new e(t);
302
+ if (i.changes) {
303
+ let n = r.length == 1 ? k : r.slice(0, r.length - 1);
304
+ return i.mapped && (n = A(n, i.mapped)), t.update({
305
+ changes: i.changes,
306
+ selection: i.startSelection,
307
+ effects: i.effects,
308
+ annotations: C.of({
309
+ side: e,
310
+ rest: n,
311
+ selection: a
312
+ }),
313
+ filter: !1,
314
+ userEvent: e == 0 ? "undo" : "redo",
315
+ scrollIntoView: !0
316
+ });
317
+ }
318
+ return null;
374
319
  }
375
320
  };
376
- function Me(e, t = "viewBox=\"0 0 40 40\"") {
377
- return `url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`;
378
- }
379
- function D(e) {
380
- return Me(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`, "width=\"6\" height=\"3\"");
381
- }
382
- var Ne = /*@__PURE__*/ a.baseTheme({
383
- ".cm-diagnostic": {
384
- padding: "3px 6px 3px 8px",
385
- marginLeft: "-1px",
386
- display: "block",
387
- whiteSpace: "pre-wrap"
388
- },
389
- ".cm-diagnostic-error": { borderLeft: "5px solid #d11" },
390
- ".cm-diagnostic-warning": { borderLeft: "5px solid orange" },
391
- ".cm-diagnostic-info": { borderLeft: "5px solid #999" },
392
- ".cm-diagnostic-hint": { borderLeft: "5px solid #66d" },
393
- ".cm-diagnosticAction": {
394
- font: "inherit",
395
- border: "none",
396
- padding: "2px 4px",
397
- backgroundColor: "#444",
398
- color: "white",
399
- borderRadius: "3px",
400
- marginLeft: "8px",
401
- cursor: "pointer"
321
+ j.empty = /*@__PURE__*/ new j(k, k);
322
+ var Le = [
323
+ {
324
+ key: "Mod-z",
325
+ run: Ee,
326
+ preventDefault: !0
402
327
  },
403
- ".cm-diagnosticSource": {
404
- fontSize: "70%",
405
- opacity: .7
328
+ {
329
+ key: "Mod-y",
330
+ mac: "Mod-Shift-z",
331
+ run: E,
332
+ preventDefault: !0
406
333
  },
407
- ".cm-lintRange": {
408
- backgroundPosition: "left bottom",
409
- backgroundRepeat: "repeat-x",
410
- paddingBottom: "0.7px"
334
+ {
335
+ linux: "Ctrl-Shift-z",
336
+ run: E,
337
+ preventDefault: !0
411
338
  },
412
- ".cm-lintRange-error": { backgroundImage: /*@__PURE__*/ D("#f11") },
413
- ".cm-lintRange-warning": { backgroundImage: /*@__PURE__*/ D("orange") },
414
- ".cm-lintRange-info": { backgroundImage: /*@__PURE__*/ D("#999") },
415
- ".cm-lintRange-hint": { backgroundImage: /*@__PURE__*/ D("#66d") },
416
- ".cm-lintRange-active": { backgroundColor: "#ffdd9980" },
417
- ".cm-tooltip-lint": {
418
- padding: 0,
419
- margin: 0
339
+ {
340
+ key: "Mod-u",
341
+ run: De,
342
+ preventDefault: !0
420
343
  },
421
- ".cm-lintPoint": {
422
- position: "relative",
423
- "&:after": {
424
- content: "\"\"",
425
- position: "absolute",
426
- bottom: 0,
427
- left: "-2px",
428
- borderLeft: "3px solid transparent",
429
- borderRight: "3px solid transparent",
430
- borderBottom: "4px solid #d11"
431
- }
432
- },
433
- ".cm-lintPoint-warning": { "&:after": { borderBottomColor: "orange" } },
434
- ".cm-lintPoint-info": { "&:after": { borderBottomColor: "#999" } },
435
- ".cm-lintPoint-hint": { "&:after": { borderBottomColor: "#66d" } },
436
- ".cm-panel.cm-panel-lint": {
437
- position: "relative",
438
- "& ul": {
439
- maxHeight: "100px",
440
- overflowY: "auto",
441
- "& [aria-selected]": {
442
- backgroundColor: "#ddd",
443
- "& u": { textDecoration: "underline" }
444
- },
445
- "&:focus [aria-selected]": {
446
- background_fallback: "#bdf",
447
- backgroundColor: "Highlight",
448
- color_fallback: "white",
449
- color: "HighlightText"
450
- },
451
- "& u": { textDecoration: "none" },
452
- padding: 0,
453
- margin: 0
454
- },
455
- "& [name=close]": {
456
- position: "absolute",
457
- top: "0",
458
- right: "2px",
459
- background: "inherit",
460
- border: "none",
461
- font: "inherit",
462
- padding: 0,
463
- margin: 0
464
- }
465
- },
466
- "&dark .cm-lintRange-active": { backgroundColor: "#86714a80" },
467
- "&dark .cm-panel.cm-panel-lint ul": { "& [aria-selected]": { backgroundColor: "#2e343e" } }
468
- });
469
- function Pe(e) {
470
- return e == "error" ? 4 : e == "warning" ? 3 : e == "info" ? 2 : 1;
471
- }
472
- function Fe(e) {
473
- let t = "hint", n = 1;
474
- for (let r of e) {
475
- let e = Pe(r.severity);
476
- e > n && (n = e, t = r.severity);
344
+ {
345
+ key: "Alt-u",
346
+ mac: "Mod-Shift-u",
347
+ run: Oe,
348
+ preventDefault: !0
477
349
  }
478
- return t;
479
- }
480
- var Ie = /*@__PURE__*/ le(ye, { hideOn: me }), Le = [
481
- w,
482
- /*@__PURE__*/ a.decorations.compute([w], (e) => {
483
- let { selected: t, panel: n } = e.field(w);
484
- return !t || !n || t.from == t.to ? g.none : g.set([ve.range(t.from, t.to)]);
485
- }),
486
- Ie,
487
- Ne
488
350
  ];
351
+ function M(e, t) {
352
+ return y.create(e.ranges.map(t), e.mainIndex);
353
+ }
354
+ function N(e, t) {
355
+ return e.update({
356
+ selection: t,
357
+ scrollIntoView: !0,
358
+ userEvent: "select"
359
+ });
360
+ }
361
+ function P({ state: e, dispatch: t }, n) {
362
+ let r = M(e.selection, n);
363
+ return !r.eq(e.selection, !0) && (t(N(e, r)), !0);
364
+ }
365
+ function F(e, t) {
366
+ return y.cursor(t ? e.to : e.from);
367
+ }
489
368
  function Re(e, t) {
490
- let n = e.field(w, !1);
491
- if (n && n.diagnostics.size) {
492
- let e = [], i = [], a = -1;
493
- for (let o = r.iter([n.diagnostics]);; o.next()) {
494
- for (let n = 0; n < e.length; n++) (!o.value || o.value.spec.diagnostics.indexOf(e[n]) < 0) && (t(e[n], i[n], a), e.splice(n, 1), i.splice(n--, 1));
495
- if (!o.value) break;
496
- for (let t of o.value.spec.diagnostics) e.indexOf(t) < 0 && (e.push(t), i.push(o.from));
497
- a = o.to;
498
- }
499
- }
369
+ return P(e, (n) => n.empty ? e.moveByChar(n, t) : F(n, t));
500
370
  }
501
- //#endregion
502
- //#region ../node_modules/.pnpm/@codemirror+commands@6.11.1/node_modules/@codemirror/commands/dist/index.js
503
- var ze = (e) => {
504
- let { state: t } = e, n = t.doc.lineAt(t.selection.main.from), r = k(e.state, n.from);
505
- return r.line ? Be(e) : r.block ? He(e) : !1;
506
- };
507
- function O(e, t) {
508
- return ({ state: n, dispatch: r }) => {
509
- if (n.readOnly) return !1;
510
- let i = e(t, n);
511
- return i ? (r(n.update(i)), !0) : !1;
512
- };
371
+ function I(t) {
372
+ return t.textDirectionAt(t.state.selection.main.head) == e.LTR;
513
373
  }
514
- var Be = /*@__PURE__*/ O(Ke, 0), Ve = /*@__PURE__*/ O(Ge, 0), He = /*@__PURE__*/ O((e, t) => Ge(e, t, We(t)), 0);
515
- function k(e, t) {
516
- let n = e.languageDataAt("commentTokens", t, 1);
517
- return n.length ? n[0] : {};
374
+ var ze = (e) => Re(e, !I(e)), Be = (e) => Re(e, I(e));
375
+ function Ve(e, t) {
376
+ return P(e, (n) => n.empty ? e.moveByGroup(n, t) : F(n, t));
518
377
  }
519
- var A = 50;
520
- function Ue(e, { open: t, close: n }, r, i) {
521
- let a = e.sliceDoc(r - A, r), o = e.sliceDoc(i, i + A), s = /\s*$/.exec(a)[0].length, c = /^\s*/.exec(o)[0].length, l = a.length - s;
522
- if (a.slice(l - t.length, l) == t && o.slice(c, c + n.length) == n) return {
523
- open: {
524
- pos: r - s,
525
- margin: s && 1
526
- },
527
- close: {
528
- pos: i + c,
529
- margin: c && 1
530
- }
531
- };
532
- let u, d;
533
- i - r <= 100 ? u = d = e.sliceDoc(r, i) : (u = e.sliceDoc(r, r + A), d = e.sliceDoc(i - A, i));
534
- let f = /^\s*/.exec(u)[0].length, p = /\s*$/.exec(d)[0].length, m = d.length - p - n.length;
535
- return u.slice(f, f + t.length) == t && d.slice(m, m + n.length) == n ? {
536
- open: {
537
- pos: r + f + t.length,
538
- margin: +!!/\s/.test(u.charAt(f + t.length))
539
- },
540
- close: {
541
- pos: i - p - n.length,
542
- margin: +!!/\s/.test(d.charAt(m - 1))
543
- }
544
- } : null;
378
+ var He = (e) => Ve(e, !I(e)), Ue = (e) => Ve(e, I(e));
379
+ typeof Intl < "u" && Intl.Segmenter;
380
+ function We(e, t, n) {
381
+ if (t.type.prop(n)) return !0;
382
+ let r = t.to - t.from;
383
+ return r && (r > 2 || /[^\s,.;:]/.test(e.sliceDoc(t.from, t.to))) || t.firstChild;
545
384
  }
546
- function We(e) {
547
- let t = [];
548
- for (let n of e.selection.ranges) {
549
- let r = e.doc.lineAt(n.from), i = n.to <= r.to ? r : e.doc.lineAt(n.to);
550
- i.from > r.from && i.from == n.to && (i = n.to == r.to + 1 ? r : e.doc.lineAt(n.to - 1));
551
- let a = t.length - 1;
552
- a >= 0 && t[a].to > r.from ? t[a].to = i.to : t.push({
553
- from: r.from + /^\s*/.exec(r.text)[0].length,
554
- to: i.to
555
- });
385
+ function L(e, t, n) {
386
+ let r = c(e).resolveInner(t.head), i = n ? p.closedBy : p.openedBy;
387
+ for (let a = t.head;;) {
388
+ let t = n ? r.childAfter(a) : r.childBefore(a);
389
+ if (!t) break;
390
+ We(e, t, i) ? r = t : a = n ? t.to : t.from;
556
391
  }
557
- return t;
392
+ let a = r.type.prop(i), o, s;
393
+ return s = a && (o = n ? v(e, r.from, 1) : v(e, r.to, -1)) && o.matched ? n ? o.end.to : o.end.from : n ? r.to : r.from, y.cursor(s, n ? -1 : 1);
558
394
  }
559
- function Ge(e, t, n = t.selection.ranges) {
560
- let r = n.map((e) => k(t, e.from).block);
561
- if (!r.every((e) => e)) return null;
562
- let i = n.map((e, n) => Ue(t, r[n], e.from, e.to));
563
- if (e != 2 && !i.every((e) => e)) return { changes: t.changes(n.map((e, t) => i[t] ? [] : [{
564
- from: e.from,
565
- insert: r[t].open + " "
566
- }, {
567
- from: e.to,
568
- insert: " " + r[t].close
569
- }])) };
570
- if (e != 1 && i.some((e) => e)) {
571
- let e = [];
572
- for (let t = 0, n; t < i.length; t++) if (n = i[t]) {
573
- let i = r[t], { open: a, close: o } = n;
574
- e.push({
575
- from: a.pos - i.open.length,
576
- to: a.pos + a.margin
577
- }, {
578
- from: o.pos - o.margin,
579
- to: o.pos + i.close.length
580
- });
581
- }
582
- return { changes: e };
583
- }
584
- return null;
395
+ var Ge = (e) => P(e, (t) => L(e.state, t, !I(e))), Ke = (e) => P(e, (t) => L(e.state, t, I(e)));
396
+ function qe(e, t) {
397
+ return P(e, (n) => {
398
+ if (!n.empty) return F(n, t);
399
+ let r = e.moveVertically(n, t);
400
+ return r.head == n.head ? e.moveToLineBoundary(n, t) : r;
401
+ });
585
402
  }
586
- function Ke(e, t, n = t.selection.ranges) {
587
- let r = [], i = -1;
588
- ranges: for (let { from: e, to: a } of n) {
589
- let n = r.length, o = 1e9, s;
590
- for (let n = e; n <= a;) {
591
- let c = t.doc.lineAt(n);
592
- if (s == null && (s = k(t, c.from).line, !s)) continue ranges;
593
- if (c.from > i && (e == a || a > c.from)) {
594
- i = c.from;
595
- let e = /^\s*/.exec(c.text)[0].length, t = e == c.length, n = c.text.slice(e, e + s.length) == s ? e : -1;
596
- e < c.text.length && e < o && (o = e), r.push({
597
- line: c,
598
- comment: n,
599
- token: s,
600
- indent: e,
601
- empty: t,
602
- single: !1
603
- });
604
- }
605
- n = c.to + 1;
403
+ var Je = (e) => qe(e, !1), Ye = (e) => qe(e, !0);
404
+ function Xe(e) {
405
+ let t = e.scrollDOM.clientHeight < e.scrollDOM.scrollHeight - 2, n = 0, r = 0, i;
406
+ if (t) {
407
+ for (let t of e.state.facet(h.scrollMargins)) {
408
+ let i = t(e);
409
+ i?.top && (n = Math.max(i?.top, n)), i?.bottom && (r = Math.max(i?.bottom, r));
606
410
  }
607
- if (o < 1e9) for (let e = n; e < r.length; e++) r[e].indent < r[e].line.text.length && (r[e].indent = o);
608
- r.length == n + 1 && (r[n].single = !0);
609
- }
610
- if (e != 2 && r.some((e) => e.comment < 0 && (!e.empty || e.single))) {
611
- let e = [];
612
- for (let { line: t, token: n, indent: i, empty: a, single: o } of r) (o || !a) && e.push({
613
- from: t.from + i,
614
- insert: n + " "
615
- });
616
- let n = t.changes(e);
617
- return {
618
- changes: n,
619
- selection: t.selection.map(n, 1)
620
- };
411
+ i = e.scrollDOM.clientHeight - n - r;
412
+ } else i = (e.dom.ownerDocument.defaultView || window).innerHeight;
413
+ return {
414
+ marginTop: n,
415
+ marginBottom: r,
416
+ selfScroll: t,
417
+ height: Math.max(e.defaultLineHeight, i - 5)
418
+ };
419
+ }
420
+ function Ze(e, t) {
421
+ let n = Xe(e), { state: r } = e, i = M(r.selection, (r) => r.empty ? e.moveVertically(r, t, n.height) : F(r, t));
422
+ if (i.eq(r.selection)) return !1;
423
+ let a;
424
+ if (n.selfScroll) {
425
+ let t = e.coordsAtPos(r.selection.main.head), o = e.scrollDOM.getBoundingClientRect(), s = o.top + n.marginTop, c = o.bottom - n.marginBottom;
426
+ t && t.top > s && t.bottom < c && (a = h.scrollIntoView(i.main.head, {
427
+ y: "start",
428
+ yMargin: t.top - s
429
+ }));
621
430
  }
622
- if (e != 1 && r.some((e) => e.comment >= 0)) {
623
- let e = [];
624
- for (let { line: t, comment: n, token: i } of r) if (n >= 0) {
625
- let r = t.from + n, a = r + i.length;
626
- t.text[a - t.from] == " " && a++, e.push({
627
- from: r,
628
- to: a
629
- });
630
- }
631
- return { changes: e };
431
+ return e.dispatch(N(r, i), { effects: a }), !0;
432
+ }
433
+ var Qe = (e) => Ze(e, !1), R = (e) => Ze(e, !0);
434
+ function z(e, t, n) {
435
+ let r = e.lineBlockAt(t.head), i = e.moveToLineBoundary(t, n);
436
+ if (i.head == t.head && i.head != (n ? r.to : r.from) && (i = e.moveToLineBoundary(t, n, !1)), !n && i.head == r.from && r.length) {
437
+ let n = /^\s*/.exec(e.state.sliceDoc(r.from, Math.min(r.from + 100, r.to)))[0].length;
438
+ n && t.head != r.from + n && (i = y.cursor(r.from + n));
632
439
  }
633
- return null;
440
+ return i;
634
441
  }
635
- var j = /*@__PURE__*/ ne.define(), qe = /*@__PURE__*/ ne.define(), Je = /*@__PURE__*/ y.define(), Ye = /*@__PURE__*/ y.define({ combine(e) {
636
- return s(e, {
637
- minDepth: 100,
638
- newGroupDelay: 500,
639
- joinToEvent: (e, t) => t
640
- }, {
641
- minDepth: Math.max,
642
- newGroupDelay: Math.min,
643
- joinToEvent: (e, t) => (n, r) => e(n, r) || t(n, r)
442
+ var $e = (e) => P(e, (t) => z(e, t, !0)), et = (e) => P(e, (t) => z(e, t, !1)), tt = (e) => P(e, (t) => z(e, t, !I(e))), nt = (e) => P(e, (t) => z(e, t, I(e))), rt = (e) => P(e, (t) => e.moveToLineBoundary(t, !1, !1)), it = (e) => P(e, (t) => e.moveToLineBoundary(t, !0, !1));
443
+ function at(e, t, n) {
444
+ let r = !1, i = M(e.selection, (t) => {
445
+ let i = v(e, t.head, -1) || v(e, t.head, 1) || t.head > 0 && v(e, t.head - 1, 1) || t.head < e.doc.length && v(e, t.head + 1, -1);
446
+ if (!i || !i.end) return t;
447
+ r = !0;
448
+ let a = i.start.from == t.head ? i.end.to : i.end.from;
449
+ return n ? y.range(t.anchor, a) : y.cursor(a);
644
450
  });
645
- } }), M = /*@__PURE__*/ ae.define({
646
- create() {
647
- return z.empty;
648
- },
649
- update(e, t) {
650
- let n = t.state.facet(Ye), r = t.annotation(j);
651
- if (r) {
652
- let i = F.fromTransaction(t, r.selection), a = r.side, o = a == 0 ? e.undone : e.done;
653
- return o = i ? I(o, o.length, n.minDepth, i) : at(o, t.startState.selection), new z(a == 0 ? r.rest : o, a == 0 ? o : r.rest);
654
- }
655
- let i = t.annotation(qe);
656
- if ((i == "full" || i == "before") && (e = e.isolate()), t.annotation(f.addToHistory) === !1) return t.changes.empty ? e : e.addMapping(t.changes.desc);
657
- let a = F.fromTransaction(t), o = t.annotation(f.time), s = t.annotation(f.userEvent);
658
- return a ? e = e.addChanges(a, o, s, n, t) : t.selection && (e = e.addSelection(t.startState.selection, o, s, n.newGroupDelay)), (i == "full" || i == "after") && (e = e.isolate()), e;
659
- },
660
- toJSON(e) {
661
- return {
662
- done: e.done.map((e) => e.toJSON()),
663
- undone: e.undone.map((e) => e.toJSON())
664
- };
665
- },
666
- fromJSON(e) {
667
- return new z(e.done.map(F.fromJSON), e.undone.map(F.fromJSON));
668
- }
669
- });
670
- function Xe(e = {}) {
671
- return [
672
- M,
673
- Ye.of(e),
674
- a.domEventHandlers({ beforeinput(e, t) {
675
- let n = e.inputType == "historyUndo" ? Qe : e.inputType == "historyRedo" ? P : null;
676
- return n ? (e.preventDefault(), n(t)) : !1;
677
- } })
678
- ];
451
+ return r ? (t(N(e, i)), !0) : !1;
679
452
  }
680
- var Ze = M;
681
- function N(e, t) {
682
- return function({ state: n, dispatch: r }) {
683
- if (!t && n.readOnly) return !1;
684
- let i = n.field(M, !1);
685
- if (!i) return !1;
686
- let a = i.pop(e, n, t);
687
- return a ? (r(a), !0) : !1;
688
- };
453
+ var ot = ({ state: e, dispatch: t }) => at(e, t, !1);
454
+ function B(e, t, n) {
455
+ let r = M(e.state.selection, (e) => {
456
+ e.undirectional && e.head >= e.anchor != t && (e = y.range(e.head, e.anchor));
457
+ let r = n(e);
458
+ return y.range(e.anchor, r.head, r.goalColumn, r.bidiLevel || void 0, r.assoc);
459
+ });
460
+ return !r.eq(e.state.selection) && (e.dispatch(N(e.state, r)), !0);
689
461
  }
690
- var Qe = /*@__PURE__*/ N(0, !1), P = /*@__PURE__*/ N(1, !1), $e = /*@__PURE__*/ N(0, !0), et = /*@__PURE__*/ N(1, !0), F = class e {
691
- constructor(e, t, n, r, i) {
692
- this.changes = e, this.effects = t, this.mapped = n, this.startSelection = r, this.selectionsAfter = i;
693
- }
694
- setSelAfter(t) {
695
- return new e(this.changes, this.effects, this.mapped, this.startSelection, t);
696
- }
697
- toJSON() {
698
- return {
699
- changes: this.changes?.toJSON(),
700
- mapped: this.mapped?.toJSON(),
701
- startSelection: this.startSelection?.toJSON(),
702
- selectionsAfter: this.selectionsAfter.map((e) => e.toJSON())
703
- };
704
- }
705
- static fromJSON(t) {
706
- return new e(t.changes && fe.fromJSON(t.changes), [], t.mapped && de.fromJSON(t.mapped), t.startSelection && h.fromJSON(t.startSelection), t.selectionsAfter.map(h.fromJSON));
707
- }
708
- static fromTransaction(t, n) {
709
- let r = L;
710
- for (let e of t.startState.facet(Je)) {
711
- let n = e(t);
712
- n.length && (r = r.concat(n));
713
- }
714
- return !r.length && t.changes.empty ? null : new e(t.changes.invert(t.startState.doc), r, void 0, n || t.startState.selection, L);
715
- }
716
- static selection(t) {
717
- return new e(void 0, L, void 0, void 0, t);
718
- }
719
- };
720
- function I(e, t, n, r) {
721
- let i = t + 1 > n + 20 ? t - n - 1 : 0, a = e.slice(i, t);
722
- return a.push(r), a;
723
- }
724
- function tt(e, t) {
725
- let n = [], r = !1;
726
- return e.iterChangedRanges((e, t) => n.push(e, t)), t.iterChangedRanges((e, t, i, a) => {
727
- for (let e = 0; e < n.length;) {
728
- let t = n[e++], o = n[e++];
729
- a >= t && i <= o && (r = !0);
730
- }
731
- }), r;
732
- }
733
- function nt(e, t) {
734
- return e.ranges.length == t.ranges.length && e.ranges.filter((e, n) => e.empty != t.ranges[n].empty).length === 0;
735
- }
736
- function rt(e, t) {
737
- return e.length ? t.length ? e.concat(t) : e : t;
738
- }
739
- var L = [], it = 200;
740
- function at(e, t) {
741
- if (e.length) {
742
- let n = e[e.length - 1], r = n.selectionsAfter.slice(Math.max(0, n.selectionsAfter.length - it));
743
- return r.length && r[r.length - 1].eq(t) ? e : (r.push(t), I(e, e.length - 1, 1e9, n.setSelAfter(r)));
744
- }
745
- return [F.selection([t])];
746
- }
747
- function ot(e) {
748
- let t = e[e.length - 1], n = e.slice();
749
- return n[e.length - 1] = t.setSelAfter(t.selectionsAfter.slice(0, t.selectionsAfter.length - 1)), n;
750
- }
751
- function R(e, t) {
752
- if (!e.length) return e;
753
- let n = e.length, r = L;
754
- for (; n;) {
755
- let i = st(e[n - 1], t, r);
756
- if (i.changes && !i.changes.empty || i.effects.length) {
757
- let t = e.slice(0, n);
758
- return t[n - 1] = i, t;
759
- }
760
- t = i.mapped, n--, r = i.selectionsAfter;
761
- }
762
- return r.length ? [F.selection(r)] : L;
763
- }
764
- function st(e, n, r) {
765
- let i = rt(e.selectionsAfter.length ? e.selectionsAfter.map((e) => e.map(n)) : L, r);
766
- if (!e.changes) return F.selection(i);
767
- let a = e.changes.map(n), o = n.mapDesc(e.changes, !0), s = e.mapped ? e.mapped.composeDesc(o) : o;
768
- return new F(a, t.mapEffects(e.effects, n), s, e.startSelection.map(o), i);
769
- }
770
- var ct = /^(input\.type|delete)($|\.)/, z = class e {
771
- constructor(e, t, n = 0, r = void 0) {
772
- this.done = e, this.undone = t, this.prevTime = n, this.prevUserEvent = r;
773
- }
774
- isolate() {
775
- return this.prevTime ? new e(this.done, this.undone) : this;
776
- }
777
- addChanges(n, r, i, a, o) {
778
- let s = this.done, c = s[s.length - 1];
779
- return s = c && c.changes && !c.changes.empty && n.changes && (!i || ct.test(i)) && (!c.selectionsAfter.length && r - this.prevTime < a.newGroupDelay && a.joinToEvent(o, tt(c.changes, n.changes)) || i == "input.type.compose") ? I(s, s.length - 1, a.minDepth, new F(n.changes.compose(c.changes), rt(t.mapEffects(n.effects, c.changes), c.effects), c.mapped, c.startSelection, L)) : I(s, s.length, a.minDepth, n), new e(s, L, r, i);
780
- }
781
- addSelection(t, n, r, i) {
782
- let a = this.done.length ? this.done[this.done.length - 1].selectionsAfter : L;
783
- return a.length > 0 && n - this.prevTime < i && r == this.prevUserEvent && r && /^select($|\.)/.test(r) && nt(a[a.length - 1], t) ? this : new e(at(this.done, t), this.undone, n, r);
784
- }
785
- addMapping(t) {
786
- return new e(R(this.done, t), R(this.undone, t), this.prevTime, this.prevUserEvent);
787
- }
788
- pop(e, t, n) {
789
- let r = e == 0 ? this.done : this.undone;
790
- if (r.length == 0) return null;
791
- let i = r[r.length - 1], a = i.selectionsAfter[0] || (i.startSelection ? i.startSelection.map(i.changes.invertedDesc, 1) : t.selection);
792
- if (n && i.selectionsAfter.length) return t.update({
793
- selection: i.selectionsAfter[i.selectionsAfter.length - 1],
794
- annotations: j.of({
795
- side: e,
796
- rest: ot(r),
797
- selection: a
798
- }),
799
- userEvent: e == 0 ? "select.undo" : "select.redo",
800
- scrollIntoView: !0
801
- });
802
- if (i.changes) {
803
- let n = r.length == 1 ? L : r.slice(0, r.length - 1);
804
- return i.mapped && (n = R(n, i.mapped)), t.update({
805
- changes: i.changes,
806
- selection: i.startSelection,
807
- effects: i.effects,
808
- annotations: j.of({
809
- side: e,
810
- rest: n,
811
- selection: a
812
- }),
813
- filter: !1,
814
- userEvent: e == 0 ? "undo" : "redo",
815
- scrollIntoView: !0
816
- });
817
- }
818
- return null;
819
- }
820
- };
821
- z.empty = /*@__PURE__*/ new z(L, L);
822
- var lt = [
823
- {
824
- key: "Mod-z",
825
- run: Qe,
826
- preventDefault: !0
827
- },
828
- {
829
- key: "Mod-y",
830
- mac: "Mod-Shift-z",
831
- run: P,
832
- preventDefault: !0
833
- },
834
- {
835
- linux: "Ctrl-Shift-z",
836
- run: P,
837
- preventDefault: !0
838
- },
839
- {
840
- key: "Mod-u",
841
- run: $e,
842
- preventDefault: !0
843
- },
844
- {
845
- key: "Alt-u",
846
- mac: "Mod-Shift-u",
847
- run: et,
848
- preventDefault: !0
849
- }
850
- ];
851
- function B(e, t) {
852
- return h.create(e.ranges.map(t), e.mainIndex);
853
- }
854
- function V(e, t) {
855
- return e.update({
856
- selection: t,
857
- scrollIntoView: !0,
858
- userEvent: "select"
859
- });
860
- }
861
- function H({ state: e, dispatch: t }, n) {
862
- let r = B(e.selection, n);
863
- return !r.eq(e.selection, !0) && (t(V(e, r)), !0);
864
- }
865
- function U(e, t) {
866
- return h.cursor(t ? e.to : e.from);
462
+ function st(e, t) {
463
+ return B(e, t, (n) => e.moveByChar(n, t));
867
464
  }
465
+ var ct = (e) => st(e, !I(e)), lt = (e) => st(e, I(e));
868
466
  function ut(e, t) {
869
- return H(e, (n) => n.empty ? e.moveByChar(n, t) : U(n, t));
870
- }
871
- function W(e) {
872
- return e.textDirectionAt(e.state.selection.main.head) == ee.LTR;
873
- }
874
- var dt = (e) => ut(e, !W(e)), ft = (e) => ut(e, W(e));
875
- function pt(e, t) {
876
- return H(e, (n) => n.empty ? e.moveByGroup(n, t) : U(n, t));
467
+ return B(e, t, (n) => e.moveByGroup(n, t));
877
468
  }
878
- var mt = (e) => pt(e, !W(e)), ht = (e) => pt(e, W(e));
879
- typeof Intl < "u" && Intl.Segmenter;
880
- function gt(e, t, n) {
881
- if (t.type.prop(n)) return !0;
882
- let r = t.to - t.from;
883
- return r && (r > 2 || /[^\s,.;:]/.test(e.sliceDoc(t.from, t.to))) || t.firstChild;
884
- }
885
- function G(e, t, n) {
886
- let r = o(e).resolveInner(t.head), i = n ? _.closedBy : _.openedBy;
887
- for (let a = t.head;;) {
888
- let t = n ? r.childAfter(a) : r.childBefore(a);
889
- if (!t) break;
890
- gt(e, t, i) ? r = t : a = n ? t.to : t.from;
891
- }
892
- let a = r.type.prop(i), s, c;
893
- return c = a && (s = n ? d(e, r.from, 1) : d(e, r.to, -1)) && s.matched ? n ? s.end.to : s.end.from : n ? r.to : r.from, h.cursor(c, n ? -1 : 1);
894
- }
895
- var _t = (e) => H(e, (t) => G(e.state, t, !W(e))), vt = (e) => H(e, (t) => G(e.state, t, W(e)));
896
- function yt(e, t) {
897
- return H(e, (n) => {
898
- if (!n.empty) return U(n, t);
899
- let r = e.moveVertically(n, t);
900
- return r.head == n.head ? e.moveToLineBoundary(n, t) : r;
901
- });
902
- }
903
- var bt = (e) => yt(e, !1), xt = (e) => yt(e, !0);
904
- function St(e) {
905
- let t = e.scrollDOM.clientHeight < e.scrollDOM.scrollHeight - 2, n = 0, r = 0, i;
906
- if (t) {
907
- for (let t of e.state.facet(a.scrollMargins)) {
908
- let i = t(e);
909
- i?.top && (n = Math.max(i?.top, n)), i?.bottom && (r = Math.max(i?.bottom, r));
910
- }
911
- i = e.scrollDOM.clientHeight - n - r;
912
- } else i = (e.dom.ownerDocument.defaultView || window).innerHeight;
913
- return {
914
- marginTop: n,
915
- marginBottom: r,
916
- selfScroll: t,
917
- height: Math.max(e.defaultLineHeight, i - 5)
918
- };
919
- }
920
- function Ct(e, t) {
921
- let n = St(e), { state: r } = e, i = B(r.selection, (r) => r.empty ? e.moveVertically(r, t, n.height) : U(r, t));
922
- if (i.eq(r.selection)) return !1;
923
- let o;
924
- if (n.selfScroll) {
925
- let t = e.coordsAtPos(r.selection.main.head), s = e.scrollDOM.getBoundingClientRect(), c = s.top + n.marginTop, l = s.bottom - n.marginBottom;
926
- t && t.top > c && t.bottom < l && (o = a.scrollIntoView(i.main.head, {
927
- y: "start",
928
- yMargin: t.top - c
929
- }));
930
- }
931
- return e.dispatch(V(r, i), { effects: o }), !0;
932
- }
933
- var wt = (e) => Ct(e, !1), K = (e) => Ct(e, !0);
934
- function q(e, t, n) {
935
- let r = e.lineBlockAt(t.head), i = e.moveToLineBoundary(t, n);
936
- if (i.head == t.head && i.head != (n ? r.to : r.from) && (i = e.moveToLineBoundary(t, n, !1)), !n && i.head == r.from && r.length) {
937
- let n = /^\s*/.exec(e.state.sliceDoc(r.from, Math.min(r.from + 100, r.to)))[0].length;
938
- n && t.head != r.from + n && (i = h.cursor(r.from + n));
939
- }
940
- return i;
941
- }
942
- var Tt = (e) => H(e, (t) => q(e, t, !0)), Et = (e) => H(e, (t) => q(e, t, !1)), Dt = (e) => H(e, (t) => q(e, t, !W(e))), Ot = (e) => H(e, (t) => q(e, t, W(e))), kt = (e) => H(e, (t) => e.moveToLineBoundary(t, !1, !1)), At = (e) => H(e, (t) => e.moveToLineBoundary(t, !0, !1));
943
- function jt(e, t, n) {
944
- let r = !1, i = B(e.selection, (t) => {
945
- let i = d(e, t.head, -1) || d(e, t.head, 1) || t.head > 0 && d(e, t.head - 1, 1) || t.head < e.doc.length && d(e, t.head + 1, -1);
946
- if (!i || !i.end) return t;
947
- r = !0;
948
- let a = i.start.from == t.head ? i.end.to : i.end.from;
949
- return n ? h.range(t.anchor, a) : h.cursor(a);
950
- });
951
- return r ? (t(V(e, i)), !0) : !1;
952
- }
953
- var Mt = ({ state: e, dispatch: t }) => jt(e, t, !1);
954
- function J(e, t, n) {
955
- let r = B(e.state.selection, (e) => {
956
- e.undirectional && e.head >= e.anchor != t && (e = h.range(e.head, e.anchor));
957
- let r = n(e);
958
- return h.range(e.anchor, r.head, r.goalColumn, r.bidiLevel || void 0, r.assoc);
959
- });
960
- return !r.eq(e.state.selection) && (e.dispatch(V(e.state, r)), !0);
961
- }
962
- function Nt(e, t) {
963
- return J(e, t, (n) => e.moveByChar(n, t));
964
- }
965
- var Pt = (e) => Nt(e, !W(e)), Ft = (e) => Nt(e, W(e));
966
- function It(e, t) {
967
- return J(e, t, (n) => e.moveByGroup(n, t));
968
- }
969
- var Lt = (e) => It(e, !W(e)), Rt = (e) => It(e, W(e)), zt = (e) => {
970
- let t = !W(e);
971
- return J(e, t, (n) => G(e.state, n, t));
972
- }, Bt = (e) => {
973
- let t = W(e);
974
- return J(e, t, (n) => G(e.state, n, t));
469
+ var dt = (e) => ut(e, !I(e)), ft = (e) => ut(e, I(e)), pt = (e) => {
470
+ let t = !I(e);
471
+ return B(e, t, (n) => L(e.state, n, t));
472
+ }, mt = (e) => {
473
+ let t = I(e);
474
+ return B(e, t, (n) => L(e.state, n, t));
975
475
  };
976
- function Vt(e, t) {
977
- return J(e, t, (n) => e.moveVertically(n, t));
476
+ function ht(e, t) {
477
+ return B(e, t, (n) => e.moveVertically(n, t));
978
478
  }
979
- var Ht = (e) => Vt(e, !1), Ut = (e) => Vt(e, !0);
980
- function Wt(e, t) {
981
- return J(e, t, (n) => e.moveVertically(n, t, St(e).height));
479
+ var gt = (e) => ht(e, !1), _t = (e) => ht(e, !0);
480
+ function vt(e, t) {
481
+ return B(e, t, (n) => e.moveVertically(n, t, Xe(e).height));
982
482
  }
983
- var Gt = (e) => Wt(e, !1), Kt = (e) => Wt(e, !0), qt = (e) => J(e, !0, (t) => q(e, t, !0)), Jt = (e) => J(e, !1, (t) => q(e, t, !1)), Yt = (e) => {
984
- let t = !W(e);
985
- return J(e, t, (n) => q(e, n, t));
986
- }, Xt = (e) => {
987
- let t = W(e);
988
- return J(e, t, (n) => q(e, n, t));
989
- }, Zt = (e) => J(e, !1, (t) => h.cursor(e.lineBlockAt(t.head).from)), Qt = (e) => J(e, !0, (t) => h.cursor(e.lineBlockAt(t.head).to)), $t = ({ state: e, dispatch: t }) => (t(V(e, { anchor: 0 })), !0), en = ({ state: e, dispatch: t }) => (t(V(e, { anchor: e.doc.length })), !0), tn = ({ state: e, dispatch: t }) => (t(V(e, {
483
+ var yt = (e) => vt(e, !1), bt = (e) => vt(e, !0), xt = (e) => B(e, !0, (t) => z(e, t, !0)), St = (e) => B(e, !1, (t) => z(e, t, !1)), Ct = (e) => {
484
+ let t = !I(e);
485
+ return B(e, t, (n) => z(e, n, t));
486
+ }, wt = (e) => {
487
+ let t = I(e);
488
+ return B(e, t, (n) => z(e, n, t));
489
+ }, Tt = (e) => B(e, !1, (t) => y.cursor(e.lineBlockAt(t.head).from)), Et = (e) => B(e, !0, (t) => y.cursor(e.lineBlockAt(t.head).to)), Dt = ({ state: e, dispatch: t }) => (t(N(e, { anchor: 0 })), !0), Ot = ({ state: e, dispatch: t }) => (t(N(e, { anchor: e.doc.length })), !0), kt = ({ state: e, dispatch: t }) => (t(N(e, {
990
490
  anchor: e.selection.main.anchor,
991
491
  head: 0
992
- })), !0), nn = ({ state: e, dispatch: t }) => (t(V(e, {
492
+ })), !0), At = ({ state: e, dispatch: t }) => (t(N(e, {
993
493
  anchor: e.selection.main.anchor,
994
494
  head: e.doc.length
995
- })), !0), rn = ({ state: e, dispatch: t }) => (t(e.update({
495
+ })), !0), jt = ({ state: e, dispatch: t }) => (t(e.update({
996
496
  selection: {
997
497
  anchor: 0,
998
498
  head: e.doc.length
999
499
  },
1000
500
  userEvent: "select"
1001
- })), !0), an = ({ state: e, dispatch: t }) => {
1002
- let n = Q(e).map(({ from: t, to: n }) => h.undirectionalRange(t, Math.min(n + 1, e.doc.length)));
501
+ })), !0), Mt = ({ state: e, dispatch: t }) => {
502
+ let n = W(e).map(({ from: t, to: n }) => y.undirectionalRange(t, Math.min(n + 1, e.doc.length)));
1003
503
  return t(e.update({
1004
- selection: h.create(n),
504
+ selection: y.create(n),
1005
505
  userEvent: "select"
1006
506
  })), !0;
1007
- }, on = ({ state: e, dispatch: t }) => {
1008
- let n = B(e.selection, (t) => {
1009
- let n = o(e), r = n.resolveStack(t.from, 1);
507
+ }, Nt = ({ state: e, dispatch: t }) => {
508
+ let n = M(e.selection, (t) => {
509
+ let n = c(e), r = n.resolveStack(t.from, 1);
1010
510
  if (t.empty) {
1011
511
  let e = n.resolveStack(t.from, -1);
1012
512
  e.node.from >= r.node.from && e.node.to <= r.node.to && (r = e);
1013
513
  }
1014
514
  for (let e = r; e; e = e.next) {
1015
515
  let { node: n } = e;
1016
- if ((n.from < t.from && n.to >= t.to || n.to > t.to && n.from <= t.from) && e.next) return h.undirectionalRange(n.from, n.to);
516
+ if ((n.from < t.from && n.to >= t.to || n.to > t.to && n.from <= t.from) && e.next) return y.undirectionalRange(n.from, n.to);
1017
517
  }
1018
518
  return t;
1019
519
  });
1020
- return !n.eq(e.selection) && (t(V(e, n)), !0);
520
+ return !n.eq(e.selection) && (t(N(e, n)), !0);
1021
521
  };
1022
- function sn(e, t) {
522
+ function Pt(e, t) {
1023
523
  let { state: n } = e, r = n.selection, i = n.selection.ranges.slice();
1024
524
  for (let r of n.selection.ranges) {
1025
525
  let a = n.doc.lineAt(r.head);
@@ -1033,96 +533,96 @@ function sn(e, t) {
1033
533
  n = r;
1034
534
  }
1035
535
  }
1036
- return i.length != r.ranges.length && (e.dispatch(V(n, h.create(i, i.length - 1))), !0);
536
+ return i.length != r.ranges.length && (e.dispatch(N(n, y.create(i, i.length - 1))), !0);
1037
537
  }
1038
- var cn = (e) => sn(e, !1), ln = (e) => sn(e, !0), un = ({ state: e, dispatch: t }) => {
538
+ var Ft = (e) => Pt(e, !1), It = (e) => Pt(e, !0), Lt = ({ state: e, dispatch: t }) => {
1039
539
  let n = e.selection, r = null;
1040
- return n.ranges.length > 1 ? r = h.create([n.main]) : n.main.empty || (r = h.create([h.cursor(n.main.head)])), r ? (t(V(e, r)), !0) : !1;
540
+ return n.ranges.length > 1 ? r = y.create([n.main]) : n.main.empty || (r = y.create([y.cursor(n.main.head)])), r ? (t(N(e, r)), !0) : !1;
1041
541
  };
1042
- function Y(e, t) {
542
+ function V(e, t) {
1043
543
  if (e.state.readOnly) return !1;
1044
544
  let n = "delete.selection", { state: r } = e, i = r.changeByRange((r) => {
1045
545
  let { from: i, to: a } = r;
1046
546
  if (i == a) {
1047
547
  let o = t(r);
1048
- o < i ? (n = "delete.backward", o = X(e, o, !1)) : o > i && (n = "delete.forward", o = X(e, o, !0)), i = Math.min(i, o), a = Math.max(a, o);
1049
- } else i = X(e, i, !1), a = X(e, a, !0);
548
+ o < i ? (n = "delete.backward", o = H(e, o, !1)) : o > i && (n = "delete.forward", o = H(e, o, !0)), i = Math.min(i, o), a = Math.max(a, o);
549
+ } else i = H(e, i, !1), a = H(e, a, !0);
1050
550
  return i == a ? { range: r } : {
1051
551
  changes: {
1052
552
  from: i,
1053
553
  to: a
1054
554
  },
1055
- range: h.cursor(i, i < r.head ? -1 : 1)
555
+ range: y.cursor(i, i < r.head ? -1 : 1)
1056
556
  };
1057
557
  });
1058
558
  return !i.changes.empty && (e.dispatch(r.update(i, {
1059
559
  scrollIntoView: !0,
1060
560
  userEvent: n,
1061
- effects: n == "delete.selection" ? a.announce.of(r.phrase("Selection deleted")) : void 0
561
+ effects: n == "delete.selection" ? h.announce.of(r.phrase("Selection deleted")) : void 0
1062
562
  })), !0);
1063
563
  }
1064
- function X(e, t, n) {
1065
- if (e instanceof a) for (let r of e.state.facet(a.atomicRanges).map((t) => t(e))) r.between(t, t, (e, r) => {
564
+ function H(e, t, n) {
565
+ if (e instanceof h) for (let r of e.state.facet(h.atomicRanges).map((t) => t(e))) r.between(t, t, (e, r) => {
1066
566
  e < t && r > t && (t = n ? r : e);
1067
567
  });
1068
568
  return t;
1069
569
  }
1070
- var dn = (e, t, n) => Y(e, (r) => {
1071
- let a = r.from, { state: o } = e, s = o.doc.lineAt(a), c, u;
1072
- if (n && !t && a > s.from && a < s.from + 200 && !/[^ \t]/.test(c = s.text.slice(0, a - s.from))) {
1073
- if (c[c.length - 1] == " ") return a - 1;
1074
- let e = l(c, o.tabSize) % i(o) || i(o);
1075
- for (let t = 0; t < e && c[c.length - 1 - t] == " "; t++) a--;
1076
- u = a;
1077
- } else u = m(s.text, a - s.from, t, t) + s.from, u == a && s.number != (t ? o.doc.lines : 1) ? u += t ? 1 : -1 : !t && /[\ufe00-\ufe0f]/.test(s.text.slice(u - s.from, a - s.from)) && (u = m(s.text, u - s.from, !1, !1) + s.from);
1078
- return u;
1079
- }), Z = (e) => dn(e, !1, !0), fn = (e) => dn(e, !0, !1), pn = (e, t) => Y(e, (n) => {
570
+ var Rt = (e, t, n) => V(e, (r) => {
571
+ let i = r.from, { state: a } = e, o = a.doc.lineAt(i), s, c;
572
+ if (n && !t && i > o.from && i < o.from + 200 && !/[^ \t]/.test(s = o.text.slice(0, i - o.from))) {
573
+ if (s[s.length - 1] == " ") return i - 1;
574
+ let e = u(s, a.tabSize) % m(a) || m(a);
575
+ for (let t = 0; t < e && s[s.length - 1 - t] == " "; t++) i--;
576
+ c = i;
577
+ } else c = f(o.text, i - o.from, t, t) + o.from, c == i && o.number != (t ? a.doc.lines : 1) ? c += t ? 1 : -1 : !t && /[\ufe00-\ufe0f]/.test(o.text.slice(c - o.from, i - o.from)) && (c = f(o.text, c - o.from, !1, !1) + o.from);
578
+ return c;
579
+ }), U = (e) => Rt(e, !1, !0), zt = (e) => Rt(e, !0, !1), Bt = (e, t) => V(e, (n) => {
1080
580
  let r = n.head, { state: i } = e, a = i.doc.lineAt(r), o = i.charCategorizer(r);
1081
581
  for (let e = null;;) {
1082
582
  if (r == (t ? a.to : a.from)) {
1083
583
  r == n.head && a.number != (t ? i.doc.lines : 1) && (r += t ? 1 : -1);
1084
584
  break;
1085
585
  }
1086
- let s = m(a.text, r - a.from, t) + a.from, c = a.text.slice(Math.min(r, s) - a.from, Math.max(r, s) - a.from), l = o(c);
586
+ let s = f(a.text, r - a.from, t) + a.from, c = a.text.slice(Math.min(r, s) - a.from, Math.max(r, s) - a.from), l = o(c);
1087
587
  if (e != null && l != e) break;
1088
588
  (c != " " || r != n.head) && (e = l), r = s;
1089
589
  }
1090
590
  return r;
1091
- }), mn = (e) => pn(e, !1), hn = (e) => pn(e, !0), gn = (e) => Y(e, (t) => {
591
+ }), Vt = (e) => Bt(e, !1), Ht = (e) => Bt(e, !0), Ut = (e) => V(e, (t) => {
1092
592
  let n = e.lineBlockAt(t.head).to;
1093
593
  return t.head < n ? n : Math.min(e.state.doc.length, t.head + 1);
1094
- }), _n = (e) => Y(e, (t) => {
594
+ }), Wt = (e) => V(e, (t) => {
1095
595
  let n = e.moveToLineBoundary(t, !1).head;
1096
596
  return t.head > n ? n : Math.max(0, t.head - 1);
1097
- }), vn = (e) => Y(e, (t) => {
597
+ }), Gt = (e) => V(e, (t) => {
1098
598
  let n = e.moveToLineBoundary(t, !0).head;
1099
599
  return t.head < n ? n : Math.min(e.state.doc.length, t.head + 1);
1100
- }), yn = ({ state: e, dispatch: t }) => {
600
+ }), Kt = ({ state: e, dispatch: t }) => {
1101
601
  if (e.readOnly) return !1;
1102
602
  let n = e.changeByRange((e) => ({
1103
603
  changes: {
1104
604
  from: e.from,
1105
605
  to: e.to,
1106
- insert: u.of(["", ""])
606
+ insert: d.of(["", ""])
1107
607
  },
1108
- range: h.cursor(e.from)
608
+ range: y.cursor(e.from)
1109
609
  }));
1110
610
  return t(e.update(n, {
1111
611
  scrollIntoView: !0,
1112
612
  userEvent: "input"
1113
613
  })), !0;
1114
- }, bn = ({ state: e, dispatch: t }) => {
614
+ }, qt = ({ state: e, dispatch: t }) => {
1115
615
  if (e.readOnly) return !1;
1116
616
  let n = e.changeByRange((t) => {
1117
617
  if (!t.empty || t.from == 0 || t.from == e.doc.length) return { range: t };
1118
- let n = t.from, r = e.doc.lineAt(n), i = n == r.from ? n - 1 : m(r.text, n - r.from, !1) + r.from, a = n == r.to ? n + 1 : m(r.text, n - r.from, !0) + r.from;
618
+ let n = t.from, r = e.doc.lineAt(n), i = n == r.from ? n - 1 : f(r.text, n - r.from, !1) + r.from, a = n == r.to ? n + 1 : f(r.text, n - r.from, !0) + r.from;
1119
619
  return {
1120
620
  changes: {
1121
621
  from: i,
1122
622
  to: a,
1123
623
  insert: e.doc.slice(n, a).append(e.doc.slice(i, n))
1124
624
  },
1125
- range: h.cursor(a)
625
+ range: y.cursor(a)
1126
626
  };
1127
627
  });
1128
628
  return !n.changes.empty && (t(e.update(n, {
@@ -1130,7 +630,7 @@ var dn = (e, t, n) => Y(e, (r) => {
1130
630
  userEvent: "move.character"
1131
631
  })), !0);
1132
632
  };
1133
- function Q(e) {
633
+ function W(e) {
1134
634
  let t = [], n = -1;
1135
635
  for (let r of e.selection.ranges) {
1136
636
  let i = e.doc.lineAt(r.from), a = e.doc.lineAt(r.to);
@@ -1146,10 +646,10 @@ function Q(e) {
1146
646
  }
1147
647
  return t;
1148
648
  }
1149
- function xn(e, t, n) {
649
+ function Jt(e, t, n) {
1150
650
  if (e.readOnly) return !1;
1151
651
  let r = [], i = [];
1152
- for (let t of Q(e)) {
652
+ for (let t of W(e)) {
1153
653
  if (n ? t.to == e.doc.length : t.from == 0) continue;
1154
654
  let a = e.doc.lineAt(n ? t.to + 1 : t.from - 1), o = a.length + 1;
1155
655
  if (n) {
@@ -1160,7 +660,7 @@ function xn(e, t, n) {
1160
660
  from: t.from,
1161
661
  insert: a.text + e.lineBreak
1162
662
  });
1163
- for (let n of t.ranges) i.push(h.range(Math.min(e.doc.length, n.anchor + o), Math.min(e.doc.length, n.head + o)));
663
+ for (let n of t.ranges) i.push(y.range(Math.min(e.doc.length, n.anchor + o), Math.min(e.doc.length, n.head + o)));
1164
664
  } else {
1165
665
  r.push({
1166
666
  from: a.from,
@@ -1169,21 +669,21 @@ function xn(e, t, n) {
1169
669
  from: t.to,
1170
670
  insert: e.lineBreak + a.text
1171
671
  });
1172
- for (let e of t.ranges) i.push(h.range(e.anchor - o, e.head - o));
672
+ for (let e of t.ranges) i.push(y.range(e.anchor - o, e.head - o));
1173
673
  }
1174
674
  }
1175
675
  return r.length ? (t(e.update({
1176
676
  changes: r,
1177
677
  scrollIntoView: !0,
1178
- selection: h.create(i, e.selection.mainIndex),
678
+ selection: y.create(i, e.selection.mainIndex),
1179
679
  userEvent: "move.line"
1180
680
  })), !0) : !1;
1181
681
  }
1182
- var Sn = ({ state: e, dispatch: t }) => xn(e, t, !1), Cn = ({ state: e, dispatch: t }) => xn(e, t, !0);
1183
- function wn(e, t, n) {
682
+ var Yt = ({ state: e, dispatch: t }) => Jt(e, t, !1), Xt = ({ state: e, dispatch: t }) => Jt(e, t, !0);
683
+ function Zt(e, t, n) {
1184
684
  if (e.readOnly) return !1;
1185
685
  let r = [];
1186
- for (let t of Q(e)) n ? r.push({
686
+ for (let t of W(e)) n ? r.push({
1187
687
  from: t.from,
1188
688
  insert: e.doc.slice(t.from, t.to) + e.lineBreak
1189
689
  }) : r.push({
@@ -1198,12 +698,12 @@ function wn(e, t, n) {
1198
698
  userEvent: "input.copyline"
1199
699
  })), !0;
1200
700
  }
1201
- var Tn = ({ state: e, dispatch: t }) => wn(e, t, !1), En = ({ state: e, dispatch: t }) => wn(e, t, !0), Dn = (e) => {
701
+ var Qt = ({ state: e, dispatch: t }) => Zt(e, t, !1), $t = ({ state: e, dispatch: t }) => Zt(e, t, !0), en = (e) => {
1202
702
  if (e.state.readOnly) return !1;
1203
- let { state: t } = e, n = t.changes(Q(t).map(({ from: e, to: n }) => (e > 0 ? e-- : n < t.doc.length && n++, {
703
+ let { state: t } = e, n = t.changes(W(t).map(({ from: e, to: n }) => (e > 0 ? e-- : n < t.doc.length && n++, {
1204
704
  from: e,
1205
705
  to: n
1206
- }))), r = B(t.selection, (t) => {
706
+ }))), r = M(t.selection, (t) => {
1207
707
  let n;
1208
708
  if (e.lineWrapping) {
1209
709
  let r = e.lineBlockAt(t.head), i = e.coordsAtPos(t.head, t.assoc || 1);
@@ -1218,47 +718,47 @@ var Tn = ({ state: e, dispatch: t }) => wn(e, t, !1), En = ({ state: e, dispatch
1218
718
  userEvent: "delete.line"
1219
719
  }), !0;
1220
720
  };
1221
- function On(e, t) {
721
+ function tn(e, t) {
1222
722
  if (/\(\)|\[\]|\{\}/.test(e.sliceDoc(t - 1, t + 1))) return {
1223
723
  from: t,
1224
724
  to: t
1225
725
  };
1226
- let n = o(e).resolveInner(t), r = n.childBefore(t), i = n.childAfter(t), a;
1227
- return r && i && r.to <= t && i.from >= t && (a = r.type.prop(_.closedBy)) && a.indexOf(i.name) > -1 && e.doc.lineAt(r.to).from == e.doc.lineAt(i.from).from && !/\S/.test(e.sliceDoc(r.to, i.from)) ? {
726
+ let n = c(e).resolveInner(t), r = n.childBefore(t), i = n.childAfter(t), a;
727
+ return r && i && r.to <= t && i.from >= t && (a = r.type.prop(p.closedBy)) && a.indexOf(i.name) > -1 && e.doc.lineAt(r.to).from == e.doc.lineAt(i.from).from && !/\S/.test(e.sliceDoc(r.to, i.from)) ? {
1228
728
  from: r.to,
1229
729
  to: i.from
1230
730
  } : null;
1231
731
  }
1232
- var kn = /*@__PURE__*/ jn(!1), An = /*@__PURE__*/ jn(!0);
1233
- function jn(t) {
1234
- return ({ state: r, dispatch: i }) => {
1235
- if (r.readOnly) return !1;
1236
- let a = r.changeByRange((i) => {
1237
- let { from: a, to: o } = i, s = r.doc.lineAt(a), c = !t && a == o && On(r, a);
1238
- t && (a = o = (o <= s.to ? s : r.doc.lineAt(o)).to);
1239
- let d = new ce(r, {
1240
- simulateBreak: a,
732
+ var nn = /*@__PURE__*/ an(!1), rn = /*@__PURE__*/ an(!0);
733
+ function an(e) {
734
+ return ({ state: n, dispatch: r }) => {
735
+ if (n.readOnly) return !1;
736
+ let i = n.changeByRange((r) => {
737
+ let { from: i, to: o } = r, s = n.doc.lineAt(i), c = !e && i == o && tn(n, i);
738
+ e && (i = o = (o <= s.to ? s : n.doc.lineAt(o)).to);
739
+ let l = new se(n, {
740
+ simulateBreak: i,
1241
741
  simulateDoubleBreak: !!c
1242
- }), f = n(d, a);
1243
- for (f ??= l(/^\s*/.exec(r.doc.lineAt(a).text)[0], r.tabSize); o < s.to && /\s/.test(s.text[o - s.from]);) o++;
1244
- c ? {from: a, to: o} = c : a > s.from && a < s.from + 100 && !/\S/.test(s.text.slice(0, a)) && (a = s.from);
1245
- let p = ["", e(r, f)];
1246
- return c && p.push(e(r, d.lineIndent(s.from, -1))), {
742
+ }), f = t(l, i);
743
+ for (f ??= u(/^\s*/.exec(n.doc.lineAt(i).text)[0], n.tabSize); o < s.to && /\s/.test(s.text[o - s.from]);) o++;
744
+ c ? {from: i, to: o} = c : i > s.from && i < s.from + 100 && !/\S/.test(s.text.slice(0, i)) && (i = s.from);
745
+ let p = ["", a(n, f)];
746
+ return c && p.push(a(n, l.lineIndent(s.from, -1))), {
1247
747
  changes: {
1248
- from: a,
748
+ from: i,
1249
749
  to: o,
1250
- insert: u.of(p)
750
+ insert: d.of(p)
1251
751
  },
1252
- range: h.cursor(a + 1 + p[1].length)
752
+ range: y.cursor(i + 1 + p[1].length)
1253
753
  };
1254
754
  });
1255
- return i(r.update(a, {
755
+ return r(n.update(i, {
1256
756
  scrollIntoView: !0,
1257
757
  userEvent: "input"
1258
758
  })), !0;
1259
759
  };
1260
760
  }
1261
- function $(e, t) {
761
+ function G(e, t) {
1262
762
  let n = -1;
1263
763
  return e.changeByRange((r) => {
1264
764
  let i = [];
@@ -1269,347 +769,866 @@ function $(e, t) {
1269
769
  let a = e.changes(i);
1270
770
  return {
1271
771
  changes: i,
1272
- range: h.range(a.mapPos(r.anchor, 1), a.mapPos(r.head, 1))
772
+ range: y.range(a.mapPos(r.anchor, 1), a.mapPos(r.head, 1))
1273
773
  };
1274
774
  });
1275
775
  }
1276
- var Mn = ({ state: t, dispatch: r }) => {
1277
- if (t.readOnly) return !1;
1278
- let i = Object.create(null), a = new ce(t, { overrideIndentation: (e) => i[e] ?? -1 }), o = $(t, (r, o, s) => {
1279
- let c = n(a, r.from);
776
+ var on = ({ state: e, dispatch: n }) => {
777
+ if (e.readOnly) return !1;
778
+ let r = Object.create(null), i = new se(e, { overrideIndentation: (e) => r[e] ?? -1 }), o = G(e, (n, o, s) => {
779
+ let c = t(i, n.from);
1280
780
  if (c == null) return;
1281
- /\S/.test(r.text) || (c = 0);
1282
- let l = /^\s*/.exec(r.text)[0], u = e(t, c);
1283
- (l != u || s.from < r.from + l.length) && (i[r.from] = c, o.push({
1284
- from: r.from,
1285
- to: r.from + l.length,
781
+ /\S/.test(n.text) || (c = 0);
782
+ let l = /^\s*/.exec(n.text)[0], u = a(e, c);
783
+ (l != u || s.from < n.from + l.length) && (r[n.from] = c, o.push({
784
+ from: n.from,
785
+ to: n.from + l.length,
1286
786
  insert: u
1287
787
  }));
1288
788
  });
1289
- return o.changes.empty || r(t.update(o, { userEvent: "indent" })), !0;
1290
- }, Nn = ({ state: e, dispatch: t }) => !e.readOnly && (t(e.update($(e, (t, n) => {
789
+ return o.changes.empty || n(e.update(o, { userEvent: "indent" })), !0;
790
+ }, K = ({ state: e, dispatch: t }) => !e.readOnly && (t(e.update(G(e, (t, n) => {
1291
791
  n.push({
1292
792
  from: t.from,
1293
- insert: e.facet(ie)
793
+ insert: e.facet(r)
1294
794
  });
1295
- }), { userEvent: "input.indent" })), !0), Pn = ({ state: t, dispatch: n }) => !t.readOnly && (n(t.update($(t, (n, r) => {
1296
- let a = /^\s*/.exec(n.text)[0];
1297
- if (!a) return;
1298
- let o = l(a, t.tabSize), s = 0, c = e(t, Math.max(0, o - i(t)));
1299
- for (; s < a.length && s < c.length && a.charCodeAt(s) == c.charCodeAt(s);) s++;
1300
- r.push({
1301
- from: n.from + s,
1302
- to: n.from + a.length,
1303
- insert: c.slice(s)
795
+ }), { userEvent: "input.indent" })), !0), sn = ({ state: e, dispatch: t }) => !e.readOnly && (t(e.update(G(e, (t, n) => {
796
+ let r = /^\s*/.exec(t.text)[0];
797
+ if (!r) return;
798
+ let i = u(r, e.tabSize), o = 0, s = a(e, Math.max(0, i - m(e)));
799
+ for (; o < r.length && o < s.length && r.charCodeAt(o) == s.charCodeAt(o);) o++;
800
+ n.push({
801
+ from: t.from + o,
802
+ to: t.from + r.length,
803
+ insert: s.slice(o)
1304
804
  });
1305
- }), { userEvent: "delete.dedent" })), !0), Fn = (e) => (e.setTabFocusMode(), !0), In = ({ state: e, dispatch: t }) => e.selection.ranges.some((e) => !e.empty) ? Nn({
805
+ }), { userEvent: "delete.dedent" })), !0), cn = (e) => (e.setTabFocusMode(), !0), ln = ({ state: e, dispatch: t }) => e.selection.ranges.some((e) => !e.empty) ? K({
1306
806
  state: e,
1307
807
  dispatch: t
1308
808
  }) : (t(e.update(e.replaceSelection(" "), {
1309
809
  scrollIntoView: !0,
1310
810
  userEvent: "input"
1311
- })), !0), Ln = [
811
+ })), !0), un = [
1312
812
  {
1313
813
  key: "Ctrl-b",
1314
- run: dt,
1315
- shift: Pt,
814
+ run: ze,
815
+ shift: ct,
1316
816
  preventDefault: !0
1317
817
  },
1318
818
  {
1319
819
  key: "Ctrl-f",
1320
- run: ft,
1321
- shift: Ft
820
+ run: Be,
821
+ shift: lt
1322
822
  },
1323
823
  {
1324
824
  key: "Ctrl-p",
1325
- run: bt,
1326
- shift: Ht
825
+ run: Je,
826
+ shift: gt
1327
827
  },
1328
828
  {
1329
829
  key: "Ctrl-n",
1330
- run: xt,
1331
- shift: Ut
830
+ run: Ye,
831
+ shift: _t
1332
832
  },
1333
833
  {
1334
834
  key: "Ctrl-a",
1335
- run: kt,
1336
- shift: Zt
835
+ run: rt,
836
+ shift: Tt
1337
837
  },
1338
838
  {
1339
839
  key: "Ctrl-e",
1340
- run: At,
1341
- shift: Qt
840
+ run: it,
841
+ shift: Et
1342
842
  },
1343
843
  {
1344
844
  key: "Ctrl-d",
1345
- run: fn
845
+ run: zt
1346
846
  },
1347
847
  {
1348
848
  key: "Ctrl-h",
1349
- run: Z
849
+ run: U
1350
850
  },
1351
851
  {
1352
852
  key: "Ctrl-k",
1353
- run: gn
853
+ run: Ut
1354
854
  },
1355
855
  {
1356
856
  key: "Ctrl-Alt-h",
1357
- run: mn
857
+ run: Vt
1358
858
  },
1359
859
  {
1360
860
  key: "Ctrl-o",
1361
- run: yn
861
+ run: Kt
1362
862
  },
1363
863
  {
1364
864
  key: "Ctrl-t",
1365
- run: bn
865
+ run: qt
1366
866
  },
1367
867
  {
1368
868
  key: "Ctrl-v",
1369
- run: K
869
+ run: R
1370
870
  }
1371
- ], Rn = /*@__PURE__*/ [
871
+ ], dn = /*@__PURE__*/ [
1372
872
  {
1373
873
  key: "ArrowLeft",
1374
- run: dt,
1375
- shift: Pt,
874
+ run: ze,
875
+ shift: ct,
1376
876
  preventDefault: !0
1377
877
  },
1378
878
  {
1379
879
  key: "Mod-ArrowLeft",
1380
880
  mac: "Alt-ArrowLeft",
1381
- run: mt,
1382
- shift: Lt,
881
+ run: He,
882
+ shift: dt,
1383
883
  preventDefault: !0
1384
884
  },
1385
885
  {
1386
886
  mac: "Cmd-ArrowLeft",
1387
- run: Dt,
1388
- shift: Yt,
887
+ run: tt,
888
+ shift: Ct,
1389
889
  preventDefault: !0
1390
890
  },
1391
891
  {
1392
892
  key: "ArrowRight",
1393
- run: ft,
1394
- shift: Ft,
893
+ run: Be,
894
+ shift: lt,
1395
895
  preventDefault: !0
1396
896
  },
1397
897
  {
1398
898
  key: "Mod-ArrowRight",
1399
899
  mac: "Alt-ArrowRight",
1400
- run: ht,
1401
- shift: Rt,
900
+ run: Ue,
901
+ shift: ft,
1402
902
  preventDefault: !0
1403
903
  },
1404
904
  {
1405
905
  mac: "Cmd-ArrowRight",
1406
- run: Ot,
1407
- shift: Xt,
906
+ run: nt,
907
+ shift: wt,
1408
908
  preventDefault: !0
1409
909
  },
1410
910
  {
1411
911
  key: "ArrowUp",
1412
- run: bt,
1413
- shift: Ht,
912
+ run: Je,
913
+ shift: gt,
1414
914
  preventDefault: !0
1415
915
  },
1416
916
  {
1417
917
  mac: "Cmd-ArrowUp",
1418
- run: $t,
1419
- shift: tn
918
+ run: Dt,
919
+ shift: kt
1420
920
  },
1421
921
  {
1422
922
  mac: "Ctrl-ArrowUp",
1423
- run: wt,
1424
- shift: Gt
923
+ run: Qe,
924
+ shift: yt
1425
925
  },
1426
926
  {
1427
927
  key: "ArrowDown",
1428
- run: xt,
1429
- shift: Ut,
928
+ run: Ye,
929
+ shift: _t,
1430
930
  preventDefault: !0
1431
931
  },
1432
932
  {
1433
933
  mac: "Cmd-ArrowDown",
1434
- run: en,
1435
- shift: nn
934
+ run: Ot,
935
+ shift: At
1436
936
  },
1437
937
  {
1438
938
  mac: "Ctrl-ArrowDown",
1439
- run: K,
1440
- shift: Kt
939
+ run: R,
940
+ shift: bt
1441
941
  },
1442
942
  {
1443
943
  key: "PageUp",
1444
- run: wt,
1445
- shift: Gt
944
+ run: Qe,
945
+ shift: yt
1446
946
  },
1447
947
  {
1448
948
  key: "PageDown",
1449
- run: K,
1450
- shift: Kt
949
+ run: R,
950
+ shift: bt
1451
951
  },
1452
952
  {
1453
953
  key: "Home",
1454
- run: Et,
1455
- shift: Jt,
954
+ run: et,
955
+ shift: St,
1456
956
  preventDefault: !0
1457
957
  },
1458
958
  {
1459
959
  key: "Mod-Home",
1460
- run: $t,
1461
- shift: tn
960
+ run: Dt,
961
+ shift: kt
1462
962
  },
1463
963
  {
1464
964
  key: "End",
1465
- run: Tt,
1466
- shift: qt,
965
+ run: $e,
966
+ shift: xt,
1467
967
  preventDefault: !0
1468
968
  },
1469
969
  {
1470
970
  key: "Mod-End",
1471
- run: en,
1472
- shift: nn
971
+ run: Ot,
972
+ shift: At
1473
973
  },
1474
974
  {
1475
975
  key: "Enter",
1476
- run: kn,
1477
- shift: kn
976
+ run: nn,
977
+ shift: nn
1478
978
  },
1479
979
  {
1480
980
  key: "Mod-a",
1481
- run: rn
981
+ run: jt
1482
982
  },
1483
983
  {
1484
984
  key: "Backspace",
1485
- run: Z,
1486
- shift: Z,
985
+ run: U,
986
+ shift: U,
1487
987
  preventDefault: !0
1488
988
  },
1489
989
  {
1490
990
  key: "Delete",
1491
- run: fn,
991
+ run: zt,
1492
992
  preventDefault: !0
1493
993
  },
1494
994
  {
1495
995
  key: "Mod-Backspace",
1496
996
  mac: "Alt-Backspace",
1497
- run: mn,
997
+ run: Vt,
1498
998
  preventDefault: !0
1499
999
  },
1500
1000
  {
1501
1001
  key: "Mod-Delete",
1502
1002
  mac: "Alt-Delete",
1503
- run: hn,
1003
+ run: Ht,
1504
1004
  preventDefault: !0
1505
1005
  },
1506
1006
  {
1507
1007
  mac: "Mod-Backspace",
1508
- run: _n,
1008
+ run: Wt,
1509
1009
  preventDefault: !0
1510
1010
  },
1511
1011
  {
1512
1012
  mac: "Mod-Delete",
1513
- run: vn,
1013
+ run: Gt,
1514
1014
  preventDefault: !0
1515
1015
  }
1516
- ].concat(/*@__PURE__*/ Ln.map((e) => ({
1016
+ ].concat(/*@__PURE__*/ un.map((e) => ({
1517
1017
  mac: e.key,
1518
1018
  run: e.run,
1519
1019
  shift: e.shift
1520
- }))), zn = /*@__PURE__*/ [
1020
+ }))), fn = /*@__PURE__*/ [
1521
1021
  {
1522
1022
  key: "Alt-ArrowLeft",
1523
1023
  mac: "Ctrl-ArrowLeft",
1524
- run: _t,
1525
- shift: zt
1024
+ run: Ge,
1025
+ shift: pt
1526
1026
  },
1527
1027
  {
1528
1028
  key: "Alt-ArrowRight",
1529
1029
  mac: "Ctrl-ArrowRight",
1530
- run: vt,
1531
- shift: Bt
1030
+ run: Ke,
1031
+ shift: mt
1532
1032
  },
1533
1033
  {
1534
1034
  key: "Alt-ArrowUp",
1535
- run: Sn
1035
+ run: Yt
1536
1036
  },
1537
1037
  {
1538
1038
  key: "Shift-Alt-ArrowUp",
1539
- run: Tn
1039
+ run: Qt
1540
1040
  },
1541
1041
  {
1542
1042
  key: "Alt-ArrowDown",
1543
- run: Cn
1043
+ run: Xt
1544
1044
  },
1545
1045
  {
1546
1046
  key: "Shift-Alt-ArrowDown",
1547
- run: En
1047
+ run: $t
1548
1048
  },
1549
1049
  {
1550
1050
  key: "Mod-Alt-ArrowUp",
1551
- run: cn
1051
+ run: Ft
1552
1052
  },
1553
1053
  {
1554
1054
  key: "Mod-Alt-ArrowDown",
1555
- run: ln
1055
+ run: It
1556
1056
  },
1557
1057
  {
1558
1058
  key: "Escape",
1559
- run: un
1059
+ run: Lt
1560
1060
  },
1561
1061
  {
1562
1062
  key: "Mod-Enter",
1563
- run: An
1063
+ run: rn
1564
1064
  },
1565
1065
  {
1566
1066
  key: "Alt-l",
1567
1067
  mac: "Ctrl-l",
1568
- run: an
1068
+ run: Mt
1569
1069
  },
1570
1070
  {
1571
1071
  key: "Mod-i",
1572
- run: on,
1072
+ run: Nt,
1573
1073
  preventDefault: !0
1574
1074
  },
1575
1075
  {
1576
1076
  key: "Mod-[",
1577
- run: Pn
1077
+ run: sn
1578
1078
  },
1579
1079
  {
1580
1080
  key: "Mod-]",
1581
- run: Nn
1081
+ run: K
1582
1082
  },
1583
1083
  {
1584
1084
  key: "Mod-Alt-\\",
1585
- run: Mn
1085
+ run: on
1586
1086
  },
1587
1087
  {
1588
1088
  key: "Shift-Mod-k",
1589
- run: Dn
1089
+ run: en
1590
1090
  },
1591
1091
  {
1592
1092
  key: "Shift-Mod-\\",
1593
- run: Mt
1093
+ run: ot
1594
1094
  },
1595
1095
  {
1596
1096
  key: "Mod-/",
1597
- run: ze
1097
+ run: fe
1598
1098
  },
1599
1099
  {
1600
1100
  key: "Alt-A",
1601
1101
  mac: "Ctrl-A",
1602
- run: Ve
1102
+ run: me
1603
1103
  },
1604
1104
  {
1605
1105
  key: "Ctrl-m",
1606
1106
  mac: "Shift-Alt-m",
1607
- run: Fn
1107
+ run: cn
1608
1108
  }
1609
- ].concat(Rn), Bn = {
1109
+ ].concat(dn), pn = {
1610
1110
  key: "Tab",
1611
- run: Nn,
1612
- shift: Pn
1613
- };
1111
+ run: K,
1112
+ shift: sn
1113
+ }, mn = class {
1114
+ constructor(e, t, n) {
1115
+ this.from = e, this.to = t, this.diagnostic = n;
1116
+ }
1117
+ }, q = class e {
1118
+ constructor(e, t, n) {
1119
+ this.diagnostics = e, this.panel = t, this.selected = n;
1120
+ }
1121
+ static init(t, n, r) {
1122
+ let i = r.facet(Q).markerFilter;
1123
+ i && (t = i(t, r));
1124
+ let a = t.slice().sort((e, t) => e.from - t.from || e.to - t.to), o = new de(), s = [], c = 0, l = r.doc.iter(), u = 0, d = r.doc.length;
1125
+ for (let e = 0;;) {
1126
+ let t = e == a.length ? null : a[e];
1127
+ if (!t && !s.length) break;
1128
+ let n, r;
1129
+ if (s.length) n = c, r = s.reduce((e, t) => Math.min(e, t.to), t && t.from > n ? t.from : 1e8);
1130
+ else {
1131
+ if (n = t.from, n > d) break;
1132
+ r = t.to, s.push(t), e++;
1133
+ }
1134
+ for (; e < a.length;) {
1135
+ let t = a[e];
1136
+ if (t.from == n && (t.to > t.from || t.to == n)) s.push(t), e++, r = Math.min(t.to, r);
1137
+ else {
1138
+ r = Math.min(t.from, r);
1139
+ break;
1140
+ }
1141
+ }
1142
+ r = Math.min(r, d);
1143
+ let i = !1;
1144
+ if (s.some((e) => e.from == n && (e.to == r || r == d)) && (i = n == r, !i && r - n < 10)) {
1145
+ let e = n - (u + l.value.length);
1146
+ e > 0 && (l.next(e), u = n);
1147
+ for (let e = n;;) {
1148
+ if (e >= r) {
1149
+ i = !0;
1150
+ break;
1151
+ }
1152
+ if (!l.lineBreak && u + l.value.length > e) break;
1153
+ e = u + l.value.length, u += l.value.length, l.next();
1154
+ }
1155
+ }
1156
+ let f = Ln(s);
1157
+ if (i) o.add(n, n, b.widget({
1158
+ widget: new jn(f),
1159
+ diagnostics: s.slice()
1160
+ }));
1161
+ else {
1162
+ let e = s.reduce((e, t) => t.markClass ? e + " " + t.markClass : e, "");
1163
+ o.add(n, r, b.mark({
1164
+ class: "cm-lintRange cm-lintRange-" + f + e,
1165
+ diagnostics: s.slice(),
1166
+ inclusiveEnd: s.some((e) => e.to > r)
1167
+ }));
1168
+ }
1169
+ if (c = r, c == d) break;
1170
+ for (let e = 0; e < s.length; e++) s[e].to <= c && s.splice(e--, 1);
1171
+ }
1172
+ let f = o.finish();
1173
+ return new e(f, n, J(f));
1174
+ }
1175
+ };
1176
+ function J(e, t = null, n = 0) {
1177
+ let r = null;
1178
+ return e.between(n, 1e9, (e, n, { spec: i }) => {
1179
+ if (!(t && i.diagnostics.indexOf(t) < 0)) {
1180
+ if (!r) r = new mn(e, n, t || i.diagnostics[0]);
1181
+ else if (i.diagnostics.indexOf(r.diagnostic) < 0) return !1;
1182
+ else r = new mn(r.from, n, r.diagnostic);
1183
+ }
1184
+ }), r;
1185
+ }
1186
+ function hn(e, t) {
1187
+ let n = t.pos, r = t.end || n, i = e.state.facet(Q).hideOn(e, n, r);
1188
+ if (i != null) return i;
1189
+ let a = e.startState.doc.lineAt(t.pos);
1190
+ return !!(e.effects.some((e) => e.is(Y)) || e.changes.touchesRange(a.from, Math.max(a.to, r)));
1191
+ }
1192
+ function gn(e, t) {
1193
+ return e.field(Z, !1) ? t : t.concat(o.appendConfig.of(zn));
1194
+ }
1195
+ function _n(e, t) {
1196
+ return { effects: gn(e, [Y.of(t)]) };
1197
+ }
1198
+ var Y = /*@__PURE__*/ o.define(), X = /*@__PURE__*/ o.define(), vn = /*@__PURE__*/ o.define(), Z = /*@__PURE__*/ i.define({
1199
+ create() {
1200
+ return new q(b.none, null, null);
1201
+ },
1202
+ update(e, t) {
1203
+ if (t.docChanged && e.diagnostics.size) {
1204
+ let n = e.diagnostics.map(t.changes), r = null, i = e.panel;
1205
+ if (e.selected) {
1206
+ let i = t.changes.mapPos(e.selected.from, 1);
1207
+ r = J(n, e.selected.diagnostic, i) || J(n, null, i);
1208
+ }
1209
+ !n.size && i && t.state.facet(Q).autoPanel && (i = null), e = new q(n, i, r);
1210
+ }
1211
+ for (let n of t.effects) if (n.is(Y)) {
1212
+ let r = t.state.facet(Q).autoPanel ? n.value.length ? Nn.open : null : e.panel;
1213
+ e = q.init(n.value, r, t.state);
1214
+ } else n.is(X) ? e = new q(e.diagnostics, n.value ? Nn.open : null, e.selected) : n.is(vn) && (e = new q(e.diagnostics, e.panel, n.value));
1215
+ return e;
1216
+ },
1217
+ provide: (e) => [ue.from(e, (e) => e.panel), h.decorations.from(e, (e) => e.diagnostics)]
1218
+ }), yn = /*@__PURE__*/ b.mark({ class: "cm-lintRange cm-lintRange-active" });
1219
+ function bn(e, t, n) {
1220
+ let { diagnostics: r } = e.state.field(Z), i, a = -1, o = -1;
1221
+ r.between(t - +(n < 0), t + +(n > 0), (e, r, { spec: s }) => {
1222
+ if (t >= e && t <= r && (e == r || (t > e || n > 0) && (t < r || n < 0))) return i = s.diagnostics, a = e, o = r, !1;
1223
+ });
1224
+ let s = e.state.facet(Q).tooltipFilter;
1225
+ return i && s && (i = s(i, e.state)), i ? {
1226
+ pos: a,
1227
+ end: o,
1228
+ above: !0,
1229
+ create() {
1230
+ return { dom: xn(e, i) };
1231
+ }
1232
+ } : null;
1233
+ }
1234
+ function xn(e, t) {
1235
+ return _("ul", { class: "cm-tooltip-lint" }, t.map((t) => An(e, t, !1)));
1236
+ }
1237
+ var Sn = (e) => {
1238
+ let t = e.state.field(Z, !1);
1239
+ (!t || !t.panel) && e.dispatch({ effects: gn(e.state, [X.of(!0)]) });
1240
+ let n = ne(e, Nn.open);
1241
+ return n && n.dom.querySelector(".cm-panel-lint ul").focus(), !0;
1242
+ }, Cn = (e) => {
1243
+ let t = e.state.field(Z, !1);
1244
+ return !t || !t.panel ? !1 : (e.dispatch({ effects: X.of(!1) }), !0);
1245
+ }, wn = [{
1246
+ key: "Mod-Shift-m",
1247
+ run: Sn,
1248
+ preventDefault: !0
1249
+ }, {
1250
+ key: "F8",
1251
+ run: (e) => {
1252
+ let t = e.state.field(Z, !1);
1253
+ if (!t) return !1;
1254
+ let n = e.state.selection.main, r = J(t.diagnostics, null, n.to + 1);
1255
+ return !r && (r = J(t.diagnostics, null, 0), !r || r.from == n.from && r.to == n.to) ? !1 : (e.dispatch({
1256
+ selection: {
1257
+ anchor: r.from,
1258
+ head: r.to
1259
+ },
1260
+ scrollIntoView: !0
1261
+ }), s(e, r.from, 1, {
1262
+ tooltip: Rn,
1263
+ until: (e) => e.docChanged || e.newSelection.main.head < r.from || e.newSelection.main.head > r.to
1264
+ }), !0);
1265
+ }
1266
+ }], Tn = /*@__PURE__*/ ee.fromClass(class {
1267
+ constructor(e) {
1268
+ this.view = e, this.timeout = -1, this.set = !0;
1269
+ let { delay: t } = e.state.facet(Q);
1270
+ this.lintTime = Date.now() + t, this.run = this.run.bind(this), this.timeout = setTimeout(this.run, t);
1271
+ }
1272
+ run() {
1273
+ clearTimeout(this.timeout);
1274
+ let e = Date.now();
1275
+ if (e < this.lintTime - 10) this.timeout = setTimeout(this.run, this.lintTime - e);
1276
+ else {
1277
+ this.set = !1;
1278
+ let { state: e } = this.view, { sources: t } = e.facet(Q);
1279
+ t.length && En(t.map((e) => Promise.resolve(e(this.view))), (t) => {
1280
+ this.view.state.doc == e.doc && this.view.dispatch(_n(this.view.state, t.reduce((e, t) => e.concat(t))));
1281
+ }, (e) => {
1282
+ re(this.view.state, e);
1283
+ });
1284
+ }
1285
+ }
1286
+ update(e) {
1287
+ let t = e.state.facet(Q);
1288
+ (e.docChanged || t != e.startState.facet(Q) || t.needsRefresh && t.needsRefresh(e)) && (this.lintTime = Date.now() + t.delay, this.set || (this.set = !0, this.timeout = setTimeout(this.run, t.delay)));
1289
+ }
1290
+ force() {
1291
+ this.set && (this.lintTime = Date.now(), this.run());
1292
+ }
1293
+ destroy() {
1294
+ clearTimeout(this.timeout);
1295
+ }
1296
+ });
1297
+ function En(e, t, n) {
1298
+ let r = [], i = -1;
1299
+ for (let a of e) a.then((n) => {
1300
+ r.push(n), clearTimeout(i), r.length == e.length ? t(r) : i = setTimeout(() => t(r), 200);
1301
+ }, n);
1302
+ }
1303
+ var Q = /*@__PURE__*/ g.define({ combine(e) {
1304
+ return {
1305
+ sources: e.map((e) => e.source).filter((e) => e != null),
1306
+ ...l(e.map((e) => e.config), {
1307
+ delay: 750,
1308
+ markerFilter: null,
1309
+ tooltipFilter: null,
1310
+ needsRefresh: null,
1311
+ hideOn: () => null
1312
+ }, {
1313
+ delay: Math.max,
1314
+ markerFilter: Dn,
1315
+ tooltipFilter: Dn,
1316
+ needsRefresh: (e, t) => e ? t ? (n) => e(n) || t(n) : e : t,
1317
+ hideOn: (e, t) => e ? t ? (n, r, i) => e(n, r, i) || t(n, r, i) : e : t,
1318
+ autoPanel: (e, t) => e || t
1319
+ })
1320
+ };
1321
+ } });
1322
+ function Dn(e, t) {
1323
+ return e ? t ? (n, r) => t(e(n, r), r) : e : t;
1324
+ }
1325
+ function On(e, t = {}) {
1326
+ return [
1327
+ Q.of({
1328
+ source: e,
1329
+ config: t
1330
+ }),
1331
+ Tn,
1332
+ zn
1333
+ ];
1334
+ }
1335
+ function kn(e) {
1336
+ let t = [];
1337
+ if (e) actions: for (let { name: n } of e) {
1338
+ for (let e = 0; e < n.length; e++) {
1339
+ let r = n[e];
1340
+ if (/[a-zA-Z]/.test(r) && !t.some((e) => e.toLowerCase() == r.toLowerCase())) {
1341
+ t.push(r);
1342
+ continue actions;
1343
+ }
1344
+ }
1345
+ t.push("");
1346
+ }
1347
+ return t;
1348
+ }
1349
+ function An(e, t, n) {
1350
+ let r = n ? kn(t.actions) : [];
1351
+ return _("li", { class: "cm-diagnostic cm-diagnostic-" + t.severity }, _("span", { class: "cm-diagnosticText" }, t.renderMessage ? t.renderMessage(e) : t.message), t.actions?.map((n, i) => {
1352
+ let a = !1, o = (r) => {
1353
+ if (r.preventDefault(), a) return;
1354
+ a = !0;
1355
+ let i = J(e.state.field(Z).diagnostics, t);
1356
+ i && n.apply(e, i.from, i.to);
1357
+ }, { name: s } = n, c = r[i] ? s.indexOf(r[i]) : -1, l = c < 0 ? s : [
1358
+ s.slice(0, c),
1359
+ _("u", s.slice(c, c + 1)),
1360
+ s.slice(c + 1)
1361
+ ], u = n.markClass ? " " + n.markClass : "";
1362
+ return _("button", {
1363
+ type: "button",
1364
+ class: "cm-diagnosticAction" + u,
1365
+ onclick: o,
1366
+ onmousedown: o,
1367
+ "aria-label": ` Action: ${s}${c < 0 ? "" : ` (access key "${r[i]})"`}.`
1368
+ }, l);
1369
+ }), t.source && _("div", { class: "cm-diagnosticSource" }, t.source));
1370
+ }
1371
+ var jn = class extends te {
1372
+ constructor(e) {
1373
+ super(), this.sev = e;
1374
+ }
1375
+ eq(e) {
1376
+ return e.sev == this.sev;
1377
+ }
1378
+ toDOM() {
1379
+ return _("span", { class: "cm-lintPoint cm-lintPoint-" + this.sev });
1380
+ }
1381
+ }, Mn = class {
1382
+ constructor(e, t) {
1383
+ this.diagnostic = t, this.id = "item_" + Math.floor(Math.random() * 4294967295).toString(16), this.dom = An(e, t, !0), this.dom.id = this.id, this.dom.setAttribute("role", "option");
1384
+ }
1385
+ }, Nn = class e {
1386
+ constructor(e) {
1387
+ this.view = e, this.items = [];
1388
+ let t = (t) => {
1389
+ if (!(t.ctrlKey || t.altKey || t.metaKey)) {
1390
+ if (t.keyCode == 27) Cn(this.view), this.view.focus();
1391
+ else if (t.keyCode == 38 || t.keyCode == 33) this.moveSelection((this.selectedIndex - 1 + this.items.length) % this.items.length);
1392
+ else if (t.keyCode == 40 || t.keyCode == 34) this.moveSelection((this.selectedIndex + 1) % this.items.length);
1393
+ else if (t.keyCode == 36) this.moveSelection(0);
1394
+ else if (t.keyCode == 35) this.moveSelection(this.items.length - 1);
1395
+ else if (t.keyCode == 13) this.view.focus();
1396
+ else if (t.keyCode >= 65 && t.keyCode <= 90 && this.selectedIndex >= 0) {
1397
+ let { diagnostic: n } = this.items[this.selectedIndex], r = kn(n.actions);
1398
+ for (let i = 0; i < r.length; i++) if (r[i].toUpperCase().charCodeAt(0) == t.keyCode) {
1399
+ let t = J(this.view.state.field(Z).diagnostics, n);
1400
+ t && n.actions[i].apply(e, t.from, t.to);
1401
+ }
1402
+ } else return;
1403
+ t.preventDefault();
1404
+ }
1405
+ }, n = (e) => {
1406
+ for (let t = 0; t < this.items.length; t++) this.items[t].dom.contains(e.target) && this.moveSelection(t);
1407
+ };
1408
+ this.list = _("ul", {
1409
+ tabIndex: 0,
1410
+ role: "listbox",
1411
+ "aria-label": this.view.state.phrase("Diagnostics"),
1412
+ onkeydown: t,
1413
+ onclick: n
1414
+ }), this.dom = _("div", { class: "cm-panel-lint" }, this.list, _("button", {
1415
+ type: "button",
1416
+ name: "close",
1417
+ "aria-label": this.view.state.phrase("close"),
1418
+ onclick: () => Cn(this.view)
1419
+ }, "×")), this.update();
1420
+ }
1421
+ get selectedIndex() {
1422
+ let e = this.view.state.field(Z).selected;
1423
+ if (!e) return -1;
1424
+ for (let t = 0; t < this.items.length; t++) if (this.items[t].diagnostic == e.diagnostic) return t;
1425
+ return -1;
1426
+ }
1427
+ update() {
1428
+ let { diagnostics: e, selected: t } = this.view.state.field(Z), n = 0, r = !1, i = null, a = /* @__PURE__ */ new Set();
1429
+ for (e.between(0, this.view.state.doc.length, (e, o, { spec: s }) => {
1430
+ for (let e of s.diagnostics) {
1431
+ if (a.has(e)) continue;
1432
+ a.add(e);
1433
+ let o = -1, s;
1434
+ for (let t = n; t < this.items.length; t++) if (this.items[t].diagnostic == e) {
1435
+ o = t;
1436
+ break;
1437
+ }
1438
+ o < 0 ? (s = new Mn(this.view, e), this.items.splice(n, 0, s), r = !0) : (s = this.items[o], o > n && (this.items.splice(n, o - n), r = !0)), t && s.diagnostic == t.diagnostic ? s.dom.hasAttribute("aria-selected") || (s.dom.setAttribute("aria-selected", "true"), i = s) : s.dom.hasAttribute("aria-selected") && s.dom.removeAttribute("aria-selected"), n++;
1439
+ }
1440
+ }); n < this.items.length && !(this.items.length == 1 && this.items[0].diagnostic.from < 0);) r = !0, this.items.pop();
1441
+ this.items.length == 0 && (this.items.push(new Mn(this.view, {
1442
+ from: -1,
1443
+ to: -1,
1444
+ severity: "info",
1445
+ message: this.view.state.phrase("No diagnostics")
1446
+ })), r = !0), i ? (this.list.setAttribute("aria-activedescendant", i.id), this.view.requestMeasure({
1447
+ key: this,
1448
+ read: () => ({
1449
+ sel: i.dom.getBoundingClientRect(),
1450
+ panel: this.list.getBoundingClientRect()
1451
+ }),
1452
+ write: ({ sel: e, panel: t }) => {
1453
+ let n = t.height / this.list.offsetHeight;
1454
+ e.top < t.top ? this.list.scrollTop -= (t.top - e.top) / n : e.bottom > t.bottom && (this.list.scrollTop += (e.bottom - t.bottom) / n);
1455
+ }
1456
+ })) : this.selectedIndex < 0 && this.list.removeAttribute("aria-activedescendant"), r && this.sync();
1457
+ }
1458
+ sync() {
1459
+ let e = this.list.firstChild;
1460
+ function t() {
1461
+ let t = e;
1462
+ e = t.nextSibling, t.remove();
1463
+ }
1464
+ for (let n of this.items) if (n.dom.parentNode == this.list) {
1465
+ for (; e != n.dom;) t();
1466
+ e = n.dom.nextSibling;
1467
+ } else this.list.insertBefore(n.dom, e);
1468
+ for (; e;) t();
1469
+ }
1470
+ moveSelection(e) {
1471
+ if (this.selectedIndex < 0) return;
1472
+ let t = J(this.view.state.field(Z).diagnostics, this.items[e].diagnostic);
1473
+ t && this.view.dispatch({
1474
+ selection: {
1475
+ anchor: t.from,
1476
+ head: t.to
1477
+ },
1478
+ scrollIntoView: !0,
1479
+ effects: vn.of(t)
1480
+ });
1481
+ }
1482
+ static open(t) {
1483
+ return new e(t);
1484
+ }
1485
+ };
1486
+ function Pn(e, t = "viewBox=\"0 0 40 40\"") {
1487
+ return `url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`;
1488
+ }
1489
+ function $(e) {
1490
+ return Pn(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`, "width=\"6\" height=\"3\"");
1491
+ }
1492
+ var Fn = /*@__PURE__*/ h.baseTheme({
1493
+ ".cm-diagnostic": {
1494
+ padding: "3px 6px 3px 8px",
1495
+ marginLeft: "-1px",
1496
+ display: "block",
1497
+ whiteSpace: "pre-wrap"
1498
+ },
1499
+ ".cm-diagnostic-error": { borderLeft: "5px solid #d11" },
1500
+ ".cm-diagnostic-warning": { borderLeft: "5px solid orange" },
1501
+ ".cm-diagnostic-info": { borderLeft: "5px solid #999" },
1502
+ ".cm-diagnostic-hint": { borderLeft: "5px solid #66d" },
1503
+ ".cm-diagnosticAction": {
1504
+ font: "inherit",
1505
+ border: "none",
1506
+ padding: "2px 4px",
1507
+ backgroundColor: "#444",
1508
+ color: "white",
1509
+ borderRadius: "3px",
1510
+ marginLeft: "8px",
1511
+ cursor: "pointer"
1512
+ },
1513
+ ".cm-diagnosticSource": {
1514
+ fontSize: "70%",
1515
+ opacity: .7
1516
+ },
1517
+ ".cm-lintRange": {
1518
+ backgroundPosition: "left bottom",
1519
+ backgroundRepeat: "repeat-x",
1520
+ paddingBottom: "0.7px"
1521
+ },
1522
+ ".cm-lintRange-error": { backgroundImage: /*@__PURE__*/ $("#f11") },
1523
+ ".cm-lintRange-warning": { backgroundImage: /*@__PURE__*/ $("orange") },
1524
+ ".cm-lintRange-info": { backgroundImage: /*@__PURE__*/ $("#999") },
1525
+ ".cm-lintRange-hint": { backgroundImage: /*@__PURE__*/ $("#66d") },
1526
+ ".cm-lintRange-active": { backgroundColor: "#ffdd9980" },
1527
+ ".cm-tooltip-lint": {
1528
+ padding: 0,
1529
+ margin: 0
1530
+ },
1531
+ ".cm-lintPoint": {
1532
+ position: "relative",
1533
+ "&:after": {
1534
+ content: "\"\"",
1535
+ position: "absolute",
1536
+ bottom: 0,
1537
+ left: "-2px",
1538
+ borderLeft: "3px solid transparent",
1539
+ borderRight: "3px solid transparent",
1540
+ borderBottom: "4px solid #d11"
1541
+ }
1542
+ },
1543
+ ".cm-lintPoint-warning": { "&:after": { borderBottomColor: "orange" } },
1544
+ ".cm-lintPoint-info": { "&:after": { borderBottomColor: "#999" } },
1545
+ ".cm-lintPoint-hint": { "&:after": { borderBottomColor: "#66d" } },
1546
+ ".cm-panel.cm-panel-lint": {
1547
+ position: "relative",
1548
+ "& ul": {
1549
+ maxHeight: "100px",
1550
+ overflowY: "auto",
1551
+ "& [aria-selected]": {
1552
+ backgroundColor: "#ddd",
1553
+ "& u": { textDecoration: "underline" }
1554
+ },
1555
+ "&:focus [aria-selected]": {
1556
+ background_fallback: "#bdf",
1557
+ backgroundColor: "Highlight",
1558
+ color_fallback: "white",
1559
+ color: "HighlightText"
1560
+ },
1561
+ "& u": { textDecoration: "none" },
1562
+ padding: 0,
1563
+ margin: 0
1564
+ },
1565
+ "& [name=close]": {
1566
+ position: "absolute",
1567
+ top: "0",
1568
+ right: "2px",
1569
+ background: "inherit",
1570
+ border: "none",
1571
+ font: "inherit",
1572
+ padding: 0,
1573
+ margin: 0
1574
+ }
1575
+ },
1576
+ "&dark .cm-lintRange-active": { backgroundColor: "#86714a80" },
1577
+ "&dark .cm-panel.cm-panel-lint ul": { "& [aria-selected]": { backgroundColor: "#2e343e" } }
1578
+ });
1579
+ function In(e) {
1580
+ return e == "error" ? 4 : e == "warning" ? 3 : e == "info" ? 2 : 1;
1581
+ }
1582
+ function Ln(e) {
1583
+ let t = "hint", n = 1;
1584
+ for (let r of e) {
1585
+ let e = In(r.severity);
1586
+ e > n && (n = e, t = r.severity);
1587
+ }
1588
+ return t;
1589
+ }
1590
+ var Rn = /*@__PURE__*/ ce(bn, { hideOn: hn }), zn = [
1591
+ Z,
1592
+ /*@__PURE__*/ h.decorations.compute([Z], (e) => {
1593
+ let { selected: t, panel: n } = e.field(Z);
1594
+ return !t || !n || t.from == t.to ? b.none : b.set([yn.range(t.from, t.to)]);
1595
+ }),
1596
+ Rn,
1597
+ Fn
1598
+ ];
1599
+ function Bn(e, t) {
1600
+ let r = e.field(Z, !1);
1601
+ if (r && r.diagnostics.size) {
1602
+ let e = [], i = [], a = -1;
1603
+ for (let o = n.iter([r.diagnostics]);; o.next()) {
1604
+ for (let n = 0; n < e.length; n++) (!o.value || o.value.spec.diagnostics.indexOf(e[n]) < 0) && (t(e[n], i[n], a), e.splice(n, 1), i.splice(n--, 1));
1605
+ if (!o.value) break;
1606
+ for (let t of o.value.spec.diagnostics) e.indexOf(t) < 0 && (e.push(t), i.push(o.from));
1607
+ a = o.to;
1608
+ }
1609
+ }
1610
+ }
1611
+ //#endregion
1612
+ //#region ../node_modules/.pnpm/@babel+runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/extends.js
1613
+ function Vn() {
1614
+ return Vn = Object.assign ? Object.assign.bind() : function(e) {
1615
+ for (var t = 1; t < arguments.length; t++) {
1616
+ var n = arguments[t];
1617
+ for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
1618
+ }
1619
+ return e;
1620
+ }, Vn.apply(null, arguments);
1621
+ }
1622
+ //#endregion
1623
+ //#region ../node_modules/.pnpm/@babel+runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
1624
+ function Hn(e, t) {
1625
+ if (e == null) return {};
1626
+ var n = {};
1627
+ for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
1628
+ if (t.indexOf(r) !== -1) continue;
1629
+ n[r] = e[r];
1630
+ }
1631
+ return n;
1632
+ }
1614
1633
  //#endregion
1615
- export { Bn as a, Ce as c, lt as i, De as l, Xe as n, In as o, Ze as r, Re as s, zn as t, ge as u };
1634
+ export { On as a, we as c, pn as d, ln as f, wn as i, Te as l, Vn as n, _n as o, Bn as r, fn as s, Hn as t, Le as u };