aibox-custom-component-packages 0.0.13 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/es/SourcePublish.mjs +1 -1
  2. package/es/assets/SourcePublish.css +1 -1
  3. package/es/chunks/{SourcePublish.BhLjt18i.js → SourcePublish.Dk7O9GzI.js} +2 -6
  4. package/es/index.mjs +1 -1
  5. package/lib/SourcePublish.js +1 -1
  6. package/lib/assets/SourcePublish.css +1 -1
  7. package/lib/chunks/SourcePublish.OeB6i-Iu.js +1 -0
  8. package/lib/index.js +1 -1
  9. package/package.json +2 -2
  10. package/es/chunks/AddOrEditSupplierDialog.BKR0RsiJ.js +0 -721
  11. package/es/chunks/AddOrEditSupplierDialog.CjNRipPe.js +0 -721
  12. package/es/chunks/AddOrEditSupplierDialog.CnsquSx2.js +0 -721
  13. package/es/chunks/AiboxTable.CDqNvRfJ.js +0 -635
  14. package/es/chunks/AiboxTable.CrWMAX84.js +0 -635
  15. package/es/chunks/ApplicationTypeTag.Cbdi0D65.js +0 -47
  16. package/es/chunks/ApplicationTypeTag.Df4BZxds.js +0 -47
  17. package/es/chunks/AuthSection.DFfj5MtZ.js +0 -201
  18. package/es/chunks/AuthSection.DWD_FxtJ.js +0 -201
  19. package/es/chunks/AvailableRangePreview.Bz9QkkAM.js +0 -194
  20. package/es/chunks/AvailableRangePreview.WFzbRasx.js +0 -194
  21. package/es/chunks/AvailableRangeSetting.Bq_K1zar.js +0 -229
  22. package/es/chunks/AvailableRangeSetting.Cty5Cdmh.js +0 -229
  23. package/es/chunks/CodeView.CWuSIL_F.js +0 -148
  24. package/es/chunks/CodeView.Dhxe1PQP.js +0 -148
  25. package/es/chunks/CommonTagsList.DSPdgjc3.js +0 -156
  26. package/es/chunks/CommonTagsList.NbXVfvLW.js +0 -156
  27. package/es/chunks/CommonTagsList.qam_Fp76.js +0 -156
  28. package/es/chunks/CreateMcpForm.BBVVd2RN.js +0 -308
  29. package/es/chunks/CreateMcpForm.BWUyeP01.js +0 -308
  30. package/es/chunks/CreateMcpForm.C8YfDSEM.js +0 -308
  31. package/es/chunks/CreateMcpForm.DSE5jyiW.js +0 -308
  32. package/es/chunks/CustomSidebar.BSGAhmVY.js +0 -585
  33. package/es/chunks/DocSyncSelect.D-WIvZZN.js +0 -2290
  34. package/es/chunks/DocSyncSelect.Kk88o9gO.js +0 -2290
  35. package/es/chunks/FileDisplay.B5laA4uX.js +0 -1649
  36. package/es/chunks/FileDisplay.BCTNdpl9.js +0 -1649
  37. package/es/chunks/FileDisplay.CBNYrdsK.js +0 -1560
  38. package/es/chunks/FilePreview.B9u8ODHp.js +0 -123
  39. package/es/chunks/FileUploader.BaikPGWb.js +0 -216
  40. package/es/chunks/FileUploader.DD-lopf-.js +0 -216
  41. package/es/chunks/McpFormDialog.4HDExbTn.js +0 -297
  42. package/es/chunks/McpFormDialog.CgnC1I7i.js +0 -297
  43. package/es/chunks/McpFormDialog.D3txmoEF.js +0 -297
  44. package/es/chunks/McpFormDialog.DNzqqhaX.js +0 -297
  45. package/es/chunks/McpParamsSet.DlWx6E5S.js +0 -501
  46. package/es/chunks/McpParamsSet.Tlo_lPn-.js +0 -501
  47. package/es/chunks/MdEditor.B9-B9aiy.js +0 -163
  48. package/es/chunks/MdEditor.CeEo0P6j.js +0 -163
  49. package/es/chunks/MdEditor.DtL0Se7T.js +0 -163
  50. package/es/chunks/ParameterTable.BCdnj1gW.js +0 -2010
  51. package/es/chunks/ParameterTable.hUsxEU6F.js +0 -2010
  52. package/es/chunks/PublishRecord.9PLs9yUj.js +0 -133
  53. package/es/chunks/PublishRecord.C0841sJ-.js +0 -133
  54. package/es/chunks/PublishRecord.DEzC7hmP.js +0 -133
  55. package/es/chunks/SourcePublish.C97G36H2.js +0 -972
  56. package/es/chunks/SourcePublish.DkyY1KEk.js +0 -972
  57. package/es/chunks/SourcePublish.Dx-ltk9U.js +0 -956
  58. package/es/chunks/SourcePublish.FiswtYfr.js +0 -972
  59. package/es/chunks/SourcePublish.nfXmrVHm.js +0 -972
  60. package/es/chunks/config.BEZNFeRN.js +0 -35
  61. package/es/chunks/config.LzgBLhTz.js +0 -270
  62. package/es/chunks/config.MfNKPMiA.js +0 -35
  63. package/es/chunks/config.TaUlPTYL.js +0 -270
  64. package/es/chunks/config.l1J_qxeB.js +0 -270
  65. package/es/chunks/i18n.CIjLjyDK.js +0 -418
  66. package/es/chunks/i18n.CxsxtRq_.js +0 -418
  67. package/es/chunks/usePreview.agdxmOk8.js +0 -126
  68. package/lib/chunks/AddOrEditSupplierDialog.D0DSQZiS.js +0 -1
  69. package/lib/chunks/CommonTagsList.DbNcVId5.js +0 -1
  70. package/lib/chunks/CreateMcpForm.Cm9eHXWg.js +0 -1
  71. package/lib/chunks/CreateMcpForm.DNijYbgd.js +0 -1
  72. package/lib/chunks/CustomSidebar.Dojb1xoS.js +0 -1
  73. package/lib/chunks/FileDisplay.B4gn0Jhp.js +0 -59
  74. package/lib/chunks/FileDisplay.B7JWIcFg.js +0 -59
  75. package/lib/chunks/FileDisplay.DjtHza32.js +0 -59
  76. package/lib/chunks/FilePreview.b1Gine59.js +0 -1
  77. package/lib/chunks/McpFormDialog.BgNPOGB-.js +0 -6
  78. package/lib/chunks/McpFormDialog.CL2bInts.js +0 -6
  79. package/lib/chunks/McpFormDialog.DbhQIwYW.js +0 -6
  80. package/lib/chunks/MdEditor.rVQbuxCg.js +0 -1
  81. package/lib/chunks/PublishRecord.B7xYlRKJ.js +0 -5
  82. package/lib/chunks/SourcePublish.BBsNlnp4.js +0 -1
  83. package/lib/chunks/SourcePublish.C9JAqJcV.js +0 -1
  84. package/lib/chunks/SourcePublish.CpeV-UOG.js +0 -1
  85. package/lib/chunks/SourcePublish.K4tntn9l.js +0 -1
  86. package/lib/chunks/SourcePublish.tNsaCp3r.js +0 -1
  87. package/lib/chunks/config.CDNV0bUm.js +0 -1
  88. package/lib/chunks/usePreview.Dmhz8azZ.js +0 -1
