markstream-vue 0.0.7-beta.7 → 0.0.7-beta.8

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/dist/exports.js CHANGED
@@ -1 +1 @@
1
- var e=Object.defineProperty,n=Object.defineProperties,t=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,i=(n,t,o)=>t in n?e(n,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[t]=o,a=(e,n)=>{for(var t in n||(n={}))r.call(n,t)&&i(e,t,n[t]);if(o)for(var t of o(n))l.call(n,t)&&i(e,t,n[t]);return e},s=(e,o)=>n(e,t(o)),c=(e,n)=>{var t={};for(var i in e)r.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&o)for(var i of o(e))n.indexOf(i)<0&&l.call(e,i)&&(t[i]=e[i]);return t},d=(e,n,t)=>new Promise((o,r)=>{var l=e=>{try{a(t.next(e))}catch(n){r(n)}},i=e=>{try{a(t.throw(e))}catch(n){r(n)}},a=e=>e.done?o(e.value):Promise.resolve(e.value).then(l,i);a((t=t.apply(e,n)).next())});import{getMarkdown as u,parseMarkdownToStructure as m,setDefaultMathOptions as h}from"stream-markdown-parser";import{defineComponent as p,createElementBlock as f,openBlock as v,withMemo as g,createVNode as w,unref as y,createElementVNode as k,Fragment as x,renderList as b,toDisplayString as M,shallowRef as _,h as C,computed as B,ref as T,watch as L,onMounted as I,onBeforeUnmount as S,normalizeClass as E,createApp as j,inject as $,provide as N,createCommentVNode as H,Transition as R,withCtx as A,normalizeStyle as D,renderSlot as O,readonly as z,defineAsyncComponent as P,createBlock as V,resolveDynamicComponent as W,useAttrs as K,mergeProps as F,isMemoSame as U,markRaw as X,reactive as q,nextTick as G,withDirectives as Z,vShow as Y,Teleport as J}from"vue";const Q=["cite"],ee=(e,n)=>{const t=e.__vccOpts||e;for(const[o,r]of n)t[o]=r;return t},ne=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e;return(t,o)=>(v(),f("blockquote",{class:"blockquote",dir:"auto",cite:e.node.cite},[g([n.node.children],()=>w(y(Nt),{"index-key":`blockquote-${n.indexKey}`,nodes:n.node.children||[],"custom-id":n.customId,typewriter:n.typewriter,onCopy:o[0]||(o[0]=e=>t.$emit("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"]),o,1)],8,Q))}}),[["__scopeId","data-v-eeadc8a3"]]);ne.install=e=>{e.component(ne.__name,ne)};const te={class:"checkbox-node"},oe=["checked"],re=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"CheckboxNode",props:{node:{}},setup:e=>(n,t)=>(v(),f("span",te,[k("input",{type:"checkbox",checked:e.node.checked,disabled:"",class:"checkbox-input"},null,8,oe)]))}),[["__scopeId","data-v-8dc6c46f"]]);re.install=e=>{e.component(re.__name,re)};const le={class:"definition-list"},ie={class:"definition-term"},ae={class:"definition-desc"},se=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e;return(e,t)=>(v(),f("dl",le,[(v(!0),f(x,null,b(n.node.items,(o,r)=>(v(),f(x,{key:r},[k("dt",ie,[w(y(Nt),{"index-key":`definition-term-${n.indexKey}-${r}`,nodes:o.term,"custom-id":n.customId,typewriter:n.typewriter,onCopy:t[0]||(t[0]=n=>e.$emit("copy",n))},null,8,["index-key","nodes","custom-id","typewriter"])]),k("dd",ae,[w(y(Nt),{"index-key":`definition-desc-${n.indexKey}-${r}`,nodes:o.definition,"custom-id":n.customId,typewriter:n.typewriter,onCopy:t[1]||(t[1]=n=>e.$emit("copy",n))},null,8,["index-key","nodes","custom-id","typewriter"])])],64))),128))]))}}),[["__scopeId","data-v-f88691d6"]]);se.install=e=>{e.component(se.__name,se)};const ce={class:"emoji-node"},de=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"EmojiNode",props:{node:{}},setup:e=>(n,t)=>(v(),f("span",ce,M(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);de.install=e=>{e.component(de.__name,de)};const ue="__global__",me="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",he=(()=>{const e=globalThis;if(e[me])return e[me];const n={scopedCustomComponents:{},revision:_(0)};return e[me]=n,n})(),pe=he.revision;function fe(e,n){"string"==typeof e?he.scopedCustomComponents[e]=n||{}:he.scopedCustomComponents[ue]=e||{},pe.value++}function ve(e){const n=he.scopedCustomComponents[ue]||{};if(!e)return n;const t=he.scopedCustomComponents[e]||{};return n&&0!==Object.keys(n).length?t&&0!==Object.keys(t).length?a(a({},n),t):n:t}function ge(e){if(e===ue)throw new Error("removeCustomComponents: use clearGlobalCustomComponents() to clear the global mapping");delete he.scopedCustomComponents[e],pe.value++}function we(){delete he.scopedCustomComponents[ue],pe.value++}const ye=["id"],ke=["title"],xe=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const n=`#footnote-${e.node.id}`;function t(){if("undefined"==typeof document)return;const e=document.querySelector(n);e?e.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${n} not found`)}return(o,r)=>(v(),f("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:t},[k("span",{href:n,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+M(e.node.id)+"]",9,ke)],8,ye))}}),[["__scopeId","data-v-01af0fee"]]);xe.install=e=>{e.component(xe.__name,xe)};const be=/* @__PURE__ */new Set(["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onreset","onsearch","onsubmit"]),Me=/* @__PURE__ */new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),_e=/* @__PURE__ */new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),Ce=/<([a-z][a-z0-9-]*)\b[^>]*>/gi,Be=/* @__PURE__ */new Set(["script"]),Te=/* @__PURE__ */new Set(["href","src","srcset","xlink:href","formaction"]),Le=(()=>{try{return Boolean(!1)}catch(e){}return!1})();function Ie(e){Le&&console.warn(e)}function Se(e){const n=function(e){let n="";for(const t of e){const e=t.charCodeAt(0);e<=31||127===e||/\s/u.test(t)||(n+=t)}return n}(e).toLowerCase();return!(!n.startsWith("javascript:")&&!n.startsWith("vbscript:"))||!!n.startsWith("data:")&&!(n.startsWith("data:image/")||n.startsWith("data:video/")||n.startsWith("data:audio/"))}function Ee(e,n){return Object.prototype.hasOwnProperty.call(e,n)}function je(e,n){const t=e.toLowerCase();return!_e.has(t)&&(Ee(n,t)||Ee(n,e))}function $e(e,n){const t=n.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(t))return"true"===e||""===e||e===n;if(["value","min","max","step","width","height","size","maxlength"].includes(t)){const n=Number(e);if(""!==e&&!Number.isNaN(n))return n}return e}function Ne(e){return e.trim().length>0}function He(e,n,t,o,r){if(Be.has(e.toLowerCase()))return null;const l=function(e){const n={};for(const[t,o]of Object.entries(e)){const e=t.toLowerCase();be.has(e)||Te.has(e)&&o&&Se(o)||(n[t]=o)}return n}(n),i=l.key,c=null!=i&&""!==i?i:r;if(je(e,o)){const n=o[e]||o[e.toLowerCase()],r=function(e){const n={};for(const[t,o]of Object.entries(e))n[t]=$e(o,t);return n}(l);return C(n,s(a({},r),{key:c}),t.length>0?t:void 0)}return C(e,s(a({},l),{innerHTML:void 0,key:c}),t.length>0?t:void 0)}function Re(e,n){if(!e||!e.includes("<"))return!1;if(!n||0===Object.keys(n).length)return!1;let t;for(Ce.lastIndex=0;null!==(t=Ce.exec(e));)if(je(t[1],n))return!0;return!1}function Ae(e,n){if(!e)return[];try{const t=function(e,n){let t=0;const o=[],r=[];for(const l of e)if("text"===l.type)(o.length>0?o[o.length-1].children:r).push(l.content);else if("self_closing"===l.type){const e=He(l.tagName,l.attrs||{},[],n,"ms-html-"+t++),i=o.length>0?o[o.length-1].children:r;null!=e&&i.push(e)}else if("tag_open"===l.type)o.push({tagName:l.tagName,children:[],attrs:l.attrs,autoKey:"ms-html-"+t++});else if("tag_close"===l.type){const e=l.tagName.toLowerCase();let t=-1;for(let n=o.length-1;n>=0;n--)if(o[n].tagName.toLowerCase()===e){t=n;break}if(-1!==t)for(;o.length>t;){const l=o.pop(),i=He(l.tagName,l.attrs||{},l.children,n,l.autoKey);o.length>0?null!=i&&o[o.length-1].children.push(i):null!=i&&r.push(i),l.tagName.toLowerCase()!==e&&o.length>t&&Ie(`Auto-closing unclosed tag: <${l.tagName}>`)}else Ie(`Ignoring closing tag with no matching opening tag: </${l.tagName}>`)}for(;o.length>0;){const e=o.pop(),t=He(e.tagName,e.attrs||{},e.children,n,e.autoKey);o.length>0?null!=t&&o[o.length-1].children.push(t):null!=t&&r.push(t),Ie(`Auto-closing unclosed tag: <${e.tagName}>`)}return r}(function(e){var n,t,o;const r=[];let l=0;for(;l<e.length;){if(e.startsWith("\x3c!--",l)){const n=e.indexOf("--\x3e",l);if(-1!==n){l=n+3;continue}break}const i=e.indexOf("<",l);if(-1===i){if(l<e.length){const n=e.slice(l);Ne(n)&&r.push({type:"text",content:n})}break}if(i>l){const n=e.slice(l,i);Ne(n)&&r.push({type:"text",content:n})}if(e.startsWith("![CDATA[",i+1)){const n=e.indexOf("]]>",i);if(-1!==n){r.push({type:"text",content:e.slice(i,n+3)}),l=n+3;continue}break}if(e.startsWith("!",i+1)){const n=e.indexOf(">",i);if(-1!==n){l=n+1;continue}break}const a=e.indexOf(">",i);if(-1===a)break;const s=e.slice(i+1,a).trim(),c=s.startsWith("/"),d=s.endsWith("/");if(c){const e=s.slice(1).trim();r.push({type:"tag_close",tagName:e})}else{const e=s.indexOf(" ");let l,i="";-1===e?l=d?s.slice(0,-1).trim():s.trim():(l=s.slice(0,e).trim(),i=s.slice(e+1));const a={};if(i){const e=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let r;for(;null!==(r=e.exec(i));){const e=r[1],l=null!=(o=null!=(t=null!=(n=r[2])?n:r[3])?t:r[4])?o:"";e&&!e.endsWith("/")&&(a[e]=l)}}r.push({type:d||Me.has(l.toLowerCase())?"self_closing":"tag_open",tagName:l,attrs:a})}l=a+1}return r}(e),n);return t}catch(o){return t=o,Le&&console.error("Failed to parse HTML to VNodes:",t),null}var t}const De=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"HtmlInlineNode",props:{node:{},customId:{}},setup(e){const n=e,t=B(()=>(pe.value,ve(n.customId))),o=p({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=B(()=>{const e=n.node.content;if(!e)return{mode:"html",content:""};if(n.node.loading&&n.node.autoClosed){const n=Ae(e,t.value);if(null!==n)return{mode:"dynamic",nodes:n}}if(!Re(e,t.value))return{mode:"html",content:e};const o=Ae(e,t.value);return null===o?{mode:"html",content:e}:{mode:"dynamic",nodes:o}}),l=T(null),i="undefined"!=typeof window,a=T({mode:"",content:"",el:null});let s=null;function c(e,n){if(!i||!l.value)return;const t=l.value,o=a.value;if(o.el!==t||o.mode!==e||o.content!==n){if("text"===e)t.textContent=n;else{const e=(!s&&i&&(s=document.createElement("template")),s);if(e){e.innerHTML=n;const o=e.content.cloneNode(!0);"function"==typeof t.replaceChildren?t.replaceChildren(o):(t.innerHTML="",t.appendChild(o))}else t.innerHTML=n}a.value={mode:e,content:n,el:t}}}function d(){c("html",n.node.content)}function u(){c("text",n.node.content)}return L(()=>[n.node.content,n.node.loading,n.node.autoClosed,r.value.mode],()=>{"html"===r.value.mode&&(n.node.loading&&!n.node.autoClosed?u():d())}),I(()=>{"html"===r.value.mode&&(n.node.loading&&!n.node.autoClosed?u():d())}),S(()=>{l.value&&(l.value.innerHTML="",a.value={mode:"",content:"",el:null})}),(e,t)=>"dynamic"===r.value.mode?(v(),f("span",{key:0,class:E(["html-inline-node",{"html-inline-node--loading":n.node.loading}])},[w(y(o),{nodes:r.value.nodes},null,8,["nodes"])],2)):(v(),f("span",{key:1,ref_key:"containerRef",ref:l,class:E(["html-inline-node",{"html-inline-node--loading":n.node.loading}])},null,2))}}),[["__scopeId","data-v-4add5e85"]]);De.install=e=>{e.component(De.__name,De)};const Oe={class:"inline text-[85%] px-1 py-0.5 rounded font-mono bg-[hsl(var(--secondary))] whitespace-normal break-words max-w-full before:content-[''] after:content-['']"},ze=/* @__PURE__ */p({__name:"InlineCodeNode",props:{node:{}},setup:e=>(n,t)=>(v(),f("code",Oe,M(e.node.code),1))});ze.install=e=>{e.component(ze.__name,ze)};const Pe=T(!1),Ve=T(""),We=T("top"),Ke=T(null),Fe=T(null),Ue=T(null),Xe=T(null),qe=T(null);let Ge=null,Ze=null;function Ye(){Ge&&(clearTimeout(Ge),Ge=null),Ze&&(clearTimeout(Ze),Ze=null)}let Je=!1,Qe=null;function en(e,n,t="top",o=!1,r,l){if(!e)return;Je||"undefined"!=typeof document&&(Qe||(Qe=Promise.resolve().then(()=>ll).then(({default:e})=>{Je=!0;const n=document.createElement("div");n.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(n),j({setup:()=>()=>{var n;return C(e,{visible:Pe.value,"anchor-el":Ke.value,content:Ve.value,placement:We.value,id:Fe.value,originX:Ue.value,originY:Xe.value,isDark:null!=(n=qe.value)?n:void 0})}}).mount(n)}).catch(e=>{Qe=null,Je=!1,console.warn("[markstream-vue] Failed to load Tooltip component. Tooltips will be disabled.",e)}))),Ye();const i=()=>{var o,i;Fe.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Ke.value=e,Ve.value=n,We.value=t,Ue.value=null!=(o=null==r?void 0:r.x)?o:null,Xe.value=null!=(i=null==r?void 0:r.y)?i:null,qe.value="boolean"==typeof l?l:null,Pe.value=!0;try{e.setAttribute("aria-describedby",Fe.value)}catch(a){}};o?i():Ge=setTimeout(i,80)}function nn(e=!1){Ye();const n=()=>{if(Ke.value&&Fe.value)try{Ke.value.removeAttribute("aria-describedby")}catch(e){}Pe.value=!1,Ke.value=null,Fe.value=null,Ue.value=null,Xe.value=null};e?n():Ze=setTimeout(n,120)}const tn={"common.copy":"Copy","common.copySuccess":"Copied","common.decrease":"Decrease","common.reset":"Reset","common.increase":"Increase","common.expand":"Expand","common.collapse":"Collapse","common.preview":"Preview","common.source":"Source","common.export":"Export","common.open":"Open","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."};function on(e){Object.assign(tn,e)}function rn(){try{const n=globalThis.$vueI18nUse||null;if(n&&"function"==typeof n)try{const e=n();if(e&&"function"==typeof e.t)return{t:e.t.bind(e)}}catch(e){}}catch(e){}return d(null,null,function*(){try{const n=yield import("vue-i18n"),t=n.useI18n||n.default&&n.default.useI18n;if(t&&"function"==typeof t)try{const n=t();if(n&&"function"==typeof n.t)try{globalThis.$vueI18nUse=()=>n}catch(e){}}catch(e){}}catch(e){}}),{t:e=>{var n;return null!=(n=tn[e])?n:function(e){return(e.split(".").pop()||e).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,e=>e.toUpperCase()).trim()}(e)}}}const ln=/* @__PURE__ */Symbol("ViewportPriority");function an(){const e=$(ln,void 0);if(e)return e;const n=/* @__PURE__ */new WeakMap;let t=null;return e=>{const o=T(!1);let r,l=!1;const i=new Promise(e=>{r=()=>{l||(l=!0,e())}}),a=()=>{try{null==t||t.unobserve(e)}catch(o){}n.delete(e)},s=t||("undefined"==typeof window||"undefined"==typeof IntersectionObserver?null:(t=new IntersectionObserver(e=>{for(const r of e){const e=n.get(r.target);if(e&&(r.isIntersecting||r.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(o){}}null==t||t.unobserve(r.target),n.delete(r.target)}}},{root:null,rootMargin:"300px",threshold:0}),t));return s?(n.set(e,{resolve:r,visible:o}),s.observe(e),{isVisible:o,whenVisible:i,destroy:a}):(o.value=!0,r(),{isVisible:o,whenVisible:i,destroy:a})}}const sn={class:"relative inline-block"},cn=["src","alt","title","loading","tabindex","aria-label"],dn={class:"text-sm whitespace-nowrap"},un={key:1,class:"text-sm text-gray-500"},mn={key:"error",class:"px-4 py-2 bg-gray-100 flex items-center justify-center rounded-lg gap-2 text-red-500"},hn={class:"text-sm whitespace-nowrap"},pn={key:0,class:"mt-2 text-sm text-gray-500 italic"},fn=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},showCaption:{type:Boolean,default:!1},lazy:{type:Boolean,default:!0},svgMinHeight:{default:"12rem"},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:n}){const t=e,o=n,r=T(!1),l=T(!1),i=T(!1),a=T(null),s=an(),c=T(null),d=T("undefined"==typeof window);"undefined"!=typeof window&&L(()=>a.value,e=>{var n;if(null==(n=c.value)||n.destroy(),c.value=null,!e)return void(d.value=!1);const t=s(e,{rootMargin:"400px"});c.value=t,d.value=t.isVisible.value,t.whenVisible.then(()=>{d.value=!0})},{immediate:!0}),S(()=>{var e;null==(e=c.value)||e.destroy(),c.value=null});const u=B(()=>l.value&&t.fallbackSrc?t.fallbackSrc:t.node.src),m=B(()=>!t.lazy||d.value),h=B(()=>/\.svg(?:\?|$)/i.test(u.value));function p(){t.fallbackSrc&&!i.value?(i.value=!0,l.value=!0):(l.value=!0,o("error",t.node.src))}function g(){r.value=!0,l.value=!1,o("load",u.value)}function x(e){e.preventDefault(),r.value&&!l.value&&o("click",[e,u.value])}const{t:b}=rn();return L(u,()=>{r.value=!1,l.value=!1}),(n,o)=>(v(),f("figure",{ref_key:"figureRef",ref:a,class:"text-center my-8"},[k("div",sn,[w(R,{name:"img-switch",mode:"out-in"},{default:A(()=>{var i,a,s,c,d;return[e.node.loading||l.value||!m.value?l.value?e.node.loading||t.fallbackSrc?H("",!0):(v(),f("div",mn,[O(n.$slots,"error",{node:t.node,displaySrc:u.value,imageLoaded:r.value,hasError:l.value,fallbackSrc:t.fallbackSrc,lazy:t.lazy,isSvg:h.value},()=>[o[1]||(o[1]=k("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[k("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),k("span",hn,M(y(b)("image.loadError")),1)],!0)])):(v(),f("div",{key:"placeholder",class:"placeholder-layer max-w-96 inline-flex items-center justify-center gap-2",style:D(h.value?{minHeight:t.svgMinHeight,width:"100%"}:{minHeight:"6rem"})},[t.usePlaceholder?O(n.$slots,"placeholder",{key:0,node:t.node,displaySrc:u.value,imageLoaded:r.value,hasError:l.value,fallbackSrc:t.fallbackSrc,lazy:t.lazy,isSvg:h.value},()=>[o[0]||(o[0]=k("div",{class:"w-4 h-4 rounded-full border-2 border-solid border-current border-t-transparent animate-spin","aria-hidden":"true"},null,-1)),k("span",dn,M(y(b)("image.loading")),1)],!0):(v(),f("span",un,M(e.node.raw),1))],4)):(v(),f("img",{key:"image",src:u.value,alt:String(null!=(a=null!=(i=t.node.alt)?i:t.node.title)?a:""),title:String(null!=(c=null!=(s=t.node.title)?s:t.node.alt)?c:""),class:E(["max-w-96 h-auto rounded-lg transition-opacity duration-200 ease-in-out",{"opacity-0":!r.value,"opacity-100":r.value,"cursor-pointer":r.value}]),style:D(h.value?{minHeight:t.svgMinHeight,width:"100%",height:"auto",objectFit:"contain"}:void 0),loading:t.lazy?"lazy":"eager",decoding:"async",tabindex:r.value?0:-1,"aria-label":null!=(d=t.node.alt)?d:y(b)("image.preview"),onError:p,onLoad:g,onClick:x},null,46,cn))]}),_:3})]),t.showCaption&&t.node.alt?(v(),f("figcaption",pn,M(t.node.alt),1)):H("",!0)],512))}}),[["__scopeId","data-v-7ca79b66"]]);fn.install=e=>{e.component(fn.__name,fn)};let vn=null,gn=!1,wn=xn;function yn(e){var n;const t=null!=(n=null==e?void 0:e.default)?n:e;return t&&"function"==typeof t.renderToString?t:null}function kn(){try{const e=globalThis;return yn(null==e?void 0:e.katex)}catch(e){return null}}function xn(){return d(null,null,function*(){const e=kn();if(e)return e;const n=yield import("katex");try{yield import("katex/dist/contrib/mhchem")}catch(t){}return yn(n)})}function bn(e){wn=e,vn=null,gn=!1}function Mn(e){bn(null!=e?e:xn)}function _n(){bn(null)}function Cn(){return"function"==typeof wn}function Bn(){return d(this,null,function*(){var e;const n=kn();if(n)return vn=n,vn;if(vn)return vn;if(gn)return null;const t=wn;if(!t)return gn=!0,null;try{const n=yield t();if(n)return vn=null!=(e=yn(n))?e:n,vn}catch(o){}return gn=!0,null})}const Tn=_(!1);let Ln=null;function In(){return Ln||(Ln=Bn().then(e=>{Tn.value=!!e}).catch(()=>{Tn.value=!1})),z(Tn)}const Sn=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const n=In();return(t,o)=>(v(),f("span",{class:E([[y(n)&&e.node.center?"text-node-center":""],"whitespace-pre-wrap break-words text-node"])},M(e.node.content),3))}}),[["__scopeId","data-v-56f30838"]]);Sn.install=e=>{e.component(Sn.__name,Sn)};const En=P(()=>d(null,null,function*(){var e,n;if("undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(n=null==(e=globalThis.process)?void 0:e.env)?void 0:n.NODE_ENV))return e=>{var n,t;return C(Sn,s(a({},e),{node:s(a({},e.node),{content:null!=(t=e.node.raw)?t:`$${null!=(n=e.node.content)?n:""}$`})}))};try{if(yield Bn())return(yield import("./index2.js")).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return e=>{var n,t;return C(Sn,s(a({},e),{node:s(a({},e.node),{content:null!=(t=e.node.raw)?t:`$${null!=(n=e.node.content)?n:""}$`})}))}})),jn=P(()=>d(null,null,function*(){try{if(yield Bn())return(yield import("./index3.js")).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var n,t;return C(Sn,s(a({},e),{node:s(a({},e.node),{content:null!=(t=e.node.raw)?t:`$$${null!=(n=e.node.content)?n:""}$$`})}))}})),$n=/* @__PURE__ */p({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(n,t)=>(v(),f("span",{class:"reference-node cursor-pointer bg-[hsl(var(--muted))] text-xs rounded-md px-1.5 mx-0.5 hover:bg-[hsl(var(--secondary))]",role:"button",tabindex:"0",onClick:t[0]||(t[0]=t=>n.$emit("click",t,e.node.id,e.messageId,e.threadId)),onMouseenter:t[1]||(t[1]=t=>n.$emit("mouseEnter",t,e.node.id,e.messageId,e.threadId)),onMouseleave:t[2]||(t[2]=t=>n.$emit("mouseLeave",t,e.node.id,e.messageId,e.threadId))},M(e.node.id),33))});$n.install=e=>{e.component($n.__name,$n)};const Nn={class:"superscript-node"},Hn={key:1},Rn=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ve(n.customId),o=a({text:Sn,inline_code:ze,link:Gn,html_inline:De,strong:Pn,emphasis:nt,footnote_reference:xe,strikethrough:Wn,highlight:Qn,insert:Yn,subscript:On,emoji:de,math_inline:En,reference:$n},t);return(t,r)=>(v(),f("sup",Nn,[(v(!0),f(x,null,b(e.node.children,(t,r)=>(v(),f(x,{key:`${e.indexKey||"superscript"}-${r}`},[o[t.type]?(v(),V(W(o[t.type]),{key:0,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"superscript"}-${r}`},null,8,["node","custom-id","index-key"])):(v(),f("span",Hn,M(t.content||t.raw),1))],64))),128))]))}}),[["__scopeId","data-v-6dc1e3ba"]]);Rn.install=e=>{e.component(Rn.__name,Rn)};const An={class:"subscript-node"},Dn={key:1},On=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ve(n.customId),o=a({text:Sn,inline_code:ze,link:Gn,html_inline:De,strong:Pn,emphasis:nt,footnote_reference:xe,strikethrough:Wn,highlight:Qn,insert:Yn,superscript:Rn,emoji:de,math_inline:En,reference:$n},t);return(t,r)=>(v(),f("sub",An,[(v(!0),f(x,null,b(e.node.children,(t,r)=>(v(),f(x,{key:`${e.indexKey||"subscript"}-${r}`},[o[t.type]?(v(),V(W(o[t.type]),{key:0,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"subscript"}-${r}`},null,8,["node","custom-id","index-key"])):(v(),f("span",Dn,M(t.content||t.raw),1))],64))),128))]))}}),[["__scopeId","data-v-69de9b81"]]);On.install=e=>{e.component(On.__name,On)};const zn={class:"strong-node"},Pn=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ve(n.customId),o=a({text:Sn,inline_code:ze,link:Gn,html_inline:De,emphasis:nt,strikethrough:Wn,highlight:Qn,insert:Yn,subscript:On,superscript:Rn,emoji:de,footnote_reference:xe,math_inline:En,reference:$n},t);return(t,r)=>(v(),f("strong",zn,[(v(!0),f(x,null,b(e.node.children,(t,r)=>(v(),V(W(o[t.type]),{key:`${e.indexKey||"strong"}-${r}`,"index-key":`${e.indexKey||"strong"}-${r}`,node:t,"custom-id":n.customId},null,8,["index-key","node","custom-id"]))),128))]))}}),[["__scopeId","data-v-af3ce037"]]);Pn.install=e=>{e.component(Pn.__name,Pn)};const Vn={class:"strikethrough-node"},Wn=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ve(n.customId),o=a({text:Sn,inline_code:ze,link:Gn,html_inline:De,strong:Pn,emphasis:nt,highlight:Qn,insert:Yn,subscript:On,superscript:Rn,emoji:de,footnote_reference:xe,math_inline:En,reference:$n},t);return(t,r)=>(v(),f("del",Vn,[(v(!0),f(x,null,b(e.node.children,(t,r)=>(v(),V(W(o[t.type]),{key:`${e.indexKey||"strikethrough"}-${r}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"strikethrough"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-904d5bd1"]]);Wn.install=e=>{e.component(Wn.__name,Wn)};const Kn=["href","title","aria-label","aria-hidden"],Fn=["aria-hidden"],Un={class:"link-text-wrapper relative inline-flex"},Xn={class:"leading-[normal] link-text"},qn={class:"leading-[normal] link-text"},Gn=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const n=e,t=B(()=>{var e,t,o,r,l,i;const a=void 0!==n.underlineBottom?"number"==typeof n.underlineBottom?`${n.underlineBottom}px`:String(n.underlineBottom):"-3px";return{"--link-color":null!=(e=n.color)?e:"#0366d6","--underline-height":`${null!=(t=n.underlineHeight)?t:2}px`,"--underline-bottom":a,"--underline-opacity":String(null!=(o=n.animationOpacity)?o:.9),"--underline-duration":`${null!=(r=n.animationDuration)?r:.8}s`,"--underline-timing":null!=(l=n.animationTiming)?l:"linear","--underline-iteration":"number"==typeof n.animationIteration?String(n.animationIteration):null!=(i=n.animationIteration)?i:"infinite"}}),o={text:Sn,strong:Pn,strikethrough:Wn,emphasis:nt,image:fn,html_inline:De,inline_code:ze},r=B(()=>(pe.value,ve(n.customId))),l=K();function i(){n.showTooltip&&nn()}const a=B(()=>{var e,t;return String(null!=(t=null!=(e=n.node.title)?e:n.node.href)?t:"")});return(s,c)=>e.node.loading?(v(),f("span",F({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},y(l),{style:t.value}),[k("span",Un,[k("span",Xn,[k("span",qn,M(e.node.text),1)]),c[1]||(c[1]=k("span",{class:"underline-anim","aria-hidden":"true"},null,-1))])],16,Fn)):(v(),f("a",F({key:0,class:"link-node",href:e.node.href,title:e.showTooltip?"":a.value,"aria-label":`Link: ${a.value}`,"aria-hidden":e.node.loading?"true":"false",target:"_blank",rel:"noopener noreferrer"},y(l),{style:t.value,onMouseenter:c[0]||(c[0]=e=>function(e){var t,o,r;if(!n.showTooltip)return;const l=e,i=null!=(null==l?void 0:l.clientX)&&null!=(null==l?void 0:l.clientY)?{x:l.clientX,y:l.clientY}:void 0,a=(null==(t=n.node)?void 0:t.title)||(null==(o=n.node)?void 0:o.href)||(null==(r=n.node)?void 0:r.text)||"";en(e.currentTarget,a,"top",!1,i)}(e)),onMouseleave:i}),[(v(!0),f(x,null,b(e.node.children,(t,l)=>(v(),V(W(function(e){return r.value[e.type]||o[e.type]||null}(t)),{key:`${e.indexKey||"emphasis"}-${l}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"link-text"}-${l}`},null,8,["node","custom-id","index-key"]))),128))],16,Kn))}}),[["__scopeId","data-v-2ccf6f70"]]);Gn.install=e=>{e.component(Gn.__name,Gn)};const Zn={class:"insert-node"},Yn=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ve(n.customId),o=a({text:Sn,inline_code:ze,link:Gn,html_inline:De,strong:Pn,emphasis:nt,strikethrough:Wn,highlight:Qn,subscript:On,superscript:Rn,emoji:de,footnote_reference:xe,math_inline:En,reference:$n},t);return(t,r)=>(v(),f("ins",Zn,[(v(!0),f(x,null,b(e.node.children,(t,r)=>(v(),V(W(o[t.type]),{key:`${e.indexKey||"insert"}-${r}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"insert"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-ab1ec9bc"]]);Yn.install=e=>{e.component(Yn.__name,Yn)};const Jn={class:"highlight-node"},Qn=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ve(n.customId),o=a({text:Sn,inline_code:ze,link:Gn,html_inline:De,strong:Pn,emphasis:nt,strikethrough:Wn,insert:Yn,subscript:On,superscript:Rn,emoji:de,footnote_reference:xe,math_inline:En,reference:$n},t);return(t,r)=>(v(),f("mark",Jn,[(v(!0),f(x,null,b(e.node.children,(t,r)=>(v(),V(W(o[t.type]),{key:`${e.indexKey||"highlight"}-${r}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"highlight"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-38e31bf6"]]);Qn.install=e=>{e.component(Qn.__name,Qn)};const et={class:"emphasis-node"},nt=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ve(n.customId),o=a({text:Sn,inline_code:ze,link:Gn,html_inline:De,strong:Pn,strikethrough:Wn,highlight:Qn,insert:Yn,subscript:On,superscript:Rn,emoji:de,footnote_reference:xe,math_inline:En,reference:$n},t);return(t,r)=>(v(),f("em",et,[(v(!0),f(x,null,b(e.node.children,(t,r)=>(v(),V(W(o[t.type]),{key:`${e.indexKey||"emphasis"}-${r}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"emphasis"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-8264674d"]]);nt.install=e=>{e.component(nt.__name,nt)};const tt=["href","title"],ot=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const n=e;function t(e){var t;if(e.preventDefault(),"undefined"==typeof document)return;const o=`fnref-${String(null!=(t=n.node.id)?t:"")}`,r=document.getElementById(o);r&&r.scrollIntoView({behavior:"smooth"})}return(n,o)=>(v(),f("a",{class:"footnote-anchor text-sm text-[#0366d6] hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:t}," ↩︎ ",8,tt))}}),[["__scopeId","data-v-4756ce0d"]]);ot.install=e=>{e.component(ot.__name,ot)};const rt=["id"],lt={class:"flex-1"},it=/* @__PURE__ */p({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e;return(t,o)=>(v(),f("div",{id:`fnref--${e.node.id}`,class:"flex mt-2 mb-2 text-sm leading-relaxed border-t border-[#eaecef] pt-2"},[k("div",lt,[g([n.node.children],()=>w(y(Nt),{"index-key":`footnote-${n.indexKey}`,nodes:n.node.children,"custom-id":n.customId,typewriter:n.typewriter,onCopy:o[0]||(o[0]=e=>t.$emit("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"]),o,1)])],8,rt))}});it.install=e=>{e.component(it.__name,it)};const at={class:"hard-break"},st=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"HardBreakNode",props:{node:{}},setup:e=>(e,n)=>(v(),f("br",at))}),[["__scopeId","data-v-50c58f70"]]);st.install=e=>{e.component(st.__name,st)};const ct=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ve(n.customId),o=a({text:Sn,inline_code:ze,link:Gn,image:fn,strong:Pn,emphasis:nt,strikethrough:Wn,highlight:Qn,insert:Yn,subscript:On,superscript:Rn,emoji:de,checkbox:re,checkbox_input:re,footnote_reference:xe,hardbreak:st,math_inline:En,reference:$n},t);return(t,r)=>g([e.node.level,e.node.children,e.node.attrs],()=>(v(),V(W(`h${e.node.level}`),F({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:A(()=>[(v(!0),f(x,null,b(e.node.children,(t,r,l,i)=>{const a=[t];if(i&&i.key===`${e.indexKey||"heading"}-${r}`&&U(i,a))return i;const s=(v(),V(W(o[t.type]),{key:`${e.indexKey||"heading"}-${r}`,"custom-id":n.customId,node:t,"index-key":`${e.indexKey||"heading"}-${r}`},null,8,["custom-id","node","index-key"]));return s.memo=a,s},r,0),128))]),_:1},16,["class"])),r,2)}}),[["__scopeId","data-v-af2f957a"]]),dt=ct;dt.install=e=>{e.component(ct.__name,ct)};const ut=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},value:{},customId:{},typewriter:{type:Boolean}},emits:["copy"],setup(e){const n=e,t=B(()=>{var e;return null!=(e=n.node)?e:n.item}),o=B(()=>null==n.value?{}:{value:n.value});return(e,r)=>{var l;return v(),f("li",F({class:"list-item pl-1.5 my-2",dir:"auto"},o.value),[g([null==(l=t.value)?void 0:l.children],()=>{var o,l;return w(y(Nt),{"index-key":`list-item-${n.indexKey}`,nodes:null!=(l=null==(o=t.value)?void 0:o.children)?l:[],"custom-id":n.customId,typewriter:n.typewriter,"batch-rendering":!1,onCopy:r[0]||(r[0]=n=>e.$emit("copy",n))},null,8,["index-key","nodes","custom-id","typewriter"])},r,1)],16)}}}),[["__scopeId","data-v-31a88b1f"]]);ut.install=e=>{e.component(ut.__name,ut)};const mt=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean}},emits:["copy"],setup(e){const n=B(()=>(pe.value,ve(e.customId).list_item||ut));return(t,o)=>(v(),V(W(e.node.ordered?"ol":"ul"),{class:E(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:A(()=>[(v(!0),f(x,null,b(e.node.items,(r,l,i,a)=>{var s;const c=[r];if(a&&a.key===`${e.indexKey||"list"}-${l}`&&U(a,c))return a;const d=(v(),V(W(n.value),{key:`${e.indexKey||"list"}-${l}`,node:r,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${l}`,typewriter:e.typewriter,value:e.node.ordered?(null!=(s=e.node.start)?s:1)+l:void 0,onCopy:o[0]||(o[0]=e=>t.$emit("copy",e))},null,40,["node","custom-id","index-key","typewriter","value"]));return d.memo=c,d},o,1),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-01209c2b"]]);mt.install=e=>{e.component(mt.__name,mt)};const ht={key:1,class:"html-block-node__raw"},pt={key:1,class:"html-block-node__placeholder"},ft=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"HtmlBlockNode",props:{node:{},customId:{}},setup(e){const n=e,t=B(()=>{const e=n.node.attrs;if(e){if(Array.isArray(e)){const n={};for(const t of e){if(!t||t.length<2)continue;const[e,o]=t;null!=e&&(n[String(e)]=null==o?"":String(o))}return n}return e}}),o=B(()=>(pe.value,ve(n.customId))),r=p({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),l=T(null),i=T("undefined"==typeof window),a=T(n.node.content),s=B(()=>{var e,t,r;if(!i.value)return{mode:"html",content:null!=(e=a.value)?e:""};const l=null!=(t=a.value)?t:n.node.content;if(!l)return{mode:"html",content:""};if(n.node.loading){const e=Ae(l,o.value);return null===e?{mode:"text",content:null!=(r=n.node.raw)?r:l}:{mode:"dynamic",nodes:e}}if(!Re(l,o.value))return{mode:"html",content:l};const s=Ae(l,o.value);return null===s?{mode:"html",content:l}:{mode:"dynamic",nodes:s}}),c=an(),d=T(null),u=!!n.node.loading;return"undefined"!=typeof window?(L(l,e=>{var t,o;if(null==(o=null==(t=d.value)?void 0:t.destroy)||o.call(t),d.value=null,!u)return i.value=!0,void(a.value=n.node.content);if(!e)return void(i.value=!1);const r=c(e,{rootMargin:"400px"});d.value=r,i.value=r.isVisible.value,r.whenVisible.then(()=>{i.value=!0})},{immediate:!0}),L(()=>n.node.content,e=>{u&&!i.value||(a.value=e)})):i.value=!0,S(()=>{var e,n;null==(n=null==(e=d.value)?void 0:e.destroy)||n.call(e),d.value=null}),(n,o)=>(v(),f("div",F({ref_key:"htmlRef",ref:l,class:"html-block-node"},t.value),[i.value?(v(),f(x,{key:0},["dynamic"===s.value.mode?(v(),V(y(r),{key:0,nodes:s.value.nodes},null,8,["nodes"])):"text"===s.value.mode?(v(),f("pre",ht,M(s.value.content),1)):g([a.value],()=>(v(),f("div",{key:2,innerHTML:a.value},null,8,["innerHTML"])),o,0)],64)):(v(),f("div",pt,[O(n.$slots,"placeholder",{node:e.node},()=>[o[1]||(o[1]=k("span",{class:"html-block-node__placeholder-bar"},null,-1)),o[2]||(o[2]=k("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),o[3]||(o[3]=k("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))],16))}}),[["__scopeId","data-v-6797fa3c"]]);ft.install=e=>{e.component(ft.__name,ft)};const vt={dir:"auto",class:"paragraph-node"},gt=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ve(n.customId),o=a({inline_code:ze,image:fn,link:Gn,hardbreak:st,emphasis:nt,strong:Pn,strikethrough:Wn,highlight:Qn,insert:Yn,subscript:On,superscript:Rn,html_inline:De,html_block:ft,emoji:de,checkbox:re,math_inline:En,checkbox_input:re,reference:$n,footnote_anchor:ot,footnote_reference:xe},t),r=In();return(t,l)=>(v(),f("p",vt,[(v(!0),f(x,null,b(e.node.children,(t,l)=>(v(),f(x,{key:`${e.indexKey||"paragraph"}-${l}`},["text"!==t.type?(v(),V(W(o[t.type]),{key:0,node:t,"index-key":`${e.indexKey}-${l}`,"custom-id":n.customId},null,8,["node","index-key","custom-id"])):(v(),f("span",{key:1,class:E([[y(r)&&t.center?"text-node-center":""],"whitespace-pre-wrap break-words text-node"])},M(t.content),3))],64))),128))]))}}),[["__scopeId","data-v-4e2afdbc"]]);gt.install=e=>{e.component(gt.__name,gt)};const wt=["aria-busy","aria-label","data-language"],yt=["textContent"],kt=/* @__PURE__ */p({__name:"PreCodeNode",props:{node:{}},setup(e){const n=e,t=B(()=>{var e,t,o;const r=String(null!=(t=null==(e=n.node)?void 0:e.language)?t:"");return String(null!=(o=String(r).split(/\s+/g)[0])?o:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=B(()=>`language-${t.value}`),r=B(()=>{const e=t.value;return e?`Code block: ${e}`:"Code block"});return(n,l)=>(v(),f("pre",{class:E([o.value]),"aria-busy":!0===e.node.loading,"aria-label":r.value,"data-language":t.value,tabindex:"0"},[k("code",{translate:"no",textContent:M(e.node.code)},null,8,yt)],10,wt))}});kt.install=e=>{e.component(kt.__name,kt)};const xt={class:"table-node-wrapper"},bt=["aria-busy"],Mt={class:"border-[var(--table-border,#cbd5e1)]"},_t={class:"border-b"},Ct={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Bt=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e,t=B(()=>{var e;return null!=(e=n.node.loading)&&e}),o=B(()=>{var e;return null!=(e=n.node.rows)?e:[]});return(r,l)=>(v(),f("div",xt,[k("table",{class:E(["my-8 text-sm table-node",{"table-node--loading":t.value}]),"aria-busy":t.value},[k("thead",Mt,[k("tr",_t,[(v(!0),f(x,null,b(e.node.header.cells,(e,t)=>(v(),f("th",{key:`header-${t}`,dir:"auto",class:E(["font-semibold p-[calc(4/7*1em)]",["right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"]])},[w(y(Nt),{nodes:e.children,"index-key":`table-th-${n.indexKey}`,"custom-id":n.customId,typewriter:n.typewriter,onCopy:l[0]||(l[0]=e=>r.$emit("copy",e))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))])]),k("tbody",null,[(v(!0),f(x,null,b(o.value,(e,t)=>(v(),f("tr",{key:`row-${t}`,class:E(["border-[var(--table-border,#cbd5e1)]",[t<o.value.length-1?"border-b":""]])},[(v(!0),f(x,null,b(e.cells,(e,o)=>(v(),f("td",{key:`cell-${t}-${o}`,class:E(["p-[calc(4/7*1em)]",["right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"]]),dir:"auto"},[w(y(Nt),{nodes:e.children,"index-key":`table-td-${n.indexKey}`,"custom-id":n.customId,typewriter:n.typewriter,onCopy:l[1]||(l[1]=e=>r.$emit("copy",e))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))],2))),128))])],10,bt),w(R,{name:"table-node-fade"},{default:A(()=>[t.value?(v(),f("div",Ct,[O(r.$slots,"loading",{isLoading:t.value},()=>[l[2]||(l[2]=k("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),l[3]||(l[3]=k("span",{class:"sr-only"},"Loading",-1))],!0)])):H("",!0)]),_:3})]))}}),[["__scopeId","data-v-369096fa"]]);Bt.install=e=>{e.component(Bt.__name,Bt)};const Tt={class:"hr-node"},Lt=/* @__PURE__ */ee({},[["render",function(e,n){return v(),f("hr",Tt)}],["__scopeId","data-v-639cbad9"]]);Lt.install=e=>{e.component(Lt.__name,Lt)};const It={class:"unknown-node"},St=/* @__PURE__ */p({__name:"FallbackComponent",props:{node:{}},setup:e=>(n,t)=>(v(),f("div",It,M(e.node.raw),1))}),Et=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},setup(e){const n=e,t=B(()=>`vmr-container vmr-container-${n.node.name}`),o=ve(n.customId),r=a({text:Sn,paragraph:gt,heading:dt,inline_code:ze,link:Gn,image:fn,strong:Pn,emphasis:nt,strikethrough:Wn,insert:Yn,subscript:On,superscript:Rn,checkbox:re,checkbox_input:re,hardbreak:st,math_inline:En,reference:$n,list:mt,math_block:jn,table:Bt},o);return(o,l)=>(v(),f("div",F({class:t.value},e.node.attrs),[(v(!0),f(x,null,b(e.node.children,(t,o,l,i)=>{const a=[t];if(i&&i.key===`${e.indexKey||"vmr-container"}-${o}`&&U(i,a))return i;const s=(v(),V(W((c=t.type,r[c]||St)),{key:`${e.indexKey||"vmr-container"}-${o}`,"custom-id":n.customId,node:t,"index-key":`${e.indexKey||"vmr-container"}-${o}`},null,8,["custom-id","node","index-key"]));var c;return s.memo=a,s},l,0),128))],16))}}),[["__scopeId","data-v-fac7405d"]]);Et.install=e=>{e.component(Et.__name,Et)};const jt=["data-custom-id"],$t=["data-node-index","data-node-type"],Nt=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},renderCodeBlocksAsPre:{type:Boolean},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},themes:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:Boolean,default:!0},batchRendering:{type:Boolean,default:!0},initialRenderBatchSize:{default:40},renderBatchSize:{default:80},renderBatchDelay:{default:16},renderBatchBudgetMs:{default:6},renderBatchIdleTimeoutMs:{default:120},deferNodesUntilVisible:{type:Boolean,default:!0},maxLiveNodes:{default:320},liveNodeBuffer:{default:60}},emits:["copy","handleArtifactClick","click","mouseover","mouseout"],setup(e,{emit:n}){var t,o,r;const l=e,i=n,c=T(),h=T(!1),p=/auto|scroll|overlay/i,g="undefined"!=typeof window,w=B(()=>l.debugPerformance&&g&&"undefined"!=typeof console);function y(e,n){w.value&&console.info(`[markstream-vue][perf] ${e}`,n)}function k(e){if("undefined"==typeof window)return null;const n=null!=e?e:c.value;if(!n)return null;const t=n.ownerDocument||document,o=t.scrollingElement||t.documentElement;let r=n;for(;r&&r!==t.body&&r!==o;){const e=window.getComputedStyle(r),n=(e.overflowY||"").toLowerCase(),t=(e.overflow||"").toLowerCase();if(p.test(n)||p.test(t))return r;r=r.parentElement}return null}const M=l.customId?`renderer-${l.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,_=u(M),C=/* @__PURE__ */new Map,I=B(()=>{const{key:e,tags:n}=function(e){if(!e||0===e.length)return{key:"",tags:[]};const n=/* @__PURE__ */new Set,t=[];for(const o of e){const e=$(o);e&&!n.has(e)&&(n.add(e),t.push(e))}return 0===t.length?{key:"",tags:[]}:{key:t.join(","),tags:t}}(l.customHtmlTags);if(!e)return _;const t=C.get(e);if(t)return t;const o=u(M,{customHtmlTags:n});return C.set(e,o),o}),j=B(()=>{const e=I.value;return l.customMarkdownIt?l.customMarkdownIt(e):e});function $(e){const n=String(null!=e?e:"").trim();if(!n)return"";const t=n.match(/^[<\s/]*([A-Z][\w-]*)/i);return t?t[1].toLowerCase():""}const O=B(()=>{var e,n,t,o;const r=null!=(e=l.parseOptions)?e:{},i=null!=(n=l.final)?n:r.final,s=[...null!=(t=l.customHtmlTags)?t:[],...null!=(o=r.customHtmlTags)?o:[]].map($).filter(Boolean),c=null!=i,d=s.length>0;return c||d?a(a(a({},r),c?{final:i}:{}),d?{customHtmlTags:Array.from(new Set(s))}:{}):r}),z=B(()=>{var e;if(null==(e=l.nodes)?void 0:e.length)return X(l.nodes.slice());if(l.content){const e=w.value?performance.now():0,n=m(l.content,j.value,O.value);return w.value&&y("parse(sync)",{ms:Math.round(performance.now()-e),nodes:n.length,contentLength:l.content.length}),X(n)}return[]}),K=B(()=>{var e;return Math.max(1,null!=(e=l.maxLiveNodes)?e:320)}),U=B(()=>{var e;return!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&z.value.length>K.value}),Z=B(()=>!1!==l.viewportPriority&&!h.value),Y=function(e,n){const t="undefined"!=typeof window&&"undefined"!=typeof document,o="boolean"==typeof n?T(n):n;let r=null,l=null;const i=/* @__PURE__ */new WeakMap,s=(n,s)=>{const c=T(!1);let d,u=!1;const m=new Promise(e=>{d=()=>{u||(u=!0,e())}}),h=()=>{try{null==r||r.unobserve(n)}catch(e){}i.delete(n)};if(!t||!o.value)return c.value=!0,d(),{isVisible:c,whenVisible:m,destroy:h};!l&&s&&(l=a({},s));const p=function(n){var o,a,s;if(r||!t)return r;if("undefined"==typeof IntersectionObserver)return null;const c=null!=(o=null==e?void 0:e(null!=n?n:null))?o:null,d=l||{};return r=new IntersectionObserver(e=>{for(const t of e){const e=i.get(t.target);if(e&&(t.isIntersecting||t.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(n){}}null==r||r.unobserve(t.target),i.delete(t.target)}}},{root:c,rootMargin:null!=(a=d.rootMargin)?a:"300px",threshold:null!=(s=d.threshold)?s:0}),r}(n);return p?(i.set(n,{resolve:d,visible:c}),p.observe(n),{isVisible:c,whenVisible:m,destroy:h}):(c.value=!0,d(),{isVisible:c,whenVisible:m,destroy:h})};return N(ln,s),s}(e=>{var n;return k(null!=(n=null!=e?e:c.value)?n:null)},Z),J=g&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):null,Q=g&&"function"==typeof window.cancelAnimationFrame?window.cancelAnimationFrame.bind(window):null,ee="undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(o=null==(t=globalThis.process)?void 0:t.env)?void 0:o.NODE_ENV),te=g&&"function"==typeof window.requestIdleCallback,oe=B(()=>{var e;const n=Math.trunc(null!=(e=l.renderBatchSize)?e:80);return Number.isFinite(n)?Math.max(0,n):0}),le=B(()=>{var e;const n=Math.trunc(null!=(e=l.initialRenderBatchSize)?e:oe.value);return Number.isFinite(n)?Math.max(0,n):oe.value}),ie=B(()=>!1!==l.batchRendering&&oe.value>0&&g&&!ee),ae=T(0),ce=T({key:l.indexKey,total:0}),ue=T(Math.max(1,oe.value||1)),me=q({}),he=/* @__PURE__ */new Map,fe=/* @__PURE__ */new Map,ge=/* @__PURE__ */new Map,we=T(0),ye=B(()=>(we.value,Array.from(ge.entries()).sort((e,n)=>e[0]-n[0]))),ke=T(0),be=T([]),Me=T([]),_e=T(null);let Ce=null,Be=null;const Te=B(()=>{var e;return!1!==l.deferNodesUntilVisible&&!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&!U.value&&!(z.value.length>900)&&Z.value}),Le=B(()=>{var e;return ie.value&&(null!=(e=l.maxLiveNodes)?e:0)<=0}),Ie=T({batchSize:oe.value,initial:le.value,delay:null!=(r=l.renderBatchDelay)?r:16,enabled:Le.value}),Se=B(()=>!!Y&&(Te.value||U.value)),Ee=B(()=>{var e;return Math.max(0,null!=(e=l.liveNodeBuffer)?e:60)}),je=T(0),$e=q({start:0,end:0}),Ne=/* @__PURE__ */new Map,He=B(()=>{if(!U.value)return z.value.length;const e=Ee.value,n=Math.max($e.end+e,le.value),t=Math.min(z.value.length,n);return Math.max(ae.value,t)});function Re(e){var n,t,o,r;const l=k(null!=(n=null!=e?e:c.value)?n:null);if(l)return l;const i=null!=(r=null!=(o=null==e?void 0:e.ownerDocument)?o:null==(t=c.value)?void 0:t.ownerDocument)?r:"undefined"!=typeof document?document:null;return(null==i?void 0:i.scrollingElement)||(null==i?void 0:i.documentElement)||null}function Ae(e){if(!g)return!1;try{const n=window.getComputedStyle(e);return!!(n.display||"").toLowerCase().includes("flex")&&(n.flexDirection||"").toLowerCase().endsWith("reverse")}catch(n){return!1}}function Oe(){Ce&&(Ce(),Ce=null),_e.value=null}function Pe(){if(!g||!U.value)return;const e=Re();if(!e||_e.value===e)return;Oe();const n=()=>We();e.addEventListener("scroll",n,{passive:!0}),_e.value=e,Ce=()=>{e.removeEventListener("scroll",n)}}function Ve(){var e,n,t;if(!Be)return;const o=null!=(t=null==(n=null==(e=c.value)?void 0:e.ownerDocument)?void 0:n.defaultView)?t:"undefined"!=typeof window?window:null;Be.viaTimeout?o?o.clearTimeout(Be.id):clearTimeout(Be.id):null==Q||Q(Be.id),Be=null}function We(e={}){var n,t,o;if(!U.value)return;if(!g)return void Ke(!0);if(e.immediate)return Ve(),void Ke(!0);if(Be)return;const r=()=>{Be=null,Ke()};if(J)Be={id:J(r),viaTimeout:!1};else{const e=null!=(o=null==(t=null==(n=c.value)?void 0:n.ownerDocument)?void 0:t.defaultView)?o:"undefined"!=typeof window?window:null,l=e?e.setTimeout(r,16):setTimeout(r,16);Be={id:l,viaTimeout:!0}}}function Ke(e=!1){var n,t,o,r,l,i,a;if(!U.value)return;const s=_e.value||Re();if(!s)return;const d=s.ownerDocument||(null==(n=c.value)?void 0:n.ownerDocument)||document,u=(null==d?void 0:d.defaultView)||("undefined"!=typeof window?window:null),m=s===(null==d?void 0:d.documentElement)||s===(null==d?void 0:d.body),h=z.value.length;if(!m&&h>0&&Ae(s)){const n=s.clientHeight||0,t=s.scrollTop,o=t<0?-t:t,r=function(e){var n;const t=z.value;if(!t.length)return 0;if(e<=0)return Math.max(0,t.length-1);if(ke.value===t.length){const n=Je(0,t.length);return tn(Math.max(0,n-e))}let o=e;for(let r=t.length-1;r>=0;r--){const e=null!=(n=Ue[r])?n:Ye.value;if(o<=e)return r;o-=e}return 0}(Math.max(0,o)+.5*Math.max(0,n)),l=Fe(r,0,Math.max(0,h-1));return void((e||Math.abs(l-je.value)>1)&&(je.value=l))}const p=m?null:s.getBoundingClientRect(),f=m?0:p.top,v=m?null!=(o=null!=(t=null==u?void 0:u.innerHeight)?t:s.clientHeight)?o:0:p.bottom,g=ye.value;let w=null,y=null;for(const[c,x]of g){if(!x)continue;const e=x.getBoundingClientRect();e.bottom<=f||e.top>=v||(null==w&&(w=c),y=c)}if(null==w||null==y){const e=c.value;if(!e)return;const n=m?{top:0}:s.getBoundingClientRect(),t=function(e,n,t){var o,r,l,i,a,s;if(t)return null!=(i=null!=(l=null==(o=null==n?void 0:n.documentElement)?void 0:o.scrollTop)?l:null==(r=null==n?void 0:n.body)?void 0:r.scrollTop)?i:0;const c=e.scrollTop;if(!Ae(e))return c;const d=c<0?-c:c;return Math.max(0,(null!=(a=e.scrollHeight)?a:0)-(null!=(s=e.clientHeight)?s:0))-d}(s,d,m),o=m?(()=>{const t=e.getBoundingClientRect(),o=(m?0:n.top)-t.top;return Math.max(0,o)})():(()=>{const n=function(e,n){let t=e,o=0,r=0;for(;t&&t!==n&&r++<64;)o+=t.offsetTop||0,t=t.offsetParent;return o}(e,s);return Math.max(0,t-n)})(),h=m?null!=(a=null!=(i=null!=(l=null==u?void 0:u.innerHeight)?l:null==(r=null==d?void 0:d.documentElement)?void 0:r.clientHeight)?i:s.clientHeight)?a:0:s.clientHeight,p=tn(o+.5*Math.max(0,h));return void(je.value=Fe(p,0,Math.max(0,z.value.length-1)))}const k=Math.round((w+y)/2);!e&&Math.abs(k-je.value)<=1||(je.value=Fe(k,0,Math.max(0,z.value.length-1)))}function Fe(e,n,t){return Math.min(Math.max(e,n),t)}const Ue=q({}),Xe=q({total:0,count:0});function qe(e,n,t){for(let o=n+1;o<e.length;o+=o&-o)e[o]+=t}function Ge(e,n){let t=0;for(let o=n+1;o>0;o-=o&-o)t+=e[o];return t}function Ze(e,n,t){if(t<=n)return 0;const o=Ge(e,t-1);return n<=0?o:o-Ge(e,n-1)}const Ye=B(()=>Xe.count>0?Math.max(12,Xe.total/Xe.count):32);function Je(e,n){var t,o;if(e>=n)return 0;if(ke.value!==z.value.length){let o=0;for(let r=e;r<n;r++)o+=null!=(t=Ue[r])?t:Ye.value;return o}const r=be.value,l=Me.value;if(!r.length||!l.length){let t=0;for(let r=e;r<n;r++)t+=null!=(o=Ue[r])?o:Ye.value;return t}return Ze(r,e,n)+(n-e-Ze(l,e,n))*Ye.value}L(()=>z.value.length,e=>{if(e<=0)return ke.value=0,be.value=[],void(Me.value=[]);e!==ke.value&&function(e){ke.value=e;const n=new Array(e+1).fill(0),t=new Array(e+1).fill(0);for(const[o,r]of Object.entries(Ue)){const l=Number(o),i=Number(r);!Number.isFinite(l)||l<0||l>=e||!Number.isFinite(i)||i<=0||(qe(n,l,i),qe(t,l,1))}be.value=n,Me.value=t}(e)},{immediate:!0});const Qe=B(()=>{if(!U.value)return z.value.map((e,n)=>({node:e,index:n}));const e=z.value.length,n=Fe($e.start,0,e),t=Fe($e.end,n,e);return z.value.slice(n,t).map((e,t)=>({node:e,index:n+t}))}),en=B(()=>U.value?Je(0,Math.min($e.start,z.value.length)):0),nn=B(()=>{if(!U.value)return 0;const e=z.value.length;return Je(Math.min($e.end,e),e)});function tn(e){var n;if(e<=0)return 0;const t=z.value;if(ke.value===t.length&&be.value.length&&Me.value.length){const n=Ye.value,o=be.value,r=Me.value,l=e=>e<=0?0:Ge(o,e-1)+(e-Ge(r,e-1))*n;let i=0,a=t.length-1,s=t.length-1;for(;i<=a;){const n=i+a>>1;l(n+1)>=e?(s=n,a=n-1):i=n+1}return s}let o=e;for(let r=0;r<t.length;r++){const e=null!=(n=Ue[r])?n:Ye.value;if(o<=e)return r;o-=e}return Math.max(0,t.length-1)}function on(){we.value+=1}function rn(e){if(!he.size)return;if(!U.value)return;let n=!1;for(const[t,o]of he)t>=e&&(o.destroy(),he.delete(t),Te.value&&delete me[t],gn(t),ge.delete(t)&&(n=!0));n&&on()}function an(e,n){Te.value&&(me[e]=n),n&&(U.value?We():je.value=Fe(e,0,Math.max(0,z.value.length-1)))}function sn(e){const n=he.get(e);n&&(n.destroy(),he.delete(e)),gn(e)}function cn(e,n){let t=!1;if(n){const o=ge.get(e);ge.set(e,n),o!==n&&(t=!0)}else ge.delete(e)&&(t=!0);if(t&&on(),n||gn(e),!Se.value||!Y)return sn(e),void(n?an(e,!0):Te.value&&delete me[e]);if(!U.value&&Te.value&&!h.value&&he.size>=640&&(function(){if(!h.value){h.value=!0;for(const e of he.values())e.destroy();if(he.clear(),g)for(const e of fe.values())window.clearTimeout(e);fe.clear();for(const e of Object.keys(me))delete me[e]}}(),!Se.value||!Y))return sn(e),void(n?an(e,!0):Te.value&&delete me[e]);if(e<le.value&&!U.value)return sn(e),void an(e,!0);if(!n)return sn(e),void(Te.value&&delete me[e]);sn(e);const o=Y(n,{rootMargin:"400px"});o&&(he.set(e,o),an(e,o.isVisible.value),Te.value&&function(e){if(!g||!Te.value)return;gn(e);const n=e%17*23,t=window.setTimeout(()=>{var n,t;if(fe.delete(e),!Te.value)return;if(!0===me[e])return;const o=ge.get(e);if(!o)return void delete me[e];const r=Re(o),l=o.ownerDocument||document,i=l.defaultView||window,a=!r||r===l.documentElement||r===l.body,s=!a&&r?r.getBoundingClientRect():null,c=a?0:s.top,d=a?null!=(t=null!=(n=i.innerHeight)?n:null==r?void 0:r.clientHeight)?t:0:s.bottom,u=o.getBoundingClientRect();u.bottom>=c-500&&u.top<=d+500&&an(e,!0)},1800+n);fe.set(e,t)}(e),o.whenVisible.then(()=>{gn(e),an(e,!0)}).catch(()=>{}).finally(()=>{he.get(e)===o&&he.delete(e);try{o.destroy()}catch(n){}}),U.value&&We())}let dn=null,un=null,mn=!1,hn=null,pn=null;function vn(){g&&(null!=dn&&(null==Q||Q(dn),dn=null),null!=un&&(window.clearTimeout(un),un=null),null!=pn&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback(pn),pn=null),mn=!1,hn=null)}function gn(e){if(!g)return;const n=fe.get(e);null!=n&&(window.clearTimeout(n),fe.delete(e))}function wn(e,n={}){var t,o;if(!Le.value)return;const r=He.value;if(ae.value>=r)return;const i=Math.max(1,e),a=e=>{var n;dn=null,un=null,pn=null,mn=!1;const t=null!=hn?hn:i;hn=null;const o=Math.max(2,null!=(n=l.renderBatchBudgetMs)?n:6),a=e=>{const n="undefined"!=typeof performance?performance.now():Date.now();ae.value=Math.min(r,ae.value+Math.max(1,e)),rn(ae.value);const t=("undefined"!=typeof performance?performance.now():Date.now())-n;return function(e){var n;if(!Le.value)return;const t=Math.max(2,null!=(n=l.renderBatchBudgetMs)?n:6),o=Math.max(1,oe.value||1),r=Math.max(1,Math.floor(o/4));e>1.2*t?ue.value=Math.max(r,Math.floor(.7*ue.value)):e<.5*t&&ue.value<o&&(ue.value=Math.min(o,Math.ceil(1.2*ue.value)))}(t),t};let s=t;for(;(a(s),!(ae.value>=r)&&e)&&!(("function"==typeof e.timeRemaining?e.timeRemaining():0)<=.5*o);)s=Math.max(1,Math.round(ue.value));ae.value<r&&yn()};if(!g||n.immediate)return void a();const s=Math.max(0,null!=(t=l.renderBatchDelay)?t:16);if(hn=null!=hn?Math.max(hn,i):i,!mn){if(mn=!0,!ee&&te&&window.requestIdleCallback){const e=Math.max(0,null!=(o=l.renderBatchIdleTimeoutMs)?o:120);return void(pn=window.requestIdleCallback(e=>{a(e)},{timeout:e}))}J&&!ee?dn=J(()=>{0!==s?un=window.setTimeout(()=>a(),s):a()}):un=window.setTimeout(()=>a(),s)}}function yn(){Le.value&&wn(ie.value?Math.max(1,Math.round(ue.value)):Math.max(1,oe.value))}L([()=>z.value,()=>z.value.length,()=>Le.value,()=>oe.value,()=>le.value,()=>l.renderBatchDelay,()=>l.indexKey],()=>{var e;const n=z.value.length,t=ce.value,o=l.indexKey,r=void 0!==o&&o!==t.key,i=n!==t.total,a=r||i;ce.value={key:o,total:n};const s=Ie.value,c=null!=(e=l.renderBatchDelay)?e:16,d=s.batchSize!==oe.value||s.initial!==le.value||s.delay!==c||s.enabled!==Le.value;Ie.value={batchSize:oe.value,initial:le.value,delay:c,enabled:Le.value},(a||d||!Le.value)&&vn(),(a||d)&&(ue.value=Math.max(1,oe.value||1)),a&&U.value&&We({immediate:!0});const u=He.value;if(!n)return ae.value=0,void rn(0);if(!Le.value)return ae.value=u,void rn(ae.value);const m=r||0===t.total;ae.value=m||d?Math.min(u,le.value):Math.min(ae.value,u);const h=Math.max(1,le.value||oe.value||n);ae.value<u?wn(h,{immediate:!g}):rn(ae.value)},{immediate:!0}),L(()=>U.value,e=>{if(!e)return Oe(),void Ve();Pe(),We({immediate:!0})},{immediate:!0}),L([()=>z.value.length,()=>U.value],e=>d(null,[e],function*([e,n]){n&&e&&g&&(yield G(),We({immediate:!0}))}),{flush:"post"}),L(()=>c.value,()=>{U.value&&(Pe(),We({immediate:!0}))}),L(()=>z.value.length,()=>{U.value&&We({immediate:!0})}),L(()=>Te.value,e=>{if(e)for(const[n,t]of ge)cn(n,t);else{for(const e of he.values())e.destroy();he.clear();for(const e of Array.from(fe.keys()))gn(e);for(const e of Object.keys(me))delete me[e];for(const[e,n]of ge)n&&an(e,!0)}},{immediate:!1}),L([()=>l.viewportPriority,()=>z.value.length],([e,n])=>{!1!==e?h.value&&n<=200&&(h.value=!1):h.value=!1}),L(()=>ae.value,()=>{U.value&&We({immediate:!0})}),L([je,K,Ee,()=>z.value.length,U],()=>{!function(){const e=z.value.length;if(!U.value||0===e)return $e.start=0,void($e.end=e);const n=Math.min(K.value,e),t=Ee.value,o=Fe(je.value-t,0,Math.max(0,e-n));$e.start=o,$e.end=Math.min(e,o+n)}()},{immediate:!0}),L([()=>z.value.length,U,K,Ee,()=>$e.start,()=>$e.end],([e,n,t,o,r,l])=>{w.value&&y("virtualization",{nodes:e,virtualization:n,maxLiveNodes:t,buffer:o,focusIndex:je.value,scroll:n?(()=>{const e=_e.value||Re();return e?{reverse:Ae(e),scrollTop:Math.round(e.scrollTop),scrollTopAbs:Math.round(Math.abs(e.scrollTop)),scrollHeight:Math.round(e.scrollHeight),clientHeight:Math.round(e.clientHeight)}:null})():null,liveRange:{start:r,end:l},rendered:ae.value})}),L(()=>He.value,(e,n)=>{Le.value&&("number"==typeof n&&e<=n||e>ae.value&&yn())}),S(()=>{vn();for(const e of he.values())e.destroy();he.clear();for(const e of Array.from(fe.keys()))gn(e);Oe(),Ve()});const kn=P(()=>d(null,null,function*(){try{return(yield import("./index4.js")).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to inline-code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',e),kt}})),xn=P(()=>d(null,null,function*(){try{return(yield import("./index5.js")).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',e),kt}})),bn=P(()=>d(null,null,function*(){try{return(yield import("./index6.js")).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for InfographicBlockNode are missing. Falling back to preformatted code rendering. To enable Infographic rendering, please install "@antv/infographic".',e),kt}})),Mn=P(()=>d(null,null,function*(){try{return(yield import("./index7.js")).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',e),kt}})),_n=B(()=>l.renderCodeBlocksAsPre?kt:kn),Cn={text:Sn,paragraph:gt,heading:dt,code_block:kn,list:mt,list_item:ut,blockquote:ne,table:Bt,definition_list:se,footnote:it,footnote_reference:xe,footnote_anchor:ot,admonition:Pt,vmr_container:Et,hardbreak:st,link:Gn,image:fn,thematic_break:Lt,math_inline:En,math_block:jn,strong:Pn,emphasis:nt,strikethrough:Wn,highlight:Qn,insert:Yn,subscript:On,superscript:Rn,emoji:de,checkbox:re,checkbox_input:re,inline_code:ze,html_inline:De,reference:$n,html_block:ft},Bn=B(()=>(pe.value,ve(l.customId))),Tn=B(()=>null!=l.indexKey?String(l.indexKey):"markdown-renderer"),Ln={},In=B(()=>a({stream:l.codeBlockStream,darkTheme:l.codeBlockDarkTheme,lightTheme:l.codeBlockLightTheme,monacoOptions:l.codeBlockMonacoOptions,themes:l.themes,minWidth:l.codeBlockMinWidth,maxWidth:l.codeBlockMaxWidth},l.codeBlockProps||{})),Nn=B(()=>({typewriter:l.typewriter})),Hn=B(()=>Qe.value.map(e=>{const n=An(e.node);return s(a({},e),{component:Dn(e.node,n),bindings:zn(e.node,n),isCodeBlock:"code_block"===e.node.type,indexKey:`${Tn.value}-${e.index}`})}));function An(e){var n;return"code_block"===(null==e?void 0:e.type)?String(null!=(n=e.language)?n:"").trim().toLowerCase():""}function Dn(e,n){if(!e)return St;const t=Bn.value,o=t[String(e.type)];if("code_block"===e.type){const r=null!=n?n:An(e);if("mermaid"===r)return t.mermaid||xn;if("infographic"===r)return t.infographic||bn;if("d2"===r||"d2lang"===r)return t.d2||Mn;if(o)return o;return t.code_block||_n.value}return o||Cn[String(e.type)]||St}function zn(e,n){const t=null!=n?n:An(e);return"mermaid"===t||"infographic"===t||"d2"===t||"d2lang"===t?Ln:"code_block"===e.type?In.value:Nn.value}function Vn(e){i("click",e)}function Kn(e){var n;(null==(n=e.target)?void 0:n.closest("[data-node-index]"))&&i("mouseover",e)}function Fn(e){var n;(null==(n=e.target)?void 0:n.closest("[data-node-index]"))&&i("mouseout",e)}return(e,n)=>(v(),f("div",{ref_key:"containerRef",ref:c,class:E(["markstream-vue markdown-renderer",[{dark:l.isDark},{virtualized:U.value}]]),"data-custom-id":l.customId,onClick:Vn,onMouseover:Kn,onMouseout:Fn},[U.value?(v(),f("div",{key:0,class:"node-spacer",style:D({height:`${en.value}px`}),"aria-hidden":"true"},null,4)):H("",!0),(v(!0),f(x,null,b(Hn.value,e=>{var t,o;return v(),f("div",{key:e.index,ref_for:!0,ref:n=>cn(e.index,n),class:"node-slot","data-node-index":e.index,"data-node-type":e.node.type},[(o=e.index,Le.value&&o>=ae.value||Te.value&&!(o<le.value)&&!0!==me[o]?(v(),f("div",{key:1,class:"node-placeholder",style:D({height:`${null!=(t=Ue[e.index])?t:Ye.value}px`})},null,4)):(v(),f("div",{key:0,ref_for:!0,ref:n=>function(e,n){n?(Ne.set(e,n),queueMicrotask(()=>{!function(e,n){if(!Number.isFinite(n)||n<=0)return;const t=Ue[e];if(Ue[e]=n,t?Xe.total+=n-t:(Xe.total+=n,Xe.count++),ke.value>e){const o=be.value,r=Me.value;if(o.length&&r.length)if(t){const r=n-t;0!==r&&qe(o,e,r)}else qe(o,e,n),qe(r,e,1)}}(e,n.offsetHeight)})):Ne.delete(e)}(e.index,n),class:"node-content"},[e.isCodeBlock||!1===l.typewriter?(v(),V(W(e.component),F({key:1,node:e.node,loading:e.node.loading,"index-key":e.indexKey},{ref_for:!0},e.bindings,{"custom-id":l.customId,"is-dark":l.isDark,onCopy:n[2]||(n[2]=e=>i("copy",e)),onHandleArtifactClick:n[3]||(n[3]=e=>i("handleArtifactClick",e))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(v(),V(R,{key:0,name:"typewriter",appear:""},{default:A(()=>[(v(),V(W(e.component),F({node:e.node,loading:e.node.loading,"index-key":e.indexKey},{ref_for:!0},e.bindings,{"custom-id":l.customId,"is-dark":l.isDark,onCopy:n[0]||(n[0]=e=>i("copy",e)),onHandleArtifactClick:n[1]||(n[1]=e=>i("handleArtifactClick",e))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1024))],512)))],8,$t)}),128)),U.value?(v(),f("div",{key:1,class:"node-spacer",style:D({height:`${nn.value}px`}),"aria-hidden":"true"},null,4)):H("",!0)],42,jt))}}),[["__scopeId","data-v-d64c1cf5"]]);Nt.install=e=>{var n,t;const o=null!=(t=null!=(n=Nt.__name)?n:Nt.name)?t:"NodeRenderer";e.component(o,Nt)};const Ht={key:0,class:"admonition-icon"},Rt={class:"admonition-title"},At=["aria-expanded","aria-controls","title"],Dt={key:0},Ot={key:1},zt=["id"],Pt=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:n}){var t;const o=e,r=n,l={note:"ℹ️",info:"ℹ️",tip:"💡",warning:"⚠️",danger:"❗",error:"⛔",caution:"⚠️"},i=B(()=>{if(o.node.title&&o.node.title.trim().length)return o.node.title;const e=o.node.kind||"note";return e.charAt(0).toUpperCase()+e.slice(1)}),a=T(!!o.node.collapsible&&!(null==(t=o.node.open)||t));function s(){o.node.collapsible&&(a.value=!a.value)}const c=`admonition-${Math.random().toString(36).slice(2,9)}`;return(n,t)=>(v(),f("div",{class:E(["admonition",[`admonition-${o.node.kind}`,o.isDark?"is-dark":""]])},[k("div",{id:c,class:"admonition-header"},[l[o.node.kind]?(v(),f("span",Ht,M(l[o.node.kind]),1)):H("",!0),k("span",Rt,M(i.value),1),o.node.collapsible?(v(),f("button",{key:1,class:"admonition-toggle","aria-expanded":!a.value,"aria-controls":`${c}-content`,title:a.value?"Expand":"Collapse",onClick:s},[a.value?(v(),f("span",Dt,"▶")):(v(),f("span",Ot,"▼"))],8,At)):H("",!0)]),Z(k("div",{id:`${c}-content`,class:"admonition-content","aria-labelledby":c},[g([o.node.children],()=>w(y(Nt),{"index-key":`admonition-${e.indexKey}`,nodes:o.node.children,"custom-id":o.customId,typewriter:o.typewriter,onCopy:t[0]||(t[0]=e=>r("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"]),t,1)],8,zt),[[Y,!a.value]])],2))}}),[["__scopeId","data-v-5e95c2b7"]]);Pt.install=e=>{e.component(Pt.__name,Pt)};let Vt=!1,Wt=null,Kt=!1;function Ft(){return d(this,null,function*(){if(Wt)return Wt;if(Kt)return null;try{return Wt=yield import("stream-monaco"),yield function(e){return d(this,null,function*(){if(Vt)return;Vt=!0;const n=null==globalThis?void 0:globalThis.MonacoEnvironment;return!n||"function"!=typeof n.getWorker&&"function"!=typeof n.getWorkerUrl?e.preloadMonacoWorkers():void 0})}(Wt),(yield function(e){return d(this,null,function*(){const n=null==e?void 0:e.getOrCreateHighlighter;if("function"!=typeof n)return!0;try{const e=yield n(["vitesse-dark","vitesse-light"],["plaintext","text","javascript"]);return e&&"function"==typeof e.codeToTokens&&e.codeToTokens("const a = 1",{lang:"javascript",theme:"vitesse-dark"}),!0}catch(t){return console.warn("[markstream-vue] Failed to warm up Shiki tokenizer; disabling stream-monaco for this session.",t),!1}})}(Wt))?Wt:(Wt=null,Kt=!0,null)}catch(e){return Kt=!0,null}})}let Ut=null;function Xt(e){Ut=null!=e?e:null}const qt={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain","c++":"cpp","c#":"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function Gt(e){var n;const t=function(e){if(!e)return"";const n=e.trim();if(!n)return"";const[t]=n.split(/\s+/),[o]=t.split(":");return o.toLowerCase()}(e);return null!=(n=qt[t])?n:t}function Zt(e){const n=Gt(e);if(!n)return"plaintext";switch(n){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return n}}function Yt(e){if(Ut){const n=Ut(e);if(null!=n&&""!==n)return n}switch(Gt(e)){case"javascript":case"js":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4.5 11c0 .828427.6715729 1.5 1.5 1.5.8284271 0 1.5-.671573 1.5-1.5V7.5M12.5 8.75C12.5 8.05964406 11.9627417 7.5 11.3 7.5L10.7 7.5C10.0372583 7.5 9.5 8.05964406 9.5 8.75 9.5 9.44035594 10.0372583 10 10.7 10L11.3 10C11.9627417 10 12.5 10.5596441 12.5 11.25 12.5 11.9403559 11.9627417 12.5 11.3 12.5L10.7 12.5C10.0372583 12.5 9.5 11.9403559 9.5 11.25" />\n <path d="m 4,1.5 h 8 c 1.385,0 2.5,1.115 2.5,2.5 v 8 c 0,1.385 -1.115,2.5 -2.5,2.5 H 4 C 2.615,14.5 1.5,13.385 1.5,12 V 4 C 1.5,2.615 2.615,1.5 4,1.5 Z" />\n </g>\n</svg>\n';case"typescript":case"ts":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4 1.5h8A2.5 2.5 0 0114.5 4v8a2.5 2.5 0 01-2.5 2.5H4A2.5 2.5 0 011.5 12V4A2.5 2.5 0 014 1.5" />\n <path d="M12.5 8.75c0-.69-.54-1.25-1.2-1.25h-.6c-.66 0-1.2.56-1.2 1.25S10.04 10 10.7 10h.6c.66 0 1.2.56 1.2 1.25s-.54 1.25-1.2 1.25h-.6c-.66 0-1.2-.56-1.2-1.25m-3-3.75v5M5 7.5h3" />\n </g>\n</svg>\n';case"jsx":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#99d1db" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 10.8c4.14 0 7.5-1.25 7.5-2.8S12.14 5.2 8 5.2.5 6.45.5 8s3.36 2.8 7.5 2.8" />\n <path d="M5.52 9.4c2.07 3.5 4.86 5.72 6.23 4.95 1.37-.78.8-4.24-1.27-7.75C8.41 3.1 5.62.88 4.25 1.65c-1.37.78-.8 4.24 1.27 7.75" />\n <path d="M5.52 6.6c-2.07 3.5-2.64 6.97-1.27 7.75 1.37.77 4.16-1.45 6.23-4.95s2.64-6.97 1.27-7.75C10.38.88 7.59 3.1 5.52 6.6" />\n <path d="M8.5 8a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n';case"tsx":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 11.3c4.14 0 7.5-1.28 7.5-2.86S12.14 5.58 8 5.58.5 6.86.5 8.44s3.36 2.87 7.5 2.87Z" />\n <path d="M5.52 9.87c2.07 3.6 4.86 5.86 6.23 5.07 1.37-.8.8-4.34-1.27-7.93S5.62 1.16 4.25 1.95s-.8 4.34 1.27 7.92" />\n <path d="M5.52 7.01c-2.07 3.59-2.64 7.14-1.27 7.93s4.16-1.48 6.23-5.07c2.07-3.58 2.64-7.13 1.27-7.92-1.37-.8-4.16 1.47-6.23 5.06" />\n <path d="M8.5 8.44a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n';case"html":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#ef9f76" d="M1.5 1.5h13L13 13l-5 2-5-2z" />\n <path stroke="#c6d0f5" d="M11 4.5H5l.25 3h5.5l-.25 3-2.5 1-2.5-1-.08-1" />\n </g>\n</svg>\n';case"css":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round">\n <path d="m4 1.5h8c1.38 0 2.5 1.12 2.5 2.5v8c0 1.38-1.12 2.5-2.5 2.5h-8c-1.38 0-2.5-1.12-2.5-2.5v-8c0-1.38 1.12-2.5 2.5-2.5z" />\n <path stroke-width=".814" d="m 10.240861,11.529149 c 0,0.58011 0.437448,1.039154 0.96002,1.035371 l 0.451635,-0.0032 c 0.522572,-0.0036 0.949379,-0.451477 0.949379,-1.032848 0,-0.581372 -0.426807,-1.065638 -0.949379,-1.065638 l -0.451635,3.4e-5 c -0.522572,3.9e-5 -0.949379,-0.4855273 -0.949379,-1.0656374 0,-0.5801104 0.426807,-1.0378931 0.949379,-1.0378931 l 0.451635,2.825e-4 c 0.522572,3.267e-4 0.951743,0.4577827 0.951743,1.0378931 M 6.8003972,11.529149 c 0,0.58011 0.4374474,1.039154 0.9600196,1.035371 l 0.46464,-0.0032 c 0.5225722,-0.0035 0.9363738,-0.451477 0.9363738,-1.031587 0,-0.580111 -0.4090724,-1.065638 -0.9316446,-1.065638 l -0.4693692,3.4e-5 c -0.5225722,3.8e-5 -0.949379,-0.4855272 -0.949379,-1.0656373 0,-0.5801104 0.4268068,-1.0378931 0.949379,-1.0378931 h 0.4516348 c 0.5225722,0 0.9635665,0.4577827 0.9635665,1.0378931 M 3.4072246,11.529149 c 0,0.58011 0.4374474,1.051765 0.9600196,1.051765 H 4.818879 c 0.5225722,0 0.949379,-0.456521 0.949379,-1.037893 m 0.01129,-2.1312747 c 0,-0.5801103 -0.4374474,-1.037893 -0.9600196,-1.037893 L 4.3678939,8.3741358 C 3.8453217,8.3744624 3.4078743,8.8420074 3.4078743,9.4233788 v 2.1186642" />\n </g>\n</svg>\n';case"scss":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#f4b8e4" stroke-linecap="round" stroke-linejoin="round" d="M6.75 6.38c1.85 1.07 3.35.74 4.83-.2 1.5-.95 2.7-2.78 1.3-4.15-.7-.68-3.25-.8-5.62.19-2.36.99-4.59 3.02-4.74 4.11-.31 2.19 3.15 2.88 3.64 4.23s.28 1.98-.2 2.83c-.5.85-1.96 1.62-2.8.68-.83-.95 1.67-2.75 2.98-3.25 1.3-.5 3.1-.4 3.69.25.58.64-.07 1.79-.03 1.79" />\n</svg>\n';case"json":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M4.5 2.5H4c-.75 0-1.5.75-1.5 1.5v2c0 1.1-1 2-1.83 2 .83 0 1.83.9 1.83 2v2c0 .75.75 1.5 1.5 1.5h.5m7-11h.5c.75 0 1.5.75 1.5 1.5v2c0 1.1 1 2 1.83 2-.83 0-1.83.9-1.83 2v2c0 .74-.75 1.5-1.5 1.5h-.5m-6.5-3a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1" />\n</svg>\n';case"python":case"py":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#8caaee" d="M8.5 5.5h-3m6 0V3c0-.8-.7-1.5-1.5-1.5H7c-.8 0-1.5.7-1.5 1.5v2.5H3c-.8 0-1.5.7-1.5 1.5v2c0 .8.7 1.5 1.48 1.5" />\n <path stroke="#e5c890" d="M10.5 10.5h-3m-3 0V13c0 .8.7 1.5 1.5 1.5h3c.8 0 1.5-.7 1.5-1.5v-2.5H13c.8 0 1.5-.7 1.5-1.5V7c0-.8-.7-1.5-1.48-1.5H11.5c0 1.5 0 2-1 2h-2" />\n <path stroke="#8caaee" d="M2.98 10.5H4.5c0-1.5 0-2 1-2h2M7.5 3.5v0" />\n <path stroke="#e5c890" d="m 8.5,12.5 v 0" />\n </g>\n</svg>\n';case"ruby":case"rb":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="M1.5 9.06v2.5c.02.86.36 1.61.9 2.15 1.76 1.76 5.71.65 8.84-2.47 3.12-3.13 4.23-7.08 2.47-8.84a3.1 3.1 0 00-2.15-.9h-2.5M14.5 4l-.25 10.25L4 14.5m4.39-6.11c2.34-2.35 3.29-5.2 2.12-6.37S6.49 1.8 4.14 4.14C1.8 6.5.85 9.34 2.02 10.51s4.02.22 6.37-2.12M5.5 14.5l.25-3.75L11 11l-.25-5.25 3.75-.25" />\n</svg>\n';case"go":case"golang":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round" d="m15.48 8.06-4.85.48m4.85-.48a4.98 4.98 0 01-4.54 5.42 5 5 0 112.95-8.66l-1.7 1.84a2.5 2.5 0 00-4.18 2.06c.05.57.3 1.1.69 1.51.25.27 1 .83 1.78.82.8-.02 1.58-.25 2.07-.81 0 0 .8-.96.68-1.88M2.5 8.5l-2 .01m1.5 2h1.5m-2-3.99 2-.02" />\n</svg>\n';case"r":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#838ba7" d="M13.5 9.5c.63-.7 1-1.54 1-2.43 0-2.52-2.91-4.57-6.5-4.57S1.5 4.55 1.5 7.07c0 1.9 1.65 3.53 4 4.22" />\n <path stroke="#8caaee" d="M10.5 9.5c.4 0 .86.34 1 .7l1 3.3m-5 0v-8h3.05c.95 0 1.95 1 1.95 2s-1 2-1.95 2H7.5Z" />\n </g>\n</svg>\n';case"java":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#c6d0f5" d="M10.73 8.41c.57 3 1.59 5.83 2.77 7.09-6.63-3.45-9.76-1.75-10.5 0-.66-3.4-.54-5.74.09-7.78" />\n <path stroke="#e78284" d="M8.5 7c.63.34 1.82 1.07 2.24 1.41-.54-2.9-.64-5.96-.74-7.91-2.13.58-5.73 1.98-6.9 7.22.52-.69 1.72-1.05 2.4-1.22" />\n <path stroke="#e78284" d="M5.5 7A1.5 1.5 0 007 8.5 1.5 1.5 0 008.5 7 1.5 1.5 0 007 5.5 1.5 1.5 0 005.5 7" />\n </g>\n</svg>\n';case"kotlin":case"kt":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#ca9ee6" d="M2.5 13.5h11L8 8" />\n <path stroke="#ef9f76" d="M8.03 2.5h5.47l-8 8" />\n <path stroke="#e78284" d="M2.5 13.5V8" />\n <path stroke="#85c1dc" d="M8 2.5H2.5V8l3-2.5" />\n </g>\n</svg>\n';case"c":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="m 4.0559072,12.951629 c 2.7459832,2.734744 7.1981158,2.734744 9.9441188,0 l -1.789955,-1.782586 c -1.75742,1.750224 -4.6067879,1.750224 -6.3642294,0 -1.7574416,-1.7502236 -1.7574416,-4.587893 0,-6.338097 1.7574415,-1.750224 4.6068094,-1.750224 6.3642294,0 l 0.894977,-0.8912929 0.894978,-0.891293 c -2.746003,-2.73472867 -7.1981359,-2.73472867 -9.944119,0 -2.7459858,2.7347089 -2.7459858,7.1685599 2e-7,9.9032689 z" clip-rule="evenodd" />\n</svg>\n';case"cpp":case"c++":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="m 2.5559121,12.951629 c 2.7459832,2.734744 7.1981158,2.734744 9.9441189,0 l -1.789955,-1.782586 c -1.7574201,1.750224 -4.606788,1.750224 -6.3642295,0 -1.7574416,-1.7502236 -1.7574416,-4.587893 0,-6.338097 1.7574415,-1.750224 4.6068094,-1.750224 6.3642295,0 l 0.894977,-0.8912929 0.894978,-0.891293 c -2.7460031,-2.73472867 -7.198136,-2.73472867 -9.9441191,0 -2.74598585,2.7347089 -2.74598585,7.1685599 2e-7,9.9032689 z" clip-rule="evenodd" />\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M7.5 6v4M5.513524 7.9999996H9.51304M13.486476 5.9999996v4M11.5 7.9999992h3.999516" />\n</svg>\n';case"cs":case"csharp":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" d="m 6.665625,1.0107144 c 0.54375,0.090628 0.9125,0.6062693 0.821875,1.1500367 L 7.18125,3.9983098 h 2.971875 L 10.5125,1.8326156 c 0.09063,-0.5437673 0.60625,-0.9125291 1.15,-0.8219012 0.54375,0.090628 0.9125,0.6062693 0.821875,1.1500367 L 12.18125,3.9983098 H 14 c 0.553125,0 1,0.4468892 1,1.0000319 0,0.5531426 -0.446875,1.0000319 -1,1.0000319 H 11.846875 L 11.18125,9.9985013 H 13 c 0.553125,0 1,0.4468897 1,1.0000317 0,0.553143 -0.446875,1.000032 -1,1.000032 H 10.846875 L 10.4875,14.164259 c -0.09063,0.543768 -0.60625,0.912529 -1.15,0.821902 -0.54375,-0.09063 -0.9125,-0.60627 -0.821875,-1.150037 l 0.30625,-1.834434 h -2.975 L 5.4875,14.167384 c -0.090625,0.543768 -0.60625,0.91253 -1.15,0.821902 C 3.79375,14.898658 3.425,14.383016 3.515625,13.839249 L 3.81875,11.998565 H 2 c -0.553125,0 -1,-0.446889 -1,-1.000032 C 1,10.445391 1.446875,9.9985013 2,9.9985013 H 4.153125 L 4.81875,5.9983736 H 3 c -0.553125,0 -1,-0.4468893 -1,-1.0000319 C 2,4.445199 2.446875,3.9983098 3,3.9983098 H 5.153125 L 5.5125,1.8326156 C 5.603125,1.2888483 6.11875,0.9200865 6.6625,1.0107144 Z M 6.846875,5.9983736 6.18125,9.9985013 H 9.153125 L 9.81875,5.9983736 Z" />\n</svg>\n';case"php":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M0.5,12.5 L0.5,13.24 C0.5,14 1.27360724,14.5 2,14.5 C2.9375516,14.5 3.5,14 3.5,13.2445661 L3.5,6.00089968 C3.5,4.28551107 4.99401107,2.52263547 7.14960413,2.5 C9.49387886,2.5 11,4.0579782 11,5.5 C11.1657296,8.48962302 9.57820404,9.63684469 7.49621582,10.5 L7.49621582,14.5 L15.4979764,14.5 L15.4979764,9 C15.5394484,8.36478228 14.9387379,7.15595371 14.1308258,6.5 C13.1942239,5.80827275 12.0584852,5.50253264 11,5.5 M11.5,14.5 L11.5,11.5 M6,6.5 C6.27614237,6.5 6.5,6.27614237 6.5,6 C6.5,5.72385763 6.27614237,5.5 6,5.5 C5.72385763,5.5 5.5,5.72385763 5.5,6 C5.5,6.27614237 5.72385763,6.5 6,6.5 Z" />\n</svg>\n';case"scala":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="m2.5 2.48 11-.98v3.04l-11 1zm0 5 11-.98v3.04l-11 1zm0 5 11-.98v3.04l-11 1z" />\n</svg>\n';case"shell":case"sh":case"bash":case"zsh":case"powershell":case"ps1":case"bat":case"batch":case"shellscript":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M2 15.5c-.7 0-1.5-.8-1.5-1.5V5c0-.7.8-1.5 1.5-1.5h9c.7 0 1.5.8 1.5 1.5v9c0 .7-.8 1.5-1.5 1.5z" />\n <path d="m1.2 3.8 3.04-2.5S5.17.5 5.7.5h8.4c.66 0 1.4.73 1.4 1.4v7.73a2.7 2.7 0 01-.7 1.75l-2.68 3.51M3 8.5l3 2-3 2m4 0h2" />\n </g>\n</svg>\n';case"sql":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M8 6.5c3.59 0 6.5-1.4 6.5-2.68S11.59 1.5 8 1.5 1.5 2.54 1.5 3.82 4.41 6.5 8 6.5M14.5 8c0 .83-1.24 1.79-3.25 2.2s-4.49.41-6.5 0S1.5 8.83 1.5 8m13 4.18c0 .83-1.24 1.6-3.25 2-2.01.42-4.49.42-6.5 0-2.01-.4-3.25-1.17-3.25-2m0-8.3v8.3m13-8.3v8.3" />\n</svg>\n';case"yaml":case"yml":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="M2.5 1.5h3l3 4 3-4h3l-9 13h-3L7 8z" />\n</svg>\n';case"markdown":case"md":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round" d="m9.25 8.25 2.25 2.25 2.25-2.25M3.5 11V5.5l2.04 3 1.96-3V11m4-.5V5M1.65 2.5h12.7c.59 0 1.15.49 1.15 1v9c0 .51-.56 1-1.15 1H1.65c-.59 0-1.15-.49-1.15-1V3.58c0-.5.56-1.08 1.15-1.08" />\n</svg>\n';case"xml":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="M4.5 4.5 1 8 4.5 11.5M11.5 4.5 15 8 11.5 11.5M9.5 2 6.5 14" />\n</svg>\n';case"rust":case"rs":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round">\n <path d="M15.5 9.5Q8 13.505.5 9.5l1-1-1-2 2-.5V4.5h2l.5-2 1.5 1 1.5-2 1.5 2 1.5-1 .5 2h2V6l2 .5-1 2z" />\n <path d="M6.5 7.5a1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1 1 1 0 011 1m5 0a1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1 1 1 0 011 1M4 11.02c-.67.37-1.5.98-1.5 2.23s1.22 1.22 2 1.25v-2M12 11c.67.37 1.5 1 1.5 2.25s-1.22 1.22-2 1.25v-2" />\n </g>\n</svg>\n';case"swift":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="M14.34 10.2c.34-1.08 1.1-5.07-4.45-8.62a.48.48 0 00-.6.07.44.44 0 00-.02.6c.03.02 2.07 2.5 1.34 5.34-1.26-.86-6.24-4.81-6.24-4.81L7.25 7.5 1.9 4.05S5.68 8.7 8 10.45c-1.12.4-3.56.82-6.78-1.18a.48.48 0 00-.58.06.44.44 0 00-.08.56c.11.18 2.7 4.36 8.14 4.36 1.5 0 2.37-.42 3.08-.77.43-.2.77-.37 1.14-.37.93 0 1.54.92 1.54.93.1.14.27.22.44.21a.46.46 0 00.4-.28c.67-1.55-.49-3.2-.96-3.78h0Z" />\n</svg>\n';case"perl":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M12.5 14.5v-3.34c-1-.66-1-1.35-1-2.66m-3 1 .02 2.53.98 2.47m-4-5v5m9 0V9.23s.17-1.73-1-1.73c0-1.5-.5-6-2.5-6S8.75 4.25 8.75 4.25A3.67 3.67 0 006.5 7.12v-3.5c0-.63-.85-1.32-1.5-1.32-.92 0-1.33.59-1.5 1.2H2.25c-.42.11-.75.59-.75 1 0 .5.28 1 .75 1h1.22l.02 3c.01.75.51 1 1.51 1h4.5" />\n</svg>\n';case"lua":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#c6d0f5" d="M10.5 7A1.5 1.5 0 019 8.5 1.5 1.5 0 017.5 7 1.5 1.5 0 019 5.5 1.5 1.5 0 0110.5 7" />\n <path stroke="#8caaee" d="M7 2.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13m7-2a1.5 1.5 0 100 3 1.5 1.5 0 000-3" />\n </g>\n</svg>\n';case"haskell":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M12.5 4.5h3m-1.5 3h1.5m-10 6 2.5-5-2.5-5H8l5.6 10h-2.53l-1.52-2.92L8 13.5zm-5 0 2.5-5-2.5-5H3l2.5 5-2.5 5z" />\n</svg>\n';case"erlang":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round">\n <path d="M6.5 5.5c0-1.25 1-2 2-2s2 .75 2 2z" />\n <path d="M13.5 13c.47-.57 1.12-1.24 1.5-2l-2.25-1.25c-.74 1.36-1.76 2.75-3.25 2.75-2.1 0-3-2.3-3-5h8c.05-1.61-.31-3.45-1-4.5M3 13c-1.08-1.3-1.5-3-1.5-5S2.1 4.24 3 3" />\n </g>\n</svg>\n';case"clojure":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#a6d189" d="M14.17 10.03A6.5 6.5 0 011.81 6.02" />\n <path stroke="#8caaee" d="M1.87 5.85A6.5 6.5 0 0114.22 9.9" />\n <path stroke="#a6d189" d="M6.36 4.9a3.5 3.5 0 103.41 6.12" />\n <path stroke="#8caaee" d="M9.77 11.02a3.5 3.5 0 00-3.03-6.29" />\n <path stroke="#c6d0f5" d="M8 7.5s-1.66 2.48-1.5 3.65" />\n <path stroke="#c6d0f5" d="M1.81 6.02C2.47 5 3.83 4.49 5 4.46c4.06 0 3 5.56 5.03 6.86 1.21.52 3.5-.21 4.15-1.32" />\n </g>\n</svg>\n';case"vue":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#a6d189" stroke-linecap="round" stroke-linejoin="round">\n <path d="M1 1.5h5.44L8 4.56 9.56 1.5H15l-6.99 13z" />\n <path d="M12.05 1.73 8 9.28 3.95 1.73" />\n </g>\n</svg>\n';case"svg":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="m4.54 10 6.92-4m-6.92 4a1.5 1.5 0 10-2.6 1.5 1.5 1.5 0 002.6-1.5M8 4v8m0-8a1.5 1.5 0 100-3 1.5 1.5 0 000 3M4.54 6l6.92 4M4.54 6a1.5 1.5 0 10-2.6-1.5A1.5 1.5 0 004.54 6M8 12a1.5 1.5 0 100 3 1.5 1.5 0 000-3m3.46-2a1.5 1.5 0 102.6 1.5 1.5 1.5 0 00-2.6-1.5m0-4a1.5 1.5 0 102.6-1.5 1.5 1.5 0 00-2.6 1.5" />\n</svg>\n';case"mermaid":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M1.5 2.5c0 6 2.25 5.75 4 7 .83.67 1.17 2 1 4h3c-.17-2 .17-3.33 1-4 1.75-1.25 4-1 4-7C12 2.5 10 3 8 7 6 3 4 2.5 1.5 2.5" />\n</svg>\n';case"dart":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round">\n <path d="M7 14.5h4.5v-3h3V7L9.17 1.64c-.28-.29-.8-.47-1.17-.29L3.5 3.5 1.35 8c-.18.37 0 .88.3 1.17z" />\n <path d="M3.5 11V3.5H11m-7.5 0 8 8" />\n </g>\n</svg>\n';case"assembly":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <rect width="8" height="13.001" x="4" y="1.499" fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round" rx="2.286" ry="2.286" />\n <path fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round" d="M 4,4.500025 H 1.5 M 4,7.9999993 H 1.5 M 4,11.499973 H 1.5 m 13,-6.999948 H 12 m 2.5,3.4999743 H 12 m 2.5,3.4999737 H 12" />\n</svg>\n';case"dockerfile":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M.5 8.5H11l.75-.5a5.35 5.35 0 010-3.5c1 .6 1 1.88 1.74 2 .77-.09 1.23.01 2 .52 0 0-.97 1.77-2.5 1.98-1.93 3.65-4.5 5.5-6.98 5.5C0 14.5.5 8.5.5 8.5m1 0v-2m0 0h8m-6 2v-4m0 0h4m-2-2h2m-2 6v-6m2 6v-6m2 6v-2" />\n</svg>\n';case"fortran":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M7.5 14.5v-1l-1-1v-3h2l1 2h1v-6h-1l-1 2h-2v-4h5l1 3h1v-5h-11v1l1 1v9l-1 1.25v.75z" />\n</svg>\n';case"lisp":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round">\n <path d="M.5 5.06v6.07C.5 12.41.82 13 2.27 13h5.6c1.04 0 1.63-.51 1.63-1.62 0-.85-.2-1.88-1.5-1.88h-.36C6.4 9.5 6 8.77 6 7.75 6 6.81 6.8 6 7.49 6h2.68" />\n <path d="M3.5 10.5V4.99C3.5 3.89 3.62 3 5 3h9c.97 0 1.5.99 1.5 1.63.12 1.55-.98 1.62-2.1 2.16-.58.26-1.4.52-1.4.98V11" />\n </g>\n</svg>\n';case"ocaml":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round">\n <path d="M1.5 8V3c0-.83.67-1.5 1.5-1.5h10c.83 0 1.5.67 1.5 1.5v10c0 .83-.67 1.5-1.5 1.5H9" />\n <path d="m1.5 8 1.14-2.3q.09-.21.36-.24a.8.8 0 01.44.13c.18.12.23.53.28.64.06.1.64 1.23.85 1.23.2 0 .71-1.47.71-1.47s.37-.49.72-.49.55.32.67.49c.12.16.24 1.76.46 2.01s1.32.87 1.67.73c.34-.13.53-.4.63-.73.1-.34-.14-.75 0-1a1.1 1.1 0 011.02-.55c.56.03 2.05.56 2.05 1.05q0 .75-1.5.75c-.48 1.33.28 2.22-3 2.25l1 4" />\n <path d="m4.5 14.5 1.5-4 1 4zm-2 0 1.5-4-1.5-.5-1 1.54V14l1 .49Z" />\n </g>\n</svg>\n';case"prolog":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="M4.5 13.5c-.33.33-.5.67-.5 1s.17.67.5 1c.17-.67.5-1 1-1s.83.33 1 1c.33-.33.5-.83.5-1.5h2c0 .67.17 1.17.5 1.5.17-.67.5-1 1-1s.83.33 1 1c.33-.33.5-.67.5-1s-.17-.67-.5-1l1-1 1.25 1.25c0-2.75 1-2.75 1-5.75a7.1 7.1 0 00-2-5.25A3.64 3.64 0 0113 .5c-1.17 0-2 .42-2.5 1.25A3.08 3.08 0 008 .5c-1 0-1.83.42-2.5 1.25C5 .92 4.17.5 3 .5c.5.83.58 1.58.25 2.25a7.1 7.1 0 00-2 5.25c0 3 1 3 1 5.75L3.5 12.5zm6-5a2 2 0 100-4 2 2 0 000 4m-5 0a2 2 0 100-4 2 2 0 000 4M7 8l1 2.5L9 8m1.5-1.5" />\n</svg>\n';case"groovy":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round">\n <path d="M11.68 5.38c.4.19.54.68 1.53 3.25 1 2.57-.92 4.07-.92 4.07s-6.73 2.47-6.73 1.63c-.18-.92-1.92-2.08-1.92-2.08s-.52-.63.06-.75c5.89-1.27 6.96-.61 7.3-2" />\n <path d="M7.38 10.63C2.62 10.88 2.48 8.08 2.5 8 3.6 4.6 9.24.91 10.8 1.58 14.07 3.04 9.2 8.96 7 8.5c-4.02-.83 1.5-4 1.5-4" />\n </g>\n</svg>\n';case"matlab":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#85c1dc" d="M4 11 .5 8.5 5 7q.78-1.77 1.89-1.89c.74-.07 1.94-1.28 3.61-3.61M5 7l1.5 1.5" />\n <path stroke="#ef9f76" d="m15.5 12.5-5-11C8.5 6.83 6.33 10 4 11c1.67-.33 2.67.83 3 3.5 3.5-1.5 3.5-3.5 5-4s1.5 1.5 3.5 2" />\n </g>\n</svg>\n';case"cobol":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M6.74 2.24c.32-1.32 2.2-1.32 2.52 0a1.3 1.3 0 001.93.8c1.15-.7 2.48.62 1.77 1.77a1.3 1.3 0 00.8 1.93c1.32.32 1.32 2.2 0 2.52a1.3 1.3 0 00-.8 1.93c.7 1.15-.62 2.48-1.77 1.77a1.3 1.3 0 00-1.93.8c-.32 1.32-2.2 1.32-2.52 0a1.3 1.3 0 00-1.93-.8c-1.15.7-2.48-.62-1.77-1.77a1.3 1.3 0 00-.8-1.93c-1.32-.32-1.32-2.2 0-2.52a1.3 1.3 0 00.8-1.93c-.7-1.15.62-2.48 1.77-1.77a1.3 1.3 0 001.93-.8M10 6.5a2.5 2.5 0 100 3" />\n</svg>\n';case"ada":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<path fill="#0f23c3" d="M24.554 20.075c.209.27 1.356.961 1.37 1.246a7 7 0 0 0-1.4-.324a17 17 0 0 1-1.412-.48a9.2 9.2 0 0 1-2.375-1.3A3.15 3.15 0 0 1 19.3 16.75a1.72 1.72 0 0 1 1.767-1.822a3.6 3.6 0 0 1 1.593.321c.146.066 1.31.606 1.256.809a5.5 5.5 0 0 0-1.41-.112c-.649.244-.4.828-.168 1.311a8 8 0 0 0 1.078 1.554c.164.194.884 1.271 1.138 1.264"/><path fill="#1a1978" d="M24.141 16.276c.128-.59.819-1.384 1.344-.773a4.2 4.2 0 0 1 .578 1.918c.12.656.2 1.327.261 1.982c.038.379.34 1.794.123 2.075a23 23 0 0 1-2.922-2.838a3.76 3.76 0 0 1-.925-1.7c-.1-1.073.879-.73 1.541-.664"/><path fill="#0f23c3" d="M26.3 17.781c.141-.732-.406-2.592-1.067-2.949a.06.06 0 0 0 .044-.007c-.156-.444-1.359 1.116-1.228 1.174c-.316-.138.774-1.984.988-2.16c.7-.578 1.372-.086 1.845.543a6.04 6.04 0 0 1 .733 4.434a4.5 4.5 0 0 1-.421 1.312c-.1.22-.45 1.1-.682 1.174a14.8 14.8 0 0 0-.212-3.521"/><path fill="#d2d2d2" d="M3.687 8.4c.179-.188-.041-1.527.324-1.548c.262-.015.553 1.741.627 1.968a9.2 9.2 0 0 0 1.127 2.329a7.53 7.53 0 0 0 4.016 2.978a4.55 4.55 0 0 0 2.366.2c.931-.208 1.82-.577 2.757-.765c1.35-.27 3.342-.352 4.438.647c.7.641.376.76.043 1.421a2.44 2.44 0 0 0 .178 2.562c.235.342 1.033.827.675 1.094c-.567.424-1.277-.452-1.636-.776c-1.4-1.264-2.711-1.313-4.492-1.074a9 9 0 0 1-4.883-.708A9.47 9.47 0 0 1 3.687 8.4M19.941 30a3.6 3.6 0 0 1-2.325-.817c.469-.092 1.021.025 1.508-.044a9.7 9.7 0 0 0 1.754-.43a10.5 10.5 0 0 0 3.022-1.554a6.55 6.55 0 0 0 2.757-5.214c.149-.088.316 1.034.319 1.091a5.8 5.8 0 0 1-.19 1.727a6.9 6.9 0 0 1-1.423 2.774A7.3 7.3 0 0 1 19.941 30"/><path fill="#d2d2d2" d="M18.962 19.109a5.8 5.8 0 0 1-2.05.859a13.4 13.4 0 0 1-2.224.549a8.86 8.86 0 0 1-4.435-.51a9.94 9.94 0 0 1-3.849-2.4c-.352-.367-2.104-2.417-1.548-3.05c.248-.282.875.846 1 .992a5 5 0 0 0 1.357 1.11a10.9 10.9 0 0 0 4.035 1.456a6.7 6.7 0 0 0 2.34-.094a13 13 0 0 1 1.694-.485a4 4 0 0 1 2.113.457c.344.17 1.523.743 1.567 1.116m9.351-4.031a19.3 19.3 0 0 1-.453 3.774c-.176-.242.016-1.47 0-1.792a6 6 0 0 0-.384-2.087a4.9 4.9 0 0 0-1.376-1.661a15 15 0 0 1-1.27-1.536c-1.837-2.382-3.245-5.211-2.9-8.3c.034-.308.069-1.448.411-1.445c.152 0 .266 1.561.29 1.718a12.5 12.5 0 0 0 1.224 4.116c.67 1.222 1.947 2.023 2.825 3.1a6.58 6.58 0 0 1 1.633 4.113M15.7 26.935a10.85 10.85 0 0 0 6.436-.687a6.94 6.94 0 0 0 4.278-4.418c.319.2-.048 1.529-.128 1.781a5.7 5.7 0 0 1-1.01 1.813a8.9 8.9 0 0 1-3.257 2.514c-1.703.772-5.662 1.652-6.319-1.003"/><path fill="#d2d2d2" d="M19.151 19.376c.367 2.107-2.957 3.124-4.478 3.213c-1.859.11-4.929-.292-6.06-2.031c-.673-1.035.781-.09 1.188.058a8.7 8.7 0 0 0 3.06.5a11.6 11.6 0 0 0 3.305-.5a14 14 0 0 0 1.533-.576c.301-.132 1.124-.691 1.452-.664m4.991 4.084c.4-.945-1.883-1.578-2.445-1.858a4.9 4.9 0 0 1-1.315-.867c-.181-.181-.872-.92-.807-1.219a5 5 0 0 1 1.087-.175a6 6 0 0 1 .855.588a10 10 0 0 0 .964.5a16 16 0 0 0 2.119.771c.308.09 1.549.208 1.727.428c-.04.296-1.97 2.021-2.185 1.832"/><path fill="#d2d2d2" d="M26.1 22.172c.265.43-1.08 1.831-1.363 2.105a9.3 9.3 0 0 1-2.566 1.728a7.8 7.8 0 0 1-2.56.753c-.679.058-1.966-.124-2.141-.979a7 7 0 0 1 1.177-.086c.462-.059.921-.149 1.376-.246a13 13 0 0 0 2.184-.645a11.5 11.5 0 0 0 2.084-1.11a11 11 0 0 0 1.078-.822c.105-.089.617-.702.731-.698m-7.342-10.207c-.1-1.308 2.612-1.3 3.271-1.092a5.98 5.98 0 0 1 2.982 2.475c-1.082.8-2.449.094-3.3-.654a4.3 4.3 0 0 0-1.481-1.029c-.809-.265-.818.094-1.472.3"/><path fill="#d2d2d2" d="M25.783 13.341c-.444-.029-.316.071-.647-.212c-.358-.307-.614-.795-.945-1.141c-.534-.558-1.242-.895-1.723-1.485a7.27 7.27 0 0 1-1.624-4.848c.018-1.489.407.187.551.675a12.3 12.3 0 0 0 1.126 2.708a46 46 0 0 0 3.4 4.321c-.039.002-.097-.021-.138-.018m-5.715 1.415c.033-.625-.911-.792-1.211-1.42c-.164-.343-.211-.569.029-.7c.082-.045.383.012.5-.02c.271-.076.335-.273.581-.4a1.193 1.193 0 0 1 1.633 1.021a1.82 1.82 0 0 1-1.532 1.519"/><path fill="#d2d2d2" d="M20.5 14.745a1.93 1.93 0 0 0 1.323-1.7c.524.139.928.658 1.521.771a2.6 2.6 0 0 0 1.029-.017c.207-.045.54-.274.721-.259c-.033.163-.464.546-.565.717a4.2 4.2 0 0 0-.388.9c-.229.741-.061.739-.709.311a4.3 4.3 0 0 0-1.957-.72c-.266-.026-.881.019-.975-.003m-.595 5.989a2.01 2.01 0 0 1-1.4 1.712c-.205.091-2.018.733-2.032.348c-.007-.2 1.624-.954 1.809-1.11a3.4 3.4 0 0 0 .867-1.071c.055-.112.232-.925.271-.943c.224-.106.488.93.485 1.064m-8.532-8.202a10.6 10.6 0 0 1 3.71-.914a10.3 10.3 0 0 1 1.865.024c.366.039 1.469.054 1.74.343a.255.255 0 0 1-.273.173c-.037.077.251.371.3.425c-.034.034-1.445-.4-1.572-.424a10.6 10.6 0 0 0-2.282-.134a16 16 0 0 0-1.841.194a6.2 6.2 0 0 1-1.647.313m11.139-1.801a1.89 1.89 0 0 1-1.517-.6c-.247-.349-.737-1.692-.385-2.021c.209-.2.384.662.484.846a11 11 0 0 0 1.418 1.775m5.276 8.469a19 19 0 0 1-.749 3.313c-.173-.077-.275-.778-.562-.95a4.1 4.1 0 0 0 .76-1.154c.152-.302.303-1.046.551-1.209m-7.807-7.357c-.132.268-.932 1.1-1.118.481c-.107-.356.876-.841 1.118-.481m-.747.45c.228.006.012-.248.012-.266c-.001-.043-.368.266-.012.266"/></svg>';case"julia":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#a6d189" d="M10.5 5a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0" />\n <path stroke="#e78284" d="M6.5 11a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0" />\n <path stroke="#ca9ee6" d="M14.5 11a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0" />\n </g>\n</svg>\n';case"elixir":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M8.03 14.5C5 14.5 3.5 12.49 3.5 10.01c0-2.82 2.25-7.02 4.62-8.48a.24.24 0 01.24 0c.08.04.12.12.11.2-.13 1.25.22 2.5.98 3.54.3.43.63.8 1.02 1.27.54.66.94 1.03 1.52 2.08l.01.02c.33.56.5 1.2.5 1.84 0 2.03-1.69 4.02-4.47 4.02" />\n</svg>\n';case"vb.net":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<path fill="#00519a" d="M6.67 7.836L9 18.915l2.336-11.079H16l-4.664 16.328H6.672L2 7.836Zm11.661 0h7.6a4.08 4.08 0 0 1 2.9 1.749a3.8 3.8 0 0 1 .571 2.04a4 4 0 0 1-.571 2.034a4.1 4.1 0 0 1-2.341 1.763a4.1 4.1 0 0 1 2.929 1.756a3.8 3.8 0 0 1 .58 2.1a4.66 4.66 0 0 1-.579 2.546a5.05 5.05 0 0 1-3.5 2.338h-7.589ZM23 14.252h1.166a1.754 1.754 0 0 0 0-3.5H23Zm0 7h1.39a2.047 2.047 0 0 0 0-4.089H23Z"/></svg>';case"nim":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M1 7 .5 4.5l1.01.67c.28-.27.47-.48 1.18-.85l.56-1.82L4.5 3.84c.77-.18 1.53-.36 2.4-.33L8 1.5l1.1 2.01c.87-.03 1.63.15 2.4.33l1.25-1.34.56 1.82c.7.37.9.58 1.18.85l1.01-.67L15 7m-1.5 1C13 6.5 11 5.5 8 5.5S3 6.5 2.5 8m11.5.75L13.5 8l-1 1.5-1.5.5-3-1.5L5 10l-1.5-.5-1-1.5-.5.75L1 7l1.25 3.75C3 12.75 6 13.5 8 13.5s5-.75 5.75-2.75L15 7z" />\n</svg>\n';case"crystal":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round" d="m 15.4712,10.050637 -5.433601,5.433968 c -0.015,0.01505 -0.04554,0.01505 -0.09055,0.01505 L 2.536327,13.517264 c -0.015,0 -0.04501,-0.01505 -0.06055,-0.06072 L 0.50026325,6.0396501 a 0.21432208,0.21495127 0 0 1 0.015,-0.090817 L 5.9483283,0.5154023 c 0.015,-0.0150465 0.04501,-0.0150465 0.09055,-0.0150465 l 7.4101857,1.997972 c 0.015,0 0.04501,0.015046 0.06055,0.060724 l 1.977121,7.4158186 c 0.03001,0.03063 0.01608,0.060724 -0.01554,0.07577 M 8.2121063,4.1480782 0.93801425,6.1154197 q -0.0225,0 0,0.04514 L 6.2655263,11.50371 c 0.015,0.01505 0.015,0 0.04501,0 l 1.962119,-7.2803988 c -0.03054,-0.075233 -0.06055,-0.075233 -0.06055,-0.075233" />\n</svg>\n';case"d":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<defs><linearGradient id="SVGMV3iTbAN" x1="185.455" x2="181.955" y1="1601.641" y2="1630.224" gradientTransform="translate(-62.523 -666.646)scale(.427)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></linearGradient><linearGradient id="SVGniw2Mvsa" x1="176.136" x2="172.636" y1="1600.5" y2="1629.083" href="#SVGMV3iTbAN"/></defs><path fill="#b03931" d="m3.978 15.462l-.009-6.953a.59.59 0 0 1 .531-.562h.076l6.074-.009a15.7 15.7 0 0 1 6.067.95a8.9 8.9 0 0 1 2.244 1.359a4.47 4.47 0 0 1 2.946-1.083a4.11 4.11 0 0 1 4.276 3.92A4.11 4.11 0 0 1 21.907 17c-.089 0-.177-.008-.265-.012a7 7 0 0 1-.232.953a85 85 0 0 1 8.59 2.6V2H2v13.4q.992.02 1.978.062m22.8-7.944a1.32 1.32 0 0 1 1.374 1.259a1.379 1.379 0 0 1-2.747 0a1.32 1.32 0 0 1 1.375-1.26Z"/><path fill="#b03931" d="M17.861 15.787a4.11 4.11 0 0 0-1.748-3.458a5.8 5.8 0 0 0-1.508-.822a7.4 7.4 0 0 0-1.629-.438a22 22 0 0 0-2.588-.1H7.769l.006 4.737a89 89 0 0 1 9.91 1.408a5 5 0 0 0 .176-1.327m3.132 3.192a7.9 7.9 0 0 1-2.128 2.582a9.7 9.7 0 0 1-3.256 1.71a11.6 11.6 0 0 1-1.971.472h-.015a32 32 0 0 1-3.326.111l-5.625.022a.616.616 0 0 1-.686-.681l-.01-7.734Q2.992 15.42 2 15.4V30h28v-9.456a85 85 0 0 0-8.59-2.6a7 7 0 0 1-.417 1.035"/><path fill="url(#SVGMV3iTbAN)" d="M20.993 18.979a7.9 7.9 0 0 1-2.128 2.582a9.7 9.7 0 0 1-3.256 1.71a11.6 11.6 0 0 1-1.971.472h-.015a32 32 0 0 1-3.326.111l-5.625.022a.616.616 0 0 1-.686-.681l-.01-7.734Q2.992 15.42 2 15.4V30h28v-9.456a85 85 0 0 0-8.59-2.6a7 7 0 0 1-.417 1.035" opacity=".3"/><path fill="#b03931" d="M10.477 20.835a16 16 0 0 0 2.877-.2a7.6 7.6 0 0 0 1.628-.5a5.6 5.6 0 0 0 1.187-.748a4.46 4.46 0 0 0 1.518-2.271a89 89 0 0 0-9.91-1.408l.006 5.133Z"/><path fill="url(#SVGniw2Mvsa)" d="M10.477 20.835a16 16 0 0 0 2.877-.2a7.6 7.6 0 0 0 1.628-.5a5.6 5.6 0 0 0 1.187-.748a4.46 4.46 0 0 0 1.518-2.271a89 89 0 0 0-9.91-1.408l.006 5.133Z" opacity=".3"/><path fill="#fff" d="M20.383 11.746a7 7 0 0 1 1.36 4.148a6.6 6.6 0 0 1-.1 1.1c.088 0 .176.012.265.012a4.11 4.11 0 0 0 4.276-3.92a4.11 4.11 0 0 0-4.276-3.92a4.47 4.47 0 0 0-2.946 1.083a8 8 0 0 1 1.421 1.497"/><ellipse cx="26.78" cy="8.777" fill="#fff" rx="1.374" ry="1.259"/><path fill="#fff" d="m4.673 23.877l5.625-.022a32 32 0 0 0 3.326-.111h.015a11.5 11.5 0 0 0 1.971-.472a9.7 9.7 0 0 0 3.256-1.71a7.9 7.9 0 0 0 2.128-2.582a7 7 0 0 0 .417-1.034a7 7 0 0 0 .332-2.051a7 7 0 0 0-1.36-4.148a8 8 0 0 0-1.421-1.5a8.9 8.9 0 0 0-2.244-1.359a15.7 15.7 0 0 0-6.067-.95l-6.074.009h-.076a.59.59 0 0 0-.532.562l.009 6.952l.01 7.734a.616.616 0 0 0 .685.682m3.1-12.908h2.619a22 22 0 0 1 2.588.1a7.4 7.4 0 0 1 1.629.438a5.8 5.8 0 0 1 1.508.822a4.12 4.12 0 0 1 1.748 3.458a5 5 0 0 1-.175 1.327a4.46 4.46 0 0 1-1.518 2.271a5.6 5.6 0 0 1-1.187.748a7.7 7.7 0 0 1-1.628.5a16 16 0 0 1-2.877.2H7.786L7.78 15.7Z"/></svg>';case"applescript":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round" d="M14.4561802 11.3673353C13.0276218 14.1261537 11.8858593 15.5 10.8437759 15.5 10.3588459 15.5 9.88231005 15.3491298 9.41749082 15.0543006 8.74000639 14.6241577 7.8668418 14.6059458 7.17068967 15.0074382 6.60881451 15.3319356 6.07177167 15.5 5.56305868 15.5 4.02887542 15.5 1.5 10.9491129 1.5 8.45090396 1.5 5.78581061 2.95006811 3.551507 5.15647301 3.551507 6.19383481 3.551507 7.09007204 4.20001691 7.84308619 4.497206 8.16210316 4.62512517 8.52255587 4.61592787 8.83410596 4.47192 9.44477141 4.18872223 10.2497236 3.551507 11.2503615 3.551507 12.4715175 3.551507 13.5338865 4.33779342 14.4184071 5.47479877 14.5532906 5.64778615 14.5172013 5.89341518 14.3377895 6.02349446 13.3500923 6.736546 12.8746057 7.53893969 12.8746057 8.45090396 12.8746057 9.36404821 13.3502672 10.1652619 14.3377895 10.8793249 14.4946576 10.992887 14.5445377 11.1984946 14.4561802 11.3673353ZM8.5 3C8.5 3 8.3468635 1.3936039 10 1" />\n</svg>\n';case"solidity":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="m3 11.5 2.5 4 2.5-4 2.5 4 2.5-4-2.5-4-2.5 4m2.5 4h-5m7.5-4H3m10-7-2.5-4-2.5 4-2.5-4-2.5 4 2.5 4 2.5-4M5.5.5h5M3 4.5h10" />\n</svg>\n';case"objectivec":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<path fill="#c2c2c2" d="M11.29 15.976a8.9 8.9 0 0 0 1.039 4.557a4.82 4.82 0 0 0 5.579 2.13a3.79 3.79 0 0 0 2.734-3.181c.095-.535.1-.54.1-.54c1.537.222 4.014.582 5.55.8l-.1.389A9.96 9.96 0 0 1 23.8 24.9a8.35 8.35 0 0 1-4.747 2.378a12.93 12.93 0 0 1-7.322-.725a8.98 8.98 0 0 1-5.106-5.524A14.35 14.35 0 0 1 6.642 10.9a9.32 9.32 0 0 1 7.929-6.24a11.8 11.8 0 0 1 5.9.491a8.47 8.47 0 0 1 5.456 6.1c.083.311.1.369.1.369c-1.709.311-3.821.705-5.518 1.075c-.323-1.695-1.122-3.029-2.831-3.445a4.656 4.656 0 0 0-5.853 3.158a9 9 0 0 0-.341 1.273a11 11 0 0 0-.194 2.295"/><path fill="#c2c2c2" d="M2.033 30V2h5.934v2.227H4.723v23.546h3.244V30zm27.934-.001h-5.934v-2.228h3.244V4.226h-3.244V1.999h5.934z"/></svg>';case"objectivecpp":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<path fill="#c2c2c2" d="M19.5 24.833a11.24 11.24 0 0 1-5.13 1.009a8.37 8.37 0 0 1-6.492-2.576A9.75 9.75 0 0 1 5.512 16.4a10.4 10.4 0 0 1 2.659-7.406a9.02 9.02 0 0 1 6.9-2.841a12.2 12.2 0 0 1 4.43.7v4.129a7.5 7.5 0 0 0-4.108-1.142a5.28 5.28 0 0 0-4.075 1.685A6.48 6.48 0 0 0 9.766 16.1a6.37 6.37 0 0 0 1.464 4.4a5.02 5.02 0 0 0 3.941 1.639a8.03 8.03 0 0 0 4.329-1.223Z"/><path fill="#c2c2c2" d="M16.572 15.081V13.24h1.841v1.841h1.84v1.84h-1.84v1.841h-1.841v-1.841h-1.839V15.08zm6.44 0V13.24h1.841v1.841h1.84v1.84h-1.84v1.841h-1.841v-1.841h-1.839V15.08zM2.035 30V2.001h5.933v2.227H4.725v23.545h3.243V30z"/><path fill="#c2c2c2" d="M29.965 29.999h-5.933v-2.228h3.243V4.227h-3.243V2h5.933z"/></svg>';case"terraform":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="m1.5 6 8 4.25 4-2.25m-12-2V1.5l8 4.25 4-2.25V8m-4-2.25v8.75M5.53 3.82 5.5 12.5l4 2" />\n</svg>\n';case"plain":case"text":case"":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M13.5 6.5v6a2 2 0 01-2 2h-7a2 2 0 01-2-2v-9c0-1.1.9-2 2-2h4.01" />\n <path d="m8.5 1.5 5 5h-4a1 1 0 01-1-1zm-3 10h5m-5-3h5m-5-3h1" />\n </g>\n</svg>\n';default:return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16">\x3c!-- Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE --\x3e<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m10 9l-3 3l3 3m4 0l3-3l-3-3"/><rect width="18" height="18" x="3" y="3" rx="2"/></g></svg>'}}const Jt={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"},Qt={key:0,class:"code-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5",style:{color:"var(--vscode-editor-foreground)","background-color":"var(--vscode-editor-background)"}},eo={class:"flex items-center gap-x-2"},no=["innerHTML"],to={class:"text-sm font-medium font-mono"},oo={class:"flex items-center gap-x-2"},ro=["aria-pressed"],lo=["disabled"],io=["disabled"],ao=["disabled"],so=["aria-label"],co={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},uo={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},mo=["aria-pressed"],ho={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"0.75rem",height:"0.75rem",viewBox:"0 0 24 24"},po={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"0.75rem",height:"0.75rem",viewBox:"0 0 24 24"},fo=["aria-label"],vo=["innerHTML"],go={class:"code-loading-placeholder"},wo=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"MarkdownCodeBlockNode",props:{node:{},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{default:"vitesse-dark"},lightTheme:{default:"vitesse-light"},isDark:{type:Boolean,default:!1},isShowPreview:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{default:void 0},maxWidth:{default:void 0},themes:{},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0}},emits:["previewCode","copy"],setup(e,{emit:n}){var t;const o=e,r=n,{t:l}=rn(),i=T(String(null!=(t=o.node.language)?t:"")),a=T(!1),s=T(!1),c=T(!1),u=T(null),m=T(null),h=T(""),p=T(!1);let g;const w=T(!0),b=T(0),_=T(14),C=T(_.value),j=B(()=>{const e=_.value,n=C.value;return"number"==typeof e&&Number.isFinite(e)&&e>0&&"number"==typeof n&&Number.isFinite(n)&&n>0}),$=B(()=>{const e=i.value.trim().toLowerCase();return Jt[e]||e.charAt(0).toUpperCase()+e.slice(1)}),N=B(()=>Yt(i.value.trim().toLowerCase().split(":")[0])),R=B(()=>{const e=i.value.trim().toLowerCase();return o.isShowPreview&&("html"===e||"svg"===e)}),A=B(()=>{const e={},n=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},t=n(o.minWidth),r=n(o.maxWidth);return t&&(e.minWidth=t),r&&(e.maxWidth=r),e}),z=B(()=>({fontSize:`${C.value}px`}));function P(){return o.isDark?o.darkTheme:o.lightTheme}function V(e){if(null==g||g.disconnect(),g=void 0,!e)return h.value="",void(p.value=!1);var n;h.value=`<pre class="shiki shiki-fallback"><code>${n=e,n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}</code></pre>`,p.value=!1}function W(){h.value="",p.value=!0}function K(){var e;const n=m.value;return!!n&&(n.childNodes.length>0||Boolean(null==(e=n.textContent)?void 0:e.trim().length))}function F(){return d(this,null,function*(){if(yield G(),K())return void W();const e=m.value;e&&(null==g||g.disconnect(),g=new MutationObserver(()=>{K()&&(W(),null==g||g.disconnect(),g=void 0)}),g.observe(e,{childList:!0,subtree:!0}))})}let U,X,q,J;const Q=/* @__PURE__ */new Set,ee=/* @__PURE__ */new Set,ne=void 0!==import.meta&&Boolean(!1);function te(e,n){return d(this,null,function*(){if(!U)return;const t=function(e,n=!1){var t;const[o]=String(null!=e?e:"").split(":"),r=null!=(t=null==o?void 0:o.trim().toLowerCase())?t:"";return r?!J||J.has(r)?r:(n&&ne&&!Q.has(r)&&(Q.add(r),console.warn(`[MarkdownCodeBlockNode] Language "${r}" not preloaded in stream-markdown; falling back to plaintext.`)),"plaintext"):"plaintext"}(n,Boolean(e&&e.length));try{yield U.updateCode(e,t)}catch(o){"plaintext"!==t?(ne&&!ee.has(t)&&(ee.add(t),console.warn(`[MarkdownCodeBlockNode] Failed to render language "${t}", retrying as plaintext.`,o)),yield U.updateCode(e,"plaintext")):ne&&console.warn("[MarkdownCodeBlockNode] Failed to render code block even as plaintext.",o)}})}function oe(){return d(this,null,function*(){yield function(){return d(this,null,function*(){if(!X)try{const e=yield import("stream-markdown");X=e.createShikiStreamRenderer,q=e.registerHighlight;const n=Array.isArray(e.defaultLanguages)?e.defaultLanguages:void 0;J=n?new Set(n.map(e=>e.toLowerCase())):void 0,null==q||q({themes:o.themes})}catch(e){console.warn("[MarkdownCodeBlockNode] stream-markdown not available:",e)}})}(),u.value&&m.value?(null==q||q({themes:o.themes}),!U&&X&&(U=X(m.value,{theme:P()}),p.value=!0),U?!1===o.stream&&o.loading?V(o.node.code):(V(o.node.code),yield te(o.node.code,i.value),yield F()):V(o.node.code)):V(o.node.code)})}function re(){const e=u.value;if(!e||s.value)return;const n=e.scrollTop;n<b.value?w.value=!1:function(e,n=50){return e.scrollHeight-e.scrollTop-e.clientHeight<=n}(e)&&(w.value=!0),b.value=n}function le(){return d(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(o.node.code)),a.value=!0,r("copy",o.node.code),setTimeout(()=>{a.value=!1},1e3)}catch(e){console.error("Copy failed:",e)}})}function ie(e){return!e||e.disabled}function ae(e,n,t="top"){if(ie(e.currentTarget))return;const r=e,l=null!=(null==r?void 0:r.clientX)&&null!=(null==r?void 0:r.clientY)?{x:r.clientX,y:r.clientY}:void 0;en(e.currentTarget,n,t,!1,l,o.isDark)}function se(){nn()}function ce(e){if(ie(e.currentTarget))return;const n=a.value?l("common.copied")||"Copied":l("common.copy")||"Copy",t=e,r=null!=(null==t?void 0:t.clientX)&&null!=(null==t?void 0:t.clientY)?{x:t.clientX,y:t.clientY}:void 0;en(e.currentTarget,n,"top",!1,r,o.isDark)}function de(){s.value=!s.value;const e=u.value;e&&(s.value?(e.style.maxHeight="none",e.style["overflow-y"]="visible",e.style["overflow-x"]="auto"):(e.style.maxHeight="500px",e.style.overflow="auto",w.value=!0,G(()=>{e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})))}function ue(){c.value=!c.value}function me(){if(!R.value)return;const e=(i.value||o.node.language).toLowerCase(),n="html"===e?"HTML Preview":"SVG Preview";r("previewCode",{type:"html"===e?"text/html":"image/svg+xml",content:o.node.code,title:n})}return oe(),I(()=>{oe()}),S(()=>{null==g||g.disconnect(),g=void 0}),L(()=>o.themes,()=>d(null,null,function*(){q&&q({themes:o.themes})})),L(()=>o.loading,e=>{e||oe()}),L(()=>[o.node.code,o.node.language],e=>d(null,[e],function*([e,n]){n!==i.value&&(i.value=n.trim()),u.value&&m.value?(U||(V(e),yield oe()),U&&e&&(!1===o.stream&&o.loading||(V(e),yield te(e,n),yield F()))):V(e)})),L(()=>[o.darkTheme,o.lightTheme],()=>d(null,null,function*(){u.value&&m.value&&(U||(yield oe()),null==U||U.setTheme(P()))})),L(()=>o.node.code,()=>d(null,null,function*(){if(s.value||!w.value)return;yield G();const e=u.value;e&&e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})),(n,t)=>(v(),f("div",{style:D(A.value),class:E(["code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",[o.isDark?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",o.isDark?"is-dark":""]])},[o.showHeader?(v(),f("div",Qt,[O(n.$slots,"header-left",{},()=>[k("div",eo,[k("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:N.value},null,8,no),k("span",to,M($.value),1)])],!0),O(n.$slots,"header-right",{},()=>[k("div",oo,[k("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":c.value,onClick:ue,onMouseenter:t[0]||(t[0]=e=>ae(e,c.value?y(l)("common.expand")||"Expand":y(l)("common.collapse")||"Collapse")),onFocus:t[1]||(t[1]=e=>ae(e,c.value?y(l)("common.expand")||"Expand":y(l)("common.collapse")||"Collapse")),onMouseleave:se,onBlur:se},[(v(),f("svg",{style:D({rotate:c.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[...t[17]||(t[17]=[k("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,ro),o.showFontSizeButtons&&o.enableFontSizeControl?(v(),f(x,{key:0},[k("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!!Number.isFinite(C.value)&&C.value<=10,onClick:t[2]||(t[2]=e=>function(){const e=Math.max(10,C.value-1);C.value=e}()),onMouseenter:t[3]||(t[3]=e=>ae(e,y(l)("common.decrease")||"Decrease")),onFocus:t[4]||(t[4]=e=>ae(e,y(l)("common.decrease")||"Decrease")),onMouseleave:se,onBlur:se},[...t[18]||(t[18]=[k("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[k("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)])],40,lo),k("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!j.value||C.value===_.value,onClick:t[5]||(t[5]=e=>{C.value=_.value}),onMouseenter:t[6]||(t[6]=e=>ae(e,y(l)("common.reset")||"Reset")),onFocus:t[7]||(t[7]=e=>ae(e,y(l)("common.reset")||"Reset")),onMouseleave:se,onBlur:se},[...t[19]||(t[19]=[k("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[k("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[k("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),k("path",{d:"M3 3v5h5"})])],-1)])],40,io),k("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!!Number.isFinite(C.value)&&C.value>=36,onClick:t[8]||(t[8]=e=>function(){const e=Math.min(36,C.value+1);C.value=e}()),onMouseenter:t[9]||(t[9]=e=>ae(e,y(l)("common.increase")||"Increase")),onFocus:t[10]||(t[10]=e=>ae(e,y(l)("common.increase")||"Increase")),onMouseleave:se,onBlur:se},[...t[20]||(t[20]=[k("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[k("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)])],40,ao)],64)):H("",!0),o.showCopyButton?(v(),f("button",{key:1,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":a.value?y(l)("common.copied")||"Copied":y(l)("common.copy")||"Copy",onClick:le,onMouseenter:t[11]||(t[11]=e=>ce(e)),onFocus:t[12]||(t[12]=e=>ce(e)),onMouseleave:se,onBlur:se},[a.value?(v(),f("svg",uo,[...t[22]||(t[22]=[k("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(v(),f("svg",co,[...t[21]||(t[21]=[k("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[k("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),k("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,so)):H("",!0),o.showExpandButton?(v(),f("button",{key:2,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":s.value,onClick:de,onMouseenter:t[13]||(t[13]=e=>ae(e,s.value?y(l)("common.collapse")||"Collapse":y(l)("common.expand")||"Expand")),onFocus:t[14]||(t[14]=e=>ae(e,s.value?y(l)("common.collapse")||"Collapse":y(l)("common.expand")||"Expand")),onMouseleave:se,onBlur:se},[s.value?(v(),f("svg",ho,[...t[23]||(t[23]=[k("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])])):(v(),f("svg",po,[...t[24]||(t[24]=[k("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])]))],40,mo)):H("",!0),R.value&&o.showPreviewButton?(v(),f("button",{key:3,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":y(l)("common.preview")||"Preview",onClick:me,onMouseenter:t[15]||(t[15]=e=>ae(e,y(l)("common.preview")||"Preview")),onFocus:t[16]||(t[16]=e=>ae(e,y(l)("common.preview")||"Preview")),onMouseleave:se,onBlur:se},[...t[25]||(t[25]=[k("svg",{"data-v-3d59cc65":"",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[k("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[k("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),k("circle",{cx:"12",cy:"12",r:"3"})])],-1)])],40,fo)):H("",!0)])],!0)])):H("",!0),Z(k("div",{ref_key:"codeBlockContent",ref:u,class:"code-block-content",style:D(z.value),onScroll:re},[k("div",{ref_key:"rendererTarget",ref:m,class:"code-block-render"},null,512),p.value?H("",!0):(v(),f("div",{key:0,class:"code-fallback-plain",innerHTML:h.value},null,8,vo))],36),[[Y,!(c.value||!e.stream&&e.loading)]]),Z(k("div",go,[O(n.$slots,"loading",{loading:e.loading,stream:e.stream},()=>[t[26]||(t[26]=k("div",{class:"loading-skeleton"},[k("div",{class:"skeleton-line"}),k("div",{class:"skeleton-line"}),k("div",{class:"skeleton-line short"})],-1))],!0)],512),[[Y,!e.stream&&e.loading]])],6))}}),[["__scopeId","data-v-9411928c"]]);wo.install=e=>{e.component(wo.__name,wo)};const yo=()=>import("./index8.js");let ko=null,xo=yo;function bo(e){xo=e,ko=null}function Mo(e){bo(null!=e?e:yo)}function _o(){bo(null)}function Co(){return"function"==typeof xo}function Bo(){return d(this,null,function*(){if(ko)return ko;const e=xo;if(!e)return null;let n;try{n=yield e()}catch(t){if(e===yo)throw new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.');throw t}return n?(ko=function(e){var n;if(!e)return e;if(e.D2&&"function"==typeof e.D2)return e.D2;if(e.default&&e.default.D2&&"function"==typeof e.default.D2)return e.default.D2;const t=null!=(n=e.default)?n:e;return"function"==typeof t?t:(null==t?void 0:t.D2)&&"function"==typeof t.D2?t.D2:t}(n),ko):null})}const To=()=>import("mermaid");let Lo=null,Io=To;function So(e){Io=e,Lo=null}function Eo(e){So(null!=e?e:To)}function jo(){So(null)}function $o(){return"function"==typeof Io}function No(e){if(!e)return e;const n=e&&e.default?e.default:e;if(n&&("function"==typeof n.render||"function"==typeof n.parse||"function"==typeof n.initialize))return n;if(n&&n.mermaidAPI&&("function"==typeof n.mermaidAPI.render||"function"==typeof n.mermaidAPI.parse)){const e=n.mermaidAPI;return s(a({},n),{render:e.render.bind(e),parse:e.parse?e.parse.bind(e):void 0,initialize:t=>"function"==typeof n.initialize?n.initialize(t):e.initialize?e.initialize(t):void 0})}return e.mermaid&&"function"==typeof e.mermaid.render?e.mermaid:n}function Ho(e){if(e)try{const n=null==e?void 0:e.initialize;e.initialize=t=>{const o=a({suppressErrorRendering:!0},t||{});return"function"==typeof n?n.call(e,o):(null==e?void 0:e.mermaidAPI)&&"function"==typeof e.mermaidAPI.initialize?e.mermaidAPI.initialize(o):void 0}}catch(n){}}function Ro(){return d(this,null,function*(){if(Lo)return Lo;const e=function(){try{const e=globalThis;return No(null==e?void 0:e.mermaid)}catch(e){return null}}();if(e)return Lo=e,Ho(Lo),Lo;const n=Io;if(!n)return null;let t;try{t=yield n()}catch(o){if(n===To)throw new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.');throw o}return t?(Lo=No(t),Ho(Lo),Lo):null})}const Ao=Math.min,Do=Math.max,Oo=Math.round,zo=Math.floor,Po=e=>({x:e,y:e}),Vo={left:"right",right:"left",bottom:"top",top:"bottom"},Wo={start:"end",end:"start"};function Ko(e,n,t){return Do(e,Ao(n,t))}function Fo(e,n){return"function"==typeof e?e(n):e}function Uo(e){return e.split("-")[0]}function Xo(e){return e.split("-")[1]}function qo(e){return"x"===e?"y":"x"}function Go(e){return"y"===e?"height":"width"}const Zo=/* @__PURE__ */new Set(["top","bottom"]);function Yo(e){return Zo.has(Uo(e))?"y":"x"}function Jo(e){return qo(Yo(e))}function Qo(e){return e.replace(/start|end/g,e=>Wo[e])}const er=["left","right"],nr=["right","left"],tr=["top","bottom"],or=["bottom","top"];function rr(e){return e.replace(/left|right|bottom|top/g,e=>Vo[e])}function lr(e){const{x:n,y:t,width:o,height:r}=e;return{width:o,height:r,top:t,left:n,right:n+o,bottom:t+r,x:n,y:t}}function ir(e,n,t){let{reference:o,floating:r}=e;const l=Yo(n),i=Jo(n),a=Go(i),s=Uo(n),c="y"===l,d=o.x+o.width/2-r.width/2,u=o.y+o.height/2-r.height/2,m=o[a]/2-r[a]/2;let h;switch(s){case"top":h={x:d,y:o.y-r.height};break;case"bottom":h={x:d,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:u};break;case"left":h={x:o.x-r.width,y:u};break;default:h={x:o.x,y:o.y}}switch(Xo(n)){case"start":h[i]-=m*(t&&c?-1:1);break;case"end":h[i]+=m*(t&&c?-1:1)}return h}function ar(e,n){return d(this,null,function*(){var t;void 0===n&&(n={});const{x:o,y:r,platform:l,rects:i,elements:s,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:m="floating",altBoundary:h=!1,padding:p=0}=Fo(n,e),f=function(e){return"number"!=typeof e?function(e){return a({top:0,right:0,bottom:0,left:0},e)}(e):{top:e,right:e,bottom:e,left:e}}(p),v=s[h?"floating"===m?"reference":"floating":m],g=lr(yield l.getClippingRect({element:null==(t=yield null==l.isElement?void 0:l.isElement(v))||t?v:v.contextElement||(yield null==l.getDocumentElement?void 0:l.getDocumentElement(s.floating)),boundary:d,rootBoundary:u,strategy:c})),w="floating"===m?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,y=yield null==l.getOffsetParent?void 0:l.getOffsetParent(s.floating),k=(yield null==l.isElement?void 0:l.isElement(y))&&(yield null==l.getScale?void 0:l.getScale(y))||{x:1,y:1},x=lr(l.convertOffsetParentRelativeRectToViewportRelativeRect?yield l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:y,strategy:c}):w);return{top:(g.top-x.top+f.top)/k.y,bottom:(x.bottom-g.bottom+f.bottom)/k.y,left:(g.left-x.left+f.left)/k.x,right:(x.right-g.right+f.right)/k.x}})}const sr=/* @__PURE__ */new Set(["left","top"]);function cr(){return"undefined"!=typeof window}function dr(e){return hr(e)?(e.nodeName||"").toLowerCase():"#document"}function ur(e){var n;return(null==e||null==(n=e.ownerDocument)?void 0:n.defaultView)||window}function mr(e){var n;return null==(n=(hr(e)?e.ownerDocument:e.document)||window.document)?void 0:n.documentElement}function hr(e){return!!cr()&&(e instanceof Node||e instanceof ur(e).Node)}function pr(e){return!!cr()&&(e instanceof Element||e instanceof ur(e).Element)}function fr(e){return!!cr()&&(e instanceof HTMLElement||e instanceof ur(e).HTMLElement)}function vr(e){return!(!cr()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof ur(e).ShadowRoot)}const gr=/* @__PURE__ */new Set(["inline","contents"]);function wr(e){const{overflow:n,overflowX:t,overflowY:o,display:r}=Sr(e);return/auto|scroll|overlay|hidden|clip/.test(n+o+t)&&!gr.has(r)}const yr=/* @__PURE__ */new Set(["table","td","th"]);function kr(e){return yr.has(dr(e))}const xr=[":popover-open",":modal"];function br(e){return xr.some(n=>{try{return e.matches(n)}catch(t){return!1}})}const Mr=["transform","translate","scale","rotate","perspective"],_r=["transform","translate","scale","rotate","perspective","filter"],Cr=["paint","layout","strict","content"];function Br(e){const n=Tr(),t=pr(e)?Sr(e):e;return Mr.some(e=>!!t[e]&&"none"!==t[e])||!!t.containerType&&"normal"!==t.containerType||!n&&!!t.backdropFilter&&"none"!==t.backdropFilter||!n&&!!t.filter&&"none"!==t.filter||_r.some(e=>(t.willChange||"").includes(e))||Cr.some(e=>(t.contain||"").includes(e))}function Tr(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Lr=/* @__PURE__ */new Set(["html","body","#document"]);function Ir(e){return Lr.has(dr(e))}function Sr(e){return ur(e).getComputedStyle(e)}function Er(e){return pr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jr(e){if("html"===dr(e))return e;const n=e.assignedSlot||e.parentNode||vr(e)&&e.host||mr(e);return vr(n)?n.host:n}function $r(e){const n=jr(e);return Ir(n)?e.ownerDocument?e.ownerDocument.body:e.body:fr(n)&&wr(n)?n:$r(n)}function Nr(e,n,t){var o;void 0===n&&(n=[]),void 0===t&&(t=!0);const r=$r(e),l=r===(null==(o=e.ownerDocument)?void 0:o.body),i=ur(r);if(l){const e=Hr(i);return n.concat(i,i.visualViewport||[],wr(r)?r:[],e&&t?Nr(e):[])}return n.concat(r,Nr(r,[],t))}function Hr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Rr(e){const n=Sr(e);let t=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const r=fr(e),l=r?e.offsetWidth:t,i=r?e.offsetHeight:o,a=Oo(t)!==l||Oo(o)!==i;return a&&(t=l,o=i),{width:t,height:o,$:a}}function Ar(e){return pr(e)?e:e.contextElement}function Dr(e){const n=Ar(e);if(!fr(n))return Po(1);const t=n.getBoundingClientRect(),{width:o,height:r,$:l}=Rr(n);let i=(l?Oo(t.width):t.width)/o,a=(l?Oo(t.height):t.height)/r;return i&&Number.isFinite(i)||(i=1),a&&Number.isFinite(a)||(a=1),{x:i,y:a}}const Or=/* @__PURE__ */Po(0);function zr(e){const n=ur(e);return Tr()&&n.visualViewport?{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}:Or}function Pr(e,n,t,o){void 0===n&&(n=!1),void 0===t&&(t=!1);const r=e.getBoundingClientRect(),l=Ar(e);let i=Po(1);n&&(o?pr(o)&&(i=Dr(o)):i=Dr(e));const a=function(e,n,t){return void 0===n&&(n=!1),!(!t||n&&t!==ur(e))&&n}(l,t,o)?zr(l):Po(0);let s=(r.left+a.x)/i.x,c=(r.top+a.y)/i.y,d=r.width/i.x,u=r.height/i.y;if(l){const e=ur(l),n=o&&pr(o)?ur(o):o;let t=e,r=Hr(t);for(;r&&o&&n!==t;){const e=Dr(r),n=r.getBoundingClientRect(),o=Sr(r),l=n.left+(r.clientLeft+parseFloat(o.paddingLeft))*e.x,i=n.top+(r.clientTop+parseFloat(o.paddingTop))*e.y;s*=e.x,c*=e.y,d*=e.x,u*=e.y,s+=l,c+=i,t=ur(r),r=Hr(t)}}return lr({width:d,height:u,x:s,y:c})}function Vr(e,n){const t=Er(e).scrollLeft;return n?n.left+t:Pr(mr(e)).left+t}function Wr(e,n){const t=e.getBoundingClientRect();return{x:t.left+n.scrollLeft-Vr(e,t),y:t.top+n.scrollTop}}const Kr=/* @__PURE__ */new Set(["absolute","fixed"]);function Fr(e,n,t){let o;if("viewport"===n)o=function(e,n){const t=ur(e),o=mr(e),r=t.visualViewport;let l=o.clientWidth,i=o.clientHeight,a=0,s=0;if(r){l=r.width,i=r.height;const e=Tr();(!e||e&&"fixed"===n)&&(a=r.offsetLeft,s=r.offsetTop)}const c=Vr(o);if(c<=0){const e=o.ownerDocument,n=e.body,t=getComputedStyle(n),r="CSS1Compat"===e.compatMode&&parseFloat(t.marginLeft)+parseFloat(t.marginRight)||0,i=Math.abs(o.clientWidth-n.clientWidth-r);i<=25&&(l-=i)}else c<=25&&(l+=c);return{width:l,height:i,x:a,y:s}}(e,t);else if("document"===n)o=function(e){const n=mr(e),t=Er(e),o=e.ownerDocument.body,r=Do(n.scrollWidth,n.clientWidth,o.scrollWidth,o.clientWidth),l=Do(n.scrollHeight,n.clientHeight,o.scrollHeight,o.clientHeight);let i=-t.scrollLeft+Vr(e);const a=-t.scrollTop;return"rtl"===Sr(o).direction&&(i+=Do(n.clientWidth,o.clientWidth)-r),{width:r,height:l,x:i,y:a}}(mr(e));else if(pr(n))o=function(e,n){const t=Pr(e,!0,"fixed"===n),o=t.top+e.clientTop,r=t.left+e.clientLeft,l=fr(e)?Dr(e):Po(1);return{width:e.clientWidth*l.x,height:e.clientHeight*l.y,x:r*l.x,y:o*l.y}}(n,t);else{const t=zr(e);o={x:n.x-t.x,y:n.y-t.y,width:n.width,height:n.height}}return lr(o)}function Ur(e,n){const t=jr(e);return!(t===n||!pr(t)||Ir(t))&&("fixed"===Sr(t).position||Ur(t,n))}function Xr(e,n,t){const o=fr(n),r=mr(n),l="fixed"===t,i=Pr(e,!0,l,n);let a={scrollLeft:0,scrollTop:0};const s=Po(0);function c(){s.x=Vr(r)}if(o||!o&&!l)if(("body"!==dr(n)||wr(r))&&(a=Er(n)),o){const e=Pr(n,!0,l,n);s.x=e.x+n.clientLeft,s.y=e.y+n.clientTop}else r&&c();l&&!o&&r&&c();const d=!r||o||l?Po(0):Wr(r,a);return{x:i.left+a.scrollLeft-s.x-d.x,y:i.top+a.scrollTop-s.y-d.y,width:i.width,height:i.height}}function qr(e){return"static"===Sr(e).position}function Gr(e,n){if(!fr(e)||"fixed"===Sr(e).position)return null;if(n)return n(e);let t=e.offsetParent;return mr(e)===t&&(t=t.ownerDocument.body),t}function Zr(e,n){const t=ur(e);if(br(e))return t;if(!fr(e)){let n=jr(e);for(;n&&!Ir(n);){if(pr(n)&&!qr(n))return n;n=jr(n)}return t}let o=Gr(e,n);for(;o&&kr(o)&&qr(o);)o=Gr(o,n);return o&&Ir(o)&&qr(o)&&!Br(o)?t:o||function(e){let n=jr(e);for(;fr(n)&&!Ir(n);){if(Br(n))return n;if(br(n))return null;n=jr(n)}return null}(e)||t}const Yr={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:n,rect:t,offsetParent:o,strategy:r}=e;const l="fixed"===r,i=mr(o),a=!!n&&br(n.floating);if(o===i||a&&l)return t;let s={scrollLeft:0,scrollTop:0},c=Po(1);const d=Po(0),u=fr(o);if((u||!u&&!l)&&(("body"!==dr(o)||wr(i))&&(s=Er(o)),fr(o))){const e=Pr(o);c=Dr(o),d.x=e.x+o.clientLeft,d.y=e.y+o.clientTop}const m=!i||u||l?Po(0):Wr(i,s);return{width:t.width*c.x,height:t.height*c.y,x:t.x*c.x-s.scrollLeft*c.x+d.x+m.x,y:t.y*c.y-s.scrollTop*c.y+d.y+m.y}},getDocumentElement:mr,getClippingRect:function(e){let{element:n,boundary:t,rootBoundary:o,strategy:r}=e;const l=[..."clippingAncestors"===t?br(n)?[]:function(e,n){const t=n.get(e);if(t)return t;let o=Nr(e,[],!1).filter(e=>pr(e)&&"body"!==dr(e)),r=null;const l="fixed"===Sr(e).position;let i=l?jr(e):e;for(;pr(i)&&!Ir(i);){const n=Sr(i),t=Br(i);t||"fixed"!==n.position||(r=null),(l?!t&&!r:!t&&"static"===n.position&&r&&Kr.has(r.position)||wr(i)&&!t&&Ur(e,i))?o=o.filter(e=>e!==i):r=n,i=jr(i)}return n.set(e,o),o}(n,this._c):[].concat(t),o],i=l[0],a=l.reduce((e,t)=>{const o=Fr(n,t,r);return e.top=Do(o.top,e.top),e.right=Ao(o.right,e.right),e.bottom=Ao(o.bottom,e.bottom),e.left=Do(o.left,e.left),e},Fr(n,i,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Zr,getElementRects:function(e){return d(this,null,function*(){const n=this.getOffsetParent||Zr,t=this.getDimensions,o=yield t(e.floating);return{reference:Xr(e.reference,yield n(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:n,height:t}=Rr(e);return{width:n,height:t}},getScale:Dr,isElement:pr,isRTL:function(e){return"rtl"===Sr(e).direction}};function Jr(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function Qr(e,n,t,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:l=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:d=!1}=o,u=Ar(e),m=r||l?[...u?Nr(u):[],...Nr(n)]:[];m.forEach(e=>{r&&e.addEventListener("scroll",t,{passive:!0}),l&&e.addEventListener("resize",t)});const h=u&&c?function(e,n){let t,o=null;const r=mr(e);function l(){var e;clearTimeout(t),null==(e=o)||e.disconnect(),o=null}return function i(c,d){void 0===c&&(c=!1),void 0===d&&(d=1),l();const u=e.getBoundingClientRect(),{left:m,top:h,width:p,height:f}=u;if(c||n(),!p||!f)return;const v={rootMargin:-zo(h)+"px "+-zo(r.clientWidth-(m+p))+"px "+-zo(r.clientHeight-(h+f))+"px "+-zo(m)+"px",threshold:Do(0,Ao(1,d))||1};let g=!0;function w(n){const o=n[0].intersectionRatio;if(o!==d){if(!g)return i();o?i(!1,o):t=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==o||Jr(u,e.getBoundingClientRect())||i(),g=!1}try{o=new IntersectionObserver(w,s(a({},v),{root:r.ownerDocument}))}catch(y){o=new IntersectionObserver(w,v)}o.observe(e)}(!0),l}(u,t):null;let p,f=-1,v=null;i&&(v=new ResizeObserver(e=>{let[o]=e;o&&o.target===u&&v&&(v.unobserve(n),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=v)||e.observe(n)})),t()}),u&&!d&&v.observe(u),v.observe(n));let g=d?Pr(e):null;return d&&function n(){const o=Pr(e);g&&!Jr(g,o)&&t(),g=o,p=requestAnimationFrame(n)}(),t(),()=>{var e;m.forEach(e=>{r&&e.removeEventListener("scroll",t),l&&e.removeEventListener("resize",t)}),null==h||h(),null==(e=v)||e.disconnect(),v=null,d&&cancelAnimationFrame(p)}}const el=function(e){return void 0===e&&(e={}),{name:"shift",options:e,fn(n){return d(this,null,function*(){const{x:t,y:o,placement:r,platform:l}=n,i=Fo(e,n),{mainAxis:d=!0,crossAxis:u=!1,limiter:m={fn:e=>{let{x:n,y:t}=e;return{x:n,y:t}}}}=i,h=c(i,["mainAxis","crossAxis","limiter"]),p={x:t,y:o},f=yield l.detectOverflow(n,h),v=Yo(Uo(r)),g=qo(v);let w=p[g],y=p[v];if(d){const e="y"===g?"bottom":"right";w=Ko(w+f["y"===g?"top":"left"],w,w-f[e])}if(u){const e="y"===v?"bottom":"right";y=Ko(y+f["y"===v?"top":"left"],y,y-f[e])}const k=m.fn(s(a({},n),{[g]:w,[v]:y}));return s(a({},k),{data:{x:k.x-t,y:k.y-o,enabled:{[g]:d,[v]:u}}})})}}},nl=function(e){return void 0===e&&(e={}),{name:"flip",options:e,fn(n){return d(this,null,function*(){var t,o;const{placement:r,middlewareData:l,rects:i,initialPlacement:a,platform:s,elements:d}=n,u=Fo(e,n),{mainAxis:m=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:g=!0}=u,w=c(u,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if(null!=(t=l.arrow)&&t.alignmentOffset)return{};const y=Uo(r),k=Yo(a),x=Uo(a)===a,b=yield null==s.isRTL?void 0:s.isRTL(d.floating),M=p||(x||!g?[rr(a)]:function(e){const n=rr(e);return[Qo(e),n,Qo(n)]}(a)),_="none"!==v;!p&&_&&M.push(...function(e,n,t,o){const r=Xo(e);let l=function(e,n,t){switch(e){case"top":case"bottom":return t?n?nr:er:n?er:nr;case"left":case"right":return n?tr:or;default:return[]}}(Uo(e),"start"===t,o);return r&&(l=l.map(e=>e+"-"+r),n&&(l=l.concat(l.map(Qo)))),l}(a,g,v,b));const C=[a,...M],B=yield s.detectOverflow(n,w),T=[];let L=(null==(o=l.flip)?void 0:o.overflows)||[];if(m&&T.push(B[y]),h){const e=function(e,n,t){void 0===t&&(t=!1);const o=Xo(e),r=Jo(e),l=Go(r);let i="x"===r?o===(t?"end":"start")?"right":"left":"start"===o?"bottom":"top";return n.reference[l]>n.floating[l]&&(i=rr(i)),[i,rr(i)]}(r,i,b);T.push(B[e[0]],B[e[1]])}if(L=[...L,{placement:r,overflows:T}],!T.every(e=>e<=0)){var I,S;const e=((null==(I=l.flip)?void 0:I.index)||0)+1,n=C[e];if(n&&("alignment"!==h||k===Yo(n)||L.every(e=>Yo(e.placement)!==k||e.overflows[0]>0)))return{data:{index:e,overflows:L},reset:{placement:n}};let t=null==(S=L.filter(e=>e.overflows[0]<=0).sort((e,n)=>e.overflows[1]-n.overflows[1])[0])?void 0:S.placement;if(!t)switch(f){case"bestFit":{var E;const e=null==(E=L.filter(e=>{if(_){const n=Yo(e.placement);return n===k||"y"===n}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,n)=>e+n,0)]).sort((e,n)=>e[1]-n[1])[0])?void 0:E[0];e&&(t=e);break}case"initialPlacement":t=a}if(r!==t)return{reset:{placement:t}}}return{}})}}},tl={class:"markstream-vue"},ol=["id"],rl=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(e){const n=e,t=B(()=>{if(void 0!==n.isDark&&null!==n.isDark)return Boolean(n.isDark);if("undefined"!=typeof document)try{if(document.documentElement.classList.contains("dark"))return!0;if((null==window?void 0:window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches)return!0}catch(e){}return!1}),o=T(null),r=T({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),l=T(!1);let i=null;function c(){return d(this,null,function*(){var e,t;if(!n.anchorEl||!o.value)return;const l=[(u=null!=(e=n.offset)?e:8,void 0===u&&(u=0),{name:"offset",options:u,fn(e){return d(this,null,function*(){var n,t;const{x:o,y:r,placement:l,middlewareData:i}=e,c=yield function(e,n){return d(this,null,function*(){const{placement:t,platform:o,elements:r}=e,l=yield null==o.isRTL?void 0:o.isRTL(r.floating),i=Uo(t),a=Xo(t),s="y"===Yo(t),c=sr.has(i)?-1:1,d=l&&s?-1:1,u=Fo(n,e);let{mainAxis:m,crossAxis:h,alignmentAxis:p}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&"number"==typeof p&&(h="end"===a?-1*p:p),s?{x:h*d,y:m*c}:{x:m*c,y:h*d}})}(e,u);return l===(null==(n=i.offset)?void 0:n.placement)&&null!=(t=i.arrow)&&t.alignmentOffset?{}:{x:o+c.x,y:r+c.y,data:s(a({},c),{placement:l})}})}}),nl(),el({padding:8})],{x:i,y:c}=yield((e,n,t)=>{const o=/* @__PURE__ */new Map,r=a({platform:Yr},t),l=s(a({},r.platform),{_c:o});return((e,n,t)=>d(null,null,function*(){const{placement:o="bottom",strategy:r="absolute",middleware:l=[],platform:i}=t,c=l.filter(Boolean),d=yield null==i.isRTL?void 0:i.isRTL(n);let u=yield i.getElementRects({reference:e,floating:n,strategy:r}),{x:m,y:h}=ir(u,o,d),p=o,f={},v=0;for(let t=0;t<c.length;t++){var g;const{name:l,fn:w}=c[t],{x:y,y:k,data:x,reset:b}=yield w({x:m,y:h,initialPlacement:o,placement:p,strategy:r,middlewareData:f,rects:u,platform:s(a({},i),{detectOverflow:null!=(g=i.detectOverflow)?g:ar}),elements:{reference:e,floating:n}});m=null!=y?y:m,h=null!=k?k:h,f=s(a({},f),{[l]:a(a({},f[l]),x)}),b&&v<=50&&(v++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(u=!0===b.rects?yield i.getElementRects({reference:e,floating:n,strategy:r}):b.rects),({x:m,y:h}=ir(u,p,d))),t=-1)}return{x:m,y:h,placement:p,strategy:r,middlewareData:f}}))(e,n,s(a({},r),{platform:l}))})(n.anchorEl,o.value,{placement:null!=(t=n.placement)?t:"top",middleware:l,strategy:"fixed"});var u;r.value.transform=`translate3d(${Math.round(i)}px, ${Math.round(c)}px, 0)`,r.value.left="0px",r.value.top="0px"})}return L(()=>n.visible,e=>d(null,null,function*(){if(e)if(l.value=!1,yield G(),n.anchorEl&&o.value)try{const e=n.anchorEl.getBoundingClientRect();yield c();const t=r.value.transform;if(null!=n.originX&&null!=n.originY){const o=Math.abs(Number(n.originX)-e.left),i=Math.abs(Number(n.originY)-e.top);Math.hypot(o,i)>120?(r.value.transform=`translate3d(${Math.round(n.originX)}px, ${Math.round(n.originY)}px, 0)`,yield G(),l.value=!0,yield G(),r.value.transform=t):l.value=!0}else l.value=!0;i=Qr(n.anchorEl,o.value,c)}catch(t){yield c(),l.value=!0,i=Qr(n.anchorEl,o.value,c)}else l.value=!0;else l.value=!1,i&&(i(),i=null)})),L([()=>n.anchorEl,()=>n.placement,()=>n.content],()=>d(null,null,function*(){n.visible&&n.anchorEl&&o.value&&(yield G(),yield c())})),S(()=>{i&&i()}),(i,a)=>(v(),V(J,{to:"body"},[k("div",tl,[w(R,{name:"tooltip",appear:""},{default:A(()=>[Z(k("div",{id:n.id,ref_key:"tooltip",ref:o,style:D({position:"fixed",left:r.value.left,top:r.value.top,transform:r.value.transform}),class:E(["z-[9999] inline-block text-base py-2 px-3 rounded-md shadow-md whitespace-nowrap pointer-events-none tooltip-element border",[t.value?"bg-gray-900 text-white border-gray-700 border is-dark":"bg-white text-gray-900 border-gray-200 border"]]),role:"tooltip"},M(e.content),15,ol),[[Y,e.visible&&l.value]])]),_:1})])]))}}),[["__scopeId","data-v-d524cc01"]]),ll=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:rl},Symbol.toStringTag,{value:"Module"}));function il(e){return JSON.stringify(e)}function al(e){var n;const t=null!=(n=e.mode)?n:"classic",o=e.katexUrl,r=e.mhchemUrl,l=il(a({throwOnError:!0,displayMode:!0,output:"html",strict:"ignore"},e.renderOptions||{})),i=il(o),s=r?il(r):'""';return"module"===t?`\nlet DEBUG = false\nlet katex = null\nlet katexLoadError = null\nlet loadPromise = null\n\nfunction normalizeKaTeX(mod) {\n const resolved = (mod && mod.default) ? mod.default : mod\n if (resolved && typeof resolved.renderToString === 'function')\n return resolved\n return null\n}\n\nasync function loadKaTeX() {\n if (katex || katexLoadError)\n return\n if (!loadPromise) {\n loadPromise = (async () => {\n try {\n const mod = await import(${i})\n katex = normalizeKaTeX(mod) || null\n const mhchemUrl = ${s}\n if (mhchemUrl) {\n try {\n await import(mhchemUrl)\n }\n catch (e) {\n // ignore optional mhchem load failures\n if (DEBUG)\n console.warn('[katex-cdn-worker] failed to load mhchem', e)\n }\n }\n }\n catch (e) {\n katexLoadError = e\n }\n })()\n }\n await loadPromise\n}\n\nglobalThis.addEventListener('message', async (ev) => {\n const data = ev.data || {}\n if (data.type === 'init') {\n DEBUG = !!data.debug\n if (DEBUG)\n console.debug('[katex-cdn-worker] debug enabled')\n return\n }\n const id = data.id ?? ''\n const content = data.content ?? ''\n const displayMode = data.displayMode ?? true\n\n await loadKaTeX()\n\n if (!katex) {\n const reason = katexLoadError ? String(katexLoadError?.message || katexLoadError) : 'KaTeX is not available in worker'\n globalThis.postMessage({ id, error: reason, content, displayMode })\n return\n }\n\n try {\n const opts = ${l}\n const html = katex.renderToString(content, { ...opts, displayMode: !!displayMode })\n globalThis.postMessage({ id, html, content, displayMode })\n }\n catch (err) {\n const msg = String(err?.message || err)\n globalThis.postMessage({ id, error: msg, content, displayMode })\n }\n})\n`.trimStart():`\nlet DEBUG = false\nlet katex = null\nlet katexLoadError = null\n\nfunction normalizeKaTeX(val) {\n const resolved = (val && val.default) ? val.default : val\n if (resolved && typeof resolved.renderToString === 'function')\n return resolved\n return null\n}\n\nfunction loadKaTeXClassic() {\n if (katex || katexLoadError)\n return\n try {\n importScripts(${i})\n const mhchemUrl = ${s}\n if (mhchemUrl) {\n try {\n importScripts(mhchemUrl)\n }\n catch (e) {\n // ignore optional mhchem load failures\n if (DEBUG)\n console.warn('[katex-cdn-worker] failed to load mhchem', e)\n }\n }\n katex = normalizeKaTeX(globalThis.katex)\n }\n catch (e) {\n katexLoadError = e\n }\n}\n\nloadKaTeXClassic()\n\nglobalThis.addEventListener('message', (ev) => {\n const data = ev.data || {}\n if (data.type === 'init') {\n DEBUG = !!data.debug\n if (DEBUG)\n console.debug('[katex-cdn-worker] debug enabled')\n return\n }\n const id = data.id ?? ''\n const content = data.content ?? ''\n const displayMode = data.displayMode ?? true\n\n if (!katex && !katexLoadError)\n loadKaTeXClassic()\n\n if (!katex) {\n const reason = katexLoadError ? String(katexLoadError?.message || katexLoadError) : 'KaTeX is not available in worker'\n globalThis.postMessage({ id, error: reason, content, displayMode })\n return\n }\n\n try {\n const opts = ${l}\n const html = katex.renderToString(content, { ...opts, displayMode: !!displayMode })\n globalThis.postMessage({ id, html, content, displayMode })\n }\n catch (err) {\n const msg = String(err?.message || err)\n globalThis.postMessage({ id, error: msg, content, displayMode })\n }\n})\n`.trimStart()}function sl(e){var n,t;const o=al(e);if("undefined"==typeof Worker||"undefined"==typeof URL||"undefined"==typeof Blob)return{worker:null,dispose:()=>{},source:o};const r=new Blob([o],{type:"text/javascript"}),l=URL.createObjectURL(r);let i=!1;const c="module"===(null!=(n=e.mode)?n:"classic")?s(a({},null!=(t=e.workerOptions)?t:{}),{type:"module"}):e.workerOptions,d=new Worker(l,c);if(e.debug)try{d.postMessage({type:"init",debug:!0})}catch(u){}return{worker:d,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(u){}}},source:o}}rl.install=e=>{e.component(rl.__name,rl)};let cl=null,dl=null,ul=!1;const ml=/* @__PURE__ */new Map,hl=/* @__PURE__ */new Map;let pl=5;const fl=/* @__PURE__ */new Set;function vl(){if(ml.size<pl&&fl.size){const n=Array.from(fl);fl.clear();for(const t of n)try{t()}catch(e){}}}function gl(e){cl=e,dl=null,cl.onmessage=e=>{const{id:n,html:t,error:o}=e.data,r=ml.get(n);if(r)if(ml.delete(n),clearTimeout(r.timeoutId),vl(),o)r.reject(new Error(o));else{const{content:n,displayMode:o}=e.data;if(n){const e=`${o?"d":"i"}:${n}`;if(hl.set(e,t),hl.size>200){const e=hl.keys().next().value;hl.delete(e)}}r.resolve(t)}},cl.onerror=e=>{console.error("[katexWorkerClient] Worker error:",e);for(const[n,t]of ml.entries())clearTimeout(t.timeoutId),t.reject(new Error(`Worker error: ${e.message}`));ml.clear(),vl()}}function wl(){var e;cl&&(null==(e=cl.terminate)||e.call(cl)),cl=null,dl=null}function yl(e){ul=!!e,cl&&cl.postMessage({type:"init",debug:ul})}function kl(e,n=!0,t=2e3,o){return d(this,null,function*(){if(performance.now(),!Cn()){const e=new Error("KaTeX rendering disabled");return e.name="KaTeXDisabled",e.code="KATEX_DISABLED",Promise.reject(e)}if(dl)return Promise.reject(dl);const r=`${n?"d":"i"}:${e}`,l=hl.get(r);if(l)return Promise.resolve(l);const i=cl||(dl=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),dl.name="WorkerInitError",dl.code="WORKER_INIT_ERROR",null);if(!i)return Promise.reject(dl);if(ml.size>=pl){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code="WORKER_BUSY",e.busy=!0,e.inFlight=ml.size,e.max=pl,Promise.reject(e)}return new Promise((r,l)=>{if(null==o?void 0:o.aborted){const e=new Error("Aborted");return e.name="AbortError",void l(e)}const a=Math.random().toString(36).slice(2),s=globalThis.setTimeout(()=>{ml.delete(a);const e=new Error("Worker render timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT",l(e),vl()},t);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(s),ml.has(a)&&ml.delete(a);const e=new Error("Aborted");e.name="AbortError",l(e),vl()},{once:!0});const c=r,d=l;ml.set(a,{resolve:e=>{c(e)},reject:e=>{d(e)},timeoutId:s}),i.postMessage({id:a,content:e,displayMode:n})})})}function xl(e,n=!0,t){const o=`${n?"d":"i"}:${e}`;if(hl.set(o,t),hl.size>200){const e=hl.keys().next().value;hl.delete(e)}}function bl(){return{inFlight:ml.size,max:pl}}function Ml(e){Number.isFinite(e)&&e>0&&(pl=Math.floor(e))}const _l="WORKER_BUSY";function Cl(){return ml.size>=pl}function Bl(e=2e3,n){return ml.size<pl?Promise.resolve():new Promise((t,o)=>{let r,l=!1;const i=()=>{l||(l=!0,r&&globalThis.clearTimeout(r),fl.delete(i),t())};if(fl.add(i),r=globalThis.setTimeout(()=>{if(l)return;l=!0,fl.delete(i);const e=new Error("Wait for worker slot timed out");e.name="WorkerBusyTimeout",e.code="WORKER_BUSY_TIMEOUT",o(e)},e),queueMicrotask(()=>vl()),n){const e=()=>{if(l)return;l=!0,r&&globalThis.clearTimeout(r),fl.delete(i);const e=new Error("Aborted");e.name="AbortError",o(e)};n.aborted?e():n.addEventListener("abort",e,{once:!0})}})}const Tl={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function Ll(e){null!=e.timeout&&(Tl.timeout=Math.max(0,Math.floor(e.timeout))),null!=e.waitTimeout&&(Tl.waitTimeout=Math.max(0,Math.floor(e.waitTimeout))),null!=e.backoffMs&&(Tl.backoffMs=Math.max(0,Math.floor(e.backoffMs))),null!=e.maxRetries&&(Tl.maxRetries=Math.max(0,Math.floor(e.maxRetries)))}function Il(){return a({},Tl)}function Sl(e){return d(this,arguments,function*(e,n=!0,t={}){var o,r,l,i;if(!Cn()){const e=new Error("KaTeX rendering disabled");throw e.name="KaTeXDisabled",e.code="KATEX_DISABLED",e}const a=null!=(o=t.timeout)?o:Tl.timeout,s=null!=(r=t.waitTimeout)?r:Tl.waitTimeout,c=null!=(l=t.backoffMs)?l:Tl.backoffMs,d=null!=(i=t.maxRetries)?i:Tl.maxRetries,u=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Tl.maxRetries,m=t.signal;let h=0;for(;;){if(null==m?void 0:m.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}try{return yield kl(e,n,a,m)}catch(p){if((null==p?void 0:p.code)!==_l||h>=u)throw p;if(h++,yield Bl(s,m).catch(()=>{}),null==m?void 0:m.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}c>0&&(yield new Promise(e=>globalThis.setTimeout(e,c*h)))}}})}function El(e){return JSON.stringify(e)}function jl(e){var n;const t=null!=(n=e.mode)?n:"module",o=El(e.mermaidUrl),r=`\nlet DEBUG = false\nlet mermaid = null\nlet mermaidLoadError = null\n\nfunction normalizeMermaidModule(mod) {\n if (!mod)\n return mod\n const candidate = (mod && mod.default) ? mod.default : mod\n if (candidate && (typeof candidate.render === 'function' || typeof candidate.parse === 'function' || typeof candidate.initialize === 'function'))\n return candidate\n if (candidate && candidate.mermaidAPI && (typeof candidate.mermaidAPI.render === 'function' || typeof candidate.mermaidAPI.parse === 'function')) {\n const api = candidate.mermaidAPI\n return {\n ...candidate,\n render: api.render ? api.render.bind(api) : undefined,\n parse: api.parse ? api.parse.bind(api) : undefined,\n initialize: (opts) => {\n if (typeof candidate.initialize === 'function')\n return candidate.initialize(opts)\n return api.initialize ? api.initialize(opts) : undefined\n },\n }\n }\n if (mod && mod.mermaid && typeof mod.mermaid.parse === 'function')\n return mod.mermaid\n return candidate\n}\n\nfunction applyThemeTo(code, theme) {\n const themeValue = theme === 'dark' ? 'dark' : 'default'\n const themeConfig = \`%%{init: {"theme": "\${themeValue}"}}%%\\n\`\n const trimmed = (code || '').trimStart()\n if (trimmed.startsWith('%%{'))\n return code\n return themeConfig + code\n}\n\nfunction findHeaderIndex(lines) {\n const headerRe = /^(?:graph|flowchart|flowchart\\s+tb|flowchart\\s+lr|sequenceDiagram|gantt|classDiagram|stateDiagram(?:-v2)?|erDiagram|journey|pie|quadrantChart|timeline|xychart(?:-beta)?)\\b/\n for (let i = 0; i < lines.length; i++) {\n const l = (lines[i] || '').trim()\n if (!l)\n continue\n if (l.startsWith('%%'))\n continue\n if (headerRe.test(l))\n return i\n }\n return -1\n}\n\nasync function canParse(code, theme) {\n const themed = applyThemeTo(code, theme)\n const anyMermaid = mermaid\n if (anyMermaid && typeof anyMermaid.parse === 'function') {\n await anyMermaid.parse(themed)\n return true\n }\n throw new Error('mermaid.parse not available in worker')\n}\n\nasync function findLastRenderablePrefix(baseCode, theme) {\n const lines = String(baseCode || '').split('\\n')\n const headerIdx = findHeaderIndex(lines)\n if (headerIdx === -1)\n return null\n const head = lines.slice(0, headerIdx + 1)\n await canParse(head.join('\\n'), theme)\n\n let low = headerIdx + 1\n let high = lines.length\n let lastGood = headerIdx + 1\n let tries = 0\n const MAX_TRIES = 12\n\n while (low <= high && tries < MAX_TRIES) {\n const mid = Math.floor((low + high) / 2)\n const candidate = [...head, ...lines.slice(headerIdx + 1, mid)].join('\\n')\n tries++\n try {\n await canParse(candidate, theme)\n lastGood = mid\n low = mid + 1\n }\n catch {\n high = mid - 1\n }\n }\n\n return [...head, ...lines.slice(headerIdx + 1, lastGood)].join('\\n')\n}\n\nfunction initMermaidOnce() {\n if (!mermaid)\n return\n try {\n if (typeof mermaid.initialize === 'function')\n mermaid.initialize(${El(a({startOnLoad:!1,securityLevel:"loose"},e.initializeOptions||{}))})\n }\n catch (e) {\n if (DEBUG)\n console.warn('[mermaid-cdn-worker] initialize failed', e)\n }\n}\n\nglobalThis.addEventListener('message', async (ev) => {\n const msg = ev.data || {}\n if (msg.type === 'init') {\n DEBUG = !!msg.debug\n if (DEBUG)\n console.debug('[mermaid-cdn-worker] debug enabled')\n return\n }\n\n const id = msg.id\n const action = msg.action\n const payload = msg.payload || {}\n\n if (!mermaid) {\n const errMsg = mermaidLoadError ? String(mermaidLoadError?.message || mermaidLoadError) : 'Mermaid is not available in worker'\n globalThis.postMessage({ id, ok: false, error: errMsg })\n return\n }\n\n try {\n if (action === 'canParse') {\n const ok = await canParse(payload.code, payload.theme)\n globalThis.postMessage({ id, ok: true, result: ok })\n return\n }\n if (action === 'findPrefix') {\n const res = await findLastRenderablePrefix(payload.code, payload.theme)\n globalThis.postMessage({ id, ok: true, result: res })\n return\n }\n globalThis.postMessage({ id, ok: false, error: 'Unknown action' })\n }\n catch (e) {\n globalThis.postMessage({ id, ok: false, error: String(e?.message || e) })\n }\n})\n`.trimStart();return"module"===t?`\n${r}\n\nlet loadPromise = null\nasync function loadMermaid() {\n if (mermaid || mermaidLoadError)\n return\n if (!loadPromise) {\n loadPromise = (async () => {\n try {\n const mod = await import(${o})\n mermaid = normalizeMermaidModule(mod) || null\n initMermaidOnce()\n }\n catch (e) {\n mermaidLoadError = e\n }\n })()\n }\n await loadPromise\n}\n\n// Load immediately; failures are reported per-request\nawait loadMermaid()\n`.trimStart():`\n${r}\n\nfunction loadMermaidClassic() {\n if (mermaid || mermaidLoadError)\n return\n try {\n importScripts(${o})\n mermaid = normalizeMermaidModule(globalThis.mermaid) || null\n initMermaidOnce()\n }\n catch (e) {\n mermaidLoadError = e\n }\n}\n\nloadMermaidClassic()\n`.trimStart()}function $l(e){var n,t;const o=jl(e);if("undefined"==typeof Worker||"undefined"==typeof URL||"undefined"==typeof Blob)return{worker:null,dispose:()=>{},source:o};const r=new Blob([o],{type:"text/javascript"}),l=URL.createObjectURL(r);let i=!1;const c="module"===(null!=(n=e.mode)?n:"module")?s(a({},null!=(t=e.workerOptions)?t:{}),{type:"module"}):e.workerOptions,d=new Worker(l,c);if(e.debug)try{d.postMessage({type:"init",debug:!0})}catch(u){}return{worker:d,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(u){}}},source:o}}let Nl=null,Hl=null;const Rl=/* @__PURE__ */new Map;let Al=5,Dl=!1;function Ol(e){Dl=!!e}function zl(e){Number.isFinite(e)&&e>0&&(Al=Math.floor(e))}function Pl(){return{inFlight:Rl.size,max:Al}}const Vl="WORKER_BUSY",Wl="MERMAID_DISABLED";function Kl(e){Nl=e,Hl=null;const n=e;Nl.onmessage=e=>{if(Nl!==n)return;const{id:t,ok:o,result:r,error:l}=e.data,i=Rl.get(t);i&&(!1===o||l?i.reject(new Error(l||"Unknown error")):i.resolve(r))},Nl.onerror=e=>{var t,o;if(Nl===n)if(0!==Rl.size){try{Dl?console.error("[mermaidWorkerClient] Worker error:",(null==e?void 0:e.message)||e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker error:",(null==e?void 0:e.message)||e)}catch(r){}for(const[n,t]of Rl.entries())t.reject(new Error(`Worker error: ${e.message}`));Rl.clear()}else null==(t=console.debug)||t.call(console,"[mermaidWorkerClient] Worker error (no pending):",(null==e?void 0:e.message)||e)},Nl.onmessageerror=e=>{var t,o;if(Nl===n)if(0!==Rl.size){try{Dl?console.error("[mermaidWorkerClient] Worker messageerror:",e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker messageerror:",e)}catch(r){}for(const[e,n]of Rl.entries())n.reject(new Error("Worker messageerror"));Rl.clear()}else null==(t=console.debug)||t.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",e)}}function Fl(){var e;if(Nl)try{for(const[e,n]of Rl.entries())n.reject(new Error("Worker cleared"));Rl.clear(),null==(e=Nl.terminate)||e.call(Nl)}catch(n){}Nl=null,Hl=null}function Ul(e,n,t=1400){if(!$o()){const e=new Error("Mermaid rendering disabled");return e.name="MermaidDisabled",e.code=Wl,Promise.reject(e)}if(Hl)return Promise.reject(Hl);const o=Nl||(Hl=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Hl.name="WorkerInitError",Hl.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(Hl);if(Rl.size>=Al){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code=Vl,e.inFlight=Rl.size,e.max=Al,Promise.reject(e)}return new Promise((r,l)=>{const i=Math.random().toString(36).slice(2);let a,s=!1;const c=()=>{s||(s=!0,null!=a&&globalThis.clearTimeout(a),Rl.delete(i))},d={resolve:e=>{c(),r(e)},reject:e=>{c(),l(e)}};Rl.set(i,d);try{o.postMessage({id:i,action:e,payload:n})}catch(u){return Rl.delete(i),void l(u)}a=globalThis.setTimeout(()=>{const e=new Error("Worker call timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT";const n=Rl.get(i);n&&n.reject(e)},t)})}function Xl(e,n,t=1400){return d(this,null,function*(){try{return yield Ul("canParse",{code:e,theme:n},t)}catch(o){return Promise.reject(o)}})}function ql(e,n,t=1400){return d(this,null,function*(){try{return yield Ul("findPrefix",{code:e,theme:n},t)}catch(o){return Promise.reject(o)}})}function Gl(){if(Nl)try{for(const[e,n]of Rl.entries())n.reject(new Error("Worker terminated"));Rl.clear(),Nl.terminate()}finally{Nl=null}}const Zl=P(()=>import("./index4.js")),Yl=P(()=>import("./index3.js")),Jl=P(()=>import("./index2.js")),Ql=P(()=>import("./index5.js")),ei=P(()=>import("./index6.js")),ni=P(()=>import("./index7.js")),ti={AdmonitionNode:Pt,BlockquoteNode:ne,CheckboxNode:re,CodeBlockNode:Zl,DefinitionListNode:se,EmojiNode:de,EmphasisNode:nt,FootnoteNode:it,FootnoteReferenceNode:xe,FootnoteAnchorNode:ot,HardBreakNode:st,HeadingNode:dt,HtmlBlockNode:ft,HtmlInlineNode:De,HighlightNode:Qn,ImageNode:fn,D2BlockNode:ni,InfographicBlockNode:ei,InlineCodeNode:ze,PreCodeNode:kt,InsertNode:Yn,LinkNode:Gn,ListItemNode:ut,ListNode:mt,MathBlockNode:Yl,MathInlineNode:Jl,MermaidBlockNode:Ql,ParagraphNode:gt,StrikethroughNode:Wn,StrongNode:Pn,SubscriptNode:On,SuperscriptNode:Rn,TableNode:Bt,TextNode:Sn,ThematicBreakNode:Lt,VmrContainerNode:Et,ReferenceNode:$n,MarkdownCodeBlockNode:wo},oi={install(e,n){Object.entries(ti).forEach(([n,t])=>{e.component(n,t)}),(null==n?void 0:n.getLanguageIcon)&&Xt(n.getLanguageIcon),(null==n?void 0:n.mathOptions)&&h(n.mathOptions)}};export{mt as $,Pt as A,ne as B,re as C,ni as D,de as E,Mn as F,Eo as G,ot as H,it as I,xe as J,ve as K,st as L,dt as M,Qn as N,ft as O,De as P,fn as Q,ei as R,ze as S,Yn as T,Co as U,Cn as V,_l as W,$o as X,Gn as Y,ut as Z,ee as _,an as a,wo as a0,Nt as a1,Yl as a2,Jl as a3,Ql as a4,gt as a5,$n as a6,ge as a7,fe as a8,on as a9,jl as aA,$l as aB,Ol as aC,zl as aD,Pl as aE,Vl as aF,Wl as aG,Kl as aH,Fl as aI,bo as aa,bn as ab,So as ac,Wn as ad,Pn as ae,On as af,Rn as ag,Bt as ah,Sn as ai,Lt as aj,rl as ak,Et as al,oi as am,Xt as an,al as ao,sl as ap,gl as aq,wl as ar,yl as as,kl as at,bl as au,Ml as av,Cl as aw,Bl as ax,Ll as ay,Il as az,Yt as b,kt as c,Sl as d,Bn as e,xl as f,Ft as g,nn as h,Ro as i,Xl as j,ql as k,Jt as l,Bo as m,Gt as n,we as o,Zl as p,se as q,Zt as r,en as s,Gl as t,rn as u,_o as v,_n as w,jo as x,nt as y,Mo as z};
1
+ var e=Object.defineProperty,n=Object.defineProperties,t=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,i=(n,t,o)=>t in n?e(n,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[t]=o,a=(e,n)=>{for(var t in n||(n={}))r.call(n,t)&&i(e,t,n[t]);if(o)for(var t of o(n))l.call(n,t)&&i(e,t,n[t]);return e},s=(e,o)=>n(e,t(o)),c=(e,n)=>{var t={};for(var i in e)r.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&o)for(var i of o(e))n.indexOf(i)<0&&l.call(e,i)&&(t[i]=e[i]);return t},d=(e,n,t)=>new Promise((o,r)=>{var l=e=>{try{a(t.next(e))}catch(n){r(n)}},i=e=>{try{a(t.throw(e))}catch(n){r(n)}},a=e=>e.done?o(e.value):Promise.resolve(e.value).then(l,i);a((t=t.apply(e,n)).next())});import{getMarkdown as u,parseMarkdownToStructure as m,setDefaultMathOptions as h}from"stream-markdown-parser";import{defineComponent as p,createElementBlock as f,openBlock as v,withMemo as g,createVNode as w,unref as y,createElementVNode as k,Fragment as x,renderList as b,toDisplayString as M,shallowRef as _,h as C,computed as B,ref as T,watch as L,onMounted as I,onBeforeUnmount as S,normalizeClass as E,createApp as j,inject as $,provide as N,createCommentVNode as H,Transition as R,withCtx as A,normalizeStyle as D,renderSlot as O,readonly as z,defineAsyncComponent as P,createBlock as V,resolveDynamicComponent as W,useAttrs as K,mergeProps as F,isMemoSame as U,markRaw as X,reactive as q,nextTick as G,withDirectives as Z,vShow as Y,Teleport as J}from"vue";const Q=["cite"],ee=(e,n)=>{const t=e.__vccOpts||e;for(const[o,r]of n)t[o]=r;return t},ne=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e;return(t,o)=>(v(),f("blockquote",{class:"blockquote",dir:"auto",cite:e.node.cite},[g([n.node.children],()=>w(y(Nt),{"index-key":`blockquote-${n.indexKey}`,nodes:n.node.children||[],"custom-id":n.customId,typewriter:n.typewriter,onCopy:o[0]||(o[0]=e=>t.$emit("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"]),o,1)],8,Q))}}),[["__scopeId","data-v-eeadc8a3"]]);ne.install=e=>{e.component(ne.__name,ne)};const te={class:"checkbox-node"},oe=["checked"],re=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"CheckboxNode",props:{node:{}},setup:e=>(n,t)=>(v(),f("span",te,[k("input",{type:"checkbox",checked:e.node.checked,disabled:"",class:"checkbox-input"},null,8,oe)]))}),[["__scopeId","data-v-8dc6c46f"]]);re.install=e=>{e.component(re.__name,re)};const le={class:"definition-list"},ie={class:"definition-term"},ae={class:"definition-desc"},se=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e;return(e,t)=>(v(),f("dl",le,[(v(!0),f(x,null,b(n.node.items,(o,r)=>(v(),f(x,{key:r},[k("dt",ie,[w(y(Nt),{"index-key":`definition-term-${n.indexKey}-${r}`,nodes:o.term,"custom-id":n.customId,typewriter:n.typewriter,onCopy:t[0]||(t[0]=n=>e.$emit("copy",n))},null,8,["index-key","nodes","custom-id","typewriter"])]),k("dd",ae,[w(y(Nt),{"index-key":`definition-desc-${n.indexKey}-${r}`,nodes:o.definition,"custom-id":n.customId,typewriter:n.typewriter,onCopy:t[1]||(t[1]=n=>e.$emit("copy",n))},null,8,["index-key","nodes","custom-id","typewriter"])])],64))),128))]))}}),[["__scopeId","data-v-f88691d6"]]);se.install=e=>{e.component(se.__name,se)};const ce={class:"emoji-node"},de=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"EmojiNode",props:{node:{}},setup:e=>(n,t)=>(v(),f("span",ce,M(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);de.install=e=>{e.component(de.__name,de)};const ue="__global__",me="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",he=(()=>{const e=globalThis;if(e[me])return e[me];const n={scopedCustomComponents:{},revision:_(0)};return e[me]=n,n})(),pe=he.revision;function fe(e,n){"string"==typeof e?he.scopedCustomComponents[e]=n||{}:he.scopedCustomComponents[ue]=e||{},pe.value++}function ve(e){const n=he.scopedCustomComponents[ue]||{};if(!e)return n;const t=he.scopedCustomComponents[e]||{};return n&&0!==Object.keys(n).length?t&&0!==Object.keys(t).length?a(a({},n),t):n:t}function ge(e){if(e===ue)throw new Error("removeCustomComponents: use clearGlobalCustomComponents() to clear the global mapping");delete he.scopedCustomComponents[e],pe.value++}function we(){delete he.scopedCustomComponents[ue],pe.value++}const ye=["id"],ke=["title"],xe=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const n=`#footnote-${e.node.id}`;function t(){if("undefined"==typeof document)return;const e=document.querySelector(n);e?e.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${n} not found`)}return(o,r)=>(v(),f("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:t},[k("span",{href:n,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+M(e.node.id)+"]",9,ke)],8,ye))}}),[["__scopeId","data-v-01af0fee"]]);xe.install=e=>{e.component(xe.__name,xe)};const be=/* @__PURE__ */new Set(["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onreset","onsearch","onsubmit"]),Me=/* @__PURE__ */new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),_e=/* @__PURE__ */new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),Ce=/<([a-z][a-z0-9-]*)\b[^>]*>/gi,Be=/* @__PURE__ */new Set(["script"]),Te=/* @__PURE__ */new Set(["href","src","srcset","xlink:href","formaction"]),Le=(()=>{try{return Boolean(!1)}catch(e){}return!1})();function Ie(e){Le&&console.warn(e)}function Se(e){const n=function(e){let n="";for(const t of e){const e=t.charCodeAt(0);e<=31||127===e||/\s/u.test(t)||(n+=t)}return n}(e).toLowerCase();return!(!n.startsWith("javascript:")&&!n.startsWith("vbscript:"))||!!n.startsWith("data:")&&!(n.startsWith("data:image/")||n.startsWith("data:video/")||n.startsWith("data:audio/"))}function Ee(e,n){return Object.prototype.hasOwnProperty.call(e,n)}function je(e,n){const t=e.toLowerCase();return!_e.has(t)&&(Ee(n,t)||Ee(n,e))}function $e(e,n){const t=n.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(t))return"true"===e||""===e||e===n;if(["value","min","max","step","width","height","size","maxlength"].includes(t)){const n=Number(e);if(""!==e&&!Number.isNaN(n))return n}return e}function Ne(e){return e.trim().length>0}function He(e,n,t,o,r){if(Be.has(e.toLowerCase()))return null;const l=function(e){const n={};for(const[t,o]of Object.entries(e)){const e=t.toLowerCase();be.has(e)||Te.has(e)&&o&&Se(o)||(n[t]=o)}return n}(n),i=l.key,c=null!=i&&""!==i?i:r;if(je(e,o)){const n=o[e]||o[e.toLowerCase()],r=function(e){const n={};for(const[t,o]of Object.entries(e))n[t]=$e(o,t);return n}(l);return C(n,s(a({},r),{key:c}),t.length>0?t:void 0)}return C(e,s(a({},l),{innerHTML:void 0,key:c}),t.length>0?t:void 0)}function Re(e,n){if(!e||!e.includes("<"))return!1;if(!n||0===Object.keys(n).length)return!1;let t;for(Ce.lastIndex=0;null!==(t=Ce.exec(e));)if(je(t[1],n))return!0;return!1}function Ae(e,n){if(!e)return[];try{const t=function(e,n){let t=0;const o=[],r=[];for(const l of e)if("text"===l.type)(o.length>0?o[o.length-1].children:r).push(l.content);else if("self_closing"===l.type){const e=He(l.tagName,l.attrs||{},[],n,"ms-html-"+t++),i=o.length>0?o[o.length-1].children:r;null!=e&&i.push(e)}else if("tag_open"===l.type)o.push({tagName:l.tagName,children:[],attrs:l.attrs,autoKey:"ms-html-"+t++});else if("tag_close"===l.type){const e=l.tagName.toLowerCase();let t=-1;for(let n=o.length-1;n>=0;n--)if(o[n].tagName.toLowerCase()===e){t=n;break}if(-1!==t)for(;o.length>t;){const l=o.pop(),i=He(l.tagName,l.attrs||{},l.children,n,l.autoKey);o.length>0?null!=i&&o[o.length-1].children.push(i):null!=i&&r.push(i),l.tagName.toLowerCase()!==e&&o.length>t&&Ie(`Auto-closing unclosed tag: <${l.tagName}>`)}else Ie(`Ignoring closing tag with no matching opening tag: </${l.tagName}>`)}for(;o.length>0;){const e=o.pop(),t=He(e.tagName,e.attrs||{},e.children,n,e.autoKey);o.length>0?null!=t&&o[o.length-1].children.push(t):null!=t&&r.push(t),Ie(`Auto-closing unclosed tag: <${e.tagName}>`)}return r}(function(e){var n,t,o;const r=[];let l=0;for(;l<e.length;){if(e.startsWith("\x3c!--",l)){const n=e.indexOf("--\x3e",l);if(-1!==n){l=n+3;continue}break}const i=e.indexOf("<",l);if(-1===i){if(l<e.length){const n=e.slice(l);Ne(n)&&r.push({type:"text",content:n})}break}if(i>l){const n=e.slice(l,i);Ne(n)&&r.push({type:"text",content:n})}if(e.startsWith("![CDATA[",i+1)){const n=e.indexOf("]]>",i);if(-1!==n){r.push({type:"text",content:e.slice(i,n+3)}),l=n+3;continue}break}if(e.startsWith("!",i+1)){const n=e.indexOf(">",i);if(-1!==n){l=n+1;continue}break}const a=e.indexOf(">",i);if(-1===a)break;const s=e.slice(i+1,a).trim(),c=s.startsWith("/"),d=s.endsWith("/");if(c){const e=s.slice(1).trim();r.push({type:"tag_close",tagName:e})}else{const e=s.indexOf(" ");let l,i="";-1===e?l=d?s.slice(0,-1).trim():s.trim():(l=s.slice(0,e).trim(),i=s.slice(e+1));const a={};if(i){const e=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let r;for(;null!==(r=e.exec(i));){const e=r[1],l=null!=(o=null!=(t=null!=(n=r[2])?n:r[3])?t:r[4])?o:"";e&&!e.endsWith("/")&&(a[e]=l)}}r.push({type:d||Me.has(l.toLowerCase())?"self_closing":"tag_open",tagName:l,attrs:a})}l=a+1}return r}(e),n);return t}catch(o){return t=o,Le&&console.error("Failed to parse HTML to VNodes:",t),null}var t}const De=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"HtmlInlineNode",props:{node:{},customId:{}},setup(e){const n=e,t=B(()=>(pe.value,ve(n.customId))),o=p({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=B(()=>{const e=n.node.content;if(!e)return{mode:"html",content:""};if(n.node.loading&&n.node.autoClosed){const n=Ae(e,t.value);if(null!==n)return{mode:"dynamic",nodes:n}}if(!Re(e,t.value))return{mode:"html",content:e};const o=Ae(e,t.value);return null===o?{mode:"html",content:e}:{mode:"dynamic",nodes:o}}),l=T(null),i="undefined"!=typeof window,a=T({mode:"",content:"",el:null});let s=null;function c(e,n){if(!i||!l.value)return;const t=l.value,o=a.value;if(o.el!==t||o.mode!==e||o.content!==n){if("text"===e)t.textContent=n;else{const e=(!s&&i&&(s=document.createElement("template")),s);if(e){e.innerHTML=n;const o=e.content.cloneNode(!0);"function"==typeof t.replaceChildren?t.replaceChildren(o):(t.innerHTML="",t.appendChild(o))}else t.innerHTML=n}a.value={mode:e,content:n,el:t}}}function d(){c("html",n.node.content)}function u(){c("text",n.node.content)}return L(()=>[n.node.content,n.node.loading,n.node.autoClosed,r.value.mode],()=>{"html"===r.value.mode&&(n.node.loading&&!n.node.autoClosed?u():d())}),I(()=>{"html"===r.value.mode&&(n.node.loading&&!n.node.autoClosed?u():d())}),S(()=>{l.value&&(l.value.innerHTML="",a.value={mode:"",content:"",el:null})}),(e,t)=>"dynamic"===r.value.mode?(v(),f("span",{key:0,class:E(["html-inline-node",{"html-inline-node--loading":n.node.loading}])},[w(y(o),{nodes:r.value.nodes},null,8,["nodes"])],2)):(v(),f("span",{key:1,ref_key:"containerRef",ref:l,class:E(["html-inline-node",{"html-inline-node--loading":n.node.loading}])},null,2))}}),[["__scopeId","data-v-4add5e85"]]);De.install=e=>{e.component(De.__name,De)};const Oe={class:"inline text-[85%] px-1 py-0.5 rounded font-mono bg-[hsl(var(--secondary))] whitespace-normal break-words max-w-full before:content-[''] after:content-['']"},ze=/* @__PURE__ */p({__name:"InlineCodeNode",props:{node:{}},setup:e=>(n,t)=>(v(),f("code",Oe,M(e.node.code),1))});ze.install=e=>{e.component(ze.__name,ze)};const Pe=T(!1),Ve=T(""),We=T("top"),Ke=T(null),Fe=T(null),Ue=T(null),Xe=T(null),qe=T(null);let Ge=null,Ze=null;function Ye(){Ge&&(clearTimeout(Ge),Ge=null),Ze&&(clearTimeout(Ze),Ze=null)}let Je=!1,Qe=null;function en(e,n,t="top",o=!1,r,l){if(!e)return;Je||"undefined"!=typeof document&&(Qe||(Qe=Promise.resolve().then(()=>ll).then(({default:e})=>{Je=!0;const n=document.createElement("div");n.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(n),j({setup:()=>()=>{var n;return C(e,{visible:Pe.value,"anchor-el":Ke.value,content:Ve.value,placement:We.value,id:Fe.value,originX:Ue.value,originY:Xe.value,isDark:null!=(n=qe.value)?n:void 0})}}).mount(n)}).catch(e=>{Qe=null,Je=!1,console.warn("[markstream-vue] Failed to load Tooltip component. Tooltips will be disabled.",e)}))),Ye();const i=()=>{var o,i;Fe.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Ke.value=e,Ve.value=n,We.value=t,Ue.value=null!=(o=null==r?void 0:r.x)?o:null,Xe.value=null!=(i=null==r?void 0:r.y)?i:null,qe.value="boolean"==typeof l?l:null,Pe.value=!0;try{e.setAttribute("aria-describedby",Fe.value)}catch(a){}};o?i():Ge=setTimeout(i,80)}function nn(e=!1){Ye();const n=()=>{if(Ke.value&&Fe.value)try{Ke.value.removeAttribute("aria-describedby")}catch(e){}Pe.value=!1,Ke.value=null,Fe.value=null,Ue.value=null,Xe.value=null};e?n():Ze=setTimeout(n,120)}const tn={"common.copy":"Copy","common.copySuccess":"Copied","common.decrease":"Decrease","common.reset":"Reset","common.increase":"Increase","common.expand":"Expand","common.collapse":"Collapse","common.preview":"Preview","common.source":"Source","common.export":"Export","common.open":"Open","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."};function on(e){Object.assign(tn,e)}function rn(){try{const n=globalThis.$vueI18nUse||null;if(n&&"function"==typeof n)try{const e=n();if(e&&"function"==typeof e.t)return{t:e.t.bind(e)}}catch(e){}}catch(e){}return d(null,null,function*(){try{const n=yield import("vue-i18n"),t=n.useI18n||n.default&&n.default.useI18n;if(t&&"function"==typeof t)try{const n=t();if(n&&"function"==typeof n.t)try{globalThis.$vueI18nUse=()=>n}catch(e){}}catch(e){}}catch(e){}}),{t:e=>{var n;return null!=(n=tn[e])?n:function(e){return(e.split(".").pop()||e).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,e=>e.toUpperCase()).trim()}(e)}}}const ln=/* @__PURE__ */Symbol("ViewportPriority");function an(){const e=$(ln,void 0);if(e)return e;const n=/* @__PURE__ */new WeakMap;let t=null;return e=>{const o=T(!1);let r,l=!1;const i=new Promise(e=>{r=()=>{l||(l=!0,e())}}),a=()=>{try{null==t||t.unobserve(e)}catch(o){}n.delete(e)},s=t||("undefined"==typeof window||"undefined"==typeof IntersectionObserver?null:(t=new IntersectionObserver(e=>{for(const r of e){const e=n.get(r.target);if(e&&(r.isIntersecting||r.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(o){}}null==t||t.unobserve(r.target),n.delete(r.target)}}},{root:null,rootMargin:"300px",threshold:0}),t));return s?(n.set(e,{resolve:r,visible:o}),s.observe(e),{isVisible:o,whenVisible:i,destroy:a}):(o.value=!0,r(),{isVisible:o,whenVisible:i,destroy:a})}}const sn={class:"relative inline-block"},cn=["src","alt","title","loading","tabindex","aria-label"],dn={class:"text-sm whitespace-nowrap"},un={key:1,class:"text-sm text-gray-500"},mn={key:"error",class:"px-4 py-2 bg-gray-100 flex items-center justify-center rounded-lg gap-2 text-red-500"},hn={class:"text-sm whitespace-nowrap"},pn={key:0,class:"mt-2 text-sm text-gray-500 italic"},fn=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},showCaption:{type:Boolean,default:!1},lazy:{type:Boolean,default:!0},svgMinHeight:{default:"12rem"},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:n}){const t=e,o=n,r=T(!1),l=T(!1),i=T(!1),a=T(null),s=an(),c=T(null),d=T("undefined"==typeof window);"undefined"!=typeof window&&L(()=>a.value,e=>{var n;if(null==(n=c.value)||n.destroy(),c.value=null,!e)return void(d.value=!1);const t=s(e,{rootMargin:"400px"});c.value=t,d.value=t.isVisible.value,t.whenVisible.then(()=>{d.value=!0})},{immediate:!0}),S(()=>{var e;null==(e=c.value)||e.destroy(),c.value=null});const u=B(()=>l.value&&t.fallbackSrc?t.fallbackSrc:t.node.src),m=B(()=>!t.lazy||d.value),h=B(()=>/\.svg(?:\?|$)/i.test(u.value));function p(){t.fallbackSrc&&!i.value?(i.value=!0,l.value=!0):(l.value=!0,o("error",t.node.src))}function g(){r.value=!0,l.value=!1,o("load",u.value)}function x(e){e.preventDefault(),r.value&&!l.value&&o("click",[e,u.value])}const{t:b}=rn();return L(u,()=>{r.value=!1,l.value=!1}),(n,o)=>(v(),f("figure",{ref_key:"figureRef",ref:a,class:"text-center my-8"},[k("div",sn,[w(R,{name:"img-switch",mode:"out-in"},{default:A(()=>{var i,a,s,c,d;return[e.node.loading||l.value||!m.value?l.value?e.node.loading||t.fallbackSrc?H("",!0):(v(),f("div",mn,[O(n.$slots,"error",{node:t.node,displaySrc:u.value,imageLoaded:r.value,hasError:l.value,fallbackSrc:t.fallbackSrc,lazy:t.lazy,isSvg:h.value},()=>[o[1]||(o[1]=k("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[k("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),k("span",hn,M(y(b)("image.loadError")),1)],!0)])):(v(),f("div",{key:"placeholder",class:"placeholder-layer max-w-96 inline-flex items-center justify-center gap-2",style:D(h.value?{minHeight:t.svgMinHeight,width:"100%"}:{minHeight:"6rem"})},[t.usePlaceholder?O(n.$slots,"placeholder",{key:0,node:t.node,displaySrc:u.value,imageLoaded:r.value,hasError:l.value,fallbackSrc:t.fallbackSrc,lazy:t.lazy,isSvg:h.value},()=>[o[0]||(o[0]=k("div",{class:"w-4 h-4 rounded-full border-2 border-solid border-current border-t-transparent animate-spin","aria-hidden":"true"},null,-1)),k("span",dn,M(y(b)("image.loading")),1)],!0):(v(),f("span",un,M(e.node.raw),1))],4)):(v(),f("img",{key:"image",src:u.value,alt:String(null!=(a=null!=(i=t.node.alt)?i:t.node.title)?a:""),title:String(null!=(c=null!=(s=t.node.title)?s:t.node.alt)?c:""),class:E(["max-w-96 h-auto rounded-lg transition-opacity duration-200 ease-in-out",{"opacity-0":!r.value,"opacity-100":r.value,"cursor-pointer":r.value}]),style:D(h.value?{minHeight:t.svgMinHeight,width:"100%",height:"auto",objectFit:"contain"}:void 0),loading:t.lazy?"lazy":"eager",decoding:"async",tabindex:r.value?0:-1,"aria-label":null!=(d=t.node.alt)?d:y(b)("image.preview"),onError:p,onLoad:g,onClick:x},null,46,cn))]}),_:3})]),t.showCaption&&t.node.alt?(v(),f("figcaption",pn,M(t.node.alt),1)):H("",!0)],512))}}),[["__scopeId","data-v-7ca79b66"]]);fn.install=e=>{e.component(fn.__name,fn)};let vn=null,gn=!1,wn=xn;function yn(e){var n;const t=null!=(n=null==e?void 0:e.default)?n:e;return t&&"function"==typeof t.renderToString?t:null}function kn(){try{const e=globalThis;return yn(null==e?void 0:e.katex)}catch(e){return null}}function xn(){return d(null,null,function*(){const e=kn();if(e)return e;const n=yield import("katex");try{yield import("katex/dist/contrib/mhchem")}catch(t){}return yn(n)})}function bn(e){wn=e,vn=null,gn=!1}function Mn(e){bn(null!=e?e:xn)}function _n(){bn(null)}function Cn(){return"function"==typeof wn}function Bn(){return d(this,null,function*(){var e;const n=kn();if(n)return vn=n,vn;if(vn)return vn;if(gn)return null;const t=wn;if(!t)return gn=!0,null;try{const n=yield t();if(n)return vn=null!=(e=yn(n))?e:n,vn}catch(o){}return gn=!0,null})}const Tn=_(!1);let Ln=null;function In(){return Ln||(Ln=Bn().then(e=>{Tn.value=!!e}).catch(()=>{Tn.value=!1})),z(Tn)}const Sn=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const n=In();return(t,o)=>(v(),f("span",{class:E([[y(n)&&e.node.center?"text-node-center":""],"whitespace-pre-wrap break-words text-node"])},M(e.node.content),3))}}),[["__scopeId","data-v-56f30838"]]);Sn.install=e=>{e.component(Sn.__name,Sn)};const En=P(()=>d(null,null,function*(){var e,n;if("undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(n=null==(e=globalThis.process)?void 0:e.env)?void 0:n.NODE_ENV))return e=>{var n,t;return C(Sn,s(a({},e),{node:s(a({},e.node),{content:null!=(t=e.node.raw)?t:`$${null!=(n=e.node.content)?n:""}$`})}))};try{if(yield Bn())return(yield import("./index2.js")).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return e=>{var n,t;return C(Sn,s(a({},e),{node:s(a({},e.node),{content:null!=(t=e.node.raw)?t:`$${null!=(n=e.node.content)?n:""}$`})}))}})),jn=P(()=>d(null,null,function*(){try{if(yield Bn())return(yield import("./index3.js")).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var n,t;return C(Sn,s(a({},e),{node:s(a({},e.node),{content:null!=(t=e.node.raw)?t:`$$${null!=(n=e.node.content)?n:""}$$`})}))}})),$n=/* @__PURE__ */p({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(n,t)=>(v(),f("span",{class:"reference-node cursor-pointer bg-[hsl(var(--muted))] text-xs rounded-md px-1.5 mx-0.5 hover:bg-[hsl(var(--secondary))]",role:"button",tabindex:"0",onClick:t[0]||(t[0]=t=>n.$emit("click",t,e.node.id,e.messageId,e.threadId)),onMouseenter:t[1]||(t[1]=t=>n.$emit("mouseEnter",t,e.node.id,e.messageId,e.threadId)),onMouseleave:t[2]||(t[2]=t=>n.$emit("mouseLeave",t,e.node.id,e.messageId,e.threadId))},M(e.node.id),33))});$n.install=e=>{e.component($n.__name,$n)};const Nn={class:"superscript-node"},Hn={key:1},Rn=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ve(n.customId),o=a({text:Sn,inline_code:ze,link:Gn,html_inline:De,strong:Pn,emphasis:nt,footnote_reference:xe,strikethrough:Wn,highlight:Qn,insert:Yn,subscript:On,emoji:de,math_inline:En,reference:$n},t);return(t,r)=>(v(),f("sup",Nn,[(v(!0),f(x,null,b(e.node.children,(t,r)=>(v(),f(x,{key:`${e.indexKey||"superscript"}-${r}`},[o[t.type]?(v(),V(W(o[t.type]),{key:0,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"superscript"}-${r}`},null,8,["node","custom-id","index-key"])):(v(),f("span",Hn,M(t.content||t.raw),1))],64))),128))]))}}),[["__scopeId","data-v-6dc1e3ba"]]);Rn.install=e=>{e.component(Rn.__name,Rn)};const An={class:"subscript-node"},Dn={key:1},On=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ve(n.customId),o=a({text:Sn,inline_code:ze,link:Gn,html_inline:De,strong:Pn,emphasis:nt,footnote_reference:xe,strikethrough:Wn,highlight:Qn,insert:Yn,superscript:Rn,emoji:de,math_inline:En,reference:$n},t);return(t,r)=>(v(),f("sub",An,[(v(!0),f(x,null,b(e.node.children,(t,r)=>(v(),f(x,{key:`${e.indexKey||"subscript"}-${r}`},[o[t.type]?(v(),V(W(o[t.type]),{key:0,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"subscript"}-${r}`},null,8,["node","custom-id","index-key"])):(v(),f("span",Dn,M(t.content||t.raw),1))],64))),128))]))}}),[["__scopeId","data-v-69de9b81"]]);On.install=e=>{e.component(On.__name,On)};const zn={class:"strong-node"},Pn=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ve(n.customId),o=a({text:Sn,inline_code:ze,link:Gn,html_inline:De,emphasis:nt,strikethrough:Wn,highlight:Qn,insert:Yn,subscript:On,superscript:Rn,emoji:de,footnote_reference:xe,math_inline:En,reference:$n},t);return(t,r)=>(v(),f("strong",zn,[(v(!0),f(x,null,b(e.node.children,(t,r)=>(v(),V(W(o[t.type]),{key:`${e.indexKey||"strong"}-${r}`,"index-key":`${e.indexKey||"strong"}-${r}`,node:t,"custom-id":n.customId},null,8,["index-key","node","custom-id"]))),128))]))}}),[["__scopeId","data-v-af3ce037"]]);Pn.install=e=>{e.component(Pn.__name,Pn)};const Vn={class:"strikethrough-node"},Wn=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ve(n.customId),o=a({text:Sn,inline_code:ze,link:Gn,html_inline:De,strong:Pn,emphasis:nt,highlight:Qn,insert:Yn,subscript:On,superscript:Rn,emoji:de,footnote_reference:xe,math_inline:En,reference:$n},t);return(t,r)=>(v(),f("del",Vn,[(v(!0),f(x,null,b(e.node.children,(t,r)=>(v(),V(W(o[t.type]),{key:`${e.indexKey||"strikethrough"}-${r}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"strikethrough"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-904d5bd1"]]);Wn.install=e=>{e.component(Wn.__name,Wn)};const Kn=["href","title","aria-label","aria-hidden"],Fn=["aria-hidden"],Un={class:"link-text-wrapper relative inline-flex"},Xn={class:"leading-[normal] link-text"},qn={class:"leading-[normal] link-text"},Gn=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const n=e,t=B(()=>{var e,t,o,r,l,i;const a=void 0!==n.underlineBottom?"number"==typeof n.underlineBottom?`${n.underlineBottom}px`:String(n.underlineBottom):"-3px";return{"--link-color":null!=(e=n.color)?e:"#0366d6","--underline-height":`${null!=(t=n.underlineHeight)?t:2}px`,"--underline-bottom":a,"--underline-opacity":String(null!=(o=n.animationOpacity)?o:.9),"--underline-duration":`${null!=(r=n.animationDuration)?r:.8}s`,"--underline-timing":null!=(l=n.animationTiming)?l:"linear","--underline-iteration":"number"==typeof n.animationIteration?String(n.animationIteration):null!=(i=n.animationIteration)?i:"infinite"}}),o={text:Sn,strong:Pn,strikethrough:Wn,emphasis:nt,image:fn,html_inline:De,inline_code:ze},r=B(()=>(pe.value,ve(n.customId))),l=K();function i(){n.showTooltip&&nn()}const a=B(()=>{var e,t;return String(null!=(t=null!=(e=n.node.title)?e:n.node.href)?t:"")});return(s,c)=>e.node.loading?(v(),f("span",F({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},y(l),{style:t.value}),[k("span",Un,[k("span",Xn,[k("span",qn,M(e.node.text),1)]),c[1]||(c[1]=k("span",{class:"underline-anim","aria-hidden":"true"},null,-1))])],16,Fn)):(v(),f("a",F({key:0,class:"link-node",href:e.node.href,title:e.showTooltip?"":a.value,"aria-label":`Link: ${a.value}`,"aria-hidden":e.node.loading?"true":"false",target:"_blank",rel:"noopener noreferrer"},y(l),{style:t.value,onMouseenter:c[0]||(c[0]=e=>function(e){var t,o,r;if(!n.showTooltip)return;const l=e,i=null!=(null==l?void 0:l.clientX)&&null!=(null==l?void 0:l.clientY)?{x:l.clientX,y:l.clientY}:void 0,a=(null==(t=n.node)?void 0:t.title)||(null==(o=n.node)?void 0:o.href)||(null==(r=n.node)?void 0:r.text)||"";en(e.currentTarget,a,"top",!1,i)}(e)),onMouseleave:i}),[(v(!0),f(x,null,b(e.node.children,(t,l)=>(v(),V(W(function(e){return r.value[e.type]||o[e.type]||null}(t)),{key:`${e.indexKey||"emphasis"}-${l}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"link-text"}-${l}`},null,8,["node","custom-id","index-key"]))),128))],16,Kn))}}),[["__scopeId","data-v-2ccf6f70"]]);Gn.install=e=>{e.component(Gn.__name,Gn)};const Zn={class:"insert-node"},Yn=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ve(n.customId),o=a({text:Sn,inline_code:ze,link:Gn,html_inline:De,strong:Pn,emphasis:nt,strikethrough:Wn,highlight:Qn,subscript:On,superscript:Rn,emoji:de,footnote_reference:xe,math_inline:En,reference:$n},t);return(t,r)=>(v(),f("ins",Zn,[(v(!0),f(x,null,b(e.node.children,(t,r)=>(v(),V(W(o[t.type]),{key:`${e.indexKey||"insert"}-${r}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"insert"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-ab1ec9bc"]]);Yn.install=e=>{e.component(Yn.__name,Yn)};const Jn={class:"highlight-node"},Qn=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ve(n.customId),o=a({text:Sn,inline_code:ze,link:Gn,html_inline:De,strong:Pn,emphasis:nt,strikethrough:Wn,insert:Yn,subscript:On,superscript:Rn,emoji:de,footnote_reference:xe,math_inline:En,reference:$n},t);return(t,r)=>(v(),f("mark",Jn,[(v(!0),f(x,null,b(e.node.children,(t,r)=>(v(),V(W(o[t.type]),{key:`${e.indexKey||"highlight"}-${r}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"highlight"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-38e31bf6"]]);Qn.install=e=>{e.component(Qn.__name,Qn)};const et={class:"emphasis-node"},nt=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ve(n.customId),o=a({text:Sn,inline_code:ze,link:Gn,html_inline:De,strong:Pn,strikethrough:Wn,highlight:Qn,insert:Yn,subscript:On,superscript:Rn,emoji:de,footnote_reference:xe,math_inline:En,reference:$n},t);return(t,r)=>(v(),f("em",et,[(v(!0),f(x,null,b(e.node.children,(t,r)=>(v(),V(W(o[t.type]),{key:`${e.indexKey||"emphasis"}-${r}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"emphasis"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-8264674d"]]);nt.install=e=>{e.component(nt.__name,nt)};const tt=["href","title"],ot=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const n=e;function t(e){var t;if(e.preventDefault(),"undefined"==typeof document)return;const o=`fnref-${String(null!=(t=n.node.id)?t:"")}`,r=document.getElementById(o);r&&r.scrollIntoView({behavior:"smooth"})}return(n,o)=>(v(),f("a",{class:"footnote-anchor text-sm text-[#0366d6] hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:t}," ↩︎ ",8,tt))}}),[["__scopeId","data-v-4756ce0d"]]);ot.install=e=>{e.component(ot.__name,ot)};const rt=["id"],lt={class:"flex-1"},it=/* @__PURE__ */p({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e;return(t,o)=>(v(),f("div",{id:`fnref--${e.node.id}`,class:"flex mt-2 mb-2 text-sm leading-relaxed border-t border-[#eaecef] pt-2"},[k("div",lt,[g([n.node.children],()=>w(y(Nt),{"index-key":`footnote-${n.indexKey}`,nodes:n.node.children,"custom-id":n.customId,typewriter:n.typewriter,onCopy:o[0]||(o[0]=e=>t.$emit("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"]),o,1)])],8,rt))}});it.install=e=>{e.component(it.__name,it)};const at={class:"hard-break"},st=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"HardBreakNode",props:{node:{}},setup:e=>(e,n)=>(v(),f("br",at))}),[["__scopeId","data-v-50c58f70"]]);st.install=e=>{e.component(st.__name,st)};const ct=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ve(n.customId),o=a({text:Sn,inline_code:ze,link:Gn,image:fn,strong:Pn,emphasis:nt,strikethrough:Wn,highlight:Qn,insert:Yn,subscript:On,superscript:Rn,emoji:de,checkbox:re,checkbox_input:re,footnote_reference:xe,hardbreak:st,math_inline:En,reference:$n},t);return(t,r)=>g([e.node.level,e.node.children,e.node.attrs],()=>(v(),V(W(`h${e.node.level}`),F({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:A(()=>[(v(!0),f(x,null,b(e.node.children,(t,r,l,i)=>{const a=[t];if(i&&i.key===`${e.indexKey||"heading"}-${r}`&&U(i,a))return i;const s=(v(),V(W(o[t.type]),{key:`${e.indexKey||"heading"}-${r}`,"custom-id":n.customId,node:t,"index-key":`${e.indexKey||"heading"}-${r}`},null,8,["custom-id","node","index-key"]));return s.memo=a,s},r,0),128))]),_:1},16,["class"])),r,2)}}),[["__scopeId","data-v-af2f957a"]]),dt=ct;dt.install=e=>{e.component(ct.__name,ct)};const ut=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},value:{},customId:{},typewriter:{type:Boolean}},emits:["copy"],setup(e){const n=e,t=B(()=>{var e;return null!=(e=n.node)?e:n.item}),o=B(()=>null==n.value?{}:{value:n.value});return(e,r)=>{var l;return v(),f("li",F({class:"list-item pl-1.5 my-2",dir:"auto"},o.value),[g([null==(l=t.value)?void 0:l.children],()=>{var o,l;return w(y(Nt),{"index-key":`list-item-${n.indexKey}`,nodes:null!=(l=null==(o=t.value)?void 0:o.children)?l:[],"custom-id":n.customId,typewriter:n.typewriter,"batch-rendering":!1,onCopy:r[0]||(r[0]=n=>e.$emit("copy",n))},null,8,["index-key","nodes","custom-id","typewriter"])},r,1)],16)}}}),[["__scopeId","data-v-31a88b1f"]]);ut.install=e=>{e.component(ut.__name,ut)};const mt=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean}},emits:["copy"],setup(e){const n=B(()=>(pe.value,ve(e.customId).list_item||ut));return(t,o)=>(v(),V(W(e.node.ordered?"ol":"ul"),{class:E(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:A(()=>[(v(!0),f(x,null,b(e.node.items,(r,l,i,a)=>{var s;const c=[r];if(a&&a.key===`${e.indexKey||"list"}-${l}`&&U(a,c))return a;const d=(v(),V(W(n.value),{key:`${e.indexKey||"list"}-${l}`,node:r,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${l}`,typewriter:e.typewriter,value:e.node.ordered?(null!=(s=e.node.start)?s:1)+l:void 0,onCopy:o[0]||(o[0]=e=>t.$emit("copy",e))},null,40,["node","custom-id","index-key","typewriter","value"]));return d.memo=c,d},o,1),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-01209c2b"]]);mt.install=e=>{e.component(mt.__name,mt)};const ht={key:1,class:"html-block-node__raw"},pt={key:1,class:"html-block-node__placeholder"},ft=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"HtmlBlockNode",props:{node:{},customId:{}},setup(e){const n=e,t=B(()=>{const e=n.node.attrs;if(e){if(Array.isArray(e)){const n={};for(const t of e){if(!t||t.length<2)continue;const[e,o]=t;null!=e&&(n[String(e)]=null==o?"":String(o))}return n}return e}}),o=B(()=>(pe.value,ve(n.customId))),r=p({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),l=T(null),i=T("undefined"==typeof window),a=T(n.node.content),s=B(()=>{var e,t,r;if(!i.value)return{mode:"html",content:null!=(e=a.value)?e:""};const l=null!=(t=a.value)?t:n.node.content;if(!l)return{mode:"html",content:""};if(n.node.loading){const e=Ae(l,o.value);return null===e?{mode:"text",content:null!=(r=n.node.raw)?r:l}:{mode:"dynamic",nodes:e}}if(!Re(l,o.value))return{mode:"html",content:l};const s=Ae(l,o.value);return null===s?{mode:"html",content:l}:{mode:"dynamic",nodes:s}}),c=an(),d=T(null),u=!!n.node.loading;return"undefined"!=typeof window?(L(l,e=>{var t,o;if(null==(o=null==(t=d.value)?void 0:t.destroy)||o.call(t),d.value=null,!u)return i.value=!0,void(a.value=n.node.content);if(!e)return void(i.value=!1);const r=c(e,{rootMargin:"400px"});d.value=r,i.value=r.isVisible.value,r.whenVisible.then(()=>{i.value=!0})},{immediate:!0}),L(()=>n.node.content,e=>{u&&!i.value||(a.value=e)})):i.value=!0,S(()=>{var e,n;null==(n=null==(e=d.value)?void 0:e.destroy)||n.call(e),d.value=null}),(n,o)=>(v(),f("div",F({ref_key:"htmlRef",ref:l,class:"html-block-node"},t.value),[i.value?(v(),f(x,{key:0},["dynamic"===s.value.mode?(v(),V(y(r),{key:0,nodes:s.value.nodes},null,8,["nodes"])):"text"===s.value.mode?(v(),f("pre",ht,M(s.value.content),1)):g([a.value],()=>(v(),f("div",{key:2,innerHTML:a.value},null,8,["innerHTML"])),o,0)],64)):(v(),f("div",pt,[O(n.$slots,"placeholder",{node:e.node},()=>[o[1]||(o[1]=k("span",{class:"html-block-node__placeholder-bar"},null,-1)),o[2]||(o[2]=k("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),o[3]||(o[3]=k("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))],16))}}),[["__scopeId","data-v-6797fa3c"]]);ft.install=e=>{e.component(ft.__name,ft)};const vt={dir:"auto",class:"paragraph-node"},gt=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ve(n.customId),o=a({inline_code:ze,image:fn,link:Gn,hardbreak:st,emphasis:nt,strong:Pn,strikethrough:Wn,highlight:Qn,insert:Yn,subscript:On,superscript:Rn,html_inline:De,html_block:ft,emoji:de,checkbox:re,math_inline:En,checkbox_input:re,reference:$n,footnote_anchor:ot,footnote_reference:xe},t),r=In();return(t,l)=>(v(),f("p",vt,[(v(!0),f(x,null,b(e.node.children,(t,l)=>(v(),f(x,{key:`${e.indexKey||"paragraph"}-${l}`},["text"!==t.type?(v(),V(W(o[t.type]),{key:0,node:t,"index-key":`${e.indexKey}-${l}`,"custom-id":n.customId},null,8,["node","index-key","custom-id"])):(v(),f("span",{key:1,class:E([[y(r)&&t.center?"text-node-center":""],"whitespace-pre-wrap break-words text-node"])},M(t.content),3))],64))),128))]))}}),[["__scopeId","data-v-4e2afdbc"]]);gt.install=e=>{e.component(gt.__name,gt)};const wt=["aria-busy","aria-label","data-language"],yt=["textContent"],kt=/* @__PURE__ */p({__name:"PreCodeNode",props:{node:{}},setup(e){const n=e,t=B(()=>{var e,t,o;const r=String(null!=(t=null==(e=n.node)?void 0:e.language)?t:"");return String(null!=(o=String(r).split(/\s+/g)[0])?o:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=B(()=>`language-${t.value}`),r=B(()=>{const e=t.value;return e?`Code block: ${e}`:"Code block"});return(n,l)=>(v(),f("pre",{class:E([o.value]),"aria-busy":!0===e.node.loading,"aria-label":r.value,"data-language":t.value,tabindex:"0"},[k("code",{translate:"no",textContent:M(e.node.code)},null,8,yt)],10,wt))}});kt.install=e=>{e.component(kt.__name,kt)};const xt={class:"table-node-wrapper"},bt=["aria-busy"],Mt={class:"border-[var(--table-border,#cbd5e1)]"},_t={class:"border-b"},Ct={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Bt=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e,t=B(()=>{var e;return null!=(e=n.node.loading)&&e}),o=B(()=>{var e;return null!=(e=n.node.rows)?e:[]});return(r,l)=>(v(),f("div",xt,[k("table",{class:E(["my-8 text-sm table-node",{"table-node--loading":t.value}]),"aria-busy":t.value},[k("thead",Mt,[k("tr",_t,[(v(!0),f(x,null,b(e.node.header.cells,(e,t)=>(v(),f("th",{key:`header-${t}`,dir:"auto",class:E(["font-semibold p-[calc(4/7*1em)]",["right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"]])},[w(y(Nt),{nodes:e.children,"index-key":`table-th-${n.indexKey}`,"custom-id":n.customId,typewriter:n.typewriter,onCopy:l[0]||(l[0]=e=>r.$emit("copy",e))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))])]),k("tbody",null,[(v(!0),f(x,null,b(o.value,(e,t)=>(v(),f("tr",{key:`row-${t}`,class:E(["border-[var(--table-border,#cbd5e1)]",[t<o.value.length-1?"border-b":""]])},[(v(!0),f(x,null,b(e.cells,(e,o)=>(v(),f("td",{key:`cell-${t}-${o}`,class:E(["p-[calc(4/7*1em)]",["right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"]]),dir:"auto"},[w(y(Nt),{nodes:e.children,"index-key":`table-td-${n.indexKey}`,"custom-id":n.customId,typewriter:n.typewriter,onCopy:l[1]||(l[1]=e=>r.$emit("copy",e))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))],2))),128))])],10,bt),w(R,{name:"table-node-fade"},{default:A(()=>[t.value?(v(),f("div",Ct,[O(r.$slots,"loading",{isLoading:t.value},()=>[l[2]||(l[2]=k("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),l[3]||(l[3]=k("span",{class:"sr-only"},"Loading",-1))],!0)])):H("",!0)]),_:3})]))}}),[["__scopeId","data-v-369096fa"]]);Bt.install=e=>{e.component(Bt.__name,Bt)};const Tt={class:"hr-node"},Lt=/* @__PURE__ */ee({},[["render",function(e,n){return v(),f("hr",Tt)}],["__scopeId","data-v-639cbad9"]]);Lt.install=e=>{e.component(Lt.__name,Lt)};const It={class:"unknown-node"},St=/* @__PURE__ */p({__name:"FallbackComponent",props:{node:{}},setup:e=>(n,t)=>(v(),f("div",It,M(e.node.raw),1))}),Et=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},setup(e){const n=e,t=B(()=>`vmr-container vmr-container-${n.node.name}`),o=ve(n.customId),r=a({text:Sn,paragraph:gt,heading:dt,inline_code:ze,link:Gn,image:fn,strong:Pn,emphasis:nt,strikethrough:Wn,insert:Yn,subscript:On,superscript:Rn,checkbox:re,checkbox_input:re,hardbreak:st,math_inline:En,reference:$n,list:mt,math_block:jn,table:Bt},o);return(o,l)=>(v(),f("div",F({class:t.value},e.node.attrs),[(v(!0),f(x,null,b(e.node.children,(t,o,l,i)=>{const a=[t];if(i&&i.key===`${e.indexKey||"vmr-container"}-${o}`&&U(i,a))return i;const s=(v(),V(W((c=t.type,r[c]||St)),{key:`${e.indexKey||"vmr-container"}-${o}`,"custom-id":n.customId,node:t,"index-key":`${e.indexKey||"vmr-container"}-${o}`},null,8,["custom-id","node","index-key"]));var c;return s.memo=a,s},l,0),128))],16))}}),[["__scopeId","data-v-fac7405d"]]);Et.install=e=>{e.component(Et.__name,Et)};const jt=["data-custom-id"],$t=["data-node-index","data-node-type"],Nt=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},renderCodeBlocksAsPre:{type:Boolean},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},themes:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:Boolean,default:!0},batchRendering:{type:Boolean,default:!0},initialRenderBatchSize:{default:40},renderBatchSize:{default:80},renderBatchDelay:{default:16},renderBatchBudgetMs:{default:6},renderBatchIdleTimeoutMs:{default:120},deferNodesUntilVisible:{type:Boolean,default:!0},maxLiveNodes:{default:320},liveNodeBuffer:{default:60}},emits:["copy","handleArtifactClick","click","mouseover","mouseout"],setup(e,{emit:n}){var t,o,r;const l=e,i=n,c=T(),h=T(!1),p=/auto|scroll|overlay/i,g="undefined"!=typeof window,w=B(()=>l.debugPerformance&&g&&"undefined"!=typeof console);function y(e,n){w.value&&console.info(`[markstream-vue][perf] ${e}`,n)}function k(e){if("undefined"==typeof window)return null;const n=null!=e?e:c.value;if(!n)return null;const t=n.ownerDocument||document,o=t.scrollingElement||t.documentElement;let r=n;for(;r&&r!==t.body&&r!==o;){const e=window.getComputedStyle(r),n=(e.overflowY||"").toLowerCase(),t=(e.overflow||"").toLowerCase();if(p.test(n)||p.test(t))return r;r=r.parentElement}return null}const M=l.customId?`renderer-${l.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,_=u(M),C=/* @__PURE__ */new Map,I=B(()=>{const{key:e,tags:n}=function(e){if(!e||0===e.length)return{key:"",tags:[]};const n=/* @__PURE__ */new Set,t=[];for(const o of e){const e=$(o);e&&!n.has(e)&&(n.add(e),t.push(e))}return 0===t.length?{key:"",tags:[]}:{key:t.join(","),tags:t}}(l.customHtmlTags);if(!e)return _;const t=C.get(e);if(t)return t;const o=u(M,{customHtmlTags:n});return C.set(e,o),o}),j=B(()=>{const e=I.value;return l.customMarkdownIt?l.customMarkdownIt(e):e});function $(e){const n=String(null!=e?e:"").trim();if(!n)return"";const t=n.match(/^[<\s/]*([A-Z][\w-]*)/i);return t?t[1].toLowerCase():""}const O=B(()=>{var e,n,t,o;const r=null!=(e=l.parseOptions)?e:{},i=null!=(n=l.final)?n:r.final,s=[...null!=(t=l.customHtmlTags)?t:[],...null!=(o=r.customHtmlTags)?o:[]].map($).filter(Boolean),c=null!=i,d=s.length>0;return c||d?a(a(a({},r),c?{final:i}:{}),d?{customHtmlTags:Array.from(new Set(s))}:{}):r}),z=B(()=>{var e;if(null==(e=l.nodes)?void 0:e.length)return X(l.nodes.slice());if(l.content){const e=w.value?performance.now():0,n=m(l.content,j.value,O.value);return w.value&&y("parse(sync)",{ms:Math.round(performance.now()-e),nodes:n.length,contentLength:l.content.length}),X(n)}return[]}),K=B(()=>{var e;return Math.max(1,null!=(e=l.maxLiveNodes)?e:320)}),U=B(()=>{var e;return!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&z.value.length>K.value}),Z=B(()=>!1!==l.viewportPriority&&!h.value),Y=function(e,n){const t="undefined"!=typeof window&&"undefined"!=typeof document,o="boolean"==typeof n?T(n):n;let r=null,l=null;const i=/* @__PURE__ */new WeakMap,s=(n,s)=>{const c=T(!1);let d,u=!1;const m=new Promise(e=>{d=()=>{u||(u=!0,e())}}),h=()=>{try{null==r||r.unobserve(n)}catch(e){}i.delete(n)};if(!t||!o.value)return c.value=!0,d(),{isVisible:c,whenVisible:m,destroy:h};!l&&s&&(l=a({},s));const p=function(n){var o,a,s;if(r||!t)return r;if("undefined"==typeof IntersectionObserver)return null;const c=null!=(o=null==e?void 0:e(null!=n?n:null))?o:null,d=l||{};return r=new IntersectionObserver(e=>{for(const t of e){const e=i.get(t.target);if(e&&(t.isIntersecting||t.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(n){}}null==r||r.unobserve(t.target),i.delete(t.target)}}},{root:c,rootMargin:null!=(a=d.rootMargin)?a:"300px",threshold:null!=(s=d.threshold)?s:0}),r}(n);return p?(i.set(n,{resolve:d,visible:c}),p.observe(n),{isVisible:c,whenVisible:m,destroy:h}):(c.value=!0,d(),{isVisible:c,whenVisible:m,destroy:h})};return N(ln,s),s}(e=>{var n;return k(null!=(n=null!=e?e:c.value)?n:null)},Z),J=g&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):null,Q=g&&"function"==typeof window.cancelAnimationFrame?window.cancelAnimationFrame.bind(window):null,ee="undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(o=null==(t=globalThis.process)?void 0:t.env)?void 0:o.NODE_ENV),te=g&&"function"==typeof window.requestIdleCallback,oe=B(()=>{var e;const n=Math.trunc(null!=(e=l.renderBatchSize)?e:80);return Number.isFinite(n)?Math.max(0,n):0}),le=B(()=>{var e;const n=Math.trunc(null!=(e=l.initialRenderBatchSize)?e:oe.value);return Number.isFinite(n)?Math.max(0,n):oe.value}),ie=B(()=>!1!==l.batchRendering&&oe.value>0&&g&&!ee),ae=T(0),ce=T({key:l.indexKey,total:0}),ue=T(Math.max(1,oe.value||1)),me=q({}),he=/* @__PURE__ */new Map,fe=/* @__PURE__ */new Map,ge=/* @__PURE__ */new Map,we=T(0),ye=B(()=>(we.value,Array.from(ge.entries()).sort((e,n)=>e[0]-n[0]))),ke=T(0),be=T([]),Me=T([]),_e=T(null);let Ce=null,Be=null;const Te=B(()=>{var e;return!1!==l.deferNodesUntilVisible&&!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&!U.value&&!(z.value.length>900)&&Z.value}),Le=B(()=>{var e;return ie.value&&(null!=(e=l.maxLiveNodes)?e:0)<=0}),Ie=T({batchSize:oe.value,initial:le.value,delay:null!=(r=l.renderBatchDelay)?r:16,enabled:Le.value}),Se=B(()=>!!Y&&(Te.value||U.value)),Ee=B(()=>{var e;return Math.max(0,null!=(e=l.liveNodeBuffer)?e:60)}),je=T(0),$e=q({start:0,end:0}),Ne=/* @__PURE__ */new Map,He=B(()=>{if(!U.value)return z.value.length;const e=Ee.value,n=Math.max($e.end+e,le.value),t=Math.min(z.value.length,n);return Math.max(ae.value,t)});function Re(e){var n,t,o,r;const l=k(null!=(n=null!=e?e:c.value)?n:null);if(l)return l;const i=null!=(r=null!=(o=null==e?void 0:e.ownerDocument)?o:null==(t=c.value)?void 0:t.ownerDocument)?r:"undefined"!=typeof document?document:null;return(null==i?void 0:i.scrollingElement)||(null==i?void 0:i.documentElement)||null}function Ae(e){if(!g)return!1;try{const n=window.getComputedStyle(e);return!!(n.display||"").toLowerCase().includes("flex")&&(n.flexDirection||"").toLowerCase().endsWith("reverse")}catch(n){return!1}}function Oe(){Ce&&(Ce(),Ce=null),_e.value=null}function Pe(){if(!g||!U.value)return;const e=Re();if(!e||_e.value===e)return;Oe();const n=()=>We();e.addEventListener("scroll",n,{passive:!0}),_e.value=e,Ce=()=>{e.removeEventListener("scroll",n)}}function Ve(){var e,n,t;if(!Be)return;const o=null!=(t=null==(n=null==(e=c.value)?void 0:e.ownerDocument)?void 0:n.defaultView)?t:"undefined"!=typeof window?window:null;Be.viaTimeout?o?o.clearTimeout(Be.id):clearTimeout(Be.id):null==Q||Q(Be.id),Be=null}function We(e={}){var n,t,o;if(!U.value)return;if(!g)return void Ke(!0);if(e.immediate)return Ve(),void Ke(!0);if(Be)return;const r=()=>{Be=null,Ke()};if(J)Be={id:J(r),viaTimeout:!1};else{const e=null!=(o=null==(t=null==(n=c.value)?void 0:n.ownerDocument)?void 0:t.defaultView)?o:"undefined"!=typeof window?window:null,l=e?e.setTimeout(r,16):setTimeout(r,16);Be={id:l,viaTimeout:!0}}}function Ke(e=!1){var n,t,o,r,l,i,a;if(!U.value)return;const s=_e.value||Re();if(!s)return;const d=s.ownerDocument||(null==(n=c.value)?void 0:n.ownerDocument)||document,u=(null==d?void 0:d.defaultView)||("undefined"!=typeof window?window:null),m=s===(null==d?void 0:d.documentElement)||s===(null==d?void 0:d.body),h=z.value.length;if(!m&&h>0&&Ae(s)){const n=s.clientHeight||0,t=s.scrollTop,o=t<0?-t:t,r=function(e){var n;const t=z.value;if(!t.length)return 0;if(e<=0)return Math.max(0,t.length-1);if(ke.value===t.length){const n=Je(0,t.length);return tn(Math.max(0,n-e))}let o=e;for(let r=t.length-1;r>=0;r--){const e=null!=(n=Ue[r])?n:Ye.value;if(o<=e)return r;o-=e}return 0}(Math.max(0,o)+.5*Math.max(0,n)),l=Fe(r,0,Math.max(0,h-1));return void((e||Math.abs(l-je.value)>1)&&(je.value=l))}const p=m?null:s.getBoundingClientRect(),f=m?0:p.top,v=m?null!=(o=null!=(t=null==u?void 0:u.innerHeight)?t:s.clientHeight)?o:0:p.bottom,g=ye.value;let w=null,y=null;for(const[c,x]of g){if(!x)continue;const e=x.getBoundingClientRect();e.bottom<=f||e.top>=v||(null==w&&(w=c),y=c)}if(null==w||null==y){const e=c.value;if(!e)return;const n=m?{top:0}:s.getBoundingClientRect(),t=function(e,n,t){var o,r,l,i,a,s;if(t)return null!=(i=null!=(l=null==(o=null==n?void 0:n.documentElement)?void 0:o.scrollTop)?l:null==(r=null==n?void 0:n.body)?void 0:r.scrollTop)?i:0;const c=e.scrollTop;if(!Ae(e))return c;const d=c<0?-c:c;return Math.max(0,(null!=(a=e.scrollHeight)?a:0)-(null!=(s=e.clientHeight)?s:0))-d}(s,d,m),o=m?(()=>{const t=e.getBoundingClientRect(),o=(m?0:n.top)-t.top;return Math.max(0,o)})():(()=>{const n=function(e,n){let t=e,o=0,r=0;for(;t&&t!==n&&r++<64;)o+=t.offsetTop||0,t=t.offsetParent;return o}(e,s);return Math.max(0,t-n)})(),h=m?null!=(a=null!=(i=null!=(l=null==u?void 0:u.innerHeight)?l:null==(r=null==d?void 0:d.documentElement)?void 0:r.clientHeight)?i:s.clientHeight)?a:0:s.clientHeight,p=tn(o+.5*Math.max(0,h));return void(je.value=Fe(p,0,Math.max(0,z.value.length-1)))}const k=Math.round((w+y)/2);!e&&Math.abs(k-je.value)<=1||(je.value=Fe(k,0,Math.max(0,z.value.length-1)))}function Fe(e,n,t){return Math.min(Math.max(e,n),t)}const Ue=q({}),Xe=q({total:0,count:0});function qe(e,n,t){for(let o=n+1;o<e.length;o+=o&-o)e[o]+=t}function Ge(e,n){let t=0;for(let o=n+1;o>0;o-=o&-o)t+=e[o];return t}function Ze(e,n,t){if(t<=n)return 0;const o=Ge(e,t-1);return n<=0?o:o-Ge(e,n-1)}const Ye=B(()=>Xe.count>0?Math.max(12,Xe.total/Xe.count):32);function Je(e,n){var t,o;if(e>=n)return 0;if(ke.value!==z.value.length){let o=0;for(let r=e;r<n;r++)o+=null!=(t=Ue[r])?t:Ye.value;return o}const r=be.value,l=Me.value;if(!r.length||!l.length){let t=0;for(let r=e;r<n;r++)t+=null!=(o=Ue[r])?o:Ye.value;return t}return Ze(r,e,n)+(n-e-Ze(l,e,n))*Ye.value}L(()=>z.value.length,e=>{if(e<=0)return ke.value=0,be.value=[],void(Me.value=[]);e!==ke.value&&function(e){ke.value=e;const n=new Array(e+1).fill(0),t=new Array(e+1).fill(0);for(const[o,r]of Object.entries(Ue)){const l=Number(o),i=Number(r);!Number.isFinite(l)||l<0||l>=e||!Number.isFinite(i)||i<=0||(qe(n,l,i),qe(t,l,1))}be.value=n,Me.value=t}(e)},{immediate:!0});const Qe=B(()=>{if(!U.value)return z.value.map((e,n)=>({node:e,index:n}));const e=z.value.length,n=Fe($e.start,0,e),t=Fe($e.end,n,e);return z.value.slice(n,t).map((e,t)=>({node:e,index:n+t}))}),en=B(()=>U.value?Je(0,Math.min($e.start,z.value.length)):0),nn=B(()=>{if(!U.value)return 0;const e=z.value.length;return Je(Math.min($e.end,e),e)});function tn(e){var n;if(e<=0)return 0;const t=z.value;if(ke.value===t.length&&be.value.length&&Me.value.length){const n=Ye.value,o=be.value,r=Me.value,l=e=>e<=0?0:Ge(o,e-1)+(e-Ge(r,e-1))*n;let i=0,a=t.length-1,s=t.length-1;for(;i<=a;){const n=i+a>>1;l(n+1)>=e?(s=n,a=n-1):i=n+1}return s}let o=e;for(let r=0;r<t.length;r++){const e=null!=(n=Ue[r])?n:Ye.value;if(o<=e)return r;o-=e}return Math.max(0,t.length-1)}function on(){we.value+=1}function rn(e){if(!he.size)return;if(!U.value)return;let n=!1;for(const[t,o]of he)t>=e&&(o.destroy(),he.delete(t),Te.value&&delete me[t],gn(t),ge.delete(t)&&(n=!0));n&&on()}function an(e,n){Te.value&&(me[e]=n),n&&(U.value?We():je.value=Fe(e,0,Math.max(0,z.value.length-1)))}function sn(e){const n=he.get(e);n&&(n.destroy(),he.delete(e)),gn(e)}function cn(e,n){let t=!1;if(n){const o=ge.get(e);ge.set(e,n),o!==n&&(t=!0)}else ge.delete(e)&&(t=!0);if(t&&on(),n||gn(e),!Se.value||!Y)return sn(e),void(n?an(e,!0):Te.value&&delete me[e]);if(!U.value&&Te.value&&!h.value&&he.size>=640&&(function(){if(!h.value){h.value=!0;for(const e of he.values())e.destroy();if(he.clear(),g)for(const e of fe.values())window.clearTimeout(e);fe.clear();for(const e of Object.keys(me))delete me[e]}}(),!Se.value||!Y))return sn(e),void(n?an(e,!0):Te.value&&delete me[e]);if(e<le.value&&!U.value)return sn(e),void an(e,!0);if(!n)return sn(e),void(Te.value&&delete me[e]);sn(e);const o=Y(n,{rootMargin:"400px"});o&&(he.set(e,o),an(e,o.isVisible.value),Te.value&&function(e){if(!g||!Te.value)return;gn(e);const n=e%17*23,t=window.setTimeout(()=>{var n,t;if(fe.delete(e),!Te.value)return;if(!0===me[e])return;const o=ge.get(e);if(!o)return void delete me[e];const r=Re(o),l=o.ownerDocument||document,i=l.defaultView||window,a=!r||r===l.documentElement||r===l.body,s=!a&&r?r.getBoundingClientRect():null,c=a?0:s.top,d=a?null!=(t=null!=(n=i.innerHeight)?n:null==r?void 0:r.clientHeight)?t:0:s.bottom,u=o.getBoundingClientRect();u.bottom>=c-500&&u.top<=d+500&&an(e,!0)},1800+n);fe.set(e,t)}(e),o.whenVisible.then(()=>{gn(e),an(e,!0)}).catch(()=>{}).finally(()=>{he.get(e)===o&&he.delete(e);try{o.destroy()}catch(n){}}),U.value&&We())}let dn=null,un=null,mn=!1,hn=null,pn=null;function vn(){g&&(null!=dn&&(null==Q||Q(dn),dn=null),null!=un&&(window.clearTimeout(un),un=null),null!=pn&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback(pn),pn=null),mn=!1,hn=null)}function gn(e){if(!g)return;const n=fe.get(e);null!=n&&(window.clearTimeout(n),fe.delete(e))}function wn(e,n={}){var t,o;if(!Le.value)return;const r=He.value;if(ae.value>=r)return;const i=Math.max(1,e),a=e=>{var n;dn=null,un=null,pn=null,mn=!1;const t=null!=hn?hn:i;hn=null;const o=Math.max(2,null!=(n=l.renderBatchBudgetMs)?n:6),a=e=>{const n="undefined"!=typeof performance?performance.now():Date.now();ae.value=Math.min(r,ae.value+Math.max(1,e)),rn(ae.value);const t=("undefined"!=typeof performance?performance.now():Date.now())-n;return function(e){var n;if(!Le.value)return;const t=Math.max(2,null!=(n=l.renderBatchBudgetMs)?n:6),o=Math.max(1,oe.value||1),r=Math.max(1,Math.floor(o/4));e>1.2*t?ue.value=Math.max(r,Math.floor(.7*ue.value)):e<.5*t&&ue.value<o&&(ue.value=Math.min(o,Math.ceil(1.2*ue.value)))}(t),t};let s=t;for(;(a(s),!(ae.value>=r)&&e)&&!(("function"==typeof e.timeRemaining?e.timeRemaining():0)<=.5*o);)s=Math.max(1,Math.round(ue.value));ae.value<r&&yn()};if(!g||n.immediate)return void a();const s=Math.max(0,null!=(t=l.renderBatchDelay)?t:16);if(hn=null!=hn?Math.max(hn,i):i,!mn){if(mn=!0,!ee&&te&&window.requestIdleCallback){const e=Math.max(0,null!=(o=l.renderBatchIdleTimeoutMs)?o:120);return void(pn=window.requestIdleCallback(e=>{a(e)},{timeout:e}))}J&&!ee?dn=J(()=>{0!==s?un=window.setTimeout(()=>a(),s):a()}):un=window.setTimeout(()=>a(),s)}}function yn(){Le.value&&wn(ie.value?Math.max(1,Math.round(ue.value)):Math.max(1,oe.value))}L([()=>z.value,()=>z.value.length,()=>Le.value,()=>oe.value,()=>le.value,()=>l.renderBatchDelay,()=>l.indexKey],()=>{var e;const n=z.value.length,t=ce.value,o=l.indexKey,r=void 0!==o&&o!==t.key,i=n!==t.total,a=r||i;ce.value={key:o,total:n};const s=Ie.value,c=null!=(e=l.renderBatchDelay)?e:16,d=s.batchSize!==oe.value||s.initial!==le.value||s.delay!==c||s.enabled!==Le.value;Ie.value={batchSize:oe.value,initial:le.value,delay:c,enabled:Le.value},(a||d||!Le.value)&&vn(),(a||d)&&(ue.value=Math.max(1,oe.value||1)),a&&U.value&&We({immediate:!0});const u=He.value;if(!n)return ae.value=0,void rn(0);if(!Le.value)return ae.value=u,void rn(ae.value);const m=r||0===t.total;ae.value=m||d?Math.min(u,le.value):Math.min(ae.value,u);const h=Math.max(1,le.value||oe.value||n);ae.value<u?wn(h,{immediate:!g}):rn(ae.value)},{immediate:!0}),L(()=>U.value,e=>{if(!e)return Oe(),void Ve();Pe(),We({immediate:!0})},{immediate:!0}),L([()=>z.value.length,()=>U.value],e=>d(null,[e],function*([e,n]){n&&e&&g&&(yield G(),We({immediate:!0}))}),{flush:"post"}),L(()=>c.value,()=>{U.value&&(Pe(),We({immediate:!0}))}),L(()=>z.value.length,()=>{U.value&&We({immediate:!0})}),L(()=>Te.value,e=>{if(e)for(const[n,t]of ge)cn(n,t);else{for(const e of he.values())e.destroy();he.clear();for(const e of Array.from(fe.keys()))gn(e);for(const e of Object.keys(me))delete me[e];for(const[e,n]of ge)n&&an(e,!0)}},{immediate:!1}),L([()=>l.viewportPriority,()=>z.value.length],([e,n])=>{!1!==e?h.value&&n<=200&&(h.value=!1):h.value=!1}),L(()=>ae.value,()=>{U.value&&We({immediate:!0})}),L([je,K,Ee,()=>z.value.length,U],()=>{!function(){const e=z.value.length;if(!U.value||0===e)return $e.start=0,void($e.end=e);const n=Math.min(K.value,e),t=Ee.value,o=Fe(je.value-t,0,Math.max(0,e-n));$e.start=o,$e.end=Math.min(e,o+n)}()},{immediate:!0}),L([()=>z.value.length,U,K,Ee,()=>$e.start,()=>$e.end],([e,n,t,o,r,l])=>{w.value&&y("virtualization",{nodes:e,virtualization:n,maxLiveNodes:t,buffer:o,focusIndex:je.value,scroll:n?(()=>{const e=_e.value||Re();return e?{reverse:Ae(e),scrollTop:Math.round(e.scrollTop),scrollTopAbs:Math.round(Math.abs(e.scrollTop)),scrollHeight:Math.round(e.scrollHeight),clientHeight:Math.round(e.clientHeight)}:null})():null,liveRange:{start:r,end:l},rendered:ae.value})}),L(()=>He.value,(e,n)=>{Le.value&&("number"==typeof n&&e<=n||e>ae.value&&yn())}),S(()=>{vn();for(const e of he.values())e.destroy();he.clear();for(const e of Array.from(fe.keys()))gn(e);Oe(),Ve()});const kn=P(()=>d(null,null,function*(){try{return(yield import("./index4.js")).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to inline-code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',e),kt}})),xn=P(()=>d(null,null,function*(){try{return(yield import("./index5.js")).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',e),kt}})),bn=P(()=>d(null,null,function*(){try{return(yield import("./index6.js")).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for InfographicBlockNode are missing. Falling back to preformatted code rendering. To enable Infographic rendering, please install "@antv/infographic".',e),kt}})),Mn=P(()=>d(null,null,function*(){try{return(yield import("./index7.js")).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',e),kt}})),_n=B(()=>l.renderCodeBlocksAsPre?kt:kn),Cn={text:Sn,paragraph:gt,heading:dt,code_block:kn,list:mt,list_item:ut,blockquote:ne,table:Bt,definition_list:se,footnote:it,footnote_reference:xe,footnote_anchor:ot,admonition:Pt,vmr_container:Et,hardbreak:st,link:Gn,image:fn,thematic_break:Lt,math_inline:En,math_block:jn,strong:Pn,emphasis:nt,strikethrough:Wn,highlight:Qn,insert:Yn,subscript:On,superscript:Rn,emoji:de,checkbox:re,checkbox_input:re,inline_code:ze,html_inline:De,reference:$n,html_block:ft},Bn=B(()=>(pe.value,ve(l.customId))),Tn=B(()=>null!=l.indexKey?String(l.indexKey):"markdown-renderer"),Ln={},In=B(()=>a({stream:l.codeBlockStream,darkTheme:l.codeBlockDarkTheme,lightTheme:l.codeBlockLightTheme,monacoOptions:l.codeBlockMonacoOptions,themes:l.themes,minWidth:l.codeBlockMinWidth,maxWidth:l.codeBlockMaxWidth},l.codeBlockProps||{})),Nn=B(()=>({typewriter:l.typewriter})),Hn=B(()=>Qe.value.map(e=>{const n=An(e.node);return s(a({},e),{component:Dn(e.node,n),bindings:zn(e.node,n),isCodeBlock:"code_block"===e.node.type,indexKey:`${Tn.value}-${e.index}`})}));function An(e){var n;return"code_block"===(null==e?void 0:e.type)?String(null!=(n=e.language)?n:"").trim().toLowerCase():""}function Dn(e,n){if(!e)return St;const t=Bn.value,o=t[String(e.type)];if("code_block"===e.type){const r=null!=n?n:An(e);if("mermaid"===r)return t.mermaid||xn;if("infographic"===r)return t.infographic||bn;if("d2"===r||"d2lang"===r)return t.d2||Mn;if(o)return o;return t.code_block||_n.value}return o||Cn[String(e.type)]||St}function zn(e,n){const t=null!=n?n:An(e);return"mermaid"===t||"infographic"===t||"d2"===t||"d2lang"===t?Ln:"code_block"===e.type?In.value:Nn.value}function Vn(e){i("click",e)}function Kn(e){var n;(null==(n=e.target)?void 0:n.closest("[data-node-index]"))&&i("mouseover",e)}function Fn(e){var n;(null==(n=e.target)?void 0:n.closest("[data-node-index]"))&&i("mouseout",e)}return(e,n)=>(v(),f("div",{ref_key:"containerRef",ref:c,class:E(["markstream-vue markdown-renderer",[{dark:l.isDark},{virtualized:U.value}]]),"data-custom-id":l.customId,onClick:Vn,onMouseover:Kn,onMouseout:Fn},[U.value?(v(),f("div",{key:0,class:"node-spacer",style:D({height:`${en.value}px`}),"aria-hidden":"true"},null,4)):H("",!0),(v(!0),f(x,null,b(Hn.value,e=>{var t,o;return v(),f("div",{key:e.index,ref_for:!0,ref:n=>cn(e.index,n),class:"node-slot","data-node-index":e.index,"data-node-type":e.node.type},[(o=e.index,Le.value&&o>=ae.value||Te.value&&!(o<le.value)&&!0!==me[o]?(v(),f("div",{key:1,class:"node-placeholder",style:D({height:`${null!=(t=Ue[e.index])?t:Ye.value}px`})},null,4)):(v(),f("div",{key:0,ref_for:!0,ref:n=>function(e,n){n?(Ne.set(e,n),queueMicrotask(()=>{!function(e,n){if(!Number.isFinite(n)||n<=0)return;const t=Ue[e];if(Ue[e]=n,t?Xe.total+=n-t:(Xe.total+=n,Xe.count++),ke.value>e){const o=be.value,r=Me.value;if(o.length&&r.length)if(t){const r=n-t;0!==r&&qe(o,e,r)}else qe(o,e,n),qe(r,e,1)}}(e,n.offsetHeight)})):Ne.delete(e)}(e.index,n),class:"node-content"},[e.isCodeBlock||!1===l.typewriter?(v(),V(W(e.component),F({key:1,node:e.node,loading:e.node.loading,"index-key":e.indexKey},{ref_for:!0},e.bindings,{"custom-id":l.customId,"is-dark":l.isDark,onCopy:n[2]||(n[2]=e=>i("copy",e)),onHandleArtifactClick:n[3]||(n[3]=e=>i("handleArtifactClick",e))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(v(),V(R,{key:0,name:"typewriter",appear:""},{default:A(()=>[(v(),V(W(e.component),F({node:e.node,loading:e.node.loading,"index-key":e.indexKey},{ref_for:!0},e.bindings,{"custom-id":l.customId,"is-dark":l.isDark,onCopy:n[0]||(n[0]=e=>i("copy",e)),onHandleArtifactClick:n[1]||(n[1]=e=>i("handleArtifactClick",e))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1024))],512)))],8,$t)}),128)),U.value?(v(),f("div",{key:1,class:"node-spacer",style:D({height:`${nn.value}px`}),"aria-hidden":"true"},null,4)):H("",!0)],42,jt))}}),[["__scopeId","data-v-d64c1cf5"]]);Nt.install=e=>{var n,t;const o=null!=(t=null!=(n=Nt.__name)?n:Nt.name)?t:"NodeRenderer";e.component(o,Nt)};const Ht={key:0,class:"admonition-icon"},Rt={class:"admonition-title"},At=["aria-expanded","aria-controls","title"],Dt={key:0},Ot={key:1},zt=["id"],Pt=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:n}){var t;const o=e,r=n,l={note:"ℹ️",info:"ℹ️",tip:"💡",warning:"⚠️",danger:"❗",error:"⛔",caution:"⚠️"},i=B(()=>{if(o.node.title&&o.node.title.trim().length)return o.node.title;const e=o.node.kind||"note";return e.charAt(0).toUpperCase()+e.slice(1)}),a=T(!!o.node.collapsible&&!(null==(t=o.node.open)||t));function s(){o.node.collapsible&&(a.value=!a.value)}const c=`admonition-${Math.random().toString(36).slice(2,9)}`;return(n,t)=>(v(),f("div",{class:E(["admonition",[`admonition-${o.node.kind}`,o.isDark?"is-dark":""]])},[k("div",{id:c,class:"admonition-header"},[l[o.node.kind]?(v(),f("span",Ht,M(l[o.node.kind]),1)):H("",!0),k("span",Rt,M(i.value),1),o.node.collapsible?(v(),f("button",{key:1,class:"admonition-toggle","aria-expanded":!a.value,"aria-controls":`${c}-content`,title:a.value?"Expand":"Collapse",onClick:s},[a.value?(v(),f("span",Dt,"▶")):(v(),f("span",Ot,"▼"))],8,At)):H("",!0)]),Z(k("div",{id:`${c}-content`,class:"admonition-content","aria-labelledby":c},[g([o.node.children],()=>w(y(Nt),{"index-key":`admonition-${e.indexKey}`,nodes:o.node.children,"custom-id":o.customId,typewriter:o.typewriter,onCopy:t[0]||(t[0]=e=>r("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"]),t,1)],8,zt),[[Y,!a.value]])],2))}}),[["__scopeId","data-v-5e95c2b7"]]);Pt.install=e=>{e.component(Pt.__name,Pt)};const Vt=()=>import("./index8.js");let Wt=null,Kt=Vt;function Ft(e){Kt=e,Wt=null}function Ut(e){Ft(null!=e?e:Vt)}function Xt(){Ft(null)}function qt(){return"function"==typeof Kt}function Gt(){return d(this,null,function*(){if(Wt)return Wt;const e=Kt;if(!e)return null;let n;try{n=yield e()}catch(t){if(e===Vt)throw new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.');throw t}return n?(Wt=function(e){var n;if(!e)return e;if(e.D2&&"function"==typeof e.D2)return e.D2;if(e.default&&e.default.D2&&"function"==typeof e.default.D2)return e.default.D2;const t=null!=(n=e.default)?n:e;return"function"==typeof t?t:(null==t?void 0:t.D2)&&"function"==typeof t.D2?t.D2:t}(n),Wt):null})}let Zt=!1,Yt=null,Jt=!1;function Qt(){return d(this,null,function*(){if(Yt)return Yt;if(Jt)return null;try{return Yt=yield import("stream-monaco"),yield function(e){return d(this,null,function*(){if(Zt)return;Zt=!0;const n=null==globalThis?void 0:globalThis.MonacoEnvironment;return!n||"function"!=typeof n.getWorker&&"function"!=typeof n.getWorkerUrl?e.preloadMonacoWorkers():void 0})}(Yt),(yield function(e){return d(this,null,function*(){const n=null==e?void 0:e.getOrCreateHighlighter;if("function"!=typeof n)return!0;try{const e=yield n(["vitesse-dark","vitesse-light"],["plaintext","text","javascript"]);return e&&"function"==typeof e.codeToTokens&&e.codeToTokens("const a = 1",{lang:"javascript",theme:"vitesse-dark"}),!0}catch(t){return console.warn("[markstream-vue] Failed to warm up Shiki tokenizer; disabling stream-monaco for this session.",t),!1}})}(Yt))?Yt:(Yt=null,Jt=!0,null)}catch(e){return Jt=!0,null}})}let eo=null;function no(e){eo=null!=e?e:null}const to={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain","c++":"cpp","c#":"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function oo(e){var n;const t=function(e){if(!e)return"";const n=e.trim();if(!n)return"";const[t]=n.split(/\s+/),[o]=t.split(":");return o.toLowerCase()}(e);return null!=(n=to[t])?n:t}function ro(e){const n=oo(e);if(!n)return"plaintext";switch(n){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return n}}function lo(e){if(eo){const n=eo(e);if(null!=n&&""!==n)return n}switch(oo(e)){case"javascript":case"js":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4.5 11c0 .828427.6715729 1.5 1.5 1.5.8284271 0 1.5-.671573 1.5-1.5V7.5M12.5 8.75C12.5 8.05964406 11.9627417 7.5 11.3 7.5L10.7 7.5C10.0372583 7.5 9.5 8.05964406 9.5 8.75 9.5 9.44035594 10.0372583 10 10.7 10L11.3 10C11.9627417 10 12.5 10.5596441 12.5 11.25 12.5 11.9403559 11.9627417 12.5 11.3 12.5L10.7 12.5C10.0372583 12.5 9.5 11.9403559 9.5 11.25" />\n <path d="m 4,1.5 h 8 c 1.385,0 2.5,1.115 2.5,2.5 v 8 c 0,1.385 -1.115,2.5 -2.5,2.5 H 4 C 2.615,14.5 1.5,13.385 1.5,12 V 4 C 1.5,2.615 2.615,1.5 4,1.5 Z" />\n </g>\n</svg>\n';case"typescript":case"ts":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4 1.5h8A2.5 2.5 0 0114.5 4v8a2.5 2.5 0 01-2.5 2.5H4A2.5 2.5 0 011.5 12V4A2.5 2.5 0 014 1.5" />\n <path d="M12.5 8.75c0-.69-.54-1.25-1.2-1.25h-.6c-.66 0-1.2.56-1.2 1.25S10.04 10 10.7 10h.6c.66 0 1.2.56 1.2 1.25s-.54 1.25-1.2 1.25h-.6c-.66 0-1.2-.56-1.2-1.25m-3-3.75v5M5 7.5h3" />\n </g>\n</svg>\n';case"jsx":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#99d1db" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 10.8c4.14 0 7.5-1.25 7.5-2.8S12.14 5.2 8 5.2.5 6.45.5 8s3.36 2.8 7.5 2.8" />\n <path d="M5.52 9.4c2.07 3.5 4.86 5.72 6.23 4.95 1.37-.78.8-4.24-1.27-7.75C8.41 3.1 5.62.88 4.25 1.65c-1.37.78-.8 4.24 1.27 7.75" />\n <path d="M5.52 6.6c-2.07 3.5-2.64 6.97-1.27 7.75 1.37.77 4.16-1.45 6.23-4.95s2.64-6.97 1.27-7.75C10.38.88 7.59 3.1 5.52 6.6" />\n <path d="M8.5 8a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n';case"tsx":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 11.3c4.14 0 7.5-1.28 7.5-2.86S12.14 5.58 8 5.58.5 6.86.5 8.44s3.36 2.87 7.5 2.87Z" />\n <path d="M5.52 9.87c2.07 3.6 4.86 5.86 6.23 5.07 1.37-.8.8-4.34-1.27-7.93S5.62 1.16 4.25 1.95s-.8 4.34 1.27 7.92" />\n <path d="M5.52 7.01c-2.07 3.59-2.64 7.14-1.27 7.93s4.16-1.48 6.23-5.07c2.07-3.58 2.64-7.13 1.27-7.92-1.37-.8-4.16 1.47-6.23 5.06" />\n <path d="M8.5 8.44a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n';case"html":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#ef9f76" d="M1.5 1.5h13L13 13l-5 2-5-2z" />\n <path stroke="#c6d0f5" d="M11 4.5H5l.25 3h5.5l-.25 3-2.5 1-2.5-1-.08-1" />\n </g>\n</svg>\n';case"css":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round">\n <path d="m4 1.5h8c1.38 0 2.5 1.12 2.5 2.5v8c0 1.38-1.12 2.5-2.5 2.5h-8c-1.38 0-2.5-1.12-2.5-2.5v-8c0-1.38 1.12-2.5 2.5-2.5z" />\n <path stroke-width=".814" d="m 10.240861,11.529149 c 0,0.58011 0.437448,1.039154 0.96002,1.035371 l 0.451635,-0.0032 c 0.522572,-0.0036 0.949379,-0.451477 0.949379,-1.032848 0,-0.581372 -0.426807,-1.065638 -0.949379,-1.065638 l -0.451635,3.4e-5 c -0.522572,3.9e-5 -0.949379,-0.4855273 -0.949379,-1.0656374 0,-0.5801104 0.426807,-1.0378931 0.949379,-1.0378931 l 0.451635,2.825e-4 c 0.522572,3.267e-4 0.951743,0.4577827 0.951743,1.0378931 M 6.8003972,11.529149 c 0,0.58011 0.4374474,1.039154 0.9600196,1.035371 l 0.46464,-0.0032 c 0.5225722,-0.0035 0.9363738,-0.451477 0.9363738,-1.031587 0,-0.580111 -0.4090724,-1.065638 -0.9316446,-1.065638 l -0.4693692,3.4e-5 c -0.5225722,3.8e-5 -0.949379,-0.4855272 -0.949379,-1.0656373 0,-0.5801104 0.4268068,-1.0378931 0.949379,-1.0378931 h 0.4516348 c 0.5225722,0 0.9635665,0.4577827 0.9635665,1.0378931 M 3.4072246,11.529149 c 0,0.58011 0.4374474,1.051765 0.9600196,1.051765 H 4.818879 c 0.5225722,0 0.949379,-0.456521 0.949379,-1.037893 m 0.01129,-2.1312747 c 0,-0.5801103 -0.4374474,-1.037893 -0.9600196,-1.037893 L 4.3678939,8.3741358 C 3.8453217,8.3744624 3.4078743,8.8420074 3.4078743,9.4233788 v 2.1186642" />\n </g>\n</svg>\n';case"scss":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#f4b8e4" stroke-linecap="round" stroke-linejoin="round" d="M6.75 6.38c1.85 1.07 3.35.74 4.83-.2 1.5-.95 2.7-2.78 1.3-4.15-.7-.68-3.25-.8-5.62.19-2.36.99-4.59 3.02-4.74 4.11-.31 2.19 3.15 2.88 3.64 4.23s.28 1.98-.2 2.83c-.5.85-1.96 1.62-2.8.68-.83-.95 1.67-2.75 2.98-3.25 1.3-.5 3.1-.4 3.69.25.58.64-.07 1.79-.03 1.79" />\n</svg>\n';case"json":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M4.5 2.5H4c-.75 0-1.5.75-1.5 1.5v2c0 1.1-1 2-1.83 2 .83 0 1.83.9 1.83 2v2c0 .75.75 1.5 1.5 1.5h.5m7-11h.5c.75 0 1.5.75 1.5 1.5v2c0 1.1 1 2 1.83 2-.83 0-1.83.9-1.83 2v2c0 .74-.75 1.5-1.5 1.5h-.5m-6.5-3a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1" />\n</svg>\n';case"python":case"py":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#8caaee" d="M8.5 5.5h-3m6 0V3c0-.8-.7-1.5-1.5-1.5H7c-.8 0-1.5.7-1.5 1.5v2.5H3c-.8 0-1.5.7-1.5 1.5v2c0 .8.7 1.5 1.48 1.5" />\n <path stroke="#e5c890" d="M10.5 10.5h-3m-3 0V13c0 .8.7 1.5 1.5 1.5h3c.8 0 1.5-.7 1.5-1.5v-2.5H13c.8 0 1.5-.7 1.5-1.5V7c0-.8-.7-1.5-1.48-1.5H11.5c0 1.5 0 2-1 2h-2" />\n <path stroke="#8caaee" d="M2.98 10.5H4.5c0-1.5 0-2 1-2h2M7.5 3.5v0" />\n <path stroke="#e5c890" d="m 8.5,12.5 v 0" />\n </g>\n</svg>\n';case"ruby":case"rb":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="M1.5 9.06v2.5c.02.86.36 1.61.9 2.15 1.76 1.76 5.71.65 8.84-2.47 3.12-3.13 4.23-7.08 2.47-8.84a3.1 3.1 0 00-2.15-.9h-2.5M14.5 4l-.25 10.25L4 14.5m4.39-6.11c2.34-2.35 3.29-5.2 2.12-6.37S6.49 1.8 4.14 4.14C1.8 6.5.85 9.34 2.02 10.51s4.02.22 6.37-2.12M5.5 14.5l.25-3.75L11 11l-.25-5.25 3.75-.25" />\n</svg>\n';case"go":case"golang":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round" d="m15.48 8.06-4.85.48m4.85-.48a4.98 4.98 0 01-4.54 5.42 5 5 0 112.95-8.66l-1.7 1.84a2.5 2.5 0 00-4.18 2.06c.05.57.3 1.1.69 1.51.25.27 1 .83 1.78.82.8-.02 1.58-.25 2.07-.81 0 0 .8-.96.68-1.88M2.5 8.5l-2 .01m1.5 2h1.5m-2-3.99 2-.02" />\n</svg>\n';case"r":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#838ba7" d="M13.5 9.5c.63-.7 1-1.54 1-2.43 0-2.52-2.91-4.57-6.5-4.57S1.5 4.55 1.5 7.07c0 1.9 1.65 3.53 4 4.22" />\n <path stroke="#8caaee" d="M10.5 9.5c.4 0 .86.34 1 .7l1 3.3m-5 0v-8h3.05c.95 0 1.95 1 1.95 2s-1 2-1.95 2H7.5Z" />\n </g>\n</svg>\n';case"java":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#c6d0f5" d="M10.73 8.41c.57 3 1.59 5.83 2.77 7.09-6.63-3.45-9.76-1.75-10.5 0-.66-3.4-.54-5.74.09-7.78" />\n <path stroke="#e78284" d="M8.5 7c.63.34 1.82 1.07 2.24 1.41-.54-2.9-.64-5.96-.74-7.91-2.13.58-5.73 1.98-6.9 7.22.52-.69 1.72-1.05 2.4-1.22" />\n <path stroke="#e78284" d="M5.5 7A1.5 1.5 0 007 8.5 1.5 1.5 0 008.5 7 1.5 1.5 0 007 5.5 1.5 1.5 0 005.5 7" />\n </g>\n</svg>\n';case"kotlin":case"kt":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#ca9ee6" d="M2.5 13.5h11L8 8" />\n <path stroke="#ef9f76" d="M8.03 2.5h5.47l-8 8" />\n <path stroke="#e78284" d="M2.5 13.5V8" />\n <path stroke="#85c1dc" d="M8 2.5H2.5V8l3-2.5" />\n </g>\n</svg>\n';case"c":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="m 4.0559072,12.951629 c 2.7459832,2.734744 7.1981158,2.734744 9.9441188,0 l -1.789955,-1.782586 c -1.75742,1.750224 -4.6067879,1.750224 -6.3642294,0 -1.7574416,-1.7502236 -1.7574416,-4.587893 0,-6.338097 1.7574415,-1.750224 4.6068094,-1.750224 6.3642294,0 l 0.894977,-0.8912929 0.894978,-0.891293 c -2.746003,-2.73472867 -7.1981359,-2.73472867 -9.944119,0 -2.7459858,2.7347089 -2.7459858,7.1685599 2e-7,9.9032689 z" clip-rule="evenodd" />\n</svg>\n';case"cpp":case"c++":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="m 2.5559121,12.951629 c 2.7459832,2.734744 7.1981158,2.734744 9.9441189,0 l -1.789955,-1.782586 c -1.7574201,1.750224 -4.606788,1.750224 -6.3642295,0 -1.7574416,-1.7502236 -1.7574416,-4.587893 0,-6.338097 1.7574415,-1.750224 4.6068094,-1.750224 6.3642295,0 l 0.894977,-0.8912929 0.894978,-0.891293 c -2.7460031,-2.73472867 -7.198136,-2.73472867 -9.9441191,0 -2.74598585,2.7347089 -2.74598585,7.1685599 2e-7,9.9032689 z" clip-rule="evenodd" />\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M7.5 6v4M5.513524 7.9999996H9.51304M13.486476 5.9999996v4M11.5 7.9999992h3.999516" />\n</svg>\n';case"cs":case"csharp":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" d="m 6.665625,1.0107144 c 0.54375,0.090628 0.9125,0.6062693 0.821875,1.1500367 L 7.18125,3.9983098 h 2.971875 L 10.5125,1.8326156 c 0.09063,-0.5437673 0.60625,-0.9125291 1.15,-0.8219012 0.54375,0.090628 0.9125,0.6062693 0.821875,1.1500367 L 12.18125,3.9983098 H 14 c 0.553125,0 1,0.4468892 1,1.0000319 0,0.5531426 -0.446875,1.0000319 -1,1.0000319 H 11.846875 L 11.18125,9.9985013 H 13 c 0.553125,0 1,0.4468897 1,1.0000317 0,0.553143 -0.446875,1.000032 -1,1.000032 H 10.846875 L 10.4875,14.164259 c -0.09063,0.543768 -0.60625,0.912529 -1.15,0.821902 -0.54375,-0.09063 -0.9125,-0.60627 -0.821875,-1.150037 l 0.30625,-1.834434 h -2.975 L 5.4875,14.167384 c -0.090625,0.543768 -0.60625,0.91253 -1.15,0.821902 C 3.79375,14.898658 3.425,14.383016 3.515625,13.839249 L 3.81875,11.998565 H 2 c -0.553125,0 -1,-0.446889 -1,-1.000032 C 1,10.445391 1.446875,9.9985013 2,9.9985013 H 4.153125 L 4.81875,5.9983736 H 3 c -0.553125,0 -1,-0.4468893 -1,-1.0000319 C 2,4.445199 2.446875,3.9983098 3,3.9983098 H 5.153125 L 5.5125,1.8326156 C 5.603125,1.2888483 6.11875,0.9200865 6.6625,1.0107144 Z M 6.846875,5.9983736 6.18125,9.9985013 H 9.153125 L 9.81875,5.9983736 Z" />\n</svg>\n';case"php":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M0.5,12.5 L0.5,13.24 C0.5,14 1.27360724,14.5 2,14.5 C2.9375516,14.5 3.5,14 3.5,13.2445661 L3.5,6.00089968 C3.5,4.28551107 4.99401107,2.52263547 7.14960413,2.5 C9.49387886,2.5 11,4.0579782 11,5.5 C11.1657296,8.48962302 9.57820404,9.63684469 7.49621582,10.5 L7.49621582,14.5 L15.4979764,14.5 L15.4979764,9 C15.5394484,8.36478228 14.9387379,7.15595371 14.1308258,6.5 C13.1942239,5.80827275 12.0584852,5.50253264 11,5.5 M11.5,14.5 L11.5,11.5 M6,6.5 C6.27614237,6.5 6.5,6.27614237 6.5,6 C6.5,5.72385763 6.27614237,5.5 6,5.5 C5.72385763,5.5 5.5,5.72385763 5.5,6 C5.5,6.27614237 5.72385763,6.5 6,6.5 Z" />\n</svg>\n';case"scala":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="m2.5 2.48 11-.98v3.04l-11 1zm0 5 11-.98v3.04l-11 1zm0 5 11-.98v3.04l-11 1z" />\n</svg>\n';case"shell":case"sh":case"bash":case"zsh":case"powershell":case"ps1":case"bat":case"batch":case"shellscript":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M2 15.5c-.7 0-1.5-.8-1.5-1.5V5c0-.7.8-1.5 1.5-1.5h9c.7 0 1.5.8 1.5 1.5v9c0 .7-.8 1.5-1.5 1.5z" />\n <path d="m1.2 3.8 3.04-2.5S5.17.5 5.7.5h8.4c.66 0 1.4.73 1.4 1.4v7.73a2.7 2.7 0 01-.7 1.75l-2.68 3.51M3 8.5l3 2-3 2m4 0h2" />\n </g>\n</svg>\n';case"sql":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M8 6.5c3.59 0 6.5-1.4 6.5-2.68S11.59 1.5 8 1.5 1.5 2.54 1.5 3.82 4.41 6.5 8 6.5M14.5 8c0 .83-1.24 1.79-3.25 2.2s-4.49.41-6.5 0S1.5 8.83 1.5 8m13 4.18c0 .83-1.24 1.6-3.25 2-2.01.42-4.49.42-6.5 0-2.01-.4-3.25-1.17-3.25-2m0-8.3v8.3m13-8.3v8.3" />\n</svg>\n';case"yaml":case"yml":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="M2.5 1.5h3l3 4 3-4h3l-9 13h-3L7 8z" />\n</svg>\n';case"markdown":case"md":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round" d="m9.25 8.25 2.25 2.25 2.25-2.25M3.5 11V5.5l2.04 3 1.96-3V11m4-.5V5M1.65 2.5h12.7c.59 0 1.15.49 1.15 1v9c0 .51-.56 1-1.15 1H1.65c-.59 0-1.15-.49-1.15-1V3.58c0-.5.56-1.08 1.15-1.08" />\n</svg>\n';case"xml":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="M4.5 4.5 1 8 4.5 11.5M11.5 4.5 15 8 11.5 11.5M9.5 2 6.5 14" />\n</svg>\n';case"rust":case"rs":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round">\n <path d="M15.5 9.5Q8 13.505.5 9.5l1-1-1-2 2-.5V4.5h2l.5-2 1.5 1 1.5-2 1.5 2 1.5-1 .5 2h2V6l2 .5-1 2z" />\n <path d="M6.5 7.5a1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1 1 1 0 011 1m5 0a1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1 1 1 0 011 1M4 11.02c-.67.37-1.5.98-1.5 2.23s1.22 1.22 2 1.25v-2M12 11c.67.37 1.5 1 1.5 2.25s-1.22 1.22-2 1.25v-2" />\n </g>\n</svg>\n';case"swift":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="M14.34 10.2c.34-1.08 1.1-5.07-4.45-8.62a.48.48 0 00-.6.07.44.44 0 00-.02.6c.03.02 2.07 2.5 1.34 5.34-1.26-.86-6.24-4.81-6.24-4.81L7.25 7.5 1.9 4.05S5.68 8.7 8 10.45c-1.12.4-3.56.82-6.78-1.18a.48.48 0 00-.58.06.44.44 0 00-.08.56c.11.18 2.7 4.36 8.14 4.36 1.5 0 2.37-.42 3.08-.77.43-.2.77-.37 1.14-.37.93 0 1.54.92 1.54.93.1.14.27.22.44.21a.46.46 0 00.4-.28c.67-1.55-.49-3.2-.96-3.78h0Z" />\n</svg>\n';case"perl":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M12.5 14.5v-3.34c-1-.66-1-1.35-1-2.66m-3 1 .02 2.53.98 2.47m-4-5v5m9 0V9.23s.17-1.73-1-1.73c0-1.5-.5-6-2.5-6S8.75 4.25 8.75 4.25A3.67 3.67 0 006.5 7.12v-3.5c0-.63-.85-1.32-1.5-1.32-.92 0-1.33.59-1.5 1.2H2.25c-.42.11-.75.59-.75 1 0 .5.28 1 .75 1h1.22l.02 3c.01.75.51 1 1.51 1h4.5" />\n</svg>\n';case"lua":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#c6d0f5" d="M10.5 7A1.5 1.5 0 019 8.5 1.5 1.5 0 017.5 7 1.5 1.5 0 019 5.5 1.5 1.5 0 0110.5 7" />\n <path stroke="#8caaee" d="M7 2.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13m7-2a1.5 1.5 0 100 3 1.5 1.5 0 000-3" />\n </g>\n</svg>\n';case"haskell":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M12.5 4.5h3m-1.5 3h1.5m-10 6 2.5-5-2.5-5H8l5.6 10h-2.53l-1.52-2.92L8 13.5zm-5 0 2.5-5-2.5-5H3l2.5 5-2.5 5z" />\n</svg>\n';case"erlang":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round">\n <path d="M6.5 5.5c0-1.25 1-2 2-2s2 .75 2 2z" />\n <path d="M13.5 13c.47-.57 1.12-1.24 1.5-2l-2.25-1.25c-.74 1.36-1.76 2.75-3.25 2.75-2.1 0-3-2.3-3-5h8c.05-1.61-.31-3.45-1-4.5M3 13c-1.08-1.3-1.5-3-1.5-5S2.1 4.24 3 3" />\n </g>\n</svg>\n';case"clojure":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#a6d189" d="M14.17 10.03A6.5 6.5 0 011.81 6.02" />\n <path stroke="#8caaee" d="M1.87 5.85A6.5 6.5 0 0114.22 9.9" />\n <path stroke="#a6d189" d="M6.36 4.9a3.5 3.5 0 103.41 6.12" />\n <path stroke="#8caaee" d="M9.77 11.02a3.5 3.5 0 00-3.03-6.29" />\n <path stroke="#c6d0f5" d="M8 7.5s-1.66 2.48-1.5 3.65" />\n <path stroke="#c6d0f5" d="M1.81 6.02C2.47 5 3.83 4.49 5 4.46c4.06 0 3 5.56 5.03 6.86 1.21.52 3.5-.21 4.15-1.32" />\n </g>\n</svg>\n';case"vue":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#a6d189" stroke-linecap="round" stroke-linejoin="round">\n <path d="M1 1.5h5.44L8 4.56 9.56 1.5H15l-6.99 13z" />\n <path d="M12.05 1.73 8 9.28 3.95 1.73" />\n </g>\n</svg>\n';case"svg":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="m4.54 10 6.92-4m-6.92 4a1.5 1.5 0 10-2.6 1.5 1.5 1.5 0 002.6-1.5M8 4v8m0-8a1.5 1.5 0 100-3 1.5 1.5 0 000 3M4.54 6l6.92 4M4.54 6a1.5 1.5 0 10-2.6-1.5A1.5 1.5 0 004.54 6M8 12a1.5 1.5 0 100 3 1.5 1.5 0 000-3m3.46-2a1.5 1.5 0 102.6 1.5 1.5 1.5 0 00-2.6-1.5m0-4a1.5 1.5 0 102.6-1.5 1.5 1.5 0 00-2.6 1.5" />\n</svg>\n';case"mermaid":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M1.5 2.5c0 6 2.25 5.75 4 7 .83.67 1.17 2 1 4h3c-.17-2 .17-3.33 1-4 1.75-1.25 4-1 4-7C12 2.5 10 3 8 7 6 3 4 2.5 1.5 2.5" />\n</svg>\n';case"dart":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round">\n <path d="M7 14.5h4.5v-3h3V7L9.17 1.64c-.28-.29-.8-.47-1.17-.29L3.5 3.5 1.35 8c-.18.37 0 .88.3 1.17z" />\n <path d="M3.5 11V3.5H11m-7.5 0 8 8" />\n </g>\n</svg>\n';case"assembly":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <rect width="8" height="13.001" x="4" y="1.499" fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round" rx="2.286" ry="2.286" />\n <path fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round" d="M 4,4.500025 H 1.5 M 4,7.9999993 H 1.5 M 4,11.499973 H 1.5 m 13,-6.999948 H 12 m 2.5,3.4999743 H 12 m 2.5,3.4999737 H 12" />\n</svg>\n';case"dockerfile":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M.5 8.5H11l.75-.5a5.35 5.35 0 010-3.5c1 .6 1 1.88 1.74 2 .77-.09 1.23.01 2 .52 0 0-.97 1.77-2.5 1.98-1.93 3.65-4.5 5.5-6.98 5.5C0 14.5.5 8.5.5 8.5m1 0v-2m0 0h8m-6 2v-4m0 0h4m-2-2h2m-2 6v-6m2 6v-6m2 6v-2" />\n</svg>\n';case"fortran":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M7.5 14.5v-1l-1-1v-3h2l1 2h1v-6h-1l-1 2h-2v-4h5l1 3h1v-5h-11v1l1 1v9l-1 1.25v.75z" />\n</svg>\n';case"lisp":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round">\n <path d="M.5 5.06v6.07C.5 12.41.82 13 2.27 13h5.6c1.04 0 1.63-.51 1.63-1.62 0-.85-.2-1.88-1.5-1.88h-.36C6.4 9.5 6 8.77 6 7.75 6 6.81 6.8 6 7.49 6h2.68" />\n <path d="M3.5 10.5V4.99C3.5 3.89 3.62 3 5 3h9c.97 0 1.5.99 1.5 1.63.12 1.55-.98 1.62-2.1 2.16-.58.26-1.4.52-1.4.98V11" />\n </g>\n</svg>\n';case"ocaml":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round">\n <path d="M1.5 8V3c0-.83.67-1.5 1.5-1.5h10c.83 0 1.5.67 1.5 1.5v10c0 .83-.67 1.5-1.5 1.5H9" />\n <path d="m1.5 8 1.14-2.3q.09-.21.36-.24a.8.8 0 01.44.13c.18.12.23.53.28.64.06.1.64 1.23.85 1.23.2 0 .71-1.47.71-1.47s.37-.49.72-.49.55.32.67.49c.12.16.24 1.76.46 2.01s1.32.87 1.67.73c.34-.13.53-.4.63-.73.1-.34-.14-.75 0-1a1.1 1.1 0 011.02-.55c.56.03 2.05.56 2.05 1.05q0 .75-1.5.75c-.48 1.33.28 2.22-3 2.25l1 4" />\n <path d="m4.5 14.5 1.5-4 1 4zm-2 0 1.5-4-1.5-.5-1 1.54V14l1 .49Z" />\n </g>\n</svg>\n';case"prolog":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="M4.5 13.5c-.33.33-.5.67-.5 1s.17.67.5 1c.17-.67.5-1 1-1s.83.33 1 1c.33-.33.5-.83.5-1.5h2c0 .67.17 1.17.5 1.5.17-.67.5-1 1-1s.83.33 1 1c.33-.33.5-.67.5-1s-.17-.67-.5-1l1-1 1.25 1.25c0-2.75 1-2.75 1-5.75a7.1 7.1 0 00-2-5.25A3.64 3.64 0 0113 .5c-1.17 0-2 .42-2.5 1.25A3.08 3.08 0 008 .5c-1 0-1.83.42-2.5 1.25C5 .92 4.17.5 3 .5c.5.83.58 1.58.25 2.25a7.1 7.1 0 00-2 5.25c0 3 1 3 1 5.75L3.5 12.5zm6-5a2 2 0 100-4 2 2 0 000 4m-5 0a2 2 0 100-4 2 2 0 000 4M7 8l1 2.5L9 8m1.5-1.5" />\n</svg>\n';case"groovy":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round">\n <path d="M11.68 5.38c.4.19.54.68 1.53 3.25 1 2.57-.92 4.07-.92 4.07s-6.73 2.47-6.73 1.63c-.18-.92-1.92-2.08-1.92-2.08s-.52-.63.06-.75c5.89-1.27 6.96-.61 7.3-2" />\n <path d="M7.38 10.63C2.62 10.88 2.48 8.08 2.5 8 3.6 4.6 9.24.91 10.8 1.58 14.07 3.04 9.2 8.96 7 8.5c-4.02-.83 1.5-4 1.5-4" />\n </g>\n</svg>\n';case"matlab":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#85c1dc" d="M4 11 .5 8.5 5 7q.78-1.77 1.89-1.89c.74-.07 1.94-1.28 3.61-3.61M5 7l1.5 1.5" />\n <path stroke="#ef9f76" d="m15.5 12.5-5-11C8.5 6.83 6.33 10 4 11c1.67-.33 2.67.83 3 3.5 3.5-1.5 3.5-3.5 5-4s1.5 1.5 3.5 2" />\n </g>\n</svg>\n';case"cobol":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M6.74 2.24c.32-1.32 2.2-1.32 2.52 0a1.3 1.3 0 001.93.8c1.15-.7 2.48.62 1.77 1.77a1.3 1.3 0 00.8 1.93c1.32.32 1.32 2.2 0 2.52a1.3 1.3 0 00-.8 1.93c.7 1.15-.62 2.48-1.77 1.77a1.3 1.3 0 00-1.93.8c-.32 1.32-2.2 1.32-2.52 0a1.3 1.3 0 00-1.93-.8c-1.15.7-2.48-.62-1.77-1.77a1.3 1.3 0 00-.8-1.93c-1.32-.32-1.32-2.2 0-2.52a1.3 1.3 0 00.8-1.93c-.7-1.15.62-2.48 1.77-1.77a1.3 1.3 0 001.93-.8M10 6.5a2.5 2.5 0 100 3" />\n</svg>\n';case"ada":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<path fill="#0f23c3" d="M24.554 20.075c.209.27 1.356.961 1.37 1.246a7 7 0 0 0-1.4-.324a17 17 0 0 1-1.412-.48a9.2 9.2 0 0 1-2.375-1.3A3.15 3.15 0 0 1 19.3 16.75a1.72 1.72 0 0 1 1.767-1.822a3.6 3.6 0 0 1 1.593.321c.146.066 1.31.606 1.256.809a5.5 5.5 0 0 0-1.41-.112c-.649.244-.4.828-.168 1.311a8 8 0 0 0 1.078 1.554c.164.194.884 1.271 1.138 1.264"/><path fill="#1a1978" d="M24.141 16.276c.128-.59.819-1.384 1.344-.773a4.2 4.2 0 0 1 .578 1.918c.12.656.2 1.327.261 1.982c.038.379.34 1.794.123 2.075a23 23 0 0 1-2.922-2.838a3.76 3.76 0 0 1-.925-1.7c-.1-1.073.879-.73 1.541-.664"/><path fill="#0f23c3" d="M26.3 17.781c.141-.732-.406-2.592-1.067-2.949a.06.06 0 0 0 .044-.007c-.156-.444-1.359 1.116-1.228 1.174c-.316-.138.774-1.984.988-2.16c.7-.578 1.372-.086 1.845.543a6.04 6.04 0 0 1 .733 4.434a4.5 4.5 0 0 1-.421 1.312c-.1.22-.45 1.1-.682 1.174a14.8 14.8 0 0 0-.212-3.521"/><path fill="#d2d2d2" d="M3.687 8.4c.179-.188-.041-1.527.324-1.548c.262-.015.553 1.741.627 1.968a9.2 9.2 0 0 0 1.127 2.329a7.53 7.53 0 0 0 4.016 2.978a4.55 4.55 0 0 0 2.366.2c.931-.208 1.82-.577 2.757-.765c1.35-.27 3.342-.352 4.438.647c.7.641.376.76.043 1.421a2.44 2.44 0 0 0 .178 2.562c.235.342 1.033.827.675 1.094c-.567.424-1.277-.452-1.636-.776c-1.4-1.264-2.711-1.313-4.492-1.074a9 9 0 0 1-4.883-.708A9.47 9.47 0 0 1 3.687 8.4M19.941 30a3.6 3.6 0 0 1-2.325-.817c.469-.092 1.021.025 1.508-.044a9.7 9.7 0 0 0 1.754-.43a10.5 10.5 0 0 0 3.022-1.554a6.55 6.55 0 0 0 2.757-5.214c.149-.088.316 1.034.319 1.091a5.8 5.8 0 0 1-.19 1.727a6.9 6.9 0 0 1-1.423 2.774A7.3 7.3 0 0 1 19.941 30"/><path fill="#d2d2d2" d="M18.962 19.109a5.8 5.8 0 0 1-2.05.859a13.4 13.4 0 0 1-2.224.549a8.86 8.86 0 0 1-4.435-.51a9.94 9.94 0 0 1-3.849-2.4c-.352-.367-2.104-2.417-1.548-3.05c.248-.282.875.846 1 .992a5 5 0 0 0 1.357 1.11a10.9 10.9 0 0 0 4.035 1.456a6.7 6.7 0 0 0 2.34-.094a13 13 0 0 1 1.694-.485a4 4 0 0 1 2.113.457c.344.17 1.523.743 1.567 1.116m9.351-4.031a19.3 19.3 0 0 1-.453 3.774c-.176-.242.016-1.47 0-1.792a6 6 0 0 0-.384-2.087a4.9 4.9 0 0 0-1.376-1.661a15 15 0 0 1-1.27-1.536c-1.837-2.382-3.245-5.211-2.9-8.3c.034-.308.069-1.448.411-1.445c.152 0 .266 1.561.29 1.718a12.5 12.5 0 0 0 1.224 4.116c.67 1.222 1.947 2.023 2.825 3.1a6.58 6.58 0 0 1 1.633 4.113M15.7 26.935a10.85 10.85 0 0 0 6.436-.687a6.94 6.94 0 0 0 4.278-4.418c.319.2-.048 1.529-.128 1.781a5.7 5.7 0 0 1-1.01 1.813a8.9 8.9 0 0 1-3.257 2.514c-1.703.772-5.662 1.652-6.319-1.003"/><path fill="#d2d2d2" d="M19.151 19.376c.367 2.107-2.957 3.124-4.478 3.213c-1.859.11-4.929-.292-6.06-2.031c-.673-1.035.781-.09 1.188.058a8.7 8.7 0 0 0 3.06.5a11.6 11.6 0 0 0 3.305-.5a14 14 0 0 0 1.533-.576c.301-.132 1.124-.691 1.452-.664m4.991 4.084c.4-.945-1.883-1.578-2.445-1.858a4.9 4.9 0 0 1-1.315-.867c-.181-.181-.872-.92-.807-1.219a5 5 0 0 1 1.087-.175a6 6 0 0 1 .855.588a10 10 0 0 0 .964.5a16 16 0 0 0 2.119.771c.308.09 1.549.208 1.727.428c-.04.296-1.97 2.021-2.185 1.832"/><path fill="#d2d2d2" d="M26.1 22.172c.265.43-1.08 1.831-1.363 2.105a9.3 9.3 0 0 1-2.566 1.728a7.8 7.8 0 0 1-2.56.753c-.679.058-1.966-.124-2.141-.979a7 7 0 0 1 1.177-.086c.462-.059.921-.149 1.376-.246a13 13 0 0 0 2.184-.645a11.5 11.5 0 0 0 2.084-1.11a11 11 0 0 0 1.078-.822c.105-.089.617-.702.731-.698m-7.342-10.207c-.1-1.308 2.612-1.3 3.271-1.092a5.98 5.98 0 0 1 2.982 2.475c-1.082.8-2.449.094-3.3-.654a4.3 4.3 0 0 0-1.481-1.029c-.809-.265-.818.094-1.472.3"/><path fill="#d2d2d2" d="M25.783 13.341c-.444-.029-.316.071-.647-.212c-.358-.307-.614-.795-.945-1.141c-.534-.558-1.242-.895-1.723-1.485a7.27 7.27 0 0 1-1.624-4.848c.018-1.489.407.187.551.675a12.3 12.3 0 0 0 1.126 2.708a46 46 0 0 0 3.4 4.321c-.039.002-.097-.021-.138-.018m-5.715 1.415c.033-.625-.911-.792-1.211-1.42c-.164-.343-.211-.569.029-.7c.082-.045.383.012.5-.02c.271-.076.335-.273.581-.4a1.193 1.193 0 0 1 1.633 1.021a1.82 1.82 0 0 1-1.532 1.519"/><path fill="#d2d2d2" d="M20.5 14.745a1.93 1.93 0 0 0 1.323-1.7c.524.139.928.658 1.521.771a2.6 2.6 0 0 0 1.029-.017c.207-.045.54-.274.721-.259c-.033.163-.464.546-.565.717a4.2 4.2 0 0 0-.388.9c-.229.741-.061.739-.709.311a4.3 4.3 0 0 0-1.957-.72c-.266-.026-.881.019-.975-.003m-.595 5.989a2.01 2.01 0 0 1-1.4 1.712c-.205.091-2.018.733-2.032.348c-.007-.2 1.624-.954 1.809-1.11a3.4 3.4 0 0 0 .867-1.071c.055-.112.232-.925.271-.943c.224-.106.488.93.485 1.064m-8.532-8.202a10.6 10.6 0 0 1 3.71-.914a10.3 10.3 0 0 1 1.865.024c.366.039 1.469.054 1.74.343a.255.255 0 0 1-.273.173c-.037.077.251.371.3.425c-.034.034-1.445-.4-1.572-.424a10.6 10.6 0 0 0-2.282-.134a16 16 0 0 0-1.841.194a6.2 6.2 0 0 1-1.647.313m11.139-1.801a1.89 1.89 0 0 1-1.517-.6c-.247-.349-.737-1.692-.385-2.021c.209-.2.384.662.484.846a11 11 0 0 0 1.418 1.775m5.276 8.469a19 19 0 0 1-.749 3.313c-.173-.077-.275-.778-.562-.95a4.1 4.1 0 0 0 .76-1.154c.152-.302.303-1.046.551-1.209m-7.807-7.357c-.132.268-.932 1.1-1.118.481c-.107-.356.876-.841 1.118-.481m-.747.45c.228.006.012-.248.012-.266c-.001-.043-.368.266-.012.266"/></svg>';case"julia":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#a6d189" d="M10.5 5a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0" />\n <path stroke="#e78284" d="M6.5 11a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0" />\n <path stroke="#ca9ee6" d="M14.5 11a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0" />\n </g>\n</svg>\n';case"elixir":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M8.03 14.5C5 14.5 3.5 12.49 3.5 10.01c0-2.82 2.25-7.02 4.62-8.48a.24.24 0 01.24 0c.08.04.12.12.11.2-.13 1.25.22 2.5.98 3.54.3.43.63.8 1.02 1.27.54.66.94 1.03 1.52 2.08l.01.02c.33.56.5 1.2.5 1.84 0 2.03-1.69 4.02-4.47 4.02" />\n</svg>\n';case"vb.net":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<path fill="#00519a" d="M6.67 7.836L9 18.915l2.336-11.079H16l-4.664 16.328H6.672L2 7.836Zm11.661 0h7.6a4.08 4.08 0 0 1 2.9 1.749a3.8 3.8 0 0 1 .571 2.04a4 4 0 0 1-.571 2.034a4.1 4.1 0 0 1-2.341 1.763a4.1 4.1 0 0 1 2.929 1.756a3.8 3.8 0 0 1 .58 2.1a4.66 4.66 0 0 1-.579 2.546a5.05 5.05 0 0 1-3.5 2.338h-7.589ZM23 14.252h1.166a1.754 1.754 0 0 0 0-3.5H23Zm0 7h1.39a2.047 2.047 0 0 0 0-4.089H23Z"/></svg>';case"nim":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M1 7 .5 4.5l1.01.67c.28-.27.47-.48 1.18-.85l.56-1.82L4.5 3.84c.77-.18 1.53-.36 2.4-.33L8 1.5l1.1 2.01c.87-.03 1.63.15 2.4.33l1.25-1.34.56 1.82c.7.37.9.58 1.18.85l1.01-.67L15 7m-1.5 1C13 6.5 11 5.5 8 5.5S3 6.5 2.5 8m11.5.75L13.5 8l-1 1.5-1.5.5-3-1.5L5 10l-1.5-.5-1-1.5-.5.75L1 7l1.25 3.75C3 12.75 6 13.5 8 13.5s5-.75 5.75-2.75L15 7z" />\n</svg>\n';case"crystal":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round" d="m 15.4712,10.050637 -5.433601,5.433968 c -0.015,0.01505 -0.04554,0.01505 -0.09055,0.01505 L 2.536327,13.517264 c -0.015,0 -0.04501,-0.01505 -0.06055,-0.06072 L 0.50026325,6.0396501 a 0.21432208,0.21495127 0 0 1 0.015,-0.090817 L 5.9483283,0.5154023 c 0.015,-0.0150465 0.04501,-0.0150465 0.09055,-0.0150465 l 7.4101857,1.997972 c 0.015,0 0.04501,0.015046 0.06055,0.060724 l 1.977121,7.4158186 c 0.03001,0.03063 0.01608,0.060724 -0.01554,0.07577 M 8.2121063,4.1480782 0.93801425,6.1154197 q -0.0225,0 0,0.04514 L 6.2655263,11.50371 c 0.015,0.01505 0.015,0 0.04501,0 l 1.962119,-7.2803988 c -0.03054,-0.075233 -0.06055,-0.075233 -0.06055,-0.075233" />\n</svg>\n';case"d":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<defs><linearGradient id="SVGMV3iTbAN" x1="185.455" x2="181.955" y1="1601.641" y2="1630.224" gradientTransform="translate(-62.523 -666.646)scale(.427)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></linearGradient><linearGradient id="SVGniw2Mvsa" x1="176.136" x2="172.636" y1="1600.5" y2="1629.083" href="#SVGMV3iTbAN"/></defs><path fill="#b03931" d="m3.978 15.462l-.009-6.953a.59.59 0 0 1 .531-.562h.076l6.074-.009a15.7 15.7 0 0 1 6.067.95a8.9 8.9 0 0 1 2.244 1.359a4.47 4.47 0 0 1 2.946-1.083a4.11 4.11 0 0 1 4.276 3.92A4.11 4.11 0 0 1 21.907 17c-.089 0-.177-.008-.265-.012a7 7 0 0 1-.232.953a85 85 0 0 1 8.59 2.6V2H2v13.4q.992.02 1.978.062m22.8-7.944a1.32 1.32 0 0 1 1.374 1.259a1.379 1.379 0 0 1-2.747 0a1.32 1.32 0 0 1 1.375-1.26Z"/><path fill="#b03931" d="M17.861 15.787a4.11 4.11 0 0 0-1.748-3.458a5.8 5.8 0 0 0-1.508-.822a7.4 7.4 0 0 0-1.629-.438a22 22 0 0 0-2.588-.1H7.769l.006 4.737a89 89 0 0 1 9.91 1.408a5 5 0 0 0 .176-1.327m3.132 3.192a7.9 7.9 0 0 1-2.128 2.582a9.7 9.7 0 0 1-3.256 1.71a11.6 11.6 0 0 1-1.971.472h-.015a32 32 0 0 1-3.326.111l-5.625.022a.616.616 0 0 1-.686-.681l-.01-7.734Q2.992 15.42 2 15.4V30h28v-9.456a85 85 0 0 0-8.59-2.6a7 7 0 0 1-.417 1.035"/><path fill="url(#SVGMV3iTbAN)" d="M20.993 18.979a7.9 7.9 0 0 1-2.128 2.582a9.7 9.7 0 0 1-3.256 1.71a11.6 11.6 0 0 1-1.971.472h-.015a32 32 0 0 1-3.326.111l-5.625.022a.616.616 0 0 1-.686-.681l-.01-7.734Q2.992 15.42 2 15.4V30h28v-9.456a85 85 0 0 0-8.59-2.6a7 7 0 0 1-.417 1.035" opacity=".3"/><path fill="#b03931" d="M10.477 20.835a16 16 0 0 0 2.877-.2a7.6 7.6 0 0 0 1.628-.5a5.6 5.6 0 0 0 1.187-.748a4.46 4.46 0 0 0 1.518-2.271a89 89 0 0 0-9.91-1.408l.006 5.133Z"/><path fill="url(#SVGniw2Mvsa)" d="M10.477 20.835a16 16 0 0 0 2.877-.2a7.6 7.6 0 0 0 1.628-.5a5.6 5.6 0 0 0 1.187-.748a4.46 4.46 0 0 0 1.518-2.271a89 89 0 0 0-9.91-1.408l.006 5.133Z" opacity=".3"/><path fill="#fff" d="M20.383 11.746a7 7 0 0 1 1.36 4.148a6.6 6.6 0 0 1-.1 1.1c.088 0 .176.012.265.012a4.11 4.11 0 0 0 4.276-3.92a4.11 4.11 0 0 0-4.276-3.92a4.47 4.47 0 0 0-2.946 1.083a8 8 0 0 1 1.421 1.497"/><ellipse cx="26.78" cy="8.777" fill="#fff" rx="1.374" ry="1.259"/><path fill="#fff" d="m4.673 23.877l5.625-.022a32 32 0 0 0 3.326-.111h.015a11.5 11.5 0 0 0 1.971-.472a9.7 9.7 0 0 0 3.256-1.71a7.9 7.9 0 0 0 2.128-2.582a7 7 0 0 0 .417-1.034a7 7 0 0 0 .332-2.051a7 7 0 0 0-1.36-4.148a8 8 0 0 0-1.421-1.5a8.9 8.9 0 0 0-2.244-1.359a15.7 15.7 0 0 0-6.067-.95l-6.074.009h-.076a.59.59 0 0 0-.532.562l.009 6.952l.01 7.734a.616.616 0 0 0 .685.682m3.1-12.908h2.619a22 22 0 0 1 2.588.1a7.4 7.4 0 0 1 1.629.438a5.8 5.8 0 0 1 1.508.822a4.12 4.12 0 0 1 1.748 3.458a5 5 0 0 1-.175 1.327a4.46 4.46 0 0 1-1.518 2.271a5.6 5.6 0 0 1-1.187.748a7.7 7.7 0 0 1-1.628.5a16 16 0 0 1-2.877.2H7.786L7.78 15.7Z"/></svg>';case"applescript":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round" d="M14.4561802 11.3673353C13.0276218 14.1261537 11.8858593 15.5 10.8437759 15.5 10.3588459 15.5 9.88231005 15.3491298 9.41749082 15.0543006 8.74000639 14.6241577 7.8668418 14.6059458 7.17068967 15.0074382 6.60881451 15.3319356 6.07177167 15.5 5.56305868 15.5 4.02887542 15.5 1.5 10.9491129 1.5 8.45090396 1.5 5.78581061 2.95006811 3.551507 5.15647301 3.551507 6.19383481 3.551507 7.09007204 4.20001691 7.84308619 4.497206 8.16210316 4.62512517 8.52255587 4.61592787 8.83410596 4.47192 9.44477141 4.18872223 10.2497236 3.551507 11.2503615 3.551507 12.4715175 3.551507 13.5338865 4.33779342 14.4184071 5.47479877 14.5532906 5.64778615 14.5172013 5.89341518 14.3377895 6.02349446 13.3500923 6.736546 12.8746057 7.53893969 12.8746057 8.45090396 12.8746057 9.36404821 13.3502672 10.1652619 14.3377895 10.8793249 14.4946576 10.992887 14.5445377 11.1984946 14.4561802 11.3673353ZM8.5 3C8.5 3 8.3468635 1.3936039 10 1" />\n</svg>\n';case"solidity":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="m3 11.5 2.5 4 2.5-4 2.5 4 2.5-4-2.5-4-2.5 4m2.5 4h-5m7.5-4H3m10-7-2.5-4-2.5 4-2.5-4-2.5 4 2.5 4 2.5-4M5.5.5h5M3 4.5h10" />\n</svg>\n';case"objectivec":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<path fill="#c2c2c2" d="M11.29 15.976a8.9 8.9 0 0 0 1.039 4.557a4.82 4.82 0 0 0 5.579 2.13a3.79 3.79 0 0 0 2.734-3.181c.095-.535.1-.54.1-.54c1.537.222 4.014.582 5.55.8l-.1.389A9.96 9.96 0 0 1 23.8 24.9a8.35 8.35 0 0 1-4.747 2.378a12.93 12.93 0 0 1-7.322-.725a8.98 8.98 0 0 1-5.106-5.524A14.35 14.35 0 0 1 6.642 10.9a9.32 9.32 0 0 1 7.929-6.24a11.8 11.8 0 0 1 5.9.491a8.47 8.47 0 0 1 5.456 6.1c.083.311.1.369.1.369c-1.709.311-3.821.705-5.518 1.075c-.323-1.695-1.122-3.029-2.831-3.445a4.656 4.656 0 0 0-5.853 3.158a9 9 0 0 0-.341 1.273a11 11 0 0 0-.194 2.295"/><path fill="#c2c2c2" d="M2.033 30V2h5.934v2.227H4.723v23.546h3.244V30zm27.934-.001h-5.934v-2.228h3.244V4.226h-3.244V1.999h5.934z"/></svg>';case"objectivecpp":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<path fill="#c2c2c2" d="M19.5 24.833a11.24 11.24 0 0 1-5.13 1.009a8.37 8.37 0 0 1-6.492-2.576A9.75 9.75 0 0 1 5.512 16.4a10.4 10.4 0 0 1 2.659-7.406a9.02 9.02 0 0 1 6.9-2.841a12.2 12.2 0 0 1 4.43.7v4.129a7.5 7.5 0 0 0-4.108-1.142a5.28 5.28 0 0 0-4.075 1.685A6.48 6.48 0 0 0 9.766 16.1a6.37 6.37 0 0 0 1.464 4.4a5.02 5.02 0 0 0 3.941 1.639a8.03 8.03 0 0 0 4.329-1.223Z"/><path fill="#c2c2c2" d="M16.572 15.081V13.24h1.841v1.841h1.84v1.84h-1.84v1.841h-1.841v-1.841h-1.839V15.08zm6.44 0V13.24h1.841v1.841h1.84v1.84h-1.84v1.841h-1.841v-1.841h-1.839V15.08zM2.035 30V2.001h5.933v2.227H4.725v23.545h3.243V30z"/><path fill="#c2c2c2" d="M29.965 29.999h-5.933v-2.228h3.243V4.227h-3.243V2h5.933z"/></svg>';case"terraform":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="m1.5 6 8 4.25 4-2.25m-12-2V1.5l8 4.25 4-2.25V8m-4-2.25v8.75M5.53 3.82 5.5 12.5l4 2" />\n</svg>\n';case"plain":case"text":case"":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M13.5 6.5v6a2 2 0 01-2 2h-7a2 2 0 01-2-2v-9c0-1.1.9-2 2-2h4.01" />\n <path d="m8.5 1.5 5 5h-4a1 1 0 01-1-1zm-3 10h5m-5-3h5m-5-3h1" />\n </g>\n</svg>\n';default:return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16">\x3c!-- Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE --\x3e<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m10 9l-3 3l3 3m4 0l3-3l-3-3"/><rect width="18" height="18" x="3" y="3" rx="2"/></g></svg>'}}const io={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"},ao={key:0,class:"code-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5",style:{color:"var(--vscode-editor-foreground)","background-color":"var(--vscode-editor-background)"}},so={class:"flex items-center gap-x-2"},co=["innerHTML"],uo={class:"text-sm font-medium font-mono"},mo={class:"flex items-center gap-x-2"},ho=["aria-pressed"],po=["disabled"],fo=["disabled"],vo=["disabled"],go=["aria-label"],wo={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},yo={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},ko=["aria-pressed"],xo={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"0.75rem",height:"0.75rem",viewBox:"0 0 24 24"},bo={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"0.75rem",height:"0.75rem",viewBox:"0 0 24 24"},Mo=["aria-label"],_o=["innerHTML"],Co={class:"code-loading-placeholder"},Bo=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"MarkdownCodeBlockNode",props:{node:{},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{default:"vitesse-dark"},lightTheme:{default:"vitesse-light"},isDark:{type:Boolean,default:!1},isShowPreview:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{default:void 0},maxWidth:{default:void 0},themes:{},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0}},emits:["previewCode","copy"],setup(e,{emit:n}){var t;const o=e,r=n,{t:l}=rn(),i=T(String(null!=(t=o.node.language)?t:"")),a=T(!1),s=T(!1),c=T(!1),u=T(null),m=T(null),h=T(""),p=T(!1);let g;const w=T(!0),b=T(0),_=T(14),C=T(_.value),j=B(()=>{const e=_.value,n=C.value;return"number"==typeof e&&Number.isFinite(e)&&e>0&&"number"==typeof n&&Number.isFinite(n)&&n>0}),$=B(()=>{const e=i.value.trim().toLowerCase();return io[e]||e.charAt(0).toUpperCase()+e.slice(1)}),N=B(()=>lo(i.value.trim().toLowerCase().split(":")[0])),R=B(()=>{const e=i.value.trim().toLowerCase();return o.isShowPreview&&("html"===e||"svg"===e)}),A=B(()=>{const e={},n=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},t=n(o.minWidth),r=n(o.maxWidth);return t&&(e.minWidth=t),r&&(e.maxWidth=r),e}),z=B(()=>({fontSize:`${C.value}px`}));function P(){return o.isDark?o.darkTheme:o.lightTheme}function V(e){if(null==g||g.disconnect(),g=void 0,!e)return h.value="",void(p.value=!1);var n;h.value=`<pre class="shiki shiki-fallback"><code>${n=e,n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}</code></pre>`,p.value=!1}function W(){h.value="",p.value=!0}function K(){var e;const n=m.value;return!!n&&(n.childNodes.length>0||Boolean(null==(e=n.textContent)?void 0:e.trim().length))}function F(){return d(this,null,function*(){if(yield G(),K())return void W();const e=m.value;e&&(null==g||g.disconnect(),g=new MutationObserver(()=>{K()&&(W(),null==g||g.disconnect(),g=void 0)}),g.observe(e,{childList:!0,subtree:!0}))})}let U,X,q,J;const Q=/* @__PURE__ */new Set,ee=/* @__PURE__ */new Set,ne=void 0!==import.meta&&Boolean(!1);function te(e,n){return d(this,null,function*(){if(!U)return;const t=function(e,n=!1){var t;const[o]=String(null!=e?e:"").split(":"),r=null!=(t=null==o?void 0:o.trim().toLowerCase())?t:"";return r?!J||J.has(r)?r:(n&&ne&&!Q.has(r)&&(Q.add(r),console.warn(`[MarkdownCodeBlockNode] Language "${r}" not preloaded in stream-markdown; falling back to plaintext.`)),"plaintext"):"plaintext"}(n,Boolean(e&&e.length));try{yield U.updateCode(e,t)}catch(o){"plaintext"!==t?(ne&&!ee.has(t)&&(ee.add(t),console.warn(`[MarkdownCodeBlockNode] Failed to render language "${t}", retrying as plaintext.`,o)),yield U.updateCode(e,"plaintext")):ne&&console.warn("[MarkdownCodeBlockNode] Failed to render code block even as plaintext.",o)}})}function oe(){return d(this,null,function*(){yield function(){return d(this,null,function*(){if(!X)try{const e=yield import("stream-markdown");X=e.createShikiStreamRenderer,q=e.registerHighlight;const n=Array.isArray(e.defaultLanguages)?e.defaultLanguages:void 0;J=n?new Set(n.map(e=>e.toLowerCase())):void 0,null==q||q({themes:o.themes})}catch(e){console.warn("[MarkdownCodeBlockNode] stream-markdown not available:",e)}})}(),u.value&&m.value?(null==q||q({themes:o.themes}),!U&&X&&(U=X(m.value,{theme:P()}),p.value=!0),U?!1===o.stream&&o.loading?V(o.node.code):(V(o.node.code),yield te(o.node.code,i.value),yield F()):V(o.node.code)):V(o.node.code)})}function re(){const e=u.value;if(!e||s.value)return;const n=e.scrollTop;n<b.value?w.value=!1:function(e,n=50){return e.scrollHeight-e.scrollTop-e.clientHeight<=n}(e)&&(w.value=!0),b.value=n}function le(){return d(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(o.node.code)),a.value=!0,r("copy",o.node.code),setTimeout(()=>{a.value=!1},1e3)}catch(e){console.error("Copy failed:",e)}})}function ie(e){return!e||e.disabled}function ae(e,n,t="top"){if(ie(e.currentTarget))return;const r=e,l=null!=(null==r?void 0:r.clientX)&&null!=(null==r?void 0:r.clientY)?{x:r.clientX,y:r.clientY}:void 0;en(e.currentTarget,n,t,!1,l,o.isDark)}function se(){nn()}function ce(e){if(ie(e.currentTarget))return;const n=a.value?l("common.copied")||"Copied":l("common.copy")||"Copy",t=e,r=null!=(null==t?void 0:t.clientX)&&null!=(null==t?void 0:t.clientY)?{x:t.clientX,y:t.clientY}:void 0;en(e.currentTarget,n,"top",!1,r,o.isDark)}function de(){s.value=!s.value;const e=u.value;e&&(s.value?(e.style.maxHeight="none",e.style["overflow-y"]="visible",e.style["overflow-x"]="auto"):(e.style.maxHeight="500px",e.style.overflow="auto",w.value=!0,G(()=>{e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})))}function ue(){c.value=!c.value}function me(){if(!R.value)return;const e=(i.value||o.node.language).toLowerCase(),n="html"===e?"HTML Preview":"SVG Preview";r("previewCode",{type:"html"===e?"text/html":"image/svg+xml",content:o.node.code,title:n})}return oe(),I(()=>{oe()}),S(()=>{null==g||g.disconnect(),g=void 0}),L(()=>o.themes,()=>d(null,null,function*(){q&&q({themes:o.themes})})),L(()=>o.loading,e=>{e||oe()}),L(()=>[o.node.code,o.node.language],e=>d(null,[e],function*([e,n]){n!==i.value&&(i.value=n.trim()),u.value&&m.value?(U||(V(e),yield oe()),U&&e&&(!1===o.stream&&o.loading||(V(e),yield te(e,n),yield F()))):V(e)})),L(()=>[o.darkTheme,o.lightTheme],()=>d(null,null,function*(){u.value&&m.value&&(U||(yield oe()),null==U||U.setTheme(P()))})),L(()=>o.node.code,()=>d(null,null,function*(){if(s.value||!w.value)return;yield G();const e=u.value;e&&e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})),(n,t)=>(v(),f("div",{style:D(A.value),class:E(["code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",[o.isDark?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",o.isDark?"is-dark":""]])},[o.showHeader?(v(),f("div",ao,[O(n.$slots,"header-left",{},()=>[k("div",so,[k("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:N.value},null,8,co),k("span",uo,M($.value),1)])],!0),O(n.$slots,"header-right",{},()=>[k("div",mo,[k("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":c.value,onClick:ue,onMouseenter:t[0]||(t[0]=e=>ae(e,c.value?y(l)("common.expand")||"Expand":y(l)("common.collapse")||"Collapse")),onFocus:t[1]||(t[1]=e=>ae(e,c.value?y(l)("common.expand")||"Expand":y(l)("common.collapse")||"Collapse")),onMouseleave:se,onBlur:se},[(v(),f("svg",{style:D({rotate:c.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[...t[17]||(t[17]=[k("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,ho),o.showFontSizeButtons&&o.enableFontSizeControl?(v(),f(x,{key:0},[k("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!!Number.isFinite(C.value)&&C.value<=10,onClick:t[2]||(t[2]=e=>function(){const e=Math.max(10,C.value-1);C.value=e}()),onMouseenter:t[3]||(t[3]=e=>ae(e,y(l)("common.decrease")||"Decrease")),onFocus:t[4]||(t[4]=e=>ae(e,y(l)("common.decrease")||"Decrease")),onMouseleave:se,onBlur:se},[...t[18]||(t[18]=[k("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[k("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)])],40,po),k("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!j.value||C.value===_.value,onClick:t[5]||(t[5]=e=>{C.value=_.value}),onMouseenter:t[6]||(t[6]=e=>ae(e,y(l)("common.reset")||"Reset")),onFocus:t[7]||(t[7]=e=>ae(e,y(l)("common.reset")||"Reset")),onMouseleave:se,onBlur:se},[...t[19]||(t[19]=[k("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[k("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[k("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),k("path",{d:"M3 3v5h5"})])],-1)])],40,fo),k("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!!Number.isFinite(C.value)&&C.value>=36,onClick:t[8]||(t[8]=e=>function(){const e=Math.min(36,C.value+1);C.value=e}()),onMouseenter:t[9]||(t[9]=e=>ae(e,y(l)("common.increase")||"Increase")),onFocus:t[10]||(t[10]=e=>ae(e,y(l)("common.increase")||"Increase")),onMouseleave:se,onBlur:se},[...t[20]||(t[20]=[k("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[k("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)])],40,vo)],64)):H("",!0),o.showCopyButton?(v(),f("button",{key:1,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":a.value?y(l)("common.copied")||"Copied":y(l)("common.copy")||"Copy",onClick:le,onMouseenter:t[11]||(t[11]=e=>ce(e)),onFocus:t[12]||(t[12]=e=>ce(e)),onMouseleave:se,onBlur:se},[a.value?(v(),f("svg",yo,[...t[22]||(t[22]=[k("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(v(),f("svg",wo,[...t[21]||(t[21]=[k("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[k("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),k("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,go)):H("",!0),o.showExpandButton?(v(),f("button",{key:2,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":s.value,onClick:de,onMouseenter:t[13]||(t[13]=e=>ae(e,s.value?y(l)("common.collapse")||"Collapse":y(l)("common.expand")||"Expand")),onFocus:t[14]||(t[14]=e=>ae(e,s.value?y(l)("common.collapse")||"Collapse":y(l)("common.expand")||"Expand")),onMouseleave:se,onBlur:se},[s.value?(v(),f("svg",xo,[...t[23]||(t[23]=[k("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])])):(v(),f("svg",bo,[...t[24]||(t[24]=[k("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])]))],40,ko)):H("",!0),R.value&&o.showPreviewButton?(v(),f("button",{key:3,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":y(l)("common.preview")||"Preview",onClick:me,onMouseenter:t[15]||(t[15]=e=>ae(e,y(l)("common.preview")||"Preview")),onFocus:t[16]||(t[16]=e=>ae(e,y(l)("common.preview")||"Preview")),onMouseleave:se,onBlur:se},[...t[25]||(t[25]=[k("svg",{"data-v-3d59cc65":"",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[k("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[k("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),k("circle",{cx:"12",cy:"12",r:"3"})])],-1)])],40,Mo)):H("",!0)])],!0)])):H("",!0),Z(k("div",{ref_key:"codeBlockContent",ref:u,class:"code-block-content",style:D(z.value),onScroll:re},[k("div",{ref_key:"rendererTarget",ref:m,class:"code-block-render"},null,512),p.value?H("",!0):(v(),f("div",{key:0,class:"code-fallback-plain",innerHTML:h.value},null,8,_o))],36),[[Y,!(c.value||!e.stream&&e.loading)]]),Z(k("div",Co,[O(n.$slots,"loading",{loading:e.loading,stream:e.stream},()=>[t[26]||(t[26]=k("div",{class:"loading-skeleton"},[k("div",{class:"skeleton-line"}),k("div",{class:"skeleton-line"}),k("div",{class:"skeleton-line short"})],-1))],!0)],512),[[Y,!e.stream&&e.loading]])],6))}}),[["__scopeId","data-v-9411928c"]]);Bo.install=e=>{e.component(Bo.__name,Bo)};const To=()=>import("mermaid");let Lo=null,Io=To;function So(e){Io=e,Lo=null}function Eo(e){So(null!=e?e:To)}function jo(){So(null)}function $o(){return"function"==typeof Io}function No(e){if(!e)return e;const n=e&&e.default?e.default:e;if(n&&("function"==typeof n.render||"function"==typeof n.parse||"function"==typeof n.initialize))return n;if(n&&n.mermaidAPI&&("function"==typeof n.mermaidAPI.render||"function"==typeof n.mermaidAPI.parse)){const e=n.mermaidAPI;return s(a({},n),{render:e.render.bind(e),parse:e.parse?e.parse.bind(e):void 0,initialize:t=>"function"==typeof n.initialize?n.initialize(t):e.initialize?e.initialize(t):void 0})}return e.mermaid&&"function"==typeof e.mermaid.render?e.mermaid:n}function Ho(e){if(e)try{const n=null==e?void 0:e.initialize;e.initialize=t=>{const o=a({suppressErrorRendering:!0},t||{});return"function"==typeof n?n.call(e,o):(null==e?void 0:e.mermaidAPI)&&"function"==typeof e.mermaidAPI.initialize?e.mermaidAPI.initialize(o):void 0}}catch(n){}}function Ro(){return d(this,null,function*(){if(Lo)return Lo;const e=function(){try{const e=globalThis;return No(null==e?void 0:e.mermaid)}catch(e){return null}}();if(e)return Lo=e,Ho(Lo),Lo;const n=Io;if(!n)return null;let t;try{t=yield n()}catch(o){if(n===To)throw new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.');throw o}return t?(Lo=No(t),Ho(Lo),Lo):null})}const Ao=Math.min,Do=Math.max,Oo=Math.round,zo=Math.floor,Po=e=>({x:e,y:e}),Vo={left:"right",right:"left",bottom:"top",top:"bottom"},Wo={start:"end",end:"start"};function Ko(e,n,t){return Do(e,Ao(n,t))}function Fo(e,n){return"function"==typeof e?e(n):e}function Uo(e){return e.split("-")[0]}function Xo(e){return e.split("-")[1]}function qo(e){return"x"===e?"y":"x"}function Go(e){return"y"===e?"height":"width"}const Zo=/* @__PURE__ */new Set(["top","bottom"]);function Yo(e){return Zo.has(Uo(e))?"y":"x"}function Jo(e){return qo(Yo(e))}function Qo(e){return e.replace(/start|end/g,e=>Wo[e])}const er=["left","right"],nr=["right","left"],tr=["top","bottom"],or=["bottom","top"];function rr(e){return e.replace(/left|right|bottom|top/g,e=>Vo[e])}function lr(e){const{x:n,y:t,width:o,height:r}=e;return{width:o,height:r,top:t,left:n,right:n+o,bottom:t+r,x:n,y:t}}function ir(e,n,t){let{reference:o,floating:r}=e;const l=Yo(n),i=Jo(n),a=Go(i),s=Uo(n),c="y"===l,d=o.x+o.width/2-r.width/2,u=o.y+o.height/2-r.height/2,m=o[a]/2-r[a]/2;let h;switch(s){case"top":h={x:d,y:o.y-r.height};break;case"bottom":h={x:d,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:u};break;case"left":h={x:o.x-r.width,y:u};break;default:h={x:o.x,y:o.y}}switch(Xo(n)){case"start":h[i]-=m*(t&&c?-1:1);break;case"end":h[i]+=m*(t&&c?-1:1)}return h}function ar(e,n){return d(this,null,function*(){var t;void 0===n&&(n={});const{x:o,y:r,platform:l,rects:i,elements:s,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:m="floating",altBoundary:h=!1,padding:p=0}=Fo(n,e),f=function(e){return"number"!=typeof e?function(e){return a({top:0,right:0,bottom:0,left:0},e)}(e):{top:e,right:e,bottom:e,left:e}}(p),v=s[h?"floating"===m?"reference":"floating":m],g=lr(yield l.getClippingRect({element:null==(t=yield null==l.isElement?void 0:l.isElement(v))||t?v:v.contextElement||(yield null==l.getDocumentElement?void 0:l.getDocumentElement(s.floating)),boundary:d,rootBoundary:u,strategy:c})),w="floating"===m?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,y=yield null==l.getOffsetParent?void 0:l.getOffsetParent(s.floating),k=(yield null==l.isElement?void 0:l.isElement(y))&&(yield null==l.getScale?void 0:l.getScale(y))||{x:1,y:1},x=lr(l.convertOffsetParentRelativeRectToViewportRelativeRect?yield l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:y,strategy:c}):w);return{top:(g.top-x.top+f.top)/k.y,bottom:(x.bottom-g.bottom+f.bottom)/k.y,left:(g.left-x.left+f.left)/k.x,right:(x.right-g.right+f.right)/k.x}})}const sr=/* @__PURE__ */new Set(["left","top"]);function cr(){return"undefined"!=typeof window}function dr(e){return hr(e)?(e.nodeName||"").toLowerCase():"#document"}function ur(e){var n;return(null==e||null==(n=e.ownerDocument)?void 0:n.defaultView)||window}function mr(e){var n;return null==(n=(hr(e)?e.ownerDocument:e.document)||window.document)?void 0:n.documentElement}function hr(e){return!!cr()&&(e instanceof Node||e instanceof ur(e).Node)}function pr(e){return!!cr()&&(e instanceof Element||e instanceof ur(e).Element)}function fr(e){return!!cr()&&(e instanceof HTMLElement||e instanceof ur(e).HTMLElement)}function vr(e){return!(!cr()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof ur(e).ShadowRoot)}const gr=/* @__PURE__ */new Set(["inline","contents"]);function wr(e){const{overflow:n,overflowX:t,overflowY:o,display:r}=Sr(e);return/auto|scroll|overlay|hidden|clip/.test(n+o+t)&&!gr.has(r)}const yr=/* @__PURE__ */new Set(["table","td","th"]);function kr(e){return yr.has(dr(e))}const xr=[":popover-open",":modal"];function br(e){return xr.some(n=>{try{return e.matches(n)}catch(t){return!1}})}const Mr=["transform","translate","scale","rotate","perspective"],_r=["transform","translate","scale","rotate","perspective","filter"],Cr=["paint","layout","strict","content"];function Br(e){const n=Tr(),t=pr(e)?Sr(e):e;return Mr.some(e=>!!t[e]&&"none"!==t[e])||!!t.containerType&&"normal"!==t.containerType||!n&&!!t.backdropFilter&&"none"!==t.backdropFilter||!n&&!!t.filter&&"none"!==t.filter||_r.some(e=>(t.willChange||"").includes(e))||Cr.some(e=>(t.contain||"").includes(e))}function Tr(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Lr=/* @__PURE__ */new Set(["html","body","#document"]);function Ir(e){return Lr.has(dr(e))}function Sr(e){return ur(e).getComputedStyle(e)}function Er(e){return pr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jr(e){if("html"===dr(e))return e;const n=e.assignedSlot||e.parentNode||vr(e)&&e.host||mr(e);return vr(n)?n.host:n}function $r(e){const n=jr(e);return Ir(n)?e.ownerDocument?e.ownerDocument.body:e.body:fr(n)&&wr(n)?n:$r(n)}function Nr(e,n,t){var o;void 0===n&&(n=[]),void 0===t&&(t=!0);const r=$r(e),l=r===(null==(o=e.ownerDocument)?void 0:o.body),i=ur(r);if(l){const e=Hr(i);return n.concat(i,i.visualViewport||[],wr(r)?r:[],e&&t?Nr(e):[])}return n.concat(r,Nr(r,[],t))}function Hr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Rr(e){const n=Sr(e);let t=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const r=fr(e),l=r?e.offsetWidth:t,i=r?e.offsetHeight:o,a=Oo(t)!==l||Oo(o)!==i;return a&&(t=l,o=i),{width:t,height:o,$:a}}function Ar(e){return pr(e)?e:e.contextElement}function Dr(e){const n=Ar(e);if(!fr(n))return Po(1);const t=n.getBoundingClientRect(),{width:o,height:r,$:l}=Rr(n);let i=(l?Oo(t.width):t.width)/o,a=(l?Oo(t.height):t.height)/r;return i&&Number.isFinite(i)||(i=1),a&&Number.isFinite(a)||(a=1),{x:i,y:a}}const Or=/* @__PURE__ */Po(0);function zr(e){const n=ur(e);return Tr()&&n.visualViewport?{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}:Or}function Pr(e,n,t,o){void 0===n&&(n=!1),void 0===t&&(t=!1);const r=e.getBoundingClientRect(),l=Ar(e);let i=Po(1);n&&(o?pr(o)&&(i=Dr(o)):i=Dr(e));const a=function(e,n,t){return void 0===n&&(n=!1),!(!t||n&&t!==ur(e))&&n}(l,t,o)?zr(l):Po(0);let s=(r.left+a.x)/i.x,c=(r.top+a.y)/i.y,d=r.width/i.x,u=r.height/i.y;if(l){const e=ur(l),n=o&&pr(o)?ur(o):o;let t=e,r=Hr(t);for(;r&&o&&n!==t;){const e=Dr(r),n=r.getBoundingClientRect(),o=Sr(r),l=n.left+(r.clientLeft+parseFloat(o.paddingLeft))*e.x,i=n.top+(r.clientTop+parseFloat(o.paddingTop))*e.y;s*=e.x,c*=e.y,d*=e.x,u*=e.y,s+=l,c+=i,t=ur(r),r=Hr(t)}}return lr({width:d,height:u,x:s,y:c})}function Vr(e,n){const t=Er(e).scrollLeft;return n?n.left+t:Pr(mr(e)).left+t}function Wr(e,n){const t=e.getBoundingClientRect();return{x:t.left+n.scrollLeft-Vr(e,t),y:t.top+n.scrollTop}}const Kr=/* @__PURE__ */new Set(["absolute","fixed"]);function Fr(e,n,t){let o;if("viewport"===n)o=function(e,n){const t=ur(e),o=mr(e),r=t.visualViewport;let l=o.clientWidth,i=o.clientHeight,a=0,s=0;if(r){l=r.width,i=r.height;const e=Tr();(!e||e&&"fixed"===n)&&(a=r.offsetLeft,s=r.offsetTop)}const c=Vr(o);if(c<=0){const e=o.ownerDocument,n=e.body,t=getComputedStyle(n),r="CSS1Compat"===e.compatMode&&parseFloat(t.marginLeft)+parseFloat(t.marginRight)||0,i=Math.abs(o.clientWidth-n.clientWidth-r);i<=25&&(l-=i)}else c<=25&&(l+=c);return{width:l,height:i,x:a,y:s}}(e,t);else if("document"===n)o=function(e){const n=mr(e),t=Er(e),o=e.ownerDocument.body,r=Do(n.scrollWidth,n.clientWidth,o.scrollWidth,o.clientWidth),l=Do(n.scrollHeight,n.clientHeight,o.scrollHeight,o.clientHeight);let i=-t.scrollLeft+Vr(e);const a=-t.scrollTop;return"rtl"===Sr(o).direction&&(i+=Do(n.clientWidth,o.clientWidth)-r),{width:r,height:l,x:i,y:a}}(mr(e));else if(pr(n))o=function(e,n){const t=Pr(e,!0,"fixed"===n),o=t.top+e.clientTop,r=t.left+e.clientLeft,l=fr(e)?Dr(e):Po(1);return{width:e.clientWidth*l.x,height:e.clientHeight*l.y,x:r*l.x,y:o*l.y}}(n,t);else{const t=zr(e);o={x:n.x-t.x,y:n.y-t.y,width:n.width,height:n.height}}return lr(o)}function Ur(e,n){const t=jr(e);return!(t===n||!pr(t)||Ir(t))&&("fixed"===Sr(t).position||Ur(t,n))}function Xr(e,n,t){const o=fr(n),r=mr(n),l="fixed"===t,i=Pr(e,!0,l,n);let a={scrollLeft:0,scrollTop:0};const s=Po(0);function c(){s.x=Vr(r)}if(o||!o&&!l)if(("body"!==dr(n)||wr(r))&&(a=Er(n)),o){const e=Pr(n,!0,l,n);s.x=e.x+n.clientLeft,s.y=e.y+n.clientTop}else r&&c();l&&!o&&r&&c();const d=!r||o||l?Po(0):Wr(r,a);return{x:i.left+a.scrollLeft-s.x-d.x,y:i.top+a.scrollTop-s.y-d.y,width:i.width,height:i.height}}function qr(e){return"static"===Sr(e).position}function Gr(e,n){if(!fr(e)||"fixed"===Sr(e).position)return null;if(n)return n(e);let t=e.offsetParent;return mr(e)===t&&(t=t.ownerDocument.body),t}function Zr(e,n){const t=ur(e);if(br(e))return t;if(!fr(e)){let n=jr(e);for(;n&&!Ir(n);){if(pr(n)&&!qr(n))return n;n=jr(n)}return t}let o=Gr(e,n);for(;o&&kr(o)&&qr(o);)o=Gr(o,n);return o&&Ir(o)&&qr(o)&&!Br(o)?t:o||function(e){let n=jr(e);for(;fr(n)&&!Ir(n);){if(Br(n))return n;if(br(n))return null;n=jr(n)}return null}(e)||t}const Yr={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:n,rect:t,offsetParent:o,strategy:r}=e;const l="fixed"===r,i=mr(o),a=!!n&&br(n.floating);if(o===i||a&&l)return t;let s={scrollLeft:0,scrollTop:0},c=Po(1);const d=Po(0),u=fr(o);if((u||!u&&!l)&&(("body"!==dr(o)||wr(i))&&(s=Er(o)),fr(o))){const e=Pr(o);c=Dr(o),d.x=e.x+o.clientLeft,d.y=e.y+o.clientTop}const m=!i||u||l?Po(0):Wr(i,s);return{width:t.width*c.x,height:t.height*c.y,x:t.x*c.x-s.scrollLeft*c.x+d.x+m.x,y:t.y*c.y-s.scrollTop*c.y+d.y+m.y}},getDocumentElement:mr,getClippingRect:function(e){let{element:n,boundary:t,rootBoundary:o,strategy:r}=e;const l=[..."clippingAncestors"===t?br(n)?[]:function(e,n){const t=n.get(e);if(t)return t;let o=Nr(e,[],!1).filter(e=>pr(e)&&"body"!==dr(e)),r=null;const l="fixed"===Sr(e).position;let i=l?jr(e):e;for(;pr(i)&&!Ir(i);){const n=Sr(i),t=Br(i);t||"fixed"!==n.position||(r=null),(l?!t&&!r:!t&&"static"===n.position&&r&&Kr.has(r.position)||wr(i)&&!t&&Ur(e,i))?o=o.filter(e=>e!==i):r=n,i=jr(i)}return n.set(e,o),o}(n,this._c):[].concat(t),o],i=l[0],a=l.reduce((e,t)=>{const o=Fr(n,t,r);return e.top=Do(o.top,e.top),e.right=Ao(o.right,e.right),e.bottom=Ao(o.bottom,e.bottom),e.left=Do(o.left,e.left),e},Fr(n,i,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Zr,getElementRects:function(e){return d(this,null,function*(){const n=this.getOffsetParent||Zr,t=this.getDimensions,o=yield t(e.floating);return{reference:Xr(e.reference,yield n(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:n,height:t}=Rr(e);return{width:n,height:t}},getScale:Dr,isElement:pr,isRTL:function(e){return"rtl"===Sr(e).direction}};function Jr(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function Qr(e,n,t,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:l=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:d=!1}=o,u=Ar(e),m=r||l?[...u?Nr(u):[],...Nr(n)]:[];m.forEach(e=>{r&&e.addEventListener("scroll",t,{passive:!0}),l&&e.addEventListener("resize",t)});const h=u&&c?function(e,n){let t,o=null;const r=mr(e);function l(){var e;clearTimeout(t),null==(e=o)||e.disconnect(),o=null}return function i(c,d){void 0===c&&(c=!1),void 0===d&&(d=1),l();const u=e.getBoundingClientRect(),{left:m,top:h,width:p,height:f}=u;if(c||n(),!p||!f)return;const v={rootMargin:-zo(h)+"px "+-zo(r.clientWidth-(m+p))+"px "+-zo(r.clientHeight-(h+f))+"px "+-zo(m)+"px",threshold:Do(0,Ao(1,d))||1};let g=!0;function w(n){const o=n[0].intersectionRatio;if(o!==d){if(!g)return i();o?i(!1,o):t=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==o||Jr(u,e.getBoundingClientRect())||i(),g=!1}try{o=new IntersectionObserver(w,s(a({},v),{root:r.ownerDocument}))}catch(y){o=new IntersectionObserver(w,v)}o.observe(e)}(!0),l}(u,t):null;let p,f=-1,v=null;i&&(v=new ResizeObserver(e=>{let[o]=e;o&&o.target===u&&v&&(v.unobserve(n),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=v)||e.observe(n)})),t()}),u&&!d&&v.observe(u),v.observe(n));let g=d?Pr(e):null;return d&&function n(){const o=Pr(e);g&&!Jr(g,o)&&t(),g=o,p=requestAnimationFrame(n)}(),t(),()=>{var e;m.forEach(e=>{r&&e.removeEventListener("scroll",t),l&&e.removeEventListener("resize",t)}),null==h||h(),null==(e=v)||e.disconnect(),v=null,d&&cancelAnimationFrame(p)}}const el=function(e){return void 0===e&&(e={}),{name:"shift",options:e,fn(n){return d(this,null,function*(){const{x:t,y:o,placement:r,platform:l}=n,i=Fo(e,n),{mainAxis:d=!0,crossAxis:u=!1,limiter:m={fn:e=>{let{x:n,y:t}=e;return{x:n,y:t}}}}=i,h=c(i,["mainAxis","crossAxis","limiter"]),p={x:t,y:o},f=yield l.detectOverflow(n,h),v=Yo(Uo(r)),g=qo(v);let w=p[g],y=p[v];if(d){const e="y"===g?"bottom":"right";w=Ko(w+f["y"===g?"top":"left"],w,w-f[e])}if(u){const e="y"===v?"bottom":"right";y=Ko(y+f["y"===v?"top":"left"],y,y-f[e])}const k=m.fn(s(a({},n),{[g]:w,[v]:y}));return s(a({},k),{data:{x:k.x-t,y:k.y-o,enabled:{[g]:d,[v]:u}}})})}}},nl=function(e){return void 0===e&&(e={}),{name:"flip",options:e,fn(n){return d(this,null,function*(){var t,o;const{placement:r,middlewareData:l,rects:i,initialPlacement:a,platform:s,elements:d}=n,u=Fo(e,n),{mainAxis:m=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:g=!0}=u,w=c(u,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if(null!=(t=l.arrow)&&t.alignmentOffset)return{};const y=Uo(r),k=Yo(a),x=Uo(a)===a,b=yield null==s.isRTL?void 0:s.isRTL(d.floating),M=p||(x||!g?[rr(a)]:function(e){const n=rr(e);return[Qo(e),n,Qo(n)]}(a)),_="none"!==v;!p&&_&&M.push(...function(e,n,t,o){const r=Xo(e);let l=function(e,n,t){switch(e){case"top":case"bottom":return t?n?nr:er:n?er:nr;case"left":case"right":return n?tr:or;default:return[]}}(Uo(e),"start"===t,o);return r&&(l=l.map(e=>e+"-"+r),n&&(l=l.concat(l.map(Qo)))),l}(a,g,v,b));const C=[a,...M],B=yield s.detectOverflow(n,w),T=[];let L=(null==(o=l.flip)?void 0:o.overflows)||[];if(m&&T.push(B[y]),h){const e=function(e,n,t){void 0===t&&(t=!1);const o=Xo(e),r=Jo(e),l=Go(r);let i="x"===r?o===(t?"end":"start")?"right":"left":"start"===o?"bottom":"top";return n.reference[l]>n.floating[l]&&(i=rr(i)),[i,rr(i)]}(r,i,b);T.push(B[e[0]],B[e[1]])}if(L=[...L,{placement:r,overflows:T}],!T.every(e=>e<=0)){var I,S;const e=((null==(I=l.flip)?void 0:I.index)||0)+1,n=C[e];if(n&&("alignment"!==h||k===Yo(n)||L.every(e=>Yo(e.placement)!==k||e.overflows[0]>0)))return{data:{index:e,overflows:L},reset:{placement:n}};let t=null==(S=L.filter(e=>e.overflows[0]<=0).sort((e,n)=>e.overflows[1]-n.overflows[1])[0])?void 0:S.placement;if(!t)switch(f){case"bestFit":{var E;const e=null==(E=L.filter(e=>{if(_){const n=Yo(e.placement);return n===k||"y"===n}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,n)=>e+n,0)]).sort((e,n)=>e[1]-n[1])[0])?void 0:E[0];e&&(t=e);break}case"initialPlacement":t=a}if(r!==t)return{reset:{placement:t}}}return{}})}}},tl={class:"markstream-vue"},ol=["id"],rl=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(e){const n=e,t=B(()=>{if(void 0!==n.isDark&&null!==n.isDark)return Boolean(n.isDark);if("undefined"!=typeof document)try{if(document.documentElement.classList.contains("dark"))return!0;if((null==window?void 0:window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches)return!0}catch(e){}return!1}),o=T(null),r=T({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),l=T(!1);let i=null;function c(){return d(this,null,function*(){var e,t;if(!n.anchorEl||!o.value)return;const l=[(u=null!=(e=n.offset)?e:8,void 0===u&&(u=0),{name:"offset",options:u,fn(e){return d(this,null,function*(){var n,t;const{x:o,y:r,placement:l,middlewareData:i}=e,c=yield function(e,n){return d(this,null,function*(){const{placement:t,platform:o,elements:r}=e,l=yield null==o.isRTL?void 0:o.isRTL(r.floating),i=Uo(t),a=Xo(t),s="y"===Yo(t),c=sr.has(i)?-1:1,d=l&&s?-1:1,u=Fo(n,e);let{mainAxis:m,crossAxis:h,alignmentAxis:p}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&"number"==typeof p&&(h="end"===a?-1*p:p),s?{x:h*d,y:m*c}:{x:m*c,y:h*d}})}(e,u);return l===(null==(n=i.offset)?void 0:n.placement)&&null!=(t=i.arrow)&&t.alignmentOffset?{}:{x:o+c.x,y:r+c.y,data:s(a({},c),{placement:l})}})}}),nl(),el({padding:8})],{x:i,y:c}=yield((e,n,t)=>{const o=/* @__PURE__ */new Map,r=a({platform:Yr},t),l=s(a({},r.platform),{_c:o});return((e,n,t)=>d(null,null,function*(){const{placement:o="bottom",strategy:r="absolute",middleware:l=[],platform:i}=t,c=l.filter(Boolean),d=yield null==i.isRTL?void 0:i.isRTL(n);let u=yield i.getElementRects({reference:e,floating:n,strategy:r}),{x:m,y:h}=ir(u,o,d),p=o,f={},v=0;for(let t=0;t<c.length;t++){var g;const{name:l,fn:w}=c[t],{x:y,y:k,data:x,reset:b}=yield w({x:m,y:h,initialPlacement:o,placement:p,strategy:r,middlewareData:f,rects:u,platform:s(a({},i),{detectOverflow:null!=(g=i.detectOverflow)?g:ar}),elements:{reference:e,floating:n}});m=null!=y?y:m,h=null!=k?k:h,f=s(a({},f),{[l]:a(a({},f[l]),x)}),b&&v<=50&&(v++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(u=!0===b.rects?yield i.getElementRects({reference:e,floating:n,strategy:r}):b.rects),({x:m,y:h}=ir(u,p,d))),t=-1)}return{x:m,y:h,placement:p,strategy:r,middlewareData:f}}))(e,n,s(a({},r),{platform:l}))})(n.anchorEl,o.value,{placement:null!=(t=n.placement)?t:"top",middleware:l,strategy:"fixed"});var u;r.value.transform=`translate3d(${Math.round(i)}px, ${Math.round(c)}px, 0)`,r.value.left="0px",r.value.top="0px"})}return L(()=>n.visible,e=>d(null,null,function*(){if(e)if(l.value=!1,yield G(),n.anchorEl&&o.value)try{const e=n.anchorEl.getBoundingClientRect();yield c();const t=r.value.transform;if(null!=n.originX&&null!=n.originY){const o=Math.abs(Number(n.originX)-e.left),i=Math.abs(Number(n.originY)-e.top);Math.hypot(o,i)>120?(r.value.transform=`translate3d(${Math.round(n.originX)}px, ${Math.round(n.originY)}px, 0)`,yield G(),l.value=!0,yield G(),r.value.transform=t):l.value=!0}else l.value=!0;i=Qr(n.anchorEl,o.value,c)}catch(t){yield c(),l.value=!0,i=Qr(n.anchorEl,o.value,c)}else l.value=!0;else l.value=!1,i&&(i(),i=null)})),L([()=>n.anchorEl,()=>n.placement,()=>n.content],()=>d(null,null,function*(){n.visible&&n.anchorEl&&o.value&&(yield G(),yield c())})),S(()=>{i&&i()}),(i,a)=>(v(),V(J,{to:"body"},[k("div",tl,[w(R,{name:"tooltip",appear:""},{default:A(()=>[Z(k("div",{id:n.id,ref_key:"tooltip",ref:o,style:D({position:"fixed",left:r.value.left,top:r.value.top,transform:r.value.transform}),class:E(["z-[9999] inline-block text-base py-2 px-3 rounded-md shadow-md whitespace-nowrap pointer-events-none tooltip-element border",[t.value?"bg-gray-900 text-white border-gray-700 border is-dark":"bg-white text-gray-900 border-gray-200 border"]]),role:"tooltip"},M(e.content),15,ol),[[Y,e.visible&&l.value]])]),_:1})])]))}}),[["__scopeId","data-v-d524cc01"]]),ll=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:rl},Symbol.toStringTag,{value:"Module"}));function il(e){return JSON.stringify(e)}function al(e){var n;const t=null!=(n=e.mode)?n:"classic",o=e.katexUrl,r=e.mhchemUrl,l=il(a({throwOnError:!0,displayMode:!0,output:"html",strict:"ignore"},e.renderOptions||{})),i=il(o),s=r?il(r):'""';return"module"===t?`\nlet DEBUG = false\nlet katex = null\nlet katexLoadError = null\nlet loadPromise = null\n\nfunction normalizeKaTeX(mod) {\n const resolved = (mod && mod.default) ? mod.default : mod\n if (resolved && typeof resolved.renderToString === 'function')\n return resolved\n return null\n}\n\nasync function loadKaTeX() {\n if (katex || katexLoadError)\n return\n if (!loadPromise) {\n loadPromise = (async () => {\n try {\n const mod = await import(${i})\n katex = normalizeKaTeX(mod) || null\n const mhchemUrl = ${s}\n if (mhchemUrl) {\n try {\n await import(mhchemUrl)\n }\n catch (e) {\n // ignore optional mhchem load failures\n if (DEBUG)\n console.warn('[katex-cdn-worker] failed to load mhchem', e)\n }\n }\n }\n catch (e) {\n katexLoadError = e\n }\n })()\n }\n await loadPromise\n}\n\nglobalThis.addEventListener('message', async (ev) => {\n const data = ev.data || {}\n if (data.type === 'init') {\n DEBUG = !!data.debug\n if (DEBUG)\n console.debug('[katex-cdn-worker] debug enabled')\n return\n }\n const id = data.id ?? ''\n const content = data.content ?? ''\n const displayMode = data.displayMode ?? true\n\n await loadKaTeX()\n\n if (!katex) {\n const reason = katexLoadError ? String(katexLoadError?.message || katexLoadError) : 'KaTeX is not available in worker'\n globalThis.postMessage({ id, error: reason, content, displayMode })\n return\n }\n\n try {\n const opts = ${l}\n const html = katex.renderToString(content, { ...opts, displayMode: !!displayMode })\n globalThis.postMessage({ id, html, content, displayMode })\n }\n catch (err) {\n const msg = String(err?.message || err)\n globalThis.postMessage({ id, error: msg, content, displayMode })\n }\n})\n`.trimStart():`\nlet DEBUG = false\nlet katex = null\nlet katexLoadError = null\n\nfunction normalizeKaTeX(val) {\n const resolved = (val && val.default) ? val.default : val\n if (resolved && typeof resolved.renderToString === 'function')\n return resolved\n return null\n}\n\nfunction loadKaTeXClassic() {\n if (katex || katexLoadError)\n return\n try {\n importScripts(${i})\n const mhchemUrl = ${s}\n if (mhchemUrl) {\n try {\n importScripts(mhchemUrl)\n }\n catch (e) {\n // ignore optional mhchem load failures\n if (DEBUG)\n console.warn('[katex-cdn-worker] failed to load mhchem', e)\n }\n }\n katex = normalizeKaTeX(globalThis.katex)\n }\n catch (e) {\n katexLoadError = e\n }\n}\n\nloadKaTeXClassic()\n\nglobalThis.addEventListener('message', (ev) => {\n const data = ev.data || {}\n if (data.type === 'init') {\n DEBUG = !!data.debug\n if (DEBUG)\n console.debug('[katex-cdn-worker] debug enabled')\n return\n }\n const id = data.id ?? ''\n const content = data.content ?? ''\n const displayMode = data.displayMode ?? true\n\n if (!katex && !katexLoadError)\n loadKaTeXClassic()\n\n if (!katex) {\n const reason = katexLoadError ? String(katexLoadError?.message || katexLoadError) : 'KaTeX is not available in worker'\n globalThis.postMessage({ id, error: reason, content, displayMode })\n return\n }\n\n try {\n const opts = ${l}\n const html = katex.renderToString(content, { ...opts, displayMode: !!displayMode })\n globalThis.postMessage({ id, html, content, displayMode })\n }\n catch (err) {\n const msg = String(err?.message || err)\n globalThis.postMessage({ id, error: msg, content, displayMode })\n }\n})\n`.trimStart()}function sl(e){var n,t;const o=al(e);if("undefined"==typeof Worker||"undefined"==typeof URL||"undefined"==typeof Blob)return{worker:null,dispose:()=>{},source:o};const r=new Blob([o],{type:"text/javascript"}),l=URL.createObjectURL(r);let i=!1;const c="module"===(null!=(n=e.mode)?n:"classic")?s(a({},null!=(t=e.workerOptions)?t:{}),{type:"module"}):e.workerOptions,d=new Worker(l,c);if(e.debug)try{d.postMessage({type:"init",debug:!0})}catch(u){}return{worker:d,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(u){}}},source:o}}rl.install=e=>{e.component(rl.__name,rl)};let cl=null,dl=null,ul=!1;const ml=/* @__PURE__ */new Map,hl=/* @__PURE__ */new Map;let pl=5;const fl=/* @__PURE__ */new Set;function vl(){if(ml.size<pl&&fl.size){const n=Array.from(fl);fl.clear();for(const t of n)try{t()}catch(e){}}}function gl(e){cl=e,dl=null,cl.onmessage=e=>{const{id:n,html:t,error:o}=e.data,r=ml.get(n);if(r)if(ml.delete(n),clearTimeout(r.timeoutId),vl(),o)r.reject(new Error(o));else{const{content:n,displayMode:o}=e.data;if(n){const e=`${o?"d":"i"}:${n}`;if(hl.set(e,t),hl.size>200){const e=hl.keys().next().value;hl.delete(e)}}r.resolve(t)}},cl.onerror=e=>{console.error("[katexWorkerClient] Worker error:",e);for(const[n,t]of ml.entries())clearTimeout(t.timeoutId),t.reject(new Error(`Worker error: ${e.message}`));ml.clear(),vl()}}function wl(){var e;cl&&(null==(e=cl.terminate)||e.call(cl)),cl=null,dl=null}function yl(e){ul=!!e,cl&&cl.postMessage({type:"init",debug:ul})}function kl(e,n=!0,t=2e3,o){return d(this,null,function*(){if(performance.now(),!Cn()){const e=new Error("KaTeX rendering disabled");return e.name="KaTeXDisabled",e.code="KATEX_DISABLED",Promise.reject(e)}if(dl)return Promise.reject(dl);const r=`${n?"d":"i"}:${e}`,l=hl.get(r);if(l)return Promise.resolve(l);const i=cl||(dl=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),dl.name="WorkerInitError",dl.code="WORKER_INIT_ERROR",null);if(!i)return Promise.reject(dl);if(ml.size>=pl){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code="WORKER_BUSY",e.busy=!0,e.inFlight=ml.size,e.max=pl,Promise.reject(e)}return new Promise((r,l)=>{if(null==o?void 0:o.aborted){const e=new Error("Aborted");return e.name="AbortError",void l(e)}const a=Math.random().toString(36).slice(2),s=globalThis.setTimeout(()=>{ml.delete(a);const e=new Error("Worker render timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT",l(e),vl()},t);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(s),ml.has(a)&&ml.delete(a);const e=new Error("Aborted");e.name="AbortError",l(e),vl()},{once:!0});const c=r,d=l;ml.set(a,{resolve:e=>{c(e)},reject:e=>{d(e)},timeoutId:s}),i.postMessage({id:a,content:e,displayMode:n})})})}function xl(e,n=!0,t){const o=`${n?"d":"i"}:${e}`;if(hl.set(o,t),hl.size>200){const e=hl.keys().next().value;hl.delete(e)}}function bl(){return{inFlight:ml.size,max:pl}}function Ml(e){Number.isFinite(e)&&e>0&&(pl=Math.floor(e))}const _l="WORKER_BUSY";function Cl(){return ml.size>=pl}function Bl(e=2e3,n){return ml.size<pl?Promise.resolve():new Promise((t,o)=>{let r,l=!1;const i=()=>{l||(l=!0,r&&globalThis.clearTimeout(r),fl.delete(i),t())};if(fl.add(i),r=globalThis.setTimeout(()=>{if(l)return;l=!0,fl.delete(i);const e=new Error("Wait for worker slot timed out");e.name="WorkerBusyTimeout",e.code="WORKER_BUSY_TIMEOUT",o(e)},e),queueMicrotask(()=>vl()),n){const e=()=>{if(l)return;l=!0,r&&globalThis.clearTimeout(r),fl.delete(i);const e=new Error("Aborted");e.name="AbortError",o(e)};n.aborted?e():n.addEventListener("abort",e,{once:!0})}})}const Tl={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function Ll(e){null!=e.timeout&&(Tl.timeout=Math.max(0,Math.floor(e.timeout))),null!=e.waitTimeout&&(Tl.waitTimeout=Math.max(0,Math.floor(e.waitTimeout))),null!=e.backoffMs&&(Tl.backoffMs=Math.max(0,Math.floor(e.backoffMs))),null!=e.maxRetries&&(Tl.maxRetries=Math.max(0,Math.floor(e.maxRetries)))}function Il(){return a({},Tl)}function Sl(e){return d(this,arguments,function*(e,n=!0,t={}){var o,r,l,i;if(!Cn()){const e=new Error("KaTeX rendering disabled");throw e.name="KaTeXDisabled",e.code="KATEX_DISABLED",e}const a=null!=(o=t.timeout)?o:Tl.timeout,s=null!=(r=t.waitTimeout)?r:Tl.waitTimeout,c=null!=(l=t.backoffMs)?l:Tl.backoffMs,d=null!=(i=t.maxRetries)?i:Tl.maxRetries,u=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Tl.maxRetries,m=t.signal;let h=0;for(;;){if(null==m?void 0:m.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}try{return yield kl(e,n,a,m)}catch(p){if((null==p?void 0:p.code)!==_l||h>=u)throw p;if(h++,yield Bl(s,m).catch(()=>{}),null==m?void 0:m.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}c>0&&(yield new Promise(e=>globalThis.setTimeout(e,c*h)))}}})}function El(e){return JSON.stringify(e)}function jl(e){var n;const t=null!=(n=e.mode)?n:"module",o=El(e.mermaidUrl),r=`\nlet DEBUG = false\nlet mermaid = null\nlet mermaidLoadError = null\n\nfunction normalizeMermaidModule(mod) {\n if (!mod)\n return mod\n const candidate = (mod && mod.default) ? mod.default : mod\n if (candidate && (typeof candidate.render === 'function' || typeof candidate.parse === 'function' || typeof candidate.initialize === 'function'))\n return candidate\n if (candidate && candidate.mermaidAPI && (typeof candidate.mermaidAPI.render === 'function' || typeof candidate.mermaidAPI.parse === 'function')) {\n const api = candidate.mermaidAPI\n return {\n ...candidate,\n render: api.render ? api.render.bind(api) : undefined,\n parse: api.parse ? api.parse.bind(api) : undefined,\n initialize: (opts) => {\n if (typeof candidate.initialize === 'function')\n return candidate.initialize(opts)\n return api.initialize ? api.initialize(opts) : undefined\n },\n }\n }\n if (mod && mod.mermaid && typeof mod.mermaid.parse === 'function')\n return mod.mermaid\n return candidate\n}\n\nfunction applyThemeTo(code, theme) {\n const themeValue = theme === 'dark' ? 'dark' : 'default'\n const themeConfig = \`%%{init: {"theme": "\${themeValue}"}}%%\\n\`\n const trimmed = (code || '').trimStart()\n if (trimmed.startsWith('%%{'))\n return code\n return themeConfig + code\n}\n\nfunction findHeaderIndex(lines) {\n const headerRe = /^(?:graph|flowchart|flowchart\\s+tb|flowchart\\s+lr|sequenceDiagram|gantt|classDiagram|stateDiagram(?:-v2)?|erDiagram|journey|pie|quadrantChart|timeline|xychart(?:-beta)?)\\b/\n for (let i = 0; i < lines.length; i++) {\n const l = (lines[i] || '').trim()\n if (!l)\n continue\n if (l.startsWith('%%'))\n continue\n if (headerRe.test(l))\n return i\n }\n return -1\n}\n\nasync function canParse(code, theme) {\n const themed = applyThemeTo(code, theme)\n const anyMermaid = mermaid\n if (anyMermaid && typeof anyMermaid.parse === 'function') {\n await anyMermaid.parse(themed)\n return true\n }\n throw new Error('mermaid.parse not available in worker')\n}\n\nasync function findLastRenderablePrefix(baseCode, theme) {\n const lines = String(baseCode || '').split('\\n')\n const headerIdx = findHeaderIndex(lines)\n if (headerIdx === -1)\n return null\n const head = lines.slice(0, headerIdx + 1)\n await canParse(head.join('\\n'), theme)\n\n let low = headerIdx + 1\n let high = lines.length\n let lastGood = headerIdx + 1\n let tries = 0\n const MAX_TRIES = 12\n\n while (low <= high && tries < MAX_TRIES) {\n const mid = Math.floor((low + high) / 2)\n const candidate = [...head, ...lines.slice(headerIdx + 1, mid)].join('\\n')\n tries++\n try {\n await canParse(candidate, theme)\n lastGood = mid\n low = mid + 1\n }\n catch {\n high = mid - 1\n }\n }\n\n return [...head, ...lines.slice(headerIdx + 1, lastGood)].join('\\n')\n}\n\nfunction initMermaidOnce() {\n if (!mermaid)\n return\n try {\n if (typeof mermaid.initialize === 'function')\n mermaid.initialize(${El(a({startOnLoad:!1,securityLevel:"loose"},e.initializeOptions||{}))})\n }\n catch (e) {\n if (DEBUG)\n console.warn('[mermaid-cdn-worker] initialize failed', e)\n }\n}\n\nglobalThis.addEventListener('message', async (ev) => {\n const msg = ev.data || {}\n if (msg.type === 'init') {\n DEBUG = !!msg.debug\n if (DEBUG)\n console.debug('[mermaid-cdn-worker] debug enabled')\n return\n }\n\n const id = msg.id\n const action = msg.action\n const payload = msg.payload || {}\n\n if (!mermaid) {\n const errMsg = mermaidLoadError ? String(mermaidLoadError?.message || mermaidLoadError) : 'Mermaid is not available in worker'\n globalThis.postMessage({ id, ok: false, error: errMsg })\n return\n }\n\n try {\n if (action === 'canParse') {\n const ok = await canParse(payload.code, payload.theme)\n globalThis.postMessage({ id, ok: true, result: ok })\n return\n }\n if (action === 'findPrefix') {\n const res = await findLastRenderablePrefix(payload.code, payload.theme)\n globalThis.postMessage({ id, ok: true, result: res })\n return\n }\n globalThis.postMessage({ id, ok: false, error: 'Unknown action' })\n }\n catch (e) {\n globalThis.postMessage({ id, ok: false, error: String(e?.message || e) })\n }\n})\n`.trimStart();return"module"===t?`\n${r}\n\nlet loadPromise = null\nasync function loadMermaid() {\n if (mermaid || mermaidLoadError)\n return\n if (!loadPromise) {\n loadPromise = (async () => {\n try {\n const mod = await import(${o})\n mermaid = normalizeMermaidModule(mod) || null\n initMermaidOnce()\n }\n catch (e) {\n mermaidLoadError = e\n }\n })()\n }\n await loadPromise\n}\n\n// Load immediately; failures are reported per-request\nawait loadMermaid()\n`.trimStart():`\n${r}\n\nfunction loadMermaidClassic() {\n if (mermaid || mermaidLoadError)\n return\n try {\n importScripts(${o})\n mermaid = normalizeMermaidModule(globalThis.mermaid) || null\n initMermaidOnce()\n }\n catch (e) {\n mermaidLoadError = e\n }\n}\n\nloadMermaidClassic()\n`.trimStart()}function $l(e){var n,t;const o=jl(e);if("undefined"==typeof Worker||"undefined"==typeof URL||"undefined"==typeof Blob)return{worker:null,dispose:()=>{},source:o};const r=new Blob([o],{type:"text/javascript"}),l=URL.createObjectURL(r);let i=!1;const c="module"===(null!=(n=e.mode)?n:"module")?s(a({},null!=(t=e.workerOptions)?t:{}),{type:"module"}):e.workerOptions,d=new Worker(l,c);if(e.debug)try{d.postMessage({type:"init",debug:!0})}catch(u){}return{worker:d,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(u){}}},source:o}}let Nl=null,Hl=null;const Rl=/* @__PURE__ */new Map;let Al=5,Dl=!1;function Ol(e){Dl=!!e}function zl(e){Number.isFinite(e)&&e>0&&(Al=Math.floor(e))}function Pl(){return{inFlight:Rl.size,max:Al}}const Vl="WORKER_BUSY",Wl="MERMAID_DISABLED";function Kl(e){Nl=e,Hl=null;const n=e;Nl.onmessage=e=>{if(Nl!==n)return;const{id:t,ok:o,result:r,error:l}=e.data,i=Rl.get(t);i&&(!1===o||l?i.reject(new Error(l||"Unknown error")):i.resolve(r))},Nl.onerror=e=>{var t,o;if(Nl===n)if(0!==Rl.size){try{Dl?console.error("[mermaidWorkerClient] Worker error:",(null==e?void 0:e.message)||e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker error:",(null==e?void 0:e.message)||e)}catch(r){}for(const[n,t]of Rl.entries())t.reject(new Error(`Worker error: ${e.message}`));Rl.clear()}else null==(t=console.debug)||t.call(console,"[mermaidWorkerClient] Worker error (no pending):",(null==e?void 0:e.message)||e)},Nl.onmessageerror=e=>{var t,o;if(Nl===n)if(0!==Rl.size){try{Dl?console.error("[mermaidWorkerClient] Worker messageerror:",e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker messageerror:",e)}catch(r){}for(const[e,n]of Rl.entries())n.reject(new Error("Worker messageerror"));Rl.clear()}else null==(t=console.debug)||t.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",e)}}function Fl(){var e;if(Nl)try{for(const[e,n]of Rl.entries())n.reject(new Error("Worker cleared"));Rl.clear(),null==(e=Nl.terminate)||e.call(Nl)}catch(n){}Nl=null,Hl=null}function Ul(e,n,t=1400){if(!$o()){const e=new Error("Mermaid rendering disabled");return e.name="MermaidDisabled",e.code=Wl,Promise.reject(e)}if(Hl)return Promise.reject(Hl);const o=Nl||(Hl=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Hl.name="WorkerInitError",Hl.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(Hl);if(Rl.size>=Al){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code=Vl,e.inFlight=Rl.size,e.max=Al,Promise.reject(e)}return new Promise((r,l)=>{const i=Math.random().toString(36).slice(2);let a,s=!1;const c=()=>{s||(s=!0,null!=a&&globalThis.clearTimeout(a),Rl.delete(i))},d={resolve:e=>{c(),r(e)},reject:e=>{c(),l(e)}};Rl.set(i,d);try{o.postMessage({id:i,action:e,payload:n})}catch(u){return Rl.delete(i),void l(u)}a=globalThis.setTimeout(()=>{const e=new Error("Worker call timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT";const n=Rl.get(i);n&&n.reject(e)},t)})}function Xl(e,n,t=1400){return d(this,null,function*(){try{return yield Ul("canParse",{code:e,theme:n},t)}catch(o){return Promise.reject(o)}})}function ql(e,n,t=1400){return d(this,null,function*(){try{return yield Ul("findPrefix",{code:e,theme:n},t)}catch(o){return Promise.reject(o)}})}function Gl(){if(Nl)try{for(const[e,n]of Rl.entries())n.reject(new Error("Worker terminated"));Rl.clear(),Nl.terminate()}finally{Nl=null}}const Zl=P(()=>import("./index4.js")),Yl=P(()=>import("./index3.js")),Jl=P(()=>import("./index2.js")),Ql=P(()=>import("./index5.js")),ei=P(()=>import("./index6.js")),ni=P(()=>import("./index7.js")),ti={AdmonitionNode:Pt,BlockquoteNode:ne,CheckboxNode:re,CodeBlockNode:Zl,DefinitionListNode:se,EmojiNode:de,EmphasisNode:nt,FootnoteNode:it,FootnoteReferenceNode:xe,FootnoteAnchorNode:ot,HardBreakNode:st,HeadingNode:dt,HtmlBlockNode:ft,HtmlInlineNode:De,HighlightNode:Qn,ImageNode:fn,D2BlockNode:ni,InfographicBlockNode:ei,InlineCodeNode:ze,PreCodeNode:kt,InsertNode:Yn,LinkNode:Gn,ListItemNode:ut,ListNode:mt,MathBlockNode:Yl,MathInlineNode:Jl,MermaidBlockNode:Ql,ParagraphNode:gt,StrikethroughNode:Wn,StrongNode:Pn,SubscriptNode:On,SuperscriptNode:Rn,TableNode:Bt,TextNode:Sn,ThematicBreakNode:Lt,VmrContainerNode:Et,ReferenceNode:$n,MarkdownCodeBlockNode:Bo},oi={install(e,n){Object.entries(ti).forEach(([n,t])=>{e.component(n,t)}),(null==n?void 0:n.getLanguageIcon)&&no(n.getLanguageIcon),(null==n?void 0:n.mathOptions)&&h(n.mathOptions)}};export{mt as $,Pt as A,ne as B,re as C,ni as D,de as E,Mn as F,Eo as G,ot as H,it as I,xe as J,ve as K,st as L,dt as M,Qn as N,ft as O,De as P,fn as Q,ei as R,ze as S,Yn as T,qt as U,Cn as V,_l as W,$o as X,Gn as Y,ut as Z,ee as _,an as a,Bo as a0,Nt as a1,Yl as a2,Jl as a3,Ql as a4,gt as a5,$n as a6,ge as a7,fe as a8,Ft as a9,jl as aA,$l as aB,Ol as aC,zl as aD,Pl as aE,Vl as aF,Wl as aG,Kl as aH,Fl as aI,on as aa,bn as ab,So as ac,Wn as ad,Pn as ae,On as af,Rn as ag,Bt as ah,Sn as ai,Lt as aj,rl as ak,Et as al,oi as am,no as an,al as ao,sl as ap,gl as aq,wl as ar,yl as as,kl as at,bl as au,Ml as av,Cl as aw,Bl as ax,Ll as ay,Il as az,lo as b,kt as c,Sl as d,Bn as e,xl as f,Qt as g,nn as h,Ro as i,Xl as j,ql as k,io as l,Gt as m,oo as n,we as o,Zl as p,se as q,ro as r,en as s,Gl as t,rn as u,Xt as v,_n as w,jo as x,nt as y,Ut as z};