@abyss-project/commons-front-core 1.0.108 → 1.0.110

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 (149) hide show
  1. package/dist/components/Spotlight/InternalProjectCard/InternalProjectCard.component.d.ts +2 -2
  2. package/dist/components/Spotlight/ProjectCard/ProjectCard.component.d.ts +0 -1
  3. package/dist/hooks/use-rich-intl.hook.d.ts +6 -6
  4. package/dist/{index-x-wS80uU.js → index-13qJQSEL.js} +2 -2
  5. package/dist/{index-DgbjyLnz.js → index-9_tr_Bvo.js} +4 -4
  6. package/dist/{index-BF4-2neQ.js → index-BAU2w_gR.js} +51 -51
  7. package/dist/{index-BQhOMl9Z.js → index-BG2a87vL.js} +4 -4
  8. package/dist/{index-BAGULs-R.js → index-BGq_qqIm.js} +2 -2
  9. package/dist/{index-UhtzQEUo.js → index-BMGFj9gc.js} +10 -10
  10. package/dist/{index-B8fTDeWY.js → index-BP6XXhaw.js} +1 -1
  11. package/dist/{index-WL31BKiF.js → index-Br9_hdVE.js} +4 -4
  12. package/dist/index-C5nX2YsP.js +121812 -0
  13. package/dist/{index-DE3a_EYy.js → index-CCg3Uumy.js} +44 -44
  14. package/dist/{index-g5eihZUt.js → index-D1nKKAcT.js} +23 -23
  15. package/dist/{index-DAke9VoO.js → index-D73AgZIV.js} +2 -2
  16. package/dist/{index-iD8hyfuz.js → index-DGcHxV3u.js} +9 -9
  17. package/dist/{index-CsmsDnOu.js → index-DPiHM4DO.js} +2 -2
  18. package/dist/{index-vCJVca-f.js → index-DUVsHcbW.js} +3 -3
  19. package/dist/{index-DzsnPLjs.js → index-DymzJGKK.js} +2 -2
  20. package/dist/{index-BfwN0P_G.js → index-EooXtAwR.js} +3 -3
  21. package/dist/{index-Dw-1MZIy.js → index-R4U3cj34.js} +22 -22
  22. package/dist/{index-CTkDyBGW.js → index-hl87KN9D.js} +3 -3
  23. package/dist/{index-s1A0V9yr.js → index-kyTu6UbD.js} +11 -11
  24. package/dist/{index-DPUOnyML.js → index-lcQSie8w.js} +2 -2
  25. package/dist/{index-BcLvpaZu.js → index-pt5GUut7.js} +19 -19
  26. package/dist/index.js +62 -62
  27. package/dist/translations/en.d.ts +3 -3
  28. package/dist/translations/fr.d.ts +3 -3
  29. package/dist/{web-BuN85rHE.js → web-BkQriXG8.js} +1 -1
  30. package/package.json +1 -1
  31. package/dist/apl-B2DGVGxc-Dd6D39pP.js +0 -76
  32. package/dist/asciiarmor-2LVJmxlE-CAn4gnoC.js +0 -34
  33. package/dist/asn1-jKiBa2Ya-xsKwdyq9.js +0 -95
  34. package/dist/asterisk-DS281yxp-B5eTWk_B.js +0 -271
  35. package/dist/brainfuck-C_p9pTT8-DKVQ9poL.js +0 -34
  36. package/dist/clike-DGTaUp48-DkV8rRT_.js +0 -620
  37. package/dist/clojure-CCKyeQKf-N9sg777Z.js +0 -800
  38. package/dist/cmake-CuaCgAKt-BbEgXraO.js +0 -28
  39. package/dist/cobol-BlTKFDRj-CHCoWafp.js +0 -72
  40. package/dist/coffeescript-BVCvwO8I-Z15ai5ac.js +0 -179
  41. package/dist/commonlisp-D_kxz07b-Ce7sn14o.js +0 -75
  42. package/dist/crystal-D309uH6_-DS6LrXoE.js +0 -217
  43. package/dist/css-BkF-NPzE-DiJu9Nkd.js +0 -1553
  44. package/dist/cypher-BMq4Fwjl-Ml-omWgp.js +0 -68
  45. package/dist/d-BZcgY6La-KCW6-bIm.js +0 -127
  46. package/dist/diff-Cg9d_RX2-C01qBVFc.js +0 -18
  47. package/dist/dockerfile-DIy8NleC-zvrZVUI3.js +0 -194
  48. package/dist/dtd-CtLokQ-U-DCbNdeIA.js +0 -84
  49. package/dist/dylan-QYeExnWK-DIUVpsct.js +0 -234
  50. package/dist/ebnf-DUPDuY4r-7HIXKmWn.js +0 -78
  51. package/dist/ecl-CiXN-g_D-DOI-W0if.js +0 -121
  52. package/dist/eiffel-yQhjl4T1-DIX8Ceq1.js +0 -110
  53. package/dist/elm-CNT9vbN0-BcYlydpO.js +0 -108
  54. package/dist/erlang-CFOYdy9e-DULXsFZl.js +0 -487
  55. package/dist/factor-DDOC7X6P-a90yMx--.js +0 -65
  56. package/dist/fcl-CPC2WYrI-CuXG3fcK.js +0 -103
  57. package/dist/forth-BmxRyE9S-BcFwWpeL.js +0 -60
  58. package/dist/fortran-9bvPyrOW-CuLcq-Iu.js +0 -442
  59. package/dist/gas-cpmYfFX2-sZgGhMxB.js +0 -183
  60. package/dist/gherkin-CJuwpceU-BRrr8yjO.js +0 -34
  61. package/dist/groovy-DZeT_VM--CmF8wcSo.js +0 -146
  62. package/dist/haskell-Bvt3Qq1t-C11r0WKv.js +0 -375
  63. package/dist/haxe-70NVW1pR-CM27SfgM.js +0 -359
  64. package/dist/http-D9LttvKF-j9E8oQ7o.js +0 -44
  65. package/dist/idl-B6TRFYjl-B6TRFYjl.js +0 -947
  66. package/dist/index-B14RbiEn-SbE4_PjO.js +0 -1873
  67. package/dist/index-BA8yeGwv-EjfwM2RT.js +0 -94
  68. package/dist/index-BETrOVsk-BrPZref6.js +0 -1307
  69. package/dist/index-BQEFWHAK-BRj2FO4q.js +0 -289
  70. package/dist/index-BY78NlEG-CoZHdTvy.js +0 -270
  71. package/dist/index-BvOqbsN7-BIEquq7s.js +0 -301
  72. package/dist/index-C45OcgOF-BUF2A1Sy.js +0 -554
  73. package/dist/index-CBWuJrqZ-e0CLc0JQ.js +0 -552
  74. package/dist/index-CJM8jWOp-22a2l_xL.js +0 -74
  75. package/dist/index-CO7ezVmf-zOGvcbYD.js +0 -953
  76. package/dist/index-CR8BSxWs-CKlyuRa2.js +0 -309
  77. package/dist/index-CZW8-tYE.js +0 -242508
  78. package/dist/index-Cdko0XF5-CKVTXanF.js +0 -342
  79. package/dist/index-D7MUQuNp-ByqAp03Z.js +0 -251
  80. package/dist/index-DM9UpwmO-Ctutmn_p.js +0 -960
  81. package/dist/index-D_UWbF-c-huGXgVrA.js +0 -612
  82. package/dist/index-DanGpNPV-_dcep_gx.js +0 -76
  83. package/dist/index-DewhIjKz-Dr8nkE-G.js +0 -101
  84. package/dist/index-FA_vVn10-D6hhYiFH.js +0 -157
  85. package/dist/index-P-0Saucc-DgOebb9I.js +0 -136
  86. package/dist/index-Vdv6L1m9-DszB5Ab4.js +0 -59
  87. package/dist/index-keAzzQcB-DVMei1x9.js +0 -138
  88. package/dist/javascript-C2yteZeJ-gF7C_gzn.js +0 -691
  89. package/dist/jinja2-DnB6dQmV-CsKNIZ4H.js +0 -154
  90. package/dist/julia-DpvXAuO6-Bk_IfD8X.js +0 -241
  91. package/dist/livescript-CanGTf8u-Cx6PrvS4.js +0 -272
  92. package/dist/lua-XplVlWi_-8f8obHzY.js +0 -217
  93. package/dist/mathematica-jaRHnSxC-B83gQsL2.js +0 -35
  94. package/dist/mbox-BctzC1hL-Hg5U2B4l.js +0 -76
  95. package/dist/mirc-CFBPAOaF-CfzSSk9W.js +0 -72
  96. package/dist/mllike-BSnXJBGA-Ao1NpT2u.js +0 -272
  97. package/dist/modelica-vUgVs--1-BObVpYBg.js +0 -93
  98. package/dist/mscgen-Cpl0NYLN-DqNArLGH.js +0 -104
  99. package/dist/mumps-CQoS1kWX-CkTUOQnt.js +0 -25
  100. package/dist/nginx-zDPm3Z74-DJk4KP7N.js +0 -87
  101. package/dist/nsis-fePjrhq7-B3y3WwWy.js +0 -62
  102. package/dist/ntriples-CsNjv2QF-C4aZn3EO.js +0 -79
  103. package/dist/octave-C8PmmSRH-DM5vTWlU.js +0 -143
  104. package/dist/oz-Ce8aN8oE-BcJM4SVy.js +0 -151
  105. package/dist/pascal-De0D6mP7-D7DGFFKL.js +0 -77
  106. package/dist/perl-B4bSCe1C-6aIa2glS.js +0 -915
  107. package/dist/pig-D24Z8EXi-BD-qt5FU.js +0 -54
  108. package/dist/powershell-DkYVfTzP-Blt1Rodi.js +0 -249
  109. package/dist/properties-Dn9wna3M-EOOwnCnk.js +0 -26
  110. package/dist/protobuf-BPIjwpzm-DAButU8_.js +0 -49
  111. package/dist/pug-CwAQJzGR-DCCI1gT4.js +0 -248
  112. package/dist/puppet-nyd4dhjf-CGzH5dsa.js +0 -45
  113. package/dist/python-BkR3uSy8-CjDnyp3B.js +0 -313
  114. package/dist/q-DXjKs-tC-R9FTvsDo.js +0 -83
  115. package/dist/r-LKEuhEGI-BFQhJnTP.js +0 -104
  116. package/dist/rpm-IznJm2Xc-CbZqrWCM.js +0 -57
  117. package/dist/ruby-CcYfvIk6-DzPSfSGo.js +0 -228
  118. package/dist/sas-7E8yHoCW-D726Uzkw.js +0 -105
  119. package/dist/scheme-DjibxsNh-Bp5gVFkm.js +0 -124
  120. package/dist/shell-C0C2sNA_-BTeYg6ir.js +0 -182
  121. package/dist/sieve-Bwz7vjP5-Cw8iTBf7.js +0 -72
  122. package/dist/simple-mode-B0dvCdAA-CbwPI_jC.js +0 -89
  123. package/dist/smalltalk-Bhddl2pB-B7URiJSp.js +0 -48
  124. package/dist/solr-BNlsLglM-BM2OpfTI.js +0 -41
  125. package/dist/sparql-FarWu_Gb-FN_uQNd4.js +0 -197
  126. package/dist/spreadsheet-C-cy4P5N-5CSTwVYq.js +0 -49
  127. package/dist/sql-CfG5lQ3l-Bd4dgm_8.js +0 -278
  128. package/dist/stex-Du4h4KAU-QOov_zHj.js +0 -129
  129. package/dist/stylus-CAdqWld3-BcRBbBxD.js +0 -250
  130. package/dist/swift-DSxqR9R6-2Hz4NOoF.js +0 -230
  131. package/dist/tcl-xfoLljhY-DAZBRGQI.js +0 -81
  132. package/dist/textile-D1AWE-pc-DuiIfEnb.js +0 -295
  133. package/dist/tiddlywiki-5wqsXtSk-WuF_8VUv.js +0 -155
  134. package/dist/tiki-__Kn3CeS-CWcR9ib_.js +0 -181
  135. package/dist/toml-BHiuTcfn-BjoUNlY3.js +0 -47
  136. package/dist/troff-D2UO-fKf-DVoIzS-O.js +0 -35
  137. package/dist/ttcn-Bsa4sfRm-hoy08sYQ.js +0 -123
  138. package/dist/ttcn-cfg-Bac_acMi-DaC4kQpd.js +0 -88
  139. package/dist/turtle-xwJUxoPV-fs94wdNM.js +0 -80
  140. package/dist/vb-c2kQGd6--DU726qF0.js +0 -74
  141. package/dist/vbscript-1f_Dhg5H-DriA32xD.js +0 -324
  142. package/dist/velocity-DJd0pTTC-BG368IR6.js +0 -96
  143. package/dist/verilog-CiS1jyi5-giQA8J-e.js +0 -259
  144. package/dist/vhdl-T9HkrbI2-BJ8LEDog.js +0 -106
  145. package/dist/web-CYC80mDV-DBhCuCsT.js +0 -18
  146. package/dist/webidl-CjfDENEo-BM8KXKJ5.js +0 -155
  147. package/dist/xquery-BUQdORAS-Dop2JBoj.js +0 -422
  148. package/dist/yacas-C0absKBh-B82QJ76F.js +0 -73
  149. package/dist/z80-Pki2zAjW-B0IQoIbR.js +0 -61