@@ -1,1560 +0,0 @@
1
- import { h as e, o as t, t as n } from "./usePreview.agdxmOk8.js";
2
- import { t as r } from "./_plugin-vue_export-helper.Ct3qlEzt.js";
3
- import { Fragment as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, openBlock as d, ref as f, renderList as p, resolveDirective as ee, resolveDynamicComponent as te, toDisplayString as ne, unref as m, withCtx as h, withDirectives as re } from "vue";
4
- import { ElIcon as g, ElImage as ie } from "element-plus";
5
- import { Error as ae } from "color-message-aibox-vue";
6
- import '../assets/FileDisplay.css';//#region ../../../node_modules/.pnpm/marked@17.0.1/node_modules/marked/lib/marked.esm.js
7
- function _() {
8
- return {
9
- async: !1,
10
- breaks: !1,
11
- extensions: null,
12
- gfm: !0,
13
- hooks: null,
14
- pedantic: !1,
15
- renderer: null,
16
- silent: !1,
17
- tokenizer: null,
18
- walkTokens: null
19
- };
20
- }
21
- var v = _();
22
- function y(e) {
23
- v = e;
24
- }
25
- var b = { exec: () => null };
26
- function x(e, t = "") {
27
- let n = typeof e == "string" ? e : e.source, r = {
28
- replace: (e, t) => {
29
- let i = typeof t == "string" ? t : t.source;
30
- return i = i.replace(S.caret, "$1"), n = n.replace(e, i), r;
31
- },
32
- getRegex: () => new RegExp(n, t)
33
- };
34
- return r;
35
- }
36
- var oe = (() => {
37
- try {
38
- return !0;
39
- } catch {
40
- return !1;
41
- }
42
- })(), S = {
43
- codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
44
- outputLinkReplace: /\\([\[\]])/g,
45
- indentCodeCompensation: /^(\s+)(?:```)/,
46
- beginningSpace: /^\s+/,
47
- endingHash: /#$/,
48
- startingSpaceChar: /^ /,
49
- endingSpaceChar: / $/,
50
- nonSpaceChar: /[^ ]/,
51
- newLineCharGlobal: /\n/g,
52
- tabCharGlobal: /\t/g,
53
- multipleSpaceGlobal: /\s+/g,
54
- blankLine: /^[ \t]*$/,
55
- doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
56
- blockquoteStart: /^ {0,3}>/,
57
- blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
58
- blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
59
- listReplaceTabs: /^\t+/,
60
- listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
61
- listIsTask: /^\[[ xX]\] +\S/,
62
- listReplaceTask: /^\[[ xX]\] +/,
63
- listTaskCheckbox: /\[[ xX]\]/,
64
- anyLine: /\n.*\n/,
65
- hrefBrackets: /^<(.*)>$/,
66
- tableDelimiter: /[:|]/,
67
- tableAlignChars: /^\||\| *$/g,
68
- tableRowBlankLine: /\n[ \t]*$/,
69
- tableAlignRight: /^ *-+: *$/,
70
- tableAlignCenter: /^ *:-+: *$/,
71
- tableAlignLeft: /^ *:-+ *$/,
72
- startATag: /^<a /i,
73
- endATag: /^<\/a>/i,
74
- startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
75
- endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
76
- startAngleBracket: /^</,
77
- endAngleBracket: />$/,
78
- pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
79
- unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
80
- escapeTest: /[&<>"']/,
81
- escapeReplace: /[&<>"']/g,
82
- escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
83
- escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
84
- unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,
85
- caret: /(^|[^\[])\^/g,
86
- percentDecode: /%25/g,
87
- findPipe: /\|/g,
88
- splitPipe: / \|/,
89
- slashPipe: /\\\|/g,
90
- carriageReturn: /\r\n|\r/g,
91
- spaceLine: /^ +$/gm,
92
- notSpaceStart: /^\S*/,
93
- endingNewline: /\n$/,
94
- listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
95
- nextBulletRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),
96
- hrRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),
97
- fencesBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}(?:\`\`\`|~~~)`),
98
- headingBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}#`),
99
- htmlBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}<(?:[a-z].*>|!--)`, "i")
100
- }, se = /^(?:[ \t]*(?:\n|$))+/, ce = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, le = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, C = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ue = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, w = /(?:[*+-]|\d{1,9}[.)])/, de = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, fe = x(de).replace(/bull/g, w).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(), pe = x(de).replace(/bull/g, w).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(), T = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, me = /^[^\n]+/, E = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, he = x(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", E).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), ge = x(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, w).getRegex(), D = "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", O = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, _e = x("^ {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", O).replace("tag", D).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ve = x(T).replace("hr", C).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", D).getRegex(), k = {
101
- blockquote: x(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ve).getRegex(),
102
- code: ce,
103
- def: he,
104
- fences: le,
105
- heading: ue,
106
- hr: C,
107
- html: _e,
108
- lheading: fe,
109
- list: ge,
110
- newline: se,
111
- paragraph: ve,
112
- table: b,
113
- text: me
114
- }, A = x("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", C).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", D).getRegex(), ye = {
115
- ...k,
116
- lheading: pe,
117
- table: A,
118
- paragraph: x(T).replace("hr", C).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", A).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", D).getRegex()
119
- }, be = {
120
- ...k,
121
- html: x("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", O).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(),
122
- def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
123
- heading: /^(#{1,6})(.*)(?:\n+|$)/,
124
- fences: b,
125
- lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
126
- paragraph: x(T).replace("hr", C).replace("heading", " *#{1,6} *[^\n]").replace("lheading", fe).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
127
- }, xe = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Se = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, j = /^( {2,}|\\)\n(?!\s*$)/, Ce = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, M = /[\p{P}\p{S}]/u, N = /[\s\p{P}\p{S}]/u, P = /[^\s\p{P}\p{S}]/u, we = x(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, N).getRegex(), F = /(?!~)[\p{P}\p{S}]/u, Te = /(?!~)[\s\p{P}\p{S}]/u, Ee = /(?:[^\s\p{P}\p{S}]|~)/u, De = x(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", oe ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), I = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Oe = x(I, "u").replace(/punct/g, M).getRegex(), ke = x(I, "u").replace(/punct/g, F).getRegex(), L = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ae = x(L, "gu").replace(/notPunctSpace/g, P).replace(/punctSpace/g, N).replace(/punct/g, M).getRegex(), je = x(L, "gu").replace(/notPunctSpace/g, Ee).replace(/punctSpace/g, Te).replace(/punct/g, F).getRegex(), Me = x("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, P).replace(/punctSpace/g, N).replace(/punct/g, M).getRegex(), Ne = x(/\\(punct)/, "gu").replace(/punct/g, M).getRegex(), Pe = x(/^<(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(), Fe = x(O).replace("(?:-->|$)", "-->").getRegex(), Ie = x("^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", Fe).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), R = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, Le = x(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", R).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Re = x(/^!?\[(label)\]\[(ref)\]/).replace("label", R).replace("ref", E).getRegex(), ze = x(/^!?\[(ref)\](?:\[\])?/).replace("ref", E).getRegex(), Be = x("reflink|nolink(?!\\()", "g").replace("reflink", Re).replace("nolink", ze).getRegex(), Ve = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, z = {
128
- _backpedal: b,
129
- anyPunctuation: Ne,
130
- autolink: Pe,
131
- blockSkip: De,
132
- br: j,
133
- code: Se,
134
- del: b,
135
- emStrongLDelim: Oe,
136
- emStrongRDelimAst: Ae,
137
- emStrongRDelimUnd: Me,
138
- escape: xe,
139
- link: Le,
140
- nolink: ze,
141
- punctuation: we,
142
- reflink: Re,
143
- reflinkSearch: Be,
144
- tag: Ie,
145
- text: Ce,
146
- url: b
147
- }, He = {
148
- ...z,
149
- link: x(/^!?\[(label)\]\((.*?)\)/).replace("label", R).getRegex(),
150
- reflink: x(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", R).getRegex()
151
- }, B = {
152
- ...z,
153
- emStrongRDelimAst: je,
154
- emStrongLDelim: ke,
155
- url: x(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Ve).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
156
- _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
157
- del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
158
- text: x(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Ve).getRegex()
159
- }, Ue = {
160
- ...B,
161
- br: x(j).replace("{2,}", "*").getRegex(),
162
- text: x(B.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
163
- }, V = {
164
- normal: k,
165
- gfm: ye,
166
- pedantic: be
167
- }, H = {
168
- normal: z,
169
- gfm: B,
170
- breaks: Ue,
171
- pedantic: He
172
- }, We = {
173
- "&": "&amp;",
174
- "<": "&lt;",
175
- ">": "&gt;",
176
- "\"": "&quot;",
177
- "'": "&#39;"
178
- }, Ge = (e) => We[e];
179
- function U(e, t) {
180
- if (t) {
181
- if (S.escapeTest.test(e)) return e.replace(S.escapeReplace, Ge);
182
- } else if (S.escapeTestNoEncode.test(e)) return e.replace(S.escapeReplaceNoEncode, Ge);
183
- return e;
184
- }
185
- function Ke(e) {
186
- try {
187
- e = encodeURI(e).replace(S.percentDecode, "%");
188
- } catch {
189
- return null;
190
- }
191
- return e;
192
- }
193
- function qe(e, t) {
194
- let n = e.replace(S.findPipe, (e, t, n) => {
195
- let r = !1, i = t;
196
- for (; --i >= 0 && n[i] === "\\";) r = !r;
197
- return r ? "|" : " |";
198
- }).split(S.splitPipe), r = 0;
199
- if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) if (n.length > t) n.splice(t);
200
- else for (; n.length < t;) n.push("");
201
- for (; r < n.length; r++) n[r] = n[r].trim().replace(S.slashPipe, "|");
202
- return n;
203
- }
204
- function W(e, t, n) {
205
- let r = e.length;
206
- if (r === 0) return "";
207
- let i = 0;
208
- for (; i < r;) {
209
- let a = e.charAt(r - i - 1);
210
- if (a === t && !n) i++;
211
- else if (a !== t && n) i++;
212
- else break;
213
- }
214
- return e.slice(0, r - i);
215
- }
216
- function Je(e, t) {
217
- if (e.indexOf(t[1]) === -1) return -1;
218
- let n = 0;
219
- for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
220
- else if (e[r] === t[0]) n++;
221
- else if (e[r] === t[1] && (n--, n < 0)) return r;
222
- return n > 0 ? -2 : -1;
223
- }
224
- function Ye(e, t, n, r, i) {
225
- let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1");
226
- r.state.inLink = !0;
227
- let c = {
228
- type: e[0].charAt(0) === "!" ? "image" : "link",
229
- raw: n,
230
- href: a,
231
- title: o,
232
- text: s,
233
- tokens: r.inlineTokens(s)
234
- };
235
- return r.state.inLink = !1, c;
236
- }
237
- function Xe(e, t, n) {
238
- let r = e.match(n.other.indentCodeCompensation);
239
- if (r === null) return t;
240
- let i = r[1];
241
- return t.split("\n").map((e) => {
242
- let t = e.match(n.other.beginningSpace);
243
- if (t === null) return e;
244
- let [r] = t;
245
- return r.length >= i.length ? e.slice(i.length) : e;
246
- }).join("\n");
247
- }
248
- var G = class {
249
- options;
250
- rules;
251
- lexer;
252
- constructor(e) {
253
- this.options = e || v;
254
- }
255
- space(e) {
256
- let t = this.rules.block.newline.exec(e);
257
- if (t && t[0].length > 0) return {
258
- type: "space",
259
- raw: t[0]
260
- };
261
- }
262
- code(e) {
263
- let t = this.rules.block.code.exec(e);
264
- if (t) {
265
- let e = t[0].replace(this.rules.other.codeRemoveIndent, "");
266
- return {
267
- type: "code",
268
- raw: t[0],
269
- codeBlockStyle: "indented",
270
- text: this.options.pedantic ? e : W(e, "\n")
271
- };
272
- }
273
- }
274
- fences(e) {
275
- let t = this.rules.block.fences.exec(e);
276
- if (t) {
277
- let e = t[0], n = Xe(e, t[3] || "", this.rules);
278
- return {
279
- type: "code",
280
- raw: e,
281
- lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
282
- text: n
283
- };
284
- }
285
- }
286
- heading(e) {
287
- let t = this.rules.block.heading.exec(e);
288
- if (t) {
289
- let e = t[2].trim();
290
- if (this.rules.other.endingHash.test(e)) {
291
- let t = W(e, "#");
292
- (this.options.pedantic || !t || this.rules.other.endingSpaceChar.test(t)) && (e = t.trim());
293
- }
294
- return {
295
- type: "heading",
296
- raw: t[0],
297
- depth: t[1].length,
298
- text: e,
299
- tokens: this.lexer.inline(e)
300
- };
301
- }
302
- }
303
- hr(e) {
304
- let t = this.rules.block.hr.exec(e);
305
- if (t) return {
306
- type: "hr",
307
- raw: W(t[0], "\n")
308
- };
309
- }
310
- blockquote(e) {
311
- let t = this.rules.block.blockquote.exec(e);
312
- if (t) {
313
- let e = W(t[0], "\n").split("\n"), n = "", r = "", i = [];
314
- for (; e.length > 0;) {
315
- let t = !1, a = [], o;
316
- for (o = 0; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
317
- else if (!t) a.push(e[o]);
318
- else break;
319
- e = e.slice(o);
320
- let s = a.join("\n"), c = s.replace(this.rules.other.blockquoteSetextReplace, "\n $1").replace(this.rules.other.blockquoteSetextReplace2, "");
321
- n = n ? `${n}
322
- ${s}` : s, r = r ? `${r}
323
- ${c}` : c;
324
- let l = this.lexer.state.top;
325
- if (this.lexer.state.top = !0, this.lexer.blockTokens(c, i, !0), this.lexer.state.top = l, e.length === 0) break;
326
- let u = i.at(-1);
327
- if (u?.type === "code") break;
328
- if (u?.type === "blockquote") {
329
- let t = u, a = t.raw + "\n" + e.join("\n"), o = this.blockquote(a);
330
- i[i.length - 1] = o, n = n.substring(0, n.length - t.raw.length) + o.raw, r = r.substring(0, r.length - t.text.length) + o.text;
331
- break;
332
- } else if (u?.type === "list") {
333
- let t = u, a = t.raw + "\n" + e.join("\n"), o = this.list(a);
334
- i[i.length - 1] = o, n = n.substring(0, n.length - u.raw.length) + o.raw, r = r.substring(0, r.length - t.raw.length) + o.raw, e = a.substring(i.at(-1).raw.length).split("\n");
335
- continue;
336
- }
337
- }
338
- return {
339
- type: "blockquote",
340
- raw: n,
341
- tokens: i,
342
- text: r
343
- };
344
- }
345
- }
346
- list(e) {
347
- let t = this.rules.block.list.exec(e);
348
- if (t) {
349
- let n = t[1].trim(), r = n.length > 1, i = {
350
- type: "list",
351
- raw: "",
352
- ordered: r,
353
- start: r ? +n.slice(0, -1) : "",
354
- loose: !1,
355
- items: []
356
- };
357
- n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
358
- let a = this.rules.other.listItemRegex(n), o = !1;
359
- for (; e;) {
360
- let n = !1, r = "", s = "";
361
- if (!(t = a.exec(e)) || this.rules.block.hr.test(e)) break;
362
- r = t[0], e = e.substring(r.length);
363
- let c = t[2].split("\n", 1)[0].replace(this.rules.other.listReplaceTabs, (e) => " ".repeat(3 * e.length)), l = e.split("\n", 1)[0], u = !c.trim(), d = 0;
364
- if (this.options.pedantic ? (d = 2, s = c.trimStart()) : u ? d = t[1].length + 1 : (d = t[2].search(this.rules.other.nonSpaceChar), d = d > 4 ? 1 : d, s = c.slice(d), d += t[1].length), u && this.rules.other.blankLine.test(l) && (r += l + "\n", e = e.substring(l.length + 1), n = !0), !n) {
365
- let t = this.rules.other.nextBulletRegex(d), n = this.rules.other.hrRegex(d), i = this.rules.other.fencesBeginRegex(d), a = this.rules.other.headingBeginRegex(d), o = this.rules.other.htmlBeginRegex(d);
366
- for (; e;) {
367
- let f = e.split("\n", 1)[0], p;
368
- if (l = f, this.options.pedantic ? (l = l.replace(this.rules.other.listReplaceNesting, " "), p = l) : p = l.replace(this.rules.other.tabCharGlobal, " "), i.test(l) || a.test(l) || o.test(l) || t.test(l) || n.test(l)) break;
369
- if (p.search(this.rules.other.nonSpaceChar) >= d || !l.trim()) s += "\n" + p.slice(d);
370
- else {
371
- if (u || c.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || i.test(c) || a.test(c) || n.test(c)) break;
372
- s += "\n" + l;
373
- }
374
- !u && !l.trim() && (u = !0), r += f + "\n", e = e.substring(f.length + 1), c = p.slice(d);
375
- }
376
- }
377
- i.loose || (o ? i.loose = !0 : this.rules.other.doubleBlankLine.test(r) && (o = !0)), i.items.push({
378
- type: "list_item",
379
- raw: r,
380
- task: !!this.options.gfm && this.rules.other.listIsTask.test(s),
381
- loose: !1,
382
- text: s,
383
- tokens: []
384
- }), i.raw += r;
385
- }
386
- let s = i.items.at(-1);
387
- if (s) s.raw = s.raw.trimEnd(), s.text = s.text.trimEnd();
388
- else return;
389
- i.raw = i.raw.trimEnd();
390
- for (let e of i.items) {
391
- if (this.lexer.state.top = !1, e.tokens = this.lexer.blockTokens(e.text, []), e.task) {
392
- if (e.text = e.text.replace(this.rules.other.listReplaceTask, ""), e.tokens[0]?.type === "text" || e.tokens[0]?.type === "paragraph") {
393
- e.tokens[0].raw = e.tokens[0].raw.replace(this.rules.other.listReplaceTask, ""), e.tokens[0].text = e.tokens[0].text.replace(this.rules.other.listReplaceTask, "");
394
- for (let e = this.lexer.inlineQueue.length - 1; e >= 0; e--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)) {
395
- this.lexer.inlineQueue[e].src = this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask, "");
396
- break;
397
- }
398
- }
399
- let t = this.rules.other.listTaskCheckbox.exec(e.raw);
400
- if (t) {
401
- let n = {
402
- type: "checkbox",
403
- raw: t[0] + " ",
404
- checked: t[0] !== "[ ]"
405
- };
406
- e.checked = n.checked, i.loose ? e.tokens[0] && ["paragraph", "text"].includes(e.tokens[0].type) && "tokens" in e.tokens[0] && e.tokens[0].tokens ? (e.tokens[0].raw = n.raw + e.tokens[0].raw, e.tokens[0].text = n.raw + e.tokens[0].text, e.tokens[0].tokens.unshift(n)) : e.tokens.unshift({
407
- type: "paragraph",
408
- raw: n.raw,
409
- text: n.raw,
410
- tokens: [n]
411
- }) : e.tokens.unshift(n);
412
- }
413
- }
414
- if (!i.loose) {
415
- let t = e.tokens.filter((e) => e.type === "space");
416
- i.loose = t.length > 0 && t.some((e) => this.rules.other.anyLine.test(e.raw));
417
- }
418
- }
419
- if (i.loose) for (let e of i.items) {
420
- e.loose = !0;
421
- for (let t of e.tokens) t.type === "text" && (t.type = "paragraph");
422
- }
423
- return i;
424
- }
425
- }
426
- html(e) {
427
- let t = this.rules.block.html.exec(e);
428
- if (t) return {
429
- type: "html",
430
- block: !0,
431
- raw: t[0],
432
- pre: t[1] === "pre" || t[1] === "script" || t[1] === "style",
433
- text: t[0]
434
- };
435
- }
436
- def(e) {
437
- let t = this.rules.block.def.exec(e);
438
- if (t) {
439
- let e = t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), n = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
440
- return {
441
- type: "def",
442
- tag: e,
443
- raw: t[0],
444
- href: n,
445
- title: r
446
- };
447
- }
448
- }
449
- table(e) {
450
- let t = this.rules.block.table.exec(e);
451
- if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
452
- let n = qe(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], a = {
453
- type: "table",
454
- raw: t[0],
455
- header: [],
456
- align: [],
457
- rows: []
458
- };
459
- if (n.length === r.length) {
460
- for (let e of r) this.rules.other.tableAlignRight.test(e) ? a.align.push("right") : this.rules.other.tableAlignCenter.test(e) ? a.align.push("center") : this.rules.other.tableAlignLeft.test(e) ? a.align.push("left") : a.align.push(null);
461
- for (let e = 0; e < n.length; e++) a.header.push({
462
- text: n[e],
463
- tokens: this.lexer.inline(n[e]),
464
- header: !0,
465
- align: a.align[e]
466
- });
467
- for (let e of i) a.rows.push(qe(e, a.header.length).map((e, t) => ({
468
- text: e,
469
- tokens: this.lexer.inline(e),
470
- header: !1,
471
- align: a.align[t]
472
- })));
473
- return a;
474
- }
475
- }
476
- lheading(e) {
477
- let t = this.rules.block.lheading.exec(e);
478
- if (t) return {
479
- type: "heading",
480
- raw: t[0],
481
- depth: t[2].charAt(0) === "=" ? 1 : 2,
482
- text: t[1],
483
- tokens: this.lexer.inline(t[1])
484
- };
485
- }
486
- paragraph(e) {
487
- let t = this.rules.block.paragraph.exec(e);
488
- if (t) {
489
- let e = t[1].charAt(t[1].length - 1) === "\n" ? t[1].slice(0, -1) : t[1];
490
- return {
491
- type: "paragraph",
492
- raw: t[0],
493
- text: e,
494
- tokens: this.lexer.inline(e)
495
- };
496
- }
497
- }
498
- text(e) {
499
- let t = this.rules.block.text.exec(e);
500
- if (t) return {
501
- type: "text",
502
- raw: t[0],
503
- text: t[0],
504
- tokens: this.lexer.inline(t[0])
505
- };
506
- }
507
- escape(e) {
508
- let t = this.rules.inline.escape.exec(e);
509
- if (t) return {
510
- type: "escape",
511
- raw: t[0],
512
- text: t[1]
513
- };
514
- }
515
- tag(e) {
516
- let t = this.rules.inline.tag.exec(e);
517
- if (t) return !this.lexer.state.inLink && this.rules.other.startATag.test(t[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t[0]) && (this.lexer.state.inRawBlock = !1), {
518
- type: "html",
519
- raw: t[0],
520
- inLink: this.lexer.state.inLink,
521
- inRawBlock: this.lexer.state.inRawBlock,
522
- block: !1,
523
- text: t[0]
524
- };
525
- }
526
- link(e) {
527
- let t = this.rules.inline.link.exec(e);
528
- if (t) {
529
- let e = t[2].trim();
530
- if (!this.options.pedantic && this.rules.other.startAngleBracket.test(e)) {
531
- if (!this.rules.other.endAngleBracket.test(e)) return;
532
- let t = W(e.slice(0, -1), "\\");
533
- if ((e.length - t.length) % 2 == 0) return;
534
- } else {
535
- let e = Je(t[2], "()");
536
- if (e === -2) return;
537
- if (e > -1) {
538
- let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
539
- t[2] = t[2].substring(0, e), t[0] = t[0].substring(0, n).trim(), t[3] = "";
540
- }
541
- }
542
- let n = t[2], r = "";
543
- if (this.options.pedantic) {
544
- let e = this.rules.other.pedanticHrefTitle.exec(n);
545
- e && (n = e[1], r = e[3]);
546
- } else r = t[3] ? t[3].slice(1, -1) : "";
547
- return n = n.trim(), this.rules.other.startAngleBracket.test(n) && (n = this.options.pedantic && !this.rules.other.endAngleBracket.test(e) ? n.slice(1) : n.slice(1, -1)), Ye(t, {
548
- href: n && n.replace(this.rules.inline.anyPunctuation, "$1"),
549
- title: r && r.replace(this.rules.inline.anyPunctuation, "$1")
550
- }, t[0], this.lexer, this.rules);
551
- }
552
- }
553
- reflink(e, t) {
554
- let n;
555
- if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
556
- let e = t[(n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " ").toLowerCase()];
557
- if (!e) {
558
- let e = n[0].charAt(0);
559
- return {
560
- type: "text",
561
- raw: e,
562
- text: e
563
- };
564
- }
565
- return Ye(n, e, n[0], this.lexer, this.rules);
566
- }
567
- }
568
- emStrong(e, t, n = "") {
569
- let r = this.rules.inline.emStrongLDelim.exec(e);
570
- if (!(!r || r[3] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(r[1] || r[2]) || !n || this.rules.inline.punctuation.exec(n))) {
571
- let n = [...r[0]].length - 1, i, a, o = n, s = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
572
- for (c.lastIndex = 0, t = t.slice(-1 * e.length + n); (r = c.exec(t)) != null;) {
573
- if (i = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !i) continue;
574
- if (a = [...i].length, r[3] || r[4]) {
575
- o += a;
576
- continue;
577
- } else if ((r[5] || r[6]) && n % 3 && !((n + a) % 3)) {
578
- s += a;
579
- continue;
580
- }
581
- if (o -= a, o > 0) continue;
582
- a = Math.min(a, a + o + s);
583
- let t = [...r[0]][0].length, c = e.slice(0, n + r.index + t + a);
584
- if (Math.min(n, a) % 2) {
585
- let e = c.slice(1, -1);
586
- return {
587
- type: "em",
588
- raw: c,
589
- text: e,
590
- tokens: this.lexer.inlineTokens(e)
591
- };
592
- }
593
- let l = c.slice(2, -2);
594
- return {
595
- type: "strong",
596
- raw: c,
597
- text: l,
598
- tokens: this.lexer.inlineTokens(l)
599
- };
600
- }
601
- }
602
- }
603
- codespan(e) {
604
- let t = this.rules.inline.code.exec(e);
605
- if (t) {
606
- let e = t[2].replace(this.rules.other.newLineCharGlobal, " "), n = this.rules.other.nonSpaceChar.test(e), r = this.rules.other.startingSpaceChar.test(e) && this.rules.other.endingSpaceChar.test(e);
607
- return n && r && (e = e.substring(1, e.length - 1)), {
608
- type: "codespan",
609
- raw: t[0],
610
- text: e
611
- };
612
- }
613
- }
614
- br(e) {
615
- let t = this.rules.inline.br.exec(e);
616
- if (t) return {
617
- type: "br",
618
- raw: t[0]
619
- };
620
- }
621
- del(e) {
622
- let t = this.rules.inline.del.exec(e);
623
- if (t) return {
624
- type: "del",
625
- raw: t[0],
626
- text: t[2],
627
- tokens: this.lexer.inlineTokens(t[2])
628
- };
629
- }
630
- autolink(e) {
631
- let t = this.rules.inline.autolink.exec(e);
632
- if (t) {
633
- let e, n;
634
- return t[2] === "@" ? (e = t[1], n = "mailto:" + e) : (e = t[1], n = e), {
635
- type: "link",
636
- raw: t[0],
637
- text: e,
638
- href: n,
639
- tokens: [{
640
- type: "text",
641
- raw: e,
642
- text: e
643
- }]
644
- };
645
- }
646
- }
647
- url(e) {
648
- let t;
649
- if (t = this.rules.inline.url.exec(e)) {
650
- let e, n;
651
- if (t[2] === "@") e = t[0], n = "mailto:" + e;
652
- else {
653
- let r;
654
- do
655
- r = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
656
- while (r !== t[0]);
657
- e = t[0], n = t[1] === "www." ? "http://" + t[0] : t[0];
658
- }
659
- return {
660
- type: "link",
661
- raw: t[0],
662
- text: e,
663
- href: n,
664
- tokens: [{
665
- type: "text",
666
- raw: e,
667
- text: e
668
- }]
669
- };
670
- }
671
- }
672
- inlineText(e) {
673
- let t = this.rules.inline.text.exec(e);
674
- if (t) {
675
- let e = this.lexer.state.inRawBlock;
676
- return {
677
- type: "text",
678
- raw: t[0],
679
- text: t[0],
680
- escaped: e
681
- };
682
- }
683
- }
684
- }, K = class e {
685
- tokens;
686
- options;
687
- state;
688
- inlineQueue;
689
- tokenizer;
690
- constructor(e) {
691
- this.tokens = [], this.tokens.links = Object.create(null), this.options = e || v, this.options.tokenizer = this.options.tokenizer || new G(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
692
- inLink: !1,
693
- inRawBlock: !1,
694
- top: !0
695
- };
696
- let t = {
697
- other: S,
698
- block: V.normal,
699
- inline: H.normal
700
- };
701
- this.options.pedantic ? (t.block = V.pedantic, t.inline = H.pedantic) : this.options.gfm && (t.block = V.gfm, this.options.breaks ? t.inline = H.breaks : t.inline = H.gfm), this.tokenizer.rules = t;
702
- }
703
- static get rules() {
704
- return {
705
- block: V,
706
- inline: H
707
- };
708
- }
709
- static lex(t, n) {
710
- return new e(n).lex(t);
711
- }
712
- static lexInline(t, n) {
713
- return new e(n).inlineTokens(t);
714
- }
715
- lex(e) {
716
- e = e.replace(S.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
717
- for (let e = 0; e < this.inlineQueue.length; e++) {
718
- let t = this.inlineQueue[e];
719
- this.inlineTokens(t.src, t.tokens);
720
- }
721
- return this.inlineQueue = [], this.tokens;
722
- }
723
- blockTokens(e, t = [], n = !1) {
724
- for (this.options.pedantic && (e = e.replace(S.tabCharGlobal, " ").replace(S.spaceLine, "")); e;) {
725
- let r;
726
- if (this.options.extensions?.block?.some((n) => (r = n.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue;
727
- if (r = this.tokenizer.space(e)) {
728
- e = e.substring(r.raw.length);
729
- let n = t.at(-1);
730
- r.raw.length === 1 && n !== void 0 ? n.raw += "\n" : t.push(r);
731
- continue;
732
- }
733
- if (r = this.tokenizer.code(e)) {
734
- e = e.substring(r.raw.length);
735
- let n = t.at(-1);
736
- n?.type === "paragraph" || n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + r.raw, n.text += "\n" + r.text, this.inlineQueue.at(-1).src = n.text) : t.push(r);
737
- continue;
738
- }
739
- if (r = this.tokenizer.fences(e)) {
740
- e = e.substring(r.raw.length), t.push(r);
741
- continue;
742
- }
743
- if (r = this.tokenizer.heading(e)) {
744
- e = e.substring(r.raw.length), t.push(r);
745
- continue;
746
- }
747
- if (r = this.tokenizer.hr(e)) {
748
- e = e.substring(r.raw.length), t.push(r);
749
- continue;
750
- }
751
- if (r = this.tokenizer.blockquote(e)) {
752
- e = e.substring(r.raw.length), t.push(r);
753
- continue;
754
- }
755
- if (r = this.tokenizer.list(e)) {
756
- e = e.substring(r.raw.length), t.push(r);
757
- continue;
758
- }
759
- if (r = this.tokenizer.html(e)) {
760
- e = e.substring(r.raw.length), t.push(r);
761
- continue;
762
- }
763
- if (r = this.tokenizer.def(e)) {
764
- e = e.substring(r.raw.length);
765
- let n = t.at(-1);
766
- n?.type === "paragraph" || n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + r.raw, n.text += "\n" + r.raw, this.inlineQueue.at(-1).src = n.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = {
767
- href: r.href,
768
- title: r.title
769
- }, t.push(r));
770
- continue;
771
- }
772
- if (r = this.tokenizer.table(e)) {
773
- e = e.substring(r.raw.length), t.push(r);
774
- continue;
775
- }
776
- if (r = this.tokenizer.lheading(e)) {
777
- e = e.substring(r.raw.length), t.push(r);
778
- continue;
779
- }
780
- let i = e;
781
- if (this.options.extensions?.startBlock) {
782
- let t = Infinity, n = e.slice(1), r;
783
- this.options.extensions.startBlock.forEach((e) => {
784
- r = e.call({ lexer: this }, n), typeof r == "number" && r >= 0 && (t = Math.min(t, r));
785
- }), t < Infinity && t >= 0 && (i = e.substring(0, t + 1));
786
- }
787
- if (this.state.top && (r = this.tokenizer.paragraph(i))) {
788
- let a = t.at(-1);
789
- n && a?.type === "paragraph" ? (a.raw += (a.raw.endsWith("\n") ? "" : "\n") + r.raw, a.text += "\n" + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = a.text) : t.push(r), n = i.length !== e.length, e = e.substring(r.raw.length);
790
- continue;
791
- }
792
- if (r = this.tokenizer.text(e)) {
793
- e = e.substring(r.raw.length);
794
- let n = t.at(-1);
795
- n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + r.raw, n.text += "\n" + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = n.text) : t.push(r);
796
- continue;
797
- }
798
- if (e) {
799
- let t = "Infinite loop on byte: " + e.charCodeAt(0);
800
- if (this.options.silent) {
801
- console.error(t);
802
- break;
803
- } else throw Error(t);
804
- }
805
- }
806
- return this.state.top = !0, t;
807
- }
808
- inline(e, t = []) {
809
- return this.inlineQueue.push({
810
- src: e,
811
- tokens: t
812
- }), t;
813
- }
814
- inlineTokens(e, t = []) {
815
- let n = e, r = null;
816
- if (this.tokens.links) {
817
- let e = Object.keys(this.tokens.links);
818
- if (e.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) != null;) e.includes(r[0].slice(r[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
819
- }
820
- for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null;) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
821
- let i;
822
- for (; (r = this.tokenizer.rules.inline.blockSkip.exec(n)) != null;) i = r[2] ? r[2].length : 0, n = n.slice(0, r.index + i) + "[" + "a".repeat(r[0].length - i - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
823
- n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
824
- let a = !1, o = "";
825
- for (; e;) {
826
- a || (o = ""), a = !1;
827
- let r;
828
- if (this.options.extensions?.inline?.some((n) => (r = n.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue;
829
- if (r = this.tokenizer.escape(e)) {
830
- e = e.substring(r.raw.length), t.push(r);
831
- continue;
832
- }
833
- if (r = this.tokenizer.tag(e)) {
834
- e = e.substring(r.raw.length), t.push(r);
835
- continue;
836
- }
837
- if (r = this.tokenizer.link(e)) {
838
- e = e.substring(r.raw.length), t.push(r);
839
- continue;
840
- }
841
- if (r = this.tokenizer.reflink(e, this.tokens.links)) {
842
- e = e.substring(r.raw.length);
843
- let n = t.at(-1);
844
- r.type === "text" && n?.type === "text" ? (n.raw += r.raw, n.text += r.text) : t.push(r);
845
- continue;
846
- }
847
- if (r = this.tokenizer.emStrong(e, n, o)) {
848
- e = e.substring(r.raw.length), t.push(r);
849
- continue;
850
- }
851
- if (r = this.tokenizer.codespan(e)) {
852
- e = e.substring(r.raw.length), t.push(r);
853
- continue;
854
- }
855
- if (r = this.tokenizer.br(e)) {
856
- e = e.substring(r.raw.length), t.push(r);
857
- continue;
858
- }
859
- if (r = this.tokenizer.del(e)) {
860
- e = e.substring(r.raw.length), t.push(r);
861
- continue;
862
- }
863
- if (r = this.tokenizer.autolink(e)) {
864
- e = e.substring(r.raw.length), t.push(r);
865
- continue;
866
- }
867
- if (!this.state.inLink && (r = this.tokenizer.url(e))) {
868
- e = e.substring(r.raw.length), t.push(r);
869
- continue;
870
- }
871
- let i = e;
872
- if (this.options.extensions?.startInline) {
873
- let t = Infinity, n = e.slice(1), r;
874
- this.options.extensions.startInline.forEach((e) => {
875
- r = e.call({ lexer: this }, n), typeof r == "number" && r >= 0 && (t = Math.min(t, r));
876
- }), t < Infinity && t >= 0 && (i = e.substring(0, t + 1));
877
- }
878
- if (r = this.tokenizer.inlineText(i)) {
879
- e = e.substring(r.raw.length), r.raw.slice(-1) !== "_" && (o = r.raw.slice(-1)), a = !0;
880
- let n = t.at(-1);
881
- n?.type === "text" ? (n.raw += r.raw, n.text += r.text) : t.push(r);
882
- continue;
883
- }
884
- if (e) {
885
- let t = "Infinite loop on byte: " + e.charCodeAt(0);
886
- if (this.options.silent) {
887
- console.error(t);
888
- break;
889
- } else throw Error(t);
890
- }
891
- }
892
- return t;
893
- }
894
- }, q = class {
895
- options;
896
- parser;
897
- constructor(e) {
898
- this.options = e || v;
899
- }
900
- space(e) {
901
- return "";
902
- }
903
- code({ text: e, lang: t, escaped: n }) {
904
- let r = (t || "").match(S.notSpaceStart)?.[0], i = e.replace(S.endingNewline, "") + "\n";
905
- return r ? "<pre><code class=\"language-" + U(r) + "\">" + (n ? i : U(i, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? i : U(i, !0)) + "</code></pre>\n";
906
- }
907
- blockquote({ tokens: e }) {
908
- return `<blockquote>
909
- ${this.parser.parse(e)}</blockquote>
910
- `;
911
- }
912
- html({ text: e }) {
913
- return e;
914
- }
915
- def(e) {
916
- return "";
917
- }
918
- heading({ tokens: e, depth: t }) {
919
- return `<h${t}>${this.parser.parseInline(e)}</h${t}>
920
- `;
921
- }
922
- hr(e) {
923
- return "<hr>\n";
924
- }
925
- list(e) {
926
- let t = e.ordered, n = e.start, r = "";
927
- for (let t = 0; t < e.items.length; t++) {
928
- let n = e.items[t];
929
- r += this.listitem(n);
930
- }
931
- let i = t ? "ol" : "ul", a = t && n !== 1 ? " start=\"" + n + "\"" : "";
932
- return "<" + i + a + ">\n" + r + "</" + i + ">\n";
933
- }
934
- listitem(e) {
935
- return `<li>${this.parser.parse(e.tokens)}</li>
936
- `;
937
- }
938
- checkbox({ checked: e }) {
939
- return "<input " + (e ? "checked=\"\" " : "") + "disabled=\"\" type=\"checkbox\"> ";
940
- }
941
- paragraph({ tokens: e }) {
942
- return `<p>${this.parser.parseInline(e)}</p>
943
- `;
944
- }
945
- table(e) {
946
- let t = "", n = "";
947
- for (let t = 0; t < e.header.length; t++) n += this.tablecell(e.header[t]);
948
- t += this.tablerow({ text: n });
949
- let r = "";
950
- for (let t = 0; t < e.rows.length; t++) {
951
- let i = e.rows[t];
952
- n = "";
953
- for (let e = 0; e < i.length; e++) n += this.tablecell(i[e]);
954
- r += this.tablerow({ text: n });
955
- }
956
- return r &&= `<tbody>${r}</tbody>`, "<table>\n<thead>\n" + t + "</thead>\n" + r + "</table>\n";
957
- }
958
- tablerow({ text: e }) {
959
- return `<tr>
960
- ${e}</tr>
961
- `;
962
- }
963
- tablecell(e) {
964
- let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
965
- return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
966
- `;
967
- }
968
- strong({ tokens: e }) {
969
- return `<strong>${this.parser.parseInline(e)}</strong>`;
970
- }
971
- em({ tokens: e }) {
972
- return `<em>${this.parser.parseInline(e)}</em>`;
973
- }
974
- codespan({ text: e }) {
975
- return `<code>${U(e, !0)}</code>`;
976
- }
977
- br(e) {
978
- return "<br>";
979
- }
980
- del({ tokens: e }) {
981
- return `<del>${this.parser.parseInline(e)}</del>`;
982
- }
983
- link({ href: e, title: t, tokens: n }) {
984
- let r = this.parser.parseInline(n), i = Ke(e);
985
- if (i === null) return r;
986
- e = i;
987
- let a = "<a href=\"" + e + "\"";
988
- return t && (a += " title=\"" + U(t) + "\""), a += ">" + r + "</a>", a;
989
- }
990
- image({ href: e, title: t, text: n, tokens: r }) {
991
- r && (n = this.parser.parseInline(r, this.parser.textRenderer));
992
- let i = Ke(e);
993
- if (i === null) return U(n);
994
- e = i;
995
- let a = `<img src="${e}" alt="${n}"`;
996
- return t && (a += ` title="${U(t)}"`), a += ">", a;
997
- }
998
- text(e) {
999
- return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : U(e.text);
1000
- }
1001
- }, J = class {
1002
- strong({ text: e }) {
1003
- return e;
1004
- }
1005
- em({ text: e }) {
1006
- return e;
1007
- }
1008
- codespan({ text: e }) {
1009
- return e;
1010
- }
1011
- del({ text: e }) {
1012
- return e;
1013
- }
1014
- html({ text: e }) {
1015
- return e;
1016
- }
1017
- text({ text: e }) {
1018
- return e;
1019
- }
1020
- link({ text: e }) {
1021
- return "" + e;
1022
- }
1023
- image({ text: e }) {
1024
- return "" + e;
1025
- }
1026
- br() {
1027
- return "";
1028
- }
1029
- checkbox({ raw: e }) {
1030
- return e;
1031
- }
1032
- }, Y = class e {
1033
- options;
1034
- renderer;
1035
- textRenderer;
1036
- constructor(e) {
1037
- this.options = e || v, this.options.renderer = this.options.renderer || new q(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new J();
1038
- }
1039
- static parse(t, n) {
1040
- return new e(n).parse(t);
1041
- }
1042
- static parseInline(t, n) {
1043
- return new e(n).parseInline(t);
1044
- }
1045
- parse(e) {
1046
- let t = "";
1047
- for (let n = 0; n < e.length; n++) {
1048
- let r = e[n];
1049
- if (this.options.extensions?.renderers?.[r.type]) {
1050
- let e = r, n = this.options.extensions.renderers[e.type].call({ parser: this }, e);
1051
- if (n !== !1 || ![
1052
- "space",
1053
- "hr",
1054
- "heading",
1055
- "code",
1056
- "table",
1057
- "blockquote",
1058
- "list",
1059
- "html",
1060
- "def",
1061
- "paragraph",
1062
- "text"
1063
- ].includes(e.type)) {
1064
- t += n || "";
1065
- continue;
1066
- }
1067
- }
1068
- let i = r;
1069
- switch (i.type) {
1070
- case "space":
1071
- t += this.renderer.space(i);
1072
- break;
1073
- case "hr":
1074
- t += this.renderer.hr(i);
1075
- break;
1076
- case "heading":
1077
- t += this.renderer.heading(i);
1078
- break;
1079
- case "code":
1080
- t += this.renderer.code(i);
1081
- break;
1082
- case "table":
1083
- t += this.renderer.table(i);
1084
- break;
1085
- case "blockquote":
1086
- t += this.renderer.blockquote(i);
1087
- break;
1088
- case "list":
1089
- t += this.renderer.list(i);
1090
- break;
1091
- case "checkbox":
1092
- t += this.renderer.checkbox(i);
1093
- break;
1094
- case "html":
1095
- t += this.renderer.html(i);
1096
- break;
1097
- case "def":
1098
- t += this.renderer.def(i);
1099
- break;
1100
- case "paragraph":
1101
- t += this.renderer.paragraph(i);
1102
- break;
1103
- case "text":
1104
- t += this.renderer.text(i);
1105
- break;
1106
- default: {
1107
- let e = "Token with \"" + i.type + "\" type was not found.";
1108
- if (this.options.silent) return console.error(e), "";
1109
- throw Error(e);
1110
- }
1111
- }
1112
- }
1113
- return t;
1114
- }
1115
- parseInline(e, t = this.renderer) {
1116
- let n = "";
1117
- for (let r = 0; r < e.length; r++) {
1118
- let i = e[r];
1119
- if (this.options.extensions?.renderers?.[i.type]) {
1120
- let e = this.options.extensions.renderers[i.type].call({ parser: this }, i);
1121
- if (e !== !1 || ![
1122
- "escape",
1123
- "html",
1124
- "link",
1125
- "image",
1126
- "strong",
1127
- "em",
1128
- "codespan",
1129
- "br",
1130
- "del",
1131
- "text"
1132
- ].includes(i.type)) {
1133
- n += e || "";
1134
- continue;
1135
- }
1136
- }
1137
- let a = i;
1138
- switch (a.type) {
1139
- case "escape":
1140
- n += t.text(a);
1141
- break;
1142
- case "html":
1143
- n += t.html(a);
1144
- break;
1145
- case "link":
1146
- n += t.link(a);
1147
- break;
1148
- case "image":
1149
- n += t.image(a);
1150
- break;
1151
- case "checkbox":
1152
- n += t.checkbox(a);
1153
- break;
1154
- case "strong":
1155
- n += t.strong(a);
1156
- break;
1157
- case "em":
1158
- n += t.em(a);
1159
- break;
1160
- case "codespan":
1161
- n += t.codespan(a);
1162
- break;
1163
- case "br":
1164
- n += t.br(a);
1165
- break;
1166
- case "del":
1167
- n += t.del(a);
1168
- break;
1169
- case "text":
1170
- n += t.text(a);
1171
- break;
1172
- default: {
1173
- let e = "Token with \"" + a.type + "\" type was not found.";
1174
- if (this.options.silent) return console.error(e), "";
1175
- throw Error(e);
1176
- }
1177
- }
1178
- }
1179
- return n;
1180
- }
1181
- }, X = class {
1182
- options;
1183
- block;
1184
- constructor(e) {
1185
- this.options = e || v;
1186
- }
1187
- static passThroughHooks = new Set([
1188
- "preprocess",
1189
- "postprocess",
1190
- "processAllTokens",
1191
- "emStrongMask"
1192
- ]);
1193
- static passThroughHooksRespectAsync = new Set([
1194
- "preprocess",
1195
- "postprocess",
1196
- "processAllTokens"
1197
- ]);
1198
- preprocess(e) {
1199
- return e;
1200
- }
1201
- postprocess(e) {
1202
- return e;
1203
- }
1204
- processAllTokens(e) {
1205
- return e;
1206
- }
1207
- emStrongMask(e) {
1208
- return e;
1209
- }
1210
- provideLexer() {
1211
- return this.block ? K.lex : K.lexInline;
1212
- }
1213
- provideParser() {
1214
- return this.block ? Y.parse : Y.parseInline;
1215
- }
1216
- }, Z = new class {
1217
- defaults = _();
1218
- options = this.setOptions;
1219
- parse = this.parseMarkdown(!0);
1220
- parseInline = this.parseMarkdown(!1);
1221
- Parser = Y;
1222
- Renderer = q;
1223
- TextRenderer = J;
1224
- Lexer = K;
1225
- Tokenizer = G;
1226
- Hooks = X;
1227
- constructor(...e) {
1228
- this.use(...e);
1229
- }
1230
- walkTokens(e, t) {
1231
- let n = [];
1232
- for (let r of e) switch (n = n.concat(t.call(this, r)), r.type) {
1233
- case "table": {
1234
- let e = r;
1235
- for (let r of e.header) n = n.concat(this.walkTokens(r.tokens, t));
1236
- for (let r of e.rows) for (let e of r) n = n.concat(this.walkTokens(e.tokens, t));
1237
- break;
1238
- }
1239
- case "list": {
1240
- let e = r;
1241
- n = n.concat(this.walkTokens(e.items, t));
1242
- break;
1243
- }
1244
- default: {
1245
- let e = r;
1246
- this.defaults.extensions?.childTokens?.[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((r) => {
1247
- let i = e[r].flat(Infinity);
1248
- n = n.concat(this.walkTokens(i, t));
1249
- }) : e.tokens && (n = n.concat(this.walkTokens(e.tokens, t)));
1250
- }
1251
- }
1252
- return n;
1253
- }
1254
- use(...e) {
1255
- let t = this.defaults.extensions || {
1256
- renderers: {},
1257
- childTokens: {}
1258
- };
1259
- return e.forEach((e) => {
1260
- let n = { ...e };
1261
- if (n.async = this.defaults.async || n.async || !1, e.extensions && (e.extensions.forEach((e) => {
1262
- if (!e.name) throw Error("extension name required");
1263
- if ("renderer" in e) {
1264
- let n = t.renderers[e.name];
1265
- n ? t.renderers[e.name] = function(...t) {
1266
- let r = e.renderer.apply(this, t);
1267
- return r === !1 && (r = n.apply(this, t)), r;
1268
- } : t.renderers[e.name] = e.renderer;
1269
- }
1270
- if ("tokenizer" in e) {
1271
- if (!e.level || e.level !== "block" && e.level !== "inline") throw Error("extension level must be 'block' or 'inline'");
1272
- let n = t[e.level];
1273
- n ? n.unshift(e.tokenizer) : t[e.level] = [e.tokenizer], e.start && (e.level === "block" ? t.startBlock ? t.startBlock.push(e.start) : t.startBlock = [e.start] : e.level === "inline" && (t.startInline ? t.startInline.push(e.start) : t.startInline = [e.start]));
1274
- }
1275
- "childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
1276
- }), n.extensions = t), e.renderer) {
1277
- let t = this.defaults.renderer || new q(this.defaults);
1278
- for (let n in e.renderer) {
1279
- if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
1280
- if (["options", "parser"].includes(n)) continue;
1281
- let r = n, i = e.renderer[r], a = t[r];
1282
- t[r] = (...e) => {
1283
- let n = i.apply(t, e);
1284
- return n === !1 && (n = a.apply(t, e)), n || "";
1285
- };
1286
- }
1287
- n.renderer = t;
1288
- }
1289
- if (e.tokenizer) {
1290
- let t = this.defaults.tokenizer || new G(this.defaults);
1291
- for (let n in e.tokenizer) {
1292
- if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
1293
- if ([
1294
- "options",
1295
- "rules",
1296
- "lexer"
1297
- ].includes(n)) continue;
1298
- let r = n, i = e.tokenizer[r], a = t[r];
1299
- t[r] = (...e) => {
1300
- let n = i.apply(t, e);
1301
- return n === !1 && (n = a.apply(t, e)), n;
1302
- };
1303
- }
1304
- n.tokenizer = t;
1305
- }
1306
- if (e.hooks) {
1307
- let t = this.defaults.hooks || new X();
1308
- for (let n in e.hooks) {
1309
- if (!(n in t)) throw Error(`hook '${n}' does not exist`);
1310
- if (["options", "block"].includes(n)) continue;
1311
- let r = n, i = e.hooks[r], a = t[r];
1312
- X.passThroughHooks.has(n) ? t[r] = (e) => {
1313
- if (this.defaults.async && X.passThroughHooksRespectAsync.has(n)) return (async () => {
1314
- let n = await i.call(t, e);
1315
- return a.call(t, n);
1316
- })();
1317
- let r = i.call(t, e);
1318
- return a.call(t, r);
1319
- } : t[r] = (...e) => {
1320
- if (this.defaults.async) return (async () => {
1321
- let n = await i.apply(t, e);
1322
- return n === !1 && (n = await a.apply(t, e)), n;
1323
- })();
1324
- let n = i.apply(t, e);
1325
- return n === !1 && (n = a.apply(t, e)), n;
1326
- };
1327
- }
1328
- n.hooks = t;
1329
- }
1330
- if (e.walkTokens) {
1331
- let t = this.defaults.walkTokens, r = e.walkTokens;
1332
- n.walkTokens = function(e) {
1333
- let n = [];
1334
- return n.push(r.call(this, e)), t && (n = n.concat(t.call(this, e))), n;
1335
- };
1336
- }
1337
- this.defaults = {
1338
- ...this.defaults,
1339
- ...n
1340
- };
1341
- }), this;
1342
- }
1343
- setOptions(e) {
1344
- return this.defaults = {
1345
- ...this.defaults,
1346
- ...e
1347
- }, this;
1348
- }
1349
- lexer(e, t) {
1350
- return K.lex(e, t ?? this.defaults);
1351
- }
1352
- parser(e, t) {
1353
- return Y.parse(e, t ?? this.defaults);
1354
- }
1355
- parseMarkdown(e) {
1356
- return (t, n) => {
1357
- let r = { ...n }, i = {
1358
- ...this.defaults,
1359
- ...r
1360
- }, a = this.onError(!!i.silent, !!i.async);
1361
- if (this.defaults.async === !0 && r.async === !1) return a(/* @__PURE__ */ Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
1362
- if (typeof t > "u" || t === null) return a(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
1363
- if (typeof t != "string") return a(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
1364
- if (i.hooks && (i.hooks.options = i, i.hooks.block = e), i.async) return (async () => {
1365
- let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer() : e ? K.lex : K.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
1366
- i.walkTokens && await Promise.all(this.walkTokens(a, i.walkTokens));
1367
- let o = await (i.hooks ? await i.hooks.provideParser() : e ? Y.parse : Y.parseInline)(a, i);
1368
- return i.hooks ? await i.hooks.postprocess(o) : o;
1369
- })().catch(a);
1370
- try {
1371
- i.hooks && (t = i.hooks.preprocess(t));
1372
- let n = (i.hooks ? i.hooks.provideLexer() : e ? K.lex : K.lexInline)(t, i);
1373
- i.hooks && (n = i.hooks.processAllTokens(n)), i.walkTokens && this.walkTokens(n, i.walkTokens);
1374
- let r = (i.hooks ? i.hooks.provideParser() : e ? Y.parse : Y.parseInline)(n, i);
1375
- return i.hooks && (r = i.hooks.postprocess(r)), r;
1376
- } catch (e) {
1377
- return a(e);
1378
- }
1379
- };
1380
- }
1381
- onError(e, t) {
1382
- return (n) => {
1383
- if (n.message += "\nPlease report this to https://github.com/markedjs/marked.", e) {
1384
- let e = "<p>An error occurred:</p><pre>" + U(n.message + "", !0) + "</pre>";
1385
- return t ? Promise.resolve(e) : e;
1386
- }
1387
- if (t) return Promise.reject(n);
1388
- throw n;
1389
- };
1390
- }
1391
- }();
1392
- function Q(e, t) {
1393
- return Z.parse(e, t);
1394
- }
1395
- Q.options = Q.setOptions = function(e) {
1396
- return Z.setOptions(e), Q.defaults = Z.defaults, y(Q.defaults), Q;
1397
- }, Q.getDefaults = _, Q.defaults = v, Q.use = function(...e) {
1398
- return Z.use(...e), Q.defaults = Z.defaults, y(Q.defaults), Q;
1399
- }, Q.walkTokens = function(e, t) {
1400
- return Z.walkTokens(e, t);
1401
- }, Q.parseInline = Z.parseInline, Q.Parser = Y, Q.parser = Y.parse, Q.Renderer = q, Q.TextRenderer = J, Q.Lexer = K, Q.lexer = K.lex, Q.Tokenizer = G, Q.Hooks = X, Q.parse = Q, Q.options, Q.setOptions, Q.use, Q.walkTokens, Q.parseInline, Y.parse, K.lex;
1402
- //#endregion
1403
- //#region utils/index.js
1404
- var Ze = (e, t) => {
1405
- let n;
1406
- return function() {
1407
- let r = this, i = arguments;
1408
- n && clearTimeout(n), n = setTimeout(() => {
1409
- e.apply(r, i);
1410
- }, t);
1411
- };
1412
- }, Qe = (e, t) => {
1413
- let n, r = !0;
1414
- return function() {
1415
- let i = this, a = arguments;
1416
- if (r) {
1417
- e.apply(i, a), r = !1, n = setTimeout(() => {
1418
- n = null, r = !0;
1419
- }, t);
1420
- return;
1421
- }
1422
- n ||= setTimeout(() => {
1423
- e.apply(i, a), n = null, r = !0;
1424
- }, t);
1425
- };
1426
- };
1427
- function $e(e, t) {
1428
- return window.sessionStorage.setItem(e, JSON.stringify(t));
1429
- }
1430
- function et(e) {
1431
- return JSON.parse(window.sessionStorage.getItem(e));
1432
- }
1433
- function tt(e) {
1434
- return window.sessionStorage.removeItem(e);
1435
- }
1436
- function nt() {
1437
- return window.sessionStorage.clear();
1438
- }
1439
- function rt(e) {
1440
- let t = Number(e);
1441
- return t ? t / 1e3 + "s" : "";
1442
- }
1443
- var it = (e) => {
1444
- if (!e) return "";
1445
- let t = 0;
1446
- for (; Math.abs(e) >= 1024 && (e /= 1024, t++, t !== 4););
1447
- return Math.round(e * 100) / 100 + " " + [
1448
- "B",
1449
- "KB",
1450
- "MB",
1451
- "GB",
1452
- "TB"
1453
- ][t];
1454
- }, $ = f({}), at = (e) => {
1455
- if (!e) return "";
1456
- let t = Q.parse(e).replace(/>(\s+)</g, "><"), n = t.match(/<img[^>]+src="([^"]+)"[^>]*>/g);
1457
- return n && n.forEach((e) => {
1458
- let n = e.match(/src="([^"]+)"/);
1459
- if (n && n[1]) {
1460
- let r = n[1];
1461
- if (!$.value[r]) {
1462
- $.value[r] = "loading";
1463
- let e = new Image();
1464
- e.onload = () => {
1465
- $.value[r] = "loaded";
1466
- }, e.onerror = () => {
1467
- $.value[r] = "error";
1468
- }, e.src = r;
1469
- }
1470
- let i;
1471
- i = $.value[r] === "loaded" ? e : $.value[r] === "error" ? `<div class="el-image__error" data-src='${n[1]}'><div class="image-slot"><i class="el-icon"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" t="1742463877500" class="icon" viewBox="0 0 1356 1024" version="1.1" p-id="4463" width="264.84375" height="200"><path d="M564.44449572 836.7634306l128.677796-204.53166511-78.14075901-43.48311004-67.64039324 78.75274348a32.20971115 32.20971115 0 0 1-45.96325785 2.995503l-111.12350325-99.68905577a32.20971115 32.20971115 0 0 0-45.83441924 2.83445505l-103.32875321 118.85383398-28.28012581-404.36071319q-3.3498102-48.18572778 44.83591758-51.53553797l311.72558369-21.838184L597.23398201 164.38571167 254.26497816 188.38194626A96.62913347 96.62913347 0 0 0 164.62535234 291.51744152l33.17600217 474.03031841a96.62913347 96.62913347 0 0 0 103.10328527 89.63962582l263.57206593-18.42395514z m84.90479874 1.67490545l299.45368385 20.93631228a96.62913347 96.62913347 0 0 0 103.13549526-89.63962649l33.14379285-474.03031771A96.62913347 96.62913347 0 0 0 995.41043062 192.56920886L772.32597104 176.94749877 737.70053205 223.00738594l254.36008835 17.77976067q48.18572778 3.38201953 44.83591824 51.56774731l-28.24791716 403.90977733-181.179625-210.97360762a32.20971115 32.20971115 0 0 0-45.70557994-3.18876161l-78.14075902 68.76773284 115.02087861 86.96622006-169.32645166 200.63429045z m-159.1159731-480.63330951a88.15797897 88.15797897 0 1 0-59.33028802 107.35496719l59.36249802-107.35496719z" p-id="4464"/></svg></i></div></div>` : "<div class=\"el-space__item\"><div class=\"el-skeleton is-animated\"><div class=\"el-skeleton__item el-skeleton__image\" style=\"width: 120px; height: 120px;\"><svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" t=\"1742463703310\" class=\"icon\" viewBox=\"0 0 1282 1024\" version=\"1.1\" p-id=\"4321\" width=\"250.390625\" height=\"200\"><path d=\"M164.38571167 759.1138438V264.8861562a100.50044453 100.50044453 0 0 1 100.50044453-100.50044453h670.00296545a100.50044453 100.50044453 0 0 1 100.50044454 100.50044453v494.22768759a100.50044453 100.50044453 0 0 1-100.50044454 100.50044454H264.8861562a100.50044453 100.50044453 0 0 1-100.50044453-100.50044454z m820.75363192-73.0973238V264.8861562q0-50.25022262-50.25022194-50.25022191H264.8861562Q214.63593429 214.63593429 214.63593429 264.8861562v421.59936608l115.84351257-115.84351258a33.50014841 33.50014841 0 0 1 47.73771135 0.3685017l108.03797766 111.52199347a33.50014841 33.50014841 0 0 0 47.90521187 0.23450113l200.06288588-202.50839652a33.50014841 33.50014841 0 0 1 47.63721077 0l203.2788992 205.75791052zM407.46278744 466.69104932a91.68990581 91.68990581 0 1 0-1e-8-183.34631097 91.68990581 91.68990581 0 0 0 0 183.34631097z\" p-id=\"4322\"/></svg></div></div></div>", t = t.replace(e, i);
1472
- }
1473
- }), t;
1474
- }, ot = (e) => {
1475
- if (typeof e != "string") return !1;
1476
- let t = e.trim().toLowerCase();
1477
- if (/^<!doctype\s+html[\s>]/.test(t) || /^<html[\s>]/.test(t)) return !0;
1478
- let n = t.indexOf("<head"), r = t.indexOf("<body");
1479
- return !!(n !== -1 && r !== -1 && n < r || t.includes("<html") && t.includes("<head") && t.includes("<body"));
1480
- }, st = (e) => {
1481
- e && (e.onload = () => {
1482
- try {
1483
- let t = e.contentDocument || e.contentWindow.document;
1484
- e.style.height = t.body.scrollHeight + 100 + "px";
1485
- } catch {
1486
- e.style.height = "800px";
1487
- }
1488
- });
1489
- }, ct = {
1490
- key: 0,
1491
- class: "file-display"
1492
- }, lt = { class: "file-img overflow-hidden" }, ut = {
1493
- key: 0,
1494
- class: "file-img__failed w-full h-full flex items-center justify-center"
1495
- }, dt = { class: "file-display__item--name text-ellipsis" }, ft = { class: "file-display__item--size" }, pt = /* @__PURE__ */ r({
1496
- __name: "index",
1497
- props: {
1498
- fileList: {
1499
- type: Array,
1500
- default: () => []
1501
- },
1502
- showRemove: {
1503
- type: Boolean,
1504
- default: !0
1505
- },
1506
- showLoading: {
1507
- type: Boolean,
1508
- default: !1
1509
- }
1510
- },
1511
- emits: ["remove-file"],
1512
- setup(r, { emit: f }) {
1513
- let { previewImage: _ } = n(), v = f, y = (e, t) => {
1514
- v("remove-file", e, t);
1515
- }, b = (e) => {
1516
- t(e.suffix, e.url) ? _(e.url) : window.open(e.url, "_blank");
1517
- };
1518
- return (n, f) => {
1519
- let _ = ee("loading"), v = ee("ellipsis-tooltip");
1520
- return r.fileList.length ? (d(), s("div", ct, [(d(!0), s(i, null, p(r.fileList, (n, f) => (d(), s("div", {
1521
- key: f,
1522
- class: "file-display__item"
1523
- }, [
1524
- re((d(), s("div", lt, [n.failed && r.showLoading ? (d(), s("div", ut, [u(m(g), {
1525
- size: "22px",
1526
- color: "#f56c6c"
1527
- }, {
1528
- default: h(() => [u(m(ae))]),
1529
- _: 1
1530
- })])) : (d(), s(i, { key: 1 }, [m(t)(n.suffix, n.url) ? (d(), a(m(ie), {
1531
- key: 0,
1532
- src: n.url,
1533
- "zoom-rate": 1.2,
1534
- "max-scale": 7,
1535
- "min-scale": .2,
1536
- onClick: (e) => b(n),
1537
- fit: "cover"
1538
- }, null, 8, ["src", "onClick"])) : (d(), a(m(g), {
1539
- key: 1,
1540
- size: "38px"
1541
- }, {
1542
- default: h(() => [(d(), a(te(m(e)(n))))]),
1543
- _: 2
1544
- }, 1024))], 64))])), [[_, !n.bnid && !n.failed && r.showLoading]]),
1545
- c("div", null, [re((d(), s("p", dt, [l(ne(n.name), 1)])), [[v, n.name]]), c("p", ft, [c("span", null, ne(m(it)(n.size)), 1)])]),
1546
- r.showRemove ? (d(), a(m(g), {
1547
- key: 0,
1548
- class: "icon-remove",
1549
- size: "18",
1550
- onClick: (e) => y(f, n.bnid)
1551
- }, {
1552
- default: h(() => [u(m(ae))]),
1553
- _: 1
1554
- }, 8, ["onClick"])) : o("", !0)
1555
- ]))), 128))])) : o("", !0);
1556
- };
1557
- }
1558
- }, [["__scopeId", "data-v-23669daf"]]);
1559
- //#endregion
1560
- export { ot as a, tt as c, Qe as d, rt as f, et as i, st as l, Ze as n, at as o, it as r, nt as s, pt as t, $e as u };