const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DDeKZH2t.js","./-BjnFHjF.js","./entry.5bPvZ2Nf.css","./bNaE6FFb.js"])))=>i.map(i=>d[i]);
import{bX as f,bY as y,bZ as d}from"./-BjnFHjF.js";function N(i){const e=i;return async r=>{const h=[],l=[];f(r,s=>{var t,a;return["pre","code"].includes(s.tagName)&&!!((t=s.properties)!=null&&t.language||(a=s.properties)!=null&&a.highlights)},s=>{const t=s,a=typeof t.properties.highlights=="string"?t.properties.highlights.split(/[,\s]+/).map(Number):Array.isArray(t.properties.highlights)?t.properties.highlights.map(Number):[],m=e.highlighter(y(s),t.properties.language,e.theme,{highlights:a.filter(Boolean),meta:t.properties.meta}).then(({tree:n,className:c,style:o,inlineStyle:u})=>{var g;t.properties.className=((t.properties.className||"")+" "+c).trim(),t.properties.style=((t.properties.style||"")+" "+u).trim(),((g=t.children[0])==null?void 0:g.tagName)==="code"?t.children[0].children=n:t.children=n[0].children||n,o&&l.push(o)});h.push(m)}),h.length&&(await Promise.all(h),r.children.push({type:"element",tagName:"style",children:[{type:"text",value:w(l.join(""))}],properties:{}}))}}const w=i=>{const e=i.split("}").filter(r=>!!r.trim()).map(r=>r.trim()+"}");return Array.from(new Set(e)).join("")},p={theme:{},async highlighter(i,e,r,h){var l,s;try{return window.sessionStorage.getItem("mdc-shiki-highlighter")==="browser"?d(()=>import("./DDeKZH2t.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(t=>t.default(i,e,r,h)).catch(()=>({})):await $fetch("/api/_mdc/highlight",{params:{code:i,lang:e,theme:JSON.stringify(r),options:JSON.stringify(h)}})}catch(t){if(((l=t==null?void 0:t.response)==null?void 0:l.status)===404)return window.sessionStorage.setItem("mdc-shiki-highlighter","browser"),(s=this.highlighter)==null?void 0:s.call(this,i,e,r,h)}return Promise.resolve({tree:[{type:"text",value:i}],className:"",style:""})}};function _(i={}){const e={...p,...i};return typeof e.highlighter!="function"&&(e.highlighter=p.highlighter),N(e)}const b={},k={highlight:{instance:_,options:{}}},v={theme:{light:"material-theme-lighter",default:"material-theme",dark:"material-theme-palenight"}};export{v as highlight,k as rehypePlugins,b as remarkPlugins};
