@digipair/skill-web-chatbot 0.90.0 → 0.91.0-0

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 (136) hide show
  1. package/.swcrc +28 -0
  2. package/README.md +7 -0
  3. package/eslint.config.mjs +22 -0
  4. package/package.json +22 -7
  5. package/rollup.config.cjs +28 -0
  6. package/src/digipair__engine.d.ts +2 -0
  7. package/src/handlebars.d.ts +1 -0
  8. package/src/index.html +18 -0
  9. package/src/lib/chat.element.ts +603 -0
  10. package/src/lib/common.data.ts +1 -0
  11. package/src/lib/config.ts +30 -0
  12. package/src/lib/digipair-full.data.ts +101 -0
  13. package/src/lib/digipair-full.element.ts +358 -0
  14. package/src/lib/digipair.data.ts +103 -0
  15. package/src/lib/digipair.element.ts +446 -0
  16. package/src/lib/inputs.element.ts +46 -0
  17. package/src/lib/mermaid.d.ts +1 -0
  18. package/src/lib/message.interface.ts +10 -0
  19. package/src/lib/pins/chatbot.actions.ts +32 -0
  20. package/src/lib/tools/css-selector.ts +12 -0
  21. package/tsconfig.json +13 -0
  22. package/tsconfig.lib.json +19 -0
  23. package/SAP-icons.cjs.js +0 -2489
  24. package/SAP-icons.cjs2.js +0 -2489
  25. package/SAP-icons.esm.js +0 -2482
  26. package/SAP-icons.esm2.js +0 -2482
  27. package/Tableau10-558cc280.cjs.js +0 -9
  28. package/Tableau10-558cc280.esm.js +0 -7
  29. package/arc-d1f6357e.cjs.js +0 -88
  30. package/arc-d1f6357e.esm.js +0 -86
  31. package/array-2ff2c7a6.cjs.js +0 -7
  32. package/array-2ff2c7a6.esm.js +0 -5
  33. package/blockDiagram-5dc23a45.cjs.js +0 -2921
  34. package/blockDiagram-5dc23a45.esm.js +0 -2919
  35. package/c4Diagram-1e775db3.cjs.js +0 -4387
  36. package/c4Diagram-1e775db3.esm.js +0 -4385
  37. package/channel-ebbc4130.cjs.js +0 -9
  38. package/channel-ebbc4130.esm.js +0 -7
  39. package/classDiagram-f52caa06.cjs.js +0 -209
  40. package/classDiagram-f52caa06.esm.js +0 -207
  41. package/classDiagram-v2-640c694e.cjs.js +0 -401
  42. package/classDiagram-v2-640c694e.esm.js +0 -399
  43. package/clone-afc2f047.cjs.js +0 -10
  44. package/clone-afc2f047.esm.js +0 -8
  45. package/createText-03b82060.cjs.js +0 -2936
  46. package/createText-03b82060.esm.js +0 -2933
  47. package/edges-16357fde.cjs.js +0 -1998
  48. package/edges-16357fde.esm.js +0 -1981
  49. package/erDiagram-c7ff1bec.cjs.js +0 -1807
  50. package/erDiagram-c7ff1bec.esm.js +0 -1805
  51. package/flowDb-9a89ea33.cjs.js +0 -5542
  52. package/flowDb-9a89ea33.esm.js +0 -5538
  53. package/flowDiagram-aadb13b0.cjs.js +0 -1351
  54. package/flowDiagram-aadb13b0.esm.js +0 -1349
  55. package/flowDiagram-v2-f2119625.cjs.js +0 -31
  56. package/flowDiagram-v2-f2119625.esm.js +0 -29
  57. package/flowchart-elk-definition-cf813a97.cjs.js +0 -50257
  58. package/flowchart-elk-definition-cf813a97.esm.js +0 -50255
  59. package/ganttDiagram-3c2fde2b.cjs.js +0 -3710
  60. package/ganttDiagram-3c2fde2b.esm.js +0 -3708
  61. package/gitGraphDiagram-c3a0619c.cjs.js +0 -3820
  62. package/gitGraphDiagram-c3a0619c.esm.js +0 -3818
  63. package/graph-0ee63739.cjs.js +0 -961
  64. package/graph-0ee63739.esm.js +0 -938
  65. package/index-bb6d8841.cjs.js +0 -648
  66. package/index-bb6d8841.esm.js +0 -646
  67. package/index.cjs.d.ts +0 -1
  68. package/index.cjs.js +0 -17
  69. package/index.cjs2.js +0 -60723
  70. package/index.esm.js +0 -1
  71. package/index.esm2.js +0 -60574
  72. package/infoDiagram-2f5c50c0.cjs.js +0 -460
  73. package/infoDiagram-2f5c50c0.esm.js +0 -458
  74. package/init-f9637058.cjs.js +0 -17
  75. package/init-f9637058.esm.js +0 -15
  76. package/journeyDiagram-14fe341a.cjs.js +0 -1061
  77. package/journeyDiagram-14fe341a.esm.js +0 -1059
  78. package/katex-d90b6d29.cjs.js +0 -25690
  79. package/katex-d90b6d29.esm.js +0 -25688
  80. package/layout-fd473db2.cjs.js +0 -1626
  81. package/layout-fd473db2.esm.js +0 -1619
  82. package/libs/engine/src/index.d.ts +0 -2
  83. package/libs/engine/src/lib/alias.interface.d.ts +0 -9
  84. package/libs/engine/src/lib/engine.d.ts +0 -13
  85. package/libs/engine/src/lib/pins-settings.interface.d.ts +0 -15
  86. package/libs/skill-web-chatbot/src/lib/chat.element.d.ts +0 -28
  87. package/libs/skill-web-chatbot/src/lib/common.data.d.ts +0 -1
  88. package/libs/skill-web-chatbot/src/lib/config.d.ts +0 -9
  89. package/libs/skill-web-chatbot/src/lib/digipair-full.data.d.ts +0 -1
  90. package/libs/skill-web-chatbot/src/lib/digipair-full.element.d.ts +0 -36
  91. package/libs/skill-web-chatbot/src/lib/digipair.data.d.ts +0 -1
  92. package/libs/skill-web-chatbot/src/lib/digipair.element.d.ts +0 -44
  93. package/libs/skill-web-chatbot/src/lib/inputs.element.d.ts +0 -10
  94. package/libs/skill-web-chatbot/src/lib/message.interface.d.ts +0 -10
  95. package/libs/skill-web-chatbot/src/lib/pins/chatbot.actions.d.ts +0 -1
  96. package/libs/skill-web-chatbot/src/lib/tools/css-selector.d.ts +0 -1
  97. package/line-24d93f1b.cjs.js +0 -34
  98. package/line-24d93f1b.esm.js +0 -32
  99. package/linear-9bcf74c4.cjs.js +0 -537
  100. package/linear-9bcf74c4.esm.js +0 -531
  101. package/mindmap-definition-9399c7e6.cjs.js +0 -20489
  102. package/mindmap-definition-9399c7e6.esm.js +0 -20487
  103. package/ordinal-5695958c.cjs.js +0 -331
  104. package/ordinal-5695958c.esm.js +0 -329
  105. package/path-428ebac9.cjs.js +0 -317
  106. package/path-428ebac9.esm.js +0 -314
  107. package/pieDiagram-828dae43.cjs.js +0 -951
  108. package/pieDiagram-828dae43.esm.js +0 -949
  109. package/quadrantDiagram-5fa00455.cjs.js +0 -2410
  110. package/quadrantDiagram-5fa00455.esm.js +0 -2408
  111. package/requirementDiagram-03163dc4.cjs.js +0 -2267
  112. package/requirementDiagram-03163dc4.esm.js +0 -2265
  113. package/sankeyDiagram-52ec8976.cjs.js +0 -1848
  114. package/sankeyDiagram-52ec8976.esm.js +0 -1846
  115. package/sequenceDiagram-b517d154.cjs.js +0 -5949
  116. package/sequenceDiagram-b517d154.esm.js +0 -5947
  117. package/stateDiagram-fca82b5b.cjs.js +0 -283
  118. package/stateDiagram-fca82b5b.esm.js +0 -281
  119. package/stateDiagram-v2-ed04200a.cjs.js +0 -373
  120. package/stateDiagram-v2-ed04200a.esm.js +0 -371
  121. package/styles-11e81fdd.cjs.js +0 -3944
  122. package/styles-11e81fdd.esm.js +0 -3940
  123. package/styles-cacbff60.cjs.js +0 -2120
  124. package/styles-cacbff60.esm.js +0 -2111
  125. package/styles-e75131e4.cjs.js +0 -671
  126. package/styles-e75131e4.esm.js +0 -661
  127. package/svgDrawCommon-ecc5f780.cjs.js +0 -68
  128. package/svgDrawCommon-ecc5f780.esm.js +0 -60
  129. package/timeline-definition-4ee9bff4.cjs.js +0 -1161
  130. package/timeline-definition-4ee9bff4.esm.js +0 -1159
  131. package/xychartDiagram-e5e6b652.cjs.js +0 -3150
  132. package/xychartDiagram-e5e6b652.esm.js +0 -3148
  133. /package/{index.d.ts → src/index.d.ts} +0 -0
  134. /package/{libs/skill-web-chatbot/src/index.d.ts → src/index.ts} +0 -0
  135. /package/{schema.fr.json → src/schema.fr.json} +0 -0
  136. /package/{schema.json → src/schema.json} +0 -0
