@burger-editor/client 4.0.0-alpha.5 → 4.0.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.js CHANGED
@@ -27,7 +27,7 @@ function kebabCase(str) {
27
27
  }
28
28
 
29
29
  /**
30
- * marked v15.0.12 - a markdown parser
30
+ * marked v16.0.0 - a markdown parser
31
31
  * Copyright (c) 2011-2025, Christopher Jeffrey. (MIT Licensed)
32
32
  * https://github.com/markedjs/marked
33
33
  */
@@ -37,2160 +37,62 @@ function kebabCase(str) {
37
37
  * The code in this file is generated from files in ./src/
38
38
  */
39
39
 
40
-
41
- // src/defaults.ts
42
- function _getDefaults() {
43
- return {
44
- async: false,
45
- breaks: false,
46
- extensions: null,
47
- gfm: true,
48
- hooks: null,
49
- pedantic: false,
50
- renderer: null,
51
- silent: false,
52
- tokenizer: null,
53
- walkTokens: null
54
- };
55
- }
56
- var _defaults = _getDefaults();
57
- function changeDefaults(newDefaults) {
58
- _defaults = newDefaults;
59
- }
60
-
61
- // src/rules.ts
62
- var noopTest = { exec: () => null };
63
- function edit(regex, opt = "") {
64
- let source = typeof regex === "string" ? regex : regex.source;
65
- const obj = {
66
- replace: (name, val) => {
67
- let valSource = typeof val === "string" ? val : val.source;
68
- valSource = valSource.replace(other.caret, "$1");
69
- source = source.replace(name, valSource);
70
- return obj;
71
- },
72
- getRegex: () => {
73
- return new RegExp(source, opt);
74
- }
75
- };
76
- return obj;
77
- }
78
- var other = {
79
- codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
80
- outputLinkReplace: /\\([\[\]])/g,
81
- indentCodeCompensation: /^(\s+)(?:```)/,
82
- beginningSpace: /^\s+/,
83
- endingHash: /#$/,
84
- startingSpaceChar: /^ /,
85
- endingSpaceChar: / $/,
86
- nonSpaceChar: /[^ ]/,
87
- newLineCharGlobal: /\n/g,
88
- tabCharGlobal: /\t/g,
89
- multipleSpaceGlobal: /\s+/g,
90
- blankLine: /^[ \t]*$/,
91
- doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
92
- blockquoteStart: /^ {0,3}>/,
93
- blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
94
- blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
95
- listReplaceTabs: /^\t+/,
96
- listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
97
- listIsTask: /^\[[ xX]\] /,
98
- listReplaceTask: /^\[[ xX]\] +/,
99
- anyLine: /\n.*\n/,
100
- hrefBrackets: /^<(.*)>$/,
101
- tableDelimiter: /[:|]/,
102
- tableAlignChars: /^\||\| *$/g,
103
- tableRowBlankLine: /\n[ \t]*$/,
104
- tableAlignRight: /^ *-+: *$/,
105
- tableAlignCenter: /^ *:-+: *$/,
106
- tableAlignLeft: /^ *:-+ *$/,
107
- startATag: /^<a /i,
108
- endATag: /^<\/a>/i,
109
- startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
110
- endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
111
- startAngleBracket: /^</,
112
- endAngleBracket: />$/,
113
- pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
114
- unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
115
- escapeTest: /[&<>"']/,
116
- escapeReplace: /[&<>"']/g,
117
- escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
118
- escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
119
- unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,
120
- caret: /(^|[^\[])\^/g,
121
- percentDecode: /%25/g,
122
- findPipe: /\|/g,
123
- splitPipe: / \|/,
124
- slashPipe: /\\\|/g,
125
- carriageReturn: /\r\n|\r/g,
126
- spaceLine: /^ +$/gm,
127
- notSpaceStart: /^\S*/,
128
- endingNewline: /\n$/,
129
- listItemRegex: (bull) => new RegExp(`^( {0,3}${bull})((?:[ ][^\\n]*)?(?:\\n|$))`),
130
- nextBulletRegex: (indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),
131
- hrRegex: (indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),
132
- fencesBeginRegex: (indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\`\`\`|~~~)`),
133
- headingBeginRegex: (indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`),
134
- htmlBeginRegex: (indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}<(?:[a-z].*>|!--)`, "i")
135
- };
136
- var newline = /^(?:[ \t]*(?:\n|$))+/;
137
- var blockCode = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
138
- var fences = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
139
- var hr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
140
- var heading = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
141
- var bullet = /(?:[*+-]|\d{1,9}[.)])/;
142
- var lheadingCore = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
143
- var lheading = edit(lheadingCore).replace(/bull/g, bullet).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex();
144
- var lheadingGfm = edit(lheadingCore).replace(/bull/g, bullet).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex();
145
- var _paragraph = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
146
- var blockText = /^[^\n]+/;
147
- var _blockLabel = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
148
- var def = edit(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", _blockLabel).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
149
- var list = edit(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, bullet).getRegex();
150
- var _tag = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
151
- var _comment = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
152
- var html$1 = edit(
153
- "^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))",
154
- "i"
155
- ).replace("comment", _comment).replace("tag", _tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
156
- var paragraph = edit(_paragraph).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex();
157
- var blockquote = edit(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", paragraph).getRegex();
158
- var blockNormal = {
159
- blockquote,
160
- code: blockCode,
161
- def,
162
- fences,
163
- heading,
164
- hr,
165
- html: html$1,
166
- lheading,
167
- list,
168
- newline,
169
- paragraph,
170
- table: noopTest,
171
- text: blockText
172
- };
173
- var gfmTable = edit(
174
- "^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
175
- ).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex();
176
- var blockGfm = {
177
- ...blockNormal,
178
- lheading: lheadingGfm,
179
- table: gfmTable,
180
- paragraph: edit(_paragraph).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", gfmTable).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex()
181
- };
182
- var blockPedantic = {
183
- ...blockNormal,
184
- html: edit(
185
- `^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`
186
- ).replace("comment", _comment).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
187
- def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
188
- heading: /^(#{1,6})(.*)(?:\n+|$)/,
189
- fences: noopTest,
190
- // fences not supported
191
- lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
192
- paragraph: edit(_paragraph).replace("hr", hr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", lheading).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
193
- };
194
- var escape = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
195
- var inlineCode = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
196
- var br = /^( {2,}|\\)\n(?!\s*$)/;
197
- var inlineText = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
198
- var _punctuation = /[\p{P}\p{S}]/u;
199
- var _punctuationOrSpace = /[\s\p{P}\p{S}]/u;
200
- var _notPunctuationOrSpace = /[^\s\p{P}\p{S}]/u;
201
- var punctuation = edit(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, _punctuationOrSpace).getRegex();
202
- var _punctuationGfmStrongEm = /(?!~)[\p{P}\p{S}]/u;
203
- var _punctuationOrSpaceGfmStrongEm = /(?!~)[\s\p{P}\p{S}]/u;
204
- var _notPunctuationOrSpaceGfmStrongEm = /(?:[^\s\p{P}\p{S}]|~)/u;
205
- var blockSkip = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g;
206
- var emStrongLDelimCore = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/;
207
- var emStrongLDelim = edit(emStrongLDelimCore, "u").replace(/punct/g, _punctuation).getRegex();
208
- var emStrongLDelimGfm = edit(emStrongLDelimCore, "u").replace(/punct/g, _punctuationGfmStrongEm).getRegex();
209
- var emStrongRDelimAstCore = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
210
- var emStrongRDelimAst = edit(emStrongRDelimAstCore, "gu").replace(/notPunctSpace/g, _notPunctuationOrSpace).replace(/punctSpace/g, _punctuationOrSpace).replace(/punct/g, _punctuation).getRegex();
211
- var emStrongRDelimAstGfm = edit(emStrongRDelimAstCore, "gu").replace(/notPunctSpace/g, _notPunctuationOrSpaceGfmStrongEm).replace(/punctSpace/g, _punctuationOrSpaceGfmStrongEm).replace(/punct/g, _punctuationGfmStrongEm).getRegex();
212
- var emStrongRDelimUnd = edit(
213
- "^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)",
214
- "gu"
215
- ).replace(/notPunctSpace/g, _notPunctuationOrSpace).replace(/punctSpace/g, _punctuationOrSpace).replace(/punct/g, _punctuation).getRegex();
216
- var anyPunctuation = edit(/\\(punct)/, "gu").replace(/punct/g, _punctuation).getRegex();
217
- var autolink = edit(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex();
218
- var _inlineComment = edit(_comment).replace("(?:-->|$)", "-->").getRegex();
219
- var tag = edit(
220
- "^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>"
221
- ).replace("comment", _inlineComment).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
222
- var _inlineLabel = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
223
- var link$1 = edit(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", _inlineLabel).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
224
- var reflink = edit(/^!?\[(label)\]\[(ref)\]/).replace("label", _inlineLabel).replace("ref", _blockLabel).getRegex();
225
- var nolink = edit(/^!?\[(ref)\](?:\[\])?/).replace("ref", _blockLabel).getRegex();
226
- var reflinkSearch = edit("reflink|nolink(?!\\()", "g").replace("reflink", reflink).replace("nolink", nolink).getRegex();
227
- var inlineNormal = {
228
- _backpedal: noopTest,
229
- // only used for GFM url
230
- anyPunctuation,
231
- autolink,
232
- blockSkip,
233
- br,
234
- code: inlineCode,
235
- del: noopTest,
236
- emStrongLDelim,
237
- emStrongRDelimAst,
238
- emStrongRDelimUnd,
239
- escape,
240
- link: link$1,
241
- nolink,
242
- punctuation,
243
- reflink,
244
- reflinkSearch,
245
- tag,
246
- text: inlineText,
247
- url: noopTest
248
- };
249
- var inlinePedantic = {
250
- ...inlineNormal,
251
- link: edit(/^!?\[(label)\]\((.*?)\)/).replace("label", _inlineLabel).getRegex(),
252
- reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", _inlineLabel).getRegex()
253
- };
254
- var inlineGfm = {
255
- ...inlineNormal,
256
- emStrongRDelimAst: emStrongRDelimAstGfm,
257
- emStrongLDelim: emStrongLDelimGfm,
258
- url: edit(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
259
- _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
260
- del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,
261
- text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
262
- };
263
- var inlineBreaks = {
264
- ...inlineGfm,
265
- br: edit(br).replace("{2,}", "*").getRegex(),
266
- text: edit(inlineGfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
267
- };
268
- var block$1 = {
269
- normal: blockNormal,
270
- gfm: blockGfm,
271
- pedantic: blockPedantic
272
- };
273
- var inline = {
274
- normal: inlineNormal,
275
- gfm: inlineGfm,
276
- breaks: inlineBreaks,
277
- pedantic: inlinePedantic
278
- };
279
-
280
- // src/helpers.ts
281
- var escapeReplacements = {
282
- "&": "&amp;",
283
- "<": "&lt;",
284
- ">": "&gt;",
285
- '"': "&quot;",
286
- "'": "&#39;"
287
- };
288
- var getEscapeReplacement = (ch) => escapeReplacements[ch];
289
- function escape2(html2, encode) {
290
- if (encode) {
291
- if (other.escapeTest.test(html2)) {
292
- return html2.replace(other.escapeReplace, getEscapeReplacement);
293
- }
294
- } else {
295
- if (other.escapeTestNoEncode.test(html2)) {
296
- return html2.replace(other.escapeReplaceNoEncode, getEscapeReplacement);
297
- }
298
- }
299
- return html2;
300
- }
301
- function cleanUrl(href) {
302
- try {
303
- href = encodeURI(href).replace(other.percentDecode, "%");
304
- } catch {
305
- return null;
306
- }
307
- return href;
308
- }
309
- function splitCells(tableRow, count) {
310
- const row = tableRow.replace(other.findPipe, (match, offset, str) => {
311
- let escaped = false;
312
- let curr = offset;
313
- while (--curr >= 0 && str[curr] === "\\") escaped = !escaped;
314
- if (escaped) {
315
- return "|";
316
- } else {
317
- return " |";
318
- }
319
- }), cells = row.split(other.splitPipe);
320
- let i = 0;
321
- if (!cells[0].trim()) {
322
- cells.shift();
323
- }
324
- if (cells.length > 0 && !cells.at(-1)?.trim()) {
325
- cells.pop();
326
- }
327
- if (count) {
328
- if (cells.length > count) {
329
- cells.splice(count);
330
- } else {
331
- while (cells.length < count) cells.push("");
332
- }
333
- }
334
- for (; i < cells.length; i++) {
335
- cells[i] = cells[i].trim().replace(other.slashPipe, "|");
336
- }
337
- return cells;
338
- }
339
- function rtrim(str, c, invert) {
340
- const l = str.length;
341
- if (l === 0) {
342
- return "";
343
- }
344
- let suffLen = 0;
345
- while (suffLen < l) {
346
- const currChar = str.charAt(l - suffLen - 1);
347
- if (currChar === c && true) {
348
- suffLen++;
349
- } else {
350
- break;
351
- }
352
- }
353
- return str.slice(0, l - suffLen);
354
- }
355
- function findClosingBracket(str, b) {
356
- if (str.indexOf(b[1]) === -1) {
357
- return -1;
358
- }
359
- let level = 0;
360
- for (let i = 0; i < str.length; i++) {
361
- if (str[i] === "\\") {
362
- i++;
363
- } else if (str[i] === b[0]) {
364
- level++;
365
- } else if (str[i] === b[1]) {
366
- level--;
367
- if (level < 0) {
368
- return i;
369
- }
370
- }
371
- }
372
- if (level > 0) {
373
- return -2;
374
- }
375
- return -1;
376
- }
377
-
378
- // src/Tokenizer.ts
379
- function outputLink(cap, link2, raw, lexer2, rules) {
380
- const href = link2.href;
381
- const title = link2.title || null;
382
- const text = cap[1].replace(rules.other.outputLinkReplace, "$1");
383
- lexer2.state.inLink = true;
384
- const token = {
385
- type: cap[0].charAt(0) === "!" ? "image" : "link",
386
- raw,
387
- href,
388
- title,
389
- text,
390
- tokens: lexer2.inlineTokens(text)
391
- };
392
- lexer2.state.inLink = false;
393
- return token;
394
- }
395
- function indentCodeCompensation(raw, text, rules) {
396
- const matchIndentToCode = raw.match(rules.other.indentCodeCompensation);
397
- if (matchIndentToCode === null) {
398
- return text;
399
- }
400
- const indentToCode = matchIndentToCode[1];
401
- return text.split("\n").map((node) => {
402
- const matchIndentInNode = node.match(rules.other.beginningSpace);
403
- if (matchIndentInNode === null) {
404
- return node;
405
- }
406
- const [indentInNode] = matchIndentInNode;
407
- if (indentInNode.length >= indentToCode.length) {
408
- return node.slice(indentToCode.length);
409
- }
410
- return node;
411
- }).join("\n");
412
- }
413
- var _Tokenizer = class {
414
- options;
415
- rules;
416
- // set by the lexer
417
- lexer;
418
- // set by the lexer
419
- constructor(options2) {
420
- this.options = options2 || _defaults;
421
- }
422
- space(src) {
423
- const cap = this.rules.block.newline.exec(src);
424
- if (cap && cap[0].length > 0) {
425
- return {
426
- type: "space",
427
- raw: cap[0]
428
- };
429
- }
430
- }
431
- code(src) {
432
- const cap = this.rules.block.code.exec(src);
433
- if (cap) {
434
- const text = cap[0].replace(this.rules.other.codeRemoveIndent, "");
435
- return {
436
- type: "code",
437
- raw: cap[0],
438
- codeBlockStyle: "indented",
439
- text: !this.options.pedantic ? rtrim(text, "\n") : text
440
- };
441
- }
442
- }
443
- fences(src) {
444
- const cap = this.rules.block.fences.exec(src);
445
- if (cap) {
446
- const raw = cap[0];
447
- const text = indentCodeCompensation(raw, cap[3] || "", this.rules);
448
- return {
449
- type: "code",
450
- raw,
451
- lang: cap[2] ? cap[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : cap[2],
452
- text
453
- };
454
- }
455
- }
456
- heading(src) {
457
- const cap = this.rules.block.heading.exec(src);
458
- if (cap) {
459
- let text = cap[2].trim();
460
- if (this.rules.other.endingHash.test(text)) {
461
- const trimmed = rtrim(text, "#");
462
- if (this.options.pedantic) {
463
- text = trimmed.trim();
464
- } else if (!trimmed || this.rules.other.endingSpaceChar.test(trimmed)) {
465
- text = trimmed.trim();
466
- }
467
- }
468
- return {
469
- type: "heading",
470
- raw: cap[0],
471
- depth: cap[1].length,
472
- text,
473
- tokens: this.lexer.inline(text)
474
- };
475
- }
476
- }
477
- hr(src) {
478
- const cap = this.rules.block.hr.exec(src);
479
- if (cap) {
480
- return {
481
- type: "hr",
482
- raw: rtrim(cap[0], "\n")
483
- };
484
- }
485
- }
486
- blockquote(src) {
487
- const cap = this.rules.block.blockquote.exec(src);
488
- if (cap) {
489
- let lines = rtrim(cap[0], "\n").split("\n");
490
- let raw = "";
491
- let text = "";
492
- const tokens = [];
493
- while (lines.length > 0) {
494
- let inBlockquote = false;
495
- const currentLines = [];
496
- let i;
497
- for (i = 0; i < lines.length; i++) {
498
- if (this.rules.other.blockquoteStart.test(lines[i])) {
499
- currentLines.push(lines[i]);
500
- inBlockquote = true;
501
- } else if (!inBlockquote) {
502
- currentLines.push(lines[i]);
503
- } else {
504
- break;
505
- }
506
- }
507
- lines = lines.slice(i);
508
- const currentRaw = currentLines.join("\n");
509
- const currentText = currentRaw.replace(this.rules.other.blockquoteSetextReplace, "\n $1").replace(this.rules.other.blockquoteSetextReplace2, "");
510
- raw = raw ? `${raw}
511
- ${currentRaw}` : currentRaw;
512
- text = text ? `${text}
513
- ${currentText}` : currentText;
514
- const top = this.lexer.state.top;
515
- this.lexer.state.top = true;
516
- this.lexer.blockTokens(currentText, tokens, true);
517
- this.lexer.state.top = top;
518
- if (lines.length === 0) {
519
- break;
520
- }
521
- const lastToken = tokens.at(-1);
522
- if (lastToken?.type === "code") {
523
- break;
524
- } else if (lastToken?.type === "blockquote") {
525
- const oldToken = lastToken;
526
- const newText = oldToken.raw + "\n" + lines.join("\n");
527
- const newToken = this.blockquote(newText);
528
- tokens[tokens.length - 1] = newToken;
529
- raw = raw.substring(0, raw.length - oldToken.raw.length) + newToken.raw;
530
- text = text.substring(0, text.length - oldToken.text.length) + newToken.text;
531
- break;
532
- } else if (lastToken?.type === "list") {
533
- const oldToken = lastToken;
534
- const newText = oldToken.raw + "\n" + lines.join("\n");
535
- const newToken = this.list(newText);
536
- tokens[tokens.length - 1] = newToken;
537
- raw = raw.substring(0, raw.length - lastToken.raw.length) + newToken.raw;
538
- text = text.substring(0, text.length - oldToken.raw.length) + newToken.raw;
539
- lines = newText.substring(tokens.at(-1).raw.length).split("\n");
540
- continue;
541
- }
542
- }
543
- return {
544
- type: "blockquote",
545
- raw,
546
- tokens,
547
- text
548
- };
549
- }
550
- }
551
- list(src) {
552
- let cap = this.rules.block.list.exec(src);
553
- if (cap) {
554
- let bull = cap[1].trim();
555
- const isordered = bull.length > 1;
556
- const list2 = {
557
- type: "list",
558
- raw: "",
559
- ordered: isordered,
560
- start: isordered ? +bull.slice(0, -1) : "",
561
- loose: false,
562
- items: []
563
- };
564
- bull = isordered ? `\\d{1,9}\\${bull.slice(-1)}` : `\\${bull}`;
565
- if (this.options.pedantic) {
566
- bull = isordered ? bull : "[*+-]";
567
- }
568
- const itemRegex = this.rules.other.listItemRegex(bull);
569
- let endsWithBlankLine = false;
570
- while (src) {
571
- let endEarly = false;
572
- let raw = "";
573
- let itemContents = "";
574
- if (!(cap = itemRegex.exec(src))) {
575
- break;
576
- }
577
- if (this.rules.block.hr.test(src)) {
578
- break;
579
- }
580
- raw = cap[0];
581
- src = src.substring(raw.length);
582
- let line = cap[2].split("\n", 1)[0].replace(this.rules.other.listReplaceTabs, (t) => " ".repeat(3 * t.length));
583
- let nextLine = src.split("\n", 1)[0];
584
- let blankLine = !line.trim();
585
- let indent = 0;
586
- if (this.options.pedantic) {
587
- indent = 2;
588
- itemContents = line.trimStart();
589
- } else if (blankLine) {
590
- indent = cap[1].length + 1;
591
- } else {
592
- indent = cap[2].search(this.rules.other.nonSpaceChar);
593
- indent = indent > 4 ? 1 : indent;
594
- itemContents = line.slice(indent);
595
- indent += cap[1].length;
596
- }
597
- if (blankLine && this.rules.other.blankLine.test(nextLine)) {
598
- raw += nextLine + "\n";
599
- src = src.substring(nextLine.length + 1);
600
- endEarly = true;
601
- }
602
- if (!endEarly) {
603
- const nextBulletRegex = this.rules.other.nextBulletRegex(indent);
604
- const hrRegex = this.rules.other.hrRegex(indent);
605
- const fencesBeginRegex = this.rules.other.fencesBeginRegex(indent);
606
- const headingBeginRegex = this.rules.other.headingBeginRegex(indent);
607
- const htmlBeginRegex = this.rules.other.htmlBeginRegex(indent);
608
- while (src) {
609
- const rawLine = src.split("\n", 1)[0];
610
- let nextLineWithoutTabs;
611
- nextLine = rawLine;
612
- if (this.options.pedantic) {
613
- nextLine = nextLine.replace(this.rules.other.listReplaceNesting, " ");
614
- nextLineWithoutTabs = nextLine;
615
- } else {
616
- nextLineWithoutTabs = nextLine.replace(this.rules.other.tabCharGlobal, " ");
617
- }
618
- if (fencesBeginRegex.test(nextLine)) {
619
- break;
620
- }
621
- if (headingBeginRegex.test(nextLine)) {
622
- break;
623
- }
624
- if (htmlBeginRegex.test(nextLine)) {
625
- break;
626
- }
627
- if (nextBulletRegex.test(nextLine)) {
628
- break;
629
- }
630
- if (hrRegex.test(nextLine)) {
631
- break;
632
- }
633
- if (nextLineWithoutTabs.search(this.rules.other.nonSpaceChar) >= indent || !nextLine.trim()) {
634
- itemContents += "\n" + nextLineWithoutTabs.slice(indent);
635
- } else {
636
- if (blankLine) {
637
- break;
638
- }
639
- if (line.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4) {
640
- break;
641
- }
642
- if (fencesBeginRegex.test(line)) {
643
- break;
644
- }
645
- if (headingBeginRegex.test(line)) {
646
- break;
647
- }
648
- if (hrRegex.test(line)) {
649
- break;
650
- }
651
- itemContents += "\n" + nextLine;
652
- }
653
- if (!blankLine && !nextLine.trim()) {
654
- blankLine = true;
655
- }
656
- raw += rawLine + "\n";
657
- src = src.substring(rawLine.length + 1);
658
- line = nextLineWithoutTabs.slice(indent);
659
- }
660
- }
661
- if (!list2.loose) {
662
- if (endsWithBlankLine) {
663
- list2.loose = true;
664
- } else if (this.rules.other.doubleBlankLine.test(raw)) {
665
- endsWithBlankLine = true;
666
- }
667
- }
668
- let istask = null;
669
- let ischecked;
670
- if (this.options.gfm) {
671
- istask = this.rules.other.listIsTask.exec(itemContents);
672
- if (istask) {
673
- ischecked = istask[0] !== "[ ] ";
674
- itemContents = itemContents.replace(this.rules.other.listReplaceTask, "");
675
- }
676
- }
677
- list2.items.push({
678
- type: "list_item",
679
- raw,
680
- task: !!istask,
681
- checked: ischecked,
682
- loose: false,
683
- text: itemContents,
684
- tokens: []
685
- });
686
- list2.raw += raw;
687
- }
688
- const lastItem = list2.items.at(-1);
689
- if (lastItem) {
690
- lastItem.raw = lastItem.raw.trimEnd();
691
- lastItem.text = lastItem.text.trimEnd();
692
- } else {
693
- return;
694
- }
695
- list2.raw = list2.raw.trimEnd();
696
- for (let i = 0; i < list2.items.length; i++) {
697
- this.lexer.state.top = false;
698
- list2.items[i].tokens = this.lexer.blockTokens(list2.items[i].text, []);
699
- if (!list2.loose) {
700
- const spacers = list2.items[i].tokens.filter((t) => t.type === "space");
701
- const hasMultipleLineBreaks = spacers.length > 0 && spacers.some((t) => this.rules.other.anyLine.test(t.raw));
702
- list2.loose = hasMultipleLineBreaks;
703
- }
704
- }
705
- if (list2.loose) {
706
- for (let i = 0; i < list2.items.length; i++) {
707
- list2.items[i].loose = true;
708
- }
709
- }
710
- return list2;
711
- }
712
- }
713
- html(src) {
714
- const cap = this.rules.block.html.exec(src);
715
- if (cap) {
716
- const token = {
717
- type: "html",
718
- block: true,
719
- raw: cap[0],
720
- pre: cap[1] === "pre" || cap[1] === "script" || cap[1] === "style",
721
- text: cap[0]
722
- };
723
- return token;
724
- }
725
- }
726
- def(src) {
727
- const cap = this.rules.block.def.exec(src);
728
- if (cap) {
729
- const tag2 = cap[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " ");
730
- const href = cap[2] ? cap[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "";
731
- const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : cap[3];
732
- return {
733
- type: "def",
734
- tag: tag2,
735
- raw: cap[0],
736
- href,
737
- title
738
- };
739
- }
740
- }
741
- table(src) {
742
- const cap = this.rules.block.table.exec(src);
743
- if (!cap) {
744
- return;
745
- }
746
- if (!this.rules.other.tableDelimiter.test(cap[2])) {
747
- return;
748
- }
749
- const headers = splitCells(cap[1]);
750
- const aligns = cap[2].replace(this.rules.other.tableAlignChars, "").split("|");
751
- const rows = cap[3]?.trim() ? cap[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [];
752
- const item = {
753
- type: "table",
754
- raw: cap[0],
755
- header: [],
756
- align: [],
757
- rows: []
758
- };
759
- if (headers.length !== aligns.length) {
760
- return;
761
- }
762
- for (const align of aligns) {
763
- if (this.rules.other.tableAlignRight.test(align)) {
764
- item.align.push("right");
765
- } else if (this.rules.other.tableAlignCenter.test(align)) {
766
- item.align.push("center");
767
- } else if (this.rules.other.tableAlignLeft.test(align)) {
768
- item.align.push("left");
769
- } else {
770
- item.align.push(null);
771
- }
772
- }
773
- for (let i = 0; i < headers.length; i++) {
774
- item.header.push({
775
- text: headers[i],
776
- tokens: this.lexer.inline(headers[i]),
777
- header: true,
778
- align: item.align[i]
779
- });
780
- }
781
- for (const row of rows) {
782
- item.rows.push(splitCells(row, item.header.length).map((cell, i) => {
783
- return {
784
- text: cell,
785
- tokens: this.lexer.inline(cell),
786
- header: false,
787
- align: item.align[i]
788
- };
789
- }));
790
- }
791
- return item;
792
- }
793
- lheading(src) {
794
- const cap = this.rules.block.lheading.exec(src);
795
- if (cap) {
796
- return {
797
- type: "heading",
798
- raw: cap[0],
799
- depth: cap[2].charAt(0) === "=" ? 1 : 2,
800
- text: cap[1],
801
- tokens: this.lexer.inline(cap[1])
802
- };
803
- }
804
- }
805
- paragraph(src) {
806
- const cap = this.rules.block.paragraph.exec(src);
807
- if (cap) {
808
- const text = cap[1].charAt(cap[1].length - 1) === "\n" ? cap[1].slice(0, -1) : cap[1];
809
- return {
810
- type: "paragraph",
811
- raw: cap[0],
812
- text,
813
- tokens: this.lexer.inline(text)
814
- };
815
- }
816
- }
817
- text(src) {
818
- const cap = this.rules.block.text.exec(src);
819
- if (cap) {
820
- return {
821
- type: "text",
822
- raw: cap[0],
823
- text: cap[0],
824
- tokens: this.lexer.inline(cap[0])
825
- };
826
- }
827
- }
828
- escape(src) {
829
- const cap = this.rules.inline.escape.exec(src);
830
- if (cap) {
831
- return {
832
- type: "escape",
833
- raw: cap[0],
834
- text: cap[1]
835
- };
836
- }
837
- }
838
- tag(src) {
839
- const cap = this.rules.inline.tag.exec(src);
840
- if (cap) {
841
- if (!this.lexer.state.inLink && this.rules.other.startATag.test(cap[0])) {
842
- this.lexer.state.inLink = true;
843
- } else if (this.lexer.state.inLink && this.rules.other.endATag.test(cap[0])) {
844
- this.lexer.state.inLink = false;
845
- }
846
- if (!this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(cap[0])) {
847
- this.lexer.state.inRawBlock = true;
848
- } else if (this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(cap[0])) {
849
- this.lexer.state.inRawBlock = false;
850
- }
851
- return {
852
- type: "html",
853
- raw: cap[0],
854
- inLink: this.lexer.state.inLink,
855
- inRawBlock: this.lexer.state.inRawBlock,
856
- block: false,
857
- text: cap[0]
858
- };
859
- }
860
- }
861
- link(src) {
862
- const cap = this.rules.inline.link.exec(src);
863
- if (cap) {
864
- const trimmedUrl = cap[2].trim();
865
- if (!this.options.pedantic && this.rules.other.startAngleBracket.test(trimmedUrl)) {
866
- if (!this.rules.other.endAngleBracket.test(trimmedUrl)) {
867
- return;
868
- }
869
- const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), "\\");
870
- if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {
871
- return;
872
- }
873
- } else {
874
- const lastParenIndex = findClosingBracket(cap[2], "()");
875
- if (lastParenIndex === -2) {
876
- return;
877
- }
878
- if (lastParenIndex > -1) {
879
- const start = cap[0].indexOf("!") === 0 ? 5 : 4;
880
- const linkLen = start + cap[1].length + lastParenIndex;
881
- cap[2] = cap[2].substring(0, lastParenIndex);
882
- cap[0] = cap[0].substring(0, linkLen).trim();
883
- cap[3] = "";
884
- }
885
- }
886
- let href = cap[2];
887
- let title = "";
888
- if (this.options.pedantic) {
889
- const link2 = this.rules.other.pedanticHrefTitle.exec(href);
890
- if (link2) {
891
- href = link2[1];
892
- title = link2[3];
893
- }
894
- } else {
895
- title = cap[3] ? cap[3].slice(1, -1) : "";
896
- }
897
- href = href.trim();
898
- if (this.rules.other.startAngleBracket.test(href)) {
899
- if (this.options.pedantic && !this.rules.other.endAngleBracket.test(trimmedUrl)) {
900
- href = href.slice(1);
901
- } else {
902
- href = href.slice(1, -1);
903
- }
904
- }
905
- return outputLink(cap, {
906
- href: href ? href.replace(this.rules.inline.anyPunctuation, "$1") : href,
907
- title: title ? title.replace(this.rules.inline.anyPunctuation, "$1") : title
908
- }, cap[0], this.lexer, this.rules);
909
- }
910
- }
911
- reflink(src, links) {
912
- let cap;
913
- if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) {
914
- const linkString = (cap[2] || cap[1]).replace(this.rules.other.multipleSpaceGlobal, " ");
915
- const link2 = links[linkString.toLowerCase()];
916
- if (!link2) {
917
- const text = cap[0].charAt(0);
918
- return {
919
- type: "text",
920
- raw: text,
921
- text
922
- };
923
- }
924
- return outputLink(cap, link2, cap[0], this.lexer, this.rules);
925
- }
926
- }
927
- emStrong(src, maskedSrc, prevChar = "") {
928
- let match = this.rules.inline.emStrongLDelim.exec(src);
929
- if (!match) return;
930
- if (match[3] && prevChar.match(this.rules.other.unicodeAlphaNumeric)) return;
931
- const nextChar = match[1] || match[2] || "";
932
- if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) {
933
- const lLength = [...match[0]].length - 1;
934
- let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;
935
- const endReg = match[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
936
- endReg.lastIndex = 0;
937
- maskedSrc = maskedSrc.slice(-1 * src.length + lLength);
938
- while ((match = endReg.exec(maskedSrc)) != null) {
939
- rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];
940
- if (!rDelim) continue;
941
- rLength = [...rDelim].length;
942
- if (match[3] || match[4]) {
943
- delimTotal += rLength;
944
- continue;
945
- } else if (match[5] || match[6]) {
946
- if (lLength % 3 && !((lLength + rLength) % 3)) {
947
- midDelimTotal += rLength;
948
- continue;
949
- }
950
- }
951
- delimTotal -= rLength;
952
- if (delimTotal > 0) continue;
953
- rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);
954
- const lastCharLength = [...match[0]][0].length;
955
- const raw = src.slice(0, lLength + match.index + lastCharLength + rLength);
956
- if (Math.min(lLength, rLength) % 2) {
957
- const text2 = raw.slice(1, -1);
958
- return {
959
- type: "em",
960
- raw,
961
- text: text2,
962
- tokens: this.lexer.inlineTokens(text2)
963
- };
964
- }
965
- const text = raw.slice(2, -2);
966
- return {
967
- type: "strong",
968
- raw,
969
- text,
970
- tokens: this.lexer.inlineTokens(text)
971
- };
972
- }
973
- }
974
- }
975
- codespan(src) {
976
- const cap = this.rules.inline.code.exec(src);
977
- if (cap) {
978
- let text = cap[2].replace(this.rules.other.newLineCharGlobal, " ");
979
- const hasNonSpaceChars = this.rules.other.nonSpaceChar.test(text);
980
- const hasSpaceCharsOnBothEnds = this.rules.other.startingSpaceChar.test(text) && this.rules.other.endingSpaceChar.test(text);
981
- if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {
982
- text = text.substring(1, text.length - 1);
983
- }
984
- return {
985
- type: "codespan",
986
- raw: cap[0],
987
- text
988
- };
989
- }
990
- }
991
- br(src) {
992
- const cap = this.rules.inline.br.exec(src);
993
- if (cap) {
994
- return {
995
- type: "br",
996
- raw: cap[0]
997
- };
998
- }
999
- }
1000
- del(src) {
1001
- const cap = this.rules.inline.del.exec(src);
1002
- if (cap) {
1003
- return {
1004
- type: "del",
1005
- raw: cap[0],
1006
- text: cap[2],
1007
- tokens: this.lexer.inlineTokens(cap[2])
1008
- };
1009
- }
1010
- }
1011
- autolink(src) {
1012
- const cap = this.rules.inline.autolink.exec(src);
1013
- if (cap) {
1014
- let text, href;
1015
- if (cap[2] === "@") {
1016
- text = cap[1];
1017
- href = "mailto:" + text;
1018
- } else {
1019
- text = cap[1];
1020
- href = text;
1021
- }
1022
- return {
1023
- type: "link",
1024
- raw: cap[0],
1025
- text,
1026
- href,
1027
- tokens: [
1028
- {
1029
- type: "text",
1030
- raw: text,
1031
- text
1032
- }
1033
- ]
1034
- };
1035
- }
1036
- }
1037
- url(src) {
1038
- let cap;
1039
- if (cap = this.rules.inline.url.exec(src)) {
1040
- let text, href;
1041
- if (cap[2] === "@") {
1042
- text = cap[0];
1043
- href = "mailto:" + text;
1044
- } else {
1045
- let prevCapZero;
1046
- do {
1047
- prevCapZero = cap[0];
1048
- cap[0] = this.rules.inline._backpedal.exec(cap[0])?.[0] ?? "";
1049
- } while (prevCapZero !== cap[0]);
1050
- text = cap[0];
1051
- if (cap[1] === "www.") {
1052
- href = "http://" + cap[0];
1053
- } else {
1054
- href = cap[0];
1055
- }
1056
- }
1057
- return {
1058
- type: "link",
1059
- raw: cap[0],
1060
- text,
1061
- href,
1062
- tokens: [
1063
- {
1064
- type: "text",
1065
- raw: text,
1066
- text
1067
- }
1068
- ]
1069
- };
1070
- }
1071
- }
1072
- inlineText(src) {
1073
- const cap = this.rules.inline.text.exec(src);
1074
- if (cap) {
1075
- const escaped = this.lexer.state.inRawBlock;
1076
- return {
1077
- type: "text",
1078
- raw: cap[0],
1079
- text: cap[0],
1080
- escaped
1081
- };
1082
- }
1083
- }
1084
- };
1085
-
1086
- // src/Lexer.ts
1087
- var _Lexer = class __Lexer {
1088
- tokens;
1089
- options;
1090
- state;
1091
- tokenizer;
1092
- inlineQueue;
1093
- constructor(options2) {
1094
- this.tokens = [];
1095
- this.tokens.links = /* @__PURE__ */ Object.create(null);
1096
- this.options = options2 || _defaults;
1097
- this.options.tokenizer = this.options.tokenizer || new _Tokenizer();
1098
- this.tokenizer = this.options.tokenizer;
1099
- this.tokenizer.options = this.options;
1100
- this.tokenizer.lexer = this;
1101
- this.inlineQueue = [];
1102
- this.state = {
1103
- inLink: false,
1104
- inRawBlock: false,
1105
- top: true
1106
- };
1107
- const rules = {
1108
- other,
1109
- block: block$1.normal,
1110
- inline: inline.normal
1111
- };
1112
- if (this.options.pedantic) {
1113
- rules.block = block$1.pedantic;
1114
- rules.inline = inline.pedantic;
1115
- } else if (this.options.gfm) {
1116
- rules.block = block$1.gfm;
1117
- if (this.options.breaks) {
1118
- rules.inline = inline.breaks;
1119
- } else {
1120
- rules.inline = inline.gfm;
1121
- }
1122
- }
1123
- this.tokenizer.rules = rules;
1124
- }
1125
- /**
1126
- * Expose Rules
1127
- */
1128
- static get rules() {
1129
- return {
1130
- block: block$1,
1131
- inline
1132
- };
1133
- }
1134
- /**
1135
- * Static Lex Method
1136
- */
1137
- static lex(src, options2) {
1138
- const lexer2 = new __Lexer(options2);
1139
- return lexer2.lex(src);
1140
- }
1141
- /**
1142
- * Static Lex Inline Method
1143
- */
1144
- static lexInline(src, options2) {
1145
- const lexer2 = new __Lexer(options2);
1146
- return lexer2.inlineTokens(src);
1147
- }
1148
- /**
1149
- * Preprocessing
1150
- */
1151
- lex(src) {
1152
- src = src.replace(other.carriageReturn, "\n");
1153
- this.blockTokens(src, this.tokens);
1154
- for (let i = 0; i < this.inlineQueue.length; i++) {
1155
- const next = this.inlineQueue[i];
1156
- this.inlineTokens(next.src, next.tokens);
1157
- }
1158
- this.inlineQueue = [];
1159
- return this.tokens;
1160
- }
1161
- blockTokens(src, tokens = [], lastParagraphClipped = false) {
1162
- if (this.options.pedantic) {
1163
- src = src.replace(other.tabCharGlobal, " ").replace(other.spaceLine, "");
1164
- }
1165
- while (src) {
1166
- let token;
1167
- if (this.options.extensions?.block?.some((extTokenizer) => {
1168
- if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
1169
- src = src.substring(token.raw.length);
1170
- tokens.push(token);
1171
- return true;
1172
- }
1173
- return false;
1174
- })) {
1175
- continue;
1176
- }
1177
- if (token = this.tokenizer.space(src)) {
1178
- src = src.substring(token.raw.length);
1179
- const lastToken = tokens.at(-1);
1180
- if (token.raw.length === 1 && lastToken !== void 0) {
1181
- lastToken.raw += "\n";
1182
- } else {
1183
- tokens.push(token);
1184
- }
1185
- continue;
1186
- }
1187
- if (token = this.tokenizer.code(src)) {
1188
- src = src.substring(token.raw.length);
1189
- const lastToken = tokens.at(-1);
1190
- if (lastToken?.type === "paragraph" || lastToken?.type === "text") {
1191
- lastToken.raw += "\n" + token.raw;
1192
- lastToken.text += "\n" + token.text;
1193
- this.inlineQueue.at(-1).src = lastToken.text;
1194
- } else {
1195
- tokens.push(token);
1196
- }
1197
- continue;
1198
- }
1199
- if (token = this.tokenizer.fences(src)) {
1200
- src = src.substring(token.raw.length);
1201
- tokens.push(token);
1202
- continue;
1203
- }
1204
- if (token = this.tokenizer.heading(src)) {
1205
- src = src.substring(token.raw.length);
1206
- tokens.push(token);
1207
- continue;
1208
- }
1209
- if (token = this.tokenizer.hr(src)) {
1210
- src = src.substring(token.raw.length);
1211
- tokens.push(token);
1212
- continue;
1213
- }
1214
- if (token = this.tokenizer.blockquote(src)) {
1215
- src = src.substring(token.raw.length);
1216
- tokens.push(token);
1217
- continue;
1218
- }
1219
- if (token = this.tokenizer.list(src)) {
1220
- src = src.substring(token.raw.length);
1221
- tokens.push(token);
1222
- continue;
1223
- }
1224
- if (token = this.tokenizer.html(src)) {
1225
- src = src.substring(token.raw.length);
1226
- tokens.push(token);
1227
- continue;
1228
- }
1229
- if (token = this.tokenizer.def(src)) {
1230
- src = src.substring(token.raw.length);
1231
- const lastToken = tokens.at(-1);
1232
- if (lastToken?.type === "paragraph" || lastToken?.type === "text") {
1233
- lastToken.raw += "\n" + token.raw;
1234
- lastToken.text += "\n" + token.raw;
1235
- this.inlineQueue.at(-1).src = lastToken.text;
1236
- } else if (!this.tokens.links[token.tag]) {
1237
- this.tokens.links[token.tag] = {
1238
- href: token.href,
1239
- title: token.title
1240
- };
1241
- }
1242
- continue;
1243
- }
1244
- if (token = this.tokenizer.table(src)) {
1245
- src = src.substring(token.raw.length);
1246
- tokens.push(token);
1247
- continue;
1248
- }
1249
- if (token = this.tokenizer.lheading(src)) {
1250
- src = src.substring(token.raw.length);
1251
- tokens.push(token);
1252
- continue;
1253
- }
1254
- let cutSrc = src;
1255
- if (this.options.extensions?.startBlock) {
1256
- let startIndex = Infinity;
1257
- const tempSrc = src.slice(1);
1258
- let tempStart;
1259
- this.options.extensions.startBlock.forEach((getStartIndex) => {
1260
- tempStart = getStartIndex.call({ lexer: this }, tempSrc);
1261
- if (typeof tempStart === "number" && tempStart >= 0) {
1262
- startIndex = Math.min(startIndex, tempStart);
1263
- }
1264
- });
1265
- if (startIndex < Infinity && startIndex >= 0) {
1266
- cutSrc = src.substring(0, startIndex + 1);
1267
- }
1268
- }
1269
- if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {
1270
- const lastToken = tokens.at(-1);
1271
- if (lastParagraphClipped && lastToken?.type === "paragraph") {
1272
- lastToken.raw += "\n" + token.raw;
1273
- lastToken.text += "\n" + token.text;
1274
- this.inlineQueue.pop();
1275
- this.inlineQueue.at(-1).src = lastToken.text;
1276
- } else {
1277
- tokens.push(token);
1278
- }
1279
- lastParagraphClipped = cutSrc.length !== src.length;
1280
- src = src.substring(token.raw.length);
1281
- continue;
1282
- }
1283
- if (token = this.tokenizer.text(src)) {
1284
- src = src.substring(token.raw.length);
1285
- const lastToken = tokens.at(-1);
1286
- if (lastToken?.type === "text") {
1287
- lastToken.raw += "\n" + token.raw;
1288
- lastToken.text += "\n" + token.text;
1289
- this.inlineQueue.pop();
1290
- this.inlineQueue.at(-1).src = lastToken.text;
1291
- } else {
1292
- tokens.push(token);
1293
- }
1294
- continue;
1295
- }
1296
- if (src) {
1297
- const errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
1298
- if (this.options.silent) {
1299
- console.error(errMsg);
1300
- break;
1301
- } else {
1302
- throw new Error(errMsg);
1303
- }
1304
- }
1305
- }
1306
- this.state.top = true;
1307
- return tokens;
1308
- }
1309
- inline(src, tokens = []) {
1310
- this.inlineQueue.push({ src, tokens });
1311
- return tokens;
1312
- }
1313
- /**
1314
- * Lexing/Compiling
1315
- */
1316
- inlineTokens(src, tokens = []) {
1317
- let maskedSrc = src;
1318
- let match = null;
1319
- if (this.tokens.links) {
1320
- const links = Object.keys(this.tokens.links);
1321
- if (links.length > 0) {
1322
- while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {
1323
- if (links.includes(match[0].slice(match[0].lastIndexOf("[") + 1, -1))) {
1324
- maskedSrc = maskedSrc.slice(0, match.index) + "[" + "a".repeat(match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);
1325
- }
1326
- }
1327
- }
1328
- }
1329
- while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) {
1330
- maskedSrc = maskedSrc.slice(0, match.index) + "++" + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
1331
- }
1332
- while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
1333
- maskedSrc = maskedSrc.slice(0, match.index) + "[" + "a".repeat(match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
1334
- }
1335
- let keepPrevChar = false;
1336
- let prevChar = "";
1337
- while (src) {
1338
- if (!keepPrevChar) {
1339
- prevChar = "";
1340
- }
1341
- keepPrevChar = false;
1342
- let token;
1343
- if (this.options.extensions?.inline?.some((extTokenizer) => {
1344
- if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
1345
- src = src.substring(token.raw.length);
1346
- tokens.push(token);
1347
- return true;
1348
- }
1349
- return false;
1350
- })) {
1351
- continue;
1352
- }
1353
- if (token = this.tokenizer.escape(src)) {
1354
- src = src.substring(token.raw.length);
1355
- tokens.push(token);
1356
- continue;
1357
- }
1358
- if (token = this.tokenizer.tag(src)) {
1359
- src = src.substring(token.raw.length);
1360
- tokens.push(token);
1361
- continue;
1362
- }
1363
- if (token = this.tokenizer.link(src)) {
1364
- src = src.substring(token.raw.length);
1365
- tokens.push(token);
1366
- continue;
1367
- }
1368
- if (token = this.tokenizer.reflink(src, this.tokens.links)) {
1369
- src = src.substring(token.raw.length);
1370
- const lastToken = tokens.at(-1);
1371
- if (token.type === "text" && lastToken?.type === "text") {
1372
- lastToken.raw += token.raw;
1373
- lastToken.text += token.text;
1374
- } else {
1375
- tokens.push(token);
1376
- }
1377
- continue;
1378
- }
1379
- if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {
1380
- src = src.substring(token.raw.length);
1381
- tokens.push(token);
1382
- continue;
1383
- }
1384
- if (token = this.tokenizer.codespan(src)) {
1385
- src = src.substring(token.raw.length);
1386
- tokens.push(token);
1387
- continue;
1388
- }
1389
- if (token = this.tokenizer.br(src)) {
1390
- src = src.substring(token.raw.length);
1391
- tokens.push(token);
1392
- continue;
1393
- }
1394
- if (token = this.tokenizer.del(src)) {
1395
- src = src.substring(token.raw.length);
1396
- tokens.push(token);
1397
- continue;
1398
- }
1399
- if (token = this.tokenizer.autolink(src)) {
1400
- src = src.substring(token.raw.length);
1401
- tokens.push(token);
1402
- continue;
1403
- }
1404
- if (!this.state.inLink && (token = this.tokenizer.url(src))) {
1405
- src = src.substring(token.raw.length);
1406
- tokens.push(token);
1407
- continue;
1408
- }
1409
- let cutSrc = src;
1410
- if (this.options.extensions?.startInline) {
1411
- let startIndex = Infinity;
1412
- const tempSrc = src.slice(1);
1413
- let tempStart;
1414
- this.options.extensions.startInline.forEach((getStartIndex) => {
1415
- tempStart = getStartIndex.call({ lexer: this }, tempSrc);
1416
- if (typeof tempStart === "number" && tempStart >= 0) {
1417
- startIndex = Math.min(startIndex, tempStart);
1418
- }
1419
- });
1420
- if (startIndex < Infinity && startIndex >= 0) {
1421
- cutSrc = src.substring(0, startIndex + 1);
1422
- }
1423
- }
1424
- if (token = this.tokenizer.inlineText(cutSrc)) {
1425
- src = src.substring(token.raw.length);
1426
- if (token.raw.slice(-1) !== "_") {
1427
- prevChar = token.raw.slice(-1);
1428
- }
1429
- keepPrevChar = true;
1430
- const lastToken = tokens.at(-1);
1431
- if (lastToken?.type === "text") {
1432
- lastToken.raw += token.raw;
1433
- lastToken.text += token.text;
1434
- } else {
1435
- tokens.push(token);
1436
- }
1437
- continue;
1438
- }
1439
- if (src) {
1440
- const errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
1441
- if (this.options.silent) {
1442
- console.error(errMsg);
1443
- break;
1444
- } else {
1445
- throw new Error(errMsg);
1446
- }
1447
- }
1448
- }
1449
- return tokens;
1450
- }
1451
- };
1452
-
1453
- // src/Renderer.ts
1454
- var _Renderer = class {
1455
- options;
1456
- parser;
1457
- // set by the parser
1458
- constructor(options2) {
1459
- this.options = options2 || _defaults;
1460
- }
1461
- space(token) {
1462
- return "";
1463
- }
1464
- code({ text, lang, escaped }) {
1465
- const langString = (lang || "").match(other.notSpaceStart)?.[0];
1466
- const code = text.replace(other.endingNewline, "") + "\n";
1467
- if (!langString) {
1468
- return "<pre><code>" + (escaped ? code : escape2(code, true)) + "</code></pre>\n";
1469
- }
1470
- return '<pre><code class="language-' + escape2(langString) + '">' + (escaped ? code : escape2(code, true)) + "</code></pre>\n";
1471
- }
1472
- blockquote({ tokens }) {
1473
- const body = this.parser.parse(tokens);
1474
- return `<blockquote>
1475
- ${body}</blockquote>
1476
- `;
1477
- }
1478
- html({ text }) {
1479
- return text;
1480
- }
1481
- heading({ tokens, depth }) {
1482
- return `<h${depth}>${this.parser.parseInline(tokens)}</h${depth}>
1483
- `;
1484
- }
1485
- hr(token) {
1486
- return "<hr>\n";
1487
- }
1488
- list(token) {
1489
- const ordered = token.ordered;
1490
- const start = token.start;
1491
- let body = "";
1492
- for (let j = 0; j < token.items.length; j++) {
1493
- const item = token.items[j];
1494
- body += this.listitem(item);
1495
- }
1496
- const type = ordered ? "ol" : "ul";
1497
- const startAttr = ordered && start !== 1 ? ' start="' + start + '"' : "";
1498
- return "<" + type + startAttr + ">\n" + body + "</" + type + ">\n";
1499
- }
1500
- listitem(item) {
1501
- let itemBody = "";
1502
- if (item.task) {
1503
- const checkbox = this.checkbox({ checked: !!item.checked });
1504
- if (item.loose) {
1505
- if (item.tokens[0]?.type === "paragraph") {
1506
- item.tokens[0].text = checkbox + " " + item.tokens[0].text;
1507
- if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === "text") {
1508
- item.tokens[0].tokens[0].text = checkbox + " " + escape2(item.tokens[0].tokens[0].text);
1509
- item.tokens[0].tokens[0].escaped = true;
1510
- }
1511
- } else {
1512
- item.tokens.unshift({
1513
- type: "text",
1514
- raw: checkbox + " ",
1515
- text: checkbox + " ",
1516
- escaped: true
1517
- });
1518
- }
1519
- } else {
1520
- itemBody += checkbox + " ";
1521
- }
1522
- }
1523
- itemBody += this.parser.parse(item.tokens, !!item.loose);
1524
- return `<li>${itemBody}</li>
1525
- `;
1526
- }
1527
- checkbox({ checked }) {
1528
- return "<input " + (checked ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
1529
- }
1530
- paragraph({ tokens }) {
1531
- return `<p>${this.parser.parseInline(tokens)}</p>
1532
- `;
1533
- }
1534
- table(token) {
1535
- let header = "";
1536
- let cell = "";
1537
- for (let j = 0; j < token.header.length; j++) {
1538
- cell += this.tablecell(token.header[j]);
1539
- }
1540
- header += this.tablerow({ text: cell });
1541
- let body = "";
1542
- for (let j = 0; j < token.rows.length; j++) {
1543
- const row = token.rows[j];
1544
- cell = "";
1545
- for (let k = 0; k < row.length; k++) {
1546
- cell += this.tablecell(row[k]);
1547
- }
1548
- body += this.tablerow({ text: cell });
1549
- }
1550
- if (body) body = `<tbody>${body}</tbody>`;
1551
- return "<table>\n<thead>\n" + header + "</thead>\n" + body + "</table>\n";
1552
- }
1553
- tablerow({ text }) {
1554
- return `<tr>
1555
- ${text}</tr>
1556
- `;
1557
- }
1558
- tablecell(token) {
1559
- const content = this.parser.parseInline(token.tokens);
1560
- const type = token.header ? "th" : "td";
1561
- const tag2 = token.align ? `<${type} align="${token.align}">` : `<${type}>`;
1562
- return tag2 + content + `</${type}>
1563
- `;
1564
- }
1565
- /**
1566
- * span level renderer
1567
- */
1568
- strong({ tokens }) {
1569
- return `<strong>${this.parser.parseInline(tokens)}</strong>`;
1570
- }
1571
- em({ tokens }) {
1572
- return `<em>${this.parser.parseInline(tokens)}</em>`;
1573
- }
1574
- codespan({ text }) {
1575
- return `<code>${escape2(text, true)}</code>`;
1576
- }
1577
- br(token) {
1578
- return "<br>";
1579
- }
1580
- del({ tokens }) {
1581
- return `<del>${this.parser.parseInline(tokens)}</del>`;
1582
- }
1583
- link({ href, title, tokens }) {
1584
- const text = this.parser.parseInline(tokens);
1585
- const cleanHref = cleanUrl(href);
1586
- if (cleanHref === null) {
1587
- return text;
1588
- }
1589
- href = cleanHref;
1590
- let out = '<a href="' + href + '"';
1591
- if (title) {
1592
- out += ' title="' + escape2(title) + '"';
1593
- }
1594
- out += ">" + text + "</a>";
1595
- return out;
1596
- }
1597
- image({ href, title, text, tokens }) {
1598
- if (tokens) {
1599
- text = this.parser.parseInline(tokens, this.parser.textRenderer);
1600
- }
1601
- const cleanHref = cleanUrl(href);
1602
- if (cleanHref === null) {
1603
- return escape2(text);
1604
- }
1605
- href = cleanHref;
1606
- let out = `<img src="${href}" alt="${text}"`;
1607
- if (title) {
1608
- out += ` title="${escape2(title)}"`;
1609
- }
1610
- out += ">";
1611
- return out;
1612
- }
1613
- text(token) {
1614
- return "tokens" in token && token.tokens ? this.parser.parseInline(token.tokens) : "escaped" in token && token.escaped ? token.text : escape2(token.text);
1615
- }
1616
- };
1617
-
1618
- // src/TextRenderer.ts
1619
- var _TextRenderer = class {
1620
- // no need for block level renderers
1621
- strong({ text }) {
1622
- return text;
1623
- }
1624
- em({ text }) {
1625
- return text;
1626
- }
1627
- codespan({ text }) {
1628
- return text;
1629
- }
1630
- del({ text }) {
1631
- return text;
1632
- }
1633
- html({ text }) {
1634
- return text;
1635
- }
1636
- text({ text }) {
1637
- return text;
1638
- }
1639
- link({ text }) {
1640
- return "" + text;
1641
- }
1642
- image({ text }) {
1643
- return "" + text;
1644
- }
1645
- br() {
1646
- return "";
1647
- }
1648
- };
1649
-
1650
- // src/Parser.ts
1651
- var _Parser = class __Parser {
1652
- options;
1653
- renderer;
1654
- textRenderer;
1655
- constructor(options2) {
1656
- this.options = options2 || _defaults;
1657
- this.options.renderer = this.options.renderer || new _Renderer();
1658
- this.renderer = this.options.renderer;
1659
- this.renderer.options = this.options;
1660
- this.renderer.parser = this;
1661
- this.textRenderer = new _TextRenderer();
1662
- }
1663
- /**
1664
- * Static Parse Method
1665
- */
1666
- static parse(tokens, options2) {
1667
- const parser2 = new __Parser(options2);
1668
- return parser2.parse(tokens);
1669
- }
1670
- /**
1671
- * Static Parse Inline Method
1672
- */
1673
- static parseInline(tokens, options2) {
1674
- const parser2 = new __Parser(options2);
1675
- return parser2.parseInline(tokens);
1676
- }
1677
- /**
1678
- * Parse Loop
1679
- */
1680
- parse(tokens, top = true) {
1681
- let out = "";
1682
- for (let i = 0; i < tokens.length; i++) {
1683
- const anyToken = tokens[i];
1684
- if (this.options.extensions?.renderers?.[anyToken.type]) {
1685
- const genericToken = anyToken;
1686
- const ret = this.options.extensions.renderers[genericToken.type].call({ parser: this }, genericToken);
1687
- if (ret !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(genericToken.type)) {
1688
- out += ret || "";
1689
- continue;
1690
- }
1691
- }
1692
- const token = anyToken;
1693
- switch (token.type) {
1694
- case "space": {
1695
- out += this.renderer.space(token);
1696
- continue;
1697
- }
1698
- case "hr": {
1699
- out += this.renderer.hr(token);
1700
- continue;
1701
- }
1702
- case "heading": {
1703
- out += this.renderer.heading(token);
1704
- continue;
1705
- }
1706
- case "code": {
1707
- out += this.renderer.code(token);
1708
- continue;
1709
- }
1710
- case "table": {
1711
- out += this.renderer.table(token);
1712
- continue;
1713
- }
1714
- case "blockquote": {
1715
- out += this.renderer.blockquote(token);
1716
- continue;
1717
- }
1718
- case "list": {
1719
- out += this.renderer.list(token);
1720
- continue;
1721
- }
1722
- case "html": {
1723
- out += this.renderer.html(token);
1724
- continue;
1725
- }
1726
- case "paragraph": {
1727
- out += this.renderer.paragraph(token);
1728
- continue;
1729
- }
1730
- case "text": {
1731
- let textToken = token;
1732
- let body = this.renderer.text(textToken);
1733
- while (i + 1 < tokens.length && tokens[i + 1].type === "text") {
1734
- textToken = tokens[++i];
1735
- body += "\n" + this.renderer.text(textToken);
1736
- }
1737
- if (top) {
1738
- out += this.renderer.paragraph({
1739
- type: "paragraph",
1740
- raw: body,
1741
- text: body,
1742
- tokens: [{ type: "text", raw: body, text: body, escaped: true }]
1743
- });
1744
- } else {
1745
- out += body;
1746
- }
1747
- continue;
1748
- }
1749
- default: {
1750
- const errMsg = 'Token with "' + token.type + '" type was not found.';
1751
- if (this.options.silent) {
1752
- console.error(errMsg);
1753
- return "";
1754
- } else {
1755
- throw new Error(errMsg);
1756
- }
1757
- }
1758
- }
1759
- }
1760
- return out;
1761
- }
1762
- /**
1763
- * Parse Inline Tokens
1764
- */
1765
- parseInline(tokens, renderer = this.renderer) {
1766
- let out = "";
1767
- for (let i = 0; i < tokens.length; i++) {
1768
- const anyToken = tokens[i];
1769
- if (this.options.extensions?.renderers?.[anyToken.type]) {
1770
- const ret = this.options.extensions.renderers[anyToken.type].call({ parser: this }, anyToken);
1771
- if (ret !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(anyToken.type)) {
1772
- out += ret || "";
1773
- continue;
1774
- }
1775
- }
1776
- const token = anyToken;
1777
- switch (token.type) {
1778
- case "escape": {
1779
- out += renderer.text(token);
1780
- break;
1781
- }
1782
- case "html": {
1783
- out += renderer.html(token);
1784
- break;
1785
- }
1786
- case "link": {
1787
- out += renderer.link(token);
1788
- break;
1789
- }
1790
- case "image": {
1791
- out += renderer.image(token);
1792
- break;
1793
- }
1794
- case "strong": {
1795
- out += renderer.strong(token);
1796
- break;
1797
- }
1798
- case "em": {
1799
- out += renderer.em(token);
1800
- break;
1801
- }
1802
- case "codespan": {
1803
- out += renderer.codespan(token);
1804
- break;
1805
- }
1806
- case "br": {
1807
- out += renderer.br(token);
1808
- break;
1809
- }
1810
- case "del": {
1811
- out += renderer.del(token);
1812
- break;
1813
- }
1814
- case "text": {
1815
- out += renderer.text(token);
1816
- break;
1817
- }
1818
- default: {
1819
- const errMsg = 'Token with "' + token.type + '" type was not found.';
1820
- if (this.options.silent) {
1821
- console.error(errMsg);
1822
- return "";
1823
- } else {
1824
- throw new Error(errMsg);
1825
- }
1826
- }
1827
- }
1828
- }
1829
- return out;
1830
- }
1831
- };
1832
-
1833
- // src/Hooks.ts
1834
- var _Hooks = class {
1835
- options;
1836
- block;
1837
- constructor(options2) {
1838
- this.options = options2 || _defaults;
1839
- }
1840
- static passThroughHooks = /* @__PURE__ */ new Set([
1841
- "preprocess",
1842
- "postprocess",
1843
- "processAllTokens"
1844
- ]);
1845
- /**
1846
- * Process markdown before marked
1847
- */
1848
- preprocess(markdown) {
1849
- return markdown;
1850
- }
1851
- /**
1852
- * Process HTML after marked is finished
1853
- */
1854
- postprocess(html2) {
1855
- return html2;
1856
- }
1857
- /**
1858
- * Process all tokens before walk tokens
1859
- */
1860
- processAllTokens(tokens) {
1861
- return tokens;
1862
- }
1863
- /**
1864
- * Provide function to tokenize markdown
1865
- */
1866
- provideLexer() {
1867
- return this.block ? _Lexer.lex : _Lexer.lexInline;
1868
- }
1869
- /**
1870
- * Provide function to parse tokens
1871
- */
1872
- provideParser() {
1873
- return this.block ? _Parser.parse : _Parser.parseInline;
1874
- }
1875
- };
1876
-
1877
- // src/Instance.ts
1878
- var Marked = class {
1879
- defaults = _getDefaults();
1880
- options = this.setOptions;
1881
- parse = this.parseMarkdown(true);
1882
- parseInline = this.parseMarkdown(false);
1883
- Parser = _Parser;
1884
- Renderer = _Renderer;
1885
- TextRenderer = _TextRenderer;
1886
- Lexer = _Lexer;
1887
- Tokenizer = _Tokenizer;
1888
- Hooks = _Hooks;
1889
- constructor(...args) {
1890
- this.use(...args);
1891
- }
1892
- /**
1893
- * Run callback for every token
1894
- */
1895
- walkTokens(tokens, callback) {
1896
- let values = [];
1897
- for (const token of tokens) {
1898
- values = values.concat(callback.call(this, token));
1899
- switch (token.type) {
1900
- case "table": {
1901
- const tableToken = token;
1902
- for (const cell of tableToken.header) {
1903
- values = values.concat(this.walkTokens(cell.tokens, callback));
1904
- }
1905
- for (const row of tableToken.rows) {
1906
- for (const cell of row) {
1907
- values = values.concat(this.walkTokens(cell.tokens, callback));
1908
- }
1909
- }
1910
- break;
1911
- }
1912
- case "list": {
1913
- const listToken = token;
1914
- values = values.concat(this.walkTokens(listToken.items, callback));
1915
- break;
1916
- }
1917
- default: {
1918
- const genericToken = token;
1919
- if (this.defaults.extensions?.childTokens?.[genericToken.type]) {
1920
- this.defaults.extensions.childTokens[genericToken.type].forEach((childTokens) => {
1921
- const tokens2 = genericToken[childTokens].flat(Infinity);
1922
- values = values.concat(this.walkTokens(tokens2, callback));
1923
- });
1924
- } else if (genericToken.tokens) {
1925
- values = values.concat(this.walkTokens(genericToken.tokens, callback));
1926
- }
1927
- }
1928
- }
1929
- }
1930
- return values;
1931
- }
1932
- use(...args) {
1933
- const extensions = this.defaults.extensions || { renderers: {}, childTokens: {} };
1934
- args.forEach((pack) => {
1935
- const opts = { ...pack };
1936
- opts.async = this.defaults.async || opts.async || false;
1937
- if (pack.extensions) {
1938
- pack.extensions.forEach((ext) => {
1939
- if (!ext.name) {
1940
- throw new Error("extension name required");
1941
- }
1942
- if ("renderer" in ext) {
1943
- const prevRenderer = extensions.renderers[ext.name];
1944
- if (prevRenderer) {
1945
- extensions.renderers[ext.name] = function(...args2) {
1946
- let ret = ext.renderer.apply(this, args2);
1947
- if (ret === false) {
1948
- ret = prevRenderer.apply(this, args2);
1949
- }
1950
- return ret;
1951
- };
1952
- } else {
1953
- extensions.renderers[ext.name] = ext.renderer;
1954
- }
1955
- }
1956
- if ("tokenizer" in ext) {
1957
- if (!ext.level || ext.level !== "block" && ext.level !== "inline") {
1958
- throw new Error("extension level must be 'block' or 'inline'");
1959
- }
1960
- const extLevel = extensions[ext.level];
1961
- if (extLevel) {
1962
- extLevel.unshift(ext.tokenizer);
1963
- } else {
1964
- extensions[ext.level] = [ext.tokenizer];
1965
- }
1966
- if (ext.start) {
1967
- if (ext.level === "block") {
1968
- if (extensions.startBlock) {
1969
- extensions.startBlock.push(ext.start);
1970
- } else {
1971
- extensions.startBlock = [ext.start];
1972
- }
1973
- } else if (ext.level === "inline") {
1974
- if (extensions.startInline) {
1975
- extensions.startInline.push(ext.start);
1976
- } else {
1977
- extensions.startInline = [ext.start];
1978
- }
1979
- }
1980
- }
1981
- }
1982
- if ("childTokens" in ext && ext.childTokens) {
1983
- extensions.childTokens[ext.name] = ext.childTokens;
1984
- }
1985
- });
1986
- opts.extensions = extensions;
1987
- }
1988
- if (pack.renderer) {
1989
- const renderer = this.defaults.renderer || new _Renderer(this.defaults);
1990
- for (const prop in pack.renderer) {
1991
- if (!(prop in renderer)) {
1992
- throw new Error(`renderer '${prop}' does not exist`);
1993
- }
1994
- if (["options", "parser"].includes(prop)) {
1995
- continue;
1996
- }
1997
- const rendererProp = prop;
1998
- const rendererFunc = pack.renderer[rendererProp];
1999
- const prevRenderer = renderer[rendererProp];
2000
- renderer[rendererProp] = (...args2) => {
2001
- let ret = rendererFunc.apply(renderer, args2);
2002
- if (ret === false) {
2003
- ret = prevRenderer.apply(renderer, args2);
2004
- }
2005
- return ret || "";
2006
- };
2007
- }
2008
- opts.renderer = renderer;
2009
- }
2010
- if (pack.tokenizer) {
2011
- const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults);
2012
- for (const prop in pack.tokenizer) {
2013
- if (!(prop in tokenizer)) {
2014
- throw new Error(`tokenizer '${prop}' does not exist`);
2015
- }
2016
- if (["options", "rules", "lexer"].includes(prop)) {
2017
- continue;
2018
- }
2019
- const tokenizerProp = prop;
2020
- const tokenizerFunc = pack.tokenizer[tokenizerProp];
2021
- const prevTokenizer = tokenizer[tokenizerProp];
2022
- tokenizer[tokenizerProp] = (...args2) => {
2023
- let ret = tokenizerFunc.apply(tokenizer, args2);
2024
- if (ret === false) {
2025
- ret = prevTokenizer.apply(tokenizer, args2);
2026
- }
2027
- return ret;
2028
- };
2029
- }
2030
- opts.tokenizer = tokenizer;
2031
- }
2032
- if (pack.hooks) {
2033
- const hooks = this.defaults.hooks || new _Hooks();
2034
- for (const prop in pack.hooks) {
2035
- if (!(prop in hooks)) {
2036
- throw new Error(`hook '${prop}' does not exist`);
2037
- }
2038
- if (["options", "block"].includes(prop)) {
2039
- continue;
2040
- }
2041
- const hooksProp = prop;
2042
- const hooksFunc = pack.hooks[hooksProp];
2043
- const prevHook = hooks[hooksProp];
2044
- if (_Hooks.passThroughHooks.has(prop)) {
2045
- hooks[hooksProp] = (arg) => {
2046
- if (this.defaults.async) {
2047
- return Promise.resolve(hooksFunc.call(hooks, arg)).then((ret2) => {
2048
- return prevHook.call(hooks, ret2);
2049
- });
2050
- }
2051
- const ret = hooksFunc.call(hooks, arg);
2052
- return prevHook.call(hooks, ret);
2053
- };
2054
- } else {
2055
- hooks[hooksProp] = (...args2) => {
2056
- let ret = hooksFunc.apply(hooks, args2);
2057
- if (ret === false) {
2058
- ret = prevHook.apply(hooks, args2);
2059
- }
2060
- return ret;
2061
- };
2062
- }
2063
- }
2064
- opts.hooks = hooks;
2065
- }
2066
- if (pack.walkTokens) {
2067
- const walkTokens2 = this.defaults.walkTokens;
2068
- const packWalktokens = pack.walkTokens;
2069
- opts.walkTokens = function(token) {
2070
- let values = [];
2071
- values.push(packWalktokens.call(this, token));
2072
- if (walkTokens2) {
2073
- values = values.concat(walkTokens2.call(this, token));
2074
- }
2075
- return values;
2076
- };
2077
- }
2078
- this.defaults = { ...this.defaults, ...opts };
2079
- });
2080
- return this;
2081
- }
2082
- setOptions(opt) {
2083
- this.defaults = { ...this.defaults, ...opt };
2084
- return this;
2085
- }
2086
- lexer(src, options2) {
2087
- return _Lexer.lex(src, options2 ?? this.defaults);
2088
- }
2089
- parser(tokens, options2) {
2090
- return _Parser.parse(tokens, options2 ?? this.defaults);
2091
- }
2092
- parseMarkdown(blockType) {
2093
- const parse2 = (src, options2) => {
2094
- const origOpt = { ...options2 };
2095
- const opt = { ...this.defaults, ...origOpt };
2096
- const throwError = this.onError(!!opt.silent, !!opt.async);
2097
- if (this.defaults.async === true && origOpt.async === false) {
2098
- return throwError(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
2099
- }
2100
- if (typeof src === "undefined" || src === null) {
2101
- return throwError(new Error("marked(): input parameter is undefined or null"));
2102
- }
2103
- if (typeof src !== "string") {
2104
- return throwError(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(src) + ", string expected"));
2105
- }
2106
- if (opt.hooks) {
2107
- opt.hooks.options = opt;
2108
- opt.hooks.block = blockType;
2109
- }
2110
- const lexer2 = opt.hooks ? opt.hooks.provideLexer() : blockType ? _Lexer.lex : _Lexer.lexInline;
2111
- const parser2 = opt.hooks ? opt.hooks.provideParser() : blockType ? _Parser.parse : _Parser.parseInline;
2112
- if (opt.async) {
2113
- return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src).then((src2) => lexer2(src2, opt)).then((tokens) => opt.hooks ? opt.hooks.processAllTokens(tokens) : tokens).then((tokens) => opt.walkTokens ? Promise.all(this.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens).then((tokens) => parser2(tokens, opt)).then((html2) => opt.hooks ? opt.hooks.postprocess(html2) : html2).catch(throwError);
2114
- }
2115
- try {
2116
- if (opt.hooks) {
2117
- src = opt.hooks.preprocess(src);
2118
- }
2119
- let tokens = lexer2(src, opt);
2120
- if (opt.hooks) {
2121
- tokens = opt.hooks.processAllTokens(tokens);
2122
- }
2123
- if (opt.walkTokens) {
2124
- this.walkTokens(tokens, opt.walkTokens);
2125
- }
2126
- let html2 = parser2(tokens, opt);
2127
- if (opt.hooks) {
2128
- html2 = opt.hooks.postprocess(html2);
2129
- }
2130
- return html2;
2131
- } catch (e) {
2132
- return throwError(e);
2133
- }
2134
- };
2135
- return parse2;
2136
- }
2137
- onError(silent, async) {
2138
- return (e) => {
2139
- e.message += "\nPlease report this to https://github.com/markedjs/marked.";
2140
- if (silent) {
2141
- const msg = "<p>An error occurred:</p><pre>" + escape2(e.message + "", true) + "</pre>";
2142
- if (async) {
2143
- return Promise.resolve(msg);
2144
- }
2145
- return msg;
2146
- }
2147
- if (async) {
2148
- return Promise.reject(e);
2149
- }
2150
- throw e;
2151
- };
2152
- }
2153
- };
2154
-
2155
- // src/marked.ts
2156
- var markedInstance = new Marked();
2157
- function marked(src, opt) {
2158
- return markedInstance.parse(src, opt);
2159
- }
2160
- marked.options = marked.setOptions = function(options2) {
2161
- markedInstance.setOptions(options2);
2162
- marked.defaults = markedInstance.defaults;
2163
- changeDefaults(marked.defaults);
2164
- return marked;
2165
- };
2166
- marked.getDefaults = _getDefaults;
2167
- marked.defaults = _defaults;
2168
- marked.use = function(...args) {
2169
- markedInstance.use(...args);
2170
- marked.defaults = markedInstance.defaults;
2171
- changeDefaults(marked.defaults);
2172
- return marked;
2173
- };
2174
- marked.walkTokens = function(tokens, callback) {
2175
- return markedInstance.walkTokens(tokens, callback);
2176
- };
2177
- marked.parseInline = markedInstance.parseInline;
2178
- marked.Parser = _Parser;
2179
- marked.parser = _Parser.parse;
2180
- marked.Renderer = _Renderer;
2181
- marked.TextRenderer = _TextRenderer;
2182
- marked.Lexer = _Lexer;
2183
- marked.lexer = _Lexer.lex;
2184
- marked.Tokenizer = _Tokenizer;
2185
- marked.Hooks = _Hooks;
2186
- marked.parse = marked;
2187
- marked.options;
2188
- marked.setOptions;
2189
- marked.use;
2190
- marked.walkTokens;
2191
- marked.parseInline;
2192
- _Parser.parse;
2193
- _Lexer.lex;
40
+ function M(){return {async:false,breaks:false,extensions:null,gfm:true,hooks:null,pedantic:false,renderer:null,silent:false,tokenizer:null,walkTokens:null}}var w=M();function H(a){w=a;}var C={exec:()=>null};function h(a,e=""){let t=typeof a=="string"?a:a.source,n={replace:(s,i)=>{let r=typeof i=="string"?i:i.source;return r=r.replace(m.caret,"$1"),t=t.replace(s,r),n},getRegex:()=>new RegExp(t,e)};return n}var m={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:a=>new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:a=>new RegExp(`^ {0,${Math.min(3,a-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:a=>new RegExp(`^ {0,${Math.min(3,a-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:a=>new RegExp(`^ {0,${Math.min(3,a-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:a=>new RegExp(`^ {0,${Math.min(3,a-1)}}#`),htmlBeginRegex:a=>new RegExp(`^ {0,${Math.min(3,a-1)}}<(?:[a-z].*>|!--)`,"i")},xe=/^(?:[ \t]*(?:\n|$))+/,be=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Te=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,I=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,we=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,j=/(?:[*+-]|\d{1,9}[.)])/,re$1=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ie=h(re$1).replace(/bull/g,j).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),ye=h(re$1).replace(/bull/g,j).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),F=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Re=/^[^\n]+/,Q=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Se=h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Q).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),$e=h(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,j).getRegex(),v="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",U=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,_e=h("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",U).replace("tag",v).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),oe=h(F).replace("hr",I).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",v).getRegex(),Le=h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",oe).getRegex(),K={blockquote:Le,code:be,def:Se,fences:Te,heading:we,hr:I,html:_e,lheading:ie,list:$e,newline:xe,paragraph:oe,table:C,text:Re},se=h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",I).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",v).getRegex(),ze={...K,lheading:ye,table:se,paragraph:h(F).replace("hr",I).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",se).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",v).getRegex()},Me={...K,html:h(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",U).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:C,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:h(F).replace("hr",I).replace("heading",` *#{1,6} *[^
41
+ ]`).replace("lheading",ie).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Pe=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ae=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,le=/^( {2,}|\\)\n(?!\s*$)/,Ee=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,D=/[\p{P}\p{S}]/u,X=/[\s\p{P}\p{S}]/u,ae=/[^\s\p{P}\p{S}]/u,Ce=h(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,X).getRegex(),ce=/(?!~)[\p{P}\p{S}]/u,Ie=/(?!~)[\s\p{P}\p{S}]/u,Oe=/(?:[^\s\p{P}\p{S}]|~)/u,Be=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,pe=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,qe=h(pe,"u").replace(/punct/g,D).getRegex(),ve=h(pe,"u").replace(/punct/g,ce).getRegex(),ue="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",De=h(ue,"gu").replace(/notPunctSpace/g,ae).replace(/punctSpace/g,X).replace(/punct/g,D).getRegex(),Ze=h(ue,"gu").replace(/notPunctSpace/g,Oe).replace(/punctSpace/g,Ie).replace(/punct/g,ce).getRegex(),Ge=h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ae).replace(/punctSpace/g,X).replace(/punct/g,D).getRegex(),He=h(/\\(punct)/,"gu").replace(/punct/g,D).getRegex(),Ne=h(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),je=h(U).replace("(?:-->|$)","-->").getRegex(),Fe=h("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",je).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),q=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Qe=h(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",q).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),he=h(/^!?\[(label)\]\[(ref)\]/).replace("label",q).replace("ref",Q).getRegex(),ke=h(/^!?\[(ref)\](?:\[\])?/).replace("ref",Q).getRegex(),Ue=h("reflink|nolink(?!\\()","g").replace("reflink",he).replace("nolink",ke).getRegex(),W={_backpedal:C,anyPunctuation:He,autolink:Ne,blockSkip:Be,br:le,code:Ae,del:C,emStrongLDelim:qe,emStrongRDelimAst:De,emStrongRDelimUnd:Ge,escape:Pe,link:Qe,nolink:ke,punctuation:Ce,reflink:he,reflinkSearch:Ue,tag:Fe,text:Ee,url:C},Ke={...W,link:h(/^!?\[(label)\]\((.*?)\)/).replace("label",q).getRegex(),reflink:h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",q).getRegex()},N={...W,emStrongRDelimAst:Ze,emStrongLDelim:ve,url:h(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Xe={...N,br:h(le).replace("{2,}","*").getRegex(),text:h(N.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},O={normal:K,gfm:ze,pedantic:Me},P={normal:W,gfm:N,breaks:Xe,pedantic:Ke};var We={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ge=a=>We[a];function R(a,e){if(e){if(m.escapeTest.test(a))return a.replace(m.escapeReplace,ge)}else if(m.escapeTestNoEncode.test(a))return a.replace(m.escapeReplaceNoEncode,ge);return a}function J(a){try{a=encodeURI(a).replace(m.percentDecode,"%");}catch{return null}return a}function V(a,e){let t=a.replace(m.findPipe,(i,r,o)=>{let l=false,c=r;for(;--c>=0&&o[c]==="\\";)l=!l;return l?"|":" |"}),n=t.split(m.splitPipe),s=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(m.slashPipe,"|");return n}function A(a,e,t){let n=a.length;if(n===0)return "";let s=0;for(;s<n;){let i=a.charAt(n-s-1);if(i===e&&true)s++;else break}return a.slice(0,n-s)}function fe(a,e){if(a.indexOf(e[1])===-1)return -1;let t=0;for(let n=0;n<a.length;n++)if(a[n]==="\\")n++;else if(a[n]===e[0])t++;else if(a[n]===e[1]&&(t--,t<0))return n;return t>0?-2:-1}function de(a,e,t,n,s){let i=e.href,r=e.title||null,o=a[1].replace(s.other.outputLinkReplace,"$1");n.state.inLink=true;let l={type:a[0].charAt(0)==="!"?"image":"link",raw:t,href:i,title:r,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=false,l}function Je(a,e,t){let n=a.match(t.other.indentCodeCompensation);if(n===null)return e;let s=n[1];return e.split(`
42
+ `).map(i=>{let r=i.match(t.other.beginningSpace);if(r===null)return i;let[o]=r;return o.length>=s.length?i.slice(s.length):i}).join(`
43
+ `)}var S=class{options;rules;lexer;constructor(e){this.options=e||w;}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return {type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return {type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:A(n,`
44
+ `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],s=Je(n,t[3]||"",this.rules);return {type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:s}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let s=A(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(n=s.trim());}return {type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return {type:"hr",raw:A(t[0],`
45
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=A(t[0],`
46
+ `).split(`
47
+ `),s="",i="",r=[];for(;n.length>0;){let o=false,l=[],c;for(c=0;c<n.length;c++)if(this.rules.other.blockquoteStart.test(n[c]))l.push(n[c]),o=true;else if(!o)l.push(n[c]);else break;n=n.slice(c);let p=l.join(`
48
+ `),u=p.replace(this.rules.other.blockquoteSetextReplace,`
49
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
50
+ ${p}`:p,i=i?`${i}
51
+ ${u}`:u;let d=this.lexer.state.top;if(this.lexer.state.top=true,this.lexer.blockTokens(u,r,true),this.lexer.state.top=d,n.length===0)break;let g=r.at(-1);if(g?.type==="code")break;if(g?.type==="blockquote"){let x=g,f=x.raw+`
52
+ `+n.join(`
53
+ `),y=this.blockquote(f);r[r.length-1]=y,s=s.substring(0,s.length-x.raw.length)+y.raw,i=i.substring(0,i.length-x.text.length)+y.text;break}else if(g?.type==="list"){let x=g,f=x.raw+`
54
+ `+n.join(`
55
+ `),y=this.list(f);r[r.length-1]=y,s=s.substring(0,s.length-g.raw.length)+y.raw,i=i.substring(0,i.length-x.raw.length)+y.raw,n=f.substring(r.at(-1).raw.length).split(`
56
+ `);continue}}return {type:"blockquote",raw:s,tokens:r,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),s=n.length>1,i={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:false,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");let r=this.rules.other.listItemRegex(n),o=false;for(;e;){let c=false,p="",u="";if(!(t=r.exec(e))||this.rules.block.hr.test(e))break;p=t[0],e=e.substring(p.length);let d=t[2].split(`
57
+ `,1)[0].replace(this.rules.other.listReplaceTabs,Z=>" ".repeat(3*Z.length)),g=e.split(`
58
+ `,1)[0],x=!d.trim(),f=0;if(this.options.pedantic?(f=2,u=d.trimStart()):x?f=t[1].length+1:(f=t[2].search(this.rules.other.nonSpaceChar),f=f>4?1:f,u=d.slice(f),f+=t[1].length),x&&this.rules.other.blankLine.test(g)&&(p+=g+`
59
+ `,e=e.substring(g.length+1),c=true),!c){let Z=this.rules.other.nextBulletRegex(f),ee=this.rules.other.hrRegex(f),te=this.rules.other.fencesBeginRegex(f),ne=this.rules.other.headingBeginRegex(f),me=this.rules.other.htmlBeginRegex(f);for(;e;){let G=e.split(`
60
+ `,1)[0],E;if(g=G,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),E=g):E=g.replace(this.rules.other.tabCharGlobal," "),te.test(g)||ne.test(g)||me.test(g)||Z.test(g)||ee.test(g))break;if(E.search(this.rules.other.nonSpaceChar)>=f||!g.trim())u+=`
61
+ `+E.slice(f);else {if(x||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||te.test(d)||ne.test(d)||ee.test(d))break;u+=`
62
+ `+g;}!x&&!g.trim()&&(x=true),p+=G+`
63
+ `,e=e.substring(G.length+1),d=E.slice(f);}}i.loose||(o?i.loose=true:this.rules.other.doubleBlankLine.test(p)&&(o=true));let y=null,Y;this.options.gfm&&(y=this.rules.other.listIsTask.exec(u),y&&(Y=y[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:p,task:!!y,checked:Y,loose:false,text:u,tokens:[]}),i.raw+=p;}let l=i.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let c=0;c<i.items.length;c++)if(this.lexer.state.top=false,i.items[c].tokens=this.lexer.blockTokens(i.items[c].text,[]),!i.loose){let p=i.items[c].tokens.filter(d=>d.type==="space"),u=p.length>0&&p.some(d=>this.rules.other.anyLine.test(d.raw));i.loose=u;}if(i.loose)for(let c=0;c<i.items.length;c++)i.items[c].loose=true;return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return {type:"html",block:true,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return {type:"def",tag:n,raw:t[0],href:s,title:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=V(t[1]),s=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
64
+ `):[],r={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===s.length){for(let o of s)this.rules.other.tableAlignRight.test(o)?r.align.push("right"):this.rules.other.tableAlignCenter.test(o)?r.align.push("center"):this.rules.other.tableAlignLeft.test(o)?r.align.push("left"):r.align.push(null);for(let o=0;o<n.length;o++)r.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:true,align:r.align[o]});for(let o of i)r.rows.push(V(o,r.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:false,align:r.align[c]})));return r}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return {type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
65
+ `?t[1].slice(0,-1):t[1];return {type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return {type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return {type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return !this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=true:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=false),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=true:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=false),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:false,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let r=A(n.slice(0,-1),"\\");if((n.length-r.length)%2===0)return}else {let r=fe(t[2],"()");if(r===-2)return;if(r>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,l).trim(),t[3]="";}}let s=t[2],i="";if(this.options.pedantic){let r=this.rules.other.pedanticHrefTitle.exec(s);r&&(s=r[1],i=r[3]);}else i=t[3]?t[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?s=s.slice(1):s=s.slice(1,-1)),de(t,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let s=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[s.toLowerCase()];if(!i){let r=n[0].charAt(0);return {type:"text",raw:r,text:r}}return de(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!s||s[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(s[1]||s[2]||"")||!n||this.rules.inline.punctuation.exec(n)){let r=[...s[0]].length-1,o,l,c=r,p=0,u=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+r);(s=u.exec(t))!=null;){if(o=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!o)continue;if(l=[...o].length,s[3]||s[4]){c+=l;continue}else if((s[5]||s[6])&&r%3&&!((r+l)%3)){p+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+p);let d=[...s[0]][0].length,g=e.slice(0,r+s.index+d+l);if(Math.min(r,l)%2){let f=g.slice(1,-1);return {type:"em",raw:g,text:f,tokens:this.lexer.inlineTokens(f)}}let x=g.slice(2,-2);return {type:"strong",raw:g,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return {type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return {type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,s;return t[2]==="@"?(n=t[1],s="mailto:"+n):(n=t[1],s=n),{type:"link",raw:t[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,s;if(t[2]==="@")n=t[0],s="mailto:"+n;else {let i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(i!==t[0]);n=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0];}return {type:"link",raw:t[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return {type:"text",raw:t[0],text:t[0],escaped:n}}}};var b=class a{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||w,this.options.tokenizer=this.options.tokenizer||new S,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:false,inRawBlock:false,top:true};let t={other:m,block:O.normal,inline:P.normal};this.options.pedantic?(t.block=O.pedantic,t.inline=P.pedantic):this.options.gfm&&(t.block=O.gfm,this.options.breaks?t.inline=P.breaks:t.inline=P.gfm),this.tokenizer.rules=t;}static get rules(){return {block:O,inline:P}}static lex(e,t){return new a(t).lex(e)}static lexInline(e,t){return new a(t).inlineTokens(e)}lex(e){e=e.replace(m.carriageReturn,`
66
+ `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens);}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=false){for(this.options.pedantic&&(e=e.replace(m.tabCharGlobal," ").replace(m.spaceLine,""));e;){let s;if(this.options.extensions?.block?.some(r=>(s=r.call({lexer:this},e,t))?(e=e.substring(s.raw.length),t.push(s),true):false))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);let r=t.at(-1);s.raw.length===1&&r!==void 0?r.raw+=`
67
+ `:t.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length);let r=t.at(-1);r?.type==="paragraph"||r?.type==="text"?(r.raw+=`
68
+ `+s.raw,r.text+=`
69
+ `+s.text,this.inlineQueue.at(-1).src=r.text):t.push(s);continue}if(s=this.tokenizer.fences(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.heading(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.hr(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.blockquote(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.list(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.html(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.def(e)){e=e.substring(s.raw.length);let r=t.at(-1);r?.type==="paragraph"||r?.type==="text"?(r.raw+=`
70
+ `+s.raw,r.text+=`
71
+ `+s.raw,this.inlineQueue.at(-1).src=r.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title});continue}if(s=this.tokenizer.table(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.lheading(e)){e=e.substring(s.raw.length),t.push(s);continue}let i=e;if(this.options.extensions?.startBlock){let r=1/0,o=e.slice(1),l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},o),typeof l=="number"&&l>=0&&(r=Math.min(r,l));}),r<1/0&&r>=0&&(i=e.substring(0,r+1));}if(this.state.top&&(s=this.tokenizer.paragraph(i))){let r=t.at(-1);n&&r?.type==="paragraph"?(r.raw+=`
72
+ `+s.raw,r.text+=`
73
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(s),n=i.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length);let r=t.at(-1);r?.type==="text"?(r.raw+=`
74
+ `+s.raw,r.text+=`
75
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(s);continue}if(e){let r="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(r);break}else throw new Error(r)}}return this.state.top=true,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,s=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)o.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,s.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(s=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=false,r="";for(;e;){i||(r=""),i=false;let o;if(this.options.extensions?.inline?.some(c=>(o=c.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),true):false))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let c=t.at(-1);o.type==="text"&&c?.type==="text"?(c.raw+=o.raw,c.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,r)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let l=e;if(this.options.extensions?.startInline){let c=1/0,p=e.slice(1),u;this.options.extensions.startInline.forEach(d=>{u=d.call({lexer:this},p),typeof u=="number"&&u>=0&&(c=Math.min(c,u));}),c<1/0&&c>=0&&(l=e.substring(0,c+1));}if(o=this.tokenizer.inlineText(l)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(r=o.raw.slice(-1)),i=true;let c=t.at(-1);c?.type==="text"?(c.raw+=o.raw,c.text+=o.text):t.push(o);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return t}};var $=class{options;parser;constructor(e){this.options=e||w;}space(e){return ""}code({text:e,lang:t,escaped:n}){let s=(t||"").match(m.notSpaceStart)?.[0],i=e.replace(m.endingNewline,"")+`
76
+ `;return s?'<pre><code class="language-'+R(s)+'">'+(n?i:R(i,true))+`</code></pre>
77
+ `:"<pre><code>"+(n?i:R(i,true))+`</code></pre>
78
+ `}blockquote({tokens:e}){return `<blockquote>
79
+ ${this.parser.parse(e)}</blockquote>
80
+ `}html({text:e}){return e}heading({tokens:e,depth:t}){return `<h${t}>${this.parser.parseInline(e)}</h${t}>
81
+ `}hr(e){return `<hr>
82
+ `}list(e){let t=e.ordered,n=e.start,s="";for(let o=0;o<e.items.length;o++){let l=e.items[o];s+=this.listitem(l);}let i=t?"ol":"ul",r=t&&n!==1?' start="'+n+'"':"";return "<"+i+r+`>
83
+ `+s+"</"+i+`>
84
+ `}listitem(e){let t="";if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=n+" "+R(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=true)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:true}):t+=n+" ";}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
85
+ `}checkbox({checked:e}){return "<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return `<p>${this.parser.parseInline(e)}</p>
86
+ `}table(e){let t="",n="";for(let i=0;i<e.header.length;i++)n+=this.tablecell(e.header[i]);t+=this.tablerow({text:n});let s="";for(let i=0;i<e.rows.length;i++){let r=e.rows[i];n="";for(let o=0;o<r.length;o++)n+=this.tablecell(r[o]);s+=this.tablerow({text:n});}return s&&(s=`<tbody>${s}</tbody>`),`<table>
87
+ <thead>
88
+ `+t+`</thead>
89
+ `+s+`</table>
90
+ `}tablerow({text:e}){return `<tr>
91
+ ${e}</tr>
92
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return (e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
93
+ `}strong({tokens:e}){return `<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return `<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return `<code>${R(e,true)}</code>`}br(e){return "<br>"}del({tokens:e}){return `<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let s=this.parser.parseInline(n),i=J(e);if(i===null)return s;e=i;let r='<a href="'+e+'"';return t&&(r+=' title="'+R(t)+'"'),r+=">"+s+"</a>",r}image({href:e,title:t,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let i=J(e);if(i===null)return R(n);e=i;let r=`<img src="${e}" alt="${n}"`;return t&&(r+=` title="${R(t)}"`),r+=">",r}text(e){return "tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:R(e.text)}};var _=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return ""+e}image({text:e}){return ""+e}br(){return ""}};var T=class a{options;renderer;textRenderer;constructor(e){this.options=e||w,this.options.renderer=this.options.renderer||new $,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new _;}static parse(e,t){return new a(t).parse(e)}static parseInline(e,t){return new a(t).parseInline(e)}parse(e,t=true){let n="";for(let s=0;s<e.length;s++){let i=e[s];if(this.options.extensions?.renderers?.[i.type]){let o=i,l=this.options.extensions.renderers[o.type].call({parser:this},o);if(l!==false||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(o.type)){n+=l||"";continue}}let r=i;switch(r.type){case "space":{n+=this.renderer.space(r);continue}case "hr":{n+=this.renderer.hr(r);continue}case "heading":{n+=this.renderer.heading(r);continue}case "code":{n+=this.renderer.code(r);continue}case "table":{n+=this.renderer.table(r);continue}case "blockquote":{n+=this.renderer.blockquote(r);continue}case "list":{n+=this.renderer.list(r);continue}case "html":{n+=this.renderer.html(r);continue}case "paragraph":{n+=this.renderer.paragraph(r);continue}case "text":{let o=r,l=this.renderer.text(o);for(;s+1<e.length&&e[s+1].type==="text";)o=e[++s],l+=`
94
+ `+this.renderer.text(o);t?n+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:true}]}):n+=l;continue}default:{let o='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(e,t=this.renderer){let n="";for(let s=0;s<e.length;s++){let i=e[s];if(this.options.extensions?.renderers?.[i.type]){let o=this.options.extensions.renderers[i.type].call({parser:this},i);if(o!==false||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=o||"";continue}}let r=i;switch(r.type){case "escape":{n+=t.text(r);break}case "html":{n+=t.html(r);break}case "link":{n+=t.link(r);break}case "image":{n+=t.image(r);break}case "strong":{n+=t.strong(r);break}case "em":{n+=t.em(r);break}case "codespan":{n+=t.codespan(r);break}case "br":{n+=t.br(r);break}case "del":{n+=t.del(r);break}case "text":{n+=t.text(r);break}default:{let o='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}};var L=class{options;block;constructor(e){this.options=e||w;}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?b.lex:b.lexInline}provideParser(){return this.block?T.parse:T.parseInline}};var B=class{defaults=M();options=this.setOptions;parse=this.parseMarkdown(true);parseInline=this.parseMarkdown(false);Parser=T;Renderer=$;TextRenderer=_;Lexer=b;Tokenizer=S;Hooks=L;constructor(...e){this.use(...e);}walkTokens(e,t){let n=[];for(let s of e)switch(n=n.concat(t.call(this,s)),s.type){case "table":{let i=s;for(let r of i.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of i.rows)for(let o of r)n=n.concat(this.walkTokens(o.tokens,t));break}case "list":{let i=s;n=n.concat(this.walkTokens(i.items,t));break}default:{let i=s;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(r=>{let o=i[r].flat(1/0);n=n.concat(this.walkTokens(o,t));}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,t)));}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||false,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let r=t.renderers[i.name];r?t.renderers[i.name]=function(...o){let l=i.renderer.apply(this,o);return l===false&&(l=r.apply(this,o)),l}:t.renderers[i.name]=i.renderer;}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=t[i.level];r?r.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]));}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens);}),s.extensions=t),n.renderer){let i=this.defaults.renderer||new $(this.defaults);for(let r in n.renderer){if(!(r in i))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let o=r,l=n.renderer[o],c=i[o];i[o]=(...p)=>{let u=l.apply(i,p);return u===false&&(u=c.apply(i,p)),u||""};}s.renderer=i;}if(n.tokenizer){let i=this.defaults.tokenizer||new S(this.defaults);for(let r in n.tokenizer){if(!(r in i))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let o=r,l=n.tokenizer[o],c=i[o];i[o]=(...p)=>{let u=l.apply(i,p);return u===false&&(u=c.apply(i,p)),u};}s.tokenizer=i;}if(n.hooks){let i=this.defaults.hooks||new L;for(let r in n.hooks){if(!(r in i))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let o=r,l=n.hooks[o],c=i[o];L.passThroughHooks.has(r)?i[o]=p=>{if(this.defaults.async)return Promise.resolve(l.call(i,p)).then(d=>c.call(i,d));let u=l.call(i,p);return c.call(i,u)}:i[o]=(...p)=>{let u=l.apply(i,p);return u===false&&(u=c.apply(i,p)),u};}s.hooks=i;}if(n.walkTokens){let i=this.defaults.walkTokens,r=n.walkTokens;s.walkTokens=function(o){let l=[];return l.push(r.call(this,o)),i&&(l=l.concat(i.call(this,o))),l};}this.defaults={...this.defaults,...s};}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return b.lex(e,t??this.defaults)}parser(e,t){return T.parse(e,t??this.defaults)}parseMarkdown(e){return (n,s)=>{let i={...s},r={...this.defaults,...i},o=this.onError(!!r.silent,!!r.async);if(this.defaults.async===true&&i.async===false)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));r.hooks&&(r.hooks.options=r,r.hooks.block=e);let l=r.hooks?r.hooks.provideLexer():e?b.lex:b.lexInline,c=r.hooks?r.hooks.provideParser():e?T.parse:T.parseInline;if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then(p=>l(p,r)).then(p=>r.hooks?r.hooks.processAllTokens(p):p).then(p=>r.walkTokens?Promise.all(this.walkTokens(p,r.walkTokens)).then(()=>p):p).then(p=>c(p,r)).then(p=>r.hooks?r.hooks.postprocess(p):p).catch(o);try{r.hooks&&(n=r.hooks.preprocess(n));let p=l(n,r);r.hooks&&(p=r.hooks.processAllTokens(p)),r.walkTokens&&this.walkTokens(p,r.walkTokens);let u=c(p,r);return r.hooks&&(u=r.hooks.postprocess(u)),u}catch(p){return o(p)}}}onError(e,t){return n=>{if(n.message+=`
95
+ Please report this to https://github.com/markedjs/marked.`,e){let s="<p>An error occurred:</p><pre>"+R(n.message+"",true)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(n);throw n}}};var z=new B;function k(a,e){return z.parse(a,e)}k.options=k.setOptions=function(a){return z.setOptions(a),k.defaults=z.defaults,H(k.defaults),k};k.getDefaults=M;k.defaults=w;k.use=function(...a){return z.use(...a),k.defaults=z.defaults,H(k.defaults),k};k.walkTokens=function(a,e){return z.walkTokens(a,e)};k.parseInline=z.parseInline;k.Parser=T;k.parser=T.parse;k.Renderer=$;k.TextRenderer=_;k.Lexer=b;k.lexer=b.lex;k.Tokenizer=S;k.Hooks=L;k.parse=k;k.options;k.setOptions;k.use;k.walkTokens;k.parseInline;T.parse;b.lex;
2194
96
 
2195
97
  /*
2196
98
  * Set up window for Node.js
@@ -8647,17 +6549,21 @@ const DESTROYED = 1 << 14;
8647
6549
  const EFFECT_RAN = 1 << 15;
8648
6550
  /** 'Transparent' effects do not create a transition boundary */
8649
6551
  const EFFECT_TRANSPARENT = 1 << 16;
8650
- /** Svelte 4 legacy mode props need to be handled with deriveds and be recognized elsewhere, hence the dedicated flag */
8651
- const LEGACY_DERIVED_PROP = 1 << 17;
8652
- const INSPECT_EFFECT = 1 << 18;
8653
- const HEAD_EFFECT = 1 << 19;
8654
- const EFFECT_HAS_DERIVED = 1 << 20;
8655
- const EFFECT_IS_UPDATING = 1 << 21;
6552
+ const INSPECT_EFFECT = 1 << 17;
6553
+ const HEAD_EFFECT = 1 << 18;
6554
+ const EFFECT_PRESERVED = 1 << 19;
6555
+ const EFFECT_IS_UPDATING = 1 << 20;
8656
6556
 
8657
6557
  const STATE_SYMBOL = Symbol('$state');
8658
6558
  const LEGACY_PROPS = Symbol('legacy props');
8659
6559
  const LOADING_ATTR_SYMBOL = Symbol('');
8660
6560
 
6561
+ /** allow users to ignore aborted signal errors if `reason.name === 'StaleReactionError` */
6562
+ const STALE_REACTION = new (class StaleReactionError extends Error {
6563
+ name = 'StaleReactionError';
6564
+ message = 'The reaction that called `getAbortSignal()` was re-run or destroyed';
6565
+ })();
6566
+
8661
6567
  /** @import { Equals } from '#client' */
8662
6568
 
8663
6569
  /** @type {Equals} */
@@ -8781,7 +6687,7 @@ function lifecycle_outside_component(name) {
8781
6687
  }
8782
6688
  }
8783
6689
 
8784
- /** @import { ComponentContext } from '#client' */
6690
+ /** @import { ComponentContext, DevStackEntry } from '#client' */
8785
6691
 
8786
6692
 
8787
6693
  /** @type {ComponentContext | null} */
@@ -9192,7 +7098,7 @@ function derived(fn) {
9192
7098
  } else {
9193
7099
  // Since deriveds are evaluated lazily, any effects created inside them are
9194
7100
  // created too late to ensure that the parent effect is added to the tree
9195
- active_effect.f |= EFFECT_HAS_DERIVED;
7101
+ active_effect.f |= EFFECT_PRESERVED;
9196
7102
  }
9197
7103
 
9198
7104
  /** @type {Derived<V>} */
@@ -9207,7 +7113,8 @@ function derived(fn) {
9207
7113
  rv: 0,
9208
7114
  v: /** @type {V} */ (null),
9209
7115
  wv: 0,
9210
- parent: parent_derived ?? active_effect
7116
+ parent: parent_derived ?? active_effect,
7117
+ ac: null
9211
7118
  };
9212
7119
 
9213
7120
  return signal;
@@ -9736,10 +7643,12 @@ function create_effect(type, fn, sync, push = true) {
9736
7643
  last: null,
9737
7644
  next: null,
9738
7645
  parent,
7646
+ b: parent && parent.b,
9739
7647
  prev: null,
9740
7648
  teardown: null,
9741
7649
  transitions: null,
9742
- wv: 0
7650
+ wv: 0,
7651
+ ac: null
9743
7652
  };
9744
7653
 
9745
7654
  if (sync) {
@@ -9762,7 +7671,7 @@ function create_effect(type, fn, sync, push = true) {
9762
7671
  effect.first === null &&
9763
7672
  effect.nodes_start === null &&
9764
7673
  effect.teardown === null &&
9765
- (effect.f & (EFFECT_HAS_DERIVED | BOUNDARY_EFFECT)) === 0;
7674
+ (effect.f & (EFFECT_PRESERVED | BOUNDARY_EFFECT)) === 0;
9766
7675
 
9767
7676
  if (!inert && push) {
9768
7677
  if (parent !== null) {
@@ -9935,7 +7844,8 @@ function template_effect(fn, thunks = [], d = derived) {
9935
7844
  * @param {number} flags
9936
7845
  */
9937
7846
  function block(fn, flags = 0) {
9938
- return create_effect(RENDER_EFFECT | BLOCK_EFFECT | flags, fn, true);
7847
+ var effect = create_effect(RENDER_EFFECT | BLOCK_EFFECT | flags, fn, true);
7848
+ return effect;
9939
7849
  }
9940
7850
 
9941
7851
  /**
@@ -9975,6 +7885,8 @@ function destroy_effect_children(signal, remove_dom = false) {
9975
7885
  signal.first = signal.last = null;
9976
7886
 
9977
7887
  while (effect !== null) {
7888
+ effect.ac?.abort(STALE_REACTION);
7889
+
9978
7890
  var next = effect.next;
9979
7891
 
9980
7892
  if ((effect.f & ROOT_EFFECT) !== 0) {
@@ -10052,6 +7964,7 @@ function destroy_effect(effect, remove_dom = true) {
10052
7964
  effect.fn =
10053
7965
  effect.nodes_start =
10054
7966
  effect.nodes_end =
7967
+ effect.ac =
10055
7968
  null;
10056
7969
  }
10057
7970
 
@@ -10215,6 +8128,7 @@ function queue_micro_task(fn) {
10215
8128
  }
10216
8129
 
10217
8130
  /** @import { Effect } from '#client' */
8131
+ /** @import { Boundary } from './dom/blocks/boundary.js' */
10218
8132
 
10219
8133
  /**
10220
8134
  * @param {unknown} error
@@ -10245,8 +8159,7 @@ function invoke_error_boundary(error, effect) {
10245
8159
  while (effect !== null) {
10246
8160
  if ((effect.f & BOUNDARY_EFFECT) !== 0) {
10247
8161
  try {
10248
- // @ts-expect-error
10249
- effect.fn(error);
8162
+ /** @type {Boundary} */ (effect.b).error(error);
10250
8163
  return;
10251
8164
  } catch {}
10252
8165
  }
@@ -10489,6 +8402,11 @@ function update_reaction(reaction) {
10489
8402
 
10490
8403
  reaction.f |= EFFECT_IS_UPDATING;
10491
8404
 
8405
+ if (reaction.ac !== null) {
8406
+ reaction.ac.abort(STALE_REACTION);
8407
+ reaction.ac = null;
8408
+ }
8409
+
10492
8410
  try {
10493
8411
  var result = /** @type {Function} */ (0, reaction.fn)();
10494
8412
  var deps = reaction.deps;
@@ -10507,7 +8425,12 @@ function update_reaction(reaction) {
10507
8425
  reaction.deps = deps = new_deps;
10508
8426
  }
10509
8427
 
10510
- if (!skip_reaction) {
8428
+ if (
8429
+ !skip_reaction ||
8430
+ // Deriveds that already have reactions can cleanup, so we still add them as reactions
8431
+ ((flags & DERIVED) !== 0 &&
8432
+ /** @type {import('#client').Derived} */ (reaction).reactions !== null)
8433
+ ) {
10511
8434
  for (i = skipped_deps; i < deps.length; i++) {
10512
8435
  (deps[i].reactions ??= []).push(reaction);
10513
8436
  }
@@ -10927,17 +8850,7 @@ function invalidate_inner_signals(fn) {
10927
8850
  var captured = capture_signals(() => untrack(fn));
10928
8851
 
10929
8852
  for (var signal of captured) {
10930
- // Go one level up because derived signals created as part of props in legacy mode
10931
- if ((signal.f & LEGACY_DERIVED_PROP) !== 0) {
10932
- for (const dep of /** @type {Derived} */ (signal).deps || []) {
10933
- if ((dep.f & DERIVED) === 0) {
10934
- // Use internal_set instead of set here and below to avoid mutation validation
10935
- internal_set(dep, dep.v);
10936
- }
10937
- }
10938
- } else {
10939
- internal_set(signal, signal.v);
10940
- }
8853
+ internal_set(signal, signal.v);
10941
8854
  }
10942
8855
  }
10943
8856
 
@@ -12949,40 +10862,29 @@ function select_option(select, value, mounting) {
12949
10862
  * current selection to the dom when it changes. Such
12950
10863
  * changes could for example occur when options are
12951
10864
  * inside an `#each` block.
12952
- * @template V
12953
10865
  * @param {HTMLSelectElement} select
12954
- * @param {() => V} [get_value]
12955
10866
  */
12956
- function init_select(select, get_value) {
12957
- let mounting = true;
12958
- effect(() => {
12959
- if (get_value) {
12960
- select_option(select, untrack(get_value), mounting);
12961
- }
12962
- mounting = false;
12963
-
12964
- var observer = new MutationObserver(() => {
12965
- // @ts-ignore
12966
- var value = select.__value;
12967
- select_option(select, value);
12968
- // Deliberately don't update the potential binding value,
12969
- // the model should be preserved unless explicitly changed
12970
- });
10867
+ function init_select(select) {
10868
+ var observer = new MutationObserver(() => {
10869
+ // @ts-ignore
10870
+ select_option(select, select.__value);
10871
+ // Deliberately don't update the potential binding value,
10872
+ // the model should be preserved unless explicitly changed
10873
+ });
12971
10874
 
12972
- observer.observe(select, {
12973
- // Listen to option element changes
12974
- childList: true,
12975
- subtree: true, // because of <optgroup>
12976
- // Listen to option element value attribute changes
12977
- // (doesn't get notified of select value changes,
12978
- // because that property is not reflected as an attribute)
12979
- attributes: true,
12980
- attributeFilter: ['value']
12981
- });
10875
+ observer.observe(select, {
10876
+ // Listen to option element changes
10877
+ childList: true,
10878
+ subtree: true, // because of <optgroup>
10879
+ // Listen to option element value attribute changes
10880
+ // (doesn't get notified of select value changes,
10881
+ // because that property is not reflected as an attribute)
10882
+ attributes: true,
10883
+ attributeFilter: ['value']
10884
+ });
12982
10885
 
12983
- return () => {
12984
- observer.disconnect();
12985
- };
10886
+ teardown(() => {
10887
+ observer.disconnect();
12986
10888
  });
12987
10889
  }
12988
10890
 
@@ -13312,10 +11214,12 @@ function attribute_effect(
13312
11214
  });
13313
11215
 
13314
11216
  if (is_select) {
13315
- init_select(
13316
- /** @type {HTMLSelectElement} */ (element),
13317
- () => /** @type {Record<string | symbol, any>} */ (prev).value
13318
- );
11217
+ var select = /** @type {HTMLSelectElement} */ (element);
11218
+
11219
+ effect(() => {
11220
+ select_option(select, /** @type {Record<string | symbol, any>} */ (prev).value);
11221
+ init_select(select);
11222
+ });
13319
11223
  }
13320
11224
 
13321
11225
  inited = true;
@@ -13782,89 +11686,92 @@ function has_destroyed_component_ctx(current_value) {
13782
11686
  * @returns {(() => V | ((arg: V) => V) | ((arg: V, mutation: boolean) => V))}
13783
11687
  */
13784
11688
  function prop(props, key, flags, fallback) {
13785
- var immutable = (flags & PROPS_IS_IMMUTABLE) !== 0;
13786
11689
  var runes = !legacy_mode_flag || (flags & PROPS_IS_RUNES) !== 0;
13787
11690
  var bindable = (flags & PROPS_IS_BINDABLE) !== 0;
13788
11691
  var lazy = (flags & PROPS_IS_LAZY_INITIAL) !== 0;
13789
- var is_store_sub = false;
13790
- var prop_value;
13791
-
13792
- if (bindable) {
13793
- [prop_value, is_store_sub] = capture_store_binding(() => /** @type {V} */ (props[key]));
13794
- } else {
13795
- prop_value = /** @type {V} */ (props[key]);
13796
- }
13797
-
13798
- // Can be the case when someone does `mount(Component, props)` with `let props = $state({...})`
13799
- // or `createClassComponent(Component, props)`
13800
- var is_entry_props = STATE_SYMBOL in props || LEGACY_PROPS in props;
13801
-
13802
- var setter =
13803
- (bindable &&
13804
- (get_descriptor(props, key)?.set ??
13805
- (is_entry_props && key in props && ((v) => (props[key] = v))))) ||
13806
- undefined;
13807
11692
 
13808
11693
  var fallback_value = /** @type {V} */ (fallback);
13809
11694
  var fallback_dirty = true;
13810
- var fallback_used = false;
13811
11695
 
13812
11696
  var get_fallback = () => {
13813
- fallback_used = true;
13814
11697
  if (fallback_dirty) {
13815
11698
  fallback_dirty = false;
13816
- if (lazy) {
13817
- fallback_value = untrack(/** @type {() => V} */ (fallback));
13818
- } else {
13819
- fallback_value = /** @type {V} */ (fallback);
13820
- }
11699
+
11700
+ fallback_value = lazy
11701
+ ? untrack(/** @type {() => V} */ (fallback))
11702
+ : /** @type {V} */ (fallback);
13821
11703
  }
13822
11704
 
13823
11705
  return fallback_value;
13824
11706
  };
13825
11707
 
13826
- if (prop_value === undefined && fallback !== undefined) {
13827
- if (setter && runes) {
13828
- props_invalid_value();
13829
- }
11708
+ /** @type {((v: V) => void) | undefined} */
11709
+ var setter;
11710
+
11711
+ if (bindable) {
11712
+ // Can be the case when someone does `mount(Component, props)` with `let props = $state({...})`
11713
+ // or `createClassComponent(Component, props)`
11714
+ var is_entry_props = STATE_SYMBOL in props || LEGACY_PROPS in props;
11715
+
11716
+ setter =
11717
+ get_descriptor(props, key)?.set ??
11718
+ (is_entry_props && key in props ? (v) => (props[key] = v) : undefined);
11719
+ }
11720
+
11721
+ var initial_value;
11722
+ var is_store_sub = false;
13830
11723
 
13831
- prop_value = get_fallback();
13832
- if (setter) setter(prop_value);
11724
+ if (bindable) {
11725
+ [initial_value, is_store_sub] = capture_store_binding(() => /** @type {V} */ (props[key]));
11726
+ } else {
11727
+ initial_value = /** @type {V} */ (props[key]);
11728
+ }
11729
+
11730
+ if (initial_value === undefined && fallback !== undefined) {
11731
+ initial_value = get_fallback();
11732
+
11733
+ if (setter) {
11734
+ if (runes) props_invalid_value();
11735
+ setter(initial_value);
11736
+ }
13833
11737
  }
13834
11738
 
13835
11739
  /** @type {() => V} */
13836
11740
  var getter;
11741
+
13837
11742
  if (runes) {
13838
11743
  getter = () => {
13839
11744
  var value = /** @type {V} */ (props[key]);
13840
11745
  if (value === undefined) return get_fallback();
13841
11746
  fallback_dirty = true;
13842
- fallback_used = false;
13843
11747
  return value;
13844
11748
  };
13845
11749
  } else {
13846
- // Svelte 4 did not trigger updates when a primitive value was updated to the same value.
13847
- // Replicate that behavior through using a derived
13848
- var derived_getter = (immutable ? derived : derived_safe_equal)(
13849
- () => /** @type {V} */ (props[key])
13850
- );
13851
- derived_getter.f |= LEGACY_DERIVED_PROP;
13852
11750
  getter = () => {
13853
- var value = get(derived_getter);
13854
- if (value !== undefined) fallback_value = /** @type {V} */ (undefined);
11751
+ var value = /** @type {V} */ (props[key]);
11752
+
11753
+ if (value !== undefined) {
11754
+ // in legacy mode, we don't revert to the fallback value
11755
+ // if the prop goes from defined to undefined. The easiest
11756
+ // way to model this is to make the fallback undefined
11757
+ // as soon as the prop has a value
11758
+ fallback_value = /** @type {V} */ (undefined);
11759
+ }
11760
+
13855
11761
  return value === undefined ? fallback_value : value;
13856
11762
  };
13857
11763
  }
13858
11764
 
13859
- // easy mode — prop is never written to
13860
- if ((flags & PROPS_IS_UPDATED) === 0 && runes) {
11765
+ // prop is never written to — we only need a getter
11766
+ if (runes && (flags & PROPS_IS_UPDATED) === 0) {
13861
11767
  return getter;
13862
11768
  }
13863
11769
 
13864
- // intermediate mode — prop is written to, but the parent component had
13865
- // `bind:foo` which means we can just call `$$props.foo = value` directly
11770
+ // prop is written to, but the parent component had `bind:foo` which
11771
+ // means we can just call `$$props.foo = value` directly
13866
11772
  if (setter) {
13867
11773
  var legacy_parent = props.$$legacy;
11774
+
13868
11775
  return function (/** @type {any} */ value, /** @type {boolean} */ mutation) {
13869
11776
  if (arguments.length > 0) {
13870
11777
  // We don't want to notify if the value was mutated and the parent is in runes mode.
@@ -13874,83 +11781,42 @@ function prop(props, key, flags, fallback) {
13874
11781
  if (!runes || !mutation || legacy_parent || is_store_sub) {
13875
11782
  /** @type {Function} */ (setter)(mutation ? getter() : value);
13876
11783
  }
11784
+
13877
11785
  return value;
13878
- } else {
13879
- return getter();
13880
11786
  }
11787
+
11788
+ return getter();
13881
11789
  };
13882
11790
  }
13883
11791
 
13884
- // hard mode. this is where it gets ugly the value in the child should
13885
- // synchronize with the parent, but it should also be possible to temporarily
13886
- // set the value to something else locally.
13887
- var from_child = false;
13888
- var was_from_child = false;
13889
-
13890
- // The derived returns the current value. The underlying mutable
13891
- // source is written to from various places to persist this value.
13892
- var inner_current_value = mutable_source(prop_value);
13893
- var current_value = derived(() => {
13894
- var parent_value = getter();
13895
- var child_value = get(inner_current_value);
13896
-
13897
- if (from_child) {
13898
- from_child = false;
13899
- was_from_child = true;
13900
- return child_value;
13901
- }
13902
-
13903
- was_from_child = false;
13904
- return (inner_current_value.v = parent_value);
13905
- });
13906
-
13907
- // Ensure we eagerly capture the initial value if it's bindable
13908
- if (bindable) {
13909
- get(current_value);
13910
- }
11792
+ // Either prop is written to, but there's no binding, which means we
11793
+ // create a derived that we can write to locally.
11794
+ // Or we are in legacy mode where we always create a derived to replicate that
11795
+ // Svelte 4 did not trigger updates when a primitive value was updated to the same value.
11796
+ var d = ((flags & PROPS_IS_IMMUTABLE) !== 0 ? derived : derived_safe_equal)(getter);
13911
11797
 
13912
- if (!immutable) current_value.equals = safe_equals;
11798
+ // Capture the initial value if it's bindable
11799
+ if (bindable) get(d);
13913
11800
 
13914
11801
  return function (/** @type {any} */ value, /** @type {boolean} */ mutation) {
13915
- // legacy nonsense — need to ensure the source is invalidated when necessary
13916
- // also needed for when handling inspect logic so we can inspect the correct source signal
13917
- if (captured_signals !== null) {
13918
- // set this so that we don't reset to the parent value if `d`
13919
- // is invalidated because of `invalidate_inner_signals` (rather
13920
- // than because the parent or child value changed)
13921
- from_child = was_from_child;
13922
- // invoke getters so that signals are picked up by `invalidate_inner_signals`
13923
- getter();
13924
- get(inner_current_value);
13925
- }
13926
-
13927
11802
  if (arguments.length > 0) {
13928
- const new_value = mutation ? get(current_value) : runes && bindable ? proxy(value) : value;
13929
-
13930
- if (!current_value.equals(new_value)) {
13931
- from_child = true;
13932
- set(inner_current_value, new_value);
13933
- // To ensure the fallback value is consistent when used with proxies, we
13934
- // update the local fallback_value, but only if the fallback is actively used
13935
- if (fallback_used && fallback_value !== undefined) {
13936
- fallback_value = new_value;
13937
- }
11803
+ const new_value = mutation ? get(d) : runes && bindable ? proxy(value) : value;
13938
11804
 
13939
- if (has_destroyed_component_ctx(current_value)) {
13940
- return value;
13941
- }
11805
+ set(d, new_value);
13942
11806
 
13943
- untrack(() => get(current_value)); // force a synchronisation immediately
11807
+ if (fallback_value !== undefined) {
11808
+ fallback_value = new_value;
13944
11809
  }
13945
11810
 
13946
11811
  return value;
13947
11812
  }
13948
11813
 
13949
- if (has_destroyed_component_ctx(current_value)) {
13950
- return current_value.v;
11814
+ // TODO is this still necessary post-#16263?
11815
+ if (has_destroyed_component_ctx(d)) {
11816
+ return d.v;
13951
11817
  }
13952
11818
 
13953
- return get(current_value);
11819
+ return get(d);
13954
11820
  };
13955
11821
  }
13956
11822
 
@@ -14015,11 +11881,7 @@ function Block_catalog($$anchor, $$props) {
14015
11881
  var consequent = ($$anchor) => {
14016
11882
  var img = root_4$3();
14017
11883
 
14018
- template_effect(() => set_attribute(img, 'src', (
14019
- blockInfo(),
14020
- untrack(() => blockInfo().img)
14021
- )));
14022
-
11884
+ template_effect(() => set_attribute(img, 'src', (blockInfo(), untrack(() => blockInfo().img))));
14023
11885
  append($$anchor, img);
14024
11886
  };
14025
11887
 
@@ -14029,21 +11891,14 @@ function Block_catalog($$anchor, $$props) {
14029
11891
  var fragment_1 = comment();
14030
11892
  var node_2 = first_child(fragment_1);
14031
11893
 
14032
- html(node_2, () => (
14033
- blockInfo(),
14034
- untrack(() => blockInfo().svg)
14035
- ));
14036
-
11894
+ html(node_2, () => (blockInfo(), untrack(() => blockInfo().svg)));
14037
11895
  append($$anchor, fragment_1);
14038
11896
  };
14039
11897
 
14040
11898
  if_block(
14041
11899
  $$anchor,
14042
11900
  ($$render) => {
14043
- if ((
14044
- blockInfo(),
14045
- untrack(() => blockInfo().svg)
14046
- )) $$render(consequent_1);
11901
+ if ((blockInfo(), untrack(() => blockInfo().svg))) $$render(consequent_1);
14047
11902
  },
14048
11903
  $$elseif
14049
11904
  );
@@ -14051,32 +11906,20 @@ function Block_catalog($$anchor, $$props) {
14051
11906
  };
14052
11907
 
14053
11908
  if_block(node_1, ($$render) => {
14054
- if ((
14055
- blockInfo(),
14056
- untrack(() => blockInfo().img)
14057
- )) $$render(consequent); else $$render(alternate, false);
11909
+ if ((blockInfo(), untrack(() => blockInfo().img))) $$render(consequent); else $$render(alternate, false);
14058
11910
  });
14059
11911
  }
14060
11912
 
14061
11913
  var figcaption = sibling(div_2, 2);
14062
11914
  var text_1 = child(figcaption);
14063
-
14064
- template_effect(() => set_text(text_1, (
14065
- blockInfo(),
14066
- untrack(() => blockInfo().label)
14067
- )));
14068
-
11915
+ template_effect(() => set_text(text_1, (blockInfo(), untrack(() => blockInfo().label))));
14069
11916
  append($$anchor, figure);
14070
11917
  };
14071
11918
 
14072
11919
  var alternate_1 = ($$anchor) => {
14073
11920
  var text_2 = text();
14074
11921
 
14075
- template_effect(() => set_text(text_2, (
14076
- blockInfo(),
14077
- untrack(() => blockInfo().label)
14078
- )));
14079
-
11922
+ template_effect(() => set_text(text_2, (blockInfo(), untrack(() => blockInfo().label))));
14080
11923
  append($$anchor, text_2);
14081
11924
  };
14082
11925
 
@@ -14123,21 +11966,8 @@ const defaultAttributes = {
14123
11966
  var root$a = from_svg(`<svg><!><!></svg>`);
14124
11967
 
14125
11968
  function Icon($$anchor, $$props) {
14126
- const $$sanitized_props = legacy_rest_props($$props, [
14127
- 'children',
14128
- '$$slots',
14129
- '$$events',
14130
- '$$legacy'
14131
- ]);
14132
-
14133
- const $$restProps = legacy_rest_props($$sanitized_props, [
14134
- 'type',
14135
- 'name',
14136
- 'color',
14137
- 'size',
14138
- 'stroke',
14139
- 'iconNode'
14140
- ]);
11969
+ const $$sanitized_props = legacy_rest_props($$props, ['children', '$$slots', '$$events', '$$legacy']);
11970
+ const $$restProps = legacy_rest_props($$sanitized_props, ['type', 'name', 'color', 'size', 'stroke', 'iconNode']);
14141
11971
 
14142
11972
  push($$props, false);
14143
11973
 
@@ -14157,17 +11987,16 @@ function Icon($$anchor, $$props) {
14157
11987
  ...$$restProps,
14158
11988
  width: size(),
14159
11989
  height: size(),
11990
+
14160
11991
  class: (
14161
11992
  deep_read_state(name()),
14162
11993
  deep_read_state($$sanitized_props),
14163
11994
  untrack(() => `tabler-icon tabler-icon-${name()} ${$$sanitized_props.class ?? ''}`)
14164
11995
  ),
11996
+
14165
11997
  ...type() === 'filled'
14166
11998
  ? { fill: color() }
14167
- : {
14168
- 'stroke-width': stroke(),
14169
- stroke: color()
14170
- }
11999
+ : { 'stroke-width': stroke(), stroke: color() }
14171
12000
  }));
14172
12001
 
14173
12002
  var node = child(svg);
@@ -14194,20 +12023,17 @@ function Icon($$anchor, $$props) {
14194
12023
  }
14195
12024
 
14196
12025
  function Arrow_big_down_line($$anchor, $$props) {
14197
- const $$sanitized_props = legacy_rest_props($$props, [
14198
- 'children',
14199
- '$$slots',
14200
- '$$events',
14201
- '$$legacy'
14202
- ]);
12026
+ const $$sanitized_props = legacy_rest_props($$props, ['children', '$$slots', '$$events', '$$legacy']);
14203
12027
 
14204
12028
  const iconNode = [
14205
12029
  [
14206
12030
  "path",
12031
+
14207
12032
  {
14208
12033
  "d": "M15 12h3.586a1 1 0 0 1 .707 1.707l-6.586 6.586a1 1 0 0 1 -1.414 0l-6.586 -6.586a1 1 0 0 1 .707 -1.707h3.586v-6h6v6z"
14209
12034
  }
14210
12035
  ],
12036
+
14211
12037
  ["path", { "d": "M15 3h-6" }]
14212
12038
  ];
14213
12039
 
@@ -14215,6 +12041,7 @@ function Arrow_big_down_line($$anchor, $$props) {
14215
12041
  get iconNode() {
14216
12042
  return iconNode;
14217
12043
  },
12044
+
14218
12045
  children: ($$anchor, $$slotProps) => {
14219
12046
  var fragment_1 = comment();
14220
12047
  var node = first_child(fragment_1);
@@ -14222,25 +12049,23 @@ function Arrow_big_down_line($$anchor, $$props) {
14222
12049
  slot(node, $$props, 'default', {});
14223
12050
  append($$anchor, fragment_1);
14224
12051
  },
12052
+
14225
12053
  $$slots: { default: true }
14226
12054
  }));
14227
12055
  }
14228
12056
 
14229
12057
  function Arrow_big_up_line($$anchor, $$props) {
14230
- const $$sanitized_props = legacy_rest_props($$props, [
14231
- 'children',
14232
- '$$slots',
14233
- '$$events',
14234
- '$$legacy'
14235
- ]);
12058
+ const $$sanitized_props = legacy_rest_props($$props, ['children', '$$slots', '$$events', '$$legacy']);
14236
12059
 
14237
12060
  const iconNode = [
14238
12061
  [
14239
12062
  "path",
12063
+
14240
12064
  {
14241
12065
  "d": "M9 12h-3.586a1 1 0 0 1 -.707 -1.707l6.586 -6.586a1 1 0 0 1 1.414 0l6.586 6.586a1 1 0 0 1 -.707 1.707h-3.586v6h-6v-6z"
14242
12066
  }
14243
12067
  ],
12068
+
14244
12069
  ["path", { "d": "M9 21h6" }]
14245
12070
  ];
14246
12071
 
@@ -14248,6 +12073,7 @@ function Arrow_big_up_line($$anchor, $$props) {
14248
12073
  get iconNode() {
14249
12074
  return iconNode;
14250
12075
  },
12076
+
14251
12077
  children: ($$anchor, $$slotProps) => {
14252
12078
  var fragment_1 = comment();
14253
12079
  var node = first_child(fragment_1);
@@ -14255,31 +12081,31 @@ function Arrow_big_up_line($$anchor, $$props) {
14255
12081
  slot(node, $$props, 'default', {});
14256
12082
  append($$anchor, fragment_1);
14257
12083
  },
12084
+
14258
12085
  $$slots: { default: true }
14259
12086
  }));
14260
12087
  }
14261
12088
 
14262
12089
  function Clipboard_plus($$anchor, $$props) {
14263
- const $$sanitized_props = legacy_rest_props($$props, [
14264
- 'children',
14265
- '$$slots',
14266
- '$$events',
14267
- '$$legacy'
14268
- ]);
12090
+ const $$sanitized_props = legacy_rest_props($$props, ['children', '$$slots', '$$events', '$$legacy']);
14269
12091
 
14270
12092
  const iconNode = [
14271
12093
  [
14272
12094
  "path",
12095
+
14273
12096
  {
14274
12097
  "d": "M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2"
14275
12098
  }
14276
12099
  ],
12100
+
14277
12101
  [
14278
12102
  "path",
12103
+
14279
12104
  {
14280
12105
  "d": "M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z"
14281
12106
  }
14282
12107
  ],
12108
+
14283
12109
  ["path", { "d": "M10 14h4" }],
14284
12110
  ["path", { "d": "M12 12v4" }]
14285
12111
  ];
@@ -14288,6 +12114,7 @@ function Clipboard_plus($$anchor, $$props) {
14288
12114
  get iconNode() {
14289
12115
  return iconNode;
14290
12116
  },
12117
+
14291
12118
  children: ($$anchor, $$slotProps) => {
14292
12119
  var fragment_1 = comment();
14293
12120
  var node = first_child(fragment_1);
@@ -14295,37 +12122,39 @@ function Clipboard_plus($$anchor, $$props) {
14295
12122
  slot(node, $$props, 'default', {});
14296
12123
  append($$anchor, fragment_1);
14297
12124
  },
12125
+
14298
12126
  $$slots: { default: true }
14299
12127
  }));
14300
12128
  }
14301
12129
 
14302
12130
  function Layout_grid_add($$anchor, $$props) {
14303
- const $$sanitized_props = legacy_rest_props($$props, [
14304
- 'children',
14305
- '$$slots',
14306
- '$$events',
14307
- '$$legacy'
14308
- ]);
12131
+ const $$sanitized_props = legacy_rest_props($$props, ['children', '$$slots', '$$events', '$$legacy']);
14309
12132
 
14310
12133
  const iconNode = [
14311
12134
  [
14312
12135
  "path",
12136
+
14313
12137
  {
14314
12138
  "d": "M4 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z"
14315
12139
  }
14316
12140
  ],
12141
+
14317
12142
  [
14318
12143
  "path",
12144
+
14319
12145
  {
14320
12146
  "d": "M14 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z"
14321
12147
  }
14322
12148
  ],
12149
+
14323
12150
  [
14324
12151
  "path",
12152
+
14325
12153
  {
14326
12154
  "d": "M4 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z"
14327
12155
  }
14328
12156
  ],
12157
+
14329
12158
  ["path", { "d": "M14 17h6m-3 -3v6" }]
14330
12159
  ];
14331
12160
 
@@ -14333,6 +12162,7 @@ function Layout_grid_add($$anchor, $$props) {
14333
12162
  get iconNode() {
14334
12163
  return iconNode;
14335
12164
  },
12165
+
14336
12166
  children: ($$anchor, $$slotProps) => {
14337
12167
  var fragment_1 = comment();
14338
12168
  var node = first_child(fragment_1);
@@ -14340,37 +12170,39 @@ function Layout_grid_add($$anchor, $$props) {
14340
12170
  slot(node, $$props, 'default', {});
14341
12171
  append($$anchor, fragment_1);
14342
12172
  },
12173
+
14343
12174
  $$slots: { default: true }
14344
12175
  }));
14345
12176
  }
14346
12177
 
14347
12178
  function Layout_grid_remove($$anchor, $$props) {
14348
- const $$sanitized_props = legacy_rest_props($$props, [
14349
- 'children',
14350
- '$$slots',
14351
- '$$events',
14352
- '$$legacy'
14353
- ]);
12179
+ const $$sanitized_props = legacy_rest_props($$props, ['children', '$$slots', '$$events', '$$legacy']);
14354
12180
 
14355
12181
  const iconNode = [
14356
12182
  [
14357
12183
  "path",
12184
+
14358
12185
  {
14359
12186
  "d": "M4 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-4z"
14360
12187
  }
14361
12188
  ],
12189
+
14362
12190
  [
14363
12191
  "path",
12192
+
14364
12193
  {
14365
12194
  "d": "M14 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-4z"
14366
12195
  }
14367
12196
  ],
12197
+
14368
12198
  [
14369
12199
  "path",
12200
+
14370
12201
  {
14371
12202
  "d": "M4 15a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-4z"
14372
12203
  }
14373
12204
  ],
12205
+
14374
12206
  ["path", { "d": "M14 17h6" }]
14375
12207
  ];
14376
12208
 
@@ -14378,6 +12210,7 @@ function Layout_grid_remove($$anchor, $$props) {
14378
12210
  get iconNode() {
14379
12211
  return iconNode;
14380
12212
  },
12213
+
14381
12214
  children: ($$anchor, $$slotProps) => {
14382
12215
  var fragment_1 = comment();
14383
12216
  var node = first_child(fragment_1);
@@ -14385,25 +12218,23 @@ function Layout_grid_remove($$anchor, $$props) {
14385
12218
  slot(node, $$props, 'default', {});
14386
12219
  append($$anchor, fragment_1);
14387
12220
  },
12221
+
14388
12222
  $$slots: { default: true }
14389
12223
  }));
14390
12224
  }
14391
12225
 
14392
12226
  function Row_insert_bottom($$anchor, $$props) {
14393
- const $$sanitized_props = legacy_rest_props($$props, [
14394
- 'children',
14395
- '$$slots',
14396
- '$$events',
14397
- '$$legacy'
14398
- ]);
12227
+ const $$sanitized_props = legacy_rest_props($$props, ['children', '$$slots', '$$events', '$$legacy']);
14399
12228
 
14400
12229
  const iconNode = [
14401
12230
  [
14402
12231
  "path",
12232
+
14403
12233
  {
14404
12234
  "d": "M20 6v4a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1z"
14405
12235
  }
14406
12236
  ],
12237
+
14407
12238
  ["path", { "d": "M12 15l0 4" }],
14408
12239
  ["path", { "d": "M14 17l-4 0" }]
14409
12240
  ];
@@ -14412,6 +12243,7 @@ function Row_insert_bottom($$anchor, $$props) {
14412
12243
  get iconNode() {
14413
12244
  return iconNode;
14414
12245
  },
12246
+
14415
12247
  children: ($$anchor, $$slotProps) => {
14416
12248
  var fragment_1 = comment();
14417
12249
  var node = first_child(fragment_1);
@@ -14419,25 +12251,23 @@ function Row_insert_bottom($$anchor, $$props) {
14419
12251
  slot(node, $$props, 'default', {});
14420
12252
  append($$anchor, fragment_1);
14421
12253
  },
12254
+
14422
12255
  $$slots: { default: true }
14423
12256
  }));
14424
12257
  }
14425
12258
 
14426
12259
  function Row_insert_top($$anchor, $$props) {
14427
- const $$sanitized_props = legacy_rest_props($$props, [
14428
- 'children',
14429
- '$$slots',
14430
- '$$events',
14431
- '$$legacy'
14432
- ]);
12260
+ const $$sanitized_props = legacy_rest_props($$props, ['children', '$$slots', '$$events', '$$legacy']);
14433
12261
 
14434
12262
  const iconNode = [
14435
12263
  [
14436
12264
  "path",
12265
+
14437
12266
  {
14438
12267
  "d": "M4 18v-4a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1z"
14439
12268
  }
14440
12269
  ],
12270
+
14441
12271
  ["path", { "d": "M12 9v-4" }],
14442
12272
  ["path", { "d": "M10 7l4 0" }]
14443
12273
  ];
@@ -14446,6 +12276,7 @@ function Row_insert_top($$anchor, $$props) {
14446
12276
  get iconNode() {
14447
12277
  return iconNode;
14448
12278
  },
12279
+
14449
12280
  children: ($$anchor, $$slotProps) => {
14450
12281
  var fragment_1 = comment();
14451
12282
  var node = first_child(fragment_1);
@@ -14453,35 +12284,31 @@ function Row_insert_top($$anchor, $$props) {
14453
12284
  slot(node, $$props, 'default', {});
14454
12285
  append($$anchor, fragment_1);
14455
12286
  },
12287
+
14456
12288
  $$slots: { default: true }
14457
12289
  }));
14458
12290
  }
14459
12291
 
14460
12292
  function Settings($$anchor, $$props) {
14461
- const $$sanitized_props = legacy_rest_props($$props, [
14462
- 'children',
14463
- '$$slots',
14464
- '$$events',
14465
- '$$legacy'
14466
- ]);
12293
+ const $$sanitized_props = legacy_rest_props($$props, ['children', '$$slots', '$$events', '$$legacy']);
14467
12294
 
14468
12295
  const iconNode = [
14469
12296
  [
14470
12297
  "path",
12298
+
14471
12299
  {
14472
12300
  "d": "M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z"
14473
12301
  }
14474
12302
  ],
14475
- [
14476
- "path",
14477
- { "d": "M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0" }
14478
- ]
12303
+
12304
+ ["path", { "d": "M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0" }]
14479
12305
  ];
14480
12306
 
14481
12307
  Icon($$anchor, spread_props({ type: 'outline', name: 'settings' }, () => $$sanitized_props, {
14482
12308
  get iconNode() {
14483
12309
  return iconNode;
14484
12310
  },
12311
+
14485
12312
  children: ($$anchor, $$slotProps) => {
14486
12313
  var fragment_1 = comment();
14487
12314
  var node = first_child(fragment_1);
@@ -14489,40 +12316,32 @@ function Settings($$anchor, $$props) {
14489
12316
  slot(node, $$props, 'default', {});
14490
12317
  append($$anchor, fragment_1);
14491
12318
  },
12319
+
14492
12320
  $$slots: { default: true }
14493
12321
  }));
14494
12322
  }
14495
12323
 
14496
12324
  function Trash($$anchor, $$props) {
14497
- const $$sanitized_props = legacy_rest_props($$props, [
14498
- 'children',
14499
- '$$slots',
14500
- '$$events',
14501
- '$$legacy'
14502
- ]);
12325
+ const $$sanitized_props = legacy_rest_props($$props, ['children', '$$slots', '$$events', '$$legacy']);
14503
12326
 
14504
12327
  const iconNode = [
14505
12328
  ["path", { "d": "M4 7l16 0" }],
14506
12329
  ["path", { "d": "M10 11l0 6" }],
14507
12330
  ["path", { "d": "M14 11l0 6" }],
12331
+
14508
12332
  [
14509
12333
  "path",
14510
- {
14511
- "d": "M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"
14512
- }
12334
+ { "d": "M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12" }
14513
12335
  ],
14514
- [
14515
- "path",
14516
- {
14517
- "d": "M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"
14518
- }
14519
- ]
12336
+
12337
+ ["path", { "d": "M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3" }]
14520
12338
  ];
14521
12339
 
14522
12340
  Icon($$anchor, spread_props({ type: 'outline', name: 'trash' }, () => $$sanitized_props, {
14523
12341
  get iconNode() {
14524
12342
  return iconNode;
14525
12343
  },
12344
+
14526
12345
  children: ($$anchor, $$slotProps) => {
14527
12346
  var fragment_1 = comment();
14528
12347
  var node = first_child(fragment_1);
@@ -14530,6 +12349,7 @@ function Trash($$anchor, $$props) {
14530
12349
  slot(node, $$props, 'default', {});
14531
12350
  append($$anchor, fragment_1);
14532
12351
  },
12352
+
14533
12353
  $$slots: { default: true }
14534
12354
  }));
14535
12355
  }
@@ -14553,12 +12373,15 @@ function Block_menu_button($$anchor, $$props) {
14553
12373
  var span = sibling(button, 2);
14554
12374
  var text = child(span);
14555
12375
 
14556
- template_effect(() => {
14557
- styles = set_style(div, '', styles, { '--name': `--anchor-${uid}` });
14558
- set_attribute(button, 'aria-labelledby', uid);
14559
- set_attribute(span, 'id', uid);
14560
- set_text(text, $$props.label);
14561
- });
12376
+ template_effect(
12377
+ ($0) => {
12378
+ styles = set_style(div, '', styles, $0);
12379
+ set_attribute(button, 'aria-labelledby', uid);
12380
+ set_attribute(span, 'id', uid);
12381
+ set_text(text, $$props.label);
12382
+ },
12383
+ [() => ({ '--name': `--anchor-${uid}` })]
12384
+ );
14562
12385
 
14563
12386
  append($$anchor, div);
14564
12387
  }
@@ -14627,7 +12450,7 @@ async function replaceElement(elA, elB, duration = 600) {
14627
12450
  }
14628
12451
 
14629
12452
  var root_5$3 = from_html(`<!> <!>`, 1);
14630
- var root$8 = from_html(`<div class="bge-menu-base svelte-15fci6"><div class="bge-menu svelte-15fci6"><div class="bge-move-group svelte-15fci6"><!> <!></div> <div class="bge-standard-group svelte-15fci6"><!> <!> <!> <!> <!> <!></div></div> <div class="bge-menu-margin svelte-15fci6"><span class="svelte-15fci6"> </span></div></div>`);
12453
+ var root$8 = from_html(`<div class="bge-menu-base svelte-1i5f2fs"><div class="bge-menu svelte-1i5f2fs"><div class="bge-move-group svelte-1i5f2fs"><!> <!></div> <div class="bge-standard-group svelte-1i5f2fs"><!> <!> <!> <!> <!> <!></div></div> <div class="bge-menu-margin svelte-1i5f2fs"><span class="svelte-1i5f2fs"> </span></div></div>`);
14631
12454
 
14632
12455
  function Block_menu($$anchor, $$props) {
14633
12456
  push($$props, false);
@@ -14646,16 +12469,7 @@ function Block_menu($$anchor, $$props) {
14646
12469
  set(currentBlock, block);
14647
12470
  });
14648
12471
 
14649
- engine().componentObserver.on('select-block', (
14650
- {
14651
- block,
14652
- width,
14653
- height,
14654
- x,
14655
- y,
14656
- marginBlockEnd
14657
- }
14658
- ) => {
12472
+ engine().componentObserver.on('select-block', ({ block, width, height, x, y, marginBlockEnd }) => {
14659
12473
  set(currentBlock, block);
14660
12474
  set(_width, width);
14661
12475
  set(_height, height);
@@ -14787,6 +12601,7 @@ function Block_menu($$anchor, $$props) {
14787
12601
  Block_menu_button(node, {
14788
12602
  label: 'ひとつ上へ移動',
14789
12603
  action: () => move(true),
12604
+
14790
12605
  children: ($$anchor, $$slotProps) => {
14791
12606
  Arrow_big_up_line($$anchor, {});
14792
12607
  }});
@@ -14796,6 +12611,7 @@ function Block_menu($$anchor, $$props) {
14796
12611
  Block_menu_button(node_1, {
14797
12612
  label: 'ひとつ下へ移動',
14798
12613
  action: () => move(false),
12614
+
14799
12615
  children: ($$anchor, $$slotProps) => {
14800
12616
  Arrow_big_down_line($$anchor, {});
14801
12617
  }});
@@ -14806,6 +12622,7 @@ function Block_menu($$anchor, $$props) {
14806
12622
  Block_menu_button(node_2, {
14807
12623
  label: '上にブロックを追加',
14808
12624
  action: () => insert(true),
12625
+
14809
12626
  children: ($$anchor, $$slotProps) => {
14810
12627
  Row_insert_top($$anchor, {});
14811
12628
  }});
@@ -14815,6 +12632,7 @@ function Block_menu($$anchor, $$props) {
14815
12632
  Block_menu_button(node_3, {
14816
12633
  label: '下にブロックを追加',
14817
12634
  action: () => insert(false),
12635
+
14818
12636
  children: ($$anchor, $$slotProps) => {
14819
12637
  Row_insert_bottom($$anchor, {});
14820
12638
  }});
@@ -14829,6 +12647,7 @@ function Block_menu($$anchor, $$props) {
14829
12647
  Block_menu_button(node_5, {
14830
12648
  label: 'ブロック内に要素を追加',
14831
12649
  action: () => updateGridItems(1),
12650
+
14832
12651
  children: ($$anchor, $$slotProps) => {
14833
12652
  Layout_grid_add($$anchor, {});
14834
12653
  }});
@@ -14838,6 +12657,7 @@ function Block_menu($$anchor, $$props) {
14838
12657
  Block_menu_button(node_6, {
14839
12658
  label: 'ブロック内の要素を削除',
14840
12659
  action: () => updateGridItems(-1),
12660
+
14841
12661
  children: ($$anchor, $$slotProps) => {
14842
12662
  Layout_grid_remove($$anchor, {});
14843
12663
  }});
@@ -14855,6 +12675,7 @@ function Block_menu($$anchor, $$props) {
14855
12675
  Block_menu_button(node_7, {
14856
12676
  label: 'オプション設定',
14857
12677
  action: () => openConfig(),
12678
+
14858
12679
  children: ($$anchor, $$slotProps) => {
14859
12680
  Settings($$anchor, {});
14860
12681
  }});
@@ -14864,6 +12685,7 @@ function Block_menu($$anchor, $$props) {
14864
12685
  Block_menu_button(node_8, {
14865
12686
  label: 'ブロックをコピー',
14866
12687
  action: () => copy(),
12688
+
14867
12689
  children: ($$anchor, $$slotProps) => {
14868
12690
  Clipboard_plus($$anchor, {});
14869
12691
  }});
@@ -14873,6 +12695,7 @@ function Block_menu($$anchor, $$props) {
14873
12695
  Block_menu_button(node_9, {
14874
12696
  label: 'ブロックを削除',
14875
12697
  action: () => remove(),
12698
+
14876
12699
  children: ($$anchor, $$slotProps) => {
14877
12700
  Trash($$anchor, {});
14878
12701
  }});
@@ -15089,16 +12912,17 @@ function Block_options($$anchor, $$props) {
15089
12912
  let propName = () => get($$array_1)[0];
15090
12913
  let data = () => get($$array_1)[1];
15091
12914
  var option = root_9$1();
15092
- var option_value = {};
15093
12915
  var text_3 = child(option);
15094
12916
 
12917
+ var option_value = {};
12918
+
15095
12919
  template_effect(() => {
12920
+ set_selected(option, options.style[category()] === propName() || data().isDefault);
12921
+ set_text(text_3, `${propName()} (${data().value})`);
12922
+
15096
12923
  if (option_value !== (option_value = data().isDefault ? '@@default' : propName())) {
15097
12924
  option.value = (option.__value = data().isDefault ? '@@default' : propName()) ?? '';
15098
12925
  }
15099
-
15100
- set_selected(option, options.style[category()] === propName() || data().isDefault);
15101
- set_text(text_3, `${propName()} (${data().value})`);
15102
12926
  });
15103
12927
 
15104
12928
  append($$anchor, option);
@@ -15299,17 +13123,14 @@ function Draft_switcher($$anchor, $$props) {
15299
13123
  }
15300
13124
 
15301
13125
  function File($$anchor, $$props) {
15302
- const $$sanitized_props = legacy_rest_props($$props, [
15303
- 'children',
15304
- '$$slots',
15305
- '$$events',
15306
- '$$legacy'
15307
- ]);
13126
+ const $$sanitized_props = legacy_rest_props($$props, ['children', '$$slots', '$$events', '$$legacy']);
15308
13127
 
15309
13128
  const iconNode = [
15310
13129
  ["path", { "d": "M14 3v4a1 1 0 0 0 1 1h4" }],
13130
+
15311
13131
  [
15312
13132
  "path",
13133
+
15313
13134
  {
15314
13135
  "d": "M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"
15315
13136
  }
@@ -15320,6 +13141,7 @@ function File($$anchor, $$props) {
15320
13141
  get iconNode() {
15321
13142
  return iconNode;
15322
13143
  },
13144
+
15323
13145
  children: ($$anchor, $$slotProps) => {
15324
13146
  var fragment_1 = comment();
15325
13147
  var node = first_child(fragment_1);
@@ -15327,38 +13149,31 @@ function File($$anchor, $$props) {
15327
13149
  slot(node, $$props, 'default', {});
15328
13150
  append($$anchor, fragment_1);
15329
13151
  },
13152
+
15330
13153
  $$slots: { default: true }
15331
13154
  }));
15332
13155
  }
15333
13156
 
15334
13157
  function File_type_doc($$anchor, $$props) {
15335
- const $$sanitized_props = legacy_rest_props($$props, [
15336
- 'children',
15337
- '$$slots',
15338
- '$$events',
15339
- '$$legacy'
15340
- ]);
13158
+ const $$sanitized_props = legacy_rest_props($$props, ['children', '$$slots', '$$events', '$$legacy']);
15341
13159
 
15342
13160
  const iconNode = [
15343
13161
  ["path", { "d": "M14 3v4a1 1 0 0 0 1 1h4" }],
13162
+ ["path", { "d": "M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4" }],
13163
+
15344
13164
  [
15345
13165
  "path",
15346
- { "d": "M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4" }
15347
- ],
15348
- [
15349
- "path",
15350
- {
15351
- "d": "M5 15v6h1a2 2 0 0 0 2 -2v-2a2 2 0 0 0 -2 -2h-1z"
15352
- }
13166
+ { "d": "M5 15v6h1a2 2 0 0 0 2 -2v-2a2 2 0 0 0 -2 -2h-1z" }
15353
13167
  ],
13168
+
15354
13169
  [
15355
13170
  "path",
15356
- {
15357
- "d": "M20 16.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0"
15358
- }
13171
+ { "d": "M20 16.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0" }
15359
13172
  ],
13173
+
15360
13174
  [
15361
13175
  "path",
13176
+
15362
13177
  {
15363
13178
  "d": "M12.5 15a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1 -3 0v-3a1.5 1.5 0 0 1 1.5 -1.5z"
15364
13179
  }
@@ -15369,6 +13184,7 @@ function File_type_doc($$anchor, $$props) {
15369
13184
  get iconNode() {
15370
13185
  return iconNode;
15371
13186
  },
13187
+
15372
13188
  children: ($$anchor, $$slotProps) => {
15373
13189
  var fragment_1 = comment();
15374
13190
  var node = first_child(fragment_1);
@@ -15376,35 +13192,24 @@ function File_type_doc($$anchor, $$props) {
15376
13192
  slot(node, $$props, 'default', {});
15377
13193
  append($$anchor, fragment_1);
15378
13194
  },
13195
+
15379
13196
  $$slots: { default: true }
15380
13197
  }));
15381
13198
  }
15382
13199
 
15383
13200
  function File_type_pdf($$anchor, $$props) {
15384
- const $$sanitized_props = legacy_rest_props($$props, [
15385
- 'children',
15386
- '$$slots',
15387
- '$$events',
15388
- '$$legacy'
15389
- ]);
13201
+ const $$sanitized_props = legacy_rest_props($$props, ['children', '$$slots', '$$events', '$$legacy']);
15390
13202
 
15391
13203
  const iconNode = [
15392
13204
  ["path", { "d": "M14 3v4a1 1 0 0 0 1 1h4" }],
15393
- [
15394
- "path",
15395
- { "d": "M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4" }
15396
- ],
15397
- [
15398
- "path",
15399
- { "d": "M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6" }
15400
- ],
13205
+ ["path", { "d": "M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4" }],
13206
+ ["path", { "d": "M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6" }],
15401
13207
  ["path", { "d": "M17 18h2" }],
15402
13208
  ["path", { "d": "M20 15h-3v6" }],
13209
+
15403
13210
  [
15404
13211
  "path",
15405
- {
15406
- "d": "M11 15v6h1a2 2 0 0 0 2 -2v-2a2 2 0 0 0 -2 -2h-1z"
15407
- }
13212
+ { "d": "M11 15v6h1a2 2 0 0 0 2 -2v-2a2 2 0 0 0 -2 -2h-1z" }
15408
13213
  ]
15409
13214
  ];
15410
13215
 
@@ -15412,6 +13217,7 @@ function File_type_pdf($$anchor, $$props) {
15412
13217
  get iconNode() {
15413
13218
  return iconNode;
15414
13219
  },
13220
+
15415
13221
  children: ($$anchor, $$slotProps) => {
15416
13222
  var fragment_1 = comment();
15417
13223
  var node = first_child(fragment_1);
@@ -15419,41 +13225,29 @@ function File_type_pdf($$anchor, $$props) {
15419
13225
  slot(node, $$props, 'default', {});
15420
13226
  append($$anchor, fragment_1);
15421
13227
  },
13228
+
15422
13229
  $$slots: { default: true }
15423
13230
  }));
15424
13231
  }
15425
13232
 
15426
13233
  function File_type_ppt($$anchor, $$props) {
15427
- const $$sanitized_props = legacy_rest_props($$props, [
15428
- 'children',
15429
- '$$slots',
15430
- '$$events',
15431
- '$$legacy'
15432
- ]);
13234
+ const $$sanitized_props = legacy_rest_props($$props, ['children', '$$slots', '$$events', '$$legacy']);
15433
13235
 
15434
13236
  const iconNode = [
15435
13237
  ["path", { "d": "M14 3v4a1 1 0 0 0 1 1h4" }],
15436
13238
  ["path", { "d": "M14 3v4a1 1 0 0 0 1 1h4" }],
15437
- [
15438
- "path",
15439
- { "d": "M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6" }
15440
- ],
15441
- [
15442
- "path",
15443
- { "d": "M11 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6" }
15444
- ],
13239
+ ["path", { "d": "M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6" }],
13240
+ ["path", { "d": "M11 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6" }],
15445
13241
  ["path", { "d": "M16.5 15h3" }],
15446
13242
  ["path", { "d": "M18 15v6" }],
15447
- [
15448
- "path",
15449
- { "d": "M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4" }
15450
- ]
13243
+ ["path", { "d": "M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4" }]
15451
13244
  ];
15452
13245
 
15453
13246
  Icon($$anchor, spread_props({ type: 'outline', name: 'file-type-ppt' }, () => $$sanitized_props, {
15454
13247
  get iconNode() {
15455
13248
  return iconNode;
15456
13249
  },
13250
+
15457
13251
  children: ($$anchor, $$slotProps) => {
15458
13252
  var fragment_1 = comment();
15459
13253
  var node = first_child(fragment_1);
@@ -15461,32 +13255,28 @@ function File_type_ppt($$anchor, $$props) {
15461
13255
  slot(node, $$props, 'default', {});
15462
13256
  append($$anchor, fragment_1);
15463
13257
  },
13258
+
15464
13259
  $$slots: { default: true }
15465
13260
  }));
15466
13261
  }
15467
13262
 
15468
13263
  function File_type_xls($$anchor, $$props) {
15469
- const $$sanitized_props = legacy_rest_props($$props, [
15470
- 'children',
15471
- '$$slots',
15472
- '$$events',
15473
- '$$legacy'
15474
- ]);
13264
+ const $$sanitized_props = legacy_rest_props($$props, ['children', '$$slots', '$$events', '$$legacy']);
15475
13265
 
15476
13266
  const iconNode = [
15477
13267
  ["path", { "d": "M14 3v4a1 1 0 0 0 1 1h4" }],
15478
- [
15479
- "path",
15480
- { "d": "M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4" }
15481
- ],
13268
+ ["path", { "d": "M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4" }],
15482
13269
  ["path", { "d": "M4 15l4 6" }],
15483
13270
  ["path", { "d": "M4 21l4 -6" }],
13271
+
15484
13272
  [
15485
13273
  "path",
13274
+
15486
13275
  {
15487
13276
  "d": "M17 20.25c0 .414 .336 .75 .75 .75h1.25a1 1 0 0 0 1 -1v-1a1 1 0 0 0 -1 -1h-1a1 1 0 0 1 -1 -1v-1a1 1 0 0 1 1 -1h1.25a.75 .75 0 0 1 .75 .75"
15488
13277
  }
15489
13278
  ],
13279
+
15490
13280
  ["path", { "d": "M11 15v6h3" }]
15491
13281
  ];
15492
13282
 
@@ -15494,6 +13284,7 @@ function File_type_xls($$anchor, $$props) {
15494
13284
  get iconNode() {
15495
13285
  return iconNode;
15496
13286
  },
13287
+
15497
13288
  children: ($$anchor, $$slotProps) => {
15498
13289
  var fragment_1 = comment();
15499
13290
  var node = first_child(fragment_1);
@@ -15501,31 +13292,31 @@ function File_type_xls($$anchor, $$props) {
15501
13292
  slot(node, $$props, 'default', {});
15502
13293
  append($$anchor, fragment_1);
15503
13294
  },
13295
+
15504
13296
  $$slots: { default: true }
15505
13297
  }));
15506
13298
  }
15507
13299
 
15508
13300
  function Headphones($$anchor, $$props) {
15509
- const $$sanitized_props = legacy_rest_props($$props, [
15510
- 'children',
15511
- '$$slots',
15512
- '$$events',
15513
- '$$legacy'
15514
- ]);
13301
+ const $$sanitized_props = legacy_rest_props($$props, ['children', '$$slots', '$$events', '$$legacy']);
15515
13302
 
15516
13303
  const iconNode = [
15517
13304
  [
15518
13305
  "path",
13306
+
15519
13307
  {
15520
13308
  "d": "M4 13m0 2a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v3a2 2 0 0 1 -2 2h-1a2 2 0 0 1 -2 -2z"
15521
13309
  }
15522
13310
  ],
13311
+
15523
13312
  [
15524
13313
  "path",
13314
+
15525
13315
  {
15526
13316
  "d": "M15 13m0 2a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v3a2 2 0 0 1 -2 2h-1a2 2 0 0 1 -2 -2z"
15527
13317
  }
15528
13318
  ],
13319
+
15529
13320
  ["path", { "d": "M4 15v-3a8 8 0 0 1 16 0v3" }]
15530
13321
  ];
15531
13322
 
@@ -15533,6 +13324,7 @@ function Headphones($$anchor, $$props) {
15533
13324
  get iconNode() {
15534
13325
  return iconNode;
15535
13326
  },
13327
+
15536
13328
  children: ($$anchor, $$slotProps) => {
15537
13329
  var fragment_1 = comment();
15538
13330
  var node = first_child(fragment_1);
@@ -15540,27 +13332,26 @@ function Headphones($$anchor, $$props) {
15540
13332
  slot(node, $$props, 'default', {});
15541
13333
  append($$anchor, fragment_1);
15542
13334
  },
13335
+
15543
13336
  $$slots: { default: true }
15544
13337
  }));
15545
13338
  }
15546
13339
 
15547
13340
  function Video($$anchor, $$props) {
15548
- const $$sanitized_props = legacy_rest_props($$props, [
15549
- 'children',
15550
- '$$slots',
15551
- '$$events',
15552
- '$$legacy'
15553
- ]);
13341
+ const $$sanitized_props = legacy_rest_props($$props, ['children', '$$slots', '$$events', '$$legacy']);
15554
13342
 
15555
13343
  const iconNode = [
15556
13344
  [
15557
13345
  "path",
13346
+
15558
13347
  {
15559
13348
  "d": "M15 10l4.553 -2.276a1 1 0 0 1 1.447 .894v6.764a1 1 0 0 1 -1.447 .894l-4.553 -2.276v-4z"
15560
13349
  }
15561
13350
  ],
13351
+
15562
13352
  [
15563
13353
  "path",
13354
+
15564
13355
  {
15565
13356
  "d": "M3 6m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z"
15566
13357
  }
@@ -15571,6 +13362,7 @@ function Video($$anchor, $$props) {
15571
13362
  get iconNode() {
15572
13363
  return iconNode;
15573
13364
  },
13365
+
15574
13366
  children: ($$anchor, $$slotProps) => {
15575
13367
  var fragment_1 = comment();
15576
13368
  var node = first_child(fragment_1);
@@ -15578,6 +13370,7 @@ function Video($$anchor, $$props) {
15578
13370
  slot(node, $$props, 'default', {});
15579
13371
  append($$anchor, fragment_1);
15580
13372
  },
13373
+
15581
13374
  $$slots: { default: true }
15582
13375
  }));
15583
13376
  }
@@ -15762,7 +13555,29 @@ var root$4 = from_html(`<div class="ctrl svelte-15rcfwg"><div class="pagination
15762
13555
  function File_list($$anchor, $$props) {
15763
13556
  push($$props, false);
15764
13557
 
15765
- const marked = ($$anchor, chars = noop) => {
13558
+ const marked = (
13559
+ $$anchor,
13560
+
13561
+ // On initial mount
13562
+ /**
13563
+ *
13564
+ * @param page
13565
+ */
13566
+ /**
13567
+ *
13568
+ * @param value
13569
+ */
13570
+ /**
13571
+ *
13572
+ * @param path
13573
+ * @param fileSize
13574
+ */
13575
+ /**
13576
+ *
13577
+ * @param callback
13578
+ */
13579
+ chars = noop
13580
+ ) => {
15766
13581
  var fragment = comment();
15767
13582
  var node = first_child(fragment);
15768
13583
 
@@ -15810,11 +13625,7 @@ function File_list($$anchor, $$props) {
15810
13625
 
15811
13626
  if (!isMounted && // On initial mount
15812
13627
  getFileList) {
15813
- const result = await getFileList(fileType(), {
15814
- filter: '',
15815
- page: 0,
15816
- selected: get(selectedPath)
15817
- });
13628
+ const result = await getFileList(fileType(), { filter: '', page: 0, selected: get(selectedPath) });
15818
13629
 
15819
13630
  set(fileList, result.data);
15820
13631
  set(currentPage, result.pagination.current);
@@ -15831,6 +13642,7 @@ function File_list($$anchor, $$props) {
15831
13642
  url: path,
15832
13643
  sizes: {}
15833
13644
  },
13645
+
15834
13646
  ...get(fileList).filter((file) => !file.url.startsWith('blob:'))
15835
13647
  ]);
15836
13648
  }
@@ -15911,12 +13723,7 @@ function File_list($$anchor, $$props) {
15911
13723
  * @param fileSize
15912
13724
  */
15913
13725
  function selectFile(path, fileSize) {
15914
- engine().componentObserver.notify('file-select', {
15915
- path,
15916
- fileSize,
15917
- isEmpty: false,
15918
- isMounted: true
15919
- });
13726
+ engine().componentObserver.notify('file-select', { path, fileSize, isEmpty: false, isMounted: true });
15920
13727
  }
15921
13728
 
15922
13729
  /**
@@ -15964,10 +13771,7 @@ function File_list($$anchor, $$props) {
15964
13771
 
15965
13772
  Thumbnail(node_2, {
15966
13773
  get src() {
15967
- return (
15968
- get(file),
15969
- untrack(() => get(file).url)
15970
- );
13774
+ return (get(file), untrack(() => get(file).url));
15971
13775
  }
15972
13776
  });
15973
13777
 
@@ -16035,6 +13839,7 @@ function File_list($$anchor, $$props) {
16035
13839
  get(file),
16036
13840
  untrack(() => formatDate(get(file).timestamp / 1000, 'YYYY-MM-DD HH:mm'))
16037
13841
  ),
13842
+
16038
13843
  () => (
16039
13844
  deep_read_state(formatByteSize),
16040
13845
  get(file),
@@ -16139,10 +13944,7 @@ function File_uploader($$anchor, $$props) {
16139
13944
  throw new Error(`Failed to upload file: ${file.name}`);
16140
13945
  }
16141
13946
 
16142
- engine().componentObserver.notify('file-listup', {
16143
- fileType: fileType(),
16144
- data: [res.uploaded]
16145
- });
13947
+ engine().componentObserver.notify('file-listup', { fileType: fileType(), data: [res.uploaded] });
16146
13948
 
16147
13949
  engine().componentObserver.notify('file-select', {
16148
13950
  path: res.uploaded.url,
@@ -16262,11 +14064,7 @@ function Preview($$anchor, $$props) {
16262
14064
 
16263
14065
  template_effect(() => {
16264
14066
  set_attribute(source, 'src', get(selectedPath));
16265
-
16266
- set_attribute(source, 'type', (
16267
- get(file),
16268
- untrack(() => `video/${get(file).ext}`)
16269
- ));
14067
+ set_attribute(source, 'type', (get(file), untrack(() => `video/${get(file).ext}`)));
16270
14068
  });
16271
14069
 
16272
14070
  append($$anchor, video_1);
@@ -16280,11 +14078,7 @@ function Preview($$anchor, $$props) {
16280
14078
 
16281
14079
  template_effect(() => {
16282
14080
  set_attribute(source_1, 'src', get(selectedPath));
16283
-
16284
- set_attribute(source_1, 'type', (
16285
- get(file),
16286
- untrack(() => `audio/${get(file).ext}`)
16287
- ));
14081
+ set_attribute(source_1, 'type', (get(file), untrack(() => `audio/${get(file).ext}`)));
16288
14082
  });
16289
14083
 
16290
14084
  append($$anchor, audio);
@@ -16303,10 +14097,7 @@ function Preview($$anchor, $$props) {
16303
14097
  untrack(() => `application/${get(file).ext}`)
16304
14098
  ));
16305
14099
 
16306
- set_attribute(object, 'title', (
16307
- get(file),
16308
- untrack(() => `${get(file).ext}ファイルのプレビュー`)
16309
- ));
14100
+ set_attribute(object, 'title', (get(file), untrack(() => `${get(file).ext}ファイルのプレビュー`)));
16310
14101
  });
16311
14102
 
16312
14103
  append($$anchor, object);
@@ -16334,10 +14125,7 @@ function Preview($$anchor, $$props) {
16334
14125
  if_block(
16335
14126
  $$anchor,
16336
14127
  ($$render) => {
16337
- if ((
16338
- get(file),
16339
- untrack(() => get(file)?.isAudio)
16340
- )) $$render(consequent_2); else $$render(alternate_2, false);
14128
+ if ((get(file), untrack(() => get(file)?.isAudio))) $$render(consequent_2); else $$render(alternate_2, false);
16341
14129
  },
16342
14130
  $$elseif
16343
14131
  );
@@ -16347,10 +14135,7 @@ function Preview($$anchor, $$props) {
16347
14135
  if_block(
16348
14136
  $$anchor,
16349
14137
  ($$render) => {
16350
- if ((
16351
- get(file),
16352
- untrack(() => get(file)?.isVideo)
16353
- )) $$render(consequent_1); else $$render(alternate_1, false);
14138
+ if ((get(file), untrack(() => get(file)?.isVideo))) $$render(consequent_1); else $$render(alternate_1, false);
16354
14139
  },
16355
14140
  $$elseif
16356
14141
  );
@@ -16358,10 +14143,7 @@ function Preview($$anchor, $$props) {
16358
14143
  };
16359
14144
 
16360
14145
  if_block(node, ($$render) => {
16361
- if ((
16362
- get(file),
16363
- untrack(() => get(file)?.isImage)
16364
- )) $$render(consequent); else $$render(alternate, false);
14146
+ if ((get(file), untrack(() => get(file)?.isImage))) $$render(consequent); else $$render(alternate, false);
16365
14147
  });
16366
14148
  }
16367
14149
 
@@ -16372,9 +14154,13 @@ function Preview($$anchor, $$props) {
16372
14154
  var div_2 = root_9();
16373
14155
  let styles;
16374
14156
 
16375
- template_effect(() => styles = set_style(div_2, '', styles, {
16376
- translate: `${get(uploaded) / get(total) * 100}%`
16377
- }));
14157
+ template_effect(
14158
+ ($0) => styles = set_style(div_2, '', styles, $0),
14159
+ [
14160
+ () => ({ translate: `${get(uploaded) / get(total) * 100}%` })
14161
+ ],
14162
+ derived_safe_equal
14163
+ );
16378
14164
 
16379
14165
  append($$anchor, div_2);
16380
14166
  };
@@ -16444,15 +14230,7 @@ function Preview($$anchor, $$props) {
16444
14230
  )) $$render(consequent_6);
16445
14231
  });
16446
14232
  }
16447
-
16448
- template_effect(
16449
- ($0) => classes = set_class(div_1, 1, 'img svelte-1ie51m5', null, classes, $0),
16450
- [
16451
- () => ({ uploading: get(isUploadingMode) })
16452
- ],
16453
- derived_safe_equal
16454
- );
16455
-
14233
+ template_effect(($0) => classes = set_class(div_1, 1, 'img svelte-1ie51m5', null, classes, $0), [() => ({ uploading: get(isUploadingMode) })], derived_safe_equal);
16456
14234
  append($$anchor, div);
16457
14235
  pop();
16458
14236
  }
@@ -16467,12 +14245,7 @@ function svelteMount(component, options) {
16467
14245
  }
16468
14246
 
16469
14247
  function Arrows_transfer_down($$anchor, $$props) {
16470
- const $$sanitized_props = legacy_rest_props($$props, [
16471
- 'children',
16472
- '$$slots',
16473
- '$$events',
16474
- '$$legacy'
16475
- ]);
14248
+ const $$sanitized_props = legacy_rest_props($$props, ['children', '$$slots', '$$events', '$$legacy']);
16476
14249
 
16477
14250
  const iconNode = [
16478
14251
  ["path", { "d": "M17 3v6" }],
@@ -16487,6 +14260,7 @@ function Arrows_transfer_down($$anchor, $$props) {
16487
14260
  get iconNode() {
16488
14261
  return iconNode;
16489
14262
  },
14263
+
16490
14264
  children: ($$anchor, $$slotProps) => {
16491
14265
  var fragment_1 = comment();
16492
14266
  var node = first_child(fragment_1);
@@ -16494,6 +14268,7 @@ function Arrows_transfer_down($$anchor, $$props) {
16494
14268
  slot(node, $$props, 'default', {});
16495
14269
  append($$anchor, fragment_1);
16496
14270
  },
14271
+
16497
14272
  $$slots: { default: true }
16498
14273
  }));
16499
14274
  }
@@ -16614,10 +14389,7 @@ function Table_editor($$anchor, $$props) {
16614
14389
  Arrows_transfer_down(node_2, { class: 'icon' });
16615
14390
 
16616
14391
  template_effect(() => {
16617
- button_1.disabled = (
16618
- get(table),
16619
- untrack(() => get(table).length === 1)
16620
- );
14392
+ button_1.disabled = (get(table), untrack(() => get(table).length === 1));
16621
14393
 
16622
14394
  button_2.disabled = (
16623
14395
  get(table),
@@ -16644,18 +14416,10 @@ function Table_editor($$anchor, $$props) {
16644
14416
  delegate(['input', 'click']);
16645
14417
 
16646
14418
  function Circle_plus($$anchor, $$props) {
16647
- const $$sanitized_props = legacy_rest_props($$props, [
16648
- 'children',
16649
- '$$slots',
16650
- '$$events',
16651
- '$$legacy'
16652
- ]);
14419
+ const $$sanitized_props = legacy_rest_props($$props, ['children', '$$slots', '$$events', '$$legacy']);
16653
14420
 
16654
14421
  const iconNode = [
16655
- [
16656
- "path",
16657
- { "d": "M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0" }
16658
- ],
14422
+ ["path", { "d": "M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0" }],
16659
14423
  ["path", { "d": "M9 12h6" }],
16660
14424
  ["path", { "d": "M12 9v6" }]
16661
14425
  ];
@@ -16664,6 +14428,7 @@ function Circle_plus($$anchor, $$props) {
16664
14428
  get iconNode() {
16665
14429
  return iconNode;
16666
14430
  },
14431
+
16667
14432
  children: ($$anchor, $$slotProps) => {
16668
14433
  var fragment_1 = comment();
16669
14434
  var node = first_child(fragment_1);
@@ -16671,6 +14436,7 @@ function Circle_plus($$anchor, $$props) {
16671
14436
  slot(node, $$props, 'default', {});
16672
14437
  append($$anchor, fragment_1);
16673
14438
  },
14439
+
16674
14440
  $$slots: { default: true }
16675
14441
  }));
16676
14442
  }
@@ -16685,7 +14451,16 @@ const onKeyDown = (event, update, currentIndex, length) => {
16685
14451
  }
16686
14452
  };
16687
14453
 
16688
- var on_click = (__1, onClick, index) => onClick(get(index));
14454
+ var on_click = /**
14455
+ *
14456
+ * @param index
14457
+ */
14458
+ /**
14459
+ *
14460
+ * @param index
14461
+ */
14462
+ (__1, onClick, index) => onClick(get(index));
14463
+
16689
14464
  var root_1 = from_html(`<button type="button" role="tab" class="svelte-2oedib"> </button>`);
16690
14465
  var on_click_1 = () => {};
16691
14466
  var root = from_html(`<div role="tablist" class="svelte-2oedib"><!> <button class="add-tab svelte-2oedib" type="button" title="タブを追加"><!></button></div>`);
@@ -16741,41 +14516,30 @@ function Tabs($$anchor, $$props) {
16741
14516
  var div = root();
16742
14517
  var node = child(div);
16743
14518
 
16744
- each(
16745
- node,
16746
- 1,
16747
- () => (
16748
- untrack(() => Array.from({ length }, (_, index) => index))
16749
- ),
16750
- (index) => index,
16751
- ($$anchor, index) => {
16752
- var button = root_1();
14519
+ each(node, 1, () => (untrack(() => Array.from({ length }, (_, index) => index))), (index) => index, ($$anchor, index) => {
14520
+ var button = root_1();
16753
14521
 
16754
- button.__click = [on_click, onClick, index];
16755
- button.__keydown = [onKeyDown, update, currentIndex, length];
14522
+ button.__click = [on_click, onClick, index];
14523
+ button.__keydown = [onKeyDown, update, currentIndex, length];
16756
14524
 
16757
- var text = child(button);
16758
- bind_this(button, ($$value, index) => mutate(refs, get(refs)[index] = $$value), (index) => get(refs)?.[index], () => [get(index)]);
14525
+ var text = child(button);
14526
+ bind_this(button, ($$value, index) => mutate(refs, get(refs)[index] = $$value), (index) => get(refs)?.[index], () => [get(index)]);
16759
14527
 
16760
- template_effect(
16761
- ($0) => {
16762
- set_attribute(button, 'aria-controls', contentId());
16763
- set_attribute(button, 'aria-selected', get(currentIndex) === get(index));
16764
- set_attribute(button, 'tabindex', get(currentIndex) === get(index) ? 0 : -1);
16765
- set_text(text, $0);
16766
- },
16767
- [
16768
- () => (
16769
- get(index),
16770
- untrack(() => createLabel(get(index)))
16771
- )
16772
- ],
16773
- derived_safe_equal
16774
- );
14528
+ template_effect(
14529
+ ($0) => {
14530
+ set_attribute(button, 'aria-controls', contentId());
14531
+ set_attribute(button, 'aria-selected', get(currentIndex) === get(index));
14532
+ set_attribute(button, 'tabindex', get(currentIndex) === get(index) ? 0 : -1);
14533
+ set_text(text, $0);
14534
+ },
14535
+ [
14536
+ () => (get(index), untrack(() => createLabel(get(index))))
14537
+ ],
14538
+ derived_safe_equal
14539
+ );
16775
14540
 
16776
- append($$anchor, button);
16777
- }
16778
- );
14541
+ append($$anchor, button);
14542
+ });
16779
14543
 
16780
14544
  var button_1 = sibling(node, 2);
16781
14545
 
@@ -16827,7 +14591,7 @@ function parseConfig(config) {
16827
14591
  }
16828
14592
  }
16829
14593
 
16830
- const version = "4.0.0-alpha.4";
14594
+ const version = "4.0.0-alpha.6";
16831
14595
  function attachDraftSwitcher(engine) {
16832
14596
  if (engine.hasDraft()) {
16833
14597
  const container = document.createElement("div");