@visulima/ono 2.0.0-alpha.16 → 2.0.0-alpha.18

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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## @visulima/ono [2.0.0-alpha.18](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.17...@visulima/ono@2.0.0-alpha.18) (2026-05-04)
2
+
3
+
4
+ ### Dependencies
5
+
6
+ * **@visulima/error:** upgraded to 6.0.0-alpha.15
7
+
8
+ ## @visulima/ono [2.0.0-alpha.17](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.16...@visulima/ono@2.0.0-alpha.17) (2026-04-30)
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * **@visulima/error:** upgraded to 6.0.0-alpha.14
14
+
1
15
  ## @visulima/ono [2.0.0-alpha.16](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.15...@visulima/ono@2.0.0-alpha.16) (2026-04-28)
2
16
 
3
17
  ## @visulima/ono [2.0.0-alpha.15](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.14...@visulima/ono@2.0.0-alpha.15) (2026-04-22)
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ var Ho=Object.defineProperty;var m=(t,e)=>Ho(t,"name",{value:e,configurable:!0})
9
9
  `)},"wordWrap");var Dn=Object.defineProperty,N=$((t,e)=>Dn(t,"name",{value:e,configurable:!0}),"n$1");const vo=80,xo=24,Ye=N((t,e,{shell:o,env:r}={})=>lr(t,e,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:o,env:r}).trim(),"exec"),Ce=N((t,e)=>({columns:Number.parseInt(t,10),rows:Number.parseInt(e,10)}),"create"),ko=N((t,e)=>{const{columns:o,rows:r}=Ce(t,e);if(!(Number.isNaN(o)||Number.isNaN(r))&&!(o===vo&&r===xo))return{columns:o,rows:r}},"createIfNotDefault"),In=N(()=>{if(W.platform!=="linux")return!0;try{const t=ce.readFileSync("/proc/self/stat","utf8"),e=t.lastIndexOf(") ");if(e===-1)return!1;const o=t.slice(e+2).trim().split(/\s+/),r=Number.parseInt(o[2],10),n=Number.parseInt(o[5],10);return Number.isNaN(r)||Number.isNaN(n)||n<=0?!1:r===n}catch{return!1}},"isForegroundProcess");function fe(){const{env:t,stdout:e,stderr:o}=W;if(e?.columns&&e?.rows)return Ce(e.columns,e.rows);if(o?.columns&&o?.rows)return Ce(o.columns,o.rows);if(t.COLUMNS&&t.LINES)return Ce(t.COLUMNS,t.LINES);const r={columns:vo,rows:xo};return W.platform==="win32"?Ze()??r:W.platform==="darwin"?Ft()??Ze()??r:Ft()??Ze()??zn()??r}m(fe,"et$1");P(fe,"me");$(fe,"O$1");N(fe,"terminalSize");const Ft=N(()=>{try{const t=W.platform==="darwin"?ce.constants.O_EVTONLY|ce.constants.O_NONBLOCK:ce.constants.O_NONBLOCK,{columns:e,rows:o}=cr.WriteStream(ce.openSync("/dev/tty",t));return{columns:e,rows:o}}catch{}},"devTty"),Ze=N(()=>{try{const t=Ye("tput",["cols"],{env:{TERM:"dumb",...W.env}}),e=Ye("tput",["lines"],{env:{TERM:"dumb",...W.env}});if(t&&e)return ko(t,e)}catch{}},"tput"),zn=N(()=>{try{if(!In())return;const t=Ye("resize",["-u"]).match(/\d+/g);if(t.length===2)return ko(t[0],t[1])}catch{}},"resize"),Rn={arrow:{bottom:"↑",bottomLeft:"↗",bottomRight:"↖",left:"→",right:"←",top:"↓",topLeft:"↘",topRight:"↙"},bold:{bottom:"━",bottomLeft:"┗",bottomRight:"┛",left:"┃",right:"┃",top:"━",topLeft:"┏",topRight:"┓"},classic:{bottom:"-",bottomLeft:"+",bottomRight:"+",left:"|",right:"|",top:"-",topLeft:"+",topRight:"+"},double:{bottom:"═",bottomLeft:"╚",bottomRight:"╝",left:"║",right:"║",top:"═",topLeft:"╔",topRight:"╗"},doubleSingle:{bottom:"═",bottomLeft:"╘",bottomRight:"╛",left:"│",right:"│",top:"═",topLeft:"╒",topRight:"╕"},round:{bottom:"─",bottomLeft:"╰",bottomRight:"╯",left:"│",right:"│",top:"─",topLeft:"╭",topRight:"╮"},single:{bottom:"─",bottomLeft:"└",bottomRight:"┘",left:"│",right:"│",top:"─",topLeft:"┌",topRight:"┐"},singleDouble:{bottom:"─",bottomLeft:"╙",bottomRight:"╜",left:"║",right:"║",top:"─",topLeft:"╓",topRight:"╖"}};var Bn=Object.defineProperty,Ln=$((t,e)=>Bn(t,"name",{value:e,configurable:!0}),"n");const yo=Ln(t=>{let e=0;for(const o of t.split(`
10
10
  `))e=Math.max(e,x(o));return e},"widestLine");var jn=Object.defineProperty,T=$((t,e)=>jn(t,"name",{value:e,configurable:!0}),"s");const _=`
11
11
  `,A=" ",he="none",Mt=T(t=>typeof t=="number"?{bottom:t,left:t*3,right:t*3,top:t}:{bottom:0,left:0,right:0,top:0,...t},"getObject"),ue=T(t=>t===he?0:2,"getBorderWidth"),Fn=T(t=>{const e=["topLeft","topRight","bottomRight","bottomLeft","left","right","top","bottom"];let o;if(t===he){t={};for(const r of e)t[r]=""}if(typeof t=="string"){const r=Rn[t];if(r===void 0)throw new TypeError(`Invalid border style: ${t}`);o=r}else{typeof t.vertical=="string"&&(t.left=t.vertical,t.right=t.vertical),typeof t.horizontal=="string"&&(t.top=t.horizontal,t.bottom=t.horizontal);for(const r of e)if(typeof t[r]!="string")throw new TypeError(`Invalid border style: ${r}`);o=t}return o},"getBorderChars"),_t=T((t,e,o,r,n)=>{t=e(t);const a=x(t);let i;switch(n){case"left":{i=t+r(o.slice(a),x(o.slice(a)));break}case"right":{i=`${r(o.slice(a+2),x(o.slice(a))+2)} ${t} `;break}default:{if(o=o.slice(a),o.length%2===1)o=o.slice(Math.floor(o.length/2)),i=r(o.slice(1),x(o.slice(1)))+t+r(o,x(o));else{o=o.slice(o.length/2);const s=x(o);i=r(o,s)+t+r(o,s)}break}}return i},"wrapText"),Mn=T((t,{height:e,padding:o,textAlignment:r,width:n})=>{t=Bt(t,{align:r});let a=t.split(_);const i=yo(t),s=n-o.left-o.right;if(i>s){const d=[];for(const p of a){const h=bo(p,{width:s,wrapMode:J.BREAK_WORDS}),u=Bt(h,{align:r}).split(`
