advaisor-chatbot 1.8.0 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/testchatbot.js +187 -221
  2. package/package.json +1 -1
@@ -1,13 +1,13 @@
1
1
  (() => {
2
- // ../node_modules/marked/lib/marked.esm.js
3
- function M() {
2
+ // node_modules/marked/lib/marked.esm.js
3
+ function L() {
4
4
  return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
5
5
  }
6
- var O = M();
7
- function G(u3) {
8
- O = u3;
6
+ var T = L();
7
+ function Z(u3) {
8
+ T = u3;
9
9
  }
10
- var _ = { exec: () => null };
10
+ var C = { exec: () => null };
11
11
  function k(u3, e = "") {
12
12
  let t = typeof u3 == "string" ? u3 : u3.source, n = { replace: (r, i) => {
13
13
  let s = typeof i == "string" ? i : i.source;
@@ -15,85 +15,82 @@
15
15
  }, getRegex: () => new RegExp(t, e) };
16
16
  return n;
17
17
  }
18
- var be = (() => {
18
+ var me = (() => {
19
19
  try {
20
20
  return !!new RegExp("(?<=1)(?<!1)");
21
21
  } catch {
22
22
  return false;
23
23
  }
24
24
  })();
25
- 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, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ 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, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (u3) => new RegExp(`^( {0,3}${u3})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}#`), htmlBeginRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}<(?:[a-z].*>|!--)`, "i"), blockquoteBeginRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}>`) };
26
- var Re = /^(?:[ \t]*(?:\n|$))+/;
27
- var Oe = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
28
- var Te = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
29
- var C = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
30
- var we = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
31
- var Q = / {0,3}(?:[*+-]|\d{1,9}[.)])/;
32
- var se = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
33
- var ie = k(se).replace(/bull/g, Q).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();
34
- var ye = k(se).replace(/bull/g, Q).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();
35
- var j = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
36
- var Pe = /^[^\n]+/;
25
+ 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]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ 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: (u3) => new RegExp(`^( {0,3}${u3})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}#`), htmlBeginRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}<(?:[a-z].*>|!--)`, "i") };
26
+ var xe = /^(?:[ \t]*(?:\n|$))+/;
27
+ var be = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
28
+ var Re = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
29
+ var I = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
30
+ var Te = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
31
+ var N = /(?:[*+-]|\d{1,9}[.)])/;
32
+ var re = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
33
+ var se = k(re).replace(/bull/g, N).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();
34
+ var Oe = k(re).replace(/bull/g, N).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();
35
+ var Q = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
36
+ var we = /^[^\n]+/;
37
37
  var F = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
38
- var Se = k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", F).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
39
- var $e = k(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Q).getRegex();
38
+ var ye = k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", F).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
39
+ var Pe = k(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, N).getRegex();
40
40
  var 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";
41
- var U = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
42
- var _e = k("^ {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();
43
- var oe = k(j).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[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex();
44
- var Le = k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", oe).getRegex();
45
- var K = { blockquote: Le, code: Oe, def: Se, fences: Te, heading: we, hr: C, html: _e, lheading: ie, list: $e, newline: Re, paragraph: oe, table: _, text: Pe };
46
- var ne = k("^ *([^\\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[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex();
47
- var Me = { ...K, lheading: ye, table: ne, paragraph: k(j).replace("hr", C).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ne).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex() };
48
- var ze = { ...K, html: k(`^ *(?: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: _, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: k(j).replace("hr", C).replace("heading", ` *#{1,6} *[^
49
- ]`).replace("lheading", ie).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() };
50
- var Ee = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
51
- var Ie = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
52
- var ae = /^( {2,}|\\)\n(?!\s*$)/;
41
+ var j = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
42
+ var Se = k("^ {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", j).replace("tag", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
43
+ var ie = k(Q).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();
44
+ var $e = k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ie).getRegex();
45
+ var U = { blockquote: $e, code: be, def: ye, fences: Re, heading: Te, hr: I, html: Se, lheading: se, list: Pe, newline: xe, paragraph: ie, table: C, text: we };
46
+ var te = k("^ *([^\\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();
47
+ var _e = { ...U, lheading: Oe, table: te, paragraph: k(Q).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", te).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() };
48
+ var Le = { ...U, html: k(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", j).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: k(Q).replace("hr", I).replace("heading", ` *#{1,6} *[^
49
+ ]`).replace("lheading", se).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() };
50
+ var Me = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
51
+ var ze = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
52
+ var oe = /^( {2,}|\\)\n(?!\s*$)/;
53
53
  var Ae = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
54
- var z = /[\p{P}\p{S}]/u;
55
- var H = /[\s\p{P}\p{S}]/u;
56
- var W = /[^\s\p{P}\p{S}]/u;
57
- var Ce = k(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, H).getRegex();
54
+ var D = /[\p{P}\p{S}]/u;
55
+ var K = /[\s\p{P}\p{S}]/u;
56
+ var ae = /[^\s\p{P}\p{S}]/u;
57
+ var Ce = k(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, K).getRegex();
58
58
  var le = /(?!~)[\p{P}\p{S}]/u;
59
- var Be = /(?!~)[\s\p{P}\p{S}]/u;
60
- var De = /(?:[^\s\p{P}\p{S}]|~)/u;
61
- var qe = k(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", be ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
62
- var ue = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/;
63
- var ve = k(ue, "u").replace(/punct/g, z).getRegex();
64
- var He = k(ue, "u").replace(/punct/g, le).getRegex();
59
+ var Ie = /(?!~)[\s\p{P}\p{S}]/u;
60
+ var Ee = /(?:[^\s\p{P}\p{S}]|~)/u;
61
+ var Be = k(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", me ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
62
+ var ue = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/;
63
+ var qe = k(ue, "u").replace(/punct/g, D).getRegex();
64
+ var ve = k(ue, "u").replace(/punct/g, le).getRegex();
65
65
  var pe = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
66
- var Ze = k(pe, "gu").replace(/notPunctSpace/g, W).replace(/punctSpace/g, H).replace(/punct/g, z).getRegex();
67
- var Ge = k(pe, "gu").replace(/notPunctSpace/g, De).replace(/punctSpace/g, Be).replace(/punct/g, le).getRegex();
68
- var Ne = k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, W).replace(/punctSpace/g, H).replace(/punct/g, z).getRegex();
69
- var Qe = k(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, z).getRegex();
70
- var je = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)";
71
- var Fe = k(je, "gu").replace(/notPunctSpace/g, W).replace(/punctSpace/g, H).replace(/punct/g, z).getRegex();
72
- var Ue = k(/\\(punct)/, "gu").replace(/punct/g, z).getRegex();
73
- var Ke = k(/^<(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();
74
- var We = k(U).replace("(?:-->|$)", "-->").getRegex();
75
- var Xe = k("^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", We).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
76
- var q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/;
77
- var Je = k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
66
+ var De = k(pe, "gu").replace(/notPunctSpace/g, ae).replace(/punctSpace/g, K).replace(/punct/g, D).getRegex();
67
+ var He = k(pe, "gu").replace(/notPunctSpace/g, Ee).replace(/punctSpace/g, Ie).replace(/punct/g, le).getRegex();
68
+ var Ze = k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ae).replace(/punctSpace/g, K).replace(/punct/g, D).getRegex();
69
+ var Ge = k(/\\(punct)/, "gu").replace(/punct/g, D).getRegex();
70
+ var Ne = k(/^<(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();
71
+ var Qe = k(j).replace("(?:-->|$)", "-->").getRegex();
72
+ var Fe = k("^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", Qe).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
73
+ var q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/;
74
+ var je = k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
78
75
  var ce = k(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", F).getRegex();
79
76
  var he = k(/^!?\[(ref)\](?:\[\])?/).replace("ref", F).getRegex();
80
- var Ve = k("reflink|nolink(?!\\()", "g").replace("reflink", ce).replace("nolink", he).getRegex();
81
- var re = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
82
- var X = { _backpedal: _, anyPunctuation: Ue, autolink: Ke, blockSkip: qe, br: ae, code: Ie, del: _, delLDelim: _, delRDelim: _, emStrongLDelim: ve, emStrongRDelimAst: Ze, emStrongRDelimUnd: Ne, escape: Ee, link: Je, nolink: he, punctuation: Ce, reflink: ce, reflinkSearch: Ve, tag: Xe, text: Ae, url: _ };
83
- var Ye = { ...X, link: k(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(), reflink: k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex() };
84
- var N = { ...X, emStrongRDelimAst: Ge, emStrongLDelim: He, delLDelim: Qe, delRDelim: Fe, url: k(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", re).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\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: k(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", re).getRegex() };
85
- var et = { ...N, br: k(ae).replace("{2,}", "*").getRegex(), text: k(N.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() };
86
- var B = { normal: K, gfm: Me, pedantic: ze };
87
- var E = { normal: X, gfm: N, breaks: et, pedantic: Ye };
88
- var tt = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" };
89
- var ke = (u3) => tt[u3];
90
- function T(u3, e) {
77
+ var Ue = k("reflink|nolink(?!\\()", "g").replace("reflink", ce).replace("nolink", he).getRegex();
78
+ var ne = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
79
+ var W = { _backpedal: C, anyPunctuation: Ge, autolink: Ne, blockSkip: Be, br: oe, code: ze, del: C, emStrongLDelim: qe, emStrongRDelimAst: De, emStrongRDelimUnd: Ze, escape: Me, link: je, nolink: he, punctuation: Ce, reflink: ce, reflinkSearch: Ue, tag: Fe, text: Ae, url: C };
80
+ var Ke = { ...W, link: k(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(), reflink: k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex() };
81
+ var G = { ...W, emStrongRDelimAst: He, emStrongLDelim: ve, url: k(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ne).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\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: k(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ne).getRegex() };
82
+ var We = { ...G, br: k(oe).replace("{2,}", "*").getRegex(), text: k(G.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() };
83
+ var E = { normal: U, gfm: _e, pedantic: Le };
84
+ var M = { normal: W, gfm: G, breaks: We, pedantic: Ke };
85
+ var Xe = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" };
86
+ var ke = (u3) => Xe[u3];
87
+ function w(u3, e) {
91
88
  if (e) {
92
89
  if (m.escapeTest.test(u3)) return u3.replace(m.escapeReplace, ke);
93
90
  } else if (m.escapeTestNoEncode.test(u3)) return u3.replace(m.escapeReplaceNoEncode, ke);
94
91
  return u3;
95
92
  }
96
- function J(u3) {
93
+ function X(u3) {
97
94
  try {
98
95
  u3 = encodeURI(u3).replace(m.percentDecode, "%");
99
96
  } catch {
@@ -101,7 +98,7 @@
101
98
  }
102
99
  return u3;
103
100
  }
104
- function V(u3, e) {
101
+ function J(u3, e) {
105
102
  let t = u3.replace(m.findPipe, (i, s, a) => {
106
103
  let o = false, l = s;
107
104
  for (; --l >= 0 && a[l] === "\\"; ) o = !o;
@@ -112,7 +109,7 @@
112
109
  for (; r < n.length; r++) n[r] = n[r].trim().replace(m.slashPipe, "|");
113
110
  return n;
114
111
  }
115
- function I(u3, e, t) {
112
+ function z(u3, e, t) {
116
113
  let n = u3.length;
117
114
  if (n === 0) return "";
118
115
  let r = 0;
@@ -132,21 +129,13 @@
132
129
  else if (u3[n] === e[1] && (t--, t < 0)) return n;
133
130
  return t > 0 ? -2 : -1;
134
131
  }
135
- function ge(u3, e = 0) {
136
- let t = e, n = "";
137
- for (let r of u3) if (r === " ") {
138
- let i = 4 - t % 4;
139
- n += " ".repeat(i), t += i;
140
- } else n += r, t++;
141
- return n;
142
- }
143
- function fe(u3, e, t, n, r) {
132
+ function ge(u3, e, t, n, r) {
144
133
  let i = e.href, s = e.title || null, a = u3[1].replace(r.other.outputLinkReplace, "$1");
145
134
  n.state.inLink = true;
146
135
  let o = { type: u3[0].charAt(0) === "!" ? "image" : "link", raw: t, href: i, title: s, text: a, tokens: n.inlineTokens(a) };
147
136
  return n.state.inLink = false, o;
148
137
  }
149
- function nt(u3, e, t) {
138
+ function Je(u3, e, t) {
150
139
  let n = u3.match(t.other.indentCodeCompensation);
151
140
  if (n === null) return e;
152
141
  let r = n[1];
@@ -159,12 +148,12 @@
159
148
  }).join(`
160
149
  `);
161
150
  }
162
- var w = class {
151
+ var y = class {
163
152
  options;
164
153
  rules;
165
154
  lexer;
166
155
  constructor(e) {
167
- this.options = e || O;
156
+ this.options = e || T;
168
157
  }
169
158
  space(e) {
170
159
  let t = this.rules.block.newline.exec(e);
@@ -174,14 +163,14 @@
174
163
  let t = this.rules.block.code.exec(e);
175
164
  if (t) {
176
165
  let n = t[0].replace(this.rules.other.codeRemoveIndent, "");
177
- return { type: "code", raw: t[0], codeBlockStyle: "indented", text: this.options.pedantic ? n : I(n, `
166
+ return { type: "code", raw: t[0], codeBlockStyle: "indented", text: this.options.pedantic ? n : z(n, `
178
167
  `) };
179
168
  }
180
169
  }
181
170
  fences(e) {
182
171
  let t = this.rules.block.fences.exec(e);
183
172
  if (t) {
184
- let n = t[0], r = nt(n, t[3] || "", this.rules);
173
+ let n = t[0], r = Je(n, t[3] || "", this.rules);
185
174
  return { type: "code", raw: n, lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2], text: r };
186
175
  }
187
176
  }
