const e=require("./loadCss-DhrQh6-A.cjs"),t=require("./katex-6UpFeIdV.cjs");function n(e,t,n){function r(e){return e.trim().split(` `,2)[0]===t}function i(e,n,r,i,a){return e[n].nesting===1&&e[n].attrJoin(`class`,t),a.renderToken(e,n,r,i,a)}n||={};let a=n.marker||`:`,o=a.charCodeAt(0),s=a.length,c=n.validate||r,l=n.render||i;function u(e,n,r,i){let l,u=!1,d=e.bMarks[n]+e.tShift[n],f=e.eMarks[n];if(o!==e.src.charCodeAt(d))return!1;for(l=d+1;l<=f&&a[(l-d)%s]===e.src[l];l++);let p=Math.floor((l-d)/s);if(p<3)return!1;l-=(l-d)%s;let m=e.src.slice(d,l),h=e.src.slice(l,f);if(!c(h,m))return!1;if(i)return!0;let g=n;for(;g++,!(g>=r||(d=e.bMarks[g]+e.tShift[g],f=e.eMarks[g],d<f&&e.sCount[g]<e.blkIndent));)if(o===e.src.charCodeAt(d)&&!(e.sCount[g]-e.blkIndent>=4)){for(l=d+1;l<=f&&a[(l-d)%s]===e.src[l];l++);if(!(Math.floor((l-d)/s)<p)&&(l-=(l-d)%s,l=e.skipSpaces(l),!(l<f))){u=!0;break}}let _=e.parentType,v=e.lineMax;e.parentType=`container`,e.lineMax=g;let y=e.push(`container_`+t+`_open`,`div`,1);y.markup=m,y.block=!0,y.info=h,y.map=[n,g],e.md.block.tokenize(e,n+1,g);let b=e.push(`container_`+t+`_close`,`div`,-1);return b.markup=e.src.slice(d,l),b.block=!0,e.parentType=_,e.lineMax=v,e.line=g+ +!!u,!0}e.block.ruler.before(`fence`,`container_`+t,u,{alt:[`paragraph`,`reference`,`blockquote`,`list`]}),e.renderer.rules[`container_`+t+`_open`]=l,e.renderer.rules[`container_`+t+`_close`]=l}function r(e){let t=[`info`,`warning`,`error`,`success`],r={info:`#0ea5e9`,warning:`#f59e0b`,error:`#ef4444`,success:`#10b981`};t.forEach(t=>{e.use(n,t,{render:(e,n)=>{let i=r[t];return e[n].nesting===1?`<div class="custom-alert alert-${t}" style="padding: 12px 16px; border-left: 4px solid ${i}; background-color: ${i}15; margin: 8px 0; border-radius: 4px; font-family: system-ui, -apple-system, sans-serif;">\n`:`</div>
`}})})}function i(e){return o(e)}function a(t){let{cssUrl:n}=t||{};return t=>(n&&typeof window<`u`&&e.t(n),o(t))}function o(e){let n=[{open:`$$`,close:`$$`,display:!0},{open:`\\[`,close:`\\]`,display:!0},{open:`\\(`,close:`\\)`,display:!1},{open:`$`,close:`$`,display:!1}],r=(e,t)=>{let r=e.src;for(let i of n){if(!r.startsWith(i.open,e.pos))continue;let n=e.pos+i.open.length,a=n,o=-1;for(;(a=r.indexOf(i.close,a))!==-1;){let e=a-1,t=0;for(;e>=0&&r[e]===`\\`;)t++,e--;if(t%2==0){o=a;break}a+=i.close.length}if(o===-1)return t||(e.pending+=i.open),e.pos+=i.open.length,!0;let s=r.slice(n,o);if(!t){let t=e.push(`math`,`math`,0);t.content=s,t.markup=i.open,t.meta={display:i.display}}return e.pos=o+i.close.length,!0}return!1},i=(n,r)=>{let i=n[r],a=i.meta?.display||!1;try{let e=t.t.renderToString(i.content,{displayMode:a,throwOnError:!1,output:`mathml`,trust:!1});return a?`<div class="katex-block">${e}</div>`:e}catch(t){let n=t instanceof Error?t.message:String(t),r=e.utils?e.utils.escapeHtml(i.content):i.content;return`<span class="katex-error" title="${e.utils?e.utils.escapeHtml(n):n}">${r}</span>`}};e.inline.ruler.before(`escape`,`math`,r),e.renderer.rules.math=i,e.block.ruler.before(`fence`,`math_block`,(e,t,r,i)=>{for(let a of n){if(!a.display)continue;let n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(n+a.open.length>o||e.src.slice(n,n+a.open.length)!==a.open)continue;n+=a.open.length;let s=e.src.slice(n,o);if(s.trim().endsWith(a.close)){let n=s.trim().slice(0,-a.close.length);if(!i){let r=e.push(`math`,`math`,0);r.block=!0,r.content=n,r.markup=a.open,r.meta={display:a.display},r.map=[t,t+1]}return e.line=t+1,!0}let c=t,l=!1;for(;c<r&&(c++,!(c>=r||(n=e.bMarks[c]+e.tShift[c],o=e.eMarks[c],n<o&&e.tShift[c]<e.blkIndent)));)if(e.src.slice(n,o).trim()===a.close){l=!0;break}if(!l)continue;let u=e.parentType,d=e.lineMax;e.parentType=`math`;let f=``;for(let n=t+1;n<c;n++){let r=e.getLines(n,n+1,e.tShift[t],!1);f+=r}if(!i){let n=e.push(`math`,`math`,0);n.block=!0,n.content=f.trim(),n.markup=a.open,n.meta={display:a.display},n.map=[t,c+1]}return e.parentType=u,e.lineMax=d,e.line=c+1,!0}return!1})}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});