@alwith/module-chat 0.1.26 → 0.1.28

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 (97) hide show
  1. package/dist/activity-host.js +1 -1
  2. package/dist/approval/choice-elicitation-form.js +1 -1
  3. package/dist/approval/permission-options.js +1 -1
  4. package/dist/approval/permission-view.js +1 -1
  5. package/dist/approval/schema-elicitation-form.js +1 -1
  6. package/dist/approval/url-elicitation-card.js +1 -1
  7. package/dist/chunk-25na55ve.js +2 -0
  8. package/dist/{chunk-ymka3s33.js → chunk-341yykkp.js} +1 -1
  9. package/dist/{chunk-10yvvt3h.js → chunk-70sfgw0j.js} +2 -2
  10. package/dist/{chunk-9npx3fhh.js → chunk-74phx7h8.js} +1 -1
  11. package/dist/{chunk-xgy0heva.js → chunk-7pr2j1zb.js} +1 -1
  12. package/dist/{chunk-e05fnqjq.js → chunk-7tj0a2na.js} +2 -2
  13. package/dist/{chunk-0wtckvss.js → chunk-8zs8vy0q.js} +1 -1
  14. package/dist/{chunk-vghme4ag.js → chunk-9me7jmzd.js} +2 -2
  15. package/dist/{chunk-h7vdhe9r.js → chunk-awbgf3hp.js} +2 -2
  16. package/dist/{chunk-gsn2bext.js → chunk-ax9ganqr.js} +2 -2
  17. package/dist/{chunk-1cy1j8gj.js → chunk-bhvtt6tv.js} +2 -2
  18. package/dist/chunk-darkfx1b.js +2 -0
  19. package/dist/{chunk-3rttyj3m.js → chunk-etvhn65g.js} +2 -2
  20. package/dist/{chunk-f5syjtnd.js → chunk-f20xh0z9.js} +1 -1
  21. package/dist/chunk-g20b01rn.js +2 -0
  22. package/dist/{chunk-c54yh2t2.js → chunk-ghfbzhnb.js} +1 -1
  23. package/dist/{chunk-mfphmgy1.js → chunk-gycty1x1.js} +2 -2
  24. package/dist/{chunk-f773g8wv.js → chunk-hnt4tt1n.js} +2 -2
  25. package/dist/{chunk-6yc96p86.js → chunk-hy1x2td2.js} +1 -1
  26. package/dist/{chunk-8d3t4bmf.js → chunk-k1c0jrk1.js} +1 -1
  27. package/dist/{chunk-bgmsrs7h.js → chunk-kj1wrn2j.js} +1 -1
  28. package/dist/{chunk-ekhe60qa.js → chunk-kzccs8ak.js} +2 -2
  29. package/dist/{chunk-gj85c3gx.js → chunk-p9wpghey.js} +2 -2
  30. package/dist/{chunk-n9mnvxs4.js → chunk-qj8r5xvx.js} +2 -2
  31. package/dist/{chunk-2kb5qj2v.js → chunk-qyhgwc51.js} +2 -2
  32. package/dist/{chunk-55zxk0m8.js → chunk-rakd7vzb.js} +1 -1
  33. package/dist/chunk-reqrpvyy.js +2 -0
  34. package/dist/{chunk-1nr8t8ar.js → chunk-s0nhgptn.js} +1 -1
  35. package/dist/{chunk-095yr4wk.js → chunk-s28x10qd.js} +1 -1
  36. package/dist/{chunk-6zj9rdvw.js → chunk-s3z33k7f.js} +1 -1
  37. package/dist/{chunk-6c610cwg.js → chunk-skx67pc6.js} +1 -1
  38. package/dist/{chunk-fr3n6fk5.js → chunk-swg5v7sg.js} +2 -2
  39. package/dist/{chunk-8n7st0js.js → chunk-wc3patey.js} +2 -2
  40. package/dist/{chunk-7fn3yt0k.js → chunk-wtkv29ba.js} +1 -1
  41. package/dist/{chunk-6rrnp8ha.js → chunk-y2xbq7rb.js} +3 -3
  42. package/dist/{chunk-etj5bb5a.js → chunk-ynga7fm4.js} +3 -3
  43. package/dist/codex/activity-group.js +1 -1
  44. package/dist/codex/assistant-message.js +2 -2
  45. package/dist/codex/async-question-card.js +1 -1
  46. package/dist/codex/edited-files-card.js +1 -1
  47. package/dist/codex/image-view-activity.js +1 -1
  48. package/dist/codex/markdown-renderer.js +4 -4
  49. package/dist/codex/navigation-rail.css +216 -1
  50. package/dist/codex/navigation-rail.js +1 -1
  51. package/dist/codex/thread-virtualizer.js +1 -1
  52. package/dist/codex/user-message.js +1 -1
  53. package/dist/codex/virtualized-turn-list.js +1 -1
  54. package/dist/composer/completion-filter.js +1 -1
  55. package/dist/composer/completion-menu.js +2 -2
  56. package/dist/composer/completion-trigger.js +1 -1
  57. package/dist/composer/effort-slider.js +1 -1
  58. package/dist/composer/menu-radio.js +1 -1
  59. package/dist/composer/model-select.js +1 -1
  60. package/dist/composer/permission-mode-select.js +1 -1
  61. package/dist/composer/prompt-input-attachments.js +1 -1
  62. package/dist/composer/prompt-input-clipboard.js +1 -1
  63. package/dist/composer/prompt-input-context.js +1 -1
  64. package/dist/composer/prompt-input-textarea.js +1 -1
  65. package/dist/composer/prompt-input.js +1 -1
  66. package/dist/image-preview-dialog.js +1 -1
  67. package/dist/lib/code-highlighter.js +1 -1
  68. package/dist/lib/fuzzy.js +1 -1
  69. package/dist/lib/group-blocks.js +1 -1
  70. package/dist/lib/limits.js +1 -1
  71. package/dist/lib/markdown-parser.js +1 -1
  72. package/dist/lib/markdown-parser.worker.js +66 -1
  73. package/dist/lib/markdown-rules.js +1 -1
  74. package/dist/lib/model-name.js +1 -1
  75. package/dist/lib/pointer-centered-zoom.js +1 -1
  76. package/dist/lib/stream-style.js +1 -1
  77. package/dist/lib/streaming-markdown.js +2 -1
  78. package/dist/search/chat-search.js +1 -1
  79. package/dist/search/dom-matches.js +1 -1
  80. package/dist/search/find-bar.js +1 -1
  81. package/dist/search/literal-matches.js +1 -1
  82. package/dist/ui/badge.js +1 -1
  83. package/dist/ui/button.js +1 -1
  84. package/dist/ui/card.js +1 -1
  85. package/dist/ui/dialog.js +1 -1
  86. package/dist/ui/dropdown-menu.js +1 -1
  87. package/dist/ui/field.js +1 -1
  88. package/dist/ui/input-group.js +1 -1
  89. package/dist/ui/separator.js +1 -1
  90. package/dist/ui/switch.js +1 -1
  91. package/dist/ui/tooltip.js +1 -1
  92. package/package.json +10 -3
  93. package/dist/chunk-1s523gek.js +0 -2
  94. package/dist/chunk-am0ge8nt.js +0 -2
  95. package/dist/chunk-gp69a45h.js +0 -2
  96. package/dist/chunk-j9hhbm77.js +0 -3
  97. package/dist/chunk-zb5h5p7y.js +0 -2