@@ -1,1873 +0,0 @@
1
- import { u as st, e as le, A as rt, i as it, W as ot, Z as at, g as q, J as M, k as R, m as lt, y as F, n as H, o as ht, p as ye, K as Ae, L as ft, E as ut, j as m, d as Ie, X as dt, R as ct, V as T, r as pt, s as mt, t as he, _ as gt } from "./index-CZW8-tYE.js";
2
- import { html as kt, htmlCompletionSource as xt } from "./index-CO7ezVmf-zOGvcbYD.js";
3
- class j {
4
- static create(e, n, s, r, i) {
5
- let o = r + (r << 8) + e + (n << 4) | 0;
6
- return new j(e, n, s, o, i, [], []);
7
- }
8
- constructor(e, n, s, r, i, o, a) {
9
- this.type = e, this.value = n, this.from = s, this.hash = r, this.end = i, this.children = o, this.positions = a, this.hashProp = [[H.contextHash, r]];
10
- }
11
- addChild(e, n) {
12
- e.prop(H.contextHash) != this.hash && (e = new T(e.type, e.children, e.positions, e.length, this.hashProp)), this.children.push(e), this.positions.push(n);
13
- }
14
- toTree(e, n = this.end) {
15
- let s = this.children.length - 1;
16
- return s >= 0 && (n = Math.max(n, this.positions[s] + this.children[s].length + this.from)), new T(e.types[this.type], this.children, this.positions, n - this.from).balance({
17
- makeTree: (r, i, o) => new T(F.none, r, i, o, this.hashProp)
18
- });
19
- }
20
- }
21
- var f;
22
- (function(t) {
23
- t[t.Document = 1] = "Document", t[t.CodeBlock = 2] = "CodeBlock", t[t.FencedCode = 3] = "FencedCode", t[t.Blockquote = 4] = "Blockquote", t[t.HorizontalRule = 5] = "HorizontalRule", t[t.BulletList = 6] = "BulletList", t[t.OrderedList = 7] = "OrderedList", t[t.ListItem = 8] = "ListItem", t[t.ATXHeading1 = 9] = "ATXHeading1", t[t.ATXHeading2 = 10] = "ATXHeading2", t[t.ATXHeading3 = 11] = "ATXHeading3", t[t.ATXHeading4 = 12] = "ATXHeading4", t[t.ATXHeading5 = 13] = "ATXHeading5", t[t.ATXHeading6 = 14] = "ATXHeading6", t[t.SetextHeading1 = 15] = "SetextHeading1", t[t.SetextHeading2 = 16] = "SetextHeading2", t[t.HTMLBlock = 17] = "HTMLBlock", t[t.LinkReference = 18] = "LinkReference", t[t.Paragraph = 19] = "Paragraph", t[t.CommentBlock = 20] = "CommentBlock", t[t.ProcessingInstructionBlock = 21] = "ProcessingInstructionBlock", t[t.Escape = 22] = "Escape", t[t.Entity = 23] = "Entity", t[t.HardBreak = 24] = "HardBreak", t[t.Emphasis = 25] = "Emphasis", t[t.StrongEmphasis = 26] = "StrongEmphasis", t[t.Link = 27] = "Link", t[t.Image = 28] = "Image", t[t.InlineCode = 29] = "InlineCode", t[t.HTMLTag = 30] = "HTMLTag", t[t.Comment = 31] = "Comment", t[t.ProcessingInstruction = 32] = "ProcessingInstruction", t[t.Autolink = 33] = "Autolink", t[t.HeaderMark = 34] = "HeaderMark", t[t.QuoteMark = 35] = "QuoteMark", t[t.ListMark = 36] = "ListMark", t[t.LinkMark = 37] = "LinkMark", t[t.EmphasisMark = 38] = "EmphasisMark", t[t.CodeMark = 39] = "CodeMark", t[t.CodeText = 40] = "CodeText", t[t.CodeInfo = 41] = "CodeInfo", t[t.LinkTitle = 42] = "LinkTitle", t[t.LinkLabel = 43] = "LinkLabel", t[t.URL = 44] = "URL";
24
- })(f || (f = {}));
25
- class Lt {
26
- /**
27
- @internal
28
- */
29
- constructor(e, n) {
30
- this.start = e, this.content = n, this.marks = [], this.parsers = [];
31
- }
32
- }
33
- class bt {
34
- constructor() {
35
- this.text = "", this.baseIndent = 0, this.basePos = 0, this.depth = 0, this.markers = [], this.pos = 0, this.indent = 0, this.next = -1;
36
- }
37
- /**
38
- @internal
39
- */
40
- forward() {
41
- this.basePos > this.pos && this.forwardInner();
42
- }
43
- /**
44
- @internal
45
- */
46
- forwardInner() {
47
- let e = this.skipSpace(this.basePos);
48
- this.indent = this.countIndent(e, this.pos, this.indent), this.pos = e, this.next = e == this.text.length ? -1 : this.text.charCodeAt(e);
49
- }
50
- /**
51
- Skip whitespace after the given position, return the position of
52
- the next non-space character or the end of the line if there's
53
- only space after `from`.
54
- */
55
- skipSpace(e) {
56
- return N(this.text, e);
57
- }
58
- /**
59
- @internal
60
- */
61
- reset(e) {
62
- for (this.text = e, this.baseIndent = this.basePos = this.pos = this.indent = 0, this.forwardInner(), this.depth = 1; this.markers.length; )
63
- this.markers.pop();
64
- }
65
- /**
66
- Move the line's base position forward to the given position.
67
- This should only be called by composite [block
68
- parsers](#BlockParser.parse) or [markup skipping
69
- functions](#NodeSpec.composite).
70
- */
71
- moveBase(e) {
72
- this.basePos = e, this.baseIndent = this.countIndent(e, this.pos, this.indent);
73
- }
74
- /**
75
- Move the line's base position forward to the given _column_.
76
- */
77
- moveBaseColumn(e) {
78
- this.baseIndent = e, this.basePos = this.findColumn(e);
79
- }
80
- /**
81
- Store a composite-block-level marker. Should be called from
82
- [markup skipping functions](#NodeSpec.composite) when they
83
- consume any non-whitespace characters.
84
- */
85
- addMarker(e) {
86
- this.markers.push(e);
87
- }
88
- /**
89
- Find the column position at `to`, optionally starting at a given
90
- position and column.
91
- */
92
- countIndent(e, n = 0, s = 0) {
93
- for (let r = n; r < e; r++)
94
- s += this.text.charCodeAt(r) == 9 ? 4 - s % 4 : 1;
95
- return s;
96
- }
97
- /**
98
- Find the position corresponding to the given column.
99
- */
100
- findColumn(e) {
101
- let n = 0;
102
- for (let s = 0; n < this.text.length && s < e; n++)
103
- s += this.text.charCodeAt(n) == 9 ? 4 - s % 4 : 1;
104
- return n;
105
- }
106
- /**
107
- @internal
108
- */
109
- scrub() {
110
- if (!this.baseIndent)
111
- return this.text;
112
- let e = "";
113
- for (let n = 0; n < this.basePos; n++)
114
- e += " ";
115
- return e + this.text.slice(this.basePos);
116
- }
117
- }
118
- function fe(t, e, n) {
119
- if (n.pos == n.text.length || t != e.block && n.indent >= e.stack[n.depth + 1].value + n.baseIndent)
120
- return !0;
121
- if (n.indent >= n.baseIndent + 4)
122
- return !1;
123
- let s = (t.type == f.OrderedList ? ie : re)(n, e, !1);
124
- return s > 0 && (t.type != f.BulletList || se(n, e, !1) < 0) && n.text.charCodeAt(n.pos + s - 1) == t.value;
125
- }
126
- const Te = {
127
- [f.Blockquote](t, e, n) {
128
- return n.next != 62 ? !1 : (n.markers.push(k(f.QuoteMark, e.lineStart + n.pos, e.lineStart + n.pos + 1)), n.moveBase(n.pos + (C(n.text.charCodeAt(n.pos + 1)) ? 2 : 1)), t.end = e.lineStart + n.text.length, !0);
129
- },
130
- [f.ListItem](t, e, n) {
131
- return n.indent < n.baseIndent + t.value && n.next > -1 ? !1 : (n.moveBaseColumn(n.baseIndent + t.value), !0);
132
- },
133
- [f.OrderedList]: fe,
134
- [f.BulletList]: fe,
135
- [f.Document]() {
136
- return !0;
137
- }
138
- };
139
- function C(t) {
140
- return t == 32 || t == 9 || t == 10 || t == 13;
141
- }
142
- function N(t, e = 0) {
143
- for (; e < t.length && C(t.charCodeAt(e)); )
144
- e++;
145
- return e;
146
- }
147
- function ue(t, e, n) {
148
- for (; e > n && C(t.charCodeAt(e - 1)); )
149
- e--;
150
- return e;
151
- }
152
- function Be(t) {
153
- if (t.next != 96 && t.next != 126)
154
- return -1;
155
- let e = t.pos + 1;
156
- for (; e < t.text.length && t.text.charCodeAt(e) == t.next; )
157
- e++;
158
- if (e < t.pos + 3)
159
- return -1;
160
- if (t.next == 96) {
161
- for (let n = e; n < t.text.length; n++)
162
- if (t.text.charCodeAt(n) == 96)
163
- return -1;
164
- }
165
- return e;
166
- }
167
- function Ee(t) {
168
- return t.next != 62 ? -1 : t.text.charCodeAt(t.pos + 1) == 32 ? 2 : 1;
169
- }
170
- function se(t, e, n) {
171
- if (t.next != 42 && t.next != 45 && t.next != 95)
172
- return -1;
173
- let s = 1;
174
- for (let r = t.pos + 1; r < t.text.length; r++) {
175
- let i = t.text.charCodeAt(r);
176
- if (i == t.next)
177
- s++;
178
- else if (!C(i))
179
- return -1;
180
- }
181
- return n && t.next == 45 && ve(t) > -1 && t.depth == e.stack.length && e.parser.leafBlockParsers.indexOf(Re.SetextHeading) > -1 || s < 3 ? -1 : 1;
182
- }
183
- function Me(t, e) {
184
- for (let n = t.stack.length - 1; n >= 0; n--)
185
- if (t.stack[n].type == e)
186
- return !0;
187
- return !1;
188
- }
189
- function re(t, e, n) {
190
- return (t.next == 45 || t.next == 43 || t.next == 42) && (t.pos == t.text.length - 1 || C(t.text.charCodeAt(t.pos + 1))) && (!n || Me(e, f.BulletList) || t.skipSpace(t.pos + 2) < t.text.length) ? 1 : -1;
191
- }
192
- function ie(t, e, n) {
193
- let s = t.pos, r = t.next;
194
- for (; r >= 48 && r <= 57; ) {
195
- if (s++, s == t.text.length)
196
- return -1;
197
- r = t.text.charCodeAt(s);
198
- }
199
- return s == t.pos || s > t.pos + 9 || r != 46 && r != 41 || s < t.text.length - 1 && !C(t.text.charCodeAt(s + 1)) || n && !Me(e, f.OrderedList) && (t.skipSpace(s + 1) == t.text.length || s > t.pos + 1 || t.next != 49) ? -1 : s + 1 - t.pos;
200
- }
201
- function He(t) {
202
- if (t.next != 35)
203
- return -1;
204
- let e = t.pos + 1;
205
- for (; e < t.text.length && t.text.charCodeAt(e) == 35; )
206
- e++;
207
- if (e < t.text.length && t.text.charCodeAt(e) != 32)
208
- return -1;
209
- let n = e - t.pos;
210
- return n > 6 ? -1 : n;
211
- }
212
- function ve(t) {
213
- if (t.next != 45 && t.next != 61 || t.indent >= t.baseIndent + 4)
214
- return -1;
215
- let e = t.pos + 1;
216
- for (; e < t.text.length && t.text.charCodeAt(e) == t.next; )
217
- e++;
218
- let n = e;
219
- for (; e < t.text.length && C(t.text.charCodeAt(e)); )
220
- e++;
221
- return e == t.text.length ? n : -1;
222
- }
223
- const G = /^[ \t]*$/, Pe = /-->/, Ne = /\?>/, J = [
224
- [/^<(?:script|pre|style)(?:\s|>|$)/i, /<\/(?:script|pre|style)>/i],
225
- [/^\s*<!--/, Pe],
226
- [/^\s*<\?/, Ne],
227
- [/^\s*<![A-Z]/, />/],
228
- [/^\s*<!\[CDATA\[/, /\]\]>/],
229
- [/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i, G],
230
- [/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i, G]
231
- ];
232
- function Oe(t, e, n) {
233
- if (t.next != 60)
234
- return -1;
235
- let s = t.text.slice(t.pos);
236
- for (let r = 0, i = J.length - (n ? 1 : 0); r < i; r++)
237
- if (J[r][0].test(s))
238
- return r;
239
- return -1;
240
- }
241
- function de(t, e) {
242
- let n = t.countIndent(e, t.pos, t.indent), s = t.countIndent(t.skipSpace(e), e, n);
243
- return s >= n + 5 ? n + 1 : s;
244
- }
245
- function I(t, e, n) {
246
- let s = t.length - 1;
247
- s >= 0 && t[s].to == e && t[s].type == f.CodeText ? t[s].to = n : t.push(k(f.CodeText, e, n));
248
- }
249
- const z = {
250
- LinkReference: void 0,
251
- IndentedCode(t, e) {
252
- let n = e.baseIndent + 4;
253
- if (e.indent < n)
254
- return !1;
255
- let s = e.findColumn(n), r = t.lineStart + s, i = t.lineStart + e.text.length, o = [], a = [];
256
- for (I(o, r, i); t.nextLine() && e.depth >= t.stack.length; )
257
- if (e.pos == e.text.length) {
258
- I(a, t.lineStart - 1, t.lineStart);
259
- for (let l of e.markers)
260
- a.push(l);
261
- } else {
262
- if (e.indent < n)
263
- break;
264
- {
265
- if (a.length) {
266
- for (let u of a)
267
- u.type == f.CodeText ? I(o, u.from, u.to) : o.push(u);
268
- a = [];
269
- }
270
- I(o, t.lineStart - 1, t.lineStart);
271
- for (let u of e.markers)
272
- o.push(u);
273
- i = t.lineStart + e.text.length;
274
- let l = t.lineStart + e.findColumn(e.baseIndent + 4);
275
- l < i && I(o, l, i);
276
- }
277
- }
278
- return a.length && (a = a.filter((l) => l.type != f.CodeText), a.length && (e.markers = a.concat(e.markers))), t.addNode(t.buffer.writeElements(o, -r).finish(f.CodeBlock, i - r), r), !0;
279
- },
280
- FencedCode(t, e) {
281
- let n = Be(e);
282
- if (n < 0)
283
- return !1;
284
- let s = t.lineStart + e.pos, r = e.next, i = n - e.pos, o = e.skipSpace(n), a = ue(e.text, e.text.length, o), l = [k(f.CodeMark, s, s + i)];
285
- o < a && l.push(k(f.CodeInfo, t.lineStart + o, t.lineStart + a));
286
- for (let u = !0; t.nextLine() && e.depth >= t.stack.length; u = !1) {
287
- let h = e.pos;
288
- if (e.indent - e.baseIndent < 4)
289
- for (; h < e.text.length && e.text.charCodeAt(h) == r; )
290
- h++;
291
- if (h - e.pos >= i && e.skipSpace(h) == e.text.length) {
292
- for (let c of e.markers)
293
- l.push(c);
294
- l.push(k(f.CodeMark, t.lineStart + e.pos, t.lineStart + h)), t.nextLine();
295
- break;
296
- } else {
297
- u || I(l, t.lineStart - 1, t.lineStart);
298
- for (let g of e.markers)
299
- l.push(g);
300
- let c = t.lineStart + e.basePos, d = t.lineStart + e.text.length;
301
- c < d && I(l, c, d);
302
- }
303
- }
304
- return t.addNode(t.buffer.writeElements(l, -s).finish(f.FencedCode, t.prevLineEnd() - s), s), !0;
305
- },
306
- Blockquote(t, e) {
307
- let n = Ee(e);
308
- return n < 0 ? !1 : (t.startContext(f.Blockquote, e.pos), t.addNode(f.QuoteMark, t.lineStart + e.pos, t.lineStart + e.pos + 1), e.moveBase(e.pos + n), null);
309
- },
310
- HorizontalRule(t, e) {
311
- if (se(e, t, !1) < 0)
312
- return !1;
313
- let n = t.lineStart + e.pos;
314
- return t.nextLine(), t.addNode(f.HorizontalRule, n), !0;
315
- },
316
- BulletList(t, e) {
317
- let n = re(e, t, !1);
318
- if (n < 0)
319
- return !1;
320
- t.block.type != f.BulletList && t.startContext(f.BulletList, e.basePos, e.next);
321
- let s = de(e, e.pos + 1);
322
- return t.startContext(f.ListItem, e.basePos, s - e.baseIndent), t.addNode(f.ListMark, t.lineStart + e.pos, t.lineStart + e.pos + n), e.moveBaseColumn(s), null;
323
- },
324
- OrderedList(t, e) {
325
- let n = ie(e, t, !1);
326
- if (n < 0)
327
- return !1;
328
- t.block.type != f.OrderedList && t.startContext(f.OrderedList, e.basePos, e.text.charCodeAt(e.pos + n - 1));
329
- let s = de(e, e.pos + n);
330
- return t.startContext(f.ListItem, e.basePos, s - e.baseIndent), t.addNode(f.ListMark, t.lineStart + e.pos, t.lineStart + e.pos + n), e.moveBaseColumn(s), null;
331
- },
332
- ATXHeading(t, e) {
333
- let n = He(e);
334
- if (n < 0)
335
- return !1;
336
- let s = e.pos, r = t.lineStart + s, i = ue(e.text, e.text.length, s), o = i;
337
- for (; o > s && e.text.charCodeAt(o - 1) == e.next; )
338
- o--;
339
- (o == i || o == s || !C(e.text.charCodeAt(o - 1))) && (o = e.text.length);
340
- let a = t.buffer.write(f.HeaderMark, 0, n).writeElements(t.parser.parseInline(e.text.slice(s + n + 1, o), r + n + 1), -r);
341
- o < e.text.length && a.write(f.HeaderMark, o - s, i - s);
342
- let l = a.finish(f.ATXHeading1 - 1 + n, e.text.length - s);
343
- return t.nextLine(), t.addNode(l, r), !0;
344
- },
345
- HTMLBlock(t, e) {
346
- let n = Oe(e, t, !1);
347
- if (n < 0)
348
- return !1;
349
- let s = t.lineStart + e.pos, r = J[n][1], i = [], o = r != G;
350
- for (; !r.test(e.text) && t.nextLine(); ) {
351
- if (e.depth < t.stack.length) {
352
- o = !1;
353
- break;
354
- }
355
- for (let u of e.markers)
356
- i.push(u);
357
- }
358
- o && t.nextLine();
359
- let a = r == Pe ? f.CommentBlock : r == Ne ? f.ProcessingInstructionBlock : f.HTMLBlock, l = t.prevLineEnd();
360
- return t.addNode(t.buffer.writeElements(i, -s).finish(a, l - s), s), !0;
361
- },
362
- SetextHeading: void 0
363
- // Specifies relative precedence for block-continue function
364
- };
365
- class St {
366
- constructor(e) {
367
- this.stage = 0, this.elts = [], this.pos = 0, this.start = e.start, this.advance(e.content);
368
- }
369
- nextLine(e, n, s) {
370
- if (this.stage == -1)
371
- return !1;
372
- let r = s.content + `
373
- ` + n.scrub(), i = this.advance(r);
374
- return i > -1 && i < r.length ? this.complete(e, s, i) : !1;
375
- }
376
- finish(e, n) {
377
- return (this.stage == 2 || this.stage == 3) && N(n.content, this.pos) == n.content.length ? this.complete(e, n, n.content.length) : !1;
378
- }
379
- complete(e, n, s) {
380
- return e.addLeafElement(n, k(f.LinkReference, this.start, this.start + s, this.elts)), !0;
381
- }
382
- nextStage(e) {
383
- return e ? (this.pos = e.to - this.start, this.elts.push(e), this.stage++, !0) : (e === !1 && (this.stage = -1), !1);
384
- }
385
- advance(e) {
386
- for (; ; ) {
387
- if (this.stage == -1)
388
- return -1;
389
- if (this.stage == 0) {
390
- if (!this.nextStage(Ze(e, this.pos, this.start, !0)))
391
- return -1;
392
- if (e.charCodeAt(this.pos) != 58)
393
- return this.stage = -1;
394
- this.elts.push(k(f.LinkMark, this.pos + this.start, this.pos + this.start + 1)), this.pos++;
395
- } else if (this.stage == 1) {
396
- if (!this.nextStage(Fe(e, N(e, this.pos), this.start)))
397
- return -1;
398
- } else if (this.stage == 2) {
399
- let n = N(e, this.pos), s = 0;
400
- if (n > this.pos) {
401
- let r = Ue(e, n, this.start);
402
- if (r) {
403
- let i = Z(e, r.to - this.start);
404
- i > 0 && (this.nextStage(r), s = i);
405
- }
406
- }
407
- return s || (s = Z(e, this.pos)), s > 0 && s < e.length ? s : -1;
408
- } else
409
- return Z(e, this.pos);
410
- }
411
- }
412
- }
413
- function Z(t, e) {
414
- for (; e < t.length; e++) {
415
- let n = t.charCodeAt(e);
416
- if (n == 10)
417
- break;
418
- if (!C(n))
419
- return -1;
420
- }
421
- return e;
422
- }
423
- class Ct {
424
- nextLine(e, n, s) {
425
- let r = n.depth < e.stack.length ? -1 : ve(n), i = n.next;
426
- if (r < 0)
427
- return !1;
428
- let o = k(f.HeaderMark, e.lineStart + n.pos, e.lineStart + r);
429
- return e.nextLine(), e.addLeafElement(s, k(i == 61 ? f.SetextHeading1 : f.SetextHeading2, s.start, e.prevLineEnd(), [
430
- ...e.parser.parseInline(s.content, s.start),
431
- o
432
- ])), !0;
433
- }
434
- finish() {
435
- return !1;
436
- }
437
- }
438
- const Re = {
439
- LinkReference(t, e) {
440
- return e.content.charCodeAt(0) == 91 ? new St(e) : null;
441
- },
442
- SetextHeading() {
443
- return new Ct();
444
- }
445
- }, wt = [
446
- (t, e) => He(e) >= 0,
447
- (t, e) => Be(e) >= 0,
448
- (t, e) => Ee(e) >= 0,
449
- (t, e) => re(e, t, !0) >= 0,
450
- (t, e) => ie(e, t, !0) >= 0,
451
- (t, e) => se(e, t, !0) >= 0,
452
- (t, e) => Oe(e, t, !0) >= 0
453
- ], yt = { text: "", end: 0 };
454
- class At {
455
- /**
456
- @internal
457
- */
458
- constructor(e, n, s, r) {
459
- this.parser = e, this.input = n, this.ranges = r, this.line = new bt(), this.atEnd = !1, this.reusePlaceholders = /* @__PURE__ */ new Map(), this.stoppedAt = null, this.rangeI = 0, this.to = r[r.length - 1].to, this.lineStart = this.absoluteLineStart = this.absoluteLineEnd = r[0].from, this.block = j.create(f.Document, 0, this.lineStart, 0, 0), this.stack = [this.block], this.fragments = s.length ? new Et(s, n) : null, this.readLine();
460
- }
461
- get parsedPos() {
462
- return this.absoluteLineStart;
463
- }
464
- advance() {
465
- if (this.stoppedAt != null && this.absoluteLineStart > this.stoppedAt)
466
- return this.finish();
467
- let { line: e } = this;
468
- for (; ; ) {
469
- for (let s = 0; ; ) {
470
- let r = e.depth < this.stack.length ? this.stack[this.stack.length - 1] : null;
471
- for (; s < e.markers.length && (!r || e.markers[s].from < r.end); ) {
472
- let i = e.markers[s++];
473
- this.addNode(i.type, i.from, i.to);
474
- }
475
- if (!r)
476
- break;
477
- this.finishContext();
478
- }
479
- if (e.pos < e.text.length)
480
- break;
481
- if (!this.nextLine())
482
- return this.finish();
483
- }
484
- if (this.fragments && this.reuseFragment(e.basePos))
485
- return null;
486
- e: for (; ; ) {
487
- for (let s of this.parser.blockParsers)
488
- if (s) {
489
- let r = s(this, e);
490
- if (r != !1) {
491
- if (r == !0)
492
- return null;
493
- e.forward();
494
- continue e;
495
- }
496
- }
497
- break;
498
- }
499
- let n = new Lt(this.lineStart + e.pos, e.text.slice(e.pos));
500
- for (let s of this.parser.leafBlockParsers)
501
- if (s) {
502
- let r = s(this, n);
503
- r && n.parsers.push(r);
504
- }
505
- e: for (; this.nextLine() && e.pos != e.text.length; ) {
506
- if (e.indent < e.baseIndent + 4) {
507
- for (let s of this.parser.endLeafBlock)
508
- if (s(this, e, n))
509
- break e;
510
- }
511
- for (let s of n.parsers)
512
- if (s.nextLine(this, e, n))
513
- return null;
514
- n.content += `
515
- ` + e.scrub();
516
- for (let s of e.markers)
517
- n.marks.push(s);
518
- }
519
- return this.finishLeaf(n), null;
520
- }
521
- stopAt(e) {
522
- if (this.stoppedAt != null && this.stoppedAt < e)
523
- throw new RangeError("Can't move stoppedAt forward");
524
- this.stoppedAt = e;
525
- }
526
- reuseFragment(e) {
527
- if (!this.fragments.moveTo(this.absoluteLineStart + e, this.absoluteLineStart) || !this.fragments.matches(this.block.hash))
528
- return !1;
529
- let n = this.fragments.takeNodes(this);
530
- return n ? (this.absoluteLineStart += n, this.lineStart = _e(this.absoluteLineStart, this.ranges), this.moveRangeI(), this.absoluteLineStart < this.to ? (this.lineStart++, this.absoluteLineStart++, this.readLine()) : (this.atEnd = !0, this.readLine()), !0) : !1;
531
- }
532
- /**
533
- The number of parent blocks surrounding the current block.
534
- */
535
- get depth() {
536
- return this.stack.length;
537
- }
538
- /**
539
- Get the type of the parent block at the given depth. When no
540
- depth is passed, return the type of the innermost parent.
541
- */
542
- parentType(e = this.depth - 1) {
543
- return this.parser.nodeSet.types[this.stack[e].type];
544
- }
545
- /**
546
- Move to the next input line. This should only be called by
547
- (non-composite) [block parsers](#BlockParser.parse) that consume
548
- the line directly, or leaf block parser
549
- [`nextLine`](#LeafBlockParser.nextLine) methods when they
550
- consume the current line (and return true).
551
- */
552
- nextLine() {
553
- return this.lineStart += this.line.text.length, this.absoluteLineEnd >= this.to ? (this.absoluteLineStart = this.absoluteLineEnd, this.atEnd = !0, this.readLine(), !1) : (this.lineStart++, this.absoluteLineStart = this.absoluteLineEnd + 1, this.moveRangeI(), this.readLine(), !0);
554
- }
555
- /**
556
- Retrieve the text of the line after the current one, without
557
- actually moving the context's current line forward.
558
- */
559
- peekLine() {
560
- return this.scanLine(this.absoluteLineEnd + 1).text;
561
- }
562
- moveRangeI() {
563
- for (; this.rangeI < this.ranges.length - 1 && this.absoluteLineStart >= this.ranges[this.rangeI].to; )
564
- this.rangeI++, this.absoluteLineStart = Math.max(this.absoluteLineStart, this.ranges[this.rangeI].from);
565
- }
566
- /**
567
- @internal
568
- Collect the text for the next line.
569
- */
570
- scanLine(e) {
571
- let n = yt;
572
- if (n.end = e, e >= this.to)
573
- n.text = "";
574
- else if (n.text = this.lineChunkAt(e), n.end += n.text.length, this.ranges.length > 1) {
575
- let s = this.absoluteLineStart, r = this.rangeI;
576
- for (; this.ranges[r].to < n.end; ) {
577
- r++;
578
- let i = this.ranges[r].from, o = this.lineChunkAt(i);
579
- n.end = i + o.length, n.text = n.text.slice(0, this.ranges[r - 1].to - s) + o, s = n.end - n.text.length;
580
- }
581
- }
582
- return n;
583
- }
584
- /**
585
- @internal
586
- Populate this.line with the content of the next line. Skip
587
- leading characters covered by composite blocks.
588
- */
589
- readLine() {
590
- let { line: e } = this, { text: n, end: s } = this.scanLine(this.absoluteLineStart);
591
- for (this.absoluteLineEnd = s, e.reset(n); e.depth < this.stack.length; e.depth++) {
592
- let r = this.stack[e.depth], i = this.parser.skipContextMarkup[r.type];
593
- if (!i)
594
- throw new Error("Unhandled block context " + f[r.type]);
595
- if (!i(r, this, e))
596
- break;
597
- e.forward();
598
- }
599
- }
600
- lineChunkAt(e) {
601
- let n = this.input.chunk(e), s;
602
- if (this.input.lineChunks)
603
- s = n == `
604
- ` ? "" : n;
605
- else {
606
- let r = n.indexOf(`
607
- `);
608
- s = r < 0 ? n : n.slice(0, r);
609
- }
610
- return e + s.length > this.to ? s.slice(0, this.to - e) : s;
611
- }
612
- /**
613
- The end position of the previous line.
614
- */
615
- prevLineEnd() {
616
- return this.atEnd ? this.lineStart : this.lineStart - 1;
617
- }
618
- /**
619
- @internal
620
- */
621
- startContext(e, n, s = 0) {
622
- this.block = j.create(e, s, this.lineStart + n, this.block.hash, this.lineStart + this.line.text.length), this.stack.push(this.block);
623
- }
624
- /**
625
- Start a composite block. Should only be called from [block
626
- parser functions](#BlockParser.parse) that return null.
627
- */
628
- startComposite(e, n, s = 0) {
629
- this.startContext(this.parser.getNodeType(e), n, s);
630
- }
631
- /**
632
- @internal
633
- */
634
- addNode(e, n, s) {
635
- typeof e == "number" && (e = new T(this.parser.nodeSet.types[e], v, v, (s ?? this.prevLineEnd()) - n)), this.block.addChild(e, n - this.block.from);
636
- }
637
- /**
638
- Add a block element. Can be called by [block
639
- parsers](#BlockParser.parse).
640
- */
641
- addElement(e) {
642
- this.block.addChild(e.toTree(this.parser.nodeSet), e.from - this.block.from);
643
- }
644
- /**
645
- Add a block element from a [leaf parser](#LeafBlockParser). This
646
- makes sure any extra composite block markup (such as blockquote
647
- markers) inside the block are also added to the syntax tree.
648
- */
649
- addLeafElement(e, n) {
650
- this.addNode(this.buffer.writeElements(ee(n.children, e.marks), -n.from).finish(n.type, n.to - n.from), n.from);
651
- }
652
- /**
653
- @internal
654
- */
655
- finishContext() {
656
- let e = this.stack.pop(), n = this.stack[this.stack.length - 1];
657
- n.addChild(e.toTree(this.parser.nodeSet), e.from - n.from), this.block = n;
658
- }
659
- finish() {
660
- for (; this.stack.length > 1; )
661
- this.finishContext();
662
- return this.addGaps(this.block.toTree(this.parser.nodeSet, this.lineStart));
663
- }
664
- addGaps(e) {
665
- return this.ranges.length > 1 ? Xe(this.ranges, 0, e.topNode, this.ranges[0].from, this.reusePlaceholders) : e;
666
- }
667
- /**
668
- @internal
669
- */
670
- finishLeaf(e) {
671
- for (let s of e.parsers)
672
- if (s.finish(this, e))
673
- return;
674
- let n = ee(this.parser.parseInline(e.content, e.start), e.marks);
675
- this.addNode(this.buffer.writeElements(n, -e.start).finish(f.Paragraph, e.content.length), e.start);
676
- }
677
- elt(e, n, s, r) {
678
- return typeof e == "string" ? k(this.parser.getNodeType(e), n, s, r) : new De(e, n);
679
- }
680
- /**
681
- @internal
682
- */
683
- get buffer() {
684
- return new ze(this.parser.nodeSet);
685
- }
686
- }
687
- function Xe(t, e, n, s, r) {
688
- let i = t[e].to, o = [], a = [], l = n.from + s;
689
- function u(h, c) {
690
- for (; c ? h >= i : h > i; ) {
691
- let d = t[e + 1].from - i;
692
- s += d, h += d, e++, i = t[e].to;
693
- }
694
- }
695
- for (let h = n.firstChild; h; h = h.nextSibling) {
696
- u(h.from + s, !0);
697
- let c = h.from + s, d, g = r.get(h.tree);
698
- g ? d = g : h.to + s > i ? (d = Xe(t, e, h, s, r), u(h.to + s, !1)) : d = h.toTree(), o.push(d), a.push(c - l);
699
- }
700
- return u(n.to + s, !1), new T(n.type, o, a, n.to + s - l, n.tree ? n.tree.propValues : void 0);
701
- }
702
- class U extends lt {
703
- /**
704
- @internal
705
- */
706
- constructor(e, n, s, r, i, o, a, l, u) {
707
- super(), this.nodeSet = e, this.blockParsers = n, this.leafBlockParsers = s, this.blockNames = r, this.endLeafBlock = i, this.skipContextMarkup = o, this.inlineParsers = a, this.inlineNames = l, this.wrappers = u, this.nodeTypes = /* @__PURE__ */ Object.create(null);
708
- for (let h of e.types)
709
- this.nodeTypes[h.name] = h.id;
710
- }
711
- createParse(e, n, s) {
712
- let r = new At(this, e, n, s);
713
- for (let i of this.wrappers)
714
- r = i(r, e, n, s);
715
- return r;
716
- }
717
- /**
718
- Reconfigure the parser.
719
- */
720
- configure(e) {
721
- let n = W(e);
722
- if (!n)
723
- return this;
724
- let { nodeSet: s, skipContextMarkup: r } = this, i = this.blockParsers.slice(), o = this.leafBlockParsers.slice(), a = this.blockNames.slice(), l = this.inlineParsers.slice(), u = this.inlineNames.slice(), h = this.endLeafBlock.slice(), c = this.wrappers;
725
- if (P(n.defineNodes)) {
726
- r = Object.assign({}, r);
727
- let d = s.types.slice(), g;
728
- for (let p of n.defineNodes) {
729
- let { name: w, block: L, composite: b, style: x } = typeof p == "string" ? { name: p } : p;
730
- if (d.some((A) => A.name == w))
731
- continue;
732
- b && (r[d.length] = (A, tt, nt) => b(tt, nt, A.value));
733
- let y = d.length, B = b ? ["Block", "BlockContext"] : L ? y >= f.ATXHeading1 && y <= f.SetextHeading2 ? ["Block", "LeafBlock", "Heading"] : ["Block", "LeafBlock"] : void 0;
734
- d.push(F.define({
735
- id: y,
736
- name: w,
737
- props: B && [[H.group, B]]
738
- })), x && (g || (g = {}), Array.isArray(x) || x instanceof ht ? g[w] = x : Object.assign(g, x));
739
- }
740
- s = new ye(d), g && (s = s.extend(Ae(g)));
741
- }
742
- if (P(n.props) && (s = s.extend(...n.props)), P(n.remove))
743
- for (let d of n.remove) {
744
- let g = this.blockNames.indexOf(d), p = this.inlineNames.indexOf(d);
745
- g > -1 && (i[g] = o[g] = void 0), p > -1 && (l[p] = void 0);
746
- }
747
- if (P(n.parseBlock))
748
- for (let d of n.parseBlock) {
749
- let g = a.indexOf(d.name);
750
- if (g > -1)
751
- i[g] = d.parse, o[g] = d.leaf;
752
- else {
753
- let p = d.before ? D(a, d.before) : d.after ? D(a, d.after) + 1 : a.length - 1;
754
- i.splice(p, 0, d.parse), o.splice(p, 0, d.leaf), a.splice(p, 0, d.name);
755
- }
756
- d.endLeaf && h.push(d.endLeaf);
757
- }
758
- if (P(n.parseInline))
759
- for (let d of n.parseInline) {
760
- let g = u.indexOf(d.name);
761
- if (g > -1)
762
- l[g] = d.parse;
763
- else {
764
- let p = d.before ? D(u, d.before) : d.after ? D(u, d.after) + 1 : u.length - 1;
765
- l.splice(p, 0, d.parse), u.splice(p, 0, d.name);
766
- }
767
- }
768
- return n.wrap && (c = c.concat(n.wrap)), new U(s, i, o, a, h, r, l, u, c);
769
- }
770
- /**
771
- @internal
772
- */
773
- getNodeType(e) {
774
- let n = this.nodeTypes[e];
775
- if (n == null)
776
- throw new RangeError(`Unknown node type '${e}'`);
777
- return n;
778
- }
779
- /**
780
- Parse the given piece of inline text at the given offset,
781
- returning an array of [`Element`](#Element) objects representing
782
- the inline content.
783
- */
784
- parseInline(e, n) {
785
- let s = new Tt(this, e, n);
786
- e: for (let r = n; r < s.end; ) {
787
- let i = s.char(r);
788
- for (let o of this.inlineParsers)
789
- if (o) {
790
- let a = o(s, i, r);
791
- if (a >= 0) {
792
- r = a;
793
- continue e;
794
- }
795
- }
796
- r++;
797
- }
798
- return s.resolveMarkers(0);
799
- }
800
- }
801
- function P(t) {
802
- return t != null && t.length > 0;
803
- }
804
- function W(t) {
805
- if (!Array.isArray(t))
806
- return t;
807
- if (t.length == 0)
808
- return null;
809
- let e = W(t[0]);
810
- if (t.length == 1)
811
- return e;
812
- let n = W(t.slice(1));
813
- if (!n || !e)
814
- return e || n;
815
- let s = (o, a) => (o || v).concat(a || v), r = e.wrap, i = n.wrap;
816
- return {
817
- props: s(e.props, n.props),
818
- defineNodes: s(e.defineNodes, n.defineNodes),
819
- parseBlock: s(e.parseBlock, n.parseBlock),
820
- parseInline: s(e.parseInline, n.parseInline),
821
- remove: s(e.remove, n.remove),
822
- wrap: r ? i ? (o, a, l, u) => r(i(o, a, l, u), a, l, u) : r : i
823
- };
824
- }
825
- function D(t, e) {
826
- let n = t.indexOf(e);
827
- if (n < 0)
828
- throw new RangeError(`Position specified relative to unknown parser ${e}`);
829
- return n;
830
- }
831
- let $e = [F.none];
832
- for (let t = 1, e; e = f[t]; t++)
833
- $e[t] = F.define({
834
- id: t,
835
- name: e,
836
- props: t >= f.Escape ? [] : [[H.group, t in Te ? ["Block", "BlockContext"] : ["Block", "LeafBlock"]]],
837
- top: e == "Document"
838
- });
839
- const v = [];
840
- class ze {
841
- constructor(e) {
842
- this.nodeSet = e, this.content = [], this.nodes = [];
843
- }
844
- write(e, n, s, r = 0) {
845
- return this.content.push(e, n, s, 4 + r * 4), this;
846
- }
847
- writeElements(e, n = 0) {
848
- for (let s of e)
849
- s.writeTo(this, n);
850
- return this;
851
- }
852
- finish(e, n) {
853
- return T.build({
854
- buffer: this.content,
855
- nodeSet: this.nodeSet,
856
- reused: this.nodes,
857
- topID: e,
858
- length: n
859
- });
860
- }
861
- }
862
- class X {
863
- /**
864
- @internal
865
- */
866
- constructor(e, n, s, r = v) {
867
- this.type = e, this.from = n, this.to = s, this.children = r;
868
- }
869
- /**
870
- @internal
871
- */
872
- writeTo(e, n) {
873
- let s = e.content.length;
874
- e.writeElements(this.children, n), e.content.push(this.type, this.from + n, this.to + n, e.content.length + 4 - s);
875
- }
876
- /**
877
- @internal
878
- */
879
- toTree(e) {
880
- return new ze(e).writeElements(this.children, -this.from).finish(this.type, this.to - this.from);
881
- }
882
- }
883
- class De {
884
- constructor(e, n) {
885
- this.tree = e, this.from = n;
886
- }
887
- get to() {
888
- return this.from + this.tree.length;
889
- }
890
- get type() {
891
- return this.tree.type.id;
892
- }
893
- get children() {
894
- return v;
895
- }
896
- writeTo(e, n) {
897
- e.nodes.push(this.tree), e.content.push(e.nodes.length - 1, this.from + n, this.to + n, -1);
898
- }
899
- toTree() {
900
- return this.tree;
901
- }
902
- }
903
- function k(t, e, n, s) {
904
- return new X(t, e, n, s);
905
- }
906
- const je = { resolve: "Emphasis", mark: "EmphasisMark" }, qe = { resolve: "Emphasis", mark: "EmphasisMark" }, E = {}, Y = {};
907
- class S {
908
- constructor(e, n, s, r) {
909
- this.type = e, this.from = n, this.to = s, this.side = r;
910
- }
911
- }
912
- const ce = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";
913
- let $ = /[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;
914
- try {
915
- $ = new RegExp("[\\p{S}|\\p{P}]", "u");
916
- } catch {
917
- }
918
- const _ = {
919
- Escape(t, e, n) {
920
- if (e != 92 || n == t.end - 1)
921
- return -1;
922
- let s = t.char(n + 1);
923
- for (let r = 0; r < ce.length; r++)
924
- if (ce.charCodeAt(r) == s)
925
- return t.append(k(f.Escape, n, n + 2));
926
- return -1;
927
- },
928
- Entity(t, e, n) {
929
- if (e != 38)
930
- return -1;
931
- let s = /^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(t.slice(n + 1, n + 31));
932
- return s ? t.append(k(f.Entity, n, n + 1 + s[0].length)) : -1;
933
- },
934
- InlineCode(t, e, n) {
935
- if (e != 96 || n && t.char(n - 1) == 96)
936
- return -1;
937
- let s = n + 1;
938
- for (; s < t.end && t.char(s) == 96; )
939
- s++;
940
- let r = s - n, i = 0;
941
- for (; s < t.end; s++)
942
- if (t.char(s) == 96) {
943
- if (i++, i == r && t.char(s + 1) != 96)
944
- return t.append(k(f.InlineCode, n, s + 1, [
945
- k(f.CodeMark, n, n + r),
946
- k(f.CodeMark, s + 1 - r, s + 1)
947
- ]));
948
- } else
949
- i = 0;
950
- return -1;
951
- },
952
- HTMLTag(t, e, n) {
953
- if (e != 60 || n == t.end - 1)
954
- return -1;
955
- let s = t.slice(n + 1, t.end), r = /^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(s);
956
- if (r)
957
- return t.append(k(f.Autolink, n, n + 1 + r[0].length, [
958
- k(f.LinkMark, n, n + 1),
959
- // url[0] includes the closing bracket, so exclude it from this slice
960
- k(f.URL, n + 1, n + r[0].length),
961
- k(f.LinkMark, n + r[0].length, n + 1 + r[0].length)
962
- ]));
963
- let i = /^!--[^>](?:-[^-]|[^-])*?-->/i.exec(s);
964
- if (i)
965
- return t.append(k(f.Comment, n, n + 1 + i[0].length));
966
- let o = /^\?[^]*?\?>/.exec(s);
967
- if (o)
968
- return t.append(k(f.ProcessingInstruction, n, n + 1 + o[0].length));
969
- let a = /^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(s);
970
- return a ? t.append(k(f.HTMLTag, n, n + 1 + a[0].length)) : -1;
971
- },
972
- Emphasis(t, e, n) {
973
- if (e != 95 && e != 42)
974
- return -1;
975
- let s = n + 1;
976
- for (; t.char(s) == e; )
977
- s++;
978
- let r = t.slice(n - 1, n), i = t.slice(s, s + 1), o = $.test(r), a = $.test(i), l = /\s|^$/.test(r), u = /\s|^$/.test(i), h = !u && (!a || l || o), c = !l && (!o || u || a), d = h && (e == 42 || !c || o), g = c && (e == 42 || !h || a);
979
- return t.append(new S(e == 95 ? je : qe, n, s, (d ? 1 : 0) | (g ? 2 : 0)));
980
- },
981
- HardBreak(t, e, n) {
982
- if (e == 92 && t.char(n + 1) == 10)
983
- return t.append(k(f.HardBreak, n, n + 2));
984
- if (e == 32) {
985
- let s = n + 1;
986
- for (; t.char(s) == 32; )
987
- s++;
988
- if (t.char(s) == 10 && s >= n + 2)
989
- return t.append(k(f.HardBreak, n, s + 1));
990
- }
991
- return -1;
992
- },
993
- Link(t, e, n) {
994
- return e == 91 ? t.append(new S(
995
- E,
996
- n,
997
- n + 1,
998
- 1
999
- /* Mark.Open */
1000
- )) : -1;
1001
- },
1002
- Image(t, e, n) {
1003
- return e == 33 && t.char(n + 1) == 91 ? t.append(new S(
1004
- Y,
1005
- n,
1006
- n + 2,
1007
- 1
1008
- /* Mark.Open */
1009
- )) : -1;
1010
- },
1011
- LinkEnd(t, e, n) {
1012
- if (e != 93)
1013
- return -1;
1014
- for (let s = t.parts.length - 1; s >= 0; s--) {
1015
- let r = t.parts[s];
1016
- if (r instanceof S && (r.type == E || r.type == Y)) {
1017
- if (!r.side || t.skipSpace(r.to) == n && !/[(\[]/.test(t.slice(n + 1, n + 2)))
1018
- return t.parts[s] = null, -1;
1019
- let i = t.takeContent(s), o = t.parts[s] = It(t, i, r.type == E ? f.Link : f.Image, r.from, n + 1);
1020
- if (r.type == E)
1021
- for (let a = 0; a < s; a++) {
1022
- let l = t.parts[a];
1023
- l instanceof S && l.type == E && (l.side = 0);
1024
- }
1025
- return o.to;
1026
- }
1027
- }
1028
- return -1;
1029
- }
1030
- };
1031
- function It(t, e, n, s, r) {
1032
- let { text: i } = t, o = t.char(r), a = r;
1033
- if (e.unshift(k(f.LinkMark, s, s + (n == f.Image ? 2 : 1))), e.push(k(f.LinkMark, r - 1, r)), o == 40) {
1034
- let l = t.skipSpace(r + 1), u = Fe(i, l - t.offset, t.offset), h;
1035
- u && (l = t.skipSpace(u.to), l != u.to && (h = Ue(i, l - t.offset, t.offset), h && (l = t.skipSpace(h.to)))), t.char(l) == 41 && (e.push(k(f.LinkMark, r, r + 1)), a = l + 1, u && e.push(u), h && e.push(h), e.push(k(f.LinkMark, l, a)));
1036
- } else if (o == 91) {
1037
- let l = Ze(i, r - t.offset, t.offset, !1);
1038
- l && (e.push(l), a = l.to);
1039
- }
1040
- return k(n, s, a, e);
1041
- }
1042
- function Fe(t, e, n) {
1043
- if (t.charCodeAt(e) == 60) {
1044
- for (let s = e + 1; s < t.length; s++) {
1045
- let r = t.charCodeAt(s);
1046
- if (r == 62)
1047
- return k(f.URL, e + n, s + 1 + n);
1048
- if (r == 60 || r == 10)
1049
- return !1;
1050
- }
1051
- return null;
1052
- } else {
1053
- let s = 0, r = e;
1054
- for (let i = !1; r < t.length; r++) {
1055
- let o = t.charCodeAt(r);
1056
- if (C(o))
1057
- break;
1058
- if (i)
1059
- i = !1;
1060
- else if (o == 40)
1061
- s++;
1062
- else if (o == 41) {
1063
- if (!s)
1064
- break;
1065
- s--;
1066
- } else o == 92 && (i = !0);
1067
- }
1068
- return r > e ? k(f.URL, e + n, r + n) : r == t.length ? null : !1;
1069
- }
1070
- }
1071
- function Ue(t, e, n) {
1072
- let s = t.charCodeAt(e);
1073
- if (s != 39 && s != 34 && s != 40)
1074
- return !1;
1075
- let r = s == 40 ? 41 : s;
1076
- for (let i = e + 1, o = !1; i < t.length; i++) {
1077
- let a = t.charCodeAt(i);
1078
- if (o)
1079
- o = !1;
1080
- else {
1081
- if (a == r)
1082
- return k(f.LinkTitle, e + n, i + 1 + n);
1083
- a == 92 && (o = !0);
1084
- }
1085
- }
1086
- return null;
1087
- }
1088
- function Ze(t, e, n, s) {
1089
- for (let r = !1, i = e + 1, o = Math.min(t.length, i + 999); i < o; i++) {
1090
- let a = t.charCodeAt(i);
1091
- if (r)
1092
- r = !1;
1093
- else {
1094
- if (a == 93)
1095
- return s ? !1 : k(f.LinkLabel, e + n, i + 1 + n);
1096
- if (s && !C(a) && (s = !1), a == 91)
1097
- return !1;
1098
- a == 92 && (r = !0);
1099
- }
1100
- }
1101
- return null;
1102
- }
1103
- class Tt {
1104
- /**
1105
- @internal
1106
- */
1107
- constructor(e, n, s) {
1108
- this.parser = e, this.text = n, this.offset = s, this.parts = [];
1109
- }
1110
- /**
1111
- Get the character code at the given (document-relative)
1112
- position.
1113
- */
1114
- char(e) {
1115
- return e >= this.end ? -1 : this.text.charCodeAt(e - this.offset);
1116
- }
1117
- /**
1118
- The position of the end of this inline section.
1119
- */
1120
- get end() {
1121
- return this.offset + this.text.length;
1122
- }
1123
- /**
1124
- Get a substring of this inline section. Again uses
1125
- document-relative positions.
1126
- */
1127
- slice(e, n) {
1128
- return this.text.slice(e - this.offset, n - this.offset);
1129
- }
1130
- /**
1131
- @internal
1132
- */
1133
- append(e) {
1134
- return this.parts.push(e), e.to;
1135
- }
1136
- /**
1137
- Add a [delimiter](#DelimiterType) at this given position. `open`
1138
- and `close` indicate whether this delimiter is opening, closing,
1139
- or both. Returns the end of the delimiter, for convenient
1140
- returning from [parse functions](#InlineParser.parse).
1141
- */
1142
- addDelimiter(e, n, s, r, i) {
1143
- return this.append(new S(e, n, s, (r ? 1 : 0) | (i ? 2 : 0)));
1144
- }
1145
- /**
1146
- Returns true when there is an unmatched link or image opening
1147
- token before the current position.
1148
- */
1149
- get hasOpenLink() {
1150
- for (let e = this.parts.length - 1; e >= 0; e--) {
1151
- let n = this.parts[e];
1152
- if (n instanceof S && (n.type == E || n.type == Y))
1153
- return !0;
1154
- }
1155
- return !1;
1156
- }
1157
- /**
1158
- Add an inline element. Returns the end of the element.
1159
- */
1160
- addElement(e) {
1161
- return this.append(e);
1162
- }
1163
- /**
1164
- Resolve markers between this.parts.length and from, wrapping matched markers in the
1165
- appropriate node and updating the content of this.parts. @internal
1166
- */
1167
- resolveMarkers(e) {
1168
- for (let s = e; s < this.parts.length; s++) {
1169
- let r = this.parts[s];
1170
- if (!(r instanceof S && r.type.resolve && r.side & 2))
1171
- continue;
1172
- let i = r.type == je || r.type == qe, o = r.to - r.from, a, l = s - 1;
1173
- for (; l >= e; l--) {
1174
- let p = this.parts[l];
1175
- if (p instanceof S && p.side & 1 && p.type == r.type && // Ignore emphasis delimiters where the character count doesn't match
1176
- !(i && (r.side & 1 || p.side & 2) && (p.to - p.from + o) % 3 == 0 && ((p.to - p.from) % 3 || o % 3))) {
1177
- a = p;
1178
- break;
1179
- }
1180
- }
1181
- if (!a)
1182
- continue;
1183
- let u = r.type.resolve, h = [], c = a.from, d = r.to;
1184
- if (i) {
1185
- let p = Math.min(2, a.to - a.from, o);
1186
- c = a.to - p, d = r.from + p, u = p == 1 ? "Emphasis" : "StrongEmphasis";
1187
- }
1188
- a.type.mark && h.push(this.elt(a.type.mark, c, a.to));
1189
- for (let p = l + 1; p < s; p++)
1190
- this.parts[p] instanceof X && h.push(this.parts[p]), this.parts[p] = null;
1191
- r.type.mark && h.push(this.elt(r.type.mark, r.from, d));
1192
- let g = this.elt(u, c, d, h);
1193
- this.parts[l] = i && a.from != c ? new S(a.type, a.from, c, a.side) : null, (this.parts[s] = i && r.to != d ? new S(r.type, d, r.to, r.side) : null) ? this.parts.splice(s, 0, g) : this.parts[s] = g;
1194
- }
1195
- let n = [];
1196
- for (let s = e; s < this.parts.length; s++) {
1197
- let r = this.parts[s];
1198
- r instanceof X && n.push(r);
1199
- }
1200
- return n;
1201
- }
1202
- /**
1203
- Find an opening delimiter of the given type. Returns `null` if
1204
- no delimiter is found, or an index that can be passed to
1205
- [`takeContent`](#InlineContext.takeContent) otherwise.
1206
- */
1207
- findOpeningDelimiter(e) {
1208
- for (let n = this.parts.length - 1; n >= 0; n--) {
1209
- let s = this.parts[n];
1210
- if (s instanceof S && s.type == e)
1211
- return n;
1212
- }
1213
- return null;
1214
- }
1215
- /**
1216
- Remove all inline elements and delimiters starting from the
1217
- given index (which you should get from
1218
- [`findOpeningDelimiter`](#InlineContext.findOpeningDelimiter),
1219
- resolve delimiters inside of them, and return them as an array
1220
- of elements.
1221
- */
1222
- takeContent(e) {
1223
- let n = this.resolveMarkers(e);
1224
- return this.parts.length = e, n;
1225
- }
1226
- /**
1227
- Skip space after the given (document) position, returning either
1228
- the position of the next non-space character or the end of the
1229
- section.
1230
- */
1231
- skipSpace(e) {
1232
- return N(this.text, e - this.offset) + this.offset;
1233
- }
1234
- elt(e, n, s, r) {
1235
- return typeof e == "string" ? k(this.parser.getNodeType(e), n, s, r) : new De(e, n);
1236
- }
1237
- }
1238
- function ee(t, e) {
1239
- if (!e.length)
1240
- return t;
1241
- if (!t.length)
1242
- return e;
1243
- let n = t.slice(), s = 0;
1244
- for (let r of e) {
1245
- for (; s < n.length && n[s].to < r.to; )
1246
- s++;
1247
- if (s < n.length && n[s].from < r.from) {
1248
- let i = n[s];
1249
- i instanceof X && (n[s] = new X(i.type, i.from, i.to, ee(i.children, [r])));
1250
- } else
1251
- n.splice(s++, 0, r);
1252
- }
1253
- return n;
1254
- }
1255
- const Bt = [f.CodeBlock, f.ListItem, f.OrderedList, f.BulletList];
1256
- class Et {
1257
- constructor(e, n) {
1258
- this.fragments = e, this.input = n, this.i = 0, this.fragment = null, this.fragmentEnd = -1, this.cursor = null, e.length && (this.fragment = e[this.i++]);
1259
- }
1260
- nextFragment() {
1261
- this.fragment = this.i < this.fragments.length ? this.fragments[this.i++] : null, this.cursor = null, this.fragmentEnd = -1;
1262
- }
1263
- moveTo(e, n) {
1264
- for (; this.fragment && this.fragment.to <= e; )
1265
- this.nextFragment();
1266
- if (!this.fragment || this.fragment.from > (e ? e - 1 : 0))
1267
- return !1;
1268
- if (this.fragmentEnd < 0) {
1269
- let i = this.fragment.to;
1270
- for (; i > 0 && this.input.read(i - 1, i) != `
1271
- `; )
1272
- i--;
1273
- this.fragmentEnd = i ? i - 1 : 0;
1274
- }
1275
- let s = this.cursor;
1276
- s || (s = this.cursor = this.fragment.tree.cursor(), s.firstChild());
1277
- let r = e + this.fragment.offset;
1278
- for (; s.to <= r; )
1279
- if (!s.parent())
1280
- return !1;
1281
- for (; ; ) {
1282
- if (s.from >= r)
1283
- return this.fragment.from <= n;
1284
- if (!s.childAfter(r))
1285
- return !1;
1286
- }
1287
- }
1288
- matches(e) {
1289
- let n = this.cursor.tree;
1290
- return n && n.prop(H.contextHash) == e;
1291
- }
1292
- takeNodes(e) {
1293
- let n = this.cursor, s = this.fragment.offset, r = this.fragmentEnd - (this.fragment.openEnd ? 1 : 0), i = e.absoluteLineStart, o = i, a = e.block.children.length, l = o, u = a;
1294
- for (; ; ) {
1295
- if (n.to - s > r) {
1296
- if (n.type.isAnonymous && n.firstChild())
1297
- continue;
1298
- break;
1299
- }
1300
- let h = _e(n.from - s, e.ranges);
1301
- if (n.to - s <= e.ranges[e.rangeI].to)
1302
- e.addNode(n.tree, h);
1303
- else {
1304
- let c = new T(e.parser.nodeSet.types[f.Paragraph], [], [], 0, e.block.hashProp);
1305
- e.reusePlaceholders.set(c, n.tree), e.addNode(c, h);
1306
- }
1307
- if (n.type.is("Block") && (Bt.indexOf(n.type.id) < 0 ? (o = n.to - s, a = e.block.children.length) : (o = l, a = u, l = n.to - s, u = e.block.children.length)), !n.nextSibling())
1308
- break;
1309
- }
1310
- for (; e.block.children.length > a; )
1311
- e.block.children.pop(), e.block.positions.pop();
1312
- return o - i;
1313
- }
1314
- }
1315
- function _e(t, e) {
1316
- let n = t;
1317
- for (let s = 1; s < e.length; s++) {
1318
- let r = e[s - 1].to, i = e[s].from;
1319
- r < t && (n -= i - r);
1320
- }
1321
- return n;
1322
- }
1323
- const Mt = Ae({
1324
- "Blockquote/...": m.quote,
1325
- HorizontalRule: m.contentSeparator,
1326
- "ATXHeading1/... SetextHeading1/...": m.heading1,
1327
- "ATXHeading2/... SetextHeading2/...": m.heading2,
1328
- "ATXHeading3/...": m.heading3,
1329
- "ATXHeading4/...": m.heading4,
1330
- "ATXHeading5/...": m.heading5,
1331
- "ATXHeading6/...": m.heading6,
1332
- "Comment CommentBlock": m.comment,
1333
- Escape: m.escape,
1334
- Entity: m.character,
1335
- "Emphasis/...": m.emphasis,
1336
- "StrongEmphasis/...": m.strong,
1337
- "Link/... Image/...": m.link,
1338
- "OrderedList/... BulletList/...": m.list,
1339
- "BlockQuote/...": m.quote,
1340
- "InlineCode CodeText": m.monospace,
1341
- "URL Autolink": m.url,
1342
- "HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark": m.processingInstruction,
1343
- "CodeInfo LinkLabel": m.labelName,
1344
- LinkTitle: m.string,
1345
- Paragraph: m.content
1346
- }), Ht = new U(new ye($e).extend(Mt), Object.keys(z).map((t) => z[t]), Object.keys(z).map((t) => Re[t]), Object.keys(z), wt, Te, Object.keys(_).map((t) => _[t]), Object.keys(_), []);
1347
- function vt(t, e, n) {
1348
- let s = [];
1349
- for (let r = t.firstChild, i = e; ; r = r.nextSibling) {
1350
- let o = r ? r.from : n;
1351
- if (o > i && s.push({ from: i, to: o }), !r)
1352
- break;
1353
- i = r.to;
1354
- }
1355
- return s;
1356
- }
1357
- function Pt(t) {
1358
- let { codeParser: e, htmlParser: n } = t;
1359
- return { wrap: ft((s, r) => {
1360
- let i = s.type.id;
1361
- if (e && (i == f.CodeBlock || i == f.FencedCode)) {
1362
- let o = "";
1363
- if (i == f.FencedCode) {
1364
- let l = s.node.getChild(f.CodeInfo);
1365
- l && (o = r.read(l.from, l.to));
1366
- }
1367
- let a = e(o);
1368
- if (a)
1369
- return { parser: a, overlay: (l) => l.type.id == f.CodeText };
1370
- } else if (n && (i == f.HTMLBlock || i == f.HTMLTag || i == f.CommentBlock))
1371
- return { parser: n, overlay: vt(s.node, s.from, s.to) };
1372
- return null;
1373
- }) };
1374
- }
1375
- const Nt = { resolve: "Strikethrough", mark: "StrikethroughMark" }, Ot = {
1376
- defineNodes: [{
1377
- name: "Strikethrough",
1378
- style: { "Strikethrough/...": m.strikethrough }
1379
- }, {
1380
- name: "StrikethroughMark",
1381
- style: m.processingInstruction
1382
- }],
1383
- parseInline: [{
1384
- name: "Strikethrough",
1385
- parse(t, e, n) {
1386
- if (e != 126 || t.char(n + 1) != 126 || t.char(n + 2) == 126)
1387
- return -1;
1388
- let s = t.slice(n - 1, n), r = t.slice(n + 2, n + 3), i = /\s|^$/.test(s), o = /\s|^$/.test(r), a = $.test(s), l = $.test(r);
1389
- return t.addDelimiter(Nt, n, n + 2, !o && (!l || i || a), !i && (!a || o || l));
1390
- },
1391
- after: "Emphasis"
1392
- }]
1393
- };
1394
- function O(t, e, n = 0, s, r = 0) {
1395
- let i = 0, o = !0, a = -1, l = -1, u = !1, h = () => {
1396
- s.push(t.elt("TableCell", r + a, r + l, t.parser.parseInline(e.slice(a, l), r + a)));
1397
- };
1398
- for (let c = n; c < e.length; c++) {
1399
- let d = e.charCodeAt(c);
1400
- d == 124 && !u ? ((!o || a > -1) && i++, o = !1, s && (a > -1 && h(), s.push(t.elt("TableDelimiter", c + r, c + r + 1))), a = l = -1) : (u || d != 32 && d != 9) && (a < 0 && (a = c), l = c + 1), u = !u && d == 92;
1401
- }
1402
- return a > -1 && (i++, s && h()), i;
1403
- }
1404
- function pe(t, e) {
1405
- for (let n = e; n < t.length; n++) {
1406
- let s = t.charCodeAt(n);
1407
- if (s == 124)
1408
- return !0;
1409
- s == 92 && n++;
1410
- }
1411
- return !1;
1412
- }
1413
- const Qe = /^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;
1414
- class me {
1415
- constructor() {
1416
- this.rows = null;
1417
- }
1418
- nextLine(e, n, s) {
1419
- if (this.rows == null) {
1420
- this.rows = !1;
1421
- let r;
1422
- if ((n.next == 45 || n.next == 58 || n.next == 124) && Qe.test(r = n.text.slice(n.pos))) {
1423
- let i = [];
1424
- O(e, s.content, 0, i, s.start) == O(e, r, n.pos) && (this.rows = [
1425
- e.elt("TableHeader", s.start, s.start + s.content.length, i),
1426
- e.elt("TableDelimiter", e.lineStart + n.pos, e.lineStart + n.text.length)
1427
- ]);
1428
- }
1429
- } else if (this.rows) {
1430
- let r = [];
1431
- O(e, n.text, n.pos, r, e.lineStart), this.rows.push(e.elt("TableRow", e.lineStart + n.pos, e.lineStart + n.text.length, r));
1432
- }
1433
- return !1;
1434
- }
1435
- finish(e, n) {
1436
- return this.rows ? (e.addLeafElement(n, e.elt("Table", n.start, n.start + n.content.length, this.rows)), !0) : !1;
1437
- }
1438
- }
1439
- const Rt = {
1440
- defineNodes: [
1441
- { name: "Table", block: !0 },
1442
- { name: "TableHeader", style: { "TableHeader/...": m.heading } },
1443
- "TableRow",
1444
- { name: "TableCell", style: m.content },
1445
- { name: "TableDelimiter", style: m.processingInstruction }
1446
- ],
1447
- parseBlock: [{
1448
- name: "Table",
1449
- leaf(t, e) {
1450
- return pe(e.content, 0) ? new me() : null;
1451
- },
1452
- endLeaf(t, e, n) {
1453
- if (n.parsers.some((r) => r instanceof me) || !pe(e.text, e.basePos))
1454
- return !1;
1455
- let s = t.peekLine();
1456
- return Qe.test(s) && O(t, e.text, e.basePos) == O(t, s, e.basePos);
1457
- },
1458
- before: "SetextHeading"
1459
- }]
1460
- };
1461
- class Xt {
1462
- nextLine() {
1463
- return !1;
1464
- }
1465
- finish(e, n) {
1466
- return e.addLeafElement(n, e.elt("Task", n.start, n.start + n.content.length, [
1467
- e.elt("TaskMarker", n.start, n.start + 3),
1468
- ...e.parser.parseInline(n.content.slice(3), n.start + 3)
1469
- ])), !0;
1470
- }
1471
- }
1472
- const $t = {
1473
- defineNodes: [
1474
- { name: "Task", block: !0, style: m.list },
1475
- { name: "TaskMarker", style: m.atom }
1476
- ],
1477
- parseBlock: [{
1478
- name: "TaskList",
1479
- leaf(t, e) {
1480
- return /^\[[ xX]\][ \t]/.test(e.content) && t.parentType().name == "ListItem" ? new Xt() : null;
1481
- },
1482
- after: "SetextHeading"
1483
- }]
1484
- }, ge = /(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy, ke = /[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy, zt = /[\w-]+\.[\w-]+($|\/)/, xe = /[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy, Le = /\/[a-zA-Z\d@.]+/gy;
1485
- function be(t, e, n, s) {
1486
- let r = 0;
1487
- for (let i = e; i < n; i++)
1488
- t[i] == s && r++;
1489
- return r;
1490
- }
1491
- function Dt(t, e) {
1492
- ke.lastIndex = e;
1493
- let n = ke.exec(t);
1494
- if (!n || zt.exec(n[0])[0].indexOf("_") > -1)
1495
- return -1;
1496
- let s = e + n[0].length;
1497
- for (; ; ) {
1498
- let r = t[s - 1], i;
1499
- if (/[?!.,:*_~]/.test(r) || r == ")" && be(t, e, s, ")") > be(t, e, s, "("))
1500
- s--;
1501
- else if (r == ";" && (i = /&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(t.slice(e, s))))
1502
- s = e + i.index;
1503
- else
1504
- break;
1505
- }
1506
- return s;
1507
- }
1508
- function Se(t, e) {
1509
- xe.lastIndex = e;
1510
- let n = xe.exec(t);
1511
- if (!n)
1512
- return -1;
1513
- let s = n[0][n[0].length - 1];
1514
- return s == "_" || s == "-" ? -1 : e + n[0].length - (s == "." ? 1 : 0);
1515
- }
1516
- const jt = {
1517
- parseInline: [{
1518
- name: "Autolink",
1519
- parse(t, e, n) {
1520
- let s = n - t.offset;
1521
- if (s && /\w/.test(t.text[s - 1]))
1522
- return -1;
1523
- ge.lastIndex = s;
1524
- let r = ge.exec(t.text), i = -1;
1525
- if (!r)
1526
- return -1;
1527
- if (r[1] || r[2]) {
1528
- if (i = Dt(t.text, s + r[0].length), i > -1 && t.hasOpenLink) {
1529
- let o = /([^\[\]]|\[[^\]]*\])*/.exec(t.text.slice(s, i));
1530
- i = s + o[0].length;
1531
- }
1532
- } else r[3] ? i = Se(t.text, s) : (i = Se(t.text, s + r[0].length), i > -1 && r[0] == "xmpp:" && (Le.lastIndex = i, r = Le.exec(t.text), r && (i = r.index + r[0].length)));
1533
- return i < 0 ? -1 : (t.addElement(t.elt("URL", n, i + t.offset)), i + t.offset);
1534
- }
1535
- }]
1536
- }, qt = [Rt, $t, Ot, jt];
1537
- function Ve(t, e, n) {
1538
- return (s, r, i) => {
1539
- if (r != t || s.char(i + 1) == t)
1540
- return -1;
1541
- let o = [s.elt(n, i, i + 1)];
1542
- for (let a = i + 1; a < s.end; a++) {
1543
- let l = s.char(a);
1544
- if (l == t)
1545
- return s.addElement(s.elt(e, i, a + 1, o.concat(s.elt(n, a, a + 1))));
1546
- if (l == 92 && o.push(s.elt("Escape", a, a++ + 2)), C(l))
1547
- break;
1548
- }
1549
- return -1;
1550
- };
1551
- }
1552
- const Ft = {
1553
- defineNodes: [
1554
- { name: "Superscript", style: m.special(m.content) },
1555
- { name: "SuperscriptMark", style: m.processingInstruction }
1556
- ],
1557
- parseInline: [{
1558
- name: "Superscript",
1559
- parse: Ve(94, "Superscript", "SuperscriptMark")
1560
- }]
1561
- }, Ut = {
1562
- defineNodes: [
1563
- { name: "Subscript", style: m.special(m.content) },
1564
- { name: "SubscriptMark", style: m.processingInstruction }
1565
- ],
1566
- parseInline: [{
1567
- name: "Subscript",
1568
- parse: Ve(126, "Subscript", "SubscriptMark")
1569
- }]
1570
- }, Zt = {
1571
- defineNodes: [{ name: "Emoji", style: m.character }],
1572
- parseInline: [{
1573
- name: "Emoji",
1574
- parse(t, e, n) {
1575
- let s;
1576
- return e != 58 || !(s = /^[a-zA-Z_0-9]+:/.exec(t.slice(n + 1, t.end))) ? -1 : t.addElement(t.elt("Emoji", n, n + 1 + s[0].length));
1577
- }
1578
- }]
1579
- }, Ke = /* @__PURE__ */ at({ commentTokens: { block: { open: "<!--", close: "-->" } } }), Ge = /* @__PURE__ */ new H(), Je = /* @__PURE__ */ Ht.configure({
1580
- props: [
1581
- /* @__PURE__ */ Ie.add((t) => !t.is("Block") || t.is("Document") || te(t) != null || _t(t) ? void 0 : (e, n) => ({ from: n.doc.lineAt(e.from).to, to: e.to })),
1582
- /* @__PURE__ */ Ge.add(te),
1583
- /* @__PURE__ */ dt.add({
1584
- Document: () => null
1585
- }),
1586
- /* @__PURE__ */ ct.add({
1587
- Document: Ke
1588
- })
1589
- ]
1590
- });
1591
- function te(t) {
1592
- let e = /^(?:ATX|Setext)Heading(\d)$/.exec(t.name);
1593
- return e ? +e[1] : void 0;
1594
- }
1595
- function _t(t) {
1596
- return t.name == "OrderedList" || t.name == "BulletList";
1597
- }
1598
- function Qt(t, e) {
1599
- let n = t;
1600
- for (; ; ) {
1601
- let s = n.nextSibling, r;
1602
- if (!s || (r = te(s.type)) != null && r <= e)
1603
- break;
1604
- n = s;
1605
- }
1606
- return n.to;
1607
- }
1608
- const Vt = /* @__PURE__ */ st.of((t, e, n) => {
1609
- for (let s = q(t).resolveInner(n, -1); s && !(s.from < e); s = s.parent) {
1610
- let r = s.type.prop(Ge);
1611
- if (r == null)
1612
- continue;
1613
- let i = Qt(s, r);
1614
- if (i > n)
1615
- return { from: n, to: i };
1616
- }
1617
- return null;
1618
- });
1619
- function oe(t) {
1620
- return new ot(Ke, t, [], "markdown");
1621
- }
1622
- const Kt = /* @__PURE__ */ oe(Je), Gt = /* @__PURE__ */ Je.configure([qt, Ut, Ft, Zt, {
1623
- props: [
1624
- /* @__PURE__ */ Ie.add({
1625
- Table: (t, e) => ({ from: e.doc.lineAt(t.from).to, to: t.to })
1626
- })
1627
- ]
1628
- }]), ne = /* @__PURE__ */ oe(Gt);
1629
- function Jt(t, e) {
1630
- return (n) => {
1631
- if (n && t) {
1632
- let s = null;
1633
- if (n = /\S*/.exec(n)[0], typeof t == "function" ? s = t(n) : s = he.matchLanguageName(t, n, !0), s instanceof he)
1634
- return s.support ? s.support.language.parser : gt.getSkippingParser(s.load());
1635
- if (s)
1636
- return s.parser;
1637
- }
1638
- return e ? e.parser : null;
1639
- };
1640
- }
1641
- class Q {
1642
- constructor(e, n, s, r, i, o, a) {
1643
- this.node = e, this.from = n, this.to = s, this.spaceBefore = r, this.spaceAfter = i, this.type = o, this.item = a;
1644
- }
1645
- blank(e, n = !0) {
1646
- let s = this.spaceBefore + (this.node.name == "Blockquote" ? ">" : "");
1647
- if (e != null) {
1648
- for (; s.length < e; )
1649
- s += " ";
1650
- return s;
1651
- } else {
1652
- for (let r = this.to - this.from - s.length - this.spaceAfter.length; r > 0; r--)
1653
- s += " ";
1654
- return s + (n ? this.spaceAfter : "");
1655
- }
1656
- }
1657
- marker(e, n) {
1658
- let s = this.node.name == "OrderedList" ? String(+Ye(this.item, e)[2] + n) : "";
1659
- return this.spaceBefore + s + this.type + this.spaceAfter;
1660
- }
1661
- }
1662
- function We(t, e) {
1663
- let n = [], s = [];
1664
- for (let r = t; r; r = r.parent) {
1665
- if (r.name == "FencedCode")
1666
- return s;
1667
- (r.name == "ListItem" || r.name == "Blockquote") && n.push(r);
1668
- }
1669
- for (let r = n.length - 1; r >= 0; r--) {
1670
- let i = n[r], o, a = e.lineAt(i.from), l = i.from - a.from;
1671
- if (i.name == "Blockquote" && (o = /^ *>( ?)/.exec(a.text.slice(l))))
1672
- s.push(new Q(i, l, l + o[0].length, "", o[1], ">", null));
1673
- else if (i.name == "ListItem" && i.parent.name == "OrderedList" && (o = /^( *)\d+([.)])( *)/.exec(a.text.slice(l)))) {
1674
- let u = o[3], h = o[0].length;
1675
- u.length >= 4 && (u = u.slice(0, u.length - 4), h -= 4), s.push(new Q(i.parent, l, l + h, o[1], u, o[2], i));
1676
- } else if (i.name == "ListItem" && i.parent.name == "BulletList" && (o = /^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(a.text.slice(l)))) {
1677
- let u = o[4], h = o[0].length;
1678
- u.length > 4 && (u = u.slice(0, u.length - 4), h -= 4);
1679
- let c = o[2];
1680
- o[3] && (c += o[3].replace(/[xX]/, " ")), s.push(new Q(i.parent, l, l + h, o[1], u, c, i));
1681
- }
1682
- }
1683
- return s;
1684
- }
1685
- function Ye(t, e) {
1686
- return /^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from, t.from + 10));
1687
- }
1688
- function V(t, e, n, s = 0) {
1689
- for (let r = -1, i = t; ; ) {
1690
- if (i.name == "ListItem") {
1691
- let a = Ye(i, e), l = +a[2];
1692
- if (r >= 0) {
1693
- if (l != r + 1)
1694
- return;
1695
- n.push({ from: i.from + a[1].length, to: i.from + a[0].length, insert: String(r + 2 + s) });
1696
- }
1697
- r = l;
1698
- }
1699
- let o = i.nextSibling;
1700
- if (!o)
1701
- break;
1702
- i = o;
1703
- }
1704
- }
1705
- function ae(t, e) {
1706
- let n = /^[ \t]*/.exec(t)[0].length;
1707
- if (!n || e.facet(ut) != " ")
1708
- return t;
1709
- let s = R(t, 4, n), r = "";
1710
- for (let i = s; i > 0; )
1711
- i >= 4 ? (r += " ", i -= 4) : (r += " ", i--);
1712
- return r + t.slice(n);
1713
- }
1714
- const Wt = ({ state: t, dispatch: e }) => {
1715
- let n = q(t), { doc: s } = t, r = null, i = t.changeByRange((o) => {
1716
- if (!o.empty || !ne.isActiveAt(t, o.from, -1) && !ne.isActiveAt(t, o.from, 1))
1717
- return r = { range: o };
1718
- let a = o.from, l = s.lineAt(a), u = We(n.resolveInner(a, -1), s);
1719
- for (; u.length && u[u.length - 1].from > a - l.from; )
1720
- u.pop();
1721
- if (!u.length)
1722
- return r = { range: o };
1723
- let h = u[u.length - 1];
1724
- if (h.to - h.spaceAfter.length > a - l.from)
1725
- return r = { range: o };
1726
- let c = a >= h.to - h.spaceAfter.length && !/\S/.test(l.text.slice(h.to));
1727
- if (h.item && c) {
1728
- let L = h.node.firstChild, b = h.node.getChild("ListItem", "ListItem");
1729
- if (L.to >= a || b && b.to < a || l.from > 0 && !/[^\s>]/.test(s.lineAt(l.from - 1).text)) {
1730
- let x = u.length > 1 ? u[u.length - 2] : null, y, B = "";
1731
- x && x.item ? (y = l.from + x.from, B = x.marker(s, 1)) : y = l.from + (x ? x.to : 0);
1732
- let A = [{ from: y, to: a, insert: B }];
1733
- return h.node.name == "OrderedList" && V(h.item, s, A, -2), x && x.node.name == "OrderedList" && V(x.item, s, A), { range: M.cursor(y + B.length), changes: A };
1734
- } else {
1735
- let x = we(u, t, l);
1736
- return {
1737
- range: M.cursor(a + x.length + 1),
1738
- changes: { from: l.from, insert: x + t.lineBreak }
1739
- };
1740
- }
1741
- }
1742
- if (h.node.name == "Blockquote" && c && l.from) {
1743
- let L = s.lineAt(l.from - 1), b = />\s*$/.exec(L.text);
1744
- if (b && b.index == h.from) {
1745
- let x = t.changes([
1746
- { from: L.from + b.index, to: L.to },
1747
- { from: l.from + h.from, to: l.to }
1748
- ]);
1749
- return { range: o.map(x), changes: x };
1750
- }
1751
- }
1752
- let d = [];
1753
- h.node.name == "OrderedList" && V(h.item, s, d);
1754
- let g = h.item && h.item.from < l.from, p = "";
1755
- if (!g || /^[\s\d.)\-+*>]*/.exec(l.text)[0].length >= h.to)
1756
- for (let L = 0, b = u.length - 1; L <= b; L++)
1757
- p += L == b && !g ? u[L].marker(s, 1) : u[L].blank(L < b ? R(l.text, 4, u[L + 1].from) - p.length : null);
1758
- let w = a;
1759
- for (; w > l.from && /\s/.test(l.text.charAt(w - l.from - 1)); )
1760
- w--;
1761
- return p = ae(p, t), Yt(h.node, t.doc) && (p = we(u, t, l) + t.lineBreak + p), d.push({ from: w, to: a, insert: t.lineBreak + p }), { range: M.cursor(w + p.length + 1), changes: d };
1762
- });
1763
- return r ? !1 : (e(t.update(i, { scrollIntoView: !0, userEvent: "input" })), !0);
1764
- };
1765
- function Ce(t) {
1766
- return t.name == "QuoteMark" || t.name == "ListMark";
1767
- }
1768
- function Yt(t, e) {
1769
- if (t.name != "OrderedList" && t.name != "BulletList")
1770
- return !1;
1771
- let n = t.firstChild, s = t.getChild("ListItem", "ListItem");
1772
- if (!s)
1773
- return !1;
1774
- let r = e.lineAt(n.to), i = e.lineAt(s.from), o = /^[\s>]*$/.test(r.text);
1775
- return r.number + (o ? 0 : 1) < i.number;
1776
- }
1777
- function we(t, e, n) {
1778
- let s = "";
1779
- for (let r = 0, i = t.length - 2; r <= i; r++)
1780
- s += t[r].blank(r < i ? R(n.text, 4, t[r + 1].from) - s.length : null, r < i);
1781
- return ae(s, e);
1782
- }
1783
- function en(t, e) {
1784
- let n = t.resolveInner(e, -1), s = e;
1785
- Ce(n) && (s = n.from, n = n.parent);
1786
- for (let r; r = n.childBefore(s); )
1787
- if (Ce(r))
1788
- s = r.from;
1789
- else if (r.name == "OrderedList" || r.name == "BulletList")
1790
- n = r.lastChild, s = n.to;
1791
- else
1792
- break;
1793
- return n;
1794
- }
1795
- const tn = ({ state: t, dispatch: e }) => {
1796
- let n = q(t), s = null, r = t.changeByRange((i) => {
1797
- let o = i.from, { doc: a } = t;
1798
- if (i.empty && ne.isActiveAt(t, i.from)) {
1799
- let l = a.lineAt(o), u = We(en(n, o), a);
1800
- if (u.length) {
1801
- let h = u[u.length - 1], c = h.to - h.spaceAfter.length + (h.spaceAfter ? 1 : 0);
1802
- if (o - l.from > c && !/\S/.test(l.text.slice(c, o - l.from)))
1803
- return {
1804
- range: M.cursor(l.from + c),
1805
- changes: { from: l.from + c, to: o }
1806
- };
1807
- if (o - l.from == c && // Only apply this if we're on the line that has the
1808
- // construct's syntax, or there's only indentation in the
1809
- // target range
1810
- (!h.item || l.from <= h.item.from || !/\S/.test(l.text.slice(0, h.to)))) {
1811
- let d = l.from + h.from;
1812
- if (h.item && h.node.from < h.item.from && /\S/.test(l.text.slice(h.from, h.to))) {
1813
- let g = h.blank(R(l.text, 4, h.to) - R(l.text, 4, h.from));
1814
- return d == l.from && (g = ae(g, t)), {
1815
- range: M.cursor(d + g.length),
1816
- changes: { from: d, to: l.from + h.to, insert: g }
1817
- };
1818
- }
1819
- if (d < o)
1820
- return { range: M.cursor(d), changes: { from: d, to: o } };
1821
- }
1822
- }
1823
- }
1824
- return s = { range: i };
1825
- });
1826
- return s ? !1 : (e(t.update(r, { scrollIntoView: !0, userEvent: "delete" })), !0);
1827
- }, nn = [
1828
- { key: "Enter", run: Wt },
1829
- { key: "Backspace", run: tn }
1830
- ], et = /* @__PURE__ */ kt({ matchClosingTags: !1 });
1831
- function ln(t = {}) {
1832
- let { codeLanguages: e, defaultCodeLanguage: n, addKeymap: s = !0, base: { parser: r } = Kt, completeHTMLTags: i = !0, htmlTagLanguage: o = et } = t;
1833
- if (!(r instanceof U))
1834
- throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");
1835
- let a = t.extensions ? [t.extensions] : [], l = [o.support, Vt], u;
1836
- n instanceof le ? (l.push(n.support), u = n.language) : n && (u = n);
1837
- let h = e || u ? Jt(e, u) : void 0;
1838
- a.push(Pt({ codeParser: h, htmlParser: o.language.parser })), s && l.push(rt.high(it.of(nn)));
1839
- let c = oe(r.configure(a));
1840
- return i && l.push(c.data.of({ autocomplete: sn })), new le(c, l);
1841
- }
1842
- function sn(t) {
1843
- let { state: e, pos: n } = t, s = /<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(n - 25, n));
1844
- if (!s)
1845
- return null;
1846
- let r = q(e).resolveInner(n, -1);
1847
- for (; r && !r.type.isTop; ) {
1848
- if (r.name == "CodeBlock" || r.name == "FencedCode" || r.name == "ProcessingInstructionBlock" || r.name == "CommentBlock" || r.name == "Link" || r.name == "Image")
1849
- return null;
1850
- r = r.parent;
1851
- }
1852
- return {
1853
- from: n - s[0].length,
1854
- to: n,
1855
- options: rn(),
1856
- validFor: /^<[:\-\.\w\u00b7-\uffff]*$/
1857
- };
1858
- }
1859
- let K = null;
1860
- function rn() {
1861
- if (K)
1862
- return K;
1863
- let t = xt(new pt(mt.create({ extensions: et }), 0, !0));
1864
- return K = t ? t.options : [];
1865
- }
1866
- export {
1867
- Kt as commonmarkLanguage,
1868
- tn as deleteMarkupBackward,
1869
- Wt as insertNewlineContinueMarkup,
1870
- ln as markdown,
1871
- nn as markdownKeymap,
1872
- ne as markdownLanguage
1873
- };