12
- `),f=Math.max(...u.map(g=>x(g)));for(const g of u){let w;switch(r){case"center":{w=A.repeat((s-f)/2)+g;break}case"right":{w=A.repeat(s-f)+g;break}default:{w=g;break}}d.push(w)}}a=d}r==="center"&&i<s?a=a.map(d=>A.repeat((s-i)/2)+d):r==="right"&&i<s&&(a=a.map(d=>A.repeat(s-i)+d));const c=A.repeat(o.left),l=A.repeat(o.right);return a=a.map(d=>{const p=c+d+l,h=n-x(p);return p+A.repeat(Math.max(h,0))}),o.top>0&&(a=[...Array.from({length:o.top}).fill(A.repeat(n)),...a]),o.bottom>0&&(a=[...a,...Array.from({length:o.bottom}).fill(A.repeat(n))]),e&&a.length>e?a=a.slice(0,e):e&&a.length<e&&(a=[...a,...Array.from({length:e-a.length}).fill(A.repeat(n))]),a.join(_)},"makeContentText"),_n=T((t,e,o,r)=>{const n=T((h,u,f)=>r.borderColor?r.borderColor(h,u,f):h,"colorizeBorder"),a=T(h=>r.headerTextColor?r.headerTextColor(h):h,"colorizeHeaderText"),i=T(h=>r.footerTextColor?r.footerTextColor(h):h,"colorizeFooterText"),s=T(h=>r.textColor?r.textColor(h):h,"colorizeContent"),c=Fn(r.borderStyle);let l=A.repeat(r.margin.left);if(r.float==="center"){const h=Math.max((o-e-ue(r.borderStyle))/2,0);l=A.repeat(h)}else if(r.float==="right"){const h=Math.max(o-e-r.margin.right-ue(r.borderStyle),0);l=A.repeat(h)}let d="";if(r.margin.top&&(d+=_.repeat(r.margin.top)),r.borderStyle!==he||r.headerText){let h=n(c.top.repeat(e),"top",e);r.headerText&&(h=_t(r.headerText,a,c.top.repeat(e),(f,g)=>n(f,"top",g),r.headerAlignment));const u=n(l+c.topLeft,"topLeft",x(l+c.topLeft));d+=u+h+n(c.topRight,"topRight",x(c.topRight))+_}const p=t.split(_);if(d+=p.map(h=>l+n(c.left,"left",x(c.left))+s(h)+n(c.right,"right",x(c.right))).join(_),r.borderStyle!==he||r.footerText){const h=_+n(l+c.bottomLeft,"bottomLeft",x(l+c.bottomLeft));let u=n(c.bottom.repeat(e),"bottom",e);r.footerText&&(u=_t(r.footerText,i,c.bottom.repeat(e),(f,g)=>n(f,"bottom",g),r.footerAlignment)),d+=h+u+n(c.bottomRight,"bottomRight",x(c.bottomRight))}return r.margin.bottom&&(d+=_.repeat(r.margin.bottom)),d},"boxContent"),On=T(t=>{if(t.fullscreen){let e=fe();typeof t.fullscreen=="function"&&(e=t.fullscreen(e.columns,e.rows)),t.width??=e.columns,t.height??=e.rows}return t.width&&(t.width=Math.max(1,t.width-ue(t.borderStyle))),t.height&&(t.height=Math.max(1,t.height-ue(t.borderStyle))),t},"sanitizeOptions"),Ot=T((t,e)=>e===he?t:` ${t} `,"formatTitle"),Pn=T((t,e,o)=>{o=On(o);const r=o.width!==void 0,n=ue(o.borderStyle),a=e-o.margin.left-o.margin.right-n,i=yo(bo(t,{trim:!1,width:e-n,wrapMode:J.BREAK_WORDS}))+o.padding.left+o.padding.right;if(o.headerText&&r?(o.headerText=o.headerText.slice(0,Math.max(0,o.width-2)),o.headerText&&(o.headerText=Ot(o.headerText,o.borderStyle))):o.headerText&&(o.headerText=o.headerText.slice(0,Math.max(0,a-2)),o.headerText&&(o.headerText=Ot(o.headerText,o.borderStyle),x(o.headerText)>i&&(o.width=x(o.headerText)))),o.width=o.width??i,!r){if(o.margin.left&&o.margin.right&&o.width>a){const s=(e-o.width-n)/(o.margin.left+o.margin.right);o.margin.left=Math.max(0,Math.floor(o.margin.left*s)),o.margin.right=Math.max(0,Math.floor(o.margin.right*s))}o.width=Math.min(o.width,e-n-o.margin.left-o.margin.right)}return o.width-(o.padding.left+o.padding.right)<=0&&(o.padding.left=0,o.padding.right=0),o.height&&o.height-(o.padding.top+o.padding.bottom)<=0&&(o.padding.top=0,o.padding.bottom=0),o},"determineDimensions"),Nn=T((t,e={})=>{if(e.borderColor!==void 0&&typeof e.borderColor!="function")throw new Error('"borderColor" is not a valid function');if(e.textColor!==void 0&&typeof e.textColor!="function")throw new Error('"textColor" is not a valid function');let o={borderStyle:"single",dimBorder:!1,float:"left",footerAlignment:"right",headerAlignment:"left",textAlignment:"left",transformTabToSpace:4,...e};o.padding=Mt(e.padding??0),o.margin=Mt(e.margin),o.transformTabToSpace&&(t=t.replaceAll(" "," ".repeat(o.transformTabToSpace)));const{columns:r}=fe();return o=Pn(t,r,o),_n(Mn(t,o),o.width,r,o)},"boxen");var qn=Object.defineProperty,Wn=m((t,e)=>qn(t,"name",{value:e,configurable:!0}),"r$5");const Hn=["cjs","mjs"],Un=["mdoc"],we=Wn(t=>{const e=(t.split("?")[0]??t).split(".").pop()?.toLowerCase();if(!e||Hn.includes(e))return"javascript";if(Un.includes(e))return"markdown";switch(e){case"js":case"cjs":case"mjs":return"javascript";case"json":return"json";case"json5":return"json5";case"jsonc":return"jsonc";case"jsx":return"jsx";case"sql":return"sql";case"ts":case"cts":case"mts":return"typescript";case"tsx":return"tsx";case"xml":return"xml";case"md":return"markdown";case"mdx":return"mdx";case"svelte":return"svelte";case"vue":return"vue";case"html":return"html";case"css":return"css";case"scss":return"scss";case"less":return"less";case"sass":return"sass";case"stylus":return"stylus";case"styl":return"styl";case"txt":return"text";default:return"javascript"}},"findLanguageBasedOnExtension");var Gn=Object.defineProperty,$o=m((t,e)=>Gn(t,"name",{value:e,configurable:!0}),"o$4");const de=new Map,be=$o(async t=>{if(/^(?:http|https|file|data):/.test(t)){if(de.has(t))return de.get(t);if(t.startsWith("file:"))try{const e=Xo(t),o=await Qo(e,"utf8");return de.set(t,o),o}catch{return}try{const e=await fetch(t);if(!e.ok)return;const o=await e.text();return de.set(t,o),o}catch{return}}},"getFileSource");$o(()=>{de.clear()},"clearFileSourceCache");var Zn=Object.defineProperty,Pe=m((t,e)=>Zn(t,"name",{value:e,configurable:!0}),"d$2");const Vn=Pe(t=>t.replace(/^\s*#+\s*/,"").trim(),"sanitizeTitle"),Kn=Pe(async(t,e,o=!1)=>{const r=[...e,to,oo],n=eo(t,{frameLimit:1})[0]??{};for await(const a of r.sort((i,s)=>i.priority-s.priority)){const{handle:i}=a;if(typeof i!="function")continue;const s=await i(t,{file:n.file??"",language:we(n.file??""),line:n.line??0,snippet:n.file?await be(n.file):""});if(s)return s}},"runSolutionFinders"),Eo=Pe(async(t,e)=>{const{solutionFinders:o=[],solutionTitle:r,color:n,debug:a=!1,...i}=e,s=Vo(t,{...i,...n?.codeFrame}),c=await Kn(t,o,a);if(!c)return{errorAnsi:s,solutionBox:void 0};const l=Vn(c.header??r??"A possible solution to this error"),d=Nn(c.body,{borderStyle:"round",padding:{top:1,right:2,bottom:1,left:2},margin:{top:0,right:0,bottom:0,left:0},headerText:`💡 ${l}`,headerAlignment:"left",textAlignment:"left",...n?.boxen});return{errorAnsi:s,solutionBox:d}},"buildOutput");Pe(async(t,e={})=>{const{logger:o=console,...r}=e,{errorAnsi:n,solutionBox:a}=await Eo(t,r);o.error(n),a&&(o.log(""),o.log(a))},"terminalOutput");const Pt="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-help-circle%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%20%2F%3E%20%3Cpath%20d%3D%22M9.09%209a3%203%200%200%201%205.83%201c0%202-3%203-3%203%22%20%2F%3E%20%3Cpath%20d%3D%22M12%2017h.01%22%20%2F%3E%20%3C%2Fsvg%3E",Nt="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-keyboard%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M10%208h.01%22%20%2F%3E%20%3Cpath%20d%3D%22M12%2012h.01%22%20%2F%3E%20%3Cpath%20d%3D%22M14%208h.01%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2012h.01%22%20%2F%3E%20%3Cpath%20d%3D%22M18%208h.01%22%20%2F%3E%20%3Cpath%20d%3D%22M6%208h.01%22%20%2F%3E%20%3Cpath%20d%3D%22M7%2016h10%22%20%2F%3E%20%3Cpath%20d%3D%22M8%2012h.01%22%20%2F%3E%20%3Crect%20width%3D%2220%22%20height%3D%2216%22%20x%3D%222%22%20y%3D%224%22%20rx%3D%222%22%20%2F%3E%20%3C%2Fsvg%3E";var Qn=Object.defineProperty,Xn=m((t,e)=>Qn(t,"name",{value:e,configurable:!0}),"o$3");const Yn=`
12
+ `),f=Math.max(...u.map(g=>x(g)));for(const g of u){let w;switch(r){case"center":{w=A.repeat((s-f)/2)+g;break}case"right":{w=A.repeat(s-f)+g;break}default:{w=g;break}}d.push(w)}}a=d}r==="center"&&i<s?a=a.map(d=>A.repeat((s-i)/2)+d):r==="right"&&i<s&&(a=a.map(d=>A.repeat(s-i)+d));const c=A.repeat(o.left),l=A.repeat(o.right);return a=a.map(d=>{const p=c+d+l,h=n-x(p);return p+A.repeat(Math.max(h,0))}),o.top>0&&(a=[...Array.from({length:o.top}).fill(A.repeat(n)),...a]),o.bottom>0&&(a=[...a,...Array.from({length:o.bottom}).fill(A.repeat(n))]),e&&a.length>e?a=a.slice(0,e):e&&a.length<e&&(a=[...a,...Array.from({length:e-a.length}).fill(A.repeat(n))]),a.join(_)},"makeContentText"),_n=T((t,e,o,r)=>{const n=T((h,u,f)=>r.borderColor?r.borderColor(h,u,f):h,"colorizeBorder"),a=T(h=>r.headerTextColor?r.headerTextColor(h):h,"colorizeHeaderText"),i=T(h=>r.footerTextColor?r.footerTextColor(h):h,"colorizeFooterText"),s=T(h=>r.textColor?r.textColor(h):h,"colorizeContent"),c=Fn(r.borderStyle);let l=A.repeat(r.margin.left);if(r.float==="center"){const h=Math.max((o-e-ue(r.borderStyle))/2,0);l=A.repeat(h)}else if(r.float==="right"){const h=Math.max(o-e-r.margin.right-ue(r.borderStyle),0);l=A.repeat(h)}let d="";if(r.margin.top&&(d+=_.repeat(r.margin.top)),r.borderStyle!==he||r.headerText){let h=n(c.top.repeat(e),"top",e);r.headerText&&(h=_t(r.headerText,a,c.top.repeat(e),(f,g)=>n(f,"top",g),r.headerAlignment));const u=n(l+c.topLeft,"topLeft",x(l+c.topLeft));d+=u+h+n(c.topRight,"topRight",x(c.topRight))+_}const p=t.split(_);if(d+=p.map(h=>l+n(c.left,"left",x(c.left))+s(h)+n(c.right,"right",x(c.right))).join(_),r.borderStyle!==he||r.footerText){const h=_+n(l+c.bottomLeft,"bottomLeft",x(l+c.bottomLeft));let u=n(c.bottom.repeat(e),"bottom",e);r.footerText&&(u=_t(r.footerText,i,c.bottom.repeat(e),(f,g)=>n(f,"bottom",g),r.footerAlignment)),d+=h+u+n(c.bottomRight,"bottomRight",x(c.bottomRight))}return r.margin.bottom&&(d+=_.repeat(r.margin.bottom)),d},"boxContent"),On=T(t=>{if(t.fullscreen){let e=fe();typeof t.fullscreen=="function"&&(e=t.fullscreen(e.columns,e.rows)),t.width??=e.columns,t.height??=e.rows}return t.width&&(t.width=Math.max(1,t.width-ue(t.borderStyle))),t.height&&(t.height=Math.max(1,t.height-ue(t.borderStyle))),t},"sanitizeOptions"),Ot=T((t,e)=>e===he?t:` ${t} `,"formatTitle"),Pn=T((t,e,o)=>{o=On(o);const r=o.width!==void 0,n=ue(o.borderStyle),a=e-o.margin.left-o.margin.right-n,i=yo(bo(t,{trim:!1,width:e-n,wrapMode:J.BREAK_WORDS}))+o.padding.left+o.padding.right;if(o.headerText&&r?(o.headerText=o.headerText.slice(0,Math.max(0,o.width-2)),o.headerText&&(o.headerText=Ot(o.headerText,o.borderStyle))):o.headerText&&(o.headerText=o.headerText.slice(0,Math.max(0,a-2)),o.headerText&&(o.headerText=Ot(o.headerText,o.borderStyle),x(o.headerText)>i&&(o.width=x(o.headerText)))),o.width=o.width??i,!r){if(o.margin.left&&o.margin.right&&o.width>a){const s=(e-o.width-n)/(o.margin.left+o.margin.right);o.margin.left=Math.max(0,Math.floor(o.margin.left*s)),o.margin.right=Math.max(0,Math.floor(o.margin.right*s))}o.width=Math.min(o.width,e-n-o.margin.left-o.margin.right)}return o.width-(o.padding.left+o.padding.right)<=0&&(o.padding.left=0,o.padding.right=0),o.height&&o.height-(o.padding.top+o.padding.bottom)<=0&&(o.padding.top=0,o.padding.bottom=0),o},"determineDimensions"),Nn=T((t,e={})=>{if(e.borderColor!==void 0&&typeof e.borderColor!="function")throw new Error('"borderColor" is not a valid function');if(e.textColor!==void 0&&typeof e.textColor!="function")throw new Error('"textColor" is not a valid function');let o={borderStyle:"single",dimBorder:!1,float:"left",footerAlignment:"right",headerAlignment:"left",textAlignment:"left",transformTabToSpace:4,...e};o.padding=Mt(e.padding??0),o.margin=Mt(e.margin),o.transformTabToSpace&&(t=t.replaceAll(" "," ".repeat(o.transformTabToSpace)));const{columns:r}=fe();return o=Pn(t,r,o),_n(Mn(t,o),o.width,r,o)},"boxen");var qn=Object.defineProperty,Wn=m((t,e)=>qn(t,"name",{value:e,configurable:!0}),"r$5");const Hn=["cjs","mjs"],Un=["mdoc"],we=Wn(t=>{const e=(t.split("?")[0]??t).split(".").pop()?.toLowerCase();if(!e||Hn.includes(e))return"javascript";if(Un.includes(e))return"markdown";switch(e){case"js":case"cjs":case"mjs":return"javascript";case"json":return"json";case"json5":return"json5";case"jsonc":return"jsonc";case"jsx":return"jsx";case"sql":return"sql";case"ts":case"cts":case"mts":return"typescript";case"tsx":return"tsx";case"xml":return"xml";case"md":return"markdown";case"mdx":return"mdx";case"svelte":return"svelte";case"vue":return"vue";case"html":return"html";case"css":return"css";case"scss":return"scss";case"less":return"less";case"sass":return"sass";case"stylus":return"stylus";case"styl":return"styl";case"txt":return"text";default:return"javascript"}},"findLanguageBasedOnExtension");var Gn=Object.defineProperty,$o=m((t,e)=>Gn(t,"name",{value:e,configurable:!0}),"o$4");const de=new Map,be=$o(async t=>{if(/^(?:http|https|file|data):/.test(t)){if(de.has(t))return de.get(t);if(t.startsWith("file:"))try{const e=Xo(t),o=await Qo(e,"utf8");return de.set(t,o),o}catch{return}try{const e=await fetch(t);if(!e.ok)return;const o=await e.text();return de.set(t,o),o}catch{return}}},"getFileSource");$o(()=>{de.clear()},"clearFileSourceCache");var Zn=Object.defineProperty,Pe=m((t,e)=>Zn(t,"name",{value:e,configurable:!0}),"d$3");const Vn=Pe(t=>t.replace(/^\s*#+\s*/,"").trim(),"sanitizeTitle"),Kn=Pe(async(t,e,o=!1)=>{const r=[...e,to,oo],n=eo(t,{frameLimit:1})[0]??{};for await(const a of r.sort((i,s)=>i.priority-s.priority)){const{handle:i}=a;if(typeof i!="function")continue;const s=await i(t,{file:n.file??"",language:we(n.file??""),line:n.line??0,snippet:n.file?await be(n.file):""});if(s)return s}},"runSolutionFinders"),Eo=Pe(async(t,e)=>{const{solutionFinders:o=[],solutionTitle:r,color:n,debug:a=!1,...i}=e,s=Vo(t,{...i,...n?.codeFrame}),c=await Kn(t,o,a);if(!c)return{errorAnsi:s,solutionBox:void 0};const l=Vn(c.header??r??"A possible solution to this error"),d=Nn(c.body,{borderStyle:"round",padding:{top:1,right:2,bottom:1,left:2},margin:{top:0,right:0,bottom:0,left:0},headerText:`💡 ${l}`,headerAlignment:"left",textAlignment:"left",...n?.boxen});return{errorAnsi:s,solutionBox:d}},"buildOutput");Pe(async(t,e={})=>{const{logger:o=console,...r}=e,{errorAnsi:n,solutionBox:a}=await Eo(t,r);o.error(n),a&&(o.log(""),o.log(a))},"terminalOutput");const Pt="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-help-circle%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%20%2F%3E%20%3Cpath%20d%3D%22M9.09%209a3%203%200%200%201%205.83%201c0%202-3%203-3%203%22%20%2F%3E%20%3Cpath%20d%3D%22M12%2017h.01%22%20%2F%3E%20%3C%2Fsvg%3E",Nt="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-keyboard%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M10%208h.01%22%20%2F%3E%20%3Cpath%20d%3D%22M12%2012h.01%22%20%2F%3E%20%3Cpath%20d%3D%22M14%208h.01%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2012h.01%22%20%2F%3E%20%3Cpath%20d%3D%22M18%208h.01%22%20%2F%3E%20%3Cpath%20d%3D%22M6%208h.01%22%20%2F%3E%20%3Cpath%20d%3D%22M7%2016h10%22%20%2F%3E%20%3Cpath%20d%3D%22M8%2012h.01%22%20%2F%3E%20%3Crect%20width%3D%2220%22%20height%3D%2216%22%20x%3D%222%22%20y%3D%224%22%20rx%3D%222%22%20%2F%3E%20%3C%2Fsvg%3E";var Qn=Object.defineProperty,Xn=m((t,e)=>Qn(t,"name",{value:e,configurable:!0}),"o$3");const Yn=`
13
13
  <div id="ono-shortcuts-modal" class="fixed inset-0 z-50 hidden backdrop-blur-xl items-center justify-center p-2" role="dialog" aria-modal="true" aria-hidden="true" aria-labelledby="ono-shortcuts-title">
