markstream-vue 0.0.2-beta.8 → 0.0.2-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/README.zh-CN.md +1 -0
- package/dist/exports-CyoL-8XF.js +4827 -0
- package/dist/exports-DADWwNRQ.cjs +246 -0
- package/dist/exports.js +1 -1
- package/dist/index-Br7IvHNe.cjs +1 -0
- package/dist/index-CDRkq20z.js +958 -0
- package/dist/index-CcqRGphH.cjs +22 -0
- package/dist/index-DdtMPiwH.js +113 -0
- package/dist/index-DoRl8S3_.js +122 -0
- package/dist/index-OTPe0l-Z.cjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +21 -1
- package/dist/index.js +71 -62
- package/dist/index.tailwind.css +1 -1
- package/dist/index2.js +1 -1
- package/dist/index3.js +1 -1
- package/dist/index4.js +1 -1
- package/dist/tailwind.ts +0 -0
- package/package.json +7 -7
- package/dist/exports-BD7Y_TjZ.cjs +0 -247
- package/dist/exports-BreegGo9.js +0 -4719
- package/dist/index-BM9Oro93.js +0 -860
- package/dist/index-Cc3u_ylp.js +0 -117
- package/dist/index-CoB_G9GJ.cjs +0 -1
- package/dist/index-DbbC_URx.cjs +0 -1
- package/dist/index-Dq586yJ8.cjs +0 -1
- package/dist/index-ELonlW3Z.js +0 -108
package/dist/exports.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,i=(t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,a=(e,t)=>{for(var n in t||(t={}))l.call(t,n)&&i(e,n,t[n]);if(o)for(var n of o(t))r.call(t,n)&&i(e,n,t[n]);return e},s=(e,o)=>t(e,n(o)),c=(e,t)=>{var n={};for(var i in e)l.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&o)for(var i of o(e))t.indexOf(i)<0&&r.call(e,i)&&(n[i]=e[i]);return n},u=(e,t,n)=>new Promise((o,l)=>{var r=e=>{try{a(n.next(e))}catch(t){l(t)}},i=e=>{try{a(n.throw(e))}catch(t){l(t)}},a=e=>e.done?o(e.value):Promise.resolve(e.value).then(r,i);a((n=n.apply(e,t)).next())});import{getMarkdown as d,parseMarkdownToStructure as h,setDefaultMathOptions as v}from"stream-markdown-parser";import{defineComponent as m,createElementBlock as p,openBlock as f,withMemo as g,createVNode as w,unref as y,createElementVNode as x,Fragment as k,renderList as b,toDisplayString as M,computed as _,ref as B,watch as C,nextTick as T,onBeforeUnmount as L,createBlock as $,Teleport as S,Transition as I,withCtx as j,withDirectives as E,normalizeClass as H,normalizeStyle as N,vShow as R,createApp as z,h as A,inject as D,provide as P,createCommentVNode as V,renderSlot as O,shallowRef as F,readonly as W,defineAsyncComponent as K,resolveDynamicComponent as X,useAttrs as Y,mergeProps as q,isMemoSame as Z,onMounted as U,onUnmounted as G,withModifiers as J,createTextVNode as Q,markRaw as ee,reactive as te}from"vue";const ne=["cite"],oe=(e,t)=>{const n=e.__vccOpts||e;for(const[o,l]of t)n[o]=l;return n},le=/* @__PURE__ */oe(/* @__PURE__ */m({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean}},emits:["copy"],setup:e=>(t,n)=>(f(),p("blockquote",{class:"blockquote",dir:"auto",cite:e.node.cite},[g([e.node.children],()=>w(y(dl),{"index-key":`blockquote-${e.indexKey}`,nodes:e.node.children||[],typewriter:e.typewriter,onCopy:n[0]||(n[0]=e=>t.$emit("copy",e))},null,8,["index-key","nodes","typewriter"]),n,1)],8,ne))}),[["__scopeId","data-v-adfdba00"]]);le.install=e=>{e.component(le.__name,le)};const re={class:"checkbox-node"},ie=["checked"],ae=/* @__PURE__ */oe(/* @__PURE__ */m({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(f(),p("span",re,[x("input",{type:"checkbox",checked:e.node.checked,disabled:"",class:"checkbox-input"},null,8,ie)]))}),[["__scopeId","data-v-8dc6c46f"]]);ae.install=e=>{e.component(ae.__name,ae)};const se={class:"definition-list"},ce={class:"definition-term"},ue={class:"definition-desc"},de=/* @__PURE__ */oe(/* @__PURE__ */m({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean}},emits:["copy"],setup:e=>(t,n)=>(f(),p("dl",se,[(f(!0),p(k,null,b(e.node.items,(o,l)=>(f(),p(k,{key:l},[x("dt",ce,[w(y(dl),{"index-key":`definition-term-${e.indexKey}-${l}`,nodes:o.term,typewriter:e.typewriter,onCopy:n[0]||(n[0]=e=>t.$emit("copy",e))},null,8,["index-key","nodes","typewriter"])]),x("dd",ue,[w(y(dl),{"index-key":`definition-desc-${e.indexKey}-${l}`,nodes:o.definition,typewriter:e.typewriter,onCopy:n[1]||(n[1]=e=>t.$emit("copy",e))},null,8,["index-key","nodes","typewriter"])])],64))),128))]))}),[["__scopeId","data-v-5a21f288"]]);de.install=e=>{e.component(de.__name,de)};const he={class:"emoji-node"},ve=/* @__PURE__ */oe(/* @__PURE__ */m({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(f(),p("span",he,M(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);ve.install=e=>{e.component(ve.__name,ve)};const me="__global__",pe={};function fe(e,t){"string"==typeof e?pe[e]=t||{}:pe[me]=e||{}}function ge(e){return e?pe[e]||pe[me]||{}:pe[me]||{}}function we(e){if(e===me)throw new Error("removeCustomComponents: use clearGlobalCustomComponents() to clear the global mapping");delete pe[e]}function ye(){delete pe[me]}const xe=["id"],ke=["title"],be=/* @__PURE__ */oe(/* @__PURE__ */m({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#footnote-${e.node.id}`;function n(){if("undefined"==typeof document)return;const e=document.querySelector(t);e?e.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(o,l)=>(f(),p("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[x("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+M(e.node.id)+"]",9,ke)],8,xe))}}),[["__scopeId","data-v-01af0fee"]]);be.install=e=>{e.component(be.__name,be)};const Me={class:"inline text-[85%] px-1 py-0.5 rounded font-mono bg-secondary whitespace-normal break-words max-w-full before:content-[''] after:content-['']"},_e=/* @__PURE__ */m({__name:"InlineCodeNode",props:{node:{}},setup:e=>(t,n)=>(f(),p("code",Me,M(e.node.code),1))});_e.install=e=>{e.component(_e.__name,_e)};const Be=Math.min,Ce=Math.max,Te=Math.round,Le=Math.floor,$e=e=>({x:e,y:e}),Se={left:"right",right:"left",bottom:"top",top:"bottom"},Ie={start:"end",end:"start"};function je(e,t,n){return Ce(e,Be(t,n))}function Ee(e,t){return"function"==typeof e?e(t):e}function He(e){return e.split("-")[0]}function Ne(e){return e.split("-")[1]}function Re(e){return"x"===e?"y":"x"}function ze(e){return"y"===e?"height":"width"}const Ae=/* @__PURE__ */new Set(["top","bottom"]);function De(e){return Ae.has(He(e))?"y":"x"}function Pe(e){return Re(De(e))}function Ve(e){return e.replace(/start|end/g,e=>Ie[e])}const Oe=["left","right"],Fe=["right","left"],We=["top","bottom"],Ke=["bottom","top"];function Xe(e){return e.replace(/left|right|bottom|top/g,e=>Se[e])}function Ye(e){const{x:t,y:n,width:o,height:l}=e;return{width:o,height:l,top:n,left:t,right:t+o,bottom:n+l,x:t,y:n}}function qe(e,t,n){let{reference:o,floating:l}=e;const r=De(t),i=Pe(t),a=ze(i),s=He(t),c="y"===r,u=o.x+o.width/2-l.width/2,d=o.y+o.height/2-l.height/2,h=o[a]/2-l[a]/2;let v;switch(s){case"top":v={x:u,y:o.y-l.height};break;case"bottom":v={x:u,y:o.y+o.height};break;case"right":v={x:o.x+o.width,y:d};break;case"left":v={x:o.x-l.width,y:d};break;default:v={x:o.x,y:o.y}}switch(Ne(t)){case"start":v[i]-=h*(n&&c?-1:1);break;case"end":v[i]+=h*(n&&c?-1:1)}return v}function Ze(e,t){return u(this,null,function*(){var n;void 0===t&&(t={});const{x:o,y:l,platform:r,rects:i,elements:s,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:v=!1,padding:m=0}=Ee(t,e),p=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}}(m),f=s[v?"floating"===h?"reference":"floating":h],g=Ye(yield r.getClippingRect({element:null==(n=yield null==r.isElement?void 0:r.isElement(f))||n?f:f.contextElement||(yield null==r.getDocumentElement?void 0:r.getDocumentElement(s.floating)),boundary:u,rootBoundary:d,strategy:c})),w="floating"===h?{x:o,y:l,width:i.floating.width,height:i.floating.height}:i.reference,y=yield null==r.getOffsetParent?void 0:r.getOffsetParent(s.floating),x=(yield null==r.isElement?void 0:r.isElement(y))&&(yield null==r.getScale?void 0:r.getScale(y))||{x:1,y:1},k=Ye(r.convertOffsetParentRelativeRectToViewportRelativeRect?yield r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:y,strategy:c}):w);return{top:(g.top-k.top+p.top)/x.y,bottom:(k.bottom-g.bottom+p.bottom)/x.y,left:(g.left-k.left+p.left)/x.x,right:(k.right-g.right+p.right)/x.x}})}const Ue=/* @__PURE__ */new Set(["left","top"]);function Ge(){return"undefined"!=typeof window}function Je(e){return tt(e)?(e.nodeName||"").toLowerCase():"#document"}function Qe(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function et(e){var t;return null==(t=(tt(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function tt(e){return!!Ge()&&(e instanceof Node||e instanceof Qe(e).Node)}function nt(e){return!!Ge()&&(e instanceof Element||e instanceof Qe(e).Element)}function ot(e){return!!Ge()&&(e instanceof HTMLElement||e instanceof Qe(e).HTMLElement)}function lt(e){return!(!Ge()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Qe(e).ShadowRoot)}const rt=/* @__PURE__ */new Set(["inline","contents"]);function it(e){const{overflow:t,overflowX:n,overflowY:o,display:l}=wt(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!rt.has(l)}const at=/* @__PURE__ */new Set(["table","td","th"]);function st(e){return at.has(Je(e))}const ct=[":popover-open",":modal"];function ut(e){return ct.some(t=>{try{return e.matches(t)}catch(n){return!1}})}const dt=["transform","translate","scale","rotate","perspective"],ht=["transform","translate","scale","rotate","perspective","filter"],vt=["paint","layout","strict","content"];function mt(e){const t=pt(),n=nt(e)?wt(e):e;return dt.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||ht.some(e=>(n.willChange||"").includes(e))||vt.some(e=>(n.contain||"").includes(e))}function pt(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const ft=/* @__PURE__ */new Set(["html","body","#document"]);function gt(e){return ft.has(Je(e))}function wt(e){return Qe(e).getComputedStyle(e)}function yt(e){return nt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xt(e){if("html"===Je(e))return e;const t=e.assignedSlot||e.parentNode||lt(e)&&e.host||et(e);return lt(t)?t.host:t}function kt(e){const t=xt(e);return gt(t)?e.ownerDocument?e.ownerDocument.body:e.body:ot(t)&&it(t)?t:kt(t)}function bt(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const l=kt(e),r=l===(null==(o=e.ownerDocument)?void 0:o.body),i=Qe(l);if(r){const e=Mt(i);return t.concat(i,i.visualViewport||[],it(l)?l:[],e&&n?bt(e):[])}return t.concat(l,bt(l,[],n))}function Mt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _t(e){const t=wt(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const l=ot(e),r=l?e.offsetWidth:n,i=l?e.offsetHeight:o,a=Te(n)!==r||Te(o)!==i;return a&&(n=r,o=i),{width:n,height:o,$:a}}function Bt(e){return nt(e)?e:e.contextElement}function Ct(e){const t=Bt(e);if(!ot(t))return $e(1);const n=t.getBoundingClientRect(),{width:o,height:l,$:r}=_t(t);let i=(r?Te(n.width):n.width)/o,a=(r?Te(n.height):n.height)/l;return i&&Number.isFinite(i)||(i=1),a&&Number.isFinite(a)||(a=1),{x:i,y:a}}const Tt=/* @__PURE__ */$e(0);function Lt(e){const t=Qe(e);return pt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Tt}function $t(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const l=e.getBoundingClientRect(),r=Bt(e);let i=$e(1);t&&(o?nt(o)&&(i=Ct(o)):i=Ct(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Qe(e))&&t}(r,n,o)?Lt(r):$e(0);let s=(l.left+a.x)/i.x,c=(l.top+a.y)/i.y,u=l.width/i.x,d=l.height/i.y;if(r){const e=Qe(r),t=o&&nt(o)?Qe(o):o;let n=e,l=Mt(n);for(;l&&o&&t!==n;){const e=Ct(l),t=l.getBoundingClientRect(),o=wt(l),r=t.left+(l.clientLeft+parseFloat(o.paddingLeft))*e.x,i=t.top+(l.clientTop+parseFloat(o.paddingTop))*e.y;s*=e.x,c*=e.y,u*=e.x,d*=e.y,s+=r,c+=i,n=Qe(l),l=Mt(n)}}return Ye({width:u,height:d,x:s,y:c})}function St(e,t){const n=yt(e).scrollLeft;return t?t.left+n:$t(et(e)).left+n}function It(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-St(e,n),y:n.top+t.scrollTop}}const jt=/* @__PURE__ */new Set(["absolute","fixed"]);function Et(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=Qe(e),o=et(e),l=n.visualViewport;let r=o.clientWidth,i=o.clientHeight,a=0,s=0;if(l){r=l.width,i=l.height;const e=pt();(!e||e&&"fixed"===t)&&(a=l.offsetLeft,s=l.offsetTop)}const c=St(o);if(c<=0){const e=o.ownerDocument,t=e.body,n=getComputedStyle(t),l="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(o.clientWidth-t.clientWidth-l);i<=25&&(r-=i)}else c<=25&&(r+=c);return{width:r,height:i,x:a,y:s}}(e,n);else if("document"===t)o=function(e){const t=et(e),n=yt(e),o=e.ownerDocument.body,l=Ce(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=Ce(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+St(e);const a=-n.scrollTop;return"rtl"===wt(o).direction&&(i+=Ce(t.clientWidth,o.clientWidth)-l),{width:l,height:r,x:i,y:a}}(et(e));else if(nt(t))o=function(e,t){const n=$t(e,!0,"fixed"===t),o=n.top+e.clientTop,l=n.left+e.clientLeft,r=ot(e)?Ct(e):$e(1);return{width:e.clientWidth*r.x,height:e.clientHeight*r.y,x:l*r.x,y:o*r.y}}(t,n);else{const n=Lt(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ye(o)}function Ht(e,t){const n=xt(e);return!(n===t||!nt(n)||gt(n))&&("fixed"===wt(n).position||Ht(n,t))}function Nt(e,t,n){const o=ot(t),l=et(t),r="fixed"===n,i=$t(e,!0,r,t);let a={scrollLeft:0,scrollTop:0};const s=$e(0);function c(){s.x=St(l)}if(o||!o&&!r)if(("body"!==Je(t)||it(l))&&(a=yt(t)),o){const e=$t(t,!0,r,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else l&&c();r&&!o&&l&&c();const u=!l||o||r?$e(0):It(l,a);return{x:i.left+a.scrollLeft-s.x-u.x,y:i.top+a.scrollTop-s.y-u.y,width:i.width,height:i.height}}function Rt(e){return"static"===wt(e).position}function zt(e,t){if(!ot(e)||"fixed"===wt(e).position)return null;if(t)return t(e);let n=e.offsetParent;return et(e)===n&&(n=n.ownerDocument.body),n}function At(e,t){const n=Qe(e);if(ut(e))return n;if(!ot(e)){let t=xt(e);for(;t&&!gt(t);){if(nt(t)&&!Rt(t))return t;t=xt(t)}return n}let o=zt(e,t);for(;o&&st(o)&&Rt(o);)o=zt(o,t);return o&>(o)&&Rt(o)&&!mt(o)?n:o||function(e){let t=xt(e);for(;ot(t)&&!gt(t);){if(mt(t))return t;if(ut(t))return null;t=xt(t)}return null}(e)||n}const Dt={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:l}=e;const r="fixed"===l,i=et(o),a=!!t&&ut(t.floating);if(o===i||a&&r)return n;let s={scrollLeft:0,scrollTop:0},c=$e(1);const u=$e(0),d=ot(o);if((d||!d&&!r)&&(("body"!==Je(o)||it(i))&&(s=yt(o)),ot(o))){const e=$t(o);c=Ct(o),u.x=e.x+o.clientLeft,u.y=e.y+o.clientTop}const h=!i||d||r?$e(0):It(i,s);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-s.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-s.scrollTop*c.y+u.y+h.y}},getDocumentElement:et,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:l}=e;const r=[..."clippingAncestors"===n?ut(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=bt(e,[],!1).filter(e=>nt(e)&&"body"!==Je(e)),l=null;const r="fixed"===wt(e).position;let i=r?xt(e):e;for(;nt(i)&&!gt(i);){const t=wt(i),n=mt(i);n||"fixed"!==t.position||(l=null),(r?!n&&!l:!n&&"static"===t.position&&l&&jt.has(l.position)||it(i)&&!n&&Ht(e,i))?o=o.filter(e=>e!==i):l=t,i=xt(i)}return t.set(e,o),o}(t,this._c):[].concat(n),o],i=r[0],a=r.reduce((e,n)=>{const o=Et(t,n,l);return e.top=Ce(o.top,e.top),e.right=Be(o.right,e.right),e.bottom=Be(o.bottom,e.bottom),e.left=Ce(o.left,e.left),e},Et(t,i,l));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:At,getElementRects:function(e){return u(this,null,function*(){const t=this.getOffsetParent||At,n=this.getDimensions,o=yield n(e.floating);return{reference:Nt(e.reference,yield t(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:t,height:n}=_t(e);return{width:t,height:n}},getScale:Ct,isElement:nt,isRTL:function(e){return"rtl"===wt(e).direction}};function Pt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Vt(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:l=!0,ancestorResize:r=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:u=!1}=o,d=Bt(e),h=l||r?[...d?bt(d):[],...bt(t)]:[];h.forEach(e=>{l&&e.addEventListener("scroll",n,{passive:!0}),r&&e.addEventListener("resize",n)});const v=d&&c?function(e,t){let n,o=null;const l=et(e);function r(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}return function i(c,u){void 0===c&&(c=!1),void 0===u&&(u=1),r();const d=e.getBoundingClientRect(),{left:h,top:v,width:m,height:p}=d;if(c||t(),!m||!p)return;const f={rootMargin:-Le(v)+"px "+-Le(l.clientWidth-(h+m))+"px "+-Le(l.clientHeight-(v+p))+"px "+-Le(h)+"px",threshold:Ce(0,Be(1,u))||1};let g=!0;function w(t){const o=t[0].intersectionRatio;if(o!==u){if(!g)return i();o?i(!1,o):n=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==o||Pt(d,e.getBoundingClientRect())||i(),g=!1}try{o=new IntersectionObserver(w,s(a({},f),{root:l.ownerDocument}))}catch(y){o=new IntersectionObserver(w,f)}o.observe(e)}(!0),r}(d,n):null;let m,p=-1,f=null;i&&(f=new ResizeObserver(e=>{let[o]=e;o&&o.target===d&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),n()}),d&&!u&&f.observe(d),f.observe(t));let g=u?$t(e):null;return u&&function t(){const o=$t(e);g&&!Pt(g,o)&&n(),g=o,m=requestAnimationFrame(t)}(),n(),()=>{var e;h.forEach(e=>{l&&e.removeEventListener("scroll",n),r&&e.removeEventListener("resize",n)}),null==v||v(),null==(e=f)||e.disconnect(),f=null,u&&cancelAnimationFrame(m)}}const Ot=function(e){return void 0===e&&(e={}),{name:"shift",options:e,fn(t){return u(this,null,function*(){const{x:n,y:o,placement:l}=t,r=Ee(e,t),{mainAxis:i=!0,crossAxis:u=!1,limiter:d={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}}}=r,h=c(r,["mainAxis","crossAxis","limiter"]),v={x:n,y:o},m=yield Ze(t,h),p=De(He(l)),f=Re(p);let g=v[f],w=v[p];if(i){const e="y"===f?"bottom":"right";g=je(g+m["y"===f?"top":"left"],g,g-m[e])}if(u){const e="y"===p?"bottom":"right";w=je(w+m["y"===p?"top":"left"],w,w-m[e])}const y=d.fn(s(a({},t),{[f]:g,[p]:w}));return s(a({},y),{data:{x:y.x-n,y:y.y-o,enabled:{[f]:i,[p]:u}}})})}}},Ft=function(e){return void 0===e&&(e={}),{name:"flip",options:e,fn(t){return u(this,null,function*(){var n,o;const{placement:l,middlewareData:r,rects:i,initialPlacement:a,platform:s,elements:u}=t,d=Ee(e,t),{mainAxis:h=!0,crossAxis:v=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0}=d,w=c(d,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const y=He(l),x=De(a),k=He(a)===a,b=yield null==s.isRTL?void 0:s.isRTL(u.floating),M=m||(k||!g?[Xe(a)]:function(e){const t=Xe(e);return[Ve(e),t,Ve(t)]}(a)),_="none"!==f;!m&&_&&M.push(...function(e,t,n,o){const l=Ne(e);let r=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Fe:Oe:t?Oe:Fe;case"left":case"right":return t?We:Ke;default:return[]}}(He(e),"start"===n,o);return l&&(r=r.map(e=>e+"-"+l),t&&(r=r.concat(r.map(Ve)))),r}(a,g,f,b));const B=[a,...M],C=yield Ze(t,w),T=[];let L=(null==(o=r.flip)?void 0:o.overflows)||[];if(h&&T.push(C[y]),v){const e=function(e,t,n){void 0===n&&(n=!1);const o=Ne(e),l=Pe(e),r=ze(l);let i="x"===l?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[r]>t.floating[r]&&(i=Xe(i)),[i,Xe(i)]}(l,i,b);T.push(C[e[0]],C[e[1]])}if(L=[...L,{placement:l,overflows:T}],!T.every(e=>e<=0)){var $,S;const e=((null==($=r.flip)?void 0:$.index)||0)+1,t=B[e];if(t&&("alignment"!==v||x===De(t)||L.every(e=>De(e.placement)!==x||e.overflows[0]>0)))return{data:{index:e,overflows:L},reset:{placement:t}};let n=null==(S=L.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:S.placement;if(!n)switch(p){case"bestFit":{var I;const e=null==(I=L.filter(e=>{if(_){const t=De(e.placement);return t===x||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:I[0];e&&(n=e);break}case"initialPlacement":n=a}if(l!==n)return{reset:{placement:n}}}return{}})}}},Wt=["id"],Kt=/* @__PURE__ */oe(/* @__PURE__ */m({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(e){const t=e,n=_(()=>{if(void 0!==t.isDark&&null!==t.isDark)return Boolean(t.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=B(null),l=B({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),r=B(!1);let i=null;function c(){return u(this,null,function*(){var e,n;if(!t.anchorEl||!o.value)return;const r=[(d=null!=(e=t.offset)?e:8,void 0===d&&(d=0),{name:"offset",options:d,fn(e){return u(this,null,function*(){var t,n;const{x:o,y:l,placement:r,middlewareData:i}=e,c=yield function(e,t){return u(this,null,function*(){const{placement:n,platform:o,elements:l}=e,r=yield null==o.isRTL?void 0:o.isRTL(l.floating),i=He(n),a=Ne(n),s="y"===De(n),c=Ue.has(i)?-1:1,u=r&&s?-1:1,d=Ee(t,e);let{mainAxis:h,crossAxis:v,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof m&&(v="end"===a?-1*m:m),s?{x:v*u,y:h*c}:{x:h*c,y:v*u}})}(e,d);return r===(null==(t=i.offset)?void 0:t.placement)&&null!=(n=i.arrow)&&n.alignmentOffset?{}:{x:o+c.x,y:l+c.y,data:s(a({},c),{placement:r})}})}}),Ft(),Ot({padding:8})],{x:i,y:c}=yield((e,t,n)=>{const o=/* @__PURE__ */new Map,l=a({platform:Dt},n),r=s(a({},l.platform),{_c:o});return((e,t,n)=>u(null,null,function*(){const{placement:o="bottom",strategy:l="absolute",middleware:r=[],platform:i}=n,c=r.filter(Boolean),u=yield null==i.isRTL?void 0:i.isRTL(t);let d=yield i.getElementRects({reference:e,floating:t,strategy:l}),{x:h,y:v}=qe(d,o,u),m=o,p={},f=0;for(let n=0;n<c.length;n++){const{name:r,fn:g}=c[n],{x:w,y,data:x,reset:k}=yield g({x:h,y:v,initialPlacement:o,placement:m,strategy:l,middlewareData:p,rects:d,platform:i,elements:{reference:e,floating:t}});h=null!=w?w:h,v=null!=y?y:v,p=s(a({},p),{[r]:a(a({},p[r]),x)}),k&&f<=50&&(f++,"object"==typeof k&&(k.placement&&(m=k.placement),k.rects&&(d=!0===k.rects?yield i.getElementRects({reference:e,floating:t,strategy:l}):k.rects),({x:h,y:v}=qe(d,m,u))),n=-1)}return{x:h,y:v,placement:m,strategy:l,middlewareData:p}}))(e,t,s(a({},l),{platform:r}))})(t.anchorEl,o.value,{placement:null!=(n=t.placement)?n:"top",middleware:r,strategy:"fixed"});var d;l.value.transform=`translate3d(${Math.round(i)}px, ${Math.round(c)}px, 0)`,l.value.left="0px",l.value.top="0px"})}return C(()=>t.visible,e=>u(null,null,function*(){if(e)if(r.value=!1,yield T(),t.anchorEl&&o.value)try{const e=t.anchorEl.getBoundingClientRect();yield c();const n=l.value.transform;if(null!=t.originX&&null!=t.originY){const o=Math.abs(Number(t.originX)-e.left),i=Math.abs(Number(t.originY)-e.top);Math.hypot(o,i)>120?(l.value.transform=`translate3d(${Math.round(t.originX)}px, ${Math.round(t.originY)}px, 0)`,yield T(),r.value=!0,yield T(),l.value.transform=n):r.value=!0}else r.value=!0;i=Vt(t.anchorEl,o.value,c)}catch(n){yield c(),r.value=!0,i=Vt(t.anchorEl,o.value,c)}else r.value=!0;else r.value=!1,i&&(i(),i=null)})),C([()=>t.anchorEl,()=>t.placement,()=>t.content],()=>u(null,null,function*(){t.visible&&t.anchorEl&&o.value&&(yield T(),yield c())})),L(()=>{i&&i()}),(i,a)=>(f(),$(S,{to:"body"},[w(I,{name:"tooltip",appear:""},{default:j(()=>[E(x("div",{id:t.id,ref_key:"tooltip",ref:o,style:N({position:"fixed",left:l.value.left,top:l.value.top,transform:l.value.transform}),class:H(["z-[9999] inline-block text-base py-2 px-3 rounded-md shadow-md whitespace-nowrap pointer-events-none tooltip-element border",[n.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,Wt),[[R,e.visible&&r.value]])]),_:1})]))}}),[["__scopeId","data-v-993f63aa"]]),Xt=B(!1),Yt=B(""),qt=B("top"),Zt=B(null),Ut=B(null),Gt=B(null),Jt=B(null),Qt=B(null);let en=null,tn=null;function nn(){en&&(clearTimeout(en),en=null),tn&&(clearTimeout(tn),tn=null)}let on=!1;function ln(e,t,n="top",o=!1,l,r){if(!e)return;!function(){if(on)return;if("undefined"==typeof document)return;on=!0;const e=document.createElement("div");e.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(e),z({setup:()=>()=>{var e;return A(Kt,{visible:Xt.value,"anchor-el":Zt.value,content:Yt.value,placement:qt.value,id:Ut.value,originX:Gt.value,originY:Jt.value,isDark:null!=(e=Qt.value)?e:void 0})}}).mount(e)}(),nn();const i=()=>{var o,i;Ut.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Zt.value=e,Yt.value=t,qt.value=n,Gt.value=null!=(o=null==l?void 0:l.x)?o:null,Jt.value=null!=(i=null==l?void 0:l.y)?i:null,Qt.value="boolean"==typeof r?r:null,Xt.value=!0;try{e.setAttribute("aria-describedby",Ut.value)}catch(a){}};o?i():en=setTimeout(i,80)}function rn(e=!1){nn();const t=()=>{if(Zt.value&&Ut.value)try{Zt.value.removeAttribute("aria-describedby")}catch(e){}Xt.value=!1,Zt.value=null,Ut.value=null,Gt.value=null,Jt.value=null};e?t():tn=setTimeout(t,120)}const an={"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 sn(e){Object.assign(an,e)}function cn(){try{const t=globalThis.$vueI18nUse||null;if(t&&"function"==typeof t)try{const e=t();if(e&&"function"==typeof e.t)return{t:e.t.bind(e)}}catch(e){}}catch(e){}return u(null,null,function*(){try{const t=yield import("vue-i18n"),n=t.useI18n||t.default&&t.default.useI18n;if(n&&"function"==typeof n)try{const t=n();if(t&&"function"==typeof t.t)try{globalThis.$vueI18nUse=()=>t}catch(e){}}catch(e){}}catch(e){}}),{t:e=>{var t;return null!=(t=an[e])?t: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 un=Symbol("ViewportPriority");function dn(){const e=D(un,void 0);if(e)return e;const t=/* @__PURE__ */new WeakMap;let n=null;return e=>{const o=B(!1);let l,r=!1;const i=new Promise(e=>{l=()=>{r||(r=!0,e())}}),a=()=>{try{null==n||n.unobserve(e)}catch(o){}t.delete(e)},s=n||("undefined"==typeof window||"undefined"==typeof IntersectionObserver?null:(n=new IntersectionObserver(e=>{for(const l of e){const e=t.get(l.target);if(e&&(l.isIntersecting||l.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(o){}}null==n||n.unobserve(l.target),t.delete(l.target)}}},{root:null,rootMargin:"300px",threshold:0}),n));return s?(t.set(e,{resolve:l,visible:o}),s.observe(e),{isVisible:o,whenVisible:i,destroy:a}):(o.value=!0,l(),{isVisible:o,whenVisible:i,destroy:a})}}const hn={class:"relative inline-block"},vn=["src","alt","title","loading","tabindex","aria-label"],mn={class:"text-sm whitespace-nowrap"},pn={key:1,class:"text-sm text-gray-500"},fn={key:"error",class:"px-4 py-2 bg-gray-100 flex items-center justify-center rounded-lg gap-2 text-red-500"},gn={class:"text-sm whitespace-nowrap"},wn={key:0,class:"mt-2 text-sm text-gray-500 italic"},yn=/* @__PURE__ */oe(/* @__PURE__ */m({__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:t}){const n=e,o=t,l=B(!1),r=B(!1),i=B(!1),a=B(null),s=dn(),c=B(null),u=B("undefined"==typeof window);"undefined"!=typeof window&&C(()=>a.value,e=>{var t;if(null==(t=c.value)||t.destroy(),c.value=null,!e)return void(u.value=!1);const n=s(e,{rootMargin:"400px"});c.value=n,u.value=n.isVisible.value,n.whenVisible.then(()=>{u.value=!0})},{immediate:!0}),L(()=>{var e;null==(e=c.value)||e.destroy(),c.value=null});const d=_(()=>r.value&&n.fallbackSrc?n.fallbackSrc:n.node.src),h=_(()=>!n.lazy||u.value),v=_(()=>/\.svg(?:\?|$)/i.test(d.value));function m(){n.fallbackSrc&&!i.value?(i.value=!0,r.value=!0):(r.value=!0,o("error",n.node.src))}function g(){l.value=!0,r.value=!1,o("load",d.value)}function k(e){e.preventDefault(),l.value&&!r.value&&o("click",[e,d.value])}const{t:b}=cn();return C(d,()=>{l.value=!1,r.value=!1}),(t,o)=>(f(),p("figure",{ref_key:"figureRef",ref:a,class:"text-center my-8"},[x("div",hn,[w(I,{name:"img-switch",mode:"out-in"},{default:j(()=>{var i,a,s,c,u;return[e.node.loading||r.value||!h.value?r.value?e.node.loading||n.fallbackSrc?V("",!0):(f(),p("div",fn,[O(t.$slots,"error",{node:n.node,displaySrc:d.value,imageLoaded:l.value,hasError:r.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy,isSvg:v.value},()=>[o[1]||(o[1]=x("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[x("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)),x("span",gn,M(y(b)("image.loadError")),1)],!0)])):(f(),p("div",{key:"placeholder",class:"placeholder-layer max-w-96 inline-flex items-center justify-center gap-2",style:N(v.value?{minHeight:n.svgMinHeight,width:"100%"}:{minHeight:"6rem"})},[n.usePlaceholder?O(t.$slots,"placeholder",{key:0,node:n.node,displaySrc:d.value,imageLoaded:l.value,hasError:r.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy,isSvg:v.value},()=>[o[0]||(o[0]=x("div",{class:"w-4 h-4 rounded-full border-2 border-solid border-current border-t-transparent animate-spin","aria-hidden":"true"},null,-1)),x("span",mn,M(y(b)("image.loading")),1)],!0):(f(),p("span",pn,M(e.node.raw),1))],4)):(f(),p("img",{key:"image",src:d.value,alt:String(null!=(a=null!=(i=n.node.alt)?i:n.node.title)?a:""),title:String(null!=(c=null!=(s=n.node.title)?s:n.node.alt)?c:""),class:H(["max-w-96 h-auto rounded-lg transition-opacity duration-200 ease-in-out",{"opacity-0":!l.value,"opacity-100":l.value,"cursor-pointer":l.value}]),style:N(v.value?{minHeight:n.svgMinHeight,width:"100%",height:"auto",objectFit:"contain"}:void 0),loading:n.lazy?"lazy":"eager",decoding:"async",tabindex:l.value?0:-1,"aria-label":null!=(u=n.node.alt)?u:y(b)("image.preview"),onError:m,onLoad:g,onClick:k},null,46,vn))]}),_:3})]),n.showCaption&&n.node.alt?(f(),p("figcaption",wn,M(n.node.alt),1)):V("",!0)],512))}}),[["__scopeId","data-v-7ca79b66"]]);yn.install=e=>{e.component(yn.__name,yn)};let xn=null,kn=!1;function bn(){return u(this,null,function*(){if(xn)return xn;if(kn)return null;try{return xn=yield import("katex"),yield import("katex/contrib/mhchem"),xn}catch(e){return kn=!0,null}})}const Mn=F(!1);let _n=null;function Bn(){return _n||(_n=bn().then(e=>{Mn.value=!!e}).catch(()=>{Mn.value=!1})),W(Mn)}const Cn=/* @__PURE__ */oe(/* @__PURE__ */m({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=Bn();return(n,o)=>(f(),p("span",{class:H([[y(t)&&e.node.center?"text-node-center":""],"whitespace-pre-wrap break-words text-node"])},M(e.node.content),3))}}),[["__scopeId","data-v-56f30838"]]);Cn.install=e=>{e.component(Cn.__name,Cn)};const Tn=K(()=>u(null,null,function*(){var e,t;if("undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(t=null==(e=globalThis.process)?void 0:e.env)?void 0:t.NODE_ENV))return e=>{var t,n;return A(Cn,s(a({},e),{node:s(a({},e.node),{content:null!=(n=e.node.raw)?n:`$${null!=(t=e.node.content)?t:""}$`})}))};try{if(yield bn())return(yield import("./index2.js")).default}catch(n){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".',n)}return e=>{var t,n;return A(Cn,s(a({},e),{node:s(a({},e.node),{content:null!=(n=e.node.raw)?n:`$${null!=(t=e.node.content)?t:""}$`})}))}})),Ln=K(()=>u(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 t,n;return A(Cn,s(a({},e),{node:s(a({},e.node),{content:null!=(n=e.node.raw)?n:`$$${null!=(t=e.node.content)?t:""}$$`})}))}})),$n=/* @__PURE__ */m({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(f(),p("span",{class:"reference-node cursor-pointer bg-accent text-xs rounded-md px-1.5 mx-0.5 hover:bg-secondary",role:"button",tabindex:"0",onClick:n[0]||(n[0]=n=>t.$emit("click",n,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=n=>t.$emit("mouseEnter",n,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=n=>t.$emit("mouseLeave",n,e.node.id,e.messageId,e.threadId))},M(e.node.id),33))});$n.install=e=>{e.component($n.__name,$n)};const Sn={class:"superscript-node"},In={key:1},jn=/* @__PURE__ */oe(/* @__PURE__ */m({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=a({text:Cn,inline_code:_e,link:Kn,strong:zn,emphasis:Gn,footnote_reference:be,strikethrough:Dn,highlight:Zn,insert:Yn,subscript:Nn,emoji:ve,math_inline:Tn,reference:$n},ge(t.customId));return(o,l)=>(f(),p("sup",Sn,[(f(!0),p(k,null,b(e.node.children,(o,l)=>(f(),p(k,{key:`${e.indexKey||"superscript"}-${l}`},[n[o.type]?(f(),$(X(n[o.type]),{key:0,node:o,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`},null,8,["node","custom-id","index-key"])):(f(),p("span",In,M(o.content||o.raw),1))],64))),128))]))}}),[["__scopeId","data-v-0ca396bb"]]);jn.install=e=>{e.component(jn.__name,jn)};const En={class:"subscript-node"},Hn={key:1},Nn=/* @__PURE__ */oe(/* @__PURE__ */m({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=a({text:Cn,inline_code:_e,link:Kn,strong:zn,emphasis:Gn,footnote_reference:be,strikethrough:Dn,highlight:Zn,insert:Yn,superscript:jn,emoji:ve,math_inline:Tn,reference:$n},ge(t.customId));return(o,l)=>(f(),p("sub",En,[(f(!0),p(k,null,b(e.node.children,(o,l)=>(f(),p(k,{key:`${e.indexKey||"subscript"}-${l}`},[n[o.type]?(f(),$(X(n[o.type]),{key:0,node:o,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`},null,8,["node","custom-id","index-key"])):(f(),p("span",Hn,M(o.content||o.raw),1))],64))),128))]))}}),[["__scopeId","data-v-5e1f04df"]]);Nn.install=e=>{e.component(Nn.__name,Nn)};const Rn={class:"strong-node"},zn=/* @__PURE__ */oe(/* @__PURE__ */m({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=a({text:Cn,inline_code:_e,link:Kn,emphasis:Gn,strikethrough:Dn,highlight:Zn,insert:Yn,subscript:Nn,superscript:jn,emoji:ve,footnote_reference:be,math_inline:Tn,reference:$n},ge(t.customId));return(o,l)=>(f(),p("strong",Rn,[(f(!0),p(k,null,b(e.node.children,(o,l)=>(f(),$(X(n[o.type]),{key:`${e.indexKey||"strong"}-${l}`,"index-key":`${e.indexKey||"strong"}-${l}`,node:o,"custom-id":t.customId},null,8,["index-key","node","custom-id"]))),128))]))}}),[["__scopeId","data-v-53b6c7df"]]);zn.install=e=>{e.component(zn.__name,zn)};const An={class:"strikethrough-node"},Dn=/* @__PURE__ */oe(/* @__PURE__ */m({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=a({text:Cn,inline_code:_e,link:Kn,strong:zn,emphasis:Gn,highlight:Zn,insert:Yn,subscript:Nn,superscript:jn,emoji:ve,footnote_reference:be,math_inline:Tn,reference:$n},ge(t.customId));return(o,l)=>(f(),p("del",An,[(f(!0),p(k,null,b(e.node.children,(o,l)=>(f(),$(X(n[o.type]),{key:`${e.indexKey||"strikethrough"}-${l}`,node:o,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-3716d25c"]]);Dn.install=e=>{e.component(Dn.__name,Dn)};const Pn=["href","title","aria-label","aria-hidden"],Vn=["aria-hidden"],On={class:"link-text-wrapper relative inline-flex"},Fn={class:"leading-[normal] link-text"},Wn={class:"leading-[normal] link-text"},Kn=/* @__PURE__ */oe(/* @__PURE__ */m({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=_(()=>{var e,n,o,l,r,i;const a=void 0!==t.underlineBottom?"number"==typeof t.underlineBottom?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px";return{"--link-color":null!=(e=t.color)?e:"#0366d6","--underline-height":`${null!=(n=t.underlineHeight)?n:2}px`,"--underline-bottom":a,"--underline-opacity":String(null!=(o=t.animationOpacity)?o:.9),"--underline-duration":`${null!=(l=t.animationDuration)?l:.8}s`,"--underline-timing":null!=(r=t.animationTiming)?r:"linear","--underline-iteration":"number"==typeof t.animationIteration?String(t.animationIteration):null!=(i=t.animationIteration)?i:"infinite"}}),o={text:Cn,strong:zn,strikethrough:Dn,emphasis:Gn,image:yn},l=Y();function r(){t.showTooltip&&rn()}const i=_(()=>{var e,n;return String(null!=(n=null!=(e=t.node.title)?e:t.node.href)?n:"")});return(a,s)=>e.node.loading?(f(),p("span",q({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},y(l),{style:n.value}),[x("span",On,[x("span",Fn,[x("span",Wn,M(e.node.text),1)]),s[1]||(s[1]=x("span",{class:"underline-anim","aria-hidden":"true"},null,-1))])],16,Vn)):(f(),p("a",q({key:0,class:"link-node",href:e.node.href,title:i.value,"aria-label":`Link: ${i.value}`,"aria-hidden":e.node.loading?"true":"false",target:"_blank",rel:"noopener noreferrer"},y(l),{style:n.value,onMouseenter:s[0]||(s[0]=e=>function(e){var n,o,l,r,i,a;if(!t.showTooltip)return;const s=e,c=null!=(null==s?void 0:s.clientX)&&null!=(null==s?void 0:s.clientY)?{x:s.clientX,y:s.clientY}:void 0,u=null!=(a=null!=(i=null!=(l=null==(n=t.node)?void 0:n.href)?l:null==(o=t.node)?void 0:o.title)?i:null==(r=t.node)?void 0:r.text)?a:"";ln(e.currentTarget,u,"top",!1,c)}(e)),onMouseleave:r}),[(f(!0),p(k,null,b(e.node.children,(n,l)=>(f(),$(X(o[n.type]),{key:`${e.indexKey||"emphasis"}-${l}`,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${l}`},null,8,["node","custom-id","index-key"]))),128))],16,Pn))}}),[["__scopeId","data-v-0ea92a03"]]);Kn.install=e=>{e.component(Kn.__name,Kn)};const Xn={class:"insert-node"},Yn=/* @__PURE__ */oe(/* @__PURE__ */m({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=a({text:Cn,inline_code:_e,link:Kn,strong:zn,emphasis:Gn,strikethrough:Dn,highlight:Zn,subscript:Nn,superscript:jn,emoji:ve,footnote_reference:be,math_inline:Tn,reference:$n},ge(t.customId));return(o,l)=>(f(),p("ins",Xn,[(f(!0),p(k,null,b(e.node.children,(o,l)=>(f(),$(X(n[o.type]),{key:`${e.indexKey||"insert"}-${l}`,node:o,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b8737de3"]]);Yn.install=e=>{e.component(Yn.__name,Yn)};const qn={class:"highlight-node"},Zn=/* @__PURE__ */oe(/* @__PURE__ */m({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=a({text:Cn,inline_code:_e,link:Kn,strong:zn,emphasis:Gn,strikethrough:Dn,insert:Yn,subscript:Nn,superscript:jn,emoji:ve,footnote_reference:be,math_inline:Tn,reference:$n},ge(t.customId));return(o,l)=>(f(),p("mark",qn,[(f(!0),p(k,null,b(e.node.children,(o,l)=>(f(),$(X(n[o.type]),{key:`${e.indexKey||"highlight"}-${l}`,node:o,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-fc52b444"]]);Zn.install=e=>{e.component(Zn.__name,Zn)};const Un={class:"emphasis-node"},Gn=/* @__PURE__ */oe(/* @__PURE__ */m({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=a({text:Cn,inline_code:_e,link:Kn,strong:zn,strikethrough:Dn,highlight:Zn,insert:Yn,subscript:Nn,superscript:jn,emoji:ve,footnote_reference:be,math_inline:Tn,reference:$n},ge(t.customId));return(o,l)=>(f(),p("em",Un,[(f(!0),p(k,null,b(e.node.children,(o,l)=>(f(),$(X(n[o.type]),{key:`${e.indexKey||"emphasis"}-${l}`,node:o,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-c25e2822"]]);Gn.install=e=>{e.component(Gn.__name,Gn)};const Jn=["href","title"],Qn=/* @__PURE__ */oe(/* @__PURE__ */m({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(e){var n;if(e.preventDefault(),"undefined"==typeof document)return;const o=`fnref-${String(null!=(n=t.node.id)?n:"")}`,l=document.getElementById(o);l&&l.scrollIntoView({behavior:"smooth"})}return(t,o)=>(f(),p("a",{class:"footnote-anchor text-sm text-[#0366d6] hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,Jn))}}),[["__scopeId","data-v-4756ce0d"]]);Qn.install=e=>{e.component(Qn.__name,Qn)};const eo=["id"],to={class:"flex-1"},no=/* @__PURE__ */m({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean}},emits:["copy"],setup:e=>(t,n)=>(f(),p("div",{id:`fnref--${e.node.id}`,class:"flex mt-2 mb-2 text-sm leading-relaxed border-t border-[#eaecef] pt-2"},[x("div",to,[g([e.node.children],()=>w(y(dl),{"index-key":`footnote-${e.indexKey}`,nodes:e.node.children,typewriter:e.typewriter,onCopy:n[0]||(n[0]=e=>t.$emit("copy",e))},null,8,["index-key","nodes","typewriter"]),n,1)])],8,eo))});no.install=e=>{e.component(no.__name,no)};const oo={class:"hard-break"},lo=/* @__PURE__ */oe(/* @__PURE__ */m({__name:"HardBreakNode",props:{node:{}},setup:e=>(e,t)=>(f(),p("br",oo))}),[["__scopeId","data-v-50c58f70"]]);lo.install=e=>{e.component(lo.__name,lo)};const ro=/* @__PURE__ */oe(/* @__PURE__ */m({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=a({text:Cn,inline_code:_e,link:Kn,image:yn,strong:zn,emphasis:Gn,strikethrough:Dn,highlight:Zn,insert:Yn,subscript:Nn,superscript:jn,emoji:ve,checkbox:ae,checkbox_input:ae,footnote_reference:be,hardbreak:lo,math_inline:Tn,reference:$n},ge(t.customId));return(o,l)=>g([e.node.children],()=>(f(),$(X(`h${e.node.level}`),{class:H(["heading-node",[`heading-${e.node.level}`]]),dir:"auto"},{default:j(()=>[(f(!0),p(k,null,b(e.node.children,(o,l,r,i)=>{const a=[o];if(i&&i.key===`${e.indexKey||"heading"}-${l}`&&Z(i,a))return i;const s=(f(),$(X(n[o.type]),{key:`${e.indexKey||"heading"}-${l}`,"custom-id":t.customId,node:o,"index-key":`${e.indexKey||"heading"}-${l}`},null,8,["custom-id","node","index-key"]));return s.memo=a,s},l,0),128))]),_:1},8,["class"])),l,2)}}),[["__scopeId","data-v-d8e179e9"]]),io=ro;io.install=e=>{e.component(ro.__name,ro)};const ao=/* @__PURE__ */oe(/* @__PURE__ */m({__name:"ListItemNode",props:{item:{},indexKey:{},value:{},typewriter:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=_(()=>null==t.value?{}:{value:t.value});return(e,o)=>(f(),p("li",q({class:"list-item pl-1.5 my-2",dir:"auto"},n.value),[g([t.item.children],()=>w(y(dl),{"index-key":`list-item-${t.indexKey}`,nodes:t.item.children,typewriter:t.typewriter,"batch-rendering":!1,onCopy:o[0]||(o[0]=t=>e.$emit("copy",t))},null,8,["index-key","nodes","typewriter"]),o,1)],16))}}),[["__scopeId","data-v-e7aa2cc3"]]);ao.install=e=>{e.component(ao.__name,ao)};const so=/* @__PURE__ */oe(/* @__PURE__ */m({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean}},emits:["copy"],setup:e=>(t,n)=>(f(),$(X(e.node.ordered?"ol":"ul"),{class:H(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:j(()=>[(f(!0),p(k,null,b(e.node.items,(o,l,r,i)=>{var a;const s=[o];if(i&&i.key===`${e.indexKey||"list"}-${l}`&&Z(i,s))return i;const c=(f(),$(y(ao),{key:`${e.indexKey||"list"}-${l}`,item:o,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${l}`,typewriter:e.typewriter,value:e.node.ordered?(null!=(a=e.node.start)?a:1)+l:void 0,onCopy:n[0]||(n[0]=e=>t.$emit("copy",e))},null,8,["item","custom-id","index-key","typewriter","value"]));return c.memo=s,c},n,1),128))]),_:1},8,["class"]))}),[["__scopeId","data-v-79057d57"]]);function co(e){try{if("undefined"!=typeof globalThis&&"function"==typeof globalThis.requestAnimationFrame)return globalThis.requestAnimationFrame(e)}catch(t){}return globalThis.setTimeout(e,0)}so.install=e=>{e.component(so.__name,so)};let uo=null,ho=null;const vo=/* @__PURE__ */new Map;let mo=5,po=!1;function fo(e){po=!!e}function go(e){Number.isFinite(e)&&e>0&&(mo=Math.floor(e))}function wo(){return{inFlight:vo.size,max:mo}}const yo="WORKER_BUSY";function xo(e){uo=e,ho=null;const t=e;uo.onmessage=e=>{if(uo!==t)return;const{id:n,ok:o,result:l,error:r}=e.data,i=vo.get(n);i&&(!1===o||r?i.reject(new Error(r||"Unknown error")):i.resolve(l))},uo.onerror=e=>{var n,o;if(uo===t)if(0!==vo.size){try{po?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(l){}for(const[t,n]of vo.entries())n.reject(new Error(`Worker error: ${e.message}`));vo.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker error (no pending):",(null==e?void 0:e.message)||e)},uo.onmessageerror=e=>{var n,o;if(uo===t)if(0!==vo.size){try{po?console.error("[mermaidWorkerClient] Worker messageerror:",e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker messageerror:",e)}catch(l){}for(const[e,t]of vo.entries())t.reject(new Error("Worker messageerror"));vo.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",e)}}function ko(){var e;if(uo)try{for(const[e,t]of vo.entries())t.reject(new Error("Worker cleared"));vo.clear(),null==(e=uo.terminate)||e.call(uo)}catch(t){}uo=null,ho=null}function bo(e,t,n=1400){if(ho)return Promise.reject(ho);const o=uo||(ho=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),ho.name="WorkerInitError",ho.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(ho);if(vo.size>=mo){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code=yo,e.inFlight=vo.size,e.max=mo,Promise.reject(e)}return new Promise((l,r)=>{const i=Math.random().toString(36).slice(2);let a,s=!1;const c=()=>{s||(s=!0,null!=a&&globalThis.clearTimeout(a),vo.delete(i))},u={resolve:e=>{c(),l(e)},reject:e=>{c(),r(e)}};vo.set(i,u);try{o.postMessage({id:i,action:e,payload:t})}catch(d){return vo.delete(i),void r(d)}a=globalThis.setTimeout(()=>{const e=new Error("Worker call timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT";const t=vo.get(i);t&&t.reject(e)},n)})}function Mo(e,t,n=1400){return u(this,null,function*(){try{return yield bo("canParse",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function _o(e,t,n=1400){return u(this,null,function*(){try{return yield bo("findPrefix",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function Bo(){if(uo)try{for(const[e,t]of vo.entries())t.reject(new Error("Worker terminated"));vo.clear(),uo.terminate()}finally{uo=null}}let Co=null;const To={key:0},Lo={key:1,class:"flex items-center space-x-2 overflow-hidden"},$o=["src"],So={key:2},Io={class:"flex items-center space-x-1"},jo={class:"flex items-center space-x-1"},Eo={key:4},Ho={key:5,class:"flex items-center space-x-1"},No=["aria-pressed"],Ro={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"},zo={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"},Ao=["disabled"],Do=["disabled"],Po={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"},Vo={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"},Oo={key:1,class:"relative"},Fo={key:0,class:"absolute top-2 right-2 z-10 rounded-lg"},Wo={class:"flex items-center gap-2 backdrop-blur rounded-lg"},Ko={class:"absolute top-6 right-6 z-50 flex items-center gap-2"},Xo=/* @__PURE__ */oe(/* @__PURE__ */m({__name:"MermaidBlockNode",props:{node:{},maxHeight:{default:"500px"},loading:{type:Boolean,default:!0},isDark:{type:Boolean},workerTimeoutMs:{default:1400},parseTimeoutMs:{default:1800},renderTimeoutMs:{default:2500},fullRenderTimeoutMs:{default:4e3},showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showFullscreenButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showZoomControls:{type:Boolean,default:!0}},emits:["copy","export","openModal","toggleMode"],setup(e,{emit:t}){var n,o;const l=e,r=t,{t:i}=cn();let c=null;const d=B(!1);"undefined"!=typeof window&&u(null,null,function*(){var e;c=yield function(){return u(this,null,function*(){if(Co)return Co;try{const e=yield import("mermaid"),t=e&&e.default?e.default:e;if(!t||"function"!=typeof t.render&&"function"!=typeof t.parse&&"function"!=typeof t.initialize)if(t&&t.mermaidAPI&&("function"==typeof t.mermaidAPI.render||"function"==typeof t.mermaidAPI.parse)){const e=t.mermaidAPI;Co=s(a({},t),{render:e.render.bind(e),parse:e.parse?e.parse.bind(e):void 0,initialize:n=>"function"==typeof t.initialize?t.initialize(n):e.initialize?e.initialize(n):void 0})}else Co=e.mermaid&&"function"==typeof e.mermaid.render?e.mermaid:t;else Co=t}catch(e){throw new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.')}try{const e=null==Co?void 0:Co.initialize;Co.initialize=t=>{const n=a({suppressErrorRendering:!0},t||{});return"function"==typeof e?e.call(Co,n):(null==Co?void 0:Co.mermaidAPI)&&"function"==typeof Co.mermaidAPI.initialize?Co.mermaidAPI.initialize(n):void 0}}catch(e){}return Co})}(),d.value=!!c,null==(e=null==c?void 0:c.initialize)||e.call(c,{startOnLoad:!1,securityLevel:"loose"})});const h=B(!1),v=B(!1),m=B(),g=B(),k=B(),b=B(),z=B(null),A=dn(),D=B(null),P=B("undefined"==typeof window),F=B(),W=_(()=>l.node.code.replace(/\]::([^:])/g,"]:::$1").replace(/:::subgraphNode$/gm,"::subgraphNode")),K=B(1),X=B(0),Y=B(0),q=B(!1),Z=B({x:0,y:0}),Q=B(!1),ee=B(!1),te=B(!1),ne=B(null),oe=B(0),le=B(!1);let re=null;const ie=B("360px");let ae=null;const se=B(!1),ce=B(!1),ue=B({}),de=B(null),he=B(""),ve=B(0);let me=null;const pe=B(!1),fe=B({zoom:1,translateX:0,translateY:0,containerHeight:"360px"}),ge=_(()=>{var e,t,n,o;return{worker:null!=(e=l.workerTimeoutMs)?e:1400,parse:null!=(t=l.parseTimeoutMs)?t:1800,render:null!=(n=l.renderTimeoutMs)?n:2500,fullRender:null!=(o=l.fullRenderTimeoutMs)?o:4e3}}),we=null!=(n=globalThis.cancelIdleCallback)?n:e=>clearTimeout(e);let ye=null,xe=null,ke=!1,be=800,Me=null,_e=0,Be=!0;function Ce(e,t){const n=null==t?void 0:t.timeoutMs,o=null==t?void 0:t.signal;if(null==o?void 0:o.aborted)return Promise.reject(new DOMException("Aborted","AbortError"));let l=null,r=!1,i=null;return new Promise((t,a)=>{const s=()=>{null!=l&&clearTimeout(l),i&&o&&o.removeEventListener("abort",i)};n&&n>0&&(l=globalThis.setTimeout(()=>{r||(r=!0,s(),a(new Error("Operation timed out")))},n)),o&&(i=()=>{r||(r=!0,s(),a(new DOMException("Aborted","AbortError")))},o.addEventListener("abort",i)),e().then(e=>{r||(r=!0,s(),t(e))}).catch(e=>{r||(r=!0,s(),a(e))})})}function Te(e){if("undefined"==typeof document)return;if(!k.value)return;const t=document.createElement("div");t.className="text-red-500 p-4",t.textContent="Failed to render diagram: ";const n=document.createElement("span");n.textContent=e instanceof Error?e.message:"Unknown error",t.appendChild(n),k.value.innerHTML="",k.value.appendChild(t),ie.value="360px",pe.value=!0,lt()}function Le(e){return!e||e.disabled}function $e(e,t,n="top"){if(Le(e.currentTarget))return;const o=e,r=null!=(null==o?void 0:o.clientX)&&null!=(null==o?void 0:o.clientY)?{x:o.clientX,y:o.clientY}:void 0;ln(e.currentTarget,t,n,!1,r,l.isDark)}function Se(){rn()}function Ie(e){if(Le(e.currentTarget))return;const t=h.value?i("common.copied")||"Copied":i("common.copy")||"Copy",n=e,o=null!=(null==n?void 0:n.clientX)&&null!=(null==n?void 0:n.clientY)?{x:n.clientX,y:n.clientY}:void 0;ln(e.currentTarget,t,"top",!1,o,l.isDark)}function je(e,t){const n=`%%{init: {"theme": "${"dark"===t?"dark":"default"}"}}%%\n`;return e.trimStart().startsWith("%%{")?e:n+e}function Ee(){return Be&&!Q.value&&!se.value&&!pe.value}function He(e){const t=e.split(/\r?\n/);for(;t.length>0;){const e=t[t.length-1].trimEnd();if(""!==e){if(!(/^[-=~>|<\s]+$/.test(e.trim())||/(?:--|==|~~|->|<-|-\||-\)|-x|o-|\|-|\.-)\s*$/.test(e)||/[-|><]$/.test(e)||/(?:graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|gantt)\s*$/i.test(e)))break;t.pop()}else t.pop()}return t.join("\n")}function Ne(e,t,n){return u(this,null,function*(){var o;try{return yield Mo(e,t,null!=(o=null==n?void 0:n.timeoutMs)?o:ge.value.worker)}catch(l){return yield function(e,t,n){return u(this,null,function*(){var o,l;if(!c)return;const r=c,i=je(e,t);if("function"==typeof r.parse)return yield Ce(()=>r.parse(i),{timeoutMs:null!=(o=null==n?void 0:n.timeoutMs)?o:ge.value.parse,signal:null==n?void 0:n.signal}),!0;const a=`mermaid-parse-${Math.random().toString(36).slice(2,9)}`;return yield Ce(()=>c.render(a,i),{timeoutMs:null!=(l=null==n?void 0:n.timeoutMs)?l:ge.value.render,signal:null==n?void 0:n.signal}),!0})}(e,t,n)}})}"undefined"!=typeof window&&C(()=>m.value,e=>{var t;if(null==(t=D.value)||t.destroy(),D.value=null,!e)return void(P.value=!1);const n=A(e,{rootMargin:"400px"});D.value=n,P.value=n.isVisible.value,n.whenVisible.then(()=>{P.value=!0})},{immediate:!0}),L(()=>{var e;null==(e=D.value)||e.destroy(),D.value=null});const Re=_(()=>Q.value||te.value||v.value);function ze(e){if(!m.value||!k.value)return;const t=k.value.querySelector("svg");if(!t)return;let n=0,o=0;const l=t.getAttribute("viewBox"),r=t.getAttribute("width"),i=t.getAttribute("height");if(l){const e=l.split(" ");4===e.length&&(n=Number.parseFloat(e[2]),o=Number.parseFloat(e[3]))}if(n&&o||r&&i&&(n=Number.parseFloat(r),o=Number.parseFloat(i)),Number.isNaN(n)||Number.isNaN(o)||n<=0||o<=0)try{const e=t.getBBox();e&&e.width>0&&e.height>0&&(n=e.width,o=e.height)}catch(a){return void console.error("Failed to get SVG BBox:",a)}if(n>0&&o>0){const t=o/n;let l=(null!=e?e:m.value.clientWidth)*t;l>o&&(l=o),ie.value=`${l}px`}}const Ae=B(!1),De=_(()=>({transform:`translate(${X.value}px, ${Y.value}px) scale(${K.value})`}));function Pe(e){"Escape"===e.key&&Ae.value&&Ve()}function Ve(){if(Ae.value=!1,b.value&&(b.value.innerHTML=""),z.value=null,"undefined"!=typeof document)try{document.body.style.overflow=""}catch(e){}if("undefined"!=typeof window)try{window.removeEventListener("keydown",Pe)}catch(e){}}function Oe(){K.value<3&&(K.value+=.1)}function Fe(){K.value>.5&&(K.value-=.1)}function We(){K.value=1,X.value=0,Y.value=0}function Ke(e){q.value=!0,e instanceof MouseEvent?Z.value={x:e.clientX-X.value,y:e.clientY-Y.value}:Z.value={x:e.touches[0].clientX-X.value,y:e.touches[0].clientY-Y.value}}function Xe(e){if(!q.value)return;let t,n;e instanceof MouseEvent?(t=e.clientX,n=e.clientY):(t=e.touches[0].clientX,n=e.touches[0].clientY),X.value=t-Z.value.x,Y.value=n-Z.value.y}function Ye(){q.value=!1}function qe(e){if(e.ctrlKey||e.metaKey){if(e.preventDefault(),!m.value)return;const t=m.value.getBoundingClientRect(),n=e.clientX-t.left,o=e.clientY-t.top,l=n-t.width/2,r=o-t.height/2,i=(l-X.value)/K.value,a=(r-Y.value)/K.value,s=.01,c=-e.deltaY*s,u=Math.min(Math.max(K.value+c,.5),3);u!==K.value&&(X.value=l-i*u,Y.value=r-a*u,K.value=u)}}function Ze(){return u(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(W.value)),h.value=!0,r("copy",W.value),setTimeout(()=>{h.value=!1},1e3)}catch(e){console.error("Failed to copy:",e)}})}function Ue(){var e;const t=null==(e=k.value)?void 0:e.querySelector("svg");if(!t)return void console.error("SVG element not found");const n=(new XMLSerializer).serializeToString(t),o={payload:{type:"export"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:t,svgString:n};r("export",o),o.defaultPrevented||function(e,t=null){u(this,null,function*(){try{const o=null!=t?t:(new XMLSerializer).serializeToString(e),l=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),r=URL.createObjectURL(l);if("undefined"!=typeof document){const e=document.createElement("a");e.href=r,e.download=`mermaid-diagram-${Date.now()}.svg`;try{document.body.appendChild(e),e.click(),document.body.removeChild(e)}catch(n){}URL.revokeObjectURL(r)}}catch(o){console.error("Failed to export SVG:",o)}})}(t,n)}function Ge(){var e,t;const n=null!=(t=null==(e=k.value)?void 0:e.querySelector("svg"))?t:null,o=n?(new XMLSerializer).serializeToString(n):null,l={payload:{type:"open-modal"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:n,svgString:o};r("openModal",l),l.defaultPrevented||function(){if(Ae.value=!0,"undefined"!=typeof document)try{document.body.style.overflow="hidden"}catch(e){}if("undefined"!=typeof window)try{window.addEventListener("keydown",Pe)}catch(e){}T(()=>{if(m.value&&b.value){const e=m.value.cloneNode(!0);e.classList.add("fullscreen");const t=e.querySelector("[data-mermaid-wrapper]");t&&(z.value=t,t.style.transform=De.value.transform),b.value.innerHTML="",b.value.appendChild(e)}})}()}function Je(e){const t={payload:{type:"toggle-mode",target:e},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}};r("toggleMode",e,t),t.defaultPrevented||Qe(e)}function Qe(e){return u(this,null,function*(){const t=F.value;if(!t)return ee.value=!0,void(Q.value="source"===e);const n=t.getBoundingClientRect().height;t.style.height=`${n}px`,t.style.overflow="hidden",ee.value=!0,Q.value="source"===e,yield T();const o=t.scrollHeight;t.style.transition="height 180ms ease",t.offsetHeight,t.style.height=`${o}px`;const l=()=>{t.style.transition="",t.style.height="",t.style.overflow="",t.removeEventListener("transitionend",r)};function r(){l()}t.addEventListener("transitionend",r),setTimeout(()=>l(),220)})}function et(){return u(this,null,function*(){return te.value?ne.value:k.value||(yield T(),k.value)?(te.value=!0,ne.value=u(null,null,function*(){var e;if(c){k.value&&(k.value.style.opacity="0");try{const t=`mermaid-${Date.now()}-${Math.random().toString(36).substring(2,11)}`;se.value||ce.value||null==(e=c.initialize)||e.call(c,{securityLevel:"loose",startOnLoad:!1});const n=function(e){const t=W.value,n=`%%{init: {"theme": "${"dark"===e?"dark":"default"}"}}%%\n`;return t.trim().startsWith("%%{")?t:n+t}(l.isDark?"dark":"light"),o=yield Ce(()=>c.render(t,n),{timeoutMs:ge.value.fullRender}),r=null==o?void 0:o.svg,i=null==o?void 0:o.bindFunctions;if(k.value){k.value.innerHTML=r,null==i||i(k.value),se.value||ce.value||(ze(),se.value=!0,fe.value={zoom:K.value,translateX:X.value,translateY:Y.value,containerHeight:ie.value});const e=l.isDark?"dark":"light";ue.value[e]=r,ce.value&&(ce.value=!1),pe.value=!1}}catch(t){console.error("Failed to render mermaid diagram:",t),!1===l.loading&&Te(t)}finally{yield T(),k.value&&(k.value.style.opacity="1"),te.value=!1,ne.value=null}}}),ne.value):void console.warn("Mermaid container not ready")})}C(De,e=>{Ae.value&&z.value&&(z.value.style.transform=e.transform)},{immediate:!0});const tt=null!=(o=globalThis.requestIdleCallback)?o:(e,t)=>setTimeout(()=>e({didTimeout:!0}),16);function nt(){return u(this,null,function*(){var e,t;const n=Date.now(),o=++ve.value;me&&me.abort(),me=new AbortController;const r=me.signal,i=l.isDark?"dark":"light",a=W.value,s=a.replace(/\s+/g,"");if(!a.trim())return k.value&&(k.value.innerHTML=""),de.value=null,he.value="",void(pe.value=!1);if(s===he.value)return;try{const d=yield function(e,t,n){return u(this,null,function*(){var o;try{if(yield Ne(e,t,n))return{fullOk:!0,prefixOk:!1}}catch(r){if("AbortError"===(null==r?void 0:r.name))throw r}let l=He(e);if(l&&l.trim()&&l!==e)try{try{const r=yield _o(e,t,null!=(o=null==n?void 0:n.timeoutMs)?o:ge.value.worker);r&&r.trim()&&(l=r)}catch(r){}if(yield Ne(l,t,n))return{fullOk:!1,prefixOk:!0,prefix:l}}catch(r){if("AbortError"===(null==r?void 0:r.name))throw r}return{fullOk:!1,prefixOk:!1}})}(a,i,{signal:r,timeoutMs:ge.value.worker});if(d.fullOk)return yield et(),void(ve.value===o&&(de.value=null!=(t=null==(e=k.value)?void 0:e.innerHTML)?t:null,he.value=s,pe.value=!1));const h=_e&&n<=_e;if(d.prefixOk&&d.prefix&&Ee()&&!h)return void(yield function(e){return u(this,null,function*(){if(Ee()&&(k.value||(yield T(),k.value))&&!te.value){te.value=!0;try{if(!c)return;const t=`mermaid-partial-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,n=l.isDark?"dark":"light",o=He(e),r=je(o&&o.trim()?o:e,n);k.value&&(k.value.style.opacity="0");const i=yield Ce(()=>c.render(t,r),{timeoutMs:ge.value.render}),a=null==i?void 0:i.svg,s=null==i?void 0:i.bindFunctions;k.value&&a&&(k.value.innerHTML=a,null==s||s(k.value),ze())}catch(t){}finally{yield T(),k.value&&(k.value.style.opacity="1"),te.value=!1}}})}(d.prefix))}catch(h){if("AbortError"===(null==h?void 0:h.name))return}if(ve.value!==o)return;if(pe.value)return;const d=ue.value[i];d&&k.value&&(k.value.innerHTML=d)})}const ot=function(){let e=null;return(...t)=>{e&&clearTimeout(e),e=setTimeout(()=>(()=>{tt(()=>{nt()},{timeout:500})})(...t),300)}}();function lt(){ke&&(ke=!1,be=800,Be=!1,Me&&(Me.abort(),Me=null),ye&&(globalThis.clearTimeout(ye),ye=null),xe&&(we(xe),xe=null),_e=Date.now())}function rt(){if(lt(),me){try{me.abort()}catch(e){}me=null}if(Me){try{Me.abort()}catch(e){}Me=null}Bo()}function it(e=800){ke&&(ye&&globalThis.clearTimeout(ye),ye=globalThis.setTimeout(()=>{xe=tt(()=>u(null,null,function*(){if(!ke)return;if(Q.value||se.value)return void lt();const e=l.isDark?"dark":"light",t=W.value;if(t.trim()){Me&&Me.abort(),Me=new AbortController;try{if((yield Ne(t,e,{signal:Me.signal,timeoutMs:ge.value.worker}))&&(yield et(),se.value))return void lt()}catch(n){}be=Math.min(Math.floor(1.5*be),4e3),it(be)}else it(be)}),{timeout:500})},e))}function at(){ke||Q.value||se.value||(ke=!0,_e=0,Be=!0,it(500))}C(()=>W.value,()=>{se.value=!1,ue.value={},ot(),!Q.value&&d.value&&at(),function(){if(!Q.value)return;if(!d.value)return;const e=W.value.length;e!==oe.value&&(le.value=!0,oe.value=e,re&&clearTimeout(re),re=setTimeout(()=>{le.value&&Q.value&&W.value.trim()&&(le.value=!1,Qe("preview"))},500))}()}),C(()=>l.isDark,()=>u(null,null,function*(){if(!se.value)return;if(pe.value)return;const e=l.isDark?"dark":"light";if(ue.value[e])return void(k.value&&(k.value.innerHTML=ue.value[e]));const t={zoom:K.value,translateX:X.value,translateY:Y.value,containerHeight:ie.value},n=1!==K.value||0!==X.value||0!==Y.value;ce.value=!0,n&&(K.value=1,X.value=0,Y.value=0,yield T()),yield et(),n&&(yield T(),K.value=t.zoom,X.value=t.translateX,Y.value=t.translateY,ie.value=t.containerHeight,fe.value=t)})),C(()=>Q.value,e=>u(null,null,function*(){if(e)lt(),se.value&&(fe.value={zoom:K.value,translateX:X.value,translateY:Y.value,containerHeight:ie.value});else{if(pe.value)return;const e=l.isDark?"dark":"light";if(se.value&&ue.value[e])return yield T(),k.value&&(k.value.innerHTML=ue.value[e]),K.value=fe.value.zoom,X.value=fe.value.translateX,Y.value=fe.value.translateY,void(ie.value=fe.value.containerHeight);if(yield T(),!d.value)return;yield nt(),at()}})),C(()=>l.loading,(e,t)=>u(null,null,function*(){if(!0===t&&!1===e){const e=W.value.trim();if(!e)return rt();const t=l.isDark?"dark":"light",o=e.replace(/\s+/g,"");if(se.value&&o===he.value)return yield T(),k.value&&!k.value.querySelector("svg")&&ue.value[t]&&(k.value.innerHTML=ue.value[t]),void rt();try{yield Ne(e,t,{timeoutMs:ge.value.worker}),yield et(),he.value=o,pe.value=!1,rt()}catch(n){rt(),Te(n)}}})),C(m,e=>{ae&&ae.disconnect(),!e||se.value||ce.value||(ae=new ResizeObserver(e=>{e&&e.length>0&&!se.value&&!ce.value&&co(()=>{ze(e[0].contentRect.width)})}),ae.observe(e))},{immediate:!0}),U(()=>u(null,null,function*(){yield T(),ee.value||(Q.value=!d.value),P.value&&(ot(),oe.value=W.value.length)})),C(()=>d.value,e=>{ee.value||(Q.value=!e)}),C(()=>P.value,e=>{e&&(se.value||(ot(),oe.value=W.value.length),l.loading||se.value||ot())},{immediate:!1}),G(()=>{re&&clearTimeout(re),ae&&ae.disconnect(),me&&(me.abort(),me=null),Bo(),lt()}),C(()=>v.value,e=>u(null,null,function*(){e?(lt(),me&&me.abort()):se.value||(yield T(),ot(),Q.value||at())}),{immediate:!1});const st=_(()=>l.isDark?"mermaid-action-btn p-2 text-xs rounded text-gray-400 hover:bg-gray-700 hover:text-gray-200":"mermaid-action-btn p-2 text-xs rounded text-gray-600 hover:bg-gray-200 hover:text-gray-700");return(e,t)=>(f(),p("div",{class:H(["my-4 rounded-lg border overflow-hidden shadow-sm",[l.isDark?"border-gray-700/30":"border-gray-200",{"is-rendering":l.loading}]])},[l.showHeader?(f(),p("div",{key:0,class:H(["mermaid-block-header flex justify-between items-center px-4 py-2.5 border-b",l.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"])},[e.$slots["header-left"]?(f(),p("div",To,[O(e.$slots,"header-left",{},void 0,!0)])):(f(),p("div",Lo,[x("img",{src:y("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%20width='16'%20height='16'%3e%3cpath%20fill='none'%20stroke='%23ca9ee6'%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M1.5%202.5c0%206%202.25%205.75%204%207%20.83.67%201.17%202%201%204h3c-.17-2%20.17-3.33%201-4%201.75-1.25%204-1%204-7C12%202.5%2010%203%208%207%206%203%204%202.5%201.5%202.5'%20/%3e%3c/svg%3e"),class:"w-4 h-4 my-0",alt:"Mermaid"},null,8,$o),x("span",{class:H(["text-sm font-medium font-mono truncate",l.isDark?"text-gray-400":"text-gray-600"])},"Mermaid",2)])),e.$slots["header-center"]?(f(),p("div",So,[O(e.$slots,"header-center",{},void 0,!0)])):l.showModeToggle&&d.value?(f(),p("div",{key:3,class:H(["flex items-center space-x-1 rounded-md p-0.5",l.isDark?"bg-gray-700":"bg-gray-100"])},[x("button",{class:H(["px-2.5 py-1 text-xs rounded transition-colors",[Q.value?l.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700":l.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm"]]),onClick:t[0]||(t[0]=()=>Je("preview")),onMouseenter:t[1]||(t[1]=e=>$e(e,y(i)("common.preview")||"Preview")),onFocus:t[2]||(t[2]=e=>$e(e,y(i)("common.preview")||"Preview")),onMouseleave:Se,onBlur:Se},[x("div",Io,[t[21]||(t[21]=x("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"},[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("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"}),x("circle",{cx:"12",cy:"12",r:"3"})])],-1)),x("span",null,M(y(i)("common.preview")||"Preview"),1)])],34),x("button",{class:H(["px-2.5 py-1 text-xs rounded transition-colors",[Q.value?l.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm":l.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700"]]),onClick:t[3]||(t[3]=()=>Je("source")),onMouseenter:t[4]||(t[4]=e=>$e(e,y(i)("common.source")||"Source")),onFocus:t[5]||(t[5]=e=>$e(e,y(i)("common.source")||"Source")),onMouseleave:Se,onBlur:Se},[x("div",jo,[t[22]||(t[22]=x("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"},[x("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m16 18l6-6l-6-6M8 6l-6 6l6 6"})],-1)),x("span",null,M(y(i)("common.source")||"Source"),1)])],34)],2)):V("",!0),e.$slots["header-right"]?(f(),p("div",Eo,[O(e.$slots,"header-right",{},void 0,!0)])):(f(),p("div",Ho,[l.showCollapseButton?(f(),p("button",{key:0,class:H(st.value),"aria-pressed":v.value,onClick:t[6]||(t[6]=e=>v.value=!v.value),onMouseenter:t[7]||(t[7]=e=>$e(e,v.value?y(i)("common.expand")||"Expand":y(i)("common.collapse")||"Collapse")),onFocus:t[8]||(t[8]=e=>$e(e,v.value?y(i)("common.expand")||"Expand":y(i)("common.collapse")||"Collapse")),onMouseleave:Se,onBlur:Se},[(f(),p("svg",{style:N({rotate:v.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[23]||(t[23]=[x("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],42,No)):V("",!0),l.showCopyButton?(f(),p("button",{key:1,class:H(st.value),onClick:Ze,onMouseenter:t[9]||(t[9]=e=>Ie(e)),onFocus:t[10]||(t[10]=e=>Ie(e)),onMouseleave:Se,onBlur:Se},[h.value?(f(),p("svg",zo,[...t[25]||(t[25]=[x("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(f(),p("svg",Ro,[...t[24]||(t[24]=[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),x("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],34)):V("",!0),l.showExportButton&&d.value?(f(),p("button",{key:2,class:H(`${st.value} ${Re.value?"opacity-50 cursor-not-allowed":""}`),disabled:Re.value,onClick:Ue,onMouseenter:t[11]||(t[11]=e=>$e(e,y(i)("common.export")||"Export")),onFocus:t[12]||(t[12]=e=>$e(e,y(i)("common.export")||"Export")),onMouseleave:Se,onBlur:Se},[...t[26]||(t[26]=[x("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"},[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("path",{d:"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),x("path",{d:"m7 10l5 5l5-5"})])],-1)])],42,Ao)):V("",!0),l.showFullscreenButton&&d.value?(f(),p("button",{key:3,class:H(`${st.value} ${Re.value?"opacity-50 cursor-not-allowed":""}`),disabled:Re.value,onClick:Ge,onMouseenter:t[13]||(t[13]=e=>$e(e,Ae.value?y(i)("common.minimize")||"Minimize":y(i)("common.open")||"Open")),onFocus:t[14]||(t[14]=e=>$e(e,Ae.value?y(i)("common.minimize")||"Minimize":y(i)("common.open")||"Open")),onMouseleave:Se,onBlur:Se},[Ae.value?(f(),p("svg",Vo,[...t[28]||(t[28]=[x("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)])])):(f(),p("svg",Po,[...t[27]||(t[27]=[x("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)])]))],42,Do)):V("",!0)]))],2)):V("",!0),E(x("div",{ref_key:"modeContainerRef",ref:F},[Q.value?(f(),p("div",{key:0,class:H(["p-4",l.isDark?"bg-gray-900":"bg-gray-50"])},[x("pre",{class:H(["text-sm font-mono whitespace-pre-wrap",l.isDark?"text-gray-300":"text-gray-700"])},M(W.value),3)],2)):(f(),p("div",Oo,[l.showZoomControls?(f(),p("div",Fo,[x("div",Wo,[x("button",{class:H(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:Oe,onMouseenter:t[15]||(t[15]=e=>$e(e,y(i)("common.zoomIn")||"Zoom in")),onFocus:t[16]||(t[16]=e=>$e(e,y(i)("common.zoomIn")||"Zoom in")),onMouseleave:Se,onBlur:Se},[...t[29]||(t[29]=[x("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"},[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("circle",{cx:"11",cy:"11",r:"8"}),x("path",{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"})])],-1)])],34),x("button",{class:H(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:Fe,onMouseenter:t[17]||(t[17]=e=>$e(e,y(i)("common.zoomOut")||"Zoom out")),onFocus:t[18]||(t[18]=e=>$e(e,y(i)("common.zoomOut")||"Zoom out")),onMouseleave:Se,onBlur:Se},[...t[30]||(t[30]=[x("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"},[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("circle",{cx:"11",cy:"11",r:"8"}),x("path",{d:"m21 21l-4.35-4.35M8 11h6"})])],-1)])],34),x("button",{class:H(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:We,onMouseenter:t[19]||(t[19]=e=>$e(e,y(i)("common.resetZoom")||"Reset zoom")),onFocus:t[20]||(t[20]=e=>$e(e,y(i)("common.resetZoom")||"Reset zoom")),onMouseleave:Se,onBlur:Se},M(Math.round(100*K.value))+"% ",35)])])):V("",!0),x("div",{ref_key:"mermaidContainer",ref:m,class:H(["min-h-[360px] relative transition-all duration-100 overflow-hidden block",l.isDark?"bg-gray-900":"bg-gray-50"]),style:N({height:ie.value}),onWheel:qe,onMousedown:Ke,onMousemove:Xe,onMouseup:Ye,onMouseleave:Ye,onTouchstartPassive:Ke,onTouchmovePassive:Xe,onTouchendPassive:Ye},[x("div",{ref_key:"mermaidWrapper",ref:g,"data-mermaid-wrapper":"",class:H(["absolute inset-0 cursor-grab",{"cursor-grabbing":q.value}]),style:N(De.value)},[x("div",{ref_key:"mermaidContent",ref:k,class:"_mermaid w-full text-center flex items-center justify-center min-h-full"},null,512)],6)],38),(f(),$(S,{to:"body"},[w(I,{name:"mermaid-dialog",appear:""},{default:j(()=>[Ae.value?(f(),p("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",onClick:J(Ve,["self"])},[x("div",{class:H(["dialog-panel relative w-full h-full max-w-full max-h-full rounded shadow-lg overflow-hidden",l.isDark?"bg-gray-900":"bg-white"])},[x("div",Ko,[x("button",{class:H(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:Oe},[...t[31]||(t[31]=[x("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"},[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("circle",{cx:"11",cy:"11",r:"8"}),x("path",{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"})])],-1)])],2),x("button",{class:H(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:Fe},[...t[32]||(t[32]=[x("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"},[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("circle",{cx:"11",cy:"11",r:"8"}),x("path",{d:"m21 21l-4.35-4.35M8 11h6"})])],-1)])],2),x("button",{class:H(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:We},M(Math.round(100*K.value))+"% ",3),x("button",{class:H(["inline-flex items-center justify-center p-2 rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:Ve},[...t[33]||(t[33]=[x("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"},[x("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"})],-1)])],2)]),x("div",{ref_key:"modalContent",ref:b,class:"w-full h-full flex items-center justify-center p-4 overflow-hidden",onWheel:qe,onMousedown:Ke,onMousemove:Xe,onMouseup:Ye,onMouseleave:Ye,onTouchstart:Ke,onTouchmove:Xe,onTouchend:Ye},null,544)],2)])):V("",!0)]),_:1})]))]))],512),[[R,!v.value]])],2))}}),[["__scopeId","data-v-68e87d14"]]);Xo.install=e=>{e.component(Xo.__name,Xo)};const Yo={dir:"auto",class:"paragraph-node"},qo=/* @__PURE__ */oe(/* @__PURE__ */m({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=a({inline_code:_e,image:yn,link:Kn,hardbreak:lo,emphasis:Gn,strong:zn,strikethrough:Dn,highlight:Zn,insert:Yn,subscript:Nn,superscript:jn,emoji:ve,checkbox:ae,math_inline:Tn,checkbox_input:ae,reference:$n,footnote_anchor:Qn,footnote_reference:be},ge(t.customId)),o=Bn();return(l,r)=>(f(),p("p",Yo,[(f(!0),p(k,null,b(e.node.children,(l,r)=>(f(),p(k,{key:`${e.indexKey||"paragraph"}-${r}`},["text"!==l.type?(f(),$(X(n[l.type]),{key:0,node:l,"index-key":`${e.indexKey}-${r}`,"custom-id":t.customId},null,8,["node","index-key","custom-id"])):(f(),p("span",{key:1,class:H([[y(o)&&l.center?"text-node-center":""],"whitespace-pre-wrap break-words text-node"])},M(l.content),3))],64))),128))]))}}),[["__scopeId","data-v-e7323e31"]]);qo.install=e=>{e.component(qo.__name,qo)};const Zo=["aria-busy","aria-label","data-language"],Uo=["textContent"],Go=/* @__PURE__ */m({__name:"PreCodeNode",props:{node:{}},setup(e){const t=e,n=_(()=>{var e,n,o;const l=String(null!=(n=null==(e=t.node)?void 0:e.language)?n:"");return String(null!=(o=String(l).split(/\s+/g)[0])?o:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=_(()=>`language-${n.value}`),l=_(()=>{const e=n.value;return e?`Code block: ${e}`:"Code block"});return(t,r)=>(f(),p("pre",{class:H([o.value]),"aria-busy":!0===e.node.loading,"aria-label":l.value,"data-language":n.value,tabindex:"0"},[r[0]||(r[0]=Q(" ",-1)),x("code",{translate:"no",textContent:M(e.node.code)},null,8,Uo),r[1]||(r[1]=Q("\n ",-1))],10,Zo))}});Go.install=e=>{e.component(Go.__name,Go)};const Jo={class:"table-node-wrapper"},Qo=["aria-busy"],el={class:"border-[var(--table-border,#cbd5e1)]"},tl={class:"border-b"},nl={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},ol=/* @__PURE__ */oe(/* @__PURE__ */m({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=_(()=>{var e,n,o,l;return null!=(l=null==(o=null==(n=null==(e=t.node)?void 0:e.header)?void 0:n.cells)?void 0:o.length)?l:0}),o=_(()=>{const e=n.value||1,t=Math.floor(100/e);return Array.from({length:e}).map((n,o)=>o===e-1?100-t*(e-1)+"%":`${t}%`)}),l=_(()=>{var e;return null!=(e=t.node.loading)&&e}),r=_(()=>{var e;return null!=(e=t.node.rows)?e:[]});return(n,i)=>(f(),p("div",Jo,[x("table",{class:H(["w-full my-8 text-sm table-fixed table-node",{"table-node--loading":l.value}]),"aria-busy":l.value},[x("colgroup",null,[(f(!0),p(k,null,b(o.value,(e,t)=>(f(),p("col",{key:`col-${t}`,style:N({width:e})},null,4))),128))]),x("thead",el,[x("tr",tl,[(f(!0),p(k,null,b(e.node.header.cells,(o,l)=>(f(),p("th",{key:`header-${l}`,dir:"auto",class:H(["font-semibold p-[calc(4/7*1em)] overflow-x-auto",["right"===o.align?"text-right":"center"===o.align?"text-center":"text-left"]])},[w(y(dl),{nodes:o.children,"index-key":`table-th-${e.indexKey}`,typewriter:t.typewriter,onCopy:i[0]||(i[0]=e=>n.$emit("copy",e))},null,8,["nodes","index-key","typewriter"])],2))),128))])]),x("tbody",null,[(f(!0),p(k,null,b(r.value,(o,l)=>(f(),p("tr",{key:`row-${l}`,class:H(["border-[var(--table-border,#cbd5e1)]",[l<r.value.length-1?"border-b":""]])},[(f(!0),p(k,null,b(o.cells,(o,r)=>(f(),p("td",{key:`cell-${l}-${r}`,class:H(["p-[calc(4/7*1em)] overflow-x-auto",["right"===o.align?"text-right":"center"===o.align?"text-center":"text-left"]]),dir:"auto"},[w(y(dl),{nodes:o.children,"index-key":`table-td-${e.indexKey}`,typewriter:t.typewriter,onCopy:i[1]||(i[1]=e=>n.$emit("copy",e))},null,8,["nodes","index-key","typewriter"])],2))),128))],2))),128))])],10,Qo),w(I,{name:"table-node-fade"},{default:j(()=>[l.value?(f(),p("div",nl,[O(n.$slots,"loading",{isLoading:l.value},()=>[i[2]||(i[2]=x("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),i[3]||(i[3]=x("span",{class:"sr-only"},"Loading",-1))],!0)])):V("",!0)]),_:3})]))}}),[["__scopeId","data-v-50ef14ca"]]);ol.install=e=>{e.component(ol.__name,ol)};const ll={class:"hr-node"},rl=/* @__PURE__ */oe({},[["render",function(e,t){return f(),p("hr",ll)}],["__scopeId","data-v-639cbad9"]]);rl.install=e=>{e.component(rl.__name,rl)};const il={key:1,class:"html-block-node__placeholder"},al=/* @__PURE__ */oe(/* @__PURE__ */m({__name:"HtmlBlockNode",props:{node:{}},setup(e){const t=e,n=_(()=>{const e=t.node.attrs;if(e){if(Array.isArray(e)){const t={};for(const n of e){if(!n||n.length<2)continue;const[e,o]=n;null!=e&&(t[String(e)]=null==o?"":String(o))}return t}return e}}),o=B(null),l=B("undefined"==typeof window),r=B(t.node.content),i=dn(),a=B(null),s=!!t.node.loading;return"undefined"!=typeof window?(C(o,e=>{var n,o;if(null==(o=null==(n=a.value)?void 0:n.destroy)||o.call(n),a.value=null,!s)return l.value=!0,void(r.value=t.node.content);if(!e)return void(l.value=!1);const c=i(e,{rootMargin:"400px"});a.value=c,l.value=c.isVisible.value,c.whenVisible.then(()=>{l.value=!0})},{immediate:!0}),C(()=>t.node.content,e=>{s&&!l.value||(r.value=e)})):l.value=!0,L(()=>{var e,t;null==(t=null==(e=a.value)?void 0:e.destroy)||t.call(e),a.value=null}),(t,i)=>(f(),p("div",q({ref_key:"htmlRef",ref:o,class:"html-block-node"},n.value),[l.value?g([r.value],()=>(f(),p("div",{key:0,innerHTML:r.value},null,8,["innerHTML"])),i,0):(f(),p("div",il,[O(t.$slots,"placeholder",{node:e.node},()=>[i[1]||(i[1]=x("span",{class:"html-block-node__placeholder-bar"},null,-1)),i[2]||(i[2]=x("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),i[3]||(i[3]=x("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))],16))}}),[["__scopeId","data-v-ed22b926"]]),sl={class:"unknown-node"},cl=/* @__PURE__ */m({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(f(),p("div",sl,M(e.node.raw),1))}),ul=["data-node-index","data-node-type"],dl=/* @__PURE__ */oe(/* @__PURE__ */m({__name:"NodeRenderer",props:{content:{},nodes:{},parseOptions:{},customMarkdownIt:{},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:t}){var n,o,l;const r=e,i=t,s=B(),c=B(!1!==r.viewportPriority),v=function(e,t){const n="undefined"!=typeof window&&"undefined"!=typeof document,o="boolean"==typeof t?B(t):t;let l=null;const r=/* @__PURE__ */new WeakMap,i=(t,i)=>{const a=B(!1);let s,c=!1;const u=new Promise(e=>{s=()=>{c||(c=!0,e())}}),d=()=>{try{null==l||l.unobserve(t)}catch(e){}r.delete(t)};if(!n||!o.value)return a.value=!0,s(),{isVisible:a,whenVisible:u,destroy:d};const h=function(){var t;if(l||!n)return l;if("undefined"==typeof IntersectionObserver)return null;const o=null!=(t=e())?t:null;return l=new IntersectionObserver(e=>{for(const n of e){const e=r.get(n.target);if(e&&(n.isIntersecting||n.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(t){}}null==l||l.unobserve(n.target),r.delete(n.target)}}},{root:o,rootMargin:"300px",threshold:0}),l}();return h?(r.set(t,{resolve:s,visible:a}),h.observe(t),{isVisible:a,whenVisible:u,destroy:d}):(a.value=!0,s(),{isVisible:a,whenVisible:u,destroy:d})};return P(un,i),i}(()=>s.value,c),m=d(),g=_(()=>r.customMarkdownIt?r.customMarkdownIt(m):m),w=_(()=>{var e;if(null==(e=r.nodes)?void 0:e.length)return ee(r.nodes.slice());if(r.content){const e=h(r.content,g.value,r.parseOptions);return ee(e)}return[]}),y="undefined"!=typeof window,x=y&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):null,M=y&&"function"==typeof window.cancelAnimationFrame?window.cancelAnimationFrame.bind(window):null,T="undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(o=null==(n=globalThis.process)?void 0:n.env)?void 0:o.NODE_ENV),S=y&&"function"==typeof window.requestIdleCallback,E=_(()=>{var e;const t=Math.trunc(null!=(e=r.renderBatchSize)?e:80);return Number.isFinite(t)?Math.max(0,t):0}),H=_(()=>{var e;const t=Math.trunc(null!=(e=r.initialRenderBatchSize)?e:E.value);return Number.isFinite(t)?Math.max(0,t):E.value}),R=_(()=>!1!==r.batchRendering&&E.value>0&&y&&!T),z=B(0),A=B({key:r.indexKey,total:0}),D=B({batchSize:E.value,initial:H.value,delay:null!=(l=r.renderBatchDelay)?l:16,enabled:R.value}),O=F([]),W=B(Math.max(1,E.value||1)),Y=te({}),Z=/* @__PURE__ */new Map,U=/* @__PURE__ */new Map,G=_(()=>!1!==r.deferNodesUntilVisible&&!1!==c.value),J=_(()=>{var e;return(null!=(e=r.maxLiveNodes)?e:0)>0}),Q=_(()=>!!v&&(G.value||J.value)),ne=_(()=>{var e;return Math.max(1,null!=(e=r.maxLiveNodes)?e:320)}),oe=_(()=>{var e;return Math.max(0,null!=(e=r.liveNodeBuffer)?e:60)}),re=B(0),ie=te({start:0,end:0}),se=/* @__PURE__ */new Map,ce=_(()=>{if(!J.value)return w.value.length;const e=oe.value,t=Math.max(ie.end+e,H.value),n=Math.min(w.value.length,t);return Math.max(z.value,n)});function ue(e,t,n){return Math.min(Math.max(e,t),n)}const he=te({}),me=te({total:0,count:0}),pe=_(()=>me.count>0?Math.max(12,me.total/me.count):32);function fe(e,t){var n;if(e>=t)return 0;let o=0;for(let l=e;l<t;l++)o+=null!=(n=he[l])?n:pe.value;return o}const we=_(()=>{if(!J.value)return w.value.map((e,t)=>({node:e,index:t}));const e=w.value.length,t=ue(ie.start,0,e),n=ue(ie.end,t,e);return w.value.slice(t,n).map((e,n)=>({node:e,index:t+n}))}),ye=_(()=>J.value?fe(0,Math.min(ie.start,w.value.length)):0),xe=_(()=>{if(!J.value)return 0;const e=w.value.length;return fe(Math.min(ie.end,e),e)});function ke(){const e=w.value.length,t=Math.min(e,z.value);return t<=0?(O.value=[],void Me(0)):t>=e?(O.value=w.value,void Me(t)):(O.value=w.value.slice(0,t),void Me(t))}function Me(e){if(Z.size)for(const[t,n]of Z)t>=e&&(n.destroy(),Z.delete(t),G.value&&delete Y[t],U.delete(t))}function Be(e,t){G.value&&(Y[e]=t),t&&(re.value=ue(e,0,Math.max(0,w.value.length-1)))}function Ce(e){const t=Z.get(e);t&&(t.destroy(),Z.delete(e))}function Te(e,t){if(t?U.set(e,t):U.delete(e),!Q.value||!v)return Ce(e),void(t?Be(e,!0):G.value&&delete Y[e]);if(e<H.value&&!J.value)return Ce(e),void Be(e,!0);if(!t)return Ce(e),void(G.value&&delete Y[e]);Ce(e);const n=v(t,{rootMargin:"400px"});n&&(Z.set(e,n),Be(e,n.isVisible.value),n.whenVisible.then(()=>{Be(e,!0)}).catch(()=>{}))}let Le=null,$e=null,Se=!1,Ie=null,je=null;function Ee(){y&&(null!=Le&&(null==M||M(Le),Le=null),null!=$e&&(window.clearTimeout($e),$e=null),null!=je&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback(je),je=null),Se=!1,Ie=null)}function He(e,t={}){var n,o;if(!R.value)return;const l=ce.value;if(z.value>=l)return;const i=Math.max(1,e),a=e=>{var t;Le=null,$e=null,je=null,Se=!1;const n=null!=Ie?Ie:i;Ie=null;const o=Math.max(2,null!=(t=r.renderBatchBudgetMs)?t:6),a=e=>{const t="undefined"!=typeof performance?performance.now():Date.now();z.value=Math.min(l,z.value+Math.max(1,e)),ke();const n=("undefined"!=typeof performance?performance.now():Date.now())-t;return function(e){var t;if(!R.value)return;const n=Math.max(2,null!=(t=r.renderBatchBudgetMs)?t:6),o=Math.max(1,E.value||1),l=Math.max(1,Math.floor(o/4));e>1.2*n?W.value=Math.max(l,Math.floor(.7*W.value)):e<.5*n&&W.value<o&&(W.value=Math.min(o,Math.ceil(1.2*W.value)))}(n),n};let s=n;for(;(a(s),!(z.value>=l)&&e)&&!(("function"==typeof e.timeRemaining?e.timeRemaining():0)<=.5*o);)s=Math.max(1,Math.round(W.value));z.value<l&&Ne()};if(!y||t.immediate)return void a();const s=Math.max(0,null!=(n=r.renderBatchDelay)?n:16);if(Ie=null!=Ie?Math.max(Ie,i):i,!Se){if(Se=!0,!T&&S&&window.requestIdleCallback){const e=Math.max(0,null!=(o=r.renderBatchIdleTimeoutMs)?o:120);return void(je=window.requestIdleCallback(e=>{a(e)},{timeout:e}))}x&&!T?Le=x(()=>{0!==s?$e=window.setTimeout(()=>a(),s):a()}):$e=window.setTimeout(()=>a(),s)}}function Ne(){He(R.value?Math.max(1,Math.round(W.value)):Math.max(1,E.value))}C([()=>w.value,()=>w.value.length,()=>R.value,()=>E.value,()=>H.value,()=>r.renderBatchDelay,()=>r.indexKey],()=>{var e;const t=w.value.length,n=A.value,o=r.indexKey,l=void 0!==o?o!==n.key:t!==n.total;A.value={key:o,total:t};const i=D.value,a=null!=(e=r.renderBatchDelay)?e:16,s=i.batchSize!==E.value||i.initial!==H.value||i.delay!==a||i.enabled!==R.value;D.value={batchSize:E.value,initial:H.value,delay:a,enabled:R.value},(l||s||!R.value)&&Ee(),(l||s)&&(W.value=Math.max(1,E.value||1));const c=ce.value;if(!t)return z.value=0,void ke();if(!R.value)return z.value=c,void ke();z.value=l||s?Math.min(c,H.value):Math.min(z.value,c);const u=Math.max(1,H.value||E.value||t);z.value<c?He(u,{immediate:!y}):ke()},{immediate:!0}),C(()=>G.value,e=>{if(e)for(const[t,n]of U)Te(t,n);else{for(const e of Z.values())e.destroy();Z.clear();for(const e of Object.keys(Y))delete Y[e];for(const[e,t]of U)t&&Be(e,!0)}},{immediate:!1}),C(()=>z.value,(e,t)=>{J.value&&("number"==typeof t&&e<=t||e>0&&(re.value=e-1))}),C([re,ne,oe,()=>w.value.length,J],()=>{!function(){const e=w.value.length;if(!J.value||0===e)return ie.start=0,void(ie.end=e);const t=Math.min(ne.value,e),n=oe.value,o=ue(re.value-n,0,Math.max(0,e-t));ie.start=o,ie.end=Math.min(e,o+t)}()},{immediate:!0}),C(()=>ce.value,(e,t)=>{R.value&&("number"==typeof t&&e<=t||e>z.value&&Ne())}),L(()=>{Ee();for(const e of Z.values())e.destroy();Z.clear()});const Re=K(()=>u(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),Go}})),ze=_(()=>r.renderCodeBlocksAsPre?Go:Re),Ae={text:Cn,paragraph:qo,heading:io,code_block:Re,list:so,blockquote:le,table:ol,definition_list:de,footnote:no,footnote_reference:be,footnote_anchor:Qn,admonition:wl,hardbreak:lo,link:Kn,image:yn,thematic_break:rl,math_inline:Tn,math_block:Ln,strong:zn,emphasis:Gn,strikethrough:Dn,highlight:Zn,insert:Yn,subscript:Nn,superscript:jn,emoji:ve,checkbox:ae,checkbox_input:ae,inline_code:_e,reference:$n,html_block:al};function De(e){var t;if(!e)return cl;const n=ge(r.customId)[String(e.type)];if(n)return n;if("code_block"===e.type){if("mermaid"===String(null!=(t=e.language)?t:"").trim().toLowerCase())return ge(r.customId).mermaid||Xo;return ge(r.customId).code_block||ze.value}return Ae[String(e.type)]||cl}function Pe(e){var t;return"code_block"===(null==e?void 0:e.type)&&"mermaid"===String(null!=(t=e.language)?t:"").trim().toLowerCase()?{}:"code_block"===e.type?a({stream:r.codeBlockStream,darkTheme:r.codeBlockDarkTheme,lightTheme:r.codeBlockLightTheme,monacoOptions:r.codeBlockMonacoOptions,themes:r.themes,minWidth:r.codeBlockMinWidth,maxWidth:r.codeBlockMaxWidth},r.codeBlockProps||{}):{typewriter:r.typewriter}}function Ve(e){i("click",e)}function Oe(e){var t;(null==(t=e.target)?void 0:t.closest("[data-node-index]"))&&i("mouseover",e)}function Fe(e){var t;(null==(t=e.target)?void 0:t.closest("[data-node-index]"))&&i("mouseout",e)}return(t,n)=>(f(),p("div",{ref_key:"containerRef",ref:s,class:"markdown-renderer",onClick:Ve,onMouseover:Oe,onMouseout:Fe},[J.value?(f(),p("div",{key:0,class:"node-spacer",style:N({height:`${ye.value}px`}),"aria-hidden":"true"},null,4)):V("",!0),(f(!0),p(k,null,b(we.value,t=>{var o,l;return f(),p("div",{key:t.index,ref_for:!0,ref:e=>Te(t.index,e),class:"node-slot","data-node-index":t.index,"data-node-type":t.node.type},[(l=t.index,!G.value||l<H.value||!0===Y[l]?(f(),p("div",{key:0,ref_for:!0,ref:e=>function(e,t){t?(se.set(e,t),queueMicrotask(()=>{!function(e,t){if(!Number.isFinite(t)||t<=0)return;const n=he[e];he[e]=t,n?me.total+=t-n:(me.total+=t,me.count++)}(e,t.offsetHeight)})):se.delete(e)}(t.index,e),class:"node-content"},["code_block"!==t.node.type&&!1!==r.typewriter?(f(),$(I,{key:0,name:"typewriter",appear:""},{default:j(()=>[(f(),$(X(De(t.node)),q({node:t.node,loading:t.node.loading,"index-key":`${e.indexKey||"markdown-renderer"}-${t.index}`},{ref_for:!0},Pe(t.node),{"custom-id":r.customId,"is-dark":r.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)):(f(),$(X(De(t.node)),q({key:1,node:t.node,loading:t.node.loading,"index-key":`${e.indexKey||"markdown-renderer"}-${t.index}`},{ref_for:!0},Pe(t.node),{"custom-id":r.customId,"is-dark":r.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"]))],512)):(f(),p("div",{key:1,class:"node-placeholder",style:N({height:`${null!=(o=he[t.index])?o:pe.value}px`})},null,4)))],8,ul)}),128)),J.value?(f(),p("div",{key:1,class:"node-spacer",style:N({height:`${xe.value}px`}),"aria-hidden":"true"},null,4)):V("",!0)],544))}}),[["__scopeId","data-v-67bd5de6"]]);dl.install=e=>{var t,n;const o=null!=(n=null!=(t=dl.__name)?t:dl.name)?n:"NodeRenderer";e.component(o,dl)};const hl={key:0,class:"admonition-icon"},vl={class:"admonition-title"},ml=["aria-expanded","aria-controls","title"],pl={key:0},fl={key:1},gl=["id"],wl=/* @__PURE__ */oe(/* @__PURE__ */m({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean}},emits:["copy"],setup(e,{emit:t}){var n;const o=e,l=t,r={note:"ℹ️",info:"ℹ️",tip:"💡",warning:"⚠️",danger:"❗",error:"⛔",caution:"⚠️"},i=_(()=>{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=B(!!o.node.collapsible&&!(null==(n=o.node.open)||n));function s(){o.node.collapsible&&(a.value=!a.value)}const c=`admonition-${Math.random().toString(36).slice(2,9)}`;return(t,n)=>(f(),p("div",{class:H(["admonition",[`admonition-${o.node.kind}`,o.isDark?"is-dark":""]])},[x("div",{id:c,class:"admonition-header"},[r[o.node.kind]?(f(),p("span",hl,M(r[o.node.kind]),1)):V("",!0),x("span",vl,M(i.value),1),o.node.collapsible?(f(),p("button",{key:1,class:"admonition-toggle","aria-expanded":!a.value,"aria-controls":`${c}-content`,title:a.value?"Expand":"Collapse",onClick:s},[a.value?(f(),p("span",pl,"▶")):(f(),p("span",fl,"▼"))],8,ml)):V("",!0)]),E(x("div",{id:`${c}-content`,class:"admonition-content","aria-labelledby":c},[g([o.node.children],()=>w(y(dl),{"index-key":`admonition-${e.indexKey}`,nodes:o.node.children,typewriter:o.typewriter,onCopy:n[0]||(n[0]=e=>l("copy",e))},null,8,["index-key","nodes","typewriter"]),n,1)],8,gl),[[R,!a.value]])],2))}}),[["__scopeId","data-v-578c25d2"]]);wl.install=e=>{e.component(wl.__name,wl)};let yl=!1,xl=null,kl=!1;function bl(){return u(this,null,function*(){if(xl)return xl;if(kl)return null;try{return xl=yield import("stream-monaco"),yield function(e){return u(this,null,function*(){if(!yl)return yl=!0,e.preloadMonacoWorkers()})}(xl),xl}catch(e){return kl=!0,null}})}let Ml=null;function _l(e){Ml=null!=e?e:null}function Bl(e){if(Ml){const t=Ml(e);if(null!=t&&""!==t)return t}switch(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":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 Cl={js:"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","":"Plain Text",plain:"Plain Text"},Tl={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)"}},Ll={class:"flex items-center space-x-2"},$l=["innerHTML"],Sl={class:"text-sm font-medium font-mono"},Il={class:"flex items-center space-x-2"},jl=["aria-pressed"],El=["disabled"],Hl=["disabled"],Nl=["disabled"],Rl=["aria-label"],zl={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"},Al={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"},Dl=["aria-pressed"],Pl={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"},Vl={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"},Ol=["aria-label"],Fl={class:"code-loading-placeholder"},Wl=/* @__PURE__ */oe(/* @__PURE__ */m({__name:"MarkdownCodeBlockNode",props:{node:{},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{default:void 0},lightTheme:{default:void 0},isDark:{type:Boolean},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:t}){var n;const o=e,l=t,{t:r}=cn(),i=B(String(null!=(n=o.node.language)?n:"")),a=B(!1),s=B(!1),c=B(!1),d=B(null),h=B(!0),v=B(0),m=B(14),g=B(m.value),w=_(()=>{const e=m.value,t=g.value;return"number"==typeof e&&Number.isFinite(e)&&e>0&&"number"==typeof t&&Number.isFinite(t)&&t>0}),b=_(()=>{const e=i.value.trim().toLowerCase();return Cl[e]||e.charAt(0).toUpperCase()+e.slice(1)}),L=_(()=>"mermaid"===i.value.trim().toLowerCase()),S=_(()=>Bl(i.value.trim().toLowerCase().split(":")[0])),I=_(()=>{const e=i.value.trim().toLowerCase();return o.isShowPreview&&("html"===e||"svg"===e)}),j=_(()=>{const e={},t=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},n=t(o.minWidth),l=t(o.maxWidth);return n&&(e.minWidth=n),l&&(e.maxWidth=l),e}),z=_(()=>({fontSize:`${g.value}px`}));function A(){return o.isDark?o.darkTheme:o.lightTheme}let D,P,F,W=()=>{};function K(){return u(this,null,function*(){if(L.value)return W(),void(null==D||D.dispose());!function(){u(this,null,function*(){if(!P)try{const e=yield import("stream-markdown");if(P=e.createShikiStreamRenderer,F=e.registerHighlight,W=e.disposeHighlighter,F({themes:o.themes}),D=P(d.value,{theme:A()}),!o.loading){const e=i.value.split(":")[0].toLocaleLowerCase().trim();D.updateCode(o.node.code,e)}}catch(e){console.warn("[MarkdownCodeBlockNode] stream-markdown not available:",e)}})}()})}K(),U(()=>{K()}),C(()=>o.themes,()=>u(null,null,function*(){F&&F({themes:o.themes})})),C(()=>[o.node.code,o.node.language],e=>u(null,[e],function*([e,t]){if(t!==i.value&&(i.value=t.trim()),d.value){if(L.value)return W(),void(null==D||D.dispose());D||(yield K()),D&&e&&(!1===o.stream&&o.loading||(t=t.split(":")[0].toLocaleLowerCase().trim(),D.updateCode(e,t)))}}));const X=C(()=>[o.darkTheme,o.lightTheme],()=>u(null,null,function*(){if(d.value){if(L.value)return W(),null==D||D.dispose(),X();D||(yield K()),null==D||D.setTheme(A())}}));function Y(){const e=d.value;if(!e||s.value)return;const t=e.scrollTop;t<v.value?h.value=!1:function(e,t=50){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}(e)&&(h.value=!0),v.value=t}function q(){return u(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(o.node.code)),a.value=!0,l("copy",o.node.code),setTimeout(()=>{a.value=!1},1e3)}catch(e){console.error("Copy failed:",e)}})}function Z(e){return!e||e.disabled}function G(e,t,n="top"){if(Z(e.currentTarget))return;const l=e,r=null!=(null==l?void 0:l.clientX)&&null!=(null==l?void 0:l.clientY)?{x:l.clientX,y:l.clientY}:void 0;ln(e.currentTarget,t,n,!1,r,o.isDark)}function J(){rn()}function Q(e){if(Z(e.currentTarget))return;const t=a.value?r("common.copied")||"Copied":r("common.copy")||"Copy",n=e,l=null!=(null==n?void 0:n.clientX)&&null!=(null==n?void 0:n.clientY)?{x:n.clientX,y:n.clientY}:void 0;ln(e.currentTarget,t,"top",!1,l,o.isDark)}function ee(){s.value=!s.value;const e=d.value;e&&(s.value?(e.style.maxHeight="none",e.style.overflow="visible"):(e.style.maxHeight="500px",e.style.overflow="auto",h.value=!0,T(()=>{e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})))}function te(){c.value=!c.value}function ne(){if(!I.value)return;const e=(i.value||o.node.language).toLowerCase(),t="html"===e?"HTML Preview":"SVG Preview";l("previewCode",{type:"html"===e?"text/html":"image/svg+xml",content:o.node.code,title:t})}return C(()=>o.node.code,()=>u(null,null,function*(){if(s.value||!h.value)return;yield T();const e=d.value;e&&e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})),(t,n)=>L.value?(f(),$(y(Xo),{key:0,node:e.node,"is-dark":o.isDark,loading:o.loading},null,8,["node","is-dark","loading"])):(f(),p("div",{key:1,style:N(j.value),class:H(["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?(f(),p("div",Tl,[O(t.$slots,"header-left",{},()=>[x("div",Ll,[x("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:S.value},null,8,$l),x("span",Sl,M(b.value),1)])],!0),O(t.$slots,"header-right",{},()=>[x("div",Il,[x("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:te,onMouseenter:n[0]||(n[0]=e=>G(e,c.value?y(r)("common.expand")||"Expand":y(r)("common.collapse")||"Collapse")),onFocus:n[1]||(n[1]=e=>G(e,c.value?y(r)("common.expand")||"Expand":y(r)("common.collapse")||"Collapse")),onMouseleave:J,onBlur:J},[(f(),p("svg",{style:N({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"},[...n[17]||(n[17]=[x("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,jl),o.showFontSizeButtons&&o.enableFontSizeControl?(f(),p(k,{key:0},[x("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!!Number.isFinite(g.value)&&g.value<=10,onClick:n[2]||(n[2]=e=>function(){const e=Math.max(10,g.value-1);g.value=e}()),onMouseenter:n[3]||(n[3]=e=>G(e,y(r)("common.decrease")||"Decrease")),onFocus:n[4]||(n[4]=e=>G(e,y(r)("common.decrease")||"Decrease")),onMouseleave:J,onBlur:J},[...n[18]||(n[18]=[x("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"},[x("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)])],40,El),x("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!w.value||g.value===m.value,onClick:n[5]||(n[5]=e=>{g.value=m.value}),onMouseenter:n[6]||(n[6]=e=>G(e,y(r)("common.reset")||"Reset")),onFocus:n[7]||(n[7]=e=>G(e,y(r)("common.reset")||"Reset")),onMouseleave:J,onBlur:J},[...n[19]||(n[19]=[x("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"},[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),x("path",{d:"M3 3v5h5"})])],-1)])],40,Hl),x("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!!Number.isFinite(g.value)&&g.value>=36,onClick:n[8]||(n[8]=e=>function(){const e=Math.min(36,g.value+1);g.value=e}()),onMouseenter:n[9]||(n[9]=e=>G(e,y(r)("common.increase")||"Increase")),onFocus:n[10]||(n[10]=e=>G(e,y(r)("common.increase")||"Increase")),onMouseleave:J,onBlur:J},[...n[20]||(n[20]=[x("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"},[x("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)])],40,Nl)],64)):V("",!0),o.showCopyButton?(f(),p("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(r)("common.copied")||"Copied":y(r)("common.copy")||"Copy",onClick:q,onMouseenter:n[11]||(n[11]=e=>Q(e)),onFocus:n[12]||(n[12]=e=>Q(e)),onMouseleave:J,onBlur:J},[a.value?(f(),p("svg",Al,[...n[22]||(n[22]=[x("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(f(),p("svg",zl,[...n[21]||(n[21]=[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),x("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,Rl)):V("",!0),o.showExpandButton?(f(),p("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:ee,onMouseenter:n[13]||(n[13]=e=>G(e,s.value?y(r)("common.collapse")||"Collapse":y(r)("common.expand")||"Expand")),onFocus:n[14]||(n[14]=e=>G(e,s.value?y(r)("common.collapse")||"Collapse":y(r)("common.expand")||"Expand")),onMouseleave:J,onBlur:J},[s.value?(f(),p("svg",Pl,[...n[23]||(n[23]=[x("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)])])):(f(),p("svg",Vl,[...n[24]||(n[24]=[x("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,Dl)):V("",!0),I.value&&o.showPreviewButton?(f(),p("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(r)("common.preview")||"Preview",onClick:ne,onMouseenter:n[15]||(n[15]=e=>G(e,y(r)("common.preview")||"Preview")),onFocus:n[16]||(n[16]=e=>G(e,y(r)("common.preview")||"Preview")),onMouseleave:J,onBlur:J},[...n[25]||(n[25]=[x("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"},[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("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"}),x("circle",{cx:"12",cy:"12",r:"3"})])],-1)])],40,Ol)):V("",!0)])],!0)])):V("",!0),E(x("div",{ref_key:"codeBlockContent",ref:d,class:"code-block-content",style:N(z.value),onScroll:Y},null,36),[[R,!(c.value||!e.stream&&e.loading)]]),E(x("div",Fl,[O(t.$slots,"loading",{loading:e.loading,stream:e.stream},()=>[n[26]||(n[26]=x("div",{class:"loading-skeleton"},[x("div",{class:"skeleton-line"}),x("div",{class:"skeleton-line"}),x("div",{class:"skeleton-line short"})],-1))],!0)],512),[[R,!e.stream&&e.loading]])],6))}}),[["__scopeId","data-v-9201c1b9"]]);Wl.install=e=>{e.component(Wl.__name,Wl)};let Kl=null,Xl=null,Yl=!1;const ql=/* @__PURE__ */new Map,Zl=/* @__PURE__ */new Map;let Ul=5;const Gl=/* @__PURE__ */new Set;function Jl(){if(ql.size<Ul&&Gl.size){const t=Array.from(Gl);Gl.clear();for(const n of t)try{n()}catch(e){}}}function Ql(e){Kl=e,Xl=null,Kl.onmessage=e=>{const{id:t,html:n,error:o}=e.data,l=ql.get(t);if(l)if(ql.delete(t),clearTimeout(l.timeoutId),Jl(),o)l.reject(new Error(o));else{const{content:t,displayMode:o}=e.data;if(t){const e=`${o?"d":"i"}:${t}`;if(Zl.set(e,n),Zl.size>200){const e=Zl.keys().next().value;Zl.delete(e)}}l.resolve(n)}},Kl.onerror=e=>{console.error("[katexWorkerClient] Worker error:",e);for(const[t,n]of ql.entries())clearTimeout(n.timeoutId),n.reject(new Error(`Worker error: ${e.message}`));ql.clear(),Jl()}}function er(){var e;Kl&&(null==(e=Kl.terminate)||e.call(Kl)),Kl=null,Xl=null}function tr(e){Yl=!!e,Kl&&Kl.postMessage({type:"init",debug:Yl})}function nr(e,t=!0,n=2e3,o){return u(this,null,function*(){if(performance.now(),Xl)return Promise.reject(Xl);const l=`${t?"d":"i"}:${e}`,r=Zl.get(l);if(r)return Promise.resolve(r);const i=Kl||(Xl=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Xl.name="WorkerInitError",Xl.code="WORKER_INIT_ERROR",null);if(!i)return Promise.reject(Xl);if(ql.size>=Ul){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code="WORKER_BUSY",e.busy=!0,e.inFlight=ql.size,e.max=Ul,Promise.reject(e)}return new Promise((l,r)=>{if(null==o?void 0:o.aborted){const e=new Error("Aborted");return e.name="AbortError",void r(e)}const a=Math.random().toString(36).slice(2),s=globalThis.setTimeout(()=>{ql.delete(a);const e=new Error("Worker render timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT",r(e),Jl()},n);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(s),ql.has(a)&&ql.delete(a);const e=new Error("Aborted");e.name="AbortError",r(e),Jl()},{once:!0});const c=l,u=r;ql.set(a,{resolve:e=>{c(e)},reject:e=>{u(e)},timeoutId:s}),i.postMessage({id:a,content:e,displayMode:t})})})}function or(e,t=!0,n){const o=`${t?"d":"i"}:${e}`;if(Zl.set(o,n),Zl.size>200){const e=Zl.keys().next().value;Zl.delete(e)}}function lr(){return{inFlight:ql.size,max:Ul}}function rr(e){Number.isFinite(e)&&e>0&&(Ul=Math.floor(e))}const ir="WORKER_BUSY";function ar(){return ql.size>=Ul}function sr(e=2e3,t){return ql.size<Ul?Promise.resolve():new Promise((n,o)=>{let l,r=!1;const i=()=>{r||(r=!0,l&&globalThis.clearTimeout(l),Gl.delete(i),n())};if(Gl.add(i),l=globalThis.setTimeout(()=>{if(r)return;r=!0,Gl.delete(i);const e=new Error("Wait for worker slot timed out");e.name="WorkerBusyTimeout",e.code="WORKER_BUSY_TIMEOUT",o(e)},e),queueMicrotask(()=>Jl()),t){const e=()=>{if(r)return;r=!0,l&&globalThis.clearTimeout(l),Gl.delete(i);const e=new Error("Aborted");e.name="AbortError",o(e)};t.aborted?e():t.addEventListener("abort",e,{once:!0})}})}const cr={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function ur(e){null!=e.timeout&&(cr.timeout=Math.max(0,Math.floor(e.timeout))),null!=e.waitTimeout&&(cr.waitTimeout=Math.max(0,Math.floor(e.waitTimeout))),null!=e.backoffMs&&(cr.backoffMs=Math.max(0,Math.floor(e.backoffMs))),null!=e.maxRetries&&(cr.maxRetries=Math.max(0,Math.floor(e.maxRetries)))}function dr(){return a({},cr)}function hr(e){return u(this,arguments,function*(e,t=!0,n={}){var o,l,r,i;const a=null!=(o=n.timeout)?o:cr.timeout,s=null!=(l=n.waitTimeout)?l:cr.waitTimeout,c=null!=(r=n.backoffMs)?r:cr.backoffMs,u=null!=(i=n.maxRetries)?i:cr.maxRetries,d=n.signal;let h=0;for(;;){if(null==d?void 0:d.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}try{return yield nr(e,t,a,d)}catch(v){if((null==v?void 0:v.code)!==ir||h>=u)throw v;if(h++,yield sr(s,d).catch(()=>{}),null==d?void 0:d.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}c>0&&(yield new Promise(e=>globalThis.setTimeout(e,c*h)))}}})}const vr=K(()=>import("./index4.js")),mr=K(()=>import("./index3.js")),pr=K(()=>import("./index2.js")),fr={AdmonitionNode:wl,BlockquoteNode:le,CheckboxNode:ae,CodeBlockNode:vr,DefinitionListNode:de,EmojiNode:ve,FootnoteNode:no,FootnoteReferenceNode:be,FootnoteAnchorNode:Qn,HardBreakNode:lo,HeadingNode:io,HighlightNode:Zn,ImageNode:yn,InlineCodeNode:_e,PreCodeNode:Go,InsertNode:Yn,LinkNode:Kn,ListItemNode:ao,ListNode:so,MathBlockNode:mr,MathInlineNode:pr,MermaidBlockNode:Xo,ParagraphNode:qo,StrikethroughNode:Dn,StrongNode:zn,SubscriptNode:Nn,SuperscriptNode:jn,TableNode:ol,TextNode:Cn,ThematicBreakNode:rl,ReferenceNode:$n,MarkdownCodeBlockNode:Wl},gr={install(e,t){Object.entries(fr).forEach(([t,n])=>{e.component(t,n)}),(null==t?void 0:t.getLanguageIcon)&&_l(t.getLanguageIcon),(null==t?void 0:t.mathOptions)&&v(t.mathOptions)}};export{Ql as $,wl as A,le as B,ae as C,de as D,ve as E,Qn as F,$n as G,lo as H,yn as I,we as J,fe as K,Kn as L,Wl as M,dl as N,sn as O,qo as P,zn as Q,Nn as R,Dn as S,jn as T,ol as U,Cn as V,ir as W,rl as X,gr as Y,_l as Z,Go as _,dn as a,er as a0,tr as a1,nr as a2,lr as a3,rr as a4,ar as a5,sr as a6,ur as a7,dr as a8,fo as a9,go as aa,wo as ab,yo as ac,xo as ad,ko as ae,Mo as af,_o as ag,Bo as ah,Bl as b,ln as c,oe as d,bn as e,or as f,bl as g,rn as h,ye as i,vr as j,no as k,Cl as l,be as m,ge as n,io as o,Zn as p,_e as q,hr as r,co as s,Yn as t,cn as u,ao as v,so as w,mr as x,pr as y,Xo as z};
|
|
1
|
+
var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,i=(t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,a=(e,t)=>{for(var n in t||(t={}))r.call(t,n)&&i(e,n,t[n]);if(o)for(var n of o(t))l.call(t,n)&&i(e,n,t[n]);return e},s=(e,o)=>t(e,n(o)),c=(e,t)=>{var n={};for(var i in e)r.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&o)for(var i of o(e))t.indexOf(i)<0&&l.call(e,i)&&(n[i]=e[i]);return n},u=(e,t,n)=>new Promise((o,r)=>{var l=e=>{try{a(n.next(e))}catch(t){r(t)}},i=e=>{try{a(n.throw(e))}catch(t){r(t)}},a=e=>e.done?o(e.value):Promise.resolve(e.value).then(l,i);a((n=n.apply(e,t)).next())});import{getMarkdown as d,parseMarkdownToStructure as h,setDefaultMathOptions as m}from"stream-markdown-parser";import{defineComponent as v,createElementBlock as p,openBlock as f,withMemo as g,createVNode as w,unref as y,createElementVNode as k,Fragment as x,renderList as b,toDisplayString as M,computed as _,ref as B,watch as C,nextTick as T,onBeforeUnmount as I,createBlock as L,Teleport as $,Transition as S,withCtx as j,withDirectives as E,normalizeClass as H,normalizeStyle as N,vShow as D,createApp as A,h as R,inject as z,provide as P,createCommentVNode as V,renderSlot as O,shallowRef as F,readonly as W,defineAsyncComponent as K,resolveDynamicComponent as X,useAttrs as Y,mergeProps as q,isMemoSame as Z,onMounted as U,onUnmounted as G,withModifiers as J,markRaw as Q,reactive as ee}from"vue";const te=["cite"],ne=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},oe=/* @__PURE__ */ne(/* @__PURE__ */v({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(f(),p("blockquote",{class:"blockquote",dir:"auto",cite:e.node.cite},[g([t.node.children],()=>w(y(Mr),{"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],"custom-id":t.customId,typewriter:t.typewriter,onCopy:o[0]||(o[0]=e=>n.$emit("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"]),o,1)],8,te))}}),[["__scopeId","data-v-eeadc8a3"]]);oe.install=e=>{e.component(oe.__name,oe)};const re={class:"checkbox-node"},le=["checked"],ie=/* @__PURE__ */ne(/* @__PURE__ */v({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(f(),p("span",re,[k("input",{type:"checkbox",checked:e.node.checked,disabled:"",class:"checkbox-input"},null,8,le)]))}),[["__scopeId","data-v-8dc6c46f"]]);ie.install=e=>{e.component(ie.__name,ie)};const ae={class:"definition-list"},se={class:"definition-term"},ce={class:"definition-desc"},ue=/* @__PURE__ */ne(/* @__PURE__ */v({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(e,n)=>(f(),p("dl",ae,[(f(!0),p(x,null,b(t.node.items,(o,r)=>(f(),p(x,{key:r},[k("dt",se,[w(y(Mr),{"index-key":`definition-term-${t.indexKey}-${r}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,onCopy:n[0]||(n[0]=t=>e.$emit("copy",t))},null,8,["index-key","nodes","custom-id","typewriter"])]),k("dd",ce,[w(y(Mr),{"index-key":`definition-desc-${t.indexKey}-${r}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,onCopy:n[1]||(n[1]=t=>e.$emit("copy",t))},null,8,["index-key","nodes","custom-id","typewriter"])])],64))),128))]))}}),[["__scopeId","data-v-f88691d6"]]);ue.install=e=>{e.component(ue.__name,ue)};const de={class:"emoji-node"},he=/* @__PURE__ */ne(/* @__PURE__ */v({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(f(),p("span",de,M(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);he.install=e=>{e.component(he.__name,he)};const me="__global__",ve={};function pe(e,t){"string"==typeof e?ve[e]=t||{}:ve[me]=e||{}}function fe(e){return e?ve[e]||ve[me]||{}:ve[me]||{}}function ge(e){if(e===me)throw new Error("removeCustomComponents: use clearGlobalCustomComponents() to clear the global mapping");delete ve[e]}function we(){delete ve[me]}const ye=["id"],ke=["title"],xe=/* @__PURE__ */ne(/* @__PURE__ */v({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#footnote-${e.node.id}`;function n(){if("undefined"==typeof document)return;const e=document.querySelector(t);e?e.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(o,r)=>(f(),p("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[k("span",{href:t,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={class:"inline text-[85%] px-1 py-0.5 rounded font-mono bg-secondary whitespace-normal break-words max-w-full before:content-[''] after:content-['']"},Me=/* @__PURE__ */v({__name:"InlineCodeNode",props:{node:{}},setup:e=>(t,n)=>(f(),p("code",be,M(e.node.code),1))});Me.install=e=>{e.component(Me.__name,Me)};const _e=Math.min,Be=Math.max,Ce=Math.round,Te=Math.floor,Ie=e=>({x:e,y:e}),Le={left:"right",right:"left",bottom:"top",top:"bottom"},$e={start:"end",end:"start"};function Se(e,t,n){return Be(e,_e(t,n))}function je(e,t){return"function"==typeof e?e(t):e}function Ee(e){return e.split("-")[0]}function He(e){return e.split("-")[1]}function Ne(e){return"x"===e?"y":"x"}function De(e){return"y"===e?"height":"width"}const Ae=/* @__PURE__ */new Set(["top","bottom"]);function Re(e){return Ae.has(Ee(e))?"y":"x"}function ze(e){return Ne(Re(e))}function Pe(e){return e.replace(/start|end/g,e=>$e[e])}const Ve=["left","right"],Oe=["right","left"],Fe=["top","bottom"],We=["bottom","top"];function Ke(e){return e.replace(/left|right|bottom|top/g,e=>Le[e])}function Xe(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Ye(e,t,n){let{reference:o,floating:r}=e;const l=Re(t),i=ze(t),a=De(i),s=Ee(t),c="y"===l,u=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,h=o[a]/2-r[a]/2;let m;switch(s){case"top":m={x:u,y:o.y-r.height};break;case"bottom":m={x:u,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:d};break;case"left":m={x:o.x-r.width,y:d};break;default:m={x:o.x,y:o.y}}switch(He(t)){case"start":m[i]-=h*(n&&c?-1:1);break;case"end":m[i]+=h*(n&&c?-1:1)}return m}function qe(e,t){return u(this,null,function*(){var n;void 0===t&&(t={});const{x:o,y:r,platform:l,rects:i,elements:s,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:m=!1,padding:v=0}=je(t,e),p=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}}(v),f=s[m?"floating"===h?"reference":"floating":h],g=Xe(yield l.getClippingRect({element:null==(n=yield null==l.isElement?void 0:l.isElement(f))||n?f:f.contextElement||(yield null==l.getDocumentElement?void 0:l.getDocumentElement(s.floating)),boundary:u,rootBoundary:d,strategy:c})),w="floating"===h?{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=Xe(l.convertOffsetParentRelativeRectToViewportRelativeRect?yield l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:y,strategy:c}):w);return{top:(g.top-x.top+p.top)/k.y,bottom:(x.bottom-g.bottom+p.bottom)/k.y,left:(g.left-x.left+p.left)/k.x,right:(x.right-g.right+p.right)/k.x}})}const Ze=/* @__PURE__ */new Set(["left","top"]);function Ue(){return"undefined"!=typeof window}function Ge(e){return et(e)?(e.nodeName||"").toLowerCase():"#document"}function Je(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Qe(e){var t;return null==(t=(et(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function et(e){return!!Ue()&&(e instanceof Node||e instanceof Je(e).Node)}function tt(e){return!!Ue()&&(e instanceof Element||e instanceof Je(e).Element)}function nt(e){return!!Ue()&&(e instanceof HTMLElement||e instanceof Je(e).HTMLElement)}function ot(e){return!(!Ue()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Je(e).ShadowRoot)}const rt=/* @__PURE__ */new Set(["inline","contents"]);function lt(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=gt(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!rt.has(r)}const it=/* @__PURE__ */new Set(["table","td","th"]);function at(e){return it.has(Ge(e))}const st=[":popover-open",":modal"];function ct(e){return st.some(t=>{try{return e.matches(t)}catch(n){return!1}})}const ut=["transform","translate","scale","rotate","perspective"],dt=["transform","translate","scale","rotate","perspective","filter"],ht=["paint","layout","strict","content"];function mt(e){const t=vt(),n=tt(e)?gt(e):e;return ut.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||dt.some(e=>(n.willChange||"").includes(e))||ht.some(e=>(n.contain||"").includes(e))}function vt(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const pt=/* @__PURE__ */new Set(["html","body","#document"]);function ft(e){return pt.has(Ge(e))}function gt(e){return Je(e).getComputedStyle(e)}function wt(e){return tt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function yt(e){if("html"===Ge(e))return e;const t=e.assignedSlot||e.parentNode||ot(e)&&e.host||Qe(e);return ot(t)?t.host:t}function kt(e){const t=yt(e);return ft(t)?e.ownerDocument?e.ownerDocument.body:e.body:nt(t)&<(t)?t:kt(t)}function xt(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=kt(e),l=r===(null==(o=e.ownerDocument)?void 0:o.body),i=Je(r);if(l){const e=bt(i);return t.concat(i,i.visualViewport||[],lt(r)?r:[],e&&n?xt(e):[])}return t.concat(r,xt(r,[],n))}function bt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Mt(e){const t=gt(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=nt(e),l=r?e.offsetWidth:n,i=r?e.offsetHeight:o,a=Ce(n)!==l||Ce(o)!==i;return a&&(n=l,o=i),{width:n,height:o,$:a}}function _t(e){return tt(e)?e:e.contextElement}function Bt(e){const t=_t(e);if(!nt(t))return Ie(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:l}=Mt(t);let i=(l?Ce(n.width):n.width)/o,a=(l?Ce(n.height):n.height)/r;return i&&Number.isFinite(i)||(i=1),a&&Number.isFinite(a)||(a=1),{x:i,y:a}}const Ct=/* @__PURE__ */Ie(0);function Tt(e){const t=Je(e);return vt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Ct}function It(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),l=_t(e);let i=Ie(1);t&&(o?tt(o)&&(i=Bt(o)):i=Bt(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Je(e))&&t}(l,n,o)?Tt(l):Ie(0);let s=(r.left+a.x)/i.x,c=(r.top+a.y)/i.y,u=r.width/i.x,d=r.height/i.y;if(l){const e=Je(l),t=o&&tt(o)?Je(o):o;let n=e,r=bt(n);for(;r&&o&&t!==n;){const e=Bt(r),t=r.getBoundingClientRect(),o=gt(r),l=t.left+(r.clientLeft+parseFloat(o.paddingLeft))*e.x,i=t.top+(r.clientTop+parseFloat(o.paddingTop))*e.y;s*=e.x,c*=e.y,u*=e.x,d*=e.y,s+=l,c+=i,n=Je(r),r=bt(n)}}return Xe({width:u,height:d,x:s,y:c})}function Lt(e,t){const n=wt(e).scrollLeft;return t?t.left+n:It(Qe(e)).left+n}function $t(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Lt(e,n),y:n.top+t.scrollTop}}const St=/* @__PURE__ */new Set(["absolute","fixed"]);function jt(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=Je(e),o=Qe(e),r=n.visualViewport;let l=o.clientWidth,i=o.clientHeight,a=0,s=0;if(r){l=r.width,i=r.height;const e=vt();(!e||e&&"fixed"===t)&&(a=r.offsetLeft,s=r.offsetTop)}const c=Lt(o);if(c<=0){const e=o.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(o.clientWidth-t.clientWidth-r);i<=25&&(l-=i)}else c<=25&&(l+=c);return{width:l,height:i,x:a,y:s}}(e,n);else if("document"===t)o=function(e){const t=Qe(e),n=wt(e),o=e.ownerDocument.body,r=Be(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),l=Be(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Lt(e);const a=-n.scrollTop;return"rtl"===gt(o).direction&&(i+=Be(t.clientWidth,o.clientWidth)-r),{width:r,height:l,x:i,y:a}}(Qe(e));else if(tt(t))o=function(e,t){const n=It(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,l=nt(e)?Bt(e):Ie(1);return{width:e.clientWidth*l.x,height:e.clientHeight*l.y,x:r*l.x,y:o*l.y}}(t,n);else{const n=Tt(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Xe(o)}function Et(e,t){const n=yt(e);return!(n===t||!tt(n)||ft(n))&&("fixed"===gt(n).position||Et(n,t))}function Ht(e,t,n){const o=nt(t),r=Qe(t),l="fixed"===n,i=It(e,!0,l,t);let a={scrollLeft:0,scrollTop:0};const s=Ie(0);function c(){s.x=Lt(r)}if(o||!o&&!l)if(("body"!==Ge(t)||lt(r))&&(a=wt(t)),o){const e=It(t,!0,l,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else r&&c();l&&!o&&r&&c();const u=!r||o||l?Ie(0):$t(r,a);return{x:i.left+a.scrollLeft-s.x-u.x,y:i.top+a.scrollTop-s.y-u.y,width:i.width,height:i.height}}function Nt(e){return"static"===gt(e).position}function Dt(e,t){if(!nt(e)||"fixed"===gt(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Qe(e)===n&&(n=n.ownerDocument.body),n}function At(e,t){const n=Je(e);if(ct(e))return n;if(!nt(e)){let t=yt(e);for(;t&&!ft(t);){if(tt(t)&&!Nt(t))return t;t=yt(t)}return n}let o=Dt(e,t);for(;o&&at(o)&&Nt(o);)o=Dt(o,t);return o&&ft(o)&&Nt(o)&&!mt(o)?n:o||function(e){let t=yt(e);for(;nt(t)&&!ft(t);){if(mt(t))return t;if(ct(t))return null;t=yt(t)}return null}(e)||n}const Rt={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const l="fixed"===r,i=Qe(o),a=!!t&&ct(t.floating);if(o===i||a&&l)return n;let s={scrollLeft:0,scrollTop:0},c=Ie(1);const u=Ie(0),d=nt(o);if((d||!d&&!l)&&(("body"!==Ge(o)||lt(i))&&(s=wt(o)),nt(o))){const e=It(o);c=Bt(o),u.x=e.x+o.clientLeft,u.y=e.y+o.clientTop}const h=!i||d||l?Ie(0):$t(i,s);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-s.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-s.scrollTop*c.y+u.y+h.y}},getDocumentElement:Qe,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const l=[..."clippingAncestors"===n?ct(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=xt(e,[],!1).filter(e=>tt(e)&&"body"!==Ge(e)),r=null;const l="fixed"===gt(e).position;let i=l?yt(e):e;for(;tt(i)&&!ft(i);){const t=gt(i),n=mt(i);n||"fixed"!==t.position||(r=null),(l?!n&&!r:!n&&"static"===t.position&&r&&St.has(r.position)||lt(i)&&!n&&Et(e,i))?o=o.filter(e=>e!==i):r=t,i=yt(i)}return t.set(e,o),o}(t,this._c):[].concat(n),o],i=l[0],a=l.reduce((e,n)=>{const o=jt(t,n,r);return e.top=Be(o.top,e.top),e.right=_e(o.right,e.right),e.bottom=_e(o.bottom,e.bottom),e.left=Be(o.left,e.left),e},jt(t,i,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:At,getElementRects:function(e){return u(this,null,function*(){const t=this.getOffsetParent||At,n=this.getDimensions,o=yield n(e.floating);return{reference:Ht(e.reference,yield t(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:t,height:n}=Mt(e);return{width:t,height:n}},getScale:Bt,isElement:tt,isRTL:function(e){return"rtl"===gt(e).direction}};function zt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Pt(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:l=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:u=!1}=o,d=_t(e),h=r||l?[...d?xt(d):[],...xt(t)]:[];h.forEach(e=>{r&&e.addEventListener("scroll",n,{passive:!0}),l&&e.addEventListener("resize",n)});const m=d&&c?function(e,t){let n,o=null;const r=Qe(e);function l(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}return function i(c,u){void 0===c&&(c=!1),void 0===u&&(u=1),l();const d=e.getBoundingClientRect(),{left:h,top:m,width:v,height:p}=d;if(c||t(),!v||!p)return;const f={rootMargin:-Te(m)+"px "+-Te(r.clientWidth-(h+v))+"px "+-Te(r.clientHeight-(m+p))+"px "+-Te(h)+"px",threshold:Be(0,_e(1,u))||1};let g=!0;function w(t){const o=t[0].intersectionRatio;if(o!==u){if(!g)return i();o?i(!1,o):n=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==o||zt(d,e.getBoundingClientRect())||i(),g=!1}try{o=new IntersectionObserver(w,s(a({},f),{root:r.ownerDocument}))}catch(y){o=new IntersectionObserver(w,f)}o.observe(e)}(!0),l}(d,n):null;let v,p=-1,f=null;i&&(f=new ResizeObserver(e=>{let[o]=e;o&&o.target===d&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),n()}),d&&!u&&f.observe(d),f.observe(t));let g=u?It(e):null;return u&&function t(){const o=It(e);g&&!zt(g,o)&&n(),g=o,v=requestAnimationFrame(t)}(),n(),()=>{var e;h.forEach(e=>{r&&e.removeEventListener("scroll",n),l&&e.removeEventListener("resize",n)}),null==m||m(),null==(e=f)||e.disconnect(),f=null,u&&cancelAnimationFrame(v)}}const Vt=function(e){return void 0===e&&(e={}),{name:"shift",options:e,fn(t){return u(this,null,function*(){const{x:n,y:o,placement:r}=t,l=je(e,t),{mainAxis:i=!0,crossAxis:u=!1,limiter:d={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}}}=l,h=c(l,["mainAxis","crossAxis","limiter"]),m={x:n,y:o},v=yield qe(t,h),p=Re(Ee(r)),f=Ne(p);let g=m[f],w=m[p];if(i){const e="y"===f?"bottom":"right";g=Se(g+v["y"===f?"top":"left"],g,g-v[e])}if(u){const e="y"===p?"bottom":"right";w=Se(w+v["y"===p?"top":"left"],w,w-v[e])}const y=d.fn(s(a({},t),{[f]:g,[p]:w}));return s(a({},y),{data:{x:y.x-n,y:y.y-o,enabled:{[f]:i,[p]:u}}})})}}},Ot=function(e){return void 0===e&&(e={}),{name:"flip",options:e,fn(t){return u(this,null,function*(){var n,o;const{placement:r,middlewareData:l,rects:i,initialPlacement:a,platform:s,elements:u}=t,d=je(e,t),{mainAxis:h=!0,crossAxis:m=!0,fallbackPlacements:v,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0}=d,w=c(d,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if(null!=(n=l.arrow)&&n.alignmentOffset)return{};const y=Ee(r),k=Re(a),x=Ee(a)===a,b=yield null==s.isRTL?void 0:s.isRTL(u.floating),M=v||(x||!g?[Ke(a)]:function(e){const t=Ke(e);return[Pe(e),t,Pe(t)]}(a)),_="none"!==f;!v&&_&&M.push(...function(e,t,n,o){const r=He(e);let l=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Oe:Ve:t?Ve:Oe;case"left":case"right":return t?Fe:We;default:return[]}}(Ee(e),"start"===n,o);return r&&(l=l.map(e=>e+"-"+r),t&&(l=l.concat(l.map(Pe)))),l}(a,g,f,b));const B=[a,...M],C=yield qe(t,w),T=[];let I=(null==(o=l.flip)?void 0:o.overflows)||[];if(h&&T.push(C[y]),m){const e=function(e,t,n){void 0===n&&(n=!1);const o=He(e),r=ze(e),l=De(r);let i="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[l]>t.floating[l]&&(i=Ke(i)),[i,Ke(i)]}(r,i,b);T.push(C[e[0]],C[e[1]])}if(I=[...I,{placement:r,overflows:T}],!T.every(e=>e<=0)){var L,$;const e=((null==(L=l.flip)?void 0:L.index)||0)+1,t=B[e];if(t&&("alignment"!==m||k===Re(t)||I.every(e=>Re(e.placement)!==k||e.overflows[0]>0)))return{data:{index:e,overflows:I},reset:{placement:t}};let n=null==($=I.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:$.placement;if(!n)switch(p){case"bestFit":{var S;const e=null==(S=I.filter(e=>{if(_){const t=Re(e.placement);return t===k||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:S[0];e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}})}}},Ft=["id"],Wt=/* @__PURE__ */ne(/* @__PURE__ */v({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(e){const t=e,n=_(()=>{if(void 0!==t.isDark&&null!==t.isDark)return Boolean(t.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=B(null),r=B({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),l=B(!1);let i=null;function c(){return u(this,null,function*(){var e,n;if(!t.anchorEl||!o.value)return;const l=[(d=null!=(e=t.offset)?e:8,void 0===d&&(d=0),{name:"offset",options:d,fn(e){return u(this,null,function*(){var t,n;const{x:o,y:r,placement:l,middlewareData:i}=e,c=yield function(e,t){return u(this,null,function*(){const{placement:n,platform:o,elements:r}=e,l=yield null==o.isRTL?void 0:o.isRTL(r.floating),i=Ee(n),a=He(n),s="y"===Re(n),c=Ze.has(i)?-1:1,u=l&&s?-1:1,d=je(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:v}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof v&&(m="end"===a?-1*v:v),s?{x:m*u,y:h*c}:{x:h*c,y:m*u}})}(e,d);return l===(null==(t=i.offset)?void 0:t.placement)&&null!=(n=i.arrow)&&n.alignmentOffset?{}:{x:o+c.x,y:r+c.y,data:s(a({},c),{placement:l})}})}}),Ot(),Vt({padding:8})],{x:i,y:c}=yield((e,t,n)=>{const o=/* @__PURE__ */new Map,r=a({platform:Rt},n),l=s(a({},r.platform),{_c:o});return((e,t,n)=>u(null,null,function*(){const{placement:o="bottom",strategy:r="absolute",middleware:l=[],platform:i}=n,c=l.filter(Boolean),u=yield null==i.isRTL?void 0:i.isRTL(t);let d=yield i.getElementRects({reference:e,floating:t,strategy:r}),{x:h,y:m}=Ye(d,o,u),v=o,p={},f=0;for(let n=0;n<c.length;n++){const{name:l,fn:g}=c[n],{x:w,y,data:k,reset:x}=yield g({x:h,y:m,initialPlacement:o,placement:v,strategy:r,middlewareData:p,rects:d,platform:i,elements:{reference:e,floating:t}});h=null!=w?w:h,m=null!=y?y:m,p=s(a({},p),{[l]:a(a({},p[l]),k)}),x&&f<=50&&(f++,"object"==typeof x&&(x.placement&&(v=x.placement),x.rects&&(d=!0===x.rects?yield i.getElementRects({reference:e,floating:t,strategy:r}):x.rects),({x:h,y:m}=Ye(d,v,u))),n=-1)}return{x:h,y:m,placement:v,strategy:r,middlewareData:p}}))(e,t,s(a({},r),{platform:l}))})(t.anchorEl,o.value,{placement:null!=(n=t.placement)?n:"top",middleware:l,strategy:"fixed"});var d;r.value.transform=`translate3d(${Math.round(i)}px, ${Math.round(c)}px, 0)`,r.value.left="0px",r.value.top="0px"})}return C(()=>t.visible,e=>u(null,null,function*(){if(e)if(l.value=!1,yield T(),t.anchorEl&&o.value)try{const e=t.anchorEl.getBoundingClientRect();yield c();const n=r.value.transform;if(null!=t.originX&&null!=t.originY){const o=Math.abs(Number(t.originX)-e.left),i=Math.abs(Number(t.originY)-e.top);Math.hypot(o,i)>120?(r.value.transform=`translate3d(${Math.round(t.originX)}px, ${Math.round(t.originY)}px, 0)`,yield T(),l.value=!0,yield T(),r.value.transform=n):l.value=!0}else l.value=!0;i=Pt(t.anchorEl,o.value,c)}catch(n){yield c(),l.value=!0,i=Pt(t.anchorEl,o.value,c)}else l.value=!0;else l.value=!1,i&&(i(),i=null)})),C([()=>t.anchorEl,()=>t.placement,()=>t.content],()=>u(null,null,function*(){t.visible&&t.anchorEl&&o.value&&(yield T(),yield c())})),I(()=>{i&&i()}),(i,a)=>(f(),L($,{to:"body"},[w(S,{name:"tooltip",appear:""},{default:j(()=>[E(k("div",{id:t.id,ref_key:"tooltip",ref:o,style:N({position:"fixed",left:r.value.left,top:r.value.top,transform:r.value.transform}),class:H(["z-[9999] inline-block text-base py-2 px-3 rounded-md shadow-md whitespace-nowrap pointer-events-none tooltip-element border",[n.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,Ft),[[D,e.visible&&l.value]])]),_:1})]))}}),[["__scopeId","data-v-993f63aa"]]),Kt=B(!1),Xt=B(""),Yt=B("top"),qt=B(null),Zt=B(null),Ut=B(null),Gt=B(null),Jt=B(null);let Qt=null,en=null;function tn(){Qt&&(clearTimeout(Qt),Qt=null),en&&(clearTimeout(en),en=null)}let nn=!1;function on(e,t,n="top",o=!1,r,l){if(!e)return;!function(){if(nn)return;if("undefined"==typeof document)return;nn=!0;const e=document.createElement("div");e.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(e),A({setup:()=>()=>{var e;return R(Wt,{visible:Kt.value,"anchor-el":qt.value,content:Xt.value,placement:Yt.value,id:Zt.value,originX:Ut.value,originY:Gt.value,isDark:null!=(e=Jt.value)?e:void 0})}}).mount(e)}(),tn();const i=()=>{var o,i;Zt.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,qt.value=e,Xt.value=t,Yt.value=n,Ut.value=null!=(o=null==r?void 0:r.x)?o:null,Gt.value=null!=(i=null==r?void 0:r.y)?i:null,Jt.value="boolean"==typeof l?l:null,Kt.value=!0;try{e.setAttribute("aria-describedby",Zt.value)}catch(a){}};o?i():Qt=setTimeout(i,80)}function rn(e=!1){tn();const t=()=>{if(qt.value&&Zt.value)try{qt.value.removeAttribute("aria-describedby")}catch(e){}Kt.value=!1,qt.value=null,Zt.value=null,Ut.value=null,Gt.value=null};e?t():en=setTimeout(t,120)}const ln={"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 an(e){Object.assign(ln,e)}function sn(){try{const t=globalThis.$vueI18nUse||null;if(t&&"function"==typeof t)try{const e=t();if(e&&"function"==typeof e.t)return{t:e.t.bind(e)}}catch(e){}}catch(e){}return u(null,null,function*(){try{const t=yield import("vue-i18n"),n=t.useI18n||t.default&&t.default.useI18n;if(n&&"function"==typeof n)try{const t=n();if(t&&"function"==typeof t.t)try{globalThis.$vueI18nUse=()=>t}catch(e){}}catch(e){}}catch(e){}}),{t:e=>{var t;return null!=(t=ln[e])?t: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 cn=Symbol("ViewportPriority");function un(){const e=z(cn,void 0);if(e)return e;const t=/* @__PURE__ */new WeakMap;let n=null;return e=>{const o=B(!1);let r,l=!1;const i=new Promise(e=>{r=()=>{l||(l=!0,e())}}),a=()=>{try{null==n||n.unobserve(e)}catch(o){}t.delete(e)},s=n||("undefined"==typeof window||"undefined"==typeof IntersectionObserver?null:(n=new IntersectionObserver(e=>{for(const r of e){const e=t.get(r.target);if(e&&(r.isIntersecting||r.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(o){}}null==n||n.unobserve(r.target),t.delete(r.target)}}},{root:null,rootMargin:"300px",threshold:0}),n));return s?(t.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 dn={class:"relative inline-block"},hn=["src","alt","title","loading","tabindex","aria-label"],mn={class:"text-sm whitespace-nowrap"},vn={key:1,class:"text-sm text-gray-500"},pn={key:"error",class:"px-4 py-2 bg-gray-100 flex items-center justify-center rounded-lg gap-2 text-red-500"},fn={class:"text-sm whitespace-nowrap"},gn={key:0,class:"mt-2 text-sm text-gray-500 italic"},wn=/* @__PURE__ */ne(/* @__PURE__ */v({__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:t}){const n=e,o=t,r=B(!1),l=B(!1),i=B(!1),a=B(null),s=un(),c=B(null),u=B("undefined"==typeof window);"undefined"!=typeof window&&C(()=>a.value,e=>{var t;if(null==(t=c.value)||t.destroy(),c.value=null,!e)return void(u.value=!1);const n=s(e,{rootMargin:"400px"});c.value=n,u.value=n.isVisible.value,n.whenVisible.then(()=>{u.value=!0})},{immediate:!0}),I(()=>{var e;null==(e=c.value)||e.destroy(),c.value=null});const d=_(()=>l.value&&n.fallbackSrc?n.fallbackSrc:n.node.src),h=_(()=>!n.lazy||u.value),m=_(()=>/\.svg(?:\?|$)/i.test(d.value));function v(){n.fallbackSrc&&!i.value?(i.value=!0,l.value=!0):(l.value=!0,o("error",n.node.src))}function g(){r.value=!0,l.value=!1,o("load",d.value)}function x(e){e.preventDefault(),r.value&&!l.value&&o("click",[e,d.value])}const{t:b}=sn();return C(d,()=>{r.value=!1,l.value=!1}),(t,o)=>(f(),p("figure",{ref_key:"figureRef",ref:a,class:"text-center my-8"},[k("div",dn,[w(S,{name:"img-switch",mode:"out-in"},{default:j(()=>{var i,a,s,c,u;return[e.node.loading||l.value||!h.value?l.value?e.node.loading||n.fallbackSrc?V("",!0):(f(),p("div",pn,[O(t.$slots,"error",{node:n.node,displaySrc:d.value,imageLoaded:r.value,hasError:l.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy,isSvg:m.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",fn,M(y(b)("image.loadError")),1)],!0)])):(f(),p("div",{key:"placeholder",class:"placeholder-layer max-w-96 inline-flex items-center justify-center gap-2",style:N(m.value?{minHeight:n.svgMinHeight,width:"100%"}:{minHeight:"6rem"})},[n.usePlaceholder?O(t.$slots,"placeholder",{key:0,node:n.node,displaySrc:d.value,imageLoaded:r.value,hasError:l.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy,isSvg:m.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",mn,M(y(b)("image.loading")),1)],!0):(f(),p("span",vn,M(e.node.raw),1))],4)):(f(),p("img",{key:"image",src:d.value,alt:String(null!=(a=null!=(i=n.node.alt)?i:n.node.title)?a:""),title:String(null!=(c=null!=(s=n.node.title)?s:n.node.alt)?c:""),class:H(["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:N(m.value?{minHeight:n.svgMinHeight,width:"100%",height:"auto",objectFit:"contain"}:void 0),loading:n.lazy?"lazy":"eager",decoding:"async",tabindex:r.value?0:-1,"aria-label":null!=(u=n.node.alt)?u:y(b)("image.preview"),onError:v,onLoad:g,onClick:x},null,46,hn))]}),_:3})]),n.showCaption&&n.node.alt?(f(),p("figcaption",gn,M(n.node.alt),1)):V("",!0)],512))}}),[["__scopeId","data-v-7ca79b66"]]);wn.install=e=>{e.component(wn.__name,wn)};let yn=null,kn=!1,xn=bn;function bn(){return u(null,null,function*(){const e=yield import("katex");return yield import("katex/contrib/mhchem"),e})}function Mn(e){xn=e,yn=null,kn=!1}function _n(e){Mn(null!=e?e:bn)}function Bn(){Mn(null)}function Cn(){return"function"==typeof xn}function Tn(){return u(this,null,function*(){if(yn)return yn;if(kn)return null;const e=xn;if(!e)return kn=!0,null;try{const t=yield e();if(t)return yn=t,yn}catch(t){}return kn=!0,null})}const In=F(!1);let Ln=null;function $n(){return Ln||(Ln=Tn().then(e=>{In.value=!!e}).catch(()=>{In.value=!1})),W(In)}const Sn=/* @__PURE__ */ne(/* @__PURE__ */v({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=$n();return(n,o)=>(f(),p("span",{class:H([[y(t)&&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 jn=K(()=>u(null,null,function*(){var e,t;if("undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(t=null==(e=globalThis.process)?void 0:e.env)?void 0:t.NODE_ENV))return e=>{var t,n;return R(Sn,s(a({},e),{node:s(a({},e.node),{content:null!=(n=e.node.raw)?n:`$${null!=(t=e.node.content)?t:""}$`})}))};try{if(yield Tn())return(yield import("./index2.js")).default}catch(n){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".',n)}return e=>{var t,n;return R(Sn,s(a({},e),{node:s(a({},e.node),{content:null!=(n=e.node.raw)?n:`$${null!=(t=e.node.content)?t:""}$`})}))}})),En=K(()=>u(null,null,function*(){try{if(yield Tn())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 t,n;return R(Sn,s(a({},e),{node:s(a({},e.node),{content:null!=(n=e.node.raw)?n:`$$${null!=(t=e.node.content)?t:""}$$`})}))}})),Hn=/* @__PURE__ */v({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(f(),p("span",{class:"reference-node cursor-pointer bg-accent text-xs rounded-md px-1.5 mx-0.5 hover:bg-secondary",role:"button",tabindex:"0",onClick:n[0]||(n[0]=n=>t.$emit("click",n,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=n=>t.$emit("mouseEnter",n,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=n=>t.$emit("mouseLeave",n,e.node.id,e.messageId,e.threadId))},M(e.node.id),33))});Hn.install=e=>{e.component(Hn.__name,Hn)};const Nn={class:"superscript-node"},Dn={key:1},An=/* @__PURE__ */ne(/* @__PURE__ */v({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=fe(t.customId),o={text:n.text||Sn,inline_code:n.inline_code||Me,link:n.link||Un,strong:n.strong||On,emphasis:n.emphasis||no,footnote_reference:n.footnote_reference||xe,strikethrough:n.strikethrough||Wn,highlight:n.highlight||eo,insert:n.insert||Jn,subscript:n.subscript||Pn,emoji:n.emoji||he,math_inline:n.math_inline||jn,reference:n.reference||Hn};return(n,r)=>(f(),p("sup",Nn,[(f(!0),p(x,null,b(e.node.children,(n,r)=>(f(),p(x,{key:`${e.indexKey||"superscript"}-${r}`},[o[n.type]?(f(),L(X(o[n.type]),{key:0,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${r}`},null,8,["node","custom-id","index-key"])):(f(),p("span",Dn,M(n.content||n.raw),1))],64))),128))]))}}),[["__scopeId","data-v-61b3fc8c"]]);An.install=e=>{e.component(An.__name,An)};const Rn={class:"subscript-node"},zn={key:1},Pn=/* @__PURE__ */ne(/* @__PURE__ */v({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=fe(t.customId),o={text:n.text||Sn,inline_code:n.inline_code||Me,link:n.link||Un,strong:n.strong||On,emphasis:n.emphasis||no,footnote_reference:n.footnote_reference||xe,strikethrough:n.strikethrough||Wn,highlight:n.highlight||eo,insert:n.insert||Jn,superscript:n.superscript||An,emoji:n.emoji||he,math_inline:n.math_inline||jn,reference:n.reference||Hn};return(n,r)=>(f(),p("sub",Rn,[(f(!0),p(x,null,b(e.node.children,(n,r)=>(f(),p(x,{key:`${e.indexKey||"subscript"}-${r}`},[o[n.type]?(f(),L(X(o[n.type]),{key:0,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${r}`},null,8,["node","custom-id","index-key"])):(f(),p("span",zn,M(n.content||n.raw),1))],64))),128))]))}}),[["__scopeId","data-v-7ab6b46a"]]);Pn.install=e=>{e.component(Pn.__name,Pn)};const Vn={class:"strong-node"},On=/* @__PURE__ */ne(/* @__PURE__ */v({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=fe(t.customId),o={text:n.text||Sn,inline_code:n.inline_code||Me,link:n.link||Un,emphasis:n.emphasis||no,strikethrough:n.strikethrough||Wn,highlight:n.highlight||eo,insert:n.insert||Jn,subscript:n.subscript||Pn,superscript:n.superscript||An,emoji:n.emoji||he,footnote_reference:n.footnote_reference||xe,math_inline:n.math_inline||jn,reference:n.reference||Hn};return(n,r)=>(f(),p("strong",Vn,[(f(!0),p(x,null,b(e.node.children,(n,r)=>(f(),L(X(o[n.type]),{key:`${e.indexKey||"strong"}-${r}`,"index-key":`${e.indexKey||"strong"}-${r}`,node:n,"custom-id":t.customId},null,8,["index-key","node","custom-id"]))),128))]))}}),[["__scopeId","data-v-fa84457b"]]);On.install=e=>{e.component(On.__name,On)};const Fn={class:"strikethrough-node"},Wn=/* @__PURE__ */ne(/* @__PURE__ */v({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=fe(t.customId),o={text:n.text||Sn,inline_code:n.inline_code||Me,link:n.link||Un,strong:n.strong||On,emphasis:n.emphasis||no,highlight:n.highlight||eo,insert:n.insert||Jn,subscript:n.subscript||Pn,superscript:n.superscript||An,emoji:n.emoji||he,footnote_reference:n.footnote_reference||xe,math_inline:n.math_inline||jn,reference:n.reference||Hn};return(n,r)=>(f(),p("del",Fn,[(f(!0),p(x,null,b(e.node.children,(n,r)=>(f(),L(X(o[n.type]),{key:`${e.indexKey||"strikethrough"}-${r}`,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b5c4d542"]]);Wn.install=e=>{e.component(Wn.__name,Wn)};const Kn=["href","title","aria-label","aria-hidden"],Xn=["aria-hidden"],Yn={class:"link-text-wrapper relative inline-flex"},qn={class:"leading-[normal] link-text"},Zn={class:"leading-[normal] link-text"},Un=/* @__PURE__ */ne(/* @__PURE__ */v({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=_(()=>{var e,n,o,r,l,i;const a=void 0!==t.underlineBottom?"number"==typeof t.underlineBottom?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px";return{"--link-color":null!=(e=t.color)?e:"#0366d6","--underline-height":`${null!=(n=t.underlineHeight)?n:2}px`,"--underline-bottom":a,"--underline-opacity":String(null!=(o=t.animationOpacity)?o:.9),"--underline-duration":`${null!=(r=t.animationDuration)?r:.8}s`,"--underline-timing":null!=(l=t.animationTiming)?l:"linear","--underline-iteration":"number"==typeof t.animationIteration?String(t.animationIteration):null!=(i=t.animationIteration)?i:"infinite"}}),o={text:Sn,strong:On,strikethrough:Wn,emphasis:no,image:wn},r=Y();function l(){t.showTooltip&&rn()}const i=_(()=>{var e,n;return String(null!=(n=null!=(e=t.node.title)?e:t.node.href)?n:"")});return(a,s)=>e.node.loading?(f(),p("span",q({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},y(r),{style:n.value}),[k("span",Yn,[k("span",qn,[k("span",Zn,M(e.node.text),1)]),s[1]||(s[1]=k("span",{class:"underline-anim","aria-hidden":"true"},null,-1))])],16,Xn)):(f(),p("a",q({key:0,class:"link-node",href:e.node.href,title:e.showTooltip?"":i.value,"aria-label":`Link: ${i.value}`,"aria-hidden":e.node.loading?"true":"false",target:"_blank",rel:"noopener noreferrer"},y(r),{style:n.value,onMouseenter:s[0]||(s[0]=e=>function(e){var n,o,r;if(!t.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==(n=t.node)?void 0:n.title)||(null==(o=t.node)?void 0:o.href)||(null==(r=t.node)?void 0:r.text)||"";on(e.currentTarget,a,"top",!1,i)}(e)),onMouseleave:l}),[(f(!0),p(x,null,b(e.node.children,(n,r)=>(f(),L(X(o[n.type]),{key:`${e.indexKey||"emphasis"}-${r}`,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${r}`},null,8,["node","custom-id","index-key"]))),128))],16,Kn))}}),[["__scopeId","data-v-80b69735"]]);Un.install=e=>{e.component(Un.__name,Un)};const Gn={class:"insert-node"},Jn=/* @__PURE__ */ne(/* @__PURE__ */v({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=fe(t.customId),o={text:n.text||Sn,inline_code:n.inline_code||Me,link:n.link||Un,strong:n.strong||On,emphasis:n.emphasis||no,strikethrough:n.strikethrough||Wn,highlight:n.highlight||eo,subscript:n.subscript||Pn,superscript:n.superscript||An,emoji:n.emoji||he,footnote_reference:n.footnote_reference||xe,math_inline:n.math_inline||jn,reference:n.reference||Hn};return(n,r)=>(f(),p("ins",Gn,[(f(!0),p(x,null,b(e.node.children,(n,r)=>(f(),L(X(o[n.type]),{key:`${e.indexKey||"insert"}-${r}`,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-f8fcda3c"]]);Jn.install=e=>{e.component(Jn.__name,Jn)};const Qn={class:"highlight-node"},eo=/* @__PURE__ */ne(/* @__PURE__ */v({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=fe(t.customId),o={text:n.text||Sn,inline_code:n.inline_code||Me,link:n.link||Un,strong:n.strong||On,emphasis:n.emphasis||no,strikethrough:n.strikethrough||Wn,insert:n.insert||Jn,subscript:n.subscript||Pn,superscript:n.superscript||An,emoji:n.emoji||he,footnote_reference:n.footnote_reference||xe,math_inline:n.math_inline||jn,reference:n.reference||Hn};return(n,r)=>(f(),p("mark",Qn,[(f(!0),p(x,null,b(e.node.children,(n,r)=>(f(),L(X(o[n.type]),{key:`${e.indexKey||"highlight"}-${r}`,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-d99ab14d"]]);eo.install=e=>{e.component(eo.__name,eo)};const to={class:"emphasis-node"},no=/* @__PURE__ */ne(/* @__PURE__ */v({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=fe(t.customId),o={text:n.text||Sn,inline_code:n.inline_code||Me,link:n.link||Un,strong:n.strong||On,strikethrough:n.strikethrough||Wn,highlight:n.highlight||eo,insert:n.insert||Jn,subscript:n.subscript||Pn,superscript:n.superscript||An,emoji:n.emoji||he,footnote_reference:n.footnote_reference||xe,math_inline:n.math_inline||jn,reference:n.reference||Hn};return(n,r)=>(f(),p("em",to,[(f(!0),p(x,null,b(e.node.children,(n,r)=>(f(),L(X(o[n.type]),{key:`${e.indexKey||"emphasis"}-${r}`,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-836b7830"]]);no.install=e=>{e.component(no.__name,no)};const oo=["href","title"],ro=/* @__PURE__ */ne(/* @__PURE__ */v({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(e){var n;if(e.preventDefault(),"undefined"==typeof document)return;const o=`fnref-${String(null!=(n=t.node.id)?n:"")}`,r=document.getElementById(o);r&&r.scrollIntoView({behavior:"smooth"})}return(t,o)=>(f(),p("a",{class:"footnote-anchor text-sm text-[#0366d6] hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,oo))}}),[["__scopeId","data-v-4756ce0d"]]);ro.install=e=>{e.component(ro.__name,ro)};const lo=["id"],io={class:"flex-1"},ao=/* @__PURE__ */v({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(f(),p("div",{id:`fnref--${e.node.id}`,class:"flex mt-2 mb-2 text-sm leading-relaxed border-t border-[#eaecef] pt-2"},[k("div",io,[g([t.node.children],()=>w(y(Mr),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,onCopy:o[0]||(o[0]=e=>n.$emit("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"]),o,1)])],8,lo))}});ao.install=e=>{e.component(ao.__name,ao)};const so={class:"hard-break"},co=/* @__PURE__ */ne(/* @__PURE__ */v({__name:"HardBreakNode",props:{node:{}},setup:e=>(e,t)=>(f(),p("br",so))}),[["__scopeId","data-v-50c58f70"]]);co.install=e=>{e.component(co.__name,co)};const uo=/* @__PURE__ */ne(/* @__PURE__ */v({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=fe(t.customId),o={text:n.text||Sn,inline_code:n.inline_code||Me,link:n.link||Un,image:n.image||wn,strong:n.strong||On,emphasis:n.emphasis||no,strikethrough:n.strikethrough||Wn,highlight:n.highlight||eo,insert:n.insert||Jn,subscript:n.subscript||Pn,superscript:n.superscript||An,emoji:n.emoji||he,checkbox:n.checkbox||ie,checkbox_input:n.checkbox_input||ie,footnote_reference:n.footnote_reference||xe,hardbreak:n.hardbreak||co,math_inline:n.math_inline||jn,reference:n.reference||Hn};return(n,r)=>g([e.node.children],()=>(f(),L(X(`h${e.node.level}`),{class:H(["heading-node",[`heading-${e.node.level}`]]),dir:"auto"},{default:j(()=>[(f(!0),p(x,null,b(e.node.children,(n,r,l,i)=>{const a=[n];if(i&&i.key===`${e.indexKey||"heading"}-${r}`&&Z(i,a))return i;const s=(f(),L(X(o[n.type]),{key:`${e.indexKey||"heading"}-${r}`,"custom-id":t.customId,node:n,"index-key":`${e.indexKey||"heading"}-${r}`},null,8,["custom-id","node","index-key"]));return s.memo=a,s},r,0),128))]),_:1},8,["class"])),r,2)}}),[["__scopeId","data-v-8712d23e"]]),ho=uo;ho.install=e=>{e.component(uo.__name,uo)};const mo=/* @__PURE__ */ne(/* @__PURE__ */v({__name:"ListItemNode",props:{item:{},indexKey:{},value:{},customId:{},typewriter:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=_(()=>null==t.value?{}:{value:t.value});return(e,o)=>(f(),p("li",q({class:"list-item pl-1.5 my-2",dir:"auto"},n.value),[g([t.item.children],()=>w(y(Mr),{"index-key":`list-item-${t.indexKey}`,nodes:t.item.children,"custom-id":t.customId,typewriter:t.typewriter,"batch-rendering":!1,onCopy:o[0]||(o[0]=t=>e.$emit("copy",t))},null,8,["index-key","nodes","custom-id","typewriter"]),o,1)],16))}}),[["__scopeId","data-v-7a618746"]]);mo.install=e=>{e.component(mo.__name,mo)};const vo=/* @__PURE__ */ne(/* @__PURE__ */v({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean}},emits:["copy"],setup:e=>(t,n)=>(f(),L(X(e.node.ordered?"ol":"ul"),{class:H(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:j(()=>[(f(!0),p(x,null,b(e.node.items,(o,r,l,i)=>{var a;const s=[o];if(i&&i.key===`${e.indexKey||"list"}-${r}`&&Z(i,s))return i;const c=(f(),L(y(mo),{key:`${e.indexKey||"list"}-${r}`,item:o,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,value:e.node.ordered?(null!=(a=e.node.start)?a:1)+r:void 0,onCopy:n[0]||(n[0]=e=>t.$emit("copy",e))},null,8,["item","custom-id","index-key","typewriter","value"]));return c.memo=s,c},n,1),128))]),_:1},8,["class"]))}),[["__scopeId","data-v-79057d57"]]);function po(e){try{if("undefined"!=typeof globalThis&&"function"==typeof globalThis.requestAnimationFrame)return globalThis.requestAnimationFrame(e)}catch(t){}return globalThis.setTimeout(e,0)}vo.install=e=>{e.component(vo.__name,vo)};const fo=()=>import("mermaid");let go=null,wo=fo;function yo(e){wo=e,go=null}function ko(e){yo(null!=e?e:fo)}function xo(){yo(null)}function bo(){return"function"==typeof wo}let Mo=null,_o=null;const Bo=/* @__PURE__ */new Map;let Co=5,To=!1;function Io(e){To=!!e}function Lo(e){Number.isFinite(e)&&e>0&&(Co=Math.floor(e))}function $o(){return{inFlight:Bo.size,max:Co}}const So="WORKER_BUSY",jo="MERMAID_DISABLED";function Eo(e){Mo=e,_o=null;const t=e;Mo.onmessage=e=>{if(Mo!==t)return;const{id:n,ok:o,result:r,error:l}=e.data,i=Bo.get(n);i&&(!1===o||l?i.reject(new Error(l||"Unknown error")):i.resolve(r))},Mo.onerror=e=>{var n,o;if(Mo===t)if(0!==Bo.size){try{To?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[t,n]of Bo.entries())n.reject(new Error(`Worker error: ${e.message}`));Bo.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker error (no pending):",(null==e?void 0:e.message)||e)},Mo.onmessageerror=e=>{var n,o;if(Mo===t)if(0!==Bo.size){try{To?console.error("[mermaidWorkerClient] Worker messageerror:",e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker messageerror:",e)}catch(r){}for(const[e,t]of Bo.entries())t.reject(new Error("Worker messageerror"));Bo.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",e)}}function Ho(){var e;if(Mo)try{for(const[e,t]of Bo.entries())t.reject(new Error("Worker cleared"));Bo.clear(),null==(e=Mo.terminate)||e.call(Mo)}catch(t){}Mo=null,_o=null}function No(e,t,n=1400){if(!bo()){const e=new Error("Mermaid rendering disabled");return e.name="MermaidDisabled",e.code=jo,Promise.reject(e)}if(_o)return Promise.reject(_o);const o=Mo||(_o=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),_o.name="WorkerInitError",_o.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(_o);if(Bo.size>=Co){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code=So,e.inFlight=Bo.size,e.max=Co,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),Bo.delete(i))},u={resolve:e=>{c(),r(e)},reject:e=>{c(),l(e)}};Bo.set(i,u);try{o.postMessage({id:i,action:e,payload:t})}catch(d){return Bo.delete(i),void l(d)}a=globalThis.setTimeout(()=>{const e=new Error("Worker call timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT";const t=Bo.get(i);t&&t.reject(e)},n)})}function Do(e,t,n=1400){return u(this,null,function*(){try{return yield No("canParse",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function Ao(e,t,n=1400){return u(this,null,function*(){try{return yield No("findPrefix",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function Ro(){if(Mo)try{for(const[e,t]of Bo.entries())t.reject(new Error("Worker terminated"));Bo.clear(),Mo.terminate()}finally{Mo=null}}const zo={key:0},Po={key:1,class:"flex items-center space-x-2 overflow-hidden"},Vo=["src"],Oo={key:2},Fo={class:"flex items-center space-x-1"},Wo={class:"flex items-center space-x-1"},Ko={key:4},Xo={key:5,class:"flex items-center space-x-1"},Yo=["aria-pressed"],qo={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"},Zo={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"},Uo=["disabled"],Go=["disabled"],Jo={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"},Qo={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"},er={key:1,class:"relative"},tr={key:0,class:"absolute top-2 right-2 z-10 rounded-lg"},nr={class:"flex items-center gap-2 backdrop-blur rounded-lg"},or={class:"absolute top-6 right-6 z-50 flex items-center gap-2"},rr=/* @__PURE__ */ne(/* @__PURE__ */v({__name:"MermaidBlockNode",props:{node:{},maxHeight:{default:"500px"},loading:{type:Boolean,default:!0},isDark:{type:Boolean},workerTimeoutMs:{default:1400},parseTimeoutMs:{default:1800},renderTimeoutMs:{default:2500},fullRenderTimeoutMs:{default:4e3},showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showFullscreenButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showZoomControls:{type:Boolean,default:!0}},emits:["copy","export","openModal","toggleMode"],setup(e,{emit:t}){var n,o;const r=e,l=t,{t:i}=sn(),c=B(!1);function d(){return u(this,null,function*(){try{const e=yield function(){return u(this,null,function*(){if(go)return go;const e=wo;if(!e)return null;let t;try{t=yield e()}catch(n){if(e===fo)throw new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.');throw n}return t?(go=function(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&("function"==typeof t.render||"function"==typeof t.parse||"function"==typeof t.initialize))return t;if(t&&t.mermaidAPI&&("function"==typeof t.mermaidAPI.render||"function"==typeof t.mermaidAPI.parse)){const e=t.mermaidAPI;return s(a({},t),{render:e.render.bind(e),parse:e.parse?e.parse.bind(e):void 0,initialize:n=>"function"==typeof t.initialize?t.initialize(n):e.initialize?e.initialize(n):void 0})}return e.mermaid&&"function"==typeof e.mermaid.render?e.mermaid:t}(t),function(e){if(e)try{const t=null==e?void 0:e.initialize;e.initialize=n=>{const o=a({suppressErrorRendering:!0},n||{});return"function"==typeof t?t.call(e,o):(null==e?void 0:e.mermaidAPI)&&"function"==typeof e.mermaidAPI.initialize?e.mermaidAPI.initialize(o):void 0}}catch(t){}}(go),go):null})}();return c.value=!!e,e}catch(e){throw c.value=!1,e}})}"undefined"!=typeof window&&u(null,null,function*(){var e;try{const t=yield d();if(!t)return;null==(e=null==t?void 0:t.initialize)||e.call(t,{startOnLoad:!1,securityLevel:"loose"})}catch(t){c.value=!1,console.warn("[markstream-vue] Failed to initialize mermaid renderer. Call enableMermaid() to configure a loader.",t)}});const h=B(!1),m=B(!1),v=B(),g=B(),x=B(),b=B(),A=B(null),R=un(),z=B(null),P=B("undefined"==typeof window),F=B(),W=_(()=>r.node.code.replace(/\]::([^:])/g,"]:::$1").replace(/:::subgraphNode$/gm,"::subgraphNode")),K=B(1),X=B(0),Y=B(0),q=B(!1),Z=B({x:0,y:0}),Q=B(!1),ee=B(!1),te=B(!1),ne=B(null),oe=B(0),re=B(!1);let le=null;const ie=B("360px");let ae=null;const se=B(!1),ce=B(!1),ue=B({}),de=B(null),he=B(""),me=B(0);let ve=null;const pe=B(!1),fe=B({zoom:1,translateX:0,translateY:0,containerHeight:"360px"}),ge=_(()=>{var e,t,n,o;return{worker:null!=(e=r.workerTimeoutMs)?e:1400,parse:null!=(t=r.parseTimeoutMs)?t:1800,render:null!=(n=r.renderTimeoutMs)?n:2500,fullRender:null!=(o=r.fullRenderTimeoutMs)?o:4e3}}),we=null!=(n=globalThis.cancelIdleCallback)?n:e=>clearTimeout(e);let ye=null,ke=null,xe=!1,be=800,Me=null,_e=0,Be=!0;function Ce(e,t){const n=null==t?void 0:t.timeoutMs,o=null==t?void 0:t.signal;if(null==o?void 0:o.aborted)return Promise.reject(new DOMException("Aborted","AbortError"));let r=null,l=!1,i=null;return new Promise((t,a)=>{const s=()=>{null!=r&&clearTimeout(r),i&&o&&o.removeEventListener("abort",i)};n&&n>0&&(r=globalThis.setTimeout(()=>{l||(l=!0,s(),a(new Error("Operation timed out")))},n)),o&&(i=()=>{l||(l=!0,s(),a(new DOMException("Aborted","AbortError")))},o.addEventListener("abort",i)),e().then(e=>{l||(l=!0,s(),t(e))}).catch(e=>{l||(l=!0,s(),a(e))})})}function Te(e){if("undefined"==typeof document)return;if(!x.value)return;const t=document.createElement("div");t.className="text-red-500 p-4",t.textContent="Failed to render diagram: ";const n=document.createElement("span");n.textContent=e instanceof Error?e.message:"Unknown error",t.appendChild(n),x.value.innerHTML="",x.value.appendChild(t),ie.value="360px",pe.value=!0,rt()}function Ie(e){return!e||e.disabled}function Le(e,t,n="top"){if(Ie(e.currentTarget))return;const o=e,l=null!=(null==o?void 0:o.clientX)&&null!=(null==o?void 0:o.clientY)?{x:o.clientX,y:o.clientY}:void 0;on(e.currentTarget,t,n,!1,l,r.isDark)}function $e(){rn()}function Se(e){if(Ie(e.currentTarget))return;const t=h.value?i("common.copied")||"Copied":i("common.copy")||"Copy",n=e,o=null!=(null==n?void 0:n.clientX)&&null!=(null==n?void 0:n.clientY)?{x:n.clientX,y:n.clientY}:void 0;on(e.currentTarget,t,"top",!1,o,r.isDark)}function je(e,t){const n=`%%{init: {"theme": "${"dark"===t?"dark":"default"}"}}%%\n`;return e.trimStart().startsWith("%%{")?e:n+e}function Ee(){return Be&&!Q.value&&!se.value&&!pe.value}function He(e){const t=e.split(/\r?\n/);for(;t.length>0;){const e=t[t.length-1].trimEnd();if(""!==e){if(!(/^[-=~>|<\s]+$/.test(e.trim())||/(?:--|==|~~|->|<-|-\||-\)|-x|o-|\|-|\.-)\s*$/.test(e)||/[-|><]$/.test(e)||/(?:graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|gantt)\s*$/i.test(e)))break;t.pop()}else t.pop()}return t.join("\n")}function Ne(e,t,n){return u(this,null,function*(){var o;try{return yield Do(e,t,null!=(o=null==n?void 0:n.timeoutMs)?o:ge.value.worker)}catch(r){return yield function(e,t,n){return u(this,null,function*(){var o,r;const l=yield d();if(!l)return;const i=l,a=je(e,t);if("function"==typeof i.parse)return yield Ce(()=>i.parse(a),{timeoutMs:null!=(o=null==n?void 0:n.timeoutMs)?o:ge.value.parse,signal:null==n?void 0:n.signal}),!0;const s=`mermaid-parse-${Math.random().toString(36).slice(2,9)}`;return yield Ce(()=>l.render(s,a),{timeoutMs:null!=(r=null==n?void 0:n.timeoutMs)?r:ge.value.render,signal:null==n?void 0:n.signal}),!0})}(e,t,n)}})}"undefined"!=typeof window&&C(()=>v.value,e=>{var t;if(null==(t=z.value)||t.destroy(),z.value=null,!e)return void(P.value=!1);const n=R(e,{rootMargin:"400px"});z.value=n,P.value=n.isVisible.value,n.whenVisible.then(()=>{P.value=!0})},{immediate:!0}),I(()=>{var e;null==(e=z.value)||e.destroy(),z.value=null});const De=_(()=>Q.value||te.value||m.value);function Ae(e){if(!v.value||!x.value)return;const t=x.value.querySelector("svg");if(!t)return;let n=0,o=0;const r=t.getAttribute("viewBox"),l=t.getAttribute("width"),i=t.getAttribute("height");if(r){const e=r.split(" ");4===e.length&&(n=Number.parseFloat(e[2]),o=Number.parseFloat(e[3]))}if(n&&o||l&&i&&(n=Number.parseFloat(l),o=Number.parseFloat(i)),Number.isNaN(n)||Number.isNaN(o)||n<=0||o<=0)try{const e=t.getBBox();e&&e.width>0&&e.height>0&&(n=e.width,o=e.height)}catch(a){return void console.error("Failed to get SVG BBox:",a)}if(n>0&&o>0){const t=o/n;let r=(null!=e?e:v.value.clientWidth)*t;r>o&&(r=o),ie.value=`${r}px`}}const Re=B(!1),ze=_(()=>({transform:`translate(${X.value}px, ${Y.value}px) scale(${K.value})`}));function Pe(e){"Escape"===e.key&&Re.value&&Ve()}function Ve(){if(Re.value=!1,b.value&&(b.value.innerHTML=""),A.value=null,"undefined"!=typeof document)try{document.body.style.overflow=""}catch(e){}if("undefined"!=typeof window)try{window.removeEventListener("keydown",Pe)}catch(e){}}function Oe(){K.value<3&&(K.value+=.1)}function Fe(){K.value>.5&&(K.value-=.1)}function We(){K.value=1,X.value=0,Y.value=0}function Ke(e){q.value=!0,e instanceof MouseEvent?Z.value={x:e.clientX-X.value,y:e.clientY-Y.value}:Z.value={x:e.touches[0].clientX-X.value,y:e.touches[0].clientY-Y.value}}function Xe(e){if(!q.value)return;let t,n;e instanceof MouseEvent?(t=e.clientX,n=e.clientY):(t=e.touches[0].clientX,n=e.touches[0].clientY),X.value=t-Z.value.x,Y.value=n-Z.value.y}function Ye(){q.value=!1}function qe(e){if(e.ctrlKey||e.metaKey){if(e.preventDefault(),!v.value)return;const t=v.value.getBoundingClientRect(),n=e.clientX-t.left,o=e.clientY-t.top,r=n-t.width/2,l=o-t.height/2,i=(r-X.value)/K.value,a=(l-Y.value)/K.value,s=.01,c=-e.deltaY*s,u=Math.min(Math.max(K.value+c,.5),3);u!==K.value&&(X.value=r-i*u,Y.value=l-a*u,K.value=u)}}function Ze(){return u(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(W.value)),h.value=!0,l("copy",W.value),setTimeout(()=>{h.value=!1},1e3)}catch(e){console.error("Failed to copy:",e)}})}function Ue(){var e;const t=null==(e=x.value)?void 0:e.querySelector("svg");if(!t)return void console.error("SVG element not found");const n=(new XMLSerializer).serializeToString(t),o={payload:{type:"export"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:t,svgString:n};l("export",o),o.defaultPrevented||function(e,t=null){u(this,null,function*(){try{const o=null!=t?t:(new XMLSerializer).serializeToString(e),r=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),l=URL.createObjectURL(r);if("undefined"!=typeof document){const e=document.createElement("a");e.href=l,e.download=`mermaid-diagram-${Date.now()}.svg`;try{document.body.appendChild(e),e.click(),document.body.removeChild(e)}catch(n){}URL.revokeObjectURL(l)}}catch(o){console.error("Failed to export SVG:",o)}})}(t,n)}function Ge(){var e,t;const n=null!=(t=null==(e=x.value)?void 0:e.querySelector("svg"))?t:null,o=n?(new XMLSerializer).serializeToString(n):null,r={payload:{type:"open-modal"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:n,svgString:o};l("openModal",r),r.defaultPrevented||function(){if(Re.value=!0,"undefined"!=typeof document)try{document.body.style.overflow="hidden"}catch(e){}if("undefined"!=typeof window)try{window.addEventListener("keydown",Pe)}catch(e){}T(()=>{if(v.value&&b.value){const e=v.value.cloneNode(!0);e.classList.add("fullscreen");const t=e.querySelector("[data-mermaid-wrapper]");t&&(A.value=t,t.style.transform=ze.value.transform),b.value.innerHTML="",b.value.appendChild(e)}})}()}function Je(e){const t={payload:{type:"toggle-mode",target:e},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}};l("toggleMode",e,t),t.defaultPrevented||Qe(e)}function Qe(e){return u(this,null,function*(){const t=F.value;if(!t)return ee.value=!0,void(Q.value="source"===e);const n=t.getBoundingClientRect().height;t.style.height=`${n}px`,t.style.overflow="hidden",ee.value=!0,Q.value="source"===e,yield T();const o=t.scrollHeight;t.style.transition="height 180ms ease",t.offsetHeight,t.style.height=`${o}px`;const r=()=>{t.style.transition="",t.style.height="",t.style.overflow="",t.removeEventListener("transitionend",l)};function l(){r()}t.addEventListener("transitionend",l),setTimeout(()=>r(),220)})}function et(){return u(this,null,function*(){return te.value?ne.value:x.value||(yield T(),x.value)?(te.value=!0,ne.value=u(null,null,function*(){var e;x.value&&(x.value.style.opacity="0");try{const t=yield d();if(!t)return;const n=`mermaid-${Date.now()}-${Math.random().toString(36).substring(2,11)}`;se.value||ce.value||null==(e=t.initialize)||e.call(t,{securityLevel:"loose",startOnLoad:!1});const o=function(e){const t=W.value,n=`%%{init: {"theme": "${"dark"===e?"dark":"default"}"}}%%\n`;return t.trim().startsWith("%%{")?t:n+t}(r.isDark?"dark":"light"),l=yield Ce(()=>t.render(n,o),{timeoutMs:ge.value.fullRender}),i=null==l?void 0:l.svg,a=null==l?void 0:l.bindFunctions;if(x.value){x.value.innerHTML=i,null==a||a(x.value),se.value||ce.value||(Ae(),se.value=!0,fe.value={zoom:K.value,translateX:X.value,translateY:Y.value,containerHeight:ie.value});const e=r.isDark?"dark":"light";ue.value[e]=i,ce.value&&(ce.value=!1),pe.value=!1}}catch(t){console.error("Failed to render mermaid diagram:",t),!1===r.loading&&Te(t)}finally{yield T(),x.value&&(x.value.style.opacity="1"),te.value=!1,ne.value=null}}),ne.value):void console.warn("Mermaid container not ready")})}C(ze,e=>{Re.value&&A.value&&(A.value.style.transform=e.transform)},{immediate:!0});const tt=null!=(o=globalThis.requestIdleCallback)?o:(e,t)=>setTimeout(()=>e({didTimeout:!0}),16);function nt(){return u(this,null,function*(){var e,t;const n=Date.now(),o=++me.value;ve&&ve.abort(),ve=new AbortController;const l=ve.signal,i=r.isDark?"dark":"light",a=W.value,s=a.replace(/\s+/g,"");if(!a.trim())return x.value&&(x.value.innerHTML=""),de.value=null,he.value="",void(pe.value=!1);if(s===he.value)return;try{const c=yield function(e,t,n){return u(this,null,function*(){var o;try{if(yield Ne(e,t,n))return{fullOk:!0,prefixOk:!1}}catch(l){if("AbortError"===(null==l?void 0:l.name))throw l}let r=He(e);if(r&&r.trim()&&r!==e)try{try{const l=yield Ao(e,t,null!=(o=null==n?void 0:n.timeoutMs)?o:ge.value.worker);l&&l.trim()&&(r=l)}catch(l){}if(yield Ne(r,t,n))return{fullOk:!1,prefixOk:!0,prefix:r}}catch(l){if("AbortError"===(null==l?void 0:l.name))throw l}return{fullOk:!1,prefixOk:!1}})}(a,i,{signal:l,timeoutMs:ge.value.worker});if(c.fullOk)return yield et(),void(me.value===o&&(de.value=null!=(t=null==(e=x.value)?void 0:e.innerHTML)?t:null,he.value=s,pe.value=!1));const h=_e&&n<=_e;if(c.prefixOk&&c.prefix&&Ee()&&!h)return void(yield function(e){return u(this,null,function*(){if(Ee()&&(x.value||(yield T(),x.value))&&!te.value){te.value=!0;try{const t=yield d();if(!t)return;const n=`mermaid-partial-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,o=r.isDark?"dark":"light",l=He(e),i=je(l&&l.trim()?l:e,o);x.value&&(x.value.style.opacity="0");const a=yield Ce(()=>t.render(n,i),{timeoutMs:ge.value.render}),s=null==a?void 0:a.svg,c=null==a?void 0:a.bindFunctions;x.value&&s&&(x.value.innerHTML=s,null==c||c(x.value),Ae())}catch(t){}finally{yield T(),x.value&&(x.value.style.opacity="1"),te.value=!1}}})}(c.prefix))}catch(h){if("AbortError"===(null==h?void 0:h.name))return}if(me.value!==o)return;if(pe.value)return;const c=ue.value[i];c&&x.value&&(x.value.innerHTML=c)})}const ot=function(){let e=null;return(...t)=>{e&&clearTimeout(e),e=setTimeout(()=>(()=>{tt(()=>{nt()},{timeout:500})})(...t),300)}}();function rt(){xe&&(xe=!1,be=800,Be=!1,Me&&(Me.abort(),Me=null),ye&&(globalThis.clearTimeout(ye),ye=null),ke&&(we(ke),ke=null),_e=Date.now())}function lt(){if(rt(),ve){try{ve.abort()}catch(e){}ve=null}if(Me){try{Me.abort()}catch(e){}Me=null}Ro()}function it(e=800){xe&&(ye&&globalThis.clearTimeout(ye),ye=globalThis.setTimeout(()=>{ke=tt(()=>u(null,null,function*(){if(!xe)return;if(Q.value||se.value)return void rt();const e=r.isDark?"dark":"light",t=W.value;if(t.trim()){Me&&Me.abort(),Me=new AbortController;try{if((yield Ne(t,e,{signal:Me.signal,timeoutMs:ge.value.worker}))&&(yield et(),se.value))return void rt()}catch(n){}be=Math.min(Math.floor(1.5*be),4e3),it(be)}else it(be)}),{timeout:500})},e))}function at(){xe||Q.value||se.value||(xe=!0,_e=0,Be=!0,it(500))}C(()=>W.value,()=>{se.value=!1,ue.value={},ot(),!Q.value&&c.value&&at(),function(){if(!Q.value)return;if(!c.value)return;const e=W.value.length;e!==oe.value&&(re.value=!0,oe.value=e,le&&clearTimeout(le),le=setTimeout(()=>{re.value&&Q.value&&W.value.trim()&&(re.value=!1,Qe("preview"))},500))}()}),C(()=>r.isDark,()=>u(null,null,function*(){if(!se.value)return;if(pe.value)return;const e=r.isDark?"dark":"light";if(ue.value[e])return void(x.value&&(x.value.innerHTML=ue.value[e]));const t={zoom:K.value,translateX:X.value,translateY:Y.value,containerHeight:ie.value},n=1!==K.value||0!==X.value||0!==Y.value;ce.value=!0,n&&(K.value=1,X.value=0,Y.value=0,yield T()),yield et(),n&&(yield T(),K.value=t.zoom,X.value=t.translateX,Y.value=t.translateY,ie.value=t.containerHeight,fe.value=t)})),C(()=>Q.value,e=>u(null,null,function*(){if(e)rt(),se.value&&(fe.value={zoom:K.value,translateX:X.value,translateY:Y.value,containerHeight:ie.value});else{if(pe.value)return;const e=r.isDark?"dark":"light";if(se.value&&ue.value[e])return yield T(),x.value&&(x.value.innerHTML=ue.value[e]),K.value=fe.value.zoom,X.value=fe.value.translateX,Y.value=fe.value.translateY,void(ie.value=fe.value.containerHeight);if(yield T(),!c.value)return;yield nt(),at()}})),C(()=>r.loading,(e,t)=>u(null,null,function*(){if(!0===t&&!1===e){const e=W.value.trim();if(!e)return lt();const t=r.isDark?"dark":"light",o=e.replace(/\s+/g,"");if(se.value&&o===he.value)return yield T(),x.value&&!x.value.querySelector("svg")&&ue.value[t]&&(x.value.innerHTML=ue.value[t]),void lt();try{yield Ne(e,t,{timeoutMs:ge.value.worker}),yield et(),he.value=o,pe.value=!1,lt()}catch(n){lt(),Te(n)}}})),C(v,e=>{ae&&ae.disconnect(),!e||se.value||ce.value||(ae=new ResizeObserver(e=>{e&&e.length>0&&!se.value&&!ce.value&&po(()=>{Ae(e[0].contentRect.width)})}),ae.observe(e))},{immediate:!0}),U(()=>u(null,null,function*(){yield T(),ee.value||(Q.value=!c.value),P.value&&(ot(),oe.value=W.value.length)})),C(()=>c.value,e=>{ee.value||(Q.value=!e)}),C(()=>P.value,e=>{e&&(se.value||(ot(),oe.value=W.value.length),r.loading||se.value||ot())},{immediate:!1}),G(()=>{le&&clearTimeout(le),ae&&ae.disconnect(),ve&&(ve.abort(),ve=null),Ro(),rt()}),C(()=>m.value,e=>u(null,null,function*(){e?(rt(),ve&&ve.abort()):se.value||(yield T(),ot(),Q.value||at())}),{immediate:!1});const st=_(()=>r.isDark?"mermaid-action-btn p-2 text-xs rounded text-gray-400 hover:bg-gray-700 hover:text-gray-200":"mermaid-action-btn p-2 text-xs rounded text-gray-600 hover:bg-gray-200 hover:text-gray-700");return(e,t)=>(f(),p("div",{class:H(["my-4 rounded-lg border overflow-hidden shadow-sm",[r.isDark?"border-gray-700/30":"border-gray-200",{"is-rendering":r.loading}]])},[r.showHeader?(f(),p("div",{key:0,class:H(["mermaid-block-header flex justify-between items-center px-4 py-2.5 border-b",r.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"])},[e.$slots["header-left"]?(f(),p("div",zo,[O(e.$slots,"header-left",{},void 0,!0)])):(f(),p("div",Po,[k("img",{src:y("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%20width='16'%20height='16'%3e%3cpath%20fill='none'%20stroke='%23ca9ee6'%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M1.5%202.5c0%206%202.25%205.75%204%207%20.83.67%201.17%202%201%204h3c-.17-2%20.17-3.33%201-4%201.75-1.25%204-1%204-7C12%202.5%2010%203%208%207%206%203%204%202.5%201.5%202.5'%20/%3e%3c/svg%3e"),class:"w-4 h-4 my-0",alt:"Mermaid"},null,8,Vo),k("span",{class:H(["text-sm font-medium font-mono truncate",r.isDark?"text-gray-400":"text-gray-600"])},"Mermaid",2)])),e.$slots["header-center"]?(f(),p("div",Oo,[O(e.$slots,"header-center",{},void 0,!0)])):r.showModeToggle&&c.value?(f(),p("div",{key:3,class:H(["flex items-center space-x-1 rounded-md p-0.5",r.isDark?"bg-gray-700":"bg-gray-100"])},[k("button",{class:H(["px-2.5 py-1 text-xs rounded transition-colors",[Q.value?r.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700":r.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm"]]),onClick:t[0]||(t[0]=()=>Je("preview")),onMouseenter:t[1]||(t[1]=e=>Le(e,y(i)("common.preview")||"Preview")),onFocus:t[2]||(t[2]=e=>Le(e,y(i)("common.preview")||"Preview")),onMouseleave:$e,onBlur:$e},[k("div",Fo,[t[21]||(t[21]=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:"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)),k("span",null,M(y(i)("common.preview")||"Preview"),1)])],34),k("button",{class:H(["px-2.5 py-1 text-xs rounded transition-colors",[Q.value?r.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm":r.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700"]]),onClick:t[3]||(t[3]=()=>Je("source")),onMouseenter:t[4]||(t[4]=e=>Le(e,y(i)("common.source")||"Source")),onFocus:t[5]||(t[5]=e=>Le(e,y(i)("common.source")||"Source")),onMouseleave:$e,onBlur:$e},[k("div",Wo,[t[22]||(t[22]=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:"m16 18l6-6l-6-6M8 6l-6 6l6 6"})],-1)),k("span",null,M(y(i)("common.source")||"Source"),1)])],34)],2)):V("",!0),e.$slots["header-right"]?(f(),p("div",Ko,[O(e.$slots,"header-right",{},void 0,!0)])):(f(),p("div",Xo,[r.showCollapseButton?(f(),p("button",{key:0,class:H(st.value),"aria-pressed":m.value,onClick:t[6]||(t[6]=e=>m.value=!m.value),onMouseenter:t[7]||(t[7]=e=>Le(e,m.value?y(i)("common.expand")||"Expand":y(i)("common.collapse")||"Collapse")),onFocus:t[8]||(t[8]=e=>Le(e,m.value?y(i)("common.expand")||"Expand":y(i)("common.collapse")||"Collapse")),onMouseleave:$e,onBlur:$e},[(f(),p("svg",{style:N({rotate:m.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[23]||(t[23]=[k("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],42,Yo)):V("",!0),r.showCopyButton?(f(),p("button",{key:1,class:H(st.value),onClick:Ze,onMouseenter:t[9]||(t[9]=e=>Se(e)),onFocus:t[10]||(t[10]=e=>Se(e)),onMouseleave:$e,onBlur:$e},[h.value?(f(),p("svg",Zo,[...t[25]||(t[25]=[k("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(f(),p("svg",qo,[...t[24]||(t[24]=[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)])]))],34)):V("",!0),r.showExportButton&&c.value?(f(),p("button",{key:2,class:H(`${st.value} ${De.value?"opacity-50 cursor-not-allowed":""}`),disabled:De.value,onClick:Ue,onMouseenter:t[11]||(t[11]=e=>Le(e,y(i)("common.export")||"Export")),onFocus:t[12]||(t[12]=e=>Le(e,y(i)("common.export")||"Export")),onMouseleave:$e,onBlur:$e},[...t[26]||(t[26]=[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:"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),k("path",{d:"m7 10l5 5l5-5"})])],-1)])],42,Uo)):V("",!0),r.showFullscreenButton&&c.value?(f(),p("button",{key:3,class:H(`${st.value} ${De.value?"opacity-50 cursor-not-allowed":""}`),disabled:De.value,onClick:Ge,onMouseenter:t[13]||(t[13]=e=>Le(e,Re.value?y(i)("common.minimize")||"Minimize":y(i)("common.open")||"Open")),onFocus:t[14]||(t[14]=e=>Le(e,Re.value?y(i)("common.minimize")||"Minimize":y(i)("common.open")||"Open")),onMouseleave:$e,onBlur:$e},[Re.value?(f(),p("svg",Qo,[...t[28]||(t[28]=[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)])])):(f(),p("svg",Jo,[...t[27]||(t[27]=[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)])]))],42,Go)):V("",!0)]))],2)):V("",!0),E(k("div",{ref_key:"modeContainerRef",ref:F},[Q.value?(f(),p("div",{key:0,class:H(["p-4",r.isDark?"bg-gray-900":"bg-gray-50"])},[k("pre",{class:H(["text-sm font-mono whitespace-pre-wrap",r.isDark?"text-gray-300":"text-gray-700"])},M(W.value),3)],2)):(f(),p("div",er,[r.showZoomControls?(f(),p("div",tr,[k("div",nr,[k("button",{class:H(["p-2 text-xs rounded transition-colors",[r.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:Oe,onMouseenter:t[15]||(t[15]=e=>Le(e,y(i)("common.zoomIn")||"Zoom in")),onFocus:t[16]||(t[16]=e=>Le(e,y(i)("common.zoomIn")||"Zoom in")),onMouseleave:$e,onBlur:$e},[...t[29]||(t[29]=[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("circle",{cx:"11",cy:"11",r:"8"}),k("path",{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"})])],-1)])],34),k("button",{class:H(["p-2 text-xs rounded transition-colors",[r.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:Fe,onMouseenter:t[17]||(t[17]=e=>Le(e,y(i)("common.zoomOut")||"Zoom out")),onFocus:t[18]||(t[18]=e=>Le(e,y(i)("common.zoomOut")||"Zoom out")),onMouseleave:$e,onBlur:$e},[...t[30]||(t[30]=[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("circle",{cx:"11",cy:"11",r:"8"}),k("path",{d:"m21 21l-4.35-4.35M8 11h6"})])],-1)])],34),k("button",{class:H(["p-2 text-xs rounded transition-colors",[r.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:We,onMouseenter:t[19]||(t[19]=e=>Le(e,y(i)("common.resetZoom")||"Reset zoom")),onFocus:t[20]||(t[20]=e=>Le(e,y(i)("common.resetZoom")||"Reset zoom")),onMouseleave:$e,onBlur:$e},M(Math.round(100*K.value))+"% ",35)])])):V("",!0),k("div",{ref_key:"mermaidContainer",ref:v,class:H(["min-h-[360px] relative transition-all duration-100 overflow-hidden block",r.isDark?"bg-gray-900":"bg-gray-50"]),style:N({height:ie.value}),onWheel:qe,onMousedown:Ke,onMousemove:Xe,onMouseup:Ye,onMouseleave:Ye,onTouchstartPassive:Ke,onTouchmovePassive:Xe,onTouchendPassive:Ye},[k("div",{ref_key:"mermaidWrapper",ref:g,"data-mermaid-wrapper":"",class:H(["absolute inset-0 cursor-grab",{"cursor-grabbing":q.value}]),style:N(ze.value)},[k("div",{ref_key:"mermaidContent",ref:x,class:"_mermaid w-full text-center flex items-center justify-center min-h-full"},null,512)],6)],38),(f(),L($,{to:"body"},[w(S,{name:"mermaid-dialog",appear:""},{default:j(()=>[Re.value?(f(),p("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",onClick:J(Ve,["self"])},[k("div",{class:H(["dialog-panel relative w-full h-full max-w-full max-h-full rounded shadow-lg overflow-hidden",r.isDark?"bg-gray-900":"bg-white"])},[k("div",or,[k("button",{class:H(["p-2 text-xs rounded transition-colors",[r.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:Oe},[...t[31]||(t[31]=[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("circle",{cx:"11",cy:"11",r:"8"}),k("path",{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"})])],-1)])],2),k("button",{class:H(["p-2 text-xs rounded transition-colors",[r.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:Fe},[...t[32]||(t[32]=[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("circle",{cx:"11",cy:"11",r:"8"}),k("path",{d:"m21 21l-4.35-4.35M8 11h6"})])],-1)])],2),k("button",{class:H(["p-2 text-xs rounded transition-colors",[r.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:We},M(Math.round(100*K.value))+"% ",3),k("button",{class:H(["inline-flex items-center justify-center p-2 rounded transition-colors",[r.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:Ve},[...t[33]||(t[33]=[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:"M18 6L6 18M6 6l12 12"})],-1)])],2)]),k("div",{ref_key:"modalContent",ref:b,class:"w-full h-full flex items-center justify-center p-4 overflow-hidden",onWheel:qe,onMousedown:Ke,onMousemove:Xe,onMouseup:Ye,onMouseleave:Ye,onTouchstart:Ke,onTouchmove:Xe,onTouchend:Ye},null,544)],2)])):V("",!0)]),_:1})]))]))],512),[[D,!m.value]])],2))}}),[["__scopeId","data-v-32888c9e"]]);rr.install=e=>{e.component(rr.__name,rr)};const lr={dir:"auto",class:"paragraph-node"},ir=/* @__PURE__ */ne(/* @__PURE__ */v({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=fe(t.customId),o={inline_code:n.inline_code||Me,image:n.image||wn,link:n.link||Un,hardbreak:n.hardbreak||co,emphasis:n.emphasis||no,strong:n.strong||On,strikethrough:n.strikethrough||Wn,highlight:n.highlight||eo,insert:n.insert||Jn,subscript:n.subscript||Pn,superscript:n.superscript||An,emoji:n.emoji||he,checkbox:n.checkbox||ie,math_inline:n.math_inline||jn,checkbox_input:n.checkbox_input||ie,reference:n.reference||Hn,footnote_anchor:n.footnote_anchor||ro,footnote_reference:n.footnote_reference||xe},r=$n();return(n,l)=>(f(),p("p",lr,[(f(!0),p(x,null,b(e.node.children,(n,l)=>(f(),p(x,{key:`${e.indexKey||"paragraph"}-${l}`},["text"!==n.type?(f(),L(X(o[n.type]),{key:0,node:n,"index-key":`${e.indexKey}-${l}`,"custom-id":t.customId},null,8,["node","index-key","custom-id"])):(f(),p("span",{key:1,class:H([[y(r)&&n.center?"text-node-center":""],"whitespace-pre-wrap break-words text-node"])},M(n.content),3))],64))),128))]))}}),[["__scopeId","data-v-5edcac7a"]]);ir.install=e=>{e.component(ir.__name,ir)};const ar=["aria-busy","aria-label","data-language"],sr=["textContent"],cr=/* @__PURE__ */v({__name:"PreCodeNode",props:{node:{}},setup(e){const t=e,n=_(()=>{var e,n,o;const r=String(null!=(n=null==(e=t.node)?void 0:e.language)?n:"");return String(null!=(o=String(r).split(/\s+/g)[0])?o:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=_(()=>`language-${n.value}`),r=_(()=>{const e=n.value;return e?`Code block: ${e}`:"Code block"});return(t,l)=>(f(),p("pre",{class:H([o.value]),"aria-busy":!0===e.node.loading,"aria-label":r.value,"data-language":n.value,tabindex:"0"},[k("code",{translate:"no",textContent:M(e.node.code)},null,8,sr)],10,ar))}});cr.install=e=>{e.component(cr.__name,cr)};const ur={class:"table-node-wrapper"},dr=["aria-busy"],hr={class:"border-[var(--table-border,#cbd5e1)]"},mr={class:"border-b"},vr={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},pr=/* @__PURE__ */ne(/* @__PURE__ */v({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e,n=_(()=>{var e,n,o,r;return null!=(r=null==(o=null==(n=null==(e=t.node)?void 0:e.header)?void 0:n.cells)?void 0:o.length)?r:0}),o=_(()=>{const e=n.value||1,t=Math.floor(100/e);return Array.from({length:e}).map((n,o)=>o===e-1?100-t*(e-1)+"%":`${t}%`)}),r=_(()=>{var e;return null!=(e=t.node.loading)&&e}),l=_(()=>{var e;return null!=(e=t.node.rows)?e:[]});return(n,i)=>(f(),p("div",ur,[k("table",{class:H(["w-full my-8 text-sm table-fixed table-node",{"table-node--loading":r.value}]),"aria-busy":r.value},[k("colgroup",null,[(f(!0),p(x,null,b(o.value,(e,t)=>(f(),p("col",{key:`col-${t}`,style:N({width:e})},null,4))),128))]),k("thead",hr,[k("tr",mr,[(f(!0),p(x,null,b(e.node.header.cells,(e,o)=>(f(),p("th",{key:`header-${o}`,dir:"auto",class:H(["font-semibold p-[calc(4/7*1em)] overflow-x-auto",["right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"]])},[w(y(Mr),{nodes:e.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,onCopy:i[0]||(i[0]=e=>n.$emit("copy",e))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))])]),k("tbody",null,[(f(!0),p(x,null,b(l.value,(e,o)=>(f(),p("tr",{key:`row-${o}`,class:H(["border-[var(--table-border,#cbd5e1)]",[o<l.value.length-1?"border-b":""]])},[(f(!0),p(x,null,b(e.cells,(e,r)=>(f(),p("td",{key:`cell-${o}-${r}`,class:H(["p-[calc(4/7*1em)] overflow-x-auto",["right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"]]),dir:"auto"},[w(y(Mr),{nodes:e.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,onCopy:i[1]||(i[1]=e=>n.$emit("copy",e))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))],2))),128))])],10,dr),w(S,{name:"table-node-fade"},{default:j(()=>[r.value?(f(),p("div",vr,[O(n.$slots,"loading",{isLoading:r.value},()=>[i[2]||(i[2]=k("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),i[3]||(i[3]=k("span",{class:"sr-only"},"Loading",-1))],!0)])):V("",!0)]),_:3})]))}}),[["__scopeId","data-v-a874491c"]]);pr.install=e=>{e.component(pr.__name,pr)};const fr={class:"hr-node"},gr=/* @__PURE__ */ne({},[["render",function(e,t){return f(),p("hr",fr)}],["__scopeId","data-v-639cbad9"]]);gr.install=e=>{e.component(gr.__name,gr)};const wr={key:1,class:"html-block-node__placeholder"},yr=/* @__PURE__ */ne(/* @__PURE__ */v({__name:"HtmlBlockNode",props:{node:{}},setup(e){const t=e,n=_(()=>{const e=t.node.attrs;if(e){if(Array.isArray(e)){const t={};for(const n of e){if(!n||n.length<2)continue;const[e,o]=n;null!=e&&(t[String(e)]=null==o?"":String(o))}return t}return e}}),o=B(null),r=B("undefined"==typeof window),l=B(t.node.content),i=un(),a=B(null),s=!!t.node.loading;return"undefined"!=typeof window?(C(o,e=>{var n,o;if(null==(o=null==(n=a.value)?void 0:n.destroy)||o.call(n),a.value=null,!s)return r.value=!0,void(l.value=t.node.content);if(!e)return void(r.value=!1);const c=i(e,{rootMargin:"400px"});a.value=c,r.value=c.isVisible.value,c.whenVisible.then(()=>{r.value=!0})},{immediate:!0}),C(()=>t.node.content,e=>{s&&!r.value||(l.value=e)})):r.value=!0,I(()=>{var e,t;null==(t=null==(e=a.value)?void 0:e.destroy)||t.call(e),a.value=null}),(t,i)=>(f(),p("div",q({ref_key:"htmlRef",ref:o,class:"html-block-node"},n.value),[r.value?g([l.value],()=>(f(),p("div",{key:0,innerHTML:l.value},null,8,["innerHTML"])),i,0):(f(),p("div",wr,[O(t.$slots,"placeholder",{node:e.node},()=>[i[1]||(i[1]=k("span",{class:"html-block-node__placeholder-bar"},null,-1)),i[2]||(i[2]=k("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),i[3]||(i[3]=k("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))],16))}}),[["__scopeId","data-v-ed22b926"]]),kr={class:"unknown-node"},xr=/* @__PURE__ */v({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(f(),p("div",kr,M(e.node.raw),1))}),br=["data-node-index","data-node-type"],Mr=/* @__PURE__ */ne(/* @__PURE__ */v({__name:"NodeRenderer",props:{content:{},nodes:{},parseOptions:{},customMarkdownIt:{},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:t}){var n,o,r;const l=e,i=t,s=B(),c=B(!1!==l.viewportPriority),m=function(e,t){const n="undefined"!=typeof window&&"undefined"!=typeof document,o="boolean"==typeof t?B(t):t;let r=null;const l=/* @__PURE__ */new WeakMap,i=(t,i)=>{const a=B(!1);let s,c=!1;const u=new Promise(e=>{s=()=>{c||(c=!0,e())}}),d=()=>{try{null==r||r.unobserve(t)}catch(e){}l.delete(t)};if(!n||!o.value)return a.value=!0,s(),{isVisible:a,whenVisible:u,destroy:d};const h=function(){var t;if(r||!n)return r;if("undefined"==typeof IntersectionObserver)return null;const o=null!=(t=e())?t:null;return r=new IntersectionObserver(e=>{for(const n of e){const e=l.get(n.target);if(e&&(n.isIntersecting||n.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(t){}}null==r||r.unobserve(n.target),l.delete(n.target)}}},{root:o,rootMargin:"300px",threshold:0}),r}();return h?(l.set(t,{resolve:s,visible:a}),h.observe(t),{isVisible:a,whenVisible:u,destroy:d}):(a.value=!0,s(),{isVisible:a,whenVisible:u,destroy:d})};return P(cn,i),i}(()=>s.value,c),v=d(),g=_(()=>l.customMarkdownIt?l.customMarkdownIt(v):v),w=_(()=>{var e;if(null==(e=l.nodes)?void 0:e.length)return Q(l.nodes.slice());if(l.content){const e=h(l.content,g.value,l.parseOptions);return Q(e)}return[]}),y="undefined"!=typeof window,k=y&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):null,M=y&&"function"==typeof window.cancelAnimationFrame?window.cancelAnimationFrame.bind(window):null,T="undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(o=null==(n=globalThis.process)?void 0:n.env)?void 0:o.NODE_ENV),$=y&&"function"==typeof window.requestIdleCallback,E=_(()=>{var e;const t=Math.trunc(null!=(e=l.renderBatchSize)?e:80);return Number.isFinite(t)?Math.max(0,t):0}),H=_(()=>{var e;const t=Math.trunc(null!=(e=l.initialRenderBatchSize)?e:E.value);return Number.isFinite(t)?Math.max(0,t):E.value}),D=_(()=>!1!==l.batchRendering&&E.value>0&&y&&!T),A=B(0),R=B({key:l.indexKey,total:0}),z=B({batchSize:E.value,initial:H.value,delay:null!=(r=l.renderBatchDelay)?r:16,enabled:D.value}),O=F([]),W=B(Math.max(1,E.value||1)),Y=ee({}),Z=/* @__PURE__ */new Map,U=/* @__PURE__ */new Map,G=_(()=>!1!==l.deferNodesUntilVisible&&!1!==c.value),J=_(()=>{var e;return(null!=(e=l.maxLiveNodes)?e:0)>0}),te=_(()=>!!m&&(G.value||J.value)),ne=_(()=>{var e;return Math.max(1,null!=(e=l.maxLiveNodes)?e:320)}),re=_(()=>{var e;return Math.max(0,null!=(e=l.liveNodeBuffer)?e:60)}),le=B(0),ae=ee({start:0,end:0}),se=/* @__PURE__ */new Map,ce=_(()=>{if(!J.value)return w.value.length;const e=re.value,t=Math.max(ae.end+e,H.value),n=Math.min(w.value.length,t);return Math.max(A.value,n)});function de(e,t,n){return Math.min(Math.max(e,t),n)}const me=ee({}),ve=ee({total:0,count:0}),pe=_(()=>ve.count>0?Math.max(12,ve.total/ve.count):32);function ge(e,t){var n;if(e>=t)return 0;let o=0;for(let r=e;r<t;r++)o+=null!=(n=me[r])?n:pe.value;return o}const we=_(()=>{if(!J.value)return w.value.map((e,t)=>({node:e,index:t}));const e=w.value.length,t=de(ae.start,0,e),n=de(ae.end,t,e);return w.value.slice(t,n).map((e,n)=>({node:e,index:t+n}))}),ye=_(()=>J.value?ge(0,Math.min(ae.start,w.value.length)):0),ke=_(()=>{if(!J.value)return 0;const e=w.value.length;return ge(Math.min(ae.end,e),e)});function be(){const e=w.value.length,t=Math.min(e,A.value);return t<=0?(O.value=[],void _e(0)):t>=e?(O.value=w.value,void _e(t)):(O.value=w.value.slice(0,t),void _e(t))}function _e(e){if(Z.size)for(const[t,n]of Z)t>=e&&(n.destroy(),Z.delete(t),G.value&&delete Y[t],U.delete(t))}function Be(e,t){G.value&&(Y[e]=t),t&&(le.value=de(e,0,Math.max(0,w.value.length-1)))}function Ce(e){const t=Z.get(e);t&&(t.destroy(),Z.delete(e))}function Te(e,t){if(t?U.set(e,t):U.delete(e),!te.value||!m)return Ce(e),void(t?Be(e,!0):G.value&&delete Y[e]);if(e<H.value&&!J.value)return Ce(e),void Be(e,!0);if(!t)return Ce(e),void(G.value&&delete Y[e]);Ce(e);const n=m(t,{rootMargin:"400px"});n&&(Z.set(e,n),Be(e,n.isVisible.value),n.whenVisible.then(()=>{Be(e,!0)}).catch(()=>{}))}let Ie=null,Le=null,$e=!1,Se=null,je=null;function Ee(){y&&(null!=Ie&&(null==M||M(Ie),Ie=null),null!=Le&&(window.clearTimeout(Le),Le=null),null!=je&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback(je),je=null),$e=!1,Se=null)}function He(e,t={}){var n,o;if(!D.value)return;const r=ce.value;if(A.value>=r)return;const i=Math.max(1,e),a=e=>{var t;Ie=null,Le=null,je=null,$e=!1;const n=null!=Se?Se:i;Se=null;const o=Math.max(2,null!=(t=l.renderBatchBudgetMs)?t:6),a=e=>{const t="undefined"!=typeof performance?performance.now():Date.now();A.value=Math.min(r,A.value+Math.max(1,e)),be();const n=("undefined"!=typeof performance?performance.now():Date.now())-t;return function(e){var t;if(!D.value)return;const n=Math.max(2,null!=(t=l.renderBatchBudgetMs)?t:6),o=Math.max(1,E.value||1),r=Math.max(1,Math.floor(o/4));e>1.2*n?W.value=Math.max(r,Math.floor(.7*W.value)):e<.5*n&&W.value<o&&(W.value=Math.min(o,Math.ceil(1.2*W.value)))}(n),n};let s=n;for(;(a(s),!(A.value>=r)&&e)&&!(("function"==typeof e.timeRemaining?e.timeRemaining():0)<=.5*o);)s=Math.max(1,Math.round(W.value));A.value<r&&Ne()};if(!y||t.immediate)return void a();const s=Math.max(0,null!=(n=l.renderBatchDelay)?n:16);if(Se=null!=Se?Math.max(Se,i):i,!$e){if($e=!0,!T&&$&&window.requestIdleCallback){const e=Math.max(0,null!=(o=l.renderBatchIdleTimeoutMs)?o:120);return void(je=window.requestIdleCallback(e=>{a(e)},{timeout:e}))}k&&!T?Ie=k(()=>{0!==s?Le=window.setTimeout(()=>a(),s):a()}):Le=window.setTimeout(()=>a(),s)}}function Ne(){He(D.value?Math.max(1,Math.round(W.value)):Math.max(1,E.value))}C([()=>w.value,()=>w.value.length,()=>D.value,()=>E.value,()=>H.value,()=>l.renderBatchDelay,()=>l.indexKey],()=>{var e;const t=w.value.length,n=R.value,o=l.indexKey,r=void 0!==o?o!==n.key:t!==n.total;R.value={key:o,total:t};const i=z.value,a=null!=(e=l.renderBatchDelay)?e:16,s=i.batchSize!==E.value||i.initial!==H.value||i.delay!==a||i.enabled!==D.value;z.value={batchSize:E.value,initial:H.value,delay:a,enabled:D.value},(r||s||!D.value)&&Ee(),(r||s)&&(W.value=Math.max(1,E.value||1));const c=ce.value;if(!t)return A.value=0,void be();if(!D.value)return A.value=c,void be();A.value=r||s?Math.min(c,H.value):Math.min(A.value,c);const u=Math.max(1,H.value||E.value||t);A.value<c?He(u,{immediate:!y}):be()},{immediate:!0}),C(()=>G.value,e=>{if(e)for(const[t,n]of U)Te(t,n);else{for(const e of Z.values())e.destroy();Z.clear();for(const e of Object.keys(Y))delete Y[e];for(const[e,t]of U)t&&Be(e,!0)}},{immediate:!1}),C(()=>A.value,(e,t)=>{J.value&&("number"==typeof t&&e<=t||e>0&&(le.value=e-1))}),C([le,ne,re,()=>w.value.length,J],()=>{!function(){const e=w.value.length;if(!J.value||0===e)return ae.start=0,void(ae.end=e);const t=Math.min(ne.value,e),n=re.value,o=de(le.value-n,0,Math.max(0,e-t));ae.start=o,ae.end=Math.min(e,o+t)}()},{immediate:!0}),C(()=>ce.value,(e,t)=>{D.value&&("number"==typeof t&&e<=t||e>A.value&&Ne())}),I(()=>{Ee();for(const e of Z.values())e.destroy();Z.clear()});const De=K(()=>u(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),cr}})),Ae=_(()=>l.renderCodeBlocksAsPre?cr:De),Re={text:Sn,paragraph:ir,heading:ho,code_block:De,list:vo,blockquote:oe,table:pr,definition_list:ue,footnote:ao,footnote_reference:xe,footnote_anchor:ro,admonition:$r,hardbreak:co,link:Un,image:wn,thematic_break:gr,math_inline:jn,math_block:En,strong:On,emphasis:no,strikethrough:Wn,highlight:eo,insert:Jn,subscript:Pn,superscript:An,emoji:he,checkbox:ie,checkbox_input:ie,inline_code:Me,reference:Hn,html_block:yr};function ze(e){var t;if(!e)return xr;const n=fe(l.customId),o=n[String(e.type)];if("code_block"===e.type){if("mermaid"===String(null!=(t=e.language)?t:"").trim().toLowerCase())return n.mermaid||rr;if(o)return o;return n.code_block||Ae.value}return o||Re[String(e.type)]||xr}function Pe(e){var t;return"code_block"===(null==e?void 0:e.type)&&"mermaid"===String(null!=(t=e.language)?t:"").trim().toLowerCase()?{}:"code_block"===e.type?a({stream:l.codeBlockStream,darkTheme:l.codeBlockDarkTheme,lightTheme:l.codeBlockLightTheme,monacoOptions:l.codeBlockMonacoOptions,themes:l.themes,minWidth:l.codeBlockMinWidth,maxWidth:l.codeBlockMaxWidth},l.codeBlockProps||{}):{typewriter:l.typewriter}}function Ve(e){i("click",e)}function Oe(e){var t;(null==(t=e.target)?void 0:t.closest("[data-node-index]"))&&i("mouseover",e)}function Fe(e){var t;(null==(t=e.target)?void 0:t.closest("[data-node-index]"))&&i("mouseout",e)}return(t,n)=>(f(),p("div",{ref_key:"containerRef",ref:s,class:"markdown-renderer",onClick:Ve,onMouseover:Oe,onMouseout:Fe},[J.value?(f(),p("div",{key:0,class:"node-spacer",style:N({height:`${ye.value}px`}),"aria-hidden":"true"},null,4)):V("",!0),(f(!0),p(x,null,b(we.value,t=>{var o,r;return f(),p("div",{key:t.index,ref_for:!0,ref:e=>Te(t.index,e),class:"node-slot","data-node-index":t.index,"data-node-type":t.node.type},[(r=t.index,!G.value||r<H.value||!0===Y[r]?(f(),p("div",{key:0,ref_for:!0,ref:e=>function(e,t){t?(se.set(e,t),queueMicrotask(()=>{!function(e,t){if(!Number.isFinite(t)||t<=0)return;const n=me[e];me[e]=t,n?ve.total+=t-n:(ve.total+=t,ve.count++)}(e,t.offsetHeight)})):se.delete(e)}(t.index,e),class:"node-content"},["code_block"!==t.node.type&&!1!==l.typewriter?(f(),L(S,{key:0,name:"typewriter",appear:""},{default:j(()=>[(f(),L(X(ze(t.node)),q({node:t.node,loading:t.node.loading,"index-key":`${e.indexKey||"markdown-renderer"}-${t.index}`},{ref_for:!0},Pe(t.node),{"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)):(f(),L(X(ze(t.node)),q({key:1,node:t.node,loading:t.node.loading,"index-key":`${e.indexKey||"markdown-renderer"}-${t.index}`},{ref_for:!0},Pe(t.node),{"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"]))],512)):(f(),p("div",{key:1,class:"node-placeholder",style:N({height:`${null!=(o=me[t.index])?o:pe.value}px`})},null,4)))],8,br)}),128)),J.value?(f(),p("div",{key:1,class:"node-spacer",style:N({height:`${ke.value}px`}),"aria-hidden":"true"},null,4)):V("",!0)],544))}}),[["__scopeId","data-v-c1cf4dae"]]);Mr.install=e=>{var t,n;const o=null!=(n=null!=(t=Mr.__name)?t:Mr.name)?n:"NodeRenderer";e.component(o,Mr)};const _r={key:0,class:"admonition-icon"},Br={class:"admonition-title"},Cr=["aria-expanded","aria-controls","title"],Tr={key:0},Ir={key:1},Lr=["id"],$r=/* @__PURE__ */ne(/* @__PURE__ */v({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const o=e,r=t,l={note:"ℹ️",info:"ℹ️",tip:"💡",warning:"⚠️",danger:"❗",error:"⛔",caution:"⚠️"},i=_(()=>{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=B(!!o.node.collapsible&&!(null==(n=o.node.open)||n));function s(){o.node.collapsible&&(a.value=!a.value)}const c=`admonition-${Math.random().toString(36).slice(2,9)}`;return(t,n)=>(f(),p("div",{class:H(["admonition",[`admonition-${o.node.kind}`,o.isDark?"is-dark":""]])},[k("div",{id:c,class:"admonition-header"},[l[o.node.kind]?(f(),p("span",_r,M(l[o.node.kind]),1)):V("",!0),k("span",Br,M(i.value),1),o.node.collapsible?(f(),p("button",{key:1,class:"admonition-toggle","aria-expanded":!a.value,"aria-controls":`${c}-content`,title:a.value?"Expand":"Collapse",onClick:s},[a.value?(f(),p("span",Tr,"▶")):(f(),p("span",Ir,"▼"))],8,Cr)):V("",!0)]),E(k("div",{id:`${c}-content`,class:"admonition-content","aria-labelledby":c},[g([o.node.children],()=>w(y(Mr),{"index-key":`admonition-${e.indexKey}`,nodes:o.node.children,"custom-id":o.customId,typewriter:o.typewriter,onCopy:n[0]||(n[0]=e=>r("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"]),n,1)],8,Lr),[[D,!a.value]])],2))}}),[["__scopeId","data-v-5e95c2b7"]]);$r.install=e=>{e.component($r.__name,$r)};let Sr=!1,jr=null,Er=!1;function Hr(){return u(this,null,function*(){if(jr)return jr;if(Er)return null;try{return jr=yield import("stream-monaco"),yield function(e){return u(this,null,function*(){if(!Sr)return Sr=!0,e.preloadMonacoWorkers()})}(jr),jr}catch(e){return Er=!0,null}})}let Nr=null;function Dr(e){Nr=null!=e?e:null}function Ar(e){if(Nr){const t=Nr(e);if(null!=t&&""!==t)return t}switch(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":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 Rr={js:"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","":"Plain Text",plain:"Plain Text"},zr={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)"}},Pr={class:"flex items-center space-x-2"},Vr=["innerHTML"],Or={class:"text-sm font-medium font-mono"},Fr={class:"flex items-center space-x-2"},Wr=["aria-pressed"],Kr=["disabled"],Xr=["disabled"],Yr=["disabled"],qr=["aria-label"],Zr={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"},Ur={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"},Gr=["aria-pressed"],Jr={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"},Qr={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"},el=["aria-label"],tl={class:"code-loading-placeholder"},nl=/* @__PURE__ */ne(/* @__PURE__ */v({__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:t}){var n;const o=e,r=t,{t:l}=sn(),i=B(String(null!=(n=o.node.language)?n:"")),a=B(!1),s=B(!1),c=B(!1),d=B(null),h=B(!0),m=B(0),v=B(14),g=B(v.value),w=_(()=>{const e=v.value,t=g.value;return"number"==typeof e&&Number.isFinite(e)&&e>0&&"number"==typeof t&&Number.isFinite(t)&&t>0}),b=_(()=>{const e=i.value.trim().toLowerCase();return Rr[e]||e.charAt(0).toUpperCase()+e.slice(1)}),I=_(()=>"mermaid"===i.value.trim().toLowerCase()),$=_(()=>Ar(i.value.trim().toLowerCase().split(":")[0])),S=_(()=>{const e=i.value.trim().toLowerCase();return o.isShowPreview&&("html"===e||"svg"===e)}),j=_(()=>{const e={},t=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},n=t(o.minWidth),r=t(o.maxWidth);return n&&(e.minWidth=n),r&&(e.maxWidth=r),e}),A=_(()=>({fontSize:`${g.value}px`}));function R(){return o.isDark?o.darkTheme:o.lightTheme}let z,P,F,W=()=>{};function K(){return u(this,null,function*(){if(I.value)return W(),void(null==z||z.dispose());!function(){u(this,null,function*(){if(!P)try{const e=yield import("stream-markdown");if(P=e.createShikiStreamRenderer,F=e.registerHighlight,W=e.disposeHighlighter,F({themes:o.themes}),z=P(d.value,{theme:R()}),!o.loading){const e=i.value.split(":")[0].toLocaleLowerCase().trim();z.updateCode(o.node.code,e)}}catch(e){console.warn("[MarkdownCodeBlockNode] stream-markdown not available:",e)}})}()})}K(),U(()=>{K()}),C(()=>o.themes,()=>u(null,null,function*(){F&&F({themes:o.themes})})),C(()=>[o.node.code,o.node.language],e=>u(null,[e],function*([e,t]){if(t!==i.value&&(i.value=t.trim()),d.value){if(I.value)return W(),void(null==z||z.dispose());z||(yield K()),z&&e&&(!1===o.stream&&o.loading||(t=t.split(":")[0].toLocaleLowerCase().trim(),z.updateCode(e,t)))}}));const X=C(()=>[o.darkTheme,o.lightTheme],()=>u(null,null,function*(){if(d.value){if(I.value)return W(),null==z||z.dispose(),X();z||(yield K()),null==z||z.setTheme(R())}}));function Y(){const e=d.value;if(!e||s.value)return;const t=e.scrollTop;t<m.value?h.value=!1:function(e,t=50){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}(e)&&(h.value=!0),m.value=t}function q(){return u(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 Z(e){return!e||e.disabled}function G(e,t,n="top"){if(Z(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;on(e.currentTarget,t,n,!1,l,o.isDark)}function J(){rn()}function Q(e){if(Z(e.currentTarget))return;const t=a.value?l("common.copied")||"Copied":l("common.copy")||"Copy",n=e,r=null!=(null==n?void 0:n.clientX)&&null!=(null==n?void 0:n.clientY)?{x:n.clientX,y:n.clientY}:void 0;on(e.currentTarget,t,"top",!1,r,o.isDark)}function ee(){s.value=!s.value;const e=d.value;e&&(s.value?(e.style.maxHeight="none",e.style.overflow="visible"):(e.style.maxHeight="500px",e.style.overflow="auto",h.value=!0,T(()=>{e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})))}function te(){c.value=!c.value}function ne(){if(!S.value)return;const e=(i.value||o.node.language).toLowerCase(),t="html"===e?"HTML Preview":"SVG Preview";r("previewCode",{type:"html"===e?"text/html":"image/svg+xml",content:o.node.code,title:t})}return C(()=>o.node.code,()=>u(null,null,function*(){if(s.value||!h.value)return;yield T();const e=d.value;e&&e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})),(t,n)=>I.value?(f(),L(y(rr),{key:0,node:e.node,"is-dark":o.isDark,loading:o.loading},null,8,["node","is-dark","loading"])):(f(),p("div",{key:1,style:N(j.value),class:H(["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?(f(),p("div",zr,[O(t.$slots,"header-left",{},()=>[k("div",Pr,[k("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:$.value},null,8,Vr),k("span",Or,M(b.value),1)])],!0),O(t.$slots,"header-right",{},()=>[k("div",Fr,[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:te,onMouseenter:n[0]||(n[0]=e=>G(e,c.value?y(l)("common.expand")||"Expand":y(l)("common.collapse")||"Collapse")),onFocus:n[1]||(n[1]=e=>G(e,c.value?y(l)("common.expand")||"Expand":y(l)("common.collapse")||"Collapse")),onMouseleave:J,onBlur:J},[(f(),p("svg",{style:N({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"},[...n[17]||(n[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,Wr),o.showFontSizeButtons&&o.enableFontSizeControl?(f(),p(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(g.value)&&g.value<=10,onClick:n[2]||(n[2]=e=>function(){const e=Math.max(10,g.value-1);g.value=e}()),onMouseenter:n[3]||(n[3]=e=>G(e,y(l)("common.decrease")||"Decrease")),onFocus:n[4]||(n[4]=e=>G(e,y(l)("common.decrease")||"Decrease")),onMouseleave:J,onBlur:J},[...n[18]||(n[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,Kr),k("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!w.value||g.value===v.value,onClick:n[5]||(n[5]=e=>{g.value=v.value}),onMouseenter:n[6]||(n[6]=e=>G(e,y(l)("common.reset")||"Reset")),onFocus:n[7]||(n[7]=e=>G(e,y(l)("common.reset")||"Reset")),onMouseleave:J,onBlur:J},[...n[19]||(n[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,Xr),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(g.value)&&g.value>=36,onClick:n[8]||(n[8]=e=>function(){const e=Math.min(36,g.value+1);g.value=e}()),onMouseenter:n[9]||(n[9]=e=>G(e,y(l)("common.increase")||"Increase")),onFocus:n[10]||(n[10]=e=>G(e,y(l)("common.increase")||"Increase")),onMouseleave:J,onBlur:J},[...n[20]||(n[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,Yr)],64)):V("",!0),o.showCopyButton?(f(),p("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:q,onMouseenter:n[11]||(n[11]=e=>Q(e)),onFocus:n[12]||(n[12]=e=>Q(e)),onMouseleave:J,onBlur:J},[a.value?(f(),p("svg",Ur,[...n[22]||(n[22]=[k("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(f(),p("svg",Zr,[...n[21]||(n[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,qr)):V("",!0),o.showExpandButton?(f(),p("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:ee,onMouseenter:n[13]||(n[13]=e=>G(e,s.value?y(l)("common.collapse")||"Collapse":y(l)("common.expand")||"Expand")),onFocus:n[14]||(n[14]=e=>G(e,s.value?y(l)("common.collapse")||"Collapse":y(l)("common.expand")||"Expand")),onMouseleave:J,onBlur:J},[s.value?(f(),p("svg",Jr,[...n[23]||(n[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)])])):(f(),p("svg",Qr,[...n[24]||(n[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,Gr)):V("",!0),S.value&&o.showPreviewButton?(f(),p("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:ne,onMouseenter:n[15]||(n[15]=e=>G(e,y(l)("common.preview")||"Preview")),onFocus:n[16]||(n[16]=e=>G(e,y(l)("common.preview")||"Preview")),onMouseleave:J,onBlur:J},[...n[25]||(n[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,el)):V("",!0)])],!0)])):V("",!0),E(k("div",{ref_key:"codeBlockContent",ref:d,class:"code-block-content",style:N(A.value),onScroll:Y},null,36),[[D,!(c.value||!e.stream&&e.loading)]]),E(k("div",tl,[O(t.$slots,"loading",{loading:e.loading,stream:e.stream},()=>[n[26]||(n[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),[[D,!e.stream&&e.loading]])],6))}}),[["__scopeId","data-v-493dbba3"]]);nl.install=e=>{e.component(nl.__name,nl)};let ol=null,rl=null,ll=!1;const il=/* @__PURE__ */new Map,al=/* @__PURE__ */new Map;let sl=5;const cl=/* @__PURE__ */new Set;function ul(){if(il.size<sl&&cl.size){const t=Array.from(cl);cl.clear();for(const n of t)try{n()}catch(e){}}}function dl(e){ol=e,rl=null,ol.onmessage=e=>{const{id:t,html:n,error:o}=e.data,r=il.get(t);if(r)if(il.delete(t),clearTimeout(r.timeoutId),ul(),o)r.reject(new Error(o));else{const{content:t,displayMode:o}=e.data;if(t){const e=`${o?"d":"i"}:${t}`;if(al.set(e,n),al.size>200){const e=al.keys().next().value;al.delete(e)}}r.resolve(n)}},ol.onerror=e=>{console.error("[katexWorkerClient] Worker error:",e);for(const[t,n]of il.entries())clearTimeout(n.timeoutId),n.reject(new Error(`Worker error: ${e.message}`));il.clear(),ul()}}function hl(){var e;ol&&(null==(e=ol.terminate)||e.call(ol)),ol=null,rl=null}function ml(e){ll=!!e,ol&&ol.postMessage({type:"init",debug:ll})}function vl(e,t=!0,n=2e3,o){return u(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(rl)return Promise.reject(rl);const r=`${t?"d":"i"}:${e}`,l=al.get(r);if(l)return Promise.resolve(l);const i=ol||(rl=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),rl.name="WorkerInitError",rl.code="WORKER_INIT_ERROR",null);if(!i)return Promise.reject(rl);if(il.size>=sl){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code="WORKER_BUSY",e.busy=!0,e.inFlight=il.size,e.max=sl,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(()=>{il.delete(a);const e=new Error("Worker render timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT",l(e),ul()},n);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(s),il.has(a)&&il.delete(a);const e=new Error("Aborted");e.name="AbortError",l(e),ul()},{once:!0});const c=r,u=l;il.set(a,{resolve:e=>{c(e)},reject:e=>{u(e)},timeoutId:s}),i.postMessage({id:a,content:e,displayMode:t})})})}function pl(e,t=!0,n){const o=`${t?"d":"i"}:${e}`;if(al.set(o,n),al.size>200){const e=al.keys().next().value;al.delete(e)}}function fl(){return{inFlight:il.size,max:sl}}function gl(e){Number.isFinite(e)&&e>0&&(sl=Math.floor(e))}const wl="WORKER_BUSY";function yl(){return il.size>=sl}function kl(e=2e3,t){return il.size<sl?Promise.resolve():new Promise((n,o)=>{let r,l=!1;const i=()=>{l||(l=!0,r&&globalThis.clearTimeout(r),cl.delete(i),n())};if(cl.add(i),r=globalThis.setTimeout(()=>{if(l)return;l=!0,cl.delete(i);const e=new Error("Wait for worker slot timed out");e.name="WorkerBusyTimeout",e.code="WORKER_BUSY_TIMEOUT",o(e)},e),queueMicrotask(()=>ul()),t){const e=()=>{if(l)return;l=!0,r&&globalThis.clearTimeout(r),cl.delete(i);const e=new Error("Aborted");e.name="AbortError",o(e)};t.aborted?e():t.addEventListener("abort",e,{once:!0})}})}const xl={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function bl(e){null!=e.timeout&&(xl.timeout=Math.max(0,Math.floor(e.timeout))),null!=e.waitTimeout&&(xl.waitTimeout=Math.max(0,Math.floor(e.waitTimeout))),null!=e.backoffMs&&(xl.backoffMs=Math.max(0,Math.floor(e.backoffMs))),null!=e.maxRetries&&(xl.maxRetries=Math.max(0,Math.floor(e.maxRetries)))}function Ml(){return a({},xl)}function _l(e){return u(this,arguments,function*(e,t=!0,n={}){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=n.timeout)?o:xl.timeout,s=null!=(r=n.waitTimeout)?r:xl.waitTimeout,c=null!=(l=n.backoffMs)?l:xl.backoffMs,u=null!=(i=n.maxRetries)?i:xl.maxRetries,d=n.signal;let h=0;for(;;){if(null==d?void 0:d.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}try{return yield vl(e,t,a,d)}catch(m){if((null==m?void 0:m.code)!==wl||h>=u)throw m;if(h++,yield kl(s,d).catch(()=>{}),null==d?void 0:d.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}c>0&&(yield new Promise(e=>globalThis.setTimeout(e,c*h)))}}})}const Bl=K(()=>import("./index4.js")),Cl=K(()=>import("./index3.js")),Tl=K(()=>import("./index2.js")),Il={AdmonitionNode:$r,BlockquoteNode:oe,CheckboxNode:ie,CodeBlockNode:Bl,DefinitionListNode:ue,EmojiNode:he,FootnoteNode:ao,FootnoteReferenceNode:xe,FootnoteAnchorNode:ro,HardBreakNode:co,HeadingNode:ho,HighlightNode:eo,ImageNode:wn,InlineCodeNode:Me,PreCodeNode:cr,InsertNode:Jn,LinkNode:Un,ListItemNode:mo,ListNode:vo,MathBlockNode:Cl,MathInlineNode:Tl,MermaidBlockNode:rr,ParagraphNode:ir,StrikethroughNode:Wn,StrongNode:On,SubscriptNode:Pn,SuperscriptNode:An,TableNode:pr,TextNode:Sn,ThematicBreakNode:gr,ReferenceNode:Hn,MarkdownCodeBlockNode:nl},Ll={install(e,t){Object.entries(Il).forEach(([t,n])=>{e.component(t,n)}),(null==t?void 0:t.getLanguageIcon)&&Dr(t.getLanguageIcon),(null==t?void 0:t.mathOptions)&&m(t.mathOptions)}};export{On as $,$r as A,oe as B,ie as C,ue as D,he as E,ro as F,bo as G,co as H,wn as I,mo as J,vo as K,Un as L,nl as M,Mr as N,Cl as O,Tl as P,rr as Q,ir as R,Hn as S,ge as T,pe as U,an as V,wl as W,Mn as X,yo as Y,Wn as Z,ne as _,un as a,Pn as a0,An as a1,pr as a2,Sn as a3,gr as a4,Ll as a5,Dr as a6,dl as a7,hl as a8,ml as a9,vl as aa,fl as ab,gl as ac,yl as ad,kl as ae,bl as af,Ml as ag,Io as ah,Lo as ai,$o as aj,So as ak,jo as al,Eo as am,Ho as an,Do as ao,Ao as ap,Ro as aq,Ar as b,cr as c,on as d,Tn as e,pl as f,Hr as g,rn as h,we as i,Bl as j,Bn as k,Rr as l,xo as m,_n as n,ko as o,ao as p,xe as q,_l as r,po as s,fe as t,sn as u,ho as v,eo as w,Me as x,Jn as y,Cn as z};
|