colloq 0.2.0__py3-none-any.whl
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.
- colloq/__init__.py +12 -0
- colloq/__main__.py +315 -0
- colloq/_app/.colloq-dist.json +66 -0
- colloq/_app/LICENSE +21 -0
- colloq/_app/THIRD_PARTY_NOTICES.md +106 -0
- colloq/_app/cli/colloq.mjs +2517 -0
- colloq/_app/cli/launch.mjs +1572 -0
- colloq/_app/cli/package.json +5 -0
- colloq/_app/cli/public-url-lease.mjs +198 -0
- colloq/_app/kernel/Dockerfile +93 -0
- colloq/_app/kernel/environments/base-gpu.txt +21 -0
- colloq/_app/kernel/environments/base.txt +12 -0
- colloq/_app/kernel/environments/cv.txt +15 -0
- colloq/_app/kernel/environments/gpu.txt +17 -0
- colloq/_app/kernel/environments/kaggle-base.txt +20 -0
- colloq/_app/kernel/environments/pvz-geo.txt +6 -0
- colloq/_app/kernel/requirements.txt +18 -0
- colloq/_app/package.json +20 -0
- colloq/_app/scripts/backup-local.sh +165 -0
- colloq/_app/scripts/backup.sh +34 -0
- colloq/_app/scripts/cluster.sh +492 -0
- colloq/_app/scripts/dns.sh +251 -0
- colloq/_app/scripts/host.sh +1514 -0
- colloq/_app/scripts/lib.sh +62 -0
- colloq/_app/scripts/restore.sh +338 -0
- colloq/_app/scripts/runtime-backup.py +373 -0
- colloq/_app/scripts/state-lock.py +85 -0
- colloq/_app/server/assets/fonts/HSESans-Black.otf +0 -0
- colloq/_app/server/assets/fonts/HSESans-Bold.otf +0 -0
- colloq/_app/server/assets/fonts/HSESans-Regular.otf +0 -0
- colloq/_app/server/assets/fonts/JetBrainsMono-Medium.ttf +0 -0
- colloq/_app/server/assets/fonts/JetBrainsMono-OFL.txt +93 -0
- colloq/_app/server/dist/local-cleanup.js +15987 -0
- colloq/_app/server/dist/runtime-smoke.js +17026 -0
- colloq/_app/server/dist/server.js +54333 -0
- colloq/_app/server/package.json +6 -0
- colloq/_app/web/dist/assets/AdminScreen-C-cg0GlJ.css +1 -0
- colloq/_app/web/dist/assets/AdminScreen-C-cg0GlJ.css.br +0 -0
- colloq/_app/web/dist/assets/AdminScreen-C-cg0GlJ.css.gz +0 -0
- colloq/_app/web/dist/assets/AdminScreen-fu4cB6Ra.js +105 -0
- colloq/_app/web/dist/assets/AdminScreen-fu4cB6Ra.js.br +0 -0
- colloq/_app/web/dist/assets/AdminScreen-fu4cB6Ra.js.gz +0 -0
- colloq/_app/web/dist/assets/App-CMXNqOjp.css +1 -0
- colloq/_app/web/dist/assets/App-CMXNqOjp.css.br +0 -0
- colloq/_app/web/dist/assets/App-CMXNqOjp.css.gz +0 -0
- colloq/_app/web/dist/assets/App-DvCPzIRO.js +26 -0
- colloq/_app/web/dist/assets/App-DvCPzIRO.js.br +0 -0
- colloq/_app/web/dist/assets/App-DvCPzIRO.js.gz +0 -0
- colloq/_app/web/dist/assets/CellOutputs-Dl-AZL45.js +42 -0
- colloq/_app/web/dist/assets/CellOutputs-Dl-AZL45.js.br +0 -0
- colloq/_app/web/dist/assets/CellOutputs-Dl-AZL45.js.gz +0 -0
- colloq/_app/web/dist/assets/CommandPalette-DhBGho7_.js +3 -0
- colloq/_app/web/dist/assets/CommandPalette-DhBGho7_.js.br +0 -0
- colloq/_app/web/dist/assets/CommandPalette-DhBGho7_.js.gz +0 -0
- colloq/_app/web/dist/assets/CompetitionsScreen-Vu3RpHmf.js +3 -0
- colloq/_app/web/dist/assets/CompetitionsScreen-Vu3RpHmf.js.br +0 -0
- colloq/_app/web/dist/assets/CompetitionsScreen-Vu3RpHmf.js.gz +0 -0
- colloq/_app/web/dist/assets/ConsoleView-B2uyYvFh.js +1 -0
- colloq/_app/web/dist/assets/ConsoleView-B2uyYvFh.js.br +0 -0
- colloq/_app/web/dist/assets/ConsoleView-B2uyYvFh.js.gz +0 -0
- colloq/_app/web/dist/assets/ConsoleView-DLbp0Jul.css +1 -0
- colloq/_app/web/dist/assets/DependencyBundleCard-B392XMVZ.js +4 -0
- colloq/_app/web/dist/assets/DependencyBundleCard-B392XMVZ.js.br +0 -0
- colloq/_app/web/dist/assets/DependencyBundleCard-B392XMVZ.js.gz +0 -0
- colloq/_app/web/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- colloq/_app/web/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- colloq/_app/web/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- colloq/_app/web/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- colloq/_app/web/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- colloq/_app/web/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- colloq/_app/web/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- colloq/_app/web/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- colloq/_app/web/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- colloq/_app/web/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- colloq/_app/web/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- colloq/_app/web/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- colloq/_app/web/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- colloq/_app/web/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- colloq/_app/web/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- colloq/_app/web/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- colloq/_app/web/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- colloq/_app/web/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- colloq/_app/web/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- colloq/_app/web/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- colloq/_app/web/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- colloq/_app/web/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- colloq/_app/web/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- colloq/_app/web/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- colloq/_app/web/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- colloq/_app/web/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- colloq/_app/web/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- colloq/_app/web/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- colloq/_app/web/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- colloq/_app/web/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- colloq/_app/web/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- colloq/_app/web/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- colloq/_app/web/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- colloq/_app/web/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- colloq/_app/web/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- colloq/_app/web/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- colloq/_app/web/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- colloq/_app/web/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- colloq/_app/web/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- colloq/_app/web/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- colloq/_app/web/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- colloq/_app/web/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- colloq/_app/web/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- colloq/_app/web/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- colloq/_app/web/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- colloq/_app/web/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- colloq/_app/web/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- colloq/_app/web/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- colloq/_app/web/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- colloq/_app/web/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- colloq/_app/web/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- colloq/_app/web/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- colloq/_app/web/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- colloq/_app/web/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- colloq/_app/web/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- colloq/_app/web/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- colloq/_app/web/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- colloq/_app/web/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- colloq/_app/web/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- colloq/_app/web/dist/assets/PultWindow-B3cc8537.css +1 -0
- colloq/_app/web/dist/assets/PultWindow-B3cc8537.css.br +0 -0
- colloq/_app/web/dist/assets/PultWindow-B3cc8537.css.gz +0 -0
- colloq/_app/web/dist/assets/PultWindow-DPOUhSqt.js +8 -0
- colloq/_app/web/dist/assets/PultWindow-DPOUhSqt.js.br +0 -0
- colloq/_app/web/dist/assets/PultWindow-DPOUhSqt.js.gz +0 -0
- colloq/_app/web/dist/assets/ReaderScreen-CV_0VAvW.js +9 -0
- colloq/_app/web/dist/assets/ReaderScreen-CV_0VAvW.js.br +0 -0
- colloq/_app/web/dist/assets/ReaderScreen-CV_0VAvW.js.gz +0 -0
- colloq/_app/web/dist/assets/SessionScreen-BrcB6CLH.js +132 -0
- colloq/_app/web/dist/assets/SessionScreen-BrcB6CLH.js.br +0 -0
- colloq/_app/web/dist/assets/SessionScreen-BrcB6CLH.js.gz +0 -0
- colloq/_app/web/dist/assets/SessionScreen-Dek9dK3C.css +1 -0
- colloq/_app/web/dist/assets/SessionScreen-Dek9dK3C.css.br +0 -0
- colloq/_app/web/dist/assets/SessionScreen-Dek9dK3C.css.gz +0 -0
- colloq/_app/web/dist/assets/actions-DLPyolgo.js +1 -0
- colloq/_app/web/dist/assets/admin-en-BHmR7Co0.js +9 -0
- colloq/_app/web/dist/assets/admin-en-BHmR7Co0.js.br +0 -0
- colloq/_app/web/dist/assets/admin-en-BHmR7Co0.js.gz +0 -0
- colloq/_app/web/dist/assets/admin-ru-Dr6Z36Zi.js +11 -0
- colloq/_app/web/dist/assets/admin-ru-Dr6Z36Zi.js.br +0 -0
- colloq/_app/web/dist/assets/admin-ru-Dr6Z36Zi.js.gz +0 -0
- colloq/_app/web/dist/assets/codemirror-6LUh0q1l.js +32 -0
- colloq/_app/web/dist/assets/codemirror-6LUh0q1l.js.br +0 -0
- colloq/_app/web/dist/assets/codemirror-6LUh0q1l.js.gz +0 -0
- colloq/_app/web/dist/assets/competitions-en-zw57uAGL.js +5 -0
- colloq/_app/web/dist/assets/competitions-en-zw57uAGL.js.br +0 -0
- colloq/_app/web/dist/assets/competitions-en-zw57uAGL.js.gz +0 -0
- colloq/_app/web/dist/assets/competitions-ru-BBQUjAx0.js +5 -0
- colloq/_app/web/dist/assets/competitions-ru-BBQUjAx0.js.br +0 -0
- colloq/_app/web/dist/assets/competitions-ru-BBQUjAx0.js.gz +0 -0
- colloq/_app/web/dist/assets/editor-theme-CVYtpZDy.js +1 -0
- colloq/_app/web/dist/assets/editor-theme-CVYtpZDy.js.br +0 -0
- colloq/_app/web/dist/assets/editor-theme-CVYtpZDy.js.gz +0 -0
- colloq/_app/web/dist/assets/index-CwbYK31L.css +1 -0
- colloq/_app/web/dist/assets/index-CwbYK31L.css.br +0 -0
- colloq/_app/web/dist/assets/index-CwbYK31L.css.gz +0 -0
- colloq/_app/web/dist/assets/index-Di16xdmz.js +2 -0
- colloq/_app/web/dist/assets/index-Di16xdmz.js.br +0 -0
- colloq/_app/web/dist/assets/index-Di16xdmz.js.gz +0 -0
- colloq/_app/web/dist/assets/katex-CS_ezkZp.css +1 -0
- colloq/_app/web/dist/assets/katex-CS_ezkZp.css.br +0 -0
- colloq/_app/web/dist/assets/katex-CS_ezkZp.css.gz +0 -0
- colloq/_app/web/dist/assets/katex-DLorvT8M.js +257 -0
- colloq/_app/web/dist/assets/katex-DLorvT8M.js.br +0 -0
- colloq/_app/web/dist/assets/katex-DLorvT8M.js.gz +0 -0
- colloq/_app/web/dist/assets/pdf-DEp6sk-T.js +55 -0
- colloq/_app/web/dist/assets/pdf-DEp6sk-T.js.br +0 -0
- colloq/_app/web/dist/assets/pdf-DEp6sk-T.js.gz +0 -0
- colloq/_app/web/dist/assets/persistence.svelte-vcuCBcT5.js +1 -0
- colloq/_app/web/dist/assets/persistence.svelte-vcuCBcT5.js.br +0 -0
- colloq/_app/web/dist/assets/persistence.svelte-vcuCBcT5.js.gz +0 -0
- colloq/_app/web/dist/assets/reader-en-UCGE3U6V.js +3 -0
- colloq/_app/web/dist/assets/reader-en-UCGE3U6V.js.br +0 -0
- colloq/_app/web/dist/assets/reader-en-UCGE3U6V.js.gz +0 -0
- colloq/_app/web/dist/assets/reader-ru-CaiNj0K8.js +3 -0
- colloq/_app/web/dist/assets/reader-ru-CaiNj0K8.js.br +0 -0
- colloq/_app/web/dist/assets/reader-ru-CaiNj0K8.js.gz +0 -0
- colloq/_app/web/dist/assets/render-CjP3RuRT.js +155 -0
- colloq/_app/web/dist/assets/render-CjP3RuRT.js.br +0 -0
- colloq/_app/web/dist/assets/render-CjP3RuRT.js.gz +0 -0
- colloq/_app/web/dist/assets/render.svelte-B4_hAJmX.js +0 -0
- colloq/_app/web/dist/assets/render.svelte-B4_hAJmX.js.br +0 -0
- colloq/_app/web/dist/assets/render.svelte-B4_hAJmX.js.gz +0 -0
- colloq/_app/web/dist/assets/room-en-Bh8L6NcO.js +3 -0
- colloq/_app/web/dist/assets/room-en-Bh8L6NcO.js.br +0 -0
- colloq/_app/web/dist/assets/room-en-Bh8L6NcO.js.gz +0 -0
- colloq/_app/web/dist/assets/room-ru-Bar2GgS0.js +3 -0
- colloq/_app/web/dist/assets/room-ru-Bar2GgS0.js.br +0 -0
- colloq/_app/web/dist/assets/room-ru-Bar2GgS0.js.gz +0 -0
- colloq/_app/web/dist/assets/seminar-link-CRaZl9Ku.js +1 -0
- colloq/_app/web/dist/assets/seminar-link-CRaZl9Ku.js.br +0 -0
- colloq/_app/web/dist/assets/seminar-link-CRaZl9Ku.js.gz +0 -0
- colloq/_app/web/dist/assets/seminar-link-DoTugxxA.css +1 -0
- colloq/_app/web/dist/assets/seminar-link-DoTugxxA.css.br +0 -0
- colloq/_app/web/dist/assets/seminar-link-DoTugxxA.css.gz +0 -0
- colloq/_app/web/dist/assets/yjs-rjB3hdnL.js +6 -0
- colloq/_app/web/dist/assets/yjs-rjB3hdnL.js.br +0 -0
- colloq/_app/web/dist/assets/yjs-rjB3hdnL.js.gz +0 -0
- colloq/_app/web/dist/fonts/JetBrainsMono-OFL.txt +93 -0
- colloq/_app/web/dist/fonts/hse-sans-400.woff2 +0 -0
- colloq/_app/web/dist/fonts/hse-sans-600.woff2 +0 -0
- colloq/_app/web/dist/fonts/hse-sans-700.woff2 +0 -0
- colloq/_app/web/dist/fonts/hse-sans-900.woff2 +0 -0
- colloq/_app/web/dist/fonts/jetbrains-mono-cyrillic-ext.woff2 +0 -0
- colloq/_app/web/dist/fonts/jetbrains-mono-cyrillic.woff2 +0 -0
- colloq/_app/web/dist/fonts/jetbrains-mono-latin-ext.woff2 +0 -0
- colloq/_app/web/dist/fonts/jetbrains-mono-latin.woff2 +0 -0
- colloq/_app/web/dist/index.html +268 -0
- colloq/_app/web/dist/og/colloq.png +0 -0
- colloq/_app/web/dist/pdf/pdf.worker.min.mjs +29 -0
- colloq/_app/web/dist/pdf/pdf.worker.min.mjs.br +0 -0
- colloq/_app/web/dist/pdf/pdf.worker.min.mjs.gz +0 -0
- colloq/_app/web/dist/plotly/plotly.min.js +3620 -0
- colloq/_app/web/dist/plotly/plotly.min.js.br +0 -0
- colloq/_app/web/dist/plotly/plotly.min.js.gz +0 -0
- colloq/_version.py +5 -0
- colloq-0.2.0.dist-info/METADATA +124 -0
- colloq-0.2.0.dist-info/RECORD +224 -0
- colloq-0.2.0.dist-info/WHEEL +4 -0
- colloq-0.2.0.dist-info/entry_points.txt +2 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
var Br=Object.defineProperty;var Fr=(t,e,n)=>e in t?Br(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var w=(t,e,n)=>Fr(t,typeof e!="symbol"?e+"":e,n);function st(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ce=st();function Vn(t){ce=t}var $e={exec:()=>null};function y(t,e=""){let n=typeof t=="string"?t:t.source;const r={replace:(s,l)=>{let u=typeof l=="string"?l:l.source;return u=u.replace(U.caret,"$1"),n=n.replace(s,u),r},getRegex:()=>new RegExp(n,e)};return r}var U={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},Hr=/^(?:[ \t]*(?:\n|$))+/,Gr=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,jr=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,He=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,qr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Bt=/(?:[*+-]|\d{1,9}[.)])/,Qn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Jn=y(Qn).replace(/bull/g,Bt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Wr=y(Qn).replace(/bull/g,Bt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ft=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Yr=/^[^\n]+/,Ht=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Zr=y(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ht).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Xr=y(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Bt).getRegex(),lt="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",Gt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Vr=y("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Gt).replace("tag",lt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Kn=y(Ft).replace("hr",He).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",lt).getRegex(),Qr=y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Kn).getRegex(),jt={blockquote:Qr,code:Gr,def:Zr,fences:jr,heading:qr,hr:He,html:Vr,lheading:Jn,list:Xr,newline:Hr,paragraph:Kn,table:$e,text:Yr},An=y("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",He).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",lt).getRegex(),Jr={...jt,lheading:Wr,table:An,paragraph:y(Ft).replace("hr",He).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",An).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",lt).getRegex()},Kr={...jt,html:y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Gt).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:$e,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:y(Ft).replace("hr",He).replace("heading",` *#{1,6} *[^
|
|
2
|
+
]`).replace("lheading",Jn).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ei=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ti=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,er=/^( {2,}|\\)\n(?!\s*$)/,ni=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ot=/[\p{P}\p{S}]/u,qt=/[\s\p{P}\p{S}]/u,tr=/[^\s\p{P}\p{S}]/u,ri=y(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,qt).getRegex(),nr=/(?!~)[\p{P}\p{S}]/u,ii=/(?!~)[\s\p{P}\p{S}]/u,si=/(?:[^\s\p{P}\p{S}]|~)/u,li=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,rr=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,oi=y(rr,"u").replace(/punct/g,ot).getRegex(),ai=y(rr,"u").replace(/punct/g,nr).getRegex(),ir="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ci=y(ir,"gu").replace(/notPunctSpace/g,tr).replace(/punctSpace/g,qt).replace(/punct/g,ot).getRegex(),ui=y(ir,"gu").replace(/notPunctSpace/g,si).replace(/punctSpace/g,ii).replace(/punct/g,nr).getRegex(),pi=y("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,tr).replace(/punctSpace/g,qt).replace(/punct/g,ot).getRegex(),fi=y(/\\(punct)/,"gu").replace(/punct/g,ot).getRegex(),hi=y(/^<(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(),gi=y(Gt).replace("(?:-->|$)","-->").getRegex(),di=y("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",gi).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),it=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,mi=y(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",it).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),sr=y(/^!?\[(label)\]\[(ref)\]/).replace("label",it).replace("ref",Ht).getRegex(),lr=y(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ht).getRegex(),bi=y("reflink|nolink(?!\\()","g").replace("reflink",sr).replace("nolink",lr).getRegex(),Wt={_backpedal:$e,anyPunctuation:fi,autolink:hi,blockSkip:li,br:er,code:ti,del:$e,emStrongLDelim:oi,emStrongRDelimAst:ci,emStrongRDelimUnd:pi,escape:ei,link:mi,nolink:lr,punctuation:ri,reflink:sr,reflinkSearch:bi,tag:di,text:ni,url:$e},_i={...Wt,link:y(/^!?\[(label)\]\((.*?)\)/).replace("label",it).getRegex(),reflink:y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",it).getRegex()},Nt={...Wt,emStrongRDelimAst:ui,emStrongLDelim:ai,url:y(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},xi={...Nt,br:y(er).replace("{2,}","*").getRegex(),text:y(Nt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},nt={normal:jt,gfm:Jr,pedantic:Kr},Ce={normal:Wt,gfm:Nt,breaks:xi,pedantic:_i},ki={"&":"&","<":"<",">":">",'"':""","'":"'"},Rn=t=>ki[t];function K(t,e){if(e){if(U.escapeTest.test(t))return t.replace(U.escapeReplace,Rn)}else if(U.escapeTestNoEncode.test(t))return t.replace(U.escapeReplaceNoEncode,Rn);return t}function Ln(t){try{t=encodeURI(t).replace(U.percentDecode,"%")}catch{return null}return t}function On(t,e){var l;const n=t.replace(U.findPipe,(u,a,p)=>{let c=!1,h=a;for(;--h>=0&&p[h]==="\\";)c=!c;return c?"|":" |"}),r=n.split(U.splitPipe);let s=0;if(r[0].trim()||r.shift(),r.length>0&&!((l=r.at(-1))!=null&&l.trim())&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(U.slashPipe,"|");return r}function De(t,e,n){const r=t.length;if(r===0)return"";let s=0;for(;s<r&&t.charAt(r-s-1)===e;)s++;return t.slice(0,r-s)}function Ti(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return n>0?-2:-1}function In(t,e,n,r,s){const l=e.href,u=e.title||null,a=t[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;const p={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:l,title:u,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,p}function yi(t,e,n){const r=t.match(n.other.indentCodeCompensation);if(r===null)return e;const s=r[1];return e.split(`
|
|
3
|
+
`).map(l=>{const u=l.match(n.other.beginningSpace);if(u===null)return l;const[a]=u;return a.length>=s.length?l.slice(s.length):l}).join(`
|
|
4
|
+
`)}var Be=class{constructor(t){w(this,"options");w(this,"rules");w(this,"lexer");this.options=t||ce}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){const e=this.rules.block.code.exec(t);if(e){const n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:De(n,`
|
|
5
|
+
`)}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const n=e[0],r=yi(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){const r=De(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:De(e[0],`
|
|
6
|
+
`)}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let n=De(e[0],`
|
|
7
|
+
`).split(`
|
|
8
|
+
`),r="",s="";const l=[];for(;n.length>0;){let u=!1;const a=[];let p;for(p=0;p<n.length;p++)if(this.rules.other.blockquoteStart.test(n[p]))a.push(n[p]),u=!0;else if(!u)a.push(n[p]);else break;n=n.slice(p);const c=a.join(`
|
|
9
|
+
`),h=c.replace(this.rules.other.blockquoteSetextReplace,`
|
|
10
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
11
|
+
${c}`:c,s=s?`${s}
|
|
12
|
+
${h}`:h;const T=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,l,!0),this.lexer.state.top=T,n.length===0)break;const m=l.at(-1);if((m==null?void 0:m.type)==="code")break;if((m==null?void 0:m.type)==="blockquote"){const D=m,x=D.raw+`
|
|
13
|
+
`+n.join(`
|
|
14
|
+
`),M=this.blockquote(x);l[l.length-1]=M,r=r.substring(0,r.length-D.raw.length)+M.raw,s=s.substring(0,s.length-D.text.length)+M.text;break}else if((m==null?void 0:m.type)==="list"){const D=m,x=D.raw+`
|
|
15
|
+
`+n.join(`
|
|
16
|
+
`),M=this.list(x);l[l.length-1]=M,r=r.substring(0,r.length-m.raw.length)+M.raw,s=s.substring(0,s.length-D.raw.length)+M.raw,n=x.substring(l.at(-1).raw.length).split(`
|
|
17
|
+
`);continue}}return{type:"blockquote",raw:r,tokens:l,text:s}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim();const r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const l=this.rules.other.listItemRegex(n);let u=!1;for(;t;){let p=!1,c="",h="";if(!(e=l.exec(t))||this.rules.block.hr.test(t))break;c=e[0],t=t.substring(c.length);let T=e[2].split(`
|
|
18
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,Z=>" ".repeat(3*Z.length)),m=t.split(`
|
|
19
|
+
`,1)[0],D=!T.trim(),x=0;if(this.options.pedantic?(x=2,h=T.trimStart()):D?x=e[1].length+1:(x=e[2].search(this.rules.other.nonSpaceChar),x=x>4?1:x,h=T.slice(x),x+=e[1].length),D&&this.rules.other.blankLine.test(m)&&(c+=m+`
|
|
20
|
+
`,t=t.substring(m.length+1),p=!0),!p){const Z=this.rules.other.nextBulletRegex(x),Re=this.rules.other.hrRegex(x),be=this.rules.other.fencesBeginRegex(x),X=this.rules.other.headingBeginRegex(x),re=this.rules.other.htmlBeginRegex(x);for(;t;){const ie=t.split(`
|
|
21
|
+
`,1)[0];let W;if(m=ie,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),W=m):W=m.replace(this.rules.other.tabCharGlobal," "),be.test(m)||X.test(m)||re.test(m)||Z.test(m)||Re.test(m))break;if(W.search(this.rules.other.nonSpaceChar)>=x||!m.trim())h+=`
|
|
22
|
+
`+W.slice(x);else{if(D||T.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||be.test(T)||X.test(T)||Re.test(T))break;h+=`
|
|
23
|
+
`+m}!D&&!m.trim()&&(D=!0),c+=ie+`
|
|
24
|
+
`,t=t.substring(ie.length+1),T=W.slice(x)}}s.loose||(u?s.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(u=!0));let M=null,ne;this.options.gfm&&(M=this.rules.other.listIsTask.exec(h),M&&(ne=M[0]!=="[ ] ",h=h.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:c,task:!!M,checked:ne,loose:!1,text:h,tokens:[]}),s.raw+=c}const a=s.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let p=0;p<s.items.length;p++)if(this.lexer.state.top=!1,s.items[p].tokens=this.lexer.blockTokens(s.items[p].text,[]),!s.loose){const c=s.items[p].tokens.filter(T=>T.type==="space"),h=c.length>0&&c.some(T=>this.rules.other.anyLine.test(T.raw));s.loose=h}if(s.loose)for(let p=0;p<s.items.length;p++)s.items[p].loose=!0;return s}}html(t){const e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){const e=this.rules.block.def.exec(t);if(e){const n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:r,title:s}}}table(t){var u;const e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;const n=On(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(u=e[3])!=null&&u.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
25
|
+
`):[],l={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const a of r)this.rules.other.tableAlignRight.test(a)?l.align.push("right"):this.rules.other.tableAlignCenter.test(a)?l.align.push("center"):this.rules.other.tableAlignLeft.test(a)?l.align.push("left"):l.align.push(null);for(let a=0;a<n.length;a++)l.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:l.align[a]});for(const a of s)l.rows.push(On(a,l.header.length).map((p,c)=>({text:p,tokens:this.lexer.inline(p),header:!1,align:l.align[c]})));return l}}lheading(t){const e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){const e=this.rules.block.paragraph.exec(t);if(e){const n=e[1].charAt(e[1].length-1)===`
|
|
26
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){const 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){const e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){const 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){const e=this.rules.inline.link.exec(t);if(e){const n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const l=De(n.slice(0,-1),"\\");if((n.length-l.length)%2===0)return}else{const l=Ti(e[2],"()");if(l===-2)return;if(l>-1){const 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 r=e[2],s="";if(this.options.pedantic){const l=this.rules.other.pedanticHrefTitle.exec(r);l&&(r=l[1],s=l[3])}else s=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),In(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){const r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[r.toLowerCase()];if(!s){const l=n[0].charAt(0);return{type:"text",raw:l,text:l}}return In(n,s,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const l=[...r[0]].length-1;let u,a,p=l,c=0;const h=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*t.length+l);(r=h.exec(e))!=null;){if(u=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!u)continue;if(a=[...u].length,r[3]||r[4]){p+=a;continue}else if((r[5]||r[6])&&l%3&&!((l+a)%3)){c+=a;continue}if(p-=a,p>0)continue;a=Math.min(a,a+p+c);const T=[...r[0]][0].length,m=t.slice(0,l+r.index+T+a);if(Math.min(l,a)%2){const x=m.slice(1,-1);return{type:"em",raw:m,text:x,tokens:this.lexer.inlineTokens(x)}}const D=m.slice(2,-2);return{type:"strong",raw:m,text:D,tokens:this.lexer.inlineTokens(D)}}}}codespan(t){const e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){const e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){const e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){const e=this.rules.inline.autolink.exec(t);if(e){let n,r;return e[2]==="@"?(n=e[1],r="mailto:"+n):(n=e[1],r=n),{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var n;let e;if(e=this.rules.inline.url.exec(t)){let r,s;if(e[2]==="@")r=e[0],s="mailto:"+r;else{let l;do l=e[0],e[0]=((n=this.rules.inline._backpedal.exec(e[0]))==null?void 0:n[0])??"";while(l!==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,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){const e=this.rules.inline.text.exec(t);if(e){const n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},ee=class Mt{constructor(e){w(this,"tokens");w(this,"options");w(this,"state");w(this,"tokenizer");w(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ce,this.options.tokenizer=this.options.tokenizer||new Be,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={other:U,block:nt.normal,inline:Ce.normal};this.options.pedantic?(n.block=nt.pedantic,n.inline=Ce.pedantic):this.options.gfm&&(n.block=nt.gfm,this.options.breaks?n.inline=Ce.breaks:n.inline=Ce.gfm),this.tokenizer.rules=n}static get rules(){return{block:nt,inline:Ce}}static lex(e,n){return new Mt(n).lex(e)}static lexInline(e,n){return new Mt(n).inlineTokens(e)}lex(e){e=e.replace(U.carriageReturn,`
|
|
27
|
+
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){const r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],r=!1){var s,l,u;for(this.options.pedantic&&(e=e.replace(U.tabCharGlobal," ").replace(U.spaceLine,""));e;){let a;if((l=(s=this.options.extensions)==null?void 0:s.block)!=null&&l.some(c=>(a=c.call({lexer:this},e,n))?(e=e.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.space(e)){e=e.substring(a.raw.length);const c=n.at(-1);a.raw.length===1&&c!==void 0?c.raw+=`
|
|
28
|
+
`:n.push(a);continue}if(a=this.tokenizer.code(e)){e=e.substring(a.raw.length);const c=n.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=`
|
|
29
|
+
`+a.raw,c.text+=`
|
|
30
|
+
`+a.text,this.inlineQueue.at(-1).src=c.text):n.push(a);continue}if(a=this.tokenizer.fences(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.heading(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.hr(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.blockquote(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.list(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.html(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.def(e)){e=e.substring(a.raw.length);const c=n.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=`
|
|
31
|
+
`+a.raw,c.text+=`
|
|
32
|
+
`+a.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title});continue}if(a=this.tokenizer.table(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.lheading(e)){e=e.substring(a.raw.length),n.push(a);continue}let p=e;if((u=this.options.extensions)!=null&&u.startBlock){let c=1/0;const h=e.slice(1);let T;this.options.extensions.startBlock.forEach(m=>{T=m.call({lexer:this},h),typeof T=="number"&&T>=0&&(c=Math.min(c,T))}),c<1/0&&c>=0&&(p=e.substring(0,c+1))}if(this.state.top&&(a=this.tokenizer.paragraph(p))){const c=n.at(-1);r&&(c==null?void 0:c.type)==="paragraph"?(c.raw+=`
|
|
33
|
+
`+a.raw,c.text+=`
|
|
34
|
+
`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):n.push(a),r=p.length!==e.length,e=e.substring(a.raw.length);continue}if(a=this.tokenizer.text(e)){e=e.substring(a.raw.length);const c=n.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=`
|
|
35
|
+
`+a.raw,c.text+=`
|
|
36
|
+
`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):n.push(a);continue}if(e){const c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){var a,p,c;let r=e,s=null;if(this.tokens.links){const h=Object.keys(this.tokens.links);if(h.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)h.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let l=!1,u="";for(;e;){l||(u=""),l=!1;let h;if((p=(a=this.options.extensions)==null?void 0:a.inline)!=null&&p.some(m=>(h=m.call({lexer:this},e,n))?(e=e.substring(h.raw.length),n.push(h),!0):!1))continue;if(h=this.tokenizer.escape(e)){e=e.substring(h.raw.length),n.push(h);continue}if(h=this.tokenizer.tag(e)){e=e.substring(h.raw.length),n.push(h);continue}if(h=this.tokenizer.link(e)){e=e.substring(h.raw.length),n.push(h);continue}if(h=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(h.raw.length);const m=n.at(-1);h.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=h.raw,m.text+=h.text):n.push(h);continue}if(h=this.tokenizer.emStrong(e,r,u)){e=e.substring(h.raw.length),n.push(h);continue}if(h=this.tokenizer.codespan(e)){e=e.substring(h.raw.length),n.push(h);continue}if(h=this.tokenizer.br(e)){e=e.substring(h.raw.length),n.push(h);continue}if(h=this.tokenizer.del(e)){e=e.substring(h.raw.length),n.push(h);continue}if(h=this.tokenizer.autolink(e)){e=e.substring(h.raw.length),n.push(h);continue}if(!this.state.inLink&&(h=this.tokenizer.url(e))){e=e.substring(h.raw.length),n.push(h);continue}let T=e;if((c=this.options.extensions)!=null&&c.startInline){let m=1/0;const D=e.slice(1);let x;this.options.extensions.startInline.forEach(M=>{x=M.call({lexer:this},D),typeof x=="number"&&x>=0&&(m=Math.min(m,x))}),m<1/0&&m>=0&&(T=e.substring(0,m+1))}if(h=this.tokenizer.inlineText(T)){e=e.substring(h.raw.length),h.raw.slice(-1)!=="_"&&(u=h.raw.slice(-1)),l=!0;const m=n.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=h.raw,m.text+=h.text):n.push(h);continue}if(e){const m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return n}},Fe=class{constructor(t){w(this,"options");w(this,"parser");this.options=t||ce}space(t){return""}code({text:t,lang:e,escaped:n}){var l;const r=(l=(e||"").match(U.notSpaceStart))==null?void 0:l[0],s=t.replace(U.endingNewline,"")+`
|
|
37
|
+
`;return r?'<pre><code class="language-'+K(r)+'">'+(n?s:K(s,!0))+`</code></pre>
|
|
38
|
+
`:"<pre><code>"+(n?s:K(s,!0))+`</code></pre>
|
|
39
|
+
`}blockquote({tokens:t}){return`<blockquote>
|
|
40
|
+
${this.parser.parse(t)}</blockquote>
|
|
41
|
+
`}html({text:t}){return t}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|
42
|
+
`}hr(t){return`<hr>
|
|
43
|
+
`}list(t){const e=t.ordered,n=t.start;let r="";for(let u=0;u<t.items.length;u++){const a=t.items[u];r+=this.listitem(a)}const s=e?"ol":"ul",l=e&&n!==1?' start="'+n+'"':"";return"<"+s+l+`>
|
|
44
|
+
`+r+"</"+s+`>
|
|
45
|
+
`}listitem(t){var n;let e="";if(t.task){const r=this.checkbox({checked:!!t.checked});t.loose?((n=t.tokens[0])==null?void 0:n.type)==="paragraph"?(t.tokens[0].text=r+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=r+" "+K(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):e+=r+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>
|
|
46
|
+
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
47
|
+
`}table(t){let e="",n="";for(let s=0;s<t.header.length;s++)n+=this.tablecell(t.header[s]);e+=this.tablerow({text:n});let r="";for(let s=0;s<t.rows.length;s++){const l=t.rows[s];n="";for(let u=0;u<l.length;u++)n+=this.tablecell(l[u]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
48
|
+
<thead>
|
|
49
|
+
`+e+`</thead>
|
|
50
|
+
`+r+`</table>
|
|
51
|
+
`}tablerow({text:t}){return`<tr>
|
|
52
|
+
${t}</tr>
|
|
53
|
+
`}tablecell(t){const e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
54
|
+
`}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>${K(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){const r=this.parser.parseInline(n),s=Ln(t);if(s===null)return r;t=s;let l='<a href="'+t+'"';return e&&(l+=' title="'+K(e)+'"'),l+=">"+r+"</a>",l}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const s=Ln(t);if(s===null)return K(n);t=s;let l=`<img src="${t}" alt="${n}"`;return e&&(l+=` title="${K(e)}"`),l+=">",l}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:K(t.text)}},at=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""}},te=class zt{constructor(e){w(this,"options");w(this,"renderer");w(this,"textRenderer");this.options=e||ce,this.options.renderer=this.options.renderer||new Fe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new at}static parse(e,n){return new zt(n).parse(e)}static parseInline(e,n){return new zt(n).parseInline(e)}parse(e,n=!0){var s,l;let r="";for(let u=0;u<e.length;u++){const a=e[u];if((l=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&l[a.type]){const c=a,h=this.options.extensions.renderers[c.type].call({parser:this},c);if(h!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(c.type)){r+=h||"";continue}}const p=a;switch(p.type){case"space":{r+=this.renderer.space(p);continue}case"hr":{r+=this.renderer.hr(p);continue}case"heading":{r+=this.renderer.heading(p);continue}case"code":{r+=this.renderer.code(p);continue}case"table":{r+=this.renderer.table(p);continue}case"blockquote":{r+=this.renderer.blockquote(p);continue}case"list":{r+=this.renderer.list(p);continue}case"html":{r+=this.renderer.html(p);continue}case"paragraph":{r+=this.renderer.paragraph(p);continue}case"text":{let c=p,h=this.renderer.text(c);for(;u+1<e.length&&e[u+1].type==="text";)c=e[++u],h+=`
|
|
55
|
+
`+this.renderer.text(c);n?r+=this.renderer.paragraph({type:"paragraph",raw:h,text:h,tokens:[{type:"text",raw:h,text:h,escaped:!0}]}):r+=h;continue}default:{const c='Token with "'+p.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return r}parseInline(e,n=this.renderer){var s,l;let r="";for(let u=0;u<e.length;u++){const a=e[u];if((l=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&l[a.type]){const c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=c||"";continue}}const p=a;switch(p.type){case"escape":{r+=n.text(p);break}case"html":{r+=n.html(p);break}case"link":{r+=n.link(p);break}case"image":{r+=n.image(p);break}case"strong":{r+=n.strong(p);break}case"em":{r+=n.em(p);break}case"codespan":{r+=n.codespan(p);break}case"br":{r+=n.br(p);break}case"del":{r+=n.del(p);break}case"text":{r+=n.text(p);break}default:{const c='Token with "'+p.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return r}},Pt,Ue=(Pt=class{constructor(t){w(this,"options");w(this,"block");this.options=t||ce}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?ee.lex:ee.lexInline}provideParser(){return this.block?te.parse:te.parseInline}},w(Pt,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Pt),or=class{constructor(...t){w(this,"defaults",st());w(this,"options",this.setOptions);w(this,"parse",this.parseMarkdown(!0));w(this,"parseInline",this.parseMarkdown(!1));w(this,"Parser",te);w(this,"Renderer",Fe);w(this,"TextRenderer",at);w(this,"Lexer",ee);w(this,"Tokenizer",Be);w(this,"Hooks",Ue);this.use(...t)}walkTokens(t,e){var r,s;let n=[];for(const l of t)switch(n=n.concat(e.call(this,l)),l.type){case"table":{const u=l;for(const a of u.header)n=n.concat(this.walkTokens(a.tokens,e));for(const a of u.rows)for(const p of a)n=n.concat(this.walkTokens(p.tokens,e));break}case"list":{const u=l;n=n.concat(this.walkTokens(u.items,e));break}default:{const u=l;(s=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&s[u.type]?this.defaults.extensions.childTokens[u.type].forEach(a=>{const p=u[a].flat(1/0);n=n.concat(this.walkTokens(p,e))}):u.tokens&&(n=n.concat(this.walkTokens(u.tokens,e)))}}return n}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{const r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const l=e.renderers[s.name];l?e.renderers[s.name]=function(...u){let a=s.renderer.apply(this,u);return a===!1&&(a=l.apply(this,u)),a}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const l=e[s.level];l?l.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),r.extensions=e),n.renderer){const s=this.defaults.renderer||new Fe(this.defaults);for(const l in n.renderer){if(!(l in s))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;const u=l,a=n.renderer[u],p=s[u];s[u]=(...c)=>{let h=a.apply(s,c);return h===!1&&(h=p.apply(s,c)),h||""}}r.renderer=s}if(n.tokenizer){const s=this.defaults.tokenizer||new Be(this.defaults);for(const l in n.tokenizer){if(!(l in s))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;const u=l,a=n.tokenizer[u],p=s[u];s[u]=(...c)=>{let h=a.apply(s,c);return h===!1&&(h=p.apply(s,c)),h}}r.tokenizer=s}if(n.hooks){const s=this.defaults.hooks||new Ue;for(const l in n.hooks){if(!(l in s))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;const u=l,a=n.hooks[u],p=s[u];Ue.passThroughHooks.has(l)?s[u]=c=>{if(this.defaults.async)return Promise.resolve(a.call(s,c)).then(T=>p.call(s,T));const h=a.call(s,c);return p.call(s,h)}:s[u]=(...c)=>{let h=a.apply(s,c);return h===!1&&(h=p.apply(s,c)),h}}r.hooks=s}if(n.walkTokens){const s=this.defaults.walkTokens,l=n.walkTokens;r.walkTokens=function(u){let a=[];return a.push(l.call(this,u)),s&&(a=a.concat(s.call(this,u))),a}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return ee.lex(t,e??this.defaults)}parser(t,e){return te.parse(t,e??this.defaults)}parseMarkdown(t){return(n,r)=>{const s={...r},l={...this.defaults,...s},u=this.onError(!!l.silent,!!l.async);if(this.defaults.async===!0&&s.async===!1)return u(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return u(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return u(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));l.hooks&&(l.hooks.options=l,l.hooks.block=t);const a=l.hooks?l.hooks.provideLexer():t?ee.lex:ee.lexInline,p=l.hooks?l.hooks.provideParser():t?te.parse:te.parseInline;if(l.async)return Promise.resolve(l.hooks?l.hooks.preprocess(n):n).then(c=>a(c,l)).then(c=>l.hooks?l.hooks.processAllTokens(c):c).then(c=>l.walkTokens?Promise.all(this.walkTokens(c,l.walkTokens)).then(()=>c):c).then(c=>p(c,l)).then(c=>l.hooks?l.hooks.postprocess(c):c).catch(u);try{l.hooks&&(n=l.hooks.preprocess(n));let c=a(n,l);l.hooks&&(c=l.hooks.processAllTokens(c)),l.walkTokens&&this.walkTokens(c,l.walkTokens);let h=p(c,l);return l.hooks&&(h=l.hooks.postprocess(h)),h}catch(c){return u(c)}}}onError(t,e){return n=>{if(n.message+=`
|
|
56
|
+
Please report this to https://github.com/markedjs/marked.`,t){const r="<p>An error occurred:</p><pre>"+K(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},me=new or;function S(t,e){return me.parse(t,e)}S.options=S.setOptions=function(t){return me.setOptions(t),S.defaults=me.defaults,Vn(S.defaults),S};S.getDefaults=st;S.defaults=ce;S.use=function(...t){return me.use(...t),S.defaults=me.defaults,Vn(S.defaults),S};S.walkTokens=function(t,e){return me.walkTokens(t,e)};S.parseInline=me.parseInline;S.Parser=te;S.parser=te.parse;S.Renderer=Fe;S.TextRenderer=at;S.Lexer=ee;S.lexer=ee.lex;S.Tokenizer=Be;S.Hooks=Ue;S.parse=S;S.options;S.setOptions;S.use;S.walkTokens;S.parseInline;te.parse;ee.lex;const os=Object.freeze(Object.defineProperty({__proto__:null,Hooks:Ue,Lexer:ee,Marked:or,Parser:te,Renderer:Fe,TextRenderer:at,Tokenizer:Be,get defaults(){return ce},getDefaults:st,marked:S},Symbol.toStringTag,{value:"Module"}));/*! @license DOMPurify 3.4.14 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.14/LICENSE */function vn(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Si(t){if(Array.isArray(t))return t}function wi(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,s,l,u,a=[],p=!0,c=!1;try{if(l=(n=n.call(t)).next,e!==0)for(;!(p=(r=l.call(n)).done)&&(a.push(r.value),a.length!==e);p=!0);}catch(h){c=!0,s=h}finally{try{if(!p&&n.return!=null&&(u=n.return(),Object(u)!==u))return}finally{if(c)throw s}}return a}}function Ei(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
57
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ai(t,e){return Si(t)||wi(t,e)||Ri(t,e)||Ei()}function Ri(t,e){if(t){if(typeof t=="string")return vn(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vn(t,e):void 0}}const ar=Object.entries,Cn=Object.setPrototypeOf,Li=Object.isFrozen,Oi=Object.getPrototypeOf,Ii=Object.getOwnPropertyDescriptor;let P=Object.freeze,N=Object.seal,Ee=Object.create,cr=typeof Reflect<"u"&&Reflect,$t=cr.apply,Ut=cr.construct;P||(P=function(e){return e});N||(N=function(e){return e});$t||($t=function(e,n){for(var r=arguments.length,s=new Array(r>2?r-2:0),l=2;l<r;l++)s[l-2]=arguments[l];return e.apply(n,s)});Ut||(Ut=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return new e(...r)});const de=C(Array.prototype.forEach),vi=C(Array.prototype.lastIndexOf),Dn=C(Array.prototype.pop),Pe=C(Array.prototype.push),Ci=C(Array.prototype.splice),Ae=Array.isArray,ze=C(String.prototype.toLowerCase),Rt=C(String.prototype.toString),Pn=C(String.prototype.match),Ne=C(String.prototype.replace),Nn=C(String.prototype.indexOf),Di=C(String.prototype.trim),Pi=C(Number.prototype.toString),Ni=C(Boolean.prototype.toString),Mn=typeof BigInt>"u"?null:C(BigInt.prototype.toString),zn=typeof Symbol>"u"?null:C(Symbol.prototype.toString),G=C(Object.prototype.hasOwnProperty),Me=C(Object.prototype.toString),z=C(RegExp.prototype.test),ge=Mi(TypeError);function C(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return $t(t,e,r)}}function Mi(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Ut(t,n)}}function k(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ze;if(Cn&&Cn(t,null),!Ae(e))return t;let r=e.length;for(;r--;){let s=e[r];if(typeof s=="string"){const l=n(s);l!==s&&(Li(e)||(e[r]=l),s=l)}t[s]=!0}return t}function zi(t){for(let e=0;e<t.length;e++)G(t,e)||(t[e]=null);return t}function q(t){const e=Ee(null);for(const r of ar(t)){var n=Ai(r,2);const s=n[0],l=n[1];G(t,s)&&(Ae(l)?e[s]=zi(l):l&&typeof l=="object"&&l.constructor===Object?e[s]=q(l):e[s]=l)}return e}function $i(t){switch(typeof t){case"string":return t;case"number":return Pi(t);case"boolean":return Ni(t);case"bigint":return Mn?Mn(t):"0";case"symbol":return zn?zn(t):"Symbol()";case"undefined":return Me(t);case"function":case"object":{if(t===null)return Me(t);const e=t,n=Y(e,"toString");if(typeof n=="function"){const r=n(e);return typeof r=="string"?r:Me(r)}return Me(t)}default:return Me(t)}}function Y(t,e){for(;t!==null;){const r=Ii(t,e);if(r){if(r.get)return C(r.get);if(typeof r.value=="function")return C(r.value)}t=Oi(t)}function n(){return null}return n}function Ui(t){try{return z(t,""),!0}catch{return!1}}const $n=P(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Lt=P(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ot=P(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Bi=P(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),It=P(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Fi=P(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Un=P(["#text"]),Bn=P(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),vt=P(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Fn=P(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),rt=P(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Hi=N(/{{[\w\W]*|^[\w\W]*}}/g),Gi=N(/<%[\w\W]*|^[\w\W]*%>/g),ji=N(/\${[\w\W]*/g),qi=N(/^data-[\-\w.\u00B7-\uFFFF]+$/),Wi=N(/^aria-[\-\w]+$/),Hn=N(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Yi=N(/^(?:\w+script|data):/i),Zi=N(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Xi=N(/^html$/i),Vi=N(/^[a-z][.\w]*(-[.\w]+)+$/i),Gn=N(/<[/\w!]/g),jn=N(/<[/\w]/g),Qi=N(/<\/no(script|embed|frames)/i),Ji=N(/\/>/i),j={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ur=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],Ki=P(k({},ur)),es=function(){const t={};return de(ur,e=>{t[e]=N(new RegExp("</"+e+"(?=[\\t\\n\\f\\r />])","i"))}),P(t)}(),ts=function(){return typeof window>"u"?null:window},ns=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const s="data-tt-policy-suffix";n&&n.hasAttribute(s)&&(r=n.getAttribute(s));const l="dompurify"+(r?"#"+r:"");try{return e.createPolicy(l,{createHTML(u){return u},createScriptURL(u){return u}})}catch{return console.warn("TrustedTypes policy "+l+" could not be created."),null}},qn=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ae=function(e,n,r,s){return G(e,n)&&Ae(e[n])?k(s.base?q(s.base):{},e[n],s.transform):r},Ct=function(e,n,r){const s=G(e,n)?e[n]:void 0;return s&&typeof s=="object"?q(s):r()};function pr(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ts();const e=g=>pr(g);if(e.version="3.4.14",e.removed=[],!t||!t.document||t.document.nodeType!==j.document||!t.Element)return e.isSupported=!1,e;let n=t.document;const r=n,s=r.currentScript;t.DocumentFragment;const l=t.HTMLTemplateElement,u=t.Node,a=t.Element,p=t.NodeFilter,c=t.NamedNodeMap;c===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const h=t.DOMParser,T=t.trustedTypes,m=a.prototype,D=Y(m,"cloneNode"),x=Y(m,"remove"),M=Y(m,"nextSibling"),ne=Y(m,"childNodes"),Z=Y(m,"parentNode"),Re=Y(m,"shadowRoot"),be=Y(m,"attributes"),X=u&&u.prototype?Y(u.prototype,"nodeType"):null,re=u&&u.prototype?Y(u.prototype,"nodeName"):null,ie=u&&u.prototype?Y(u.prototype,"ownerDocument"):null,W=function(i){return X?X(i):i.nodeType},ct=function(i){return re?re(i):i.nodeName};if(typeof l=="function"){const g=n.createElement("template");g.content&&g.content.ownerDocument&&(n=g.content.ownerDocument)}let B,ue="",ut,Yt=!1,Le=0;const Zt=function(){if(Le>0)throw ge('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},_e=function(i){Zt(),Le++;try{return B.createHTML(i)}finally{Le--}},fr=function(i){Zt(),Le++;try{return B.createScriptURL(i)}finally{Le--}},hr=function(){return Yt||(ut=ns(T,s),Yt=!0),ut},Ge=n,pt=Ge.implementation,Xt=Ge.createNodeIterator,gr=Ge.createDocumentFragment,dr=Ge.getElementsByTagName,mr=r.importNode;let R=qn();e.isSupported=typeof ar=="function"&&typeof Z=="function"&&pt&&pt.createHTMLDocument!==void 0;const br=Hi,_r=Gi,xr=ji,kr=qi,Tr=Wi,yr=Yi,Vt=Zi,Sr=Vi;let Qt=Hn,L=null;const ft=k({},[...$n,...Lt,...Ot,...It,...Un]);let O=null;const ht=k({},[...Bn,...vt,...Fn,...rt]);let V=Object.seal(Ee(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Oe=null,Jt=null;const se=Object.seal(Ee(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Kt=!0,gt=!0,en=!1,tn=!0,le=!1,pe=!0,fe=!1,dt=!1,je=null,qe=null,mt=!1,xe=!1,We=!1,Ye=!1,nn=!0,rn=!1;const sn="user-content-";let bt=!0,_t=!1,ke={},Te=null;const ln=k({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let on=null;const an=k({},["audio","video","img","source","image","track"]);let cn=null;const un=k({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ze="http://www.w3.org/1998/Math/MathML",Xe="http://www.w3.org/2000/svg",Q="http://www.w3.org/1999/xhtml";let ye=Q,xt=!1,kt=null;const wr=k({},[Ze,Xe,Q],Rt),pn=P(["mi","mo","mn","ms","mtext"]);let Tt=k({},pn);const fn=P(["annotation-xml"]);let yt=k({},fn);const Er=k({},["title","style","font","a","script"]);let Ie=null;const Ar=["application/xhtml+xml","text/html"],Rr="text/html";let v=null,Se=null;const Lr=n.createElement("form"),hn=function(i){return i instanceof RegExp||i instanceof Function},St=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Se&&Se===i)return;(!i||typeof i!="object")&&(i={}),i=q(i),Ie=Ar.indexOf(i.PARSER_MEDIA_TYPE)===-1?Rr:i.PARSER_MEDIA_TYPE,v=Ie==="application/xhtml+xml"?Rt:ze,L=ae(i,"ALLOWED_TAGS",ft,{transform:v}),O=ae(i,"ALLOWED_ATTR",ht,{transform:v}),kt=ae(i,"ALLOWED_NAMESPACES",wr,{transform:Rt}),cn=ae(i,"ADD_URI_SAFE_ATTR",un,{transform:v,base:un}),on=ae(i,"ADD_DATA_URI_TAGS",an,{transform:v,base:an}),Te=ae(i,"FORBID_CONTENTS",ln,{transform:v}),Oe=ae(i,"FORBID_TAGS",q({}),{transform:v}),Jt=ae(i,"FORBID_ATTR",q({}),{transform:v}),ke=G(i,"USE_PROFILES")?i.USE_PROFILES&&typeof i.USE_PROFILES=="object"?q(i.USE_PROFILES):i.USE_PROFILES:!1,Kt=i.ALLOW_ARIA_ATTR!==!1,gt=i.ALLOW_DATA_ATTR!==!1,en=i.ALLOW_UNKNOWN_PROTOCOLS||!1,tn=i.ALLOW_SELF_CLOSE_IN_ATTR!==!1,le=i.SAFE_FOR_TEMPLATES||!1,pe=i.SAFE_FOR_XML!==!1,fe=i.WHOLE_DOCUMENT||!1,xe=i.RETURN_DOM||!1,We=i.RETURN_DOM_FRAGMENT||!1,Ye=i.RETURN_TRUSTED_TYPE||!1,mt=i.FORCE_BODY||!1,nn=i.SANITIZE_DOM!==!1,rn=i.SANITIZE_NAMED_PROPS||!1,bt=i.KEEP_CONTENT!==!1,_t=i.IN_PLACE||!1,Qt=Ui(i.ALLOWED_URI_REGEXP)?i.ALLOWED_URI_REGEXP:Hn,ye=typeof i.NAMESPACE=="string"?i.NAMESPACE:Q,Tt=Ct(i,"MATHML_TEXT_INTEGRATION_POINTS",()=>k({},pn)),yt=Ct(i,"HTML_INTEGRATION_POINTS",()=>k({},fn));const o=Ct(i,"CUSTOM_ELEMENT_HANDLING",()=>Ee(null));if(V=Ee(null),G(o,"tagNameCheck")&&hn(o.tagNameCheck)&&(V.tagNameCheck=o.tagNameCheck),G(o,"attributeNameCheck")&&hn(o.attributeNameCheck)&&(V.attributeNameCheck=o.attributeNameCheck),G(o,"allowCustomizedBuiltInElements")&&typeof o.allowCustomizedBuiltInElements=="boolean"&&(V.allowCustomizedBuiltInElements=o.allowCustomizedBuiltInElements),N(V),le&&(gt=!1),We&&(xe=!0),ke&&(L=k({},Un),O=Ee(null),ke.html===!0&&(k(L,$n),k(O,Bn)),ke.svg===!0&&(k(L,Lt),k(O,vt),k(O,rt)),ke.svgFilters===!0&&(k(L,Ot),k(O,vt),k(O,rt)),ke.mathMl===!0&&(k(L,It),k(O,Fn),k(O,rt))),se.tagCheck=null,se.attributeCheck=null,G(i,"ADD_TAGS")&&(typeof i.ADD_TAGS=="function"?se.tagCheck=i.ADD_TAGS:Ae(i.ADD_TAGS)&&(L===ft&&(L=q(L)),k(L,i.ADD_TAGS,v))),G(i,"ADD_ATTR")&&(typeof i.ADD_ATTR=="function"?se.attributeCheck=i.ADD_ATTR:Ae(i.ADD_ATTR)&&(O===ht&&(O=q(O)),k(O,i.ADD_ATTR,v))),G(i,"ADD_FORBID_CONTENTS")&&Ae(i.ADD_FORBID_CONTENTS)&&(Te===ln&&(Te=q(Te)),k(Te,i.ADD_FORBID_CONTENTS,v)),bt&&(L["#text"]=!0),fe&&k(L,["html","head","body"]),L.table&&(k(L,["tbody"]),delete Oe.tbody),i.TRUSTED_TYPES_POLICY){if(typeof i.TRUSTED_TYPES_POLICY.createHTML!="function")throw ge('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof i.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ge('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const f=B;B=i.TRUSTED_TYPES_POLICY;try{ue=_e("")}catch(d){throw B=f,d}}else i.TRUSTED_TYPES_POLICY===null?(B=void 0,ue=""):(B===void 0&&(B=hr()),B&&typeof ue=="string"&&(ue=_e("")));P&&P(i),Se=i},gn=k({},[...Lt,...Ot,...Bi]),dn=k({},[...It,...Fi]),Or=function(i,o,f){return o.namespaceURI===Q?i==="svg":o.namespaceURI===Ze?i==="svg"&&(f==="annotation-xml"||Tt[f]):!!gn[i]},Ir=function(i,o,f){return o.namespaceURI===Q?i==="math":o.namespaceURI===Xe?i==="math"&&yt[f]:!!dn[i]},vr=function(i,o,f){return o.namespaceURI===Xe&&!yt[f]||o.namespaceURI===Ze&&!Tt[f]?!1:!dn[i]&&(Er[i]||!gn[i])},Cr=function(i){let o=Z(i);(!o||!o.tagName)&&(o={namespaceURI:ye,tagName:"template"});const f=ze(i.tagName),d=ze(o.tagName);return kt[i.namespaceURI]?i.namespaceURI===Xe?Or(f,o,d):i.namespaceURI===Ze?Ir(f,o,d):i.namespaceURI===Q?vr(f,o,d):!!(Ie==="application/xhtml+xml"&&kt[i.namespaceURI]):!1},oe=function(i){Pe(e.removed,{element:i});try{Z(i).removeChild(i)}catch{if(x(i),!Z(i))throw ge("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},mn=function(i,o,f){try{i.removeAttributeNode(o)}catch{try{i.removeAttribute(f)}catch{}}},Ve=function(i){Qe(i);const o=ne(i);if(o){const d=[];de(o,b=>{Pe(d,b)}),de(d,b=>{try{x(b)}catch{}})}const f=be(i);if(f)for(let d=f.length-1;d>=0;--d){const b=f[d],_=b&&b.name;typeof _=="string"&&mn(i,b,_)}},he=function(i,o,f){if(!f)try{f=o.getAttributeNode(i)}catch{f=null}Pe(e.removed,{attribute:f||null,from:o});try{f?o.removeAttributeNode(f):o.removeAttribute(i)}catch{try{o.removeAttribute(i)}catch{}}if(i==="is")if(xe||We)try{oe(o)}catch{}else try{o.setAttribute(i,"")}catch{}},Dr=function(i){const o=be(i);if(o)for(let f=o.length-1;f>=0;--f){const d=o[f],b=d&&d.name;typeof b!="string"||O[v(b)]||mn(i,d,b)}},Qe=function(i){const o=[i];for(;o.length>0;){const f=o.pop();W(f)===j.element&&Dr(f);const b=ne(f);if(b)for(let _=b.length-1;_>=0;--_)o.push(b[_])}},bn=function(i,o){return pe?i==="patchsrc"?!0:i==="for"&&o!=="label"&&o!=="output":!1},Pr=function(i){if(!pe)return;const o=[i];for(;o.length>0;){const f=o.pop(),d=W(f);if(d===j.processingInstruction||d===j.comment&&z(jn,f.data)){try{x(f)}catch{}continue}if(d===j.element){const _=f,A=v(ct(f));try{_.hasAttribute&&_.hasAttribute("patchsrc")&&_.removeAttribute("patchsrc"),_.hasAttribute&&_.hasAttribute("for")&&bn("for",A)&&_.removeAttribute("for")}catch{}}const b=ne(f);if(b)for(let _=b.length-1;_>=0;--_)o.push(b[_])}},_n=function(i){let o=null,f=null;if(mt)i="<remove></remove>"+i;else{const _=Pn(i,/^[\r\n\t ]+/);f=_&&_[0]}Ie==="application/xhtml+xml"&&ye===Q&&(i='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+i+"</body></html>");const d=B?_e(i):i;if(ye===Q)try{o=new h().parseFromString(d,Ie)}catch{}if(!o||!o.documentElement){o=pt.createDocument(ye,"template",null);try{o.documentElement.innerHTML=xt?ue:d}catch{}}const b=o.body||o.documentElement;return i&&f&&b.insertBefore(n.createTextNode(f),b.childNodes[0]||null),ye===Q?dr.call(o,fe?"html":"body")[0]:fe?o.documentElement:b},xn=function(i){const o=ie?ie(i):i.ownerDocument;return Xt.call(o||i,i,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},Je=function(i){return i=Ne(i,br," "),i=Ne(i,_r," "),i=Ne(i,xr," "),i},wt=function(i){var o;i.normalize();const f=ie?ie(i):i.ownerDocument,d=Xt.call(f||i,i,p.SHOW_TEXT|p.SHOW_COMMENT|p.SHOW_CDATA_SECTION|p.SHOW_PROCESSING_INSTRUCTION,null);let b=d.nextNode();for(;b;)b.data=Je(b.data),b=d.nextNode();const _=(o=i.querySelectorAll)===null||o===void 0?void 0:o.call(i,"template");_&&de(_,A=>{we(A.content)&&wt(A.content)})},Ke=function(i){const o=re?re(i):null;return typeof o!="string"||v(o)!=="form"?!1:typeof i.nodeName!="string"||typeof i.textContent!="string"||typeof i.removeChild!="function"||i.attributes!==be(i)||typeof i.removeAttribute!="function"||typeof i.setAttribute!="function"||typeof i.namespaceURI!="string"||typeof i.insertBefore!="function"||typeof i.hasChildNodes!="function"||i.nodeType!==X(i)||i.childNodes!==ne(i)},we=function(i){if(!X||typeof i!="object"||i===null)return!1;try{return X(i)===j.documentFragment}catch{return!1}},ve=function(i){if(!X||typeof i!="object"||i===null)return!1;try{return typeof X(i)=="number"}catch{return!1}};function J(g,i,o){g.length!==0&&de(g,f=>{f.call(e,i,o,Se)})}const Nr=function(i,o){return!!(pe&&i.hasChildNodes()&&!ve(i.firstElementChild)&&z(Gn,i.textContent)&&z(Gn,i.innerHTML)||pe&&i.namespaceURI===Q&&Ki[o]&&(ve(i.firstElementChild)||typeof i.textContent=="string"&&z(es[o],i.textContent))||i.nodeType===j.processingInstruction||pe&&i.nodeType===j.comment&&z(jn,i.data))},et=function(i,o){if(i instanceof RegExp)return z(i,o);if(i instanceof Function){for(var f=arguments.length,d=new Array(f>2?f-2:0),b=2;b<f;b++)d[b-2]=arguments[b];return!!i(o,...d)}return!1},Mr=function(i,o,f){if(!Oe[o]&&wn(o)&&et(V.tagNameCheck,o))return!1;if(bt&&!Te[o]){const d=Z(i),b=ne(i);if(b&&d){const _=b.length;for(let A=_-1;A>=0;--A){const I=i===f?D(b[A],!0):b[A];d.insertBefore(I,M(i))}}}return oe(i),!0},kn=function(i,o,f,d){return i.length===0?o:o===f||o===d?q(o):o},Tn=function(i,o){return i===o||Z(i)!==null?!1:(_t&&Qe(i),!0)},yn=function(i,o){if(J(R.beforeSanitizeElements,i,null),Tn(i,o))return!0;if(Ke(i))return oe(i),!0;const f=v(ct(i));if(L=kn(R.uponSanitizeElement,L,ft,je),J(R.uponSanitizeElement,i,{tagName:f,allowedTags:L}),Tn(i,o))return!0;if(Nr(i,f))return oe(i),!0;if(Oe[f]||!(se.tagCheck instanceof Function&&se.tagCheck(f))&&!L[f]){const b=Mr(i,f,o);return b===!1&&J(R.afterSanitizeElements,i,null),b}if(W(i)===j.element&&!Cr(i)||(f==="noscript"||f==="noembed"||f==="noframes")&&z(Qi,i.innerHTML))return oe(i),!0;if(le&&i.nodeType===j.text){const b=Je(i.textContent);i.textContent!==b&&(Pe(e.removed,{element:i.cloneNode()}),i.textContent=b)}return J(R.afterSanitizeElements,i,null),!1},Sn=function(i,o,f){if(Jt[o]||bn(o,i)||nn&&(o==="id"||o==="name")&&(f in n||f in Lr))return!1;const d=O[o]||se.attributeCheck instanceof Function&&se.attributeCheck(o,i);return gt&&z(kr,o)||Kt&&z(Tr,o)?!0:d?cn[o]||z(Qt,Ne(f,Vt,""))||(o==="src"||o==="xlink:href"||o==="href")&&i!=="script"&&Nn(f,"data:")===0&&on[i]||en&&!z(yr,Ne(f,Vt,""))?!0:!f:wn(i)&&et(V.tagNameCheck,i)&&et(V.attributeNameCheck,o,i)||o==="is"&&V.allowCustomizedBuiltInElements&&et(V.tagNameCheck,f)},zr=k({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),wn=function(i){return!zr[ze(i)]&&z(Sr,i)},$r=function(i,o,f,d){if(B&&typeof T=="object"&&typeof T.getAttributeType=="function"&&!f)switch(T.getAttributeType(i,o)){case"TrustedHTML":return _e(d);case"TrustedScriptURL":return fr(d)}return d},Ur=function(i,o,f,d){try{f?i.setAttributeNS(f,o,d):i.setAttribute(o,d),Ke(i)?oe(i):Dn(e.removed)}catch{he(o,i)}},En=function(i){J(R.beforeSanitizeAttributes,i,null);const o=i.attributes;if(!o||Ke(i))return;O=kn(R.uponSanitizeAttribute,O,ht,qe);const f={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:O,forceKeepAttr:void 0};let d=o.length;const b=v(i.nodeName);for(;d--;){const _=o[d],A=_.name,I=_.namespaceURI,F=_.value,H=v(A),At=F;let $=A==="value"?At:Di(At);if(f.attrName=H,f.attrValue=$,f.keepAttr=!0,f.forceKeepAttr=void 0,J(R.uponSanitizeAttribute,i,f),$=f.attrValue,rn&&(H==="id"||H==="name")&&Nn($,sn)!==0&&(he(A,i,_),$=sn+$),pe&&z(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,$)){he(A,i,_);continue}if(H==="attributename"&&Pn($,"href")){he(A,i,_);continue}if(!f.forceKeepAttr){if(!f.keepAttr){he(A,i,_);continue}if(!tn&&z(Ji,$)){he(A,i,_);continue}if(le&&($=Je($)),!Sn(b,H,$)){he(A,i,_);continue}$=$r(b,H,I,$),$!==At&&Ur(i,A,I,$)}}J(R.afterSanitizeAttributes,i,null)},tt=function(i){let o=null;const f=xn(i);for(J(R.beforeSanitizeShadowDOM,i,null);o=f.nextNode();)if(J(R.uponSanitizeShadowNode,o,null),yn(o,i),En(o),we(o.content)&&tt(o.content),W(o)===j.element){const d=Re(o);we(d)&&(Et(d),tt(d))}J(R.afterSanitizeShadowDOM,i,null)},Et=function(i){const o=[{node:i,shadow:null}];for(;o.length>0;){const f=o.pop();if(f.shadow){tt(f.shadow);continue}const d=f.node,_=W(d)===j.element,A=ne(d);if(A)for(let I=A.length-1;I>=0;--I)o.push({node:A[I],shadow:null});if(_){const I=re?re(d):null;if(typeof I=="string"&&v(I)==="template"){const F=d.content;we(F)&&o.push({node:F,shadow:null})}}if(_){const I=Re(d);we(I)&&o.push({node:null,shadow:I},{node:I,shadow:null})}}};return e.sanitize=function(g){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=null,f=null,d=null,b=null;if(xt=!g,xt&&(g="<!-->"),typeof g!="string"&&!ve(g)&&(g=$i(g),typeof g!="string"))throw ge("dirty is not a string, aborting");if(!e.isSupported)return g;dt?(L=je,O=qe):St(i),(R.uponSanitizeElement.length>0||R.uponSanitizeAttribute.length>0)&&(L=q(L)),R.uponSanitizeAttribute.length>0&&(O=q(O)),e.removed=[];const _=_t&&typeof g!="string"&&ve(g);if(_){Pr(g);const F=ct(g);if(typeof F=="string"){const H=v(F);if(!L[H]||Oe[H])throw Ve(g),ge("root node is forbidden and cannot be sanitized in-place")}if(Ke(g))throw Ve(g),ge("root node is clobbered and cannot be sanitized in-place");try{Et(g)}catch(H){throw Ve(g),H}}else if(ve(g))o=_n("<!---->"),f=o.ownerDocument.importNode(g,!0),f.nodeType===j.element&&f.nodeName==="BODY"||f.nodeName==="HTML"?o=f:o.appendChild(f),Et(f);else{if(!xe&&!le&&!fe&&g.indexOf("<")===-1)return B&&Ye?_e(g):g;if(o=_n(g),!o)return xe?null:Ye?ue:""}o&&mt&&oe(o.firstChild);const A=_?g:o;try{const F=xn(A);for(;d=F.nextNode();)yn(d,A),En(d),we(d.content)&&tt(d.content)}catch(F){throw _&&(Ve(g),de(e.removed,H=>{H.element&&Qe(H.element)})),F}if(_)return de(e.removed,F=>{F.element&&Qe(F.element)}),le&&wt(g),g;if(xe){if(le&&wt(o),We)for(b=gr.call(o.ownerDocument);o.firstChild;)b.appendChild(o.firstChild);else b=o;return(O.shadowroot||O.shadowrootmode)&&(b=mr.call(r,b,!0)),b}let I=fe?o.outerHTML:o.innerHTML;return fe&&L["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&z(Xi,o.ownerDocument.doctype.name)&&(I="<!DOCTYPE "+o.ownerDocument.doctype.name+`>
|
|
58
|
+
`+I),le&&(I=Je(I)),B&&Ye?_e(I):I},e.setConfig=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};St(g),dt=!0,je=L,qe=O},e.clearConfig=function(){Se=null,dt=!1,je=null,qe=null,B=ut,ue=""},e.isValidAttribute=function(g,i,o){Se||St({});const f=v(g),d=v(i);return Sn(f,d,o)},e.addHook=function(g,i){typeof i=="function"&&G(R,g)&&Pe(R[g],i)},e.removeHook=function(g,i){if(G(R,g)){if(i!==void 0){const o=vi(R[g],i);return o===-1?void 0:Ci(R[g],o,1)[0]}return Dn(R[g])}},e.removeHooks=function(g){G(R,g)&&(R[g]=[])},e.removeAllHooks=function(){R=qn()},e}var rs=pr();const as=Object.freeze(Object.defineProperty({__proto__:null,default:rs},Symbol.toStringTag,{value:"Module"}));var Dt=function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},E;(function(t){t[t.EOS=0]="EOS",t[t.Text=1]="Text",t[t.Incomplete=2]="Incomplete",t[t.ESC=3]="ESC",t[t.Unknown=4]="Unknown",t[t.SGR=5]="SGR",t[t.OSCURL=6]="OSCURL"})(E||(E={}));class is{constructor(){this.VERSION="6.0.6",this.setup_palettes(),this._use_classes=!1,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1,this.fg=this.bg=null,this._buffer="",this._url_allowlist={http:1,https:1},this._escape_html=!0,this.boldStyle="font-weight:bold",this.faintStyle="opacity:0.7",this.italicStyle="font-style:italic",this.underlineStyle="text-decoration:underline"}set use_classes(e){this._use_classes=e}get use_classes(){return this._use_classes}set url_allowlist(e){this._url_allowlist=e}get url_allowlist(){return this._url_allowlist}set escape_html(e){this._escape_html=e}get escape_html(){return this._escape_html}set boldStyle(e){this._boldStyle=e}get boldStyle(){return this._boldStyle}set faintStyle(e){this._faintStyle=e}get faintStyle(){return this._faintStyle}set italicStyle(e){this._italicStyle=e}get italicStyle(){return this._italicStyle}set underlineStyle(e){this._underlineStyle=e}get underlineStyle(){return this._underlineStyle}setup_palettes(){this.ansi_colors=[[{rgb:[0,0,0],class_name:"ansi-black"},{rgb:[187,0,0],class_name:"ansi-red"},{rgb:[0,187,0],class_name:"ansi-green"},{rgb:[187,187,0],class_name:"ansi-yellow"},{rgb:[0,0,187],class_name:"ansi-blue"},{rgb:[187,0,187],class_name:"ansi-magenta"},{rgb:[0,187,187],class_name:"ansi-cyan"},{rgb:[255,255,255],class_name:"ansi-white"}],[{rgb:[85,85,85],class_name:"ansi-bright-black"},{rgb:[255,85,85],class_name:"ansi-bright-red"},{rgb:[0,255,0],class_name:"ansi-bright-green"},{rgb:[255,255,85],class_name:"ansi-bright-yellow"},{rgb:[85,85,255],class_name:"ansi-bright-blue"},{rgb:[255,85,255],class_name:"ansi-bright-magenta"},{rgb:[85,255,255],class_name:"ansi-bright-cyan"},{rgb:[255,255,255],class_name:"ansi-bright-white"}]],this.palette_256=[],this.ansi_colors.forEach(r=>{r.forEach(s=>{this.palette_256.push(s)})});let e=[0,95,135,175,215,255];for(let r=0;r<6;++r)for(let s=0;s<6;++s)for(let l=0;l<6;++l){let u={rgb:[e[r],e[s],e[l]],class_name:"truecolor"};this.palette_256.push(u)}let n=8;for(let r=0;r<24;++r,n+=10){let s={rgb:[n,n,n],class_name:"truecolor"};this.palette_256.push(s)}}escape_txt_for_html(e){return this._escape_html?e.replace(/[&<>"']/gm,n=>{if(n==="&")return"&";if(n==="<")return"<";if(n===">")return">";if(n==='"')return""";if(n==="'")return"'"}):e}append_buffer(e){var n=this._buffer+e;this._buffer=n}get_next_packet(){var e={kind:E.EOS,text:"",url:""},n=this._buffer.length;if(n==0)return e;var r=this._buffer.indexOf("\x1B");if(r==-1)return e.kind=E.Text,e.text=this._buffer,this._buffer="",e;if(r>0)return e.kind=E.Text,e.text=this._buffer.slice(0,r),this._buffer=this._buffer.slice(r),e;if(r==0){if(n<3)return e.kind=E.Incomplete,e;var s=this._buffer.charAt(1);if(s!="["&&s!="]"&&s!="(")return e.kind=E.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;if(s=="["){this._csi_regex||(this._csi_regex=Wn(Yn||(Yn=Dt([`
|
|
59
|
+
^ # beginning of line
|
|
60
|
+
#
|
|
61
|
+
# First attempt
|
|
62
|
+
(?: # legal sequence
|
|
63
|
+
\x1B[ # CSI
|
|
64
|
+
([<-?]?) # private-mode char
|
|
65
|
+
([d;]*) # any digits or semicolons
|
|
66
|
+
([ -/]? # an intermediate modifier
|
|
67
|
+
[@-~]) # the command
|
|
68
|
+
)
|
|
69
|
+
| # alternate (second attempt)
|
|
70
|
+
(?: # illegal sequence
|
|
71
|
+
\x1B[ # CSI
|
|
72
|
+
[ -~]* # anything legal
|
|
73
|
+
([\0-:]) # anything illegal
|
|
74
|
+
)
|
|
75
|
+
`],[`
|
|
76
|
+
^ # beginning of line
|
|
77
|
+
#
|
|
78
|
+
# First attempt
|
|
79
|
+
(?: # legal sequence
|
|
80
|
+
\\x1b\\[ # CSI
|
|
81
|
+
([\\x3c-\\x3f]?) # private-mode char
|
|
82
|
+
([\\d;]*) # any digits or semicolons
|
|
83
|
+
([\\x20-\\x2f]? # an intermediate modifier
|
|
84
|
+
[\\x40-\\x7e]) # the command
|
|
85
|
+
)
|
|
86
|
+
| # alternate (second attempt)
|
|
87
|
+
(?: # illegal sequence
|
|
88
|
+
\\x1b\\[ # CSI
|
|
89
|
+
[\\x20-\\x7e]* # anything legal
|
|
90
|
+
([\\x00-\\x1f:]) # anything illegal
|
|
91
|
+
)
|
|
92
|
+
`]))));let u=this._buffer.match(this._csi_regex);if(u===null)return e.kind=E.Incomplete,e;if(u[4])return e.kind=E.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;u[1]!=""||u[3]!="m"?e.kind=E.Unknown:e.kind=E.SGR,e.text=u[2];var l=u[0].length;return this._buffer=this._buffer.slice(l),e}else if(s=="]"){if(n<4)return e.kind=E.Incomplete,e;if(this._buffer.charAt(2)!="8"||this._buffer.charAt(3)!=";")return e.kind=E.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;this._osc_st||(this._osc_st=ss(Zn||(Zn=Dt([`
|
|
93
|
+
(?: # legal sequence
|
|
94
|
+
(\x1B\\) # ESC | # alternate
|
|
95
|
+
(\x07) # BEL (what xterm did)
|
|
96
|
+
)
|
|
97
|
+
| # alternate (second attempt)
|
|
98
|
+
( # illegal sequence
|
|
99
|
+
[\0-] # anything illegal
|
|
100
|
+
| # alternate
|
|
101
|
+
[\b-] # anything illegal
|
|
102
|
+
| # alternate
|
|
103
|
+
[-] # anything illegal
|
|
104
|
+
)
|
|
105
|
+
`],[`
|
|
106
|
+
(?: # legal sequence
|
|
107
|
+
(\\x1b\\\\) # ESC \\
|
|
108
|
+
| # alternate
|
|
109
|
+
(\\x07) # BEL (what xterm did)
|
|
110
|
+
)
|
|
111
|
+
| # alternate (second attempt)
|
|
112
|
+
( # illegal sequence
|
|
113
|
+
[\\x00-\\x06] # anything illegal
|
|
114
|
+
| # alternate
|
|
115
|
+
[\\x08-\\x1a] # anything illegal
|
|
116
|
+
| # alternate
|
|
117
|
+
[\\x1c-\\x1f] # anything illegal
|
|
118
|
+
)
|
|
119
|
+
`])))),this._osc_st.lastIndex=0;{let p=this._osc_st.exec(this._buffer);if(p===null)return e.kind=E.Incomplete,e;if(p[3])return e.kind=E.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e}{let p=this._osc_st.exec(this._buffer);if(p===null)return e.kind=E.Incomplete,e;if(p[3])return e.kind=E.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e}this._osc_regex||(this._osc_regex=Wn(Xn||(Xn=Dt([`
|
|
120
|
+
^ # beginning of line
|
|
121
|
+
#
|
|
122
|
+
\x1B]8; # OSC Hyperlink
|
|
123
|
+
[ -:<-~]* # params (excluding ;)
|
|
124
|
+
; # end of params
|
|
125
|
+
([!-~]{0,512}) # URL capture
|
|
126
|
+
(?: # ST
|
|
127
|
+
(?:\x1B\\) # ESC | # alternate
|
|
128
|
+
(?:\x07) # BEL (what xterm did)
|
|
129
|
+
)
|
|
130
|
+
([ -~]+) # TEXT capture
|
|
131
|
+
\x1B]8;; # OSC Hyperlink End
|
|
132
|
+
(?: # ST
|
|
133
|
+
(?:\x1B\\) # ESC | # alternate
|
|
134
|
+
(?:\x07) # BEL (what xterm did)
|
|
135
|
+
)
|
|
136
|
+
`],[`
|
|
137
|
+
^ # beginning of line
|
|
138
|
+
#
|
|
139
|
+
\\x1b\\]8; # OSC Hyperlink
|
|
140
|
+
[\\x20-\\x3a\\x3c-\\x7e]* # params (excluding ;)
|
|
141
|
+
; # end of params
|
|
142
|
+
([\\x21-\\x7e]{0,512}) # URL capture
|
|
143
|
+
(?: # ST
|
|
144
|
+
(?:\\x1b\\\\) # ESC \\
|
|
145
|
+
| # alternate
|
|
146
|
+
(?:\\x07) # BEL (what xterm did)
|
|
147
|
+
)
|
|
148
|
+
([\\x20-\\x7e]+) # TEXT capture
|
|
149
|
+
\\x1b\\]8;; # OSC Hyperlink End
|
|
150
|
+
(?: # ST
|
|
151
|
+
(?:\\x1b\\\\) # ESC \\
|
|
152
|
+
| # alternate
|
|
153
|
+
(?:\\x07) # BEL (what xterm did)
|
|
154
|
+
)
|
|
155
|
+
`]))));let u=this._buffer.match(this._osc_regex);if(u===null)return e.kind=E.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;e.kind=E.OSCURL,e.url=u[1],e.text=u[2];var l=u[0].length;return this._buffer=this._buffer.slice(l),e}else if(s=="(")return e.kind=E.Unknown,this._buffer=this._buffer.slice(3),e}}ansi_to_html(e){this.append_buffer(e);for(var n=[];;){var r=this.get_next_packet();if(r.kind==E.EOS||r.kind==E.Incomplete)break;r.kind==E.ESC||r.kind==E.Unknown||(r.kind==E.Text?n.push(this.transform_to_html(this.with_state(r))):r.kind==E.SGR?this.process_ansi(r):r.kind==E.OSCURL&&n.push(this.process_hyperlink(r)))}return n.join("")}with_state(e){return{bold:this.bold,faint:this.faint,italic:this.italic,underline:this.underline,fg:this.fg,bg:this.bg,text:e.text}}process_ansi(e){let n=e.text.split(";");for(;n.length>0;){let r=n.shift(),s=parseInt(r,10);if(isNaN(s)||s===0)this.fg=null,this.bg=null,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1;else if(s===1)this.bold=!0;else if(s===2)this.faint=!0;else if(s===3)this.italic=!0;else if(s===4)this.underline=!0;else if(s===21)this.bold=!1;else if(s===22)this.faint=!1,this.bold=!1;else if(s===23)this.italic=!1;else if(s===24)this.underline=!1;else if(s===39)this.fg=null;else if(s===49)this.bg=null;else if(s>=30&&s<38)this.fg=this.ansi_colors[0][s-30];else if(s>=40&&s<48)this.bg=this.ansi_colors[0][s-40];else if(s>=90&&s<98)this.fg=this.ansi_colors[1][s-90];else if(s>=100&&s<108)this.bg=this.ansi_colors[1][s-100];else if((s===38||s===48)&&n.length>0){let l=s===38,u=n.shift();if(u==="5"&&n.length>0){let a=parseInt(n.shift(),10);a>=0&&a<=255&&(l?this.fg=this.palette_256[a]:this.bg=this.palette_256[a])}if(u==="2"&&n.length>2){let a=parseInt(n.shift(),10),p=parseInt(n.shift(),10),c=parseInt(n.shift(),10);if(a>=0&&a<=255&&p>=0&&p<=255&&c>=0&&c<=255){let h={rgb:[a,p,c],class_name:"truecolor"};l?this.fg=h:this.bg=h}}}}}transform_to_html(e){let n=e.text;if(n.length===0||(n=this.escape_txt_for_html(n),!e.bold&&!e.italic&&!e.faint&&!e.underline&&e.fg===null&&e.bg===null))return n;let r=[],s=[],l=e.fg,u=e.bg;e.bold&&r.push(this._boldStyle),e.faint&&r.push(this._faintStyle),e.italic&&r.push(this._italicStyle),e.underline&&r.push(this._underlineStyle),this._use_classes?(l&&(l.class_name!=="truecolor"?s.push(`${l.class_name}-fg`):r.push(`color:rgb(${l.rgb.join(",")})`)),u&&(u.class_name!=="truecolor"?s.push(`${u.class_name}-bg`):r.push(`background-color:rgb(${u.rgb.join(",")})`))):(l&&r.push(`color:rgb(${l.rgb.join(",")})`),u&&r.push(`background-color:rgb(${u.rgb})`));let a="",p="";return s.length&&(a=` class="${s.join(" ")}"`),r.length&&(p=` style="${r.join(";")}"`),`<span${p}${a}>${n}</span>`}process_hyperlink(e){let n=e.url.split(":");return n.length<1||!this._url_allowlist[n[0]]?"":`<a href="${this.escape_txt_for_html(e.url)}">${this.escape_txt_for_html(e.text)}</a>`}}function Wn(t,...e){let n=t.raw[0],r=/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,s=n.replace(r,"");return new RegExp(s)}function ss(t,...e){let n=t.raw[0],r=/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,s=n.replace(r,"");return new RegExp(s,"g")}var Yn,Zn,Xn;const cs=Object.freeze(Object.defineProperty({__proto__:null,AnsiUp:is},Symbol.toStringTag,{value:"Module"}));export{cs as a,os as m,as as p};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|