14
14
  <div class="bg-[var(--ono-surface)] rounded-[var(--ono-radius-lg)] shadow-[var(--ono-elevation-2)] max-w-md w-full max-h-[90vh] overflow-auto">
15
15
  <div class="flex items-center justify-between px-4 py-2 border-b border-[var(--ono-border)]">
@@ -260,7 +260,7 @@ bindShortcutsModal();
260
260
  `:`
261
261
  bindShortcutsModal();
262
262
  `}
263
- `}},"headerBar"),ca=`<!-- @license lucide-static v1.11.0 - ISC -->
263
+ `}},"headerBar"),ca=`<!-- @license lucide-static v1.14.0 - ISC -->
264
264
  <svg
265
265
  class="lucide lucide-blocks"
266
266
  xmlns="http://www.w3.org/2000/svg"
@@ -276,7 +276,7 @@ bindShortcutsModal();
276
276
  <path d="M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2" />
277
277
  <rect x="14" y="2" width="8" height="8" rx="1" />
278
278
  </svg>
279
- `,da=`<!-- @license lucide-static v1.11.0 - ISC -->
279
+ `,da=`<!-- @license lucide-static v1.14.0 - ISC -->
280
280
  <svg
281
281
  class="lucide lucide-layers"
282
282
  xmlns="http://www.w3.org/2000/svg"
@@ -293,7 +293,7 @@ bindShortcutsModal();
293
293
  <path d="M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12" />
294
294
  <path d="M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17" />
295
295
  </svg>
296
- `,pa=`<!-- @license lucide-static v1.11.0 - ISC -->
296
+ `,pa=`<!-- @license lucide-static v1.14.0 - ISC -->
297
297
  <svg
298
298
  class="lucide lucide-square-dashed"
299
299
  xmlns="http://www.w3.org/2000/svg"
@@ -834,7 +834,7 @@ bindShortcutsModal();
834
834
  </button>
835
835
  </div>
836
836
  </div>
837
- `}},"copyDropdown"),Ke="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-x%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M18%206%206%2018%22%20%2F%3E%20%3Cpath%20d%3D%22m6%206%2012%2012%22%20%2F%3E%20%3C%2Fsvg%3E";var Ga=Object.defineProperty,v=m((t,e)=>Ga(t,"name",{value:e,configurable:!0}),"g");function qe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}m(qe,"v$1");v(qe,"z");var Q=qe();function vt(t){Q=t}m(vt,"ae");v(vt,"G");var q={exec:v(()=>null,"exec")};function b(t,e=""){let o=typeof t=="string"?t:t.source,r={replace:v((n,a)=>{let i=typeof a=="string"?a:a.source;return i=i.replace(C.caret,"$1"),o=o.replace(n,i),r},"replace"),getRegex:v(()=>new RegExp(o,e),"getRegex")};return r}m(b,"u");v(b,"k");var Za=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),C={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:v(t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),"listItemRegex"),nextBulletRegex:v(t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),"nextBulletRegex"),hrRegex:v(t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),"hrRegex"),fencesBeginRegex:v(t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),"fencesBeginRegex"),headingBeginRegex:v(t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),"headingBeginRegex"),htmlBeginRegex:v(t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),"htmlBeginRegex"),blockquoteBeginRegex:v(t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`),"blockquoteBeginRegex")},Va=/^(?:[ \t]*(?:\n|$))+/,Ka=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Qa=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ve=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Xa=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,xt=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Io=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,zo=b(Io).replace(/bull/g,xt).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(),Ya=b(Io).replace(/bull/g,xt).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(),kt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ja=/^[^\n]+/,yt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ei=b(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",yt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ti=b(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,xt).getRegex(),We="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",$t=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,oi=b("^ {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",$t).replace("tag",We).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ro=b(kt).replace("hr",ve).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",We).getRegex(),ri=b(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ro).getRegex(),Et={blockquote:ri,code:Ka,def:ei,fences:Qa,heading:Xa,hr:ve,html:oi,lheading:zo,list:ti,newline:Va,paragraph:Ro,table:q,text:Ja},Kt=b("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ve).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",We).getRegex(),ni={...Et,lheading:Ya,table:Kt,paragraph:b(kt).replace("hr",ve).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Kt).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",We).getRegex()},ai={...Et,html:b(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",$t).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:q,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:b(kt).replace("hr",ve).replace("heading",` *#{1,6} *[^
837
+ `}},"copyDropdown"),Ke="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-x%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M18%206%206%2018%22%20%2F%3E%20%3Cpath%20d%3D%22m6%206%2012%2012%22%20%2F%3E%20%3C%2Fsvg%3E";var Ga=Object.defineProperty,v=m((t,e)=>Ga(t,"name",{value:e,configurable:!0}),"k");function qe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}m(qe,"v$1");v(qe,"z");var Q=qe();function vt(t){Q=t}m(vt,"ae");v(vt,"G");var q={exec:v(()=>null,"exec")};function b(t,e=""){let o=typeof t=="string"?t:t.source,r={replace:v((n,a)=>{let i=typeof a=="string"?a:a.source;return i=i.replace(C.caret,"$1"),o=o.replace(n,i),r},"replace"),getRegex:v(()=>new RegExp(o,e),"getRegex")};return r}m(b,"u");v(b,"d");var Za=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),C={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:v(t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),"listItemRegex"),nextBulletRegex:v(t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),"nextBulletRegex"),hrRegex:v(t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),"hrRegex"),fencesBeginRegex:v(t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),"fencesBeginRegex"),headingBeginRegex:v(t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),"headingBeginRegex"),htmlBeginRegex:v(t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),"htmlBeginRegex"),blockquoteBeginRegex:v(t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`),"blockquoteBeginRegex")},Va=/^(?:[ \t]*(?:\n|$))+/,Ka=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Qa=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ve=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Xa=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,xt=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Io=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,zo=b(Io).replace(/bull/g,xt).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(),Ya=b(Io).replace(/bull/g,xt).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(),kt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ja=/^[^\n]+/,yt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ei=b(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",yt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ti=b(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,xt).getRegex(),We="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",$t=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,oi=b("^ {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",$t).replace("tag",We).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ro=b(kt).replace("hr",ve).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",We).getRegex(),ri=b(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ro).getRegex(),Et={blockquote:ri,code:Ka,def:ei,fences:Qa,heading:Xa,hr:ve,html:oi,lheading:zo,list:ti,newline:Va,paragraph:Ro,table:q,text:Ja},Kt=b("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ve).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",We).getRegex(),ni={...Et,lheading:Ya,table:Kt,paragraph:b(kt).replace("hr",ve).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Kt).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",We).getRegex()},ai={...Et,html:b(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",$t).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:q,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:b(kt).replace("hr",ve).replace("heading",` *#{1,6} *[^
838
838
  ]`).replace("lheading",zo).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ii=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,si=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Bo=/^( {2,}|\\)\n(?!\s*$)/,li=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,re=/[\p{P}\p{S}]/u,He=/[\s\p{P}\p{S}]/u,St=/[^\s\p{P}\p{S}]/u,ci=b(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,He).getRegex(),Lo=/(?!~)[\p{P}\p{S}]/u,di=/(?!~)[\s\p{P}\p{S}]/u,pi=/(?:[^\s\p{P}\p{S}]|~)/u,hi=b(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Za?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),jo=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,ui=b(jo,"u").replace(/punct/g,re).getRegex(),gi=b(jo,"u").replace(/punct/g,Lo).getRegex(),Fo="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",mi=b(Fo,"gu").replace(/notPunctSpace/g,St).replace(/punctSpace/g,He).replace(/punct/g,re).getRegex(),fi=b(Fo,"gu").replace(/notPunctSpace/g,pi).replace(/punctSpace/g,di).replace(/punct/g,Lo).getRegex(),wi=b("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,St).replace(/punctSpace/g,He).replace(/punct/g,re).getRegex(),bi=b(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,re).getRegex(),vi="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",xi=b(vi,"gu").replace(/notPunctSpace/g,St).replace(/punctSpace/g,He).replace(/punct/g,re).getRegex(),ki=b(/\\(punct)/,"gu").replace(/punct/g,re).getRegex(),yi=b(/^<(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(),$i=b($t).replace("(?:-->|$)","-->").getRegex(),Ei=b("^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",$i).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ie=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Si=b(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Ie).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Mo=b(/^!?\[(label)\]\[(ref)\]/).replace("label",Ie).replace("ref",yt).getRegex(),_o=b(/^!?\[(ref)\](?:\[\])?/).replace("ref",yt).getRegex(),Ci=b("reflink|nolink(?!\\()","g").replace("reflink",Mo).replace("nolink",_o).getRegex(),Qt=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ct={_backpedal:q,anyPunctuation:ki,autolink:yi,blockSkip:hi,br:Bo,code:si,del:q,delLDelim:q,delRDelim:q,emStrongLDelim:ui,emStrongRDelimAst:mi,emStrongRDelimUnd:wi,escape:ii,link:Si,nolink:_o,punctuation:ci,reflink:Mo,reflinkSearch:Ci,tag:Ei,text:li,url:q},Ti={...Ct,link:b(/^!?\[(label)\]\((.*?)\)/).replace("label",Ie).getRegex(),reflink:b(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ie).getRegex()},tt={...Ct,emStrongRDelimAst:fi,emStrongLDelim:gi,delLDelim:bi,delRDelim:xi,url:b(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Qt).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:b(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Qt).getRegex()},Ai={...tt,br:b(Bo).replace("{2,}","*").getRegex(),text:b(tt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},$e={normal:Et,gfm:ni,pedantic:ai},le={normal:Ct,gfm:tt,breaks:Ai,pedantic:Ti},Di={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Xt=v(t=>Di[t],"de");function I(t,e){if(e){if(C.escapeTest.test(t))return t.replace(C.escapeReplace,Xt)}else if(C.escapeTestNoEncode.test(t))return t.replace(C.escapeReplaceNoEncode,Xt);return t}m(I,"y$2");v(I,"O");function ot(t){try{t=encodeURI(t).replace(C.percentDecode,"%")}catch{return null}return t}m(ot,"ne");v(ot,"J");function rt(t,e){let o=t.replace(C.findPipe,(a,i,s)=>{let c=!1,l=i;for(;--l>=0&&s[l]==="\\";)c=!c;return c?"|":" |"}),r=o.split(C.splitPipe),n=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(C.slashPipe,"|");return r}m(rt,"se");v(rt,"V");function F(t,e,o){let r=t.length;if(r===0)return"";let n=0;for(;n<r;){let a=t.charAt(r-n-1);if(a===e&&!o)n++;else if(a!==e&&o)n++;else break}return t.slice(0,r-n)}m(F,"$$2");v(F,"$");function nt(t){let e=t.split(`
839
839
  `),o=e.length-1;for(;o>=0&&C.blankLine.test(e[o]);)o--;return e.length-o<=2?t:e.slice(0,o+1).join(`
840
840
  `)}m(nt,"ie");v(nt,"Y");function Oo(t,e){if(t.indexOf(e[1])===-1)return-1;let o=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])o++;else if(t[r]===e[1]&&(o--,o<0))return r;return o>0?-2:-1}m(Oo,"st");v(Oo,"ge");function Po(t,e=0){let o=e,r="";for(let n of t)if(n===" "){let a=4-o%4;r+=" ".repeat(a),o+=a}else r+=n,o++;return r}m(Po,"it");v(Po,"fe");function at(t,e,o,r,n){let a=e.href,i=e.title||null,s=t[1].replace(n.other.outputLinkReplace,"$1");r.state.inLink=!0;let c={type:t[0].charAt(0)==="!"?"image":"link",raw:o,href:a,title:i,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}m(at,"le");v(at,"me");function No(t,e,o){let r=t.match(o.other.indentCodeCompensation);if(r===null)return e;let n=r[1];return e.split(`
@@ -859,7 +859,7 @@ ${d}`:d;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
859
859
  `,1)[0],z;if(h=M,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),z=h):z=h.replace(this.rules.other.tabCharGlobal," "),y.test(h)||D.test(h)||L.test(h)||ne.test(h)||g.test(h)||w.test(h))break;if(z.search(this.rules.other.nonSpaceChar)>=f||!h.trim())d+=`
860
860
  `+z.slice(f);else{if(u||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||y.test(p)||D.test(p)||w.test(p))break;d+=`
861
861
  `+h}u=!h.trim(),l+=M+`
862
- `,t=t.substring(M.length+1),p=z.slice(f)}}n.loose||(i?n.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(i=!0)),n.items.push({type:"list_item",raw:l,task:!!this.options.gfm&&this.rules.other.listIsTask.test(d),loose:!1,text:d,tokens:[]}),n.raw+=l}let s=n.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let c of n.items){if(this.lexer.state.top=!1,c.tokens=this.lexer.blockTokens(c.text,[]),c.task){if(c.text=c.text.replace(this.rules.other.listReplaceTask,""),c.tokens[0]?.type==="text"||c.tokens[0]?.type==="paragraph"){c.tokens[0].raw=c.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),c.tokens[0].text=c.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}}let l=this.rules.other.listTaskCheckbox.exec(c.raw);if(l){let d={type:"checkbox",raw:l[0]+" ",checked:l[0]!=="[ ]"};c.checked=d.checked,n.loose?c.tokens[0]&&["paragraph","text"].includes(c.tokens[0].type)&&"tokens"in c.tokens[0]&&c.tokens[0].tokens?(c.tokens[0].raw=d.raw+c.tokens[0].raw,c.tokens[0].text=d.raw+c.tokens[0].text,c.tokens[0].tokens.unshift(d)):c.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):c.tokens.unshift(d)}}if(!n.loose){let l=c.tokens.filter(p=>p.type==="space"),d=l.length>0&&l.some(p=>this.rules.other.anyLine.test(p.raw));n.loose=d}}if(n.loose)for(let c of n.items){c.loose=!0;for(let l of c.tokens)l.type==="text"&&(l.type="paragraph")}return n}}html(t){let e=this.rules.block.html.exec(t);if(e){let o=nt(e[0]);return{type:"html",block:!0,raw:o,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:o}}}def(t){let e=this.rules.block.def.exec(t);if(e){let o=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"):"",n=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:o,raw:F(e[0],`
862
+ `,t=t.substring(M.length+1),p=z.slice(f)}}n.loose||(i?n.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(i=!0)),n.items.push({type:"list_item",raw:l,task:!!this.options.gfm&&this.rules.other.listIsTask.test(d),loose:!1,text:d,tokens:[]}),n.raw+=l}let s=n.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let c of n.items){this.lexer.state.top=!1,c.tokens=this.lexer.blockTokens(c.text,[]);let l=c.tokens[0];if(c.task&&(l?.type==="text"||l?.type==="paragraph")){c.text=c.text.replace(this.rules.other.listReplaceTask,""),l.raw=l.raw.replace(this.rules.other.listReplaceTask,""),l.text=l.text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}let d=this.rules.other.listTaskCheckbox.exec(c.raw);if(d){let p={type:"checkbox",raw:d[0]+" ",checked:d[0]!=="[ ]"};c.checked=p.checked,n.loose?c.tokens[0]&&["paragraph","text"].includes(c.tokens[0].type)&&"tokens"in c.tokens[0]&&c.tokens[0].tokens?(c.tokens[0].raw=p.raw+c.tokens[0].raw,c.tokens[0].text=p.raw+c.tokens[0].text,c.tokens[0].tokens.unshift(p)):c.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):c.tokens.unshift(p)}}else c.task&&(c.task=!1);if(!n.loose){let d=c.tokens.filter(h=>h.type==="space"),p=d.length>0&&d.some(h=>this.rules.other.anyLine.test(h.raw));n.loose=p}}if(n.loose)for(let c of n.items){c.loose=!0;for(let l of c.tokens)l.type==="text"&&(l.type="paragraph")}return n}}html(t){let e=this.rules.block.html.exec(t);if(e){let o=nt(e[0]);return{type:"html",block:!0,raw:o,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:o}}}def(t){let e=this.rules.block.def.exec(t);if(e){let o=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"):"",n=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:o,raw:F(e[0],`
863
863
  `),href:r,title:n}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let o=rt(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
864
864
  `):[],a={type:"table",raw:F(e[0],`
865
865
  `),header:[],align:[],rows:[]};if(o.length===r.length){for(let i of r)this.rules.other.tableAlignRight.test(i)?a.align.push("right"):this.rules.other.tableAlignCenter.test(i)?a.align.push("center"):this.rules.other.tableAlignLeft.test(i)?a.align.push("left"):a.align.push(null);for(let i=0;i<o.length;i++)a.header.push({text:o[i],tokens:this.lexer.inline(o[i]),header:!0,align:a.align[i]});for(let i of n)a.rows.push(rt(i,a.header.length).map((s,c)=>({text:s,tokens:this.lexer.inline(s),header:!1,align:a.align[c]})));return a}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let o=e[1].trim();return{type:"heading",raw:F(e[0],`
@@ -897,7 +897,7 @@ ${this.parser.parse(e)}</blockquote>
897
897
  ${e}</tr>
898
898
  `}tablecell(e){let o=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+o+`</${r}>
899
899
  `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${I(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:o,tokens:r}){let n=this.parser.parseInline(r),a=ot(e);if(a===null)return n;e=a;let i='<a href="'+e+'"';return o&&(i+=' title="'+I(o)+'"'),i+=">"+n+"</a>",i}image({href:e,title:o,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));let a=ot(e);if(a===null)return I(r);e=a;let i=`<img src="${e}" alt="${I(r)}"`;return o&&(i+=` title="${I(o)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:I(e.text)}},Tt=class{static{m(this,"M")}static{v(this,"L")}strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},B=class st{static{m(this,"O")}static{v(this,"l")}options;renderer;textRenderer;constructor(e){this.options=e||Q,this.options.renderer=this.options.renderer||new Re,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Tt}static parse(e,o){return new st(o).parse(e)}static parseInline(e,o){return new st(o).parseInline(e)}parse(e){this.renderer.parser=this;let o="";for(let r=0;r<e.length;r++){let n=e[r];if(this.options.extensions?.renderers?.[n.type]){let i=n,s=this.options.extensions.renderers[i.type].call({parser:this},i);if(s!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(i.type)){o+=s||"";continue}}let a=n;switch(a.type){case"space":{o+=this.renderer.space(a);break}case"hr":{o+=this.renderer.hr(a);break}case"heading":{o+=this.renderer.heading(a);break}case"code":{o+=this.renderer.code(a);break}case"table":{o+=this.renderer.table(a);break}case"blockquote":{o+=this.renderer.blockquote(a);break}case"list":{o+=this.renderer.list(a);break}case"checkbox":{o+=this.renderer.checkbox(a);break}case"html":{o+=this.renderer.html(a);break}case"def":{o+=this.renderer.def(a);break}case"paragraph":{o+=this.renderer.paragraph(a);break}case"text":{o+=this.renderer.text(a);break}default:{let i='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}return o}parseInline(e,o=this.renderer){this.renderer.parser=this;let r="";for(let n=0;n<e.length;n++){let a=e[n];if(this.options.extensions?.renderers?.[a.type]){let s=this.options.extensions.renderers[a.type].call({parser:this},a);if(s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=s||"";continue}}let i=a;switch(i.type){case"escape":{r+=o.text(i);break}case"html":{r+=o.html(i);break}case"link":{r+=o.link(i);break}case"image":{r+=o.image(i);break}case"checkbox":{r+=o.checkbox(i);break}case"strong":{r+=o.strong(i);break}case"em":{r+=o.em(i);break}case"codespan":{r+=o.codespan(i);break}case"br":{r+=o.br(i);break}case"del":{r+=o.del(i);break}case"text":{r+=o.text(i);break}default:{let s='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return r}},pe=class{static{m(this,"A")}static{v(this,"P")}options;block;constructor(e){this.options=e||Q}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?R.lex:R.lexInline}provideParser(e=this.block){return e?B.parse:B.parseInline}},Ii=class{static{m(this,"xe")}static{v(this,"D")}defaults=qe();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=B;Renderer=Re;TextRenderer=Tt;Lexer=R;Tokenizer=ze;Hooks=pe;constructor(...t){this.use(...t)}walkTokens(t,e){let o=[];for(let r of t)switch(o=o.concat(e.call(this,r)),r.type){case"table":{let n=r;for(let a of n.header)o=o.concat(this.walkTokens(a.tokens,e));for(let a of n.rows)for(let i of a)o=o.concat(this.walkTokens(i.tokens,e));break}case"list":{let n=r;o=o.concat(this.walkTokens(n.items,e));break}default:{let n=r;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(a=>{let i=n[a].flat(1/0);o=o.concat(this.walkTokens(i,e))}):n.tokens&&(o=o.concat(this.walkTokens(n.tokens,e)))}}return o}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(o=>{let r={...o};if(r.async=this.defaults.async||r.async||!1,o.extensions&&(o.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let a=e.renderers[n.name];a?e.renderers[n.name]=function(...i){let s=n.renderer.apply(this,i);return s===!1&&(s=a.apply(this,i)),s}:e.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=e[n.level];a?a.unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),r.extensions=e),o.renderer){let n=this.defaults.renderer||new Re(this.defaults);for(let a in o.renderer){if(!(a in n))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let i=a,s=o.renderer[i],c=n[i];n[i]=(...l)=>{let d=s.apply(n,l);return d===!1&&(d=c.apply(n,l)),d||""}}r.renderer=n}if(o.tokenizer){let n=this.defaults.tokenizer||new ze(this.defaults);for(let a in o.tokenizer){if(!(a in n))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let i=a,s=o.tokenizer[i],c=n[i];n[i]=(...l)=>{let d=s.apply(n,l);return d===!1&&(d=c.apply(n,l)),d}}r.tokenizer=n}if(o.hooks){let n=this.defaults.hooks||new pe;for(let a in o.hooks){if(!(a in n))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let i=a,s=o.hooks[i],c=n[i];pe.passThroughHooks.has(a)?n[i]=l=>{if(this.defaults.async&&pe.passThroughHooksRespectAsync.has(a))return(async()=>{let p=await s.call(n,l);return c.call(n,p)})();let d=s.call(n,l);return c.call(n,d)}:n[i]=(...l)=>{if(this.defaults.async)return(async()=>{let p=await s.apply(n,l);return p===!1&&(p=await c.apply(n,l)),p})();let d=s.apply(n,l);return d===!1&&(d=c.apply(n,l)),d}}r.hooks=n}if(o.walkTokens){let n=this.defaults.walkTokens,a=o.walkTokens;r.walkTokens=function(i){let s=[];return s.push(a.call(this,i)),n&&(s=s.concat(n.call(this,i))),s}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return R.lex(t,e??this.defaults)}parser(t,e){return B.parse(t,e??this.defaults)}parseMarkdown(t){return(e,o)=>{let r={...o},n={...this.defaults,...r},a=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&r.async===!1)return a(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 a(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=t),n.async)return(async()=>{let i=n.hooks?await n.hooks.preprocess(e):e,s=await(n.hooks?await n.hooks.provideLexer(t):t?R.lex:R.lexInline)(i,n),c=n.hooks?await n.hooks.processAllTokens(s):s;n.walkTokens&&await Promise.all(this.walkTokens(c,n.walkTokens));let l=await(n.hooks?await n.hooks.provideParser(t):t?B.parse:B.parseInline)(c,n);return n.hooks?await n.hooks.postprocess(l):l})().catch(a);try{n.hooks&&(e=n.hooks.preprocess(e));let i=(n.hooks?n.hooks.provideLexer(t):t?R.lex:R.lexInline)(e,n);n.hooks&&(i=n.hooks.processAllTokens(i)),n.walkTokens&&this.walkTokens(i,n.walkTokens);let s=(n.hooks?n.hooks.provideParser(t):t?B.parse:B.parseInline)(i,n);return n.hooks&&(s=n.hooks.postprocess(s)),s}catch(i){return a(i)}}}onError(t,e){return o=>{if(o.message+=`
900
- Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+I(o.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(o);throw o}}},U=new Ii;function k(t,e){return U.parse(t,e)}m(k,"k");v(k,"g");k.options=k.setOptions=function(t){return U.setOptions(t),k.defaults=U.defaults,vt(k.defaults),k};k.getDefaults=qe;k.defaults=Q;k.use=function(...t){return U.use(...t),k.defaults=U.defaults,vt(k.defaults),k};k.walkTokens=function(t,e){return U.walkTokens(t,e)};k.parseInline=U.parseInline;k.Parser=B;k.parser=B.parse;k.Renderer=Re;k.TextRenderer=Tt;k.Lexer=R;k.lexer=R.lex;k.Tokenizer=ze;k.Hooks=pe;k.parse=k;var Yt=k,zi=Object.defineProperty,Ri=m((t,e)=>zi(t,"name",{value:e,configurable:!0}),"l$2");const Bi=Ri(async(t,e=[])=>{let o;const r=[...e,to,oo],n=eo(t,{frameLimit:1})[0];for(const a of r.toSorted((i,s)=>s.priority-i.priority)){if(o)break;const{handle:i,name:s}=a;if(process.env.DEBUG&&console.debug(`Running solution finder: ${s}`),typeof i=="function")try{o=await i(t,{file:n?.file??"",language:we(n?.file??""),line:n?.line??0,snippet:n?.file?await be(n.file):""})}catch{continue}}return o?{html:`<div id="ono-solution-wrapper" class="relative w-full transition-all duration-300 ease-in-out overflow-visible">
900
+ Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+I(o.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(o);throw o}}},U=new Ii;function k(t,e){return U.parse(t,e)}m(k,"d");v(k,"g");k.options=k.setOptions=function(t){return U.setOptions(t),k.defaults=U.defaults,vt(k.defaults),k};k.getDefaults=qe;k.defaults=Q;k.use=function(...t){return U.use(...t),k.defaults=U.defaults,vt(k.defaults),k};k.walkTokens=function(t,e){return U.walkTokens(t,e)};k.parseInline=U.parseInline;k.Parser=B;k.parser=B.parse;k.Renderer=Re;k.TextRenderer=Tt;k.Lexer=R;k.lexer=R.lex;k.Tokenizer=ze;k.Hooks=pe;k.parse=k;var Yt=k,zi=Object.defineProperty,Ri=m((t,e)=>zi(t,"name",{value:e,configurable:!0}),"l$2");const Bi=Ri(async(t,e=[])=>{let o;const r=[...e,to,oo],n=eo(t,{frameLimit:1})[0];for(const a of r.toSorted((i,s)=>s.priority-i.priority)){if(o)break;const{handle:i,name:s}=a;if(process.env.DEBUG&&console.debug(`Running solution finder: ${s}`),typeof i=="function")try{o=await i(t,{file:n?.file??"",language:we(n?.file??""),line:n?.line??0,snippet:n?.file?await be(n.file):""})}catch{continue}}return o?{html:`<div id="ono-solution-wrapper" class="relative w-full transition-all duration-300 ease-in-out overflow-visible">
901
901
  <button id="ono-solution-button" type="button" aria-label="Toggle solutions" aria-controls="ono-solution-content" aria-expanded="true" title="Toggle solution details" class="bg-[var(--ono-success-bg)] text-[var(--ono-text)] rounded-[var(--ono-radius-md)] p-2 absolute top-2 right-2 z-10 h-9 w-8 cursor-pointer shadow-[var(--ono-elevation-1)]">
902
902
  <span id="ono-solution-icon" class="dui" style="-webkit-mask-image: url('${Ke}'); mask-image: url('${Ke}')"></span>
903
903
  </button>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/ono",
3
- "version": "2.0.0-alpha.16",
3
+ "version": "2.0.0-alpha.18",
4
4
  "description": "Ono is an error-parsing library that pretty prints JavaScript errors on a web page or the terminal.",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -94,7 +94,7 @@
94
94
  },
95
95
  "dependencies": {
96
96
  "@shikijs/langs": "catalog:prod",
97
- "@visulima/error": "6.0.0-alpha.13",
97
+ "@visulima/error": "6.0.0-alpha.15",
98
98
  "isomorphic-dompurify": "catalog:prod",
99
99
  "launch-editor-middleware": "catalog:prod",
100
100
  "shiki": "catalog:syntax"