@usepagelet/runtime 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/dist/v1/capabilities.md +59 -0
- package/dist/v1/chunks/architecture-7EHR7CIX-CDRXMAVQ.js +2 -0
- package/dist/v1/chunks/architecture-7EHR7CIX-CDRXMAVQ.js.map +7 -0
- package/dist/v1/chunks/architectureDiagram-3BPJPVTR-EYIVUOEK.js +37 -0
- package/dist/v1/chunks/architectureDiagram-3BPJPVTR-EYIVUOEK.js.map +7 -0
- package/dist/v1/chunks/blockDiagram-GPEHLZMM-P7MBAWVH.js +133 -0
- package/dist/v1/chunks/blockDiagram-GPEHLZMM-P7MBAWVH.js.map +7 -0
- package/dist/v1/chunks/c4Diagram-AAUBKEIU-2XSL5LGB.js +11 -0
- package/dist/v1/chunks/c4Diagram-AAUBKEIU-2XSL5LGB.js.map +7 -0
- package/dist/v1/chunks/chunk-2STBDRRH.js +2 -0
- package/dist/v1/chunks/chunk-2STBDRRH.js.map +7 -0
- package/dist/v1/chunks/chunk-6AA7JQNC.js +71 -0
- package/dist/v1/chunks/chunk-6AA7JQNC.js.map +7 -0
- package/dist/v1/chunks/chunk-72WSJX2P.js +2 -0
- package/dist/v1/chunks/chunk-72WSJX2P.js.map +7 -0
- package/dist/v1/chunks/chunk-AUV7QZZ7.js +2 -0
- package/dist/v1/chunks/chunk-AUV7QZZ7.js.map +7 -0
- package/dist/v1/chunks/chunk-AZFF2WJO.js +2 -0
- package/dist/v1/chunks/chunk-AZFF2WJO.js.map +7 -0
- package/dist/v1/chunks/chunk-C2IUOGBD.js +2 -0
- package/dist/v1/chunks/chunk-C2IUOGBD.js.map +7 -0
- package/dist/v1/chunks/chunk-DKQVSAO3.js +2 -0
- package/dist/v1/chunks/chunk-DKQVSAO3.js.map +7 -0
- package/dist/v1/chunks/chunk-DS52DG6H.js +2 -0
- package/dist/v1/chunks/chunk-DS52DG6H.js.map +7 -0
- package/dist/v1/chunks/chunk-DXEOG5W4.js +2 -0
- package/dist/v1/chunks/chunk-DXEOG5W4.js.map +7 -0
- package/dist/v1/chunks/chunk-EHSK6IMI.js +3 -0
- package/dist/v1/chunks/chunk-EHSK6IMI.js.map +7 -0
- package/dist/v1/chunks/chunk-FWZR474D.js +2 -0
- package/dist/v1/chunks/chunk-FWZR474D.js.map +7 -0
- package/dist/v1/chunks/chunk-FYLAOHYS.js +2 -0
- package/dist/v1/chunks/chunk-FYLAOHYS.js.map +7 -0
- package/dist/v1/chunks/chunk-G6W4FKMG.js +2 -0
- package/dist/v1/chunks/chunk-G6W4FKMG.js.map +7 -0
- package/dist/v1/chunks/chunk-HLP6UJDY.js +2 -0
- package/dist/v1/chunks/chunk-HLP6UJDY.js.map +7 -0
- package/dist/v1/chunks/chunk-IGLPGT7W.js +160 -0
- package/dist/v1/chunks/chunk-IGLPGT7W.js.map +7 -0
- package/dist/v1/chunks/chunk-IQVRW6XA.js +322 -0
- package/dist/v1/chunks/chunk-IQVRW6XA.js.map +7 -0
- package/dist/v1/chunks/chunk-IY5OUPDU.js +5 -0
- package/dist/v1/chunks/chunk-IY5OUPDU.js.map +7 -0
- package/dist/v1/chunks/chunk-JOJIMF7A.js +2 -0
- package/dist/v1/chunks/chunk-JOJIMF7A.js.map +7 -0
- package/dist/v1/chunks/chunk-NWD66TP4.js +2 -0
- package/dist/v1/chunks/chunk-NWD66TP4.js.map +7 -0
- package/dist/v1/chunks/chunk-PLQZIFSO.js +2 -0
- package/dist/v1/chunks/chunk-PLQZIFSO.js.map +7 -0
- package/dist/v1/chunks/chunk-PVPXGQIV.js +2 -0
- package/dist/v1/chunks/chunk-PVPXGQIV.js.map +7 -0
- package/dist/v1/chunks/chunk-QDJGX3SU.js +16 -0
- package/dist/v1/chunks/chunk-QDJGX3SU.js.map +7 -0
- package/dist/v1/chunks/chunk-QSGUWHXF.js +2 -0
- package/dist/v1/chunks/chunk-QSGUWHXF.js.map +7 -0
- package/dist/v1/chunks/chunk-RCIRWMC7.js +2 -0
- package/dist/v1/chunks/chunk-RCIRWMC7.js.map +7 -0
- package/dist/v1/chunks/chunk-S4ACHXBI.js +2 -0
- package/dist/v1/chunks/chunk-S4ACHXBI.js.map +7 -0
- package/dist/v1/chunks/chunk-SA4K3XYV.js +2 -0
- package/dist/v1/chunks/chunk-SA4K3XYV.js.map +7 -0
- package/dist/v1/chunks/chunk-SAENYLYK.js +232 -0
- package/dist/v1/chunks/chunk-SAENYLYK.js.map +7 -0
- package/dist/v1/chunks/chunk-SN6BTAM3.js +4 -0
- package/dist/v1/chunks/chunk-SN6BTAM3.js.map +7 -0
- package/dist/v1/chunks/chunk-SWJRRCAF.js +2 -0
- package/dist/v1/chunks/chunk-SWJRRCAF.js.map +7 -0
- package/dist/v1/chunks/chunk-TGL5CWDU.js +63 -0
- package/dist/v1/chunks/chunk-TGL5CWDU.js.map +7 -0
- package/dist/v1/chunks/chunk-TVSQ2OZ6.js +11 -0
- package/dist/v1/chunks/chunk-TVSQ2OZ6.js.map +7 -0
- package/dist/v1/chunks/chunk-URGT6V7R.js +2 -0
- package/dist/v1/chunks/chunk-URGT6V7R.js.map +7 -0
- package/dist/v1/chunks/chunk-WBEUYPCI.js +123 -0
- package/dist/v1/chunks/chunk-WBEUYPCI.js.map +7 -0
- package/dist/v1/chunks/chunk-WEZ3ELJO.js +2 -0
- package/dist/v1/chunks/chunk-WEZ3ELJO.js.map +7 -0
- package/dist/v1/chunks/chunk-WIIGSS4X.js +2 -0
- package/dist/v1/chunks/chunk-WIIGSS4X.js.map +7 -0
- package/dist/v1/chunks/chunk-XUJKMBZ5.js +2 -0
- package/dist/v1/chunks/chunk-XUJKMBZ5.js.map +7 -0
- package/dist/v1/chunks/chunk-YC75LZ32.js +33 -0
- package/dist/v1/chunks/chunk-YC75LZ32.js.map +7 -0
- package/dist/v1/chunks/chunk-YK2CHHQT.js +207 -0
- package/dist/v1/chunks/chunk-YK2CHHQT.js.map +7 -0
- package/dist/v1/chunks/chunk-YYWGGXI6.js +2 -0
- package/dist/v1/chunks/chunk-YYWGGXI6.js.map +7 -0
- package/dist/v1/chunks/chunk-ZY7EQCMR.js +4 -0
- package/dist/v1/chunks/chunk-ZY7EQCMR.js.map +7 -0
- package/dist/v1/chunks/classDiagram-4FO5ZUOK-4VU3VATX.js +2 -0
- package/dist/v1/chunks/classDiagram-4FO5ZUOK-4VU3VATX.js.map +7 -0
- package/dist/v1/chunks/classDiagram-v2-Q7XG4LA2-QIBN3KO6.js +2 -0
- package/dist/v1/chunks/classDiagram-v2-Q7XG4LA2-QIBN3KO6.js.map +7 -0
- package/dist/v1/chunks/cose-bilkent-S5V4N54A-MHLDSCZY.js +2 -0
- package/dist/v1/chunks/cose-bilkent-S5V4N54A-MHLDSCZY.js.map +7 -0
- package/dist/v1/chunks/dagre-BM42HDAG-U3ECKIMS.js +5 -0
- package/dist/v1/chunks/dagre-BM42HDAG-U3ECKIMS.js.map +7 -0
- package/dist/v1/chunks/diagram-2AECGRRQ-BNRGNWOM.js +44 -0
- package/dist/v1/chunks/diagram-2AECGRRQ-BNRGNWOM.js.map +7 -0
- package/dist/v1/chunks/diagram-5GNKFQAL-CPWZIJ4M.js +11 -0
- package/dist/v1/chunks/diagram-5GNKFQAL-CPWZIJ4M.js.map +7 -0
- package/dist/v1/chunks/diagram-KO2AKTUF-7CDCIBL3.js +4 -0
- package/dist/v1/chunks/diagram-KO2AKTUF-7CDCIBL3.js.map +7 -0
- package/dist/v1/chunks/diagram-LMA3HP47-LPHFNXWX.js +25 -0
- package/dist/v1/chunks/diagram-LMA3HP47-LPHFNXWX.js.map +7 -0
- package/dist/v1/chunks/diagram-OG6HWLK6-FWJ2MCGI.js +25 -0
- package/dist/v1/chunks/diagram-OG6HWLK6-FWJ2MCGI.js.map +7 -0
- package/dist/v1/chunks/erDiagram-TEJ5UH35-OX62GPYU.js +86 -0
- package/dist/v1/chunks/erDiagram-TEJ5UH35-OX62GPYU.js.map +7 -0
- package/dist/v1/chunks/eventmodeling-FCH6USID-NRRIBZEB.js +2 -0
- package/dist/v1/chunks/eventmodeling-FCH6USID-NRRIBZEB.js.map +7 -0
- package/dist/v1/chunks/flowDiagram-I6XJVG4X-I4ULL6MS.js +163 -0
- package/dist/v1/chunks/flowDiagram-I6XJVG4X-I4ULL6MS.js.map +7 -0
- package/dist/v1/chunks/ganttDiagram-6RSMTGT7-TIDOVKXT.js +293 -0
- package/dist/v1/chunks/ganttDiagram-6RSMTGT7-TIDOVKXT.js.map +7 -0
- package/dist/v1/chunks/gitGraph-WXDBUCRP-4LEEA2GI.js +2 -0
- package/dist/v1/chunks/gitGraph-WXDBUCRP-4LEEA2GI.js.map +7 -0
- package/dist/v1/chunks/gitGraphDiagram-PVQCEYII-BPEBW2KG.js +107 -0
- package/dist/v1/chunks/gitGraphDiagram-PVQCEYII-BPEBW2KG.js.map +7 -0
- package/dist/v1/chunks/info-J43DQDTF-EI2RS372.js +2 -0
- package/dist/v1/chunks/info-J43DQDTF-EI2RS372.js.map +7 -0
- package/dist/v1/chunks/infoDiagram-5YYISTIA-5GFVQYI7.js +3 -0
- package/dist/v1/chunks/infoDiagram-5YYISTIA-5GFVQYI7.js.map +7 -0
- package/dist/v1/chunks/ishikawaDiagram-YF4QCWOH-AZ7PAHIN.js +71 -0
- package/dist/v1/chunks/ishikawaDiagram-YF4QCWOH-AZ7PAHIN.js.map +7 -0
- package/dist/v1/chunks/journeyDiagram-JHISSGLW-B4ZN6VTS.js +140 -0
- package/dist/v1/chunks/journeyDiagram-JHISSGLW-B4ZN6VTS.js.map +7 -0
- package/dist/v1/chunks/kanban-definition-UN3LZRKU-5THRXHJP.js +90 -0
- package/dist/v1/chunks/kanban-definition-UN3LZRKU-5THRXHJP.js.map +7 -0
- package/dist/v1/chunks/katex-CLI7E3QC.js +258 -0
- package/dist/v1/chunks/katex-CLI7E3QC.js.map +7 -0
- package/dist/v1/chunks/mindmap-definition-RKZ34NQL-E57QDEMN.js +97 -0
- package/dist/v1/chunks/mindmap-definition-RKZ34NQL-E57QDEMN.js.map +7 -0
- package/dist/v1/chunks/packet-YPE3B663-PKWGZRBL.js +2 -0
- package/dist/v1/chunks/packet-YPE3B663-PKWGZRBL.js.map +7 -0
- package/dist/v1/chunks/pie-LRSECV5Y-QSTOXR4H.js +2 -0
- package/dist/v1/chunks/pie-LRSECV5Y-QSTOXR4H.js.map +7 -0
- package/dist/v1/chunks/pieDiagram-4H26LBE5-CZULUIHM.js +31 -0
- package/dist/v1/chunks/pieDiagram-4H26LBE5-CZULUIHM.js.map +7 -0
- package/dist/v1/chunks/quadrantDiagram-W4KKPZXB-WRXQ2LCP.js +8 -0
- package/dist/v1/chunks/quadrantDiagram-W4KKPZXB-WRXQ2LCP.js.map +7 -0
- package/dist/v1/chunks/radar-GUYGQ44K-UJHF7VJA.js +2 -0
- package/dist/v1/chunks/radar-GUYGQ44K-UJHF7VJA.js.map +7 -0
- package/dist/v1/chunks/requirementDiagram-4Y6WPE33-LUKBHY3G.js +85 -0
- package/dist/v1/chunks/requirementDiagram-4Y6WPE33-LUKBHY3G.js.map +7 -0
- package/dist/v1/chunks/sankeyDiagram-5OEKKPKP-IHGIKQ7Q.js +41 -0
- package/dist/v1/chunks/sankeyDiagram-5OEKKPKP-IHGIKQ7Q.js.map +7 -0
- package/dist/v1/chunks/sequenceDiagram-3UESZ5HK-AZIJM7V2.js +163 -0
- package/dist/v1/chunks/sequenceDiagram-3UESZ5HK-AZIJM7V2.js.map +7 -0
- package/dist/v1/chunks/stateDiagram-AJRCARHV-7TL53ICK.js +2 -0
- package/dist/v1/chunks/stateDiagram-AJRCARHV-7TL53ICK.js.map +7 -0
- package/dist/v1/chunks/stateDiagram-v2-BHNVJYJU-TJ245A24.js +2 -0
- package/dist/v1/chunks/stateDiagram-v2-BHNVJYJU-TJ245A24.js.map +7 -0
- package/dist/v1/chunks/timeline-definition-PNZ67QCA-C5FF5CVI.js +121 -0
- package/dist/v1/chunks/timeline-definition-PNZ67QCA-C5FF5CVI.js.map +7 -0
- package/dist/v1/chunks/treeView-BLDUP644-2MCPJRE2.js +2 -0
- package/dist/v1/chunks/treeView-BLDUP644-2MCPJRE2.js.map +7 -0
- package/dist/v1/chunks/treemap-LRROVOQU-WSVRI32O.js +2 -0
- package/dist/v1/chunks/treemap-LRROVOQU-WSVRI32O.js.map +7 -0
- package/dist/v1/chunks/vennDiagram-CIIHVFJN-NQU7FBQX.js +35 -0
- package/dist/v1/chunks/vennDiagram-CIIHVFJN-NQU7FBQX.js.map +7 -0
- package/dist/v1/chunks/wardley-L42UT6IY-GONRRIFG.js +2 -0
- package/dist/v1/chunks/wardley-L42UT6IY-GONRRIFG.js.map +7 -0
- package/dist/v1/chunks/wardleyDiagram-YWT4CUSO-KNM7EB5A.js +79 -0
- package/dist/v1/chunks/wardleyDiagram-YWT4CUSO-KNM7EB5A.js.map +7 -0
- package/dist/v1/chunks/xychartDiagram-2RQKCTM6-CMGOBHPC.js +8 -0
- package/dist/v1/chunks/xychartDiagram-2RQKCTM6-CMGOBHPC.js.map +7 -0
- package/dist/v1/modules/charts.js +4 -0
- package/dist/v1/modules/charts.js.map +7 -0
- package/dist/v1/modules/code.js +26 -0
- package/dist/v1/modules/code.js.map +7 -0
- package/dist/v1/modules/markdown.js +65 -0
- package/dist/v1/modules/markdown.js.map +7 -0
- package/dist/v1/modules/math.js +258 -0
- package/dist/v1/modules/math.js.map +7 -0
- package/dist/v1/modules/mermaid.js +9 -0
- package/dist/v1/modules/mermaid.js.map +7 -0
- package/dist/v1/modules/png.js +3 -0
- package/dist/v1/modules/png.js.map +7 -0
- package/dist/v1/pagelet.js +128 -0
- package/dist/v1/pagelet.js.map +7 -0
- package/package.json +40 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import{r as te}from"./chunk-EHSK6IMI.js";import{A as J,G as F,J as ee,L as Re,M as ze}from"./chunk-WBEUYPCI.js";import{b as x,d as z,j as E}from"./chunk-PVPXGQIV.js";import{c as k}from"./chunk-URGT6V7R.js";var dt=Object.freeze({left:0,top:0,width:16,height:16}),L=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),ne=Object.freeze({...dt,...L}),ve=Object.freeze({...ne,body:"",hidden:!1});var mt=Object.freeze({width:null,height:null}),Ae=Object.freeze({...mt,...L});var re=(n,e,r,s="")=>{let t=n.split(":");if(n.slice(0,1)==="@"){if(t.length<2||t.length>3)return null;s=t.shift().slice(1)}if(t.length>3||!t.length)return null;if(t.length>1){let l=t.pop(),a=t.pop(),p={provider:t.length>0?t[0]:s,prefix:a,name:l};return e&&!O(p)?null:p}let o=t[0],i=o.split("-");if(i.length>1){let l={provider:s,prefix:i.shift(),name:i.join("-")};return e&&!O(l)?null:l}if(r&&s===""){let l={provider:s,prefix:"",name:o};return e&&!O(l,r)?null:l}return null},O=(n,e)=>n?!!((e&&n.prefix===""||n.prefix)&&n.name):!1;function Ee(n,e){let r={};!n.hFlip!=!e.hFlip&&(r.hFlip=!0),!n.vFlip!=!e.vFlip&&(r.vFlip=!0);let s=((n.rotate||0)+(e.rotate||0))%4;return s&&(r.rotate=s),r}function se(n,e){let r=Ee(n,e);for(let s in ve)s in L?s in n&&!(s in r)&&(r[s]=L[s]):s in e?r[s]=e[s]:s in n&&(r[s]=n[s]);return r}function Le(n,e){let r=n.icons,s=n.aliases||Object.create(null),t=Object.create(null);function o(i){if(r[i])return t[i]=[];if(!(i in t)){t[i]=null;let l=s[i]&&s[i].parent,a=l&&o(l);a&&(t[i]=[l].concat(a))}return t[i]}return(e||Object.keys(r).concat(Object.keys(s))).forEach(o),t}function Ce(n,e,r){let s=n.icons,t=n.aliases||Object.create(null),o={};function i(l){o=se(s[l]||t[l],o)}return i(e),r.forEach(i),se(n,o)}function ie(n,e){if(n.icons[e])return Ce(n,e,[]);let r=Le(n,[e])[e];return r?Ce(n,e,r):null}var kt=/(-?[0-9.]*[0-9]+[0-9.]*)/g,xt=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function oe(n,e,r){if(e===1)return n;if(r=r||100,typeof n=="number")return Math.ceil(n*e*r)/r;if(typeof n!="string")return n;let s=n.split(kt);if(s===null||!s.length)return n;let t=[],o=s.shift(),i=xt.test(o);for(;;){if(i){let l=parseFloat(o);isNaN(l)?t.push(o):t.push(Math.ceil(l*e*r)/r)}else t.push(o);if(o=s.shift(),o===void 0)return t.join("");i=!i}}function bt(n,e="defs"){let r="",s=n.indexOf("<"+e);for(;s>=0;){let t=n.indexOf(">",s),o=n.indexOf("</"+e);if(t===-1||o===-1)break;let i=n.indexOf(">",o);if(i===-1)break;r+=n.slice(t+1,o).trim(),n=n.slice(0,s).trim()+n.slice(i+1)}return{defs:r,content:n}}function wt(n,e){return n?"<defs>"+n+"</defs>"+e:e}function Pe(n,e,r){let s=bt(n);return wt(s.defs,e+s.content+r)}var yt=n=>n==="unset"||n==="undefined"||n==="none";function le(n,e){let r={...ne,...n},s={...Ae,...e},t={left:r.left,top:r.top,width:r.width,height:r.height},o=r.body;[r,s].forEach(b=>{let w=[],C=b.hFlip,P=b.vFlip,T=b.rotate;C?P?T+=2:(w.push("translate("+(t.width+t.left).toString()+" "+(0-t.top).toString()+")"),w.push("scale(-1 1)"),t.top=t.left=0):P&&(w.push("translate("+(0-t.left).toString()+" "+(t.height+t.top).toString()+")"),w.push("scale(1 -1)"),t.top=t.left=0);let S;switch(T<0&&(T-=Math.floor(T/4)*4),T=T%4,T){case 1:S=t.height/2+t.top,w.unshift("rotate(90 "+S.toString()+" "+S.toString()+")");break;case 2:w.unshift("rotate(180 "+(t.width/2+t.left).toString()+" "+(t.height/2+t.top).toString()+")");break;case 3:S=t.width/2+t.left,w.unshift("rotate(-90 "+S.toString()+" "+S.toString()+")");break}T%2===1&&(t.left!==t.top&&(S=t.left,t.left=t.top,t.top=S),t.width!==t.height&&(S=t.width,t.width=t.height,t.height=S)),w.length&&(o=Pe(o,'<g transform="'+w.join(" ")+'">',"</g>"))});let i=s.width,l=s.height,a=t.width,p=t.height,c,h;i===null?(h=l===null?"1em":l==="auto"?p:l,c=oe(h,a/p)):(c=i==="auto"?a:i,h=l===null?oe(c,p/a):l==="auto"?p:l);let u={},f=(b,w)=>{yt(w)||(u[b]=w.toString())};f("width",c),f("height",h);let g=[t.left,t.top,a,p];return u.viewBox=g.join(" "),{attributes:u,viewBox:g,body:o}}var St=/\sid="(\S+)"/g,_e=new Map;function Tt(n){n=n.replace(/[0-9]+$/,"")||"a";let e=_e.get(n)||0;return _e.set(n,e+1),e?`${n}${e}`:n}function ae(n){let e=[],r;for(;r=St.exec(n);)e.push(r[1]);if(!e.length)return n;let s="suffix"+(Math.random()*16777216|Date.now()).toString(16);return e.forEach(t=>{let o=Tt(t),i=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");n=n.replace(new RegExp('([#;"])('+i+')([")]|\\.[a-z])',"g"),"$1"+o+s+"$3")}),n=n.replace(new RegExp(s,"g"),""),n}function ce(n,e){let r=n.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(let s in e)r+=" "+s+'="'+e[s]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+n+"</svg>"}function fe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var A=fe();function Oe(n){A=n}var D={exec:()=>null};function d(n,e=""){let r=typeof n=="string"?n:n.source,s={replace:(t,o)=>{let i=typeof o=="string"?o:o.source;return i=i.replace(y.caret,"$1"),r=r.replace(t,i),s},getRegex:()=>new RegExp(r,e)};return s}var $t=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),y={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:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},It=/^(?:[ \t]*(?:\n|$))+/,Rt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,zt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,q=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,vt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ge=/(?:[*+-]|\d{1,9}[.)])/,We=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ge=d(We).replace(/bull/g,ge).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(),At=d(We).replace(/bull/g,ge).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(),de=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Et=/^[^\n]+/,me=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Lt=d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",me).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ct=d(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ge).getRegex(),V="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ke=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Pt=d("^ {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",ke).replace("tag",V).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),He=d(de).replace("hr",q).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",V).getRegex(),_t=d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",He).getRegex(),xe={blockquote:_t,code:Rt,def:Lt,fences:zt,heading:vt,hr:q,html:Pt,lheading:Ge,list:Ct,newline:It,paragraph:He,table:D,text:Et},je=d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",q).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",V).getRegex(),jt={...xe,lheading:At,table:je,paragraph:d(de).replace("hr",q).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",je).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",V).getRegex()},Mt={...xe,html:d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ke).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:D,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:d(de).replace("hr",q).replace("heading",` *#{1,6} *[^
|
|
2
|
+
]`).replace("lheading",Ge).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Bt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Dt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ze=/^( {2,}|\\)\n(?!\s*$)/,qt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,U=/[\p{P}\p{S}]/u,be=/[\s\p{P}\p{S}]/u,Ne=/[^\s\p{P}\p{S}]/u,Ft=d(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,be).getRegex(),Ve=/(?!~)[\p{P}\p{S}]/u,Ot=/(?!~)[\s\p{P}\p{S}]/u,Wt=/(?:[^\s\p{P}\p{S}]|~)/u,Gt=d(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",$t?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ue=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Ht=d(Ue,"u").replace(/punct/g,U).getRegex(),Zt=d(Ue,"u").replace(/punct/g,Ve).getRegex(),Qe="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Nt=d(Qe,"gu").replace(/notPunctSpace/g,Ne).replace(/punctSpace/g,be).replace(/punct/g,U).getRegex(),Vt=d(Qe,"gu").replace(/notPunctSpace/g,Wt).replace(/punctSpace/g,Ot).replace(/punct/g,Ve).getRegex(),Ut=d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ne).replace(/punctSpace/g,be).replace(/punct/g,U).getRegex(),Qt=d(/\\(punct)/,"gu").replace(/punct/g,U).getRegex(),Kt=d(/^<(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(),Xt=d(ke).replace("(?:-->|$)","-->").getRegex(),Yt=d("^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",Xt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),H=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Jt=d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",H).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ke=d(/^!?\[(label)\]\[(ref)\]/).replace("label",H).replace("ref",me).getRegex(),Xe=d(/^!?\[(ref)\](?:\[\])?/).replace("ref",me).getRegex(),en=d("reflink|nolink(?!\\()","g").replace("reflink",Ke).replace("nolink",Xe).getRegex(),Me=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,we={_backpedal:D,anyPunctuation:Qt,autolink:Kt,blockSkip:Gt,br:Ze,code:Dt,del:D,emStrongLDelim:Ht,emStrongRDelimAst:Nt,emStrongRDelimUnd:Ut,escape:Bt,link:Jt,nolink:Xe,punctuation:Ft,reflink:Ke,reflinkSearch:en,tag:Yt,text:qt,url:D},tn={...we,link:d(/^!?\[(label)\]\((.*?)\)/).replace("label",H).getRegex(),reflink:d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",H).getRegex()},pe={...we,emStrongRDelimAst:Vt,emStrongLDelim:Zt,url:d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Me).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Me).getRegex()},nn={...pe,br:d(Ze).replace("{2,}","*").getRegex(),text:d(pe.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},W={normal:xe,gfm:jt,pedantic:Mt},j={normal:we,gfm:pe,breaks:nn,pedantic:tn},rn={"&":"&","<":"<",">":">",'"':""","'":"'"},Be=n=>rn[n];function R(n,e){if(e){if(y.escapeTest.test(n))return n.replace(y.escapeReplace,Be)}else if(y.escapeTestNoEncode.test(n))return n.replace(y.escapeReplaceNoEncode,Be);return n}function De(n){try{n=encodeURI(n).replace(y.percentDecode,"%")}catch{return null}return n}function qe(n,e){let r=n.replace(y.findPipe,(o,i,l)=>{let a=!1,p=i;for(;--p>=0&&l[p]==="\\";)a=!a;return a?"|":" |"}),s=r.split(y.splitPipe),t=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;t<s.length;t++)s[t]=s[t].trim().replace(y.slashPipe,"|");return s}function M(n,e,r){let s=n.length;if(s===0)return"";let t=0;for(;t<s;){let o=n.charAt(s-t-1);if(o===e&&!r)t++;else if(o!==e&&r)t++;else break}return n.slice(0,s-t)}function sn(n,e){if(n.indexOf(e[1])===-1)return-1;let r=0;for(let s=0;s<n.length;s++)if(n[s]==="\\")s++;else if(n[s]===e[0])r++;else if(n[s]===e[1]&&(r--,r<0))return s;return r>0?-2:-1}function Fe(n,e,r,s,t){let o=e.href,i=e.title||null,l=n[1].replace(t.other.outputLinkReplace,"$1");s.state.inLink=!0;let a={type:n[0].charAt(0)==="!"?"image":"link",raw:r,href:o,title:i,text:l,tokens:s.inlineTokens(l)};return s.state.inLink=!1,a}function on(n,e,r){let s=n.match(r.other.indentCodeCompensation);if(s===null)return e;let t=s[1];return e.split(`
|
|
3
|
+
`).map(o=>{let i=o.match(r.other.beginningSpace);if(i===null)return o;let[l]=i;return l.length>=t.length?o.slice(t.length):o}).join(`
|
|
4
|
+
`)}var Z=class{constructor(n){k(this,"options");k(this,"rules");k(this,"lexer");this.options=n||A}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let r=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?r:M(r,`
|
|
5
|
+
`)}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let r=e[0],s=on(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(n){let e=this.rules.block.heading.exec(n);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){let s=M(r,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(r=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(n){let e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:M(e[0],`
|
|
6
|
+
`)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let r=M(e[0],`
|
|
7
|
+
`).split(`
|
|
8
|
+
`),s="",t="",o=[];for(;r.length>0;){let i=!1,l=[],a;for(a=0;a<r.length;a++)if(this.rules.other.blockquoteStart.test(r[a]))l.push(r[a]),i=!0;else if(!i)l.push(r[a]);else break;r=r.slice(a);let p=l.join(`
|
|
9
|
+
`),c=p.replace(this.rules.other.blockquoteSetextReplace,`
|
|
10
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
11
|
+
${p}`:p,t=t?`${t}
|
|
12
|
+
${c}`:c;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,o,!0),this.lexer.state.top=h,r.length===0)break;let u=o.at(-1);if(u?.type==="code")break;if(u?.type==="blockquote"){let f=u,g=f.raw+`
|
|
13
|
+
`+r.join(`
|
|
14
|
+
`),b=this.blockquote(g);o[o.length-1]=b,s=s.substring(0,s.length-f.raw.length)+b.raw,t=t.substring(0,t.length-f.text.length)+b.text;break}else if(u?.type==="list"){let f=u,g=f.raw+`
|
|
15
|
+
`+r.join(`
|
|
16
|
+
`),b=this.list(g);o[o.length-1]=b,s=s.substring(0,s.length-u.raw.length)+b.raw,t=t.substring(0,t.length-f.raw.length)+b.raw,r=g.substring(o.at(-1).raw.length).split(`
|
|
17
|
+
`);continue}}return{type:"blockquote",raw:s,tokens:o,text:t}}}list(n){let e=this.rules.block.list.exec(n);if(e){let r=e[1].trim(),s=r.length>1,t={type:"list",raw:"",ordered:s,start:s?+r.slice(0,-1):"",loose:!1,items:[]};r=s?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=s?r:"[*+-]");let o=this.rules.other.listItemRegex(r),i=!1;for(;n;){let a=!1,p="",c="";if(!(e=o.exec(n))||this.rules.block.hr.test(n))break;p=e[0],n=n.substring(p.length);let h=e[2].split(`
|
|
18
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,C=>" ".repeat(3*C.length)),u=n.split(`
|
|
19
|
+
`,1)[0],f=!h.trim(),g=0;if(this.options.pedantic?(g=2,c=h.trimStart()):f?g=e[1].length+1:(g=e[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,c=h.slice(g),g+=e[1].length),f&&this.rules.other.blankLine.test(u)&&(p+=u+`
|
|
20
|
+
`,n=n.substring(u.length+1),a=!0),!a){let C=this.rules.other.nextBulletRegex(g),P=this.rules.other.hrRegex(g),T=this.rules.other.fencesBeginRegex(g),S=this.rules.other.headingBeginRegex(g),gt=this.rules.other.htmlBeginRegex(g);for(;n;){let Y=n.split(`
|
|
21
|
+
`,1)[0],_;if(u=Y,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting," "),_=u):_=u.replace(this.rules.other.tabCharGlobal," "),T.test(u)||S.test(u)||gt.test(u)||C.test(u)||P.test(u))break;if(_.search(this.rules.other.nonSpaceChar)>=g||!u.trim())c+=`
|
|
22
|
+
`+_.slice(g);else{if(f||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||T.test(h)||S.test(h)||P.test(h))break;c+=`
|
|
23
|
+
`+u}!f&&!u.trim()&&(f=!0),p+=Y+`
|
|
24
|
+
`,n=n.substring(Y.length+1),h=_.slice(g)}}t.loose||(i?t.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(i=!0));let b=null,w;this.options.gfm&&(b=this.rules.other.listIsTask.exec(c),b&&(w=b[0]!=="[ ] ",c=c.replace(this.rules.other.listReplaceTask,""))),t.items.push({type:"list_item",raw:p,task:!!b,checked:w,loose:!1,text:c,tokens:[]}),t.raw+=p}let l=t.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;t.raw=t.raw.trimEnd();for(let a=0;a<t.items.length;a++)if(this.lexer.state.top=!1,t.items[a].tokens=this.lexer.blockTokens(t.items[a].text,[]),!t.loose){let p=t.items[a].tokens.filter(h=>h.type==="space"),c=p.length>0&&p.some(h=>this.rules.other.anyLine.test(h.raw));t.loose=c}if(t.loose)for(let a=0;a<t.items.length;a++)t.items[a].loose=!0;return t}}html(n){let e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){let e=this.rules.block.def.exec(n);if(e){let r=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",t=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:e[0],href:s,title:t}}}table(n){let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=qe(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),t=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
25
|
+
`):[],o={type:"table",raw:e[0],header:[],align:[],rows:[]};if(r.length===s.length){for(let i of s)this.rules.other.tableAlignRight.test(i)?o.align.push("right"):this.rules.other.tableAlignCenter.test(i)?o.align.push("center"):this.rules.other.tableAlignLeft.test(i)?o.align.push("left"):o.align.push(null);for(let i=0;i<r.length;i++)o.header.push({text:r[i],tokens:this.lexer.inline(r[i]),header:!0,align:o.align[i]});for(let i of t)o.rows.push(qe(i,o.header.length).map((l,a)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:o.align[a]})));return o}}lheading(n){let e=this.rules.block.lheading.exec(n);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(n){let e=this.rules.block.paragraph.exec(n);if(e){let r=e[1].charAt(e[1].length-1)===`
|
|
26
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);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(n){let e=this.rules.inline.link.exec(n);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let o=M(r.slice(0,-1),"\\");if((r.length-o.length)%2===0)return}else{let o=sn(e[2],"()");if(o===-2)return;if(o>-1){let i=(e[0].indexOf("!")===0?5:4)+e[1].length+o;e[2]=e[2].substring(0,o),e[0]=e[0].substring(0,i).trim(),e[3]=""}}let s=e[2],t="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(s);o&&(s=o[1],t=o[3])}else t=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?s=s.slice(1):s=s.slice(1,-1)),Fe(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:t&&t.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let r;if((r=this.rules.inline.reflink.exec(n))||(r=this.rules.inline.nolink.exec(n))){let s=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),t=e[s.toLowerCase()];if(!t){let o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return Fe(r,t,r[0],this.lexer,this.rules)}}emStrong(n,e,r=""){let s=this.rules.inline.emStrongLDelim.exec(n);if(!(!s||s[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!r||this.rules.inline.punctuation.exec(r))){let t=[...s[0]].length-1,o,i,l=t,a=0,p=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,e=e.slice(-1*n.length+t);(s=p.exec(e))!=null;){if(o=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!o)continue;if(i=[...o].length,s[3]||s[4]){l+=i;continue}else if((s[5]||s[6])&&t%3&&!((t+i)%3)){a+=i;continue}if(l-=i,l>0)continue;i=Math.min(i,i+l+a);let c=[...s[0]][0].length,h=n.slice(0,t+s.index+c+i);if(Math.min(t,i)%2){let f=h.slice(1,-1);return{type:"em",raw:h,text:f,tokens:this.lexer.inlineTokens(f)}}let u=h.slice(2,-2);return{type:"strong",raw:h,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(r),t=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return s&&t&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n){let e=this.rules.inline.del.exec(n);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let r,s;return e[2]==="@"?(r=e[1],s="mailto:"+r):(r=e[1],s=r),{type:"link",raw:e[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}url(n){let e;if(e=this.rules.inline.url.exec(n)){let r,s;if(e[2]==="@")r=e[0],s="mailto:"+r;else{let t;do t=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(t!==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(n){let e=this.rules.inline.text.exec(n);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},$=class he{constructor(e){k(this,"tokens");k(this,"options");k(this,"state");k(this,"tokenizer");k(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||A,this.options.tokenizer=this.options.tokenizer||new Z,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:y,block:W.normal,inline:j.normal};this.options.pedantic?(r.block=W.pedantic,r.inline=j.pedantic):this.options.gfm&&(r.block=W.gfm,this.options.breaks?r.inline=j.breaks:r.inline=j.gfm),this.tokenizer.rules=r}static get rules(){return{block:W,inline:j}}static lex(e,r){return new he(r).lex(e)}static lexInline(e,r){return new he(r).inlineTokens(e)}lex(e){e=e.replace(y.carriageReturn,`
|
|
27
|
+
`),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let s=this.inlineQueue[r];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],s=!1){for(this.options.pedantic&&(e=e.replace(y.tabCharGlobal," ").replace(y.spaceLine,""));e;){let t;if(this.options.extensions?.block?.some(i=>(t=i.call({lexer:this},e,r))?(e=e.substring(t.raw.length),r.push(t),!0):!1))continue;if(t=this.tokenizer.space(e)){e=e.substring(t.raw.length);let i=r.at(-1);t.raw.length===1&&i!==void 0?i.raw+=`
|
|
28
|
+
`:r.push(t);continue}if(t=this.tokenizer.code(e)){e=e.substring(t.raw.length);let i=r.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
|
|
29
|
+
`)?"":`
|
|
30
|
+
`)+t.raw,i.text+=`
|
|
31
|
+
`+t.text,this.inlineQueue.at(-1).src=i.text):r.push(t);continue}if(t=this.tokenizer.fences(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.heading(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.hr(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.blockquote(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.list(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.html(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.def(e)){e=e.substring(t.raw.length);let i=r.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
|
|
32
|
+
`)?"":`
|
|
33
|
+
`)+t.raw,i.text+=`
|
|
34
|
+
`+t.raw,this.inlineQueue.at(-1).src=i.text):this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title},r.push(t));continue}if(t=this.tokenizer.table(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.lheading(e)){e=e.substring(t.raw.length),r.push(t);continue}let o=e;if(this.options.extensions?.startBlock){let i=1/0,l=e.slice(1),a;this.options.extensions.startBlock.forEach(p=>{a=p.call({lexer:this},l),typeof a=="number"&&a>=0&&(i=Math.min(i,a))}),i<1/0&&i>=0&&(o=e.substring(0,i+1))}if(this.state.top&&(t=this.tokenizer.paragraph(o))){let i=r.at(-1);s&&i?.type==="paragraph"?(i.raw+=(i.raw.endsWith(`
|
|
35
|
+
`)?"":`
|
|
36
|
+
`)+t.raw,i.text+=`
|
|
37
|
+
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):r.push(t),s=o.length!==e.length,e=e.substring(t.raw.length);continue}if(t=this.tokenizer.text(e)){e=e.substring(t.raw.length);let i=r.at(-1);i?.type==="text"?(i.raw+=(i.raw.endsWith(`
|
|
38
|
+
`)?"":`
|
|
39
|
+
`)+t.raw,i.text+=`
|
|
40
|
+
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):r.push(t);continue}if(e){let i="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(i);break}else throw new Error(i)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){let s=e,t=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(t=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)a.includes(t[0].slice(t[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(t=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,t.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(t=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)o=t[2]?t[2].length:0,s=s.slice(0,t.index+o)+"["+"a".repeat(t[0].length-o-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let i=!1,l="";for(;e;){i||(l=""),i=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,r))?(e=e.substring(a.raw.length),r.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let c=r.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):r.push(a);continue}if(a=this.tokenizer.emStrong(e,s,l)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.del(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),r.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),r.push(a);continue}let p=e;if(this.options.extensions?.startInline){let c=1/0,h=e.slice(1),u;this.options.extensions.startInline.forEach(f=>{u=f.call({lexer:this},h),typeof u=="number"&&u>=0&&(c=Math.min(c,u))}),c<1/0&&c>=0&&(p=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(p)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(l=a.raw.slice(-1)),i=!0;let c=r.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):r.push(a);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return r}},N=class{constructor(n){k(this,"options");k(this,"parser");this.options=n||A}space(n){return""}code({text:n,lang:e,escaped:r}){let s=(e||"").match(y.notSpaceStart)?.[0],t=n.replace(y.endingNewline,"")+`
|
|
41
|
+
`;return s?'<pre><code class="language-'+R(s)+'">'+(r?t:R(t,!0))+`</code></pre>
|
|
42
|
+
`:"<pre><code>"+(r?t:R(t,!0))+`</code></pre>
|
|
43
|
+
`}blockquote({tokens:n}){return`<blockquote>
|
|
44
|
+
${this.parser.parse(n)}</blockquote>
|
|
45
|
+
`}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:e}){return`<h${e}>${this.parser.parseInline(n)}</h${e}>
|
|
46
|
+
`}hr(n){return`<hr>
|
|
47
|
+
`}list(n){let e=n.ordered,r=n.start,s="";for(let i=0;i<n.items.length;i++){let l=n.items[i];s+=this.listitem(l)}let t=e?"ol":"ul",o=e&&r!==1?' start="'+r+'"':"";return"<"+t+o+`>
|
|
48
|
+
`+s+"</"+t+`>
|
|
49
|
+
`}listitem(n){let e="";if(n.task){let r=this.checkbox({checked:!!n.checked});n.loose?n.tokens[0]?.type==="paragraph"?(n.tokens[0].text=r+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&n.tokens[0].tokens[0].type==="text"&&(n.tokens[0].tokens[0].text=r+" "+R(n.tokens[0].tokens[0].text),n.tokens[0].tokens[0].escaped=!0)):n.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):e+=r+" "}return e+=this.parser.parse(n.tokens,!!n.loose),`<li>${e}</li>
|
|
50
|
+
`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
|
|
51
|
+
`}table(n){let e="",r="";for(let t=0;t<n.header.length;t++)r+=this.tablecell(n.header[t]);e+=this.tablerow({text:r});let s="";for(let t=0;t<n.rows.length;t++){let o=n.rows[t];r="";for(let i=0;i<o.length;i++)r+=this.tablecell(o[i]);s+=this.tablerow({text:r})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
52
|
+
<thead>
|
|
53
|
+
`+e+`</thead>
|
|
54
|
+
`+s+`</table>
|
|
55
|
+
`}tablerow({text:n}){return`<tr>
|
|
56
|
+
${n}</tr>
|
|
57
|
+
`}tablecell(n){let e=this.parser.parseInline(n.tokens),r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+e+`</${r}>
|
|
58
|
+
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${R(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:r}){let s=this.parser.parseInline(r),t=De(n);if(t===null)return s;n=t;let o='<a href="'+n+'"';return e&&(o+=' title="'+R(e)+'"'),o+=">"+s+"</a>",o}image({href:n,title:e,text:r,tokens:s}){s&&(r=this.parser.parseInline(s,this.parser.textRenderer));let t=De(n);if(t===null)return R(r);n=t;let o=`<img src="${n}" alt="${r}"`;return e&&(o+=` title="${R(e)}"`),o+=">",o}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:R(n.text)}},ye=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}},I=class ue{constructor(e){k(this,"options");k(this,"renderer");k(this,"textRenderer");this.options=e||A,this.options.renderer=this.options.renderer||new N,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ye}static parse(e,r){return new ue(r).parse(e)}static parseInline(e,r){return new ue(r).parseInline(e)}parse(e,r=!0){let s="";for(let t=0;t<e.length;t++){let o=e[t];if(this.options.extensions?.renderers?.[o.type]){let l=o,a=this.options.extensions.renderers[l.type].call({parser:this},l);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){s+=a||"";continue}}let i=o;switch(i.type){case"space":{s+=this.renderer.space(i);continue}case"hr":{s+=this.renderer.hr(i);continue}case"heading":{s+=this.renderer.heading(i);continue}case"code":{s+=this.renderer.code(i);continue}case"table":{s+=this.renderer.table(i);continue}case"blockquote":{s+=this.renderer.blockquote(i);continue}case"list":{s+=this.renderer.list(i);continue}case"html":{s+=this.renderer.html(i);continue}case"def":{s+=this.renderer.def(i);continue}case"paragraph":{s+=this.renderer.paragraph(i);continue}case"text":{let l=i,a=this.renderer.text(l);for(;t+1<e.length&&e[t+1].type==="text";)l=e[++t],a+=`
|
|
59
|
+
`+this.renderer.text(l);r?s+=this.renderer.paragraph({type:"paragraph",raw:a,text:a,tokens:[{type:"text",raw:a,text:a,escaped:!0}]}):s+=a;continue}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return s}parseInline(e,r=this.renderer){let s="";for(let t=0;t<e.length;t++){let o=e[t];if(this.options.extensions?.renderers?.[o.type]){let l=this.options.extensions.renderers[o.type].call({parser:this},o);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){s+=l||"";continue}}let i=o;switch(i.type){case"escape":{s+=r.text(i);break}case"html":{s+=r.html(i);break}case"link":{s+=r.link(i);break}case"image":{s+=r.image(i);break}case"strong":{s+=r.strong(i);break}case"em":{s+=r.em(i);break}case"codespan":{s+=r.codespan(i);break}case"br":{s+=r.br(i);break}case"del":{s+=r.del(i);break}case"text":{s+=r.text(i);break}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return s}},G,B=(G=class{constructor(n){k(this,"options");k(this,"block");this.options=n||A}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?$.lex:$.lexInline}provideParser(){return this.block?I.parse:I.parseInline}},k(G,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),k(G,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),G),ln=class{constructor(...n){k(this,"defaults",fe());k(this,"options",this.setOptions);k(this,"parse",this.parseMarkdown(!0));k(this,"parseInline",this.parseMarkdown(!1));k(this,"Parser",I);k(this,"Renderer",N);k(this,"TextRenderer",ye);k(this,"Lexer",$);k(this,"Tokenizer",Z);k(this,"Hooks",B);this.use(...n)}walkTokens(n,e){let r=[];for(let s of n)switch(r=r.concat(e.call(this,s)),s.type){case"table":{let t=s;for(let o of t.header)r=r.concat(this.walkTokens(o.tokens,e));for(let o of t.rows)for(let i of o)r=r.concat(this.walkTokens(i.tokens,e));break}case"list":{let t=s;r=r.concat(this.walkTokens(t.items,e));break}default:{let t=s;this.defaults.extensions?.childTokens?.[t.type]?this.defaults.extensions.childTokens[t.type].forEach(o=>{let i=t[o].flat(1/0);r=r.concat(this.walkTokens(i,e))}):t.tokens&&(r=r.concat(this.walkTokens(t.tokens,e)))}}return r}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(r=>{let s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach(t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){let o=e.renderers[t.name];o?e.renderers[t.name]=function(...i){let l=t.renderer.apply(this,i);return l===!1&&(l=o.apply(this,i)),l}:e.renderers[t.name]=t.renderer}if("tokenizer"in t){if(!t.level||t.level!=="block"&&t.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=e[t.level];o?o.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&(t.level==="block"?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:t.level==="inline"&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)}),s.extensions=e),r.renderer){let t=this.defaults.renderer||new N(this.defaults);for(let o in r.renderer){if(!(o in t))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let i=o,l=r.renderer[i],a=t[i];t[i]=(...p)=>{let c=l.apply(t,p);return c===!1&&(c=a.apply(t,p)),c||""}}s.renderer=t}if(r.tokenizer){let t=this.defaults.tokenizer||new Z(this.defaults);for(let o in r.tokenizer){if(!(o in t))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let i=o,l=r.tokenizer[i],a=t[i];t[i]=(...p)=>{let c=l.apply(t,p);return c===!1&&(c=a.apply(t,p)),c}}s.tokenizer=t}if(r.hooks){let t=this.defaults.hooks||new B;for(let o in r.hooks){if(!(o in t))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let i=o,l=r.hooks[i],a=t[i];B.passThroughHooks.has(o)?t[i]=p=>{if(this.defaults.async&&B.passThroughHooksRespectAsync.has(o))return(async()=>{let h=await l.call(t,p);return a.call(t,h)})();let c=l.call(t,p);return a.call(t,c)}:t[i]=(...p)=>{if(this.defaults.async)return(async()=>{let h=await l.apply(t,p);return h===!1&&(h=await a.apply(t,p)),h})();let c=l.apply(t,p);return c===!1&&(c=a.apply(t,p)),c}}s.hooks=t}if(r.walkTokens){let t=this.defaults.walkTokens,o=r.walkTokens;s.walkTokens=function(i){let l=[];return l.push(o.call(this,i)),t&&(l=l.concat(t.call(this,i))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return $.lex(n,e??this.defaults)}parser(n,e){return I.parse(n,e??this.defaults)}parseMarkdown(n){return(e,r)=>{let s={...r},t={...this.defaults,...s},o=this.onError(!!t.silent,!!t.async);if(this.defaults.async===!0&&s.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(t.hooks&&(t.hooks.options=t,t.hooks.block=n),t.async)return(async()=>{let i=t.hooks?await t.hooks.preprocess(e):e,l=await(t.hooks?await t.hooks.provideLexer():n?$.lex:$.lexInline)(i,t),a=t.hooks?await t.hooks.processAllTokens(l):l;t.walkTokens&&await Promise.all(this.walkTokens(a,t.walkTokens));let p=await(t.hooks?await t.hooks.provideParser():n?I.parse:I.parseInline)(a,t);return t.hooks?await t.hooks.postprocess(p):p})().catch(o);try{t.hooks&&(e=t.hooks.preprocess(e));let i=(t.hooks?t.hooks.provideLexer():n?$.lex:$.lexInline)(e,t);t.hooks&&(i=t.hooks.processAllTokens(i)),t.walkTokens&&this.walkTokens(i,t.walkTokens);let l=(t.hooks?t.hooks.provideParser():n?I.parse:I.parseInline)(i,t);return t.hooks&&(l=t.hooks.postprocess(l)),l}catch(i){return o(i)}}}onError(n,e){return r=>{if(r.message+=`
|
|
60
|
+
Please report this to https://github.com/markedjs/marked.`,n){let s="<p>An error occurred:</p><pre>"+R(r.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(r);throw r}}},v=new ln;function m(n,e){return v.parse(n,e)}m.options=m.setOptions=function(n){return v.setOptions(n),m.defaults=v.defaults,Oe(m.defaults),m};m.getDefaults=fe;m.defaults=A;m.use=function(...n){return v.use(...n),m.defaults=v.defaults,Oe(m.defaults),m};m.walkTokens=function(n,e){return v.walkTokens(n,e)};m.parseInline=v.parseInline;m.Parser=I;m.parser=I.parse;m.Renderer=N;m.TextRenderer=ye;m.Lexer=$;m.lexer=$.lex;m.Tokenizer=Z;m.Hooks=B;m.parse=m;var On=m.options,Wn=m.setOptions,Gn=m.use,Hn=m.walkTokens,Zn=m.parseInline;var Nn=I.parse,Vn=$.lex;function Ye(n){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var s=Array.from(typeof n=="string"?[n]:n);s[s.length-1]=s[s.length-1].replace(/\r?\n([\t ]*)$/,"");var t=s.reduce(function(l,a){var p=a.match(/\n([\t ]+|(?!\s).)/g);return p?l.concat(p.map(function(c){var h,u;return(u=(h=c.match(/[\t ]/g))===null||h===void 0?void 0:h.length)!==null&&u!==void 0?u:0})):l},[]);if(t.length){var o=new RegExp(`
|
|
61
|
+
[ ]{`.concat(Math.min.apply(Math,t),"}"),"g");s=s.map(function(l){return l.replace(o,`
|
|
62
|
+
`)})}s[0]=s[0].replace(/^\r?\n/,"");var i=s[0];return e.forEach(function(l,a){var p=i.match(/(?:^|\n)( *)$/),c=p?p[1]:"",h=l;typeof l=="string"&&l.includes(`
|
|
63
|
+
`)&&(h=String(l).split(`
|
|
64
|
+
`).map(function(u,f){return f===0?u:"".concat(c).concat(u)}).join(`
|
|
65
|
+
`)),i+=h+s[a+1]}),i}var an={body:'<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',height:80,width:80},Se=new Map,et=new Map,or=x(n=>{for(let e of n){if(!e.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(z.debug("Registering icon pack:",e.name),"loader"in e)et.set(e.name,e.loader);else if("icons"in e)Se.set(e.name,e.icons);else throw z.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),tt=x(async(n,e)=>{let r=re(n,!0,e!==void 0);if(!r)throw new Error(`Invalid icon name: ${n}`);let s=r.prefix||e;if(!s)throw new Error(`Icon name must contain a prefix: ${n}`);let t=Se.get(s);if(!t){let i=et.get(s);if(!i)throw new Error(`Icon set not found: ${r.prefix}`);try{t={...await i(),prefix:s},Se.set(s,t)}catch(l){throw z.error(l),new Error(`Failed to load icon set: ${r.prefix}`)}}let o=ie(t,r.name);if(!o)throw new Error(`Icon not found: ${n}`);return o},"getRegisteredIconData"),cn=x(async n=>{try{return await tt(n),!0}catch{return!1}},"isIconAvailable"),pn=x(async(n,e,r)=>{let s;try{s=await tt(n,e?.fallbackPrefix)}catch(i){z.error(i),s=an}let t=le(s,e),o=ce(ae(t.body),{...t.attributes,...r});return F(o,J())},"getIconSVG");function nt(n,{markdownAutoWrap:e}){let s=n.replace(/<br\/>/g,`
|
|
66
|
+
`).replace(/\n{2,}/g,`
|
|
67
|
+
`);return Ye(s)}x(nt,"preprocessMarkdown");function rt(n){return n.split(/\\n|\n|<br\s*\/?>/gi).map(e=>e.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}x(rt,"nonMarkdownToLines");function st(n,e={}){let r=nt(n,e),s=m.lexer(r),t=[[]],o=0;function i(l,a="normal"){l.type==="text"?l.text.split(`
|
|
68
|
+
`).forEach((c,h)=>{h!==0&&(o++,t.push([])),c.split(" ").forEach(u=>{u=u.replace(/'/g,"'"),u&&t[o].push({content:u,type:a})})}):l.type==="strong"||l.type==="em"?l.tokens.forEach(p=>{i(p,l.type)}):l.type==="html"&&t[o].push({content:l.text,type:"normal"})}return x(i,"processNode"),s.forEach(l=>{l.type==="paragraph"?l.tokens?.forEach(a=>{i(a)}):l.type==="html"?t[o].push({content:l.text,type:"normal"}):t[o].push({content:l.raw,type:"normal"})}),t}x(st,"markdownToLines");function it(n){return n?`<p>${n.replace(/\\n|\n/g,"<br />")}</p>`:""}x(it,"nonMarkdownToHTML");function ot(n,{markdownAutoWrap:e}={}){let r=m.lexer(n);function s(t){return t.type==="text"?e===!1?t.text.replace(/\n */g,"<br/>").replace(/ /g," "):t.text.replace(/\n */g,"<br/>"):t.type==="strong"?`<strong>${t.tokens?.map(s).join("")}</strong>`:t.type==="em"?`<em>${t.tokens?.map(s).join("")}</em>`:t.type==="paragraph"?`<p>${t.tokens?.map(s).join("")}</p>`:t.type==="space"?"":t.type==="html"?`${t.text}`:t.type==="escape"?t.text:(z.warn(`Unsupported markdown: ${t.type}`),t.raw)}return x(s,"output"),r.map(s).join("")}x(ot,"markdownToHTML");function lt(n){return Intl.Segmenter?[...new Intl.Segmenter().segment(n)].map(e=>e.segment):[...n]}x(lt,"splitTextToChars");function at(n,e){let r=lt(e.content);return Ie(n,[],r,e.type)}x(at,"splitWordToFitWidth");function Ie(n,e,r,s){if(r.length===0)return[{content:e.join(""),type:s},{content:"",type:s}];let[t,...o]=r,i=[...e,t];return n([{content:i.join(""),type:s}])?Ie(n,i,o,s):(e.length===0&&t&&(e.push(t),r.shift()),[{content:e.join(""),type:s},{content:r.join(""),type:s}])}x(Ie,"splitWordToFitWidthRecursion");function ct(n,e){if(n.some(({content:r})=>r.includes(`
|
|
69
|
+
`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return Q(n,e)}x(ct,"splitLineToFitWidth");function Q(n,e,r=[],s=[]){if(n.length===0)return s.length>0&&r.push(s),r.length>0?r:[];let t="";n[0].content===" "&&(t=" ",n.shift());let o=n.shift()??{content:" ",type:"normal"},i=[...s];if(t!==""&&i.push({content:t,type:"normal"}),i.push(o),e(i))return Q(n,e,r,i);if(s.length>0)r.push(s),n.unshift(o);else if(o.content){let[l,a]=at(e,o);r.push([l]),a.content&&n.unshift(a)}return Q(n,e,r)}x(Q,"splitLineToFitWidthRecursion");function Te(n,e){e&&n.attr("style",e)}x(Te,"applyStyle");var Je=16384;async function pt(n,e,r,s,t=!1,o=J()){let i=n.append("foreignObject");i.attr("width",`${Math.min(10*r,Je)}px`),i.attr("height",`${Math.min(10*r,Je)}px`);let l=i.append("xhtml:div"),a=ee(e.label)?await Re(e.label.replace(ze.lineBreakRegex,`
|
|
70
|
+
`),o):F(e.label,o),p=e.isNode?"nodeLabel":"edgeLabel",c=l.append("span");c.html(a),Te(c,e.labelStyle),c.attr("class",`${p} ${s}`),Te(l,e.labelStyle),l.style("display","table-cell"),l.style("white-space","nowrap"),l.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(l.style("max-width",r+"px"),l.style("text-align","center")),l.attr("xmlns","http://www.w3.org/1999/xhtml"),t&&l.attr("class","labelBkg");let h=l.node().getBoundingClientRect();return h.width===r&&(l.style("display","table"),l.style("white-space","break-spaces"),l.style("width",r+"px"),h=l.node().getBoundingClientRect()),i.node()}x(pt,"addHtmlSpan");function K(n,e,r,s=!1){let t=n.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em");return s&&t.attr("text-anchor","middle"),t}x(K,"createTspan");function ht(n,e,r){let s=n.append("text"),t=K(s,1,e);X(t,r);let o=t.node().getComputedTextLength();return s.remove(),o}x(ht,"computeWidthOfText");function hn(n,e,r){let s=n.append("text"),t=K(s,1,e);X(t,[{content:r,type:"normal"}]);let o=t.node()?.getBoundingClientRect();return o&&s.remove(),o}x(hn,"computeDimensionOfText");function ut(n,e,r,s=!1,t=!1){let i=e.append("g"),l=i.insert("rect").attr("class","background").attr("style","stroke: none"),a=i.append("text").attr("y","-10.1");t&&a.attr("text-anchor","middle");let p=0;for(let c of r){let h=x(f=>ht(i,1.1,f)<=n,"checkWidth"),u=h(c)?[c]:ct(c,h);for(let f of u){let g=K(a,p,1.1,t);X(g,f),p++}}if(s){let c=a.node().getBBox(),h=2;return l.attr("x",c.x-h).attr("y",c.y-h).attr("width",c.width+2*h).attr("height",c.height+2*h),i.node()}else return a.node()}x(ut,"createFormattedText");function $e(n){let e=/&(amp|lt|gt);/g;return n.replace(e,(r,s)=>{switch(s){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}x($e,"decodeHTMLEntities");function X(n,e){n.text(""),e.forEach((r,s)=>{let t=n.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");s===0?t.text($e(r.content)):t.text(" "+$e(r.content))})}x(X,"updateTextContentAndStyles");async function ft(n,e={}){let r=[];n.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(t,o,i)=>(r.push((async()=>{let l=`${o}:${i}`;return await cn(l)?await pn(l,void 0,{class:"label-icon"}):`<i class='${F(t,e).replace(":"," ")}'></i>`})()),t));let s=await Promise.all(r);return n.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>s.shift()??"")}x(ft,"replaceIconSubstring");var pr=x(async(n,e="",{style:r="",isTitle:s=!1,classes:t="",useHtmlLabels:o=!0,markdown:i=!0,isNode:l=!0,width:a=200,addSvgBackground:p=!1}={},c)=>{if(z.debug("XYZ createText",e,r,s,t,o,l,"addSvgBackground: ",p),o){let h=i?ot(e,c):it(e),u=await ft(te(h),c),f=e.replace(/\\\\/g,"\\"),g={isNode:l,label:ee(e)?f:u,labelStyle:r.replace("fill:","color:")};return await pt(n,g,a,t,p,c)}else{let h=te(e.replace(/<br\s*\/?>/g,"<br/>")),u=i?st(h.replace("<br>","<br/>"),c):rt(h),f=ut(a,n,u,e?p:!1,!l);if(l){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));let g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");E(f).attr("style",g)}else{let g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");E(f).select("rect").attr("style",g.replace(/background:/g,"fill:"));let b=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");E(f).select("text").attr("style",b)}return s?E(f).selectAll("tspan.text-outer-tspan").classed("title-row",!0):E(f).selectAll("tspan.text-outer-tspan").classed("row",!0),f}},"createText");export{Ye as a,an as b,or as c,pn as d,hn as e,pr as f};
|
|
71
|
+
//# sourceMappingURL=chunk-6AA7JQNC.js.map
|