@@ -1 +1 @@
1
- import{Ft,Dt,Je,Ht,ae}from"../chunk-1s523gek.js";export{Ft as BYTES_PER_MB,Dt as MAX_TOTAL_IMAGE_BYTES,ae as MAX_TOTAL_IMAGE_MB,Je as exceedsImageLimit,Ht as formatImageSizeMb};
1
+ import{At,Ft,Ze,Dt,ae}from"../chunk-reqrpvyy.js";export{At as BYTES_PER_MB,Ft as MAX_TOTAL_IMAGE_BYTES,ae as MAX_TOTAL_IMAGE_MB,Ze as exceedsImageLimit,Dt as formatImageSizeMb};
@@ -1 +1 @@
1
- import{ie,Ye}from"../chunk-gp69a45h.js";export{ie as cachedMarkdown,Ye as createMarkdownParser};
1
+ import{ie,Xe}from"../chunk-g20b01rn.js";export{ie as cachedMarkdown,Xe as createMarkdownParser};
@@ -1 +1,66 @@
1
- import"../chunk-vghme4ag.js";import{Xe}from"../chunk-j9hhbm77.js";var t=new Map;self.onmessage=(a)=>{let s=a.data;if(s.type==="dispose"){t.delete(s.clientId);return}let{clientId:r,revision:n,source:d}=s,o;try{let e=t.get(r);if(e===void 0)e=Xe(),t.set(r,e);o={clientId:r,revision:n,ok:!0,tokens:e.parse(d)}}catch(e){o={clientId:r,revision:n,ok:!1,error:e instanceof Error?e.message:String(e)}}self.postMessage(o)};
1
+ function U(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var T=U();function Fe(t){T=t}var S={exec:()=>null};function v(t){let e=[];return(r)=>{let s=Math.max(0,Math.min(3,r-1)),n=e[s];return n||(n=t(s),e[s]=n),n}}function g(t,e=""){let r=typeof t=="string"?t:t.source,s={replace:(n,i)=>{let l=typeof i=="string"?i:i.source;return l=l.replace(m.caret,"$1"),r=r.replace(n,l),s},getRegex:()=>new RegExp(r,e)};return s}var Qe=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),m={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,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,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,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:(t)=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:v((t)=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:v((t)=>new RegExp(`^ {0,${t}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:v((t)=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:v((t)=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:v((t)=>new RegExp(`^ {0,${t}}(?:</?(?:${q})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,"i")),blockquoteBeginRegex:v((t)=>new RegExp(`^ {0,${t}}>`))},He=/^(?:[ \t]*(?:\n|$))+/,Ne=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,We=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,M=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ge=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,K=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,be=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,we=g(be).replace(/bull/g,K).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}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Xe=g(be).replace(/bull/g,K).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}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),J=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Ue=/^[^\n]+/,V=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ke=g(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",V).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Je=g(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,K).getRegex(),q="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",Y=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ve=g("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",Y).replace("tag",q).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ee=(t)=>g(J).replace("hr",M).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",t).replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",q).getRegex(),Ye=Ee(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),et=Ee(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),tt=g(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",et).getRegex(),ee={blockquote:tt,code:Ne,def:Ke,fences:We,heading:Ge,hr:M,html:Ve,lheading:we,list:Je,newline:He,paragraph:Ye,table:S,text:Ue},he=g("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",M).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",q).getRegex(),rt={...ee,lheading:Xe,table:he,paragraph:g(J).replace("hr",M).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",he).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",q).getRegex()},nt={...ee,html:g(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Y).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:S,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:g(J).replace("hr",M).replace("heading",` *#{1,6} *[^
2
+ ]`).replace("lheading",we).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},st=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,it=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ae=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,lt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,y=/[\p{P}\p{S}]/u,P=/[\s\p{P}\p{S}]/u,O=/[^\s\p{P}\p{S}]/u,at=g(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,P).getRegex(),ut=/[\p{Pi}\p{Ps}"']/u,$e=/(?!~)[\p{P}\p{S}]/u,ot=/(?!~)[\s\p{P}\p{S}]/u,ct=/(?:[^\s\p{P}\p{S}]|~)/u,ht=g(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Qe?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ce=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,pt=g(Ce,"u").replace(/punct/g,y).getRegex(),gt=g(Ce,"u").replace(/punct/g,$e).getRegex(),dt=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,ft=g(dt,"u").replace(/openQuote/g,ut).replace(/punct/g,y).getRegex(),ye="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",kt=g(ye,"gu").replace(/notPunctSpace/g,O).replace(/punctSpace/g,P).replace(/punct/g,y).getRegex(),xt=g(ye,"gu").replace(/notPunctSpace/g,ct).replace(/punctSpace/g,ot).replace(/punct/g,$e).getRegex(),Dt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",_t=g(Dt,"gu").replace(/notPunctSpace/g,O).replace(/punctSpace/g,P).replace(/punct/g,y).getRegex(),mt=g("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,O).replace(/punctSpace/g,P).replace(/punct/g,y).getRegex(),Ft="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",bt=g(Ft,"gu").replace(/notPunctSpace/g,O).replace(/punctSpace/g,P).replace(/punct/g,y).getRegex(),wt=g(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,y).getRegex(),Et="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",At=g(Et,"gu").replace(/notPunctSpace/g,O).replace(/punctSpace/g,P).replace(/punct/g,y).getRegex(),$t=g(/\\(punct)/,"gu").replace(/punct/g,y).getRegex(),Ct=g(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,"gu").replace(/punct/g,y).getRegex(),yt=g(/^<(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(),zt=g(Y).replace("(?:-->|$)","-->").getRegex(),Rt=g("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",zt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ze=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Q=g(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",ze).getRegex(),St=g(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",Q).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Bt=g(/^!?\[(label)\]\[(ref)\]/).replace("label",Q).replace("ref",V).getRegex(),Tt=g(/^!?\[(ref)\](?:\[\])?/).replace("ref",V).getRegex(),pe=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,vt=g(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",ze).getRegex(),Pt=g("reflink|nolink(?!\\()","g").replace("reflink",g(/^!?\[(label)\]\[(ref)\]/).replace("label",vt).replace("ref",pe).getRegex()).replace("nolink",g(/^!?\[(ref)\](?:\[\])?/).replace("ref",pe).getRegex()).getRegex(),ge=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,It=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,Lt=g(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,It).getRegex(),te={_backpedal:S,anyPunctuation:$t,anyPunctuationOutsideCode:Ct,autolink:yt,blockSkip:ht,br:Ae,code:it,del:S,delLDelim:S,delRDelim:S,emStrongLDelim:pt,emStrongRDelimAst:kt,emStrongRDelimUnd:mt,escape:st,link:St,nolink:Tt,punctuation:at,reflink:Bt,reflinkSearch:Pt,tag:Rt,text:lt,url:S},Zt={...te,emStrongLDelim:ft,emStrongRDelimAst:_t,emStrongRDelimUnd:bt,link:g(/^!?\[(label)\]\((.*?)\)/).replace("label",Q).getRegex(),reflink:g(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Q).getRegex()},X={...te,emStrongRDelimAst:xt,emStrongLDelim:gt,delLDelim:wt,delRDelim:At,url:g(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",Lt).replace("protocol",ge).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:g(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",ge).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},Mt={...X,br:g(Ae).replace("{2,}","*").getRegex(),text:g(X.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},j={normal:ee,gfm:rt,pedantic:nt},L={normal:te,gfm:X,breaks:Mt,pedantic:Zt},qt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},de=(t)=>qt[t];function b(t,e){if(e){if(m.escapeTest.test(t))return t.replace(m.escapeReplace,de)}else if(m.escapeTestNoEncode.test(t))return t.replace(m.escapeReplaceNoEncode,de);return t}function Ot(t){return m.numericCharacterReference.test(t)?t.replace(m.numericCharacterReferenceOrAmpersand,(e,r,s)=>{if(r===void 0&&s===void 0)return"&amp;";let n=r===void 0?Number.parseInt(s,16):Number.parseInt(r,10);return n===0||n>1114111||n>=55296&&n<=57343?"�":n===38?"&amp;":String.fromCodePoint(n)}):t}function fe(t){try{t=encodeURI(t).replace(m.percentDecode,"%")}catch{return null}return t}function ke(t,e){let r=t.replace(m.findPipe,(i,l,a)=>{let c=!1,u=l;for(;--u>=0&&a[u]==="\\";)c=!c;return c?"|":" |"}),s=r.split(m.splitPipe),n=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;n<s.length;n++)s[n]=s[n].trim().replace(m.slashPipe,"|");return s}function z(t,e,r){let s=t.length;if(s===0)return"";let n=0;for(;n<s;){let i=t.charAt(s-n-1);if(i===e&&!r)n++;else if(i!==e&&r)n++;else break}return t.slice(0,s-n)}function xe(t){let e=t.split(`
3
+ `),r=e.length-1;for(;r>=0&&m.blankLine.test(e[r]);)r--;return e.length-r<=2?t:e.slice(0,r+1).join(`
4
+ `)}function H(t){return t.trim().toLowerCase().toUpperCase().toLowerCase()}function De(t,e){if(t.indexOf(e[0])===-1&&t.indexOf(e[1])===-1)return-1;let r=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])r++;else if(t[s]===e[1]&&(r--,r<0))return s;return r>0?-2:-1}function G(t,e=0){let r=e,s="";for(let n of t)if(n==="\t"){let i=4-r%4;s+=" ".repeat(i),r+=i}else s+=n,r++;return s}function _e(t,e,r,s,n){let i=e.href,l=e.title||null,a=t[1].replace(n.other.outputLinkReplace,"$1"),c=t[0].charAt(0)==="!",u=s.state.inLink,o=s.state.linkEmitted,p=s.state.inRawBlock;s.state.inLink=!0,s.state.linkEmitted=!1;let k=s.inlineTokens(a),h=s.state.linkEmitted;if(s.state.linkEmitted=o,s.state.inLink=u,!c){if(h){s.state.inRawBlock=p;return}s.state.linkEmitted=!0}return{type:c?"image":"link",raw:r,href:i,title:l,text:a,tokens:k}}function jt(t,e,r){let s=t.match(r.other.indentCodeCompensation);if(s===null)return e;let n=s[1];return e.split(`
5
+ `).map((i)=>{let l=i.match(r.other.beginningSpace);if(l===null)return i;let[a]=l;return i.slice(Math.min(a.length,n.length))}).join(`
6
+ `)}function me(t,e,r,s){if(!e.includes("<"))return!1;for(let n=0;n<e.length;n++){if(e[n]==="\\"){n++;continue}if(e[n]==="`"){let a=s.inline.code.exec(e.slice(n));if(a){n+=a[0].length-1;continue}}if(e[n]!=="<")continue;let i=t.slice(r+n),l=s.inline.tag.exec(i)||s.inline.autolink.exec(i);if(l){if(l[0].length>e.length-n)return!0;n+=l[0].length-1}}return!1}var N=class{options;rules;lexer;constructor(t){this.options=t||T}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let r=this.options.pedantic?e[0]:xe(e[0]),s=r.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r,codeBlockStyle:"indented",text:s}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let r=e[0],s=jt(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){let s=z(r,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceTabChar.test(s))&&(r=s.trim())}return{type:"heading",raw:z(e[0],`
7
+ `),depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:z(e[0],`
8
+ `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let r=z(e[0],`
9
+ `).split(`
10
+ `),s="",n="",i=[];for(;r.length>0;){let l=!1,a=[],c;for(c=0;c<r.length;c++)if(this.rules.other.blockquoteStart.test(r[c]))a.push(r[c]),l=!0;else if(!l)a.push(r[c]);else break;r=r.slice(c);let u=a.join(`
11
+ `),o=u.replace(this.rules.other.blockquoteSetextReplace,`
12
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
13
+ ${u}`:u,n=n?`${n}
14
+ ${o}`:o;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(o,i,!0),this.lexer.state.top=p,r.length===0)break;let k=i.at(-1);if(k?.type==="code"||k?.type==="heading"||k?.type==="hr"||k?.type==="html")break;if(k?.type==="blockquote"){let h=k,x=r.join(`
15
+ `),_=h.raw+`
16
+ `+x.replace(this.rules.other.blockquoteSetextReplace2,""),f=this.blockquote(_);i[i.length-1]=f;let F=_.substring(f.raw.length).replace(/^\n/,""),d=F?F.split(`
17
+ `).length:0,w=d?r.slice(0,-d):r;w.length>0&&(s=`${s}
18
+ ${w.join(`
19
+ `)}`),n=n.substring(0,n.length-h.text.length)+f.text;break}else if(k?.type==="list"){let h=k,x=h.raw+`
20
+ `+r.join(`
21
+ `),_=this.list(x);i[i.length-1]=_,s=s.substring(0,s.length-k.raw.length)+_.raw,n=n.substring(0,n.length-h.raw.length)+_.raw,r=x.substring(i.at(-1).raw.length).split(`
22
+ `);continue}}return{type:"blockquote",raw:s,tokens:i,text:n}}}list(t){let e=this.rules.block.list.exec(t);if(e){let r=t,s=()=>r.length-t.length,n=e[1].trim(),i=n.length>1,l={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let a=this.rules.other.listItemRegex(n),c=!1;for(;t;){let o=!1,p="";if(!(e=a.exec(t))||this.rules.block.hr.test(t))break;let k=s();t=t.substring(e[0].length);let h=e[2].split(`
23
+ `,1)[0],x=e[1].length,_=this.options.pedantic?G(h,x):h.replace(this.rules.other.leadingSpaceTab,(C)=>G(C,x)),f=t.split(`
24
+ `,1)[0],F=!_.trim(),d=0;if(this.options.pedantic?(d=2,p=_.trimStart()):F?d=x+1:(d=_.search(this.rules.other.nonSpaceChar),d=d>4?1:d,p=_.slice(d),d+=x),F&&this.rules.other.blankLine.test(f)&&(t=t.substring(f.length+1),o=!0),!o){let C=this.rules.other.nextBulletRegex(d),ae=this.rules.other.hrRegex(d),ue=this.rules.other.fencesBeginRegex(d),oe=this.rules.other.headingBeginRegex(d),qe=this.rules.other.htmlBeginRegex(d),Oe=this.rules.other.blockquoteBeginRegex(d);for(;t;){let ce=t.split(`
25
+ `,1)[0],I;if(f=ce,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),I=f):I=f.replace(this.rules.other.leadingSpaceTab,(je)=>G(je)),ue.test(f)||oe.test(f)||qe.test(f)||Oe.test(f)||C.test(f)||ae.test(f))break;if(I.search(this.rules.other.nonSpaceChar)>=d||!f.trim())p+=`
26
+ `+I.slice(d);else{if(F||_.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||ue.test(_)||oe.test(_)||ae.test(_))break;p+=`
27
+ `+f}F=!f.trim(),t=t.substring(ce.length+1),_=I.slice(d)}}let w=r.slice(k,s());l.loose||(c?l.loose=!0:this.rules.other.doubleBlankLine.test(w)&&(c=!0)),l.items.push({type:"list_item",raw:w,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]})}let u=l.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;l.raw=r.slice(0,s()).trimEnd();for(let o of l.items)if(this.lexer.state.top=!1,o.tokens=this.lexer.blockTokens(o.text,[]),!l.loose){let p=o.tokens.filter((h)=>h.type==="space"),k=p.length>0&&p.some((h)=>this.rules.other.anyLine.test(h.raw));l.loose=k}for(let o of l.items){let p=o.tokens[0];if(o.task&&(p?.type==="text"||p?.type==="paragraph")){o.text=o.text.replace(this.rules.other.listReplaceTask,""),p.raw=p.raw.replace(this.rules.other.listReplaceTask,""),p.text=p.text.replace(this.rules.other.listReplaceTask,"");for(let h=this.lexer.inlineQueue.length-1;h>=0;h--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)){this.lexer.inlineQueue[h].src=this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask,"");break}let k=this.rules.other.listTaskCheckbox.exec(o.raw);if(k){let h={type:"checkbox",raw:k[0]+" ",checked:k[0]!=="[ ]"};o.checked=h.checked,l.loose?o.tokens[0]&&["paragraph","text"].includes(o.tokens[0].type)&&"tokens"in o.tokens[0]&&o.tokens[0].tokens?(o.tokens[0].raw=h.raw+o.tokens[0].raw,o.tokens[0].text=h.raw+o.tokens[0].text,o.tokens[0].tokens.unshift(h)):o.tokens.unshift({type:"paragraph",raw:h.raw,text:h.raw,tokens:[h]}):o.tokens.unshift(h)}}else o.task&&(o.task=!1)}if(l.loose)for(let o of l.items){o.loose=!0;for(let p of o.tokens)p.type==="text"&&(p.type="paragraph")}return l}}html(t){let e=this.rules.block.html.exec(t);if(e){let r=xe(e[0]);return{type:"html",block:!0,raw:r,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:r}}}def(t){let e=this.rules.block.def.exec(t);if(e){if(!this.rules.other.startAngleBracket.test(e[2])&&De(e[2],"()")!==-1)return;let r=H(e[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:z(e[0],`
28
+ `),href:s,title:n}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=ke(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
29
+ `):[],i={type:"table",raw:z(e[0],`
30
+ `),header:[],align:[],rows:[]};if(r.length===s.length){for(let l of s)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l<r.length;l++)i.header.push({text:r[l],tokens:this.lexer.inline(r[l]),header:!0,align:i.align[l]});for(let l of n)i.rows.push(ke(l,i.header.length).map((a,c)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:i.align[c]})));return i}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let r=e[1].trim();return{type:"heading",raw:z(e[0],`
31
+ `),depth:e[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let r=e[1].charAt(e[1].length-1)===`
32
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){if(this.lexer.state.linkParenPossible===!1)return;let e=this.rules.inline.link.exec(t);if(e){let r=e[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&me(t,e[1],r,this.rules))return;let s=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let l=z(s.slice(0,-1),"\\");if((s.length-l.length)%2===0)return}else{let l=De(e[2],"()");if(l===-2)return;if(l>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+l;e[2]=e[2].substring(0,l),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let n=e[2],i="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(n);l&&(n=l[1],i=l[3])}else i=e[3]?e[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?n=n.slice(1):n=n.slice(1,-1)),_e(e,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let s=r[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&me(t,r[1],s,this.rules))return;let n=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[H(n)];if(!i){let l=r[0].charAt(0);return{type:"text",raw:l,text:l}}return _e(r,i,r[0],this.lexer,this.rules)}}emStrong(t,e,r=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&r.match(this.rules.other.unicodeAlphaNumeric))return;if(!(s[1]||s[3])||!r||this.rules.inline.punctuation.exec(r)){let n=[...s[0]].length-1,i,l,a=n,c=0,u=s[0][0],o=r===u,p=u==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,e=e.slice(-1*t.length+n);(s=p.exec(e))!==null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(l=[...i].length,s[3]||s[4]){a+=l;continue}else if(s[5]||s[6]){if(n%3&&!((n+l)%3)){c+=l;continue}if(o)break}if(a-=l,a>0)continue;l=Math.min(l,l+a+c);let k=[...s[0]][0].length,h=t.slice(0,n+s.index+k+l);if(Math.min(n,l)%2){let _=h.slice(1,-1);return{type:"em",raw:h,text:_,tokens:this.lexer.inlineTokens(_)}}let x=h.slice(2,-2);return{type:"strong",raw:h,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(r),n=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return s&&n&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,r=""){let s=this.rules.inline.delLDelim.exec(t);if(!s)return;if(!s[1]||!r||this.rules.inline.punctuation.exec(r)){let n=[...s[0]].length-1,i,l,a=n,c=this.rules.inline.delRDelim;for(c.lastIndex=0,e=e.slice(-1*t.length+n);(s=c.exec(e))!==null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i||(l=[...i].length,l!==n))continue;if(s[3]||s[4]){a+=l;continue}if(a-=l,a>0)continue;l=Math.min(l,l+a);let u=[...s[0]][0].length,o=t.slice(0,n+s.index+u+l),p=o.slice(n,-n);return{type:"del",raw:o,text:p,tokens:this.lexer.inlineTokens(p)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let r,s;return e[2]==="@"?(r=e[1],s="mailto:"+r):(r=e[1],s=r),{type:"link",raw:e[0],text:r,href:s,autolink:!0,tokens:[{type:"text",raw:r,text:r}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let r,s;if(e[2]==="@")r=e[0],s="mailto:"+r;else{let n;do n=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(n!==e[0]);r=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:r,href:s,autolink:!0,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:r?e[0]:Ot(e[0]),escaped:r}}}},E=class t{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||T,this.options.tokenizer=this.options.tokenizer||new N,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let r={other:m,block:j.normal,inline:L.normal};this.options.pedantic?(r.block=j.pedantic,r.inline=L.pedantic):this.options.gfm&&(r.block=j.gfm,this.options.breaks?r.inline=L.breaks:r.inline=L.gfm),this.tokenizer.rules=r}static get rules(){return{block:j,inline:L}}static lex(e,r){return new t(r).lex(e)}static lexInline(e,r){return new t(r).inlineTokens(e)}lex(e){e=e.replace(m.carriageReturn,`
33
+ `),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let s=this.inlineQueue[r];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],s=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(m.tabCharGlobal," ").replace(m.spaceLine,""));let n=1/0;for(;e;){if(e.length<n)n=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some((a)=>(i=a.call({lexer:this},e,r))?(e=e.substring(i.raw.length),r.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let a=r.at(-1);i.raw.length===1&&a!==void 0?a.raw+=`
34
+ `:r.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
35
+ `)?"":`
36
+ `)+i.raw,a.text+=`
37
+ `+i.text,this.inlineQueue.at(-1).src=a.text):r.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
38
+ `)?"":`
39
+ `)+i.raw,a.text+=`
40
+ `+i.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},r.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),r.push(i);continue}let l=e;if(this.options.extensions?.startBlock){let a=1/0,c=e.slice(1),u;this.options.extensions.startBlock.forEach((o)=>{u=o.call({lexer:this},c),typeof u=="number"&&u>=0&&(a=Math.min(a,u))}),a<1/0&&a>=0&&(l=e.substring(0,a+1))}if(this.state.top&&(i=this.tokenizer.paragraph(l))){let a=r.at(-1);s&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
41
+ `)?"":`
42
+ `)+i.raw,a.text+=`
43
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(i),s=l.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let a=r.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
44
+ `)?"":`
45
+ `)+i.raw,a.text+=`
46
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}linkInText(e){if(!e.includes("["))return!1;let r=this.tokenizer.rules.inline.link;for(let s of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(r.test(s[0])&&e.charAt(s.index-1)!=="!")return!0;for(let s of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let n=s[0],i=n.lastIndexOf("[");if(!(n.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,H(n.slice(i+1,-1))))&&!(i>1&&this.linkInText(n.slice(1,i-1))))return!0}return!1}inlineTokens(e,r=[]){this.tokenizer.lexer=this;let s=this.state.linkParenPossible;this.state.linkParenPossible=s&&e.includes(")");try{return this.#e(e,r)}finally{this.state.linkParenPossible=s}}#e(e,r){let s=e;if(this.tokens.links&&e.includes("[")){let a=this.tokenizer.rules.inline.reflinkSearch,c=(u)=>{let o=u.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,H(u.slice(o+1,-1))))return u;if(o>1&&u.charAt(0)!=="!"){let p=u.slice(1,o-1);if(this.linkInText(p))return"["+p.replace(a,c)+"]["+"a".repeat(u.length-o-2)+"]"}return"["+"a".repeat(u.length-2)+"]"};s=s.replace(a,c)}s=s.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(a,c,u)=>u?"+".repeat(a.length):c?c+a.slice(c.length,-c.length).replace(/`/g,"+")+c:a),s=s.replace(this.tokenizer.rules.inline.blockSkip,(a,c,u)=>{let o=u?u.length:0;return a.slice(0,o)+"["+"a".repeat(a.length-o-2)+"]"}),s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let n=!1,i="",l=1/0;for(;e;){if(e.length<l)l=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}n||(i=""),n=!1;let a;if(this.options.extensions?.inline?.some((u)=>(a=u.call({lexer:this},e,r))?(e=e.substring(a.raw.length),r.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let u=r.at(-1);a.type==="text"&&u?.type==="text"?(u.raw+=a.raw,u.text+=a.text):r.push(a);continue}if(a=this.tokenizer.emStrong(e,s,i)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.del(e,s,i)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),r.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),r.push(a);continue}let c=e;if(this.options.extensions?.startInline){let u=1/0,o=e.slice(1),p;this.options.extensions.startInline.forEach((k)=>{p=k.call({lexer:this},o),typeof p=="number"&&p>=0&&(u=Math.min(u,p))}),u<1/0&&u>=0&&(c=e.substring(0,u+1))}if(a=this.tokenizer.inlineText(c)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(i=a.raw.slice(-1)),n=!0;let u=r.at(-1);u?.type==="text"?(u.raw+=a.raw,u.text+=a.text):r.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return r}infiniteLoopError(e){let r="Infinite loop on byte: "+e;if(this.options.silent)console.error(r);else throw Error(r)}},W=class{options;parser;constructor(t){this.options=t||T}space(t){return""}code({text:t,lang:e,escaped:r}){let s=(e||"").match(m.notSpaceStart)?.[0],n=t?t.replace(m.endingNewline,"")+`
47
+ `:"";return s?'<pre><code class="language-'+b(s)+'">'+(r?n:b(n,!0))+`</code></pre>
48
+ `:"<pre><code>"+(r?n:b(n,!0))+`</code></pre>
49
+ `}blockquote({tokens:t}){return`<blockquote>
50
+ ${this.parser.parse(t)}</blockquote>
51
+ `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
52
+ `}hr(t){return`<hr>
53
+ `}list(t){let{ordered:e,start:r}=t,s="";for(let l=0;l<t.items.length;l++){let a=t.items[l];s+=this.listitem(a)}let n=e?"ol":"ul",i=e&&r!==1?' start="'+r+'"':"";return"<"+n+i+`>
54
+ `+s+"</"+n+`>
55
+ `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
56
+ `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
57
+ `}table(t){let e="",r="";for(let n=0;n<t.header.length;n++)r+=this.tablecell(t.header[n]);e+=this.tablerow({text:r});let s="";for(let n=0;n<t.rows.length;n++){let i=t.rows[n];r="";for(let l=0;l<i.length;l++)r+=this.tablecell(i[l]);s+=this.tablerow({text:r})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
58
+ <thead>
59
+ `+e+`</thead>
60
+ `+s+`</table>
61
+ `}tablerow({text:t}){return`<tr>
62
+ ${t}</tr>
63
+ `}tablecell(t){let e=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`</${r}>
64
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${b(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,text:r,tokens:s,autolink:n}){let i=n?b(r,!0):this.parser.parseInline(s),l=fe(t);if(l===null)return i;t=b(l,n);let a='<a href="'+t+'"';return e&&(a+=' title="'+b(e)+'"'),a+=">"+i+"</a>",a}image({href:t,title:e,text:r,tokens:s}){s&&(r=this.parser.parseInline(s,this.parser.textRenderer));let n=fe(t);if(n===null)return b(r);t=n;let i=`<img src="${b(t)}" alt="${b(r)}"`;return e&&(i+=` title="${b(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):("escaped"in t)&&t.escaped?t.text:b(t.text)}},re=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},A=class t{options;renderer;textRenderer;constructor(e){this.options=e||T,this.options.renderer=this.options.renderer||new W,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new re}static parse(e,r){return new t(r).parse(e)}static parseInline(e,r){return new t(r).parseInline(e)}parse(e){this.renderer.parser=this;let r="";for(let s=0;s<e.length;s++){let n=e[s];if(this.options.extensions?.renderers?.[n.type]){let l=n,a=this.options.extensions.renderers[l.type].call({parser:this},l);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(l.type)){r+=a||"";continue}}let i=n;switch(i.type){case"space":{r+=this.renderer.space(i);break}case"hr":{r+=this.renderer.hr(i);break}case"heading":{r+=this.renderer.heading(i);break}case"code":{r+=this.renderer.code(i);break}case"table":{r+=this.renderer.table(i);break}case"blockquote":{r+=this.renderer.blockquote(i);break}case"list":{r+=this.renderer.list(i);break}case"checkbox":{r+=this.renderer.checkbox(i);break}case"html":{r+=this.renderer.html(i);break}case"def":{r+=this.renderer.def(i);break}case"paragraph":{r+=this.renderer.paragraph(i);break}case"text":{r+=this.renderer.text(i);break}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw Error(l)}}}return r}parseInline(e,r=this.renderer){this.renderer.parser=this;let s="";for(let n=0;n<e.length;n++){let i=e[n];if(this.options.extensions?.renderers?.[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(i.type)){s+=a||"";continue}}let l=i;switch(l.type){case"escape":{s+=r.text(l);break}case"html":{s+=r.html(l);break}case"link":{s+=r.link(l);break}case"image":{s+=r.image(l);break}case"checkbox":{s+=r.checkbox(l);break}case"strong":{s+=r.strong(l);break}case"em":{s+=r.em(l);break}case"codespan":{s+=r.codespan(l);break}case"br":{s+=r.br(l);break}case"del":{s+=r.del(l);break}case"text":{s+=r.text(l);break}default:{let a='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw Error(a)}}}return s}},Z=class{options;block;constructor(t){this.options=t||T}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?E.lex:E.lexInline}provideParser(t=this.block){return t?A.parse:A.parseInline}};function R(t,e){if(Array.isArray(e))for(let r=0;r<e.length;r++)t.push(e[r]);else t.push(e)}var ne=class{defaults=U();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=A;Renderer=W;TextRenderer=re;Lexer=E;Tokenizer=N;Hooks=Z;constructor(...t){this.use(...t)}walkTokens(t,e){let r=[];for(let s of t)switch(R(r,e.call(this,s)),s.type){case"table":{let n=s;for(let i of n.header)R(r,this.walkTokens(i.tokens,e));for(let i of n.rows)for(let l of i)R(r,this.walkTokens(l.tokens,e));break}case"list":{let n=s;R(r,this.walkTokens(n.items,e));break}default:{let n=s;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach((i)=>{let l=n[i].flat(1/0);R(r,this.walkTokens(l,e))}):n.tokens&&R(r,this.walkTokens(n.tokens,e))}}return r}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach((r)=>{let s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach((n)=>{if(!n.name)throw Error("extension name required");if("renderer"in n){let i=e.renderers[n.name];i?e.renderers[n.name]=function(...l){let a=n.renderer.apply(this,l);return a===!1&&(a=i.apply(this,l)),a}:e.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw Error("extension level must be 'block' or 'inline'");let i=e[n.level];i?i.unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),s.extensions=e),r.renderer){let n=this.defaults.renderer||new W(this.defaults);for(let i in r.renderer){if(!(i in n))throw Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let l=i,a=r.renderer[l],c=n[l];n[l]=(...u)=>{let o=a.apply(n,u);return o===!1&&(o=c.apply(n,u)),o||""}}s.renderer=n}if(r.tokenizer){let n=this.defaults.tokenizer||new N(this.defaults);for(let i in r.tokenizer){if(!(i in n))throw Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let l=i,a=r.tokenizer[l],c=n[l];n[l]=(...u)=>{let o=a.apply(n,u);return o===!1&&(o=c.apply(n,u)),o}}s.tokenizer=n}if(r.hooks){let n=this.defaults.hooks||new Z;for(let i in r.hooks){if(!(i in n))throw Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let l=i,a=r.hooks[l],c=n[l];Z.passThroughHooks.has(i)?n[l]=(u)=>{if(this.defaults.async&&Z.passThroughHooksRespectAsync.has(i))return(async()=>{let p=await a.call(n,u);return c.call(n,p)})();let o=a.call(n,u);return c.call(n,o)}:n[l]=(...u)=>{if(this.defaults.async)return(async()=>{let p=await a.apply(n,u);return p===!1&&(p=await c.apply(n,u)),p})();let o=a.apply(n,u);return o===!1&&(o=c.apply(n,u)),o}}s.hooks=n}if(r.walkTokens){let n=this.defaults.walkTokens,i=r.walkTokens;s.walkTokens=function(l){let a=[];return a.push(i.call(this,l)),n&&R(a,n.call(this,l)),a}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return E.lex(t,e??this.defaults)}parser(t,e){return A.parse(t,e??this.defaults)}parseMarkdown(t){return(e,r)=>{let s={...r},n={...this.defaults,...s},i=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&s.async===!1)return i(Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=t),n.async)return(async()=>{let l=n.hooks?await n.hooks.preprocess(e):e,a=await(n.hooks?await n.hooks.provideLexer(t):t?E.lex:E.lexInline)(l,n),c=n.hooks?await n.hooks.processAllTokens(a):a;n.walkTokens&&await Promise.all(this.walkTokens(c,n.walkTokens));let u=await(n.hooks?await n.hooks.provideParser(t):t?A.parse:A.parseInline)(c,n);return n.hooks?await n.hooks.postprocess(u):u})().catch(i);try{n.hooks&&(e=n.hooks.preprocess(e));let l=(n.hooks?n.hooks.provideLexer(t):t?E.lex:E.lexInline)(e,n);n.hooks&&(l=n.hooks.processAllTokens(l)),n.walkTokens&&this.walkTokens(l,n.walkTokens);let a=(n.hooks?n.hooks.provideParser(t):t?A.parse:A.parseInline)(l,n);return n.hooks&&(a=n.hooks.postprocess(a)),a}catch(l){return i(l)}}}onError(t,e){return(r)=>{if(r.message+=`
65
+ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+b(r.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(r);throw r}}},B=new ne;function D(t,e){return B.parse(t,e)}D.options=D.setOptions=function(t){return B.setOptions(t),D.defaults=B.defaults,Fe(D.defaults),D};D.getDefaults=U;D.defaults=T;function Qt(...t){return B.use(...t),D.defaults=B.defaults,Fe(D.defaults),D}D.use=Qt;D.walkTokens=function(t,e){return B.walkTokens(t,e)};D.parseInline=B.parseInline;D.Parser=A;D.parser=A.parse;D.Renderer=W;D.TextRenderer=re;D.Lexer=E;D.lexer=E.lex;D.Tokenizer=N;D.Hooks=Z;D.parse=D;var{options:sr,setOptions:ir,walkTokens:lr,parseInline:ar}=D;var ur=A.parse,or=E.lex;var Re=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Se=/[\0-\x1F\x7F-\x9F]/;var Be=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/;var Te=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;var Ht=class{src_Any=Re.source;src_Cc=Se.source;src_Z=Te.source;src_P=Be.source;src_ZPCc=[this.src_Z,this.src_P,this.src_Cc].join("|");src_ZCc=[this.src_Z,this.src_Cc].join("|");cache={};opts={maxLength:1e4,urlAuth:!1,schema_names:[]};constructor(t={}){this.opts={...this.opts,...t}}set(t={}){return this.opts={...this.opts,...t},this.cache={},this}escapeRE(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}nestedPairRE(t,e,r=4){let s=this.escapeRE(t),n=this.escapeRE(e),i=`(?:(?!${this.src_ZCc}|${s}|${n}).)`,l=`${s}${i}{0,1000}${n}`;for(let a=2;a<=r;a++)l=`${s}(?:${i}|${l}){0,1000}${n}`;return l}get_text_separators(){return this.cache.text_separators??=/[><\uff5c]/}get_pseudo_letter(){return this.cache.src_pseudo_letter??=new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`)}get_ipv4_addr(){return this.cache.src_ip4??=new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])")}get_ipv6_addr(){let e=`(?:(?:[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4})|${this.get_ipv4_addr().source})`;return this.cache.src_ip6_addr??=new RegExp(`(?:(?:[0-9A-Fa-f]{1,4}:){6}${e}|::(?:[0-9A-Fa-f]{1,4}:){5}${e}|(?:[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){4}${e}|(?:(?:[0-9A-Fa-f]{1,4}:){0,1}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){3}${e}|(?:(?:[0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){2}${e}|(?:(?:[0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:${e}|(?:(?:[0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})?::${e}|(?:(?:[0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(?:(?:[0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})?::)`)}get_ipv6_url_host(){return this.cache.src_ip6_host??=new RegExp(`\\[${this.get_ipv6_addr().source}\\]`)}get_ipv6_mail_host(){return this.cache.src_ipv6_mail_host??=new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`)}get_auth(){return this.cache.src_auth??=new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`)}get_port(){return this.cache.src_port??=new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?")}get_host_terminator(){return this.cache.src_host_terminator??=new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`)}get_path_terminator(){return this.cache.src_path_terminator??=new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`)}get_path(){return this.cache.src_path??=new RegExp(`(?:[/?#](?:${this.nestedPairRE("[","]")}|${this.nestedPairRE("(",")")}|${this.nestedPairRE("{","}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts["---"]?"\\-(?!--(?:[^-]|$))(?:-{0,19})|":"\\-{1,20}|")+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`)}get_mail_name(){return this.cache.src_mail_name??=new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}")}get_xn(){return this.cache.src_xn??=new RegExp("xn--[a-z0-9\\-]{1,59}")}get_tld(){if(this.cache.tld)return this.cache.tld;let t=[...new Set(this.opts.tlds||[])].sort().reverse().join("|");return this.cache.tld=new RegExp(`${t||"$#none#$"}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){return this.cache.src_domain_root??=new RegExp("(?:"+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`)}get_domain(){return this.cache.src_domain??=new RegExp("(?:"+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`)}get_url_host_port(){return this.cache.url_host_port??=new RegExp("(?:"+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source)}get_fuzzy_url_host_port(){return this.cache.fuzzy_url_host_port??=new RegExp("(?:"+(this.opts.fuzzyIP?this.get_ipv4_addr().source+"|":"")+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source)}get_mail_host(){return this.cache.src_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source)}get_fuzzy_mail_host(){return this.cache.src_fuzzy_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source)}get_path_extra(){return this.cache.src_path_extra??=new RegExp("")}get_fuzzy_mail_host_search(){return this.cache.mail_fuzzy_host_search??=new RegExp(`@${this.get_fuzzy_mail_host().source}`,"ig")}get_fuzzy_link_search(){return this.cache.link_fuzzy_search??=new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${this.src_ZPCc}))(?:(?![$+<=>^\`||])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,"ig")}get_http_validator(){return this.cache.http_validator??=new RegExp("\\/\\/"+(this.opts.urlAuth?this.get_auth().source:"")+this.get_url_host_port().source+this.get_path().source,"iy")}get_relative_proto_validator(){return this.cache.relative_proto_validator??=new RegExp((this.opts.urlAuth?this.get_auth().source:"")+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,"iy")}get_mail_name_validator(){return this.cache.mail_name_validator??=new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`)}get_mailto_validator(){return this.cache.mailto_validator??=new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,"iy")}get_schema_names(){return this.cache.schema_names??=new RegExp((this.opts.schema_names||[]).map((t)=>this.escapeRE(t)).join("|"))}get_schema_search(){return this.cache.schema_search??=new RegExp(`(^|(?!_)(?:[><|]|${this.src_ZPCc}))(${this.get_schema_names().source})`,"ig")}get_schema_at_start(){return this.cache.schema_at_start??=new RegExp(`^${this.get_schema_search().source}`,"i")}},se={validate:(t,e,r)=>{let s=r.re.get_http_validator();s.lastIndex=e;let n=s.exec(t);return n?n[0].length:0},normalize:(t,e)=>e.normalize(t)},Nt={"http:":se,"https:":se,"ftp:":se,"//":{validate:function(t,e,r){let s=r.re.get_relative_proto_validator();s.lastIndex=e;let n=s.exec(t);if(n){if(e>=3&&t[e-3]===":")return 0;if(e>=3&&t[e-3]==="/")return 0;return n[0].length}return 0},normalize:(t,e)=>e.normalize(t)},"mailto:":{validate:function(t,e,r){let s=r.re.get_mailto_validator();s.lastIndex=e;let n=s.exec(t);return n?n[0].length:0},normalize:(t,e)=>e.normalize(t)}},Wt="a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw",Gt="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";function Xt(){let t=Gt.split("|");return Wt.split("|").forEach((e)=>{let r=e.indexOf(":"),s=e.slice(0,r);for(let n of e.slice(r+1))t.push(s+n)}),t}var Ut={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:Xt(),urlAuth:!1,maxLength:1e4},ve=class{schema;index;lastIndex;raw;text;url;constructor(t,e,r,s){let n=t.slice(r,s);this.schema=e.toLowerCase(),this.index=r,this.lastIndex=s,this.raw=n,this.text=n,this.url=n}},Pe=class{__opts__;__schemas__;re;constructor(t={}){let{rebuilder:e,...r}=t;this.__opts__={...Ut,...r},this.__schemas__={...Nt},this.re=e||new Ht,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(t,e=null){if(!e)delete this.__schemas__[t];else{let r={normalize:(s,n)=>n.normalize(s),...e};this.__schemas__[t]=r}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(t={}){return this.__opts__={...this.__opts__,...t},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(t){if(!t.length)return!1;let e,r;r=this.re.get_schema_search(),r.lastIndex=0;while((e=r.exec(t))!==null)if(this.testSchemaAt(t,e[2],r.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__["http:"]){if(r=this.re.get_fuzzy_link_search(),r.lastIndex=0,r.exec(t)!==null)return!0}if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]){if(t.indexOf("@")>=0){let s=this.re.get_fuzzy_mail_host_search(),n=this.re.get_mail_name_validator();s.lastIndex=0;while((e=s.exec(t))!==null){let i=t.slice(Math.max(0,e.index-65),e.index);if(n.test(i))return!0}}}return!1}testSchemaAt(t,e,r){if(!this.__schemas__[e.toLowerCase()])return 0;return this.__schemas__[e.toLowerCase()].validate(t.slice(0,r+this.__opts__.maxLength),r,this)}match(t){let e=[],r=this.re.get_schema_search(),s,n,i,l,a,c,u=!1,o=!1,p=!1,k=0;if(!t.length)return null;if(r.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__["http:"])s=this.re.get_fuzzy_link_search(),s.lastIndex=0;if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"])n=this.re.get_fuzzy_mail_host_search(),n.lastIndex=0,i=this.re.get_mail_name_validator();for(;;){let h=Math.max(k-1,0);if(n&&i&&!p&&(!a||a.index<k)){if(n.lastIndex<h)n.lastIndex=h;for(;;){let d=n.exec(t);if(!d){p=!0,a=void 0;break}let w=i.exec(t.slice(Math.max(0,d.index-65),d.index));if(!w)continue;if(a={schema:"mailto:",index:d.index-w[1].length,lastIndex:d.index+d[0].length},a.index>=k)break;if(n.lastIndex<h)n.lastIndex=h}}if(s&&!o&&(!l||l.index<k)){if(s.lastIndex<h)s.lastIndex=h;for(;;){let d=s.exec(t);if(!d){o=!0,l=void 0;break}if(l={schema:"",index:d.index+d[1].length,lastIndex:d.index+d[0].length},l.index>=k)break;if(s.lastIndex<h)s.lastIndex=h}}let x=a;if(!x||l&&(l.index<x.index||l.index===x.index&&l.lastIndex>x.lastIndex))x=l;let _;if(!u)for(;;){if(!c){if(r.lastIndex<h)r.lastIndex=h;let C=r.exec(t);if(!C){u=!0;break}c={schema:C[2],index:C.index+C[1].length,lastIndex:C.index+C[0].length}}if(c.index<k){c=void 0;continue}if(x&&c.index>x.index)break;let d=c;c=void 0;let w=this.testSchemaAt(t,d.schema,d.lastIndex);if(w){_={schema:d.schema,index:d.index,lastIndex:d.lastIndex+w};break}}let f=_;if(!f||a&&(a.index<f.index||a.index===f.index&&a.lastIndex>f.lastIndex))f=a;if(!f||l&&(l.index<f.index||l.index===f.index&&l.lastIndex>f.lastIndex))f=l;if(!f)break;if(f===a)a=void 0;else if(f===l)l=void 0;let F=new ve(t,f.schema,f.index,f.lastIndex);if(F.schema)this.__schemas__[F.schema].normalize(F,this);else this.normalize(F);e.push(F),k=f.lastIndex}if(e.length)return e;return null}matchAtStart(t){if(!t.length)return null;let e=this.re.get_schema_at_start().exec(t);if(!e)return null;let r=this.testSchemaAt(t,e[2],e[0].length);if(!r)return null;let s=new ve(t,e[2],e.index+e[1].length,e.index+e[0].length+r);return this.__schemas__[s.schema].normalize(s,this),s}tlds(t,e=!1){if(t=Array.isArray(t)?t:[t],!e)this.__opts__.tlds=t;else this.__opts__.tlds=this.__opts__.tlds.concat(t);return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(t){if(!t.schema)t.url=`http://${t.url}`;if(t.schema==="mailto:"&&!/^mailto:/i.test(t.url))t.url=`mailto:${t.url}`}};var Kt={fuzzyLink:!0};function ie(t={}){let{tlds:e,tldsKeepOld:r,schemas:s,...n}=t,i=new Pe({...Kt,...n});return Jt(i,e,r),Vt(i,s),{extensions:[{name:"autolink",level:"inline",start:(l)=>{let a=Ie(i,l);if(!a)return;return a.index},tokenizer(l){if(this.lexer.state.inLink)return;let a=Ie(i,l);if(!a)return;let c;if(a.index===0)c=a.raw;else if(a.index===1&&l.charAt(0)==="<"&&l.charAt(a.lastIndex)===">")c=`<${a.raw}>`;if(!c)return;return{type:"link",raw:c,text:a.text,href:a.url,tokens:[{type:"text",raw:a.text,text:a.text}]}}}]}}function Ie(t,e){let r=t.match(e);if(!r||!r.length)return;return r[0]}function Jt(t,e,r){if(e)t.tlds(e,r)}function Vt(t,e){if(e)for(let[r,s]of Object.entries(e))t.add(r,s)}var Yt=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,er=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,Le=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,tr={extensions:[{name:"math",level:"block",tokenizer(t){let e=Le.exec(t);if(e===null)return;return{type:"math",raw:e[0],text:(e[1]??e[2]).trim(),display:!0}}},{name:"math",level:"inline",start(t){return t.search(/\$|\\[([]/)},tokenizer(t){let e=Le.exec(t);if(e!==null)return{type:"math",raw:e[0],text:(e[1]??e[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(t);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let s=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(t);if(s===null||/^\s|\s$/.test(s[1]))return;return{type:"math",raw:s[0],text:s[1],display:!1}}}]};function Ze(){let t=new ne({gfm:!0}),e=ie(),r=e.extensions[0],s=r.tokenizer;r.tokenizer=function(n,i){let l=s.call(this,n,i);if(l===void 0)return;if(l.raw.startsWith("<"))return l;let a=/^(?:[a-z][a-z\d+.-]*:\/\/|www\.)[^/?#]+[/?#]/i.exec(l.raw);if(a===null)return l;let c=a[0].length-1,u=l.raw.slice(c).search(/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u);if(u===-1)return l;let o=l.raw.slice(0,c+u),p=l.href.slice(0,l.href.length-(l.raw.length-o.length));return{...l,raw:o,href:p,text:o,tokens:[{type:"text",raw:o,text:o}]}},t.use(tr,e);for(let n of["block","inline"])t.use({extensions:[{name:"internalMessage",level:n,...n==="inline"?{start(i){return Yt.exec(i)?.index}}:{},tokenizer(i){let l=er.exec(i);if(l===null)return;return{type:"internalMessage",raw:l[0]}},renderer(){return""}}]});return t}function rr(t,e){let r=Object.keys(t);return r.length===Object.keys(e).length&&r.every((s)=>{let n=e[s];return t[s].href===n?.href&&t[s].title===n.title})}function nr(t,e){let r=2,s=0;for(let i=t.length-1;i>=0;i-=1){if(t[i].type==="space")continue;if(r-=1,r===0){s=i;break}}let n=0;for(let i=0;i<s;i+=1){let l=t[i];if(l.type==="def"||/^ {0,3}(?:\[|<|\$\$|\\\[)/.test(l.raw))return n;let a=!1;if(e.walkTokens([t[i]],(c)=>{if(c.type==="html"&&(("inLink"in c)&&c.inLink||("inRawBlock"in c)&&c.inRawBlock))a=!0}),a)return n;if(/\n[\t ]*\n$/.test(t[i].raw))n=i+1}return n}function Me(t=Ze()){let e="",r=[],s={},n={};return{parse(i){let l=i.replaceAll(/\r\n|\r/g,`
66
+ `);if(!l.startsWith(e))e="",r=[],s={},n={};let a=new t.Lexer(t.defaults);a.tokens.links={...s};let c=a.lex(l.slice(e.length)),u=[...r,...c],o=c.links;if(r.length>0&&!rr(n,o)){let h=t.lexer(l);u=[...h],o=h.links}n=o;let p=0,k=[];for(let h of u){if(!l.startsWith(h.raw,p))break;k.push(h),p+=h.raw.length}return r=k.slice(0,nr(k,t)),e=l.slice(0,r.reduce((h,x)=>h+x.raw.length,0)),s=Object.create(null),t.walkTokens(r,(h)=>{if(h.type!=="def")return;let x=h;if(!Object.hasOwn(s,x.tag))s[x.tag]={href:x.href,title:x.title}}),structuredClone(u)}}}var le=new Map;self.onmessage=(t)=>{let e=t.data;if(e.type==="dispose"){le.delete(e.clientId);return}let{clientId:r,revision:s,source:n}=e,i;try{let l=le.get(r);if(l===void 0)l=Me(),le.set(r,l);i={clientId:r,revision:s,ok:!0,tokens:l.parse(n)}}catch(l){i={clientId:r,revision:s,ok:!1,error:l instanceof Error?l.message:String(l)}}self.postMessage(i)};
@@ -1 +1 @@
1
- import{Ze,oe}from"../chunk-vghme4ag.js";export{Ze as createChatMarkdown,oe as isSafeMarkdownUrl};
1
+ import{$e,re}from"../chunk-9me7jmzd.js";export{$e as createChatMarkdown,re as isSafeMarkdownUrl};
@@ -1 +1 @@
1
- import{re}from"../chunk-gj85c3gx.js";export{re as formatModelName};
1
+ import{oe}from"../chunk-p9wpghey.js";export{oe as formatModelName};
@@ -1 +1 @@
1
- import{et}from"../chunk-n9mnvxs4.js";export{et as getPointerCenteredScrollPosition};
1
+ import{Ye}from"../chunk-qj8r5xvx.js";export{Ye as getPointerCenteredScrollPosition};
@@ -1 +1 @@
1
- import{Ot,nt,pt,d,Bt}from"../chunk-6rrnp8ha.js";export{Ot as STREAM_STYLES,pt as TOOL_CATEGORIES,d as describeToolUse,nt as isCodexLook,Bt as toolDotClass};
1
+ import{Ht,et,mt,d,Ot}from"../chunk-y2xbq7rb.js";export{Ht as STREAM_STYLES,mt as TOOL_CATEGORIES,d as describeToolUse,et as isCodexLook,Ot as toolDotClass};
@@ -1 +1,2 @@
1
- import{Xe}from"../chunk-j9hhbm77.js";import"../chunk-vghme4ag.js";export{Xe as createStreamingMarkdownLexer};
1
+ import{$e}from"../chunk-9me7jmzd.js";function T(e,o){let t=Object.keys(e);return t.length===Object.keys(o).length&&t.every((r)=>{let i=o[r];return e[r].href===i?.href&&e[r].title===i.title})}function b(e,o){let t=2,r=0;for(let n=e.length-1;n>=0;n-=1){if(e[n].type==="space")continue;if(t-=1,t===0){r=n;break}}let i=0;for(let n=0;n<r;n+=1){let l=e[n];if(l.type==="def"||/^ {0,3}(?:\[|<|\$\$|\\\[)/.test(l.raw))return i;let k=!1;if(o.walkTokens([e[n]],(a)=>{if(a.type==="html"&&(("inLink"in a)&&a.inLink||("inRawBlock"in a)&&a.inRawBlock))k=!0}),k)return i;if(/\n[\t ]*\n$/.test(e[n].raw))i=n+1}return i}function L(e=$e()){let o="",t=[],r={},i={};return{parse(n){let l=n.replaceAll(/\r\n|\r/g,`
2
+ `);if(!l.startsWith(o))o="",t=[],r={},i={};let k=new e.Lexer(e.defaults);k.tokens.links={...r};let a=k.lex(l.slice(o.length)),f=[...t,...a],u=a.links;if(t.length>0&&!T(i,u)){let s=e.lexer(l);f=[...s],u=s.links}i=u;let h=0,d=[];for(let s of f){if(!l.startsWith(s.raw,h))break;d.push(s),h+=s.raw.length}return t=d.slice(0,b(d,e)),o=l.slice(0,t.reduce((s,c)=>s+c.raw.length,0)),r=Object.create(null),e.walkTokens(t,(s)=>{if(s.type!=="def")return;let c=s;if(!Object.hasOwn(r,c.tag))r[c.tag]={href:c.href,title:c.title}}),structuredClone(f)}}}export{L as createStreamingMarkdownLexer};
@@ -1 +1 @@
1
- import{e}from"../chunk-xgy0heva.js";import"../chunk-m8gejgjs.js";import{xe}from"../chunk-10yvvt3h.js";import"../chunk-2kb5qj2v.js";import{A}from"../chunk-55zxk0m8.js";import{cn as Y}from"cn";import{SearchIcon as Z}from"lucide-react";import{useCallback as _,useEffect as g,useMemo as z,useRef as v,useState as R}from"react";import{jsxDEV as y,Fragment as et}from"react/jsx-dev-runtime";var D="chat-search",F="chat-search-current",U=150;function it(o){let r=o??"";return[...document.querySelectorAll("[data-chat-scroll]")].find((l)=>l.dataset.chatScroll===r)??null}var j=12;function J(o,r="center"){let l=o.closest("[data-chat-scroll]");if(!l)return;let d=o.getBoundingClientRect(),m=l.getBoundingClientRect(),x=r==="start"?j:(l.clientHeight-d.height)/2;l.scrollTo({top:l.scrollTop+(d.top-m.top)-x,behavior:"smooth"})}function q(o){let r=o.startContainer.parentElement;if(!r)return;J(r)}var T=new Map;function Q(){if(typeof CSS>"u"||!("highlights"in CSS)||typeof Highlight>"u")return;if(T.size===0){CSS.highlights.delete(D),CSS.highlights.delete(F);return}let o=[...T.values()];CSS.highlights.set(D,new Highlight(...o.flatMap((r)=>r.all))),CSS.highlights.set(F,new Highlight(...o.flatMap((r)=>r.current?[r.current]:[])))}function tt(){let o=Symbol();return{clearHighlights:()=>{T.delete(o),Q()},applyHighlights:(r,l)=>{T.set(o,{all:r,current:l}),Q()}}}function ut({getViewport:o,findSourceMatches:r,revealTurn:l,subscribeOpen:d,labels:m,placement:x="header"}){let{clearHighlights:i,applyHighlights:p}=z(tt,[]),S=r!==void 0,[s,w]=R(!1),[u,K]=R(""),h=z(()=>s&&u.trim()&&r?r(u.trim()):[],[r,s,u]),[O,L]=R(0),[V,E]=R(0),C=v([]),H=v(0),a=v(null),P=v(null),G=v(null);g(()=>{if(!d)return;return d(()=>{w(!0);let t=G.current;if(t!==null)t.focus(),t.select()})},[d]);let I=_(async(c,t)=>{let n=h[c];if(n===void 0)return;let f=o();if(f===null)throw Error("Chat scroll container is missing");if(l)await l(n.turnKey,t);if(t.aborted)return;let b=f.querySelector(`[data-turn-key="${CSS.escape(n.turnKey)}"]`);if(b===null)throw Error(`Codex turn is missing: ${n.turnKey}`);if(!l)J(b,"start");if(await new Promise((X)=>requestAnimationFrame(()=>X())),t.aborted)return;let B=A(b,u.trim());C.current=B;let N=B[n.occurrenceInTurn];if(p(B,N??null),N!==void 0)q(N)},[p,h,o,u,l]),k=v(I);g(()=>{k.current=I},[I]);let M=_(()=>{w(!1),K(""),H.current=0,a.current?.abort(),a.current=null,i(),C.current=[]},[i]);g(()=>{if(!s)return;let c=(t)=>{if(t.key==="Escape"&&P.current?.contains(document.activeElement))t.preventDefault(),M()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[s,M]),g(()=>{if(!s||!u.trim()){i(),C.current=[],L(0),E(0),H.current=0;return}let c=setTimeout(()=>{if(S)return;let t=o();if(!t)return;let n=A(t,u);if(C.current=n,L(n.length),E(0),p(n,n[0]??null),n[0])q(n[0])},U);return()=>{clearTimeout(c),i()}},[p,i,S,s,u,o]),g(()=>{if(!s||!S||!u.trim())return;let c=new AbortController;a.current?.abort(),a.current=c;let t=setTimeout(()=>{C.current=[],H.current=0,L(h.length),E(0),i(),k.current(0,c.signal)},U);return()=>{if(c.abort(),a.current===c)a.current=null;clearTimeout(t),i()}},[i,h.length,S,s,u]),g(()=>()=>{a.current?.abort(),i()},[i]),g(()=>{if(!s)i()},[i,s]);let W=_((c)=>{if(S){if(h.length===0)return;let n=(H.current+(c?-1:1)+h.length)%h.length;H.current=n,E(n),a.current?.abort();let f=new AbortController;a.current=f,k.current(n,f.signal);return}let t=C.current;if(!t.length)return;E((n)=>{let f=(n+(c?-1:1)+t.length)%t.length,b=t[f];return p(t,b),q(b),f})},[p,h.length,S]);return y(et,{children:[x==="header"&&y(e,{variant:"ghost",size:"icon-sm",title:m.search,onClick:()=>s?M():w(!0),children:y(Z,{},void 0,!1,void 0,this)},void 0,!1,void 0,this),s&&y("div",{"data-chat-search":!0,ref:P,className:Y("bg-background border-b",x==="body"?"relative shrink-0":"absolute inset-x-0 top-full z-30"),children:[y(xe,{ref:G,value:u,onChange:K,onFind:W,onClose:M,placeholder:m.placeholder,prevTitle:m.previous,nextTitle:m.next},void 0,!1,void 0,this),u.trim()&&y("div",{className:"text-muted-foreground border-border border-t px-3 py-1 text-[11px]",children:O===0?"0 / 0":`${V+1} / ${O}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}export{ut as ChatSearch,A as collectMatches,it as findChatScrollContainer,J as scrollChatElementIntoView};
1
+ import{e}from"../chunk-7pr2j1zb.js";import"../chunk-m8gejgjs.js";import{ve}from"../chunk-70sfgw0j.js";import"../chunk-qyhgwc51.js";import{A}from"../chunk-rakd7vzb.js";import{cn as Y}from"cn";import{SearchIcon as Z}from"lucide-react";import{useCallback as _,useEffect as g,useMemo as z,useRef as v,useState as R}from"react";import{jsxDEV as y,Fragment as et}from"react/jsx-dev-runtime";var D="chat-search",F="chat-search-current",U=150;function it(o){let r=o??"";return[...document.querySelectorAll("[data-chat-scroll]")].find((l)=>l.dataset.chatScroll===r)??null}var j=12;function J(o,r="center"){let l=o.closest("[data-chat-scroll]");if(!l)return;let d=o.getBoundingClientRect(),m=l.getBoundingClientRect(),x=r==="start"?j:(l.clientHeight-d.height)/2;l.scrollTo({top:l.scrollTop+(d.top-m.top)-x,behavior:"smooth"})}function q(o){let r=o.startContainer.parentElement;if(!r)return;J(r)}var T=new Map;function Q(){if(typeof CSS>"u"||!("highlights"in CSS)||typeof Highlight>"u")return;if(T.size===0){CSS.highlights.delete(D),CSS.highlights.delete(F);return}let o=[...T.values()];CSS.highlights.set(D,new Highlight(...o.flatMap((r)=>r.all))),CSS.highlights.set(F,new Highlight(...o.flatMap((r)=>r.current?[r.current]:[])))}function tt(){let o=Symbol();return{clearHighlights:()=>{T.delete(o),Q()},applyHighlights:(r,l)=>{T.set(o,{all:r,current:l}),Q()}}}function ut({getViewport:o,findSourceMatches:r,revealTurn:l,subscribeOpen:d,labels:m,placement:x="header"}){let{clearHighlights:i,applyHighlights:p}=z(tt,[]),S=r!==void 0,[s,w]=R(!1),[u,K]=R(""),h=z(()=>s&&u.trim()&&r?r(u.trim()):[],[r,s,u]),[O,L]=R(0),[V,E]=R(0),C=v([]),H=v(0),a=v(null),P=v(null),G=v(null);g(()=>{if(!d)return;return d(()=>{w(!0);let t=G.current;if(t!==null)t.focus(),t.select()})},[d]);let I=_(async(c,t)=>{let n=h[c];if(n===void 0)return;let f=o();if(f===null)throw Error("Chat scroll container is missing");if(l)await l(n.turnKey,t);if(t.aborted)return;let b=f.querySelector(`[data-turn-key="${CSS.escape(n.turnKey)}"]`);if(b===null)throw Error(`Codex turn is missing: ${n.turnKey}`);if(!l)J(b,"start");if(await new Promise((X)=>requestAnimationFrame(()=>X())),t.aborted)return;let B=A(b,u.trim());C.current=B;let N=B[n.occurrenceInTurn];if(p(B,N??null),N!==void 0)q(N)},[p,h,o,u,l]),k=v(I);g(()=>{k.current=I},[I]);let M=_(()=>{w(!1),K(""),H.current=0,a.current?.abort(),a.current=null,i(),C.current=[]},[i]);g(()=>{if(!s)return;let c=(t)=>{if(t.key==="Escape"&&P.current?.contains(document.activeElement))t.preventDefault(),M()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[s,M]),g(()=>{if(!s||!u.trim()){i(),C.current=[],L(0),E(0),H.current=0;return}let c=setTimeout(()=>{if(S)return;let t=o();if(!t)return;let n=A(t,u);if(C.current=n,L(n.length),E(0),p(n,n[0]??null),n[0])q(n[0])},U);return()=>{clearTimeout(c),i()}},[p,i,S,s,u,o]),g(()=>{if(!s||!S||!u.trim())return;let c=new AbortController;a.current?.abort(),a.current=c;let t=setTimeout(()=>{C.current=[],H.current=0,L(h.length),E(0),i(),k.current(0,c.signal)},U);return()=>{if(c.abort(),a.current===c)a.current=null;clearTimeout(t),i()}},[i,h.length,S,s,u]),g(()=>()=>{a.current?.abort(),i()},[i]),g(()=>{if(!s)i()},[i,s]);let W=_((c)=>{if(S){if(h.length===0)return;let n=(H.current+(c?-1:1)+h.length)%h.length;H.current=n,E(n),a.current?.abort();let f=new AbortController;a.current=f,k.current(n,f.signal);return}let t=C.current;if(!t.length)return;E((n)=>{let f=(n+(c?-1:1)+t.length)%t.length,b=t[f];return p(t,b),q(b),f})},[p,h.length,S]);return y(et,{children:[x==="header"&&y(e,{variant:"ghost",size:"icon-sm",title:m.search,onClick:()=>s?M():w(!0),children:y(Z,{},void 0,!1,void 0,this)},void 0,!1,void 0,this),s&&y("div",{"data-chat-search":!0,ref:P,className:Y("bg-background border-b",x==="body"?"relative shrink-0":"absolute inset-x-0 top-full z-30"),children:[y(ve,{ref:G,value:u,onChange:K,onFind:W,onClose:M,placeholder:m.placeholder,prevTitle:m.previous,nextTitle:m.next},void 0,!1,void 0,this),u.trim()&&y("div",{className:"text-muted-foreground border-border border-t px-3 py-1 text-[11px]",children:O===0?"0 / 0":`${V+1} / ${O}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}export{ut as ChatSearch,A as collectMatches,it as findChatScrollContainer,J as scrollChatElementIntoView};
@@ -1 +1 @@
1
- import{A}from"../chunk-55zxk0m8.js";import"../chunk-2kb5qj2v.js";export{A as collectMatches};
1
+ import{A}from"../chunk-rakd7vzb.js";import"../chunk-qyhgwc51.js";export{A as collectMatches};
@@ -1 +1 @@
1
- import{xe}from"../chunk-10yvvt3h.js";import"../chunk-m8gejgjs.js";import"../chunk-xgy0heva.js";export{xe as FindBar};
1
+ import{ve}from"../chunk-70sfgw0j.js";import"../chunk-m8gejgjs.js";import"../chunk-7pr2j1zb.js";export{ve as FindBar};
@@ -1 +1 @@
1
- import{q,wt}from"../chunk-2kb5qj2v.js";export{wt as findTextSourceMatches,q as literalMatches};
1
+ import{q,yt}from"../chunk-qyhgwc51.js";export{yt as findTextSourceMatches,q as literalMatches};
package/dist/ui/badge.js CHANGED
@@ -1 +1 @@
1
- import{dt,Ae}from"../chunk-ymka3s33.js";export{Ae as Badge,dt as badgeVariants};
1
+ import{lt,Ae}from"../chunk-341yykkp.js";export{Ae as Badge,lt as badgeVariants};
package/dist/ui/button.js CHANGED
@@ -1 +1 @@
1
- import{mt,e}from"../chunk-xgy0heva.js";export{e as Button,mt as buttonVariants};
1
+ import{ut,e}from"../chunk-7pr2j1zb.js";export{e as Button,ut as buttonVariants};
package/dist/ui/card.js CHANGED
@@ -1 +1 @@
1
- import{Pe,Ie,Me,Ne,It,Se,Ee}from"../chunk-f5syjtnd.js";export{Pe as Card,It as CardAction,Se as CardContent,Ne as CardDescription,Ee as CardFooter,Ie as CardHeader,Me as CardTitle};
1
+ import{Pe,Ie,Me,Ne,Pt,Se,Ee}from"../chunk-f20xh0z9.js";export{Pe as Card,Pt as CardAction,Se as CardContent,Ne as CardDescription,Ee as CardFooter,Ie as CardHeader,Me as CardTitle};
package/dist/ui/dialog.js CHANGED
@@ -1 +1 @@
1
- import{E,At,ct,We,ut,R,qe,Ge,L,je}from"../chunk-1nr8t8ar.js";import"../chunk-xgy0heva.js";export{E as Dialog,We as DialogClose,R as DialogContent,je as DialogDescription,Ge as DialogFooter,qe as DialogHeader,ut as DialogOverlay,ct as DialogPortal,L as DialogTitle,At as DialogTrigger};
1
+ import{E,_t,dt,We,ct,R,qe,Ge,L,je}from"../chunk-s0nhgptn.js";import"../chunk-7pr2j1zb.js";export{E as Dialog,We as DialogClose,R as DialogContent,je as DialogDescription,Ge as DialogFooter,qe as DialogHeader,ct as DialogOverlay,dt as DialogPortal,L as DialogTitle,_t as DialogTrigger};
@@ -1 +1 @@
1
- import{v,Rt,x,m,b,H,y,I,M,N,J,Oe,Be,s,Lt}from"../chunk-bgmsrs7h.js";export{v as DropdownMenu,J as DropdownMenuCheckboxItem,m as DropdownMenuContent,b as DropdownMenuGroup,y as DropdownMenuItem,H as DropdownMenuLabel,Rt as DropdownMenuPortal,Oe as DropdownMenuRadioGroup,Be as DropdownMenuRadioItem,s as DropdownMenuSeparator,Lt as DropdownMenuShortcut,I as DropdownMenuSub,N as DropdownMenuSubContent,M as DropdownMenuSubTrigger,x as DropdownMenuTrigger};
1
+ import{x,Et,v,m,b,H,y,P,I,M,J,Oe,Be,s,Rt}from"../chunk-kj1wrn2j.js";export{x as DropdownMenu,J as DropdownMenuCheckboxItem,m as DropdownMenuContent,b as DropdownMenuGroup,y as DropdownMenuItem,H as DropdownMenuLabel,Et as DropdownMenuPortal,Oe as DropdownMenuRadioGroup,Be as DropdownMenuRadioItem,s as DropdownMenuSeparator,Rt as DropdownMenuShortcut,P as DropdownMenuSub,M as DropdownMenuSubContent,I as DropdownMenuSubTrigger,v as DropdownMenuTrigger};
package/dist/ui/field.js CHANGED
@@ -1 +1 @@
1
- import{Z,Y,Fe,De,Mt,He,Nt,D,St,Et}from"../chunk-8d3t4bmf.js";import"../chunk-pnncsvbz.js";import"../chunk-0wtckvss.js";export{De as Field,Mt as FieldContent,D as FieldDescription,Et as FieldError,Fe as FieldGroup,He as FieldLabel,Y as FieldLegend,St as FieldSeparator,Z as FieldSet,Nt as FieldTitle};
1
+ import{Z,Y,Fe,De,It,He,Mt,D,Nt,St}from"../chunk-k1c0jrk1.js";import"../chunk-pnncsvbz.js";import"../chunk-8zs8vy0q.js";export{De as Field,It as FieldContent,D as FieldDescription,St as FieldError,Fe as FieldGroup,He as FieldLabel,Y as FieldLegend,Nt as FieldSeparator,Z as FieldSet,Mt as FieldTitle};
@@ -1 +1 @@
1
- import{ze,ee,te,_t}from"../chunk-c54yh2t2.js";import{ne}from"../chunk-jnx3t913.js";import"../chunk-r9k7kszp.js";import"../chunk-xgy0heva.js";export{ze as InputGroup,ee as InputGroupAddon,te as InputGroupButton,_t as InputGroupText,ne as InputGroupTextarea};
1
+ import{ze,ee,te,Lt}from"../chunk-ghfbzhnb.js";import{ne}from"../chunk-jnx3t913.js";import"../chunk-r9k7kszp.js";import"../chunk-7pr2j1zb.js";export{ze as InputGroup,ee as InputGroupAddon,te as InputGroupButton,Lt as InputGroupText,ne as InputGroupTextarea};
@@ -1 +1 @@
1
- import{S}from"../chunk-0wtckvss.js";export{S as Separator};
1
+ import{N}from"../chunk-8zs8vy0q.js";export{N as Separator};
package/dist/ui/switch.js CHANGED
@@ -1 +1 @@
1
- import{P}from"../chunk-095yr4wk.js";export{P as Switch};
1
+ import{S}from"../chunk-s28x10qd.js";export{S as Switch};
@@ -1 +1 @@
1
- import{Ct,G,j,Q}from"../chunk-7fn3yt0k.js";export{G as Tooltip,Q as TooltipContent,Ct as TooltipProvider,j as TooltipTrigger};
1
+ import{kt,G,j,Q}from"../chunk-wtkv29ba.js";export{G as Tooltip,Q as TooltipContent,kt as TooltipProvider,j as TooltipTrigger};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwith/module-chat",
3
- "version": "0.1.26",
3
+ "version": "0.1.28",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -270,7 +270,13 @@
270
270
  "types": "./dist/codex/navigation-instruments.d.ts",
271
271
  "import": "./dist/codex/navigation-instruments.js",
272
272
  "default": "./dist/codex/navigation-instruments.js"
273
- }
273
+ },
274
+ "./code-highlighter.worker": {
275
+ "types": "./dist/lib/code-highlighter.worker.d.ts",
276
+ "import": "./dist/lib/code-highlighter.worker.js",
277
+ "default": "./dist/lib/code-highlighter.worker.js"
278
+ },
279
+ "./navigation-rail.css": "./dist/codex/navigation-rail.css"
274
280
  },
275
281
  "peerDependencies": {
276
282
  "@agentclientprotocol/sdk": "^2.0.2",
@@ -287,7 +293,8 @@
287
293
  ],
288
294
  "alwithBuild": {
289
295
  "bundledEntries": [
290
- "src/lib/code-highlighter.worker.ts"
296
+ "src/lib/code-highlighter.worker.ts",
297
+ "src/lib/markdown-parser.worker.ts"
291
298
  ]
292
299
  },
293
300
  "scripts": {
@@ -1,2 +0,0 @@
1
- var Ft=1e6,Dt=5000000;function Je(_,e){return _+e>5000000}function Ht(_){return(_/1e6).toFixed(1)}var ae=5;
2
- export{Ft,Dt,Je,Ht,ae};
@@ -1,2 +0,0 @@
1
- class s{worker=new Worker(new URL("./code-highlighter.worker.ts",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(i)=>{let e=this.active,t=i.data;if(t.clientId!==e?.clientId||t.revision!==e.revision){this.fail(Error("Code highlighting worker returned an unexpected request"));return}if(this.active=null,!t.ok){this.fail(Error(t.error));return}let r=this.clients.get(e.clientId);if(r?.revision===e.revision)r.onResult({code:e.code,language:e.language,html:t.html});this.dispatch()},this.worker.onerror=(i)=>this.fail(Error(i.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize code highlighting result"))}fail(i){this.failure=i,this.worker.terminate(),this.pending.clear(),this.active=null;for(let e of this.clients.values())e.onError(i)}dispatch(){if(this.active!==null||this.pending.size===0)return;let i=this.pending.values().next().value;this.pending.delete(i.clientId),this.active=i;try{this.worker.postMessage(i)}catch(e){this.fail(e instanceof Error?e:Error(String(e)))}}connect(i,e){if(this.failure!==null)throw this.failure;let t=++this.nextClientId,r={revision:0,onResult:i,onError:e};return this.clients.set(t,r),{update:(o,l)=>{if(this.failure!==null)throw this.failure;r.revision+=1,this.pending.set(t,{clientId:t,revision:r.revision,code:o,language:l}),this.dispatch()},dispose:()=>{if(this.clients.delete(t),this.pending.delete(t),this.clients.size===0)this.worker.terminate(),n=void 0}}}}var n;function $e(i,e){return n??=new s,n.connect(i,e)}
2
- export{$e};
@@ -1,2 +0,0 @@
1
- var t=new Map;var a=0;function ie(e,n){let r=n?void 0:t.get(e);if(r===void 0)return null;return t.delete(e),t.set(e,r),{...r,tokens:structuredClone(r.tokens)}}function c(e){if(e.isStreaming||e.text.length>1048576)return;if(t.delete(e.text))a-=e.text.length;t.set(e.text,{...e,tokens:structuredClone(e.tokens)}),a+=e.text.length;while(a>2097152||t.size>200){let n=t.keys().next().value;a-=n.length,t.delete(n)}}class l{worker=new Worker(new URL("./markdown-parser.worker.ts",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(e)=>{let n=e.data,r=this.active;if(n.clientId!==r?.clientId||n.revision!==r.revision){this.fail(Error("Markdown worker returned an unexpected request"));return}if(this.active=null,!n.ok){this.fail(Error(n.error));return}let i={...r.input,tokens:n.tokens};c(i);let s=this.clients.get(r.clientId),o=this.pending.get(r.clientId),u=o!==void 0&&r.input.isStreaming&&o.input.isStreaming&&o.input.text.startsWith(r.input.text);if(s!==void 0&&(s.revision===r.revision||u))s.onResult(i);this.dispatch()},this.worker.onerror=(e)=>this.fail(Error(e.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize Markdown parsing result"))}fail(e){this.failure=e,this.worker.terminate(),this.pending.clear(),this.active=null;for(let n of this.clients.values())n.onError(e)}send(e){try{this.worker.postMessage(e)}catch(n){this.fail(n instanceof Error?n:Error(String(n)))}}dispatch(){if(this.active!==null||this.pending.size===0)return;let e=this.pending.values().next().value;this.pending.delete(e.clientId),this.active=e,this.send({type:"parse",clientId:e.clientId,revision:e.revision,source:e.input.source})}connect(e,n){if(this.failure!==null)throw this.failure;let r=++this.nextClientId,i={revision:0,onResult:e,onError:n};return this.clients.set(r,i),{update:(s)=>{if(this.failure!==null)throw this.failure;i.revision+=1;let o=ie(s.text,s.isStreaming);if(o!==null){this.pending.delete(r),i.onResult(o);return}this.pending.set(r,{clientId:r,revision:i.revision,input:s}),this.dispatch()},dispose:()=>{if(!this.clients.delete(r))return;if(this.pending.delete(r),this.clients.size===0)this.worker.terminate(),d=void 0;else if(this.failure===null)this.send({type:"dispose",clientId:r})}}}}var d;function Ye(e,n){return d??=new l,d.connect(e,n)}
2
- export{ie,Ye};
@@ -1,3 +0,0 @@
1
- import{Ze}from"./chunk-vghme4ag.js";function T(e,o){let t=Object.keys(e);return t.length===Object.keys(o).length&&t.every((r)=>{let i=o[r];return e[r].href===i?.href&&e[r].title===i.title})}function b(e,o){let t=2,r=0;for(let n=e.length-1;n>=0;n-=1){if(e[n].type==="space")continue;if(t-=1,t===0){r=n;break}}let i=0;for(let n=0;n<r;n+=1){let l=e[n];if(l.type==="def"||/^ {0,3}(?:\[|<|\$\$|\\\[)/.test(l.raw))return i;let k=!1;if(o.walkTokens([e[n]],(a)=>{if(a.type==="html"&&(("inLink"in a)&&a.inLink||("inRawBlock"in a)&&a.inRawBlock))k=!0}),k)return i;if(/\n[\t ]*\n$/.test(e[n].raw))i=n+1}return i}function Xe(e=Ze()){let o="",t=[],r={},i={};return{parse(n){let l=n.replaceAll(/\r\n|\r/g,`
2
- `);if(!l.startsWith(o))o="",t=[],r={},i={};let k=new e.Lexer(e.defaults);k.tokens.links={...r};let a=k.lex(l.slice(o.length)),f=[...t,...a],u=a.links;if(t.length>0&&!T(i,u)){let s=e.lexer(l);f=[...s],u=s.links}i=u;let h=0,d=[];for(let s of f){if(!l.startsWith(s.raw,h))break;d.push(s),h+=s.raw.length}return t=d.slice(0,b(d,e)),o=l.slice(0,t.reduce((s,c)=>s+c.raw.length,0)),r=Object.create(null),e.walkTokens(t,(s)=>{if(s.type!=="def")return;let c=s;if(!Object.hasOwn(r,c.tag))r[c.tag]={href:c.href,title:c.title}}),structuredClone(f)}}}
3
- export{Xe};
@@ -1,2 +0,0 @@
1
- var ot={allow_once:0,allow_always:1,reject_once:2,reject_always:3};function Te(e){return[...e].toSorted((o,n)=>(ot[o.kind]??99)-(ot[n.kind]??99))}function Tt(e){return e==="allow_once"||e==="allow_always"}function Pt(e){return e==="allow_always"||e==="reject_always"}
2
- export{ot,Te,Tt,Pt};