@@ -190,7 +179,7 @@
190
179
  if (t) {
191
180
  let n = t[2].trim();
192
181
  if (this.rules.other.endingHash.test(n)) {
193
- let r = I(n, "#");
182
+ let r = z(n, "#");
194
183
  (this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
195
184
  }
196
185
  return { type: "heading", raw: t[0], depth: t[1].length, text: n, tokens: this.lexer.inline(n) };
@@ -198,13 +187,13 @@
198
187
  }
199
188
  hr(e) {
200
189
  let t = this.rules.block.hr.exec(e);
201
- if (t) return { type: "hr", raw: I(t[0], `
190
+ if (t) return { type: "hr", raw: z(t[0], `
202
191
  `) };
203
192
  }
204
193
  blockquote(e) {
205
194
  let t = this.rules.block.blockquote.exec(e);
206
195
  if (t) {
207
- let n = I(t[0], `
196
+ let n = z(t[0], `
208
197
  `).split(`
209
198
  `), r = "", i = "", s = [];
210
199
  for (; n.length > 0; ) {
@@ -219,21 +208,21 @@
219
208
  r = r ? `${r}
220
209
  ${p}` : p, i = i ? `${i}
221
210
  ${c}` : c;
222
- let d = this.lexer.state.top;
223
- if (this.lexer.state.top = true, this.lexer.blockTokens(c, s, true), this.lexer.state.top = d, n.length === 0) break;
211
+ let g = this.lexer.state.top;
212
+ if (this.lexer.state.top = true, this.lexer.blockTokens(c, s, true), this.lexer.state.top = g, n.length === 0) break;
224
213
  let h = s.at(-1);
225
214
  if (h?.type === "code") break;
226
215
  if (h?.type === "blockquote") {
227
216
  let R = h, f = R.raw + `
228
217
  ` + n.join(`
229
- `), S = this.blockquote(f);
230
- s[s.length - 1] = S, r = r.substring(0, r.length - R.raw.length) + S.raw, i = i.substring(0, i.length - R.text.length) + S.text;
218
+ `), O = this.blockquote(f);
219
+ s[s.length - 1] = O, r = r.substring(0, r.length - R.raw.length) + O.raw, i = i.substring(0, i.length - R.text.length) + O.text;
231
220
  break;
232
221
  } else if (h?.type === "list") {
233
222
  let R = h, f = R.raw + `
234
223
  ` + n.join(`
235
- `), S = this.list(f);
236
- s[s.length - 1] = S, r = r.substring(0, r.length - h.raw.length) + S.raw, i = i.substring(0, i.length - R.raw.length) + S.raw, n = f.substring(s.at(-1).raw.length).split(`
224
+ `), O = this.list(f);
225
+ s[s.length - 1] = O, r = r.substring(0, r.length - h.raw.length) + O.raw, i = i.substring(0, i.length - R.raw.length) + O.raw, n = f.substring(s.at(-1).raw.length).split(`
237
226
  `);
238
227
  continue;
239
228
  }
@@ -251,25 +240,25 @@ ${c}` : c;
251
240
  let l = false, p = "", c = "";
252
241
  if (!(t = s.exec(e)) || this.rules.block.hr.test(e)) break;
253
242
  p = t[0], e = e.substring(p.length);
254
- let d = ge(t[2].split(`
255
- `, 1)[0], t[1].length), h = e.split(`
256
- `, 1)[0], R = !d.trim(), f = 0;
257
- if (this.options.pedantic ? (f = 2, c = d.trimStart()) : R ? f = t[1].length + 1 : (f = d.search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, c = d.slice(f), f += t[1].length), R && this.rules.other.blankLine.test(h) && (p += h + `
243
+ let g = t[2].split(`
244
+ `, 1)[0].replace(this.rules.other.listReplaceTabs, (O) => " ".repeat(3 * O.length)), h = e.split(`
245
+ `, 1)[0], R = !g.trim(), f = 0;
246
+ if (this.options.pedantic ? (f = 2, c = g.trimStart()) : R ? f = t[1].length + 1 : (f = t[2].search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, c = g.slice(f), f += t[1].length), R && this.rules.other.blankLine.test(h) && (p += h + `
258
247
  `, e = e.substring(h.length + 1), l = true), !l) {
259
- let S = this.rules.other.nextBulletRegex(f), Y = this.rules.other.hrRegex(f), ee = this.rules.other.fencesBeginRegex(f), te = this.rules.other.headingBeginRegex(f), me = this.rules.other.htmlBeginRegex(f), xe = this.rules.other.blockquoteBeginRegex(f);
248
+ let O = this.rules.other.nextBulletRegex(f), V = this.rules.other.hrRegex(f), Y = this.rules.other.fencesBeginRegex(f), ee = this.rules.other.headingBeginRegex(f), fe = this.rules.other.htmlBeginRegex(f);
260
249
  for (; e; ) {
261
- let Z = e.split(`
250
+ let H = e.split(`
262
251
  `, 1)[0], A;
263
- if (h = Z, this.options.pedantic ? (h = h.replace(this.rules.other.listReplaceNesting, " "), A = h) : A = h.replace(this.rules.other.tabCharGlobal, " "), ee.test(h) || te.test(h) || me.test(h) || xe.test(h) || S.test(h) || Y.test(h)) break;
252
+ if (h = H, this.options.pedantic ? (h = h.replace(this.rules.other.listReplaceNesting, " "), A = h) : A = h.replace(this.rules.other.tabCharGlobal, " "), Y.test(h) || ee.test(h) || fe.test(h) || O.test(h) || V.test(h)) break;
264
253
  if (A.search(this.rules.other.nonSpaceChar) >= f || !h.trim()) c += `
265
254
  ` + A.slice(f);
266
255
  else {
267
- if (R || d.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ee.test(d) || te.test(d) || Y.test(d)) break;
256
+ if (R || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || Y.test(g) || ee.test(g) || V.test(g)) break;
268
257
  c += `
269
258
  ` + h;
270
259
  }
271
- R = !h.trim(), p += Z + `
272
- `, e = e.substring(Z.length + 1), d = A.slice(f);
260
+ !R && !h.trim() && (R = true), p += H + `
261
+ `, e = e.substring(H.length + 1), g = A.slice(f);
273
262
  }
274
263
  }
275
264
  i.loose || (a ? i.loose = true : this.rules.other.doubleBlankLine.test(p) && (a = true)), i.items.push({ type: "list_item", raw: p, task: !!this.options.gfm && this.rules.other.listIsTask.test(c), loose: false, text: c, tokens: [] }), i.raw += p;
@@ -294,7 +283,7 @@ ${c}` : c;
294
283
  }
295
284
  }
296
285
  if (!i.loose) {
297
- let p = l.tokens.filter((d) => d.type === "space"), c = p.length > 0 && p.some((d) => this.rules.other.anyLine.test(d.raw));
286
+ let p = l.tokens.filter((g) => g.type === "space"), c = p.length > 0 && p.some((g) => this.rules.other.anyLine.test(g.raw));
298
287
  i.loose = c;
299
288
  }
300
289
  }
@@ -319,21 +308,18 @@ ${c}` : c;
319
308
  table(e) {
320
309
  let t = this.rules.block.table.exec(e);
321
310
  if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
322
- let n = V(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
311
+ let n = J(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
323
312
  `) : [], s = { type: "table", raw: t[0], header: [], align: [], rows: [] };
324
313
  if (n.length === r.length) {
325
314
  for (let a of r) this.rules.other.tableAlignRight.test(a) ? s.align.push("right") : this.rules.other.tableAlignCenter.test(a) ? s.align.push("center") : this.rules.other.tableAlignLeft.test(a) ? s.align.push("left") : s.align.push(null);
326
315
  for (let a = 0; a < n.length; a++) s.header.push({ text: n[a], tokens: this.lexer.inline(n[a]), header: true, align: s.align[a] });
327
- for (let a of i) s.rows.push(V(a, s.header.length).map((o, l) => ({ text: o, tokens: this.lexer.inline(o), header: false, align: s.align[l] })));
316
+ for (let a of i) s.rows.push(J(a, s.header.length).map((o, l) => ({ text: o, tokens: this.lexer.inline(o), header: false, align: s.align[l] })));
328
317
  return s;
329
318
  }
330
319
  }
331
320
  lheading(e) {
332
321
  let t = this.rules.block.lheading.exec(e);
333
- if (t) {
334
- let n = t[1].trim();
335
- return { type: "heading", raw: t[0], depth: t[2].charAt(0) === "=" ? 1 : 2, text: n, tokens: this.lexer.inline(n) };
336
- }
322
+ if (t) return { type: "heading", raw: t[0], depth: t[2].charAt(0) === "=" ? 1 : 2, text: t[1], tokens: this.lexer.inline(t[1]) };
337
323
  }
338
324
  paragraph(e) {
339
325
  let t = this.rules.block.paragraph.exec(e);
@@ -361,7 +347,7 @@ ${c}` : c;
361
347
  let n = t[2].trim();
362
348
  if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
363
349
  if (!this.rules.other.endAngleBracket.test(n)) return;
364
- let s = I(n.slice(0, -1), "\\");
350
+ let s = z(n.slice(0, -1), "\\");
365
351
  if ((n.length - s.length) % 2 === 0) return;
366
352
  } else {
367
353
  let s = de(t[2], "()");
@@ -376,7 +362,7 @@ ${c}` : c;
376
362
  let s = this.rules.other.pedanticHrefTitle.exec(r);
377
363
  s && (r = s[1], i = s[3]);
378
364
  } else i = t[3] ? t[3].slice(1, -1) : "";
379
- return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), fe(t, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: i && i.replace(this.rules.inline.anyPunctuation, "$1") }, t[0], this.lexer, this.rules);
365
+ return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), ge(t, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: i && i.replace(this.rules.inline.anyPunctuation, "$1") }, t[0], this.lexer, this.rules);
380
366
  }
381
367
  }
382
368
  reflink(e, t) {
@@ -387,15 +373,15 @@ ${c}` : c;
387
373
  let s = n[0].charAt(0);
388
374
  return { type: "text", raw: s, text: s };
389
375
  }
390
- return fe(n, i, n[0], this.lexer, this.rules);
376
+ return ge(n, i, n[0], this.lexer, this.rules);
391
377
  }
392
378
  }
393
379
  emStrong(e, t, n = "") {
394
380
  let r = this.rules.inline.emStrongLDelim.exec(e);
395
- if (!r || !r[1] && !r[2] && !r[3] && !r[4] || r[4] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
396
- if (!(r[1] || r[3] || "") || !n || this.rules.inline.punctuation.exec(n)) {
381
+ if (!r || r[3] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
382
+ if (!(r[1] || r[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
397
383
  let s = [...r[0]].length - 1, a, o, l = s, p = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
398
- for (c.lastIndex = 0, t = t.slice(-1 * e.length + s); (r = c.exec(t)) !== null; ) {
384
+ for (c.lastIndex = 0, t = t.slice(-1 * e.length + s); (r = c.exec(t)) != null; ) {
399
385
  if (a = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !a) continue;
400
386
  if (o = [...a].length, r[3] || r[4]) {
401
387
  l += o;
@@ -406,7 +392,7 @@ ${c}` : c;
406
392
  }
407
393
  if (l -= o, l > 0) continue;
408
394
  o = Math.min(o, o + l + p);
409
- let d = [...r[0]][0].length, h = e.slice(0, s + r.index + d + o);
395
+ let g = [...r[0]][0].length, h = e.slice(0, s + r.index + g + o);
410
396
  if (Math.min(s, o) % 2) {
411
397
  let f = h.slice(1, -1);
412
398
  return { type: "em", raw: h, text: f, tokens: this.lexer.inlineTokens(f) };
@@ -427,23 +413,9 @@ ${c}` : c;
427
413
  let t = this.rules.inline.br.exec(e);
428
414
  if (t) return { type: "br", raw: t[0] };
429
415
  }
430
- del(e, t, n = "") {
431
- let r = this.rules.inline.delLDelim.exec(e);
432
- if (!r) return;
433
- if (!(r[1] || "") || !n || this.rules.inline.punctuation.exec(n)) {
434
- let s = [...r[0]].length - 1, a, o, l = s, p = this.rules.inline.delRDelim;
435
- for (p.lastIndex = 0, t = t.slice(-1 * e.length + s); (r = p.exec(t)) !== null; ) {
436
- if (a = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !a || (o = [...a].length, o !== s)) continue;
437
- if (r[3] || r[4]) {
438
- l += o;
439
- continue;
440
- }
441
- if (l -= o, l > 0) continue;
442
- o = Math.min(o, o + l);
443
- let c = [...r[0]][0].length, d = e.slice(0, s + r.index + c + o), h = d.slice(s, -s);
444
- return { type: "del", raw: d, text: h, tokens: this.lexer.inlineTokens(h) };
445
- }
446
- }
416
+ del(e) {
417
+ let t = this.rules.inline.del.exec(e);
418
+ if (t) return { type: "del", raw: t[0], text: t[2], tokens: this.lexer.inlineTokens(t[2]) };
447
419
  }
448
420
  autolink(e) {
449
421
  let t = this.rules.inline.autolink.exec(e);
@@ -482,12 +454,12 @@ ${c}` : c;
482
454
  inlineQueue;
483
455
  tokenizer;
484
456
  constructor(e) {
485
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || O, this.options.tokenizer = this.options.tokenizer || new w(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, top: true };
486
- let t = { other: m, block: B.normal, inline: E.normal };
487
- this.options.pedantic ? (t.block = B.pedantic, t.inline = E.pedantic) : this.options.gfm && (t.block = B.gfm, this.options.breaks ? t.inline = E.breaks : t.inline = E.gfm), this.tokenizer.rules = t;
457
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || T, this.options.tokenizer = this.options.tokenizer || new y(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, top: true };
458
+ let t = { other: m, block: E.normal, inline: M.normal };
459
+ this.options.pedantic ? (t.block = E.pedantic, t.inline = M.pedantic) : this.options.gfm && (t.block = E.gfm, this.options.breaks ? t.inline = M.breaks : t.inline = M.gfm), this.tokenizer.rules = t;
488
460
  }
489
461
  static get rules() {
490
- return { block: B, inline: E };
462
+ return { block: E, inline: M };
491
463
  }
492
464
  static lex(e, t) {
493
465
  return new u(t).lex(e);
@@ -505,7 +477,7 @@ ${c}` : c;
505
477
  return this.inlineQueue = [], this.tokens;
506
478
  }
507
479
  blockTokens(e, t = [], n = false) {
508
- for (this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(m.tabCharGlobal, " ").replace(m.spaceLine, "")); e; ) {
480
+ for (this.options.pedantic && (e = e.replace(m.tabCharGlobal, " ").replace(m.spaceLine, "")); e; ) {
509
481
  let r;
510
482
  if (this.options.extensions?.block?.some((s) => (r = s.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), true) : false)) continue;
511
483
  if (r = this.tokenizer.space(e)) {
@@ -603,15 +575,14 @@ ${c}` : c;
603
575
  return this.inlineQueue.push({ src: e, tokens: t }), t;
604
576
  }
605
577
  inlineTokens(e, t = []) {
606
- this.tokenizer.lexer = this;
607
578
  let n = e, r = null;
608
579
  if (this.tokens.links) {
609
580
  let o = Object.keys(this.tokens.links);
610
- if (o.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) !== null; ) o.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));
581
+ if (o.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) != null; ) o.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));
611
582
  }
612
- for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) !== null; ) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
583
+ for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null; ) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
613
584
  let i;
614
- 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);
585
+ 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);
615
586
  n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
616
587
  let s = false, a = "";
617
588
  for (; e; ) {
@@ -648,7 +619,7 @@ ${c}` : c;
648
619
  e = e.substring(o.raw.length), t.push(o);
649
620
  continue;
650
621
  }
651
- if (o = this.tokenizer.del(e, n, a)) {
622
+ if (o = this.tokenizer.del(e)) {
652
623
  e = e.substring(o.raw.length), t.push(o);
653
624
  continue;
654
625
  }
@@ -662,9 +633,9 @@ ${c}` : c;
662
633
  }
663
634
  let l = e;
664
635
  if (this.options.extensions?.startInline) {
665
- let p = 1 / 0, c = e.slice(1), d;
636
+ let p = 1 / 0, c = e.slice(1), g;
666
637
  this.options.extensions.startInline.forEach((h) => {
667
- d = h.call({ lexer: this }, c), typeof d == "number" && d >= 0 && (p = Math.min(p, d));
638
+ g = h.call({ lexer: this }, c), typeof g == "number" && g >= 0 && (p = Math.min(p, g));
668
639
  }), p < 1 / 0 && p >= 0 && (l = e.substring(0, p + 1));
669
640
  }
670
641
  if (o = this.tokenizer.inlineText(l)) {
@@ -684,11 +655,11 @@ ${c}` : c;
684
655
  return t;
685
656
  }
686
657
  };
687
- var y = class {
658
+ var P = class {
688
659
  options;
689
660
  parser;
690
661
  constructor(e) {
691
- this.options = e || O;
662
+ this.options = e || T;
692
663
  }
693
664
  space(e) {
694
665
  return "";
@@ -696,8 +667,8 @@ ${c}` : c;
696
667
  code({ text: e, lang: t, escaped: n }) {
697
668
  let r = (t || "").match(m.notSpaceStart)?.[0], i = e.replace(m.endingNewline, "") + `
698
669
  `;
699
- return r ? '<pre><code class="language-' + T(r) + '">' + (n ? i : T(i, true)) + `</code></pre>
700
- ` : "<pre><code>" + (n ? i : T(i, true)) + `</code></pre>
670
+ return r ? '<pre><code class="language-' + w(r) + '">' + (n ? i : w(i, true)) + `</code></pre>
671
+ ` : "<pre><code>" + (n ? i : w(i, true)) + `</code></pre>
701
672
  `;
702
673
  }
703
674
  blockquote({ tokens: e }) {
@@ -775,7 +746,7 @@ ${e}</tr>
775
746
  return `<em>${this.parser.parseInline(e)}</em>`;
776
747
  }
777
748
  codespan({ text: e }) {
778
- return `<code>${T(e, true)}</code>`;
749
+ return `<code>${w(e, true)}</code>`;
779
750
  }
780
751
  br(e) {
781
752
  return "<br>";
@@ -784,22 +755,22 @@ ${e}</tr>
784
755
  return `<del>${this.parser.parseInline(e)}</del>`;
785
756
  }
786
757
  link({ href: e, title: t, tokens: n }) {
787
- let r = this.parser.parseInline(n), i = J(e);
758
+ let r = this.parser.parseInline(n), i = X(e);
788
759
  if (i === null) return r;
789
760
  e = i;
790
761
  let s = '<a href="' + e + '"';
791
- return t && (s += ' title="' + T(t) + '"'), s += ">" + r + "</a>", s;
762
+ return t && (s += ' title="' + w(t) + '"'), s += ">" + r + "</a>", s;
792
763
  }
793
764
  image({ href: e, title: t, text: n, tokens: r }) {
794
765
  r && (n = this.parser.parseInline(r, this.parser.textRenderer));
795
- let i = J(e);
796
- if (i === null) return T(n);
766
+ let i = X(e);
767
+ if (i === null) return w(n);
797
768
  e = i;
798
- let s = `<img src="${e}" alt="${T(n)}"`;
799
- return t && (s += ` title="${T(t)}"`), s += ">", s;
769
+ let s = `<img src="${e}" alt="${n}"`;
770
+ return t && (s += ` title="${w(t)}"`), s += ">", s;
800
771
  }
801
772
  text(e) {
802
- return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : T(e.text);
773
+ return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : w(e.text);
803
774
  }
804
775
  };
805
776
  var $ = class {
@@ -839,7 +810,7 @@ ${e}</tr>
839
810
  renderer;
840
811
  textRenderer;
841
812
  constructor(e) {
842
- this.options = e || O, this.options.renderer = this.options.renderer || new y(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new $();
813
+ this.options = e || T, this.options.renderer = this.options.renderer || new P(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new $();
843
814
  }
844
815
  static parse(e, t) {
845
816
  return new u2(t).parse(e);
@@ -848,7 +819,6 @@ ${e}</tr>
848
819
  return new u2(t).parseInline(e);
849
820
  }
850
821
  parse(e) {
851
- this.renderer.parser = this;
852
822
  let t = "";
853
823
  for (let n = 0; n < e.length; n++) {
854
824
  let r = e[n];
@@ -919,7 +889,6 @@ ${e}</tr>
919
889
  return t;
920
890
  }
921
891
  parseInline(e, t = this.renderer) {
922
- this.renderer.parser = this;
923
892
  let n = "";
924
893
  for (let r = 0; r < e.length; r++) {
925
894
  let i = e[r];
@@ -986,11 +955,11 @@ ${e}</tr>
986
955
  return n;
987
956
  }
988
957
  };
989
- var P = class {
958
+ var S = class {
990
959
  options;
991
960
  block;
992
961
  constructor(e) {
993
- this.options = e || O;
962
+ this.options = e || T;
994
963
  }
995
964
  static passThroughHooks = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
996
965
  static passThroughHooksRespectAsync = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"]);
@@ -1006,24 +975,24 @@ ${e}</tr>
1006
975
  emStrongMask(e) {
1007
976
  return e;
1008
977
  }
1009
- provideLexer(e = this.block) {
1010
- return e ? x.lex : x.lexInline;
978
+ provideLexer() {
979
+ return this.block ? x.lex : x.lexInline;
1011
980
  }
1012
- provideParser(e = this.block) {
1013
- return e ? b.parse : b.parseInline;
981
+ provideParser() {
982
+ return this.block ? b.parse : b.parseInline;
1014
983
  }
1015
984
  };
1016
- var D = class {
1017
- defaults = M();
985
+ var B = class {
986
+ defaults = L();
1018
987
  options = this.setOptions;
1019
988
  parse = this.parseMarkdown(true);
1020
989
  parseInline = this.parseMarkdown(false);
1021
990
  Parser = b;
1022
- Renderer = y;
991
+ Renderer = P;
1023
992
  TextRenderer = $;
1024
993
  Lexer = x;
1025
- Tokenizer = w;
1026
- Hooks = P;
994
+ Tokenizer = y;
995
+ Hooks = S;
1027
996
  constructor(...e) {
1028
997
  this.use(...e);
1029
998
  }
@@ -1071,7 +1040,7 @@ ${e}</tr>
1071
1040
  }
1072
1041
  "childTokens" in i && i.childTokens && (t.childTokens[i.name] = i.childTokens);
1073
1042
  }), r.extensions = t), n.renderer) {
1074
- let i = this.defaults.renderer || new y(this.defaults);
1043
+ let i = this.defaults.renderer || new P(this.defaults);
1075
1044
  for (let s in n.renderer) {
1076
1045
  if (!(s in i)) throw new Error(`renderer '${s}' does not exist`);
1077
1046
  if (["options", "parser"].includes(s)) continue;
@@ -1084,7 +1053,7 @@ ${e}</tr>
1084
1053
  r.renderer = i;
1085
1054
  }
1086
1055
  if (n.tokenizer) {
1087
- let i = this.defaults.tokenizer || new w(this.defaults);
1056
+ let i = this.defaults.tokenizer || new y(this.defaults);
1088
1057
  for (let s in n.tokenizer) {
1089
1058
  if (!(s in i)) throw new Error(`tokenizer '${s}' does not exist`);
1090
1059
  if (["options", "rules", "lexer"].includes(s)) continue;
@@ -1097,22 +1066,22 @@ ${e}</tr>
1097
1066
  r.tokenizer = i;
1098
1067
  }
1099
1068
  if (n.hooks) {
1100
- let i = this.defaults.hooks || new P();
1069
+ let i = this.defaults.hooks || new S();
1101
1070
  for (let s in n.hooks) {
1102
1071
  if (!(s in i)) throw new Error(`hook '${s}' does not exist`);
1103
1072
  if (["options", "block"].includes(s)) continue;
1104
1073
  let a = s, o = n.hooks[a], l = i[a];
1105
- P.passThroughHooks.has(s) ? i[a] = (p) => {
1106
- if (this.defaults.async && P.passThroughHooksRespectAsync.has(s)) return (async () => {
1107
- let d = await o.call(i, p);
1108
- return l.call(i, d);
1074
+ S.passThroughHooks.has(s) ? i[a] = (p) => {
1075
+ if (this.defaults.async && S.passThroughHooksRespectAsync.has(s)) return (async () => {
1076
+ let g = await o.call(i, p);
1077
+ return l.call(i, g);
1109
1078
  })();
1110
1079
  let c = o.call(i, p);
1111
1080
  return l.call(i, c);
1112
1081
  } : i[a] = (...p) => {
1113
1082
  if (this.defaults.async) return (async () => {
1114
- let d = await o.apply(i, p);
1115
- return d === false && (d = await l.apply(i, p)), d;
1083
+ let g = await o.apply(i, p);
1084
+ return g === false && (g = await l.apply(i, p)), g;
1116
1085
  })();
1117
1086
  let c = o.apply(i, p);
1118
1087
  return c === false && (c = l.apply(i, p)), c;
@@ -1146,16 +1115,16 @@ ${e}</tr>
1146
1115
  if (typeof n > "u" || n === null) return a(new Error("marked(): input parameter is undefined or null"));
1147
1116
  if (typeof n != "string") return a(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
1148
1117
  if (s.hooks && (s.hooks.options = s, s.hooks.block = e), s.async) return (async () => {
1149
- let o = s.hooks ? await s.hooks.preprocess(n) : n, p = await (s.hooks ? await s.hooks.provideLexer(e) : e ? x.lex : x.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(p) : p;
1118
+ let o = s.hooks ? await s.hooks.preprocess(n) : n, p = await (s.hooks ? await s.hooks.provideLexer() : e ? x.lex : x.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(p) : p;
1150
1119
  s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
1151
- let h = await (s.hooks ? await s.hooks.provideParser(e) : e ? b.parse : b.parseInline)(c, s);
1120
+ let h = await (s.hooks ? await s.hooks.provideParser() : e ? b.parse : b.parseInline)(c, s);
1152
1121
  return s.hooks ? await s.hooks.postprocess(h) : h;
1153
1122
  })().catch(a);
1154
1123
  try {
1155
1124
  s.hooks && (n = s.hooks.preprocess(n));
1156
- let l = (s.hooks ? s.hooks.provideLexer(e) : e ? x.lex : x.lexInline)(n, s);
1125
+ let l = (s.hooks ? s.hooks.provideLexer() : e ? x.lex : x.lexInline)(n, s);
1157
1126
  s.hooks && (l = s.hooks.processAllTokens(l)), s.walkTokens && this.walkTokens(l, s.walkTokens);
1158
- let c = (s.hooks ? s.hooks.provideParser(e) : e ? b.parse : b.parseInline)(l, s);
1127
+ let c = (s.hooks ? s.hooks.provideParser() : e ? b.parse : b.parseInline)(l, s);
1159
1128
  return s.hooks && (c = s.hooks.postprocess(c)), c;
1160
1129
  } catch (o) {
1161
1130
  return a(o);
@@ -1166,7 +1135,7 @@ ${e}</tr>
1166
1135
  return (n) => {
1167
1136
  if (n.message += `
1168
1137
  Please report this to https://github.com/markedjs/marked.`, e) {
1169
- let r = "<p>An error occurred:</p><pre>" + T(n.message + "", true) + "</pre>";
1138
+ let r = "<p>An error occurred:</p><pre>" + w(n.message + "", true) + "</pre>";
1170
1139
  return t ? Promise.resolve(r) : r;
1171
1140
  }
1172
1141
  if (t) return Promise.reject(n);
@@ -1174,38 +1143,38 @@ Please report this to https://github.com/markedjs/marked.`, e) {
1174
1143
  };
1175
1144
  }
1176
1145
  };
1177
- var L = new D();
1178
- function g(u3, e) {
1179
- return L.parse(u3, e);
1146
+ var _ = new B();
1147
+ function d(u3, e) {
1148
+ return _.parse(u3, e);
1180
1149
  }
1181
- g.options = g.setOptions = function(u3) {
1182
- return L.setOptions(u3), g.defaults = L.defaults, G(g.defaults), g;
1150
+ d.options = d.setOptions = function(u3) {
1151
+ return _.setOptions(u3), d.defaults = _.defaults, Z(d.defaults), d;
1183
1152
  };
1184
- g.getDefaults = M;
1185
- g.defaults = O;
1186
- g.use = function(...u3) {
1187
- return L.use(...u3), g.defaults = L.defaults, G(g.defaults), g;
1153
+ d.getDefaults = L;
1154
+ d.defaults = T;
1155
+ d.use = function(...u3) {
1156
+ return _.use(...u3), d.defaults = _.defaults, Z(d.defaults), d;
1188
1157
  };
1189
- g.walkTokens = function(u3, e) {
1190
- return L.walkTokens(u3, e);
1158
+ d.walkTokens = function(u3, e) {
1159
+ return _.walkTokens(u3, e);
1191
1160
  };
1192
- g.parseInline = L.parseInline;
1193
- g.Parser = b;
1194
- g.parser = b.parse;
1195
- g.Renderer = y;
1196
- g.TextRenderer = $;
1197
- g.Lexer = x;
1198
- g.lexer = x.lex;
1199
- g.Tokenizer = w;
1200
- g.Hooks = P;
1201
- g.parse = g;
1202
- var Qt = g.options;
1203
- var jt = g.setOptions;
1204
- var Ft = g.use;
1205
- var Ut = g.walkTokens;
1206
- var Kt = g.parseInline;
1207
- var Xt = b.parse;
1208
- var Jt = x.lex;
1161
+ d.parseInline = _.parseInline;
1162
+ d.Parser = b;
1163
+ d.parser = b.parse;
1164
+ d.Renderer = P;
1165
+ d.TextRenderer = $;
1166
+ d.Lexer = x;
1167
+ d.lexer = x.lex;
1168
+ d.Tokenizer = y;
1169
+ d.Hooks = S;
1170
+ d.parse = d;
1171
+ var Dt = d.options;
1172
+ var Ht = d.setOptions;
1173
+ var Zt = d.use;
1174
+ var Gt = d.walkTokens;
1175
+ var Nt = d.parseInline;
1176
+ var Ft = b.parse;
1177
+ var jt = x.lex;
1209
1178
 
1210
1179
  // src/sidebar.js
1211
1180
  var ChatSidebar = class extends HTMLElement {
@@ -1735,7 +1704,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
1735
1704
  }
1736
1705
 
1737
1706
  // src/chatbot.js
1738
- g.setOptions({
1707
+ d.setOptions({
1739
1708
  breaks: true,
1740
1709
  gfm: true
1741
1710
  });
@@ -2459,9 +2428,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
2459
2428
  const decoder = new TextDecoder("utf-8");
2460
2429
  let buffer = "";
2461
2430
  let accumulatedAnswer = "";
2462
- let lastStatusMessage = "";
2463
2431
  let accumulatedImages = [];
2464
- let historyAccumulatedImages = [];
2465
2432
  let currentDisplayText = "";
2466
2433
  let animationFrameId = null;
2467
2434
  let lastRenderedLength = 0;
@@ -2499,7 +2466,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
2499
2466
  }
2500
2467
  const newText = data.text;
2501
2468
  accumulatedAnswer += newText;
2502
- const words = newText.split(" ");
2503
2469
  if (!animationFrameId) {
2504
2470
  let lastTime = performance.now();
2505
2471
  const animate = (now) => {
@@ -2514,7 +2480,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
2514
2480
  currentDisplayText = accumulatedAnswer.slice(0, lastRenderedLength);
2515
2481
  const safeText = this.ensureClosedCodeBlock(currentDisplayText);
2516
2482
  const cleanReply = this.fixMarkdown(safeText);
2517
- contentDiv.innerHTML = g.parse(cleanReply);
2483
+ contentDiv.innerHTML = d.parse(cleanReply);
2518
2484
  }
2519
2485
  if (lastRenderedLength < accumulatedAnswer.length) {
2520
2486
  animationFrameId = requestAnimationFrame(animate);
@@ -2529,7 +2495,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
2529
2495
  statusDiv.remove();
2530
2496
  typingDiv.style.display = "none";
2531
2497
  const cleanReply = this.fixMarkdown(accumulatedAnswer);
2532
- const htmlReply = g.parse(cleanReply);
2498
+ const htmlReply = d.parse(cleanReply);
2533
2499
  contentDiv.innerHTML = htmlReply;
2534
2500
  const images = accumulatedImages;
2535
2501
  if (images?.length > 0) {
@@ -2695,7 +2661,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
2695
2661
  body.innerHTML = `<div class="message bot">Loading conversation...</div>`;
2696
2662
  try {
2697
2663
  const res = await fetch(
2698
- "http://45.195.82.92:2002/customer/user_session_chats",
2664
+ "https://pat.echnotek.com:2002/customer/user_session_chats",
2699
2665
  {
2700
2666
  method: "POST",
2701
2667
  headers: {
@@ -2736,7 +2702,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
2736
2702
  const cleanReply = this.fixMarkdown(content);
2737
2703
  const contentDiv = document.createElement("div");
2738
2704
  contentDiv.className = "content";
2739
- contentDiv.innerHTML = g.parse(cleanReply);
2705
+ contentDiv.innerHTML = d.parse(cleanReply);
2740
2706
  wrapper.appendChild(contentDiv);
2741
2707
  } else {
2742
2708
  wrapper.textContent = content;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "advaisor-chatbot",
3
- "version": "1.8.0",
3
+ "version": "1.11.0",
4
4
  "description": "Embeddable chatbot component",
5
5
  "main": "dist/testchatbot.js",
6
6
  "scripts": {