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