@@ -1,2933 +0,0 @@
1
- import { c as L, ap as q0, aq as mh } from './index.esm2.js';
2
-
3
- function _array_like_to_array(arr, len) {
4
- if (len == null || len > arr.length) len = arr.length;
5
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
6
- return arr2;
7
- }
8
- function _array_with_holes(arr) {
9
- if (Array.isArray(arr)) return arr;
10
- }
11
- function _array_without_holes(arr) {
12
- if (Array.isArray(arr)) return _array_like_to_array(arr);
13
- }
14
- function _define_property(obj, key, value) {
15
- if (key in obj) {
16
- Object.defineProperty(obj, key, {
17
- value: value,
18
- enumerable: true,
19
- configurable: true,
20
- writable: true
21
- });
22
- } else {
23
- obj[key] = value;
24
- }
25
- return obj;
26
- }
27
- function _iterable_to_array(iter) {
28
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
29
- }
30
- function _iterable_to_array_limit(arr, i) {
31
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
32
- if (_i == null) return;
33
- var _arr = [];
34
- var _n = true;
35
- var _d = false;
36
- var _s, _e;
37
- try {
38
- for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
39
- _arr.push(_s.value);
40
- if (i && _arr.length === i) break;
41
- }
42
- } catch (err) {
43
- _d = true;
44
- _e = err;
45
- } finally{
46
- try {
47
- if (!_n && _i["return"] != null) _i["return"]();
48
- } finally{
49
- if (_d) throw _e;
50
- }
51
- }
52
- return _arr;
53
- }
54
- function _non_iterable_rest() {
55
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
56
- }
57
- function _non_iterable_spread() {
58
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
59
- }
60
- function _sliced_to_array(arr, i) {
61
- return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
62
- }
63
- function _to_array(arr) {
64
- return _array_with_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_rest();
65
- }
66
- function _to_consumable_array(arr) {
67
- return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
68
- }
69
- function _unsupported_iterable_to_array(o, minLen) {
70
- if (!o) return;
71
- if (typeof o === "string") return _array_like_to_array(o, minLen);
72
- var n = Object.prototype.toString.call(o).slice(8, -1);
73
- if (n === "Object" && o.constructor) n = o.constructor.name;
74
- if (n === "Map" || n === "Set") return Array.from(n);
75
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
76
- }
77
- var Tt = {};
78
- function Bt(n, r) {
79
- var t = r || Tt, e = typeof t.includeImageAlt == "boolean" ? t.includeImageAlt : !0, u = typeof t.includeHtml == "boolean" ? t.includeHtml : !0;
80
- return et(n, e, u);
81
- }
82
- function et(n, r, t) {
83
- if (Lt(n)) {
84
- if ("value" in n) return n.type === "html" && !t ? "" : n.value;
85
- if (r && "alt" in n && n.alt) return n.alt;
86
- if ("children" in n) return Vn(n.children, r, t);
87
- }
88
- return Array.isArray(n) ? Vn(n, r, t) : "";
89
- }
90
- function Vn(n, r, t) {
91
- var e = [];
92
- var u = -1;
93
- for(; ++u < n.length;)e[u] = et(n[u], r, t);
94
- return e.join("");
95
- }
96
- function Lt(n) {
97
- return !!(n && typeof n == "object");
98
- }
99
- function tn(n, r, t, e) {
100
- var _n, _n1;
101
- var u = n.length;
102
- var i = 0, l;
103
- if (r < 0 ? r = -r > u ? 0 : u + r : r = r > u ? u : r, t = t > 0 ? t : 0, e.length < 1e4) l = Array.from(e), l.unshift(r, t), (_n = n).splice.apply(_n, _to_consumable_array(l));
104
- else for(t && n.splice(r, t); i < e.length;)l = e.slice(i, i + 1e4), l.unshift(r, 0), (_n1 = n).splice.apply(_n1, _to_consumable_array(l)), i += 1e4, r += 1e4;
105
- }
106
- function Y(n, r) {
107
- return n.length > 0 ? (tn(n, n.length, 0, r), n) : r;
108
- }
109
- var Wn = {}.hasOwnProperty;
110
- function Ot(n) {
111
- var r = {};
112
- var t = -1;
113
- for(; ++t < n.length;)Dt(r, n[t]);
114
- return r;
115
- }
116
- function Dt(n, r) {
117
- var t;
118
- for(t in r){
119
- var u = (Wn.call(n, t) ? n[t] : void 0) || (n[t] = {}), i = r[t];
120
- var l = void 0;
121
- if (i) for(l in i){
122
- Wn.call(u, l) || (u[l] = []);
123
- var a = i[l];
124
- Pt(// @ts-expect-error Looks like a list.
125
- u[l], Array.isArray(a) ? a : a ? [
126
- a
127
- ] : []);
128
- }
129
- }
130
- }
131
- function Pt(n, r) {
132
- var t = -1;
133
- var e = [];
134
- for(; ++t < r.length;)(r[t].add === "after" ? n : e).push(r[t]);
135
- tn(n, 0, 0, e);
136
- }
137
- var _t = /[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/, nn = cn(/[A-Za-z]/), v = cn(/[\dA-Za-z]/), Mt = cn(/[#-'*+\--9=?A-Z^-~]/);
138
- function An(n) {
139
- return(// Special whitespace codes (which have negative values), C0 and Control
140
- // character DEL
141
- n !== null && (n < 32 || n === 127));
142
- }
143
- var zn = cn(/\d/), jt = cn(/[\dA-Fa-f]/), Rt = cn(/[!-/:-@[-`{-~]/);
144
- function C(n) {
145
- return n !== null && n < -2;
146
- }
147
- function Z(n) {
148
- return n !== null && (n < 0 || n === 32);
149
- }
150
- function z(n) {
151
- return n === -2 || n === -1 || n === 32;
152
- }
153
- var qt = cn(_t), Ht = cn(/\s/);
154
- function cn(n) {
155
- return r;
156
- function r(t) {
157
- return t !== null && n.test(String.fromCharCode(t));
158
- }
159
- }
160
- function O(n, r, t, e) {
161
- var u = e ? e - 1 : Number.POSITIVE_INFINITY;
162
- var i = 0;
163
- return l;
164
- function l(m) {
165
- return z(m) ? (n.enter(t), a(m)) : r(m);
166
- }
167
- function a(m) {
168
- return z(m) && i++ < u ? (n.consume(m), a) : (n.exit(t), r(m));
169
- }
170
- }
171
- var Nt = {
172
- tokenize: Vt
173
- };
174
- function Vt(n) {
175
- var r = n.attempt(this.parser.constructs.contentInitial, e, u);
176
- var t;
177
- return r;
178
- function e(a) {
179
- if (a === null) {
180
- n.consume(a);
181
- return;
182
- }
183
- return n.enter("lineEnding"), n.consume(a), n.exit("lineEnding"), O(n, r, "linePrefix");
184
- }
185
- function u(a) {
186
- return n.enter("paragraph"), i(a);
187
- }
188
- function i(a) {
189
- var m = n.enter("chunkText", {
190
- contentType: "text",
191
- previous: t
192
- });
193
- return t && (t.next = m), t = m, l(a);
194
- }
195
- function l(a) {
196
- if (a === null) {
197
- n.exit("chunkText"), n.exit("paragraph"), n.consume(a);
198
- return;
199
- }
200
- return C(a) ? (n.consume(a), n.exit("chunkText"), i) : (n.consume(a), l);
201
- }
202
- }
203
- var Wt = {
204
- tokenize: Qt
205
- }, Qn = {
206
- tokenize: Ut
207
- };
208
- function Qt(n) {
209
- var r = this, t = [];
210
- var e = 0, u, i, l;
211
- return a;
212
- function a(F) {
213
- if (e < t.length) {
214
- var D = t[e];
215
- return r.containerState = D[1], n.attempt(D[0].continuation, m, c)(F);
216
- }
217
- return c(F);
218
- }
219
- function m(F) {
220
- if (e++, r.containerState._closeFlow) {
221
- r.containerState._closeFlow = void 0, u && j();
222
- var D = r.events.length;
223
- var _ = D, k;
224
- for(; _--;)if (r.events[_][0] === "exit" && r.events[_][1].type === "chunkFlow") {
225
- k = r.events[_][1].end;
226
- break;
227
- }
228
- b(e);
229
- var T = D;
230
- for(; T < r.events.length;)r.events[T][1].end = Object.assign({}, k), T++;
231
- return tn(r.events, _ + 1, 0, r.events.slice(D)), r.events.length = T, c(F);
232
- }
233
- return a(F);
234
- }
235
- function c(F) {
236
- if (e === t.length) {
237
- if (!u) return x(F);
238
- if (u.currentConstruct && u.currentConstruct.concrete) return A(F);
239
- r.interrupt = !!(u.currentConstruct && !u._gfmTableDynamicInterruptHack);
240
- }
241
- return r.containerState = {}, n.check(Qn, p, f)(F);
242
- }
243
- function p(F) {
244
- return u && j(), b(e), x(F);
245
- }
246
- function f(F) {
247
- return r.parser.lazy[r.now().line] = e !== t.length, l = r.now().offset, A(F);
248
- }
249
- function x(F) {
250
- return r.containerState = {}, n.attempt(Qn, h, A)(F);
251
- }
252
- function h(F) {
253
- return e++, t.push([
254
- r.currentConstruct,
255
- r.containerState
256
- ]), x(F);
257
- }
258
- function A(F) {
259
- if (F === null) {
260
- u && j(), b(0), n.consume(F);
261
- return;
262
- }
263
- return u = u || r.parser.flow(r.now()), n.enter("chunkFlow", {
264
- contentType: "flow",
265
- previous: i,
266
- _tokenizer: u
267
- }), I(F);
268
- }
269
- function I(F) {
270
- if (F === null) {
271
- M(n.exit("chunkFlow"), !0), b(0), n.consume(F);
272
- return;
273
- }
274
- return C(F) ? (n.consume(F), M(n.exit("chunkFlow")), e = 0, r.interrupt = void 0, a) : (n.consume(F), I);
275
- }
276
- function M(F, D) {
277
- var _ = r.sliceStream(F);
278
- if (D && _.push(null), F.previous = i, i && (i.next = F), i = F, u.defineSkip(F.start), u.write(_), r.parser.lazy[F.start.line]) {
279
- var k = u.events.length;
280
- for(; k--;)if (// The token starts before the line ending…
281
- u.events[k][1].start.offset < l && // …and either is not ended yet…
282
- (!u.events[k][1].end || // …or ends after it.
283
- u.events[k][1].end.offset > l)) return;
284
- var T = r.events.length;
285
- var H = T, N, V;
286
- for(; H--;)if (r.events[H][0] === "exit" && r.events[H][1].type === "chunkFlow") {
287
- if (N) {
288
- V = r.events[H][1].end;
289
- break;
290
- }
291
- N = !0;
292
- }
293
- for(b(e), k = T; k < r.events.length;)r.events[k][1].end = Object.assign({}, V), k++;
294
- tn(r.events, H + 1, 0, r.events.slice(T)), r.events.length = k;
295
- }
296
- }
297
- function b(F) {
298
- var D = t.length;
299
- for(; D-- > F;){
300
- var _ = t[D];
301
- r.containerState = _[1], _[0].exit.call(r, n);
302
- }
303
- t.length = F;
304
- }
305
- function j() {
306
- u.write([
307
- null
308
- ]), i = void 0, u = void 0, r.containerState._closeFlow = void 0;
309
- }
310
- }
311
- function Ut(n, r, t) {
312
- return O(n, n.attempt(this.parser.constructs.document, r, t), "linePrefix", this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4);
313
- }
314
- function Un(n) {
315
- if (n === null || Z(n) || Ht(n)) return 1;
316
- if (qt(n)) return 2;
317
- }
318
- function Ln(n, r, t) {
319
- var e = [];
320
- var u = -1;
321
- for(; ++u < n.length;){
322
- var i = n[u].resolveAll;
323
- i && !e.includes(i) && (r = i(r, t), e.push(i));
324
- }
325
- return r;
326
- }
327
- var In = {
328
- name: "attention",
329
- tokenize: Zt,
330
- resolveAll: $t
331
- };
332
- function $t(n, r) {
333
- var t = -1, e, u, i, l, a, m, c, p;
334
- for(; ++t < n.length;)if (n[t][0] === "enter" && n[t][1].type === "attentionSequence" && n[t][1]._close) {
335
- for(e = t; e--;)if (n[e][0] === "exit" && n[e][1].type === "attentionSequence" && n[e][1]._open && // If the markers are the same:
336
- r.sliceSerialize(n[e][1]).charCodeAt(0) === r.sliceSerialize(n[t][1]).charCodeAt(0)) {
337
- if ((n[e][1]._close || n[t][1]._open) && (n[t][1].end.offset - n[t][1].start.offset) % 3 && !((n[e][1].end.offset - n[e][1].start.offset + n[t][1].end.offset - n[t][1].start.offset) % 3)) continue;
338
- m = n[e][1].end.offset - n[e][1].start.offset > 1 && n[t][1].end.offset - n[t][1].start.offset > 1 ? 2 : 1;
339
- var f = Object.assign({}, n[e][1].end), x = Object.assign({}, n[t][1].start);
340
- $n(f, -m), $n(x, m), l = {
341
- type: m > 1 ? "strongSequence" : "emphasisSequence",
342
- start: f,
343
- end: Object.assign({}, n[e][1].end)
344
- }, a = {
345
- type: m > 1 ? "strongSequence" : "emphasisSequence",
346
- start: Object.assign({}, n[t][1].start),
347
- end: x
348
- }, i = {
349
- type: m > 1 ? "strongText" : "emphasisText",
350
- start: Object.assign({}, n[e][1].end),
351
- end: Object.assign({}, n[t][1].start)
352
- }, u = {
353
- type: m > 1 ? "strong" : "emphasis",
354
- start: Object.assign({}, l.start),
355
- end: Object.assign({}, a.end)
356
- }, n[e][1].end = Object.assign({}, l.start), n[t][1].start = Object.assign({}, a.end), c = [], n[e][1].end.offset - n[e][1].start.offset && (c = Y(c, [
357
- [
358
- "enter",
359
- n[e][1],
360
- r
361
- ],
362
- [
363
- "exit",
364
- n[e][1],
365
- r
366
- ]
367
- ])), c = Y(c, [
368
- [
369
- "enter",
370
- u,
371
- r
372
- ],
373
- [
374
- "enter",
375
- l,
376
- r
377
- ],
378
- [
379
- "exit",
380
- l,
381
- r
382
- ],
383
- [
384
- "enter",
385
- i,
386
- r
387
- ]
388
- ]), c = Y(c, Ln(r.parser.constructs.insideSpan.null, n.slice(e + 1, t), r)), c = Y(c, [
389
- [
390
- "exit",
391
- i,
392
- r
393
- ],
394
- [
395
- "enter",
396
- a,
397
- r
398
- ],
399
- [
400
- "exit",
401
- a,
402
- r
403
- ],
404
- [
405
- "exit",
406
- u,
407
- r
408
- ]
409
- ]), n[t][1].end.offset - n[t][1].start.offset ? (p = 2, c = Y(c, [
410
- [
411
- "enter",
412
- n[t][1],
413
- r
414
- ],
415
- [
416
- "exit",
417
- n[t][1],
418
- r
419
- ]
420
- ])) : p = 0, tn(n, e - 1, t - e + 3, c), t = e + c.length - p - 2;
421
- break;
422
- }
423
- }
424
- for(t = -1; ++t < n.length;)n[t][1].type === "attentionSequence" && (n[t][1].type = "data");
425
- return n;
426
- }
427
- function Zt(n, r) {
428
- var t = this.parser.constructs.attentionMarkers.null, e = this.previous, u = Un(e);
429
- var i;
430
- return l;
431
- function l(m) {
432
- return i = m, n.enter("attentionSequence"), a(m);
433
- }
434
- function a(m) {
435
- if (m === i) return n.consume(m), a;
436
- var c = n.exit("attentionSequence"), p = Un(m), f = !p || p === 2 && u || t.includes(m), x = !u || u === 2 && p || t.includes(e);
437
- return c._open = !!(i === 42 ? f : f && (u || !x)), c._close = !!(i === 42 ? x : x && (p || !f)), r(m);
438
- }
439
- }
440
- function $n(n, r) {
441
- n.column += r, n.offset += r, n._bufferIndex += r;
442
- }
443
- var Yt = {
444
- name: "autolink",
445
- tokenize: Gt
446
- };
447
- function Gt(n, r, t) {
448
- var e = 0;
449
- return u;
450
- function u(h) {
451
- return n.enter("autolink"), n.enter("autolinkMarker"), n.consume(h), n.exit("autolinkMarker"), n.enter("autolinkProtocol"), i;
452
- }
453
- function i(h) {
454
- return nn(h) ? (n.consume(h), l) : c(h);
455
- }
456
- function l(h) {
457
- return h === 43 || h === 45 || h === 46 || v(h) ? (e = 1, a(h)) : c(h);
458
- }
459
- function a(h) {
460
- return h === 58 ? (n.consume(h), e = 0, m) : (h === 43 || h === 45 || h === 46 || v(h)) && e++ < 32 ? (n.consume(h), a) : (e = 0, c(h));
461
- }
462
- function m(h) {
463
- return h === 62 ? (n.exit("autolinkProtocol"), n.enter("autolinkMarker"), n.consume(h), n.exit("autolinkMarker"), n.exit("autolink"), r) : h === null || h === 32 || h === 60 || An(h) ? t(h) : (n.consume(h), m);
464
- }
465
- function c(h) {
466
- return h === 64 ? (n.consume(h), p) : Mt(h) ? (n.consume(h), c) : t(h);
467
- }
468
- function p(h) {
469
- return v(h) ? f(h) : t(h);
470
- }
471
- function f(h) {
472
- return h === 46 ? (n.consume(h), e = 0, p) : h === 62 ? (n.exit("autolinkProtocol").type = "autolinkEmail", n.enter("autolinkMarker"), n.consume(h), n.exit("autolinkMarker"), n.exit("autolink"), r) : x(h);
473
- }
474
- function x(h) {
475
- if ((h === 45 || v(h)) && e++ < 63) {
476
- var A = h === 45 ? x : f;
477
- return n.consume(h), A;
478
- }
479
- return t(h);
480
- }
481
- }
482
- var Sn = {
483
- tokenize: Jt,
484
- partial: !0
485
- };
486
- function Jt(n, r, t) {
487
- return e;
488
- function e(i) {
489
- return z(i) ? O(n, u, "linePrefix")(i) : u(i);
490
- }
491
- function u(i) {
492
- return i === null || C(i) ? r(i) : t(i);
493
- }
494
- }
495
- var rt = {
496
- name: "blockQuote",
497
- tokenize: Kt,
498
- continuation: {
499
- tokenize: Xt
500
- },
501
- exit: vt
502
- };
503
- function Kt(n, r, t) {
504
- var e = this;
505
- return u;
506
- function u(l) {
507
- if (l === 62) {
508
- var a = e.containerState;
509
- return a.open || (n.enter("blockQuote", {
510
- _container: !0
511
- }), a.open = !0), n.enter("blockQuotePrefix"), n.enter("blockQuoteMarker"), n.consume(l), n.exit("blockQuoteMarker"), i;
512
- }
513
- return t(l);
514
- }
515
- function i(l) {
516
- return z(l) ? (n.enter("blockQuotePrefixWhitespace"), n.consume(l), n.exit("blockQuotePrefixWhitespace"), n.exit("blockQuotePrefix"), r) : (n.exit("blockQuotePrefix"), r(l));
517
- }
518
- }
519
- function Xt(n, r, t) {
520
- var e = this;
521
- return u;
522
- function u(l) {
523
- return z(l) ? O(n, i, "linePrefix", e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(l) : i(l);
524
- }
525
- function i(l) {
526
- return n.attempt(rt, r, t)(l);
527
- }
528
- }
529
- function vt(n) {
530
- n.exit("blockQuote");
531
- }
532
- var it = {
533
- name: "characterEscape",
534
- tokenize: ne
535
- };
536
- function ne(n, r, t) {
537
- return e;
538
- function e(i) {
539
- return n.enter("characterEscape"), n.enter("escapeMarker"), n.consume(i), n.exit("escapeMarker"), u;
540
- }
541
- function u(i) {
542
- return Rt(i) ? (n.enter("characterEscapeValue"), n.consume(i), n.exit("characterEscapeValue"), n.exit("characterEscape"), r) : t(i);
543
- }
544
- }
545
- var Zn = document.createElement("i");
546
- function On(n) {
547
- var r = "&" + n + ";";
548
- Zn.innerHTML = r;
549
- var t = Zn.textContent;
550
- return t.charCodeAt(t.length - 1) === 59 && n !== "semi" || t === r ? !1 : t;
551
- }
552
- var ut = {
553
- name: "characterReference",
554
- tokenize: te
555
- };
556
- function te(n, r, t) {
557
- var e = this;
558
- var u = 0, i, l;
559
- return a;
560
- function a(f) {
561
- return n.enter("characterReference"), n.enter("characterReferenceMarker"), n.consume(f), n.exit("characterReferenceMarker"), m;
562
- }
563
- function m(f) {
564
- return f === 35 ? (n.enter("characterReferenceMarkerNumeric"), n.consume(f), n.exit("characterReferenceMarkerNumeric"), c) : (n.enter("characterReferenceValue"), i = 31, l = v, p(f));
565
- }
566
- function c(f) {
567
- return f === 88 || f === 120 ? (n.enter("characterReferenceMarkerHexadecimal"), n.consume(f), n.exit("characterReferenceMarkerHexadecimal"), n.enter("characterReferenceValue"), i = 6, l = jt, p) : (n.enter("characterReferenceValue"), i = 7, l = zn, p(f));
568
- }
569
- function p(f) {
570
- if (f === 59 && u) {
571
- var x = n.exit("characterReferenceValue");
572
- return l === v && !On(e.sliceSerialize(x)) ? t(f) : (n.enter("characterReferenceMarker"), n.consume(f), n.exit("characterReferenceMarker"), n.exit("characterReference"), r);
573
- }
574
- return l(f) && u++ < i ? (n.consume(f), p) : t(f);
575
- }
576
- }
577
- var Yn = {
578
- tokenize: re,
579
- partial: !0
580
- }, Gn = {
581
- name: "codeFenced",
582
- tokenize: ee,
583
- concrete: !0
584
- };
585
- function ee(n, r, t) {
586
- var e = this, u = {
587
- tokenize: _,
588
- partial: !0
589
- };
590
- var i = 0, l = 0, a;
591
- return m;
592
- function m(k) {
593
- return c(k);
594
- }
595
- function c(k) {
596
- var T = e.events[e.events.length - 1];
597
- return i = T && T[1].type === "linePrefix" ? T[2].sliceSerialize(T[1], !0).length : 0, a = k, n.enter("codeFenced"), n.enter("codeFencedFence"), n.enter("codeFencedFenceSequence"), p(k);
598
- }
599
- function p(k) {
600
- return k === a ? (l++, n.consume(k), p) : l < 3 ? t(k) : (n.exit("codeFencedFenceSequence"), z(k) ? O(n, f, "whitespace")(k) : f(k));
601
- }
602
- function f(k) {
603
- return k === null || C(k) ? (n.exit("codeFencedFence"), e.interrupt ? r(k) : n.check(Yn, I, D)(k)) : (n.enter("codeFencedFenceInfo"), n.enter("chunkString", {
604
- contentType: "string"
605
- }), x(k));
606
- }
607
- function x(k) {
608
- return k === null || C(k) ? (n.exit("chunkString"), n.exit("codeFencedFenceInfo"), f(k)) : z(k) ? (n.exit("chunkString"), n.exit("codeFencedFenceInfo"), O(n, h, "whitespace")(k)) : k === 96 && k === a ? t(k) : (n.consume(k), x);
609
- }
610
- function h(k) {
611
- return k === null || C(k) ? f(k) : (n.enter("codeFencedFenceMeta"), n.enter("chunkString", {
612
- contentType: "string"
613
- }), A(k));
614
- }
615
- function A(k) {
616
- return k === null || C(k) ? (n.exit("chunkString"), n.exit("codeFencedFenceMeta"), f(k)) : k === 96 && k === a ? t(k) : (n.consume(k), A);
617
- }
618
- function I(k) {
619
- return n.attempt(u, D, M)(k);
620
- }
621
- function M(k) {
622
- return n.enter("lineEnding"), n.consume(k), n.exit("lineEnding"), b;
623
- }
624
- function b(k) {
625
- return i > 0 && z(k) ? O(n, j, "linePrefix", i + 1)(k) : j(k);
626
- }
627
- function j(k) {
628
- return k === null || C(k) ? n.check(Yn, I, D)(k) : (n.enter("codeFlowValue"), F(k));
629
- }
630
- function F(k) {
631
- return k === null || C(k) ? (n.exit("codeFlowValue"), j(k)) : (n.consume(k), F);
632
- }
633
- function D(k) {
634
- return n.exit("codeFenced"), r(k);
635
- }
636
- function _(k, T, H) {
637
- var N = 0;
638
- return V;
639
- function V(w) {
640
- return k.enter("lineEnding"), k.consume(w), k.exit("lineEnding"), y;
641
- }
642
- function y(w) {
643
- return k.enter("codeFencedFence"), z(w) ? O(k, S, "linePrefix", e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(w) : S(w);
644
- }
645
- function S(w) {
646
- return w === a ? (k.enter("codeFencedFenceSequence"), P(w)) : H(w);
647
- }
648
- function P(w) {
649
- return w === a ? (N++, k.consume(w), P) : N >= l ? (k.exit("codeFencedFenceSequence"), z(w) ? O(k, R, "whitespace")(w) : R(w)) : H(w);
650
- }
651
- function R(w) {
652
- return w === null || C(w) ? (k.exit("codeFencedFence"), T(w)) : H(w);
653
- }
654
- }
655
- }
656
- function re(n, r, t) {
657
- var e = this;
658
- return u;
659
- function u(l) {
660
- return l === null ? t(l) : (n.enter("lineEnding"), n.consume(l), n.exit("lineEnding"), i);
661
- }
662
- function i(l) {
663
- return e.parser.lazy[e.now().line] ? t(l) : r(l);
664
- }
665
- }
666
- var Cn = {
667
- name: "codeIndented",
668
- tokenize: ue
669
- }, ie = {
670
- tokenize: le,
671
- partial: !0
672
- };
673
- function ue(n, r, t) {
674
- var e = this;
675
- return u;
676
- function u(c) {
677
- return n.enter("codeIndented"), O(n, i, "linePrefix", 4 + 1)(c);
678
- }
679
- function i(c) {
680
- var p = e.events[e.events.length - 1];
681
- return p && p[1].type === "linePrefix" && p[2].sliceSerialize(p[1], !0).length >= 4 ? l(c) : t(c);
682
- }
683
- function l(c) {
684
- return c === null ? m(c) : C(c) ? n.attempt(ie, l, m)(c) : (n.enter("codeFlowValue"), a(c));
685
- }
686
- function a(c) {
687
- return c === null || C(c) ? (n.exit("codeFlowValue"), l(c)) : (n.consume(c), a);
688
- }
689
- function m(c) {
690
- return n.exit("codeIndented"), r(c);
691
- }
692
- }
693
- function le(n, r, t) {
694
- var e = this;
695
- return u;
696
- function u(l) {
697
- return e.parser.lazy[e.now().line] ? t(l) : C(l) ? (n.enter("lineEnding"), n.consume(l), n.exit("lineEnding"), u) : O(n, i, "linePrefix", 4 + 1)(l);
698
- }
699
- function i(l) {
700
- var a = e.events[e.events.length - 1];
701
- return a && a[1].type === "linePrefix" && a[2].sliceSerialize(a[1], !0).length >= 4 ? r(l) : C(l) ? u(l) : t(l);
702
- }
703
- }
704
- var ae = {
705
- name: "codeText",
706
- tokenize: ce,
707
- resolve: oe,
708
- previous: se
709
- };
710
- function oe(n) {
711
- var r = n.length - 4, t = 3, e, u;
712
- if ((n[t][1].type === "lineEnding" || n[t][1].type === "space") && (n[r][1].type === "lineEnding" || n[r][1].type === "space")) {
713
- for(e = t; ++e < r;)if (n[e][1].type === "codeTextData") {
714
- n[t][1].type = "codeTextPadding", n[r][1].type = "codeTextPadding", t += 2, r -= 2;
715
- break;
716
- }
717
- }
718
- for(e = t - 1, r++; ++e <= r;)u === void 0 ? e !== r && n[e][1].type !== "lineEnding" && (u = e) : (e === r || n[e][1].type === "lineEnding") && (n[u][1].type = "codeTextData", e !== u + 2 && (n[u][1].end = n[e - 1][1].end, n.splice(u + 2, e - u - 2), r -= e - u - 2, e = u + 2), u = void 0);
719
- return n;
720
- }
721
- function se(n) {
722
- return n !== 96 || this.events[this.events.length - 1][1].type === "characterEscape";
723
- }
724
- function ce(n, r, t) {
725
- var e = 0, u, i;
726
- return l;
727
- function l(f) {
728
- return n.enter("codeText"), n.enter("codeTextSequence"), a(f);
729
- }
730
- function a(f) {
731
- return f === 96 ? (n.consume(f), e++, a) : (n.exit("codeTextSequence"), m(f));
732
- }
733
- function m(f) {
734
- return f === null ? t(f) : f === 32 ? (n.enter("space"), n.consume(f), n.exit("space"), m) : f === 96 ? (i = n.enter("codeTextSequence"), u = 0, p(f)) : C(f) ? (n.enter("lineEnding"), n.consume(f), n.exit("lineEnding"), m) : (n.enter("codeTextData"), c(f));
735
- }
736
- function c(f) {
737
- return f === null || f === 32 || f === 96 || C(f) ? (n.exit("codeTextData"), m(f)) : (n.consume(f), c);
738
- }
739
- function p(f) {
740
- return f === 96 ? (n.consume(f), u++, p) : u === e ? (n.exit("codeTextSequence"), n.exit("codeText"), r(f)) : (i.type = "codeTextData", c(f));
741
- }
742
- }
743
- function lt(n) {
744
- var r = {};
745
- var t = -1, e, u, i, l, a, m, c;
746
- for(; ++t < n.length;){
747
- for(; (t in r);)t = r[t];
748
- if (e = n[t], t && e[1].type === "chunkFlow" && n[t - 1][1].type === "listItemPrefix" && (m = e[1]._tokenizer.events, i = 0, i < m.length && m[i][1].type === "lineEndingBlank" && (i += 2), i < m.length && m[i][1].type === "content")) for(; ++i < m.length && m[i][1].type !== "content";)m[i][1].type === "chunkText" && (m[i][1]._isInFirstContentOfListItem = !0, i++);
749
- if (e[0] === "enter") e[1].contentType && (Object.assign(r, he(n, t)), t = r[t], c = !0);
750
- else if (e[1]._container) {
751
- for(i = t, u = void 0; i-- && (l = n[i], l[1].type === "lineEnding" || l[1].type === "lineEndingBlank");)l[0] === "enter" && (u && (n[u][1].type = "lineEndingBlank"), l[1].type = "lineEnding", u = i);
752
- u && (e[1].end = Object.assign({}, n[u][1].start), a = n.slice(u, t), a.unshift(e), tn(n, u, t - u + 1, a));
753
- }
754
- }
755
- return !c;
756
- }
757
- function he(n, r) {
758
- var t = n[r][1], e = n[r][2];
759
- var u = r - 1;
760
- var i = [], l = t._tokenizer || e.parser[t.contentType](t.start), a = l.events, m = [], c = {};
761
- var p, f, x = -1, h = t, A = 0, I = 0;
762
- var M = [
763
- I
764
- ];
765
- for(; h;){
766
- for(; n[++u][1] !== h;);
767
- i.push(u), h._tokenizer || (p = e.sliceStream(h), h.next || p.push(null), f && l.defineSkip(h.start), h._isInFirstContentOfListItem && (l._gfmTasklistFirstContentOfListItem = !0), l.write(p), h._isInFirstContentOfListItem && (l._gfmTasklistFirstContentOfListItem = void 0)), f = h, h = h.next;
768
- }
769
- for(h = t; ++x < a.length;)// Find a void token that includes a break.
770
- a[x][0] === "exit" && a[x - 1][0] === "enter" && a[x][1].type === a[x - 1][1].type && a[x][1].start.line !== a[x][1].end.line && (I = x + 1, M.push(I), h._tokenizer = void 0, h.previous = void 0, h = h.next);
771
- for(l.events = [], h ? (h._tokenizer = void 0, h.previous = void 0) : M.pop(), x = M.length; x--;){
772
- var b = a.slice(M[x], M[x + 1]), j = i.pop();
773
- m.unshift([
774
- j,
775
- j + b.length - 1
776
- ]), tn(n, j, 2, b);
777
- }
778
- for(x = -1; ++x < m.length;)c[A + m[x][0]] = A + m[x][1], A += m[x][1] - m[x][0] - 1;
779
- return c;
780
- }
781
- var pe = {
782
- tokenize: xe,
783
- resolve: me
784
- }, fe = {
785
- tokenize: ge,
786
- partial: !0
787
- };
788
- function me(n) {
789
- return lt(n), n;
790
- }
791
- function xe(n, r) {
792
- var t;
793
- return e;
794
- function e(a) {
795
- return n.enter("content"), t = n.enter("chunkContent", {
796
- contentType: "content"
797
- }), u(a);
798
- }
799
- function u(a) {
800
- return a === null ? i(a) : C(a) ? n.check(fe, l, i)(a) : (n.consume(a), u);
801
- }
802
- function i(a) {
803
- return n.exit("chunkContent"), n.exit("content"), r(a);
804
- }
805
- function l(a) {
806
- return n.consume(a), n.exit("chunkContent"), t.next = n.enter("chunkContent", {
807
- contentType: "content",
808
- previous: t
809
- }), t = t.next, u;
810
- }
811
- }
812
- function ge(n, r, t) {
813
- var e = this;
814
- return u;
815
- function u(l) {
816
- return n.exit("chunkContent"), n.enter("lineEnding"), n.consume(l), n.exit("lineEnding"), O(n, i, "linePrefix");
817
- }
818
- function i(l) {
819
- if (l === null || C(l)) return t(l);
820
- var a = e.events[e.events.length - 1];
821
- return !e.parser.constructs.disable.null.includes("codeIndented") && a && a[1].type === "linePrefix" && a[2].sliceSerialize(a[1], !0).length >= 4 ? r(l) : n.interrupt(e.parser.constructs.flow, t, r)(l);
822
- }
823
- }
824
- function at(n, r, t, e, u, i, l, a, m) {
825
- var c = m || Number.POSITIVE_INFINITY;
826
- var p = 0;
827
- return f;
828
- function f(b) {
829
- return b === 60 ? (n.enter(e), n.enter(u), n.enter(i), n.consume(b), n.exit(i), x) : b === null || b === 32 || b === 41 || An(b) ? t(b) : (n.enter(e), n.enter(l), n.enter(a), n.enter("chunkString", {
830
- contentType: "string"
831
- }), I(b));
832
- }
833
- function x(b) {
834
- return b === 62 ? (n.enter(i), n.consume(b), n.exit(i), n.exit(u), n.exit(e), r) : (n.enter(a), n.enter("chunkString", {
835
- contentType: "string"
836
- }), h(b));
837
- }
838
- function h(b) {
839
- return b === 62 ? (n.exit("chunkString"), n.exit(a), x(b)) : b === null || b === 60 || C(b) ? t(b) : (n.consume(b), b === 92 ? A : h);
840
- }
841
- function A(b) {
842
- return b === 60 || b === 62 || b === 92 ? (n.consume(b), h) : h(b);
843
- }
844
- function I(b) {
845
- return !p && (b === null || b === 41 || Z(b)) ? (n.exit("chunkString"), n.exit(a), n.exit(l), n.exit(e), r(b)) : p < c && b === 40 ? (n.consume(b), p++, I) : b === 41 ? (n.consume(b), p--, I) : b === null || b === 32 || b === 40 || An(b) ? t(b) : (n.consume(b), b === 92 ? M : I);
846
- }
847
- function M(b) {
848
- return b === 40 || b === 41 || b === 92 ? (n.consume(b), I) : I(b);
849
- }
850
- }
851
- function ot(n, r, t, e, u, i) {
852
- var l = this;
853
- var a = 0, m;
854
- return c;
855
- function c(h) {
856
- return n.enter(e), n.enter(u), n.consume(h), n.exit(u), n.enter(i), p;
857
- }
858
- function p(h) {
859
- return a > 999 || h === null || h === 91 || h === 93 && !m || // To do: remove in the future once we’ve switched from
860
- // `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,
861
- // which doesn’t need this.
862
- // Hidden footnotes hook.
863
- /* c8 ignore next 3 */ h === 94 && !a && "_hiddenFootnoteSupport" in l.parser.constructs ? t(h) : h === 93 ? (n.exit(i), n.enter(u), n.consume(h), n.exit(u), n.exit(e), r) : C(h) ? (n.enter("lineEnding"), n.consume(h), n.exit("lineEnding"), p) : (n.enter("chunkString", {
864
- contentType: "string"
865
- }), f(h));
866
- }
867
- function f(h) {
868
- return h === null || h === 91 || h === 93 || C(h) || a++ > 999 ? (n.exit("chunkString"), p(h)) : (n.consume(h), m || (m = !z(h)), h === 92 ? x : f);
869
- }
870
- function x(h) {
871
- return h === 91 || h === 92 || h === 93 ? (n.consume(h), a++, f) : f(h);
872
- }
873
- }
874
- function st(n, r, t, e, u, i) {
875
- var l;
876
- return a;
877
- function a(x) {
878
- return x === 34 || x === 39 || x === 40 ? (n.enter(e), n.enter(u), n.consume(x), n.exit(u), l = x === 40 ? 41 : x, m) : t(x);
879
- }
880
- function m(x) {
881
- return x === l ? (n.enter(u), n.consume(x), n.exit(u), n.exit(e), r) : (n.enter(i), c(x));
882
- }
883
- function c(x) {
884
- return x === l ? (n.exit(i), m(l)) : x === null ? t(x) : C(x) ? (n.enter("lineEnding"), n.consume(x), n.exit("lineEnding"), O(n, c, "linePrefix")) : (n.enter("chunkString", {
885
- contentType: "string"
886
- }), p(x));
887
- }
888
- function p(x) {
889
- return x === l || x === null || C(x) ? (n.exit("chunkString"), c(x)) : (n.consume(x), x === 92 ? f : p);
890
- }
891
- function f(x) {
892
- return x === l || x === 92 ? (n.consume(x), p) : p(x);
893
- }
894
- }
895
- function dn(n, r) {
896
- var t;
897
- return e;
898
- function e(u) {
899
- return C(u) ? (n.enter("lineEnding"), n.consume(u), n.exit("lineEnding"), t = !0, e) : z(u) ? O(n, e, t ? "linePrefix" : "lineSuffix")(u) : r(u);
900
- }
901
- }
902
- function xn(n) {
903
- return n.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
904
- }
905
- var ke = {
906
- name: "definition",
907
- tokenize: be
908
- }, de = {
909
- tokenize: ye,
910
- partial: !0
911
- };
912
- function be(n, r, t) {
913
- var e = this;
914
- var u;
915
- return i;
916
- function i(h) {
917
- return n.enter("definition"), l(h);
918
- }
919
- function l(h) {
920
- return ot.call(e, n, a, // Note: we don’t need to reset the way `markdown-rs` does.
921
- t, "definitionLabel", "definitionLabelMarker", "definitionLabelString")(h);
922
- }
923
- function a(h) {
924
- return u = xn(e.sliceSerialize(e.events[e.events.length - 1][1]).slice(1, -1)), h === 58 ? (n.enter("definitionMarker"), n.consume(h), n.exit("definitionMarker"), m) : t(h);
925
- }
926
- function m(h) {
927
- return Z(h) ? dn(n, c)(h) : c(h);
928
- }
929
- function c(h) {
930
- return at(n, p, // Note: we don’t need to reset the way `markdown-rs` does.
931
- t, "definitionDestination", "definitionDestinationLiteral", "definitionDestinationLiteralMarker", "definitionDestinationRaw", "definitionDestinationString")(h);
932
- }
933
- function p(h) {
934
- return n.attempt(de, f, f)(h);
935
- }
936
- function f(h) {
937
- return z(h) ? O(n, x, "whitespace")(h) : x(h);
938
- }
939
- function x(h) {
940
- return h === null || C(h) ? (n.exit("definition"), e.parser.defined.push(u), r(h)) : t(h);
941
- }
942
- }
943
- function ye(n, r, t) {
944
- return e;
945
- function e(a) {
946
- return Z(a) ? dn(n, u)(a) : t(a);
947
- }
948
- function u(a) {
949
- return st(n, i, t, "definitionTitle", "definitionTitleMarker", "definitionTitleString")(a);
950
- }
951
- function i(a) {
952
- return z(a) ? O(n, l, "whitespace")(a) : l(a);
953
- }
954
- function l(a) {
955
- return a === null || C(a) ? r(a) : t(a);
956
- }
957
- }
958
- var Se = {
959
- name: "hardBreakEscape",
960
- tokenize: Fe
961
- };
962
- function Fe(n, r, t) {
963
- return e;
964
- function e(i) {
965
- return n.enter("hardBreakEscape"), n.consume(i), u;
966
- }
967
- function u(i) {
968
- return C(i) ? (n.exit("hardBreakEscape"), r(i)) : t(i);
969
- }
970
- }
971
- var Ee = {
972
- name: "headingAtx",
973
- tokenize: we,
974
- resolve: Ce
975
- };
976
- function Ce(n, r) {
977
- var t = n.length - 2, e = 3, u, i;
978
- return n[e][1].type === "whitespace" && (e += 2), t - 2 > e && n[t][1].type === "whitespace" && (t -= 2), n[t][1].type === "atxHeadingSequence" && (e === t - 1 || t - 4 > e && n[t - 2][1].type === "whitespace") && (t -= e + 1 === t ? 2 : 4), t > e && (u = {
979
- type: "atxHeadingText",
980
- start: n[e][1].start,
981
- end: n[t][1].end
982
- }, i = {
983
- type: "chunkText",
984
- start: n[e][1].start,
985
- end: n[t][1].end,
986
- contentType: "text"
987
- }, tn(n, e, t - e + 1, [
988
- [
989
- "enter",
990
- u,
991
- r
992
- ],
993
- [
994
- "enter",
995
- i,
996
- r
997
- ],
998
- [
999
- "exit",
1000
- i,
1001
- r
1002
- ],
1003
- [
1004
- "exit",
1005
- u,
1006
- r
1007
- ]
1008
- ])), n;
1009
- }
1010
- function we(n, r, t) {
1011
- var e = 0;
1012
- return u;
1013
- function u(p) {
1014
- return n.enter("atxHeading"), i(p);
1015
- }
1016
- function i(p) {
1017
- return n.enter("atxHeadingSequence"), l(p);
1018
- }
1019
- function l(p) {
1020
- return p === 35 && e++ < 6 ? (n.consume(p), l) : p === null || Z(p) ? (n.exit("atxHeadingSequence"), a(p)) : t(p);
1021
- }
1022
- function a(p) {
1023
- return p === 35 ? (n.enter("atxHeadingSequence"), m(p)) : p === null || C(p) ? (n.exit("atxHeading"), r(p)) : z(p) ? O(n, a, "whitespace")(p) : (n.enter("atxHeadingText"), c(p));
1024
- }
1025
- function m(p) {
1026
- return p === 35 ? (n.consume(p), m) : (n.exit("atxHeadingSequence"), a(p));
1027
- }
1028
- function c(p) {
1029
- return p === null || p === 35 || Z(p) ? (n.exit("atxHeadingText"), a(p)) : (n.consume(p), c);
1030
- }
1031
- }
1032
- var Ae = [
1033
- "address",
1034
- "article",
1035
- "aside",
1036
- "base",
1037
- "basefont",
1038
- "blockquote",
1039
- "body",
1040
- "caption",
1041
- "center",
1042
- "col",
1043
- "colgroup",
1044
- "dd",
1045
- "details",
1046
- "dialog",
1047
- "dir",
1048
- "div",
1049
- "dl",
1050
- "dt",
1051
- "fieldset",
1052
- "figcaption",
1053
- "figure",
1054
- "footer",
1055
- "form",
1056
- "frame",
1057
- "frameset",
1058
- "h1",
1059
- "h2",
1060
- "h3",
1061
- "h4",
1062
- "h5",
1063
- "h6",
1064
- "head",
1065
- "header",
1066
- "hr",
1067
- "html",
1068
- "iframe",
1069
- "legend",
1070
- "li",
1071
- "link",
1072
- "main",
1073
- "menu",
1074
- "menuitem",
1075
- "nav",
1076
- "noframes",
1077
- "ol",
1078
- "optgroup",
1079
- "option",
1080
- "p",
1081
- "param",
1082
- "search",
1083
- "section",
1084
- "summary",
1085
- "table",
1086
- "tbody",
1087
- "td",
1088
- "tfoot",
1089
- "th",
1090
- "thead",
1091
- "title",
1092
- "tr",
1093
- "track",
1094
- "ul"
1095
- ], Jn = [
1096
- "pre",
1097
- "script",
1098
- "style",
1099
- "textarea"
1100
- ], ze = {
1101
- name: "htmlFlow",
1102
- tokenize: Le,
1103
- resolveTo: Be,
1104
- concrete: !0
1105
- }, Ie = {
1106
- tokenize: De,
1107
- partial: !0
1108
- }, Te = {
1109
- tokenize: Oe,
1110
- partial: !0
1111
- };
1112
- function Be(n) {
1113
- var r = n.length;
1114
- for(; r-- && !(n[r][0] === "enter" && n[r][1].type === "htmlFlow"););
1115
- return r > 1 && n[r - 2][1].type === "linePrefix" && (n[r][1].start = n[r - 2][1].start, n[r + 1][1].start = n[r - 2][1].start, n.splice(r - 2, 2)), n;
1116
- }
1117
- function Le(n, r, t) {
1118
- var e = this;
1119
- var u, i, l, a, m;
1120
- return c;
1121
- function c(s) {
1122
- return p(s);
1123
- }
1124
- function p(s) {
1125
- return n.enter("htmlFlow"), n.enter("htmlFlowData"), n.consume(s), f;
1126
- }
1127
- function f(s) {
1128
- return s === 33 ? (n.consume(s), x) : s === 47 ? (n.consume(s), i = !0, I) : s === 63 ? (n.consume(s), u = 3, e.interrupt ? r : o) : nn(s) ? (n.consume(s), l = String.fromCharCode(s), M) : t(s);
1129
- }
1130
- function x(s) {
1131
- return s === 45 ? (n.consume(s), u = 2, h) : s === 91 ? (n.consume(s), u = 5, a = 0, A) : nn(s) ? (n.consume(s), u = 4, e.interrupt ? r : o) : t(s);
1132
- }
1133
- function h(s) {
1134
- return s === 45 ? (n.consume(s), e.interrupt ? r : o) : t(s);
1135
- }
1136
- function A(s) {
1137
- var K = "CDATA[";
1138
- return s === K.charCodeAt(a++) ? (n.consume(s), a === K.length ? e.interrupt ? r : S : A) : t(s);
1139
- }
1140
- function I(s) {
1141
- return nn(s) ? (n.consume(s), l = String.fromCharCode(s), M) : t(s);
1142
- }
1143
- function M(s) {
1144
- if (s === null || s === 47 || s === 62 || Z(s)) {
1145
- var K = s === 47, hn = l.toLowerCase();
1146
- return !K && !i && Jn.includes(hn) ? (u = 1, e.interrupt ? r(s) : S(s)) : Ae.includes(l.toLowerCase()) ? (u = 6, K ? (n.consume(s), b) : e.interrupt ? r(s) : S(s)) : (u = 7, e.interrupt && !e.parser.lazy[e.now().line] ? t(s) : i ? j(s) : F(s));
1147
- }
1148
- return s === 45 || v(s) ? (n.consume(s), l += String.fromCharCode(s), M) : t(s);
1149
- }
1150
- function b(s) {
1151
- return s === 62 ? (n.consume(s), e.interrupt ? r : S) : t(s);
1152
- }
1153
- function j(s) {
1154
- return z(s) ? (n.consume(s), j) : V(s);
1155
- }
1156
- function F(s) {
1157
- return s === 47 ? (n.consume(s), V) : s === 58 || s === 95 || nn(s) ? (n.consume(s), D) : z(s) ? (n.consume(s), F) : V(s);
1158
- }
1159
- function D(s) {
1160
- return s === 45 || s === 46 || s === 58 || s === 95 || v(s) ? (n.consume(s), D) : _(s);
1161
- }
1162
- function _(s) {
1163
- return s === 61 ? (n.consume(s), k) : z(s) ? (n.consume(s), _) : F(s);
1164
- }
1165
- function k(s) {
1166
- return s === null || s === 60 || s === 61 || s === 62 || s === 96 ? t(s) : s === 34 || s === 39 ? (n.consume(s), m = s, T) : z(s) ? (n.consume(s), k) : H(s);
1167
- }
1168
- function T(s) {
1169
- return s === m ? (n.consume(s), m = null, N) : s === null || C(s) ? t(s) : (n.consume(s), T);
1170
- }
1171
- function H(s) {
1172
- return s === null || s === 34 || s === 39 || s === 47 || s === 60 || s === 61 || s === 62 || s === 96 || Z(s) ? _(s) : (n.consume(s), H);
1173
- }
1174
- function N(s) {
1175
- return s === 47 || s === 62 || z(s) ? F(s) : t(s);
1176
- }
1177
- function V(s) {
1178
- return s === 62 ? (n.consume(s), y) : t(s);
1179
- }
1180
- function y(s) {
1181
- return s === null || C(s) ? S(s) : z(s) ? (n.consume(s), y) : t(s);
1182
- }
1183
- function S(s) {
1184
- return s === 45 && u === 2 ? (n.consume(s), U) : s === 60 && u === 1 ? (n.consume(s), W) : s === 62 && u === 4 ? (n.consume(s), J) : s === 63 && u === 3 ? (n.consume(s), o) : s === 93 && u === 5 ? (n.consume(s), en) : C(s) && (u === 6 || u === 7) ? (n.exit("htmlFlowData"), n.check(Ie, rn, P)(s)) : s === null || C(s) ? (n.exit("htmlFlowData"), P(s)) : (n.consume(s), S);
1185
- }
1186
- function P(s) {
1187
- return n.check(Te, R, rn)(s);
1188
- }
1189
- function R(s) {
1190
- return n.enter("lineEnding"), n.consume(s), n.exit("lineEnding"), w;
1191
- }
1192
- function w(s) {
1193
- return s === null || C(s) ? P(s) : (n.enter("htmlFlowData"), S(s));
1194
- }
1195
- function U(s) {
1196
- return s === 45 ? (n.consume(s), o) : S(s);
1197
- }
1198
- function W(s) {
1199
- return s === 47 ? (n.consume(s), l = "", G) : S(s);
1200
- }
1201
- function G(s) {
1202
- if (s === 62) {
1203
- var K = l.toLowerCase();
1204
- return Jn.includes(K) ? (n.consume(s), J) : S(s);
1205
- }
1206
- return nn(s) && l.length < 8 ? (n.consume(s), l += String.fromCharCode(s), G) : S(s);
1207
- }
1208
- function en(s) {
1209
- return s === 93 ? (n.consume(s), o) : S(s);
1210
- }
1211
- function o(s) {
1212
- return s === 62 ? (n.consume(s), J) : s === 45 && u === 2 ? (n.consume(s), o) : S(s);
1213
- }
1214
- function J(s) {
1215
- return s === null || C(s) ? (n.exit("htmlFlowData"), rn(s)) : (n.consume(s), J);
1216
- }
1217
- function rn(s) {
1218
- return n.exit("htmlFlow"), r(s);
1219
- }
1220
- }
1221
- function Oe(n, r, t) {
1222
- var e = this;
1223
- return u;
1224
- function u(l) {
1225
- return C(l) ? (n.enter("lineEnding"), n.consume(l), n.exit("lineEnding"), i) : t(l);
1226
- }
1227
- function i(l) {
1228
- return e.parser.lazy[e.now().line] ? t(l) : r(l);
1229
- }
1230
- }
1231
- function De(n, r, t) {
1232
- return e;
1233
- function e(u) {
1234
- return n.enter("lineEnding"), n.consume(u), n.exit("lineEnding"), n.attempt(Sn, r, t);
1235
- }
1236
- }
1237
- var Pe = {
1238
- name: "htmlText",
1239
- tokenize: _e
1240
- };
1241
- function _e(n, r, t) {
1242
- var e = this;
1243
- var u, i, l;
1244
- return a;
1245
- function a(o) {
1246
- return n.enter("htmlText"), n.enter("htmlTextData"), n.consume(o), m;
1247
- }
1248
- function m(o) {
1249
- return o === 33 ? (n.consume(o), c) : o === 47 ? (n.consume(o), _) : o === 63 ? (n.consume(o), F) : nn(o) ? (n.consume(o), H) : t(o);
1250
- }
1251
- function c(o) {
1252
- return o === 45 ? (n.consume(o), p) : o === 91 ? (n.consume(o), i = 0, A) : nn(o) ? (n.consume(o), j) : t(o);
1253
- }
1254
- function p(o) {
1255
- return o === 45 ? (n.consume(o), h) : t(o);
1256
- }
1257
- function f(o) {
1258
- return o === null ? t(o) : o === 45 ? (n.consume(o), x) : C(o) ? (l = f, W(o)) : (n.consume(o), f);
1259
- }
1260
- function x(o) {
1261
- return o === 45 ? (n.consume(o), h) : f(o);
1262
- }
1263
- function h(o) {
1264
- return o === 62 ? U(o) : o === 45 ? x(o) : f(o);
1265
- }
1266
- function A(o) {
1267
- var J = "CDATA[";
1268
- return o === J.charCodeAt(i++) ? (n.consume(o), i === J.length ? I : A) : t(o);
1269
- }
1270
- function I(o) {
1271
- return o === null ? t(o) : o === 93 ? (n.consume(o), M) : C(o) ? (l = I, W(o)) : (n.consume(o), I);
1272
- }
1273
- function M(o) {
1274
- return o === 93 ? (n.consume(o), b) : I(o);
1275
- }
1276
- function b(o) {
1277
- return o === 62 ? U(o) : o === 93 ? (n.consume(o), b) : I(o);
1278
- }
1279
- function j(o) {
1280
- return o === null || o === 62 ? U(o) : C(o) ? (l = j, W(o)) : (n.consume(o), j);
1281
- }
1282
- function F(o) {
1283
- return o === null ? t(o) : o === 63 ? (n.consume(o), D) : C(o) ? (l = F, W(o)) : (n.consume(o), F);
1284
- }
1285
- function D(o) {
1286
- return o === 62 ? U(o) : F(o);
1287
- }
1288
- function _(o) {
1289
- return nn(o) ? (n.consume(o), k) : t(o);
1290
- }
1291
- function k(o) {
1292
- return o === 45 || v(o) ? (n.consume(o), k) : T(o);
1293
- }
1294
- function T(o) {
1295
- return C(o) ? (l = T, W(o)) : z(o) ? (n.consume(o), T) : U(o);
1296
- }
1297
- function H(o) {
1298
- return o === 45 || v(o) ? (n.consume(o), H) : o === 47 || o === 62 || Z(o) ? N(o) : t(o);
1299
- }
1300
- function N(o) {
1301
- return o === 47 ? (n.consume(o), U) : o === 58 || o === 95 || nn(o) ? (n.consume(o), V) : C(o) ? (l = N, W(o)) : z(o) ? (n.consume(o), N) : U(o);
1302
- }
1303
- function V(o) {
1304
- return o === 45 || o === 46 || o === 58 || o === 95 || v(o) ? (n.consume(o), V) : y(o);
1305
- }
1306
- function y(o) {
1307
- return o === 61 ? (n.consume(o), S) : C(o) ? (l = y, W(o)) : z(o) ? (n.consume(o), y) : N(o);
1308
- }
1309
- function S(o) {
1310
- return o === null || o === 60 || o === 61 || o === 62 || o === 96 ? t(o) : o === 34 || o === 39 ? (n.consume(o), u = o, P) : C(o) ? (l = S, W(o)) : z(o) ? (n.consume(o), S) : (n.consume(o), R);
1311
- }
1312
- function P(o) {
1313
- return o === u ? (n.consume(o), u = void 0, w) : o === null ? t(o) : C(o) ? (l = P, W(o)) : (n.consume(o), P);
1314
- }
1315
- function R(o) {
1316
- return o === null || o === 34 || o === 39 || o === 60 || o === 61 || o === 96 ? t(o) : o === 47 || o === 62 || Z(o) ? N(o) : (n.consume(o), R);
1317
- }
1318
- function w(o) {
1319
- return o === 47 || o === 62 || Z(o) ? N(o) : t(o);
1320
- }
1321
- function U(o) {
1322
- return o === 62 ? (n.consume(o), n.exit("htmlTextData"), n.exit("htmlText"), r) : t(o);
1323
- }
1324
- function W(o) {
1325
- return n.exit("htmlTextData"), n.enter("lineEnding"), n.consume(o), n.exit("lineEnding"), G;
1326
- }
1327
- function G(o) {
1328
- return z(o) ? O(n, en, "linePrefix", e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(o) : en(o);
1329
- }
1330
- function en(o) {
1331
- return n.enter("htmlTextData"), l(o);
1332
- }
1333
- }
1334
- var Dn = {
1335
- name: "labelEnd",
1336
- tokenize: Ne,
1337
- resolveTo: He,
1338
- resolveAll: qe
1339
- }, Me = {
1340
- tokenize: Ve
1341
- }, je = {
1342
- tokenize: We
1343
- }, Re = {
1344
- tokenize: Qe
1345
- };
1346
- function qe(n) {
1347
- var r = -1;
1348
- for(; ++r < n.length;){
1349
- var t = n[r][1];
1350
- (t.type === "labelImage" || t.type === "labelLink" || t.type === "labelEnd") && (n.splice(r + 1, t.type === "labelImage" ? 4 : 2), t.type = "data", r++);
1351
- }
1352
- return n;
1353
- }
1354
- function He(n, r) {
1355
- var t = n.length, e = 0, u, i, l, a;
1356
- for(; t--;)if (u = n[t][1], i) {
1357
- if (u.type === "link" || u.type === "labelLink" && u._inactive) break;
1358
- n[t][0] === "enter" && u.type === "labelLink" && (u._inactive = !0);
1359
- } else if (l) {
1360
- if (n[t][0] === "enter" && (u.type === "labelImage" || u.type === "labelLink") && !u._balanced && (i = t, u.type !== "labelLink")) {
1361
- e = 2;
1362
- break;
1363
- }
1364
- } else u.type === "labelEnd" && (l = t);
1365
- var m = {
1366
- type: n[i][1].type === "labelLink" ? "link" : "image",
1367
- start: Object.assign({}, n[i][1].start),
1368
- end: Object.assign({}, n[n.length - 1][1].end)
1369
- }, c = {
1370
- type: "label",
1371
- start: Object.assign({}, n[i][1].start),
1372
- end: Object.assign({}, n[l][1].end)
1373
- }, p = {
1374
- type: "labelText",
1375
- start: Object.assign({}, n[i + e + 2][1].end),
1376
- end: Object.assign({}, n[l - 2][1].start)
1377
- };
1378
- return a = [
1379
- [
1380
- "enter",
1381
- m,
1382
- r
1383
- ],
1384
- [
1385
- "enter",
1386
- c,
1387
- r
1388
- ]
1389
- ], a = Y(a, n.slice(i + 1, i + e + 3)), a = Y(a, [
1390
- [
1391
- "enter",
1392
- p,
1393
- r
1394
- ]
1395
- ]), a = Y(a, Ln(r.parser.constructs.insideSpan.null, n.slice(i + e + 4, l - 3), r)), a = Y(a, [
1396
- [
1397
- "exit",
1398
- p,
1399
- r
1400
- ],
1401
- n[l - 2],
1402
- n[l - 1],
1403
- [
1404
- "exit",
1405
- c,
1406
- r
1407
- ]
1408
- ]), a = Y(a, n.slice(l + 1)), a = Y(a, [
1409
- [
1410
- "exit",
1411
- m,
1412
- r
1413
- ]
1414
- ]), tn(n, i, n.length, a), n;
1415
- }
1416
- function Ne(n, r, t) {
1417
- var e = this;
1418
- var u = e.events.length, i, l;
1419
- for(; u--;)if ((e.events[u][1].type === "labelImage" || e.events[u][1].type === "labelLink") && !e.events[u][1]._balanced) {
1420
- i = e.events[u][1];
1421
- break;
1422
- }
1423
- return a;
1424
- function a(x) {
1425
- return i ? i._inactive ? f(x) : (l = e.parser.defined.includes(xn(e.sliceSerialize({
1426
- start: i.end,
1427
- end: e.now()
1428
- }))), n.enter("labelEnd"), n.enter("labelMarker"), n.consume(x), n.exit("labelMarker"), n.exit("labelEnd"), m) : t(x);
1429
- }
1430
- function m(x) {
1431
- return x === 40 ? n.attempt(Me, p, l ? p : f)(x) : x === 91 ? n.attempt(je, p, l ? c : f)(x) : l ? p(x) : f(x);
1432
- }
1433
- function c(x) {
1434
- return n.attempt(Re, p, f)(x);
1435
- }
1436
- function p(x) {
1437
- return r(x);
1438
- }
1439
- function f(x) {
1440
- return i._balanced = !0, t(x);
1441
- }
1442
- }
1443
- function Ve(n, r, t) {
1444
- return e;
1445
- function e(f) {
1446
- return n.enter("resource"), n.enter("resourceMarker"), n.consume(f), n.exit("resourceMarker"), u;
1447
- }
1448
- function u(f) {
1449
- return Z(f) ? dn(n, i)(f) : i(f);
1450
- }
1451
- function i(f) {
1452
- return f === 41 ? p(f) : at(n, l, a, "resourceDestination", "resourceDestinationLiteral", "resourceDestinationLiteralMarker", "resourceDestinationRaw", "resourceDestinationString", 32)(f);
1453
- }
1454
- function l(f) {
1455
- return Z(f) ? dn(n, m)(f) : p(f);
1456
- }
1457
- function a(f) {
1458
- return t(f);
1459
- }
1460
- function m(f) {
1461
- return f === 34 || f === 39 || f === 40 ? st(n, c, t, "resourceTitle", "resourceTitleMarker", "resourceTitleString")(f) : p(f);
1462
- }
1463
- function c(f) {
1464
- return Z(f) ? dn(n, p)(f) : p(f);
1465
- }
1466
- function p(f) {
1467
- return f === 41 ? (n.enter("resourceMarker"), n.consume(f), n.exit("resourceMarker"), n.exit("resource"), r) : t(f);
1468
- }
1469
- }
1470
- function We(n, r, t) {
1471
- var e = this;
1472
- return u;
1473
- function u(a) {
1474
- return ot.call(e, n, i, l, "reference", "referenceMarker", "referenceString")(a);
1475
- }
1476
- function i(a) {
1477
- return e.parser.defined.includes(xn(e.sliceSerialize(e.events[e.events.length - 1][1]).slice(1, -1))) ? r(a) : t(a);
1478
- }
1479
- function l(a) {
1480
- return t(a);
1481
- }
1482
- }
1483
- function Qe(n, r, t) {
1484
- return e;
1485
- function e(i) {
1486
- return n.enter("reference"), n.enter("referenceMarker"), n.consume(i), n.exit("referenceMarker"), u;
1487
- }
1488
- function u(i) {
1489
- return i === 93 ? (n.enter("referenceMarker"), n.consume(i), n.exit("referenceMarker"), n.exit("reference"), r) : t(i);
1490
- }
1491
- }
1492
- var Ue = {
1493
- name: "labelStartImage",
1494
- tokenize: $e,
1495
- resolveAll: Dn.resolveAll
1496
- };
1497
- function $e(n, r, t) {
1498
- var e = this;
1499
- return u;
1500
- function u(a) {
1501
- return n.enter("labelImage"), n.enter("labelImageMarker"), n.consume(a), n.exit("labelImageMarker"), i;
1502
- }
1503
- function i(a) {
1504
- return a === 91 ? (n.enter("labelMarker"), n.consume(a), n.exit("labelMarker"), n.exit("labelImage"), l) : t(a);
1505
- }
1506
- function l(a) {
1507
- return a === 94 && "_hiddenFootnoteSupport" in e.parser.constructs ? t(a) : r(a);
1508
- }
1509
- }
1510
- var Ze = {
1511
- name: "labelStartLink",
1512
- tokenize: Ye,
1513
- resolveAll: Dn.resolveAll
1514
- };
1515
- function Ye(n, r, t) {
1516
- var e = this;
1517
- return u;
1518
- function u(l) {
1519
- return n.enter("labelLink"), n.enter("labelMarker"), n.consume(l), n.exit("labelMarker"), n.exit("labelLink"), i;
1520
- }
1521
- function i(l) {
1522
- return l === 94 && "_hiddenFootnoteSupport" in e.parser.constructs ? t(l) : r(l);
1523
- }
1524
- }
1525
- var wn = {
1526
- name: "lineEnding",
1527
- tokenize: Ge
1528
- };
1529
- function Ge(n, r) {
1530
- return t;
1531
- function t(e) {
1532
- return n.enter("lineEnding"), n.consume(e), n.exit("lineEnding"), O(n, r, "linePrefix");
1533
- }
1534
- }
1535
- var bn = {
1536
- name: "thematicBreak",
1537
- tokenize: Je
1538
- };
1539
- function Je(n, r, t) {
1540
- var e = 0, u;
1541
- return i;
1542
- function i(c) {
1543
- return n.enter("thematicBreak"), l(c);
1544
- }
1545
- function l(c) {
1546
- return u = c, a(c);
1547
- }
1548
- function a(c) {
1549
- return c === u ? (n.enter("thematicBreakSequence"), m(c)) : e >= 3 && (c === null || C(c)) ? (n.exit("thematicBreak"), r(c)) : t(c);
1550
- }
1551
- function m(c) {
1552
- return c === u ? (n.consume(c), e++, m) : (n.exit("thematicBreakSequence"), z(c) ? O(n, a, "whitespace")(c) : a(c));
1553
- }
1554
- }
1555
- var $ = {
1556
- name: "list",
1557
- tokenize: ve,
1558
- continuation: {
1559
- tokenize: nr
1560
- },
1561
- exit: er
1562
- }, Ke = {
1563
- tokenize: rr,
1564
- partial: !0
1565
- }, Xe = {
1566
- tokenize: tr,
1567
- partial: !0
1568
- };
1569
- function ve(n, r, t) {
1570
- var e = this, u = e.events[e.events.length - 1];
1571
- var i = u && u[1].type === "linePrefix" ? u[2].sliceSerialize(u[1], !0).length : 0, l = 0;
1572
- return a;
1573
- function a(h) {
1574
- var A = e.containerState.type || (h === 42 || h === 43 || h === 45 ? "listUnordered" : "listOrdered");
1575
- if (A === "listUnordered" ? !e.containerState.marker || h === e.containerState.marker : zn(h)) {
1576
- if (e.containerState.type || (e.containerState.type = A, n.enter(A, {
1577
- _container: !0
1578
- })), A === "listUnordered") return n.enter("listItemPrefix"), h === 42 || h === 45 ? n.check(bn, t, c)(h) : c(h);
1579
- if (!e.interrupt || h === 49) return n.enter("listItemPrefix"), n.enter("listItemValue"), m(h);
1580
- }
1581
- return t(h);
1582
- }
1583
- function m(h) {
1584
- return zn(h) && ++l < 10 ? (n.consume(h), m) : (!e.interrupt || l < 2) && (e.containerState.marker ? h === e.containerState.marker : h === 41 || h === 46) ? (n.exit("listItemValue"), c(h)) : t(h);
1585
- }
1586
- function c(h) {
1587
- return n.enter("listItemMarker"), n.consume(h), n.exit("listItemMarker"), e.containerState.marker = e.containerState.marker || h, n.check(Sn, // Can’t be empty when interrupting.
1588
- e.interrupt ? t : p, n.attempt(Ke, x, f));
1589
- }
1590
- function p(h) {
1591
- return e.containerState.initialBlankLine = !0, i++, x(h);
1592
- }
1593
- function f(h) {
1594
- return z(h) ? (n.enter("listItemPrefixWhitespace"), n.consume(h), n.exit("listItemPrefixWhitespace"), x) : t(h);
1595
- }
1596
- function x(h) {
1597
- return e.containerState.size = i + e.sliceSerialize(n.exit("listItemPrefix"), !0).length, r(h);
1598
- }
1599
- }
1600
- function nr(n, r, t) {
1601
- var e = this;
1602
- return e.containerState._closeFlow = void 0, n.check(Sn, u, i);
1603
- function u(a) {
1604
- return e.containerState.furtherBlankLines = e.containerState.furtherBlankLines || e.containerState.initialBlankLine, O(n, r, "listItemIndent", e.containerState.size + 1)(a);
1605
- }
1606
- function i(a) {
1607
- return e.containerState.furtherBlankLines || !z(a) ? (e.containerState.furtherBlankLines = void 0, e.containerState.initialBlankLine = void 0, l(a)) : (e.containerState.furtherBlankLines = void 0, e.containerState.initialBlankLine = void 0, n.attempt(Xe, r, l)(a));
1608
- }
1609
- function l(a) {
1610
- return e.containerState._closeFlow = !0, e.interrupt = void 0, O(n, n.attempt($, r, t), "linePrefix", e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(a);
1611
- }
1612
- }
1613
- function tr(n, r, t) {
1614
- var e = this;
1615
- return O(n, u, "listItemIndent", e.containerState.size + 1);
1616
- function u(i) {
1617
- var l = e.events[e.events.length - 1];
1618
- return l && l[1].type === "listItemIndent" && l[2].sliceSerialize(l[1], !0).length === e.containerState.size ? r(i) : t(i);
1619
- }
1620
- }
1621
- function er(n) {
1622
- n.exit(this.containerState.type);
1623
- }
1624
- function rr(n, r, t) {
1625
- var e = this;
1626
- return O(n, u, "listItemPrefixWhitespace", e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + 1);
1627
- function u(i) {
1628
- var l = e.events[e.events.length - 1];
1629
- return !z(i) && l && l[1].type === "listItemPrefixWhitespace" ? r(i) : t(i);
1630
- }
1631
- }
1632
- var Kn = {
1633
- name: "setextUnderline",
1634
- tokenize: ur,
1635
- resolveTo: ir
1636
- };
1637
- function ir(n, r) {
1638
- var t = n.length, e, u, i;
1639
- for(; t--;)if (n[t][0] === "enter") {
1640
- if (n[t][1].type === "content") {
1641
- e = t;
1642
- break;
1643
- }
1644
- n[t][1].type === "paragraph" && (u = t);
1645
- } else n[t][1].type === "content" && n.splice(t, 1), !i && n[t][1].type === "definition" && (i = t);
1646
- var l = {
1647
- type: "setextHeading",
1648
- start: Object.assign({}, n[u][1].start),
1649
- end: Object.assign({}, n[n.length - 1][1].end)
1650
- };
1651
- return n[u][1].type = "setextHeadingText", i ? (n.splice(u, 0, [
1652
- "enter",
1653
- l,
1654
- r
1655
- ]), n.splice(i + 1, 0, [
1656
- "exit",
1657
- n[e][1],
1658
- r
1659
- ]), n[e][1].end = Object.assign({}, n[i][1].end)) : n[e][1] = l, n.push([
1660
- "exit",
1661
- l,
1662
- r
1663
- ]), n;
1664
- }
1665
- function ur(n, r, t) {
1666
- var e = this;
1667
- var u;
1668
- return i;
1669
- function i(c) {
1670
- var p = e.events.length, f;
1671
- for(; p--;)if (e.events[p][1].type !== "lineEnding" && e.events[p][1].type !== "linePrefix" && e.events[p][1].type !== "content") {
1672
- f = e.events[p][1].type === "paragraph";
1673
- break;
1674
- }
1675
- return !e.parser.lazy[e.now().line] && (e.interrupt || f) ? (n.enter("setextHeadingLine"), u = c, l(c)) : t(c);
1676
- }
1677
- function l(c) {
1678
- return n.enter("setextHeadingLineSequence"), a(c);
1679
- }
1680
- function a(c) {
1681
- return c === u ? (n.consume(c), a) : (n.exit("setextHeadingLineSequence"), z(c) ? O(n, m, "lineSuffix")(c) : m(c));
1682
- }
1683
- function m(c) {
1684
- return c === null || C(c) ? (n.exit("setextHeadingLine"), r(c)) : t(c);
1685
- }
1686
- }
1687
- var lr = {
1688
- tokenize: ar
1689
- };
1690
- function ar(n) {
1691
- var r = this, t = n.attempt(// Try to parse a blank line.
1692
- Sn, e, // Try to parse initial flow (essentially, only code).
1693
- n.attempt(this.parser.constructs.flowInitial, u, O(n, n.attempt(this.parser.constructs.flow, u, n.attempt(pe, u)), "linePrefix")));
1694
- return t;
1695
- function e(i) {
1696
- if (i === null) {
1697
- n.consume(i);
1698
- return;
1699
- }
1700
- return n.enter("lineEndingBlank"), n.consume(i), n.exit("lineEndingBlank"), r.currentConstruct = void 0, t;
1701
- }
1702
- function u(i) {
1703
- if (i === null) {
1704
- n.consume(i);
1705
- return;
1706
- }
1707
- return n.enter("lineEnding"), n.consume(i), n.exit("lineEnding"), r.currentConstruct = void 0, t;
1708
- }
1709
- }
1710
- var or = {
1711
- resolveAll: ht()
1712
- }, sr = ct("string"), cr = ct("text");
1713
- function ct(n) {
1714
- return {
1715
- tokenize: r,
1716
- resolveAll: ht(n === "text" ? hr : void 0)
1717
- };
1718
- function r(t) {
1719
- var e = this, u = this.parser.constructs[n], i = t.attempt(u, l, a);
1720
- return l;
1721
- function l(p) {
1722
- return c(p) ? i(p) : a(p);
1723
- }
1724
- function a(p) {
1725
- if (p === null) {
1726
- t.consume(p);
1727
- return;
1728
- }
1729
- return t.enter("data"), t.consume(p), m;
1730
- }
1731
- function m(p) {
1732
- return c(p) ? (t.exit("data"), i(p)) : (t.consume(p), m);
1733
- }
1734
- function c(p) {
1735
- if (p === null) return !0;
1736
- var f = u[p];
1737
- var x = -1;
1738
- if (f) for(; ++x < f.length;){
1739
- var h = f[x];
1740
- if (!h.previous || h.previous.call(e, e.previous)) return !0;
1741
- }
1742
- return !1;
1743
- }
1744
- }
1745
- }
1746
- function ht(n) {
1747
- return r;
1748
- function r(t, e) {
1749
- var u = -1, i;
1750
- for(; ++u <= t.length;)i === void 0 ? t[u] && t[u][1].type === "data" && (i = u, u++) : (!t[u] || t[u][1].type !== "data") && (u !== i + 2 && (t[i][1].end = t[u - 1][1].end, t.splice(i + 2, u - i - 2), u = i + 2), i = void 0);
1751
- return n ? n(t, e) : t;
1752
- }
1753
- }
1754
- function hr(n, r) {
1755
- var t = 0;
1756
- for(; ++t <= n.length;)if ((t === n.length || n[t][1].type === "lineEnding") && n[t - 1][1].type === "data") {
1757
- var e = n[t - 1][1], u = r.sliceStream(e);
1758
- var i = u.length, l = -1, a = 0, m = void 0;
1759
- for(; i--;){
1760
- var c = u[i];
1761
- if (typeof c == "string") {
1762
- for(l = c.length; c.charCodeAt(l - 1) === 32;)a++, l--;
1763
- if (l) break;
1764
- l = -1;
1765
- } else if (c === -2) m = !0, a++;
1766
- else if (c !== -1) {
1767
- i++;
1768
- break;
1769
- }
1770
- }
1771
- if (a) {
1772
- var c1 = {
1773
- type: t === n.length || m || a < 2 ? "lineSuffix" : "hardBreakTrailing",
1774
- start: {
1775
- line: e.end.line,
1776
- column: e.end.column - a,
1777
- offset: e.end.offset - a,
1778
- _index: e.start._index + i,
1779
- _bufferIndex: i ? l : e.start._bufferIndex + l
1780
- },
1781
- end: Object.assign({}, e.end)
1782
- };
1783
- e.end = Object.assign({}, c1.start), e.start.offset === e.end.offset ? Object.assign(e, c1) : (n.splice(t, 0, [
1784
- "enter",
1785
- c1,
1786
- r
1787
- ], [
1788
- "exit",
1789
- c1,
1790
- r
1791
- ]), t += 2);
1792
- }
1793
- t++;
1794
- }
1795
- return n;
1796
- }
1797
- function pr(n, r, t) {
1798
- var e = Object.assign(t ? Object.assign({}, t) : {
1799
- line: 1,
1800
- column: 1,
1801
- offset: 0
1802
- }, {
1803
- _index: 0,
1804
- _bufferIndex: -1
1805
- });
1806
- var u = {}, i = [];
1807
- var l = [], a = [];
1808
- var m = {
1809
- consume: j,
1810
- enter: F,
1811
- exit: D,
1812
- attempt: T(_),
1813
- check: T(k),
1814
- interrupt: T(k, {
1815
- interrupt: !0
1816
- })
1817
- }, c = {
1818
- previous: null,
1819
- code: null,
1820
- containerState: {},
1821
- events: [],
1822
- parser: n,
1823
- sliceStream: h,
1824
- sliceSerialize: x,
1825
- now: A,
1826
- defineSkip: I,
1827
- write: f
1828
- };
1829
- var p = r.tokenize.call(c, m);
1830
- return r.resolveAll && i.push(r), c;
1831
- function f(y) {
1832
- return l = Y(l, y), M(), l[l.length - 1] !== null ? [] : (H(r, 0), c.events = Ln(i, c.events, c), c.events);
1833
- }
1834
- function x(y, S) {
1835
- return mr(h(y), S);
1836
- }
1837
- function h(y) {
1838
- return fr(l, y);
1839
- }
1840
- function A() {
1841
- var y = e.line, S = e.column, P = e.offset, R = e._index, w = e._bufferIndex;
1842
- return {
1843
- line: y,
1844
- column: S,
1845
- offset: P,
1846
- _index: R,
1847
- _bufferIndex: w
1848
- };
1849
- }
1850
- function I(y) {
1851
- u[y.line] = y.column, V();
1852
- }
1853
- function M() {
1854
- var y;
1855
- for(; e._index < l.length;){
1856
- var S = l[e._index];
1857
- if (typeof S == "string") for(y = e._index, e._bufferIndex < 0 && (e._bufferIndex = 0); e._index === y && e._bufferIndex < S.length;)b(S.charCodeAt(e._bufferIndex));
1858
- else b(S);
1859
- }
1860
- }
1861
- function b(y) {
1862
- p = p(y);
1863
- }
1864
- function j(y) {
1865
- C(y) ? (e.line++, e.column = 1, e.offset += y === -3 ? 2 : 1, V()) : y !== -1 && (e.column++, e.offset++), e._bufferIndex < 0 ? e._index++ : (e._bufferIndex++, e._bufferIndex === l[e._index].length && (e._bufferIndex = -1, e._index++)), c.previous = y;
1866
- }
1867
- function F(y, S) {
1868
- var P = S || {};
1869
- return P.type = y, P.start = A(), c.events.push([
1870
- "enter",
1871
- P,
1872
- c
1873
- ]), a.push(P), P;
1874
- }
1875
- function D(y) {
1876
- var S = a.pop();
1877
- return S.end = A(), c.events.push([
1878
- "exit",
1879
- S,
1880
- c
1881
- ]), S;
1882
- }
1883
- function _(y, S) {
1884
- H(y, S.from);
1885
- }
1886
- function k(y, S) {
1887
- S.restore();
1888
- }
1889
- function T(y, S) {
1890
- return P;
1891
- function P(R, w, U) {
1892
- var W, G, en, o;
1893
- return Array.isArray(R) ? rn(R) : "tokenize" in R ? // @ts-expect-error Looks like a construct.
1894
- rn([
1895
- R
1896
- ]) : J(R);
1897
- function J(Q) {
1898
- return pn;
1899
- function pn(an) {
1900
- var fn = an !== null && Q[an], mn = an !== null && Q.null, Fn = // To do: add more extension tests.
1901
- /* c8 ignore next 2 */ _to_consumable_array(Array.isArray(fn) ? fn : fn ? [
1902
- fn
1903
- ] : []).concat(_to_consumable_array(Array.isArray(mn) ? mn : mn ? [
1904
- mn
1905
- ] : []));
1906
- return rn(Fn)(an);
1907
- }
1908
- }
1909
- function rn(Q) {
1910
- return W = Q, G = 0, Q.length === 0 ? U : s(Q[G]);
1911
- }
1912
- function s(Q) {
1913
- return pn;
1914
- function pn(an) {
1915
- return o = N(), en = Q, Q.partial || (c.currentConstruct = Q), Q.name && c.parser.constructs.disable.null.includes(Q.name) ? hn() : Q.tokenize.call(// If we do have fields, create an object w/ `context` as its
1916
- // prototype.
1917
- // This allows a “live binding”, which is needed for `interrupt`.
1918
- S ? Object.assign(Object.create(c), S) : c, m, K, hn)(an);
1919
- }
1920
- }
1921
- function K(Q) {
1922
- return y(en, o), w;
1923
- }
1924
- function hn(Q) {
1925
- return o.restore(), ++G < W.length ? s(W[G]) : U;
1926
- }
1927
- }
1928
- }
1929
- function H(y, S) {
1930
- y.resolveAll && !i.includes(y) && i.push(y), y.resolve && tn(c.events, S, c.events.length - S, y.resolve(c.events.slice(S), c)), y.resolveTo && (c.events = y.resolveTo(c.events, c));
1931
- }
1932
- function N() {
1933
- var y = A(), S = c.previous, P = c.currentConstruct, R = c.events.length, w = Array.from(a);
1934
- return {
1935
- restore: U,
1936
- from: R
1937
- };
1938
- function U() {
1939
- e = y, c.previous = S, c.currentConstruct = P, c.events.length = R, a = w, V();
1940
- }
1941
- }
1942
- function V() {
1943
- e.line in u && e.column < 2 && (e.column = u[e.line], e.offset += u[e.line] - 1);
1944
- }
1945
- }
1946
- function fr(n, r) {
1947
- var t = r.start._index, e = r.start._bufferIndex, u = r.end._index, i = r.end._bufferIndex;
1948
- var l;
1949
- if (t === u) l = [
1950
- n[t].slice(e, i)
1951
- ];
1952
- else {
1953
- if (l = n.slice(t, u), e > -1) {
1954
- var a = l[0];
1955
- typeof a == "string" ? l[0] = a.slice(e) : l.shift();
1956
- }
1957
- i > 0 && l.push(n[u].slice(0, i));
1958
- }
1959
- return l;
1960
- }
1961
- function mr(n, r) {
1962
- var t = -1;
1963
- var e = [];
1964
- var u;
1965
- for(; ++t < n.length;){
1966
- var i = n[t];
1967
- var l = void 0;
1968
- if (typeof i == "string") l = i;
1969
- else switch(i){
1970
- case -5:
1971
- {
1972
- l = "\r";
1973
- break;
1974
- }
1975
- case -4:
1976
- {
1977
- l = "\n";
1978
- break;
1979
- }
1980
- case -3:
1981
- {
1982
- l = "\r\n";
1983
- break;
1984
- }
1985
- case -2:
1986
- {
1987
- l = r ? " " : " ";
1988
- break;
1989
- }
1990
- case -1:
1991
- {
1992
- if (!r && u) continue;
1993
- l = " ";
1994
- break;
1995
- }
1996
- default:
1997
- l = String.fromCharCode(i);
1998
- }
1999
- u = i === -2, e.push(l);
2000
- }
2001
- return e.join("");
2002
- }
2003
- var _obj, _obj1;
2004
- var xr = {
2005
- 42: $,
2006
- 43: $,
2007
- 45: $,
2008
- 48: $,
2009
- 49: $,
2010
- 50: $,
2011
- 51: $,
2012
- 52: $,
2013
- 53: $,
2014
- 54: $,
2015
- 55: $,
2016
- 56: $,
2017
- 57: $,
2018
- 62: rt
2019
- }, gr = {
2020
- 91: ke
2021
- }, kr = (_obj = {}, _define_property(_obj, -2, Cn), _define_property(_obj, -1, Cn), _define_property(_obj, 32, Cn), _obj), dr = {
2022
- 35: Ee,
2023
- 42: bn,
2024
- 45: [
2025
- Kn,
2026
- bn
2027
- ],
2028
- 60: ze,
2029
- 61: Kn,
2030
- 95: bn,
2031
- 96: Gn,
2032
- 126: Gn
2033
- }, br = {
2034
- 38: ut,
2035
- 92: it
2036
- }, yr = (_obj1 = {}, _define_property(_obj1, -5, wn), _define_property(_obj1, -4, wn), _define_property(_obj1, -3, wn), _define_property(_obj1, 33, Ue), _define_property(_obj1, 38, ut), _define_property(_obj1, 42, In), _define_property(_obj1, 60, [
2037
- Yt,
2038
- Pe
2039
- ]), _define_property(_obj1, 91, Ze), _define_property(_obj1, 92, [
2040
- Se,
2041
- it
2042
- ]), _define_property(_obj1, 93, Dn), _define_property(_obj1, 95, In), _define_property(_obj1, 96, ae), _obj1), Sr = {
2043
- null: [
2044
- In,
2045
- or
2046
- ]
2047
- }, Fr = {
2048
- null: [
2049
- 42,
2050
- 95
2051
- ]
2052
- }, Er = {
2053
- null: []
2054
- }, Cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2055
- __proto__: null,
2056
- attentionMarkers: Fr,
2057
- contentInitial: gr,
2058
- disable: Er,
2059
- document: xr,
2060
- flow: dr,
2061
- flowInitial: kr,
2062
- insideSpan: Sr,
2063
- string: br,
2064
- text: yr
2065
- }, Symbol.toStringTag, {
2066
- value: "Module"
2067
- }));
2068
- function wr(n) {
2069
- var t = /** @type {FullNormalizedExtension} */ Ot([
2070
- Cr
2071
- ].concat(_to_consumable_array((n || {}).extensions || []))), e = {
2072
- defined: [],
2073
- lazy: {},
2074
- constructs: t,
2075
- content: u(Nt),
2076
- document: u(Wt),
2077
- flow: u(lr),
2078
- string: u(sr),
2079
- text: u(cr)
2080
- };
2081
- return e;
2082
- function u(i) {
2083
- return l;
2084
- function l(a) {
2085
- return pr(e, i, a);
2086
- }
2087
- }
2088
- }
2089
- var Xn = /[\0\t\n\r]/g;
2090
- function Ar() {
2091
- var n = 1, r = "", t = !0, e;
2092
- return u;
2093
- function u(i, l, a) {
2094
- var m = [];
2095
- var c, p, f, x, h;
2096
- for(i = r + i.toString(l), f = 0, r = "", t && (i.charCodeAt(0) === 65279 && f++, t = void 0); f < i.length;){
2097
- if (Xn.lastIndex = f, c = Xn.exec(i), x = c && c.index !== void 0 ? c.index : i.length, h = i.charCodeAt(x), !c) {
2098
- r = i.slice(f);
2099
- break;
2100
- }
2101
- if (h === 10 && f === x && e) m.push(-3), e = void 0;
2102
- else switch(e && (m.push(-5), e = void 0), f < x && (m.push(i.slice(f, x)), n += x - f), h){
2103
- case 0:
2104
- {
2105
- m.push(65533), n++;
2106
- break;
2107
- }
2108
- case 9:
2109
- {
2110
- for(p = Math.ceil(n / 4) * 4, m.push(-2); n++ < p;)m.push(-1);
2111
- break;
2112
- }
2113
- case 10:
2114
- {
2115
- m.push(-4), n = 1;
2116
- break;
2117
- }
2118
- default:
2119
- e = !0, n = 1;
2120
- }
2121
- f = x + 1;
2122
- }
2123
- return a && (e && m.push(-5), r && m.push(r), m.push(null)), m;
2124
- }
2125
- }
2126
- function zr(n) {
2127
- for(; !lt(n););
2128
- return n;
2129
- }
2130
- function pt(n, r) {
2131
- var t = Number.parseInt(n, r);
2132
- return(// C0 except for HT, LF, FF, CR, space.
2133
- t < 9 || t === 11 || t > 13 && t < 32 || // Control character (DEL) of C0, and C1 controls.
2134
- t > 126 && t < 160 || // Lone high surrogates and low surrogates.
2135
- t > 55295 && t < 57344 || // Noncharacters.
2136
- t > 64975 && t < 65008 || (t & 65535) === 65535 || (t & 65535) === 65534 || // Out of range
2137
- t > 1114111 ? "�" : String.fromCharCode(t));
2138
- }
2139
- var Ir = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
2140
- function Tr(n) {
2141
- return n.replace(Ir, Br);
2142
- }
2143
- function Br(n, r, t) {
2144
- if (r) return r;
2145
- if (t.charCodeAt(0) === 35) {
2146
- var u = t.charCodeAt(1), i = u === 120 || u === 88;
2147
- return pt(t.slice(i ? 2 : 1), i ? 16 : 10);
2148
- }
2149
- return On(t) || n;
2150
- }
2151
- function yn(n) {
2152
- return !n || typeof n != "object" ? "" : "position" in n || "type" in n ? vn(n.position) : "start" in n || "end" in n ? vn(n) : "line" in n || "column" in n ? Tn(n) : "";
2153
- }
2154
- function Tn(n) {
2155
- return nt(n && n.line) + ":" + nt(n && n.column);
2156
- }
2157
- function vn(n) {
2158
- return Tn(n && n.start) + "-" + Tn(n && n.end);
2159
- }
2160
- function nt(n) {
2161
- return n && typeof n == "number" ? n : 1;
2162
- }
2163
- var ft = {}.hasOwnProperty, mt = /**
2164
- * @type {(
2165
- * ((value: Value, encoding: Encoding, options?: Options | null | undefined) => Root) &
2166
- * ((value: Value, options?: Options | null | undefined) => Root)
2167
- * )}
2168
- */ /**
2169
- * @param {Value} value
2170
- * @param {Encoding | Options | null | undefined} [encoding]
2171
- * @param {Options | null | undefined} [options]
2172
- * @returns {Root}
2173
- */ function mt(n, r, t) {
2174
- return typeof r != "string" && (t = r, r = void 0), Lr(t)(zr(wr(t).document().write(Ar()(n, r, !0))));
2175
- };
2176
- function Lr(n) {
2177
- var r = {
2178
- transforms: [],
2179
- canContainEols: [
2180
- "emphasis",
2181
- "fragment",
2182
- "heading",
2183
- "paragraph",
2184
- "strong"
2185
- ],
2186
- enter: {
2187
- autolink: a(Hn),
2188
- autolinkProtocol: y,
2189
- autolinkEmail: y,
2190
- atxHeading: a(jn),
2191
- blockQuote: a(Fn),
2192
- characterEscape: y,
2193
- characterReference: y,
2194
- codeFenced: a(Mn),
2195
- codeFencedFenceInfo: m,
2196
- codeFencedFenceMeta: m,
2197
- codeIndented: a(Mn, m),
2198
- codeText: a(kt, m),
2199
- codeTextData: y,
2200
- data: y,
2201
- codeFlowValue: y,
2202
- definition: a(dt),
2203
- definitionDestinationString: m,
2204
- definitionLabelString: m,
2205
- definitionTitleString: m,
2206
- emphasis: a(bt),
2207
- hardBreakEscape: a(Rn),
2208
- hardBreakTrailing: a(Rn),
2209
- htmlFlow: a(qn, m),
2210
- htmlFlowData: y,
2211
- htmlText: a(qn, m),
2212
- htmlTextData: y,
2213
- image: a(yt),
2214
- label: m,
2215
- link: a(Hn),
2216
- listItem: a(St),
2217
- listItemValue: A,
2218
- listOrdered: a(Nn, h),
2219
- listUnordered: a(Nn),
2220
- paragraph: a(Ft),
2221
- reference: hn,
2222
- referenceString: m,
2223
- resourceDestinationString: m,
2224
- resourceTitleString: m,
2225
- setextHeading: a(jn),
2226
- strong: a(Et),
2227
- thematicBreak: a(wt)
2228
- },
2229
- exit: {
2230
- atxHeading: p(),
2231
- atxHeadingSequence: T,
2232
- autolink: p(),
2233
- autolinkEmail: mn,
2234
- autolinkProtocol: fn,
2235
- blockQuote: p(),
2236
- characterEscapeValue: S,
2237
- characterReferenceMarkerHexadecimal: pn,
2238
- characterReferenceMarkerNumeric: pn,
2239
- characterReferenceValue: an,
2240
- codeFenced: p(j),
2241
- codeFencedFence: b,
2242
- codeFencedFenceInfo: I,
2243
- codeFencedFenceMeta: M,
2244
- codeFlowValue: S,
2245
- codeIndented: p(F),
2246
- codeText: p(W),
2247
- codeTextData: S,
2248
- data: S,
2249
- definition: p(),
2250
- definitionDestinationString: k,
2251
- definitionLabelString: D,
2252
- definitionTitleString: _,
2253
- emphasis: p(),
2254
- hardBreakEscape: p(R),
2255
- hardBreakTrailing: p(R),
2256
- htmlFlow: p(w),
2257
- htmlFlowData: S,
2258
- htmlText: p(U),
2259
- htmlTextData: S,
2260
- image: p(en),
2261
- label: J,
2262
- labelText: o,
2263
- lineEnding: P,
2264
- link: p(G),
2265
- listItem: p(),
2266
- listOrdered: p(),
2267
- listUnordered: p(),
2268
- paragraph: p(),
2269
- referenceString: Q,
2270
- resourceDestinationString: rn,
2271
- resourceTitleString: s,
2272
- resource: K,
2273
- setextHeading: p(V),
2274
- setextHeadingLineSequence: N,
2275
- setextHeadingText: H,
2276
- strong: p(),
2277
- thematicBreak: p()
2278
- }
2279
- };
2280
- xt(r, (n || {}).mdastExtensions || []);
2281
- var t = {};
2282
- return e;
2283
- function e(g) {
2284
- var d = {
2285
- type: "root",
2286
- children: []
2287
- };
2288
- var E = {
2289
- stack: [
2290
- d
2291
- ],
2292
- tokenStack: [],
2293
- config: r,
2294
- enter: c,
2295
- exit: f,
2296
- buffer: m,
2297
- resume: x,
2298
- setData: i,
2299
- getData: l
2300
- }, B = [];
2301
- var L = -1;
2302
- for(; ++L < g.length;)if (g[L][1].type === "listOrdered" || g[L][1].type === "listUnordered") if (g[L][0] === "enter") B.push(L);
2303
- else {
2304
- var X = B.pop();
2305
- L = u(g, X, L);
2306
- }
2307
- for(L = -1; ++L < g.length;){
2308
- var X1 = r[g[L][0]];
2309
- ft.call(X1, g[L][1].type) && X1[g[L][1].type].call(Object.assign({
2310
- sliceSerialize: g[L][2].sliceSerialize
2311
- }, E), g[L][1]);
2312
- }
2313
- if (E.tokenStack.length > 0) {
2314
- var X2 = E.tokenStack[E.tokenStack.length - 1];
2315
- (X2[1] || tt).call(E, void 0, X2[0]);
2316
- }
2317
- for(d.position = {
2318
- start: sn(g.length > 0 ? g[0][1].start : {
2319
- line: 1,
2320
- column: 1,
2321
- offset: 0
2322
- }),
2323
- end: sn(g.length > 0 ? g[g.length - 2][1].end : {
2324
- line: 1,
2325
- column: 1,
2326
- offset: 0
2327
- })
2328
- }, L = -1; ++L < r.transforms.length;)d = r.transforms[L](d) || d;
2329
- return d;
2330
- }
2331
- function u(g, d, E) {
2332
- var B = d - 1, L = -1, X = !1, on, un, gn, kn;
2333
- for(; ++B <= E;){
2334
- var q = g[B];
2335
- if (q[1].type === "listUnordered" || q[1].type === "listOrdered" || q[1].type === "blockQuote" ? (q[0] === "enter" ? L++ : L--, kn = void 0) : q[1].type === "lineEndingBlank" ? q[0] === "enter" && (on && !kn && !L && !gn && (gn = B), kn = void 0) : q[1].type === "linePrefix" || q[1].type === "listItemValue" || q[1].type === "listItemMarker" || q[1].type === "listItemPrefix" || q[1].type === "listItemPrefixWhitespace" || (kn = void 0), !L && q[0] === "enter" && q[1].type === "listItemPrefix" || L === -1 && q[0] === "exit" && (q[1].type === "listUnordered" || q[1].type === "listOrdered")) {
2336
- if (on) {
2337
- var En = B;
2338
- for(un = void 0; En--;){
2339
- var ln = g[En];
2340
- if (ln[1].type === "lineEnding" || ln[1].type === "lineEndingBlank") {
2341
- if (ln[0] === "exit") continue;
2342
- un && (g[un][1].type = "lineEndingBlank", X = !0), ln[1].type = "lineEnding", un = En;
2343
- } else if (!(ln[1].type === "linePrefix" || ln[1].type === "blockQuotePrefix" || ln[1].type === "blockQuotePrefixWhitespace" || ln[1].type === "blockQuoteMarker" || ln[1].type === "listItemIndent")) break;
2344
- }
2345
- gn && (!un || gn < un) && (on._spread = !0), on.end = Object.assign({}, un ? g[un][1].start : q[1].end), g.splice(un || B, 0, [
2346
- "exit",
2347
- on,
2348
- q[2]
2349
- ]), B++, E++;
2350
- }
2351
- q[1].type === "listItemPrefix" && (on = {
2352
- type: "listItem",
2353
- _spread: !1,
2354
- start: Object.assign({}, q[1].start),
2355
- // @ts-expect-error: we’ll add `end` in a second.
2356
- end: void 0
2357
- }, g.splice(B, 0, [
2358
- "enter",
2359
- on,
2360
- q[2]
2361
- ]), B++, E++, gn = void 0, kn = !0);
2362
- }
2363
- }
2364
- return g[d][1]._spread = X, E;
2365
- }
2366
- function i(g, d) {
2367
- t[g] = d;
2368
- }
2369
- function l(g) {
2370
- return t[g];
2371
- }
2372
- function a(g, d) {
2373
- return E;
2374
- function E(B) {
2375
- c.call(this, g(B), B), d && d.call(this, B);
2376
- }
2377
- }
2378
- function m() {
2379
- this.stack.push({
2380
- type: "fragment",
2381
- children: []
2382
- });
2383
- }
2384
- function c(g, d, E) {
2385
- return this.stack[this.stack.length - 1].children.push(g), this.stack.push(g), this.tokenStack.push([
2386
- d,
2387
- E
2388
- ]), g.position = {
2389
- start: sn(d.start)
2390
- }, g;
2391
- }
2392
- function p(g) {
2393
- return d;
2394
- function d(E) {
2395
- g && g.call(this, E), f.call(this, E);
2396
- }
2397
- }
2398
- function f(g, d) {
2399
- var E = this.stack.pop(), B = this.tokenStack.pop();
2400
- if (B) B[0].type !== g.type && (d ? d.call(this, g, B[0]) : (B[1] || tt).call(this, g, B[0]));
2401
- else throw new Error("Cannot close `" + g.type + "` (" + yn({
2402
- start: g.start,
2403
- end: g.end
2404
- }) + "): it’s not open");
2405
- return E.position.end = sn(g.end), E;
2406
- }
2407
- function x() {
2408
- return Bt(this.stack.pop());
2409
- }
2410
- function h() {
2411
- i("expectingFirstListItemValue", !0);
2412
- }
2413
- function A(g) {
2414
- if (l("expectingFirstListItemValue")) {
2415
- var d = this.stack[this.stack.length - 2];
2416
- d.start = Number.parseInt(this.sliceSerialize(g), 10), i("expectingFirstListItemValue");
2417
- }
2418
- }
2419
- function I() {
2420
- var g = this.resume(), d = this.stack[this.stack.length - 1];
2421
- d.lang = g;
2422
- }
2423
- function M() {
2424
- var g = this.resume(), d = this.stack[this.stack.length - 1];
2425
- d.meta = g;
2426
- }
2427
- function b() {
2428
- l("flowCodeInside") || (this.buffer(), i("flowCodeInside", !0));
2429
- }
2430
- function j() {
2431
- var g = this.resume(), d = this.stack[this.stack.length - 1];
2432
- d.value = g.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ""), i("flowCodeInside");
2433
- }
2434
- function F() {
2435
- var g = this.resume(), d = this.stack[this.stack.length - 1];
2436
- d.value = g.replace(/(\r?\n|\r)$/g, "");
2437
- }
2438
- function D(g) {
2439
- var d = this.resume(), E = this.stack[this.stack.length - 1];
2440
- E.label = d, E.identifier = xn(this.sliceSerialize(g)).toLowerCase();
2441
- }
2442
- function _() {
2443
- var g = this.resume(), d = this.stack[this.stack.length - 1];
2444
- d.title = g;
2445
- }
2446
- function k() {
2447
- var g = this.resume(), d = this.stack[this.stack.length - 1];
2448
- d.url = g;
2449
- }
2450
- function T(g) {
2451
- var d = this.stack[this.stack.length - 1];
2452
- if (!d.depth) {
2453
- var E = this.sliceSerialize(g).length;
2454
- d.depth = E;
2455
- }
2456
- }
2457
- function H() {
2458
- i("setextHeadingSlurpLineEnding", !0);
2459
- }
2460
- function N(g) {
2461
- var d = this.stack[this.stack.length - 1];
2462
- d.depth = this.sliceSerialize(g).charCodeAt(0) === 61 ? 1 : 2;
2463
- }
2464
- function V() {
2465
- i("setextHeadingSlurpLineEnding");
2466
- }
2467
- function y(g) {
2468
- var d = this.stack[this.stack.length - 1];
2469
- var E = d.children[d.children.length - 1];
2470
- (!E || E.type !== "text") && (E = Ct(), E.position = {
2471
- start: sn(g.start)
2472
- }, d.children.push(E)), this.stack.push(E);
2473
- }
2474
- function S(g) {
2475
- var d = this.stack.pop();
2476
- d.value += this.sliceSerialize(g), d.position.end = sn(g.end);
2477
- }
2478
- function P(g) {
2479
- var d = this.stack[this.stack.length - 1];
2480
- if (l("atHardBreak")) {
2481
- var E = d.children[d.children.length - 1];
2482
- E.position.end = sn(g.end), i("atHardBreak");
2483
- return;
2484
- }
2485
- !l("setextHeadingSlurpLineEnding") && r.canContainEols.includes(d.type) && (y.call(this, g), S.call(this, g));
2486
- }
2487
- function R() {
2488
- i("atHardBreak", !0);
2489
- }
2490
- function w() {
2491
- var g = this.resume(), d = this.stack[this.stack.length - 1];
2492
- d.value = g;
2493
- }
2494
- function U() {
2495
- var g = this.resume(), d = this.stack[this.stack.length - 1];
2496
- d.value = g;
2497
- }
2498
- function W() {
2499
- var g = this.resume(), d = this.stack[this.stack.length - 1];
2500
- d.value = g;
2501
- }
2502
- function G() {
2503
- var g = this.stack[this.stack.length - 1];
2504
- if (l("inReference")) {
2505
- var d = l("referenceType") || "shortcut";
2506
- g.type += "Reference", g.referenceType = d, delete g.url, delete g.title;
2507
- } else delete g.identifier, delete g.label;
2508
- i("referenceType");
2509
- }
2510
- function en() {
2511
- var g = this.stack[this.stack.length - 1];
2512
- if (l("inReference")) {
2513
- var d = l("referenceType") || "shortcut";
2514
- g.type += "Reference", g.referenceType = d, delete g.url, delete g.title;
2515
- } else delete g.identifier, delete g.label;
2516
- i("referenceType");
2517
- }
2518
- function o(g) {
2519
- var d = this.sliceSerialize(g), E = this.stack[this.stack.length - 2];
2520
- E.label = Tr(d), E.identifier = xn(d).toLowerCase();
2521
- }
2522
- function J() {
2523
- var g = this.stack[this.stack.length - 1], d = this.resume(), E = this.stack[this.stack.length - 1];
2524
- if (i("inReference", !0), E.type === "link") {
2525
- var B = g.children;
2526
- E.children = B;
2527
- } else E.alt = d;
2528
- }
2529
- function rn() {
2530
- var g = this.resume(), d = this.stack[this.stack.length - 1];
2531
- d.url = g;
2532
- }
2533
- function s() {
2534
- var g = this.resume(), d = this.stack[this.stack.length - 1];
2535
- d.title = g;
2536
- }
2537
- function K() {
2538
- i("inReference");
2539
- }
2540
- function hn() {
2541
- i("referenceType", "collapsed");
2542
- }
2543
- function Q(g) {
2544
- var d = this.resume(), E = this.stack[this.stack.length - 1];
2545
- E.label = d, E.identifier = xn(this.sliceSerialize(g)).toLowerCase(), i("referenceType", "full");
2546
- }
2547
- function pn(g) {
2548
- i("characterReferenceType", g.type);
2549
- }
2550
- function an(g) {
2551
- var d = this.sliceSerialize(g), E = l("characterReferenceType");
2552
- var B;
2553
- E ? (B = pt(d, E === "characterReferenceMarkerNumeric" ? 10 : 16), i("characterReferenceType")) : B = On(d);
2554
- var L = this.stack.pop();
2555
- L.value += B, L.position.end = sn(g.end);
2556
- }
2557
- function fn(g) {
2558
- S.call(this, g);
2559
- var d = this.stack[this.stack.length - 1];
2560
- d.url = this.sliceSerialize(g);
2561
- }
2562
- function mn(g) {
2563
- S.call(this, g);
2564
- var d = this.stack[this.stack.length - 1];
2565
- d.url = "mailto:" + this.sliceSerialize(g);
2566
- }
2567
- function Fn() {
2568
- return {
2569
- type: "blockquote",
2570
- children: []
2571
- };
2572
- }
2573
- function Mn() {
2574
- return {
2575
- type: "code",
2576
- lang: null,
2577
- meta: null,
2578
- value: ""
2579
- };
2580
- }
2581
- function kt() {
2582
- return {
2583
- type: "inlineCode",
2584
- value: ""
2585
- };
2586
- }
2587
- function dt() {
2588
- return {
2589
- type: "definition",
2590
- identifier: "",
2591
- label: null,
2592
- title: null,
2593
- url: ""
2594
- };
2595
- }
2596
- function bt() {
2597
- return {
2598
- type: "emphasis",
2599
- children: []
2600
- };
2601
- }
2602
- function jn() {
2603
- return {
2604
- type: "heading",
2605
- depth: void 0,
2606
- children: []
2607
- };
2608
- }
2609
- function Rn() {
2610
- return {
2611
- type: "break"
2612
- };
2613
- }
2614
- function qn() {
2615
- return {
2616
- type: "html",
2617
- value: ""
2618
- };
2619
- }
2620
- function yt() {
2621
- return {
2622
- type: "image",
2623
- title: null,
2624
- url: "",
2625
- alt: null
2626
- };
2627
- }
2628
- function Hn() {
2629
- return {
2630
- type: "link",
2631
- title: null,
2632
- url: "",
2633
- children: []
2634
- };
2635
- }
2636
- function Nn(g) {
2637
- return {
2638
- type: "list",
2639
- ordered: g.type === "listOrdered",
2640
- start: null,
2641
- spread: g._spread,
2642
- children: []
2643
- };
2644
- }
2645
- function St(g) {
2646
- return {
2647
- type: "listItem",
2648
- spread: g._spread,
2649
- checked: null,
2650
- children: []
2651
- };
2652
- }
2653
- function Ft() {
2654
- return {
2655
- type: "paragraph",
2656
- children: []
2657
- };
2658
- }
2659
- function Et() {
2660
- return {
2661
- type: "strong",
2662
- children: []
2663
- };
2664
- }
2665
- function Ct() {
2666
- return {
2667
- type: "text",
2668
- value: ""
2669
- };
2670
- }
2671
- function wt() {
2672
- return {
2673
- type: "thematicBreak"
2674
- };
2675
- }
2676
- }
2677
- function sn(n) {
2678
- return {
2679
- line: n.line,
2680
- column: n.column,
2681
- offset: n.offset
2682
- };
2683
- }
2684
- function xt(n, r) {
2685
- var t = -1;
2686
- for(; ++t < r.length;){
2687
- var e = r[t];
2688
- Array.isArray(e) ? xt(n, e) : Or(n, e);
2689
- }
2690
- }
2691
- function Or(n, r) {
2692
- var t;
2693
- for(t in r)if (ft.call(r, t)) {
2694
- if (t === "canContainEols") {
2695
- var _n_t;
2696
- var e = r[t];
2697
- e && (_n_t = n[t]).push.apply(_n_t, _to_consumable_array(e));
2698
- } else if (t === "transforms") {
2699
- var _n_t1;
2700
- var e1 = r[t];
2701
- e1 && (_n_t1 = n[t]).push.apply(_n_t1, _to_consumable_array(e1));
2702
- } else if (t === "enter" || t === "exit") {
2703
- var e2 = r[t];
2704
- e2 && Object.assign(n[t], e2);
2705
- }
2706
- }
2707
- }
2708
- function tt(n, r) {
2709
- throw n ? new Error("Cannot close `" + n.type + "` (" + yn({
2710
- start: n.start,
2711
- end: n.end
2712
- }) + "): a different token (`" + r.type + "`, " + yn({
2713
- start: r.start,
2714
- end: r.end
2715
- }) + ") is open") : new Error("Cannot close document, a token (`" + r.type + "`, " + yn({
2716
- start: r.start,
2717
- end: r.end
2718
- }) + ") is still open");
2719
- }
2720
- function Dr(n) {
2721
- var r = n.replace(/\n{2,}/g, "\n");
2722
- return mh(r);
2723
- }
2724
- function Pr(n) {
2725
- var r = Dr(n), _mt = mt(r), t = _mt.children, e = [
2726
- []
2727
- ];
2728
- var u = 0;
2729
- function i(l) {
2730
- var a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "normal";
2731
- l.type === "text" ? l.value.split("\n").forEach(function(c, p) {
2732
- p !== 0 && (u++, e.push([])), c.split(" ").forEach(function(f) {
2733
- f && e[u].push({
2734
- content: f,
2735
- type: a
2736
- });
2737
- });
2738
- }) : (l.type === "strong" || l.type === "emphasis") && l.children.forEach(function(m) {
2739
- i(m, l.type);
2740
- });
2741
- }
2742
- return t.forEach(function(l) {
2743
- l.type === "paragraph" && l.children.forEach(function(a) {
2744
- i(a);
2745
- });
2746
- }), e;
2747
- }
2748
- function _r(n) {
2749
- var _mt = mt(n), r = _mt.children;
2750
- function t(e) {
2751
- return e.type === "text" ? e.value.replace(/\n/g, "<br/>") : e.type === "strong" ? "<strong>".concat(e.children.map(t).join(""), "</strong>") : e.type === "emphasis" ? "<em>".concat(e.children.map(t).join(""), "</em>") : e.type === "paragraph" ? "<p>".concat(e.children.map(t).join(""), "</p>") : "Unsupported markdown: ".concat(e.type);
2752
- }
2753
- return r.map(t).join("");
2754
- }
2755
- function Mr(n) {
2756
- return Intl.Segmenter ? _to_consumable_array(new Intl.Segmenter().segment(n)).map(function(r) {
2757
- return r.segment;
2758
- }) : _to_consumable_array(n);
2759
- }
2760
- function jr(n, r) {
2761
- var t = Mr(r.content);
2762
- return gt(n, [], t, r.type);
2763
- }
2764
- function gt(n, r, t, e) {
2765
- if (t.length === 0) return [
2766
- {
2767
- content: r.join(""),
2768
- type: e
2769
- },
2770
- {
2771
- content: "",
2772
- type: e
2773
- }
2774
- ];
2775
- var _t = _to_array(t), u = _t[0], i = _t.slice(1), l = _to_consumable_array(r).concat([
2776
- u
2777
- ]);
2778
- return n([
2779
- {
2780
- content: l.join(""),
2781
- type: e
2782
- }
2783
- ]) ? gt(n, l, i, e) : (r.length === 0 && u && (r.push(u), t.shift()), [
2784
- {
2785
- content: r.join(""),
2786
- type: e
2787
- },
2788
- {
2789
- content: t.join(""),
2790
- type: e
2791
- }
2792
- ]);
2793
- }
2794
- function Rr(n, r) {
2795
- if (n.some(function(param) {
2796
- var t = param.content;
2797
- return t.includes("\n");
2798
- })) throw new Error("splitLineToFitWidth does not support newlines in the line");
2799
- return Bn(n, r);
2800
- }
2801
- function Bn(n, r) {
2802
- var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [], e = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : [];
2803
- if (n.length === 0) return e.length > 0 && t.push(e), t.length > 0 ? t : [];
2804
- var u = "";
2805
- n[0].content === " " && (u = " ", n.shift());
2806
- var _n_shift;
2807
- var i = (_n_shift = n.shift()) !== null && _n_shift !== void 0 ? _n_shift : {
2808
- content: " ",
2809
- type: "normal"
2810
- }, l = _to_consumable_array(e);
2811
- if (u !== "" && l.push({
2812
- content: u,
2813
- type: "normal"
2814
- }), l.push(i), r(l)) return Bn(n, r, t, l);
2815
- if (e.length > 0) t.push(e), n.unshift(i);
2816
- else if (i.content) {
2817
- var _jr = _sliced_to_array(jr(r, i), 2), a = _jr[0], m = _jr[1];
2818
- t.push([
2819
- a
2820
- ]), m.content && n.unshift(m);
2821
- }
2822
- return Bn(n, r, t);
2823
- }
2824
- function qr(n, r) {
2825
- r && n.attr("style", r);
2826
- }
2827
- function Hr(n, r, t, e) {
2828
- var u = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !1;
2829
- var i = n.append("foreignObject"), l = i.append("xhtml:div"), a = r.label, m = r.isNode ? "nodeLabel" : "edgeLabel";
2830
- l.html('\n <span class="'.concat(m, " ").concat(e, '" ') + (r.labelStyle ? 'style="' + r.labelStyle + '"' : "") + ">" + a + "</span>"), qr(l, r.labelStyle), l.style("display", "table-cell"), l.style("white-space", "nowrap"), l.style("max-width", t + "px"), l.attr("xmlns", "http://www.w3.org/1999/xhtml"), u && l.attr("class", "labelBkg");
2831
- var c = l.node().getBoundingClientRect();
2832
- return c.width === t && (l.style("display", "table"), l.style("white-space", "break-spaces"), l.style("width", t + "px"), c = l.node().getBoundingClientRect()), i.style("width", c.width), i.style("height", c.height), i.node();
2833
- }
2834
- function Pn(n, r, t) {
2835
- return n.append("tspan").attr("class", "text-outer-tspan").attr("x", 0).attr("y", r * t - 0.1 + "em").attr("dy", t + "em");
2836
- }
2837
- function Nr(n, r, t) {
2838
- var e = n.append("text"), u = Pn(e, 1, r);
2839
- _n(u, t);
2840
- var i = u.node().getComputedTextLength();
2841
- return e.remove(), i;
2842
- }
2843
- function Qr(n, r, t) {
2844
- var l;
2845
- var e = n.append("text"), u = Pn(e, 1, r);
2846
- _n(u, [
2847
- {
2848
- content: t,
2849
- type: "normal"
2850
- }
2851
- ]);
2852
- var i = (l = u.node()) == null ? void 0 : l.getBoundingClientRect();
2853
- return i && e.remove(), i;
2854
- }
2855
- function Vr(n, r, t) {
2856
- var e = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
2857
- var i = r.append("g"), l = i.insert("rect").attr("class", "background"), a = i.append("text").attr("y", "-10.1");
2858
- var m = 0;
2859
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
2860
- try {
2861
- for(var _iterator = t[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
2862
- var c = _step.value;
2863
- var p = function(x) {
2864
- return Nr(i, 1.1, x) <= n;
2865
- }, f = p(c) ? [
2866
- c
2867
- ] : Rr(c, p);
2868
- var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
2869
- try {
2870
- for(var _iterator1 = f[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
2871
- var x = _step1.value;
2872
- var h = Pn(a, m, 1.1);
2873
- _n(h, x), m++;
2874
- }
2875
- } catch (err) {
2876
- _didIteratorError1 = true;
2877
- _iteratorError1 = err;
2878
- } finally{
2879
- try {
2880
- if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
2881
- _iterator1.return();
2882
- }
2883
- } finally{
2884
- if (_didIteratorError1) {
2885
- throw _iteratorError1;
2886
- }
2887
- }
2888
- }
2889
- }
2890
- } catch (err) {
2891
- _didIteratorError = true;
2892
- _iteratorError = err;
2893
- } finally{
2894
- try {
2895
- if (!_iteratorNormalCompletion && _iterator.return != null) {
2896
- _iterator.return();
2897
- }
2898
- } finally{
2899
- if (_didIteratorError) {
2900
- throw _iteratorError;
2901
- }
2902
- }
2903
- }
2904
- if (e) {
2905
- var c1 = a.node().getBBox(), p1 = 2;
2906
- return l.attr("x", -p1).attr("y", -p1).attr("width", c1.width + 2 * p1).attr("height", c1.height + 2 * p1), i.node();
2907
- } else return a.node();
2908
- }
2909
- function _n(n, r) {
2910
- n.text(""), r.forEach(function(t, e) {
2911
- var u = n.append("tspan").attr("font-style", t.type === "emphasis" ? "italic" : "normal").attr("class", "text-inner-tspan").attr("font-weight", t.type === "strong" ? "bold" : "normal");
2912
- e === 0 ? u.text(t.content) : u.text(" " + t.content);
2913
- });
2914
- }
2915
- var Ur = function(n) {
2916
- var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", _ref = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, tmp = _ref.style, t = tmp === void 0 ? "" : tmp, tmp1 = _ref.isTitle, e = tmp1 === void 0 ? !1 : tmp1, tmp2 = _ref.classes, u = tmp2 === void 0 ? "" : tmp2, tmp3 = _ref.useHtmlLabels, i = tmp3 === void 0 ? !0 : tmp3, tmp4 = _ref.isNode, l = tmp4 === void 0 ? !0 : tmp4, tmp5 = _ref.width, a = tmp5 === void 0 ? 200 : tmp5, tmp6 = _ref.addSvgBackground, m = tmp6 === void 0 ? !1 : tmp6;
2917
- if (L.info("createText", r, t, e, u, i, l, m), i) {
2918
- var c = _r(r), p = {
2919
- isNode: l,
2920
- label: q0(c).replace(/fa[blrs]?:fa-[\w-]+/g, // cspell: disable-line
2921
- function(x) {
2922
- return "<i class='".concat(x.replace(":", " "), "'></i>");
2923
- }),
2924
- labelStyle: t.replace("fill:", "color:")
2925
- };
2926
- return Hr(n, p, a, u, m);
2927
- } else {
2928
- var c1 = Pr(r);
2929
- return Vr(a, n, c1, m);
2930
- }
2931
- };
2932
-
2933
- export { Qr as Q, Ur as U };